hedgewars/uStats.pas
changeset 14595 fa908241798f
parent 14545 adf3e7d94db0
child 14596 1c7439c50f4d
equal deleted inserted replaced
14594:825fe522f4f1 14595:fa908241798f
    23 uses uConsts, uTypes;
    23 uses uConsts, uTypes;
    24 
    24 
    25 var TotalRoundsPre: LongInt; // Helper variable for calculating start of Sudden Death and more. Starts at -1 and is incremented on the turn BEFORE the turn which marks the start of the next round. Always -1 while in hog placing phase
    25 var TotalRoundsPre: LongInt; // Helper variable for calculating start of Sudden Death and more. Starts at -1 and is incremented on the turn BEFORE the turn which marks the start of the next round. Always -1 while in hog placing phase
    26     TotalRoundsReal: LongInt; // Total number of rounds played (-1 if not started or in hog placing phase). Exported to Lua as 'TotalRounds'
    26     TotalRoundsReal: LongInt; // Total number of rounds played (-1 if not started or in hog placing phase). Exported to Lua as 'TotalRounds'
    27     FinishedTurnsTotal: LongInt;
    27     FinishedTurnsTotal: LongInt;
       
    28     // Variables to disable certain portions of game stats (set by Lua)
    28     SendGameResultOn : boolean = true;
    29     SendGameResultOn : boolean = true;
    29     SendRankingStatsOn : boolean = true;
    30     SendRankingStatsOn : boolean = true;
    30     SendAchievementsStatsOn : boolean = true;
    31     SendAchievementsStatsOn : boolean = true;
    31     SendHealthStatsOn : boolean = true;
    32     SendHealthStatsOn : boolean = true;
       
    33     // Clan death log, used for game stats
    32     ClanDeathLog : PClanDeathLogEntry;
    34     ClanDeathLog : PClanDeathLogEntry;
    33 
    35 
    34 procedure initModule;
    36 procedure initModule;
    35 procedure freeModule;
    37 procedure freeModule;
    36 
    38 
    50 procedure dumpPoint(x, y: LongInt);
    52 procedure dumpPoint(x, y: LongInt);
    51 
    53 
    52 implementation
    54 implementation
    53 uses uSound, uLocale, uVariables, uUtils, uIO, uCaptions, uMisc, uConsole, uScript;
    55 uses uSound, uLocale, uVariables, uUtils, uIO, uCaptions, uMisc, uConsole, uScript;
    54 
    56 
    55 var DamageClan  : Longword = 0;
    57 var DamageClan  : Longword = 0;         // Damage of own clan in turn
    56     DamageTeam  : Longword = 0;
    58     DamageTeam  : Longword = 0;         // Damage of own team tin turn
    57     DamageTotal : Longword = 0;
    59     DamageTotal : Longword = 0;         // Total damage dealt in game
    58     DamageTurn  : Longword = 0;
    60     DamageTurn  : Longword = 0;         // Damage in turn
    59     PoisonTurn  : Longword = 0; // Poisoned enemies per turn
    61     PoisonTurn  : Longword = 0;         // Poisoned enemies in turn
    60     PoisonClan  : Longword = 0; // Poisoned own clan members in turn
    62     PoisonClan  : Longword = 0;         // Poisoned own clan members in turn
    61     PoisonTeam  : Longword = 0; // Poisoned own team members in turn
    63     PoisonTeam  : Longword = 0;         // Poisoned own team members in turn
    62     PoisonTotal : Longword = 0; // Poisoned hogs in whole round
    64     PoisonTotal : Longword = 0;         // Poisoned hogs in whole round
    63     KillsClan   : LongWord = 0;
    65     KillsClan   : LongWord = 0;         // Own clan members killed in turn
    64     KillsTeam   : LongWord = 0;
    66     KillsTeam   : LongWord = 0;         // Own team members killed in turn
    65     Kills       : LongWord = 0;
    67     Kills       : LongWord = 0;         // Killed hedgehogs in turn
    66     KillsTotal  : LongWord = 0;
    68     KillsTotal  : LongWord = 0;         // Total killed hedgehogs in game
    67     HitTargets  : LongWord = 0; // Target (gtTarget) hits per turn
    69     HitTargets  : LongWord = 0;         // Target (gtTarget) hits in turn
    68     AmmoUsedCount : Longword = 0;
    70     AmmoUsedCount : Longword = 0;       // Number of times an ammo has been used this turn
    69     AmmoDamagingUsed : boolean = false;
    71     AmmoDamagingUsed : boolean = false; // true if damaging ammo was used in turn
    70     FirstBlood  : boolean = false;
    72     FirstBlood  : boolean = false;      // true if the “First blood” taunt has been used in this game
    71     LeaveMeAlone : boolean = false;
    73     LeaveMeAlone : boolean = false;     // true if the “Leave me alone” taunt is to be used this turn
    72     SkippedTurns: LongWord = 0;
    74     SkippedTurns: LongWord = 0;         // number of skipped turns in game
    73     isTurnSkipped: boolean = false;
    75     isTurnSkipped: boolean = false;     // true if this turn was skipped
    74     vpHurtSameClan: PVoicepack = nil;
    76     vpHurtSameClan: PVoicepack = nil;   // voicepack of current clan (used for taunts)
    75     vpHurtEnemy: PVoicepack = nil;
    77     vpHurtEnemy: PVoicepack = nil;      // voicepack of enemy (used for taunts)
    76 
    78 
    77 procedure HedgehogPoisoned(Gear: PGear; Attacker: PHedgehog);
    79 procedure HedgehogPoisoned(Gear: PGear; Attacker: PHedgehog);
    78 begin
    80 begin
    79     if Attacker^.Team^.Clan = Gear^.Hedgehog^.Team^.Clan then
    81     if Attacker^.Team^.Clan = Gear^.Hedgehog^.Team^.Clan then
    80         begin
    82         begin