hedgewars/uStats.pas
changeset 1625 37aae47943ce
parent 1070 6371ecc10806
child 1669 b709e061577e
equal deleted inserted replaced
1624:3cbf01d31e5c 1625:37aae47943ce
    87 var i, t: LongInt;
    87 var i, t: LongInt;
    88 begin
    88 begin
    89 TryDo(not bBetweenTurns, 'Engine bug: TurnReaction between turns', true);
    89 TryDo(not bBetweenTurns, 'Engine bug: TurnReaction between turns', true);
    90 
    90 
    91 inc(FinishedTurnsTotal);
    91 inc(FinishedTurnsTotal);
    92 if FinishedTurnsTotal = 0 then exit;
    92 if FinishedTurnsTotal <> 0 then
    93 
    93 	begin
    94 inc(CurrentHedgehog^.stats.FinishedTurns);
    94 	inc(CurrentHedgehog^.stats.FinishedTurns);
    95 
    95 
    96 if (DamageGiven = DamageTotal) and (DamageTotal > 0) then
    96 	if (DamageGiven = DamageTotal) and (DamageTotal > 0) then
    97 	PlaySound(sndFirstBlood, false)
    97 		PlaySound(sndFirstBlood, false)
    98 
    98 
    99 else if CurrentHedgehog^.stats.StepDamageRecv > 0 then
    99 	else if CurrentHedgehog^.stats.StepDamageRecv > 0 then
   100 	PlaySound(sndStupid, false)
   100 		PlaySound(sndStupid, false)
   101 
   101 
   102 else if DamageClan <> 0 then
   102 	else if DamageClan <> 0 then
   103 	if DamageTotal > DamageClan then
   103 		if DamageTotal > DamageClan then
   104 		if random(2) = 0 then
   104 			if random(2) = 0 then
   105 			PlaySound(sndNutter, false)
   105 				PlaySound(sndNutter, false)
       
   106 			else
       
   107 				PlaySound(sndWatchIt, false)
   106 		else
   108 		else
   107 			PlaySound(sndWatchIt, false)
   109 			if random(2) = 0 then
       
   110 				PlaySound(sndSameTeam, false)
       
   111 			else
       
   112 				PlaySound(sndTraitor, false)
       
   113 
       
   114 	else if DamageGiven <> 0 then
       
   115 		if Kills > 0 then
       
   116 			PlaySound(sndEnemyDown, false)
       
   117 		else
       
   118 			PlaySound(sndRegret, false)
       
   119 
       
   120 	else if AmmoDamagingUsed then
       
   121 		PlaySound(sndMissed, false)
       
   122 	else if (AmmoUsedCount > 0) and not isTurnSkipped then
       
   123 		// nothing ?
       
   124 	else if isTurnSkipped then
       
   125 		PlaySound(sndBoring, false)
   108 	else
   126 	else
   109 		if random(2) = 0 then
   127 		PlaySound(sndCoward, false);
   110 			PlaySound(sndSameTeam, false)
   128 	end;
   111 		else
   129 
   112 			PlaySound(sndTraitor, false)
   130 
   113 
   131 for t:= 0 to Pred(TeamsCount) do // send even on zero turn
   114 else if DamageGiven <> 0 then
       
   115 	if Kills > 0 then
       
   116 		PlaySound(sndEnemyDown, false)
       
   117 	else
       
   118 		PlaySound(sndRegret, false)
       
   119 
       
   120 else if AmmoDamagingUsed then
       
   121 	PlaySound(sndMissed, false)
       
   122 else if (AmmoUsedCount > 0) and not isTurnSkipped then
       
   123 	// nothing ?
       
   124 else if isTurnSkipped then
       
   125 	PlaySound(sndBoring, false)
       
   126 else
       
   127 	PlaySound(sndCoward, false);
       
   128 
       
   129 
       
   130 for t:= 0 to Pred(TeamsCount) do
       
   131 	with TeamsArray[t]^ do
   132 	with TeamsArray[t]^ do
   132 		for i:= 0 to cMaxHHIndex do
   133 		for i:= 0 to cMaxHHIndex do
   133 			with Hedgehogs[i].stats do
   134 			with Hedgehogs[i].stats do
   134 				begin
   135 				begin
   135 				inc(DamageRecv, StepDamageRecv);
   136 				inc(DamageRecv, StepDamageRecv);
   139 				if StepKills > MaxStepKills then MaxStepKills:= StepKills;
   140 				if StepKills > MaxStepKills then MaxStepKills:= StepKills;
   140 				StepKills:= 0;
   141 				StepKills:= 0;
   141 				StepDamageRecv:= 0;
   142 				StepDamageRecv:= 0;
   142 				StepDamageGiven:= 0
   143 				StepDamageGiven:= 0
   143 				end;
   144 				end;
       
   145 
       
   146 for t:= 0 to Pred(ClansCount) do
       
   147 	with ClansArray[t]^ do
       
   148 		begin
       
   149 		SendStat(siClanHealth, inttostr(Color) + ' ' + inttostr(ClanHealth));
       
   150 		end;
   144 
   151 
   145 Kills:= 0;
   152 Kills:= 0;
   146 KillsClan:= 0;
   153 KillsClan:= 0;
   147 DamageGiven:= 0;
   154 DamageGiven:= 0;
   148 DamageClan:= 0;
   155 DamageClan:= 0;