- Add statistics info for ammo used in step and whether it is damaging ammo
authorunc0rr
Tue, 01 Apr 2008 16:05:19 +0000
changeset 830 f07267032194
parent 829 1209eb768acf
child 831 5cfd1096be5f
- Add statistics info for ammo used in step and whether it is damaging ammo - This info isn't used yet
hedgewars/uConsts.pas
hedgewars/uStats.pas
--- a/hedgewars/uConsts.pas	Tue Apr 01 15:57:51 2008 +0000
+++ b/hedgewars/uConsts.pas	Tue Apr 01 16:05:19 2008 +0000
@@ -395,6 +395,7 @@
                                   Slot: 0..cMaxSlotIndex;
                                   TimeAfterTurn: Longword;
                                   minAngle, maxAngle: Longword;
+                                  isDamaging: boolean;
                                   PosCount: Longword;
                                   PosSprite: TSprite;
                                   end = (
@@ -412,6 +413,7 @@
                                    TimeAfterTurn: 3000;
                                    minAngle: 0;
                                    maxAngle: 0;
+                                   isDamaging: true;
                                    PosCount: 1;
                                    PosSprite: sprWater),
                                   (NameId: sidClusterBomb;
@@ -428,6 +430,7 @@
                                    TimeAfterTurn: 3000;
                                    minAngle: 0;
                                    maxAngle: 0;
+                                   isDamaging: true;
                                    PosCount: 1;
                                    PosSprite: sprWater),
                                   (NameId: sidBazooka;
@@ -443,6 +446,7 @@
                                    TimeAfterTurn: 3000;
                                    minAngle: 0;
                                    maxAngle: 0;
+                                   isDamaging: true;
                                    PosCount: 1;
                                    PosSprite: sprWater),
                                   (NameId: sidUFO;
@@ -460,6 +464,7 @@
                                    TimeAfterTurn: 3000;
                                    minAngle: 0;
                                    maxAngle: 0;
+                                   isDamaging: true;
                                    PosCount: 1;
                                    PosSprite: sprWater),
                                   (NameId: sidShotgun;
@@ -475,6 +480,7 @@
                                    TimeAfterTurn: 3000;
                                    minAngle: 0;
                                    maxAngle: 0;
+                                   isDamaging: true;
                                    PosCount: 1;
                                    PosSprite: sprWater),
                                   (NameId: sidPickHammer;
@@ -493,6 +499,7 @@
                                    TimeAfterTurn: 0;
                                    minAngle: 0;
                                    maxAngle: 0;
+                                   isDamaging: false;
                                    PosCount: 1;
                                    PosSprite: sprWater),
                                   (NameId: sidSkip;
@@ -508,6 +515,7 @@
                                    TimeAfterTurn: 0;
                                    minAngle: 0;
                                    maxAngle: 0;
+                                   isDamaging: false;
                                    PosCount: 1;
                                    PosSprite: sprWater),
                                   (NameId: sidRope;
@@ -525,6 +533,7 @@
                                    TimeAfterTurn: 0;
                                    minAngle: 0;
                                    maxAngle: cMaxAngle div 2;
+                                   isDamaging: false;
                                    PosCount: 1;
                                    PosSprite: sprWater),
                                   (NameId: sidMine;
@@ -541,6 +550,7 @@
                                    TimeAfterTurn: 5000;
                                    minAngle: 0;
                                    maxAngle: 0;
+                                   isDamaging: true;
                                    PosCount: 1;
                                    PosSprite: sprWater),
                                   (NameId: sidDEagle;
@@ -556,6 +566,7 @@
                                    TimeAfterTurn: 3000;
                                    minAngle: 0;
                                    maxAngle: 0;
+                                   isDamaging: true;
                                    PosCount: 1;
                                    PosSprite: sprWater),
                                   (NameId: sidDynamite;
@@ -573,6 +584,7 @@
                                    TimeAfterTurn: 5000;
                                    minAngle: 0;
                                    maxAngle: 0;
+                                   isDamaging: true;
                                    PosCount: 1;
                                    PosSprite: sprWater),
                                   (NameId: sidFirePunch;
@@ -590,6 +602,7 @@
                                    TimeAfterTurn: 3000;
                                    MinAngle: 0;
                                    maxAngle: 0;
+                                   isDamaging: true;
                                    PosCount: 1;
                                    PosSprite: sprWater),
                                   (NameId: sidBaseballBat;
@@ -605,6 +618,7 @@
                                    TimeAfterTurn: 5000;
                                    minAngle: 0;
                                    maxAngle: cMaxAngle div 2;
+                                   isDamaging: true;
                                    PosCount: 1;
                                    PosSprite: sprWater),
                                   (NameId: sidParachute;
@@ -623,6 +637,7 @@
                                    TimeAfterTurn: 0;
                                    minAngle: 0;
                                    maxAngle: 0;
+                                   isDamaging: false;
                                    PosCount: 1;
                                    PosSprite: sprWater),
                                   (NameId: sidAirAttack;
@@ -641,6 +656,7 @@
                                    TimeAfterTurn: 0;
                                    minAngle: 0;
                                    maxAngle: 0;
+                                   isDamaging: true;
                                    PosCount: 2;
                                    PosSprite: sprAmAirplane),
                                   (NameId: sidMineStrike;
@@ -659,6 +675,7 @@
                                    TimeAfterTurn: 0;
                                    minAngle: 0;
                                    maxAngle: 0;
+                                   isDamaging: true;
                                    PosCount: 2;
                                    PosSprite: sprAmAirplane),
                                   (NameId: sidBlowTorch;
@@ -674,6 +691,7 @@
                                    TimeAfterTurn: 3000;
                                    minAngle: 768;
                                    maxAngle: 1280;
+                                   isDamaging: false;
                                    PosCount: 1;
                                    PosSprite: sprWater),
                                   (NameId: sidGirder;
@@ -692,6 +710,7 @@
                                    TimeAfterTurn: 3000;
                                    minAngle: 0;
                                    maxAngle: 0;
+                                   isDamaging: false;
                                    PosCount: 8;
                                    PosSprite: sprAmGirder),
                                   (NameId: sidTeleport;
@@ -711,6 +730,7 @@
                                    TimeAfterTurn: 0;
                                    minAngle: 0;
                                    maxAngle: 0;
+                                   isDamaging: false;
                                    PosCount: 1;
                                    PosSprite: sprWater),
                                   (NameId: sidSwitch;
@@ -728,6 +748,7 @@
                                    TimeAfterTurn: 0;
                                    minAngle: 0;
                                    maxAngle: 0;
+                                   isDamaging: false;
                                    PosCount: 1;
                                    PosSprite: sprWater));
 
--- a/hedgewars/uStats.pas	Tue Apr 01 15:57:51 2008 +0000
+++ b/hedgewars/uStats.pas	Tue Apr 01 16:05:19 2008 +0000
@@ -40,6 +40,8 @@
 var DamageGiven : Longword = 0;
     DamageClan  : Longword = 0;
     DamageTotal : Longword = 0;
+    AmmoUsedCount : Longword = 0;
+    AmmoDamagingUsed : boolean = false;
 
 procedure HedgehogDamaged(Gear: PGear; Damage: Longword);
 begin
@@ -82,11 +84,15 @@
   end;
 
 DamageGiven:= 0;
-DamageClan:= 0
+DamageClan:= 0;
+AmmoUsedCount:= 0;
+AmmoDamagingUsed:= false
 end;
 
 procedure AmmoUsed(am: TAmmoType);
 begin
+inc(AmmoUsedCount);
+AmmoDamagingUsed:= AmmoDamagingUsed or Ammoz[am].isDamaging
 end;
 
 procedure SendStats;