author | nemo |
Fri, 16 Oct 2009 01:29:10 +0000 | |
changeset 2473 | b188194432f5 |
parent 2470 | 44b66fbf37da |
child 2475 | e0646a529a38 |
permissions | -rw-r--r-- |
4 | 1 |
(* |
1066 | 2 |
* Hedgewars, a free turn based strategy game |
1689 | 3 |
* Copyright (c) 2004-2009 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; |
|
1918 | 22 |
var skipSpeed, skipAngle, skipDecay: hwFloat; |
4 | 23 |
begin |
1918 | 24 |
// probably needs tweaking. might need to be in a case statement based upon gear type |
25 |
//(not Gear^.dY.isNegative) and this should not be necessary |
|
498 | 26 |
if cWaterLine < hwRound(Gear^.Y) + Gear^.Radius then |
1918 | 27 |
begin |
28 |
skipSpeed:= _0_25; // was 0.36 - couldn't manage baseball bat. Tiy's build is 0.36... |
|
29 |
skipAngle:= _1 + _0_9; // these should perhaps also be constants, once work out what proper values are |
|
30 |
skipDecay:= _0_87; // this could perhaps be a tiny bit higher. |
|
1919 | 31 |
if (hwSqr(Gear^.dX) + hwSqr(Gear^.dY) > skipSpeed) and |
1920 | 32 |
(hwAbs(Gear^.dX) > skipAngle * hwAbs(Gear^.dY)) then |
1918 | 33 |
begin |
34 |
Gear^.dY.isNegative:= true; |
|
1919 | 35 |
Gear^.dY:= Gear^.dY * skipDecay; |
36 |
Gear^.dX:= Gear^.dX * skipDecay; |
|
1918 | 37 |
CheckGearDrowning:= false |
38 |
end |
|
39 |
else |
|
40 |
begin |
|
41 |
CheckGearDrowning:= true; |
|
42 |
Gear^.State:= gstDrowning; |
|
2429 | 43 |
Gear^.RenderTimer:= false; |
1918 | 44 |
Gear^.doStep:= @doStepDrowningGear; |
2367
86c9aadea817
Remove gstHHDriven flag when hedgehog get into the water. Fixes some odd cases.
unc0rr
parents:
2365
diff
changeset
|
45 |
if Gear^.Kind = gtHedgehog then |
86c9aadea817
Remove gstHHDriven flag when hedgehog get into the water. Fixes some odd cases.
unc0rr
parents:
2365
diff
changeset
|
46 |
begin |
86c9aadea817
Remove gstHHDriven flag when hedgehog get into the water. Fixes some odd cases.
unc0rr
parents:
2365
diff
changeset
|
47 |
Gear^.State:= Gear^.State and (not gstHHDriven); |
86c9aadea817
Remove gstHHDriven flag when hedgehog get into the water. Fixes some odd cases.
unc0rr
parents:
2365
diff
changeset
|
48 |
AddCaption(Format(GetEventString(eidDrowned), PHedgehog(Gear^.Hedgehog)^.Name), $FFFFFF, capgrpMessage); |
86c9aadea817
Remove gstHHDriven flag when hedgehog get into the water. Fixes some odd cases.
unc0rr
parents:
2365
diff
changeset
|
49 |
end |
1918 | 50 |
end; |
51 |
PlaySound(sndSplash, false, nil) |
|
52 |
end |
|
53 |
else |
|
1133 | 54 |
CheckGearDrowning:= false |
4 | 55 |
end; |
56 |
||
57 |
procedure CheckCollision(Gear: PGear); |
|
58 |
begin |
|
351 | 59 |
if TestCollisionXwithGear(Gear, hwSign(Gear^.X)) or TestCollisionYwithGear(Gear, hwSign(Gear^.Y)) |
1133 | 60 |
then Gear^.State:= Gear^.State or gstCollision |
61 |
else Gear^.State:= Gear^.State and not gstCollision |
|
4 | 62 |
end; |
63 |
||
64 |
procedure CheckHHDamage(Gear: PGear); |
|
522 | 65 |
var dmg: Longword; |
4 | 66 |
begin |
1849 | 67 |
if(Gear^.Invulnerable) then exit; |
522 | 68 |
if _0_4 < Gear^.dY then |
1123 | 69 |
begin |
70 |
if _0_6 < Gear^.dY then |
|
1669 | 71 |
PlaySound(sndOw4, false, PHedgehog(Gear^.Hedgehog)^.Team^.voicepack) |
1123 | 72 |
else |
1669 | 73 |
PlaySound(sndOw1, false, PHedgehog(Gear^.Hedgehog)^.Team^.voicepack); |
1123 | 74 |
|
1861 | 75 |
dmg:= modifyDamage(1 + hwRound((hwAbs(Gear^.dY) - _0_4) * 70)); |
2017 | 76 |
ApplyDamage(Gear, dmg); |
1123 | 77 |
end |
4 | 78 |
end; |
79 |
||
80 |
//////////////////////////////////////////////////////////////////////////////// |
|
81 |
//////////////////////////////////////////////////////////////////////////////// |
|
82 |
procedure CalcRotationDirAngle(Gear: PGear); |
|
776
8fc7e59d9cb4
Convert the rest of rotated sprites to be rotated by OpenGL
unc0rr
parents:
764
diff
changeset
|
83 |
var dAngle: real; |
4 | 84 |
begin |
776
8fc7e59d9cb4
Convert the rest of rotated sprites to be rotated by OpenGL
unc0rr
parents:
764
diff
changeset
|
85 |
dAngle:= (hwAbs(Gear^.dX) + hwAbs(Gear^.dY)).QWordValue / $80000000; |
1133 | 86 |
if not Gear^.dX.isNegative then |
87 |
Gear^.DirAngle:= Gear^.DirAngle + dAngle |
|
88 |
else |
|
89 |
Gear^.DirAngle:= Gear^.DirAngle - dAngle; |
|
90 |
||
776
8fc7e59d9cb4
Convert the rest of rotated sprites to be rotated by OpenGL
unc0rr
parents:
764
diff
changeset
|
91 |
if Gear^.DirAngle < 0 then Gear^.DirAngle:= Gear^.DirAngle + 360 |
8fc7e59d9cb4
Convert the rest of rotated sprites to be rotated by OpenGL
unc0rr
parents:
764
diff
changeset
|
92 |
else if 360 < Gear^.DirAngle then Gear^.DirAngle:= Gear^.DirAngle - 360 |
4 | 93 |
end; |
94 |
||
95 |
//////////////////////////////////////////////////////////////////////////////// |
|
96 |
procedure doStepDrowningGear(Gear: PGear); |
|
97 |
begin |
|
98 |
AllInactive:= false; |
|
351 | 99 |
Gear^.Y:= Gear^.Y + cDrownSpeed; |
2228 | 100 |
Gear^.X:= Gear^.X + Gear^.dX * cDrownSpeed; |
2143
ad05f6b2d1c0
New baseball bat sound, steam when fire lands on water (needs new hiss sound), bubbles when hedgehog drowns, more messages on
nemo
parents:
2142
diff
changeset
|
101 |
if hwRound(Gear^.Y) > Gear^.Radius + cWaterLine + cVisibleWater then DeleteGear(Gear); |
ad05f6b2d1c0
New baseball bat sound, steam when fire lands on water (needs new hiss sound), bubbles when hedgehog drowns, more messages on
nemo
parents:
2142
diff
changeset
|
102 |
// Create some bubbles (0.5% might be better but causes too few bubbles sometimes) |
2225 | 103 |
if (GameTicks and $1F) = 0 then |
2376 | 104 |
if (Gear^.Kind = gtHedgehog) and (Random(4) = 0) then |
2225 | 105 |
AddVisualGear(hwRound(Gear^.X) - Gear^.Radius, hwRound(Gear^.Y) - Gear^.Radius, vgtBubble) |
106 |
else if Random(12) = 0 then |
|
107 |
AddVisualGear(hwRound(Gear^.X) - Gear^.Radius, hwRound(Gear^.Y) - Gear^.Radius, vgtBubble) |
|
4 | 108 |
end; |
109 |
||
110 |
//////////////////////////////////////////////////////////////////////////////// |
|
111 |
procedure doStepFallingGear(Gear: PGear); |
|
2455
cc54dd148cc2
Remove sheepluva's simple 45 deg bouncing from r2472, add various flame sizes for Tiy
nemo
parents:
2440
diff
changeset
|
112 |
var isFalling: boolean; |
4 | 113 |
begin |
503 | 114 |
Gear^.State:= Gear^.State and not gstCollision; |
115 |
||
116 |
if Gear^.dY.isNegative then |
|
1133 | 117 |
begin |
118 |
isFalling:= true; |
|
119 |
if TestCollisionYwithGear(Gear, -1) then |
|
120 |
begin |
|
121 |
Gear^.dX:= Gear^.dX * Gear^.Friction; |
|
122 |
Gear^.dY:= - Gear^.dY * Gear^.Elasticity; |
|
123 |
Gear^.State:= Gear^.State or gstCollision |
|
124 |
end |
|
125 |
end else |
|
126 |
if TestCollisionYwithGear(Gear, 1) then |
|
127 |
begin |
|
128 |
isFalling:= false; |
|
129 |
Gear^.dX:= Gear^.dX * Gear^.Friction; |
|
130 |
Gear^.dY:= - Gear^.dY * Gear^.Elasticity; |
|
131 |
Gear^.State:= Gear^.State or gstCollision |
|
132 |
end else isFalling:= true; |
|
503 | 133 |
|
351 | 134 |
if TestCollisionXwithGear(Gear, hwSign(Gear^.dX)) then |
1133 | 135 |
begin |
136 |
Gear^.dX:= - Gear^.dX * Gear^.Elasticity; |
|
137 |
Gear^.dY:= Gear^.dY * Gear^.Elasticity; |
|
138 |
Gear^.State:= Gear^.State or gstCollision |
|
139 |
end; |
|
503 | 140 |
|
542 | 141 |
if isFalling then Gear^.dY:= Gear^.dY + cGravity; |
503 | 142 |
|
351 | 143 |
Gear^.X:= Gear^.X + Gear^.dX; |
144 |
Gear^.Y:= Gear^.Y + Gear^.dY; |
|
4 | 145 |
CheckGearDrowning(Gear); |
503 | 146 |
if (hwSqr(Gear^.dX) + hwSqr(Gear^.dY) < _0_0002) and |
1133 | 147 |
(not isFalling) then |
148 |
Gear^.State:= Gear^.State and not gstMoving |
|
149 |
else |
|
150 |
Gear^.State:= Gear^.State or gstMoving |
|
4 | 151 |
end; |
152 |
||
153 |
//////////////////////////////////////////////////////////////////////////////// |
|
154 |
procedure doStepBomb(Gear: PGear); |
|
371 | 155 |
var i: LongInt; |
919 | 156 |
dX, dY: hwFloat; |
4 | 157 |
begin |
158 |
AllInactive:= false; |
|
1263 | 159 |
|
4 | 160 |
doStepFallingGear(Gear); |
1263 | 161 |
|
351 | 162 |
dec(Gear^.Timer); |
163 |
if Gear^.Timer = 0 then |
|
1133 | 164 |
begin |
165 |
case Gear^.Kind of |
|
166 |
gtAmmo_Bomb: doMakeExplosion(hwRound(Gear^.X), hwRound(Gear^.Y), 50, EXPLAutoSound); |
|
1603 | 167 |
gtBall: doMakeExplosion(hwRound(Gear^.X), hwRound(Gear^.Y), 40, EXPLAutoSound); |
1133 | 168 |
gtClusterBomb: begin |
169 |
doMakeExplosion(hwRound(Gear^.X), hwRound(Gear^.Y), 20, EXPLAutoSound); |
|
170 |
for i:= 0 to 4 do |
|
171 |
begin |
|
172 |
dX:= rndSign(GetRandom * _0_1); |
|
173 |
dY:= (GetRandom - _3) * _0_08; |
|
1261 | 174 |
AddGear(hwRound(Gear^.X), hwRound(Gear^.Y), gtCluster, 0, dX, dY, 25); |
175 |
end |
|
176 |
end; |
|
177 |
gtWatermelon: begin |
|
178 |
doMakeExplosion(hwRound(Gear^.X), hwRound(Gear^.Y), 75, EXPLAutoSound); |
|
179 |
for i:= 0 to 5 do |
|
180 |
begin |
|
181 |
dX:= rndSign(GetRandom * _0_1); |
|
1496 | 182 |
dY:= (GetRandom - _1_5) * _0_3; |
1262 | 183 |
AddGear(hwRound(Gear^.X), hwRound(Gear^.Y), gtMelonPiece, 0, dX, dY, 75)^.DirAngle:= i * 60; |
1133 | 184 |
end |
1263 | 185 |
end; |
1555 | 186 |
gtHellishBomb: begin |
187 |
doMakeExplosion(hwRound(Gear^.X), hwRound(Gear^.Y), 90, EXPLAutoSound); |
|
188 |
for i:= 0 to 127 do |
|
189 |
begin |
|
190 |
dX:= AngleCos(i * 16) * _0_5 * (GetRandom + _1); |
|
191 |
dY:= AngleSin(i * 16) * _0_5 * (GetRandom + _1); |
|
192 |
AddGear(hwRound(Gear^.X), hwRound(Gear^.Y), gtFlame, 0, dX, dY, 0); |
|
193 |
AddGear(hwRound(Gear^.X), hwRound(Gear^.Y), gtFlame, 0, dX, -dY, 0); |
|
194 |
end |
|
195 |
end; |
|
1133 | 196 |
end; |
197 |
DeleteGear(Gear); |
|
198 |
exit |
|
199 |
end; |
|
1263 | 200 |
|
4 | 201 |
CalcRotationDirAngle(Gear); |
1263 | 202 |
|
203 |
if Gear^.Kind = gtHellishBomb then |
|
1279 | 204 |
begin |
1669 | 205 |
if Gear^.Timer = 3000 then PlaySound(sndHellish, false, nil); |
1279 | 206 |
|
1263 | 207 |
if (GameTicks and $3F) = 0 then |
208 |
if (Gear^.State and gstCollision) = 0 then |
|
209 |
AddGear(hwRound(Gear^.X), hwRound(Gear^.Y), gtEvilTrace, 0, _0, _0, 0); |
|
1279 | 210 |
end; |
1263 | 211 |
|
1158 | 212 |
if (Gear^.State and (gstCollision or gstMoving)) = (gstCollision or gstMoving) then |
213 |
if (hwAbs(Gear^.dX) > _0_1) or |
|
214 |
(hwAbs(Gear^.dY) > _0_1) then |
|
1669 | 215 |
PlaySound(sndGrenadeImpact, false, nil) |
4 | 216 |
end; |
2457
ecf0c7e7995b
Initial molotov cocktail. Still needs graphics, tweaking of fire behaviour. Also changed probabilities for default weapon sets
nemo
parents:
2455
diff
changeset
|
217 |
//////////////////////////////////////////////////////////////////////////////// |
ecf0c7e7995b
Initial molotov cocktail. Still needs graphics, tweaking of fire behaviour. Also changed probabilities for default weapon sets
nemo
parents:
2455
diff
changeset
|
218 |
procedure doStepMolotov(Gear: PGear); |
ecf0c7e7995b
Initial molotov cocktail. Still needs graphics, tweaking of fire behaviour. Also changed probabilities for default weapon sets
nemo
parents:
2455
diff
changeset
|
219 |
var i: LongInt; |
ecf0c7e7995b
Initial molotov cocktail. Still needs graphics, tweaking of fire behaviour. Also changed probabilities for default weapon sets
nemo
parents:
2455
diff
changeset
|
220 |
dX, dY: hwFloat; |
ecf0c7e7995b
Initial molotov cocktail. Still needs graphics, tweaking of fire behaviour. Also changed probabilities for default weapon sets
nemo
parents:
2455
diff
changeset
|
221 |
Fire: PGear; |
ecf0c7e7995b
Initial molotov cocktail. Still needs graphics, tweaking of fire behaviour. Also changed probabilities for default weapon sets
nemo
parents:
2455
diff
changeset
|
222 |
begin |
ecf0c7e7995b
Initial molotov cocktail. Still needs graphics, tweaking of fire behaviour. Also changed probabilities for default weapon sets
nemo
parents:
2455
diff
changeset
|
223 |
AllInactive:= false; |
ecf0c7e7995b
Initial molotov cocktail. Still needs graphics, tweaking of fire behaviour. Also changed probabilities for default weapon sets
nemo
parents:
2455
diff
changeset
|
224 |
|
ecf0c7e7995b
Initial molotov cocktail. Still needs graphics, tweaking of fire behaviour. Also changed probabilities for default weapon sets
nemo
parents:
2455
diff
changeset
|
225 |
doStepFallingGear(Gear); |
ecf0c7e7995b
Initial molotov cocktail. Still needs graphics, tweaking of fire behaviour. Also changed probabilities for default weapon sets
nemo
parents:
2455
diff
changeset
|
226 |
CalcRotationDirAngle(Gear); |
ecf0c7e7995b
Initial molotov cocktail. Still needs graphics, tweaking of fire behaviour. Also changed probabilities for default weapon sets
nemo
parents:
2455
diff
changeset
|
227 |
|
ecf0c7e7995b
Initial molotov cocktail. Still needs graphics, tweaking of fire behaviour. Also changed probabilities for default weapon sets
nemo
parents:
2455
diff
changeset
|
228 |
if (Gear^.State and gstCollision) <> 0 then begin |
2470 | 229 |
PlaySound(sndMolotov, false, nil); |
230 |
//doMakeExplosion(hwRound(Gear^.X), hwRound(Gear^.Y), 5, EXPLAutoSound); |
|
2457
ecf0c7e7995b
Initial molotov cocktail. Still needs graphics, tweaking of fire behaviour. Also changed probabilities for default weapon sets
nemo
parents:
2455
diff
changeset
|
231 |
for i:= 0 to 40 do begin |
2468
0b62498c201a
openal fix, training map selection and rcplane adjustments from Smaxx (untested, but look reasonable). Bunch of new graphics from Tiy, new translation for pt-pt from inu_
nemo
parents:
2462
diff
changeset
|
232 |
dX:= AngleCos(i * 2) * ((_0_08*(i mod 10))) * (GetRandom + _1); |
0b62498c201a
openal fix, training map selection and rcplane adjustments from Smaxx (untested, but look reasonable). Bunch of new graphics from Tiy, new translation for pt-pt from inu_
nemo
parents:
2462
diff
changeset
|
233 |
dY:= AngleSin(i * 8) * _0_5 * (GetRandom + _1); |
0b62498c201a
openal fix, training map selection and rcplane adjustments from Smaxx (untested, but look reasonable). Bunch of new graphics from Tiy, new translation for pt-pt from inu_
nemo
parents:
2462
diff
changeset
|
234 |
Fire:= AddGear(hwRound(Gear^.X), hwRound(Gear^.Y), gtFlame, 0, dX, dY, 0); |
0b62498c201a
openal fix, training map selection and rcplane adjustments from Smaxx (untested, but look reasonable). Bunch of new graphics from Tiy, new translation for pt-pt from inu_
nemo
parents:
2462
diff
changeset
|
235 |
Fire^.State:= Fire^.State or gsttmpFlag; |
0b62498c201a
openal fix, training map selection and rcplane adjustments from Smaxx (untested, but look reasonable). Bunch of new graphics from Tiy, new translation for pt-pt from inu_
nemo
parents:
2462
diff
changeset
|
236 |
Fire:= AddGear(hwRound(Gear^.X), hwRound(Gear^.Y), gtFlame, 0, dX, -dY, 0); |
0b62498c201a
openal fix, training map selection and rcplane adjustments from Smaxx (untested, but look reasonable). Bunch of new graphics from Tiy, new translation for pt-pt from inu_
nemo
parents:
2462
diff
changeset
|
237 |
Fire^.State:= Fire^.State or gsttmpFlag; |
0b62498c201a
openal fix, training map selection and rcplane adjustments from Smaxx (untested, but look reasonable). Bunch of new graphics from Tiy, new translation for pt-pt from inu_
nemo
parents:
2462
diff
changeset
|
238 |
Fire:= AddGear(hwRound(Gear^.X), hwRound(Gear^.Y), gtFlame, 0, -dX, dY, 0); |
0b62498c201a
openal fix, training map selection and rcplane adjustments from Smaxx (untested, but look reasonable). Bunch of new graphics from Tiy, new translation for pt-pt from inu_
nemo
parents:
2462
diff
changeset
|
239 |
Fire^.State:= Fire^.State or gsttmpFlag; |
0b62498c201a
openal fix, training map selection and rcplane adjustments from Smaxx (untested, but look reasonable). Bunch of new graphics from Tiy, new translation for pt-pt from inu_
nemo
parents:
2462
diff
changeset
|
240 |
Fire:= AddGear(hwRound(Gear^.X), hwRound(Gear^.Y), gtFlame, 0, -dX, -dY, 0); |
0b62498c201a
openal fix, training map selection and rcplane adjustments from Smaxx (untested, but look reasonable). Bunch of new graphics from Tiy, new translation for pt-pt from inu_
nemo
parents:
2462
diff
changeset
|
241 |
Fire^.State:= Fire^.State or gsttmpFlag; |
2457
ecf0c7e7995b
Initial molotov cocktail. Still needs graphics, tweaking of fire behaviour. Also changed probabilities for default weapon sets
nemo
parents:
2455
diff
changeset
|
242 |
end; |
ecf0c7e7995b
Initial molotov cocktail. Still needs graphics, tweaking of fire behaviour. Also changed probabilities for default weapon sets
nemo
parents:
2455
diff
changeset
|
243 |
DeleteGear(Gear); |
ecf0c7e7995b
Initial molotov cocktail. Still needs graphics, tweaking of fire behaviour. Also changed probabilities for default weapon sets
nemo
parents:
2455
diff
changeset
|
244 |
exit |
ecf0c7e7995b
Initial molotov cocktail. Still needs graphics, tweaking of fire behaviour. Also changed probabilities for default weapon sets
nemo
parents:
2455
diff
changeset
|
245 |
end; |
ecf0c7e7995b
Initial molotov cocktail. Still needs graphics, tweaking of fire behaviour. Also changed probabilities for default weapon sets
nemo
parents:
2455
diff
changeset
|
246 |
end; |
4 | 247 |
|
1279 | 248 |
procedure doStepWatermelon(Gear: PGear); |
249 |
begin |
|
250 |
AllInactive:= false; |
|
1669 | 251 |
PlaySound(sndMelon, false, nil); |
1279 | 252 |
Gear^.doStep:= @doStepBomb |
253 |
end; |
|
254 |
||
78 | 255 |
procedure doStepCluster(Gear: PGear); |
256 |
begin |
|
257 |
AllInactive:= false; |
|
258 |
doStepFallingGear(Gear); |
|
351 | 259 |
if (Gear^.State and gstCollision) <> 0 then |
1133 | 260 |
begin |
1261 | 261 |
doMakeExplosion(hwRound(Gear^.X), hwRound(Gear^.Y), Gear^.Timer, EXPLAutoSound); |
1133 | 262 |
DeleteGear(Gear); |
263 |
exit |
|
264 |
end; |
|
1262 | 265 |
|
266 |
if Gear^.Kind = gtMelonPiece then |
|
267 |
CalcRotationDirAngle(Gear) |
|
268 |
else |
|
269 |
if (GameTicks and $1F) = 0 then |
|
270 |
AddGear(hwRound(Gear^.X), hwRound(Gear^.Y), gtSmokeTrace, 0, _0, _0, 0) |
|
78 | 271 |
end; |
272 |
||
4 | 273 |
//////////////////////////////////////////////////////////////////////////////// |
274 |
procedure doStepGrenade(Gear: PGear); |
|
275 |
begin |
|
276 |
AllInactive:= false; |
|
351 | 277 |
Gear^.dX:= Gear^.dX + cWindSpeed; |
4 | 278 |
doStepFallingGear(Gear); |
351 | 279 |
if (Gear^.State and gstCollision) <> 0 then |
1133 | 280 |
begin |
281 |
doMakeExplosion(hwRound(Gear^.X), hwRound(Gear^.Y), 50, EXPLAutoSound); |
|
282 |
DeleteGear(Gear); |
|
283 |
exit |
|
284 |
end; |
|
4 | 285 |
if (GameTicks and $3F) = 0 then |
1133 | 286 |
AddGear(hwRound(Gear^.X), hwRound(Gear^.Y), gtSmokeTrace, 0, _0, _0, 0) |
4 | 287 |
end; |
288 |
||
289 |
//////////////////////////////////////////////////////////////////////////////// |
|
95 | 290 |
procedure doStepHealthTagWork(Gear: PGear); |
4 | 291 |
begin |
522 | 292 |
if Gear^.Kind = gtHealthTag then |
1505 | 293 |
AllInactive:= false; |
294 |
||
351 | 295 |
dec(Gear^.Timer); |
522 | 296 |
Gear^.Y:= Gear^.Y + Gear^.dY; |
1505 | 297 |
|
351 | 298 |
if Gear^.Timer = 0 then |
1133 | 299 |
begin |
2017 | 300 |
if (Gear^.Kind = gtHealthTag) and (PHedgehog(Gear^.Hedgehog)^.Gear <> nil) then |
1133 | 301 |
PHedgehog(Gear^.Hedgehog)^.Gear^.Active:= true; // to let current hh die |
302 |
DeleteGear(Gear) |
|
303 |
end |
|
4 | 304 |
end; |
305 |
||
263 | 306 |
procedure doStepHealthTagWorkUnderWater(Gear: PGear); |
307 |
begin |
|
1505 | 308 |
AllInactive:= false; |
1495 | 309 |
|
351 | 310 |
Gear^.Y:= Gear^.Y - _0_08; |
1495 | 311 |
|
498 | 312 |
if hwRound(Gear^.Y) < cWaterLine + 10 then |
1505 | 313 |
DeleteGear(Gear) |
263 | 314 |
end; |
315 |
||
95 | 316 |
procedure doStepHealthTag(Gear: PGear); |
317 |
var s: shortstring; |
|
318 |
begin |
|
1505 | 319 |
AllInactive:= false; |
320 |
Gear^.dY:= -_0_08; |
|
522 | 321 |
|
351 | 322 |
str(Gear^.State, s); |
1505 | 323 |
Gear^.Tex:= RenderStringTex(s, PHedgehog(Gear^.Hedgehog)^.Team^.Clan^.Color, fnt16); |
324 |
||
325 |
if hwRound(Gear^.Y) < cWaterLine then |
|
326 |
Gear^.doStep:= @doStepHealthTagWork |
|
327 |
else |
|
328 |
Gear^.doStep:= @doStepHealthTagWorkUnderWater; |
|
329 |
||
762 | 330 |
Gear^.Y:= Gear^.Y - int2hwFloat(Gear^.Tex^.h) |
95 | 331 |
end; |
332 |
||
4 | 333 |
//////////////////////////////////////////////////////////////////////////////// |
334 |
procedure doStepGrave(Gear: PGear); |
|
335 |
begin |
|
336 |
AllInactive:= false; |
|
498 | 337 |
if Gear^.dY.isNegative then |
338 |
if TestCollisionY(Gear, -1) then Gear^.dY:= _0; |
|
4 | 339 |
|
351 | 340 |
if not Gear^.dY.isNegative then |
68 | 341 |
if TestCollisionY(Gear, 1) then |
4 | 342 |
begin |
351 | 343 |
Gear^.dY:= - Gear^.dY * Gear^.Elasticity; |
344 |
if Gear^.dY > - _1div1024 then |
|
4 | 345 |
begin |
351 | 346 |
Gear^.Active:= false; |
4 | 347 |
exit |
1669 | 348 |
end else if Gear^.dY < - _0_03 then PlaySound(sndGraveImpact, false, nil) |
4 | 349 |
end; |
1505 | 350 |
|
351 | 351 |
Gear^.Y:= Gear^.Y + Gear^.dY; |
4 | 352 |
CheckGearDrowning(Gear); |
351 | 353 |
Gear^.dY:= Gear^.dY + cGravity |
4 | 354 |
end; |
355 |
||
356 |
//////////////////////////////////////////////////////////////////////////////// |
|
357 |
procedure doStepUFOWork(Gear: PGear); |
|
351 | 358 |
var t: hwFloat; |
374 | 359 |
y: LongInt; |
4 | 360 |
begin |
361 |
AllInactive:= false; |
|
351 | 362 |
t:= Distance(Gear^.dX, Gear^.dY); |
363 |
Gear^.dX:= Gear^.Elasticity * (Gear^.dX + _0_000004 * (TargetPoint.X - hwRound(Gear^.X))); |
|
364 |
Gear^.dY:= Gear^.Elasticity * (Gear^.dY + _0_000004 * (TargetPoint.Y - hwRound(Gear^.Y))); |
|
365 |
t:= t / Distance(Gear^.dX, Gear^.dY); |
|
366 |
Gear^.dX:= Gear^.dX * t; |
|
367 |
Gear^.dY:= Gear^.dY * t; |
|
368 |
Gear^.X:= Gear^.X + Gear^.dX; |
|
369 |
Gear^.Y:= Gear^.Y + Gear^.dY; |
|
374 | 370 |
|
371 |
if (GameTicks and $3F) = 0 then |
|
372 |
begin |
|
373 |
y:= hwRound(Gear^.Y); |
|
374 |
if y + Gear^.Radius < cWaterLine then |
|
498 | 375 |
AddGear(hwRound(Gear^.X), y, gtSmokeTrace, 0, _0, _0, 0); |
374 | 376 |
end; |
377 |
||
4 | 378 |
CheckCollision(Gear); |
351 | 379 |
dec(Gear^.Timer); |
380 |
if ((Gear^.State and gstCollision) <> 0) or (Gear^.Timer = 0) then |
|
4 | 381 |
begin |
560 | 382 |
StopSound(sndUFO); |
351 | 383 |
doMakeExplosion(hwRound(Gear^.X), hwRound(Gear^.Y), 50, EXPLAutoSound); |
4 | 384 |
DeleteGear(Gear); |
385 |
end; |
|
386 |
end; |
|
387 |
||
388 |
procedure doStepUFO(Gear: PGear); |
|
389 |
begin |
|
390 |
AllInactive:= false; |
|
351 | 391 |
Gear^.X:= Gear^.X + Gear^.dX; |
392 |
Gear^.Y:= Gear^.Y + Gear^.dY; |
|
393 |
Gear^.dY:= Gear^.dY + cGravity; |
|
4 | 394 |
CheckCollision(Gear); |
351 | 395 |
if (Gear^.State and gstCollision) <> 0 then |
4 | 396 |
begin |
351 | 397 |
doMakeExplosion(hwRound(Gear^.X), hwRound(Gear^.Y), 50, EXPLAutoSound); |
4 | 398 |
DeleteGear(Gear); |
399 |
exit |
|
400 |
end; |
|
351 | 401 |
dec(Gear^.Timer); |
402 |
if Gear^.Timer = 0 then |
|
4 | 403 |
begin |
1669 | 404 |
PlaySound(sndUFO, true, nil); |
351 | 405 |
Gear^.Timer:= 5000; |
406 |
Gear^.doStep:= @doStepUFOWork |
|
4 | 407 |
end; |
408 |
end; |
|
409 |
||
410 |
//////////////////////////////////////////////////////////////////////////////// |
|
876 | 411 |
procedure doStepShotIdle(Gear: PGear); |
412 |
begin |
|
413 |
AllInactive:= false; |
|
414 |
inc(Gear^.Timer); |
|
415 |
if Gear^.Timer > 75 then |
|
416 |
begin |
|
417 |
DeleteGear(Gear); |
|
418 |
AfterAttack |
|
419 |
end |
|
420 |
end; |
|
421 |
||
4 | 422 |
procedure doStepShotgunShot(Gear: PGear); |
423 |
var i: LongWord; |
|
424 |
begin |
|
425 |
AllInactive:= false; |
|
876 | 426 |
|
427 |
if ((Gear^.State and gstAnimation) = 0) then |
|
428 |
begin |
|
429 |
dec(Gear^.Timer); |
|
430 |
if Gear^.Timer = 0 then |
|
431 |
begin |
|
1669 | 432 |
PlaySound(sndShotgunFire, false, nil); |
876 | 433 |
Gear^.State:= Gear^.State or gstAnimation |
434 |
end; |
|
435 |
exit |
|
436 |
end |
|
437 |
else inc(Gear^.Timer); |
|
438 |
||
4 | 439 |
i:= 200; |
440 |
repeat |
|
351 | 441 |
Gear^.X:= Gear^.X + Gear^.dX; |
442 |
Gear^.Y:= Gear^.Y + Gear^.dY; |
|
4 | 443 |
CheckCollision(Gear); |
351 | 444 |
if (Gear^.State and gstCollision) <> 0 then |
876 | 445 |
begin |
446 |
Gear^.X:= Gear^.X + Gear^.dX * 8; |
|
447 |
Gear^.Y:= Gear^.Y + Gear^.dY * 8; |
|
448 |
ShotgunShot(Gear); |
|
449 |
Gear^.doStep:= @doStepShotIdle; |
|
450 |
exit |
|
451 |
end; |
|
4 | 452 |
dec(i) |
453 |
until i = 0; |
|
1760 | 454 |
if (hwRound(Gear^.X) and LAND_WIDTH_MASK <> 0) or (hwRound(Gear^.Y) and LAND_HEIGHT_MASK <> 0) then |
876 | 455 |
Gear^.doStep:= @doStepShotIdle |
4 | 456 |
end; |
457 |
||
458 |
//////////////////////////////////////////////////////////////////////////////// |
|
2023
41d3afaa20c7
Artillery mode, sniper rifle, speech bubble tweaks, fix of rope bug introduced by enabling hats in jump
nemo
parents:
2017
diff
changeset
|
459 |
procedure doStepBulletWork(Gear: PGear); |
38 | 460 |
var i, x, y: LongWord; |
351 | 461 |
oX, oY: hwFloat; |
38 | 462 |
begin |
463 |
AllInactive:= false; |
|
876 | 464 |
inc(Gear^.Timer); |
37 | 465 |
i:= 80; |
351 | 466 |
oX:= Gear^.X; |
467 |
oY:= Gear^.Y; |
|
37 | 468 |
repeat |
351 | 469 |
Gear^.X:= Gear^.X + Gear^.dX; |
470 |
Gear^.Y:= Gear^.Y + Gear^.dY; |
|
471 |
x:= hwRound(Gear^.X); |
|
472 |
y:= hwRound(Gear^.Y); |
|
1753 | 473 |
if ((y and LAND_HEIGHT_MASK) = 0) and ((x and LAND_WIDTH_MASK) = 0) |
351 | 474 |
and (Land[y, x] <> 0) then inc(Gear^.Damage); |
2023
41d3afaa20c7
Artillery mode, sniper rifle, speech bubble tweaks, fix of rope bug introduced by enabling hats in jump
nemo
parents:
2017
diff
changeset
|
475 |
if Gear^.Damage > 5 then |
41d3afaa20c7
Artillery mode, sniper rifle, speech bubble tweaks, fix of rope bug introduced by enabling hats in jump
nemo
parents:
2017
diff
changeset
|
476 |
if Gear^.Ammo^.AmmoType = amDEagle then |
41d3afaa20c7
Artillery mode, sniper rifle, speech bubble tweaks, fix of rope bug introduced by enabling hats in jump
nemo
parents:
2017
diff
changeset
|
477 |
AmmoShove(Gear, 7, 20) |
41d3afaa20c7
Artillery mode, sniper rifle, speech bubble tweaks, fix of rope bug introduced by enabling hats in jump
nemo
parents:
2017
diff
changeset
|
478 |
else |
2031
b6f3e56fb100
david_ac's game scheme options for mine delay/quantity, tweaks to sniper rifle
nemo
parents:
2029
diff
changeset
|
479 |
AmmoShove(Gear, Gear^.Timer, 20); |
38 | 480 |
dec(i) |
351 | 481 |
until (i = 0) or (Gear^.Damage > Gear^.Health); |
482 |
if Gear^.Damage > 0 then |
|
37 | 483 |
begin |
351 | 484 |
DrawTunnel(oX, oY, Gear^.dX, Gear^.dY, 82 - i, 1); |
485 |
dec(Gear^.Health, Gear^.Damage); |
|
486 |
Gear^.Damage:= 0 |
|
37 | 487 |
end; |
1760 | 488 |
|
489 |
if (Gear^.Health <= 0) |
|
490 |
or (hwRound(Gear^.X) and LAND_WIDTH_MASK <> 0) |
|
491 |
or (hwRound(Gear^.Y) and LAND_HEIGHT_MASK <> 0) then |
|
2031
b6f3e56fb100
david_ac's game scheme options for mine delay/quantity, tweaks to sniper rifle
nemo
parents:
2029
diff
changeset
|
492 |
begin |
2087 | 493 |
if (Gear^.Kind = gtSniperRifleShot) and ((GameFlags and gfLaserSight) = 0) then cLaserSighting:= false; |
2033 | 494 |
if (Gear^.Ammo^.NumPerTurn <= CurrentHedgehog^.AttacksNum) and |
2031
b6f3e56fb100
david_ac's game scheme options for mine delay/quantity, tweaks to sniper rifle
nemo
parents:
2029
diff
changeset
|
495 |
((GameFlags and gfArtillery) = 0) then cArtillery:= false; |
876 | 496 |
Gear^.doStep:= @doStepShotIdle |
2031
b6f3e56fb100
david_ac's game scheme options for mine delay/quantity, tweaks to sniper rifle
nemo
parents:
2029
diff
changeset
|
497 |
end; |
37 | 498 |
end; |
499 |
||
559 | 500 |
procedure doStepDEagleShot(Gear: PGear); |
501 |
begin |
|
1669 | 502 |
PlaySound(sndGun, false, nil); |
2023
41d3afaa20c7
Artillery mode, sniper rifle, speech bubble tweaks, fix of rope bug introduced by enabling hats in jump
nemo
parents:
2017
diff
changeset
|
503 |
Gear^.doStep:= @doStepBulletWork |
41d3afaa20c7
Artillery mode, sniper rifle, speech bubble tweaks, fix of rope bug introduced by enabling hats in jump
nemo
parents:
2017
diff
changeset
|
504 |
end; |
41d3afaa20c7
Artillery mode, sniper rifle, speech bubble tweaks, fix of rope bug introduced by enabling hats in jump
nemo
parents:
2017
diff
changeset
|
505 |
|
41d3afaa20c7
Artillery mode, sniper rifle, speech bubble tweaks, fix of rope bug introduced by enabling hats in jump
nemo
parents:
2017
diff
changeset
|
506 |
procedure doStepSniperRifleShot(Gear: PGear); |
2031
b6f3e56fb100
david_ac's game scheme options for mine delay/quantity, tweaks to sniper rifle
nemo
parents:
2029
diff
changeset
|
507 |
var HHGear: PGear; |
2023
41d3afaa20c7
Artillery mode, sniper rifle, speech bubble tweaks, fix of rope bug introduced by enabling hats in jump
nemo
parents:
2017
diff
changeset
|
508 |
begin |
2024
2985f3bd18b7
Disable long jump in artillery mode, make snipre rifle single shot
nemo
parents:
2023
diff
changeset
|
509 |
cArtillery:= true; |
2031
b6f3e56fb100
david_ac's game scheme options for mine delay/quantity, tweaks to sniper rifle
nemo
parents:
2029
diff
changeset
|
510 |
HHGear:=PHedgehog(Gear^.Hedgehog)^.Gear; |
b6f3e56fb100
david_ac's game scheme options for mine delay/quantity, tweaks to sniper rifle
nemo
parents:
2029
diff
changeset
|
511 |
HHGear^.State:= HHGear^.State or gstNotKickable; |
2033 | 512 |
HedgehogChAngle(HHGear); |
2220 | 513 |
if not cLaserSighting then // game does not have default laser sight. turn it on and give them a chance to aim |
2023
41d3afaa20c7
Artillery mode, sniper rifle, speech bubble tweaks, fix of rope bug introduced by enabling hats in jump
nemo
parents:
2017
diff
changeset
|
514 |
begin |
41d3afaa20c7
Artillery mode, sniper rifle, speech bubble tweaks, fix of rope bug introduced by enabling hats in jump
nemo
parents:
2017
diff
changeset
|
515 |
cLaserSighting:= true; |
2031
b6f3e56fb100
david_ac's game scheme options for mine delay/quantity, tweaks to sniper rifle
nemo
parents:
2029
diff
changeset
|
516 |
HHGear^.Message:= 0; |
2052 | 517 |
if(HHGear^.Angle - 32 >= 0) then dec(HHGear^.Angle,32) |
2031
b6f3e56fb100
david_ac's game scheme options for mine delay/quantity, tweaks to sniper rifle
nemo
parents:
2029
diff
changeset
|
518 |
end; |
b6f3e56fb100
david_ac's game scheme options for mine delay/quantity, tweaks to sniper rifle
nemo
parents:
2029
diff
changeset
|
519 |
|
b6f3e56fb100
david_ac's game scheme options for mine delay/quantity, tweaks to sniper rifle
nemo
parents:
2029
diff
changeset
|
520 |
if (HHGear^.Message and gm_Attack) <> 0 then |
b6f3e56fb100
david_ac's game scheme options for mine delay/quantity, tweaks to sniper rifle
nemo
parents:
2029
diff
changeset
|
521 |
begin |
b6f3e56fb100
david_ac's game scheme options for mine delay/quantity, tweaks to sniper rifle
nemo
parents:
2029
diff
changeset
|
522 |
Gear^.State:= Gear^.State or gstAnimation; |
b6f3e56fb100
david_ac's game scheme options for mine delay/quantity, tweaks to sniper rifle
nemo
parents:
2029
diff
changeset
|
523 |
Gear^.dX:= SignAs(AngleSin(HHGear^.Angle), HHGear^.dX) * _0_5; |
b6f3e56fb100
david_ac's game scheme options for mine delay/quantity, tweaks to sniper rifle
nemo
parents:
2029
diff
changeset
|
524 |
Gear^.dY:= -AngleCos(HHGear^.Angle) * _0_5; |
b6f3e56fb100
david_ac's game scheme options for mine delay/quantity, tweaks to sniper rifle
nemo
parents:
2029
diff
changeset
|
525 |
PlaySound(sndGun, false, nil); |
b6f3e56fb100
david_ac's game scheme options for mine delay/quantity, tweaks to sniper rifle
nemo
parents:
2029
diff
changeset
|
526 |
Gear^.doStep:= @doStepBulletWork; |
2024
2985f3bd18b7
Disable long jump in artillery mode, make snipre rifle single shot
nemo
parents:
2023
diff
changeset
|
527 |
end |
2985f3bd18b7
Disable long jump in artillery mode, make snipre rifle single shot
nemo
parents:
2023
diff
changeset
|
528 |
else |
2031
b6f3e56fb100
david_ac's game scheme options for mine delay/quantity, tweaks to sniper rifle
nemo
parents:
2029
diff
changeset
|
529 |
if (GameTicks mod 32) = 0 then |
2376 | 530 |
if (GameTicks mod 4096) < 2048 then |
2052 | 531 |
begin |
532 |
if(HHGear^.Angle + 1 <= cMaxAngle) then inc(HHGear^.Angle) |
|
533 |
end |
|
534 |
else |
|
535 |
if(HHGear^.Angle - 1 >= 0) then dec(HHGear^.Angle); |
|
2024
2985f3bd18b7
Disable long jump in artillery mode, make snipre rifle single shot
nemo
parents:
2023
diff
changeset
|
536 |
|
2376 | 537 |
if (TurnTimeLeft > 0) then |
2058 | 538 |
dec(TurnTimeLeft) |
539 |
else |
|
540 |
begin |
|
2139
5a083e71a71d
Properly decrement sniper rifle if timed out. Try to get camera position straight for once.
nemo
parents:
2090
diff
changeset
|
541 |
PHedgehog(Gear^.Hedgehog)^.AttacksNum:= Gear^.Ammo^.NumPerTurn+1; |
2058 | 542 |
DeleteGear(Gear); |
2059 | 543 |
AfterAttack; |
544 |
TurnTimeLeft:= 0 |
|
2058 | 545 |
end; |
559 | 546 |
end; |
547 |
||
37 | 548 |
//////////////////////////////////////////////////////////////////////////////// |
4 | 549 |
procedure doStepActionTimer(Gear: PGear); |
550 |
begin |
|
351 | 551 |
dec(Gear^.Timer); |
552 |
case Gear^.Kind of |
|
83 | 553 |
gtATStartGame: begin |
4 | 554 |
AllInactive:= false; |
351 | 555 |
if Gear^.Timer = 0 then |
83 | 556 |
AddCaption(trmsg[sidStartFight], $FFFFFF, capgrpGameState); |
4 | 557 |
end; |
83 | 558 |
gtATSmoothWindCh: begin |
351 | 559 |
if Gear^.Timer = 0 then |
6 | 560 |
begin |
351 | 561 |
if WindBarWidth < Gear^.Tag then inc(WindBarWidth) |
562 |
else if WindBarWidth > Gear^.Tag then dec(WindBarWidth); |
|
563 |
if WindBarWidth <> Gear^.Tag then Gear^.Timer:= 10; |
|
83 | 564 |
end |
565 |
end; |
|
566 |
gtATFinishGame: begin |
|
567 |
AllInactive:= false; |
|
351 | 568 |
if Gear^.Timer = 0 then |
113 | 569 |
begin |
570 |
SendIPC('N'); |
|
324
f4c109c82a0c
Don't show game stats in case of interrupted by command '/quit' game
unc0rr
parents:
306
diff
changeset
|
571 |
SendIPC('q'); |
83 | 572 |
GameState:= gsExit |
113 | 573 |
end |
6 | 574 |
end; |
4 | 575 |
end; |
351 | 576 |
if Gear^.Timer = 0 then DeleteGear(Gear) |
4 | 577 |
end; |
578 |
||
579 |
//////////////////////////////////////////////////////////////////////////////// |
|
580 |
procedure doStepPickHammerWork(Gear: PGear); |
|
371 | 581 |
var i, ei: LongInt; |
4 | 582 |
HHGear: PGear; |
583 |
begin |
|
70 | 584 |
AllInactive:= false; |
351 | 585 |
HHGear:= PHedgehog(Gear^.Hedgehog)^.Gear; |
586 |
dec(Gear^.Timer); |
|
587 |
if (Gear^.Timer = 0)or((Gear^.Message and gm_Destroy) <> 0)or((HHGear^.State and gstHHDriven) = 0) then |
|
1200 | 588 |
begin |
589 |
StopSound(sndPickhammer); |
|
590 |
DeleteGear(Gear); |
|
591 |
AfterAttack; |
|
592 |
exit |
|
593 |
end; |
|
845 | 594 |
|
422 | 595 |
if (Gear^.Timer mod 33) = 0 then |
1200 | 596 |
begin |
597 |
HHGear^.State:= HHGear^.State or gstNoDamage; |
|
598 |
doMakeExplosion(hwRound(Gear^.X), hwRound(Gear^.Y) + 7, 6, EXPLDontDraw); |
|
599 |
HHGear^.State:= HHGear^.State and not gstNoDamage |
|
600 |
end; |
|
422 | 601 |
|
602 |
if (Gear^.Timer mod 47) = 0 then |
|
1200 | 603 |
begin |
604 |
i:= hwRound(Gear^.X) - Gear^.Radius - LongInt(GetRandom(2)); |
|
605 |
ei:= hwRound(Gear^.X) + Gear^.Radius + LongInt(GetRandom(2)); |
|
606 |
while i <= ei do |
|
607 |
begin |
|
608 |
DrawExplosion(i, hwRound(Gear^.Y) + 3, 3); |
|
609 |
inc(i, 1) |
|
610 |
end; |
|
2331
e4941a7986d6
Another try at keeping blowtorch/firepunch/jackhammer from going through indestructible stuff. Shame these routines don't use hedgehog movement
nemo
parents:
2329
diff
changeset
|
611 |
|
e4941a7986d6
Another try at keeping blowtorch/firepunch/jackhammer from going through indestructible stuff. Shame these routines don't use hedgehog movement
nemo
parents:
2329
diff
changeset
|
612 |
if CheckLandValue(hwRound(Gear^.X + Gear^.dX + SignAs(_6,Gear^.dX)), hwRound(Gear^.Y + _1_9), COLOR_INDESTRUCTIBLE) then |
2090
4edb0d49a42d
prevent unc0rr from getting clever with jackhammer too. bring blowtorch into line with the other - should be more fun anyway
nemo
parents:
2089
diff
changeset
|
613 |
begin |
4edb0d49a42d
prevent unc0rr from getting clever with jackhammer too. bring blowtorch into line with the other - should be more fun anyway
nemo
parents:
2089
diff
changeset
|
614 |
Gear^.X:= Gear^.X + Gear^.dX; |
4edb0d49a42d
prevent unc0rr from getting clever with jackhammer too. bring blowtorch into line with the other - should be more fun anyway
nemo
parents:
2089
diff
changeset
|
615 |
Gear^.Y:= Gear^.Y + _1_9; |
4edb0d49a42d
prevent unc0rr from getting clever with jackhammer too. bring blowtorch into line with the other - should be more fun anyway
nemo
parents:
2089
diff
changeset
|
616 |
end; |
1200 | 617 |
SetAllHHToActive; |
618 |
end; |
|
4 | 619 |
if TestCollisionYwithGear(Gear, 1) then |
1200 | 620 |
begin |
621 |
Gear^.dY:= _0; |
|
622 |
SetLittle(HHGear^.dX); |
|
623 |
HHGear^.dY:= _0; |
|
624 |
end else |
|
625 |
begin |
|
626 |
Gear^.dY:= Gear^.dY + cGravity; |
|
627 |
Gear^.Y:= Gear^.Y + Gear^.dY; |
|
1417 | 628 |
if hwRound(Gear^.Y) > cWaterLine then Gear^.Timer:= 1 |
1200 | 629 |
end; |
4 | 630 |
|
351 | 631 |
Gear^.X:= Gear^.X + HHGear^.dX; |
632 |
HHGear^.X:= Gear^.X; |
|
498 | 633 |
HHGear^.Y:= Gear^.Y - int2hwFloat(cHHRadius); |
4 | 634 |
|
351 | 635 |
if (Gear^.Message and gm_Attack) <> 0 then |
636 |
if (Gear^.State and gsttmpFlag) <> 0 then Gear^.Timer:= 1 else else |
|
637 |
if (Gear^.State and gsttmpFlag) = 0 then Gear^.State:= Gear^.State or gsttmpFlag; |
|
638 |
if ((Gear^.Message and gm_Left) <> 0) then Gear^.dX:= - _0_3 else |
|
639 |
if ((Gear^.Message and gm_Right) <> 0) then Gear^.dX:= _0_3 |
|
498 | 640 |
else Gear^.dX:= _0; |
4 | 641 |
end; |
642 |
||
643 |
procedure doStepPickHammer(Gear: PGear); |
|
371 | 644 |
var i, y: LongInt; |
4 | 645 |
ar: TRangeArray; |
911
b709fe13ed69
Fix issue with hedgehog on top of the hedgehog with pickhammer
unc0rr
parents:
883
diff
changeset
|
646 |
HHGear: PGear; |
4 | 647 |
begin |
648 |
i:= 0; |
|
911
b709fe13ed69
Fix issue with hedgehog on top of the hedgehog with pickhammer
unc0rr
parents:
883
diff
changeset
|
649 |
HHGear:= PHedgehog(Gear^.Hedgehog)^.Gear; |
b709fe13ed69
Fix issue with hedgehog on top of the hedgehog with pickhammer
unc0rr
parents:
883
diff
changeset
|
650 |
|
498 | 651 |
y:= hwRound(Gear^.Y) - cHHRadius * 2; |
351 | 652 |
while y < hwRound(Gear^.Y) do |
4 | 653 |
begin |
371 | 654 |
ar[i].Left := hwRound(Gear^.X) - Gear^.Radius - LongInt(GetRandom(2)); |
655 |
ar[i].Right:= hwRound(Gear^.X) + Gear^.Radius + LongInt(GetRandom(2)); |
|
4 | 656 |
inc(y, 2); |
657 |
inc(i) |
|
658 |
end; |
|
911
b709fe13ed69
Fix issue with hedgehog on top of the hedgehog with pickhammer
unc0rr
parents:
883
diff
changeset
|
659 |
|
498 | 660 |
DrawHLinesExplosions(@ar, 3, hwRound(Gear^.Y) - cHHRadius * 2, 2, Pred(i)); |
911
b709fe13ed69
Fix issue with hedgehog on top of the hedgehog with pickhammer
unc0rr
parents:
883
diff
changeset
|
661 |
Gear^.dY:= HHGear^.dY; |
b709fe13ed69
Fix issue with hedgehog on top of the hedgehog with pickhammer
unc0rr
parents:
883
diff
changeset
|
662 |
DeleteCI(HHGear); |
b709fe13ed69
Fix issue with hedgehog on top of the hedgehog with pickhammer
unc0rr
parents:
883
diff
changeset
|
663 |
|
1669 | 664 |
PlaySound(sndPickhammer, true, nil); |
4 | 665 |
doStepPickHammerWork(Gear); |
351 | 666 |
Gear^.doStep:= @doStepPickHammerWork |
4 | 667 |
end; |
668 |
||
669 |
//////////////////////////////////////////////////////////////////////////////// |
|
371 | 670 |
var BTPrevAngle, BTSteps: LongInt; |
302 | 671 |
|
303
1659c4aad5ab
Now blow torch angle can be changed during blowing :)
unc0rr
parents:
302
diff
changeset
|
672 |
procedure doStepBlowTorchWork(Gear: PGear); |
302 | 673 |
var HHGear: PGear; |
1528 | 674 |
b: boolean; |
675 |
prevX: LongInt; |
|
302 | 676 |
begin |
677 |
AllInactive:= false; |
|
351 | 678 |
dec(Gear^.Timer); |
679 |
HHGear:= PHedgehog(Gear^.Hedgehog)^.Gear; |
|
303
1659c4aad5ab
Now blow torch angle can be changed during blowing :)
unc0rr
parents:
302
diff
changeset
|
680 |
|
1659c4aad5ab
Now blow torch angle can be changed during blowing :)
unc0rr
parents:
302
diff
changeset
|
681 |
HedgehogChAngle(HHGear); |
1659c4aad5ab
Now blow torch angle can be changed during blowing :)
unc0rr
parents:
302
diff
changeset
|
682 |
|
305 | 683 |
b:= false; |
684 |
||
371 | 685 |
if abs(LongInt(HHGear^.Angle) - BTPrevAngle) > 7 then |
1528 | 686 |
begin |
687 |
Gear^.dX:= SignAs(AngleSin(HHGear^.Angle) * _0_5, HHGear^.dX); |
|
688 |
Gear^.dY:= AngleCos(HHGear^.Angle) * ( - _0_5); |
|
689 |
BTPrevAngle:= HHGear^.Angle; |
|
690 |
b:= true |
|
691 |
end; |
|
692 |
||
693 |
if ((HHGear^.State and gstMoving) <> 0) then |
|
694 |
begin |
|
695 |
doStepHedgehogMoving(HHGear); |
|
1736 | 696 |
if (HHGear^.State and gstHHDriven) = 0 then Gear^.Timer:= 0 |
1528 | 697 |
end; |
305 | 698 |
|
351 | 699 |
if Gear^.Timer mod cHHStepTicks = 0 then |
1528 | 700 |
begin |
701 |
b:= true; |
|
702 |
if Gear^.dX.isNegative then |
|
1547 | 703 |
HHGear^.Message:= (HHGear^.Message and (gm_Attack or gm_Up or gm_Down)) or gm_Left |
1528 | 704 |
else |
1547 | 705 |
HHGear^.Message:= (HHGear^.Message and (gm_Attack or gm_Up or gm_Down)) or gm_Right; |
305 | 706 |
|
1528 | 707 |
if ((HHGear^.State and gstMoving) = 0) then |
708 |
begin |
|
709 |
HHGear^.State:= HHGear^.State and not gstAttacking; |
|
710 |
prevX:= hwRound(HHGear^.X); |
|
2376 | 711 |
|
712 |
// why the call to HedgehogStep then a further increment of X? |
|
713 |
if (prevX = hwRound(HHGear^.X)) and |
|
2331
e4941a7986d6
Another try at keeping blowtorch/firepunch/jackhammer from going through indestructible stuff. Shame these routines don't use hedgehog movement
nemo
parents:
2329
diff
changeset
|
714 |
CheckLandValue(hwRound(HHGear^.X + SignAs(_6, HHGear^.dX)), hwRound(HHGear^.Y), COLOR_INDESTRUCTIBLE) then HedgehogStep(HHGear); |
2376 | 715 |
|
716 |
if (prevX = hwRound(HHGear^.X)) and |
|
2331
e4941a7986d6
Another try at keeping blowtorch/firepunch/jackhammer from going through indestructible stuff. Shame these routines don't use hedgehog movement
nemo
parents:
2329
diff
changeset
|
717 |
CheckLandValue(hwRound(HHGear^.X + SignAs(_6, HHGear^.dX)), hwRound(HHGear^.Y), COLOR_INDESTRUCTIBLE) then HHGear^.X:= HHGear^.X + SignAs(_1, HHGear^.dX); |
1528 | 718 |
HHGear^.State:= HHGear^.State or gstAttacking |
719 |
end; |
|
305 | 720 |
|
1528 | 721 |
inc(BTSteps); |
722 |
if BTSteps = 7 then |
|
723 |
begin |
|
724 |
BTSteps:= 0; |
|
2331
e4941a7986d6
Another try at keeping blowtorch/firepunch/jackhammer from going through indestructible stuff. Shame these routines don't use hedgehog movement
nemo
parents:
2329
diff
changeset
|
725 |
if CheckLandValue(hwRound(HHGear^.X + Gear^.dX * (cHHRadius + cBlowTorchC) + SignAs(_6,Gear^.dX)), hwRound(HHGear^.Y + Gear^.dY * (cHHRadius + cBlowTorchC)), COLOR_INDESTRUCTIBLE) then |
2090
4edb0d49a42d
prevent unc0rr from getting clever with jackhammer too. bring blowtorch into line with the other - should be more fun anyway
nemo
parents:
2089
diff
changeset
|
726 |
begin |
2331
e4941a7986d6
Another try at keeping blowtorch/firepunch/jackhammer from going through indestructible stuff. Shame these routines don't use hedgehog movement
nemo
parents:
2329
diff
changeset
|
727 |
Gear^.X:= HHGear^.X + Gear^.dX * (cHHRadius + cBlowTorchC); |
e4941a7986d6
Another try at keeping blowtorch/firepunch/jackhammer from going through indestructible stuff. Shame these routines don't use hedgehog movement
nemo
parents:
2329
diff
changeset
|
728 |
Gear^.Y:= HHGear^.Y + Gear^.dY * (cHHRadius + cBlowTorchC); |
2090
4edb0d49a42d
prevent unc0rr from getting clever with jackhammer too. bring blowtorch into line with the other - should be more fun anyway
nemo
parents:
2089
diff
changeset
|
729 |
end; |
1528 | 730 |
HHGear^.State:= HHGear^.State or gstNoDamage; |
1643 | 731 |
AmmoShove(Gear, 2, 15); |
1528 | 732 |
HHGear^.State:= HHGear^.State and not gstNoDamage |
733 |
end; |
|
734 |
end; |
|
305 | 735 |
|
736 |
if b then |
|
498 | 737 |
DrawTunnel(HHGear^.X - Gear^.dX * cHHRadius, HHGear^.Y - _4 - Gear^.dY * cHHRadius + hwAbs(Gear^.dY) * 7, |
351 | 738 |
Gear^.dX, Gear^.dY, |
1501 | 739 |
cHHRadius * 5, cHHRadius * 2 + 7); |
305 | 740 |
|
2090
4edb0d49a42d
prevent unc0rr from getting clever with jackhammer too. bring blowtorch into line with the other - should be more fun anyway
nemo
parents:
2089
diff
changeset
|
741 |
if (Gear^.Timer = 0) or ((HHGear^.Message and gm_Attack) <> 0) then |
1528 | 742 |
begin |
743 |
HHGear^.Message:= 0; |
|
744 |
HHGear^.State:= HHGear^.State and (not gstNotKickable); |
|
745 |
DeleteGear(Gear); |
|
746 |
AfterAttack |
|
747 |
end |
|
302 | 748 |
end; |
749 |
||
303
1659c4aad5ab
Now blow torch angle can be changed during blowing :)
unc0rr
parents:
302
diff
changeset
|
750 |
procedure doStepBlowTorch(Gear: PGear); |
1659c4aad5ab
Now blow torch angle can be changed during blowing :)
unc0rr
parents:
302
diff
changeset
|
751 |
var HHGear: PGear; |
1659c4aad5ab
Now blow torch angle can be changed during blowing :)
unc0rr
parents:
302
diff
changeset
|
752 |
begin |
371 | 753 |
BTPrevAngle:= High(LongInt); |
305 | 754 |
BTSteps:= 0; |
351 | 755 |
HHGear:= PHedgehog(Gear^.Hedgehog)^.Gear; |
756 |
HHGear^.Message:= 0; |
|
1528 | 757 |
HHGear^.State:= HHGear^.State or gstNotKickable; |
351 | 758 |
Gear^.doStep:= @doStepBlowTorchWork |
303
1659c4aad5ab
Now blow torch angle can be changed during blowing :)
unc0rr
parents:
302
diff
changeset
|
759 |
end; |
1659c4aad5ab
Now blow torch angle can be changed during blowing :)
unc0rr
parents:
302
diff
changeset
|
760 |
|
302 | 761 |
//////////////////////////////////////////////////////////////////////////////// |
762 |
||
1781 | 763 |
procedure doStepRope(Gear: PGear); forward; |
764 |
||
765 |
procedure doStepRopeAfterAttack(Gear: PGear); |
|
766 |
var HHGear: PGear; |
|
767 |
begin |
|
768 |
HHGear:= PHedgehog(Gear^.Hedgehog)^.Gear; |
|
769 |
if ((HHGear^.State and gstHHDriven) = 0) |
|
770 |
or (CheckGearDrowning(HHGear)) |
|
771 |
or TestCollisionYwithGear(HHGear, 1) then |
|
772 |
begin |
|
773 |
DeleteGear(Gear); |
|
2060
3e9e5e1be6f5
fix crash in parachute/rope if drowning with active girder/teleport
nemo
parents:
2059
diff
changeset
|
774 |
isCursorVisible:= false; |
1781 | 775 |
exit |
776 |
end; |
|
777 |
||
1785 | 778 |
HedgehogChAngle(HHGear); |
779 |
||
2283 | 780 |
if TestCollisionXwithGear(HHGear, hwSign(HHGear^.dX)) then SetLittle(HHGear^.dX); |
2029 | 781 |
|
1781 | 782 |
if HHGear^.dY.isNegative and TestCollisionYwithGear(HHGear, -1) then HHGear^.dY:= _0; |
783 |
HHGear^.X:= HHGear^.X + HHGear^.dX; |
|
784 |
HHGear^.Y:= HHGear^.Y + HHGear^.dY; |
|
785 |
HHGear^.dY:= HHGear^.dY + cGravity; |
|
786 |
||
787 |
if (Gear^.Message and gm_Attack) <> 0 then |
|
788 |
begin |
|
789 |
Gear^.X:= HHGear^.X; |
|
790 |
Gear^.Y:= HHGear^.Y; |
|
1964 | 791 |
|
792 |
ApplyAngleBounds(PHedgehog(Gear^.Hedgehog)^, amRope); |
|
2376 | 793 |
|
1781 | 794 |
Gear^.dX:= SignAs(AngleSin(HHGear^.Angle), HHGear^.dX); |
795 |
Gear^.dY:= -AngleCos(HHGear^.Angle); |
|
796 |
Gear^.Friction:= _450; |
|
797 |
Gear^.Elasticity:= _0; |
|
798 |
Gear^.State:= Gear^.State and not gsttmpflag; |
|
799 |
Gear^.doStep:= @doStepRope |
|
800 |
end |
|
801 |
end; |
|
802 |
||
4 | 803 |
procedure doStepRopeWork(Gear: PGear); |
804 |
var HHGear: PGear; |
|
1669 | 805 |
len, tx, ty, nx, ny, ropeDx, ropeDy, mdX, mdY: hwFloat; |
1504 | 806 |
lx, ly: LongInt; |
1553
77f326c7f0ef
The best final fix for rope stucking in the ground bug
unc0rr
parents:
1552
diff
changeset
|
807 |
haveCollision, |
77f326c7f0ef
The best final fix for rope stucking in the ground bug
unc0rr
parents:
1552
diff
changeset
|
808 |
haveDivided: boolean; |
4 | 809 |
|
1504 | 810 |
procedure DeleteMe; |
811 |
begin |
|
812 |
with HHGear^ do |
|
813 |
begin |
|
814 |
Message:= Message and not gm_Attack; |
|
2025
692308790912
Adjust routines impacted by DrawRotatedF modification, clear gstHHHJump in rope to avoid crosshair/hat drawing bug.
nemo
parents:
2024
diff
changeset
|
815 |
State:= (State or gstMoving) and not gstWinner; |
1504 | 816 |
end; |
817 |
DeleteGear(Gear) |
|
818 |
end; |
|
4 | 819 |
|
1781 | 820 |
procedure WaitCollision; |
821 |
begin |
|
822 |
with HHGear^ do |
|
823 |
begin |
|
824 |
Message:= Message and not gm_Attack; |
|
825 |
State:= State or gstMoving; |
|
826 |
end; |
|
827 |
RopePoints.Count:= 0; |
|
828 |
Gear^.Elasticity:= _0; |
|
829 |
Gear^.doStep:= @doStepRopeAfterAttack |
|
830 |
end; |
|
831 |
||
4 | 832 |
begin |
351 | 833 |
HHGear:= PHedgehog(Gear^.Hedgehog)^.Gear; |
108 | 834 |
|
351 | 835 |
if ((HHGear^.State and gstHHDriven) = 0) |
1504 | 836 |
or (CheckGearDrowning(HHGear)) then |
837 |
begin |
|
838 |
DeleteMe; |
|
839 |
exit |
|
840 |
end; |
|
928
b9064b48b001
Some preparation work for attacking from rope, parachute and etc.
unc0rr
parents:
925
diff
changeset
|
841 |
|
351 | 842 |
if (Gear^.Message and gm_Left <> 0) then HHGear^.dX:= HHGear^.dX - _0_0002 else |
843 |
if (Gear^.Message and gm_Right <> 0) then HHGear^.dX:= HHGear^.dX + _0_0002; |
|
4 | 844 |
|
351 | 845 |
if not TestCollisionYwithGear(HHGear, 1) then HHGear^.dY:= HHGear^.dY + cGravity; |
4 | 846 |
|
1652 | 847 |
ropeDx:= HHGear^.X - Gear^.X; // vector between hedgehog and rope attaching point |
848 |
ropeDy:= HHGear^.Y - Gear^.Y; |
|
849 |
||
850 |
mdX:= ropeDx + HHGear^.dX; |
|
851 |
mdY:= ropeDy + HHGear^.dY; |
|
852 |
len:= _1 / Distance(mdX, mdY); |
|
853 |
mdX:= mdX * len; // rope vector plus hedgehog direction vector normalized |
|
854 |
mdY:= mdY * len; |
|
855 |
||
856 |
Gear^.dX:= mdX; // for visual purposes only |
|
857 |
Gear^.dY:= mdY; |
|
858 |
||
859 |
///// |
|
860 |
tx:= HHGear^.X; |
|
861 |
ty:= HHGear^.Y; |
|
4 | 862 |
|
1652 | 863 |
if ((Gear^.Message and gm_Down) <> 0) and (Gear^.Elasticity < Gear^.Friction) then |
864 |
if not (TestCollisionXwithGear(HHGear, hwSign(ropeDx)) |
|
865 |
or TestCollisionYwithGear(HHGear, hwSign(ropeDy))) then |
|
866 |
Gear^.Elasticity:= Gear^.Elasticity + _0_3; |
|
867 |
||
868 |
if ((Gear^.Message and gm_Up) <> 0) and (Gear^.Elasticity > _30) then |
|
869 |
if not (TestCollisionXwithGear(HHGear, -hwSign(ropeDx)) |
|
870 |
or TestCollisionYwithGear(HHGear, -hwSign(ropeDy))) then |
|
871 |
Gear^.Elasticity:= Gear^.Elasticity - _0_3; |
|
872 |
||
873 |
HHGear^.X:= Gear^.X + mdX * Gear^.Elasticity; |
|
874 |
HHGear^.Y:= Gear^.Y + mdY * Gear^.Elasticity; |
|
875 |
||
876 |
HHGear^.dX:= HHGear^.X - tx; |
|
877 |
HHGear^.dY:= HHGear^.Y - ty; |
|
878 |
//// |
|
879 |
||
1554 | 880 |
|
1922 | 881 |
haveDivided:= false; |
1553
77f326c7f0ef
The best final fix for rope stucking in the ground bug
unc0rr
parents:
1552
diff
changeset
|
882 |
// check whether rope needs dividing |
77f326c7f0ef
The best final fix for rope stucking in the ground bug
unc0rr
parents:
1552
diff
changeset
|
883 |
len:= _1 / Distance(ropeDx, ropeDy); // old rope pos |
77f326c7f0ef
The best final fix for rope stucking in the ground bug
unc0rr
parents:
1552
diff
changeset
|
884 |
nx:= ropeDx * len; |
77f326c7f0ef
The best final fix for rope stucking in the ground bug
unc0rr
parents:
1552
diff
changeset
|
885 |
ny:= ropeDy * len; |
2376 | 886 |
|
1652 | 887 |
len:= Gear^.Elasticity - _0_3x70; |
2365 | 888 |
while len > _3 do |
1504 | 889 |
begin |
1652 | 890 |
lx:= hwRound(Gear^.X + mdX * len); |
891 |
ly:= hwRound(Gear^.Y + mdY * len); |
|
1753 | 892 |
if ((ly and LAND_HEIGHT_MASK) = 0) and ((lx and LAND_WIDTH_MASK) = 0) and (Land[ly, lx] <> 0) then |
1504 | 893 |
begin |
894 |
with RopePoints.ar[RopePoints.Count] do |
|
895 |
begin |
|
896 |
X:= Gear^.X; |
|
897 |
Y:= Gear^.Y; |
|
1553
77f326c7f0ef
The best final fix for rope stucking in the ground bug
unc0rr
parents:
1552
diff
changeset
|
898 |
if RopePoints.Count = 0 then RopePoints.HookAngle:= DxDy2Angle(Gear^.dY, Gear^.dX); |
1652 | 899 |
b:= (nx * HHGear^.dY) > (ny * HHGear^.dX); |
1504 | 900 |
dLen:= len |
901 |
end; |
|
2365 | 902 |
with RopePoints.rounded[RopePoints.Count] do |
903 |
begin |
|
904 |
X:= hwRound(Gear^.X); |
|
905 |
Y:= hwRound(Gear^.Y); |
|
906 |
end; |
|
2376 | 907 |
|
1553
77f326c7f0ef
The best final fix for rope stucking in the ground bug
unc0rr
parents:
1552
diff
changeset
|
908 |
Gear^.X:= Gear^.X + nx * len; |
77f326c7f0ef
The best final fix for rope stucking in the ground bug
unc0rr
parents:
1552
diff
changeset
|
909 |
Gear^.Y:= Gear^.Y + ny * len; |
1504 | 910 |
inc(RopePoints.Count); |
911 |
TryDo(RopePoints.Count <= MAXROPEPOINTS, 'Rope points overflow', true); |
|
912 |
Gear^.Elasticity:= Gear^.Elasticity - len; |
|
913 |
Gear^.Friction:= Gear^.Friction - len; |
|
1553
77f326c7f0ef
The best final fix for rope stucking in the ground bug
unc0rr
parents:
1552
diff
changeset
|
914 |
haveDivided:= true; |
1504 | 915 |
break |
916 |
end; |
|
1553
77f326c7f0ef
The best final fix for rope stucking in the ground bug
unc0rr
parents:
1552
diff
changeset
|
917 |
len:= len - _0_3 // should be the same as increase step |
1504 | 918 |
end; |
1553
77f326c7f0ef
The best final fix for rope stucking in the ground bug
unc0rr
parents:
1552
diff
changeset
|
919 |
|
77f326c7f0ef
The best final fix for rope stucking in the ground bug
unc0rr
parents:
1552
diff
changeset
|
920 |
if not haveDivided then |
1504 | 921 |
if RopePoints.Count > 0 then // check whether the last dividing point could be removed |
922 |
begin |
|
923 |
tx:= RopePoints.ar[Pred(RopePoints.Count)].X; |
|
924 |
ty:= RopePoints.ar[Pred(RopePoints.Count)].Y; |
|
925 |
if RopePoints.ar[Pred(RopePoints.Count)].b xor ((tx - Gear^.X) * (ty - HHGear^.Y) > (tx - HHGear^.X) * (ty - Gear^.Y)) then |
|
926 |
begin |
|
927 |
dec(RopePoints.Count); |
|
1652 | 928 |
Gear^.X:= RopePoints.ar[RopePoints.Count].X; |
929 |
Gear^.Y:= RopePoints.ar[RopePoints.Count].Y; |
|
1504 | 930 |
Gear^.Elasticity:= Gear^.Elasticity + RopePoints.ar[RopePoints.Count].dLen; |
931 |
Gear^.Friction:= Gear^.Friction + RopePoints.ar[RopePoints.Count].dLen |
|
932 |
end |
|
933 |
end; |
|
4 | 934 |
|
1551
c747e69f98f3
Add some speed to hedgehog on rope when colliding with land and pressing left or right arrow key
unc0rr
parents:
1548
diff
changeset
|
935 |
haveCollision:= false; |
351 | 936 |
if TestCollisionXwithGear(HHGear, hwSign(HHGear^.dX)) then |
1551
c747e69f98f3
Add some speed to hedgehog on rope when colliding with land and pressing left or right arrow key
unc0rr
parents:
1548
diff
changeset
|
937 |
begin |
1504 | 938 |
HHGear^.dX:= -_0_6 * HHGear^.dX; |
1551
c747e69f98f3
Add some speed to hedgehog on rope when colliding with land and pressing left or right arrow key
unc0rr
parents:
1548
diff
changeset
|
939 |
haveCollision:= true |
c747e69f98f3
Add some speed to hedgehog on rope when colliding with land and pressing left or right arrow key
unc0rr
parents:
1548
diff
changeset
|
940 |
end; |
351 | 941 |
if TestCollisionYwithGear(HHGear, hwSign(HHGear^.dY)) then |
1551
c747e69f98f3
Add some speed to hedgehog on rope when colliding with land and pressing left or right arrow key
unc0rr
parents:
1548
diff
changeset
|
942 |
begin |
1504 | 943 |
HHGear^.dY:= -_0_6 * HHGear^.dY; |
1551
c747e69f98f3
Add some speed to hedgehog on rope when colliding with land and pressing left or right arrow key
unc0rr
parents:
1548
diff
changeset
|
944 |
haveCollision:= true |
c747e69f98f3
Add some speed to hedgehog on rope when colliding with land and pressing left or right arrow key
unc0rr
parents:
1548
diff
changeset
|
945 |
end; |
c747e69f98f3
Add some speed to hedgehog on rope when colliding with land and pressing left or right arrow key
unc0rr
parents:
1548
diff
changeset
|
946 |
|
1579
2f581b1f289e
More bouncy rope, but you need to press vertical arrow and horizontal keys at once to bounce
unc0rr
parents:
1573
diff
changeset
|
947 |
if haveCollision |
2f581b1f289e
More bouncy rope, but you need to press vertical arrow and horizontal keys at once to bounce
unc0rr
parents:
1573
diff
changeset
|
948 |
and (Gear^.Message and (gm_Left or gm_Right) <> 0) |
2f581b1f289e
More bouncy rope, but you need to press vertical arrow and horizontal keys at once to bounce
unc0rr
parents:
1573
diff
changeset
|
949 |
and (Gear^.Message and (gm_Up or gm_Down) <> 0) then |
1551
c747e69f98f3
Add some speed to hedgehog on rope when colliding with land and pressing left or right arrow key
unc0rr
parents:
1548
diff
changeset
|
950 |
begin |
1579
2f581b1f289e
More bouncy rope, but you need to press vertical arrow and horizontal keys at once to bounce
unc0rr
parents:
1573
diff
changeset
|
951 |
HHGear^.dX:= SignAs(hwAbs(HHGear^.dX) + _0_2, HHGear^.dX); |
2f581b1f289e
More bouncy rope, but you need to press vertical arrow and horizontal keys at once to bounce
unc0rr
parents:
1573
diff
changeset
|
952 |
HHGear^.dY:= SignAs(hwAbs(HHGear^.dY) + _0_2, HHGear^.dY) |
1551
c747e69f98f3
Add some speed to hedgehog on rope when colliding with land and pressing left or right arrow key
unc0rr
parents:
1548
diff
changeset
|
953 |
end; |
4 | 954 |
|
789 | 955 |
len:= Distance(HHGear^.dX, HHGear^.dY); |
940 | 956 |
if len > _0_8 then |
1504 | 957 |
begin |
958 |
len:= _0_8 / len; |
|
959 |
HHGear^.dX:= HHGear^.dX * len; |
|
960 |
HHGear^.dY:= HHGear^.dY * len; |
|
961 |
end; |
|
789 | 962 |
|
351 | 963 |
if (Gear^.Message and gm_Attack) <> 0 then |
1504 | 964 |
if (Gear^.State and gsttmpFlag) <> 0 then |
1922 | 965 |
with PHedgehog(Gear^.Hedgehog)^ do |
1964 | 966 |
if Ammo^[CurSlot, CurAmmo].AmmoType <> amParachute then |
1922 | 967 |
WaitCollision |
968 |
else |
|
969 |
DeleteMe |
|
1504 | 970 |
else |
971 |
else |
|
972 |
if (Gear^.State and gsttmpFlag) = 0 then |
|
973 |
Gear^.State:= Gear^.State or gsttmpFlag; |
|
4 | 974 |
end; |
975 |
||
976 |
procedure doStepRopeAttach(Gear: PGear); |
|
977 |
var HHGear: PGear; |
|
1781 | 978 |
tx, ty, tt: hwFloat; |
979 |
||
980 |
procedure RemoveFromAmmo; |
|
981 |
begin |
|
982 |
if (Gear^.State and gstAttacked) = 0 then |
|
983 |
begin |
|
984 |
OnUsedAmmo(PHedgehog(HHGear^.Hedgehog)^); |
|
985 |
Gear^.State:= Gear^.State or gstAttacked |
|
1964 | 986 |
end; |
987 |
ApplyAmmoChanges(PHedgehog(HHGear^.Hedgehog)^) |
|
1781 | 988 |
end; |
2376 | 989 |
|
4 | 990 |
begin |
351 | 991 |
Gear^.X:= Gear^.X - Gear^.dX; |
992 |
Gear^.Y:= Gear^.Y - Gear^.dY; |
|
498 | 993 |
Gear^.Elasticity:= Gear^.Elasticity + _1; |
351 | 994 |
HHGear:= PHedgehog(Gear^.Hedgehog)^.Gear; |
517 | 995 |
DeleteCI(HHGear); |
542 | 996 |
if (HHGear^.State and gstMoving) <> 0 then |
1433 | 997 |
begin |
2282 | 998 |
if TestCollisionXwithGear(HHGear, hwSign(HHGear^.dX)) then SetLittle(HHGear^.dX); |
2329
1cfb7d184ee1
Fix bug with hedgehog getting into ground while throwing rope (http://hedgewars.org/node/1722)
unc0rr
parents:
2301
diff
changeset
|
999 |
if HHGear^.dY.isNegative and TestCollisionYwithGear(HHGear, -1) then HHGear^.dY:= _0; |
2376 | 1000 |
|
1433 | 1001 |
HHGear^.X:= HHGear^.X + HHGear^.dX; |
1002 |
Gear^.X:= Gear^.X + HHGear^.dX; |
|
2281
3217f0d8c420
Fix hedgehog stopping to slide when throwing rope (not tested)
unc0rr
parents:
2280
diff
changeset
|
1003 |
|
3217f0d8c420
Fix hedgehog stopping to slide when throwing rope (not tested)
unc0rr
parents:
2280
diff
changeset
|
1004 |
if TestCollisionYwithGear(HHGear, 1) then |
3217f0d8c420
Fix hedgehog stopping to slide when throwing rope (not tested)
unc0rr
parents:
2280
diff
changeset
|
1005 |
begin |
3217f0d8c420
Fix hedgehog stopping to slide when throwing rope (not tested)
unc0rr
parents:
2280
diff
changeset
|
1006 |
CheckHHDamage(HHGear); |
3217f0d8c420
Fix hedgehog stopping to slide when throwing rope (not tested)
unc0rr
parents:
2280
diff
changeset
|
1007 |
HHGear^.dY:= _0; |
2339 | 1008 |
//HHGear^.State:= HHGear^.State and not (gstHHJumping or gstHHHJump); |
2281
3217f0d8c420
Fix hedgehog stopping to slide when throwing rope (not tested)
unc0rr
parents:
2280
diff
changeset
|
1009 |
end else |
1433 | 1010 |
begin |
2281
3217f0d8c420
Fix hedgehog stopping to slide when throwing rope (not tested)
unc0rr
parents:
2280
diff
changeset
|
1011 |
HHGear^.Y:= HHGear^.Y + HHGear^.dY; |
3217f0d8c420
Fix hedgehog stopping to slide when throwing rope (not tested)
unc0rr
parents:
2280
diff
changeset
|
1012 |
Gear^.Y:= Gear^.Y + HHGear^.dY; |
3217f0d8c420
Fix hedgehog stopping to slide when throwing rope (not tested)
unc0rr
parents:
2280
diff
changeset
|
1013 |
HHGear^.dY:= HHGear^.dY + cGravity; |
3217f0d8c420
Fix hedgehog stopping to slide when throwing rope (not tested)
unc0rr
parents:
2280
diff
changeset
|
1014 |
tt:= Gear^.Elasticity; |
3217f0d8c420
Fix hedgehog stopping to slide when throwing rope (not tested)
unc0rr
parents:
2280
diff
changeset
|
1015 |
tx:= _0; |
3217f0d8c420
Fix hedgehog stopping to slide when throwing rope (not tested)
unc0rr
parents:
2280
diff
changeset
|
1016 |
ty:= _0; |
3217f0d8c420
Fix hedgehog stopping to slide when throwing rope (not tested)
unc0rr
parents:
2280
diff
changeset
|
1017 |
while tt > _20 do |
1433 | 1018 |
begin |
2281
3217f0d8c420
Fix hedgehog stopping to slide when throwing rope (not tested)
unc0rr
parents:
2280
diff
changeset
|
1019 |
if TestCollisionXwithXYShift(Gear, tx, hwRound(ty), -hwSign(Gear^.dX)) |
3217f0d8c420
Fix hedgehog stopping to slide when throwing rope (not tested)
unc0rr
parents:
2280
diff
changeset
|
1020 |
or TestCollisionYwithXYShift(Gear, hwRound(tx), hwRound(ty), -hwSign(Gear^.dY)) then |
3217f0d8c420
Fix hedgehog stopping to slide when throwing rope (not tested)
unc0rr
parents:
2280
diff
changeset
|
1021 |
begin |
3217f0d8c420
Fix hedgehog stopping to slide when throwing rope (not tested)
unc0rr
parents:
2280
diff
changeset
|
1022 |
Gear^.X:= Gear^.X + tx; |
3217f0d8c420
Fix hedgehog stopping to slide when throwing rope (not tested)
unc0rr
parents:
2280
diff
changeset
|
1023 |
Gear^.Y:= Gear^.Y + ty; |
3217f0d8c420
Fix hedgehog stopping to slide when throwing rope (not tested)
unc0rr
parents:
2280
diff
changeset
|
1024 |
Gear^.Elasticity:= tt; |
3217f0d8c420
Fix hedgehog stopping to slide when throwing rope (not tested)
unc0rr
parents:
2280
diff
changeset
|
1025 |
Gear^.doStep:= @doStepRopeWork; |
2339 | 1026 |
with HHGear^ do State:= State and not (gstAttacking or gstHHJumping or gstHHHJump); |
2376 | 1027 |
|
2281
3217f0d8c420
Fix hedgehog stopping to slide when throwing rope (not tested)
unc0rr
parents:
2280
diff
changeset
|
1028 |
RemoveFromAmmo; |
2376 | 1029 |
|
2281
3217f0d8c420
Fix hedgehog stopping to slide when throwing rope (not tested)
unc0rr
parents:
2280
diff
changeset
|
1030 |
tt:= _0; |
3217f0d8c420
Fix hedgehog stopping to slide when throwing rope (not tested)
unc0rr
parents:
2280
diff
changeset
|
1031 |
exit |
3217f0d8c420
Fix hedgehog stopping to slide when throwing rope (not tested)
unc0rr
parents:
2280
diff
changeset
|
1032 |
end; |
3217f0d8c420
Fix hedgehog stopping to slide when throwing rope (not tested)
unc0rr
parents:
2280
diff
changeset
|
1033 |
tx:= tx + Gear^.dX + Gear^.dX; |
3217f0d8c420
Fix hedgehog stopping to slide when throwing rope (not tested)
unc0rr
parents:
2280
diff
changeset
|
1034 |
ty:= ty + Gear^.dY + Gear^.dY; |
3217f0d8c420
Fix hedgehog stopping to slide when throwing rope (not tested)
unc0rr
parents:
2280
diff
changeset
|
1035 |
tt:= tt - _2; |
1433 | 1036 |
end; |
1037 |
end; |
|
1038 |
end; |
|
929
9456e1e77369
- Continue preparation for implementing attack from rope and parachute
unc0rr
parents:
928
diff
changeset
|
1039 |
|
4 | 1040 |
CheckCollision(Gear); |
929
9456e1e77369
- Continue preparation for implementing attack from rope and parachute
unc0rr
parents:
928
diff
changeset
|
1041 |
|
351 | 1042 |
if (Gear^.State and gstCollision) <> 0 then |
2068 | 1043 |
if Gear^.Elasticity < _10 then |
1044 |
Gear^.Elasticity:= _10000 |
|
1045 |
else |
|
1046 |
begin |
|
1047 |
Gear^.doStep:= @doStepRopeWork; |
|
2339 | 1048 |
with HHGear^ do State:= State and not (gstAttacking or gstHHJumping or gstHHHJump); |
929
9456e1e77369
- Continue preparation for implementing attack from rope and parachute
unc0rr
parents:
928
diff
changeset
|
1049 |
|
2068 | 1050 |
RemoveFromAmmo; |
2376 | 1051 |
|
2068 | 1052 |
exit |
1053 |
end; |
|
4 | 1054 |
|
1634
486a89f0e843
Fix rope bug which allowed hedgehog to go into land
unc0rr
parents:
1633
diff
changeset
|
1055 |
if (Gear^.Elasticity > Gear^.Friction) |
486a89f0e843
Fix rope bug which allowed hedgehog to go into land
unc0rr
parents:
1633
diff
changeset
|
1056 |
or ((Gear^.Message and gm_Attack) = 0) |
2280 | 1057 |
or ((HHGear^.State and gstHHDriven) = 0) |
1634
486a89f0e843
Fix rope bug which allowed hedgehog to go into land
unc0rr
parents:
1633
diff
changeset
|
1058 |
or (HHGear^.Damage > 0) then |
1433 | 1059 |
begin |
1060 |
with PHedgehog(Gear^.Hedgehog)^.Gear^ do |
|
1061 |
begin |
|
1062 |
State:= State and not gstAttacking; |
|
1063 |
Message:= Message and not gm_Attack |
|
1064 |
end; |
|
1065 |
DeleteGear(Gear) |
|
1066 |
end |
|
4 | 1067 |
end; |
1068 |
||
1069 |
procedure doStepRope(Gear: PGear); |
|
1070 |
begin |
|
351 | 1071 |
Gear^.dX:= - Gear^.dX; |
1072 |
Gear^.dY:= - Gear^.dY; |
|
1073 |
Gear^.doStep:= @doStepRopeAttach |
|
4 | 1074 |
end; |
1075 |
||
1076 |
//////////////////////////////////////////////////////////////////////////////// |
|
1077 |
procedure doStepSmokeTrace(Gear: PGear); |
|
1078 |
begin |
|
351 | 1079 |
inc(Gear^.Timer); |
1080 |
if Gear^.Timer > 64 then |
|
1133 | 1081 |
begin |
1082 |
Gear^.Timer:= 0; |
|
1083 |
dec(Gear^.State) |
|
1084 |
end; |
|
351 | 1085 |
Gear^.dX:= Gear^.dX + cWindSpeed; |
1086 |
Gear^.X:= Gear^.X + Gear^.dX; |
|
1087 |
if Gear^.State = 0 then DeleteGear(Gear) |
|
4 | 1088 |
end; |
9 | 1089 |
|
1090 |
//////////////////////////////////////////////////////////////////////////////// |
|
1045 | 1091 |
procedure doStepExplosionWork(Gear: PGear); |
9 | 1092 |
begin |
351 | 1093 |
inc(Gear^.Timer); |
1094 |
if Gear^.Timer > 75 then |
|
1133 | 1095 |
begin |
1096 |
inc(Gear^.State); |
|
1097 |
Gear^.Timer:= 0; |
|
1098 |
if Gear^.State > 5 then DeleteGear(Gear) |
|
1099 |
end; |
|
9 | 1100 |
end; |
10 | 1101 |
|
1045 | 1102 |
procedure doStepExplosion(Gear: PGear); |
1103 |
var i: LongWord; |
|
1104 |
begin |
|
1047 | 1105 |
for i:= 0 to 31 do AddVisualGear(hwRound(Gear^.X), hwRound(Gear^.Y), vgtFire); |
1106 |
for i:= 0 to 8 do AddVisualGear(hwRound(Gear^.X), hwRound(Gear^.Y), vgtExplPart); |
|
1107 |
for i:= 0 to 8 do AddVisualGear(hwRound(Gear^.X), hwRound(Gear^.Y), vgtExplPart2); |
|
1045 | 1108 |
Gear^.doStep:= @doStepExplosionWork |
1109 |
end; |
|
1110 |
||
10 | 1111 |
//////////////////////////////////////////////////////////////////////////////// |
1112 |
procedure doStepMine(Gear: PGear); |
|
1113 |
begin |
|
542 | 1114 |
if (Gear^.State and gstMoving) <> 0 then |
914 | 1115 |
begin |
1116 |
DeleteCI(Gear); |
|
1117 |
doStepFallingGear(Gear); |
|
1118 |
if (Gear^.State and gstMoving) = 0 then |
|
1119 |
begin |
|
1120 |
AddGearCI(Gear); |
|
1121 |
Gear^.dX:= _0; |
|
1122 |
Gear^.dY:= _0 |
|
1123 |
end; |
|
1124 |
CalcRotationDirAngle(Gear); |
|
1125 |
AllInactive:= false |
|
1126 |
end else |
|
1127 |
if ((GameTicks and $3F) = 25) then |
|
1128 |
doStepFallingGear(Gear); |
|
351 | 1129 |
|
1130 |
if ((Gear^.State and gsttmpFlag) <> 0) then |
|
1133 | 1131 |
if ((Gear^.State and gstAttacking) = 0) then |
1132 |
begin |
|
1133 |
if ((GameTicks and $1F) = 0) then |
|
1134 |
if CheckGearNear(Gear, gtHedgehog, 46, 32) <> nil then Gear^.State:= Gear^.State or gstAttacking |
|
1135 |
end else // gstAttacking <> 0 |
|
1136 |
begin |
|
1137 |
AllInactive:= false; |
|
1669 | 1138 |
if (Gear^.Timer and $FF) = 0 then PlaySound(sndMineTick, false, nil); |
1133 | 1139 |
if Gear^.Timer = 0 then |
1140 |
begin |
|
1141 |
doMakeExplosion(hwRound(Gear^.X), hwRound(Gear^.Y), 50, EXPLAutoSound); |
|
1142 |
DeleteGear(Gear); |
|
1143 |
exit |
|
1144 |
end; |
|
1145 |
dec(Gear^.Timer); |
|
1146 |
end else // gsttmpFlag = 0 |
|
1147 |
if TurnTimeLeft = 0 then Gear^.State:= Gear^.State or gsttmpFlag; |
|
10 | 1148 |
end; |
57 | 1149 |
|
39 | 1150 |
//////////////////////////////////////////////////////////////////////////////// |
1151 |
procedure doStepDynamite(Gear: PGear); |
|
1152 |
begin |
|
43 | 1153 |
doStepFallingGear(Gear); |
1154 |
AllInactive:= false; |
|
351 | 1155 |
if Gear^.Timer mod 166 = 0 then inc(Gear^.Tag); |
1156 |
if Gear^.Timer = 0 then |
|
1133 | 1157 |
begin |
1158 |
doMakeExplosion(hwRound(Gear^.X), hwRound(Gear^.Y), 75, EXPLAutoSound); |
|
1159 |
DeleteGear(Gear); |
|
1160 |
exit |
|
1161 |
end; |
|
351 | 1162 |
dec(Gear^.Timer); |
39 | 1163 |
end; |
14
81f125629b25
- Mine checks whether a hedgehog is near less frequently
unc0rr
parents:
13
diff
changeset
|
1164 |
|
351 | 1165 |
/////////////////////////////////////////////////////////////////////////////// |
14
81f125629b25
- Mine checks whether a hedgehog is near less frequently
unc0rr
parents:
13
diff
changeset
|
1166 |
procedure doStepCase(Gear: PGear); |
371 | 1167 |
var i, x, y: LongInt; |
1436 | 1168 |
k: TGearType; |
14
81f125629b25
- Mine checks whether a hedgehog is near less frequently
unc0rr
parents:
13
diff
changeset
|
1169 |
begin |
351 | 1170 |
if (Gear^.Message and gm_Destroy) > 0 then |
1133 | 1171 |
begin |
1172 |
DeleteGear(Gear); |
|
1173 |
FreeActionsList; |
|
1174 |
SetAllToActive; // something (hh, mine, etc...) could be on top of the case |
|
1175 |
with CurrentHedgehog^ do |
|
1176 |
if Gear <> nil then Gear^.Message:= Gear^.Message and not (gm_LJump or gm_HJump); |
|
1177 |
exit |
|
1178 |
end; |
|
15 | 1179 |
|
351 | 1180 |
if Gear^.Damage > 0 then |
1133 | 1181 |
begin |
1182 |
x:= hwRound(Gear^.X); |
|
1183 |
y:= hwRound(Gear^.Y); |
|
1436 | 1184 |
k:= Gear^.Kind; |
1185 |
DeleteGear(Gear); // <-- delete gear! |
|
2376 | 1186 |
|
1436 | 1187 |
if k = gtCase then |
1133 | 1188 |
begin |
1189 |
doMakeExplosion(x, y, 25, EXPLAutoSound); |
|
1190 |
for i:= 0 to 63 do |
|
1191 |
AddGear(x, y, gtFlame, 0, _0, _0, 0); |
|
1192 |
end; |
|
1193 |
exit |
|
1194 |
end; |
|
79 | 1195 |
|
351 | 1196 |
if (Gear^.dY.QWordValue <> 0) or (not TestCollisionYwithGear(Gear, 1)) then |
1133 | 1197 |
begin |
1198 |
AllInactive:= false; |
|
1199 |
Gear^.dY:= Gear^.dY + cGravity; |
|
1200 |
Gear^.Y:= Gear^.Y + Gear^.dY; |
|
1201 |
if (Gear^.dY.isNegative) and TestCollisionYwithGear(Gear, -1) then Gear^.dY:= _0 else |
|
1202 |
if (not Gear^.dY.isNegative) and TestCollisionYwithGear(Gear, 1) then |
|
1203 |
begin |
|
1204 |
Gear^.dY:= - Gear^.dY * Gear^.Elasticity; |
|
1205 |
if Gear^.dY > - _0_001 then Gear^.dY:= _0 |
|
1669 | 1206 |
else if Gear^.dY < - _0_03 then PlaySound(sndGraveImpact, false, nil); |
1133 | 1207 |
end; |
1208 |
CheckGearDrowning(Gear); |
|
1209 |
end; |
|
14
81f125629b25
- Mine checks whether a hedgehog is near less frequently
unc0rr
parents:
13
diff
changeset
|
1210 |
|
511 | 1211 |
if (Gear^.dY.QWordValue = 0) then AddGearCI(Gear) |
1133 | 1212 |
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
|
1213 |
end; |
49 | 1214 |
|
1215 |
//////////////////////////////////////////////////////////////////////////////// |
|
2460 | 1216 |
|
1217 |
procedure doStepTarget(Gear: PGear); |
|
1218 |
begin |
|
1219 |
if (Gear^.Timer = 0) and (Gear^.Tag = 0) then |
|
1220 |
PlaySound(sndWarp, false, nil); |
|
1221 |
||
1222 |
if (Gear^.Tag = 0) and (Gear^.Timer < 1000) then |
|
1223 |
inc(Gear^.Timer) |
|
1224 |
else if Gear^.Tag = 1 then |
|
2468
0b62498c201a
openal fix, training map selection and rcplane adjustments from Smaxx (untested, but look reasonable). Bunch of new graphics from Tiy, new translation for pt-pt from inu_
nemo
parents:
2462
diff
changeset
|
1225 |
begin |
0b62498c201a
openal fix, training map selection and rcplane adjustments from Smaxx (untested, but look reasonable). Bunch of new graphics from Tiy, new translation for pt-pt from inu_
nemo
parents:
2462
diff
changeset
|
1226 |
Gear^.Tag:= 2; |
0b62498c201a
openal fix, training map selection and rcplane adjustments from Smaxx (untested, but look reasonable). Bunch of new graphics from Tiy, new translation for pt-pt from inu_
nemo
parents:
2462
diff
changeset
|
1227 |
if (TrainingFlags and tfTimeTrial) <> 0 then |
0b62498c201a
openal fix, training map selection and rcplane adjustments from Smaxx (untested, but look reasonable). Bunch of new graphics from Tiy, new translation for pt-pt from inu_
nemo
parents:
2462
diff
changeset
|
1228 |
begin |
2460 | 1229 |
inc(TurnTimeLeft, TrainingTimeInc); |
1230 |
||
1231 |
if TrainingTimeInc > TrainingTimeInM then |
|
1232 |
dec(TrainingTimeInc, TrainingTimeInD); |
|
1233 |
if TurnTimeLeft > TrainingTimeMax then |
|
1234 |
TurnTimeLeft:= TrainingTimeMax; |
|
2468
0b62498c201a
openal fix, training map selection and rcplane adjustments from Smaxx (untested, but look reasonable). Bunch of new graphics from Tiy, new translation for pt-pt from inu_
nemo
parents:
2462
diff
changeset
|
1235 |
end; |
0b62498c201a
openal fix, training map selection and rcplane adjustments from Smaxx (untested, but look reasonable). Bunch of new graphics from Tiy, new translation for pt-pt from inu_
nemo
parents:
2462
diff
changeset
|
1236 |
end |
0b62498c201a
openal fix, training map selection and rcplane adjustments from Smaxx (untested, but look reasonable). Bunch of new graphics from Tiy, new translation for pt-pt from inu_
nemo
parents:
2462
diff
changeset
|
1237 |
else if Gear^.Tag = 2 then |
0b62498c201a
openal fix, training map selection and rcplane adjustments from Smaxx (untested, but look reasonable). Bunch of new graphics from Tiy, new translation for pt-pt from inu_
nemo
parents:
2462
diff
changeset
|
1238 |
if Gear^.Timer > 0 then |
0b62498c201a
openal fix, training map selection and rcplane adjustments from Smaxx (untested, but look reasonable). Bunch of new graphics from Tiy, new translation for pt-pt from inu_
nemo
parents:
2462
diff
changeset
|
1239 |
dec(Gear^.Timer) |
0b62498c201a
openal fix, training map selection and rcplane adjustments from Smaxx (untested, but look reasonable). Bunch of new graphics from Tiy, new translation for pt-pt from inu_
nemo
parents:
2462
diff
changeset
|
1240 |
else |
0b62498c201a
openal fix, training map selection and rcplane adjustments from Smaxx (untested, but look reasonable). Bunch of new graphics from Tiy, new translation for pt-pt from inu_
nemo
parents:
2462
diff
changeset
|
1241 |
begin |
0b62498c201a
openal fix, training map selection and rcplane adjustments from Smaxx (untested, but look reasonable). Bunch of new graphics from Tiy, new translation for pt-pt from inu_
nemo
parents:
2462
diff
changeset
|
1242 |
if (TrainingFlags and tfTargetRespawn) <> 0 then |
0b62498c201a
openal fix, training map selection and rcplane adjustments from Smaxx (untested, but look reasonable). Bunch of new graphics from Tiy, new translation for pt-pt from inu_
nemo
parents:
2462
diff
changeset
|
1243 |
begin |
0b62498c201a
openal fix, training map selection and rcplane adjustments from Smaxx (untested, but look reasonable). Bunch of new graphics from Tiy, new translation for pt-pt from inu_
nemo
parents:
2462
diff
changeset
|
1244 |
TrainingTargetGear:= AddGear(0, 0, gtTarget, 0, _0, _0, 0); |
0b62498c201a
openal fix, training map selection and rcplane adjustments from Smaxx (untested, but look reasonable). Bunch of new graphics from Tiy, new translation for pt-pt from inu_
nemo
parents:
2462
diff
changeset
|
1245 |
FindPlace(TrainingTargetGear, false, 0, LAND_WIDTH); |
0b62498c201a
openal fix, training map selection and rcplane adjustments from Smaxx (untested, but look reasonable). Bunch of new graphics from Tiy, new translation for pt-pt from inu_
nemo
parents:
2462
diff
changeset
|
1246 |
end; |
2460 | 1247 |
DeleteGear(Gear); |
1248 |
exit; |
|
1249 |
end; |
|
1250 |
||
1251 |
doStepCase(Gear) |
|
1252 |
end; |
|
1253 |
||
1254 |
//////////////////////////////////////////////////////////////////////////////// |
|
854 | 1255 |
procedure doStepIdle(Gear: PGear); |
1256 |
begin |
|
1257 |
AllInactive:= false; |
|
925 | 1258 |
dec(Gear^.Timer); |
854 | 1259 |
if Gear^.Timer = 0 then |
1260 |
begin |
|
1261 |
DeleteGear(Gear); |
|
1262 |
AfterAttack |
|
1263 |
end |
|
1264 |
end; |
|
1265 |
||
79 | 1266 |
procedure doStepShover(Gear: PGear); |
1267 |
var HHGear: PGear; |
|
1268 |
begin |
|
351 | 1269 |
HHGear:= PHedgehog(Gear^.Hedgehog)^.Gear; |
1270 |
HHGear^.State:= HHGear^.State or gstNoDamage; |
|
980
20128e98988b
Don't push attacking hedgehog when using whip or baseball
unc0rr
parents:
979
diff
changeset
|
1271 |
DeleteCI(HHGear); |
20128e98988b
Don't push attacking hedgehog when using whip or baseball
unc0rr
parents:
979
diff
changeset
|
1272 |
|
79 | 1273 |
AmmoShove(Gear, 30, 115); |
980
20128e98988b
Don't push attacking hedgehog when using whip or baseball
unc0rr
parents:
979
diff
changeset
|
1274 |
|
351 | 1275 |
HHGear^.State:= HHGear^.State and not gstNoDamage; |
854 | 1276 |
Gear^.Timer:= 250; |
1277 |
Gear^.doStep:= @doStepIdle |
|
79 | 1278 |
end; |
1279 |
||
1280 |
//////////////////////////////////////////////////////////////////////////////// |
|
925 | 1281 |
procedure doStepWhip(Gear: PGear); |
1282 |
var HHGear: PGear; |
|
1283 |
i: LongInt; |
|
1284 |
begin |
|
1285 |
HHGear:= PHedgehog(Gear^.Hedgehog)^.Gear; |
|
1286 |
HHGear^.State:= HHGear^.State or gstNoDamage; |
|
980
20128e98988b
Don't push attacking hedgehog when using whip or baseball
unc0rr
parents:
979
diff
changeset
|
1287 |
DeleteCI(HHGear); |
925 | 1288 |
|
1289 |
for i:= 0 to 3 do |
|
1290 |
begin |
|
1291 |
AmmoShove(Gear, 30, 25); |
|
1292 |
Gear^.X:= Gear^.X + Gear^.dX * 5 |
|
1293 |
end; |
|
1294 |
||
1295 |
HHGear^.State:= HHGear^.State and not gstNoDamage; |
|
1296 |
Gear^.Timer:= 250; |
|
1297 |
Gear^.doStep:= @doStepIdle |
|
1298 |
end; |
|
1299 |
||
1300 |
//////////////////////////////////////////////////////////////////////////////// |
|
79 | 1301 |
procedure doStepFlame(Gear: PGear); |
2143
ad05f6b2d1c0
New baseball bat sound, steam when fire lands on water (needs new hiss sound), bubbles when hedgehog drowns, more messages on
nemo
parents:
2142
diff
changeset
|
1302 |
var i: Integer; |
79 | 1303 |
begin |
2424
b52344de23ae
In progress, trying to make a fire for molotov cocktail. Normal fire should still work fairly normally.
nemo
parents:
2376
diff
changeset
|
1304 |
if (Gear^.State and gsttmpFlag) = 0 then AllInactive:= false; |
1433 | 1305 |
|
79 | 1306 |
if not TestCollisionYwithGear(Gear, 1) then |
1133 | 1307 |
begin |
1586 | 1308 |
if hwAbs(Gear^.dX) > _0_01 then |
1309 |
Gear^.dX:= Gear^.dX * _0_995; |
|
2468
0b62498c201a
openal fix, training map selection and rcplane adjustments from Smaxx (untested, but look reasonable). Bunch of new graphics from Tiy, new translation for pt-pt from inu_
nemo
parents:
2462
diff
changeset
|
1310 |
if (Gear^.State and gsttmpFlag) <> 0 then Gear^.dY:= Gear^.dY + _2*cGravity else |
1133 | 1311 |
Gear^.dY:= Gear^.dY + cGravity; |
1830 | 1312 |
if hwAbs(Gear^.dY) > _0_2 then Gear^.dY:= Gear^.dY * _0_995; |
2376 | 1313 |
|
2468
0b62498c201a
openal fix, training map selection and rcplane adjustments from Smaxx (untested, but look reasonable). Bunch of new graphics from Tiy, new translation for pt-pt from inu_
nemo
parents:
2462
diff
changeset
|
1314 |
if (Gear^.State and gsttmpFlag) <> 0 then Gear^.X:= Gear^.X + Gear^.dX else |
1830 | 1315 |
Gear^.X:= Gear^.X + Gear^.dX + cWindSpeed * 640; |
1133 | 1316 |
Gear^.Y:= Gear^.Y + Gear^.dY; |
2376 | 1317 |
|
2143
ad05f6b2d1c0
New baseball bat sound, steam when fire lands on water (needs new hiss sound), bubbles when hedgehog drowns, more messages on
nemo
parents:
2142
diff
changeset
|
1318 |
if (hwRound(Gear^.Y) > cWaterLine) then |
1133 | 1319 |
begin |
2143
ad05f6b2d1c0
New baseball bat sound, steam when fire lands on water (needs new hiss sound), bubbles when hedgehog drowns, more messages on
nemo
parents:
2142
diff
changeset
|
1320 |
for i:= 0 to 3 do |
ad05f6b2d1c0
New baseball bat sound, steam when fire lands on water (needs new hiss sound), bubbles when hedgehog drowns, more messages on
nemo
parents:
2142
diff
changeset
|
1321 |
begin |
ad05f6b2d1c0
New baseball bat sound, steam when fire lands on water (needs new hiss sound), bubbles when hedgehog drowns, more messages on
nemo
parents:
2142
diff
changeset
|
1322 |
AddVisualGear(hwRound(Gear^.X) - 16 + Random(32), hwRound(Gear^.Y) - 16 + Random(16), vgtSteam); |
ad05f6b2d1c0
New baseball bat sound, steam when fire lands on water (needs new hiss sound), bubbles when hedgehog drowns, more messages on
nemo
parents:
2142
diff
changeset
|
1323 |
PlaySound(sndVaporize, false, nil); |
ad05f6b2d1c0
New baseball bat sound, steam when fire lands on water (needs new hiss sound), bubbles when hedgehog drowns, more messages on
nemo
parents:
2142
diff
changeset
|
1324 |
end; |
1133 | 1325 |
DeleteGear(Gear); |
1326 |
exit |
|
1327 |
end |
|
2424
b52344de23ae
In progress, trying to make a fire for molotov cocktail. Normal fire should still work fairly normally.
nemo
parents:
2376
diff
changeset
|
1328 |
end else begin |
b52344de23ae
In progress, trying to make a fire for molotov cocktail. Normal fire should still work fairly normally.
nemo
parents:
2376
diff
changeset
|
1329 |
if (Gear^.State and gsttmpFlag) <> 0 then |
b52344de23ae
In progress, trying to make a fire for molotov cocktail. Normal fire should still work fairly normally.
nemo
parents:
2376
diff
changeset
|
1330 |
begin |
b52344de23ae
In progress, trying to make a fire for molotov cocktail. Normal fire should still work fairly normally.
nemo
parents:
2376
diff
changeset
|
1331 |
Gear^.Radius:= 9; |
b52344de23ae
In progress, trying to make a fire for molotov cocktail. Normal fire should still work fairly normally.
nemo
parents:
2376
diff
changeset
|
1332 |
AmmoShove(Gear, 4, 100); |
b52344de23ae
In progress, trying to make a fire for molotov cocktail. Normal fire should still work fairly normally.
nemo
parents:
2376
diff
changeset
|
1333 |
Gear^.Radius:= 1 |
b52344de23ae
In progress, trying to make a fire for molotov cocktail. Normal fire should still work fairly normally.
nemo
parents:
2376
diff
changeset
|
1334 |
end; |
b52344de23ae
In progress, trying to make a fire for molotov cocktail. Normal fire should still work fairly normally.
nemo
parents:
2376
diff
changeset
|
1335 |
if Gear^.Timer > 0 then dec(Gear^.Timer) |
b52344de23ae
In progress, trying to make a fire for molotov cocktail. Normal fire should still work fairly normally.
nemo
parents:
2376
diff
changeset
|
1336 |
else begin |
b52344de23ae
In progress, trying to make a fire for molotov cocktail. Normal fire should still work fairly normally.
nemo
parents:
2376
diff
changeset
|
1337 |
// Standard fire |
b52344de23ae
In progress, trying to make a fire for molotov cocktail. Normal fire should still work fairly normally.
nemo
parents:
2376
diff
changeset
|
1338 |
if (Gear^.State and gsttmpFlag) = 0 then |
b52344de23ae
In progress, trying to make a fire for molotov cocktail. Normal fire should still work fairly normally.
nemo
parents:
2376
diff
changeset
|
1339 |
begin |
b52344de23ae
In progress, trying to make a fire for molotov cocktail. Normal fire should still work fairly normally.
nemo
parents:
2376
diff
changeset
|
1340 |
Gear^.Radius:= 9; |
b52344de23ae
In progress, trying to make a fire for molotov cocktail. Normal fire should still work fairly normally.
nemo
parents:
2376
diff
changeset
|
1341 |
AmmoShove(Gear, 4, 100); |
b52344de23ae
In progress, trying to make a fire for molotov cocktail. Normal fire should still work fairly normally.
nemo
parents:
2376
diff
changeset
|
1342 |
Gear^.Radius:= 1; |
b52344de23ae
In progress, trying to make a fire for molotov cocktail. Normal fire should still work fairly normally.
nemo
parents:
2376
diff
changeset
|
1343 |
doMakeExplosion(hwRound(Gear^.X), hwRound(Gear^.Y), 4, EXPLNoDamage); |
b52344de23ae
In progress, trying to make a fire for molotov cocktail. Normal fire should still work fairly normally.
nemo
parents:
2376
diff
changeset
|
1344 |
if Gear^.Health > 0 then dec(Gear^.Health); |
b52344de23ae
In progress, trying to make a fire for molotov cocktail. Normal fire should still work fairly normally.
nemo
parents:
2376
diff
changeset
|
1345 |
Gear^.Timer:= 450 - Gear^.Tag * 8 |
b52344de23ae
In progress, trying to make a fire for molotov cocktail. Normal fire should still work fairly normally.
nemo
parents:
2376
diff
changeset
|
1346 |
end |
b52344de23ae
In progress, trying to make a fire for molotov cocktail. Normal fire should still work fairly normally.
nemo
parents:
2376
diff
changeset
|
1347 |
else begin |
b52344de23ae
In progress, trying to make a fire for molotov cocktail. Normal fire should still work fairly normally.
nemo
parents:
2376
diff
changeset
|
1348 |
// Modified fire |
b52344de23ae
In progress, trying to make a fire for molotov cocktail. Normal fire should still work fairly normally.
nemo
parents:
2376
diff
changeset
|
1349 |
if ((GameTicks and $1FF) = 0) and ((GameFlags and gfSolidLand) = 0) then |
b52344de23ae
In progress, trying to make a fire for molotov cocktail. Normal fire should still work fairly normally.
nemo
parents:
2376
diff
changeset
|
1350 |
DrawExplosion(hwRound(Gear^.X), hwRound(Gear^.Y), 4); |
b52344de23ae
In progress, trying to make a fire for molotov cocktail. Normal fire should still work fairly normally.
nemo
parents:
2376
diff
changeset
|
1351 |
// This one is interesting. I think I understand the purpose, but I wonder if a bit more fuzzy of kicking could be done with getrandom. |
b52344de23ae
In progress, trying to make a fire for molotov cocktail. Normal fire should still work fairly normally.
nemo
parents:
2376
diff
changeset
|
1352 |
Gear^.Timer:= 100 - Gear^.Tag * 3; |
b52344de23ae
In progress, trying to make a fire for molotov cocktail. Normal fire should still work fairly normally.
nemo
parents:
2376
diff
changeset
|
1353 |
if ((GameTicks and $FF) = 0) then Gear^.Health:= 0 |
b52344de23ae
In progress, trying to make a fire for molotov cocktail. Normal fire should still work fairly normally.
nemo
parents:
2376
diff
changeset
|
1354 |
end |
b52344de23ae
In progress, trying to make a fire for molotov cocktail. Normal fire should still work fairly normally.
nemo
parents:
2376
diff
changeset
|
1355 |
end |
b52344de23ae
In progress, trying to make a fire for molotov cocktail. Normal fire should still work fairly normally.
nemo
parents:
2376
diff
changeset
|
1356 |
end; |
351 | 1357 |
if Gear^.Health = 0 then |
1133 | 1358 |
DeleteGear(Gear) |
79 | 1359 |
end; |
82 | 1360 |
|
1361 |
//////////////////////////////////////////////////////////////////////////////// |
|
1362 |
procedure doStepFirePunchWork(Gear: PGear); |
|
1363 |
var HHGear: PGear; |
|
1364 |
begin |
|
1365 |
AllInactive:= false; |
|
351 | 1366 |
if ((Gear^.Message and gm_Destroy) <> 0) then |
1133 | 1367 |
begin |
1368 |
DeleteGear(Gear); |
|
1369 |
AfterAttack; |
|
1370 |
exit |
|
1371 |
end; |
|
82 | 1372 |
|
351 | 1373 |
HHGear:= PHedgehog(Gear^.Hedgehog)^.Gear; |
1374 |
if hwRound(HHGear^.Y) <= Gear^.Tag - 2 then |
|
1133 | 1375 |
begin |
1376 |
Gear^.Tag:= hwRound(HHGear^.Y); |
|
1377 |
DrawTunnel(HHGear^.X - int2hwFloat(cHHRadius), HHGear^.Y - _1, _0_5, _0, cHHRadius * 4, 2); |
|
1378 |
HHGear^.State:= HHGear^.State or gstNoDamage; |
|
1379 |
Gear^.Y:= HHGear^.Y; |
|
1380 |
AmmoShove(Gear, 30, 40); |
|
1381 |
HHGear^.State:= HHGear^.State and not gstNoDamage |
|
1382 |
end; |
|
351 | 1383 |
|
1384 |
HHGear^.dY:= HHGear^.dY + cGravity; |
|
1385 |
if not (HHGear^.dY.isNegative) then |
|
1133 | 1386 |
begin |
1387 |
HHGear^.State:= HHGear^.State or gstMoving; |
|
1388 |
DeleteGear(Gear); |
|
1389 |
AfterAttack; |
|
1390 |
exit |
|
1391 |
end; |
|
2089 | 1392 |
|
2376 | 1393 |
if CheckLandValue(hwRound(HHGear^.X), hwRound(HHGear^.Y + HHGear^.dY + SignAs(_6,Gear^.dY)), COLOR_INDESTRUCTIBLE) then |
2331
e4941a7986d6
Another try at keeping blowtorch/firepunch/jackhammer from going through indestructible stuff. Shame these routines don't use hedgehog movement
nemo
parents:
2329
diff
changeset
|
1394 |
HHGear^.Y:= HHGear^.Y + HHGear^.dY |
82 | 1395 |
end; |
1396 |
||
1397 |
procedure doStepFirePunch(Gear: PGear); |
|
1398 |
var HHGear: PGear; |
|
1399 |
begin |
|
1400 |
AllInactive:= false; |
|
351 | 1401 |
HHGear:= PHedgehog(Gear^.Hedgehog)^.Gear; |
514 | 1402 |
DeleteCI(HHGear); |
498 | 1403 |
HHGear^.X:= int2hwFloat(hwRound(HHGear^.X)) - _0_5; |
1014
3c7d4e7ccdff
- Fix firepunch sprite direction when use in high jump
unc0rr
parents:
992
diff
changeset
|
1404 |
HHGear^.dX:= SignAs(cLittle, Gear^.dX); |
3c7d4e7ccdff
- Fix firepunch sprite direction when use in high jump
unc0rr
parents:
992
diff
changeset
|
1405 |
|
351 | 1406 |
HHGear^.dY:= - _0_3; |
82 | 1407 |
|
351 | 1408 |
Gear^.X:= HHGear^.X; |
979
edb8f208c1d9
Fix firepunch direction when attacking from high jump
unc0rr
parents:
974
diff
changeset
|
1409 |
Gear^.dX:= SignAs(_0_45, Gear^.dX); |
351 | 1410 |
Gear^.dY:= - _0_9; |
1411 |
Gear^.doStep:= @doStepFirePunchWork; |
|
498 | 1412 |
DrawTunnel(HHGear^.X - int2hwFloat(cHHRadius), HHGear^.Y + _1, _0_5, _0, cHHRadius * 4, 5); |
1279 | 1413 |
|
1669 | 1414 |
PlaySound(TSound(ord(sndFirePunch1) + GetRandom(6)), false, PHedgehog(HHGear^.Hedgehog)^.Team^.voicepack) |
82 | 1415 |
end; |
1416 |
||
263 | 1417 |
//////////////////////////////////////////////////////////////////////////////// |
1418 |
||
929
9456e1e77369
- Continue preparation for implementing attack from rope and parachute
unc0rr
parents:
928
diff
changeset
|
1419 |
procedure doStepParachuteWork(Gear: PGear); |
211 | 1420 |
var HHGear: PGear; |
1421 |
begin |
|
351 | 1422 |
HHGear:= PHedgehog(Gear^.Hedgehog)^.Gear; |
82 | 1423 |
|
516 | 1424 |
inc(Gear^.Timer); |
1425 |
||
212 | 1426 |
if TestCollisionYwithGear(HHGear, 1) |
1133 | 1427 |
or ((HHGear^.State and gstHHDriven) = 0) |
1428 |
or CheckGearDrowning(HHGear) |
|
1429 |
or ((Gear^.Message and gm_Attack) <> 0) then |
|
1430 |
begin |
|
1431 |
with HHGear^ do |
|
1432 |
begin |
|
1433 |
Message:= 0; |
|
1434 |
SetLittle(dX); |
|
1435 |
dY:= _0; |
|
1436 |
State:= State or gstMoving; |
|
1437 |
end; |
|
1438 |
DeleteGear(Gear); |
|
2060
3e9e5e1be6f5
fix crash in parachute/rope if drowning with active girder/teleport
nemo
parents:
2059
diff
changeset
|
1439 |
isCursorVisible:= false; |
1133 | 1440 |
exit |
1441 |
end; |
|
211 | 1442 |
|
351 | 1443 |
if not TestCollisionXwithGear(HHGear, hwSign(HHGear^.dX)) then |
1133 | 1444 |
HHGear^.X:= HHGear^.X + cWindSpeed * 200; |
211 | 1445 |
|
351 | 1446 |
if (Gear^.Message and gm_Left) <> 0 then HHGear^.X:= HHGear^.X - cMaxWindSpeed * 40 |
1447 |
else if (Gear^.Message and gm_Right) <> 0 then HHGear^.X:= HHGear^.X + cMaxWindSpeed * 40; |
|
1448 |
if (Gear^.Message and gm_Up) <> 0 then HHGear^.Y:= HHGear^.Y - cGravity * 40 |
|
1449 |
else if (Gear^.Message and gm_Down) <> 0 then HHGear^.Y:= HHGear^.Y + cGravity * 40; |
|
211 | 1450 |
|
351 | 1451 |
HHGear^.Y:= HHGear^.Y + cGravity * 100; |
568 | 1452 |
Gear^.X:= HHGear^.X; |
1453 |
Gear^.Y:= HHGear^.Y |
|
263 | 1454 |
end; |
211 | 1455 |
|
929
9456e1e77369
- Continue preparation for implementing attack from rope and parachute
unc0rr
parents:
928
diff
changeset
|
1456 |
procedure doStepParachute(Gear: PGear); |
9456e1e77369
- Continue preparation for implementing attack from rope and parachute
unc0rr
parents:
928
diff
changeset
|
1457 |
var HHGear: PGear; |
9456e1e77369
- Continue preparation for implementing attack from rope and parachute
unc0rr
parents:
928
diff
changeset
|
1458 |
begin |
9456e1e77369
- Continue preparation for implementing attack from rope and parachute
unc0rr
parents:
928
diff
changeset
|
1459 |
HHGear:= PHedgehog(Gear^.Hedgehog)^.Gear; |
9456e1e77369
- Continue preparation for implementing attack from rope and parachute
unc0rr
parents:
928
diff
changeset
|
1460 |
|
9456e1e77369
- Continue preparation for implementing attack from rope and parachute
unc0rr
parents:
928
diff
changeset
|
1461 |
DeleteCI(HHGear); |
9456e1e77369
- Continue preparation for implementing attack from rope and parachute
unc0rr
parents:
928
diff
changeset
|
1462 |
|
9456e1e77369
- Continue preparation for implementing attack from rope and parachute
unc0rr
parents:
928
diff
changeset
|
1463 |
OnUsedAmmo(PHedgehog(HHGear^.Hedgehog)^); |
9456e1e77369
- Continue preparation for implementing attack from rope and parachute
unc0rr
parents:
928
diff
changeset
|
1464 |
ApplyAmmoChanges(PHedgehog(HHGear^.Hedgehog)^); |
9456e1e77369
- Continue preparation for implementing attack from rope and parachute
unc0rr
parents:
928
diff
changeset
|
1465 |
|
931 | 1466 |
HHGear^.State:= HHGear^.State and not (gstAttacking or gstAttacked or gstMoving); |
929
9456e1e77369
- Continue preparation for implementing attack from rope and parachute
unc0rr
parents:
928
diff
changeset
|
1467 |
HHGear^.Message:= HHGear^.Message and not gm_Attack; |
9456e1e77369
- Continue preparation for implementing attack from rope and parachute
unc0rr
parents:
928
diff
changeset
|
1468 |
|
9456e1e77369
- Continue preparation for implementing attack from rope and parachute
unc0rr
parents:
928
diff
changeset
|
1469 |
Gear^.doStep:= @doStepParachuteWork; |
9456e1e77369
- Continue preparation for implementing attack from rope and parachute
unc0rr
parents:
928
diff
changeset
|
1470 |
|
9456e1e77369
- Continue preparation for implementing attack from rope and parachute
unc0rr
parents:
928
diff
changeset
|
1471 |
Gear^.Message:= HHGear^.Message; |
9456e1e77369
- Continue preparation for implementing attack from rope and parachute
unc0rr
parents:
928
diff
changeset
|
1472 |
doStepParachuteWork(Gear) |
9456e1e77369
- Continue preparation for implementing attack from rope and parachute
unc0rr
parents:
928
diff
changeset
|
1473 |
end; |
9456e1e77369
- Continue preparation for implementing attack from rope and parachute
unc0rr
parents:
928
diff
changeset
|
1474 |
|
263 | 1475 |
//////////////////////////////////////////////////////////////////////////////// |
1476 |
procedure doStepAirAttackWork(Gear: PGear); |
|
1507 | 1477 |
var i: Longint; |
263 | 1478 |
begin |
1479 |
AllInactive:= false; |
|
498 | 1480 |
Gear^.X:= Gear^.X + cAirPlaneSpeed * Gear^.Tag; |
1124 | 1481 |
|
543
465e2ec8f05f
- Better randomness of placing hedgehogs on the land
unc0rr
parents:
542
diff
changeset
|
1482 |
if (Gear^.Health > 0)and(not (Gear^.X < Gear^.dX))and(Gear^.X < Gear^.dX + cAirPlaneSpeed) then |
1124 | 1483 |
begin |
1484 |
dec(Gear^.Health); |
|
1485 |
case Gear^.State of |
|
1486 |
0: FollowGear:= AddGear(hwRound(Gear^.X), hwRound(Gear^.Y), gtAirBomb, 0, cBombsSpeed * Gear^.Tag, _0, 0); |
|
1487 |
1: FollowGear:= AddGear(hwRound(Gear^.X), hwRound(Gear^.Y), gtMine, 0, cBombsSpeed * Gear^.Tag, _0, 0); |
|
1586 | 1488 |
2: for i:= -19 to 19 do |
1489 |
FollowGear:= AddGear(hwRound(Gear^.X) + i div 3, hwRound(Gear^.Y), gtFlame, 0, _0_001 * i, _0, 0); |
|
1124 | 1490 |
end; |
1491 |
Gear^.dX:= Gear^.dX + int2hwFloat(30 * Gear^.Tag) |
|
1492 |
end; |
|
1493 |
||
1494 |
if (GameTicks and $3F) = 0 then |
|
1495 |
AddGear(hwRound(Gear^.X), hwRound(Gear^.Y), gtSmokeTrace, 0, _0, _0, 0); |
|
1496 |
||
1753 | 1497 |
if (hwRound(Gear^.X) > (LAND_WIDTH+1024)) or (hwRound(Gear^.X) < -1024) then DeleteGear(Gear) |
263 | 1498 |
end; |
1499 |
||
1500 |
procedure doStepAirAttack(Gear: PGear); |
|
1501 |
begin |
|
1502 |
AllInactive:= false; |
|
543
465e2ec8f05f
- Better randomness of placing hedgehogs on the land
unc0rr
parents:
542
diff
changeset
|
1503 |
|
1507 | 1504 |
if Gear^.X.QWordValue = 0 then |
1771 | 1505 |
begin |
1506 |
Gear^.Tag:= 1; |
|
1507 |
Gear^.X:= -_1024; |
|
1508 |
end |
|
1507 | 1509 |
else |
1771 | 1510 |
begin |
1507 | 1511 |
Gear^.Tag:= -1; |
1771 | 1512 |
Gear^.X:= int2hwFloat(LAND_WIDTH + 1024); |
1513 |
end; |
|
1507 | 1514 |
|
1784 | 1515 |
Gear^.Y:= int2hwFloat(topY-300); |
543
465e2ec8f05f
- Better randomness of placing hedgehogs on the land
unc0rr
parents:
542
diff
changeset
|
1516 |
Gear^.dX:= int2hwFloat(TargetPoint.X - 5 * Gear^.Tag * 15); |
357 | 1517 |
|
543
465e2ec8f05f
- Better randomness of placing hedgehogs on the land
unc0rr
parents:
542
diff
changeset
|
1518 |
if int2hwFloat(TargetPoint.Y) - Gear^.Y > _0 then |
1133 | 1519 |
Gear^.dX:= Gear^.dX - cBombsSpeed * hwSqrt((int2hwFloat(TargetPoint.Y) - Gear^.Y) * 2 / cGravity) * Gear^.Tag; |
543
465e2ec8f05f
- Better randomness of placing hedgehogs on the land
unc0rr
parents:
542
diff
changeset
|
1520 |
|
351 | 1521 |
Gear^.Health:= 6; |
801 | 1522 |
Gear^.doStep:= @doStepAirAttackWork; |
1669 | 1523 |
PlaySound(sndIncoming, false, PHedgehog(Gear^.Hedgehog)^.Team^.voicepack) |
263 | 1524 |
end; |
1525 |
||
1526 |
//////////////////////////////////////////////////////////////////////////////// |
|
1527 |
||
1528 |
procedure doStepAirBomb(Gear: PGear); |
|
1529 |
begin |
|
1530 |
AllInactive:= false; |
|
1531 |
doStepFallingGear(Gear); |
|
351 | 1532 |
if (Gear^.State and gstCollision) <> 0 then |
1133 | 1533 |
begin |
1534 |
doMakeExplosion(hwRound(Gear^.X), hwRound(Gear^.Y), 30, EXPLAutoSound); |
|
1535 |
DeleteGear(Gear); |
|
1536 |
exit |
|
1537 |
end; |
|
263 | 1538 |
if (GameTicks and $3F) = 0 then |
1133 | 1539 |
AddGear(hwRound(Gear^.X), hwRound(Gear^.Y), gtSmokeTrace, 0, _0, _0, 0) |
211 | 1540 |
end; |
409 | 1541 |
|
1542 |
//////////////////////////////////////////////////////////////////////////////// |
|
1543 |
||
1544 |
procedure doStepGirder(Gear: PGear); |
|
415 | 1545 |
var HHGear: PGear; |
1915 | 1546 |
x, y, tx, ty: hwFloat; |
409 | 1547 |
begin |
1548 |
AllInactive:= false; |
|
415 | 1549 |
|
1550 |
HHGear:= PHedgehog(Gear^.Hedgehog)^.Gear; |
|
1915 | 1551 |
tx:= int2hwFloat(TargetPoint.X); |
1552 |
ty:= int2hwFloat(TargetPoint.Y); |
|
1553 |
x:= HHGear^.X; |
|
1554 |
y:= HHGear^.Y; |
|
1909 | 1555 |
|
1915 | 1556 |
if (Distance(tx - x, ty - y) > _256) or |
1557 |
not TryPlaceOnLand(TargetPoint.X - SpritesData[sprAmGirder].Width div 2, |
|
1558 |
TargetPoint.Y - SpritesData[sprAmGirder].Height div 2, |
|
520 | 1559 |
sprAmGirder, Gear^.State, true) then |
1133 | 1560 |
begin |
1914 | 1561 |
PlaySound(sndDenied, false, nil); |
1562 |
HHGear^.Message:= HHGear^.Message and not gm_Attack; |
|
1563 |
HHGear^.State:= HHGear^.State and not gstAttacking; |
|
1133 | 1564 |
HHGear^.State:= HHGear^.State or gstHHChooseTarget; |
1914 | 1565 |
isCursorVisible:= true; |
1566 |
DeleteGear(Gear) |
|
1133 | 1567 |
end |
1568 |
else begin |
|
1914 | 1569 |
PlaySound(sndPlaced, false, nil); |
1133 | 1570 |
DeleteGear(Gear); |
1909 | 1571 |
OnUsedAmmo(PHedgehog(HHGear^.Hedgehog)^); |
1914 | 1572 |
ApplyAmmoChanges(PHedgehog(HHGear^.Hedgehog)^) |
1573 |
end; |
|
1574 |
||
1909 | 1575 |
HHGear^.State:= HHGear^.State and not (gstAttacking or gstAttacked); |
1576 |
HHGear^.Message:= HHGear^.Message and not gm_Attack; |
|
415 | 1577 |
TargetPoint.X:= NoPointX |
409 | 1578 |
end; |
520 | 1579 |
|
1580 |
//////////////////////////////////////////////////////////////////////////////// |
|
525 | 1581 |
procedure doStepTeleportAfter(Gear: PGear); |
912 | 1582 |
var HHGear: PGear; |
1583 |
begin |
|
1584 |
HHGear:= PHedgehog(Gear^.Hedgehog)^.Gear; |
|
1585 |
HHGear^.Y:= HHGear^.Y + HHGear^.dY; // hedgehog falling to collect cases |
|
1586 |
HHGear^.dY:= HHGear^.dY + cGravity; |
|
945
4ead9cde4e14
- Start chat implementation: chat strings are on the screen
unc0rr
parents:
940
diff
changeset
|
1587 |
if TestCollisionYwithGear(HHGear, 1) |
1133 | 1588 |
or CheckGearDrowning(HHGear) then |
1589 |
begin |
|
1590 |
DeleteGear(Gear); |
|
1591 |
AfterAttack |
|
1592 |
end |
|
912 | 1593 |
end; |
1594 |
||
1595 |
procedure doStepTeleportAnim(Gear: PGear); |
|
525 | 1596 |
begin |
853 | 1597 |
inc(Gear^.Timer); |
1598 |
if Gear^.Timer = 65 then |
|
1599 |
begin |
|
1600 |
Gear^.Timer:= 0; |
|
1601 |
inc(Gear^.Pos); |
|
1602 |
if Gear^.Pos = 11 then |
|
912 | 1603 |
Gear^.doStep:= @doStepTeleportAfter |
2217 | 1604 |
end; |
525 | 1605 |
end; |
520 | 1606 |
|
1607 |
procedure doStepTeleport(Gear: PGear); |
|
1608 |
var HHGear: PGear; |
|
1609 |
begin |
|
1610 |
AllInactive:= false; |
|
1611 |
||
1612 |
HHGear:= PHedgehog(Gear^.Hedgehog)^.Gear; |
|
1613 |
if not TryPlaceOnLand(TargetPoint.X - SpritesData[sprHHTelepMask].Width div 2, |
|
1614 |
TargetPoint.Y - SpritesData[sprHHTelepMask].Height div 2, |
|
1615 |
sprHHTelepMask, 0, false) then |
|
853 | 1616 |
begin |
1617 |
HHGear^.Message:= HHGear^.Message and not gm_Attack; |
|
1618 |
HHGear^.State:= HHGear^.State and not gstAttacking; |
|
1619 |
HHGear^.State:= HHGear^.State or gstHHChooseTarget; |
|
1620 |
DeleteGear(Gear); |
|
2227 | 1621 |
isCursorVisible:= true; |
1622 |
PlaySound(sndDenied, false, nil); |
|
853 | 1623 |
end |
1624 |
else begin |
|
1625 |
DeleteCI(HHGear); |
|
1626 |
SetAllHHToActive; |
|
912 | 1627 |
Gear^.doStep:= @doStepTeleportAnim; |
853 | 1628 |
Gear^.X:= HHGear^.X; |
1629 |
Gear^.Y:= HHGear^.Y; |
|
1630 |
HHGear^.X:= int2hwFloat(TargetPoint.X); |
|
1631 |
HHGear^.Y:= int2hwFloat(TargetPoint.Y); |
|
2227 | 1632 |
HHGear^.State:= HHGear^.State or gstMoving; |
1633 |
playSound(sndWarp, false, nil); |
|
853 | 1634 |
end; |
2217 | 1635 |
TargetPoint.X:= NoPointX; |
1636 |
||
520 | 1637 |
end; |
534 | 1638 |
|
1639 |
//////////////////////////////////////////////////////////////////////////////// |
|
1640 |
procedure doStepSwitcherWork(Gear: PGear); |
|
1641 |
var HHGear: PGear; |
|
1642 |
Msg, State: Longword; |
|
1643 |
begin |
|
1644 |
AllInactive:= false; |
|
1645 |
||
540 | 1646 |
if ((Gear^.Message and not gm_Switch) <> 0) or (TurnTimeLeft = 0) then |
1133 | 1647 |
begin |
1648 |
HHGear:= PHedgehog(Gear^.Hedgehog)^.Gear; |
|
1649 |
Msg:= Gear^.Message and not gm_Switch; |
|
1650 |
DeleteGear(Gear); |
|
1651 |
OnUsedAmmo(PHedgehog(HHGear^.Hedgehog)^); |
|
1652 |
ApplyAmmoChanges(PHedgehog(HHGear^.Hedgehog)^); |
|
534 | 1653 |
|
1133 | 1654 |
HHGear:= CurrentHedgehog^.Gear; |
1655 |
ApplyAmmoChanges(PHedgehog(HHGear^.Hedgehog)^); |
|
1656 |
HHGear^.Message:= Msg; |
|
1657 |
exit |
|
1658 |
end; |
|
534 | 1659 |
|
1660 |
if (Gear^.Message and gm_Switch) <> 0 then |
|
1133 | 1661 |
begin |
1662 |
HHGear:= CurrentHedgehog^.Gear; |
|
1663 |
HHGear^.Message:= HHGear^.Message and not gm_Switch; |
|
1664 |
Gear^.Message:= Gear^.Message and not gm_Switch; |
|
1665 |
State:= HHGear^.State; |
|
1666 |
HHGear^.State:= 0; |
|
1667 |
HHGear^.Active:= false; |
|
1668 |
HHGear^.Z:= cHHZ; |
|
1669 |
RemoveGearFromList(HHGear); |
|
1670 |
InsertGearToList(HHGear); |
|
534 | 1671 |
|
1133 | 1672 |
repeat |
1673 |
CurrentTeam^.CurrHedgehog:= Succ(CurrentTeam^.CurrHedgehog) mod (CurrentTeam^.HedgehogsNumber); |
|
1674 |
until (CurrentTeam^.Hedgehogs[CurrentTeam^.CurrHedgehog].Gear <> nil); |
|
652 | 1675 |
|
1133 | 1676 |
CurrentHedgehog:= @CurrentTeam^.Hedgehogs[CurrentTeam^.CurrHedgehog]; |
534 | 1677 |
|
1133 | 1678 |
HHGear:= CurrentHedgehog^.Gear; |
1679 |
HHGear^.State:= State; |
|
1680 |
HHGear^.Active:= true; |
|
1681 |
FollowGear:= HHGear; |
|
1682 |
HHGear^.Z:= cCurrHHZ; |
|
1683 |
RemoveGearFromList(HHGear); |
|
1684 |
InsertGearToList(HHGear); |
|
1685 |
Gear^.X:= HHGear^.X; |
|
1686 |
Gear^.Y:= HHGear^.Y |
|
1687 |
end; |
|
534 | 1688 |
end; |
1689 |
||
1690 |
procedure doStepSwitcher(Gear: PGear); |
|
1691 |
var HHGear: PGear; |
|
1692 |
begin |
|
1693 |
Gear^.doStep:= @doStepSwitcherWork; |
|
1694 |
||
1695 |
HHGear:= PHedgehog(Gear^.Hedgehog)^.Gear; |
|
1696 |
with HHGear^ do |
|
1133 | 1697 |
begin |
1698 |
State:= State and not gstAttacking; |
|
1699 |
Message:= Message and not gm_Attack |
|
1700 |
end |
|
534 | 1701 |
end; |
924 | 1702 |
|
1703 |
//////////////////////////////////////////////////////////////////////////////// |
|
1704 |
procedure doStepMortar(Gear: PGear); |
|
1705 |
var dX, dY: hwFloat; |
|
1706 |
i: LongInt; |
|
963 | 1707 |
dxn, dyn: boolean; |
924 | 1708 |
begin |
1709 |
AllInactive:= false; |
|
963 | 1710 |
dxn:= Gear^.dX.isNegative; |
1711 |
dyn:= Gear^.dY.isNegative; |
|
1712 |
||
924 | 1713 |
doStepFallingGear(Gear); |
1714 |
if (Gear^.State and gstCollision) <> 0 then |
|
1715 |
begin |
|
1716 |
doMakeExplosion(hwRound(Gear^.X), hwRound(Gear^.Y), 20, EXPLAutoSound); |
|
2262 | 1717 |
soundFadeOut(sndMortar,10,nil); |
963 | 1718 |
|
1719 |
Gear^.dX.isNegative:= not dxn; |
|
1720 |
Gear^.dY.isNegative:= not dyn; |
|
924 | 1721 |
for i:= 0 to 4 do |
1722 |
begin |
|
963 | 1723 |
dX:= Gear^.dX + (GetRandom - _0_5) * _0_03; |
1724 |
dY:= Gear^.dY + (GetRandom - _0_5) * _0_03; |
|
1273 | 1725 |
AddGear(hwRound(Gear^.X), hwRound(Gear^.Y), gtCluster, 0, dX, dY, 25); |
924 | 1726 |
end; |
2376 | 1727 |
|
924 | 1728 |
DeleteGear(Gear); |
1729 |
exit |
|
1730 |
end; |
|
963 | 1731 |
|
924 | 1732 |
if (GameTicks and $3F) = 0 then |
1733 |
AddGear(hwRound(Gear^.X), hwRound(Gear^.Y), gtSmokeTrace, 0, _0, _0, 0) |
|
1734 |
end; |
|
984 | 1735 |
|
1736 |
//////////////////////////////////////////////////////////////////////////////// |
|
1737 |
procedure doStepKamikazeWork(Gear: PGear); |
|
1738 |
const upd: Longword = 0; |
|
987 | 1739 |
var i: LongWord; |
984 | 1740 |
HHGear: PGear; |
1741 |
begin |
|
1742 |
AllInactive:= false; |
|
1743 |
||
1744 |
HHGear:= PHedgehog(Gear^.Hedgehog)^.Gear; |
|
1745 |
HHGear^.State:= HHGear^.State or gstNoDamage; |
|
1746 |
DeleteCI(HHGear); |
|
1747 |
||
1748 |
i:= 2; |
|
1749 |
repeat |
|
1750 |
Gear^.X:= Gear^.X + HHGear^.dX; |
|
1751 |
Gear^.Y:= Gear^.Y + HHGear^.dY; |
|
1752 |
HHGear^.X:= Gear^.X; |
|
1753 |
HHGear^.Y:= Gear^.Y; |
|
1754 |
||
1755 |
inc(Gear^.Damage, 2); |
|
1756 |
||
1200 | 1757 |
// if TestCollisionXwithGear(HHGear, hwSign(Gear^.dX)) |
1758 |
// or TestCollisionYwithGear(HHGear, hwSign(Gear^.dY)) then inc(Gear^.Damage, 3); |
|
984 | 1759 |
|
1760 |
dec(i) |
|
1761 |
until (i = 0) or (Gear^.Damage > Gear^.Health); |
|
1762 |
||
1763 |
inc(upd); |
|
1764 |
if upd > 3 then |
|
1765 |
begin |
|
987 | 1766 |
if Gear^.Health < 1500 then Gear^.Pos:= 2; |
2376 | 1767 |
|
984 | 1768 |
AmmoShove(Gear, 30, 40); |
2376 | 1769 |
|
984 | 1770 |
DrawTunnel(HHGear^.X - HHGear^.dX * 10, |
1200 | 1771 |
HHGear^.Y - _2 - HHGear^.dY * 10 + hwAbs(HHGear^.dY) * 2, |
984 | 1772 |
HHGear^.dX, |
1773 |
HHGear^.dY, |
|
1774 |
20 + cHHRadius * 2, |
|
1200 | 1775 |
cHHRadius * 2 + 6); |
2376 | 1776 |
|
984 | 1777 |
upd:= 0 |
1778 |
end; |
|
1779 |
||
1780 |
if Gear^.Health < Gear^.Damage then |
|
1781 |
begin |
|
1782 |
doMakeExplosion(hwRound(Gear^.X), hwRound(Gear^.Y), 30, EXPLAutoSound); |
|
1783 |
AfterAttack; |
|
1784 |
DeleteGear(Gear); |
|
1785 |
DeleteGear(HHGear); |
|
1786 |
end else |
|
1787 |
begin |
|
1788 |
dec(Gear^.Health, Gear^.Damage); |
|
1789 |
Gear^.Damage:= 0 |
|
1790 |
end |
|
1791 |
end; |
|
1792 |
||
987 | 1793 |
procedure doStepKamikazeIdle(Gear: PGear); |
1794 |
begin |
|
1795 |
AllInactive:= false; |
|
1796 |
dec(Gear^.Timer); |
|
1797 |
if Gear^.Timer = 0 then |
|
1798 |
begin |
|
1799 |
Gear^.Pos:= 1; |
|
1669 | 1800 |
PlaySound(sndKamikaze, false, PHedgehog(Gear^.Hedgehog)^.Team^.voicepack); |
987 | 1801 |
Gear^.doStep:= @doStepKamikazeWork |
1802 |
end |
|
1803 |
end; |
|
1804 |
||
984 | 1805 |
procedure doStepKamikaze(Gear: PGear); |
1806 |
var HHGear: PGear; |
|
1807 |
begin |
|
1808 |
AllInactive:= false; |
|
1809 |
||
1810 |
HHGear:= PHedgehog(Gear^.Hedgehog)^.Gear; |
|
1811 |
||
1812 |
HHGear^.dX:= Gear^.dX; |
|
1813 |
HHGear^.dY:= Gear^.dY; |
|
1814 |
||
1815 |
Gear^.dX:= SignAs(_0_45, Gear^.dX); |
|
1816 |
Gear^.dY:= - _0_9; |
|
1817 |
||
987 | 1818 |
Gear^.Timer:= 550; |
1819 |
||
1820 |
Gear^.doStep:= @doStepKamikazeIdle |
|
984 | 1821 |
end; |
1822 |
||
1103 | 1823 |
//////////////////////////////////////////////////////////////////////////////// |
1824 |
const cakeh = 27; |
|
1110 | 1825 |
cakeDmg = 75; |
1103 | 1826 |
var CakePoints: array[0..Pred(cakeh)] of record x, y: hwFloat; end; |
1827 |
CakeI: Longword; |
|
1828 |
||
1110 | 1829 |
procedure doStepCakeExpl(Gear: PGear); |
1830 |
begin |
|
2141 | 1831 |
AllInactive:= false; |
1832 |
||
1110 | 1833 |
inc(Gear^.Tag); |
1834 |
if Gear^.Tag < 2250 then exit; |
|
1835 |
||
1836 |
doMakeExplosion(hwRound(Gear^.X), hwRound(Gear^.Y), cakeDmg, EXPLAutoSound); |
|
1837 |
AfterAttack; |
|
1838 |
DeleteGear(Gear) |
|
1839 |
end; |
|
1840 |
||
1109 | 1841 |
procedure doStepCakeDown(Gear: PGear); |
1133 | 1842 |
var gi: PGear; |
1843 |
dmg: LongInt; |
|
1109 | 1844 |
begin |
1845 |
AllInactive:= false; |
|
1846 |
||
1847 |
inc(Gear^.Tag); |
|
1848 |
if Gear^.Tag < 100 then exit; |
|
1849 |
Gear^.Tag:= 0; |
|
1850 |
||
1851 |
if Gear^.Pos = 0 then |
|
1852 |
begin |
|
1110 | 1853 |
gi:= GearsList; |
1854 |
while gi <> nil do |
|
1855 |
begin |
|
1856 |
dmg:= cakeDmg * 2 - hwRound(Distance(gi^.X - Gear^.X, gi^.Y - Gear^.Y)); |
|
1865
ebc6dfca60d4
- nemo's patch: some animations, zero probability for infinite weapons
unc0rr
parents:
1861
diff
changeset
|
1857 |
if (dmg > 1) and (gi^.Kind = gtHedgehog) then |
ebc6dfca60d4
- nemo's patch: some animations, zero probability for infinite weapons
unc0rr
parents:
1861
diff
changeset
|
1858 |
if (CurrentHedgehog^.Gear = gi) and (not gi^.Invulnerable) then |
1867 | 1859 |
gi^.State:= gi^.State or gstLoser |
1865
ebc6dfca60d4
- nemo's patch: some animations, zero probability for infinite weapons
unc0rr
parents:
1861
diff
changeset
|
1860 |
else |
ebc6dfca60d4
- nemo's patch: some animations, zero probability for infinite weapons
unc0rr
parents:
1861
diff
changeset
|
1861 |
gi^.State:= gi^.State or gstWinner; |
1110 | 1862 |
gi:= gi^.NextGear |
1863 |
end; |
|
1864 |
Gear^.doStep:= @doStepCakeExpl; |
|
1669 | 1865 |
PlaySound(sndCake, false, nil) |
1109 | 1866 |
end else dec(Gear^.Pos) |
1867 |
end; |
|
1868 |
||
1869 |
||
1089 | 1870 |
procedure doStepCakeWork(Gear: PGear); |
1871 |
const dirs: array[0..3] of TPoint = ((x: 0; y: -1), (x: 1; y: 0),(x: 0; y: 1),(x: -1; y: 0)); |
|
1872 |
var xx, yy, xxn, yyn: LongInt; |
|
1873 |
da: LongInt; |
|
1103 | 1874 |
tdx, tdy: hwFloat; |
1089 | 1875 |
|
1876 |
procedure PrevAngle; |
|
1877 |
begin |
|
1133 | 1878 |
Gear^.Angle:= (LongInt(Gear^.Angle) + 4 - dA) mod 4 |
1089 | 1879 |
end; |
2376 | 1880 |
|
1089 | 1881 |
procedure NextAngle; |
1882 |
begin |
|
1133 | 1883 |
Gear^.Angle:= (LongInt(Gear^.Angle) + 4 + dA) mod 4 |
1089 | 1884 |
end; |
2376 | 1885 |
|
1088 | 1886 |
begin |
2141 | 1887 |
AllInactive:= false; |
1888 |
||
1089 | 1889 |
inc(Gear^.Tag); |
1108 | 1890 |
if Gear^.Tag < 7 then exit; |
1089 | 1891 |
|
1892 |
dA:= hwSign(Gear^.dX); |
|
1893 |
xx:= dirs[Gear^.Angle].x; |
|
1894 |
yy:= dirs[Gear^.Angle].y; |
|
1133 | 1895 |
xxn:= dirs[(LongInt(Gear^.Angle) + 4 + dA) mod 4].x; |
1896 |
yyn:= dirs[(LongInt(Gear^.Angle) + 4 + dA) mod 4].y; |
|
1089 | 1897 |
|
1898 |
if (xx = 0) then |
|
1899 |
if TestCollisionYwithGear(Gear, yy) then |
|
1900 |
PrevAngle |
|
1901 |
else begin |
|
1902 |
Gear^.Tag:= 0; |
|
1903 |
Gear^.Y:= Gear^.Y + int2hwFloat(yy); |
|
1635
cc5976f292f9
Cake makes a step after turn. This fixes cake stucking in air
unc0rr
parents:
1634
diff
changeset
|
1904 |
if not TestCollisionXwithGear(Gear, xxn) then |
cc5976f292f9
Cake makes a step after turn. This fixes cake stucking in air
unc0rr
parents:
1634
diff
changeset
|
1905 |
begin |
cc5976f292f9
Cake makes a step after turn. This fixes cake stucking in air
unc0rr
parents:
1634
diff
changeset
|
1906 |
Gear^.X:= Gear^.X + int2hwFloat(xxn); |
cc5976f292f9
Cake makes a step after turn. This fixes cake stucking in air
unc0rr
parents:
1634
diff
changeset
|
1907 |
NextAngle |
cc5976f292f9
Cake makes a step after turn. This fixes cake stucking in air
unc0rr
parents:
1634
diff
changeset
|
1908 |
end; |
1089 | 1909 |
end; |
1910 |
||
1911 |
if (yy = 0) then |
|
1912 |
if TestCollisionXwithGear(Gear, xx) then |
|
1913 |
PrevAngle |
|
1914 |
else begin |
|
1915 |
Gear^.Tag:= 0; |
|
1916 |
Gear^.X:= Gear^.X + int2hwFloat(xx); |
|
1635
cc5976f292f9
Cake makes a step after turn. This fixes cake stucking in air
unc0rr
parents:
1634
diff
changeset
|
1917 |
if not TestCollisionYwithGear(Gear, yyn) then |
cc5976f292f9
Cake makes a step after turn. This fixes cake stucking in air
unc0rr
parents:
1634
diff
changeset
|
1918 |
begin |
cc5976f292f9
Cake makes a step after turn. This fixes cake stucking in air
unc0rr
parents:
1634
diff
changeset
|
1919 |
Gear^.Y:= Gear^.Y + int2hwFloat(yyn); |
cc5976f292f9
Cake makes a step after turn. This fixes cake stucking in air
unc0rr
parents:
1634
diff
changeset
|
1920 |
NextAngle |
cc5976f292f9
Cake makes a step after turn. This fixes cake stucking in air
unc0rr
parents:
1634
diff
changeset
|
1921 |
end; |
1089 | 1922 |
end; |
1923 |
||
1103 | 1924 |
if Gear^.Tag = 0 then |
1925 |
begin |
|
1926 |
CakeI:= (CakeI + 1) mod cakeh; |
|
1927 |
tdx:= CakePoints[CakeI].x - Gear^.X; |
|
1928 |
tdy:= - CakePoints[CakeI].y + Gear^.Y; |
|
1929 |
CakePoints[CakeI].x:= Gear^.X; |
|
1930 |
CakePoints[CakeI].y:= Gear^.Y; |
|
1931 |
Gear^.DirAngle:= DxDy2Angle(tdx, tdy); |
|
1932 |
end; |
|
1933 |
||
1089 | 1934 |
dec(Gear^.Health); |
2208
7d1a084d11ab
disable timers on a few silly items, trying out a timer on cake
nemo
parents:
2204
diff
changeset
|
1935 |
Gear^.Timer:= Gear^.Health*10; // This is not seconds, but at least it is *some* feedback |
1090 | 1936 |
if (Gear^.Health = 0) or ((Gear^.Message and gm_Attack) <> 0) then |
1089 | 1937 |
begin |
1109 | 1938 |
FollowGear:= Gear; |
2358 | 1939 |
Gear^.RenderTimer:= false; |
1109 | 1940 |
Gear^.doStep:= @doStepCakeDown |
1089 | 1941 |
end |
1088 | 1942 |
end; |
1089 | 1943 |
|
1103 | 1944 |
procedure doStepCakeUp(Gear: PGear); |
1945 |
var i: Longword; |
|
1946 |
begin |
|
1947 |
AllInactive:= false; |
|
1948 |
||
1108 | 1949 |
inc(Gear^.Tag); |
1109 | 1950 |
if Gear^.Tag < 100 then exit; |
1108 | 1951 |
Gear^.Tag:= 0; |
1952 |
||
1109 | 1953 |
if Gear^.Pos = 6 then |
1103 | 1954 |
begin |
1955 |
for i:= 0 to Pred(cakeh) do |
|
1956 |
begin |
|
1957 |
CakePoints[i].x:= Gear^.X; |
|
1958 |
CakePoints[i].y:= Gear^.Y |
|
1959 |
end; |
|
1960 |
CakeI:= 0; |
|
1961 |
Gear^.doStep:= @doStepCakeWork |
|
1109 | 1962 |
end else inc(Gear^.Pos) |
1103 | 1963 |
end; |
1964 |
||
1089 | 1965 |
procedure doStepCakeFall(Gear: PGear); |
1966 |
begin |
|
1967 |
AllInactive:= false; |
|
1968 |
||
1969 |
Gear^.dY:= Gear^.dY + cGravity; |
|
1970 |
if TestCollisionYwithGear(Gear, 1) then |
|
1103 | 1971 |
Gear^.doStep:= @doStepCakeUp |
1089 | 1972 |
else |
1973 |
begin |
|
1974 |
Gear^.Y:= Gear^.Y + Gear^.dY; |
|
1975 |
if CheckGearDrowning(Gear) then AfterAttack |
|
1976 |
end |
|
1977 |
end; |
|
1978 |
||
1979 |
procedure doStepCake(Gear: PGear); |
|
1980 |
var HHGear: PGear; |
|
1981 |
begin |
|
1982 |
AllInactive:= false; |
|
1983 |
||
1984 |
HHGear:= PHedgehog(Gear^.Hedgehog)^.Gear; |
|
1103 | 1985 |
HHGear^.Message:= HHGear^.Message and (not gm_Attack); |
1089 | 1986 |
DeleteCI(HHGear); |
1987 |
||
1106 | 1988 |
FollowGear:= Gear; |
1989 |
||
1089 | 1990 |
Gear^.doStep:= @doStepCakeFall |
1991 |
end; |
|
1992 |
||
1259 | 1993 |
//////////////////////////////////////////////////////////////////////////////// |
1284 | 1994 |
procedure doStepSeductionWork(Gear: PGear); |
1995 |
var x, y: LongInt; |
|
1259 | 1996 |
begin |
1997 |
AllInactive:= false; |
|
1284 | 1998 |
|
1999 |
Gear^.X:= Gear^.X + Gear^.dX; |
|
2000 |
Gear^.Y:= Gear^.Y + Gear^.dY; |
|
2001 |
x:= hwRound(Gear^.X); |
|
2002 |
y:= hwRound(Gear^.Y); |
|
1259 | 2003 |
|
1753 | 2004 |
if ((y and LAND_HEIGHT_MASK) = 0) and ((x and LAND_WIDTH_MASK) = 0) then |
1284 | 2005 |
if (Land[y, x] <> 0) then |
2006 |
begin |
|
2007 |
Gear^.dX.isNegative:= not Gear^.dX.isNegative; |
|
2008 |
Gear^.dY.isNegative:= not Gear^.dY.isNegative; |
|
1286 | 2009 |
Gear^.dX:= Gear^.dX * _1_5; |
2010 |
Gear^.dY:= Gear^.dY * _1_5 - _0_3; |
|
1284 | 2011 |
AmmoShove(Gear, 0, 40); |
1286 | 2012 |
AfterAttack; |
1284 | 2013 |
DeleteGear(Gear) |
2014 |
end |
|
2015 |
else |
|
2016 |
else |
|
1286 | 2017 |
begin |
2018 |
AfterAttack; |
|
1284 | 2019 |
DeleteGear(Gear) |
1286 | 2020 |
end |
2021 |
end; |
|
2022 |
||
2023 |
procedure doStepSeductionWear(Gear: PGear); |
|
2024 |
begin |
|
2025 |
AllInactive:= false; |
|
2026 |
inc(Gear^.Timer); |
|
2027 |
if Gear^.Timer > 250 then |
|
2028 |
begin |
|
2029 |
Gear^.Timer:= 0; |
|
1388 | 2030 |
inc(Gear^.Pos); |
2031 |
if Gear^.Pos = 5 then |
|
1669 | 2032 |
PlaySound(sndYoohoo, false, PHedgehog(Gear^.Hedgehog)^.Team^.voicepack) |
1286 | 2033 |
end; |
1367 | 2034 |
|
2035 |
if Gear^.Pos = 14 then |
|
1286 | 2036 |
Gear^.doStep:= @doStepSeductionWork |
1259 | 2037 |
end; |
1284 | 2038 |
|
2039 |
procedure doStepSeduction(Gear: PGear); |
|
2040 |
begin |
|
2041 |
AllInactive:= false; |
|
2042 |
DeleteCI(PHedgehog(Gear^.Hedgehog)^.Gear); |
|
1286 | 2043 |
Gear^.doStep:= @doStepSeductionWear |
1284 | 2044 |
end; |
1298 | 2045 |
|
2046 |
//////////////////////////////////////////////////////////////////////////////// |
|
2047 |
procedure doStepWaterUp(Gear: PGear); |
|
2048 |
var i: LongWord; |
|
2049 |
begin |
|
2050 |
AllInactive:= false; |
|
2051 |
||
2052 |
inc(Gear^.Timer); |
|
2053 |
if Gear^.Timer = 17 then |
|
2054 |
Gear^.Timer:= 0 |
|
2055 |
else |
|
2056 |
exit; |
|
2057 |
||
2058 |
if cWaterLine > 0 then |
|
2059 |
begin |
|
2060 |
dec(cWaterLine); |
|
1760 | 2061 |
for i:= 0 to LAND_WIDTH - 1 do |
1298 | 2062 |
Land[cWaterLine, i]:= 0; |
2063 |
SetAllToActive |
|
2064 |
end; |
|
2065 |
||
2066 |
inc(Gear^.Tag); |
|
1343 | 2067 |
if (Gear^.Tag = 47) or (cWaterLine = 0) then |
1298 | 2068 |
DeleteGear(Gear) |
2069 |
end; |
|
1573 | 2070 |
|
2071 |
//////////////////////////////////////////////////////////////////////////////// |
|
1590 | 2072 |
procedure doStepDrillDrilling(Gear: PGear); |
1633 | 2073 |
var t: PGearArray; |
2074 |
ox, oy: hwFloat; |
|
1573 | 2075 |
begin |
1590 | 2076 |
AllInactive:= false; |
2077 |
||
1633 | 2078 |
if (Gear^.Timer > 0) and ((Gear^.Timer mod 10) = 0) then |
1590 | 2079 |
begin |
1573 | 2080 |
ox:= Gear^.X; |
2081 |
oy:= Gear^.Y; |
|
2082 |
Gear^.X:= Gear^.X + Gear^.dX; |
|
2083 |
Gear^.Y:= Gear^.Y + Gear^.dY; |
|
2084 |
DrawTunnel(oX, oY, Gear^.dX, Gear^.dY, 2, 6); |
|
2085 |
CheckGearDrowning(Gear); |
|
1590 | 2086 |
end; |
2087 |
||
1633 | 2088 |
t:= CheckGearsCollision(Gear); //fixes drill not exploding when touching HH bug |
1590 | 2089 |
if (Gear^.Timer = 0) |
1633 | 2090 |
or (t^.Count <> 0) |
1590 | 2091 |
or (not TestCollisionYWithGear(Gear, hwSign(Gear^.dY)) |
1784 | 2092 |
and not TestCollisionXWithGear(Gear, hwSign(Gear^.dX))) |
2093 |
or (Land[hwRound(Gear^.Y), hwRound(Gear^.X)] = COLOR_INDESTRUCTIBLE) then |
|
1590 | 2094 |
begin //out of time or exited ground |
2462
fa3ddd1ff2a1
Suggestion by Smaxx - use pickhammer sound while drill is in operation
nemo
parents:
2460
diff
changeset
|
2095 |
StopSound(sndPickhammer); |
1590 | 2096 |
doMakeExplosion(hwRound(Gear^.X), hwRound(Gear^.Y), 50, EXPLAutoSound); |
2097 |
DeleteGear(Gear); |
|
2098 |
exit |
|
2099 |
end; |
|
2100 |
||
2101 |
dec(Gear^.Timer); |
|
1573 | 2102 |
end; |
2103 |
||
2104 |
procedure doStepDrill(Gear: PGear); |
|
1590 | 2105 |
var t: PGearArray; |
1633 | 2106 |
oldDx, oldDy: hwFloat; |
2107 |
t2: hwFloat; |
|
1573 | 2108 |
begin |
1590 | 2109 |
AllInactive:= false; |
1573 | 2110 |
|
1590 | 2111 |
Gear^.dX:= Gear^.dX + cWindSpeed; |
2112 |
oldDx:= Gear^.dX; |
|
2113 |
oldDy:= Gear^.dY; |
|
2114 |
||
2115 |
doStepFallingGear(Gear); |
|
2116 |
||
2117 |
if (GameTicks and $3F) = 0 then |
|
2118 |
AddGear(hwRound(Gear^.X), hwRound(Gear^.Y), gtSmokeTrace, 0, _0, _0, 0); |
|
1573 | 2119 |
|
1633 | 2120 |
if ((Gear^.State and gstCollision) <> 0) then begin //hit |
1590 | 2121 |
Gear^.dX:= oldDx; |
2122 |
Gear^.dY:= oldDy; |
|
1633 | 2123 |
|
1590 | 2124 |
t:= CheckGearsCollision(Gear); |
1633 | 2125 |
if (t^.Count = 0) then begin //hit the ground not the HH |
2126 |
t2 := _0_5 / Distance(Gear^.dX, Gear^.dY); |
|
2127 |
Gear^.dX:= Gear^.dX * t2; |
|
2128 |
Gear^.dY:= Gear^.dY * t2; |
|
2129 |
end else begin //explode right on contact with HH |
|
2130 |
doMakeExplosion(hwRound(Gear^.X), hwRound(Gear^.Y), 50, EXPLAutoSound); |
|
2131 |
DeleteGear(Gear); |
|
2132 |
exit; |
|
2133 |
end; |
|
2376 | 2134 |
|
2462
fa3ddd1ff2a1
Suggestion by Smaxx - use pickhammer sound while drill is in operation
nemo
parents:
2460
diff
changeset
|
2135 |
PlaySound(sndPickhammer, true, nil); |
1590 | 2136 |
Gear^.doStep:= @doStepDrillDrilling; |
1633 | 2137 |
dec(Gear^.Timer) |
1590 | 2138 |
end |
2139 |
end; |
|
1601 | 2140 |
|
1633 | 2141 |
//////////////////////////////////////////////////////////////////////////////// |
1601 | 2142 |
procedure doStepBallgunWork(Gear: PGear); |
2143 |
var HHGear: PGear; |
|
1630 | 2144 |
rx, ry: hwFloat; |
1601 | 2145 |
begin |
2146 |
AllInactive:= false; |
|
2147 |
dec(Gear^.Timer); |
|
2148 |
HHGear:= PHedgehog(Gear^.Hedgehog)^.Gear; |
|
2149 |
HedgehogChAngle(HHGear); |
|
2150 |
if (Gear^.Timer mod 100) = 0 then |
|
2151 |
begin |
|
1630 | 2152 |
rx:= rndSign(getRandom * _0_1); |
2153 |
ry:= rndSign(getRandom * _0_1); |
|
2376 | 2154 |
|
1630 | 2155 |
AddGear(hwRound(Gear^.X), hwRound(Gear^.Y), gtBall, 0, |
2156 |
SignAs(AngleSin(HHGear^.Angle) * _0_8, HHGear^.dX) + rx, |
|
2157 |
AngleCos(HHGear^.Angle) * ( - _0_8) + ry, |
|
2158 |
0); |
|
2376 | 2159 |
|
1669 | 2160 |
PlaySound(sndGun, false, nil); |
1601 | 2161 |
end; |
2162 |
||
1643 | 2163 |
if (Gear^.Timer = 0) or (HHGear^.Damage <> 0) then |
1601 | 2164 |
begin |
2165 |
DeleteGear(Gear); |
|
1643 | 2166 |
AfterAttack |
2167 |
end |
|
1601 | 2168 |
end; |
2169 |
||
2170 |
procedure doStepBallgun(Gear: PGear); |
|
2171 |
var HHGear: PGear; |
|
2172 |
begin |
|
2173 |
HHGear:= PHedgehog(Gear^.Hedgehog)^.Gear; |
|
2174 |
HHGear^.Message:= HHGear^.Message and not (gm_Up or gm_Down); |
|
2175 |
HHGear^.State:= HHGear^.State or gstNotKickable; |
|
2176 |
Gear^.doStep:= @doStepBallgunWork |
|
1633 | 2177 |
end; |
1689 | 2178 |
|
1696 | 2179 |
//////////////////////////////////////////////////////////////////////////////// |
1689 | 2180 |
procedure doStepRCPlaneWork(Gear: PGear); |
2181 |
const cAngleSpeed = 3; |
|
2182 |
var HHGear: PGear; |
|
2183 |
i: LongInt; |
|
2184 |
dX, dY: hwFloat; |
|
2185 |
fChanged: boolean; |
|
2186 |
trueAngle: Longword; |
|
2187 |
t: PGear; |
|
2188 |
begin |
|
2189 |
AllInactive:= false; |
|
2190 |
||
2428 | 2191 |
if ((TrainingFlags and tfRCPlane) = 0) and (Gear^.Timer > 0) then dec(Gear^.Timer); |
2192 |
||
2193 |
if ((TrainingFlags and tfRCPlane) <> 0) and ((TrainingFlags and tfTimeTrial) <> 0 ) and (TimeTrialStartTime = 0) then TimeTrialStartTime:= RealTicks; |
|
1689 | 2194 |
|
2195 |
HHGear:= PHedgehog(Gear^.Hedgehog)^.Gear; |
|
2196 |
FollowGear:= Gear; |
|
2197 |
||
2198 |
fChanged:= false; |
|
1696 | 2199 |
if ((HHGear^.State and gstHHDriven) = 0) or (Gear^.Timer = 0) then |
1689 | 2200 |
begin |
2201 |
fChanged:= true; |
|
1696 | 2202 |
if Gear^.Angle > 2048 then dec(Gear^.Angle) else |
2203 |
if Gear^.Angle < 2048 then inc(Gear^.Angle) else fChanged:= false |
|
2204 |
end |
|
2205 |
else |
|
2206 |
begin |
|
2207 |
if ((Gear^.Message and gm_Left) <> 0) then |
|
2208 |
begin |
|
2209 |
fChanged:= true; |
|
2210 |
Gear^.Angle:= (Gear^.Angle + (4096 - cAngleSpeed)) mod 4096 |
|
2211 |
end; |
|
1689 | 2212 |
|
1696 | 2213 |
if ((Gear^.Message and gm_Right) <> 0) then |
2214 |
begin |
|
2215 |
fChanged:= true; |
|
2216 |
Gear^.Angle:= (Gear^.Angle + cAngleSpeed) mod 4096 |
|
2217 |
end |
|
1689 | 2218 |
end; |
2219 |
||
2220 |
if fChanged then |
|
2221 |
begin |
|
2222 |
Gear^.dX.isNegative:= (Gear^.Angle > 2048); |
|
2223 |
if Gear^.dX.isNegative then |
|
2224 |
trueAngle:= 4096 - Gear^.Angle |
|
2225 |
else |
|
2226 |
trueAngle:= Gear^.Angle; |
|
2227 |
||
2228 |
Gear^.dX:= SignAs(AngleSin(trueAngle), Gear^.dX) * _0_25; |
|
2229 |
Gear^.dY:= AngleCos(trueAngle) * -_0_25; |
|
2230 |
end; |
|
2231 |
||
2232 |
Gear^.X:= Gear^.X + Gear^.dX; |
|
2233 |
Gear^.Y:= Gear^.Y + Gear^.dY; |
|
2234 |
||
2428 | 2235 |
if (TrainingFlags and tfRCPlane) = 0 then |
2236 |
begin |
|
2237 |
if (GameTicks and $FF) = 0 then |
|
2238 |
if Gear^.Timer < 3500 then |
|
2239 |
AddGear(hwRound(Gear^.X), hwRound(Gear^.Y), gtEvilTrace, 0, _0, _0, 0) |
|
2240 |
else |
|
2241 |
AddGear(hwRound(Gear^.X), hwRound(Gear^.Y), gtSmokeTrace, 0, _0, _0, 0); |
|
2242 |
||
2243 |
if ((HHGear^.Message and gm_Attack) <> 0) and (Gear^.Health <> 0) then |
|
2244 |
begin |
|
2245 |
HHGear^.Message := HHGear^.Message and not gm_Attack; |
|
2246 |
AddGear(hwRound(Gear^.X), hwRound(Gear^.Y), gtAirBomb, 0, Gear^.dX * _0_5, Gear^.dY * _0_5, 0); |
|
2247 |
dec(Gear^.Health) |
|
2248 |
end; |
|
2249 |
||
2250 |
if ((HHGear^.Message and gm_LJump) <> 0) |
|
2251 |
and ((Gear^.State and gsttmpFlag) = 0) then |
|
2252 |
begin |
|
2253 |
Gear^.State:= Gear^.State or gsttmpFlag; |
|
2254 |
PauseMusic; |
|
2255 |
playSound(sndRideOfTheValkyries, false, nil); |
|
2256 |
end; |
|
2257 |
||
2258 |
// pickup bonuses |
|
2259 |
t:= CheckGearNear(Gear, gtCase, 36, 36); |
|
2260 |
if t <> nil then |
|
2261 |
PickUp(HHGear, t); |
|
2262 |
end |
|
2263 |
else |
|
2264 |
begin |
|
2265 |
if (GameTicks and $FF) = 0 then |
|
1696 | 2266 |
AddGear(hwRound(Gear^.X), hwRound(Gear^.Y), gtSmokeTrace, 0, _0, _0, 0); |
1689 | 2267 |
|
2428 | 2268 |
// pickup targets |
2269 |
t:= CheckGearNear(Gear, gtTarget, 36, 36); |
|
2270 |
if t <> nil then |
|
2460 | 2271 |
begin |
2468
0b62498c201a
openal fix, training map selection and rcplane adjustments from Smaxx (untested, but look reasonable). Bunch of new graphics from Tiy, new translation for pt-pt from inu_
nemo
parents:
2462
diff
changeset
|
2272 |
if t^.Tag <> 0 then // collect it only once |
2460 | 2273 |
exit; |
2274 |
PlaySound(sndShotgunReload, false, nil); |
|
2275 |
t^.Tag:= 1; |
|
2276 |
TrainingTargetGear:= nil; // remove target cursor |
|
2277 |
exit; |
|
2428 | 2278 |
end; |
1712 | 2279 |
|
2428 | 2280 |
if (TurnTimeLeft > 0) then |
2281 |
dec(TurnTimeLeft) |
|
2282 |
end; |
|
2283 |
||
1689 | 2284 |
CheckCollision(Gear); |
2285 |
||
2468
0b62498c201a
openal fix, training map selection and rcplane adjustments from Smaxx (untested, but look reasonable). Bunch of new graphics from Tiy, new translation for pt-pt from inu_
nemo
parents:
2462
diff
changeset
|
2286 |
if ((Gear^.State and gstCollision) <> 0) or (((TrainingFlags and tfRCPlane) <> 0) and (TurnTimeLeft = 0)) |
1712 | 2287 |
or CheckGearDrowning(Gear) then |
1689 | 2288 |
begin |
2428 | 2289 |
if ((TrainingFlags and tfRCPlane) <> 0) and ((TrainingFlags and tfTimeTrial) <> 0 ) and (TimeTrialStopTime = 0) then TimeTrialStopTime:= RealTicks; |
1712 | 2290 |
StopSound(sndRCPlane); |
2291 |
StopSound(sndRideOfTheValkyries); |
|
2292 |
ResumeMusic; |
|
2376 | 2293 |
|
2468
0b62498c201a
openal fix, training map selection and rcplane adjustments from Smaxx (untested, but look reasonable). Bunch of new graphics from Tiy, new translation for pt-pt from inu_
nemo
parents:
2462
diff
changeset
|
2294 |
if ((Gear^.State and gstCollision) <> 0) or (((TrainingFlags and tfRCPlane) <> 0) and (TurnTimeLeft = 0)) then |
1689 | 2295 |
begin |
1712 | 2296 |
doMakeExplosion(hwRound(Gear^.X), hwRound(Gear^.Y), 25, EXPLAutoSound); |
1714 | 2297 |
for i:= 0 to 32 do |
1712 | 2298 |
begin |
1714 | 2299 |
dX:= AngleCos(i * 64) * _0_5 * (GetRandom + _1); |
2300 |
dY:= AngleSin(i * 64) * _0_5 * (GetRandom + _1); |
|
1712 | 2301 |
AddGear(hwRound(Gear^.X), hwRound(Gear^.Y), gtFlame, 0, dX, dY, 0); |
2302 |
AddGear(hwRound(Gear^.X), hwRound(Gear^.Y), gtFlame, 0, dX, -dY, 0); |
|
2303 |
end; |
|
2304 |
DeleteGear(Gear) |
|
1689 | 2305 |
end; |
1713 | 2306 |
|
1689 | 2307 |
AfterAttack; |
1713 | 2308 |
CurAmmoGear:= nil; |
1697 | 2309 |
TurnTimeLeft:= 14 * 125; |
2468
0b62498c201a
openal fix, training map selection and rcplane adjustments from Smaxx (untested, but look reasonable). Bunch of new graphics from Tiy, new translation for pt-pt from inu_
nemo
parents:
2462
diff
changeset
|
2310 |
|
0b62498c201a
openal fix, training map selection and rcplane adjustments from Smaxx (untested, but look reasonable). Bunch of new graphics from Tiy, new translation for pt-pt from inu_
nemo
parents:
2462
diff
changeset
|
2311 |
if (TrainingFlags and tfRCPlane) <> 0 then |
0b62498c201a
openal fix, training map selection and rcplane adjustments from Smaxx (untested, but look reasonable). Bunch of new graphics from Tiy, new translation for pt-pt from inu_
nemo
parents:
2462
diff
changeset
|
2312 |
TurnTimeLeft:= 0; // HACK: RCPlane training allows unlimited plane starts in last 2 seconds |
0b62498c201a
openal fix, training map selection and rcplane adjustments from Smaxx (untested, but look reasonable). Bunch of new graphics from Tiy, new translation for pt-pt from inu_
nemo
parents:
2462
diff
changeset
|
2313 |
|
1712 | 2314 |
HHGear^.Message:= 0; |
1697 | 2315 |
ParseCommand('/taunt '#1, true) |
2316 |
end |
|
1689 | 2317 |
end; |
2318 |
||
2319 |
procedure doStepRCPlane(Gear: PGear); |
|
2320 |
var HHGear: PGear; |
|
2321 |
begin |
|
2322 |
HHGear:= PHedgehog(Gear^.Hedgehog)^.Gear; |
|
2323 |
HHGear^.Message:= 0; |
|
2324 |
HHGear^.State:= HHGear^.State or gstNotKickable; |
|
2325 |
Gear^.Angle:= HHGear^.Angle; |
|
1696 | 2326 |
Gear^.Tag:= hwSign(HHGear^.dX); |
1689 | 2327 |
if HHGear^.dX.isNegative then Gear^.Angle:= 4096 - Gear^.Angle; |
2328 |
Gear^.doStep:= @doStepRCPlaneWork |
|
1712 | 2329 |
end; |
2177
c045698e044f
Initial attempt at jetpack. Pluses, more like lunar lander (takes fall damage). Minuses, can't seem to cancel it or use alt weapon
nemo
parents:
2143
diff
changeset
|
2330 |
|
c045698e044f
Initial attempt at jetpack. Pluses, more like lunar lander (takes fall damage). Minuses, can't seem to cancel it or use alt weapon
nemo
parents:
2143
diff
changeset
|
2331 |
procedure doStepJetpackWork(Gear: PGear); |
c045698e044f
Initial attempt at jetpack. Pluses, more like lunar lander (takes fall damage). Minuses, can't seem to cancel it or use alt weapon
nemo
parents:
2143
diff
changeset
|
2332 |
var HHGear: PGear; |
c045698e044f
Initial attempt at jetpack. Pluses, more like lunar lander (takes fall damage). Minuses, can't seem to cancel it or use alt weapon
nemo
parents:
2143
diff
changeset
|
2333 |
fuel: LongInt; |
c045698e044f
Initial attempt at jetpack. Pluses, more like lunar lander (takes fall damage). Minuses, can't seem to cancel it or use alt weapon
nemo
parents:
2143
diff
changeset
|
2334 |
move: hwFloat; |
c045698e044f
Initial attempt at jetpack. Pluses, more like lunar lander (takes fall damage). Minuses, can't seem to cancel it or use alt weapon
nemo
parents:
2143
diff
changeset
|
2335 |
begin |
c045698e044f
Initial attempt at jetpack. Pluses, more like lunar lander (takes fall damage). Minuses, can't seem to cancel it or use alt weapon
nemo
parents:
2143
diff
changeset
|
2336 |
AllInactive:= false; |
c045698e044f
Initial attempt at jetpack. Pluses, more like lunar lander (takes fall damage). Minuses, can't seem to cancel it or use alt weapon
nemo
parents:
2143
diff
changeset
|
2337 |
HHGear:=PHedgehog(Gear^.Hedgehog)^.Gear; |
c045698e044f
Initial attempt at jetpack. Pluses, more like lunar lander (takes fall damage). Minuses, can't seem to cancel it or use alt weapon
nemo
parents:
2143
diff
changeset
|
2338 |
//dec(Gear^.Timer); |
2440 | 2339 |
move:= _0_1; |
2177
c045698e044f
Initial attempt at jetpack. Pluses, more like lunar lander (takes fall damage). Minuses, can't seem to cancel it or use alt weapon
nemo
parents:
2143
diff
changeset
|
2340 |
fuel:= 50; |
2182
ed7e7eb3f9ed
Ugly graphic for jetpack - jetpack should be essentially functional.
nemo
parents:
2181
diff
changeset
|
2341 |
(*if (HHGear^.Message and gm_Precise) <> 0 then |
2177
c045698e044f
Initial attempt at jetpack. Pluses, more like lunar lander (takes fall damage). Minuses, can't seem to cancel it or use alt weapon
nemo
parents:
2143
diff
changeset
|
2342 |
begin |
c045698e044f
Initial attempt at jetpack. Pluses, more like lunar lander (takes fall damage). Minuses, can't seem to cancel it or use alt weapon
nemo
parents:
2143
diff
changeset
|
2343 |
move:= _0_02; |
c045698e044f
Initial attempt at jetpack. Pluses, more like lunar lander (takes fall damage). Minuses, can't seem to cancel it or use alt weapon
nemo
parents:
2143
diff
changeset
|
2344 |
fuel:= 5; |
2182
ed7e7eb3f9ed
Ugly graphic for jetpack - jetpack should be essentially functional.
nemo
parents:
2181
diff
changeset
|
2345 |
end;*) |
2177
c045698e044f
Initial attempt at jetpack. Pluses, more like lunar lander (takes fall damage). Minuses, can't seem to cancel it or use alt weapon
nemo
parents:
2143
diff
changeset
|
2346 |
|
c045698e044f
Initial attempt at jetpack. Pluses, more like lunar lander (takes fall damage). Minuses, can't seem to cancel it or use alt weapon
nemo
parents:
2143
diff
changeset
|
2347 |
if (HHGear^.Message and gm_Up) <> 0 then |
c045698e044f
Initial attempt at jetpack. Pluses, more like lunar lander (takes fall damage). Minuses, can't seem to cancel it or use alt weapon
nemo
parents:
2143
diff
changeset
|
2348 |
begin |
2433 | 2349 |
if (not HHGear^.dY.isNegative) or (HHGear^.Y > -_256) then |
2350 |
HHGear^.dY:= HHGear^.dY - move; |
|
2177
c045698e044f
Initial attempt at jetpack. Pluses, more like lunar lander (takes fall damage). Minuses, can't seem to cancel it or use alt weapon
nemo
parents:
2143
diff
changeset
|
2351 |
HHGear^.dY:= HHGear^.dY - move; |
2182
ed7e7eb3f9ed
Ugly graphic for jetpack - jetpack should be essentially functional.
nemo
parents:
2181
diff
changeset
|
2352 |
dec(Gear^.Health, fuel); |
ed7e7eb3f9ed
Ugly graphic for jetpack - jetpack should be essentially functional.
nemo
parents:
2181
diff
changeset
|
2353 |
Gear^.MsgParam:= Gear^.MsgParam or gm_Up; |
ed7e7eb3f9ed
Ugly graphic for jetpack - jetpack should be essentially functional.
nemo
parents:
2181
diff
changeset
|
2354 |
Gear^.Timer:= GameTicks |
2177
c045698e044f
Initial attempt at jetpack. Pluses, more like lunar lander (takes fall damage). Minuses, can't seem to cancel it or use alt weapon
nemo
parents:
2143
diff
changeset
|
2355 |
end; |
2187
66c0f9b3bd6f
set vector to negative *after* applying upward vector
nemo
parents:
2186
diff
changeset
|
2356 |
if (HHGear^.Message and gm_Left) <> 0 then move.isNegative:= true; |
2177
c045698e044f
Initial attempt at jetpack. Pluses, more like lunar lander (takes fall damage). Minuses, can't seem to cancel it or use alt weapon
nemo
parents:
2143
diff
changeset
|
2357 |
if (HHGear^.Message and (gm_Left or gm_Right)) <> 0 then |
c045698e044f
Initial attempt at jetpack. Pluses, more like lunar lander (takes fall damage). Minuses, can't seem to cancel it or use alt weapon
nemo
parents:
2143
diff
changeset
|
2358 |
begin |
c045698e044f
Initial attempt at jetpack. Pluses, more like lunar lander (takes fall damage). Minuses, can't seem to cancel it or use alt weapon
nemo
parents:
2143
diff
changeset
|
2359 |
HHGear^.dX:= HHGear^.dX + (move * _0_2); |
2182
ed7e7eb3f9ed
Ugly graphic for jetpack - jetpack should be essentially functional.
nemo
parents:
2181
diff
changeset
|
2360 |
dec(Gear^.Health, fuel div 5); |
ed7e7eb3f9ed
Ugly graphic for jetpack - jetpack should be essentially functional.
nemo
parents:
2181
diff
changeset
|
2361 |
Gear^.MsgParam:= Gear^.MsgParam or (HHGear^.Message and (gm_Left or gm_Right)); |
ed7e7eb3f9ed
Ugly graphic for jetpack - jetpack should be essentially functional.
nemo
parents:
2181
diff
changeset
|
2362 |
Gear^.Timer:= GameTicks |
2177
c045698e044f
Initial attempt at jetpack. Pluses, more like lunar lander (takes fall damage). Minuses, can't seem to cancel it or use alt weapon
nemo
parents:
2143
diff
changeset
|
2363 |
end; |
2182
ed7e7eb3f9ed
Ugly graphic for jetpack - jetpack should be essentially functional.
nemo
parents:
2181
diff
changeset
|
2364 |
|
2376 | 2365 |
// erases them all at once :-/ |
2182
ed7e7eb3f9ed
Ugly graphic for jetpack - jetpack should be essentially functional.
nemo
parents:
2181
diff
changeset
|
2366 |
if (Gear^.Timer <> 0) and (GameTicks - Gear^.Timer > 250) then |
ed7e7eb3f9ed
Ugly graphic for jetpack - jetpack should be essentially functional.
nemo
parents:
2181
diff
changeset
|
2367 |
begin |
ed7e7eb3f9ed
Ugly graphic for jetpack - jetpack should be essentially functional.
nemo
parents:
2181
diff
changeset
|
2368 |
Gear^.Timer:= 0; |
ed7e7eb3f9ed
Ugly graphic for jetpack - jetpack should be essentially functional.
nemo
parents:
2181
diff
changeset
|
2369 |
Gear^.MsgParam:= 0 |
ed7e7eb3f9ed
Ugly graphic for jetpack - jetpack should be essentially functional.
nemo
parents:
2181
diff
changeset
|
2370 |
end; |
ed7e7eb3f9ed
Ugly graphic for jetpack - jetpack should be essentially functional.
nemo
parents:
2181
diff
changeset
|
2371 |
|
2177
c045698e044f
Initial attempt at jetpack. Pluses, more like lunar lander (takes fall damage). Minuses, can't seem to cancel it or use alt weapon
nemo
parents:
2143
diff
changeset
|
2372 |
if Gear^.Health < 0 then Gear^.Health:= 0; |
2376 | 2373 |
if (GameTicks and $3F) = 0 then |
2204
526f8165acce
Smaxx' idea of timers, reworked just a tad. Might need variable for offset, but seems ok for now
nemo
parents:
2202
diff
changeset
|
2374 |
begin |
526f8165acce
Smaxx' idea of timers, reworked just a tad. Might need variable for offset, but seems ok for now
nemo
parents:
2202
diff
changeset
|
2375 |
//AddCaption('Fuel: '+inttostr(round(Gear^.Health/20))+'%', $FFFFFF, capgrpAmmostate); |
526f8165acce
Smaxx' idea of timers, reworked just a tad. Might need variable for offset, but seems ok for now
nemo
parents:
2202
diff
changeset
|
2376 |
if Gear^.Tex <> nil then FreeTexture(Gear^.Tex); |
526f8165acce
Smaxx' idea of timers, reworked just a tad. Might need variable for offset, but seems ok for now
nemo
parents:
2202
diff
changeset
|
2377 |
Gear^.Tex:= RenderStringTex(trmsg[sidFuel] + ': ' + inttostr(round(Gear^.Health / 20)) + '%', $FFFFFFFF, fntSmall) |
526f8165acce
Smaxx' idea of timers, reworked just a tad. Might need variable for offset, but seems ok for now
nemo
parents:
2202
diff
changeset
|
2378 |
end; |
2177
c045698e044f
Initial attempt at jetpack. Pluses, more like lunar lander (takes fall damage). Minuses, can't seem to cancel it or use alt weapon
nemo
parents:
2143
diff
changeset
|
2379 |
|
2278
28519f4f3f21
requested change by Tiy to Flying Saucer start (hover until first keypress)
nemo
parents:
2267
diff
changeset
|
2380 |
if HHGear^.Message and (gm_Attack or gm_Up or gm_Precise or gm_Left or gm_Right) <> 0 then Gear^.State:= Gear^.State and not gsttmpFlag; |
2177
c045698e044f
Initial attempt at jetpack. Pluses, more like lunar lander (takes fall damage). Minuses, can't seem to cancel it or use alt weapon
nemo
parents:
2143
diff
changeset
|
2381 |
HHGear^.Message:= HHGear^.Message and not (gm_Up or gm_Precise or gm_Left or gm_Right); |
2376 | 2382 |
HHGear^.State:= HHGear^.State or gstMoving; |
2177
c045698e044f
Initial attempt at jetpack. Pluses, more like lunar lander (takes fall damage). Minuses, can't seem to cancel it or use alt weapon
nemo
parents:
2143
diff
changeset
|
2383 |
|
c045698e044f
Initial attempt at jetpack. Pluses, more like lunar lander (takes fall damage). Minuses, can't seem to cancel it or use alt weapon
nemo
parents:
2143
diff
changeset
|
2384 |
Gear^.X:= HHGear^.X; |
c045698e044f
Initial attempt at jetpack. Pluses, more like lunar lander (takes fall damage). Minuses, can't seem to cancel it or use alt weapon
nemo
parents:
2143
diff
changeset
|
2385 |
Gear^.Y:= HHGear^.Y; |
2196 | 2386 |
// For some reason I need to reapply followgear here, something else grabs it otherwise. |
2226
e35b62cb7a1c
Try turning off follow gear while ammo menu is open - needs testing w/ rope/parachute/jetpack
nemo
parents:
2225
diff
changeset
|
2387 |
if not bShowAmmoMenu then FollowGear:= HHGear; |
2278
28519f4f3f21
requested change by Tiy to Flying Saucer start (hover until first keypress)
nemo
parents:
2267
diff
changeset
|
2388 |
|
28519f4f3f21
requested change by Tiy to Flying Saucer start (hover until first keypress)
nemo
parents:
2267
diff
changeset
|
2389 |
if ((Gear^.State and gsttmpFlag) = 0) or (HHGear^.dY < _0) then doStepHedgehogMoving(HHGear); |
2177
c045698e044f
Initial attempt at jetpack. Pluses, more like lunar lander (takes fall damage). Minuses, can't seem to cancel it or use alt weapon
nemo
parents:
2143
diff
changeset
|
2390 |
|
2179 | 2391 |
if (Gear^.Health = 0) |
2180
6c5a339f8e28
Use different group to not erase messages, restore gear deletion on hog damage.
nemo
parents:
2179
diff
changeset
|
2392 |
or (HHGear^.Damage <> 0) |
2179 | 2393 |
or CheckGearDrowning(HHGear) |
2376 | 2394 |
or (TurnTimeLeft = 0) |
2189 | 2395 |
// allow brief ground touches - to be fair on this, might need another counter |
2190 | 2396 |
or (((GameTicks and $1FF) = 0) and (not HHGear^.dY.isNegative) and TestCollisionYwithGear(HHGear, 1)) |
2179 | 2397 |
or ((Gear^.Message and gm_Attack) <> 0) then |
2177
c045698e044f
Initial attempt at jetpack. Pluses, more like lunar lander (takes fall damage). Minuses, can't seem to cancel it or use alt weapon
nemo
parents:
2143
diff
changeset
|
2398 |
begin |
2179 | 2399 |
with HHGear^ do |
2400 |
begin |
|
2401 |
Message:= 0; |
|
2402 |
Active:= true; |
|
2403 |
State:= State or gstMoving |
|
2404 |
end; |
|
2177
c045698e044f
Initial attempt at jetpack. Pluses, more like lunar lander (takes fall damage). Minuses, can't seem to cancel it or use alt weapon
nemo
parents:
2143
diff
changeset
|
2405 |
DeleteGear(Gear); |
2179 | 2406 |
isCursorVisible:= false; |
2204
526f8165acce
Smaxx' idea of timers, reworked just a tad. Might need variable for offset, but seems ok for now
nemo
parents:
2202
diff
changeset
|
2407 |
// if Gear^.Tex <> nil then FreeTexture(Gear^.Tex); |
526f8165acce
Smaxx' idea of timers, reworked just a tad. Might need variable for offset, but seems ok for now
nemo
parents:
2202
diff
changeset
|
2408 |
// Gear^.Tex:= RenderStringTex(trmsg[sidFuel] + ': ' + inttostr(round(Gear^.Health / 20)) + '%', $FFFFFFFF, fntSmall) |
526f8165acce
Smaxx' idea of timers, reworked just a tad. Might need variable for offset, but seems ok for now
nemo
parents:
2202
diff
changeset
|
2409 |
//AddCaption(trmsg[sidFuel]+': '+inttostr(round(Gear^.Health/20))+'%', $FFFFFF, capgrpAmmostate); |
2177
c045698e044f
Initial attempt at jetpack. Pluses, more like lunar lander (takes fall damage). Minuses, can't seem to cancel it or use alt weapon
nemo
parents:
2143
diff
changeset
|
2410 |
end |
c045698e044f
Initial attempt at jetpack. Pluses, more like lunar lander (takes fall damage). Minuses, can't seem to cancel it or use alt weapon
nemo
parents:
2143
diff
changeset
|
2411 |
end; |
c045698e044f
Initial attempt at jetpack. Pluses, more like lunar lander (takes fall damage). Minuses, can't seem to cancel it or use alt weapon
nemo
parents:
2143
diff
changeset
|
2412 |
|
c045698e044f
Initial attempt at jetpack. Pluses, more like lunar lander (takes fall damage). Minuses, can't seem to cancel it or use alt weapon
nemo
parents:
2143
diff
changeset
|
2413 |
procedure doStepJetpack(Gear: PGear); |
c045698e044f
Initial attempt at jetpack. Pluses, more like lunar lander (takes fall damage). Minuses, can't seem to cancel it or use alt weapon
nemo
parents:
2143
diff
changeset
|
2414 |
var HHGear: PGear; |
c045698e044f
Initial attempt at jetpack. Pluses, more like lunar lander (takes fall damage). Minuses, can't seem to cancel it or use alt weapon
nemo
parents:
2143
diff
changeset
|
2415 |
begin |
c045698e044f
Initial attempt at jetpack. Pluses, more like lunar lander (takes fall damage). Minuses, can't seem to cancel it or use alt weapon
nemo
parents:
2143
diff
changeset
|
2416 |
Gear^.doStep:= @doStepJetpackWork; |
c045698e044f
Initial attempt at jetpack. Pluses, more like lunar lander (takes fall damage). Minuses, can't seem to cancel it or use alt weapon
nemo
parents:
2143
diff
changeset
|
2417 |
|
c045698e044f
Initial attempt at jetpack. Pluses, more like lunar lander (takes fall damage). Minuses, can't seem to cancel it or use alt weapon
nemo
parents:
2143
diff
changeset
|
2418 |
HHGear:= PHedgehog(Gear^.Hedgehog)^.Gear; |
c045698e044f
Initial attempt at jetpack. Pluses, more like lunar lander (takes fall damage). Minuses, can't seem to cancel it or use alt weapon
nemo
parents:
2143
diff
changeset
|
2419 |
FollowGear:= HHGear; |
2179 | 2420 |
OnUsedAmmo(PHedgehog(HHGear^.Hedgehog)^); |
2421 |
ApplyAmmoChanges(PHedgehog(HHGear^.Hedgehog)^); |
|
2177
c045698e044f
Initial attempt at jetpack. Pluses, more like lunar lander (takes fall damage). Minuses, can't seem to cancel it or use alt weapon
nemo
parents:
2143
diff
changeset
|
2422 |
with HHGear^ do |
c045698e044f
Initial attempt at jetpack. Pluses, more like lunar lander (takes fall damage). Minuses, can't seem to cancel it or use alt weapon
nemo
parents:
2143
diff
changeset
|
2423 |
begin |
c045698e044f
Initial attempt at jetpack. Pluses, more like lunar lander (takes fall damage). Minuses, can't seem to cancel it or use alt weapon
nemo
parents:
2143
diff
changeset
|
2424 |
State:= State and not gstAttacking; |
2278
28519f4f3f21
requested change by Tiy to Flying Saucer start (hover until first keypress)
nemo
parents:
2267
diff
changeset
|
2425 |
Message:= Message and not (gm_Attack or gm_Up or gm_Precise or gm_Left or gm_Right); |
2301 | 2426 |
if (dY < _0_1) and (dY > -_0_1) then |
2427 |
begin |
|
2428 |
Gear^.State:= Gear^.State or gsttmpFlag; |
|
2429 |
dY:= dY - _0_2 |
|
2430 |
end |
|
2177
c045698e044f
Initial attempt at jetpack. Pluses, more like lunar lander (takes fall damage). Minuses, can't seem to cancel it or use alt weapon
nemo
parents:
2143
diff
changeset
|
2431 |
end |
c045698e044f
Initial attempt at jetpack. Pluses, more like lunar lander (takes fall damage). Minuses, can't seem to cancel it or use alt weapon
nemo
parents:
2143
diff
changeset
|
2432 |
end; |