~ubuntu-branches/ubuntu/utopic/hedgewars/utopic

« back to all changes in this revision

Viewing changes to hedgewars/uAI.pas

  • Committer: Package Import Robot
  • Author(s): Gianfranco Costamagna
  • Date: 2014-01-02 12:37:23 UTC
  • mfrom: (19.1.5 sid)
  • Revision ID: package-import@ubuntu.com-20140102123723-6pdhmyj8tb5y8xbg
Tags: 0.9.20.3-1
New upstream minor release, suitable for unstable

Show diffs side-by-side

added added

removed removed

Lines of Context:
106
106
procedure TestAmmos(var Actions: TActions; Me: PGear; rareChecks: boolean);
107
107
var BotLevel: Byte;
108
108
    ap: TAttackParams;
109
 
    Score, i, dAngle: LongInt;
 
109
    Score, i, t, n, dAngle: LongInt;
110
110
    a, aa: TAmmoType;
111
111
begin
112
112
BotLevel:= Me^.Hedgehog^.BotLevel;
182
182
                        end else
183
183
                        if (Ammoz[a].Ammo.Propz and ammoprop_AttackingPut) = 0 then
184
184
                            begin
 
185
                            if (AmmoTests[a].flags and amtest_MultipleAttacks) = 0 then
 
186
                                n:= 1 else n:= ap.AttacksNum;
 
187
 
185
188
                            AddAction(BestActions, aia_attack, aim_push, 650 + random(300), 0, 0);
 
189
                            for t:= 2 to n do
 
190
                                begin
 
191
                                AddAction(BestActions, aia_attack, aim_push, 150, 0, 0);
 
192
                                AddAction(BestActions, aia_attack, aim_release, ap.Power, 0, 0);
 
193
                                end;
186
194
                            AddAction(BestActions, aia_attack, aim_release, ap.Power, 0, 0);
187
195
                            end;
188
196
 
243
251
    AddAction(Actions, aia_Weapon, Longword(amSkip), 100 + random(200), 0, 0);
244
252
 
245
253
if ((CurrentHedgehog^.MultiShootAttacks = 0) or ((Ammoz[Me^.Hedgehog^.CurAmmoType].Ammo.Propz and ammoprop_NoMoveAfter) = 0))
246
 
    and (GameFlags and gfArtillery = 0) then
 
254
    and (GameFlags and gfArtillery = 0) and (cGravityf <> 0) then
247
255
    begin
248
256
    tmp:= random(2) + 1;
249
257
    Push(0, Actions, Me^, tmp);
482
490
FillBonuses(((Me^.State and gstAttacked) <> 0) and (not isInMultiShoot));
483
491
 
484
492
SDL_LockMutex(ThreadLock);
485
 
ThinkThread:= SDL_CreateThread(@Think{$IFDEF SDL13}, 'think'{$ENDIF}, Me);
 
493
ThinkThread:= SDL_CreateThread(@Think{$IFDEF SDL2}, 'think'{$ENDIF}, Me);
486
494
SDL_UnlockMutex(ThreadLock);
487
495
end;
488
496