author | nemo |
Sun, 18 Oct 2009 00:58:18 +0000 | |
changeset 2533 | 36801e5e90d1 |
parent 2524 | 0b075d38fee5 |
child 2538 | 661079b00177 |
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; |
2524
0b075d38fee5
Fix bug when rope goes through land when hedgehog is sliding
unc0rr
parents:
2515
diff
changeset
|
994 |
|
351 | 995 |
HHGear:= PHedgehog(Gear^.Hedgehog)^.Gear; |
517 | 996 |
DeleteCI(HHGear); |
2524
0b075d38fee5
Fix bug when rope goes through land when hedgehog is sliding
unc0rr
parents:
2515
diff
changeset
|
997 |
|
542 | 998 |
if (HHGear^.State and gstMoving) <> 0 then |
1433 | 999 |
begin |
2282 | 1000 |
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
|
1001 |
if HHGear^.dY.isNegative and TestCollisionYwithGear(HHGear, -1) then HHGear^.dY:= _0; |
2376 | 1002 |
|
1433 | 1003 |
HHGear^.X:= HHGear^.X + HHGear^.dX; |
1004 |
Gear^.X:= Gear^.X + HHGear^.dX; |
|
2281
3217f0d8c420
Fix hedgehog stopping to slide when throwing rope (not tested)
unc0rr
parents:
2280
diff
changeset
|
1005 |
|
3217f0d8c420
Fix hedgehog stopping to slide when throwing rope (not tested)
unc0rr
parents:
2280
diff
changeset
|
1006 |
if TestCollisionYwithGear(HHGear, 1) then |
3217f0d8c420
Fix hedgehog stopping to slide when throwing rope (not tested)
unc0rr
parents:
2280
diff
changeset
|
1007 |
begin |
3217f0d8c420
Fix hedgehog stopping to slide when throwing rope (not tested)
unc0rr
parents:
2280
diff
changeset
|
1008 |
CheckHHDamage(HHGear); |
3217f0d8c420
Fix hedgehog stopping to slide when throwing rope (not tested)
unc0rr
parents:
2280
diff
changeset
|
1009 |
HHGear^.dY:= _0; |
2339 | 1010 |
//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
|
1011 |
end else |
1433 | 1012 |
begin |
2281
3217f0d8c420
Fix hedgehog stopping to slide when throwing rope (not tested)
unc0rr
parents:
2280
diff
changeset
|
1013 |
HHGear^.Y:= HHGear^.Y + HHGear^.dY; |
3217f0d8c420
Fix hedgehog stopping to slide when throwing rope (not tested)
unc0rr
parents:
2280
diff
changeset
|
1014 |
Gear^.Y:= Gear^.Y + HHGear^.dY; |
3217f0d8c420
Fix hedgehog stopping to slide when throwing rope (not tested)
unc0rr
parents:
2280
diff
changeset
|
1015 |
HHGear^.dY:= HHGear^.dY + cGravity; |
2524
0b075d38fee5
Fix bug when rope goes through land when hedgehog is sliding
unc0rr
parents:
2515
diff
changeset
|
1016 |
end; |
0b075d38fee5
Fix bug when rope goes through land when hedgehog is sliding
unc0rr
parents:
2515
diff
changeset
|
1017 |
|
0b075d38fee5
Fix bug when rope goes through land when hedgehog is sliding
unc0rr
parents:
2515
diff
changeset
|
1018 |
tt:= Gear^.Elasticity; |
0b075d38fee5
Fix bug when rope goes through land when hedgehog is sliding
unc0rr
parents:
2515
diff
changeset
|
1019 |
tx:= _0; |
0b075d38fee5
Fix bug when rope goes through land when hedgehog is sliding
unc0rr
parents:
2515
diff
changeset
|
1020 |
ty:= _0; |
0b075d38fee5
Fix bug when rope goes through land when hedgehog is sliding
unc0rr
parents:
2515
diff
changeset
|
1021 |
while tt > _20 do |
0b075d38fee5
Fix bug when rope goes through land when hedgehog is sliding
unc0rr
parents:
2515
diff
changeset
|
1022 |
begin |
0b075d38fee5
Fix bug when rope goes through land when hedgehog is sliding
unc0rr
parents:
2515
diff
changeset
|
1023 |
if TestCollisionXwithXYShift(Gear, tx, hwRound(ty), -hwSign(Gear^.dX)) |
0b075d38fee5
Fix bug when rope goes through land when hedgehog is sliding
unc0rr
parents:
2515
diff
changeset
|
1024 |
or TestCollisionYwithXYShift(Gear, hwRound(tx), hwRound(ty), -hwSign(Gear^.dY)) then |
1433 | 1025 |
begin |
2524
0b075d38fee5
Fix bug when rope goes through land when hedgehog is sliding
unc0rr
parents:
2515
diff
changeset
|
1026 |
Gear^.X:= Gear^.X + tx; |
0b075d38fee5
Fix bug when rope goes through land when hedgehog is sliding
unc0rr
parents:
2515
diff
changeset
|
1027 |
Gear^.Y:= Gear^.Y + ty; |
0b075d38fee5
Fix bug when rope goes through land when hedgehog is sliding
unc0rr
parents:
2515
diff
changeset
|
1028 |
Gear^.Elasticity:= tt; |
0b075d38fee5
Fix bug when rope goes through land when hedgehog is sliding
unc0rr
parents:
2515
diff
changeset
|
1029 |
Gear^.doStep:= @doStepRopeWork; |
0b075d38fee5
Fix bug when rope goes through land when hedgehog is sliding
unc0rr
parents:
2515
diff
changeset
|
1030 |
with HHGear^ do State:= State and not (gstAttacking or gstHHJumping or gstHHHJump); |
2376 | 1031 |
|
2524
0b075d38fee5
Fix bug when rope goes through land when hedgehog is sliding
unc0rr
parents:
2515
diff
changeset
|
1032 |
RemoveFromAmmo; |
2376 | 1033 |
|
2524
0b075d38fee5
Fix bug when rope goes through land when hedgehog is sliding
unc0rr
parents:
2515
diff
changeset
|
1034 |
tt:= _0; |
0b075d38fee5
Fix bug when rope goes through land when hedgehog is sliding
unc0rr
parents:
2515
diff
changeset
|
1035 |
exit |
1433 | 1036 |
end; |
2524
0b075d38fee5
Fix bug when rope goes through land when hedgehog is sliding
unc0rr
parents:
2515
diff
changeset
|
1037 |
tx:= tx + Gear^.dX + Gear^.dX; |
0b075d38fee5
Fix bug when rope goes through land when hedgehog is sliding
unc0rr
parents:
2515
diff
changeset
|
1038 |
ty:= ty + Gear^.dY + Gear^.dY; |
0b075d38fee5
Fix bug when rope goes through land when hedgehog is sliding
unc0rr
parents:
2515
diff
changeset
|
1039 |
tt:= tt - _2; |
1433 | 1040 |
end; |
1041 |
end; |
|
929
9456e1e77369
- Continue preparation for implementing attack from rope and parachute
unc0rr
parents:
928
diff
changeset
|
1042 |
|
4 | 1043 |
CheckCollision(Gear); |
929
9456e1e77369
- Continue preparation for implementing attack from rope and parachute
unc0rr
parents:
928
diff
changeset
|
1044 |
|
351 | 1045 |
if (Gear^.State and gstCollision) <> 0 then |
2068 | 1046 |
if Gear^.Elasticity < _10 then |
1047 |
Gear^.Elasticity:= _10000 |
|
1048 |
else |
|
1049 |
begin |
|
1050 |
Gear^.doStep:= @doStepRopeWork; |
|
2339 | 1051 |
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
|
1052 |
|
2068 | 1053 |
RemoveFromAmmo; |
2376 | 1054 |
|
2068 | 1055 |
exit |
1056 |
end; |
|
4 | 1057 |
|
1634
486a89f0e843
Fix rope bug which allowed hedgehog to go into land
unc0rr
parents:
1633
diff
changeset
|
1058 |
if (Gear^.Elasticity > Gear^.Friction) |
486a89f0e843
Fix rope bug which allowed hedgehog to go into land
unc0rr
parents:
1633
diff
changeset
|
1059 |
or ((Gear^.Message and gm_Attack) = 0) |
2280 | 1060 |
or ((HHGear^.State and gstHHDriven) = 0) |
1634
486a89f0e843
Fix rope bug which allowed hedgehog to go into land
unc0rr
parents:
1633
diff
changeset
|
1061 |
or (HHGear^.Damage > 0) then |
1433 | 1062 |
begin |
1063 |
with PHedgehog(Gear^.Hedgehog)^.Gear^ do |
|
1064 |
begin |
|
1065 |
State:= State and not gstAttacking; |
|
1066 |
Message:= Message and not gm_Attack |
|
1067 |
end; |
|
1068 |
DeleteGear(Gear) |
|
1069 |
end |
|
4 | 1070 |
end; |
1071 |
||
1072 |
procedure doStepRope(Gear: PGear); |
|
1073 |
begin |
|
351 | 1074 |
Gear^.dX:= - Gear^.dX; |
1075 |
Gear^.dY:= - Gear^.dY; |
|
1076 |
Gear^.doStep:= @doStepRopeAttach |
|
4 | 1077 |
end; |
1078 |
||
1079 |
//////////////////////////////////////////////////////////////////////////////// |
|
1080 |
procedure doStepSmokeTrace(Gear: PGear); |
|
1081 |
begin |
|
351 | 1082 |
inc(Gear^.Timer); |
1083 |
if Gear^.Timer > 64 then |
|
1133 | 1084 |
begin |
1085 |
Gear^.Timer:= 0; |
|
1086 |
dec(Gear^.State) |
|
1087 |
end; |
|
351 | 1088 |
Gear^.dX:= Gear^.dX + cWindSpeed; |
1089 |
Gear^.X:= Gear^.X + Gear^.dX; |
|
1090 |
if Gear^.State = 0 then DeleteGear(Gear) |
|
4 | 1091 |
end; |
9 | 1092 |
|
1093 |
//////////////////////////////////////////////////////////////////////////////// |
|
1045 | 1094 |
procedure doStepExplosionWork(Gear: PGear); |
9 | 1095 |
begin |
351 | 1096 |
inc(Gear^.Timer); |
1097 |
if Gear^.Timer > 75 then |
|
1133 | 1098 |
begin |
1099 |
inc(Gear^.State); |
|
1100 |
Gear^.Timer:= 0; |
|
1101 |
if Gear^.State > 5 then DeleteGear(Gear) |
|
1102 |
end; |
|
9 | 1103 |
end; |
10 | 1104 |
|
1045 | 1105 |
procedure doStepExplosion(Gear: PGear); |
1106 |
var i: LongWord; |
|
1107 |
begin |
|
1047 | 1108 |
for i:= 0 to 31 do AddVisualGear(hwRound(Gear^.X), hwRound(Gear^.Y), vgtFire); |
1109 |
for i:= 0 to 8 do AddVisualGear(hwRound(Gear^.X), hwRound(Gear^.Y), vgtExplPart); |
|
1110 |
for i:= 0 to 8 do AddVisualGear(hwRound(Gear^.X), hwRound(Gear^.Y), vgtExplPart2); |
|
1045 | 1111 |
Gear^.doStep:= @doStepExplosionWork |
1112 |
end; |
|
1113 |
||
10 | 1114 |
//////////////////////////////////////////////////////////////////////////////// |
1115 |
procedure doStepMine(Gear: PGear); |
|
1116 |
begin |
|
542 | 1117 |
if (Gear^.State and gstMoving) <> 0 then |
914 | 1118 |
begin |
1119 |
DeleteCI(Gear); |
|
1120 |
doStepFallingGear(Gear); |
|
1121 |
if (Gear^.State and gstMoving) = 0 then |
|
1122 |
begin |
|
1123 |
AddGearCI(Gear); |
|
1124 |
Gear^.dX:= _0; |
|
1125 |
Gear^.dY:= _0 |
|
1126 |
end; |
|
1127 |
CalcRotationDirAngle(Gear); |
|
1128 |
AllInactive:= false |
|
1129 |
end else |
|
1130 |
if ((GameTicks and $3F) = 25) then |
|
1131 |
doStepFallingGear(Gear); |
|
351 | 1132 |
|
1133 |
if ((Gear^.State and gsttmpFlag) <> 0) then |
|
1133 | 1134 |
if ((Gear^.State and gstAttacking) = 0) then |
1135 |
begin |
|
1136 |
if ((GameTicks and $1F) = 0) then |
|
1137 |
if CheckGearNear(Gear, gtHedgehog, 46, 32) <> nil then Gear^.State:= Gear^.State or gstAttacking |
|
1138 |
end else // gstAttacking <> 0 |
|
1139 |
begin |
|
1140 |
AllInactive:= false; |
|
1669 | 1141 |
if (Gear^.Timer and $FF) = 0 then PlaySound(sndMineTick, false, nil); |
1133 | 1142 |
if Gear^.Timer = 0 then |
1143 |
begin |
|
1144 |
doMakeExplosion(hwRound(Gear^.X), hwRound(Gear^.Y), 50, EXPLAutoSound); |
|
1145 |
DeleteGear(Gear); |
|
1146 |
exit |
|
1147 |
end; |
|
1148 |
dec(Gear^.Timer); |
|
1149 |
end else // gsttmpFlag = 0 |
|
1150 |
if TurnTimeLeft = 0 then Gear^.State:= Gear^.State or gsttmpFlag; |
|
10 | 1151 |
end; |
57 | 1152 |
|
39 | 1153 |
//////////////////////////////////////////////////////////////////////////////// |
1154 |
procedure doStepDynamite(Gear: PGear); |
|
1155 |
begin |
|
43 | 1156 |
doStepFallingGear(Gear); |
1157 |
AllInactive:= false; |
|
351 | 1158 |
if Gear^.Timer mod 166 = 0 then inc(Gear^.Tag); |
1159 |
if Gear^.Timer = 0 then |
|
1133 | 1160 |
begin |
1161 |
doMakeExplosion(hwRound(Gear^.X), hwRound(Gear^.Y), 75, EXPLAutoSound); |
|
1162 |
DeleteGear(Gear); |
|
1163 |
exit |
|
1164 |
end; |
|
351 | 1165 |
dec(Gear^.Timer); |
39 | 1166 |
end; |
14
81f125629b25
- Mine checks whether a hedgehog is near less frequently
unc0rr
parents:
13
diff
changeset
|
1167 |
|
351 | 1168 |
/////////////////////////////////////////////////////////////////////////////// |
14
81f125629b25
- Mine checks whether a hedgehog is near less frequently
unc0rr
parents:
13
diff
changeset
|
1169 |
procedure doStepCase(Gear: PGear); |
371 | 1170 |
var i, x, y: LongInt; |
1436 | 1171 |
k: TGearType; |
14
81f125629b25
- Mine checks whether a hedgehog is near less frequently
unc0rr
parents:
13
diff
changeset
|
1172 |
begin |
351 | 1173 |
if (Gear^.Message and gm_Destroy) > 0 then |
1133 | 1174 |
begin |
1175 |
DeleteGear(Gear); |
|
1176 |
FreeActionsList; |
|
1177 |
SetAllToActive; // something (hh, mine, etc...) could be on top of the case |
|
1178 |
with CurrentHedgehog^ do |
|
1179 |
if Gear <> nil then Gear^.Message:= Gear^.Message and not (gm_LJump or gm_HJump); |
|
1180 |
exit |
|
1181 |
end; |
|
15 | 1182 |
|
351 | 1183 |
if Gear^.Damage > 0 then |
1133 | 1184 |
begin |
1185 |
x:= hwRound(Gear^.X); |
|
1186 |
y:= hwRound(Gear^.Y); |
|
1436 | 1187 |
k:= Gear^.Kind; |
1188 |
DeleteGear(Gear); // <-- delete gear! |
|
2376 | 1189 |
|
1436 | 1190 |
if k = gtCase then |
1133 | 1191 |
begin |
1192 |
doMakeExplosion(x, y, 25, EXPLAutoSound); |
|
1193 |
for i:= 0 to 63 do |
|
1194 |
AddGear(x, y, gtFlame, 0, _0, _0, 0); |
|
1195 |
end; |
|
1196 |
exit |
|
1197 |
end; |
|
79 | 1198 |
|
351 | 1199 |
if (Gear^.dY.QWordValue <> 0) or (not TestCollisionYwithGear(Gear, 1)) then |
1133 | 1200 |
begin |
1201 |
AllInactive:= false; |
|
1202 |
Gear^.dY:= Gear^.dY + cGravity; |
|
1203 |
Gear^.Y:= Gear^.Y + Gear^.dY; |
|
1204 |
if (Gear^.dY.isNegative) and TestCollisionYwithGear(Gear, -1) then Gear^.dY:= _0 else |
|
1205 |
if (not Gear^.dY.isNegative) and TestCollisionYwithGear(Gear, 1) then |
|
1206 |
begin |
|
1207 |
Gear^.dY:= - Gear^.dY * Gear^.Elasticity; |
|
1208 |
if Gear^.dY > - _0_001 then Gear^.dY:= _0 |
|
1669 | 1209 |
else if Gear^.dY < - _0_03 then PlaySound(sndGraveImpact, false, nil); |
1133 | 1210 |
end; |
1211 |
CheckGearDrowning(Gear); |
|
1212 |
end; |
|
14
81f125629b25
- Mine checks whether a hedgehog is near less frequently
unc0rr
parents:
13
diff
changeset
|
1213 |
|
511 | 1214 |
if (Gear^.dY.QWordValue = 0) then AddGearCI(Gear) |
1133 | 1215 |
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
|
1216 |
end; |
49 | 1217 |
|
1218 |
//////////////////////////////////////////////////////////////////////////////// |
|
2460 | 1219 |
|
1220 |
procedure doStepTarget(Gear: PGear); |
|
1221 |
begin |
|
1222 |
if (Gear^.Timer = 0) and (Gear^.Tag = 0) then |
|
1223 |
PlaySound(sndWarp, false, nil); |
|
1224 |
||
1225 |
if (Gear^.Tag = 0) and (Gear^.Timer < 1000) then |
|
1226 |
inc(Gear^.Timer) |
|
1227 |
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
|
1228 |
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
|
1229 |
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
|
1230 |
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
|
1231 |
begin |
2460 | 1232 |
inc(TurnTimeLeft, TrainingTimeInc); |
1233 |
||
1234 |
if TrainingTimeInc > TrainingTimeInM then |
|
1235 |
dec(TrainingTimeInc, TrainingTimeInD); |
|
1236 |
if TurnTimeLeft > TrainingTimeMax then |
|
1237 |
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
|
1238 |
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
|
1239 |
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
|
1240 |
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
|
1241 |
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
|
1242 |
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
|
1243 |
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
|
1244 |
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
|
1245 |
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
|
1246 |
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
|
1247 |
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
|
1248 |
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
|
1249 |
end; |
2460 | 1250 |
DeleteGear(Gear); |
1251 |
exit; |
|
1252 |
end; |
|
1253 |
||
1254 |
doStepCase(Gear) |
|
1255 |
end; |
|
1256 |
||
1257 |
//////////////////////////////////////////////////////////////////////////////// |
|
854 | 1258 |
procedure doStepIdle(Gear: PGear); |
1259 |
begin |
|
1260 |
AllInactive:= false; |
|
925 | 1261 |
dec(Gear^.Timer); |
854 | 1262 |
if Gear^.Timer = 0 then |
1263 |
begin |
|
1264 |
DeleteGear(Gear); |
|
1265 |
AfterAttack |
|
1266 |
end |
|
1267 |
end; |
|
1268 |
||
79 | 1269 |
procedure doStepShover(Gear: PGear); |
1270 |
var HHGear: PGear; |
|
1271 |
begin |
|
351 | 1272 |
HHGear:= PHedgehog(Gear^.Hedgehog)^.Gear; |
1273 |
HHGear^.State:= HHGear^.State or gstNoDamage; |
|
980
20128e98988b
Don't push attacking hedgehog when using whip or baseball
unc0rr
parents:
979
diff
changeset
|
1274 |
DeleteCI(HHGear); |
20128e98988b
Don't push attacking hedgehog when using whip or baseball
unc0rr
parents:
979
diff
changeset
|
1275 |
|
79 | 1276 |
AmmoShove(Gear, 30, 115); |
980
20128e98988b
Don't push attacking hedgehog when using whip or baseball
unc0rr
parents:
979
diff
changeset
|
1277 |
|
351 | 1278 |
HHGear^.State:= HHGear^.State and not gstNoDamage; |
854 | 1279 |
Gear^.Timer:= 250; |
1280 |
Gear^.doStep:= @doStepIdle |
|
79 | 1281 |
end; |
1282 |
||
1283 |
//////////////////////////////////////////////////////////////////////////////// |
|
925 | 1284 |
procedure doStepWhip(Gear: PGear); |
1285 |
var HHGear: PGear; |
|
1286 |
i: LongInt; |
|
1287 |
begin |
|
1288 |
HHGear:= PHedgehog(Gear^.Hedgehog)^.Gear; |
|
1289 |
HHGear^.State:= HHGear^.State or gstNoDamage; |
|
980
20128e98988b
Don't push attacking hedgehog when using whip or baseball
unc0rr
parents:
979
diff
changeset
|
1290 |
DeleteCI(HHGear); |
925 | 1291 |
|
1292 |
for i:= 0 to 3 do |
|
1293 |
begin |
|
1294 |
AmmoShove(Gear, 30, 25); |
|
1295 |
Gear^.X:= Gear^.X + Gear^.dX * 5 |
|
1296 |
end; |
|
1297 |
||
1298 |
HHGear^.State:= HHGear^.State and not gstNoDamage; |
|
1299 |
Gear^.Timer:= 250; |
|
1300 |
Gear^.doStep:= @doStepIdle |
|
1301 |
end; |
|
1302 |
||
1303 |
//////////////////////////////////////////////////////////////////////////////// |
|
79 | 1304 |
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
|
1305 |
var i: Integer; |
79 | 1306 |
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
|
1307 |
if (Gear^.State and gsttmpFlag) = 0 then AllInactive:= false; |
1433 | 1308 |
|
79 | 1309 |
if not TestCollisionYwithGear(Gear, 1) then |
1133 | 1310 |
begin |
1586 | 1311 |
if hwAbs(Gear^.dX) > _0_01 then |
1312 |
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
|
1313 |
if (Gear^.State and gsttmpFlag) <> 0 then Gear^.dY:= Gear^.dY + _2*cGravity else |
1133 | 1314 |
Gear^.dY:= Gear^.dY + cGravity; |
1830 | 1315 |
if hwAbs(Gear^.dY) > _0_2 then Gear^.dY:= Gear^.dY * _0_995; |
2376 | 1316 |
|
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
|
1317 |
if (Gear^.State and gsttmpFlag) <> 0 then Gear^.X:= Gear^.X + Gear^.dX else |
1830 | 1318 |
Gear^.X:= Gear^.X + Gear^.dX + cWindSpeed * 640; |
1133 | 1319 |
Gear^.Y:= Gear^.Y + Gear^.dY; |
2376 | 1320 |
|
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
|
1321 |
if (hwRound(Gear^.Y) > cWaterLine) then |
1133 | 1322 |
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
|
1323 |
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
|
1324 |
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
|
1325 |
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
|
1326 |
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
|
1327 |
end; |
1133 | 1328 |
DeleteGear(Gear); |
1329 |
exit |
|
1330 |
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
|
1331 |
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
|
1332 |
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
|
1333 |
begin |
b52344de23ae
In progress, trying to make a fire for molotov cocktail. Normal fire should still work fairly normally.
nemo
parents:
2376
diff
changeset
|
1334 |
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
|
1335 |
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
|
1336 |
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
|
1337 |
end; |
2475 | 1338 |
if Gear^.Timer > 0 then |
1339 |
begin |
|
1340 |
dec(Gear^.Timer); |
|
1341 |
inc(Gear^.Damage) |
|
1342 |
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
|
1343 |
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
|
1344 |
// 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
|
1345 |
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
|
1346 |
begin |
b52344de23ae
In progress, trying to make a fire for molotov cocktail. Normal fire should still work fairly normally.
nemo
parents:
2376
diff
changeset
|
1347 |
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
|
1348 |
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
|
1349 |
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
|
1350 |
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
|
1351 |
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
|
1352 |
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
|
1353 |
end |
b52344de23ae
In progress, trying to make a fire for molotov cocktail. Normal fire should still work fairly normally.
nemo
parents:
2376
diff
changeset
|
1354 |
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
|
1355 |
// Modified fire |
2475 | 1356 |
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
|
1357 |
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
|
1358 |
// 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
|
1359 |
Gear^.Timer:= 100 - Gear^.Tag * 3; |
2475 | 1360 |
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
|
1361 |
end |
b52344de23ae
In progress, trying to make a fire for molotov cocktail. Normal fire should still work fairly normally.
nemo
parents:
2376
diff
changeset
|
1362 |
end |
b52344de23ae
In progress, trying to make a fire for molotov cocktail. Normal fire should still work fairly normally.
nemo
parents:
2376
diff
changeset
|
1363 |
end; |
351 | 1364 |
if Gear^.Health = 0 then |
1133 | 1365 |
DeleteGear(Gear) |
79 | 1366 |
end; |
82 | 1367 |
|
1368 |
//////////////////////////////////////////////////////////////////////////////// |
|
1369 |
procedure doStepFirePunchWork(Gear: PGear); |
|
1370 |
var HHGear: PGear; |
|
1371 |
begin |
|
1372 |
AllInactive:= false; |
|
351 | 1373 |
if ((Gear^.Message and gm_Destroy) <> 0) then |
1133 | 1374 |
begin |
1375 |
DeleteGear(Gear); |
|
1376 |
AfterAttack; |
|
1377 |
exit |
|
1378 |
end; |
|
82 | 1379 |
|
351 | 1380 |
HHGear:= PHedgehog(Gear^.Hedgehog)^.Gear; |
1381 |
if hwRound(HHGear^.Y) <= Gear^.Tag - 2 then |
|
1133 | 1382 |
begin |
1383 |
Gear^.Tag:= hwRound(HHGear^.Y); |
|
1384 |
DrawTunnel(HHGear^.X - int2hwFloat(cHHRadius), HHGear^.Y - _1, _0_5, _0, cHHRadius * 4, 2); |
|
1385 |
HHGear^.State:= HHGear^.State or gstNoDamage; |
|
1386 |
Gear^.Y:= HHGear^.Y; |
|
1387 |
AmmoShove(Gear, 30, 40); |
|
1388 |
HHGear^.State:= HHGear^.State and not gstNoDamage |
|
1389 |
end; |
|
351 | 1390 |
|
1391 |
HHGear^.dY:= HHGear^.dY + cGravity; |
|
1392 |
if not (HHGear^.dY.isNegative) then |
|
1133 | 1393 |
begin |
1394 |
HHGear^.State:= HHGear^.State or gstMoving; |
|
1395 |
DeleteGear(Gear); |
|
1396 |
AfterAttack; |
|
1397 |
exit |
|
1398 |
end; |
|
2089 | 1399 |
|
2376 | 1400 |
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
|
1401 |
HHGear^.Y:= HHGear^.Y + HHGear^.dY |
82 | 1402 |
end; |
1403 |
||
1404 |
procedure doStepFirePunch(Gear: PGear); |
|
1405 |
var HHGear: PGear; |
|
1406 |
begin |
|
1407 |
AllInactive:= false; |
|
351 | 1408 |
HHGear:= PHedgehog(Gear^.Hedgehog)^.Gear; |
514 | 1409 |
DeleteCI(HHGear); |
498 | 1410 |
HHGear^.X:= int2hwFloat(hwRound(HHGear^.X)) - _0_5; |
1014
3c7d4e7ccdff
- Fix firepunch sprite direction when use in high jump
unc0rr
parents:
992
diff
changeset
|
1411 |
HHGear^.dX:= SignAs(cLittle, Gear^.dX); |
3c7d4e7ccdff
- Fix firepunch sprite direction when use in high jump
unc0rr
parents:
992
diff
changeset
|
1412 |
|
351 | 1413 |
HHGear^.dY:= - _0_3; |
82 | 1414 |
|
351 | 1415 |
Gear^.X:= HHGear^.X; |
979
edb8f208c1d9
Fix firepunch direction when attacking from high jump
unc0rr
parents:
974
diff
changeset
|
1416 |
Gear^.dX:= SignAs(_0_45, Gear^.dX); |
351 | 1417 |
Gear^.dY:= - _0_9; |
1418 |
Gear^.doStep:= @doStepFirePunchWork; |
|
498 | 1419 |
DrawTunnel(HHGear^.X - int2hwFloat(cHHRadius), HHGear^.Y + _1, _0_5, _0, cHHRadius * 4, 5); |
1279 | 1420 |
|
1669 | 1421 |
PlaySound(TSound(ord(sndFirePunch1) + GetRandom(6)), false, PHedgehog(HHGear^.Hedgehog)^.Team^.voicepack) |
82 | 1422 |
end; |
1423 |
||
263 | 1424 |
//////////////////////////////////////////////////////////////////////////////// |
1425 |
||
929
9456e1e77369
- Continue preparation for implementing attack from rope and parachute
unc0rr
parents:
928
diff
changeset
|
1426 |
procedure doStepParachuteWork(Gear: PGear); |
211 | 1427 |
var HHGear: PGear; |
1428 |
begin |
|
351 | 1429 |
HHGear:= PHedgehog(Gear^.Hedgehog)^.Gear; |
82 | 1430 |
|
516 | 1431 |
inc(Gear^.Timer); |
1432 |
||
212 | 1433 |
if TestCollisionYwithGear(HHGear, 1) |
1133 | 1434 |
or ((HHGear^.State and gstHHDriven) = 0) |
1435 |
or CheckGearDrowning(HHGear) |
|
1436 |
or ((Gear^.Message and gm_Attack) <> 0) then |
|
1437 |
begin |
|
1438 |
with HHGear^ do |
|
1439 |
begin |
|
1440 |
Message:= 0; |
|
1441 |
SetLittle(dX); |
|
1442 |
dY:= _0; |
|
1443 |
State:= State or gstMoving; |
|
1444 |
end; |
|
1445 |
DeleteGear(Gear); |
|
2060
3e9e5e1be6f5
fix crash in parachute/rope if drowning with active girder/teleport
nemo
parents:
2059
diff
changeset
|
1446 |
isCursorVisible:= false; |
1133 | 1447 |
exit |
1448 |
end; |
|
211 | 1449 |
|
351 | 1450 |
if not TestCollisionXwithGear(HHGear, hwSign(HHGear^.dX)) then |
1133 | 1451 |
HHGear^.X:= HHGear^.X + cWindSpeed * 200; |
211 | 1452 |
|
351 | 1453 |
if (Gear^.Message and gm_Left) <> 0 then HHGear^.X:= HHGear^.X - cMaxWindSpeed * 40 |
1454 |
else if (Gear^.Message and gm_Right) <> 0 then HHGear^.X:= HHGear^.X + cMaxWindSpeed * 40; |
|
1455 |
if (Gear^.Message and gm_Up) <> 0 then HHGear^.Y:= HHGear^.Y - cGravity * 40 |
|
1456 |
else if (Gear^.Message and gm_Down) <> 0 then HHGear^.Y:= HHGear^.Y + cGravity * 40; |
|
211 | 1457 |
|
351 | 1458 |
HHGear^.Y:= HHGear^.Y + cGravity * 100; |
568 | 1459 |
Gear^.X:= HHGear^.X; |
1460 |
Gear^.Y:= HHGear^.Y |
|
263 | 1461 |
end; |
211 | 1462 |
|
929
9456e1e77369
- Continue preparation for implementing attack from rope and parachute
unc0rr
parents:
928
diff
changeset
|
1463 |
procedure doStepParachute(Gear: PGear); |
9456e1e77369
- Continue preparation for implementing attack from rope and parachute
unc0rr
parents:
928
diff
changeset
|
1464 |
var HHGear: PGear; |
9456e1e77369
- Continue preparation for implementing attack from rope and parachute
unc0rr
parents:
928
diff
changeset
|
1465 |
begin |
9456e1e77369
- Continue preparation for implementing attack from rope and parachute
unc0rr
parents:
928
diff
changeset
|
1466 |
HHGear:= PHedgehog(Gear^.Hedgehog)^.Gear; |
9456e1e77369
- Continue preparation for implementing attack from rope and parachute
unc0rr
parents:
928
diff
changeset
|
1467 |
|
9456e1e77369
- Continue preparation for implementing attack from rope and parachute
unc0rr
parents:
928
diff
changeset
|
1468 |
DeleteCI(HHGear); |
9456e1e77369
- Continue preparation for implementing attack from rope and parachute
unc0rr
parents:
928
diff
changeset
|
1469 |
|
9456e1e77369
- Continue preparation for implementing attack from rope and parachute
unc0rr
parents:
928
diff
changeset
|
1470 |
OnUsedAmmo(PHedgehog(HHGear^.Hedgehog)^); |
9456e1e77369
- Continue preparation for implementing attack from rope and parachute
unc0rr
parents:
928
diff
changeset
|
1471 |
ApplyAmmoChanges(PHedgehog(HHGear^.Hedgehog)^); |
9456e1e77369
- Continue preparation for implementing attack from rope and parachute
unc0rr
parents:
928
diff
changeset
|
1472 |
|
931 | 1473 |
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
|
1474 |
HHGear^.Message:= HHGear^.Message and not gm_Attack; |
9456e1e77369
- Continue preparation for implementing attack from rope and parachute
unc0rr
parents:
928
diff
changeset
|
1475 |
|
9456e1e77369
- Continue preparation for implementing attack from rope and parachute
unc0rr
parents:
928
diff
changeset
|
1476 |
Gear^.doStep:= @doStepParachuteWork; |
9456e1e77369
- Continue preparation for implementing attack from rope and parachute
unc0rr
parents:
928
diff
changeset
|
1477 |
|
9456e1e77369
- Continue preparation for implementing attack from rope and parachute
unc0rr
parents:
928
diff
changeset
|
1478 |
Gear^.Message:= HHGear^.Message; |
9456e1e77369
- Continue preparation for implementing attack from rope and parachute
unc0rr
parents:
928
diff
changeset
|
1479 |
doStepParachuteWork(Gear) |
9456e1e77369
- Continue preparation for implementing attack from rope and parachute
unc0rr
parents:
928
diff
changeset
|
1480 |
end; |
9456e1e77369
- Continue preparation for implementing attack from rope and parachute
unc0rr
parents:
928
diff
changeset
|
1481 |
|
263 | 1482 |
//////////////////////////////////////////////////////////////////////////////// |
1483 |
procedure doStepAirAttackWork(Gear: PGear); |
|
1507 | 1484 |
var i: Longint; |
263 | 1485 |
begin |
1486 |
AllInactive:= false; |
|
498 | 1487 |
Gear^.X:= Gear^.X + cAirPlaneSpeed * Gear^.Tag; |
1124 | 1488 |
|
543
465e2ec8f05f
- Better randomness of placing hedgehogs on the land
unc0rr
parents:
542
diff
changeset
|
1489 |
if (Gear^.Health > 0)and(not (Gear^.X < Gear^.dX))and(Gear^.X < Gear^.dX + cAirPlaneSpeed) then |
1124 | 1490 |
begin |
1491 |
dec(Gear^.Health); |
|
1492 |
case Gear^.State of |
|
1493 |
0: FollowGear:= AddGear(hwRound(Gear^.X), hwRound(Gear^.Y), gtAirBomb, 0, cBombsSpeed * Gear^.Tag, _0, 0); |
|
1494 |
1: FollowGear:= AddGear(hwRound(Gear^.X), hwRound(Gear^.Y), gtMine, 0, cBombsSpeed * Gear^.Tag, _0, 0); |
|
1586 | 1495 |
2: for i:= -19 to 19 do |
1496 |
FollowGear:= AddGear(hwRound(Gear^.X) + i div 3, hwRound(Gear^.Y), gtFlame, 0, _0_001 * i, _0, 0); |
|
1124 | 1497 |
end; |
1498 |
Gear^.dX:= Gear^.dX + int2hwFloat(30 * Gear^.Tag) |
|
1499 |
end; |
|
1500 |
||
1501 |
if (GameTicks and $3F) = 0 then |
|
1502 |
AddGear(hwRound(Gear^.X), hwRound(Gear^.Y), gtSmokeTrace, 0, _0, _0, 0); |
|
1503 |
||
1753 | 1504 |
if (hwRound(Gear^.X) > (LAND_WIDTH+1024)) or (hwRound(Gear^.X) < -1024) then DeleteGear(Gear) |
263 | 1505 |
end; |
1506 |
||
1507 |
procedure doStepAirAttack(Gear: PGear); |
|
1508 |
begin |
|
1509 |
AllInactive:= false; |
|
543
465e2ec8f05f
- Better randomness of placing hedgehogs on the land
unc0rr
parents:
542
diff
changeset
|
1510 |
|
1507 | 1511 |
if Gear^.X.QWordValue = 0 then |
1771 | 1512 |
begin |
1513 |
Gear^.Tag:= 1; |
|
1514 |
Gear^.X:= -_1024; |
|
1515 |
end |
|
1507 | 1516 |
else |
1771 | 1517 |
begin |
1507 | 1518 |
Gear^.Tag:= -1; |
1771 | 1519 |
Gear^.X:= int2hwFloat(LAND_WIDTH + 1024); |
1520 |
end; |
|
1507 | 1521 |
|
1784 | 1522 |
Gear^.Y:= int2hwFloat(topY-300); |
543
465e2ec8f05f
- Better randomness of placing hedgehogs on the land
unc0rr
parents:
542
diff
changeset
|
1523 |
Gear^.dX:= int2hwFloat(TargetPoint.X - 5 * Gear^.Tag * 15); |
357 | 1524 |
|
543
465e2ec8f05f
- Better randomness of placing hedgehogs on the land
unc0rr
parents:
542
diff
changeset
|
1525 |
if int2hwFloat(TargetPoint.Y) - Gear^.Y > _0 then |
1133 | 1526 |
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
|
1527 |
|
351 | 1528 |
Gear^.Health:= 6; |
801 | 1529 |
Gear^.doStep:= @doStepAirAttackWork; |
1669 | 1530 |
PlaySound(sndIncoming, false, PHedgehog(Gear^.Hedgehog)^.Team^.voicepack) |
263 | 1531 |
end; |
1532 |
||
1533 |
//////////////////////////////////////////////////////////////////////////////// |
|
1534 |
||
1535 |
procedure doStepAirBomb(Gear: PGear); |
|
1536 |
begin |
|
1537 |
AllInactive:= false; |
|
1538 |
doStepFallingGear(Gear); |
|
351 | 1539 |
if (Gear^.State and gstCollision) <> 0 then |
1133 | 1540 |
begin |
1541 |
doMakeExplosion(hwRound(Gear^.X), hwRound(Gear^.Y), 30, EXPLAutoSound); |
|
1542 |
DeleteGear(Gear); |
|
1543 |
exit |
|
1544 |
end; |
|
263 | 1545 |
if (GameTicks and $3F) = 0 then |
1133 | 1546 |
AddGear(hwRound(Gear^.X), hwRound(Gear^.Y), gtSmokeTrace, 0, _0, _0, 0) |
211 | 1547 |
end; |
409 | 1548 |
|
1549 |
//////////////////////////////////////////////////////////////////////////////// |
|
1550 |
||
1551 |
procedure doStepGirder(Gear: PGear); |
|
415 | 1552 |
var HHGear: PGear; |
1915 | 1553 |
x, y, tx, ty: hwFloat; |
409 | 1554 |
begin |
1555 |
AllInactive:= false; |
|
415 | 1556 |
|
1557 |
HHGear:= PHedgehog(Gear^.Hedgehog)^.Gear; |
|
1915 | 1558 |
tx:= int2hwFloat(TargetPoint.X); |
1559 |
ty:= int2hwFloat(TargetPoint.Y); |
|
1560 |
x:= HHGear^.X; |
|
1561 |
y:= HHGear^.Y; |
|
1909 | 1562 |
|
1915 | 1563 |
if (Distance(tx - x, ty - y) > _256) or |
1564 |
not TryPlaceOnLand(TargetPoint.X - SpritesData[sprAmGirder].Width div 2, |
|
1565 |
TargetPoint.Y - SpritesData[sprAmGirder].Height div 2, |
|
520 | 1566 |
sprAmGirder, Gear^.State, true) then |
1133 | 1567 |
begin |
1914 | 1568 |
PlaySound(sndDenied, false, nil); |
1569 |
HHGear^.Message:= HHGear^.Message and not gm_Attack; |
|
1570 |
HHGear^.State:= HHGear^.State and not gstAttacking; |
|
1133 | 1571 |
HHGear^.State:= HHGear^.State or gstHHChooseTarget; |
1914 | 1572 |
isCursorVisible:= true; |
1573 |
DeleteGear(Gear) |
|
1133 | 1574 |
end |
1575 |
else begin |
|
1914 | 1576 |
PlaySound(sndPlaced, false, nil); |
1133 | 1577 |
DeleteGear(Gear); |
1909 | 1578 |
OnUsedAmmo(PHedgehog(HHGear^.Hedgehog)^); |
1914 | 1579 |
ApplyAmmoChanges(PHedgehog(HHGear^.Hedgehog)^) |
1580 |
end; |
|
1581 |
||
1909 | 1582 |
HHGear^.State:= HHGear^.State and not (gstAttacking or gstAttacked); |
1583 |
HHGear^.Message:= HHGear^.Message and not gm_Attack; |
|
415 | 1584 |
TargetPoint.X:= NoPointX |
409 | 1585 |
end; |
520 | 1586 |
|
1587 |
//////////////////////////////////////////////////////////////////////////////// |
|
525 | 1588 |
procedure doStepTeleportAfter(Gear: PGear); |
912 | 1589 |
var HHGear: PGear; |
1590 |
begin |
|
1591 |
HHGear:= PHedgehog(Gear^.Hedgehog)^.Gear; |
|
1592 |
HHGear^.Y:= HHGear^.Y + HHGear^.dY; // hedgehog falling to collect cases |
|
1593 |
HHGear^.dY:= HHGear^.dY + cGravity; |
|
945
4ead9cde4e14
- Start chat implementation: chat strings are on the screen
unc0rr
parents:
940
diff
changeset
|
1594 |
if TestCollisionYwithGear(HHGear, 1) |
1133 | 1595 |
or CheckGearDrowning(HHGear) then |
1596 |
begin |
|
1597 |
DeleteGear(Gear); |
|
1598 |
AfterAttack |
|
1599 |
end |
|
912 | 1600 |
end; |
1601 |
||
1602 |
procedure doStepTeleportAnim(Gear: PGear); |
|
525 | 1603 |
begin |
853 | 1604 |
inc(Gear^.Timer); |
1605 |
if Gear^.Timer = 65 then |
|
1606 |
begin |
|
1607 |
Gear^.Timer:= 0; |
|
1608 |
inc(Gear^.Pos); |
|
1609 |
if Gear^.Pos = 11 then |
|
912 | 1610 |
Gear^.doStep:= @doStepTeleportAfter |
2217 | 1611 |
end; |
525 | 1612 |
end; |
520 | 1613 |
|
1614 |
procedure doStepTeleport(Gear: PGear); |
|
1615 |
var HHGear: PGear; |
|
1616 |
begin |
|
1617 |
AllInactive:= false; |
|
1618 |
||
1619 |
HHGear:= PHedgehog(Gear^.Hedgehog)^.Gear; |
|
1620 |
if not TryPlaceOnLand(TargetPoint.X - SpritesData[sprHHTelepMask].Width div 2, |
|
1621 |
TargetPoint.Y - SpritesData[sprHHTelepMask].Height div 2, |
|
1622 |
sprHHTelepMask, 0, false) then |
|
853 | 1623 |
begin |
1624 |
HHGear^.Message:= HHGear^.Message and not gm_Attack; |
|
1625 |
HHGear^.State:= HHGear^.State and not gstAttacking; |
|
1626 |
HHGear^.State:= HHGear^.State or gstHHChooseTarget; |
|
1627 |
DeleteGear(Gear); |
|
2227 | 1628 |
isCursorVisible:= true; |
1629 |
PlaySound(sndDenied, false, nil); |
|
853 | 1630 |
end |
1631 |
else begin |
|
1632 |
DeleteCI(HHGear); |
|
1633 |
SetAllHHToActive; |
|
912 | 1634 |
Gear^.doStep:= @doStepTeleportAnim; |
853 | 1635 |
Gear^.X:= HHGear^.X; |
1636 |
Gear^.Y:= HHGear^.Y; |
|
1637 |
HHGear^.X:= int2hwFloat(TargetPoint.X); |
|
1638 |
HHGear^.Y:= int2hwFloat(TargetPoint.Y); |
|
2227 | 1639 |
HHGear^.State:= HHGear^.State or gstMoving; |
1640 |
playSound(sndWarp, false, nil); |
|
853 | 1641 |
end; |
2217 | 1642 |
TargetPoint.X:= NoPointX; |
1643 |
||
520 | 1644 |
end; |
534 | 1645 |
|
1646 |
//////////////////////////////////////////////////////////////////////////////// |
|
1647 |
procedure doStepSwitcherWork(Gear: PGear); |
|
1648 |
var HHGear: PGear; |
|
1649 |
Msg, State: Longword; |
|
1650 |
begin |
|
1651 |
AllInactive:= false; |
|
1652 |
||
540 | 1653 |
if ((Gear^.Message and not gm_Switch) <> 0) or (TurnTimeLeft = 0) then |
1133 | 1654 |
begin |
1655 |
HHGear:= PHedgehog(Gear^.Hedgehog)^.Gear; |
|
1656 |
Msg:= Gear^.Message and not gm_Switch; |
|
1657 |
DeleteGear(Gear); |
|
1658 |
OnUsedAmmo(PHedgehog(HHGear^.Hedgehog)^); |
|
1659 |
ApplyAmmoChanges(PHedgehog(HHGear^.Hedgehog)^); |
|
534 | 1660 |
|
1133 | 1661 |
HHGear:= CurrentHedgehog^.Gear; |
1662 |
ApplyAmmoChanges(PHedgehog(HHGear^.Hedgehog)^); |
|
1663 |
HHGear^.Message:= Msg; |
|
1664 |
exit |
|
1665 |
end; |
|
534 | 1666 |
|
1667 |
if (Gear^.Message and gm_Switch) <> 0 then |
|
1133 | 1668 |
begin |
1669 |
HHGear:= CurrentHedgehog^.Gear; |
|
1670 |
HHGear^.Message:= HHGear^.Message and not gm_Switch; |
|
1671 |
Gear^.Message:= Gear^.Message and not gm_Switch; |
|
1672 |
State:= HHGear^.State; |
|
1673 |
HHGear^.State:= 0; |
|
1674 |
HHGear^.Active:= false; |
|
1675 |
HHGear^.Z:= cHHZ; |
|
1676 |
RemoveGearFromList(HHGear); |
|
1677 |
InsertGearToList(HHGear); |
|
534 | 1678 |
|
1133 | 1679 |
repeat |
1680 |
CurrentTeam^.CurrHedgehog:= Succ(CurrentTeam^.CurrHedgehog) mod (CurrentTeam^.HedgehogsNumber); |
|
1681 |
until (CurrentTeam^.Hedgehogs[CurrentTeam^.CurrHedgehog].Gear <> nil); |
|
652 | 1682 |
|
1133 | 1683 |
CurrentHedgehog:= @CurrentTeam^.Hedgehogs[CurrentTeam^.CurrHedgehog]; |
534 | 1684 |
|
1133 | 1685 |
HHGear:= CurrentHedgehog^.Gear; |
1686 |
HHGear^.State:= State; |
|
1687 |
HHGear^.Active:= true; |
|
1688 |
FollowGear:= HHGear; |
|
1689 |
HHGear^.Z:= cCurrHHZ; |
|
1690 |
RemoveGearFromList(HHGear); |
|
1691 |
InsertGearToList(HHGear); |
|
1692 |
Gear^.X:= HHGear^.X; |
|
1693 |
Gear^.Y:= HHGear^.Y |
|
1694 |
end; |
|
534 | 1695 |
end; |
1696 |
||
1697 |
procedure doStepSwitcher(Gear: PGear); |
|
1698 |
var HHGear: PGear; |
|
1699 |
begin |
|
1700 |
Gear^.doStep:= @doStepSwitcherWork; |
|
1701 |
||
1702 |
HHGear:= PHedgehog(Gear^.Hedgehog)^.Gear; |
|
1703 |
with HHGear^ do |
|
1133 | 1704 |
begin |
1705 |
State:= State and not gstAttacking; |
|
1706 |
Message:= Message and not gm_Attack |
|
1707 |
end |
|
534 | 1708 |
end; |
924 | 1709 |
|
1710 |
//////////////////////////////////////////////////////////////////////////////// |
|
1711 |
procedure doStepMortar(Gear: PGear); |
|
1712 |
var dX, dY: hwFloat; |
|
1713 |
i: LongInt; |
|
963 | 1714 |
dxn, dyn: boolean; |
924 | 1715 |
begin |
1716 |
AllInactive:= false; |
|
963 | 1717 |
dxn:= Gear^.dX.isNegative; |
1718 |
dyn:= Gear^.dY.isNegative; |
|
1719 |
||
924 | 1720 |
doStepFallingGear(Gear); |
1721 |
if (Gear^.State and gstCollision) <> 0 then |
|
1722 |
begin |
|
1723 |
doMakeExplosion(hwRound(Gear^.X), hwRound(Gear^.Y), 20, EXPLAutoSound); |
|
963 | 1724 |
|
1725 |
Gear^.dX.isNegative:= not dxn; |
|
1726 |
Gear^.dY.isNegative:= not dyn; |
|
924 | 1727 |
for i:= 0 to 4 do |
1728 |
begin |
|
963 | 1729 |
dX:= Gear^.dX + (GetRandom - _0_5) * _0_03; |
1730 |
dY:= Gear^.dY + (GetRandom - _0_5) * _0_03; |
|
1273 | 1731 |
AddGear(hwRound(Gear^.X), hwRound(Gear^.Y), gtCluster, 0, dX, dY, 25); |
924 | 1732 |
end; |
2376 | 1733 |
|
924 | 1734 |
DeleteGear(Gear); |
1735 |
exit |
|
1736 |
end; |
|
963 | 1737 |
|
924 | 1738 |
if (GameTicks and $3F) = 0 then |
1739 |
AddGear(hwRound(Gear^.X), hwRound(Gear^.Y), gtSmokeTrace, 0, _0, _0, 0) |
|
1740 |
end; |
|
984 | 1741 |
|
1742 |
//////////////////////////////////////////////////////////////////////////////// |
|
1743 |
procedure doStepKamikazeWork(Gear: PGear); |
|
1744 |
const upd: Longword = 0; |
|
987 | 1745 |
var i: LongWord; |
984 | 1746 |
HHGear: PGear; |
1747 |
begin |
|
1748 |
AllInactive:= false; |
|
1749 |
||
1750 |
HHGear:= PHedgehog(Gear^.Hedgehog)^.Gear; |
|
1751 |
HHGear^.State:= HHGear^.State or gstNoDamage; |
|
1752 |
DeleteCI(HHGear); |
|
1753 |
||
1754 |
i:= 2; |
|
1755 |
repeat |
|
1756 |
Gear^.X:= Gear^.X + HHGear^.dX; |
|
1757 |
Gear^.Y:= Gear^.Y + HHGear^.dY; |
|
1758 |
HHGear^.X:= Gear^.X; |
|
1759 |
HHGear^.Y:= Gear^.Y; |
|
1760 |
||
1761 |
inc(Gear^.Damage, 2); |
|
1762 |
||
1200 | 1763 |
// if TestCollisionXwithGear(HHGear, hwSign(Gear^.dX)) |
1764 |
// or TestCollisionYwithGear(HHGear, hwSign(Gear^.dY)) then inc(Gear^.Damage, 3); |
|
984 | 1765 |
|
1766 |
dec(i) |
|
1767 |
until (i = 0) or (Gear^.Damage > Gear^.Health); |
|
1768 |
||
1769 |
inc(upd); |
|
1770 |
if upd > 3 then |
|
1771 |
begin |
|
987 | 1772 |
if Gear^.Health < 1500 then Gear^.Pos:= 2; |
2376 | 1773 |
|
984 | 1774 |
AmmoShove(Gear, 30, 40); |
2376 | 1775 |
|
984 | 1776 |
DrawTunnel(HHGear^.X - HHGear^.dX * 10, |
1200 | 1777 |
HHGear^.Y - _2 - HHGear^.dY * 10 + hwAbs(HHGear^.dY) * 2, |
984 | 1778 |
HHGear^.dX, |
1779 |
HHGear^.dY, |
|
1780 |
20 + cHHRadius * 2, |
|
1200 | 1781 |
cHHRadius * 2 + 6); |
2376 | 1782 |
|
984 | 1783 |
upd:= 0 |
1784 |
end; |
|
1785 |
||
1786 |
if Gear^.Health < Gear^.Damage then |
|
1787 |
begin |
|
1788 |
doMakeExplosion(hwRound(Gear^.X), hwRound(Gear^.Y), 30, EXPLAutoSound); |
|
1789 |
AfterAttack; |
|
1790 |
DeleteGear(Gear); |
|
1791 |
DeleteGear(HHGear); |
|
1792 |
end else |
|
1793 |
begin |
|
1794 |
dec(Gear^.Health, Gear^.Damage); |
|
1795 |
Gear^.Damage:= 0 |
|
1796 |
end |
|
1797 |
end; |
|
1798 |
||
987 | 1799 |
procedure doStepKamikazeIdle(Gear: PGear); |
1800 |
begin |
|
1801 |
AllInactive:= false; |
|
1802 |
dec(Gear^.Timer); |
|
1803 |
if Gear^.Timer = 0 then |
|
1804 |
begin |
|
1805 |
Gear^.Pos:= 1; |
|
1669 | 1806 |
PlaySound(sndKamikaze, false, PHedgehog(Gear^.Hedgehog)^.Team^.voicepack); |
987 | 1807 |
Gear^.doStep:= @doStepKamikazeWork |
1808 |
end |
|
1809 |
end; |
|
1810 |
||
984 | 1811 |
procedure doStepKamikaze(Gear: PGear); |
1812 |
var HHGear: PGear; |
|
1813 |
begin |
|
1814 |
AllInactive:= false; |
|
1815 |
||
1816 |
HHGear:= PHedgehog(Gear^.Hedgehog)^.Gear; |
|
1817 |
||
1818 |
HHGear^.dX:= Gear^.dX; |
|
1819 |
HHGear^.dY:= Gear^.dY; |
|
1820 |
||
1821 |
Gear^.dX:= SignAs(_0_45, Gear^.dX); |
|
1822 |
Gear^.dY:= - _0_9; |
|
1823 |
||
987 | 1824 |
Gear^.Timer:= 550; |
1825 |
||
1826 |
Gear^.doStep:= @doStepKamikazeIdle |
|
984 | 1827 |
end; |
1828 |
||
1103 | 1829 |
//////////////////////////////////////////////////////////////////////////////// |
1830 |
const cakeh = 27; |
|
1110 | 1831 |
cakeDmg = 75; |
1103 | 1832 |
var CakePoints: array[0..Pred(cakeh)] of record x, y: hwFloat; end; |
1833 |
CakeI: Longword; |
|
1834 |
||
1110 | 1835 |
procedure doStepCakeExpl(Gear: PGear); |
1836 |
begin |
|
2141 | 1837 |
AllInactive:= false; |
1838 |
||
1110 | 1839 |
inc(Gear^.Tag); |
1840 |
if Gear^.Tag < 2250 then exit; |
|
1841 |
||
1842 |
doMakeExplosion(hwRound(Gear^.X), hwRound(Gear^.Y), cakeDmg, EXPLAutoSound); |
|
1843 |
AfterAttack; |
|
1844 |
DeleteGear(Gear) |
|
1845 |
end; |
|
1846 |
||
1109 | 1847 |
procedure doStepCakeDown(Gear: PGear); |
1133 | 1848 |
var gi: PGear; |
1849 |
dmg: LongInt; |
|
1109 | 1850 |
begin |
1851 |
AllInactive:= false; |
|
1852 |
||
1853 |
inc(Gear^.Tag); |
|
1854 |
if Gear^.Tag < 100 then exit; |
|
1855 |
Gear^.Tag:= 0; |
|
1856 |
||
1857 |
if Gear^.Pos = 0 then |
|
1858 |
begin |
|
1110 | 1859 |
gi:= GearsList; |
1860 |
while gi <> nil do |
|
1861 |
begin |
|
1862 |
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
|
1863 |
if (dmg > 1) and (gi^.Kind = gtHedgehog) then |
ebc6dfca60d4
- nemo's patch: some animations, zero probability for infinite weapons
unc0rr
parents:
1861
diff
changeset
|
1864 |
if (CurrentHedgehog^.Gear = gi) and (not gi^.Invulnerable) then |
1867 | 1865 |
gi^.State:= gi^.State or gstLoser |
1865
ebc6dfca60d4
- nemo's patch: some animations, zero probability for infinite weapons
unc0rr
parents:
1861
diff
changeset
|
1866 |
else |
ebc6dfca60d4
- nemo's patch: some animations, zero probability for infinite weapons
unc0rr
parents:
1861
diff
changeset
|
1867 |
gi^.State:= gi^.State or gstWinner; |
1110 | 1868 |
gi:= gi^.NextGear |
1869 |
end; |
|
1870 |
Gear^.doStep:= @doStepCakeExpl; |
|
1669 | 1871 |
PlaySound(sndCake, false, nil) |
1109 | 1872 |
end else dec(Gear^.Pos) |
1873 |
end; |
|
1874 |
||
1875 |
||
1089 | 1876 |
procedure doStepCakeWork(Gear: PGear); |
1877 |
const dirs: array[0..3] of TPoint = ((x: 0; y: -1), (x: 1; y: 0),(x: 0; y: 1),(x: -1; y: 0)); |
|
1878 |
var xx, yy, xxn, yyn: LongInt; |
|
1879 |
da: LongInt; |
|
1103 | 1880 |
tdx, tdy: hwFloat; |
1089 | 1881 |
|
1882 |
procedure PrevAngle; |
|
1883 |
begin |
|
1133 | 1884 |
Gear^.Angle:= (LongInt(Gear^.Angle) + 4 - dA) mod 4 |
1089 | 1885 |
end; |
2376 | 1886 |
|
1089 | 1887 |
procedure NextAngle; |
1888 |
begin |
|
1133 | 1889 |
Gear^.Angle:= (LongInt(Gear^.Angle) + 4 + dA) mod 4 |
1089 | 1890 |
end; |
2376 | 1891 |
|
1088 | 1892 |
begin |
2141 | 1893 |
AllInactive:= false; |
1894 |
||
1089 | 1895 |
inc(Gear^.Tag); |
1108 | 1896 |
if Gear^.Tag < 7 then exit; |
1089 | 1897 |
|
1898 |
dA:= hwSign(Gear^.dX); |
|
1899 |
xx:= dirs[Gear^.Angle].x; |
|
1900 |
yy:= dirs[Gear^.Angle].y; |
|
1133 | 1901 |
xxn:= dirs[(LongInt(Gear^.Angle) + 4 + dA) mod 4].x; |
1902 |
yyn:= dirs[(LongInt(Gear^.Angle) + 4 + dA) mod 4].y; |
|
1089 | 1903 |
|
1904 |
if (xx = 0) then |
|
1905 |
if TestCollisionYwithGear(Gear, yy) then |
|
1906 |
PrevAngle |
|
1907 |
else begin |
|
1908 |
Gear^.Tag:= 0; |
|
1909 |
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
|
1910 |
if not TestCollisionXwithGear(Gear, xxn) then |
cc5976f292f9
Cake makes a step after turn. This fixes cake stucking in air
unc0rr
parents:
1634
diff
changeset
|
1911 |
begin |
cc5976f292f9
Cake makes a step after turn. This fixes cake stucking in air
unc0rr
parents:
1634
diff
changeset
|
1912 |
Gear^.X:= Gear^.X + int2hwFloat(xxn); |
cc5976f292f9
Cake makes a step after turn. This fixes cake stucking in air
unc0rr
parents:
1634
diff
changeset
|
1913 |
NextAngle |
cc5976f292f9
Cake makes a step after turn. This fixes cake stucking in air
unc0rr
parents:
1634
diff
changeset
|
1914 |
end; |
1089 | 1915 |
end; |
1916 |
||
1917 |
if (yy = 0) then |
|
1918 |
if TestCollisionXwithGear(Gear, xx) then |
|
1919 |
PrevAngle |
|
1920 |
else begin |
|
1921 |
Gear^.Tag:= 0; |
|
1922 |
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
|
1923 |
if not TestCollisionYwithGear(Gear, yyn) then |
cc5976f292f9
Cake makes a step after turn. This fixes cake stucking in air
unc0rr
parents:
1634
diff
changeset
|
1924 |
begin |
cc5976f292f9
Cake makes a step after turn. This fixes cake stucking in air
unc0rr
parents:
1634
diff
changeset
|
1925 |
Gear^.Y:= Gear^.Y + int2hwFloat(yyn); |
cc5976f292f9
Cake makes a step after turn. This fixes cake stucking in air
unc0rr
parents:
1634
diff
changeset
|
1926 |
NextAngle |
cc5976f292f9
Cake makes a step after turn. This fixes cake stucking in air
unc0rr
parents:
1634
diff
changeset
|
1927 |
end; |
1089 | 1928 |
end; |
1929 |
||
1103 | 1930 |
if Gear^.Tag = 0 then |
1931 |
begin |
|
1932 |
CakeI:= (CakeI + 1) mod cakeh; |
|
1933 |
tdx:= CakePoints[CakeI].x - Gear^.X; |
|
1934 |
tdy:= - CakePoints[CakeI].y + Gear^.Y; |
|
1935 |
CakePoints[CakeI].x:= Gear^.X; |
|
1936 |
CakePoints[CakeI].y:= Gear^.Y; |
|
1937 |
Gear^.DirAngle:= DxDy2Angle(tdx, tdy); |
|
1938 |
end; |
|
1939 |
||
1089 | 1940 |
dec(Gear^.Health); |
2208
7d1a084d11ab
disable timers on a few silly items, trying out a timer on cake
nemo
parents:
2204
diff
changeset
|
1941 |
Gear^.Timer:= Gear^.Health*10; // This is not seconds, but at least it is *some* feedback |
1090 | 1942 |
if (Gear^.Health = 0) or ((Gear^.Message and gm_Attack) <> 0) then |
1089 | 1943 |
begin |
1109 | 1944 |
FollowGear:= Gear; |
2358 | 1945 |
Gear^.RenderTimer:= false; |
1109 | 1946 |
Gear^.doStep:= @doStepCakeDown |
1089 | 1947 |
end |
1088 | 1948 |
end; |
1089 | 1949 |
|
1103 | 1950 |
procedure doStepCakeUp(Gear: PGear); |
1951 |
var i: Longword; |
|
1952 |
begin |
|
1953 |
AllInactive:= false; |
|
1954 |
||
1108 | 1955 |
inc(Gear^.Tag); |
1109 | 1956 |
if Gear^.Tag < 100 then exit; |
1108 | 1957 |
Gear^.Tag:= 0; |
1958 |
||
1109 | 1959 |
if Gear^.Pos = 6 then |
1103 | 1960 |
begin |
1961 |
for i:= 0 to Pred(cakeh) do |
|
1962 |
begin |
|
1963 |
CakePoints[i].x:= Gear^.X; |
|
1964 |
CakePoints[i].y:= Gear^.Y |
|
1965 |
end; |
|
1966 |
CakeI:= 0; |
|
1967 |
Gear^.doStep:= @doStepCakeWork |
|
1109 | 1968 |
end else inc(Gear^.Pos) |
1103 | 1969 |
end; |
1970 |
||
1089 | 1971 |
procedure doStepCakeFall(Gear: PGear); |
1972 |
begin |
|
1973 |
AllInactive:= false; |
|
1974 |
||
1975 |
Gear^.dY:= Gear^.dY + cGravity; |
|
1976 |
if TestCollisionYwithGear(Gear, 1) then |
|
1103 | 1977 |
Gear^.doStep:= @doStepCakeUp |
1089 | 1978 |
else |
1979 |
begin |
|
1980 |
Gear^.Y:= Gear^.Y + Gear^.dY; |
|
1981 |
if CheckGearDrowning(Gear) then AfterAttack |
|
1982 |
end |
|
1983 |
end; |
|
1984 |
||
1985 |
procedure doStepCake(Gear: PGear); |
|
1986 |
var HHGear: PGear; |
|
1987 |
begin |
|
1988 |
AllInactive:= false; |
|
1989 |
||
1990 |
HHGear:= PHedgehog(Gear^.Hedgehog)^.Gear; |
|
1103 | 1991 |
HHGear^.Message:= HHGear^.Message and (not gm_Attack); |
1089 | 1992 |
DeleteCI(HHGear); |
1993 |
||
1106 | 1994 |
FollowGear:= Gear; |
1995 |
||
1089 | 1996 |
Gear^.doStep:= @doStepCakeFall |
1997 |
end; |
|
1998 |
||
1259 | 1999 |
//////////////////////////////////////////////////////////////////////////////// |
1284 | 2000 |
procedure doStepSeductionWork(Gear: PGear); |
2001 |
var x, y: LongInt; |
|
1259 | 2002 |
begin |
2003 |
AllInactive:= false; |
|
1284 | 2004 |
|
2005 |
Gear^.X:= Gear^.X + Gear^.dX; |
|
2006 |
Gear^.Y:= Gear^.Y + Gear^.dY; |
|
2007 |
x:= hwRound(Gear^.X); |
|
2008 |
y:= hwRound(Gear^.Y); |
|
1259 | 2009 |
|
1753 | 2010 |
if ((y and LAND_HEIGHT_MASK) = 0) and ((x and LAND_WIDTH_MASK) = 0) then |
1284 | 2011 |
if (Land[y, x] <> 0) then |
2012 |
begin |
|
2013 |
Gear^.dX.isNegative:= not Gear^.dX.isNegative; |
|
2014 |
Gear^.dY.isNegative:= not Gear^.dY.isNegative; |
|
1286 | 2015 |
Gear^.dX:= Gear^.dX * _1_5; |
2016 |
Gear^.dY:= Gear^.dY * _1_5 - _0_3; |
|
1284 | 2017 |
AmmoShove(Gear, 0, 40); |
1286 | 2018 |
AfterAttack; |
1284 | 2019 |
DeleteGear(Gear) |
2020 |
end |
|
2021 |
else |
|
2022 |
else |
|
1286 | 2023 |
begin |
2024 |
AfterAttack; |
|
1284 | 2025 |
DeleteGear(Gear) |
1286 | 2026 |
end |
2027 |
end; |
|
2028 |
||
2029 |
procedure doStepSeductionWear(Gear: PGear); |
|
2030 |
begin |
|
2031 |
AllInactive:= false; |
|
2032 |
inc(Gear^.Timer); |
|
2033 |
if Gear^.Timer > 250 then |
|
2034 |
begin |
|
2035 |
Gear^.Timer:= 0; |
|
1388 | 2036 |
inc(Gear^.Pos); |
2037 |
if Gear^.Pos = 5 then |
|
1669 | 2038 |
PlaySound(sndYoohoo, false, PHedgehog(Gear^.Hedgehog)^.Team^.voicepack) |
1286 | 2039 |
end; |
1367 | 2040 |
|
2041 |
if Gear^.Pos = 14 then |
|
1286 | 2042 |
Gear^.doStep:= @doStepSeductionWork |
1259 | 2043 |
end; |
1284 | 2044 |
|
2045 |
procedure doStepSeduction(Gear: PGear); |
|
2046 |
begin |
|
2047 |
AllInactive:= false; |
|
2048 |
DeleteCI(PHedgehog(Gear^.Hedgehog)^.Gear); |
|
1286 | 2049 |
Gear^.doStep:= @doStepSeductionWear |
1284 | 2050 |
end; |
1298 | 2051 |
|
2052 |
//////////////////////////////////////////////////////////////////////////////// |
|
2053 |
procedure doStepWaterUp(Gear: PGear); |
|
2054 |
var i: LongWord; |
|
2055 |
begin |
|
2056 |
AllInactive:= false; |
|
2057 |
||
2058 |
inc(Gear^.Timer); |
|
2059 |
if Gear^.Timer = 17 then |
|
2060 |
Gear^.Timer:= 0 |
|
2061 |
else |
|
2062 |
exit; |
|
2063 |
||
2064 |
if cWaterLine > 0 then |
|
2065 |
begin |
|
2066 |
dec(cWaterLine); |
|
1760 | 2067 |
for i:= 0 to LAND_WIDTH - 1 do |
1298 | 2068 |
Land[cWaterLine, i]:= 0; |
2069 |
SetAllToActive |
|
2070 |
end; |
|
2071 |
||
2072 |
inc(Gear^.Tag); |
|
1343 | 2073 |
if (Gear^.Tag = 47) or (cWaterLine = 0) then |
1298 | 2074 |
DeleteGear(Gear) |
2075 |
end; |
|
1573 | 2076 |
|
2077 |
//////////////////////////////////////////////////////////////////////////////// |
|
1590 | 2078 |
procedure doStepDrillDrilling(Gear: PGear); |
1633 | 2079 |
var t: PGearArray; |
2080 |
ox, oy: hwFloat; |
|
1573 | 2081 |
begin |
1590 | 2082 |
AllInactive:= false; |
2083 |
||
1633 | 2084 |
if (Gear^.Timer > 0) and ((Gear^.Timer mod 10) = 0) then |
1590 | 2085 |
begin |
1573 | 2086 |
ox:= Gear^.X; |
2087 |
oy:= Gear^.Y; |
|
2088 |
Gear^.X:= Gear^.X + Gear^.dX; |
|
2089 |
Gear^.Y:= Gear^.Y + Gear^.dY; |
|
2090 |
DrawTunnel(oX, oY, Gear^.dX, Gear^.dY, 2, 6); |
|
2091 |
CheckGearDrowning(Gear); |
|
1590 | 2092 |
end; |
2093 |
||
1633 | 2094 |
t:= CheckGearsCollision(Gear); //fixes drill not exploding when touching HH bug |
1590 | 2095 |
if (Gear^.Timer = 0) |
1633 | 2096 |
or (t^.Count <> 0) |
1590 | 2097 |
or (not TestCollisionYWithGear(Gear, hwSign(Gear^.dY)) |
1784 | 2098 |
and not TestCollisionXWithGear(Gear, hwSign(Gear^.dX))) |
2099 |
or (Land[hwRound(Gear^.Y), hwRound(Gear^.X)] = COLOR_INDESTRUCTIBLE) then |
|
1590 | 2100 |
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
|
2101 |
StopSound(sndPickhammer); |
1590 | 2102 |
doMakeExplosion(hwRound(Gear^.X), hwRound(Gear^.Y), 50, EXPLAutoSound); |
2103 |
DeleteGear(Gear); |
|
2104 |
exit |
|
2105 |
end; |
|
2106 |
||
2107 |
dec(Gear^.Timer); |
|
1573 | 2108 |
end; |
2109 |
||
2110 |
procedure doStepDrill(Gear: PGear); |
|
1590 | 2111 |
var t: PGearArray; |
1633 | 2112 |
oldDx, oldDy: hwFloat; |
2113 |
t2: hwFloat; |
|
1573 | 2114 |
begin |
1590 | 2115 |
AllInactive:= false; |
1573 | 2116 |
|
1590 | 2117 |
Gear^.dX:= Gear^.dX + cWindSpeed; |
2118 |
oldDx:= Gear^.dX; |
|
2119 |
oldDy:= Gear^.dY; |
|
2120 |
||
2121 |
doStepFallingGear(Gear); |
|
2122 |
||
2123 |
if (GameTicks and $3F) = 0 then |
|
2124 |
AddGear(hwRound(Gear^.X), hwRound(Gear^.Y), gtSmokeTrace, 0, _0, _0, 0); |
|
1573 | 2125 |
|
1633 | 2126 |
if ((Gear^.State and gstCollision) <> 0) then begin //hit |
1590 | 2127 |
Gear^.dX:= oldDx; |
2128 |
Gear^.dY:= oldDy; |
|
1633 | 2129 |
|
1590 | 2130 |
t:= CheckGearsCollision(Gear); |
1633 | 2131 |
if (t^.Count = 0) then begin //hit the ground not the HH |
2132 |
t2 := _0_5 / Distance(Gear^.dX, Gear^.dY); |
|
2133 |
Gear^.dX:= Gear^.dX * t2; |
|
2134 |
Gear^.dY:= Gear^.dY * t2; |
|
2135 |
end else begin //explode right on contact with HH |
|
2136 |
doMakeExplosion(hwRound(Gear^.X), hwRound(Gear^.Y), 50, EXPLAutoSound); |
|
2137 |
DeleteGear(Gear); |
|
2138 |
exit; |
|
2139 |
end; |
|
2376 | 2140 |
|
2462
fa3ddd1ff2a1
Suggestion by Smaxx - use pickhammer sound while drill is in operation
nemo
parents:
2460
diff
changeset
|
2141 |
PlaySound(sndPickhammer, true, nil); |
1590 | 2142 |
Gear^.doStep:= @doStepDrillDrilling; |
1633 | 2143 |
dec(Gear^.Timer) |
1590 | 2144 |
end |
2145 |
end; |
|
1601 | 2146 |
|
1633 | 2147 |
//////////////////////////////////////////////////////////////////////////////// |
1601 | 2148 |
procedure doStepBallgunWork(Gear: PGear); |
2149 |
var HHGear: PGear; |
|
1630 | 2150 |
rx, ry: hwFloat; |
1601 | 2151 |
begin |
2152 |
AllInactive:= false; |
|
2153 |
dec(Gear^.Timer); |
|
2154 |
HHGear:= PHedgehog(Gear^.Hedgehog)^.Gear; |
|
2155 |
HedgehogChAngle(HHGear); |
|
2156 |
if (Gear^.Timer mod 100) = 0 then |
|
2157 |
begin |
|
1630 | 2158 |
rx:= rndSign(getRandom * _0_1); |
2159 |
ry:= rndSign(getRandom * _0_1); |
|
2376 | 2160 |
|
1630 | 2161 |
AddGear(hwRound(Gear^.X), hwRound(Gear^.Y), gtBall, 0, |
2162 |
SignAs(AngleSin(HHGear^.Angle) * _0_8, HHGear^.dX) + rx, |
|
2163 |
AngleCos(HHGear^.Angle) * ( - _0_8) + ry, |
|
2164 |
0); |
|
2376 | 2165 |
|
1669 | 2166 |
PlaySound(sndGun, false, nil); |
1601 | 2167 |
end; |
2168 |
||
1643 | 2169 |
if (Gear^.Timer = 0) or (HHGear^.Damage <> 0) then |
1601 | 2170 |
begin |
2171 |
DeleteGear(Gear); |
|
1643 | 2172 |
AfterAttack |
2173 |
end |
|
1601 | 2174 |
end; |
2175 |
||
2176 |
procedure doStepBallgun(Gear: PGear); |
|
2177 |
var HHGear: PGear; |
|
2178 |
begin |
|
2179 |
HHGear:= PHedgehog(Gear^.Hedgehog)^.Gear; |
|
2180 |
HHGear^.Message:= HHGear^.Message and not (gm_Up or gm_Down); |
|
2181 |
HHGear^.State:= HHGear^.State or gstNotKickable; |
|
2182 |
Gear^.doStep:= @doStepBallgunWork |
|
1633 | 2183 |
end; |
1689 | 2184 |
|
1696 | 2185 |
//////////////////////////////////////////////////////////////////////////////// |
1689 | 2186 |
procedure doStepRCPlaneWork(Gear: PGear); |
2187 |
const cAngleSpeed = 3; |
|
2188 |
var HHGear: PGear; |
|
2189 |
i: LongInt; |
|
2190 |
dX, dY: hwFloat; |
|
2191 |
fChanged: boolean; |
|
2192 |
trueAngle: Longword; |
|
2193 |
t: PGear; |
|
2194 |
begin |
|
2195 |
AllInactive:= false; |
|
2196 |
||
2428 | 2197 |
if ((TrainingFlags and tfRCPlane) = 0) and (Gear^.Timer > 0) then dec(Gear^.Timer); |
2198 |
||
2199 |
if ((TrainingFlags and tfRCPlane) <> 0) and ((TrainingFlags and tfTimeTrial) <> 0 ) and (TimeTrialStartTime = 0) then TimeTrialStartTime:= RealTicks; |
|
1689 | 2200 |
|
2201 |
HHGear:= PHedgehog(Gear^.Hedgehog)^.Gear; |
|
2202 |
FollowGear:= Gear; |
|
2203 |
||
2204 |
fChanged:= false; |
|
1696 | 2205 |
if ((HHGear^.State and gstHHDriven) = 0) or (Gear^.Timer = 0) then |
1689 | 2206 |
begin |
2207 |
fChanged:= true; |
|
1696 | 2208 |
if Gear^.Angle > 2048 then dec(Gear^.Angle) else |
2209 |
if Gear^.Angle < 2048 then inc(Gear^.Angle) else fChanged:= false |
|
2210 |
end |
|
2211 |
else |
|
2212 |
begin |
|
2213 |
if ((Gear^.Message and gm_Left) <> 0) then |
|
2214 |
begin |
|
2215 |
fChanged:= true; |
|
2216 |
Gear^.Angle:= (Gear^.Angle + (4096 - cAngleSpeed)) mod 4096 |
|
2217 |
end; |
|
1689 | 2218 |
|
1696 | 2219 |
if ((Gear^.Message and gm_Right) <> 0) then |
2220 |
begin |
|
2221 |
fChanged:= true; |
|
2222 |
Gear^.Angle:= (Gear^.Angle + cAngleSpeed) mod 4096 |
|
2223 |
end |
|
1689 | 2224 |
end; |
2225 |
||
2226 |
if fChanged then |
|
2227 |
begin |
|
2228 |
Gear^.dX.isNegative:= (Gear^.Angle > 2048); |
|
2229 |
if Gear^.dX.isNegative then |
|
2230 |
trueAngle:= 4096 - Gear^.Angle |
|
2231 |
else |
|
2232 |
trueAngle:= Gear^.Angle; |
|
2233 |
||
2234 |
Gear^.dX:= SignAs(AngleSin(trueAngle), Gear^.dX) * _0_25; |
|
2235 |
Gear^.dY:= AngleCos(trueAngle) * -_0_25; |
|
2236 |
end; |
|
2237 |
||
2238 |
Gear^.X:= Gear^.X + Gear^.dX; |
|
2239 |
Gear^.Y:= Gear^.Y + Gear^.dY; |
|
2240 |
||
2428 | 2241 |
if (TrainingFlags and tfRCPlane) = 0 then |
2242 |
begin |
|
2243 |
if (GameTicks and $FF) = 0 then |
|
2244 |
if Gear^.Timer < 3500 then |
|
2245 |
AddGear(hwRound(Gear^.X), hwRound(Gear^.Y), gtEvilTrace, 0, _0, _0, 0) |
|
2246 |
else |
|
2247 |
AddGear(hwRound(Gear^.X), hwRound(Gear^.Y), gtSmokeTrace, 0, _0, _0, 0); |
|
2248 |
||
2249 |
if ((HHGear^.Message and gm_Attack) <> 0) and (Gear^.Health <> 0) then |
|
2250 |
begin |
|
2251 |
HHGear^.Message := HHGear^.Message and not gm_Attack; |
|
2252 |
AddGear(hwRound(Gear^.X), hwRound(Gear^.Y), gtAirBomb, 0, Gear^.dX * _0_5, Gear^.dY * _0_5, 0); |
|
2253 |
dec(Gear^.Health) |
|
2254 |
end; |
|
2255 |
||
2256 |
if ((HHGear^.Message and gm_LJump) <> 0) |
|
2257 |
and ((Gear^.State and gsttmpFlag) = 0) then |
|
2258 |
begin |
|
2259 |
Gear^.State:= Gear^.State or gsttmpFlag; |
|
2260 |
PauseMusic; |
|
2261 |
playSound(sndRideOfTheValkyries, false, nil); |
|
2262 |
end; |
|
2263 |
||
2264 |
// pickup bonuses |
|
2265 |
t:= CheckGearNear(Gear, gtCase, 36, 36); |
|
2266 |
if t <> nil then |
|
2267 |
PickUp(HHGear, t); |
|
2268 |
end |
|
2269 |
else |
|
2270 |
begin |
|
2271 |
if (GameTicks and $FF) = 0 then |
|
1696 | 2272 |
AddGear(hwRound(Gear^.X), hwRound(Gear^.Y), gtSmokeTrace, 0, _0, _0, 0); |
1689 | 2273 |
|
2428 | 2274 |
// pickup targets |
2275 |
t:= CheckGearNear(Gear, gtTarget, 36, 36); |
|
2276 |
if t <> nil then |
|
2460 | 2277 |
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
|
2278 |
if t^.Tag <> 0 then // collect it only once |
2460 | 2279 |
exit; |
2280 |
PlaySound(sndShotgunReload, false, nil); |
|
2281 |
t^.Tag:= 1; |
|
2282 |
TrainingTargetGear:= nil; // remove target cursor |
|
2283 |
exit; |
|
2428 | 2284 |
end; |
1712 | 2285 |
|
2428 | 2286 |
if (TurnTimeLeft > 0) then |
2287 |
dec(TurnTimeLeft) |
|
2288 |
end; |
|
2289 |
||
1689 | 2290 |
CheckCollision(Gear); |
2291 |
||
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
|
2292 |
if ((Gear^.State and gstCollision) <> 0) or (((TrainingFlags and tfRCPlane) <> 0) and (TurnTimeLeft = 0)) |
1712 | 2293 |
or CheckGearDrowning(Gear) then |
1689 | 2294 |
begin |
2428 | 2295 |
if ((TrainingFlags and tfRCPlane) <> 0) and ((TrainingFlags and tfTimeTrial) <> 0 ) and (TimeTrialStopTime = 0) then TimeTrialStopTime:= RealTicks; |
1712 | 2296 |
StopSound(sndRCPlane); |
2297 |
StopSound(sndRideOfTheValkyries); |
|
2298 |
ResumeMusic; |
|
2376 | 2299 |
|
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
|
2300 |
if ((Gear^.State and gstCollision) <> 0) or (((TrainingFlags and tfRCPlane) <> 0) and (TurnTimeLeft = 0)) then |
1689 | 2301 |
begin |
1712 | 2302 |
doMakeExplosion(hwRound(Gear^.X), hwRound(Gear^.Y), 25, EXPLAutoSound); |
1714 | 2303 |
for i:= 0 to 32 do |
1712 | 2304 |
begin |
1714 | 2305 |
dX:= AngleCos(i * 64) * _0_5 * (GetRandom + _1); |
2306 |
dY:= AngleSin(i * 64) * _0_5 * (GetRandom + _1); |
|
1712 | 2307 |
AddGear(hwRound(Gear^.X), hwRound(Gear^.Y), gtFlame, 0, dX, dY, 0); |
2308 |
AddGear(hwRound(Gear^.X), hwRound(Gear^.Y), gtFlame, 0, dX, -dY, 0); |
|
2309 |
end; |
|
2310 |
DeleteGear(Gear) |
|
1689 | 2311 |
end; |
1713 | 2312 |
|
1689 | 2313 |
AfterAttack; |
1713 | 2314 |
CurAmmoGear:= nil; |
1697 | 2315 |
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
|
2316 |
|
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
|
2317 |
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
|
2318 |
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
|
2319 |
|
1712 | 2320 |
HHGear^.Message:= 0; |
1697 | 2321 |
ParseCommand('/taunt '#1, true) |
2322 |
end |
|
1689 | 2323 |
end; |
2324 |
||
2325 |
procedure doStepRCPlane(Gear: PGear); |
|
2326 |
var HHGear: PGear; |
|
2327 |
begin |
|
2328 |
HHGear:= PHedgehog(Gear^.Hedgehog)^.Gear; |
|
2329 |
HHGear^.Message:= 0; |
|
2330 |
HHGear^.State:= HHGear^.State or gstNotKickable; |
|
2331 |
Gear^.Angle:= HHGear^.Angle; |
|
1696 | 2332 |
Gear^.Tag:= hwSign(HHGear^.dX); |
1689 | 2333 |
if HHGear^.dX.isNegative then Gear^.Angle:= 4096 - Gear^.Angle; |
2334 |
Gear^.doStep:= @doStepRCPlaneWork |
|
1712 | 2335 |
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
|
2336 |
|
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 |
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
|
2338 |
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
|
2339 |
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
|
2340 |
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
|
2341 |
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
|
2342 |
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
|
2343 |
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
|
2344 |
//dec(Gear^.Timer); |
2440 | 2345 |
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
|
2346 |
fuel:= 50; |
2182
ed7e7eb3f9ed
Ugly graphic for jetpack - jetpack should be essentially functional.
nemo
parents:
2181
diff
changeset
|
2347 |
(*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
|
2348 |
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
|
2349 |
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
|
2350 |
fuel:= 5; |
2182
ed7e7eb3f9ed
Ugly graphic for jetpack - jetpack should be essentially functional.
nemo
parents:
2181
diff
changeset
|
2351 |
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
|
2352 |
|
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
|
2353 |
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
|
2354 |
begin |
2433 | 2355 |
if (not HHGear^.dY.isNegative) or (HHGear^.Y > -_256) then |
2356 |
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
|
2357 |
HHGear^.dY:= HHGear^.dY - move; |
2182
ed7e7eb3f9ed
Ugly graphic for jetpack - jetpack should be essentially functional.
nemo
parents:
2181
diff
changeset
|
2358 |
dec(Gear^.Health, fuel); |
ed7e7eb3f9ed
Ugly graphic for jetpack - jetpack should be essentially functional.
nemo
parents:
2181
diff
changeset
|
2359 |
Gear^.MsgParam:= Gear^.MsgParam or gm_Up; |
ed7e7eb3f9ed
Ugly graphic for jetpack - jetpack should be essentially functional.
nemo
parents:
2181
diff
changeset
|
2360 |
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
|
2361 |
end; |
2187
66c0f9b3bd6f
set vector to negative *after* applying upward vector
nemo
parents:
2186
diff
changeset
|
2362 |
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
|
2363 |
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
|
2364 |
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
|
2365 |
HHGear^.dX:= HHGear^.dX + (move * _0_2); |
2182
ed7e7eb3f9ed
Ugly graphic for jetpack - jetpack should be essentially functional.
nemo
parents:
2181
diff
changeset
|
2366 |
dec(Gear^.Health, fuel div 5); |
ed7e7eb3f9ed
Ugly graphic for jetpack - jetpack should be essentially functional.
nemo
parents:
2181
diff
changeset
|
2367 |
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
|
2368 |
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
|
2369 |
end; |
2182
ed7e7eb3f9ed
Ugly graphic for jetpack - jetpack should be essentially functional.
nemo
parents:
2181
diff
changeset
|
2370 |
|
2376 | 2371 |
// erases them all at once :-/ |
2182
ed7e7eb3f9ed
Ugly graphic for jetpack - jetpack should be essentially functional.
nemo
parents:
2181
diff
changeset
|
2372 |
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
|
2373 |
begin |
ed7e7eb3f9ed
Ugly graphic for jetpack - jetpack should be essentially functional.
nemo
parents:
2181
diff
changeset
|
2374 |
Gear^.Timer:= 0; |
ed7e7eb3f9ed
Ugly graphic for jetpack - jetpack should be essentially functional.
nemo
parents:
2181
diff
changeset
|
2375 |
Gear^.MsgParam:= 0 |
ed7e7eb3f9ed
Ugly graphic for jetpack - jetpack should be essentially functional.
nemo
parents:
2181
diff
changeset
|
2376 |
end; |
ed7e7eb3f9ed
Ugly graphic for jetpack - jetpack should be essentially functional.
nemo
parents:
2181
diff
changeset
|
2377 |
|
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
|
2378 |
if Gear^.Health < 0 then Gear^.Health:= 0; |
2376 | 2379 |
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
|
2380 |
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
|
2381 |
//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
|
2382 |
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
|
2383 |
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
|
2384 |
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
|
2385 |
|
2278
28519f4f3f21
requested change by Tiy to Flying Saucer start (hover until first keypress)
nemo
parents:
2267
diff
changeset
|
2386 |
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
|
2387 |
HHGear^.Message:= HHGear^.Message and not (gm_Up or gm_Precise or gm_Left or gm_Right); |
2376 | 2388 |
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
|
2389 |
|
c045698e044f
Initial attempt at jetpack. Pluses, more like lunar lander (takes fall damage). Minuses, can't seem to cancel it or use alt weapon
nemo
parents:
2143
diff
changeset
|
2390 |
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
|
2391 |
Gear^.Y:= HHGear^.Y; |
2196 | 2392 |
// 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
|
2393 |
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
|
2394 |
|
28519f4f3f21
requested change by Tiy to Flying Saucer start (hover until first keypress)
nemo
parents:
2267
diff
changeset
|
2395 |
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
|
2396 |
|
2179 | 2397 |
if (Gear^.Health = 0) |
2180
6c5a339f8e28
Use different group to not erase messages, restore gear deletion on hog damage.
nemo
parents:
2179
diff
changeset
|
2398 |
or (HHGear^.Damage <> 0) |
2179 | 2399 |
or CheckGearDrowning(HHGear) |
2376 | 2400 |
or (TurnTimeLeft = 0) |
2189 | 2401 |
// allow brief ground touches - to be fair on this, might need another counter |
2190 | 2402 |
or (((GameTicks and $1FF) = 0) and (not HHGear^.dY.isNegative) and TestCollisionYwithGear(HHGear, 1)) |
2179 | 2403 |
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
|
2404 |
begin |
2179 | 2405 |
with HHGear^ do |
2406 |
begin |
|
2407 |
Message:= 0; |
|
2408 |
Active:= true; |
|
2409 |
State:= State or gstMoving |
|
2410 |
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
|
2411 |
DeleteGear(Gear); |
2179 | 2412 |
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
|
2413 |
// 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
|
2414 |
// 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
|
2415 |
//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
|
2416 |
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
|
2417 |
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
|
2418 |
|
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 |
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
|
2420 |
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
|
2421 |
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
|
2422 |
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
|
2423 |
|
c045698e044f
Initial attempt at jetpack. Pluses, more like lunar lander (takes fall damage). Minuses, can't seem to cancel it or use alt weapon
nemo
parents:
2143
diff
changeset
|
2424 |
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
|
2425 |
FollowGear:= HHGear; |
2179 | 2426 |
OnUsedAmmo(PHedgehog(HHGear^.Hedgehog)^); |
2427 |
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
|
2428 |
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
|
2429 |
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
|
2430 |
State:= State and not gstAttacking; |
2278
28519f4f3f21
requested change by Tiy to Flying Saucer start (hover until first keypress)
nemo
parents:
2267
diff
changeset
|
2431 |
Message:= Message and not (gm_Attack or gm_Up or gm_Precise or gm_Left or gm_Right); |
2301 | 2432 |
if (dY < _0_1) and (dY > -_0_1) then |
2433 |
begin |
|
2434 |
Gear^.State:= Gear^.State or gsttmpFlag; |
|
2435 |
dY:= dY - _0_2 |
|
2436 |
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
|
2437 |
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
|
2438 |
end; |