author | unc0rr |
Sat, 17 Oct 2009 09:44:22 +0000 | |
changeset 2520 | b785c90b93fe |
parent 2515 | 51d3f4b6293a |
child 2524 | 0b075d38fee5 |
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); |
|
2492
9e80b7fc4017
Tweak of molotov based on burp's play, a little bit more specificity in homerun.
nemo
parents:
2480
diff
changeset
|
231 |
for i:= 0 to 20 do begin |
2512 | 232 |
dX:= AngleCos(i * 2) * ((_0_1*(i div 5))) * (GetRandom + _1); |
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
|
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; |
2514
df9d0728c5bb
Make hedgies just hop a bit on flames so they are more likely to get properly scorched
nemo
parents:
2512
diff
changeset
|
1332 |
AmmoShove(Gear, 2, 30); |
2424
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; |
2475 | 1335 |
if Gear^.Timer > 0 then |
1336 |
begin |
|
1337 |
dec(Gear^.Timer); |
|
1338 |
inc(Gear^.Damage) |
|
1339 |
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
|
1340 |
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
|
1341 |
// 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
|
1342 |
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
|
1343 |
begin |
b52344de23ae
In progress, trying to make a fire for molotov cocktail. Normal fire should still work fairly normally.
nemo
parents:
2376
diff
changeset
|
1344 |
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
|
1345 |
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
|
1346 |
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
|
1347 |
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
|
1348 |
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
|
1349 |
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
|
1350 |
end |
b52344de23ae
In progress, trying to make a fire for molotov cocktail. Normal fire should still work fairly normally.
nemo
parents:
2376
diff
changeset
|
1351 |
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
|
1352 |
// Modified fire |
2475 | 1353 |
if ((GameTicks and $7FF) = 0) and ((GameFlags and gfSolidLand) = 0) then |
2424
b52344de23ae
In progress, trying to make a fire for molotov cocktail. Normal fire should still work fairly normally.
nemo
parents:
2376
diff
changeset
|
1354 |
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
|
1355 |
// 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
|
1356 |
Gear^.Timer:= 100 - Gear^.Tag * 3; |
2475 | 1357 |
if (Gear^.Damage > 3000+Gear^.Tag*1500) then Gear^.Health:= 0 |
2424
b52344de23ae
In progress, trying to make a fire for molotov cocktail. Normal fire should still work fairly normally.
nemo
parents:
2376
diff
changeset
|
1358 |
end |
b52344de23ae
In progress, trying to make a fire for molotov cocktail. Normal fire should still work fairly normally.
nemo
parents:
2376
diff
changeset
|
1359 |
end |
b52344de23ae
In progress, trying to make a fire for molotov cocktail. Normal fire should still work fairly normally.
nemo
parents:
2376
diff
changeset
|
1360 |
end; |
351 | 1361 |
if Gear^.Health = 0 then |
1133 | 1362 |
DeleteGear(Gear) |
79 | 1363 |
end; |
82 | 1364 |
|
1365 |
//////////////////////////////////////////////////////////////////////////////// |
|
1366 |
procedure doStepFirePunchWork(Gear: PGear); |
|
1367 |
var HHGear: PGear; |
|
1368 |
begin |
|
1369 |
AllInactive:= false; |
|
351 | 1370 |
if ((Gear^.Message and gm_Destroy) <> 0) then |
1133 | 1371 |
begin |
1372 |
DeleteGear(Gear); |
|
1373 |
AfterAttack; |
|
1374 |
exit |
|
1375 |
end; |
|
82 | 1376 |
|
351 | 1377 |
HHGear:= PHedgehog(Gear^.Hedgehog)^.Gear; |
1378 |
if hwRound(HHGear^.Y) <= Gear^.Tag - 2 then |
|
1133 | 1379 |
begin |
1380 |
Gear^.Tag:= hwRound(HHGear^.Y); |
|
1381 |
DrawTunnel(HHGear^.X - int2hwFloat(cHHRadius), HHGear^.Y - _1, _0_5, _0, cHHRadius * 4, 2); |
|
1382 |
HHGear^.State:= HHGear^.State or gstNoDamage; |
|
1383 |
Gear^.Y:= HHGear^.Y; |
|
1384 |
AmmoShove(Gear, 30, 40); |
|
1385 |
HHGear^.State:= HHGear^.State and not gstNoDamage |
|
1386 |
end; |
|
351 | 1387 |
|
1388 |
HHGear^.dY:= HHGear^.dY + cGravity; |
|
1389 |
if not (HHGear^.dY.isNegative) then |
|
1133 | 1390 |
begin |
1391 |
HHGear^.State:= HHGear^.State or gstMoving; |
|
1392 |
DeleteGear(Gear); |
|
1393 |
AfterAttack; |
|
1394 |
exit |
|
1395 |
end; |
|
2089 | 1396 |
|
2376 | 1397 |
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
|
1398 |
HHGear^.Y:= HHGear^.Y + HHGear^.dY |
82 | 1399 |
end; |
1400 |
||
1401 |
procedure doStepFirePunch(Gear: PGear); |
|
1402 |
var HHGear: PGear; |
|
1403 |
begin |
|
1404 |
AllInactive:= false; |
|
351 | 1405 |
HHGear:= PHedgehog(Gear^.Hedgehog)^.Gear; |
514 | 1406 |
DeleteCI(HHGear); |
498 | 1407 |
HHGear^.X:= int2hwFloat(hwRound(HHGear^.X)) - _0_5; |
1014
3c7d4e7ccdff
- Fix firepunch sprite direction when use in high jump
unc0rr
parents:
992
diff
changeset
|
1408 |
HHGear^.dX:= SignAs(cLittle, Gear^.dX); |
3c7d4e7ccdff
- Fix firepunch sprite direction when use in high jump
unc0rr
parents:
992
diff
changeset
|
1409 |
|
351 | 1410 |
HHGear^.dY:= - _0_3; |
82 | 1411 |
|
351 | 1412 |
Gear^.X:= HHGear^.X; |
979
edb8f208c1d9
Fix firepunch direction when attacking from high jump
unc0rr
parents:
974
diff
changeset
|
1413 |
Gear^.dX:= SignAs(_0_45, Gear^.dX); |
351 | 1414 |
Gear^.dY:= - _0_9; |
1415 |
Gear^.doStep:= @doStepFirePunchWork; |
|
498 | 1416 |
DrawTunnel(HHGear^.X - int2hwFloat(cHHRadius), HHGear^.Y + _1, _0_5, _0, cHHRadius * 4, 5); |
1279 | 1417 |
|
1669 | 1418 |
PlaySound(TSound(ord(sndFirePunch1) + GetRandom(6)), false, PHedgehog(HHGear^.Hedgehog)^.Team^.voicepack) |
82 | 1419 |
end; |
1420 |
||
263 | 1421 |
//////////////////////////////////////////////////////////////////////////////// |
1422 |
||
929
9456e1e77369
- Continue preparation for implementing attack from rope and parachute
unc0rr
parents:
928
diff
changeset
|
1423 |
procedure doStepParachuteWork(Gear: PGear); |
211 | 1424 |
var HHGear: PGear; |
1425 |
begin |
|
351 | 1426 |
HHGear:= PHedgehog(Gear^.Hedgehog)^.Gear; |
82 | 1427 |
|
516 | 1428 |
inc(Gear^.Timer); |
1429 |
||
212 | 1430 |
if TestCollisionYwithGear(HHGear, 1) |
1133 | 1431 |
or ((HHGear^.State and gstHHDriven) = 0) |
1432 |
or CheckGearDrowning(HHGear) |
|
1433 |
or ((Gear^.Message and gm_Attack) <> 0) then |
|
1434 |
begin |
|
1435 |
with HHGear^ do |
|
1436 |
begin |
|
1437 |
Message:= 0; |
|
1438 |
SetLittle(dX); |
|
1439 |
dY:= _0; |
|
1440 |
State:= State or gstMoving; |
|
1441 |
end; |
|
1442 |
DeleteGear(Gear); |
|
2060
3e9e5e1be6f5
fix crash in parachute/rope if drowning with active girder/teleport
nemo
parents:
2059
diff
changeset
|
1443 |
isCursorVisible:= false; |
1133 | 1444 |
exit |
1445 |
end; |
|
211 | 1446 |
|
351 | 1447 |
if not TestCollisionXwithGear(HHGear, hwSign(HHGear^.dX)) then |
1133 | 1448 |
HHGear^.X:= HHGear^.X + cWindSpeed * 200; |
211 | 1449 |
|
351 | 1450 |
if (Gear^.Message and gm_Left) <> 0 then HHGear^.X:= HHGear^.X - cMaxWindSpeed * 40 |
1451 |
else if (Gear^.Message and gm_Right) <> 0 then HHGear^.X:= HHGear^.X + cMaxWindSpeed * 40; |
|
1452 |
if (Gear^.Message and gm_Up) <> 0 then HHGear^.Y:= HHGear^.Y - cGravity * 40 |
|
1453 |
else if (Gear^.Message and gm_Down) <> 0 then HHGear^.Y:= HHGear^.Y + cGravity * 40; |
|
211 | 1454 |
|
351 | 1455 |
HHGear^.Y:= HHGear^.Y + cGravity * 100; |
568 | 1456 |
Gear^.X:= HHGear^.X; |
1457 |
Gear^.Y:= HHGear^.Y |
|
263 | 1458 |
end; |
211 | 1459 |
|
929
9456e1e77369
- Continue preparation for implementing attack from rope and parachute
unc0rr
parents:
928
diff
changeset
|
1460 |
procedure doStepParachute(Gear: PGear); |
9456e1e77369
- Continue preparation for implementing attack from rope and parachute
unc0rr
parents:
928
diff
changeset
|
1461 |
var HHGear: PGear; |
9456e1e77369
- Continue preparation for implementing attack from rope and parachute
unc0rr
parents:
928
diff
changeset
|
1462 |
begin |
9456e1e77369
- Continue preparation for implementing attack from rope and parachute
unc0rr
parents:
928
diff
changeset
|
1463 |
HHGear:= PHedgehog(Gear^.Hedgehog)^.Gear; |
9456e1e77369
- Continue preparation for implementing attack from rope and parachute
unc0rr
parents:
928
diff
changeset
|
1464 |
|
9456e1e77369
- Continue preparation for implementing attack from rope and parachute
unc0rr
parents:
928
diff
changeset
|
1465 |
DeleteCI(HHGear); |
9456e1e77369
- Continue preparation for implementing attack from rope and parachute
unc0rr
parents:
928
diff
changeset
|
1466 |
|
9456e1e77369
- Continue preparation for implementing attack from rope and parachute
unc0rr
parents:
928
diff
changeset
|
1467 |
OnUsedAmmo(PHedgehog(HHGear^.Hedgehog)^); |
9456e1e77369
- Continue preparation for implementing attack from rope and parachute
unc0rr
parents:
928
diff
changeset
|
1468 |
ApplyAmmoChanges(PHedgehog(HHGear^.Hedgehog)^); |
9456e1e77369
- Continue preparation for implementing attack from rope and parachute
unc0rr
parents:
928
diff
changeset
|
1469 |
|
931 | 1470 |
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
|
1471 |
HHGear^.Message:= HHGear^.Message and not gm_Attack; |
9456e1e77369
- Continue preparation for implementing attack from rope and parachute
unc0rr
parents:
928
diff
changeset
|
1472 |
|
9456e1e77369
- Continue preparation for implementing attack from rope and parachute
unc0rr
parents:
928
diff
changeset
|
1473 |
Gear^.doStep:= @doStepParachuteWork; |
9456e1e77369
- Continue preparation for implementing attack from rope and parachute
unc0rr
parents:
928
diff
changeset
|
1474 |
|
9456e1e77369
- Continue preparation for implementing attack from rope and parachute
unc0rr
parents:
928
diff
changeset
|
1475 |
Gear^.Message:= HHGear^.Message; |
9456e1e77369
- Continue preparation for implementing attack from rope and parachute
unc0rr
parents:
928
diff
changeset
|
1476 |
doStepParachuteWork(Gear) |
9456e1e77369
- Continue preparation for implementing attack from rope and parachute
unc0rr
parents:
928
diff
changeset
|
1477 |
end; |
9456e1e77369
- Continue preparation for implementing attack from rope and parachute
unc0rr
parents:
928
diff
changeset
|
1478 |
|
263 | 1479 |
//////////////////////////////////////////////////////////////////////////////// |
1480 |
procedure doStepAirAttackWork(Gear: PGear); |
|
1507 | 1481 |
var i: Longint; |
263 | 1482 |
begin |
1483 |
AllInactive:= false; |
|
498 | 1484 |
Gear^.X:= Gear^.X + cAirPlaneSpeed * Gear^.Tag; |
1124 | 1485 |
|
543
465e2ec8f05f
- Better randomness of placing hedgehogs on the land
unc0rr
parents:
542
diff
changeset
|
1486 |
if (Gear^.Health > 0)and(not (Gear^.X < Gear^.dX))and(Gear^.X < Gear^.dX + cAirPlaneSpeed) then |
1124 | 1487 |
begin |
1488 |
dec(Gear^.Health); |
|
1489 |
case Gear^.State of |
|
1490 |
0: FollowGear:= AddGear(hwRound(Gear^.X), hwRound(Gear^.Y), gtAirBomb, 0, cBombsSpeed * Gear^.Tag, _0, 0); |
|
1491 |
1: FollowGear:= AddGear(hwRound(Gear^.X), hwRound(Gear^.Y), gtMine, 0, cBombsSpeed * Gear^.Tag, _0, 0); |
|
1586 | 1492 |
2: for i:= -19 to 19 do |
1493 |
FollowGear:= AddGear(hwRound(Gear^.X) + i div 3, hwRound(Gear^.Y), gtFlame, 0, _0_001 * i, _0, 0); |
|
1124 | 1494 |
end; |
1495 |
Gear^.dX:= Gear^.dX + int2hwFloat(30 * Gear^.Tag) |
|
1496 |
end; |
|
1497 |
||
1498 |
if (GameTicks and $3F) = 0 then |
|
1499 |
AddGear(hwRound(Gear^.X), hwRound(Gear^.Y), gtSmokeTrace, 0, _0, _0, 0); |
|
1500 |
||
1753 | 1501 |
if (hwRound(Gear^.X) > (LAND_WIDTH+1024)) or (hwRound(Gear^.X) < -1024) then DeleteGear(Gear) |
263 | 1502 |
end; |
1503 |
||
1504 |
procedure doStepAirAttack(Gear: PGear); |
|
1505 |
begin |
|
1506 |
AllInactive:= false; |
|
543
465e2ec8f05f
- Better randomness of placing hedgehogs on the land
unc0rr
parents:
542
diff
changeset
|
1507 |
|
1507 | 1508 |
if Gear^.X.QWordValue = 0 then |
1771 | 1509 |
begin |
1510 |
Gear^.Tag:= 1; |
|
1511 |
Gear^.X:= -_1024; |
|
1512 |
end |
|
1507 | 1513 |
else |
1771 | 1514 |
begin |
1507 | 1515 |
Gear^.Tag:= -1; |
1771 | 1516 |
Gear^.X:= int2hwFloat(LAND_WIDTH + 1024); |
1517 |
end; |
|
1507 | 1518 |
|
1784 | 1519 |
Gear^.Y:= int2hwFloat(topY-300); |
543
465e2ec8f05f
- Better randomness of placing hedgehogs on the land
unc0rr
parents:
542
diff
changeset
|
1520 |
Gear^.dX:= int2hwFloat(TargetPoint.X - 5 * Gear^.Tag * 15); |
357 | 1521 |
|
543
465e2ec8f05f
- Better randomness of placing hedgehogs on the land
unc0rr
parents:
542
diff
changeset
|
1522 |
if int2hwFloat(TargetPoint.Y) - Gear^.Y > _0 then |
1133 | 1523 |
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
|
1524 |
|
351 | 1525 |
Gear^.Health:= 6; |
801 | 1526 |
Gear^.doStep:= @doStepAirAttackWork; |
1669 | 1527 |
PlaySound(sndIncoming, false, PHedgehog(Gear^.Hedgehog)^.Team^.voicepack) |
263 | 1528 |
end; |
1529 |
||
1530 |
//////////////////////////////////////////////////////////////////////////////// |
|
1531 |
||
1532 |
procedure doStepAirBomb(Gear: PGear); |
|
1533 |
begin |
|
1534 |
AllInactive:= false; |
|
1535 |
doStepFallingGear(Gear); |
|
351 | 1536 |
if (Gear^.State and gstCollision) <> 0 then |
1133 | 1537 |
begin |
1538 |
doMakeExplosion(hwRound(Gear^.X), hwRound(Gear^.Y), 30, EXPLAutoSound); |
|
1539 |
DeleteGear(Gear); |
|
1540 |
exit |
|
1541 |
end; |
|
263 | 1542 |
if (GameTicks and $3F) = 0 then |
1133 | 1543 |
AddGear(hwRound(Gear^.X), hwRound(Gear^.Y), gtSmokeTrace, 0, _0, _0, 0) |
211 | 1544 |
end; |
409 | 1545 |
|
1546 |
//////////////////////////////////////////////////////////////////////////////// |
|
1547 |
||
1548 |
procedure doStepGirder(Gear: PGear); |
|
415 | 1549 |
var HHGear: PGear; |
1915 | 1550 |
x, y, tx, ty: hwFloat; |
409 | 1551 |
begin |
1552 |
AllInactive:= false; |
|
415 | 1553 |
|
1554 |
HHGear:= PHedgehog(Gear^.Hedgehog)^.Gear; |
|
1915 | 1555 |
tx:= int2hwFloat(TargetPoint.X); |
1556 |
ty:= int2hwFloat(TargetPoint.Y); |
|
1557 |
x:= HHGear^.X; |
|
1558 |
y:= HHGear^.Y; |
|
1909 | 1559 |
|
1915 | 1560 |
if (Distance(tx - x, ty - y) > _256) or |
1561 |
not TryPlaceOnLand(TargetPoint.X - SpritesData[sprAmGirder].Width div 2, |
|
1562 |
TargetPoint.Y - SpritesData[sprAmGirder].Height div 2, |
|
520 | 1563 |
sprAmGirder, Gear^.State, true) then |
1133 | 1564 |
begin |
1914 | 1565 |
PlaySound(sndDenied, false, nil); |
1566 |
HHGear^.Message:= HHGear^.Message and not gm_Attack; |
|
1567 |
HHGear^.State:= HHGear^.State and not gstAttacking; |
|
1133 | 1568 |
HHGear^.State:= HHGear^.State or gstHHChooseTarget; |
1914 | 1569 |
isCursorVisible:= true; |
1570 |
DeleteGear(Gear) |
|
1133 | 1571 |
end |
1572 |
else begin |
|
1914 | 1573 |
PlaySound(sndPlaced, false, nil); |
1133 | 1574 |
DeleteGear(Gear); |
1909 | 1575 |
OnUsedAmmo(PHedgehog(HHGear^.Hedgehog)^); |
1914 | 1576 |
ApplyAmmoChanges(PHedgehog(HHGear^.Hedgehog)^) |
1577 |
end; |
|
1578 |
||
1909 | 1579 |
HHGear^.State:= HHGear^.State and not (gstAttacking or gstAttacked); |
1580 |
HHGear^.Message:= HHGear^.Message and not gm_Attack; |
|
415 | 1581 |
TargetPoint.X:= NoPointX |
409 | 1582 |
end; |
520 | 1583 |
|
1584 |
//////////////////////////////////////////////////////////////////////////////// |
|
525 | 1585 |
procedure doStepTeleportAfter(Gear: PGear); |
912 | 1586 |
var HHGear: PGear; |
1587 |
begin |
|
1588 |
HHGear:= PHedgehog(Gear^.Hedgehog)^.Gear; |
|
1589 |
HHGear^.Y:= HHGear^.Y + HHGear^.dY; // hedgehog falling to collect cases |
|
1590 |
HHGear^.dY:= HHGear^.dY + cGravity; |
|
945
4ead9cde4e14
- Start chat implementation: chat strings are on the screen
unc0rr
parents:
940
diff
changeset
|
1591 |
if TestCollisionYwithGear(HHGear, 1) |
1133 | 1592 |
or CheckGearDrowning(HHGear) then |
1593 |
begin |
|
1594 |
DeleteGear(Gear); |
|
1595 |
AfterAttack |
|
1596 |
end |
|
912 | 1597 |
end; |
1598 |
||
1599 |
procedure doStepTeleportAnim(Gear: PGear); |
|
525 | 1600 |
begin |
853 | 1601 |
inc(Gear^.Timer); |
1602 |
if Gear^.Timer = 65 then |
|
1603 |
begin |
|
1604 |
Gear^.Timer:= 0; |
|
1605 |
inc(Gear^.Pos); |
|
1606 |
if Gear^.Pos = 11 then |
|
912 | 1607 |
Gear^.doStep:= @doStepTeleportAfter |
2217 | 1608 |
end; |
525 | 1609 |
end; |
520 | 1610 |
|
1611 |
procedure doStepTeleport(Gear: PGear); |
|
1612 |
var HHGear: PGear; |
|
1613 |
begin |
|
1614 |
AllInactive:= false; |
|
1615 |
||
1616 |
HHGear:= PHedgehog(Gear^.Hedgehog)^.Gear; |
|
1617 |
if not TryPlaceOnLand(TargetPoint.X - SpritesData[sprHHTelepMask].Width div 2, |
|
1618 |
TargetPoint.Y - SpritesData[sprHHTelepMask].Height div 2, |
|
1619 |
sprHHTelepMask, 0, false) then |
|
853 | 1620 |
begin |
1621 |
HHGear^.Message:= HHGear^.Message and not gm_Attack; |
|
1622 |
HHGear^.State:= HHGear^.State and not gstAttacking; |
|
1623 |
HHGear^.State:= HHGear^.State or gstHHChooseTarget; |
|
1624 |
DeleteGear(Gear); |
|
2227 | 1625 |
isCursorVisible:= true; |
1626 |
PlaySound(sndDenied, false, nil); |
|
853 | 1627 |
end |
1628 |
else begin |
|
1629 |
DeleteCI(HHGear); |
|
1630 |
SetAllHHToActive; |
|
912 | 1631 |
Gear^.doStep:= @doStepTeleportAnim; |
853 | 1632 |
Gear^.X:= HHGear^.X; |
1633 |
Gear^.Y:= HHGear^.Y; |
|
1634 |
HHGear^.X:= int2hwFloat(TargetPoint.X); |
|
1635 |
HHGear^.Y:= int2hwFloat(TargetPoint.Y); |
|
2227 | 1636 |
HHGear^.State:= HHGear^.State or gstMoving; |
1637 |
playSound(sndWarp, false, nil); |
|
853 | 1638 |
end; |
2217 | 1639 |
TargetPoint.X:= NoPointX; |
1640 |
||
520 | 1641 |
end; |
534 | 1642 |
|
1643 |
//////////////////////////////////////////////////////////////////////////////// |
|
1644 |
procedure doStepSwitcherWork(Gear: PGear); |
|
1645 |
var HHGear: PGear; |
|
1646 |
Msg, State: Longword; |
|
1647 |
begin |
|
1648 |
AllInactive:= false; |
|
1649 |
||
540 | 1650 |
if ((Gear^.Message and not gm_Switch) <> 0) or (TurnTimeLeft = 0) then |
1133 | 1651 |
begin |
1652 |
HHGear:= PHedgehog(Gear^.Hedgehog)^.Gear; |
|
1653 |
Msg:= Gear^.Message and not gm_Switch; |
|
1654 |
DeleteGear(Gear); |
|
1655 |
OnUsedAmmo(PHedgehog(HHGear^.Hedgehog)^); |
|
1656 |
ApplyAmmoChanges(PHedgehog(HHGear^.Hedgehog)^); |
|
534 | 1657 |
|
1133 | 1658 |
HHGear:= CurrentHedgehog^.Gear; |
1659 |
ApplyAmmoChanges(PHedgehog(HHGear^.Hedgehog)^); |
|
1660 |
HHGear^.Message:= Msg; |
|
1661 |
exit |
|
1662 |
end; |
|
534 | 1663 |
|
1664 |
if (Gear^.Message and gm_Switch) <> 0 then |
|
1133 | 1665 |
begin |
1666 |
HHGear:= CurrentHedgehog^.Gear; |
|
1667 |
HHGear^.Message:= HHGear^.Message and not gm_Switch; |
|
1668 |
Gear^.Message:= Gear^.Message and not gm_Switch; |
|
1669 |
State:= HHGear^.State; |
|
1670 |
HHGear^.State:= 0; |
|
1671 |
HHGear^.Active:= false; |
|
1672 |
HHGear^.Z:= cHHZ; |
|
1673 |
RemoveGearFromList(HHGear); |
|
1674 |
InsertGearToList(HHGear); |
|
534 | 1675 |
|
1133 | 1676 |
repeat |
1677 |
CurrentTeam^.CurrHedgehog:= Succ(CurrentTeam^.CurrHedgehog) mod (CurrentTeam^.HedgehogsNumber); |
|
1678 |
until (CurrentTeam^.Hedgehogs[CurrentTeam^.CurrHedgehog].Gear <> nil); |
|
652 | 1679 |
|
1133 | 1680 |
CurrentHedgehog:= @CurrentTeam^.Hedgehogs[CurrentTeam^.CurrHedgehog]; |
534 | 1681 |
|
1133 | 1682 |
HHGear:= CurrentHedgehog^.Gear; |
1683 |
HHGear^.State:= State; |
|
1684 |
HHGear^.Active:= true; |
|
1685 |
FollowGear:= HHGear; |
|
1686 |
HHGear^.Z:= cCurrHHZ; |
|
1687 |
RemoveGearFromList(HHGear); |
|
1688 |
InsertGearToList(HHGear); |
|
1689 |
Gear^.X:= HHGear^.X; |
|
1690 |
Gear^.Y:= HHGear^.Y |
|
1691 |
end; |
|
534 | 1692 |
end; |
1693 |
||
1694 |
procedure doStepSwitcher(Gear: PGear); |
|
1695 |
var HHGear: PGear; |
|
1696 |
begin |
|
1697 |
Gear^.doStep:= @doStepSwitcherWork; |
|
1698 |
||
1699 |
HHGear:= PHedgehog(Gear^.Hedgehog)^.Gear; |
|
1700 |
with HHGear^ do |
|
1133 | 1701 |
begin |
1702 |
State:= State and not gstAttacking; |
|
1703 |
Message:= Message and not gm_Attack |
|
1704 |
end |
|
534 | 1705 |
end; |
924 | 1706 |
|
1707 |
//////////////////////////////////////////////////////////////////////////////// |
|
1708 |
procedure doStepMortar(Gear: PGear); |
|
1709 |
var dX, dY: hwFloat; |
|
1710 |
i: LongInt; |
|
963 | 1711 |
dxn, dyn: boolean; |
924 | 1712 |
begin |
1713 |
AllInactive:= false; |
|
963 | 1714 |
dxn:= Gear^.dX.isNegative; |
1715 |
dyn:= Gear^.dY.isNegative; |
|
1716 |
||
924 | 1717 |
doStepFallingGear(Gear); |
1718 |
if (Gear^.State and gstCollision) <> 0 then |
|
1719 |
begin |
|
1720 |
doMakeExplosion(hwRound(Gear^.X), hwRound(Gear^.Y), 20, EXPLAutoSound); |
|
963 | 1721 |
|
1722 |
Gear^.dX.isNegative:= not dxn; |
|
1723 |
Gear^.dY.isNegative:= not dyn; |
|
924 | 1724 |
for i:= 0 to 4 do |
1725 |
begin |
|
963 | 1726 |
dX:= Gear^.dX + (GetRandom - _0_5) * _0_03; |
1727 |
dY:= Gear^.dY + (GetRandom - _0_5) * _0_03; |
|
1273 | 1728 |
AddGear(hwRound(Gear^.X), hwRound(Gear^.Y), gtCluster, 0, dX, dY, 25); |
924 | 1729 |
end; |
2376 | 1730 |
|
924 | 1731 |
DeleteGear(Gear); |
1732 |
exit |
|
1733 |
end; |
|
963 | 1734 |
|
924 | 1735 |
if (GameTicks and $3F) = 0 then |
1736 |
AddGear(hwRound(Gear^.X), hwRound(Gear^.Y), gtSmokeTrace, 0, _0, _0, 0) |
|
1737 |
end; |
|
984 | 1738 |
|
1739 |
//////////////////////////////////////////////////////////////////////////////// |
|
1740 |
procedure doStepKamikazeWork(Gear: PGear); |
|
1741 |
const upd: Longword = 0; |
|
987 | 1742 |
var i: LongWord; |
984 | 1743 |
HHGear: PGear; |
1744 |
begin |
|
1745 |
AllInactive:= false; |
|
1746 |
||
1747 |
HHGear:= PHedgehog(Gear^.Hedgehog)^.Gear; |
|
1748 |
HHGear^.State:= HHGear^.State or gstNoDamage; |
|
1749 |
DeleteCI(HHGear); |
|
1750 |
||
1751 |
i:= 2; |
|
1752 |
repeat |
|
1753 |
Gear^.X:= Gear^.X + HHGear^.dX; |
|
1754 |
Gear^.Y:= Gear^.Y + HHGear^.dY; |
|
1755 |
HHGear^.X:= Gear^.X; |
|
1756 |
HHGear^.Y:= Gear^.Y; |
|
1757 |
||
1758 |
inc(Gear^.Damage, 2); |
|
1759 |
||
1200 | 1760 |
// if TestCollisionXwithGear(HHGear, hwSign(Gear^.dX)) |
1761 |
// or TestCollisionYwithGear(HHGear, hwSign(Gear^.dY)) then inc(Gear^.Damage, 3); |
|
984 | 1762 |
|
1763 |
dec(i) |
|
1764 |
until (i = 0) or (Gear^.Damage > Gear^.Health); |
|
1765 |
||
1766 |
inc(upd); |
|
1767 |
if upd > 3 then |
|
1768 |
begin |
|
987 | 1769 |
if Gear^.Health < 1500 then Gear^.Pos:= 2; |
2376 | 1770 |
|
984 | 1771 |
AmmoShove(Gear, 30, 40); |
2376 | 1772 |
|
984 | 1773 |
DrawTunnel(HHGear^.X - HHGear^.dX * 10, |
1200 | 1774 |
HHGear^.Y - _2 - HHGear^.dY * 10 + hwAbs(HHGear^.dY) * 2, |
984 | 1775 |
HHGear^.dX, |
1776 |
HHGear^.dY, |
|
1777 |
20 + cHHRadius * 2, |
|
1200 | 1778 |
cHHRadius * 2 + 6); |
2376 | 1779 |
|
984 | 1780 |
upd:= 0 |
1781 |
end; |
|
1782 |
||
1783 |
if Gear^.Health < Gear^.Damage then |
|
1784 |
begin |
|
1785 |
doMakeExplosion(hwRound(Gear^.X), hwRound(Gear^.Y), 30, EXPLAutoSound); |
|
1786 |
AfterAttack; |
|
1787 |
DeleteGear(Gear); |
|
1788 |
DeleteGear(HHGear); |
|
1789 |
end else |
|
1790 |
begin |
|
1791 |
dec(Gear^.Health, Gear^.Damage); |
|
1792 |
Gear^.Damage:= 0 |
|
1793 |
end |
|
1794 |
end; |
|
1795 |
||
987 | 1796 |
procedure doStepKamikazeIdle(Gear: PGear); |
1797 |
begin |
|
1798 |
AllInactive:= false; |
|
1799 |
dec(Gear^.Timer); |
|
1800 |
if Gear^.Timer = 0 then |
|
1801 |
begin |
|
1802 |
Gear^.Pos:= 1; |
|
1669 | 1803 |
PlaySound(sndKamikaze, false, PHedgehog(Gear^.Hedgehog)^.Team^.voicepack); |
987 | 1804 |
Gear^.doStep:= @doStepKamikazeWork |
1805 |
end |
|
1806 |
end; |
|
1807 |
||
984 | 1808 |
procedure doStepKamikaze(Gear: PGear); |
1809 |
var HHGear: PGear; |
|
1810 |
begin |
|
1811 |
AllInactive:= false; |
|
1812 |
||
1813 |
HHGear:= PHedgehog(Gear^.Hedgehog)^.Gear; |
|
1814 |
||
1815 |
HHGear^.dX:= Gear^.dX; |
|
1816 |
HHGear^.dY:= Gear^.dY; |
|
1817 |
||
1818 |
Gear^.dX:= SignAs(_0_45, Gear^.dX); |
|
1819 |
Gear^.dY:= - _0_9; |
|
1820 |
||
987 | 1821 |
Gear^.Timer:= 550; |
1822 |
||
1823 |
Gear^.doStep:= @doStepKamikazeIdle |
|
984 | 1824 |
end; |
1825 |
||
1103 | 1826 |
//////////////////////////////////////////////////////////////////////////////// |
1827 |
const cakeh = 27; |
|
1110 | 1828 |
cakeDmg = 75; |
1103 | 1829 |
var CakePoints: array[0..Pred(cakeh)] of record x, y: hwFloat; end; |
1830 |
CakeI: Longword; |
|
1831 |
||
1110 | 1832 |
procedure doStepCakeExpl(Gear: PGear); |
1833 |
begin |
|
2141 | 1834 |
AllInactive:= false; |
1835 |
||
1110 | 1836 |
inc(Gear^.Tag); |
1837 |
if Gear^.Tag < 2250 then exit; |
|
1838 |
||
1839 |
doMakeExplosion(hwRound(Gear^.X), hwRound(Gear^.Y), cakeDmg, EXPLAutoSound); |
|
1840 |
AfterAttack; |
|
1841 |
DeleteGear(Gear) |
|
1842 |
end; |
|
1843 |
||
1109 | 1844 |
procedure doStepCakeDown(Gear: PGear); |
1133 | 1845 |
var gi: PGear; |
1846 |
dmg: LongInt; |
|
1109 | 1847 |
begin |
1848 |
AllInactive:= false; |
|
1849 |
||
1850 |
inc(Gear^.Tag); |
|
1851 |
if Gear^.Tag < 100 then exit; |
|
1852 |
Gear^.Tag:= 0; |
|
1853 |
||
1854 |
if Gear^.Pos = 0 then |
|
1855 |
begin |
|
1110 | 1856 |
gi:= GearsList; |
1857 |
while gi <> nil do |
|
1858 |
begin |
|
1859 |
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
|
1860 |
if (dmg > 1) and (gi^.Kind = gtHedgehog) then |
ebc6dfca60d4
- nemo's patch: some animations, zero probability for infinite weapons
unc0rr
parents:
1861
diff
changeset
|
1861 |
if (CurrentHedgehog^.Gear = gi) and (not gi^.Invulnerable) then |
1867 | 1862 |
gi^.State:= gi^.State or gstLoser |
1865
ebc6dfca60d4
- nemo's patch: some animations, zero probability for infinite weapons
unc0rr
parents:
1861
diff
changeset
|
1863 |
else |
ebc6dfca60d4
- nemo's patch: some animations, zero probability for infinite weapons
unc0rr
parents:
1861
diff
changeset
|
1864 |
gi^.State:= gi^.State or gstWinner; |
1110 | 1865 |
gi:= gi^.NextGear |
1866 |
end; |
|
1867 |
Gear^.doStep:= @doStepCakeExpl; |
|
1669 | 1868 |
PlaySound(sndCake, false, nil) |
1109 | 1869 |
end else dec(Gear^.Pos) |
1870 |
end; |
|
1871 |
||
1872 |
||
1089 | 1873 |
procedure doStepCakeWork(Gear: PGear); |
1874 |
const dirs: array[0..3] of TPoint = ((x: 0; y: -1), (x: 1; y: 0),(x: 0; y: 1),(x: -1; y: 0)); |
|
1875 |
var xx, yy, xxn, yyn: LongInt; |
|
1876 |
da: LongInt; |
|
1103 | 1877 |
tdx, tdy: hwFloat; |
1089 | 1878 |
|
1879 |
procedure PrevAngle; |
|
1880 |
begin |
|
1133 | 1881 |
Gear^.Angle:= (LongInt(Gear^.Angle) + 4 - dA) mod 4 |
1089 | 1882 |
end; |
2376 | 1883 |
|
1089 | 1884 |
procedure NextAngle; |
1885 |
begin |
|
1133 | 1886 |
Gear^.Angle:= (LongInt(Gear^.Angle) + 4 + dA) mod 4 |
1089 | 1887 |
end; |
2376 | 1888 |
|
1088 | 1889 |
begin |
2141 | 1890 |
AllInactive:= false; |
1891 |
||
1089 | 1892 |
inc(Gear^.Tag); |
1108 | 1893 |
if Gear^.Tag < 7 then exit; |
1089 | 1894 |
|
1895 |
dA:= hwSign(Gear^.dX); |
|
1896 |
xx:= dirs[Gear^.Angle].x; |
|
1897 |
yy:= dirs[Gear^.Angle].y; |
|
1133 | 1898 |
xxn:= dirs[(LongInt(Gear^.Angle) + 4 + dA) mod 4].x; |
1899 |
yyn:= dirs[(LongInt(Gear^.Angle) + 4 + dA) mod 4].y; |
|
1089 | 1900 |
|
1901 |
if (xx = 0) then |
|
1902 |
if TestCollisionYwithGear(Gear, yy) then |
|
1903 |
PrevAngle |
|
1904 |
else begin |
|
1905 |
Gear^.Tag:= 0; |
|
1906 |
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
|
1907 |
if not TestCollisionXwithGear(Gear, xxn) then |
cc5976f292f9
Cake makes a step after turn. This fixes cake stucking in air
unc0rr
parents:
1634
diff
changeset
|
1908 |
begin |
cc5976f292f9
Cake makes a step after turn. This fixes cake stucking in air
unc0rr
parents:
1634
diff
changeset
|
1909 |
Gear^.X:= Gear^.X + int2hwFloat(xxn); |
cc5976f292f9
Cake makes a step after turn. This fixes cake stucking in air
unc0rr
parents:
1634
diff
changeset
|
1910 |
NextAngle |
cc5976f292f9
Cake makes a step after turn. This fixes cake stucking in air
unc0rr
parents:
1634
diff
changeset
|
1911 |
end; |
1089 | 1912 |
end; |
1913 |
||
1914 |
if (yy = 0) then |
|
1915 |
if TestCollisionXwithGear(Gear, xx) then |
|
1916 |
PrevAngle |
|
1917 |
else begin |
|
1918 |
Gear^.Tag:= 0; |
|
1919 |
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
|
1920 |
if not TestCollisionYwithGear(Gear, yyn) then |
cc5976f292f9
Cake makes a step after turn. This fixes cake stucking in air
unc0rr
parents:
1634
diff
changeset
|
1921 |
begin |
cc5976f292f9
Cake makes a step after turn. This fixes cake stucking in air
unc0rr
parents:
1634
diff
changeset
|
1922 |
Gear^.Y:= Gear^.Y + int2hwFloat(yyn); |
cc5976f292f9
Cake makes a step after turn. This fixes cake stucking in air
unc0rr
parents:
1634
diff
changeset
|
1923 |
NextAngle |
cc5976f292f9
Cake makes a step after turn. This fixes cake stucking in air
unc0rr
parents:
1634
diff
changeset
|
1924 |
end; |
1089 | 1925 |
end; |
1926 |
||
1103 | 1927 |
if Gear^.Tag = 0 then |
1928 |
begin |
|
1929 |
CakeI:= (CakeI + 1) mod cakeh; |
|
1930 |
tdx:= CakePoints[CakeI].x - Gear^.X; |
|
1931 |
tdy:= - CakePoints[CakeI].y + Gear^.Y; |
|
1932 |
CakePoints[CakeI].x:= Gear^.X; |
|
1933 |
CakePoints[CakeI].y:= Gear^.Y; |
|
1934 |
Gear^.DirAngle:= DxDy2Angle(tdx, tdy); |
|
1935 |
end; |
|
1936 |
||
1089 | 1937 |
dec(Gear^.Health); |
2208
7d1a084d11ab
disable timers on a few silly items, trying out a timer on cake
nemo
parents:
2204
diff
changeset
|
1938 |
Gear^.Timer:= Gear^.Health*10; // This is not seconds, but at least it is *some* feedback |
1090 | 1939 |
if (Gear^.Health = 0) or ((Gear^.Message and gm_Attack) <> 0) then |
1089 | 1940 |
begin |
1109 | 1941 |
FollowGear:= Gear; |
2358 | 1942 |
Gear^.RenderTimer:= false; |
1109 | 1943 |
Gear^.doStep:= @doStepCakeDown |
1089 | 1944 |
end |
1088 | 1945 |
end; |
1089 | 1946 |
|
1103 | 1947 |
procedure doStepCakeUp(Gear: PGear); |
1948 |
var i: Longword; |
|
1949 |
begin |
|
1950 |
AllInactive:= false; |
|
1951 |
||
1108 | 1952 |
inc(Gear^.Tag); |
1109 | 1953 |
if Gear^.Tag < 100 then exit; |
1108 | 1954 |
Gear^.Tag:= 0; |
1955 |
||
1109 | 1956 |
if Gear^.Pos = 6 then |
1103 | 1957 |
begin |
1958 |
for i:= 0 to Pred(cakeh) do |
|
1959 |
begin |
|
1960 |
CakePoints[i].x:= Gear^.X; |
|
1961 |
CakePoints[i].y:= Gear^.Y |
|
1962 |
end; |
|
1963 |
CakeI:= 0; |
|
1964 |
Gear^.doStep:= @doStepCakeWork |
|
1109 | 1965 |
end else inc(Gear^.Pos) |
1103 | 1966 |
end; |
1967 |
||
1089 | 1968 |
procedure doStepCakeFall(Gear: PGear); |
1969 |
begin |
|
1970 |
AllInactive:= false; |
|
1971 |
||
1972 |
Gear^.dY:= Gear^.dY + cGravity; |
|
1973 |
if TestCollisionYwithGear(Gear, 1) then |
|
1103 | 1974 |
Gear^.doStep:= @doStepCakeUp |
1089 | 1975 |
else |
1976 |
begin |
|
1977 |
Gear^.Y:= Gear^.Y + Gear^.dY; |
|
1978 |
if CheckGearDrowning(Gear) then AfterAttack |
|
1979 |
end |
|
1980 |
end; |
|
1981 |
||
1982 |
procedure doStepCake(Gear: PGear); |
|
1983 |
var HHGear: PGear; |
|
1984 |
begin |
|
1985 |
AllInactive:= false; |
|
1986 |
||
1987 |
HHGear:= PHedgehog(Gear^.Hedgehog)^.Gear; |
|
1103 | 1988 |
HHGear^.Message:= HHGear^.Message and (not gm_Attack); |
1089 | 1989 |
DeleteCI(HHGear); |
1990 |
||
1106 | 1991 |
FollowGear:= Gear; |
1992 |
||
1089 | 1993 |
Gear^.doStep:= @doStepCakeFall |
1994 |
end; |
|
1995 |
||
1259 | 1996 |
//////////////////////////////////////////////////////////////////////////////// |
1284 | 1997 |
procedure doStepSeductionWork(Gear: PGear); |
1998 |
var x, y: LongInt; |
|
1259 | 1999 |
begin |
2000 |
AllInactive:= false; |
|
1284 | 2001 |
|
2002 |
Gear^.X:= Gear^.X + Gear^.dX; |
|
2003 |
Gear^.Y:= Gear^.Y + Gear^.dY; |
|
2004 |
x:= hwRound(Gear^.X); |
|
2005 |
y:= hwRound(Gear^.Y); |
|
1259 | 2006 |
|
1753 | 2007 |
if ((y and LAND_HEIGHT_MASK) = 0) and ((x and LAND_WIDTH_MASK) = 0) then |
1284 | 2008 |
if (Land[y, x] <> 0) then |
2009 |
begin |
|
2010 |
Gear^.dX.isNegative:= not Gear^.dX.isNegative; |
|
2011 |
Gear^.dY.isNegative:= not Gear^.dY.isNegative; |
|
1286 | 2012 |
Gear^.dX:= Gear^.dX * _1_5; |
2013 |
Gear^.dY:= Gear^.dY * _1_5 - _0_3; |
|
1284 | 2014 |
AmmoShove(Gear, 0, 40); |
1286 | 2015 |
AfterAttack; |
1284 | 2016 |
DeleteGear(Gear) |
2017 |
end |
|
2018 |
else |
|
2019 |
else |
|
1286 | 2020 |
begin |
2021 |
AfterAttack; |
|
1284 | 2022 |
DeleteGear(Gear) |
1286 | 2023 |
end |
2024 |
end; |
|
2025 |
||
2026 |
procedure doStepSeductionWear(Gear: PGear); |
|
2027 |
begin |
|
2028 |
AllInactive:= false; |
|
2029 |
inc(Gear^.Timer); |
|
2030 |
if Gear^.Timer > 250 then |
|
2031 |
begin |
|
2032 |
Gear^.Timer:= 0; |
|
1388 | 2033 |
inc(Gear^.Pos); |
2034 |
if Gear^.Pos = 5 then |
|
1669 | 2035 |
PlaySound(sndYoohoo, false, PHedgehog(Gear^.Hedgehog)^.Team^.voicepack) |
1286 | 2036 |
end; |
1367 | 2037 |
|
2038 |
if Gear^.Pos = 14 then |
|
1286 | 2039 |
Gear^.doStep:= @doStepSeductionWork |
1259 | 2040 |
end; |
1284 | 2041 |
|
2042 |
procedure doStepSeduction(Gear: PGear); |
|
2043 |
begin |
|
2044 |
AllInactive:= false; |
|
2045 |
DeleteCI(PHedgehog(Gear^.Hedgehog)^.Gear); |
|
1286 | 2046 |
Gear^.doStep:= @doStepSeductionWear |
1284 | 2047 |
end; |
1298 | 2048 |
|
2049 |
//////////////////////////////////////////////////////////////////////////////// |
|
2050 |
procedure doStepWaterUp(Gear: PGear); |
|
2051 |
var i: LongWord; |
|
2052 |
begin |
|
2053 |
AllInactive:= false; |
|
2054 |
||
2055 |
inc(Gear^.Timer); |
|
2056 |
if Gear^.Timer = 17 then |
|
2057 |
Gear^.Timer:= 0 |
|
2058 |
else |
|
2059 |
exit; |
|
2060 |
||
2061 |
if cWaterLine > 0 then |
|
2062 |
begin |
|
2063 |
dec(cWaterLine); |
|
1760 | 2064 |
for i:= 0 to LAND_WIDTH - 1 do |
1298 | 2065 |
Land[cWaterLine, i]:= 0; |
2066 |
SetAllToActive |
|
2067 |
end; |
|
2068 |
||
2069 |
inc(Gear^.Tag); |
|
1343 | 2070 |
if (Gear^.Tag = 47) or (cWaterLine = 0) then |
1298 | 2071 |
DeleteGear(Gear) |
2072 |
end; |
|
1573 | 2073 |
|
2074 |
//////////////////////////////////////////////////////////////////////////////// |
|
1590 | 2075 |
procedure doStepDrillDrilling(Gear: PGear); |
1633 | 2076 |
var t: PGearArray; |
2077 |
ox, oy: hwFloat; |
|
1573 | 2078 |
begin |
1590 | 2079 |
AllInactive:= false; |
2080 |
||
1633 | 2081 |
if (Gear^.Timer > 0) and ((Gear^.Timer mod 10) = 0) then |
1590 | 2082 |
begin |
1573 | 2083 |
ox:= Gear^.X; |
2084 |
oy:= Gear^.Y; |
|
2085 |
Gear^.X:= Gear^.X + Gear^.dX; |
|
2086 |
Gear^.Y:= Gear^.Y + Gear^.dY; |
|
2087 |
DrawTunnel(oX, oY, Gear^.dX, Gear^.dY, 2, 6); |
|
2088 |
CheckGearDrowning(Gear); |
|
1590 | 2089 |
end; |
2090 |
||
1633 | 2091 |
t:= CheckGearsCollision(Gear); //fixes drill not exploding when touching HH bug |
1590 | 2092 |
if (Gear^.Timer = 0) |
1633 | 2093 |
or (t^.Count <> 0) |
1590 | 2094 |
or (not TestCollisionYWithGear(Gear, hwSign(Gear^.dY)) |
1784 | 2095 |
and not TestCollisionXWithGear(Gear, hwSign(Gear^.dX))) |
2096 |
or (Land[hwRound(Gear^.Y), hwRound(Gear^.X)] = COLOR_INDESTRUCTIBLE) then |
|
1590 | 2097 |
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
|
2098 |
StopSound(sndPickhammer); |
1590 | 2099 |
doMakeExplosion(hwRound(Gear^.X), hwRound(Gear^.Y), 50, EXPLAutoSound); |
2100 |
DeleteGear(Gear); |
|
2101 |
exit |
|
2102 |
end; |
|
2103 |
||
2104 |
dec(Gear^.Timer); |
|
1573 | 2105 |
end; |
2106 |
||
2107 |
procedure doStepDrill(Gear: PGear); |
|
1590 | 2108 |
var t: PGearArray; |
1633 | 2109 |
oldDx, oldDy: hwFloat; |
2110 |
t2: hwFloat; |
|
1573 | 2111 |
begin |
1590 | 2112 |
AllInactive:= false; |
1573 | 2113 |
|
1590 | 2114 |
Gear^.dX:= Gear^.dX + cWindSpeed; |
2115 |
oldDx:= Gear^.dX; |
|
2116 |
oldDy:= Gear^.dY; |
|
2117 |
||
2118 |
doStepFallingGear(Gear); |
|
2119 |
||
2120 |
if (GameTicks and $3F) = 0 then |
|
2121 |
AddGear(hwRound(Gear^.X), hwRound(Gear^.Y), gtSmokeTrace, 0, _0, _0, 0); |
|
1573 | 2122 |
|
1633 | 2123 |
if ((Gear^.State and gstCollision) <> 0) then begin //hit |
1590 | 2124 |
Gear^.dX:= oldDx; |
2125 |
Gear^.dY:= oldDy; |
|
1633 | 2126 |
|
1590 | 2127 |
t:= CheckGearsCollision(Gear); |
1633 | 2128 |
if (t^.Count = 0) then begin //hit the ground not the HH |
2129 |
t2 := _0_5 / Distance(Gear^.dX, Gear^.dY); |
|
2130 |
Gear^.dX:= Gear^.dX * t2; |
|
2131 |
Gear^.dY:= Gear^.dY * t2; |
|
2132 |
end else begin //explode right on contact with HH |
|
2133 |
doMakeExplosion(hwRound(Gear^.X), hwRound(Gear^.Y), 50, EXPLAutoSound); |
|
2134 |
DeleteGear(Gear); |
|
2135 |
exit; |
|
2136 |
end; |
|
2376 | 2137 |
|
2462
fa3ddd1ff2a1
Suggestion by Smaxx - use pickhammer sound while drill is in operation
nemo
parents:
2460
diff
changeset
|
2138 |
PlaySound(sndPickhammer, true, nil); |
1590 | 2139 |
Gear^.doStep:= @doStepDrillDrilling; |
1633 | 2140 |
dec(Gear^.Timer) |
1590 | 2141 |
end |
2142 |
end; |
|
1601 | 2143 |
|
1633 | 2144 |
//////////////////////////////////////////////////////////////////////////////// |
1601 | 2145 |
procedure doStepBallgunWork(Gear: PGear); |
2146 |
var HHGear: PGear; |
|
1630 | 2147 |
rx, ry: hwFloat; |
1601 | 2148 |
begin |
2149 |
AllInactive:= false; |
|
2150 |
dec(Gear^.Timer); |
|
2151 |
HHGear:= PHedgehog(Gear^.Hedgehog)^.Gear; |
|
2152 |
HedgehogChAngle(HHGear); |
|
2153 |
if (Gear^.Timer mod 100) = 0 then |
|
2154 |
begin |
|
1630 | 2155 |
rx:= rndSign(getRandom * _0_1); |
2156 |
ry:= rndSign(getRandom * _0_1); |
|
2376 | 2157 |
|
1630 | 2158 |
AddGear(hwRound(Gear^.X), hwRound(Gear^.Y), gtBall, 0, |
2159 |
SignAs(AngleSin(HHGear^.Angle) * _0_8, HHGear^.dX) + rx, |
|
2160 |
AngleCos(HHGear^.Angle) * ( - _0_8) + ry, |
|
2161 |
0); |
|
2376 | 2162 |
|
1669 | 2163 |
PlaySound(sndGun, false, nil); |
1601 | 2164 |
end; |
2165 |
||
1643 | 2166 |
if (Gear^.Timer = 0) or (HHGear^.Damage <> 0) then |
1601 | 2167 |
begin |
2168 |
DeleteGear(Gear); |
|
1643 | 2169 |
AfterAttack |
2170 |
end |
|
1601 | 2171 |
end; |
2172 |
||
2173 |
procedure doStepBallgun(Gear: PGear); |
|
2174 |
var HHGear: PGear; |
|
2175 |
begin |
|
2176 |
HHGear:= PHedgehog(Gear^.Hedgehog)^.Gear; |
|
2177 |
HHGear^.Message:= HHGear^.Message and not (gm_Up or gm_Down); |
|
2178 |
HHGear^.State:= HHGear^.State or gstNotKickable; |
|
2179 |
Gear^.doStep:= @doStepBallgunWork |
|
1633 | 2180 |
end; |
1689 | 2181 |
|
1696 | 2182 |
//////////////////////////////////////////////////////////////////////////////// |
1689 | 2183 |
procedure doStepRCPlaneWork(Gear: PGear); |
2184 |
const cAngleSpeed = 3; |
|
2185 |
var HHGear: PGear; |
|
2186 |
i: LongInt; |
|
2187 |
dX, dY: hwFloat; |
|
2188 |
fChanged: boolean; |
|
2189 |
trueAngle: Longword; |
|
2190 |
t: PGear; |
|
2191 |
begin |
|
2192 |
AllInactive:= false; |
|
2193 |
||
2428 | 2194 |
if ((TrainingFlags and tfRCPlane) = 0) and (Gear^.Timer > 0) then dec(Gear^.Timer); |
2195 |
||
2196 |
if ((TrainingFlags and tfRCPlane) <> 0) and ((TrainingFlags and tfTimeTrial) <> 0 ) and (TimeTrialStartTime = 0) then TimeTrialStartTime:= RealTicks; |
|
1689 | 2197 |
|
2198 |
HHGear:= PHedgehog(Gear^.Hedgehog)^.Gear; |
|
2199 |
FollowGear:= Gear; |
|
2200 |
||
2201 |
fChanged:= false; |
|
1696 | 2202 |
if ((HHGear^.State and gstHHDriven) = 0) or (Gear^.Timer = 0) then |
1689 | 2203 |
begin |
2204 |
fChanged:= true; |
|
1696 | 2205 |
if Gear^.Angle > 2048 then dec(Gear^.Angle) else |
2206 |
if Gear^.Angle < 2048 then inc(Gear^.Angle) else fChanged:= false |
|
2207 |
end |
|
2208 |
else |
|
2209 |
begin |
|
2210 |
if ((Gear^.Message and gm_Left) <> 0) then |
|
2211 |
begin |
|
2212 |
fChanged:= true; |
|
2213 |
Gear^.Angle:= (Gear^.Angle + (4096 - cAngleSpeed)) mod 4096 |
|
2214 |
end; |
|
1689 | 2215 |
|
1696 | 2216 |
if ((Gear^.Message and gm_Right) <> 0) then |
2217 |
begin |
|
2218 |
fChanged:= true; |
|
2219 |
Gear^.Angle:= (Gear^.Angle + cAngleSpeed) mod 4096 |
|
2220 |
end |
|
1689 | 2221 |
end; |
2222 |
||
2223 |
if fChanged then |
|
2224 |
begin |
|
2225 |
Gear^.dX.isNegative:= (Gear^.Angle > 2048); |
|
2226 |
if Gear^.dX.isNegative then |
|
2227 |
trueAngle:= 4096 - Gear^.Angle |
|
2228 |
else |
|
2229 |
trueAngle:= Gear^.Angle; |
|
2230 |
||
2231 |
Gear^.dX:= SignAs(AngleSin(trueAngle), Gear^.dX) * _0_25; |
|
2232 |
Gear^.dY:= AngleCos(trueAngle) * -_0_25; |
|
2233 |
end; |
|
2234 |
||
2235 |
Gear^.X:= Gear^.X + Gear^.dX; |
|
2236 |
Gear^.Y:= Gear^.Y + Gear^.dY; |
|
2237 |
||
2428 | 2238 |
if (TrainingFlags and tfRCPlane) = 0 then |
2239 |
begin |
|
2240 |
if (GameTicks and $FF) = 0 then |
|
2241 |
if Gear^.Timer < 3500 then |
|
2242 |
AddGear(hwRound(Gear^.X), hwRound(Gear^.Y), gtEvilTrace, 0, _0, _0, 0) |
|
2243 |
else |
|
2244 |
AddGear(hwRound(Gear^.X), hwRound(Gear^.Y), gtSmokeTrace, 0, _0, _0, 0); |
|
2245 |
||
2246 |
if ((HHGear^.Message and gm_Attack) <> 0) and (Gear^.Health <> 0) then |
|
2247 |
begin |
|
2248 |
HHGear^.Message := HHGear^.Message and not gm_Attack; |
|
2249 |
AddGear(hwRound(Gear^.X), hwRound(Gear^.Y), gtAirBomb, 0, Gear^.dX * _0_5, Gear^.dY * _0_5, 0); |
|
2250 |
dec(Gear^.Health) |
|
2251 |
end; |
|
2252 |
||
2253 |
if ((HHGear^.Message and gm_LJump) <> 0) |
|
2254 |
and ((Gear^.State and gsttmpFlag) = 0) then |
|
2255 |
begin |
|
2256 |
Gear^.State:= Gear^.State or gsttmpFlag; |
|
2257 |
PauseMusic; |
|
2258 |
playSound(sndRideOfTheValkyries, false, nil); |
|
2259 |
end; |
|
2260 |
||
2261 |
// pickup bonuses |
|
2262 |
t:= CheckGearNear(Gear, gtCase, 36, 36); |
|
2263 |
if t <> nil then |
|
2264 |
PickUp(HHGear, t); |
|
2265 |
end |
|
2266 |
else |
|
2267 |
begin |
|
2268 |
if (GameTicks and $FF) = 0 then |
|
1696 | 2269 |
AddGear(hwRound(Gear^.X), hwRound(Gear^.Y), gtSmokeTrace, 0, _0, _0, 0); |
1689 | 2270 |
|
2428 | 2271 |
// pickup targets |
2272 |
t:= CheckGearNear(Gear, gtTarget, 36, 36); |
|
2273 |
if t <> nil then |
|
2460 | 2274 |
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
|
2275 |
if t^.Tag <> 0 then // collect it only once |
2460 | 2276 |
exit; |
2277 |
PlaySound(sndShotgunReload, false, nil); |
|
2278 |
t^.Tag:= 1; |
|
2279 |
TrainingTargetGear:= nil; // remove target cursor |
|
2280 |
exit; |
|
2428 | 2281 |
end; |
1712 | 2282 |
|
2428 | 2283 |
if (TurnTimeLeft > 0) then |
2284 |
dec(TurnTimeLeft) |
|
2285 |
end; |
|
2286 |
||
1689 | 2287 |
CheckCollision(Gear); |
2288 |
||
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
|
2289 |
if ((Gear^.State and gstCollision) <> 0) or (((TrainingFlags and tfRCPlane) <> 0) and (TurnTimeLeft = 0)) |
1712 | 2290 |
or CheckGearDrowning(Gear) then |
1689 | 2291 |
begin |
2428 | 2292 |
if ((TrainingFlags and tfRCPlane) <> 0) and ((TrainingFlags and tfTimeTrial) <> 0 ) and (TimeTrialStopTime = 0) then TimeTrialStopTime:= RealTicks; |
1712 | 2293 |
StopSound(sndRCPlane); |
2294 |
StopSound(sndRideOfTheValkyries); |
|
2295 |
ResumeMusic; |
|
2376 | 2296 |
|
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
|
2297 |
if ((Gear^.State and gstCollision) <> 0) or (((TrainingFlags and tfRCPlane) <> 0) and (TurnTimeLeft = 0)) then |
1689 | 2298 |
begin |
1712 | 2299 |
doMakeExplosion(hwRound(Gear^.X), hwRound(Gear^.Y), 25, EXPLAutoSound); |
1714 | 2300 |
for i:= 0 to 32 do |
1712 | 2301 |
begin |
1714 | 2302 |
dX:= AngleCos(i * 64) * _0_5 * (GetRandom + _1); |
2303 |
dY:= AngleSin(i * 64) * _0_5 * (GetRandom + _1); |
|
1712 | 2304 |
AddGear(hwRound(Gear^.X), hwRound(Gear^.Y), gtFlame, 0, dX, dY, 0); |
2305 |
AddGear(hwRound(Gear^.X), hwRound(Gear^.Y), gtFlame, 0, dX, -dY, 0); |
|
2306 |
end; |
|
2307 |
DeleteGear(Gear) |
|
1689 | 2308 |
end; |
1713 | 2309 |
|
1689 | 2310 |
AfterAttack; |
1713 | 2311 |
CurAmmoGear:= nil; |
1697 | 2312 |
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
|
2313 |
|
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
|
2314 |
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
|
2315 |
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
|
2316 |
|
1712 | 2317 |
HHGear^.Message:= 0; |
1697 | 2318 |
ParseCommand('/taunt '#1, true) |
2319 |
end |
|
1689 | 2320 |
end; |
2321 |
||
2322 |
procedure doStepRCPlane(Gear: PGear); |
|
2323 |
var HHGear: PGear; |
|
2324 |
begin |
|
2325 |
HHGear:= PHedgehog(Gear^.Hedgehog)^.Gear; |
|
2326 |
HHGear^.Message:= 0; |
|
2327 |
HHGear^.State:= HHGear^.State or gstNotKickable; |
|
2328 |
Gear^.Angle:= HHGear^.Angle; |
|
1696 | 2329 |
Gear^.Tag:= hwSign(HHGear^.dX); |
1689 | 2330 |
if HHGear^.dX.isNegative then Gear^.Angle:= 4096 - Gear^.Angle; |
2331 |
Gear^.doStep:= @doStepRCPlaneWork |
|
1712 | 2332 |
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
|
2333 |
|
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 |
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
|
2335 |
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
|
2336 |
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
|
2337 |
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
|
2338 |
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
|
2339 |
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
|
2340 |
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
|
2341 |
//dec(Gear^.Timer); |
2440 | 2342 |
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
|
2343 |
fuel:= 50; |
2182
ed7e7eb3f9ed
Ugly graphic for jetpack - jetpack should be essentially functional.
nemo
parents:
2181
diff
changeset
|
2344 |
(*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
|
2345 |
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
|
2346 |
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
|
2347 |
fuel:= 5; |
2182
ed7e7eb3f9ed
Ugly graphic for jetpack - jetpack should be essentially functional.
nemo
parents:
2181
diff
changeset
|
2348 |
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
|
2349 |
|
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
|
2350 |
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
|
2351 |
begin |
2433 | 2352 |
if (not HHGear^.dY.isNegative) or (HHGear^.Y > -_256) then |
2353 |
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
|
2354 |
HHGear^.dY:= HHGear^.dY - move; |
2182
ed7e7eb3f9ed
Ugly graphic for jetpack - jetpack should be essentially functional.
nemo
parents:
2181
diff
changeset
|
2355 |
dec(Gear^.Health, fuel); |
ed7e7eb3f9ed
Ugly graphic for jetpack - jetpack should be essentially functional.
nemo
parents:
2181
diff
changeset
|
2356 |
Gear^.MsgParam:= Gear^.MsgParam or gm_Up; |
ed7e7eb3f9ed
Ugly graphic for jetpack - jetpack should be essentially functional.
nemo
parents:
2181
diff
changeset
|
2357 |
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
|
2358 |
end; |
2187
66c0f9b3bd6f
set vector to negative *after* applying upward vector
nemo
parents:
2186
diff
changeset
|
2359 |
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
|
2360 |
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
|
2361 |
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
|
2362 |
HHGear^.dX:= HHGear^.dX + (move * _0_2); |
2182
ed7e7eb3f9ed
Ugly graphic for jetpack - jetpack should be essentially functional.
nemo
parents:
2181
diff
changeset
|
2363 |
dec(Gear^.Health, fuel div 5); |
ed7e7eb3f9ed
Ugly graphic for jetpack - jetpack should be essentially functional.
nemo
parents:
2181
diff
changeset
|
2364 |
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
|
2365 |
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
|
2366 |
end; |
2182
ed7e7eb3f9ed
Ugly graphic for jetpack - jetpack should be essentially functional.
nemo
parents:
2181
diff
changeset
|
2367 |
|
2376 | 2368 |
// erases them all at once :-/ |
2182
ed7e7eb3f9ed
Ugly graphic for jetpack - jetpack should be essentially functional.
nemo
parents:
2181
diff
changeset
|
2369 |
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
|
2370 |
begin |
ed7e7eb3f9ed
Ugly graphic for jetpack - jetpack should be essentially functional.
nemo
parents:
2181
diff
changeset
|
2371 |
Gear^.Timer:= 0; |
ed7e7eb3f9ed
Ugly graphic for jetpack - jetpack should be essentially functional.
nemo
parents:
2181
diff
changeset
|
2372 |
Gear^.MsgParam:= 0 |
ed7e7eb3f9ed
Ugly graphic for jetpack - jetpack should be essentially functional.
nemo
parents:
2181
diff
changeset
|
2373 |
end; |
ed7e7eb3f9ed
Ugly graphic for jetpack - jetpack should be essentially functional.
nemo
parents:
2181
diff
changeset
|
2374 |
|
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
|
2375 |
if Gear^.Health < 0 then Gear^.Health:= 0; |
2376 | 2376 |
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
|
2377 |
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
|
2378 |
//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
|
2379 |
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
|
2380 |
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
|
2381 |
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
|
2382 |
|
2278
28519f4f3f21
requested change by Tiy to Flying Saucer start (hover until first keypress)
nemo
parents:
2267
diff
changeset
|
2383 |
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
|
2384 |
HHGear^.Message:= HHGear^.Message and not (gm_Up or gm_Precise or gm_Left or gm_Right); |
2376 | 2385 |
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
|
2386 |
|
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
|
2387 |
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
|
2388 |
Gear^.Y:= HHGear^.Y; |
2196 | 2389 |
// 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
|
2390 |
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
|
2391 |
|
28519f4f3f21
requested change by Tiy to Flying Saucer start (hover until first keypress)
nemo
parents:
2267
diff
changeset
|
2392 |
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
|
2393 |
|
2179 | 2394 |
if (Gear^.Health = 0) |
2180
6c5a339f8e28
Use different group to not erase messages, restore gear deletion on hog damage.
nemo
parents:
2179
diff
changeset
|
2395 |
or (HHGear^.Damage <> 0) |
2179 | 2396 |
or CheckGearDrowning(HHGear) |
2376 | 2397 |
or (TurnTimeLeft = 0) |
2189 | 2398 |
// allow brief ground touches - to be fair on this, might need another counter |
2190 | 2399 |
or (((GameTicks and $1FF) = 0) and (not HHGear^.dY.isNegative) and TestCollisionYwithGear(HHGear, 1)) |
2179 | 2400 |
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
|
2401 |
begin |
2179 | 2402 |
with HHGear^ do |
2403 |
begin |
|
2404 |
Message:= 0; |
|
2405 |
Active:= true; |
|
2406 |
State:= State or gstMoving |
|
2407 |
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
|
2408 |
DeleteGear(Gear); |
2179 | 2409 |
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
|
2410 |
// 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
|
2411 |
// 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
|
2412 |
//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
|
2413 |
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
|
2414 |
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
|
2415 |
|
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 |
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
|
2417 |
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
|
2418 |
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
|
2419 |
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
|
2420 |
|
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
|
2421 |
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
|
2422 |
FollowGear:= HHGear; |
2179 | 2423 |
OnUsedAmmo(PHedgehog(HHGear^.Hedgehog)^); |
2424 |
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
|
2425 |
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
|
2426 |
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
|
2427 |
State:= State and not gstAttacking; |
2278
28519f4f3f21
requested change by Tiy to Flying Saucer start (hover until first keypress)
nemo
parents:
2267
diff
changeset
|
2428 |
Message:= Message and not (gm_Attack or gm_Up or gm_Precise or gm_Left or gm_Right); |
2301 | 2429 |
if (dY < _0_1) and (dY > -_0_1) then |
2430 |
begin |
|
2431 |
Gear^.State:= Gear^.State or gsttmpFlag; |
|
2432 |
dY:= dY - _0_2 |
|
2433 |
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
|
2434 |
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
|
2435 |
end; |