- Timestamp:
- Apr 21, 2024, 10:57:18 AM (8 months ago)
- Location:
- trunk/AI/StdAI
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/AI/StdAI/AI.pas
r531 r548 231 231 else 232 232 begin 233 Quality := trunc(100 * (ln(mi.Attack) + ln(mi.Defense) +234 ln(mi.Speed / 150) * 1.7 - ln(mi.Cost)));233 Quality := Trunc(100 * (Ln(mi.Attack) + Ln(mi.Defense) + 234 Ln(mi.Speed / 150) * 1.7 - Ln(mi.Cost))); 235 235 if mi.Cap and (1 shl (mcFanatic - mcFirstNonCap)) <> 0 then 236 Inc(Quality, trunc(100 * ln(1.5)));236 Inc(Quality, Trunc(100 * Ln(1.5))); 237 237 if mi.Cap and (1 shl (mcLongRange - mcFirstNonCap)) <> 0 then 238 Inc(Quality, trunc(100 * ln(1.5)));238 Inc(Quality, Trunc(100 * Ln(1.5))); 239 239 end; 240 240 end … … 242 242 begin 243 243 Category := mctGroundDefender; 244 Quality := trunc(100 * (ln(mi.Defense) - ln(mi.Cost) * 0.6));244 Quality := Trunc(100 * (Ln(mi.Defense) - Ln(mi.Cost) * 0.6)); 245 245 if mi.Cap and (1 shl (mcFanatic - mcFirstNonCap)) <> 0 then 246 Inc(Quality, trunc(100 * ln(1.5)));246 Inc(Quality, Trunc(100 * Ln(1.5))); 247 247 end; 248 248 dSea: … … 257 257 if EffectiveTransport > 4 then 258 258 EffectiveTransport := 4; // rarely used more 259 Quality := 100 + trunc(100 * (ln(EffectiveTransport) +260 ln(mi.Speed / 150) + ln(mi.Defense) - ln(mi.Cost)));259 Quality := 100 + Trunc(100 * (Ln(EffectiveTransport) + 260 Ln(mi.Speed / 150) + Ln(mi.Defense) - Ln(mi.Cost))); 261 261 if mi.Cap and (1 shl (mcNav - mcFirstNonCap)) <> 0 then 262 Inc(Quality, trunc(100 * ln(1.5)));262 Inc(Quality, Trunc(100 * Ln(1.5))); 263 263 if mi.Cap and (1 shl (mcAirDef - mcFirstNonCap)) <> 0 then 264 Inc(Quality, trunc(100 * ln(1.3)));264 Inc(Quality, Trunc(100 * Ln(1.3))); 265 265 end; 266 266 end … … 272 272 else 273 273 begin 274 Quality := trunc(100 * (ln(mi.Attack) + ln(mi.Defense) * 0.6 - ln(mi.Cost)));274 Quality := Trunc(100 * (Ln(mi.Attack) + Ln(mi.Defense) * 0.6 - Ln(mi.Cost))); 275 275 if mi.Cap and (1 shl (mcNav - mcFirstNonCap)) <> 0 then 276 Inc(Quality, trunc(100 * ln(1.4)));276 Inc(Quality, Trunc(100 * Ln(1.4))); 277 277 if mi.Cap and (1 shl (mcAirDef - mcFirstNonCap)) <> 0 then 278 Inc(Quality, trunc(100 * ln(1.3)));278 Inc(Quality, Trunc(100 * Ln(1.3))); 279 279 if mi.Cap and (1 shl (mcLongRange - mcFirstNonCap)) <> 0 then 280 Inc(Quality, trunc(100 * ln(2.0)));280 Inc(Quality, Trunc(100 * Ln(2.0))); 281 281 if mi.Cap and (1 shl (mcRadar - mcFirstNonCap)) <> 0 then 282 Inc(Quality, trunc(100 * ln(1.5)));282 Inc(Quality, Trunc(100 * Ln(1.5))); 283 283 end; 284 284 end; -
trunk/AI/StdAI/ToolAI.pas
r531 r548 197 197 X := Loc - Y * G.lx; 198 198 Inc(sy, Y); 199 A := 2 * pi * X / G.lx;200 su := su + cos(A);201 sv := sv + sin(A);199 A := 2 * Pi * X / G.lx; 200 su := su + Cos(A); 201 sv := sv + Sin(A); 202 202 Inc(N); 203 203 end; 204 204 end; 205 A := arctan2(sv, su);206 X := round(G.lx * A / (2 * pi));205 A := ArcTan2(sv, su); 206 X := Round(G.lx * A / (2 * Pi)); 207 207 while X >= G.lx do 208 208 Dec(X, G.lx);
Note:
See TracChangeset
for help on using the changeset viewer.