hedgewars/uAIAmmoTests.pas
changeset 13472 d3209e0caf12
parent 13463 f1d349a52bc7
child 13668 2b194214732d
equal deleted inserted replaced
13471:b688e2ca9a8d 13472:d3209e0caf12
  1207                 // 58 (instead of 60) for better prediction (hh moves after explosion of one of the rockets)
  1207                 // 58 (instead of 60) for better prediction (hh moves after explosion of one of the rockets)
  1208                 end
  1208                 end
  1209             end;
  1209             end;
  1210 until fexit or (Y > cWaterLine);
  1210 until fexit or (Y > cWaterLine);
  1211 
  1211 
  1212 for i:= 0 to 5 do inc(valueResult, dmg[i]);
  1212 for i:= 0 to 5 do
       
  1213     if dmg[i] <> BadTurn then
       
  1214         inc(valueResult, dmg[i]);
  1213 t:= valueResult;
  1215 t:= valueResult;
  1214 ap.AttackPutX:= Targ.Point.X - 60;
  1216 ap.AttackPutX:= Targ.Point.X - 60;
  1215 
  1217 
  1216 for i:= 0 to 3 do
  1218 for i:= 0 to 3 do
  1217     begin
  1219     if dmg[i] <> BadTurn then
  1218     dec(t, dmg[i]);
  1220         begin
  1219     inc(t, dmg[i + 6]);
  1221         dec(t, dmg[i]);
  1220     if t > valueResult then
  1222         inc(t, dmg[i + 6]);
  1221         begin
  1223         if t > valueResult then
  1222         valueResult:= t;
  1224             begin
  1223         ap.AttackPutX:= Targ.Point.X - 30 - cShift + i * 30
  1225             valueResult:= t;
  1224         end
  1226             ap.AttackPutX:= Targ.Point.X - 30 - cShift + i * 30
  1225     end;
  1227             end
       
  1228         end;
  1226 
  1229 
  1227 if valueResult <= 0 then
  1230 if valueResult <= 0 then
  1228     valueResult:= BadTurn;
  1231     valueResult:= BadTurn;
  1229 TestAirAttack:= valueResult;
  1232 TestAirAttack:= valueResult;
  1230 end;
  1233 end;