hedgewars/uTeams.pas
changeset 3038 4e48c276a468
parent 3030 411146650700
child 3045 41732f986b4f
equal deleted inserted replaced
3037:ab6e949eb5cb 3038:4e48c276a468
   102     ClansCount: Longword;
   102     ClansCount: Longword;
   103     LocalClan: LongInt;  // last non-bot, non-extdriven clan
   103     LocalClan: LongInt;  // last non-bot, non-extdriven clan
   104     LocalAmmo: LongInt;  // last non-bot, non-extdriven clan's first team's ammo index
   104     LocalAmmo: LongInt;  // last non-bot, non-extdriven clan's first team's ammo index
   105     CurMinAngle, CurMaxAngle: Longword;
   105     CurMinAngle, CurMaxAngle: Longword;
   106 
   106 
   107 procedure init_uTeams;
   107 procedure initModule;
   108 procedure free_uTeams;
   108 procedure freeModule;
   109 function  AddTeam(TeamColor: Longword): PTeam;
   109 function  AddTeam(TeamColor: Longword): PTeam;
   110 procedure SwitchHedgehog;
   110 procedure SwitchHedgehog;
   111 procedure AfterSwitchHedgehog;
   111 procedure AfterSwitchHedgehog;
   112 procedure InitTeams;
   112 procedure InitTeams;
   113 function  TeamSize(p: PTeam): Longword;
   113 function  TeamSize(p: PTeam): Longword;
   460                 Gear^.Invulnerable:= false;
   460                 Gear^.Invulnerable:= false;
   461                 Gear^.Damage:= Gear^.Health
   461                 Gear^.Damage:= Gear^.Health
   462                 end
   462                 end
   463 end;
   463 end;
   464 
   464 
   465 procedure init_uTeams;
   465 procedure initModule;
   466 begin
   466 begin
   467     CurrentTeam:= nil;
   467     CurrentTeam:= nil;
   468     PreviousTeam:= nil;
   468     PreviousTeam:= nil;
   469     CurrentHedgehog:= nil;
   469     CurrentHedgehog:= nil;
   470     TeamsCount:= 0;
   470     TeamsCount:= 0;
   471     ClansCount:= 0;
   471     ClansCount:= 0;
   472     LocalClan:= -1;
   472     LocalClan:= -1;
   473     LocalAmmo:= -1;
   473     LocalAmmo:= -1;
   474 end;
   474 end;
   475 
   475 
   476 procedure free_uTeams;
   476 procedure freeModule;
   477 var i: LongWord;
   477 var i: LongWord;
   478 begin
   478 begin
   479    if TeamsCount > 0 then
   479    if TeamsCount > 0 then
   480      begin
   480      begin
   481      for i:= 0 to Pred(TeamsCount) do Dispose(TeamsArray[i]);
   481      for i:= 0 to Pred(TeamsCount) do Dispose(TeamsArray[i]);