hedgewars/uAI.pas
changeset 4372 3836973380b9
parent 4368 b89235e401e5
child 4373 fe0e3903bb9e
equal deleted inserted replaced
4371:ae172b2b03ed 4372:3836973380b9
    64 var BotLevel: Byte;
    64 var BotLevel: Byte;
    65     ap: TAttackParams;
    65     ap: TAttackParams;
    66     Score, i: LongInt;
    66     Score, i: LongInt;
    67     a, aa: TAmmoType;
    67     a, aa: TAmmoType;
    68 begin
    68 begin
    69 BotLevel:= PHedgehog(Me^.Hedgehog)^.BotLevel;
    69 BotLevel:= Me^.Hedgehog^.BotLevel;
    70 
    70 
    71 for i:= 0 to Pred(Targets.Count) do
    71 for i:= 0 to Pred(Targets.Count) do
    72     if (Targets.ar[i].Score >= 0) and (not StopThinking) then
    72     if (Targets.ar[i].Score >= 0) and (not StopThinking) then
    73        begin
    73        begin
    74        with CurrentHedgehog^ do
    74        with CurrentHedgehog^ do
   193 ticks:= 0; // avoid compiler hint
   193 ticks:= 0; // avoid compiler hint
   194 Actions.Count:= 0;
   194 Actions.Count:= 0;
   195 Actions.Pos:= 0;
   195 Actions.Pos:= 0;
   196 Actions.Score:= 0;
   196 Actions.Score:= 0;
   197 Stack.Count:= 0;
   197 Stack.Count:= 0;
   198 BotLevel:= PHedgehog(Me^.Hedgehog)^.BotLevel;
   198 BotLevel:= Me^.Hedgehog^.BotLevel;
   199 
   199 
   200 tmp:= random(2) + 1;
   200 tmp:= random(2) + 1;
   201 Push(0, Actions, Me^, tmp);
   201 Push(0, Actions, Me^, tmp);
   202 Push(0, Actions, Me^, tmp xor 3);
   202 Push(0, Actions, Me^, tmp xor 3);
   203 
   203 
   320    exit
   320    exit
   321    end;
   321    end;
   322 
   322 
   323 FillBonuses((Me^.State and gstAttacked) <> 0);
   323 FillBonuses((Me^.State and gstAttacked) <> 0);
   324 for a:= Low(TAmmoType) to High(TAmmoType) do
   324 for a:= Low(TAmmoType) to High(TAmmoType) do
   325     CanUseAmmo[a]:= Assigned(AmmoTests[a].proc) and HHHasAmmo(PHedgehog(Me^.Hedgehog)^, a);
   325     CanUseAmmo[a]:= Assigned(AmmoTests[a].proc) and HHHasAmmo(Me^.Hedgehog^, a);
   326 {$IFDEF DEBUGFILE}AddFileLog('Enter Think Thread');{$ENDIF}
   326 {$IFDEF DEBUGFILE}AddFileLog('Enter Think Thread');{$ENDIF}
   327 BeginThread(@Think, Me, ThinkThread)
   327 BeginThread(@Think, Me, ThinkThread)
   328 end;
   328 end;
   329 
   329 
   330 procedure ProcessBot;
   330 procedure ProcessBot;