# HG changeset patch # User unc0rr # Date 1367517303 -14400 # Node ID 3e07b8ff2ae1e1b403a8e9ea0ee0577df38fb138 # Parent ed2509832311bd2fa9ce2778e44e9949b1906156 Make AI more active in multiattack game mode diff -r ed2509832311 -r 3e07b8ff2ae1 hedgewars/uAI.pas --- a/hedgewars/uAI.pas Wed May 01 04:05:10 2013 +0300 +++ b/hedgewars/uAI.pas Thu May 02 21:55:03 2013 +0400 @@ -377,7 +377,7 @@ switchCount:= HHHasAmmo(PGear(Me)^.Hedgehog^, amSwitch) else switchCount:= 0; -if (Me^.State and gstAttacked) = 0 then +if ((Me^.State and gstAttacked) = 0) or isInMultiShoot then if Targets.Count > 0 then begin // iterate over current team hedgehogs @@ -426,7 +426,8 @@ else begin BackMe:= Me^; - while (not StopThinking) and (BestActions.Count = 0) do + i:= 12; + while (not StopThinking) and (BestActions.Count = 0) and (i > 0) do begin (* // Maybe this would get a bit of movement out of them? Hopefully not *toward* water. Need to check how often he'd choose that strategy @@ -439,6 +440,7 @@ Actions.Pos:= 0; Actions.Score:= 0; Walk(@WalkMe, Actions); + dec(i); if not StopThinking then SDL_Delay(100) end @@ -477,7 +479,7 @@ exit end; -FillBonuses((Me^.State and gstAttacked) <> 0); +FillBonuses(((Me^.State and gstAttacked) <> 0) and (not isInMultiShoot)); SDL_LockMutex(ThreadLock); ThinkThread:= SDL_CreateThread(@Think{$IFDEF SDL13}, 'think'{$ENDIF}, Me);