author | unc0rr |
Mon, 04 Jun 2007 21:29:05 +0000 | |
changeset 537 | 4d2e60623e44 |
parent 534 | 92fb2b0d5117 |
child 538 | 74219eadab5e |
permissions | -rw-r--r-- |
4 | 1 |
(* |
2 |
* Hedgewars, a worms-like game |
|
393 | 3 |
* Copyright (c) 2004-2007 Andrey Korotaev <unC0Rr@gmail.com> |
4 | 4 |
* |
183 | 5 |
* This program is free software; you can redistribute it and/or modify |
6 |
* it under the terms of the GNU General Public License as published by |
|
7 |
* the Free Software Foundation; version 2 of the License |
|
4 | 8 |
* |
183 | 9 |
* This program is distributed in the hope that it will be useful, |
10 |
* but WITHOUT ANY WARRANTY; without even the implied warranty of |
|
11 |
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
|
12 |
* GNU General Public License for more details. |
|
4 | 13 |
* |
183 | 14 |
* You should have received a copy of the GNU General Public License |
15 |
* along with this program; if not, write to the Free Software |
|
16 |
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA |
|
4 | 17 |
*) |
18 |
||
19 |
procedure doStepDrowningGear(Gear: PGear); forward; |
|
20 |
||
21 |
function CheckGearDrowning(Gear: PGear): boolean; |
|
22 |
begin |
|
498 | 23 |
if cWaterLine < hwRound(Gear^.Y) + Gear^.Radius then |
4 | 24 |
begin |
351 | 25 |
CheckGearDrowning:= true; |
26 |
Gear^.State:= gstDrowning; |
|
27 |
Gear^.doStep:= @doStepDrowningGear; |
|
28 |
PlaySound(sndSplash, false) |
|
29 |
end else |
|
30 |
CheckGearDrowning:= false |
|
4 | 31 |
end; |
32 |
||
33 |
procedure CheckCollision(Gear: PGear); |
|
34 |
begin |
|
351 | 35 |
if TestCollisionXwithGear(Gear, hwSign(Gear^.X)) or TestCollisionYwithGear(Gear, hwSign(Gear^.Y)) |
36 |
then Gear^.State:= Gear^.State or gstCollision |
|
37 |
else Gear^.State:= Gear^.State and not gstCollision |
|
4 | 38 |
end; |
39 |
||
40 |
procedure CheckHHDamage(Gear: PGear); |
|
522 | 41 |
var dmg: Longword; |
4 | 42 |
begin |
522 | 43 |
if _0_4 < Gear^.dY then |
44 |
begin |
|
45 |
dmg:= 1 + hwRound((hwAbs(Gear^.dY) - _0_4) * 70); |
|
46 |
inc(Gear^.Damage, dmg); |
|
47 |
AddDamageTag(hwRound(Gear^.X), hwRound(Gear^.Y) + cHHRadius, dmg, Gear); |
|
48 |
end |
|
4 | 49 |
end; |
50 |
||
51 |
//////////////////////////////////////////////////////////////////////////////// |
|
52 |
//////////////////////////////////////////////////////////////////////////////// |
|
53 |
procedure CalcRotationDirAngle(Gear: PGear); |
|
351 | 54 |
var dAngle: hwFloat; |
4 | 55 |
begin |
351 | 56 |
dAngle:= (hwAbs(Gear^.dX) + hwAbs(Gear^.dY)) * _0_1; |
57 |
if not Gear^.dX.isNegative then Gear^.DirAngle:= Gear^.DirAngle + dAngle |
|
58 |
else Gear^.DirAngle:= Gear^.DirAngle - dAngle; |
|
498 | 59 |
if Gear^.DirAngle.isNegative then Gear^.DirAngle:= Gear^.DirAngle + _16 |
60 |
else if _16 < Gear^.DirAngle then Gear^.DirAngle:= Gear^.DirAngle - _16 |
|
4 | 61 |
end; |
62 |
||
63 |
//////////////////////////////////////////////////////////////////////////////// |
|
64 |
procedure doStepDrowningGear(Gear: PGear); |
|
65 |
begin |
|
66 |
AllInactive:= false; |
|
351 | 67 |
Gear^.Y:= Gear^.Y + cDrownSpeed; |
68 |
if hwRound(Gear^.Y) > Gear^.Radius + cWaterLine + cVisibleWater then DeleteGear(Gear) |
|
4 | 69 |
end; |
70 |
||
71 |
//////////////////////////////////////////////////////////////////////////////// |
|
72 |
procedure doStepFallingGear(Gear: PGear); |
|
73 |
begin |
|
503 | 74 |
Gear^.State:= Gear^.State and not gstCollision; |
75 |
||
76 |
if Gear^.dY.isNegative then |
|
4 | 77 |
begin |
503 | 78 |
Gear^.State:= Gear^.State or gstFalling; |
79 |
if TestCollisionYwithGear(Gear, -1) then |
|
80 |
begin |
|
81 |
Gear^.dX:= Gear^.dX * Gear^.Friction; |
|
82 |
Gear^.dY:= - Gear^.dY * Gear^.Elasticity; |
|
83 |
Gear^.State:= Gear^.State or gstCollision |
|
84 |
end |
|
85 |
end else |
|
86 |
if TestCollisionYwithGear(Gear, 1) then |
|
87 |
begin |
|
88 |
Gear^.State:= Gear^.State and not gstFalling; |
|
89 |
Gear^.dX:= Gear^.dX * Gear^.Friction; |
|
90 |
Gear^.dY:= - Gear^.dY * Gear^.Elasticity; |
|
91 |
Gear^.State:= Gear^.State or gstCollision |
|
92 |
end else Gear^.State:= Gear^.State or gstFalling; |
|
93 |
||
351 | 94 |
if TestCollisionXwithGear(Gear, hwSign(Gear^.dX)) then |
4 | 95 |
begin |
351 | 96 |
Gear^.dX:= - Gear^.dX * Gear^.Elasticity; |
97 |
Gear^.State:= Gear^.State or gstCollision |
|
4 | 98 |
end; |
503 | 99 |
|
100 |
if (Gear^.State and gstFalling) <> 0 then Gear^.dY:= Gear^.dY + cGravity; |
|
101 |
||
351 | 102 |
Gear^.X:= Gear^.X + Gear^.dX; |
103 |
Gear^.Y:= Gear^.Y + Gear^.dY; |
|
4 | 104 |
CheckGearDrowning(Gear); |
503 | 105 |
if (hwSqr(Gear^.dX) + hwSqr(Gear^.dY) < _0_0002) and |
106 |
((Gear^.State and gstFalling) = 0) then Gear^.State:= Gear^.State and not gstMoving |
|
107 |
else Gear^.State:= Gear^.State or gstMoving |
|
4 | 108 |
end; |
109 |
||
110 |
//////////////////////////////////////////////////////////////////////////////// |
|
111 |
procedure doStepCloud(Gear: PGear); |
|
112 |
begin |
|
351 | 113 |
Gear^.X:= Gear^.X + cWindSpeed * 200 + Gear^.dX; |
498 | 114 |
if hwRound(Gear^.Y) > -160 then Gear^.dY:= Gear^.dY - _1div50000 |
115 |
else Gear^.dY:= Gear^.dY + _1div50000; |
|
351 | 116 |
Gear^.Y:= Gear^.Y + Gear^.dY; |
498 | 117 |
if hwRound(Gear^.X) < -cScreenWidth - 256 then Gear^.X:= int2hwFloat(cScreenWidth + 2048) else |
118 |
if hwRound(Gear^.X) > cScreenWidth + 2048 then Gear^.X:= int2hwFloat(-cScreenWidth - 256) |
|
4 | 119 |
end; |
120 |
||
121 |
//////////////////////////////////////////////////////////////////////////////// |
|
122 |
procedure doStepBomb(Gear: PGear); |
|
371 | 123 |
var i: LongInt; |
4 | 124 |
begin |
125 |
AllInactive:= false; |
|
126 |
doStepFallingGear(Gear); |
|
351 | 127 |
dec(Gear^.Timer); |
128 |
if Gear^.Timer = 0 then |
|
4 | 129 |
begin |
351 | 130 |
case Gear^.Kind of |
131 |
gtAmmo_Bomb: doMakeExplosion(hwRound(Gear^.X), hwRound(Gear^.Y), 50, EXPLAutoSound); |
|
78 | 132 |
gtClusterBomb: begin |
351 | 133 |
doMakeExplosion(hwRound(Gear^.X), hwRound(Gear^.Y), 30, EXPLAutoSound); |
78 | 134 |
for i:= 0 to 4 do |
498 | 135 |
AddGear(hwRound(Gear^.X), hwRound(Gear^.Y), gtCluster, 0, (getrandom - _0_5) * _0_2, (getrandom - _3) * _0_08, 0); |
78 | 136 |
end |
137 |
end; |
|
4 | 138 |
DeleteGear(Gear); |
139 |
exit |
|
140 |
end; |
|
141 |
CalcRotationDirAngle(Gear); |
|
351 | 142 |
if (Gear^.State and (gstCollision or gstMoving)) = (gstCollision or gstMoving) then PlaySound(sndGrenadeImpact, false) |
4 | 143 |
end; |
144 |
||
78 | 145 |
procedure doStepCluster(Gear: PGear); |
146 |
begin |
|
147 |
AllInactive:= false; |
|
148 |
doStepFallingGear(Gear); |
|
351 | 149 |
if (Gear^.State and gstCollision) <> 0 then |
78 | 150 |
begin |
351 | 151 |
doMakeExplosion(hwRound(Gear^.X), hwRound(Gear^.Y), 20, EXPLAutoSound); |
78 | 152 |
DeleteGear(Gear); |
153 |
exit |
|
154 |
end; |
|
155 |
if (GameTicks and $1F) = 0 then |
|
498 | 156 |
AddGear(hwRound(Gear^.X), hwRound(Gear^.Y), gtSmokeTrace, 0, _0, _0, 0) |
78 | 157 |
end; |
158 |
||
4 | 159 |
//////////////////////////////////////////////////////////////////////////////// |
160 |
procedure doStepGrenade(Gear: PGear); |
|
161 |
begin |
|
162 |
AllInactive:= false; |
|
351 | 163 |
Gear^.dX:= Gear^.dX + cWindSpeed; |
4 | 164 |
doStepFallingGear(Gear); |
351 | 165 |
if (Gear^.State and gstCollision) <> 0 then |
4 | 166 |
begin |
351 | 167 |
doMakeExplosion(hwRound(Gear^.X), hwRound(Gear^.Y), 50, EXPLAutoSound); |
4 | 168 |
DeleteGear(Gear); |
169 |
exit |
|
170 |
end; |
|
171 |
if (GameTicks and $3F) = 0 then |
|
498 | 172 |
AddGear(hwRound(Gear^.X), hwRound(Gear^.Y), gtSmokeTrace, 0, _0, _0, 0) |
4 | 173 |
end; |
174 |
||
175 |
//////////////////////////////////////////////////////////////////////////////// |
|
95 | 176 |
procedure doStepHealthTagWork(Gear: PGear); |
4 | 177 |
begin |
522 | 178 |
if Gear^.Kind = gtHealthTag then |
179 |
AllInactive:= false; |
|
351 | 180 |
dec(Gear^.Timer); |
522 | 181 |
Gear^.Y:= Gear^.Y + Gear^.dY; |
351 | 182 |
if Gear^.Timer = 0 then |
4 | 183 |
begin |
522 | 184 |
if Gear^.Kind = gtHealthTag then |
185 |
PHedgehog(Gear^.Hedgehog)^.Gear^.Active:= true; // to let current hh die |
|
4 | 186 |
DeleteGear(Gear) |
187 |
end |
|
188 |
end; |
|
189 |
||
263 | 190 |
procedure doStepHealthTagWorkUnderWater(Gear: PGear); |
191 |
begin |
|
192 |
AllInactive:= false; |
|
351 | 193 |
Gear^.Y:= Gear^.Y - _0_08; |
498 | 194 |
if hwRound(Gear^.Y) < cWaterLine + 10 then |
263 | 195 |
DeleteGear(Gear) |
196 |
end; |
|
197 |
||
95 | 198 |
procedure doStepHealthTag(Gear: PGear); |
199 |
var s: shortstring; |
|
522 | 200 |
font: THWFont; |
95 | 201 |
begin |
202 |
AllInactive:= false; |
|
522 | 203 |
if Gear^.Kind = gtHealthTag then |
204 |
begin |
|
205 |
font:= fnt16; |
|
206 |
Gear^.dY:= -_0_08 |
|
207 |
end else |
|
208 |
begin |
|
209 |
font:= fntSmall; |
|
210 |
Gear^.dY:= -_0_02 |
|
211 |
end; |
|
212 |
||
351 | 213 |
str(Gear^.State, s); |
522 | 214 |
Gear^.Surf:= RenderString(s, PHedgehog(Gear^.Hedgehog)^.Team^.Color, font); |
498 | 215 |
if hwRound(Gear^.Y) < cWaterLine then Gear^.doStep:= @doStepHealthTagWork |
522 | 216 |
else Gear^.doStep:= @doStepHealthTagWorkUnderWater; |
217 |
Gear^.Y:= Gear^.Y - int2hwFloat(Gear^.Surf^.h) |
|
95 | 218 |
end; |
219 |
||
4 | 220 |
//////////////////////////////////////////////////////////////////////////////// |
221 |
procedure doStepGrave(Gear: PGear); |
|
222 |
begin |
|
223 |
AllInactive:= false; |
|
498 | 224 |
if Gear^.dY.isNegative then |
225 |
if TestCollisionY(Gear, -1) then Gear^.dY:= _0; |
|
4 | 226 |
|
351 | 227 |
if not Gear^.dY.isNegative then |
68 | 228 |
if TestCollisionY(Gear, 1) then |
4 | 229 |
begin |
351 | 230 |
Gear^.dY:= - Gear^.dY * Gear^.Elasticity; |
231 |
if Gear^.dY > - _1div1024 then |
|
4 | 232 |
begin |
351 | 233 |
Gear^.Active:= false; |
4 | 234 |
exit |
351 | 235 |
end else if Gear^.dY < - _0_03 then PlaySound(sndGraveImpact, false) |
4 | 236 |
end; |
351 | 237 |
Gear^.Y:= Gear^.Y + Gear^.dY; |
4 | 238 |
CheckGearDrowning(Gear); |
351 | 239 |
Gear^.dY:= Gear^.dY + cGravity |
4 | 240 |
end; |
241 |
||
242 |
//////////////////////////////////////////////////////////////////////////////// |
|
243 |
procedure doStepUFOWork(Gear: PGear); |
|
351 | 244 |
var t: hwFloat; |
374 | 245 |
y: LongInt; |
4 | 246 |
begin |
247 |
AllInactive:= false; |
|
351 | 248 |
t:= Distance(Gear^.dX, Gear^.dY); |
249 |
Gear^.dX:= Gear^.Elasticity * (Gear^.dX + _0_000004 * (TargetPoint.X - hwRound(Gear^.X))); |
|
250 |
Gear^.dY:= Gear^.Elasticity * (Gear^.dY + _0_000004 * (TargetPoint.Y - hwRound(Gear^.Y))); |
|
251 |
t:= t / Distance(Gear^.dX, Gear^.dY); |
|
252 |
Gear^.dX:= Gear^.dX * t; |
|
253 |
Gear^.dY:= Gear^.dY * t; |
|
254 |
Gear^.X:= Gear^.X + Gear^.dX; |
|
255 |
Gear^.Y:= Gear^.Y + Gear^.dY; |
|
374 | 256 |
|
257 |
if (GameTicks and $3F) = 0 then |
|
258 |
begin |
|
259 |
y:= hwRound(Gear^.Y); |
|
260 |
if y + Gear^.Radius < cWaterLine then |
|
498 | 261 |
AddGear(hwRound(Gear^.X), y, gtSmokeTrace, 0, _0, _0, 0); |
374 | 262 |
end; |
263 |
||
4 | 264 |
CheckCollision(Gear); |
351 | 265 |
dec(Gear^.Timer); |
266 |
if ((Gear^.State and gstCollision) <> 0) or (Gear^.Timer = 0) then |
|
4 | 267 |
begin |
351 | 268 |
doMakeExplosion(hwRound(Gear^.X), hwRound(Gear^.Y), 50, EXPLAutoSound); |
4 | 269 |
DeleteGear(Gear); |
270 |
end; |
|
271 |
end; |
|
272 |
||
273 |
procedure doStepUFO(Gear: PGear); |
|
274 |
begin |
|
275 |
AllInactive:= false; |
|
351 | 276 |
Gear^.X:= Gear^.X + Gear^.dX; |
277 |
Gear^.Y:= Gear^.Y + Gear^.dY; |
|
278 |
Gear^.dY:= Gear^.dY + cGravity; |
|
4 | 279 |
CheckCollision(Gear); |
351 | 280 |
if (Gear^.State and gstCollision) <> 0 then |
4 | 281 |
begin |
351 | 282 |
doMakeExplosion(hwRound(Gear^.X), hwRound(Gear^.Y), 50, EXPLAutoSound); |
4 | 283 |
DeleteGear(Gear); |
284 |
exit |
|
285 |
end; |
|
351 | 286 |
dec(Gear^.Timer); |
287 |
if Gear^.Timer = 0 then |
|
4 | 288 |
begin |
351 | 289 |
Gear^.Timer:= 5000; |
290 |
Gear^.doStep:= @doStepUFOWork |
|
4 | 291 |
end; |
292 |
end; |
|
293 |
||
294 |
//////////////////////////////////////////////////////////////////////////////// |
|
295 |
procedure doStepShotgunShot(Gear: PGear); |
|
296 |
var i: LongWord; |
|
297 |
begin |
|
298 |
AllInactive:= false; |
|
351 | 299 |
if Gear^.Timer > 0 then |
4 | 300 |
begin |
351 | 301 |
dec(Gear^.Timer); |
302 |
if Gear^.Timer = 0 then PlaySound(sndShotgunFire, false); |
|
4 | 303 |
exit |
304 |
end; |
|
305 |
i:= 200; |
|
306 |
repeat |
|
351 | 307 |
Gear^.X:= Gear^.X + Gear^.dX; |
308 |
Gear^.Y:= Gear^.Y + Gear^.dY; |
|
4 | 309 |
CheckCollision(Gear); |
351 | 310 |
if (Gear^.State and gstCollision) <> 0 then |
4 | 311 |
begin |
506 | 312 |
Gear^.X:= Gear^.X + Gear^.dX * 8; |
313 |
Gear^.Y:= Gear^.Y + Gear^.dY * 8; |
|
314 |
ShotgunShot(Gear); |
|
4 | 315 |
DeleteGear(Gear); |
75 | 316 |
AfterAttack; |
4 | 317 |
exit |
318 |
end; |
|
319 |
dec(i) |
|
320 |
until i = 0; |
|
498 | 321 |
if (Gear^.X < _0) or (Gear^.Y < _0) or (Gear^.X > _2048) or (Gear^.Y > _1024) then |
95 | 322 |
begin |
323 |
DeleteGear(Gear); |
|
324 |
AfterAttack |
|
325 |
end |
|
4 | 326 |
end; |
327 |
||
328 |
//////////////////////////////////////////////////////////////////////////////// |
|
38 | 329 |
procedure doStepDEagleShot(Gear: PGear); |
330 |
var i, x, y: LongWord; |
|
351 | 331 |
oX, oY: hwFloat; |
38 | 332 |
begin |
333 |
AllInactive:= false; |
|
37 | 334 |
i:= 80; |
351 | 335 |
oX:= Gear^.X; |
336 |
oY:= Gear^.Y; |
|
37 | 337 |
repeat |
351 | 338 |
Gear^.X:= Gear^.X + Gear^.dX; |
339 |
Gear^.Y:= Gear^.Y + Gear^.dY; |
|
340 |
x:= hwRound(Gear^.X); |
|
341 |
y:= hwRound(Gear^.Y); |
|
38 | 342 |
if ((y and $FFFFFC00) = 0) and ((x and $FFFFF800) = 0) |
351 | 343 |
and (Land[y, x] <> 0) then inc(Gear^.Damage); |
519 | 344 |
if Gear^.Damage > 5 then AmmoShove(Gear, 7, 20); |
38 | 345 |
dec(i) |
351 | 346 |
until (i = 0) or (Gear^.Damage > Gear^.Health); |
347 |
if Gear^.Damage > 0 then |
|
37 | 348 |
begin |
351 | 349 |
DrawTunnel(oX, oY, Gear^.dX, Gear^.dY, 82 - i, 1); |
350 |
dec(Gear^.Health, Gear^.Damage); |
|
351 |
Gear^.Damage:= 0 |
|
37 | 352 |
end; |
498 | 353 |
if (Gear^.Health <= 0) or (Gear^.X < _0) or (Gear^.Y < _0) or (Gear^.X > _2048) or (Gear^.Y > _1024) then |
37 | 354 |
DeleteGear(Gear) |
355 |
end; |
|
356 |
||
357 |
//////////////////////////////////////////////////////////////////////////////// |
|
4 | 358 |
procedure doStepActionTimer(Gear: PGear); |
359 |
begin |
|
351 | 360 |
dec(Gear^.Timer); |
361 |
case Gear^.Kind of |
|
83 | 362 |
gtATStartGame: begin |
4 | 363 |
AllInactive:= false; |
351 | 364 |
if Gear^.Timer = 0 then |
83 | 365 |
AddCaption(trmsg[sidStartFight], $FFFFFF, capgrpGameState); |
4 | 366 |
end; |
83 | 367 |
gtATSmoothWindCh: begin |
351 | 368 |
if Gear^.Timer = 0 then |
6 | 369 |
begin |
351 | 370 |
if WindBarWidth < Gear^.Tag then inc(WindBarWidth) |
371 |
else if WindBarWidth > Gear^.Tag then dec(WindBarWidth); |
|
372 |
if WindBarWidth <> Gear^.Tag then Gear^.Timer:= 10; |
|
83 | 373 |
end |
374 |
end; |
|
375 |
gtATFinishGame: begin |
|
376 |
AllInactive:= false; |
|
351 | 377 |
if Gear^.Timer = 0 then |
113 | 378 |
begin |
379 |
SendIPC('N'); |
|
324
f4c109c82a0c
Don't show game stats in case of interrupted by command '/quit' game
unc0rr
parents:
306
diff
changeset
|
380 |
SendIPC('q'); |
83 | 381 |
GameState:= gsExit |
113 | 382 |
end |
6 | 383 |
end; |
4 | 384 |
end; |
351 | 385 |
if Gear^.Timer = 0 then DeleteGear(Gear) |
4 | 386 |
end; |
387 |
||
388 |
//////////////////////////////////////////////////////////////////////////////// |
|
389 |
procedure doStepPickHammerWork(Gear: PGear); |
|
371 | 390 |
var i, ei: LongInt; |
4 | 391 |
HHGear: PGear; |
392 |
begin |
|
70 | 393 |
AllInactive:= false; |
351 | 394 |
HHGear:= PHedgehog(Gear^.Hedgehog)^.Gear; |
395 |
dec(Gear^.Timer); |
|
396 |
if (Gear^.Timer = 0)or((Gear^.Message and gm_Destroy) <> 0)or((HHGear^.State and gstHHDriven) = 0) then |
|
4 | 397 |
begin |
282 | 398 |
StopSound(sndPickhammer); |
4 | 399 |
DeleteGear(Gear); |
400 |
AfterAttack; |
|
401 |
exit |
|
402 |
end; |
|
422 | 403 |
|
404 |
if (Gear^.Timer mod 33) = 0 then |
|
405 |
doMakeExplosion(hwRound(Gear^.X), hwRound(Gear^.Y) + 6, 6, EXPLDontDraw); |
|
406 |
||
407 |
if (Gear^.Timer mod 47) = 0 then |
|
4 | 408 |
begin |
371 | 409 |
i:= hwRound(Gear^.X) - Gear^.Radius - LongInt(GetRandom(2)); |
410 |
ei:= hwRound(Gear^.X) + Gear^.Radius + LongInt(GetRandom(2)); |
|
4 | 411 |
while i <= ei do |
412 |
begin |
|
422 | 413 |
DrawExplosion(i, hwRound(Gear^.Y) + 3, 3); |
4 | 414 |
inc(i, 1) |
415 |
end; |
|
351 | 416 |
Gear^.X:= Gear^.X + Gear^.dX; |
417 |
Gear^.Y:= Gear^.Y + _1_9; |
|
42 | 418 |
SetAllHHToActive; |
4 | 419 |
end; |
420 |
if TestCollisionYwithGear(Gear, 1) then |
|
421 |
begin |
|
498 | 422 |
Gear^.dY:= _0; |
351 | 423 |
SetLittle(HHGear^.dX); |
498 | 424 |
HHGear^.dY:= _0; |
4 | 425 |
end else |
426 |
begin |
|
351 | 427 |
Gear^.dY:= Gear^.dY + cGravity; |
428 |
Gear^.Y:= Gear^.Y + Gear^.dY; |
|
498 | 429 |
if Gear^.Y > _1024 then Gear^.Timer:= 1 |
4 | 430 |
end; |
431 |
||
351 | 432 |
Gear^.X:= Gear^.X + HHGear^.dX; |
433 |
HHGear^.X:= Gear^.X; |
|
498 | 434 |
HHGear^.Y:= Gear^.Y - int2hwFloat(cHHRadius); |
4 | 435 |
|
351 | 436 |
if (Gear^.Message and gm_Attack) <> 0 then |
437 |
if (Gear^.State and gsttmpFlag) <> 0 then Gear^.Timer:= 1 else else |
|
438 |
if (Gear^.State and gsttmpFlag) = 0 then Gear^.State:= Gear^.State or gsttmpFlag; |
|
439 |
if ((Gear^.Message and gm_Left) <> 0) then Gear^.dX:= - _0_3 else |
|
440 |
if ((Gear^.Message and gm_Right) <> 0) then Gear^.dX:= _0_3 |
|
498 | 441 |
else Gear^.dX:= _0; |
4 | 442 |
end; |
443 |
||
444 |
procedure doStepPickHammer(Gear: PGear); |
|
371 | 445 |
var i, y: LongInt; |
4 | 446 |
ar: TRangeArray; |
447 |
begin |
|
448 |
i:= 0; |
|
498 | 449 |
y:= hwRound(Gear^.Y) - cHHRadius * 2; |
351 | 450 |
while y < hwRound(Gear^.Y) do |
4 | 451 |
begin |
371 | 452 |
ar[i].Left := hwRound(Gear^.X) - Gear^.Radius - LongInt(GetRandom(2)); |
453 |
ar[i].Right:= hwRound(Gear^.X) + Gear^.Radius + LongInt(GetRandom(2)); |
|
4 | 454 |
inc(y, 2); |
455 |
inc(i) |
|
456 |
end; |
|
498 | 457 |
DrawHLinesExplosions(@ar, 3, hwRound(Gear^.Y) - cHHRadius * 2, 2, Pred(i)); |
351 | 458 |
Gear^.dY:= PHedgehog(Gear^.Hedgehog)^.Gear^.dY; |
282 | 459 |
PlaySound(sndPickhammer, true); |
4 | 460 |
doStepPickHammerWork(Gear); |
351 | 461 |
Gear^.doStep:= @doStepPickHammerWork |
4 | 462 |
end; |
463 |
||
464 |
//////////////////////////////////////////////////////////////////////////////// |
|
371 | 465 |
var BTPrevAngle, BTSteps: LongInt; |
302 | 466 |
|
303
1659c4aad5ab
Now blow torch angle can be changed during blowing :)
unc0rr
parents:
302
diff
changeset
|
467 |
procedure doStepBlowTorchWork(Gear: PGear); |
302 | 468 |
var HHGear: PGear; |
305 | 469 |
b: boolean; |
302 | 470 |
begin |
471 |
AllInactive:= false; |
|
351 | 472 |
dec(Gear^.Timer); |
473 |
HHGear:= PHedgehog(Gear^.Hedgehog)^.Gear; |
|
303
1659c4aad5ab
Now blow torch angle can be changed during blowing :)
unc0rr
parents:
302
diff
changeset
|
474 |
|
1659c4aad5ab
Now blow torch angle can be changed during blowing :)
unc0rr
parents:
302
diff
changeset
|
475 |
HedgehogChAngle(HHGear); |
1659c4aad5ab
Now blow torch angle can be changed during blowing :)
unc0rr
parents:
302
diff
changeset
|
476 |
|
305 | 477 |
b:= false; |
478 |
||
371 | 479 |
if abs(LongInt(HHGear^.Angle) - BTPrevAngle) > 7 then |
305 | 480 |
begin |
498 | 481 |
Gear^.dX:= SignAs(AngleSin(HHGear^.Angle) * _0_5, HHGear^.dX); |
355 | 482 |
Gear^.dY:= AngleCos(HHGear^.Angle) * ( - _0_5); |
351 | 483 |
BTPrevAngle:= HHGear^.Angle; |
358 | 484 |
b:= true |
305 | 485 |
end; |
486 |
||
351 | 487 |
if Gear^.Timer mod cHHStepTicks = 0 then |
302 | 488 |
begin |
305 | 489 |
b:= true; |
498 | 490 |
if Gear^.dX.isNegative then HHGear^.Message:= (HHGear^.Message or gm_Left) and not gm_Right |
491 |
else HHGear^.Message:= (HHGear^.Message or gm_Right) and not gm_Left; |
|
357 | 492 |
|
493 |
HHGear^.State:= HHGear^.State and not gstAttacking; |
|
302 | 494 |
HedgehogStep(HHGear); |
357 | 495 |
HHGear^.State:= HHGear^.State or gstAttacking; |
305 | 496 |
|
497 |
inc(BTSteps); |
|
511 | 498 |
if BTSteps = 7 then |
305 | 499 |
begin |
500 |
BTSteps:= 0; |
|
511 | 501 |
Gear^.X:= HHGear^.X + Gear^.dX * (cHHRadius + cBlowTorchC); |
502 |
Gear^.Y:= HHGear^.Y + Gear^.dY * (cHHRadius + cBlowTorchC); |
|
351 | 503 |
HHGear^.State:= HHGear^.State or gstNoDamage; |
511 | 504 |
AmmoShove(Gear, 2, 14); |
351 | 505 |
HHGear^.State:= HHGear^.State and not gstNoDamage |
305 | 506 |
end; |
507 |
||
351 | 508 |
if (HHGear^.State and gstFalling) <> 0 then Gear^.Timer:= 0 |
302 | 509 |
end; |
305 | 510 |
|
511 |
if b then |
|
498 | 512 |
DrawTunnel(HHGear^.X - Gear^.dX * cHHRadius, HHGear^.Y - _4 - Gear^.dY * cHHRadius + hwAbs(Gear^.dY) * 7, |
351 | 513 |
Gear^.dX, Gear^.dY, |
306 | 514 |
cHHRadius * 5, cHHRadius * 2 + 6); |
305 | 515 |
|
351 | 516 |
if (Gear^.Timer = 0) or ((HHGear^.Message and gm_Attack) <> 0) then |
302 | 517 |
begin |
351 | 518 |
HHGear^.Message:= 0; |
302 | 519 |
DeleteGear(Gear); |
520 |
AfterAttack |
|
521 |
end |
|
522 |
end; |
|
523 |
||
303
1659c4aad5ab
Now blow torch angle can be changed during blowing :)
unc0rr
parents:
302
diff
changeset
|
524 |
procedure doStepBlowTorch(Gear: PGear); |
1659c4aad5ab
Now blow torch angle can be changed during blowing :)
unc0rr
parents:
302
diff
changeset
|
525 |
var HHGear: PGear; |
1659c4aad5ab
Now blow torch angle can be changed during blowing :)
unc0rr
parents:
302
diff
changeset
|
526 |
begin |
371 | 527 |
BTPrevAngle:= High(LongInt); |
305 | 528 |
BTSteps:= 0; |
351 | 529 |
HHGear:= PHedgehog(Gear^.Hedgehog)^.Gear; |
530 |
HHGear^.Message:= 0; |
|
531 |
Gear^.doStep:= @doStepBlowTorchWork |
|
303
1659c4aad5ab
Now blow torch angle can be changed during blowing :)
unc0rr
parents:
302
diff
changeset
|
532 |
end; |
1659c4aad5ab
Now blow torch angle can be changed during blowing :)
unc0rr
parents:
302
diff
changeset
|
533 |
|
302 | 534 |
//////////////////////////////////////////////////////////////////////////////// |
535 |
||
4 | 536 |
procedure doStepRopeWork(Gear: PGear); |
70 | 537 |
const flCheck: boolean = false; |
4 | 538 |
var HHGear: PGear; |
351 | 539 |
len, cs, cc, tx, ty: hwFloat; |
108 | 540 |
lx, ly: LongInt; |
4 | 541 |
|
542 |
procedure DeleteMe; |
|
543 |
begin |
|
544 |
with HHGear^ do |
|
545 |
begin |
|
546 |
Message:= Message and not gm_Attack; |
|
547 |
State:= State or gstFalling; |
|
548 |
end; |
|
549 |
DeleteGear(Gear); |
|
534 | 550 |
OnUsedAmmo(PHedgehog(HHGear^.Hedgehog)^); |
351 | 551 |
ApplyAmmoChanges(PHedgehog(HHGear^.Hedgehog)^) |
4 | 552 |
end; |
553 |
||
554 |
begin |
|
351 | 555 |
HHGear:= PHedgehog(Gear^.Hedgehog)^.Gear; |
108 | 556 |
|
351 | 557 |
if ((HHGear^.State and gstHHDriven) = 0) |
80 | 558 |
or (CheckGearDrowning(HHGear)) then |
4 | 559 |
begin |
560 |
DeleteMe; |
|
561 |
exit |
|
562 |
end; |
|
351 | 563 |
Gear^.dX:= HHGear^.X - Gear^.X; |
564 |
Gear^.dY:= HHGear^.Y - Gear^.Y; |
|
4 | 565 |
|
351 | 566 |
if (Gear^.Message and gm_Left <> 0) then HHGear^.dX:= HHGear^.dX - _0_0002 else |
567 |
if (Gear^.Message and gm_Right <> 0) then HHGear^.dX:= HHGear^.dX + _0_0002; |
|
4 | 568 |
|
351 | 569 |
if not TestCollisionYwithGear(HHGear, 1) then HHGear^.dY:= HHGear^.dY + cGravity; |
4 | 570 |
|
351 | 571 |
cs:= Gear^.dY + HHGear^.dY; |
572 |
cc:= Gear^.dX + HHGear^.dX; |
|
498 | 573 |
len:= _1 / Distance(cc, cs); |
108 | 574 |
cc:= cc * len; |
575 |
cs:= cs * len; |
|
4 | 576 |
|
577 |
flCheck:= not flCheck; |
|
578 |
if flCheck then // check whether rope needs dividing |
|
579 |
begin |
|
498 | 580 |
len:= Gear^.Elasticity - _20; |
581 |
while len > _5 do |
|
4 | 582 |
begin |
583 |
tx:= cc*len; |
|
584 |
ty:= cs*len; |
|
351 | 585 |
lx:= hwRound(Gear^.X + tx) + hwSign(HHGear^.dX); |
586 |
ly:= hwRound(Gear^.Y + ty) + hwSign(HHGear^.dY); |
|
4 | 587 |
if ((ly and $FFFFFC00) = 0) and ((lx and $FFFFF800) = 0)and (Land[ly, lx] <> 0) then |
588 |
begin |
|
589 |
with RopePoints.ar[RopePoints.Count] do |
|
590 |
begin |
|
351 | 591 |
X:= Gear^.X; |
592 |
Y:= Gear^.Y; |
|
370
c75410fe3133
- Repair bots: they can walk and use bazooka, possible cannot jump (why?)
unc0rr
parents:
358
diff
changeset
|
593 |
if RopePoints.Count = 0 then RopePoints.HookAngle:= DxDy2Angle32(Gear^.dY, Gear^.dX); |
351 | 594 |
b:= (cc * HHGear^.dY) > (cs * HHGear^.dX); |
4 | 595 |
dLen:= len |
596 |
end; |
|
351 | 597 |
Gear^.X:= Gear^.X + tx; |
598 |
Gear^.Y:= Gear^.Y + ty; |
|
4 | 599 |
inc(RopePoints.Count); |
351 | 600 |
Gear^.Elasticity:= Gear^.Elasticity - len; |
601 |
Gear^.Friction:= Gear^.Friction - len; |
|
4 | 602 |
break |
603 |
end; |
|
498 | 604 |
len:= len - _3 |
4 | 605 |
end; |
606 |
end else |
|
607 |
if RopePoints.Count > 0 then // check whether the last dividing point could be removed |
|
608 |
begin |
|
609 |
tx:= RopePoints.ar[Pred(RopePoints.Count)].X; |
|
610 |
ty:= RopePoints.ar[Pred(RopePoints.Count)].Y; |
|
351 | 611 |
if RopePoints.ar[Pred(RopePoints.Count)].b xor ((tx - Gear^.X) * (ty - HHGear^.Y) > (tx - HHGear^.X) * (ty - Gear^.Y)) then |
4 | 612 |
begin |
613 |
dec(RopePoints.Count); |
|
351 | 614 |
Gear^.X:=RopePoints.ar[RopePoints.Count].X; |
615 |
Gear^.Y:=RopePoints.ar[RopePoints.Count].Y; |
|
616 |
Gear^.Elasticity:= Gear^.Elasticity + RopePoints.ar[RopePoints.Count].dLen; |
|
617 |
Gear^.Friction:= Gear^.Friction + RopePoints.ar[RopePoints.Count].dLen |
|
4 | 618 |
end |
619 |
end; |
|
620 |
||
351 | 621 |
Gear^.dX:= HHGear^.X - Gear^.X; |
622 |
Gear^.dY:= HHGear^.Y - Gear^.Y; |
|
108 | 623 |
|
351 | 624 |
cs:= Gear^.dY + HHGear^.dY; |
625 |
cc:= Gear^.dX + HHGear^.dX; |
|
498 | 626 |
len:= _1 / Distance(cc, cs); |
108 | 627 |
cc:= cc * len; |
628 |
cs:= cs * len; |
|
4 | 629 |
|
351 | 630 |
HHGear^.dX:= HHGear^.X; |
631 |
HHGear^.dY:= HHGear^.Y; |
|
4 | 632 |
|
351 | 633 |
if ((Gear^.Message and gm_Down) <> 0) and (Gear^.Elasticity < Gear^.Friction) then |
634 |
if not (TestCollisionXwithGear(HHGear, hwSign(Gear^.dX)) |
|
635 |
or TestCollisionYwithGear(HHGear, hwSign(Gear^.dY))) then Gear^.Elasticity:= Gear^.Elasticity + _0_3; |
|
4 | 636 |
|
498 | 637 |
if ((Gear^.Message and gm_Up) <> 0) and (Gear^.Elasticity > _30) then |
351 | 638 |
if not (TestCollisionXwithGear(HHGear, -hwSign(Gear^.dX)) |
639 |
or TestCollisionYwithGear(HHGear, -hwSign(Gear^.dY))) then Gear^.Elasticity:= Gear^.Elasticity - _0_3; |
|
4 | 640 |
|
351 | 641 |
HHGear^.X:= Gear^.X + cc*Gear^.Elasticity; |
642 |
HHGear^.Y:= Gear^.Y + cs*Gear^.Elasticity; |
|
4 | 643 |
|
351 | 644 |
HHGear^.dX:= HHGear^.X - HHGear^.dX; |
645 |
HHGear^.dY:= HHGear^.Y - HHGear^.dY; |
|
4 | 646 |
|
351 | 647 |
if TestCollisionXwithGear(HHGear, hwSign(HHGear^.dX)) then |
648 |
HHGear^.dX:= -_0_6 * HHGear^.dX; |
|
649 |
if TestCollisionYwithGear(HHGear, hwSign(HHGear^.dY)) then |
|
650 |
HHGear^.dY:= -_0_6 * HHGear^.dY; |
|
4 | 651 |
|
351 | 652 |
if (Gear^.Message and gm_Attack) <> 0 then |
653 |
if (Gear^.State and gsttmpFlag) <> 0 then DeleteMe else |
|
654 |
else if (Gear^.State and gsttmpFlag) = 0 then Gear^.State:= Gear^.State or gsttmpFlag; |
|
4 | 655 |
end; |
656 |
||
657 |
||
658 |
procedure doStepRopeAttach(Gear: PGear); |
|
659 |
var HHGear: PGear; |
|
351 | 660 |
tx, ty, tt: hwFloat; |
4 | 661 |
begin |
351 | 662 |
Gear^.X:= Gear^.X - Gear^.dX; |
663 |
Gear^.Y:= Gear^.Y - Gear^.dY; |
|
498 | 664 |
Gear^.Elasticity:= Gear^.Elasticity + _1; |
351 | 665 |
HHGear:= PHedgehog(Gear^.Hedgehog)^.Gear; |
517 | 666 |
DeleteCI(HHGear); |
351 | 667 |
if (HHGear^.State and gstFalling) <> 0 then |
68 | 668 |
if TestCollisionYwithGear(HHGear, 1) then |
4 | 669 |
begin |
498 | 670 |
HHGear^.dY:= _0; |
4 | 671 |
CheckHHDamage(HHGear); |
351 | 672 |
HHGear^.State:= HHGear^.State and not (gstFalling or gstHHJumping); |
4 | 673 |
end else |
674 |
begin |
|
351 | 675 |
if TestCollisionXwithGear(HHGear, hwSign(HHGear^.dX)) then SetLittle(HHGear^.dX); |
676 |
HHGear^.X:= HHGear^.X + HHGear^.dX; |
|
677 |
HHGear^.Y:= HHGear^.Y + HHGear^.dY; |
|
678 |
Gear^.X:= Gear^.X + HHGear^.dX; |
|
679 |
Gear^.Y:= Gear^.Y + HHGear^.dY; |
|
680 |
HHGear^.dY:= HHGear^.dY + cGravity; |
|
681 |
tt:= Gear^.Elasticity; |
|
498 | 682 |
tx:= _0; |
683 |
ty:= _0; |
|
684 |
while tt > _20 do |
|
4 | 685 |
begin |
517 | 686 |
if TestCollisionXwithXYShift(Gear, tx, hwRound(ty), -hwSign(Gear^.dX)) |
687 |
or TestCollisionYwithXYShift(Gear, hwRound(tx), hwRound(ty), -hwSign(Gear^.dY)) then |
|
4 | 688 |
begin |
351 | 689 |
Gear^.X:= Gear^.X + tx; |
690 |
Gear^.Y:= Gear^.Y + ty; |
|
691 |
Gear^.Elasticity:= tt; |
|
692 |
Gear^.doStep:= @doStepRopeWork; |
|
4 | 693 |
with HHGear^ do State:= State and not gstAttacking; |
498 | 694 |
tt:= _0 |
4 | 695 |
end; |
517 | 696 |
tx:= tx + Gear^.dX + Gear^.dX; |
697 |
ty:= ty + Gear^.dY + Gear^.dY; |
|
498 | 698 |
tt:= tt - _2; |
4 | 699 |
end; |
700 |
end; |
|
701 |
CheckCollision(Gear); |
|
351 | 702 |
if (Gear^.State and gstCollision) <> 0 then |
4 | 703 |
begin |
351 | 704 |
Gear^.doStep:= @doStepRopeWork; |
4 | 705 |
with HHGear^ do State:= State and not gstAttacking; |
498 | 706 |
if Gear^.Elasticity < _10 then |
707 |
Gear^.Elasticity:= _10000; |
|
4 | 708 |
end; |
709 |
||
351 | 710 |
if (Gear^.Elasticity > Gear^.Friction) or ((Gear^.Message and gm_Attack) = 0) then |
4 | 711 |
begin |
351 | 712 |
with PHedgehog(Gear^.Hedgehog)^.Gear^ do |
4 | 713 |
begin |
714 |
State:= State and not gstAttacking; |
|
715 |
Message:= Message and not gm_Attack |
|
716 |
end; |
|
717 |
DeleteGear(Gear) |
|
718 |
end |
|
719 |
end; |
|
720 |
||
721 |
procedure doStepRope(Gear: PGear); |
|
722 |
begin |
|
351 | 723 |
Gear^.dX:= - Gear^.dX; |
724 |
Gear^.dY:= - Gear^.dY; |
|
725 |
Gear^.doStep:= @doStepRopeAttach |
|
4 | 726 |
end; |
727 |
||
728 |
//////////////////////////////////////////////////////////////////////////////// |
|
729 |
procedure doStepSmokeTrace(Gear: PGear); |
|
730 |
begin |
|
351 | 731 |
inc(Gear^.Timer); |
732 |
if Gear^.Timer > 64 then |
|
4 | 733 |
begin |
351 | 734 |
Gear^.Timer:= 0; |
735 |
dec(Gear^.State) |
|
4 | 736 |
end; |
351 | 737 |
Gear^.dX:= Gear^.dX + cWindSpeed; |
738 |
Gear^.X:= Gear^.X + Gear^.dX; |
|
739 |
if Gear^.State = 0 then DeleteGear(Gear) |
|
4 | 740 |
end; |
9 | 741 |
|
742 |
//////////////////////////////////////////////////////////////////////////////// |
|
743 |
procedure doStepExplosion(Gear: PGear); |
|
744 |
begin |
|
351 | 745 |
inc(Gear^.Timer); |
746 |
if Gear^.Timer > 75 then |
|
9 | 747 |
begin |
351 | 748 |
inc(Gear^.State); |
749 |
Gear^.Timer:= 0; |
|
750 |
if Gear^.State > 5 then DeleteGear(Gear) |
|
9 | 751 |
end; |
752 |
end; |
|
10 | 753 |
|
754 |
//////////////////////////////////////////////////////////////////////////////// |
|
755 |
procedure doStepMine(Gear: PGear); |
|
756 |
begin |
|
503 | 757 |
if (Gear^.State and (gstMoving or gstFalling)) <> 0 then |
10 | 758 |
begin |
503 | 759 |
DeleteCI(Gear); |
10 | 760 |
doStepFallingGear(Gear); |
503 | 761 |
if (Gear^.State and (gstMoving or gstFalling)) = 0 then |
13 | 762 |
begin |
503 | 763 |
AddGearCI(Gear); |
498 | 764 |
Gear^.dX:= _0; |
765 |
Gear^.dY:= _0 |
|
13 | 766 |
end; |
767 |
CalcRotationDirAngle(Gear); |
|
10 | 768 |
AllInactive:= false |
769 |
end; |
|
351 | 770 |
|
771 |
if ((Gear^.State and gsttmpFlag) <> 0) then |
|
772 |
if ((Gear^.State and gstAttacking) = 0) then |
|
14
81f125629b25
- Mine checks whether a hedgehog is near less frequently
unc0rr
parents:
13
diff
changeset
|
773 |
begin |
39 | 774 |
if ((GameTicks and $F) = 0) then |
351 | 775 |
if CheckGearNear(Gear, gtHedgehog, 46, 32) <> nil then Gear^.State:= Gear^.State or gstAttacking |
14
81f125629b25
- Mine checks whether a hedgehog is near less frequently
unc0rr
parents:
13
diff
changeset
|
776 |
end else // gstAttacking <> 0 |
10 | 777 |
begin |
778 |
AllInactive:= false; |
|
351 | 779 |
if (Gear^.Timer and $FF) = 0 then PlaySound(sndMineTick, false); |
780 |
if Gear^.Timer = 0 then |
|
10 | 781 |
begin |
351 | 782 |
doMakeExplosion(hwRound(Gear^.X), hwRound(Gear^.Y), 50, EXPLAutoSound); |
521 | 783 |
DeleteGear(Gear); |
784 |
exit |
|
10 | 785 |
end; |
351 | 786 |
dec(Gear^.Timer); |
13 | 787 |
end else // gsttmpFlag = 0 |
351 | 788 |
if TurnTimeLeft = 0 then Gear^.State:= Gear^.State or gsttmpFlag; |
10 | 789 |
end; |
57 | 790 |
|
39 | 791 |
//////////////////////////////////////////////////////////////////////////////// |
792 |
procedure doStepDynamite(Gear: PGear); |
|
793 |
begin |
|
43 | 794 |
doStepFallingGear(Gear); |
795 |
AllInactive:= false; |
|
351 | 796 |
if Gear^.Timer mod 166 = 0 then inc(Gear^.Tag); |
797 |
if Gear^.Timer = 0 then |
|
39 | 798 |
begin |
351 | 799 |
doMakeExplosion(hwRound(Gear^.X), hwRound(Gear^.Y), 75, EXPLAutoSound); |
43 | 800 |
DeleteGear(Gear); |
801 |
exit |
|
39 | 802 |
end; |
351 | 803 |
dec(Gear^.Timer); |
39 | 804 |
end; |
14
81f125629b25
- Mine checks whether a hedgehog is near less frequently
unc0rr
parents:
13
diff
changeset
|
805 |
|
351 | 806 |
/////////////////////////////////////////////////////////////////////////////// |
14
81f125629b25
- Mine checks whether a hedgehog is near less frequently
unc0rr
parents:
13
diff
changeset
|
807 |
procedure doStepCase(Gear: PGear); |
371 | 808 |
var i, x, y: LongInt; |
14
81f125629b25
- Mine checks whether a hedgehog is near less frequently
unc0rr
parents:
13
diff
changeset
|
809 |
begin |
351 | 810 |
if (Gear^.Message and gm_Destroy) > 0 then |
15 | 811 |
begin |
812 |
DeleteGear(Gear); |
|
435 | 813 |
FreeActionsList; |
441 | 814 |
with CurrentTeam^.Hedgehogs[CurrentTeam^.CurrHedgehog] do |
815 |
if Gear <> nil then Gear^.Message:= Gear^.Message and not (gm_LJump or gm_HJump); |
|
15 | 816 |
exit |
817 |
end; |
|
818 |
||
351 | 819 |
if Gear^.Damage > 0 then |
79 | 820 |
begin |
351 | 821 |
x:= hwRound(Gear^.X); |
822 |
y:= hwRound(Gear^.Y); |
|
79 | 823 |
DeleteGear(Gear); |
89 | 824 |
doMakeExplosion(x, y, 25, EXPLAutoSound); |
79 | 825 |
for i:= 0 to 63 do |
498 | 826 |
AddGear(x, y, gtFlame, 0, _0, _0, 0); |
79 | 827 |
exit |
828 |
end; |
|
829 |
||
351 | 830 |
if (Gear^.dY.QWordValue <> 0) or (not TestCollisionYwithGear(Gear, 1)) then |
14
81f125629b25
- Mine checks whether a hedgehog is near less frequently
unc0rr
parents:
13
diff
changeset
|
831 |
begin |
81f125629b25
- Mine checks whether a hedgehog is near less frequently
unc0rr
parents:
13
diff
changeset
|
832 |
AllInactive:= false; |
351 | 833 |
Gear^.dY:= Gear^.dY + cGravity; |
834 |
Gear^.Y:= Gear^.Y + Gear^.dY; |
|
498 | 835 |
if (Gear^.dY.isNegative) and TestCollisionYwithGear(Gear, -1) then Gear^.dY:= _0 else |
439 | 836 |
if (not Gear^.dY.isNegative) and TestCollisionYwithGear(Gear, 1) then |
14
81f125629b25
- Mine checks whether a hedgehog is near less frequently
unc0rr
parents:
13
diff
changeset
|
837 |
begin |
351 | 838 |
Gear^.dY:= - Gear^.dY * Gear^.Elasticity; |
498 | 839 |
if Gear^.dY > - _0_001 then Gear^.dY:= _0 |
351 | 840 |
else if Gear^.dY < - _0_03 then PlaySound(sndGraveImpact, false); |
14
81f125629b25
- Mine checks whether a hedgehog is near less frequently
unc0rr
parents:
13
diff
changeset
|
841 |
end; |
81f125629b25
- Mine checks whether a hedgehog is near less frequently
unc0rr
parents:
13
diff
changeset
|
842 |
CheckGearDrowning(Gear); |
81f125629b25
- Mine checks whether a hedgehog is near less frequently
unc0rr
parents:
13
diff
changeset
|
843 |
end; |
81f125629b25
- Mine checks whether a hedgehog is near less frequently
unc0rr
parents:
13
diff
changeset
|
844 |
|
511 | 845 |
if (Gear^.dY.QWordValue = 0) then AddGearCI(Gear) |
846 |
else if (Gear^.dY.QWordValue <> 0) then DeleteCI(Gear) |
|
14
81f125629b25
- Mine checks whether a hedgehog is near less frequently
unc0rr
parents:
13
diff
changeset
|
847 |
end; |
49 | 848 |
|
849 |
//////////////////////////////////////////////////////////////////////////////// |
|
850 |
var thexchar: array[0..5] of record |
|
371 | 851 |
oy, ny: LongInt; |
49 | 852 |
team: PTeam; |
853 |
end; |
|
854 |
thexchcnt: Longword; |
|
143 | 855 |
currsorter: PGear; |
49 | 856 |
|
857 |
procedure doStepTeamHealthSorterWork(Gear: PGear); |
|
371 | 858 |
var i: LongInt; |
49 | 859 |
begin |
860 |
AllInactive:= false; |
|
351 | 861 |
dec(Gear^.Timer); |
862 |
if (Gear^.Timer and 15) = 0 then |
|
49 | 863 |
for i:= 0 to Pred(thexchcnt) do |
864 |
with thexchar[i] do |
|
865 |
{$WARNINGS OFF} |
|
351 | 866 |
team^.DrawHealthY:= ny + (oy - ny) * Gear^.Timer div 640; |
49 | 867 |
{$WARNINGS ON} |
351 | 868 |
if (Gear^.Timer = 0) or (currsorter <> Gear) then |
143 | 869 |
begin |
870 |
if currsorter = Gear then currsorter:= nil; |
|
49 | 871 |
DeleteGear(Gear) |
143 | 872 |
end |
49 | 873 |
end; |
874 |
||
875 |
procedure doStepTeamHealthSorter(Gear: PGear); |
|
876 |
var team: PTeam; |
|
877 |
i, t: Longword; |
|
878 |
begin |
|
879 |
AllInactive:= false; |
|
880 |
team:= TeamsList; |
|
881 |
i:= 0; |
|
882 |
while team <> nil do |
|
883 |
begin |
|
351 | 884 |
thexchar[i].oy:= team^.DrawHealthY; |
49 | 885 |
thexchar[i].team:= team; |
886 |
inc(i); |
|
351 | 887 |
team:= team^.Next |
49 | 888 |
end; |
889 |
thexchcnt:= i; |
|
890 |
for i:= 1 to thexchcnt do |
|
891 |
for t:= 0 to thexchcnt - 2 do |
|
351 | 892 |
if thexchar[t].team^.TeamHealthBarWidth > thexchar[Succ(t)].team^.TeamHealthBarWidth then |
49 | 893 |
begin |
894 |
thexchar[5]:= thexchar[t]; |
|
895 |
thexchar[t]:= thexchar[Succ(t)]; |
|
896 |
thexchar[Succ(t)]:= thexchar[5] |
|
897 |
end; |
|
898 |
t:= cScreenHeight - 4; |
|
899 |
for i:= 0 to Pred(thexchcnt) do |
|
900 |
with thexchar[i] do |
|
901 |
begin |
|
351 | 902 |
dec(t, team^.HealthRect.h + 2); |
49 | 903 |
ny:= t |
904 |
end; |
|
351 | 905 |
Gear^.Timer:= 640; |
906 |
Gear^.doStep:= @doStepTeamHealthSorterWork; |
|
143 | 907 |
currsorter:= Gear |
49 | 908 |
end; |
909 |
||
79 | 910 |
//////////////////////////////////////////////////////////////////////////////// |
911 |
procedure doStepShover(Gear: PGear); |
|
912 |
var HHGear: PGear; |
|
913 |
begin |
|
351 | 914 |
HHGear:= PHedgehog(Gear^.Hedgehog)^.Gear; |
915 |
HHGear^.State:= HHGear^.State or gstNoDamage; |
|
79 | 916 |
AmmoShove(Gear, 30, 115); |
351 | 917 |
HHGear^.State:= HHGear^.State and not gstNoDamage; |
79 | 918 |
DeleteGear(Gear) |
919 |
end; |
|
920 |
||
921 |
//////////////////////////////////////////////////////////////////////////////// |
|
922 |
procedure doStepFlame(Gear: PGear); |
|
923 |
begin |
|
924 |
AllInactive:= false; |
|
925 |
if not TestCollisionYwithGear(Gear, 1) then |
|
926 |
begin |
|
351 | 927 |
Gear^.dX:= Gear^.dX + cWindSpeed; |
928 |
Gear^.dY:= Gear^.dY + cGravity; |
|
929 |
if hwAbs(Gear^.dX) > _0_1 then Gear^.dX:= Gear^.dX * _0_5; |
|
930 |
if Gear^.dY > _0_1 then Gear^.dY:= Gear^.dY * _0_995; |
|
931 |
Gear^.X:= Gear^.X + Gear^.dX; |
|
932 |
Gear^.Y:= Gear^.Y + Gear^.dY; |
|
498 | 933 |
if not (Gear^.Y < _1024) then |
79 | 934 |
begin |
935 |
DeleteGear(Gear); |
|
936 |
exit |
|
937 |
end |
|
938 |
end else begin |
|
351 | 939 |
if Gear^.Timer > 0 then dec(Gear^.Timer) |
79 | 940 |
else begin |
506 | 941 |
// doMakeExplosion(hwRound(Gear^.X), hwRound(Gear^.Y), 2, 0); |
351 | 942 |
dec(Gear^.Health); |
943 |
Gear^.Timer:= 1250 - Gear^.Angle * 12 |
|
79 | 944 |
end |
945 |
end; |
|
946 |
||
351 | 947 |
if (((GameTicks div 8) mod 64) = Gear^.Angle) then |
79 | 948 |
AmmoFlameWork(Gear); |
949 |
||
351 | 950 |
if Gear^.Health = 0 then |
79 | 951 |
DeleteGear(Gear) |
952 |
end; |
|
82 | 953 |
|
954 |
//////////////////////////////////////////////////////////////////////////////// |
|
955 |
procedure doStepFirePunchWork(Gear: PGear); |
|
956 |
var HHGear: PGear; |
|
957 |
begin |
|
958 |
AllInactive:= false; |
|
351 | 959 |
if ((Gear^.Message and gm_Destroy) <> 0) then |
82 | 960 |
begin |
961 |
DeleteGear(Gear); |
|
962 |
AfterAttack; |
|
963 |
exit |
|
964 |
end; |
|
965 |
||
351 | 966 |
HHGear:= PHedgehog(Gear^.Hedgehog)^.Gear; |
967 |
if hwRound(HHGear^.Y) <= Gear^.Tag - 2 then |
|
82 | 968 |
begin |
351 | 969 |
Gear^.Tag:= hwRound(HHGear^.Y); |
498 | 970 |
DrawTunnel(HHGear^.X - int2hwFloat(cHHRadius), HHGear^.Y - _1, _0_5, _0, cHHRadius * 4, 2); |
351 | 971 |
HHGear^.State:= HHGear^.State or gstNoDamage; |
972 |
Gear^.Y:= HHGear^.Y; |
|
82 | 973 |
AmmoShove(Gear, 30, 40); |
351 | 974 |
HHGear^.State:= HHGear^.State and not gstNoDamage |
82 | 975 |
end; |
351 | 976 |
|
977 |
HHGear^.dY:= HHGear^.dY + cGravity; |
|
978 |
if not (HHGear^.dY.isNegative) then |
|
82 | 979 |
begin |
351 | 980 |
HHGear^.State:= HHGear^.State or gstFalling; |
82 | 981 |
DeleteGear(Gear); |
982 |
AfterAttack; |
|
983 |
exit |
|
984 |
end; |
|
351 | 985 |
HHGear^.Y:= HHGear^.Y + HHGear^.dY |
82 | 986 |
end; |
987 |
||
988 |
procedure doStepFirePunch(Gear: PGear); |
|
989 |
var HHGear: PGear; |
|
990 |
begin |
|
991 |
AllInactive:= false; |
|
351 | 992 |
HHGear:= PHedgehog(Gear^.Hedgehog)^.Gear; |
514 | 993 |
DeleteCI(HHGear); |
498 | 994 |
HHGear^.X:= int2hwFloat(hwRound(HHGear^.X)) - _0_5; |
351 | 995 |
SetLittle(HHGear^.dX); |
996 |
HHGear^.dY:= - _0_3; |
|
82 | 997 |
|
351 | 998 |
Gear^.X:= HHGear^.X; |
498 | 999 |
Gear^.dX:= SignAs(_0_45, HHGear^.dX); |
351 | 1000 |
Gear^.dY:= - _0_9; |
1001 |
Gear^.doStep:= @doStepFirePunchWork; |
|
498 | 1002 |
DrawTunnel(HHGear^.X - int2hwFloat(cHHRadius), HHGear^.Y + _1, _0_5, _0, cHHRadius * 4, 5); |
82 | 1003 |
end; |
1004 |
||
263 | 1005 |
//////////////////////////////////////////////////////////////////////////////// |
1006 |
||
211 | 1007 |
procedure doStepParachute(Gear: PGear); |
1008 |
var HHGear: PGear; |
|
1009 |
begin |
|
351 | 1010 |
HHGear:= PHedgehog(Gear^.Hedgehog)^.Gear; |
1011 |
HHGear^.State:= HHGear^.State and not gstAttacking; |
|
517 | 1012 |
DeleteCI(HHGear); |
82 | 1013 |
|
516 | 1014 |
inc(Gear^.Timer); |
1015 |
||
212 | 1016 |
if TestCollisionYwithGear(HHGear, 1) |
351 | 1017 |
or ((HHGear^.State and gstHHDriven) = 0) |
212 | 1018 |
or CheckGearDrowning(HHGear) then |
211 | 1019 |
begin |
1020 |
with HHGear^ do |
|
1021 |
begin |
|
1022 |
Message:= 0; |
|
351 | 1023 |
SetLittle(dx); |
498 | 1024 |
dY:= _0; |
211 | 1025 |
State:= State and not (gstAttacking or gstAttacked); |
1026 |
State:= State or gstFalling; |
|
1027 |
end; |
|
1028 |
DeleteGear(Gear); |
|
516 | 1029 |
if Gear^.Timer > 10 then |
1030 |
begin |
|
534 | 1031 |
OnUsedAmmo(PHedgehog(HHGear^.Hedgehog)^); |
516 | 1032 |
ApplyAmmoChanges(PHedgehog(HHGear^.Hedgehog)^) |
1033 |
end; |
|
211 | 1034 |
exit |
1035 |
end; |
|
1036 |
||
351 | 1037 |
if not TestCollisionXwithGear(HHGear, hwSign(HHGear^.dX)) then |
1038 |
HHGear^.X:= HHGear^.X + cWindSpeed * 200; |
|
211 | 1039 |
|
351 | 1040 |
if (Gear^.Message and gm_Left) <> 0 then HHGear^.X:= HHGear^.X - cMaxWindSpeed * 40 |
1041 |
else if (Gear^.Message and gm_Right) <> 0 then HHGear^.X:= HHGear^.X + cMaxWindSpeed * 40; |
|
1042 |
if (Gear^.Message and gm_Up) <> 0 then HHGear^.Y:= HHGear^.Y - cGravity * 40 |
|
1043 |
else if (Gear^.Message and gm_Down) <> 0 then HHGear^.Y:= HHGear^.Y + cGravity * 40; |
|
211 | 1044 |
|
351 | 1045 |
HHGear^.Y:= HHGear^.Y + cGravity * 100; |
263 | 1046 |
end; |
211 | 1047 |
|
263 | 1048 |
//////////////////////////////////////////////////////////////////////////////// |
351 | 1049 |
const cAirPlaneSpeed: hwFloat = (isNegative: false; QWordValue: 6012954214); // 1.4 |
1050 |
cBombsDistance: hwFloat = (isNegative: false; QWordValue: 128849018880); // 30 |
|
1051 |
cBombsSpeed : hwFloat = (isNegative: false; QWordValue: 429496729); |
|
263 | 1052 |
|
1053 |
procedure doStepAirAttackWork(Gear: PGear); |
|
1054 |
begin |
|
1055 |
AllInactive:= false; |
|
498 | 1056 |
Gear^.X:= Gear^.X + cAirPlaneSpeed * Gear^.Tag; |
351 | 1057 |
if (Gear^.Health > 0)and( not (Gear^.X < Gear^.dX))and(Gear^.X < Gear^.dX + cAirPlaneSpeed) then |
263 | 1058 |
begin |
351 | 1059 |
dec(Gear^.Health); |
1060 |
case Gear^.State of |
|
498 | 1061 |
0: FollowGear:= AddGear(hwRound(Gear^.X), hwRound(Gear^.Y), gtAirBomb, 0, cBombsSpeed * Gear^.Tag, _0, 0); |
1062 |
1: FollowGear:= AddGear(hwRound(Gear^.X), hwRound(Gear^.Y), gtMine, 0, cBombsSpeed * Gear^.Tag, _0, 0); |
|
285 | 1063 |
end; |
498 | 1064 |
Gear^.dX:= Gear^.dX + cBombsDistance * Gear^.Tag |
263 | 1065 |
end; |
498 | 1066 |
if (hwRound(Gear^.X) > 3072) or (hwRound(Gear^.X) < -1024) then DeleteGear(Gear) |
263 | 1067 |
end; |
1068 |
||
1069 |
procedure doStepAirAttack(Gear: PGear); |
|
1070 |
begin |
|
1071 |
AllInactive:= false; |
|
408 | 1072 |
if Gear^.X.QWordValue = 0 then Gear^.Tag:= 1 |
1073 |
else Gear^.Tag:= -1; |
|
498 | 1074 |
Gear^.X:= _1024 - _2048 * Gear^.Tag; |
1075 |
Gear^.Y:= -_128; |
|
1076 |
Gear^.dX:= int2hwFloat(TargetPoint.X) - |
|
1077 |
cBombsDistance * _5 * Gear^.Tag / _2; |
|
357 | 1078 |
|
498 | 1079 |
if TargetPoint.Y - hwRound(Gear^.Y) > 0 then |
1080 |
Gear^.dX:= Gear^.dX - cBombsSpeed * hwSqrt((int2hwFloat(TargetPoint.Y) - Gear^.Y) * 2 / cGravity) * Gear^.Tag; |
|
351 | 1081 |
Gear^.Health:= 6; |
1082 |
Gear^.doStep:= @doStepAirAttackWork |
|
263 | 1083 |
end; |
1084 |
||
1085 |
//////////////////////////////////////////////////////////////////////////////// |
|
1086 |
||
1087 |
procedure doStepAirBomb(Gear: PGear); |
|
1088 |
begin |
|
1089 |
AllInactive:= false; |
|
1090 |
doStepFallingGear(Gear); |
|
351 | 1091 |
if (Gear^.State and gstCollision) <> 0 then |
263 | 1092 |
begin |
351 | 1093 |
doMakeExplosion(hwRound(Gear^.X), hwRound(Gear^.Y), 30, EXPLAutoSound); |
263 | 1094 |
DeleteGear(Gear); |
1095 |
exit |
|
1096 |
end; |
|
1097 |
if (GameTicks and $3F) = 0 then |
|
498 | 1098 |
AddGear(hwRound(Gear^.X), hwRound(Gear^.Y), gtSmokeTrace, 0, _0, _0, 0) |
211 | 1099 |
end; |
409 | 1100 |
|
1101 |
//////////////////////////////////////////////////////////////////////////////// |
|
1102 |
||
1103 |
procedure doStepGirder(Gear: PGear); |
|
415 | 1104 |
var HHGear: PGear; |
409 | 1105 |
begin |
1106 |
AllInactive:= false; |
|
415 | 1107 |
|
1108 |
HHGear:= PHedgehog(Gear^.Hedgehog)^.Gear; |
|
409 | 1109 |
if not TryPlaceOnLand(TargetPoint.X - SpritesData[sprAmGirder].Width div 2, |
1110 |
TargetPoint.Y - SpritesData[sprAmGirder].Height div 2, |
|
520 | 1111 |
sprAmGirder, Gear^.State, true) then |
409 | 1112 |
begin |
415 | 1113 |
HHGear^.Message:= HHGear^.Message and not gm_Attack; |
1114 |
HHGear^.State:= HHGear^.State and not gstAttacking; |
|
1115 |
HHGear^.State:= HHGear^.State or gstHHChooseTarget; |
|
1116 |
DeleteGear(Gear); |
|
1117 |
isCursorVisible:= true |
|
409 | 1118 |
end |
415 | 1119 |
else begin |
1120 |
DeleteGear(Gear); |
|
1121 |
AfterAttack |
|
1122 |
end; |
|
1123 |
TargetPoint.X:= NoPointX |
|
409 | 1124 |
end; |
520 | 1125 |
|
1126 |
//////////////////////////////////////////////////////////////////////////////// |
|
525 | 1127 |
procedure doStepTeleportAfter(Gear: PGear); |
1128 |
var HHGear: PGear; |
|
1129 |
begin |
|
1130 |
HHGear:= PHedgehog(Gear^.Hedgehog)^.Gear; |
|
1131 |
HHGear^.Y:= HHGear^.Y + HHGear^.dY; |
|
1132 |
HHGear^.dY:= HHGear^.dY + cGravity; |
|
1133 |
if TestCollisionYwithGear(HHGear, 1) then |
|
1134 |
begin |
|
1135 |
DeleteGear(Gear); |
|
1136 |
AfterAttack |
|
1137 |
end |
|
1138 |
end; |
|
520 | 1139 |
|
1140 |
procedure doStepTeleport(Gear: PGear); |
|
1141 |
var HHGear: PGear; |
|
1142 |
begin |
|
1143 |
AllInactive:= false; |
|
1144 |
||
1145 |
HHGear:= PHedgehog(Gear^.Hedgehog)^.Gear; |
|
1146 |
if not TryPlaceOnLand(TargetPoint.X - SpritesData[sprHHTelepMask].Width div 2, |
|
1147 |
TargetPoint.Y - SpritesData[sprHHTelepMask].Height div 2, |
|
1148 |
sprHHTelepMask, 0, false) then |
|
1149 |
begin |
|
1150 |
HHGear^.Message:= HHGear^.Message and not gm_Attack; |
|
1151 |
HHGear^.State:= HHGear^.State and not gstAttacking; |
|
1152 |
HHGear^.State:= HHGear^.State or gstHHChooseTarget; |
|
1153 |
DeleteGear(Gear); |
|
1154 |
isCursorVisible:= true |
|
1155 |
end |
|
1156 |
else begin |
|
1157 |
DeleteCI(HHGear); |
|
525 | 1158 |
Gear^.doStep:= @doStepTeleportAfter; |
520 | 1159 |
HHGear^.X:= int2hwFloat(TargetPoint.X); |
1160 |
HHGear^.Y:= int2hwFloat(TargetPoint.Y); |
|
525 | 1161 |
HHGear^.State:= HHGear^.State or gstFalling |
520 | 1162 |
end; |
1163 |
TargetPoint.X:= NoPointX |
|
1164 |
end; |
|
534 | 1165 |
|
1166 |
//////////////////////////////////////////////////////////////////////////////// |
|
1167 |
procedure doStepSwitcherWork(Gear: PGear); |
|
1168 |
var HHGear: PGear; |
|
1169 |
Team: PTeam; |
|
1170 |
th: LongInt; |
|
1171 |
Msg, State: Longword; |
|
1172 |
begin |
|
1173 |
AllInactive:= false; |
|
1174 |
||
1175 |
if (Gear^.Message and not gm_Switch) <> 0 then |
|
1176 |
begin |
|
1177 |
HHGear:= PHedgehog(Gear^.Hedgehog)^.Gear; |
|
1178 |
Msg:= Gear^.Message and not gm_Switch; |
|
1179 |
DeleteGear(Gear); |
|
1180 |
OnUsedAmmo(PHedgehog(Gear^.Hedgehog)^); |
|
1181 |
||
1182 |
HHGear:= CurrentTeam^.Hedgehogs[CurrentTeam^.CurrHedgehog].Gear; |
|
1183 |
ApplyAmmoChanges(PHedgehog(Gear^.Hedgehog)^); |
|
1184 |
HHGear^.Message:= Msg; |
|
1185 |
exit |
|
1186 |
end; |
|
1187 |
||
1188 |
if (Gear^.Message and gm_Switch) <> 0 then |
|
1189 |
begin |
|
1190 |
HHGear:= CurrentTeam^.Hedgehogs[CurrentTeam^.CurrHedgehog].Gear; |
|
1191 |
HHGear^.Message:= HHGear^.Message and not gm_Switch; |
|
1192 |
State:= HHGear^.State; |
|
1193 |
HHGear^.State:= 0; |
|
1194 |
HHGear^.Active:= false; |
|
1195 |
HHGear^.Z:= cHHZ; |
|
1196 |
RemoveGearFromList(HHGear); |
|
1197 |
InsertGearToList(HHGear); |
|
1198 |
||
1199 |
th:= CurrentTeam^.CurrHedgehog; |
|
1200 |
repeat |
|
1201 |
CurrentTeam^.CurrHedgehog:= Succ(CurrentTeam^.CurrHedgehog) mod (cMaxHHIndex + 1); |
|
537 | 1202 |
until (CurrentTeam^.Hedgehogs[CurrentTeam^.CurrHedgehog].Gear <> nil) or (CurrentTeam^.CurrHedgehog = th); |
534 | 1203 |
|
1204 |
HHGear:= CurrentTeam^.Hedgehogs[CurrentTeam^.CurrHedgehog].Gear; |
|
1205 |
HHGear^.State:= State; |
|
1206 |
HHGear^.Active:= true; |
|
1207 |
FollowGear:= HHGear; |
|
1208 |
HHGear^.Z:= cCurrHHZ; |
|
1209 |
RemoveGearFromList(HHGear); |
|
1210 |
InsertGearToList(HHGear); |
|
1211 |
Gear^.X:= HHGear^.X; |
|
1212 |
Gear^.Y:= HHGear^.Y |
|
1213 |
end; |
|
1214 |
end; |
|
1215 |
||
1216 |
procedure doStepSwitcher(Gear: PGear); |
|
1217 |
var HHGear: PGear; |
|
1218 |
begin |
|
1219 |
Gear^.doStep:= @doStepSwitcherWork; |
|
1220 |
||
1221 |
HHGear:= PHedgehog(Gear^.Hedgehog)^.Gear; |
|
1222 |
with HHGear^ do |
|
1223 |
begin |
|
1224 |
State:= State and not gstAttacking; |
|
1225 |
Message:= Message and not gm_Attack |
|
1226 |
end |
|
1227 |
end; |