hedgewars/uTeams.pas
changeset 783 4f59db6f147d
parent 764 7513452b1d51
child 800 e95f16b7ec80
equal deleted inserted replaced
782:e2d2b84aa776 783:4f59db6f147d
    85 procedure InitTeams;
    85 procedure InitTeams;
    86 function  TeamSize(p: PTeam): Longword;
    86 function  TeamSize(p: PTeam): Longword;
    87 procedure RecountTeamHealth(team: PTeam);
    87 procedure RecountTeamHealth(team: PTeam);
    88 procedure RestoreTeamsFromSave;
    88 procedure RestoreTeamsFromSave;
    89 function CheckForWin: boolean;
    89 function CheckForWin: boolean;
    90 procedure SetWeapon(weap: TAmmoType);
       
    91 procedure SendStats;
    90 procedure SendStats;
    92 
    91 
    93 implementation
    92 implementation
    94 uses uMisc, uWorld, uAI, uLocale, uConsole, uAmmos;
    93 uses uMisc, uWorld, uAI, uLocale, uConsole, uAmmos;
    95 const MaxTeamHealth: LongInt = 0;
    94 const MaxTeamHealth: LongInt = 0;
   317 begin
   316 begin
   318 for t:= 0 to Pred(TeamsCount) do
   317 for t:= 0 to Pred(TeamsCount) do
   319    TeamsArray[t]^.ExtDriven:= false
   318    TeamsArray[t]^.ExtDriven:= false
   320 end;
   319 end;
   321 
   320 
   322 procedure SetWeapon(weap: TAmmoType);
       
   323 var t: LongInt;
       
   324 begin
       
   325 t:= cMaxSlotAmmoIndex;
       
   326 with CurrentTeam^ do
       
   327      with Hedgehogs[CurrHedgehog] do
       
   328           while (Ammo^[CurSlot, CurAmmo].AmmoType <> weap) and (t >= 0) do
       
   329                 begin
       
   330                 ParseCommand('/slot ' + chr(49 + Ammoz[TAmmoType(weap)].Slot), true);
       
   331                 dec(t)
       
   332                 end
       
   333 end;
       
   334 
       
   335 procedure SendStats;
   321 procedure SendStats;
   336 var i, t: LongInt;
   322 var i, t: LongInt;
   337     msd: Longword; msdhh: PHedgehog;
   323     msd: Longword; msdhh: PHedgehog;
   338 begin
   324 begin
   339 msd:= 0; msdhh:= nil;
   325 msd:= 0; msdhh:= nil;