hedgewars/uStats.pas
changeset 12348 6ff01dc1ffe2
parent 12337 657a8d63c99d
child 12364 81ab841a0da5
equal deleted inserted replaced
12347:ad09d733fdb0 12348:6ff01dc1ffe2
    99 
    99 
   100 if CurrentHedgehog^.Team^.Clan = Gear^.Hedgehog^.Team^.Clan then inc(DamageClan, Damage);
   100 if CurrentHedgehog^.Team^.Clan = Gear^.Hedgehog^.Team^.Clan then inc(DamageClan, Damage);
   101 
   101 
   102 if killed then
   102 if killed then
   103     begin
   103     begin
       
   104     Gear^.Hedgehog^.stats.StepDied:= true;
   104     inc(Attacker^.stats.StepKills);
   105     inc(Attacker^.stats.StepKills);
   105     inc(Kills);
   106     inc(Kills);
   106     inc(KillsTotal);
   107     inc(KillsTotal);
   107     inc(Attacker^.Team^.stats.Kills);
   108     inc(Attacker^.Team^.stats.Kills);
   108     if (Attacker^.Team^.TeamName = Gear^.Hedgehog^.Team^.TeamName) then
   109     if (Attacker^.Team^.TeamName = Gear^.Hedgehog^.Team^.TeamName) then
   142     if (CurrentHedgehog^.stats.Sacrificed) then
   143     if (CurrentHedgehog^.stats.Sacrificed) then
   143         killsCheck:= 1
   144         killsCheck:= 1
   144     else
   145     else
   145         killsCheck:= 0;
   146         killsCheck:= 0;
   146 
   147 
       
   148     system.writeln(inttostr(CurrentHedgehog^.stats.StepDamageRecv));
   147     // First blood (first damage, poison or kill)
   149     // First blood (first damage, poison or kill)
   148     if ((DamageTotal > 0) or (KillsTotal > 0) or (PoisonTotal > 0)) and ((CurrentHedgehog^.stats.DamageGiven = DamageTotal) and (CurrentHedgehog^.stats.StepKills = KillsTotal) and (PoisonTotal = PoisonTurn + PoisonClan)) then
   150     if ((DamageTotal > 0) or (KillsTotal > 0) or (PoisonTotal > 0)) and ((CurrentHedgehog^.stats.DamageGiven = DamageTotal) and (CurrentHedgehog^.stats.StepKills = KillsTotal) and (PoisonTotal = PoisonTurn + PoisonClan)) then
   149         AddVoice(sndFirstBlood, CurrentTeam^.voicepack)
   151         AddVoice(sndFirstBlood, CurrentTeam^.voicepack)
   150 
   152 
   151     // Hog hurts, poisons or kills itself (except sacrifice)
   153     // Hog hurts, poisons or kills itself (except sacrifice)
   152     else if (CurrentHedgehog^.stats.Sacrificed = false) and ((CurrentHedgehog^.stats.StepDamageRecv > 0) or (CurrentHedgehog^.stats.StepPoisoned) or (CurrentHedgehog^.Gear = nil)) then
   154     else if (CurrentHedgehog^.stats.Sacrificed = false) and ((CurrentHedgehog^.stats.StepDamageRecv > 0) or (CurrentHedgehog^.stats.StepPoisoned) or (CurrentHedgehog^.stats.StepDied)) then
   153         begin
   155         begin
   154         AddVoice(sndStupid, PreviousTeam^.voicepack);
   156         AddVoice(sndStupid, PreviousTeam^.voicepack);
   155         // Message for hurting itself only (not drowning)
   157         // Message for hurting itself only (not drowning)
   156         if (CurrentHedgehog^.stats.DamageGiven = CurrentHedgehog^.stats.StepDamageRecv) and (CurrentHedgehog^.stats.StepDamageRecv >= 1) then
   158         if (CurrentHedgehog^.stats.DamageGiven = CurrentHedgehog^.stats.StepDamageRecv) and (CurrentHedgehog^.stats.StepDamageRecv >= 1) then
   157             AddCaption(FormatA(GetEventString(eidHurtSelf), s), cWhiteColor, capgrpMessage);
   159             AddCaption(FormatA(GetEventString(eidHurtSelf), s), cWhiteColor, capgrpMessage);
   216                     MaxStepKills:= StepKills;
   218                     MaxStepKills:= StepKills;
   217                 StepKills:= 0;
   219                 StepKills:= 0;
   218                 StepDamageRecv:= 0;
   220                 StepDamageRecv:= 0;
   219                 StepDamageGiven:= 0;
   221                 StepDamageGiven:= 0;
   220                 StepPoisoned:= false;
   222                 StepPoisoned:= false;
       
   223                 StepDied:= false;
   221                 end;
   224                 end;
   222 
   225 
   223 if SendHealthStatsOn then
   226 if SendHealthStatsOn then
   224     for t:= 0 to Pred(ClansCount) do
   227     for t:= 0 to Pred(ClansCount) do
   225         with ClansArray[t]^ do
   228         with ClansArray[t]^ do