hedgewars/uStats.pas
changeset 858 5005a485f103
parent 831 5cfd1096be5f
child 864 024369e09a53
equal deleted inserted replaced
857:43912f139db1 858:5005a485f103
    34 procedure HedgehogDamaged(Gear: PGear; Damage: Longword);
    34 procedure HedgehogDamaged(Gear: PGear; Damage: Longword);
    35 procedure TurnReaction;
    35 procedure TurnReaction;
    36 procedure SendStats;
    36 procedure SendStats;
    37 
    37 
    38 implementation
    38 implementation
    39 uses uTeams, uSound;
    39 uses uTeams, uSound, uMisc;
    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;
    43     AmmoUsedCount : Longword = 0;
    44     AmmoDamagingUsed : boolean = false;
    44     AmmoDamagingUsed : boolean = false;
    94 inc(AmmoUsedCount);
    94 inc(AmmoUsedCount);
    95 AmmoDamagingUsed:= AmmoDamagingUsed or Ammoz[am].isDamaging
    95 AmmoDamagingUsed:= AmmoDamagingUsed or Ammoz[am].isDamaging
    96 end;
    96 end;
    97 
    97 
    98 procedure SendStats;
    98 procedure SendStats;
    99 //var i, t: LongInt;
    99 var i, t: LongInt;
   100 //    msd: Longword; msdhh: PHedgehog;
   100     msd: Longword; msdhh: PHedgehog;
   101 begin
   101 begin
   102 (*msd:= 0; msdhh:= nil;
   102 msd:= 0; msdhh:= nil;
   103 for t:= 0 to Pred(TeamsCount) do
   103 for t:= 0 to Pred(TeamsCount) do
   104    with TeamsArray[t]^ do
   104    with TeamsArray[t]^ do
   105       begin
   105       begin
   106       for i:= 0 to cMaxHHIndex do
   106       for i:= 0 to cMaxHHIndex do
   107           if Hedgehogs[i].MaxStepDamage > msd then
   107           if Hedgehogs[i].stats.StepDamageGiven > msd then
   108              begin
   108              begin
   109              msdhh:= @Hedgehogs[i];
   109              msdhh:= @Hedgehogs[i];
   110              msd:= Hedgehogs[i].MaxStepDamage
   110              msd:= Hedgehogs[i].stats.StepDamageGiven
   111              end;
   111              end;
   112       end;
   112       end;
   113 if msdhh <> nil then SendStat(siMaxStepDamage, inttostr(msdhh^.MaxStepDamage) + ' ' +
   113 if msdhh <> nil then SendStat(siMaxStepDamage, inttostr(msd) + ' ' +
   114                                                msdhh^.Name + ' (' + msdhh^.Team^.TeamName + ')');
   114                                                msdhh^.Name + ' (' + msdhh^.Team^.TeamName + ')');
   115 if KilledHHs > 0 then SendStat(siKilledHHs, inttostr(KilledHHs));*)
   115 if KilledHHs > 0 then SendStat(siKilledHHs, inttostr(KilledHHs));
   116 end;
   116 end;
   117 
   117 
   118 end.
   118 end.