Call hedgehogs stupid for poisoning themselves
authorWuzzy <almikes@aol.com>
Wed, 19 Apr 2017 22:10:12 +0200
changeset 12290 4ce7cb441c75
parent 12289 c20fbf96b853
child 12291 e2b30aba00e1
Call hedgehogs stupid for poisoning themselves
hedgewars/uStats.pas
hedgewars/uTypes.pas
--- a/hedgewars/uStats.pas	Wed Apr 19 22:03:11 2017 +0200
+++ b/hedgewars/uStats.pas	Wed Apr 19 22:10:12 2017 +0200
@@ -71,6 +71,7 @@
         vpHurtEnemy:= Gear^.Hedgehog^.Team^.voicepack;
         inc(PoisonTurn)
         end;
+    Gear^.Hedgehog^.stats.StepPoisoned:= true;
     inc(PoisonTotal)
 end;
 
@@ -132,8 +133,8 @@
     if ((DamageTotal > 0) or (KillsTotal > 0) or (PoisonTotal > 0)) and ((CurrentHedgehog^.stats.DamageGiven = DamageTotal) and (CurrentHedgehog^.stats.StepKills = KillsTotal) and (PoisonTotal = PoisonTurn + PoisonClan)) then
         AddVoice(sndFirstBlood, CurrentTeam^.voicepack)
 
-    // Hog hurts itself only
-    else if CurrentHedgehog^.stats.StepDamageRecv > 0 then
+    // Hog hurts or poisons itself
+    else if (CurrentHedgehog^.stats.StepDamageRecv > 0) or (CurrentHedgehog^.stats.StepPoisoned) then
         begin
         AddVoice(sndStupid, PreviousTeam^.voicepack);
         if CurrentHedgehog^.stats.DamageGiven = CurrentHedgehog^.stats.StepDamageRecv then
@@ -192,7 +193,8 @@
                     MaxStepKills:= StepKills;
                 StepKills:= 0;
                 StepDamageRecv:= 0;
-                StepDamageGiven:= 0
+                StepDamageGiven:= 0;
+                StepPoisoned:= false;
                 end;
 
 if SendHealthStatsOn then
--- a/hedgewars/uTypes.pas	Wed Apr 19 22:03:11 2017 +0200
+++ b/hedgewars/uTypes.pas	Wed Apr 19 22:10:12 2017 +0200
@@ -329,6 +329,7 @@
         StepDamageRecv,
         StepDamageGiven,
         StepKills: Longword;
+        StepPoisoned: boolean;
         MaxStepDamageRecv,
         MaxStepDamageGiven,
         MaxStepKills: Longword;