93 procedure HedgehogDamaged(Gear: PGear; Attacker: PHedgehog; Damage: Longword; killed: boolean); |
93 procedure HedgehogDamaged(Gear: PGear; Attacker: PHedgehog; Damage: Longword; killed: boolean); |
94 begin |
94 begin |
95 if Attacker^.Team^.Clan = Gear^.Hedgehog^.Team^.Clan then |
95 if Attacker^.Team^.Clan = Gear^.Hedgehog^.Team^.Clan then |
96 vpHurtSameClan:= CurrentHedgehog^.Team^.voicepack |
96 vpHurtSameClan:= CurrentHedgehog^.Team^.voicepack |
97 else |
97 else |
|
98 begin |
98 vpHurtEnemy:= Gear^.Hedgehog^.Team^.voicepack; |
99 vpHurtEnemy:= Gear^.Hedgehog^.Team^.voicepack; |
|
100 if (not killed) then |
|
101 begin |
|
102 // Check if attacker got revenge |
|
103 if (Attacker^.RevengeHog <> nil) and (Attacker^.RevengeHog = Gear^.Hedgehog) then |
|
104 begin |
|
105 Attacker^.stats.GotRevenge:= true; |
|
106 Attacker^.RevengeHog:= nil; |
|
107 end |
|
108 // If not, victim remembers their attacker to plan *their* revenge |
|
109 else |
|
110 Gear^.Hedgehog^.RevengeHog:= Attacker; |
|
111 end |
|
112 end; |
99 |
113 |
100 ////////////////////////// |
114 ////////////////////////// |
101 |
115 |
102 inc(Attacker^.stats.StepDamageGiven, Damage); |
116 inc(Attacker^.stats.StepDamageGiven, Damage); |
103 inc(Gear^.Hedgehog^.stats.StepDamageRecv, Damage); |
117 inc(Gear^.Hedgehog^.stats.StepDamageRecv, Damage); |
260 // 1 kill |
274 // 1 kill |
261 else if Kills = (killsCheck + 1) then |
275 else if Kills = (killsCheck + 1) then |
262 AddVoice(sndEnemyDown, CurrentTeam^.voicepack) |
276 AddVoice(sndEnemyDown, CurrentTeam^.voicepack) |
263 // 0 kills, only damage or poison |
277 // 0 kills, only damage or poison |
264 else |
278 else |
265 // TODO: Play sndExcellent for a high damage shot. |
279 if CurrentHedgehog^.stats.GotRevenge then |
266 // Not done yet because the fallback is sndEnemyDown. |
280 AddVoice(sndRevenge, CurrentHedgehog^.Team^.voicepack) |
267 if random(2) = 0 then |
|
268 AddVoice(sndRegret, vpHurtEnemy) |
|
269 else |
281 else |
270 AddVoice(sndGonnaGetYou, vpHurtEnemy) |
282 // TODO: Maybe play sndExcellent for a high damage shot. |
|
283 // Not done yet because the fallback is sndEnemyDown. |
|
284 if random(2) = 0 then |
|
285 AddVoice(sndRegret, vpHurtEnemy) |
|
286 else |
|
287 AddVoice(sndGonnaGetYou, vpHurtEnemy) |
271 |
288 |
272 // Missed shot |
289 // Missed shot |
273 // A miss is defined as a shot with a damaging weapon with 0 kills, 0 damage, 0 hogs poisoned and 0 targets hit |
290 // A miss is defined as a shot with a damaging weapon with 0 kills, 0 damage, 0 hogs poisoned and 0 targets hit |
274 else if AmmoDamagingUsed and (Kills <= killsCheck) and (PoisonTurn = 0) and (PoisonClan = 0) and (DamageTurn = 0) and (HitTargets = 0) then |
291 else if AmmoDamagingUsed and (Kills <= killsCheck) and (PoisonTurn = 0) and (PoisonClan = 0) and (DamageTurn = 0) and (HitTargets = 0) then |
275 // Chance to call hedgehog stupid or nutter if sacrificed for nothing |
292 // Chance to call hedgehog stupid or nutter if sacrificed for nothing |