hedgewars/uStats.pas
changeset 8717 6e1ccd678e8a
parent 7932 ebe1d112e439
child 8833 c13ebed437cb
child 9080 9b42757d7e71
equal deleted inserted replaced
8716:e09633d10f16 8717:6e1ccd678e8a
    38 implementation
    38 implementation
    39 uses uSound, uLocale, uVariables, uUtils, uIO, uCaptions, uDebug, uMisc, uConsole;
    39 uses uSound, uLocale, uVariables, uUtils, uIO, uCaptions, uDebug, uMisc, uConsole;
    40 
    40 
    41 var DamageClan  : Longword = 0;
    41 var DamageClan  : Longword = 0;
    42     DamageTotal : Longword = 0;
    42     DamageTotal : Longword = 0;
       
    43     DamageTurn  : Longword = 0;
    43     KillsClan   : LongWord = 0;
    44     KillsClan   : LongWord = 0;
    44     Kills       : LongWord = 0;
    45     Kills       : LongWord = 0;
    45     KillsTotal  : LongWord = 0;
    46     KillsTotal  : LongWord = 0;
    46     AmmoUsedCount : Longword = 0;
    47     AmmoUsedCount : Longword = 0;
    47     AmmoDamagingUsed : boolean = false;
    48     AmmoDamagingUsed : boolean = false;
    80         inc(Attacker^.Team^.stats.Suicides);
    81         inc(Attacker^.Team^.stats.Suicides);
    81     if Attacker^.Team^.Clan = Gear^.Hedgehog^.Team^.Clan then
    82     if Attacker^.Team^.Clan = Gear^.Hedgehog^.Team^.Clan then
    82         inc(KillsClan);
    83         inc(KillsClan);
    83     end;
    84     end;
    84 
    85 
    85 inc(DamageTotal, Damage)
    86 inc(DamageTotal, Damage);
       
    87 inc(DamageTurn, Damage)
    86 end;
    88 end;
    87 
    89 
    88 procedure Skipped;
    90 procedure Skipped;
    89 begin
    91 begin
    90 inc(SkippedTurns);
    92 inc(SkippedTurns);
   110         if CurrentHedgehog^.stats.DamageGiven = CurrentHedgehog^.stats.StepDamageRecv then 
   112         if CurrentHedgehog^.stats.DamageGiven = CurrentHedgehog^.stats.StepDamageRecv then 
   111             AddCaption(Format(GetEventString(eidHurtSelf), CurrentHedgehog^.Name), cWhiteColor, capgrpMessage);
   113             AddCaption(Format(GetEventString(eidHurtSelf), CurrentHedgehog^.Name), cWhiteColor, capgrpMessage);
   112         end
   114         end
   113 
   115 
   114     else if DamageClan <> 0 then
   116     else if DamageClan <> 0 then
   115         if DamageTotal > DamageClan then
   117         if DamageTurn > DamageClan then
   116             if random(2) = 0 then
   118             if random(2) = 0 then
   117                 AddVoice(sndNutter, CurrentTeam^.voicepack)
   119                 AddVoice(sndNutter, CurrentTeam^.voicepack)
   118             else
   120             else
   119                 AddVoice(sndWatchIt, vpHurtSameClan)
   121                 AddVoice(sndWatchIt, vpHurtSameClan)
   120         else
   122         else
   168         end;
   170         end;
   169 
   171 
   170 Kills:= 0;
   172 Kills:= 0;
   171 KillsClan:= 0;
   173 KillsClan:= 0;
   172 DamageClan:= 0;
   174 DamageClan:= 0;
       
   175 DamageTurn:= 0;
   173 AmmoUsedCount:= 0;
   176 AmmoUsedCount:= 0;
   174 AmmoDamagingUsed:= false;
   177 AmmoDamagingUsed:= false;
   175 isTurnSkipped:= false
   178 isTurnSkipped:= false
   176 end;
   179 end;
   177 
   180