hedgewars/uStats.pas
changeset 12157 e837912ba85d
parent 12095 e1bca1ebbad9
child 12176 29f1ea94488b
equal deleted inserted replaced
12156:9755922396f5 12157:e837912ba85d
   107 if FinishedTurnsTotal <> 0 then
   107 if FinishedTurnsTotal <> 0 then
   108     begin
   108     begin
   109     s:= ansistring(CurrentHedgehog^.Name);
   109     s:= ansistring(CurrentHedgehog^.Name);
   110     inc(CurrentHedgehog^.stats.FinishedTurns);
   110     inc(CurrentHedgehog^.stats.FinishedTurns);
   111 
   111 
   112     if (CurrentHedgehog^.stats.DamageGiven = DamageTotal) and (DamageTotal > 0) then
   112     // First blood (first damage or kill)
       
   113     if ((DamageTotal > 0) or (KillsTotal > 0)) and ((CurrentHedgehog^.stats.DamageGiven = DamageTotal) and (CurrentHedgehog^.stats.StepKills = KillsTotal)) then
   113         AddVoice(sndFirstBlood, CurrentTeam^.voicepack)
   114         AddVoice(sndFirstBlood, CurrentTeam^.voicepack)
   114 
   115 
       
   116     // Hog hurts itself only
   115     else if CurrentHedgehog^.stats.StepDamageRecv > 0 then
   117     else if CurrentHedgehog^.stats.StepDamageRecv > 0 then
   116         begin
   118         begin
   117         AddVoice(sndStupid, PreviousTeam^.voicepack);
   119         AddVoice(sndStupid, PreviousTeam^.voicepack);
   118         if CurrentHedgehog^.stats.DamageGiven = CurrentHedgehog^.stats.StepDamageRecv then
   120         if CurrentHedgehog^.stats.DamageGiven = CurrentHedgehog^.stats.StepDamageRecv then
   119             AddCaption(FormatA(GetEventString(eidHurtSelf), s), cWhiteColor, capgrpMessage);
   121             AddCaption(FormatA(GetEventString(eidHurtSelf), s), cWhiteColor, capgrpMessage);
   120         end
   122         end
   121 
   123 
   122     else if DamageClan <> 0 then
   124     // Hog hurts own team/clan
   123         if DamageTurn > DamageClan then
   125     else if (DamageClan <> 0) or (KillsClan <> 0) then
       
   126         if (DamageTurn > DamageClan) or (Kills > KillsClan) then
   124             if random(2) = 0 then
   127             if random(2) = 0 then
   125                 AddVoice(sndNutter, CurrentTeam^.voicepack)
   128                 AddVoice(sndNutter, CurrentTeam^.voicepack)
   126             else
   129             else
   127                 AddVoice(sndWatchIt, vpHurtSameClan)
   130                 AddVoice(sndWatchIt, vpHurtSameClan)
   128         else
   131         else
   129             if random(2) = 0 then
   132             if random(2) = 0 then
   130                 AddVoice(sndSameTeam, vpHurtSameClan)
   133                 AddVoice(sndSameTeam, vpHurtSameClan)
   131             else
   134             else
   132                 AddVoice(sndTraitor, vpHurtSameClan)
   135                 AddVoice(sndTraitor, vpHurtSameClan)
   133 
   136 
   134     else if CurrentHedgehog^.stats.StepDamageGiven <> 0 then
   137     // Hog hurts or kills enemy
       
   138     else if (CurrentHedgehog^.stats.StepDamageGiven <> 0) or (CurrentHedgehog^.stats.StepKills <> 0) then
   135         if Kills > 0 then
   139         if Kills > 0 then
   136             AddVoice(sndEnemyDown, CurrentTeam^.voicepack)
   140             AddVoice(sndEnemyDown, CurrentTeam^.voicepack)
   137         else
   141         else
   138             AddVoice(sndRegret, vpHurtEnemy)
   142             AddVoice(sndRegret, vpHurtEnemy)
   139 
   143 
   140     else if AmmoDamagingUsed then
   144     // Missed shot
       
   145     else if AmmoDamagingUsed and (Kills = 0) then
   141         AddVoice(sndMissed, PreviousTeam^.voicepack)
   146         AddVoice(sndMissed, PreviousTeam^.voicepack)
       
   147 
       
   148     // Timeout
   142     else if (AmmoUsedCount > 0) and (not isTurnSkipped) then
   149     else if (AmmoUsedCount > 0) and (not isTurnSkipped) then
   143         begin end// nothing ?
   150         begin end// nothing ?
       
   151 
       
   152     // Turn skipped
   144     else if isTurnSkipped and (not PlacingHogs) then
   153     else if isTurnSkipped and (not PlacingHogs) then
   145         begin
   154         begin
   146         AddVoice(sndCoward, PreviousTeam^.voicepack);
   155         AddVoice(sndCoward, PreviousTeam^.voicepack);
   147         AddCaption(FormatA(GetEventString(eidTurnSkipped), s), cWhiteColor, capgrpMessage);
   156         AddCaption(FormatA(GetEventString(eidTurnSkipped), s), cWhiteColor, capgrpMessage);
   148         end
   157         end