hedgewars/uTeams.pas
changeset 800 e95f16b7ec80
parent 783 4f59db6f147d
child 801 0323e5c7ee54
equal deleted inserted replaced
799:71ba310da909 800:e95f16b7ec80
    88 procedure RestoreTeamsFromSave;
    88 procedure RestoreTeamsFromSave;
    89 function CheckForWin: boolean;
    89 function CheckForWin: boolean;
    90 procedure SendStats;
    90 procedure SendStats;
    91 
    91 
    92 implementation
    92 implementation
    93 uses uMisc, uWorld, uAI, uLocale, uConsole, uAmmos;
    93 uses uMisc, uWorld, uAI, uLocale, uConsole, uAmmos, uSound;
    94 const MaxTeamHealth: LongInt = 0;
    94 const MaxTeamHealth: LongInt = 0;
    95 
    95 
    96 procedure FreeTeamsList; forward;
    96 procedure FreeTeamsList; forward;
    97 
    97 
    98 function CheckForWin: boolean;
    98 function CheckForWin: boolean;
   189 cWindSpeed:= rndSign(GetRandom * cMaxWindSpeed);
   189 cWindSpeed:= rndSign(GetRandom * cMaxWindSpeed);
   190 g:= AddGear(0, 0, gtATSmoothWindCh, 0, _0, _0, 1);
   190 g:= AddGear(0, 0, gtATSmoothWindCh, 0, _0, _0, 1);
   191 g^.Tag:= hwRound(cWindSpeed * 72 / cMaxWindSpeed);
   191 g^.Tag:= hwRound(cWindSpeed * 72 / cMaxWindSpeed);
   192 {$IFDEF DEBUGFILE}AddFileLog('Wind = '+FloatToStr(cWindSpeed));{$ENDIF}
   192 {$IFDEF DEBUGFILE}AddFileLog('Wind = '+FloatToStr(cWindSpeed));{$ENDIF}
   193 ApplyAmmoChanges(CurrentHedgehog^);
   193 ApplyAmmoChanges(CurrentHedgehog^);
       
   194 
   194 if CurrentTeam^.ExtDriven then SetDefaultBinds
   195 if CurrentTeam^.ExtDriven then SetDefaultBinds
   195                           else SetBinds(CurrentTeam^.Binds);
   196                           else SetBinds(CurrentTeam^.Binds);
   196 bShowFinger:= true;
   197 bShowFinger:= true;
       
   198 
       
   199 if not (CurrentTeam^.ExtDriven or (CurrentHedgehog^.BotLevel > 0)) then PlaySound(sndYesSir, false);
       
   200 
   197 TurnTimeLeft:= cHedgehogTurnTime
   201 TurnTimeLeft:= cHedgehogTurnTime
   198 end;
   202 end;
   199 
   203 
   200 function AddTeam(TeamColor: Longword): PTeam;
   204 function AddTeam(TeamColor: Longword): PTeam;
   201 var Result: PTeam;
   205 var Result: PTeam;