hedgewars/uStats.pas
changeset 10127 7f29a65aa1e4
parent 10116 dd27562b6f21
child 11046 47a8c19ecb60
equal deleted inserted replaced
10126:2fa3bb7785ee 10127:7f29a65aa1e4
    95 isTurnSkipped:= true
    95 isTurnSkipped:= true
    96 end;
    96 end;
    97 
    97 
    98 procedure TurnReaction;
    98 procedure TurnReaction;
    99 var i, t: LongInt;
    99 var i, t: LongInt;
       
   100     s: ansistring;
   100 begin
   101 begin
   101 TryDo(not bBetweenTurns, 'Engine bug: TurnReaction between turns', true);
   102 TryDo(not bBetweenTurns, 'Engine bug: TurnReaction between turns', true);
   102 
   103 
   103 inc(FinishedTurnsTotal);
   104 inc(FinishedTurnsTotal);
   104 if FinishedTurnsTotal <> 0 then
   105 if FinishedTurnsTotal <> 0 then
   105     begin
   106     begin
       
   107     s:= ansistring(CurrentHedgehog^.Name);
   106     inc(CurrentHedgehog^.stats.FinishedTurns);
   108     inc(CurrentHedgehog^.stats.FinishedTurns);
   107 
   109 
   108     if (CurrentHedgehog^.stats.DamageGiven = DamageTotal) and (DamageTotal > 0) then
   110     if (CurrentHedgehog^.stats.DamageGiven = DamageTotal) and (DamageTotal > 0) then
   109         AddVoice(sndFirstBlood, CurrentTeam^.voicepack)
   111         AddVoice(sndFirstBlood, CurrentTeam^.voicepack)
   110 
   112 
   111     else if CurrentHedgehog^.stats.StepDamageRecv > 0 then
   113     else if CurrentHedgehog^.stats.StepDamageRecv > 0 then
   112         begin
   114         begin
   113         AddVoice(sndStupid, PreviousTeam^.voicepack);
   115         AddVoice(sndStupid, PreviousTeam^.voicepack);
   114         if CurrentHedgehog^.stats.DamageGiven = CurrentHedgehog^.stats.StepDamageRecv then
   116         if CurrentHedgehog^.stats.DamageGiven = CurrentHedgehog^.stats.StepDamageRecv then
   115             AddCaption(Format(GetEventString(eidHurtSelf), CurrentHedgehog^.Name), cWhiteColor, capgrpMessage);
   117             AddCaption(FormatA(GetEventString(eidHurtSelf), s), cWhiteColor, capgrpMessage);
   116         end
   118         end
   117 
   119 
   118     else if DamageClan <> 0 then
   120     else if DamageClan <> 0 then
   119         if DamageTurn > DamageClan then
   121         if DamageTurn > DamageClan then
   120             if random(2) = 0 then
   122             if random(2) = 0 then
   138     else if (AmmoUsedCount > 0) and (not isTurnSkipped) then
   140     else if (AmmoUsedCount > 0) and (not isTurnSkipped) then
   139         begin end// nothing ?
   141         begin end// nothing ?
   140     else if isTurnSkipped then
   142     else if isTurnSkipped then
   141         begin
   143         begin
   142         AddVoice(sndBoring, PreviousTeam^.voicepack);
   144         AddVoice(sndBoring, PreviousTeam^.voicepack);
   143         AddCaption(Format(GetEventString(eidTurnSkipped), CurrentHedgehog^.Name), cWhiteColor, capgrpMessage);
   145         AddCaption(FormatA(GetEventString(eidTurnSkipped), s), cWhiteColor, capgrpMessage);
   144         end
   146         end
   145     else if not PlacingHogs then
   147     else if not PlacingHogs then
   146         AddVoice(sndCoward, PreviousTeam^.voicepack);
   148         AddVoice(sndCoward, PreviousTeam^.voicepack);
   147     end;
   149     end;
   148 
   150