hedgewars/uStats.pas
changeset 12295 4ce7cb441c75
parent 12181 29f1ea94488b
child 12296 e2b30aba00e1
equal deleted inserted replaced
12294:c20fbf96b853 12295:4ce7cb441c75
    69     else
    69     else
    70         begin
    70         begin
    71         vpHurtEnemy:= Gear^.Hedgehog^.Team^.voicepack;
    71         vpHurtEnemy:= Gear^.Hedgehog^.Team^.voicepack;
    72         inc(PoisonTurn)
    72         inc(PoisonTurn)
    73         end;
    73         end;
       
    74     Gear^.Hedgehog^.stats.StepPoisoned:= true;
    74     inc(PoisonTotal)
    75     inc(PoisonTotal)
    75 end;
    76 end;
    76 
    77 
    77 procedure HedgehogDamaged(Gear: PGear; Attacker: PHedgehog; Damage: Longword; killed: boolean);
    78 procedure HedgehogDamaged(Gear: PGear; Attacker: PHedgehog; Damage: Longword; killed: boolean);
    78 begin
    79 begin
   130 
   131 
   131     // First blood (first damage, poison or kill)
   132     // First blood (first damage, poison or kill)
   132     if ((DamageTotal > 0) or (KillsTotal > 0) or (PoisonTotal > 0)) and ((CurrentHedgehog^.stats.DamageGiven = DamageTotal) and (CurrentHedgehog^.stats.StepKills = KillsTotal) and (PoisonTotal = PoisonTurn + PoisonClan)) then
   133     if ((DamageTotal > 0) or (KillsTotal > 0) or (PoisonTotal > 0)) and ((CurrentHedgehog^.stats.DamageGiven = DamageTotal) and (CurrentHedgehog^.stats.StepKills = KillsTotal) and (PoisonTotal = PoisonTurn + PoisonClan)) then
   133         AddVoice(sndFirstBlood, CurrentTeam^.voicepack)
   134         AddVoice(sndFirstBlood, CurrentTeam^.voicepack)
   134 
   135 
   135     // Hog hurts itself only
   136     // Hog hurts or poisons itself
   136     else if CurrentHedgehog^.stats.StepDamageRecv > 0 then
   137     else if (CurrentHedgehog^.stats.StepDamageRecv > 0) or (CurrentHedgehog^.stats.StepPoisoned) then
   137         begin
   138         begin
   138         AddVoice(sndStupid, PreviousTeam^.voicepack);
   139         AddVoice(sndStupid, PreviousTeam^.voicepack);
   139         if CurrentHedgehog^.stats.DamageGiven = CurrentHedgehog^.stats.StepDamageRecv then
   140         if CurrentHedgehog^.stats.DamageGiven = CurrentHedgehog^.stats.StepDamageRecv then
   140             AddCaption(FormatA(GetEventString(eidHurtSelf), s), cWhiteColor, capgrpMessage);
   141             AddCaption(FormatA(GetEventString(eidHurtSelf), s), cWhiteColor, capgrpMessage);
   141         end
   142         end
   190                     MaxStepDamageGiven:= StepDamageGiven;
   191                     MaxStepDamageGiven:= StepDamageGiven;
   191                 if StepKills > MaxStepKills then
   192                 if StepKills > MaxStepKills then
   192                     MaxStepKills:= StepKills;
   193                     MaxStepKills:= StepKills;
   193                 StepKills:= 0;
   194                 StepKills:= 0;
   194                 StepDamageRecv:= 0;
   195                 StepDamageRecv:= 0;
   195                 StepDamageGiven:= 0
   196                 StepDamageGiven:= 0;
       
   197                 StepPoisoned:= false;
   196                 end;
   198                 end;
   197 
   199 
   198 if SendHealthStatsOn then
   200 if SendHealthStatsOn then
   199     for t:= 0 to Pred(ClansCount) do
   201     for t:= 0 to Pred(ClansCount) do
   200         with ClansArray[t]^ do
   202         with ClansArray[t]^ do