hedgewars/uFLTeams.pas
branchqmlfrontend
changeset 11458 8318e841648f
parent 11456 ab77e2ea2f82
equal deleted inserted replaced
11457:55a8322e307d 11458:8318e841648f
     1 unit uFLTeams;
     1 unit uFLTeams;
     2 interface
     2 interface
     3 uses uFLTypes;
     3 uses uFLTypes;
     4 
     4 
     5 function createRandomTeam: TTeam;
     5 function createRandomTeam: TTeam;
     6 procedure sendTeamConfig(var team: TTeam);
     6 procedure sendTeamConfig(hp: LongInt; var team: TTeam);
     7 
     7 
     8 function getTeamsList: PPChar; cdecl;
     8 function getTeamsList: PPChar; cdecl;
     9 procedure freeTeamsList;
     9 procedure freeTeamsList;
    10 
    10 
    11 function teamByName(s: shortstring): PTeam;
    11 function teamByName(s: shortstring): PTeam;
    43     end;
    43     end;
    44     createRandomTeam:= t
    44     createRandomTeam:= t
    45 end;
    45 end;
    46 
    46 
    47 
    47 
    48 procedure sendTeamConfig(var team: TTeam);
    48 procedure sendTeamConfig(hp: LongInt; var team: TTeam);
    49 var i: Longword;
    49 var i: Longword;
    50 begin
    50 begin
    51     with team do
    51     with team do
    52     begin
    52     begin
    53         ipcToEngine('eaddteam <hash> ' + colorsSet[color] + ' ' + teamName);
    53         ipcToEngine('eaddteam <hash> ' + colorsSet[color] + ' ' + teamName);
    55         if extDriven then
    55         if extDriven then
    56             ipcToEngine('erdriven');
    56             ipcToEngine('erdriven');
    57 
    57 
    58         for i:= 0 to Pred(hogsNumber) do
    58         for i:= 0 to Pred(hogsNumber) do
    59         begin
    59         begin
    60             ipcToEngine('eaddhh ' + inttostr(botLevel) + ' 100 ' + hedgehogs[i].name);
    60             ipcToEngine('eaddhh ' + IntToStr(botLevel) + ' ' + IntToStr(hp) + ' ' + hedgehogs[i].name);
    61             ipcToEngine('ehat ' + hedgehogs[i].hat);
    61             ipcToEngine('ehat ' + hedgehogs[i].hat);
    62         end;
    62         end;
    63     end
    63     end
    64 end;
    64 end;
    65 
    65