hedgewars/uStats.pas
changeset 5638 e35ba2a400d8
parent 5203 b77f28facca6
child 6014 b432c4b9cc9b
equal deleted inserted replaced
5636:c18aed7ad618 5638:e35ba2a400d8
    97 if FinishedTurnsTotal <> 0 then
    97 if FinishedTurnsTotal <> 0 then
    98     begin
    98     begin
    99     inc(CurrentHedgehog^.stats.FinishedTurns);
    99     inc(CurrentHedgehog^.stats.FinishedTurns);
   100 
   100 
   101     if (CurrentHedgehog^.stats.DamageGiven = DamageTotal) and (DamageTotal > 0) then
   101     if (CurrentHedgehog^.stats.DamageGiven = DamageTotal) and (DamageTotal > 0) then
   102         PlaySound(sndFirstBlood, CurrentTeam^.voicepack)
   102         AddVoice(sndFirstBlood, CurrentTeam^.voicepack)
   103 
   103 
   104     else if CurrentHedgehog^.stats.StepDamageRecv > 0 then
   104     else if CurrentHedgehog^.stats.StepDamageRecv > 0 then
   105         begin
   105         begin
   106         PlaySound(sndStupid, PreviousTeam^.voicepack);
   106         AddVoice(sndStupid, PreviousTeam^.voicepack);
   107         if CurrentHedgehog^.stats.DamageGiven = CurrentHedgehog^.stats.StepDamageRecv then 
   107         if CurrentHedgehog^.stats.DamageGiven = CurrentHedgehog^.stats.StepDamageRecv then 
   108             AddCaption(Format(GetEventString(eidHurtSelf), CurrentHedgehog^.Name), cWhiteColor, capgrpMessage);
   108             AddCaption(Format(GetEventString(eidHurtSelf), CurrentHedgehog^.Name), cWhiteColor, capgrpMessage);
   109         end
   109         end
   110 
   110 
   111     else if DamageClan <> 0 then
   111     else if DamageClan <> 0 then
   112         if DamageTotal > DamageClan then
   112         if DamageTotal > DamageClan then
   113             if random(2) = 0 then
   113             if random(2) = 0 then
   114                 PlaySound(sndNutter, CurrentTeam^.voicepack)
   114                 AddVoice(sndNutter, CurrentTeam^.voicepack)
   115             else
   115             else
   116                 PlaySound(sndWatchIt, vpHurtSameClan)
   116                 AddVoice(sndWatchIt, vpHurtSameClan)
   117         else
   117         else
   118             if random(2) = 0 then
   118             if random(2) = 0 then
   119                 PlaySound(sndSameTeam, vpHurtSameClan)
   119                 AddVoice(sndSameTeam, vpHurtSameClan)
   120             else
   120             else
   121                 PlaySound(sndTraitor, vpHurtSameClan)
   121                 AddVoice(sndTraitor, vpHurtSameClan)
   122 
   122 
   123     else if CurrentHedgehog^.stats.StepDamageGiven <> 0 then
   123     else if CurrentHedgehog^.stats.StepDamageGiven <> 0 then
   124         if Kills > 0 then
   124         if Kills > 0 then
   125             PlaySound(sndEnemyDown, CurrentTeam^.voicepack)
   125             AddVoice(sndEnemyDown, CurrentTeam^.voicepack)
   126         else
   126         else
   127             PlaySound(sndRegret, vpHurtEnemy)
   127             AddVoice(sndRegret, vpHurtEnemy)
   128 
   128 
   129     else if AmmoDamagingUsed then
   129     else if AmmoDamagingUsed then
   130         PlaySound(sndMissed, PreviousTeam^.voicepack)
   130         AddVoice(sndMissed, PreviousTeam^.voicepack)
   131     else if (AmmoUsedCount > 0) and not isTurnSkipped then
   131     else if (AmmoUsedCount > 0) and not isTurnSkipped then
   132         // nothing ?
   132         // nothing ?
   133     else if isTurnSkipped then
   133     else if isTurnSkipped then
   134         begin
   134         begin
   135         PlaySound(sndBoring, PreviousTeam^.voicepack);
   135         AddVoice(sndBoring, PreviousTeam^.voicepack);
   136         AddCaption(Format(GetEventString(eidTurnSkipped), CurrentHedgehog^.Name), cWhiteColor, capgrpMessage);
   136         AddCaption(Format(GetEventString(eidTurnSkipped), CurrentHedgehog^.Name), cWhiteColor, capgrpMessage);
   137         end
   137         end
   138     else if not PlacingHogs then
   138     else if not PlacingHogs then
   139         PlaySound(sndCoward, PreviousTeam^.voicepack);
   139         AddVoice(sndCoward, PreviousTeam^.voicepack);
   140     end;
   140     end;
   141 
   141 
   142 
   142 
   143 for t:= 0 to Pred(TeamsCount) do // send even on zero turn
   143 for t:= 0 to Pred(TeamsCount) do // send even on zero turn
   144     with TeamsArray[t]^ do
   144     with TeamsArray[t]^ do