hedgewars/uStats.pas
changeset 2143 ad05f6b2d1c0
parent 1723 430064bafa18
child 2619 bc2786a00fb8
equal deleted inserted replaced
2142:48ed98cfd119 2143:ad05f6b2d1c0
    41 var
    41 var
    42 	TotalRounds: LongInt = -1;
    42 	TotalRounds: LongInt = -1;
    43 	FinishedTurnsTotal: LongInt = -1;
    43 	FinishedTurnsTotal: LongInt = -1;
    44 
    44 
    45 implementation
    45 implementation
    46 uses uTeams, uSound, uMisc;
    46 uses uTeams, uSound, uMisc, uLocale, uWorld;
    47 var DamageGiven : Longword = 0;
    47 var DamageGiven : Longword = 0;
    48 	DamageClan  : Longword = 0;
    48 	DamageClan  : Longword = 0;
    49 	DamageTotal : Longword = 0;
    49 	DamageTotal : Longword = 0;
    50 	KillsClan   : LongWord = 0;
    50 	KillsClan   : LongWord = 0;
    51 	Kills       : LongWord = 0;
    51 	Kills       : LongWord = 0;
   104 
   104 
   105 	if (DamageGiven = DamageTotal) and (DamageTotal > 0) then
   105 	if (DamageGiven = DamageTotal) and (DamageTotal > 0) then
   106 		PlaySound(sndFirstBlood, false, CurrentTeam^.voicepack)
   106 		PlaySound(sndFirstBlood, false, CurrentTeam^.voicepack)
   107 
   107 
   108 	else if CurrentHedgehog^.stats.StepDamageRecv > 0 then
   108 	else if CurrentHedgehog^.stats.StepDamageRecv > 0 then
   109 		PlaySound(sndStupid, false, PreviousTeam^.voicepack)
   109 		begin
   110 
   110 		PlaySound(sndStupid, false, PreviousTeam^.voicepack);
       
   111 		if DamageGiven = CurrentHedgehog^.stats.StepDamageRecv then AddCaption(Format(GetEventString(eidHurtSelf), CurrentHedgehog^.Name), $FFFFFF, capgrpGameState);
       
   112 		end
   111 	else if DamageClan <> 0 then
   113 	else if DamageClan <> 0 then
   112 		if DamageTotal > DamageClan then
   114 		if DamageTotal > DamageClan then
   113 			if random(2) = 0 then
   115 			if random(2) = 0 then
   114 				PlaySound(sndNutter, false, CurrentTeam^.voicepack)
   116 				PlaySound(sndNutter, false, CurrentTeam^.voicepack)
   115 			else
   117 			else
   117 		else
   119 		else
   118 			if random(2) = 0 then
   120 			if random(2) = 0 then
   119 				PlaySound(sndSameTeam, false, vpHurtSameClan)
   121 				PlaySound(sndSameTeam, false, vpHurtSameClan)
   120 			else
   122 			else
   121 				PlaySound(sndTraitor, false, vpHurtSameClan)
   123 				PlaySound(sndTraitor, false, vpHurtSameClan)
   122 
       
   123 	else if DamageGiven <> 0 then
   124 	else if DamageGiven <> 0 then
   124 		if Kills > 0 then
   125 		if Kills > 0 then
   125 			PlaySound(sndEnemyDown, false, CurrentTeam^.voicepack)
   126 			PlaySound(sndEnemyDown, false, CurrentTeam^.voicepack)
   126 		else
   127 		else
   127 			PlaySound(sndRegret, false, vpHurtEnemy)
   128 			PlaySound(sndRegret, false, vpHurtEnemy)
   129 	else if AmmoDamagingUsed then
   130 	else if AmmoDamagingUsed then
   130 		PlaySound(sndMissed, false, PreviousTeam^.voicepack)
   131 		PlaySound(sndMissed, false, PreviousTeam^.voicepack)
   131 	else if (AmmoUsedCount > 0) and not isTurnSkipped then
   132 	else if (AmmoUsedCount > 0) and not isTurnSkipped then
   132 		// nothing ?
   133 		// nothing ?
   133 	else if isTurnSkipped then
   134 	else if isTurnSkipped then
   134 		PlaySound(sndBoring, false, PreviousTeam^.voicepack)
   135 		begin
       
   136 		PlaySound(sndBoring, false, PreviousTeam^.voicepack);
       
   137 		AddCaption(Format(GetEventString(eidTurnSkipped), CurrentHedgehog^.Name), $FFFFFF, capgrpGameState);
       
   138 		end
   135 	else
   139 	else
   136 		PlaySound(sndCoward, false, PreviousTeam^.voicepack);
   140 		PlaySound(sndCoward, false, PreviousTeam^.voicepack);
   137 	end;
   141 	end;
   138 
   142 
   139 
   143