Changeset 522 for trunk/AI/StdAI/CustomAI.pas
- Timestamp:
- Jan 7, 2024, 10:24:51 PM (10 months ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/AI/StdAI/CustomAI.pas
r447 r522 246 246 procedure ab_to_V8(A, B: Integer; var V8: Integer); 247 247 begin 248 Assert(( abs(A) <= 1) and (abs(B) <= 1) and ((A <> 0) or (B <> 0)));248 Assert((Abs(A) <= 1) and (Abs(B) <= 1) and ((A <> 0) or (B <> 0))); 249 249 V8 := ab_v8[2 * B + B + A]; 250 250 end; … … 373 373 begin 374 374 Loc_to_ab(Loc0, Loc1, A, B); 375 dx := abs(A - B); 376 dy := abs(A + B); 377 Result := dx + dy + abs(dx - dy) shr 1; 378 end; 379 375 dx := Abs(A - B); 376 dy := Abs(A + B); 377 Result := dx + dy + Abs(dx - dy) shr 1; 378 end; 380 379 381 380 procedure Init(NewGameData: TNewGameData); … … 392 391 {$ENDIF} 393 392 end; 394 395 393 396 394 constructor TCustomAI.Create(Nation: Integer); … … 410 408 Server(sSetDebugMap, Me, 0, nodata^); 411 409 end; 412 413 410 414 411 procedure TCustomAI.Process(Command: Integer; var Data); … … 495 492 begin 496 493 Inc(Count); 497 if random(Count) = 0 then494 if Random(Count) = 0 then 498 495 NewResearch := ad; 499 496 end; … … 623 620 begin 624 621 Inc(Count); 625 if random(Count) = 0 then622 if Random(Count) = 0 then 626 623 Steal := ad; 627 624 end; … … 1109 1106 end; 1110 1107 1111 1112 1108 // negotiation 1113 1109 function TCustomAI.Nego_CheckMyAction: Integer; … … 1122 1118 end; 1123 1119 1124 1125 1120 initialization 1126 1121 nodata := Pointer(0);
Note:
See TracChangeset
for help on using the changeset viewer.