author | unc0rr |
Thu, 27 Jul 2006 15:24:14 +0000 | |
changeset 89 | f9db56409a86 |
parent 83 | 207c85fbef51 |
child 95 | 1ef5e2c41115 |
permissions | -rw-r--r-- |
4 | 1 |
(* |
2 |
* Hedgewars, a worms-like game |
|
79 | 3 |
* Copyright (c) 2004, 2005, 2006 Andrey Korotaev <unC0Rr@gmail.com> |
4 | 4 |
* |
5 |
* Distributed under the terms of the BSD-modified licence: |
|
6 |
* |
|
7 |
* Permission is hereby granted, free of charge, to any person obtaining a copy |
|
8 |
* of this software and associated documentation files (the "Software"), to deal |
|
9 |
* with the Software without restriction, including without limitation the |
|
10 |
* rights to use, copy, modify, merge, publish, distribute, sublicense, and/or |
|
11 |
* sell copies of the Software, and to permit persons to whom the Software is |
|
12 |
* furnished to do so, subject to the following conditions: |
|
13 |
* |
|
14 |
* 1. Redistributions of source code must retain the above copyright notice, |
|
15 |
* this list of conditions and the following disclaimer. |
|
16 |
* 2. Redistributions in binary form must reproduce the above copyright notice, |
|
17 |
* this list of conditions and the following disclaimer in the documentation |
|
18 |
* and/or other materials provided with the distribution. |
|
19 |
* 3. The name of the author may not be used to endorse or promote products |
|
20 |
* derived from this software without specific prior written permission. |
|
21 |
* |
|
22 |
* THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR IMPLIED |
|
23 |
* WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF |
|
24 |
* MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO |
|
25 |
* EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, |
|
26 |
* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, |
|
27 |
* PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; |
|
28 |
* OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, |
|
29 |
* WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR |
|
30 |
* OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF |
|
31 |
* ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. |
|
32 |
*) |
|
33 |
||
34 |
procedure doStepDrowningGear(Gear: PGear); forward; |
|
35 |
||
36 |
function CheckGearDrowning(Gear: PGear): boolean; |
|
37 |
begin |
|
53 | 38 |
Result:= Gear.Y + Gear.Radius >= cWaterLine; |
4 | 39 |
if Result then |
40 |
begin |
|
41 |
Gear.State:= gstDrowning; |
|
42 |
Gear.doStep:= doStepDrowningGear; |
|
43 |
PlaySound(sndSplash) |
|
44 |
end |
|
45 |
end; |
|
46 |
||
47 |
procedure CheckCollision(Gear: PGear); |
|
48 |
begin |
|
49 |
if TestCollisionXwithGear(Gear, Sign(Gear.X)) or TestCollisionYwithGear(Gear, Sign(Gear.Y)) |
|
50 |
then Gear.State:= Gear.State or gstCollision |
|
51 |
else Gear.State:= Gear.State and not gstCollision |
|
52 |
end; |
|
53 |
||
54 |
procedure CheckHHDamage(Gear: PGear); |
|
55 |
begin |
|
71 | 56 |
if Gear.dY > 0.40 then Gear.Damage:= Gear.Damage + 1 + round(70 * (abs(Gear.dY) - 0.40)); |
4 | 57 |
end; |
58 |
||
59 |
//////////////////////////////////////////////////////////////////////////////// |
|
60 |
//////////////////////////////////////////////////////////////////////////////// |
|
61 |
procedure CalcRotationDirAngle(Gear: PGear); |
|
62 |
var dAngle: real; |
|
63 |
begin |
|
64 |
dAngle:= (abs(Gear.dX) + abs(Gear.dY))*0.1; |
|
65 |
if Gear.dX >= 0 then Gear.DirAngle:= Gear.DirAngle + dAngle |
|
66 |
else Gear.DirAngle:= Gear.DirAngle - dAngle; |
|
67 |
if Gear.DirAngle < 0 then Gear.DirAngle:= Gear.DirAngle + 16 |
|
68 |
else if Gear.DirAngle >= 16 then Gear.DirAngle:= Gear.DirAngle - 16 |
|
69 |
end; |
|
70 |
||
71 |
//////////////////////////////////////////////////////////////////////////////// |
|
72 |
procedure doStepDrowningGear(Gear: PGear); |
|
73 |
begin |
|
74 |
AllInactive:= false; |
|
75 |
Gear.Y:= Gear.Y + cDrownSpeed; |
|
75 | 76 |
if round(Gear.Y) > Gear.Radius + cWaterLine + cVisibleWater then DeleteGear(Gear) |
4 | 77 |
end; |
78 |
||
79 |
//////////////////////////////////////////////////////////////////////////////// |
|
80 |
procedure doStepFallingGear(Gear: PGear); |
|
81 |
var b: boolean; |
|
82 |
begin |
|
83 |
if TestCollisionYwithGear(Gear, Sign(Gear.dY)) then |
|
84 |
begin |
|
85 |
Gear.dX:= Gear.dX * Gear.Friction; |
|
86 |
Gear.dY:= - Gear.dY * Gear.Elasticity; |
|
87 |
b:= false |
|
88 |
end else b:= true; |
|
89 |
if TestCollisionXwithGear(Gear, Sign(Gear.dX)) then |
|
90 |
begin |
|
91 |
Gear.dX:= - Gear.dX * Gear.Elasticity; |
|
92 |
// Gear.dY:= Gear.dY; |
|
93 |
b:= false |
|
94 |
end; |
|
95 |
if b then |
|
96 |
begin |
|
97 |
Gear.dY:= Gear.dY + cGravity; |
|
98 |
Gear.State:= Gear.State and not gstCollision |
|
99 |
end else |
|
100 |
begin |
|
101 |
if sqr(Gear.dX) + sqr(Gear.dY) < 0.00001 then |
|
102 |
if (Gear.Timer = 0) then Gear.Active:= false |
|
103 |
else begin |
|
104 |
Gear.dX:= 0; |
|
105 |
Gear.dY:= 0 |
|
106 |
end; |
|
107 |
Gear.State:= Gear.State or gstCollision |
|
108 |
end; |
|
109 |
Gear.X:= Gear.X + Gear.dX; |
|
110 |
Gear.Y:= Gear.Y + Gear.dY; |
|
111 |
CheckGearDrowning(Gear); |
|
112 |
if (sqr(Gear.dX) + sqr(Gear.dY) < 0.003) then Gear.State:= Gear.State and not gstMoving |
|
113 |
else Gear.State:= Gear.State or gstMoving |
|
114 |
end; |
|
115 |
||
116 |
//////////////////////////////////////////////////////////////////////////////// |
|
117 |
procedure doStepCloud(Gear: PGear); |
|
118 |
begin |
|
119 |
Gear.X:= Gear.X + cWindSpeed * 200 + Gear.dX; |
|
74 | 120 |
if Gear.Y > -160 then Gear.dY:= Gear.dY - 0.00002 |
121 |
else Gear.dY:= Gear.dY + 0.00002; |
|
122 |
Gear.Y:= Gear.Y + Gear.dY; |
|
123 |
if Gear.X < -cScreenWidth - 256 then Gear.X:= cScreenWidth + 2048 else |
|
4 | 124 |
if Gear.X > cScreenWidth + 2048 then Gear.X:= -cScreenWidth - 256 |
125 |
end; |
|
126 |
||
127 |
//////////////////////////////////////////////////////////////////////////////// |
|
128 |
procedure doStepBomb(Gear: PGear); |
|
78 | 129 |
var i: integer; |
4 | 130 |
begin |
131 |
AllInactive:= false; |
|
132 |
doStepFallingGear(Gear); |
|
133 |
dec(Gear.Timer); |
|
134 |
if Gear.Timer = 0 then |
|
135 |
begin |
|
78 | 136 |
case Gear.Kind of |
137 |
gtAmmo_Bomb: doMakeExplosion(round(Gear.X), round(Gear.Y), 50, EXPLAutoSound); |
|
138 |
gtClusterBomb: begin |
|
139 |
doMakeExplosion(round(Gear.X), round(Gear.Y), 30, EXPLAutoSound); |
|
140 |
for i:= 0 to 4 do |
|
79 | 141 |
AddGear(round(Gear.X), round(Gear.Y), gtCluster, 0, (getrandom - 0.5)*0.2, (getrandom - 3) * 0.08); |
78 | 142 |
end |
143 |
end; |
|
4 | 144 |
DeleteGear(Gear); |
145 |
exit |
|
146 |
end; |
|
147 |
CalcRotationDirAngle(Gear); |
|
148 |
if (Gear.State and (gstCollision or gstMoving)) = (gstCollision or gstMoving) then PlaySound(sndGrenadeImpact) |
|
149 |
end; |
|
150 |
||
78 | 151 |
procedure doStepCluster(Gear: PGear); |
152 |
begin |
|
153 |
AllInactive:= false; |
|
154 |
doStepFallingGear(Gear); |
|
155 |
if (Gear.State and gstCollision) <> 0 then |
|
156 |
begin |
|
157 |
doMakeExplosion(round(Gear.X), round(Gear.Y), 20, EXPLAutoSound); |
|
158 |
DeleteGear(Gear); |
|
159 |
exit |
|
160 |
end; |
|
161 |
if (GameTicks and $1F) = 0 then |
|
162 |
AddGear(round(Gear.X), round(Gear.Y), gtSmokeTrace, 0) |
|
163 |
end; |
|
164 |
||
4 | 165 |
//////////////////////////////////////////////////////////////////////////////// |
166 |
procedure doStepGrenade(Gear: PGear); |
|
167 |
begin |
|
168 |
AllInactive:= false; |
|
169 |
Gear.dX:= Gear.dX + cWindSpeed; |
|
170 |
doStepFallingGear(Gear); |
|
171 |
if (Gear.State and gstCollision) <> 0 then |
|
172 |
begin |
|
173 |
doMakeExplosion(round(Gear.X), round(Gear.Y), 50, EXPLAutoSound); |
|
174 |
DeleteGear(Gear); |
|
175 |
exit |
|
176 |
end; |
|
177 |
if (GameTicks and $3F) = 0 then |
|
178 |
AddGear(round(Gear.X), round(Gear.Y), gtSmokeTrace, 0) |
|
179 |
end; |
|
180 |
||
181 |
//////////////////////////////////////////////////////////////////////////////// |
|
182 |
procedure doStepHealthTag(Gear: PGear); |
|
183 |
begin |
|
184 |
AllInactive:= false; |
|
185 |
dec(Gear.Timer); |
|
186 |
Gear.Y:= Gear.Y - 0.07; |
|
187 |
if Gear.Timer = 0 then |
|
188 |
begin |
|
189 |
PHedgehog(Gear.Hedgehog).Gear.Active:= true; |
|
190 |
DeleteGear(Gear) |
|
191 |
end |
|
192 |
end; |
|
193 |
||
194 |
//////////////////////////////////////////////////////////////////////////////// |
|
195 |
procedure doStepGrave(Gear: PGear); |
|
196 |
begin |
|
197 |
AllInactive:= false; |
|
198 |
if Gear.dY < 0 then |
|
68 | 199 |
if TestCollisionY(Gear, -1) then Gear.dY:= 0; |
4 | 200 |
|
201 |
if Gear.dY >=0 then |
|
68 | 202 |
if TestCollisionY(Gear, 1) then |
4 | 203 |
begin |
204 |
Gear.dY:= - Gear.dY * Gear.Elasticity; |
|
205 |
if Gear.dY > - 0.001 then |
|
206 |
begin |
|
207 |
Gear.Active:= false; |
|
208 |
exit |
|
209 |
end else if Gear.dY < - 0.03 then PlaySound(sndGraveImpact) |
|
210 |
end; |
|
211 |
Gear.Y:= Gear.Y + Gear.dY; |
|
212 |
CheckGearDrowning(Gear); |
|
213 |
Gear.dY:= Gear.dY + cGravity |
|
214 |
end; |
|
215 |
||
216 |
//////////////////////////////////////////////////////////////////////////////// |
|
217 |
procedure doStepUFOWork(Gear: PGear); |
|
218 |
var t: real; |
|
219 |
begin |
|
220 |
AllInactive:= false; |
|
221 |
t:= sqrt(sqr(Gear.dX) + sqr(Gear.dY)); |
|
222 |
Gear.dX:= Gear.Elasticity * (Gear.dX + 0.000004 * (TargetPoint.X - trunc(Gear.X))); |
|
223 |
Gear.dY:= Gear.Elasticity * (Gear.dY + 0.000004 * (TargetPoint.Y - trunc(Gear.Y))); |
|
224 |
t:= t / (sqrt(sqr(Gear.dX) + sqr(Gear.dY))); |
|
225 |
Gear.dX:= Gear.dX * t; |
|
226 |
Gear.dY:= Gear.dY * t; |
|
227 |
Gear.X:= Gear.X + Gear.dX; |
|
228 |
Gear.Y:= Gear.Y + Gear.dY; |
|
229 |
CheckCollision(Gear); |
|
230 |
dec(Gear.Timer); |
|
231 |
if ((Gear.State and gstCollision) <> 0) or (Gear.Timer = 0) then |
|
232 |
begin |
|
233 |
doMakeExplosion(round(Gear.X), round(Gear.Y), 50, EXPLAutoSound); |
|
234 |
DeleteGear(Gear); |
|
235 |
end; |
|
236 |
end; |
|
237 |
||
238 |
procedure doStepUFO(Gear: PGear); |
|
239 |
begin |
|
240 |
AllInactive:= false; |
|
241 |
Gear.X:= Gear.X + Gear.dX; |
|
242 |
Gear.Y:= Gear.Y + Gear.dY; |
|
243 |
Gear.dY:= Gear.dY + cGravity; |
|
244 |
CheckCollision(Gear); |
|
245 |
if (Gear.State and gstCollision) <> 0 then |
|
246 |
begin |
|
247 |
doMakeExplosion(round(Gear.X), round(Gear.Y), 50, EXPLAutoSound); |
|
248 |
DeleteGear(Gear); |
|
249 |
exit |
|
250 |
end; |
|
251 |
dec(Gear.Timer); |
|
252 |
if Gear.Timer = 0 then |
|
253 |
begin |
|
254 |
Gear.Timer:= 5000; |
|
255 |
Gear.doStep:= doStepUFOWork |
|
256 |
end; |
|
257 |
end; |
|
258 |
||
259 |
//////////////////////////////////////////////////////////////////////////////// |
|
260 |
procedure doStepShotgunShot(Gear: PGear); |
|
261 |
var i: LongWord; |
|
262 |
begin |
|
263 |
AllInactive:= false; |
|
264 |
if Gear.Timer > 0 then |
|
265 |
begin |
|
266 |
dec(Gear.Timer); |
|
267 |
if Gear.Timer = 1 then PlaySound(sndShotgunFire); |
|
268 |
exit |
|
269 |
end; |
|
270 |
i:= 200; |
|
271 |
repeat |
|
272 |
Gear.X:= Gear.X + Gear.dX; |
|
273 |
Gear.Y:= Gear.Y + Gear.dY; |
|
274 |
CheckCollision(Gear); |
|
275 |
if (Gear.State and gstCollision) <> 0 then |
|
276 |
begin |
|
75 | 277 |
AmmoShove(Gear, 25, 25); |
42 | 278 |
doMakeExplosion(round(Gear.X), round(Gear.Y), 25, EXPLNoDamage or EXPLDoNotTouchHH); |
4 | 279 |
DeleteGear(Gear); |
75 | 280 |
AfterAttack; |
4 | 281 |
exit |
282 |
end; |
|
283 |
dec(i) |
|
284 |
until i = 0; |
|
285 |
if (Gear.X < 0) or (Gear.Y < 0) or (Gear.X > 2048) or (Gear.Y > 1024) then |
|
286 |
DeleteGear(Gear) |
|
287 |
end; |
|
288 |
||
289 |
//////////////////////////////////////////////////////////////////////////////// |
|
38 | 290 |
procedure doStepDEagleShot(Gear: PGear); |
291 |
var i, x, y: LongWord; |
|
292 |
oX, oY: real; |
|
293 |
begin |
|
294 |
AllInactive:= false; |
|
37 | 295 |
i:= 80; |
38 | 296 |
oX:= Gear.X; |
297 |
oY:= Gear.Y; |
|
37 | 298 |
repeat |
38 | 299 |
Gear.X:= Gear.X + Gear.dX; |
300 |
Gear.Y:= Gear.Y + Gear.dY; |
|
301 |
x:= round(Gear.X); |
|
302 |
y:= round(Gear.Y); |
|
303 |
if ((y and $FFFFFC00) = 0) and ((x and $FFFFF800) = 0) |
|
304 |
and (Land[y, x] <> 0) then inc(Gear.Damage); |
|
75 | 305 |
AmmoShove(Gear, 7, 20); |
38 | 306 |
dec(i) |
307 |
until (i = 0) or (Gear.Damage > Gear.Health); |
|
308 |
if Gear.Damage > 0 then |
|
37 | 309 |
begin |
38 | 310 |
DrawTunnel(oX, oY, Gear.dX, Gear.dY, 82 - i, 1); |
311 |
dec(Gear.Health, Gear.Damage); |
|
312 |
Gear.Damage:= 0 |
|
37 | 313 |
end; |
38 | 314 |
if (Gear.Health <= 0) or (Gear.X < 0) or (Gear.Y < 0) or (Gear.X > 2048) or (Gear.Y > 1024) then |
37 | 315 |
DeleteGear(Gear) |
316 |
end; |
|
317 |
||
318 |
//////////////////////////////////////////////////////////////////////////////// |
|
4 | 319 |
procedure doStepActionTimer(Gear: PGear); |
320 |
begin |
|
83 | 321 |
dec(Gear.Timer); |
322 |
case Gear.Kind of |
|
323 |
gtATStartGame: begin |
|
4 | 324 |
AllInactive:= false; |
83 | 325 |
if Gear.Timer = 0 then |
326 |
AddCaption(trmsg[sidStartFight], $FFFFFF, capgrpGameState); |
|
4 | 327 |
end; |
83 | 328 |
gtATSmoothWindCh: begin |
6 | 329 |
if Gear.Timer = 0 then |
330 |
begin |
|
331 |
if WindBarWidth < Gear.Tag then inc(WindBarWidth) |
|
83 | 332 |
else if WindBarWidth > Gear.Tag then dec(WindBarWidth); |
333 |
if WindBarWidth <> Gear.Tag then Gear.Timer:= 10; |
|
334 |
end |
|
335 |
end; |
|
336 |
gtATFinishGame: begin |
|
337 |
AllInactive:= false; |
|
338 |
if Gear.Timer = 0 then |
|
339 |
GameState:= gsExit |
|
6 | 340 |
end; |
4 | 341 |
end; |
83 | 342 |
if Gear.Timer = 0 then DeleteGear(Gear) |
4 | 343 |
end; |
344 |
||
345 |
//////////////////////////////////////////////////////////////////////////////// |
|
346 |
procedure doStepPickHammerWork(Gear: PGear); |
|
347 |
var i, ei: integer; |
|
348 |
HHGear: PGear; |
|
349 |
begin |
|
70 | 350 |
AllInactive:= false; |
4 | 351 |
dec(Gear.Timer); |
352 |
if (Gear.Timer = 0)or((Gear.Message and gm_Destroy) <> 0) then |
|
353 |
begin |
|
354 |
DeleteGear(Gear); |
|
355 |
AfterAttack; |
|
356 |
exit |
|
357 |
end; |
|
358 |
HHGear:= PHedgehog(Gear.Hedgehog).Gear; |
|
359 |
if (Gear.Timer and $3F) = 0 then |
|
360 |
begin |
|
53 | 361 |
i:= round(Gear.X) - Gear.Radius - GetRandom(2); |
362 |
ei:= round(Gear.X) + Gear.Radius + GetRandom(2); |
|
4 | 363 |
while i <= ei do |
364 |
begin |
|
365 |
doMakeExplosion(i, round(Gear.Y) + 3, 3, 0); |
|
366 |
inc(i, 1) |
|
367 |
end; |
|
368 |
Gear.X:= Gear.X + Gear.dX; |
|
42 | 369 |
Gear.Y:= Gear.Y + 1.9; |
370 |
SetAllHHToActive; |
|
4 | 371 |
end; |
372 |
if TestCollisionYwithGear(Gear, 1) then |
|
373 |
begin |
|
374 |
Gear.dY:= 0; |
|
375 |
HHGear.dX:= 0.0000001 * Sign(PGear(Gear.Hedgehog).dX); |
|
376 |
HHGear.dY:= 0; |
|
377 |
end else |
|
378 |
begin |
|
379 |
Gear.dY:= Gear.dY + cGravity; |
|
380 |
Gear.Y:= Gear.Y + Gear.dY; |
|
381 |
if Gear.Y > 1024 then Gear.Timer:= 1 |
|
382 |
end; |
|
383 |
||
384 |
Gear.X:= Gear.X + HHGear.dX; |
|
385 |
HHGear.X:= Gear.X; |
|
53 | 386 |
HHGear.Y:= Gear.Y - cHHRadius; |
4 | 387 |
|
388 |
if (Gear.Message and gm_Attack) <> 0 then |
|
389 |
if (Gear.State and gsttmpFlag) <> 0 then Gear.Timer:= 1 else else |
|
390 |
if (Gear.State and gsttmpFlag) = 0 then Gear.State:= Gear.State or gsttmpFlag; |
|
391 |
if ((Gear.Message and gm_Left) <> 0) then Gear.dX:= -0.3 else |
|
392 |
if ((Gear.Message and gm_Right) <> 0) then Gear.dX:= 0.3 |
|
393 |
else Gear.dX:= 0; |
|
394 |
end; |
|
395 |
||
396 |
procedure doStepPickHammer(Gear: PGear); |
|
397 |
var i, y: integer; |
|
398 |
ar: TRangeArray; |
|
399 |
begin |
|
400 |
i:= 0; |
|
53 | 401 |
y:= round(Gear.Y) - cHHRadius*2; |
4 | 402 |
while y < round(Gear.Y) do |
403 |
begin |
|
53 | 404 |
ar[i].Left := round(Gear.X) - Gear.Radius - GetRandom(2); |
405 |
ar[i].Right:= round(Gear.X) + Gear.Radius + GetRandom(2); |
|
4 | 406 |
inc(y, 2); |
407 |
inc(i) |
|
408 |
end; |
|
53 | 409 |
DrawHLinesExplosions(@ar, 3, round(Gear.Y) - cHHRadius*2, 2, Pred(i)); |
4 | 410 |
Gear.dY:= PHedgehog(Gear.Hedgehog).Gear.dY; |
411 |
doStepPickHammerWork(Gear); |
|
412 |
Gear.doStep:= doStepPickHammerWork |
|
413 |
end; |
|
414 |
||
415 |
//////////////////////////////////////////////////////////////////////////////// |
|
416 |
procedure doStepRopeWork(Gear: PGear); |
|
70 | 417 |
const flCheck: boolean = false; |
4 | 418 |
var HHGear: PGear; |
419 |
len, cs, cc, tx, ty: real; |
|
420 |
lx, ly: integer; |
|
421 |
||
422 |
procedure DeleteMe; |
|
423 |
begin |
|
424 |
with HHGear^ do |
|
425 |
begin |
|
426 |
Message:= Message and not gm_Attack; |
|
427 |
State:= State or gstFalling; |
|
428 |
end; |
|
429 |
DeleteGear(Gear); |
|
430 |
OnUsedAmmo(PHedgehog(Gear.Hedgehog)^.Ammo); |
|
70 | 431 |
ApplyAmmoChanges(PHedgehog(Gear.Hedgehog)^) |
4 | 432 |
end; |
433 |
||
434 |
begin |
|
435 |
HHGear:= PHedgehog(Gear.Hedgehog).Gear; |
|
80 | 436 |
if ((HHGear.State and gstHHDriven) = 0) |
437 |
or (CheckGearDrowning(HHGear)) then |
|
4 | 438 |
begin |
439 |
DeleteMe; |
|
440 |
exit |
|
441 |
end; |
|
442 |
Gear.dX:= HHGear.X - Gear.X; |
|
443 |
Gear.dY:= HHGear.Y - Gear.Y; |
|
444 |
||
445 |
if (Gear.Message and gm_Left <> 0) then HHGear.dX:= HHGear.dX - 0.0002 else |
|
446 |
if (Gear.Message and gm_Right <> 0) then HHGear.dX:= HHGear.dX + 0.0002; |
|
447 |
||
448 |
if not TestCollisionYwithGear(HHGear, 1) then HHGear.dY:= HHGear.dY + cGravity; |
|
449 |
||
450 |
HHGear.DirAngle:= arctan(Gear.dY + HHGear.dY, Gear.dX + HHGear.dX); |
|
451 |
cs:= sin(HHGear.DirAngle); |
|
452 |
cc:= cos(HHGear.DirAngle); |
|
453 |
||
454 |
flCheck:= not flCheck; |
|
455 |
if flCheck then // check whether rope needs dividing |
|
456 |
begin |
|
457 |
len:= Gear.Elasticity - 20; |
|
458 |
while len > 5 do |
|
459 |
begin |
|
460 |
tx:= cc*len; |
|
461 |
ty:= cs*len; |
|
70 | 462 |
lx:= round(Gear.X + tx) + Sign(HHGear.dX); |
463 |
ly:= round(Gear.Y + ty) + Sign(HHGear.dY); |
|
4 | 464 |
if ((ly and $FFFFFC00) = 0) and ((lx and $FFFFF800) = 0)and (Land[ly, lx] <> 0) then |
465 |
begin |
|
466 |
with RopePoints.ar[RopePoints.Count] do |
|
467 |
begin |
|
468 |
X:= Gear.X; |
|
469 |
Y:= Gear.Y; |
|
470 |
if RopePoints.Count = 0 then RopePoints.HookAngle:= DxDy2Angle32(Gear.dY, Gear.dX); |
|
471 |
b:= (cc * HHGear.dY) > (cs * HHGear.dX); |
|
472 |
dLen:= len |
|
473 |
end; |
|
474 |
Gear.X:= Gear.X + tx; |
|
475 |
Gear.Y:= Gear.Y + ty; |
|
476 |
inc(RopePoints.Count); |
|
477 |
Gear.Elasticity:= Gear.Elasticity - len; |
|
478 |
Gear.Friction:= Gear.Friction - len; |
|
479 |
break |
|
480 |
end; |
|
481 |
len:= len - 3 |
|
482 |
end; |
|
483 |
end else |
|
484 |
if RopePoints.Count > 0 then // check whether the last dividing point could be removed |
|
485 |
begin |
|
486 |
tx:= RopePoints.ar[Pred(RopePoints.Count)].X; |
|
487 |
ty:= RopePoints.ar[Pred(RopePoints.Count)].Y; |
|
488 |
if RopePoints.ar[Pred(RopePoints.Count)].b xor ((tx - Gear.X) * (ty - HHGear.Y) > (tx - HHGear.X) * (ty - Gear.Y)) then |
|
489 |
begin |
|
490 |
dec(RopePoints.Count); |
|
491 |
Gear.X:=RopePoints.ar[RopePoints.Count].X; |
|
492 |
Gear.Y:=RopePoints.ar[RopePoints.Count].Y; |
|
493 |
Gear.Elasticity:= Gear.Elasticity + RopePoints.ar[RopePoints.Count].dLen; |
|
494 |
Gear.Friction:= Gear.Friction + RopePoints.ar[RopePoints.Count].dLen |
|
495 |
end |
|
496 |
end; |
|
497 |
||
498 |
Gear.dX:= HHGear.X - Gear.X; |
|
499 |
Gear.dY:= HHGear.Y - Gear.Y; |
|
500 |
HHGear.DirAngle:= arctan(Gear.dY + HHGear.dY, Gear.dX + HHGear.dX); |
|
501 |
cs:= sin(HHGear.DirAngle); |
|
502 |
cc:= cos(HHGear.DirAngle); |
|
503 |
||
504 |
HHGear.dX:= HHGear.X; |
|
505 |
HHGear.dY:= HHGear.Y; |
|
506 |
||
507 |
if ((Gear.Message and gm_Down) <> 0) and (Gear.Elasticity < Gear.Friction) then |
|
508 |
if not (TestCollisionXwithGear(HHGear, Sign(Gear.dX)) |
|
509 |
or TestCollisionYwithGear(HHGear, Sign(Gear.dY))) then Gear.Elasticity:= Gear.Elasticity + 0.3; |
|
510 |
||
511 |
if ((Gear.Message and gm_Up) <> 0) and (Gear.Elasticity > 30) then |
|
512 |
if not (TestCollisionXwithGear(HHGear, -Sign(Gear.dX)) |
|
513 |
or TestCollisionYwithGear(HHGear, -Sign(Gear.dY))) then Gear.Elasticity:= Gear.Elasticity - 0.3; |
|
514 |
||
515 |
HHGear.X:= Gear.X + cc*Gear.Elasticity; |
|
516 |
HHGear.Y:= Gear.Y + cs*Gear.Elasticity; |
|
517 |
||
518 |
HHGear.dX:= HHGear.X - HHGear.dX; |
|
519 |
HHGear.dY:= HHGear.Y - HHGear.dY; |
|
520 |
||
521 |
if TestCollisionXwithGear(HHGear, Sign(HHGear.dX)) then |
|
75 | 522 |
HHGear.dX:= -0.6 * HHGear.dX; |
4 | 523 |
if TestCollisionYwithGear(HHGear, Sign(HHGear.dY)) then |
75 | 524 |
HHGear.dY:= -0.6 * HHGear.dY; |
4 | 525 |
|
526 |
if (Gear.Message and gm_Attack) <> 0 then |
|
527 |
if (Gear.State and gsttmpFlag) <> 0 then DeleteMe else |
|
528 |
else if (Gear.State and gsttmpFlag) = 0 then Gear.State:= Gear.State or gsttmpFlag; |
|
529 |
end; |
|
530 |
||
531 |
||
532 |
procedure doStepRopeAttach(Gear: PGear); |
|
533 |
var HHGear: PGear; |
|
534 |
tx, ty, tt: real; |
|
535 |
begin |
|
536 |
Gear.X:= Gear.X + Gear.dX; |
|
537 |
Gear.Y:= Gear.Y + Gear.dY; |
|
538 |
Gear.Elasticity:= Gear.Elasticity + 1.0; |
|
539 |
HHGear:= PHedgehog(Gear.Hedgehog)^.Gear; |
|
540 |
if (HHGear.State and gstFalling) <> 0 then |
|
68 | 541 |
if TestCollisionYwithGear(HHGear, 1) then |
4 | 542 |
begin |
543 |
HHGear.dY:= 0; |
|
544 |
CheckHHDamage(HHGear); |
|
545 |
HHGear.State:= HHGear.State and not (gstFalling or gstHHJumping); |
|
546 |
end else |
|
547 |
begin |
|
548 |
if TestCollisionXwithGear(HHGear, Sign(HHGear.dX)) then HHGear.dX:= 0.0000001 * Sign(HHGear.dX); |
|
549 |
HHGear.X:= HHGear.X + HHGear.dX; |
|
550 |
HHGear.Y:= HHGear.Y + HHGear.dY; |
|
551 |
Gear.X:= Gear.X + HHGear.dX; |
|
552 |
Gear.Y:= Gear.Y + HHGear.dY; |
|
553 |
HHGear.dY:= HHGear.dY + cGravity; |
|
554 |
tt:= Gear.Elasticity; |
|
555 |
tx:= 0; |
|
556 |
ty:= 0; |
|
557 |
while tt > 20 do |
|
558 |
begin |
|
559 |
if TestCollisionXwithXYShift(Gear, round(tx), round(ty), Sign(Gear.dX)) |
|
560 |
or TestCollisionYwithXYShift(Gear, round(tx), round(ty), Sign(Gear.dY)) then |
|
561 |
begin |
|
562 |
Gear.X:= Gear.X + tx; |
|
563 |
Gear.Y:= Gear.Y + ty; |
|
564 |
Gear.Elasticity:= tt; |
|
565 |
Gear.doStep:= doStepRopeWork; |
|
566 |
with HHGear^ do State:= State and not gstAttacking; |
|
567 |
tt:= 0 |
|
568 |
end; |
|
569 |
tx:= tx - Gear.dX - Gear.dX; |
|
570 |
ty:= ty - Gear.dY - Gear.dY; |
|
571 |
tt:= tt - 2.0; |
|
572 |
end; |
|
573 |
end; |
|
574 |
CheckCollision(Gear); |
|
575 |
if (Gear.State and gstCollision) <> 0 then |
|
576 |
begin |
|
577 |
Gear.doStep:= doStepRopeWork; |
|
578 |
with HHGear^ do State:= State and not gstAttacking; |
|
579 |
if Gear.Elasticity < 10 then |
|
580 |
Gear.Elasticity:= 10000; |
|
581 |
end; |
|
582 |
||
583 |
if (Gear.Elasticity >= Gear.Friction) or ((Gear.Message and gm_Attack) = 0) then |
|
584 |
begin |
|
585 |
with PHedgehog(Gear.Hedgehog).Gear^ do |
|
586 |
begin |
|
587 |
State:= State and not gstAttacking; |
|
588 |
Message:= Message and not gm_Attack |
|
589 |
end; |
|
590 |
DeleteGear(Gear) |
|
591 |
end |
|
592 |
end; |
|
593 |
||
594 |
procedure doStepRope(Gear: PGear); |
|
595 |
begin |
|
596 |
Gear.doStep:= doStepRopeAttach |
|
597 |
end; |
|
598 |
||
599 |
//////////////////////////////////////////////////////////////////////////////// |
|
600 |
procedure doStepSmokeTrace(Gear: PGear); |
|
601 |
begin |
|
602 |
inc(Gear.Timer); |
|
603 |
if Gear.Timer > 64 then |
|
604 |
begin |
|
605 |
Gear.Timer:= 0; |
|
9 | 606 |
dec(Gear.State) |
4 | 607 |
end; |
608 |
Gear.dX:= Gear.dX + cWindSpeed; |
|
609 |
Gear.X:= Gear.X + Gear.dX; |
|
9 | 610 |
if Gear.State = 0 then DeleteGear(Gear) |
4 | 611 |
end; |
9 | 612 |
|
613 |
//////////////////////////////////////////////////////////////////////////////// |
|
614 |
procedure doStepExplosion(Gear: PGear); |
|
615 |
begin |
|
616 |
inc(Gear.Timer); |
|
617 |
if Gear.Timer > 75 then |
|
618 |
begin |
|
619 |
inc(Gear.State); |
|
620 |
Gear.Timer:= 0; |
|
621 |
if Gear.State > 5 then DeleteGear(Gear) |
|
622 |
end; |
|
623 |
end; |
|
10 | 624 |
|
625 |
//////////////////////////////////////////////////////////////////////////////// |
|
626 |
procedure doStepMine(Gear: PGear); |
|
627 |
begin |
|
39 | 628 |
if (Gear.dX <> 0) or (Gear.dY <> 0) then |
10 | 629 |
begin |
53 | 630 |
if Gear.CollIndex < High(Longword) then DeleteCI(Gear); |
10 | 631 |
doStepFallingGear(Gear); |
13 | 632 |
if Gear.Active = false then |
633 |
begin |
|
53 | 634 |
if Gear.CollIndex = High(Longword) then AddGearCI(Gear); |
13 | 635 |
Gear.dX:= 0; |
636 |
Gear.dY:= 0 |
|
637 |
end; |
|
638 |
CalcRotationDirAngle(Gear); |
|
10 | 639 |
AllInactive:= false |
640 |
end; |
|
39 | 641 |
|
10 | 642 |
if ((Gear.State and gsttmpFlag) <> 0) then |
643 |
if ((Gear.State and gstAttacking) = 0) then |
|
14
81f125629b25
- Mine checks whether a hedgehog is near less frequently
unc0rr
parents:
13
diff
changeset
|
644 |
begin |
39 | 645 |
if ((GameTicks and $F) = 0) then |
15 | 646 |
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
|
647 |
end else // gstAttacking <> 0 |
10 | 648 |
begin |
649 |
AllInactive:= false; |
|
37 | 650 |
if (Gear.Timer and $FF) = 0 then PlaySound(sndMineTick); |
10 | 651 |
if Gear.Timer = 0 then |
652 |
begin |
|
13 | 653 |
doMakeExplosion(round(Gear.X), round(Gear.Y), 50, EXPLAutoSound); |
10 | 654 |
DeleteGear(Gear) |
655 |
end; |
|
13 | 656 |
dec(Gear.Timer); |
657 |
end else // gsttmpFlag = 0 |
|
658 |
if TurnTimeLeft = 0 then Gear.State:= Gear.State or gsttmpFlag; |
|
10 | 659 |
end; |
57 | 660 |
|
39 | 661 |
//////////////////////////////////////////////////////////////////////////////// |
662 |
procedure doStepDynamite(Gear: PGear); |
|
663 |
begin |
|
43 | 664 |
doStepFallingGear(Gear); |
665 |
AllInactive:= false; |
|
666 |
if Gear.Timer mod 166 = 0 then inc(Gear.Tag); |
|
667 |
if Gear.Timer = 0 then |
|
39 | 668 |
begin |
46 | 669 |
doMakeExplosion(round(Gear.X), round(Gear.Y), 75, EXPLAutoSound); |
43 | 670 |
DeleteGear(Gear); |
671 |
exit |
|
39 | 672 |
end; |
43 | 673 |
dec(Gear.Timer); |
39 | 674 |
end; |
14
81f125629b25
- Mine checks whether a hedgehog is near less frequently
unc0rr
parents:
13
diff
changeset
|
675 |
|
15 | 676 |
//////////////////////////////////////////////////////////////////////////////// |
14
81f125629b25
- Mine checks whether a hedgehog is near less frequently
unc0rr
parents:
13
diff
changeset
|
677 |
procedure doStepCase(Gear: PGear); |
89 | 678 |
var i, x, y: integer; |
14
81f125629b25
- Mine checks whether a hedgehog is near less frequently
unc0rr
parents:
13
diff
changeset
|
679 |
begin |
15 | 680 |
if (Gear.Message and gm_Destroy) > 0 then |
681 |
begin |
|
682 |
DeleteGear(Gear); |
|
683 |
exit |
|
684 |
end; |
|
685 |
||
79 | 686 |
if Gear.Damage > 0 then |
687 |
begin |
|
89 | 688 |
x:= round(Gear.X); |
689 |
y:= round(Gear.Y); |
|
79 | 690 |
DeleteGear(Gear); |
89 | 691 |
doMakeExplosion(x, y, 25, EXPLAutoSound); |
79 | 692 |
for i:= 0 to 63 do |
89 | 693 |
AddGear(x, y, gtFlame, 0); |
79 | 694 |
exit |
695 |
end; |
|
696 |
||
53 | 697 |
if (Gear.dY <> 0) or (not TestCollisionYwithGear(Gear, 1)) then |
14
81f125629b25
- Mine checks whether a hedgehog is near less frequently
unc0rr
parents:
13
diff
changeset
|
698 |
begin |
81f125629b25
- Mine checks whether a hedgehog is near less frequently
unc0rr
parents:
13
diff
changeset
|
699 |
AllInactive:= false; |
81f125629b25
- Mine checks whether a hedgehog is near less frequently
unc0rr
parents:
13
diff
changeset
|
700 |
Gear.dY:= Gear.dY + cGravity; |
81f125629b25
- Mine checks whether a hedgehog is near less frequently
unc0rr
parents:
13
diff
changeset
|
701 |
Gear.Y:= Gear.Y + Gear.dY; |
53 | 702 |
if (Gear.dY < 0) and TestCollisionYwithGear(Gear, -1) then Gear.dY:= 0 else |
703 |
if (Gear.dY >= 0) and TestCollisionYwithGear(Gear, 1) then |
|
14
81f125629b25
- Mine checks whether a hedgehog is near less frequently
unc0rr
parents:
13
diff
changeset
|
704 |
begin |
81f125629b25
- Mine checks whether a hedgehog is near less frequently
unc0rr
parents:
13
diff
changeset
|
705 |
Gear.dY:= - Gear.dY * Gear.Elasticity; |
81f125629b25
- Mine checks whether a hedgehog is near less frequently
unc0rr
parents:
13
diff
changeset
|
706 |
if Gear.dY > - 0.001 then Gear.dY:= 0 |
81f125629b25
- Mine checks whether a hedgehog is near less frequently
unc0rr
parents:
13
diff
changeset
|
707 |
else if Gear.dY < - 0.03 then PlaySound(sndGraveImpact); |
81f125629b25
- Mine checks whether a hedgehog is near less frequently
unc0rr
parents:
13
diff
changeset
|
708 |
end; |
81f125629b25
- Mine checks whether a hedgehog is near less frequently
unc0rr
parents:
13
diff
changeset
|
709 |
CheckGearDrowning(Gear); |
81f125629b25
- Mine checks whether a hedgehog is near less frequently
unc0rr
parents:
13
diff
changeset
|
710 |
end; |
81f125629b25
- Mine checks whether a hedgehog is near less frequently
unc0rr
parents:
13
diff
changeset
|
711 |
|
53 | 712 |
if (Gear.CollIndex = High(Longword)) and (Gear.dY = 0) then AddGearCI(Gear) |
713 |
else if (Gear.CollIndex < High(Longword)) and (Gear.dY <> 0) then DeleteCI(Gear); |
|
14
81f125629b25
- Mine checks whether a hedgehog is near less frequently
unc0rr
parents:
13
diff
changeset
|
714 |
end; |
49 | 715 |
|
716 |
//////////////////////////////////////////////////////////////////////////////// |
|
717 |
var thexchar: array[0..5] of record |
|
718 |
oy, ny: integer; |
|
719 |
team: PTeam; |
|
720 |
end; |
|
721 |
thexchcnt: Longword; |
|
722 |
||
723 |
procedure doStepTeamHealthSorterWork(Gear: PGear); |
|
724 |
var i: integer; |
|
725 |
begin |
|
726 |
AllInactive:= false; |
|
727 |
dec(Gear.Timer); |
|
728 |
if (Gear.Timer and 15) = 0 then |
|
729 |
for i:= 0 to Pred(thexchcnt) do |
|
730 |
with thexchar[i] do |
|
731 |
{$WARNINGS OFF} |
|
732 |
team.DrawHealthY:= ny + (oy - ny) * Gear.Timer div 640; |
|
733 |
{$WARNINGS ON} |
|
734 |
if Gear.Timer = 0 then |
|
735 |
DeleteGear(Gear) |
|
736 |
end; |
|
737 |
||
738 |
procedure doStepTeamHealthSorter(Gear: PGear); |
|
739 |
var team: PTeam; |
|
740 |
i, t: Longword; |
|
741 |
begin |
|
742 |
AllInactive:= false; |
|
743 |
team:= TeamsList; |
|
744 |
i:= 0; |
|
745 |
while team <> nil do |
|
746 |
begin |
|
747 |
thexchar[i].oy:= team.DrawHealthY; |
|
748 |
thexchar[i].team:= team; |
|
749 |
inc(i); |
|
750 |
team:= team.Next |
|
751 |
end; |
|
752 |
thexchcnt:= i; |
|
753 |
for i:= 1 to thexchcnt do |
|
754 |
for t:= 0 to thexchcnt - 2 do |
|
755 |
if thexchar[t].team.TeamHealth > thexchar[Succ(t)].team.TeamHealth then |
|
756 |
begin |
|
757 |
thexchar[5]:= thexchar[t]; |
|
758 |
thexchar[t]:= thexchar[Succ(t)]; |
|
759 |
thexchar[Succ(t)]:= thexchar[5] |
|
760 |
end; |
|
761 |
t:= cScreenHeight - 4; |
|
762 |
for i:= 0 to Pred(thexchcnt) do |
|
763 |
with thexchar[i] do |
|
764 |
begin |
|
765 |
dec(t, team.HealthRect.h + 2); |
|
766 |
ny:= t |
|
767 |
end; |
|
768 |
Gear.Timer:= 640; |
|
769 |
Gear.doStep:= doStepTeamHealthSorterWork |
|
770 |
end; |
|
771 |
||
79 | 772 |
//////////////////////////////////////////////////////////////////////////////// |
773 |
procedure doStepShover(Gear: PGear); |
|
774 |
var HHGear: PGear; |
|
775 |
begin |
|
776 |
HHGear:= PHedgehog(Gear.Hedgehog)^.Gear; |
|
777 |
HHGear.State:= HHGear.State or gstNoDamage; |
|
778 |
AmmoShove(Gear, 30, 115); |
|
779 |
HHGear.State:= HHGear.State and not gstNoDamage; |
|
780 |
DeleteGear(Gear) |
|
781 |
end; |
|
782 |
||
783 |
//////////////////////////////////////////////////////////////////////////////// |
|
784 |
procedure doStepFlame(Gear: PGear); |
|
785 |
begin |
|
786 |
AllInactive:= false; |
|
787 |
if not TestCollisionYwithGear(Gear, 1) then |
|
788 |
begin |
|
789 |
Gear.dX:= Gear.dX + cWindSpeed; |
|
790 |
Gear.dY:= Gear.dY + cGravity; |
|
791 |
if abs(Gear.dX) > 0.12 then Gear.dX:= Gear.dX * 0.5; |
|
792 |
if Gear.dY > 0.12 then Gear.dY:= Gear.dY * 0.995; |
|
793 |
Gear.X:= Gear.X + Gear.dX; |
|
794 |
Gear.Y:= Gear.Y + Gear.dY; |
|
795 |
if Gear.Y > 1023 then |
|
796 |
begin |
|
797 |
DeleteGear(Gear); |
|
798 |
exit |
|
799 |
end |
|
800 |
end else begin |
|
801 |
if Gear.Timer > 0 then dec(Gear.Timer) |
|
802 |
else begin |
|
803 |
doMakeExplosion(round(Gear.X), round(Gear.Y), 2, 0); |
|
804 |
dec(Gear.Health); |
|
805 |
Gear.Timer:= 1250 - Gear.Angle * 12 |
|
806 |
end |
|
807 |
end; |
|
808 |
||
809 |
if (((GameTicks div 8) mod 64) = Gear.Angle) then |
|
810 |
AmmoFlameWork(Gear); |
|
811 |
||
82 | 812 |
if Gear.Health = 0 then |
79 | 813 |
DeleteGear(Gear) |
814 |
end; |
|
82 | 815 |
|
816 |
//////////////////////////////////////////////////////////////////////////////// |
|
817 |
procedure doStepFirePunchWork(Gear: PGear); |
|
818 |
var HHGear: PGear; |
|
819 |
begin |
|
820 |
AllInactive:= false; |
|
821 |
if ((Gear.Message and gm_Destroy) <> 0) then |
|
822 |
begin |
|
823 |
DeleteGear(Gear); |
|
824 |
AfterAttack; |
|
825 |
exit |
|
826 |
end; |
|
827 |
||
828 |
HHGear:= PHedgehog(Gear.Hedgehog).Gear; |
|
829 |
if round(HHGear.Y) <= Gear.Tag - 2 then |
|
830 |
begin |
|
831 |
Gear.Tag:= round(HHGear.Y); |
|
832 |
DrawTunnel(HHGear.X - cHHRadius, HHGear.Y - 1, 0.5, 0.0, cHHRadius * 4, 2); |
|
833 |
HHGear.State:= HHGear.State or gstNoDamage; |
|
834 |
Gear.Y:= HHGear.Y; |
|
835 |
AmmoShove(Gear, 30, 40); |
|
836 |
HHGear.State:= HHGear.State and not gstNoDamage |
|
837 |
end; |
|
838 |
||
839 |
HHGear.dY:= HHGear.dY + cGravity; |
|
840 |
if HHGear.dY >= 0 then |
|
841 |
begin |
|
842 |
HHGear.State:= HHGear.State or gstFalling; |
|
843 |
DeleteGear(Gear); |
|
844 |
AfterAttack; |
|
845 |
exit |
|
846 |
end; |
|
847 |
HHGear.Y:= HHGear.Y + HHGear.dY |
|
848 |
end; |
|
849 |
||
850 |
procedure doStepFirePunch(Gear: PGear); |
|
851 |
var HHGear: PGear; |
|
852 |
begin |
|
853 |
AllInactive:= false; |
|
854 |
HHGear:= PHedgehog(Gear.Hedgehog).Gear; |
|
855 |
HHGear.X:= round(HHGear.X) - 0.5; |
|
856 |
HHGear.dX:= 0.0000001 * Sign(HHGear.dX); |
|
857 |
HHGear.dY:= -0.30; |
|
858 |
||
859 |
Gear.X:= HHGear.X; |
|
860 |
Gear.dX:= Sign(HHGear.dX)* 0.45; |
|
861 |
Gear.dY:= -0.9; |
|
862 |
Gear.doStep:= doStepFirePunchWork; |
|
863 |
DrawTunnel(HHGear.X - cHHRadius, HHGear.Y + 1, 0.5, 0.0, cHHRadius * 4, 5); |
|
864 |
end; |
|
865 |
||
866 |