62 function RatePlace(Gear: PGear): LongInt; |
62 function RatePlace(Gear: PGear): LongInt; |
63 function TestColl(x, y, r: LongInt): boolean; inline; |
63 function TestColl(x, y, r: LongInt): boolean; inline; |
64 function TestCollExcludingObjects(x, y, r: LongInt): boolean; inline; |
64 function TestCollExcludingObjects(x, y, r: LongInt): boolean; inline; |
65 function TestCollExcludingMe(Me: PGear; x, y, r: LongInt): boolean; inline; |
65 function TestCollExcludingMe(Me: PGear; x, y, r: LongInt): boolean; inline; |
66 function TraceShoveFall(x, y, dX, dY: Real): LongInt; |
66 function TraceShoveFall(x, y, dX, dY: Real): LongInt; |
67 function TestCollWithLand(x, y, r: LongInt): boolean; inline; |
|
68 |
67 |
69 function RateExplosion(Me: PGear; x, y, r: LongInt): LongInt; inline; |
68 function RateExplosion(Me: PGear; x, y, r: LongInt): LongInt; inline; |
70 function RateExplosion(Me: PGear; x, y, r: LongInt; Flags: LongWord): LongInt; |
69 function RateExplosion(Me: PGear; x, y, r: LongInt; Flags: LongWord): LongInt; |
71 function RateShove(x, y, r, power, kick: LongInt; gdX, gdY: real; Flags: LongWord): LongInt; |
70 function RateShove(x, y, r, power, kick: LongInt; gdX, gdY: real; Flags: LongWord): LongInt; |
72 function RateShotgun(Me: PGear; gdX, gdY: real; x, y: LongInt): LongInt; |
71 function RateShotgun(Me: PGear; gdX, gdY: real; x, y: LongInt): LongInt; |
306 exit(true); |
305 exit(true); |
307 |
306 |
308 TestColl:= false; |
307 TestColl:= false; |
309 end; |
308 end; |
310 |
309 |
311 function TestCollWithLand(x, y, r: LongInt): boolean; inline; |
|
312 begin |
|
313 if not CheckBounds(x, y, r) then |
|
314 exit(false); |
|
315 |
|
316 if (Land[y-r, x-r] > lfAllObjMask) or |
|
317 (Land[y+r, x-r] > lfAllObjMask) or |
|
318 (Land[y-r, x+r] > lfAllObjMask) or |
|
319 (Land[y+r, x+r] > lfAllObjMask) then |
|
320 exit(true); |
|
321 |
|
322 TestCollWithLand:= false; |
|
323 end; |
|
324 |
|
325 |
310 |
326 // Wrapper to test various approaches. If it works reasonably, will just replace. |
311 // Wrapper to test various approaches. If it works reasonably, will just replace. |
327 // Right now, converting to hwFloat is a tad inefficient since the x/y were hwFloat to begin with... |
312 // Right now, converting to hwFloat is a tad inefficient since the x/y were hwFloat to begin with... |
328 function TestCollExcludingMe(Me: PGear; x, y, r: LongInt): boolean; inline; |
313 function TestCollExcludingMe(Me: PGear; x, y, r: LongInt): boolean; inline; |
329 var MeX, MeY: LongInt; |
314 var MeX, MeY: LongInt; |