hedgewars/uStats.pas
changeset 830 f07267032194
parent 829 1209eb768acf
child 831 5cfd1096be5f
equal deleted inserted replaced
829:1209eb768acf 830:f07267032194
    38 implementation
    38 implementation
    39 uses uTeams, uSound;
    39 uses uTeams, uSound;
    40 var DamageGiven : Longword = 0;
    40 var DamageGiven : Longword = 0;
    41     DamageClan  : Longword = 0;
    41     DamageClan  : Longword = 0;
    42     DamageTotal : Longword = 0;
    42     DamageTotal : Longword = 0;
       
    43     AmmoUsedCount : Longword = 0;
       
    44     AmmoDamagingUsed : boolean = false;
    43 
    45 
    44 procedure HedgehogDamaged(Gear: PGear; Damage: Longword);
    46 procedure HedgehogDamaged(Gear: PGear; Damage: Longword);
    45 begin
    47 begin
    46 if Gear <> CurrentHedgehog^.Gear then
    48 if Gear <> CurrentHedgehog^.Gear then
    47    inc(CurrentHedgehog^.stats.StepDamageGiven, Damage);
    49    inc(CurrentHedgehog^.stats.StepDamageGiven, Damage);
    80       end;
    82       end;
    81   Gear:= Gear^.NextGear
    83   Gear:= Gear^.NextGear
    82   end;
    84   end;
    83 
    85 
    84 DamageGiven:= 0;
    86 DamageGiven:= 0;
    85 DamageClan:= 0
    87 DamageClan:= 0;
       
    88 AmmoUsedCount:= 0;
       
    89 AmmoDamagingUsed:= false
    86 end;
    90 end;
    87 
    91 
    88 procedure AmmoUsed(am: TAmmoType);
    92 procedure AmmoUsed(am: TAmmoType);
    89 begin
    93 begin
       
    94 inc(AmmoUsedCount);
       
    95 AmmoDamagingUsed:= AmmoDamagingUsed or Ammoz[am].isDamaging
    90 end;
    96 end;
    91 
    97 
    92 procedure SendStats;
    98 procedure SendStats;
    93 //var i, t: LongInt;
    99 //var i, t: LongInt;
    94 //    msd: Longword; msdhh: PHedgehog;
   100 //    msd: Longword; msdhh: PHedgehog;