--- a/hedgewars/uStats.pas Tue Apr 01 15:53:52 2008 +0000
+++ b/hedgewars/uStats.pas Tue Apr 01 15:57:51 2008 +0000
@@ -18,7 +18,7 @@
unit uStats;
interface
-uses uGears;
+uses uGears, uConsts;
type TStatistics = record
DamageRecv,
@@ -30,14 +30,16 @@
FinishedTurns: Longword;
end;
+procedure AmmoUsed(am: TAmmoType);
procedure HedgehogDamaged(Gear: PGear; Damage: Longword);
procedure TurnReaction;
procedure SendStats;
implementation
-uses uTeams, uSound, uConsts;
+uses uTeams, uSound;
var DamageGiven : Longword = 0;
DamageClan : Longword = 0;
+ DamageTotal : Longword = 0;
procedure HedgehogDamaged(Gear: PGear; Damage: Longword);
begin
@@ -48,7 +50,8 @@
inc(PHedgehog(Gear^.Hedgehog)^.stats.StepDamageRecv, Damage);
-inc(DamageGiven, Damage)
+inc(DamageGiven, Damage);
+inc(DamageTotal, Damage)
end;
procedure TurnReaction;
@@ -56,7 +59,8 @@
begin
inc(CurrentHedgehog^.stats.FinishedTurns);
-if CurrentHedgehog^.stats.StepDamageRecv > 0 then PlaySound(sndStupid, false)
+if (DamageGiven = DamageTotal) and (DamageTotal > 0) then PlaySound(sndFirstBlood, false)
+else if CurrentHedgehog^.stats.StepDamageRecv > 0 then PlaySound(sndStupid, false)
else if DamageClan <> 0 then
else if DamageGiven <> 0 then
else PlaySound(sndMissed, false);
@@ -81,6 +85,10 @@
DamageClan:= 0
end;
+procedure AmmoUsed(am: TAmmoType);
+begin
+end;
+
procedure SendStats;
//var i, t: LongInt;
// msd: Longword; msdhh: PHedgehog;