Changeset 663 for trunk/AI/StdAI
- Timestamp:
- Jul 5, 2025, 10:57:12 AM (11 hours ago)
- Location:
- trunk/AI/StdAI
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/AI/StdAI/CustomAI.pas
r592 r663 177 177 178 178 procedure Loc_to_ab(Loc0, Loc: Integer; var A, B: Integer); 179 {$IFDEF FPC}// freepascal180 179 var 181 180 dx, dy: Integer; … … 187 186 B := (dy - dx) div 2; 188 187 end; 189 190 {$ELSE}// delphi191 register;192 asm193 push ebx194 195 // calculate196 push ecx197 div Byte ptr [G]198 xor ebx,ebx199 mov bl,ah // ebx:=Loc0 mod G.lx200 mov ecx,eax201 and ecx,$000000FF // ecx:=Loc0 div G.lx202 mov eax,edx203 div Byte ptr [G]204 xor edx,edx205 mov dl,ah // edx:=Loc mod G.lx206 and eax,$000000FF // eax:=Loc div G.lx207 sub edx,ebx // edx:=Loc mod G.lx-Loc0 mod G.lx208 mov ebx,eax209 sub ebx,ecx // ebx:=dy210 and eax,1211 and ecx,1212 add edx,edx213 add eax,edx214 sub eax,ecx // eax:=dx, not normalized215 pop ecx216 217 // normalize218 mov edx,dword ptr [G]219 cmp eax,edx220 jl @A221 sub eax,edx222 sub eax,edx223 jmp @ok224 @A:225 neg edx226 cmp eax,edx227 jnl @ok228 sub eax,edx229 sub eax,edx230 231 // return results232 @ok:233 mov edx,ebx234 sub edx,eax235 add eax,ebx236 sar edx,1 // edx:=b237 mov ebx,[B]238 mov [ebx],edx239 sar eax,1 // eax:=a240 mov [A],eax241 242 pop ebx243 end;244 {$ENDIF}245 188 246 189 procedure ab_to_V8(A, B: Integer; var V8: Integer); -
trunk/AI/StdAI/ToolAI.pas
r592 r663 613 613 dGround: 614 614 begin 615 Inc(Result, (50 + (Speed - 150) * 13 shr 7) shl 8); // HeavyCost615 Inc(Result, (50 + (Speed - 150) * 13 shr 7) shl 8); // HeavyCost 616 616 if RO.Wonder[woShinkansen].EffectiveOwner <> Me then 617 617 Inc(Result, Speed * (4 * 1311) shr 17); // RailCost 618 if (RO.Wonder[woGardens].EffectiveOwner <> Me) or619 (Kind = mkSettler) and (Speed >= 200) then618 if (RO.Wonder[woGardens].EffectiveOwner <> Me) and 619 not ((Kind = mkSettler) and (Speed >= 200)) then 620 620 Inc(Result, msHostile); 621 621 if Kind = mkDiplomat then
Note:
See TracChangeset
for help on using the changeset viewer.