author | unc0rr |
Thu, 03 May 2012 12:21:16 +0400 | |
changeset 7013 | 54db061b5710 |
parent 7010 | 10a0a31804f3 |
child 7028 | 0f60591f3a16 |
permissions | -rw-r--r-- |
6581 | 1 |
(* |
2 |
* Hedgewars, a free turn based strategy game |
|
6700 | 3 |
* Copyright (c) 2004-2012 Andrey Korotaev <unC0Rr@gmail.com> |
6581 | 4 |
* |
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 |
|
8 |
* |
|
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. |
|
13 |
* |
|
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 |
|
17 |
*) |
|
18 |
||
19 |
{$INCLUDE "options.inc"} |
|
20 |
||
21 |
unit uGearsHedgehog; |
|
22 |
interface |
|
23 |
uses uTypes; |
|
24 |
||
25 |
procedure doStepHedgehog(Gear: PGear); |
|
26 |
procedure AfterAttack; |
|
27 |
procedure HedgehogStep(Gear: PGear); |
|
28 |
procedure doStepHedgehogMoving(Gear: PGear); |
|
29 |
procedure HedgehogChAngle(HHGear: PGear); |
|
30 |
procedure PickUp(HH, Gear: PGear); |
|
31 |
||
32 |
implementation |
|
6992 | 33 |
uses uConsts, uVariables, uFloat, uAmmos, uSound, uCaptions, |
6581 | 34 |
uCommands, uLocale, uUtils, uVisualGears, uStats, uIO, uScript, |
35 |
uGearsList, uGears, uCollisions, uRandom, uStore, uTeams, |
|
36 |
uGearsUtils; |
|
37 |
||
38 |
// Shouldn't more of this ammo switching stuff be moved to uAmmos ? |
|
39 |
function ChangeAmmo(HHGear: PGear): boolean; |
|
40 |
var slot, i: Longword; |
|
41 |
ammoidx: LongInt; |
|
42 |
begin |
|
43 |
ChangeAmmo:= false; |
|
44 |
slot:= HHGear^.MsgParam; |
|
45 |
||
46 |
with HHGear^.Hedgehog^ do |
|
47 |
begin |
|
48 |
HHGear^.Message:= HHGear^.Message and (not gmSlot); |
|
49 |
ammoidx:= 0; |
|
50 |
if ((HHGear^.State and (gstAttacking or gstAttacked)) <> 0) |
|
51 |
or ((MultiShootAttacks > 0) and ((Ammoz[CurAmmoType].Ammo.Propz and ammoprop_NoRoundEnd) = 0)) |
|
52 |
or ((HHGear^.State and gstHHDriven) = 0) then |
|
53 |
exit; |
|
54 |
ChangeAmmo:= true; |
|
55 |
||
56 |
while (ammoidx < cMaxSlotAmmoIndex) and (Ammo^[slot, ammoidx].AmmoType <> CurAmmoType) do |
|
57 |
inc(ammoidx); |
|
58 |
||
59 |
if ((Ammoz[CurAmmoType].Ammo.Propz and ammoprop_NoRoundEnd) <> 0) and (MultiShootAttacks > 0) then |
|
60 |
OnUsedAmmo(HHGear^.Hedgehog^); |
|
61 |
||
62 |
MultiShootAttacks:= 0; |
|
63 |
HHGear^.Message:= HHGear^.Message and (not (gmLJump or gmHJump)); |
|
64 |
||
65 |
if Ammoz[CurAmmoType].Slot = slot then |
|
66 |
begin |
|
67 |
i:= 0; |
|
68 |
repeat |
|
69 |
inc(ammoidx); |
|
70 |
if (ammoidx > cMaxSlotAmmoIndex) then |
|
71 |
begin |
|
72 |
inc(i); |
|
73 |
CurAmmoType:= amNothing; |
|
74 |
ammoidx:= -1; |
|
75 |
//TryDo(i < 2, 'Engine bug: no ammo in current slot', true) |
|
76 |
end; |
|
77 |
until (i = 1) or ((Ammo^[slot, ammoidx].Count > 0) |
|
78 |
and (Team^.Clan^.TurnNumber > Ammoz[Ammo^[slot, ammoidx].AmmoType].SkipTurns)) |
|
79 |
||
80 |
end |
|
81 |
else |
|
82 |
begin |
|
83 |
i:= 0; |
|
84 |
// check whether there is ammo in slot |
|
85 |
while (i <= cMaxSlotAmmoIndex) and ((Ammo^[slot, i].Count = 0) |
|
86 |
or (Team^.Clan^.TurnNumber <= Ammoz[Ammo^[slot, i].AmmoType].SkipTurns)) |
|
87 |
do inc(i); |
|
88 |
||
89 |
if i <= cMaxSlotAmmoIndex then |
|
90 |
ammoidx:= i |
|
91 |
else ammoidx:= -1 |
|
92 |
end; |
|
93 |
if ammoidx >= 0 then |
|
94 |
CurAmmoType:= Ammo^[slot, ammoidx].AmmoType; |
|
95 |
end |
|
96 |
end; |
|
97 |
||
98 |
procedure HHSetWeapon(HHGear: PGear); |
|
99 |
var t: LongInt; |
|
100 |
weap: TAmmoType; |
|
101 |
Hedgehog: PHedgehog; |
|
102 |
s: boolean; |
|
103 |
begin |
|
104 |
s:= false; |
|
105 |
||
106 |
weap:= TAmmoType(HHGear^.MsgParam); |
|
107 |
Hedgehog:= HHGear^.Hedgehog; |
|
108 |
||
109 |
if Hedgehog^.Team^.Clan^.TurnNumber <= Ammoz[weap].SkipTurns then |
|
110 |
exit; // weapon is not activated yet |
|
111 |
||
112 |
HHGear^.MsgParam:= Ammoz[weap].Slot; |
|
113 |
||
114 |
t:= cMaxSlotAmmoIndex; |
|
115 |
||
116 |
HHGear^.Message:= HHGear^.Message and (not gmWeapon); |
|
117 |
||
118 |
with Hedgehog^ do |
|
119 |
while (CurAmmoType <> weap) and (t >= 0) do |
|
120 |
begin |
|
121 |
s:= ChangeAmmo(HHGear); |
|
122 |
dec(t) |
|
123 |
end; |
|
124 |
||
125 |
if s then |
|
126 |
ApplyAmmoChanges(HHGear^.Hedgehog^) |
|
127 |
end; |
|
128 |
||
129 |
procedure HHSetTimer(Gear: PGear); |
|
130 |
var CurWeapon: PAmmo; |
|
131 |
color: LongWord; |
|
132 |
begin |
|
133 |
Gear^.Message:= Gear^.Message and (not gmTimer); |
|
6924 | 134 |
CurWeapon:= GetCurAmmoEntry(Gear^.Hedgehog^); |
6581 | 135 |
with Gear^.Hedgehog^ do |
136 |
if ((Gear^.Message and gmPrecise) <> 0) and ((CurWeapon^.Propz and ammoprop_SetBounce) <> 0) then |
|
137 |
begin |
|
138 |
color:= Gear^.Hedgehog^.Team^.Clan^.Color; |
|
139 |
case Gear^.MsgParam of |
|
140 |
1: begin |
|
141 |
AddCaption(format(trmsg[sidBounce], trmsg[sidBounce1]), color, capgrpAmmostate); |
|
142 |
CurWeapon^.Bounciness:= 350; |
|
143 |
end; |
|
144 |
2: begin |
|
145 |
AddCaption(format(trmsg[sidBounce], trmsg[sidBounce2]), color, capgrpAmmostate); |
|
146 |
CurWeapon^.Bounciness:= 700; |
|
147 |
end; |
|
148 |
3: begin |
|
149 |
AddCaption(format(trmsg[sidBounce], trmsg[sidBounce3]), color, capgrpAmmostate); |
|
150 |
CurWeapon^.Bounciness:= 1000; |
|
151 |
end; |
|
152 |
4: begin |
|
153 |
AddCaption(format(trmsg[sidBounce], trmsg[sidBounce4]), color, capgrpAmmostate); |
|
154 |
CurWeapon^.Bounciness:= 2000; |
|
155 |
end; |
|
156 |
5: begin |
|
157 |
AddCaption(format(trmsg[sidBounce], trmsg[sidBounce5]), color, capgrpAmmostate); |
|
158 |
CurWeapon^.Bounciness:= 4000; |
|
159 |
end |
|
160 |
end |
|
161 |
end |
|
162 |
else if (CurWeapon^.Propz and ammoprop_Timerable) <> 0 then |
|
163 |
begin |
|
164 |
CurWeapon^.Timer:= 1000 * Gear^.MsgParam; |
|
165 |
with CurrentTeam^ do |
|
166 |
ApplyAmmoChanges(Hedgehogs[CurrHedgehog]); |
|
167 |
end; |
|
168 |
end; |
|
169 |
||
170 |
||
171 |
procedure Attack(Gear: PGear); |
|
172 |
var xx, yy, newDx, newDy, lx, ly: hwFloat; |
|
173 |
speech: PVisualGear; |
|
174 |
newGear: PGear; |
|
175 |
CurWeapon: PAmmo; |
|
176 |
altUse: boolean; |
|
177 |
elastic: hwFloat; |
|
178 |
begin |
|
179 |
newGear:= nil; |
|
180 |
bShowFinger:= false; |
|
6924 | 181 |
CurWeapon:= GetCurAmmoEntry(Gear^.Hedgehog^); |
6581 | 182 |
with Gear^, |
183 |
Gear^.Hedgehog^ do |
|
184 |
begin |
|
185 |
if ((State and gstHHDriven) <> 0) and ((State and (gstAttacked or gstHHChooseTarget)) = 0) and (((State and gstMoving) = 0) |
|
186 |
or (Power > 0) |
|
187 |
or (CurAmmoType = amTeleport) |
|
188 |
or |
|
189 |
// Allow attacks while moving on ammo with AltAttack |
|
190 |
((CurAmmoGear <> nil) and ((Ammoz[CurAmmoGear^.AmmoType].Ammo.Propz and ammoprop_AltAttack) <> 0)) |
|
191 |
or ((Ammoz[CurAmmoType].Ammo.Propz and ammoprop_AttackInMove) <> 0)) |
|
192 |
and ((TargetPoint.X <> NoPointX) or ((Ammoz[CurAmmoType].Ammo.Propz and ammoprop_NeedTarget) = 0)) then |
|
193 |
begin |
|
194 |
State:= State or gstAttacking; |
|
195 |
if Power = cMaxPower then |
|
196 |
Message:= Message and (not gmAttack) |
|
197 |
else if (Ammoz[CurAmmoType].Ammo.Propz and ammoprop_Power) = 0 then |
|
198 |
Message:= Message and (not gmAttack) |
|
199 |
else |
|
200 |
begin |
|
201 |
if Power = 0 then |
|
202 |
begin |
|
203 |
AttackBar:= CurrentTeam^.AttackBar; |
|
204 |
PlaySound(sndThrowPowerUp) |
|
205 |
end; |
|
206 |
inc(Power) |
|
207 |
end; |
|
208 |
if ((Message and gmAttack) <> 0) then |
|
209 |
exit; |
|
210 |
||
211 |
if (Ammoz[CurAmmoType].Ammo.Propz and ammoprop_Power) <> 0 then |
|
212 |
begin |
|
213 |
StopSound(sndThrowPowerUp); |
|
214 |
PlaySound(sndThrowRelease); |
|
215 |
end; |
|
216 |
||
217 |
xx:= SignAs(AngleSin(Angle), dX); |
|
218 |
yy:= -AngleCos(Angle); |
|
219 |
||
220 |
lx:= X + int2hwfloat(round(GetLaunchX(CurAmmoType, hwSign(dX), Angle))); |
|
221 |
ly:= Y + int2hwfloat(round(GetLaunchY(CurAmmoType, Angle))); |
|
222 |
||
223 |
if ((Gear^.State and gstHHHJump) <> 0) and (not cArtillery) then |
|
224 |
xx:= - xx; |
|
225 |
if Ammoz[CurAmmoType].Ammo.AttackVoice <> sndNone then |
|
226 |
AddVoice(Ammoz[CurAmmoType].Ammo.AttackVoice, CurrentTeam^.voicepack); |
|
227 |
||
228 |
// Initiating alt attack |
|
229 |
if (CurAmmoGear <> nil) |
|
230 |
and ((Ammoz[CurAmmoGear^.AmmoType].Ammo.Propz and ammoprop_AltAttack) <> 0) |
|
231 |
and ((Gear^.Message and gmLJump) <> 0) |
|
232 |
and ((Ammoz[CurAmmoType].Ammo.Propz and ammoprop_AltUse) <> 0) then |
|
233 |
begin |
|
234 |
newDx:= dX / _2; |
|
235 |
newDy:= dY / _2; |
|
236 |
altUse:= true; |
|
237 |
end |
|
238 |
else |
|
239 |
begin |
|
240 |
newDx:= xx*Power/cPowerDivisor; |
|
241 |
newDy:= yy*Power/cPowerDivisor; |
|
242 |
altUse:= false |
|
243 |
end; |
|
244 |
||
245 |
case CurAmmoType of |
|
246 |
amGrenade: newGear:= AddGear(hwRound(lx), hwRound(ly), gtGrenade, 0, newDx, newDy, CurWeapon^.Timer); |
|
247 |
amMolotov: newGear:= AddGear(hwRound(lx), hwRound(ly), gtMolotov, 0, newDx, newDy, 0); |
|
248 |
amClusterBomb: newGear:= AddGear(hwRound(lx), hwRound(ly), gtClusterBomb, 0, newDx, newDy, CurWeapon^.Timer); |
|
249 |
amGasBomb: newGear:= AddGear(hwRound(lx), hwRound(ly), gtGasBomb, 0, newDx, newDy, CurWeapon^.Timer); |
|
250 |
amBazooka: newGear:= AddGear(hwRound(lx), hwRound(ly), gtShell, 0, newDx, newDy, 0); |
|
251 |
amSnowball: newGear:= AddGear(hwRound(lx), hwRound(ly), gtSnowball, 0, newDx, newDy, 0); |
|
252 |
amBee: newGear:= AddGear(hwRound(lx), hwRound(ly), gtBee, 0, newDx, newDy, 0); |
|
253 |
amShotgun: begin |
|
254 |
PlaySound(sndShotgunReload); |
|
255 |
newGear:= AddGear(hwRound(lx), hwRound(ly), gtShotgunShot, 0, xx * _0_5, yy * _0_5, 0); |
|
256 |
end; |
|
257 |
amPickHammer: newGear:= AddGear(hwRound(lx), hwRound(ly) + cHHRadius, gtPickHammer, 0, _0, _0, 0); |
|
258 |
amSkip: ParseCommand('/skip', true); |
|
259 |
amRope: newGear:= AddGear(hwRound(lx), hwRound(ly), gtRope, 0, xx, yy, 0); |
|
260 |
amMine: if altUse then |
|
261 |
newGear:= AddGear(hwRound(lx) + hwSign(dX) * 7, hwRound(ly), gtMine, gstWait, newDx, newDy, 3000) |
|
262 |
else |
|
263 |
newGear:= AddGear(hwRound(lx) + hwSign(dX) * 7, hwRound(ly), gtMine, gstWait, SignAs(_0_02, dX), _0, 3000); |
|
264 |
amSMine: newGear:= AddGear(hwRound(lx), hwRound(ly), gtSMine, 0, xx*Power/cPowerDivisor, yy*Power/cPowerDivisor, 0); |
|
265 |
amDEagle: newGear:= AddGear(hwRound(lx + xx * cHHRadius), hwRound(ly + yy * cHHRadius), gtDEagleShot, 0, xx * _0_5, yy * _0_5, 0); |
|
266 |
amSineGun: newGear:= AddGear(hwRound(lx + xx * cHHRadius), hwRound(ly + yy * cHHRadius), gtSineGunShot, 0, xx * _0_5, yy * _0_5, 0); |
|
267 |
amPortalGun: begin |
|
268 |
newGear:= AddGear(hwRound(lx + xx * cHHRadius), hwRound(ly + yy * cHHRadius), gtPortal, 0, xx * _0_6, yy * _0_6, |
|
269 |
// set selected color |
|
270 |
CurWeapon^.Pos); |
|
271 |
end; |
|
272 |
amSniperRifle: begin |
|
273 |
PlaySound(sndSniperReload); |
|
274 |
newGear:= AddGear(hwRound(lx + xx * cHHRadius), hwRound(ly + yy * cHHRadius), gtSniperRifleShot, 0, xx * _0_5, yy * _0_5, 0); |
|
275 |
end; |
|
276 |
amDynamite: newGear:= AddGear(hwRound(lx) + hwSign(dX) * 7, hwRound(ly), gtDynamite, 0, SignAs(_0_03, dX), _0, 5000); |
|
277 |
amFirePunch: newGear:= AddGear(hwRound(lx) + hwSign(dX) * 10, hwRound(ly), gtFirePunch, 0, xx, _0, 0); |
|
278 |
amWhip: begin |
|
279 |
newGear:= AddGear(hwRound(lx) + hwSign(dX) * 10, hwRound(ly), gtWhip, 0, SignAs(_1, dX), - _0_8, 0); |
|
280 |
PlaySound(sndWhipCrack) |
|
281 |
end; |
|
282 |
amHammer: begin |
|
283 |
newGear:= AddGear(hwRound(lx) + hwSign(dX) * 10, hwRound(ly), gtHammer, 0, SignAs(_1, dX), - _0_8, 0); |
|
284 |
PlaySound(sndWhack) |
|
285 |
end; |
|
286 |
amBaseballBat: begin |
|
287 |
newGear:= AddGear(hwRound(lx) + hwSign(dX) * 10, hwRound(ly), gtShover, gsttmpFlag, xx * _0_5, yy * _0_5, 0); |
|
288 |
PlaySound(sndBaseballBat) // TODO: Only play if something is hit? |
|
289 |
end; |
|
290 |
amParachute: begin |
|
291 |
newGear:= AddGear(hwRound(lx), hwRound(ly), gtParachute, 0, _0, _0, 0); |
|
292 |
PlaySound(sndParachute) |
|
293 |
end; |
|
294 |
// we save CurWeapon^.Pos (in this case: cursor direction) by using it as (otherwise irrelevant) X value of the new gear. |
|
295 |
amAirAttack: newGear:= AddGear(CurWeapon^.Pos, 0, gtAirAttack, 0, _0, _0, 0); |
|
296 |
amMineStrike: newGear:= AddGear(CurWeapon^.Pos, 0, gtAirAttack, 1, _0, _0, 0); |
|
297 |
amDrillStrike: newGear:= AddGear(CurWeapon^.Pos, 0, gtAirAttack, 3, _0, _0, CurWeapon^.Timer); |
|
298 |
amNapalm: newGear:= AddGear(CurWeapon^.Pos, 0, gtAirAttack, 2, _0, _0, 0); |
|
299 |
amBlowTorch: newGear:= AddGear(hwRound(lx), hwRound(ly), gtBlowTorch, 0, SignAs(_0_5, dX), _0, 0); |
|
300 |
amGirder: newGear:= AddGear(0, 0, gtGirder, CurWeapon^.Pos, _0, _0, 0); |
|
301 |
amTeleport: newGear:= AddGear(CurWeapon^.Pos, 0, gtTeleport, 0, _0, _0, 0); |
|
302 |
amSwitch: newGear:= AddGear(hwRound(lx), hwRound(ly), gtSwitcher, 0, _0, _0, 0); |
|
303 |
amMortar: begin |
|
304 |
playSound(sndMortar); |
|
305 |
newGear:= AddGear(hwRound(lx), hwRound(ly), gtMortar, 0, xx*cMaxPower/cPowerDivisor, yy*cMaxPower/cPowerDivisor, 0); |
|
306 |
end; |
|
307 |
amRCPlane: begin |
|
308 |
newGear:= AddGear(hwRound(lx), hwRound(ly), gtRCPlane, 0, xx * cMaxPower / cPowerDivisor / 4, yy * cMaxPower / cPowerDivisor / 4, 0); |
|
309 |
newGear^.SoundChannel:= LoopSound(sndRCPlane, nil) |
|
310 |
end; |
|
311 |
amKamikaze: newGear:= AddGear(hwRound(lx), hwRound(ly), gtKamikaze, 0, xx * _0_5, yy * _0_5, 0); |
|
312 |
amCake: newGear:= AddGear(hwRound(lx) + hwSign(dX) * 3, hwRound(ly), gtCake, 0, xx, _0, 0); |
|
313 |
amSeduction: newGear:= AddGear(hwRound(lx), hwRound(ly), gtSeduction, 0, _0, _0, 0); |
|
314 |
amWatermelon: newGear:= AddGear(hwRound(lx), hwRound(ly), gtWatermelon, 0, newDx, newDy, CurWeapon^.Timer); |
|
315 |
amHellishBomb: newGear:= AddGear(hwRound(lx), hwRound(ly), gtHellishBomb, 0, newDx, newDy, 0); |
|
316 |
amDrill: newGear:= AddGear(hwRound(lx), hwRound(ly), gtDrill, 0, newDx, newDy, 0); |
|
317 |
amBallgun: newGear:= AddGear(hwRound(X), hwRound(Y), gtBallgun, 0, xx * _0_5, yy * _0_5, 0); |
|
318 |
amJetpack: newGear:= AddGear(hwRound(lx), hwRound(ly), gtJetpack, 0, _0, _0, 0); |
|
319 |
amBirdy: begin |
|
320 |
PlaySound(sndWhistle); |
|
321 |
newGear:= AddGear(hwRound(lx), hwRound(ly) - 32, gtBirdy, 0, _0, _0, 0); |
|
322 |
end; |
|
323 |
amLowGravity: begin |
|
324 |
PlaySound(sndLowGravity); |
|
325 |
cGravity:= cMaxWindSpeed; |
|
326 |
cGravityf:= 0.00025 |
|
327 |
end; |
|
328 |
amExtraDamage: begin |
|
329 |
PlaySound(sndHellishImpact4); |
|
330 |
cDamageModifier:= _1_5 |
|
331 |
end; |
|
332 |
amInvulnerable: Invulnerable:= true; |
|
333 |
amExtraTime: begin |
|
334 |
PlaySound(sndSwitchHog); |
|
335 |
TurnTimeLeft:= TurnTimeLeft + 30000 |
|
336 |
end; |
|
337 |
amLaserSight: cLaserSighting:= true; |
|
338 |
amVampiric: begin |
|
339 |
PlaySound(sndOw1, Team^.voicepack); |
|
340 |
cVampiric:= true; |
|
341 |
end; |
|
342 |
amPiano: begin |
|
343 |
// Tuck the hedgehog away until the piano attack is completed |
|
344 |
Unplaced:= true; |
|
345 |
X:= _0; |
|
346 |
Y:= _0; |
|
347 |
newGear:= AddGear(TargetPoint.X, 0, gtPiano, 0, _0, _0, 0); |
|
348 |
PauseMusic |
|
349 |
end; |
|
350 |
amFlamethrower: newGear:= AddGear(hwRound(X), hwRound(Y), gtFlamethrower, 0, xx * _0_5, yy * _0_5, 0); |
|
351 |
amLandGun: newGear:= AddGear(hwRound(X), hwRound(Y), gtLandGun, 0, xx * _0_5, yy * _0_5, 0); |
|
352 |
amResurrector: begin |
|
353 |
newGear:= AddGear(hwRound(lx), hwRound(ly), gtResurrector, 0, _0, _0, 0); |
|
354 |
newGear^.SoundChannel := LoopSound(sndResurrector); |
|
355 |
end; |
|
356 |
//amMelonStrike: AddGear(CurWeapon^.Pos, 0, gtAirAttack, 4, _0, _0, 0); |
|
357 |
amStructure: newGear:= AddGear(hwRound(lx) + hwSign(dX) * 7, hwRound(ly), gtStructure, gstWait, SignAs(_0_02, dX), _0, 3000); |
|
358 |
amTardis: newGear:= AddGear(hwRound(X), hwRound(Y), gtTardis, 0, _0, _0, 5000); |
|
7010
10a0a31804f3
Switch effects to longint for convenience of tracking ice states. I could add a new Hedgehog value, but since we have this effects list being all useless as booleans anyway...
nemo
parents:
6992
diff
changeset
|
359 |
amIceGun: newGear:= AddGear(hwRound(X), hwRound(Y), gtIceGun, 0, _0, _0, 0); |
6581 | 360 |
end; |
361 |
||
362 |
case CurAmmoType of |
|
363 |
amGrenade, amMolotov, |
|
364 |
amClusterBomb, amGasBomb, |
|
365 |
amBazooka, amSnowball, |
|
366 |
amBee, amSMine, |
|
367 |
amMortar, amWatermelon, |
|
368 |
amHellishBomb, amDrill: FollowGear:= newGear; |
|
369 |
||
370 |
amShotgun, amPickHammer, |
|
371 |
amRope, amDEagle, |
|
372 |
amSineGun, amSniperRifle, |
|
373 |
amFirePunch, amWhip, |
|
374 |
amHammer, amBaseballBat, |
|
375 |
amParachute, amBlowTorch, |
|
376 |
amGirder, amTeleport, |
|
377 |
amSwitch, amRCPlane, |
|
378 |
amKamikaze, amCake, |
|
379 |
amSeduction, amBallgun, |
|
380 |
amJetpack, amBirdy, |
|
381 |
amFlamethrower, amLandGun, |
|
382 |
amResurrector, amStructure, |
|
7010
10a0a31804f3
Switch effects to longint for convenience of tracking ice states. I could add a new Hedgehog value, but since we have this effects list being all useless as booleans anyway...
nemo
parents:
6992
diff
changeset
|
383 |
amTardis, amPiano, |
10a0a31804f3
Switch effects to longint for convenience of tracking ice states. I could add a new Hedgehog value, but since we have this effects list being all useless as booleans anyway...
nemo
parents:
6992
diff
changeset
|
384 |
amIceGun: CurAmmoGear:= newGear; |
6581 | 385 |
end; |
386 |
||
387 |
if ((CurAmmoType = amMine) or (CurAmmoType = amSMine)) and (GameFlags and gfInfAttack <> 0) then |
|
388 |
newGear^.FlightTime:= GameTicks + 1000 |
|
389 |
else if CurAmmoType = amDrill then |
|
390 |
newGear^.FlightTime:= GameTicks + 250; |
|
391 |
if Ammoz[CurAmmoType].Ammo.Propz and ammoprop_NeedTarget <> 0 then |
|
392 |
begin |
|
393 |
newGear^.Target.X:= TargetPoint.X; |
|
394 |
newGear^.Target.Y:= TargetPoint.Y |
|
395 |
end; |
|
396 |
||
397 |
// Clear FollowGear if using on a rope/parachute/saucer etc so focus stays with the hog's movement |
|
398 |
if altUse then |
|
399 |
FollowGear:= nil; |
|
400 |
||
401 |
if (newGear <> nil) and ((Ammoz[newGear^.AmmoType].Ammo.Propz and ammoprop_SetBounce) <> 0) then |
|
402 |
begin |
|
403 |
elastic:= int2hwfloat(CurWeapon^.Bounciness) / _1000; |
|
404 |
||
405 |
if elastic < _1 then |
|
406 |
newGear^.Elasticity:= newGear^.Elasticity * elastic |
|
407 |
else if elastic > _1 then |
|
408 |
newGear^.Elasticity:= _1 - ((_1-newGear^.Elasticity) / elastic); |
|
409 |
(* Experimented with friction modifier. Didn't seem helpful |
|
410 |
fric:= int2hwfloat(CurWeapon^.Bounciness) / _250; |
|
411 |
if fric < _1 then newGear^.Friction:= newGear^.Friction * fric |
|
412 |
else if fric > _1 then newGear^.Friction:= _1 - ((_1-newGear^.Friction) / fric)*) |
|
413 |
end; |
|
414 |
||
415 |
||
416 |
uStats.AmmoUsed(CurAmmoType); |
|
417 |
||
418 |
if not (SpeechText = '') then |
|
419 |
begin |
|
420 |
speech:= AddVisualGear(0, 0, vgtSpeechBubble); |
|
421 |
if speech <> nil then |
|
422 |
begin |
|
423 |
speech^.Text:= SpeechText; |
|
424 |
speech^.Hedgehog:= Gear^.Hedgehog; |
|
425 |
speech^.FrameTicks:= SpeechType; |
|
426 |
end; |
|
427 |
SpeechText:= '' |
|
428 |
end; |
|
429 |
||
430 |
Power:= 0; |
|
431 |
if (CurAmmoGear <> nil) |
|
432 |
and ((Ammoz[CurAmmoType].Ammo.Propz and ammoprop_AltUse) = 0){check for dropping ammo from rope} then |
|
433 |
begin |
|
434 |
Message:= Message or gmAttack; |
|
435 |
CurAmmoGear^.Message:= Message |
|
436 |
end |
|
437 |
else |
|
438 |
begin |
|
439 |
if not CurrentTeam^.ExtDriven |
|
440 |
and ((Ammoz[CurAmmoType].Ammo.Propz and ammoprop_Power) <> 0) then |
|
441 |
SendIPC('a'); |
|
442 |
AfterAttack; |
|
443 |
end |
|
444 |
end |
|
445 |
else |
|
446 |
Message:= Message and (not gmAttack); |
|
447 |
end; |
|
448 |
TargetPoint.X := NoPointX; |
|
449 |
ScriptCall('onHogAttack'); |
|
450 |
end; |
|
451 |
||
452 |
procedure AfterAttack; |
|
453 |
var s: shortstring; |
|
454 |
a: TAmmoType; |
|
455 |
begin |
|
456 |
with CurrentHedgehog^.Gear^, CurrentHedgehog^ do |
|
457 |
begin |
|
458 |
a:= CurAmmoType; |
|
459 |
State:= State and (not gstAttacking); |
|
460 |
if (Ammoz[a].Ammo.Propz and ammoprop_Effect) = 0 then |
|
461 |
begin |
|
462 |
Inc(MultiShootAttacks); |
|
463 |
||
464 |
if (Ammoz[a].Ammo.NumPerTurn >= MultiShootAttacks) then |
|
465 |
begin |
|
466 |
s:= inttostr(Ammoz[a].Ammo.NumPerTurn - MultiShootAttacks + 1); |
|
467 |
AddCaption(format(trmsg[sidRemaining], s), cWhiteColor, capgrpAmmostate); |
|
468 |
end; |
|
469 |
||
470 |
if (Ammoz[a].Ammo.NumPerTurn >= MultiShootAttacks) |
|
471 |
or ((GameFlags and gfMultiWeapon) <> 0) then |
|
472 |
begin |
|
473 |
isInMultiShoot:= true |
|
474 |
end |
|
475 |
else |
|
476 |
begin |
|
477 |
OnUsedAmmo(CurrentHedgehog^); |
|
478 |
if ((Ammoz[a].Ammo.Propz and ammoprop_NoRoundEnd) = 0) and (((GameFlags and gfInfAttack) = 0) or PlacingHogs) then |
|
479 |
begin |
|
480 |
if TagTurnTimeLeft = 0 then |
|
481 |
TagTurnTimeLeft:= TurnTimeLeft; |
|
482 |
TurnTimeLeft:=(Ammoz[a].TimeAfterTurn * cGetAwayTime) div 100; |
|
483 |
end; |
|
484 |
if ((Ammoz[a].Ammo.Propz and ammoprop_NoRoundEnd) = 0) then |
|
485 |
State:= State or gstAttacked; |
|
486 |
if (Ammoz[a].Ammo.Propz and ammoprop_NoRoundEnd) <> 0 then |
|
487 |
ApplyAmmoChanges(CurrentHedgehog^) |
|
488 |
end; |
|
489 |
end |
|
490 |
else |
|
491 |
begin |
|
492 |
OnUsedAmmo(CurrentHedgehog^); |
|
493 |
ApplyAmmoChanges(CurrentHedgehog^); |
|
494 |
end; |
|
495 |
AttackBar:= 0 |
|
496 |
end |
|
497 |
end; |
|
498 |
||
499 |
//////////////////////////////////////////////////////////////////////////////// |
|
500 |
procedure doStepHedgehogDead(Gear: PGear); |
|
501 |
const frametime = 200; |
|
502 |
timertime = frametime * 6; |
|
503 |
begin |
|
504 |
if Gear^.Hedgehog^.Unplaced then |
|
505 |
exit; |
|
506 |
if Gear^.Timer > 1 then |
|
507 |
begin |
|
508 |
AllInactive:= false; |
|
509 |
dec(Gear^.Timer); |
|
510 |
if (Gear^.Timer mod frametime) = 0 then |
|
511 |
inc(Gear^.Pos) |
|
512 |
end |
|
513 |
else if Gear^.Timer = 1 then |
|
514 |
begin |
|
515 |
Gear^.State:= Gear^.State or gstNoDamage; |
|
516 |
doMakeExplosion(hwRound(Gear^.X), hwRound(Gear^.Y), 30, CurrentHedgehog, EXPLAutoSound); |
|
517 |
AddGear(hwRound(Gear^.X), hwRound(Gear^.Y), gtGrave, 0, _0, _0, 0)^.Hedgehog:= Gear^.Hedgehog; |
|
518 |
DeleteGear(Gear); |
|
519 |
SetAllToActive |
|
520 |
end |
|
521 |
else // Gear^.Timer = 0 |
|
522 |
begin |
|
523 |
AllInactive:= false; |
|
524 |
Gear^.Z:= cCurrHHZ; |
|
525 |
RemoveGearFromList(Gear); |
|
526 |
InsertGearToList(Gear); |
|
527 |
PlaySound(sndByeBye, Gear^.Hedgehog^.Team^.voicepack); |
|
528 |
Gear^.Pos:= 0; |
|
529 |
Gear^.Timer:= timertime |
|
530 |
end |
|
531 |
end; |
|
532 |
||
533 |
//////////////////////////////////////////////////////////////////////////////// |
|
534 |
procedure doStepHedgehogGone(Gear: PGear); |
|
535 |
const frametime = 65; |
|
536 |
timertime = frametime * 11; |
|
537 |
begin |
|
538 |
if Gear^.Hedgehog^.Unplaced then |
|
539 |
exit; |
|
540 |
if Gear^.Timer > 1 then |
|
541 |
begin |
|
542 |
AllInactive:= false; |
|
543 |
dec(Gear^.Timer); |
|
544 |
if (Gear^.Timer mod frametime) = 0 then |
|
545 |
inc(Gear^.Pos) |
|
546 |
end |
|
547 |
else |
|
548 |
if Gear^.Timer = 1 then |
|
549 |
begin |
|
550 |
DeleteGear(Gear); |
|
551 |
SetAllToActive |
|
552 |
end |
|
553 |
else // Gear^.Timer = 0 |
|
554 |
begin |
|
555 |
AllInactive:= false; |
|
556 |
Gear^.Z:= cCurrHHZ; |
|
557 |
RemoveGearFromList(Gear); |
|
558 |
InsertGearToList(Gear); |
|
559 |
PlaySound(sndByeBye, Gear^.Hedgehog^.Team^.voicepack); |
|
560 |
PlaySound(sndWarp); |
|
561 |
Gear^.Pos:= 0; |
|
562 |
Gear^.Timer:= timertime |
|
563 |
end |
|
564 |
end; |
|
565 |
||
566 |
//////////////////////////////////////////////////////////////////////////////// |
|
567 |
procedure PickUp(HH, Gear: PGear); |
|
568 |
var s: shortstring; |
|
569 |
a: TAmmoType; |
|
570 |
i: LongInt; |
|
571 |
vga: PVisualGear; |
|
572 |
begin |
|
573 |
Gear^.Message:= gmDestroy; |
|
574 |
PlaySound(sndShotgunReload); |
|
575 |
if (Gear^.Pos and posCaseExplode) <> 0 then |
|
576 |
if (Gear^.Pos and posCasePoison) <> 0 then |
|
577 |
doMakeExplosion(hwRound(Gear^.X), hwRound(Gear^.Y), 25, HH^.Hedgehog, EXPLAutoSound + EXPLPoisoned) |
|
578 |
else |
|
579 |
doMakeExplosion(hwRound(Gear^.X), hwRound(Gear^.Y), 25, HH^.Hedgehog, EXPLAutoSound) |
|
580 |
else if (Gear^.Pos and posCasePoison) <> 0 then |
|
581 |
doMakeExplosion(hwRound(Gear^.X), hwRound(Gear^.Y), 25, HH^.Hedgehog, EXPLAutoSound + EXPLPoisoned + EXPLNoDamage) |
|
582 |
else |
|
583 |
case Gear^.Pos of |
|
584 |
posCaseUtility, |
|
585 |
posCaseAmmo: begin |
|
586 |
if Gear^.AmmoType <> amNothing then a:= Gear^.AmmoType |
|
587 |
else |
|
588 |
begin |
|
589 |
for i:= 0 to GameTicks and $7F do |
|
590 |
GetRandom(2); // Burn some random numbers |
|
591 |
if Gear^.Pos = posCaseUtility then |
|
592 |
a:= GetUtility(HH^.Hedgehog) |
|
593 |
else |
|
594 |
a:= GetAmmo(HH^.Hedgehog) |
|
595 |
end; |
|
596 |
AddAmmo(HH^.Hedgehog^, a); |
|
597 |
// Possibly needs to check shared clan ammo game flag once added. |
|
598 |
// On the other hand, no obvious reason that clan members shouldn't know what ammo another clan member picked up |
|
599 |
if (not (HH^.Hedgehog^.Team^.ExtDriven |
|
600 |
or (HH^.Hedgehog^.BotLevel > 0))) |
|
601 |
or (HH^.Hedgehog^.Team^.Clan^.ClanIndex = LocalClan) |
|
602 |
or (GameType = gmtDemo) then |
|
603 |
begin |
|
604 |
s:= trammo[Ammoz[a].NameId] + ' (+' + IntToStr(Ammoz[a].NumberInCase) + ')'; |
|
605 |
AddCaption(s, HH^.Hedgehog^.Team^.Clan^.Color, capgrpAmmoinfo); |
|
606 |
||
607 |
// show ammo icon |
|
608 |
vga:= AddVisualGear(hwRound(Gear^.X), hwRound(Gear^.Y), vgtAmmo); |
|
609 |
if vga <> nil then |
|
610 |
vga^.Frame:= Longword(a); |
|
611 |
end; |
|
612 |
||
613 |
end; |
|
614 |
posCaseHealth: begin |
|
615 |
inc(HH^.Health, Gear^.Health); |
|
7010
10a0a31804f3
Switch effects to longint for convenience of tracking ice states. I could add a new Hedgehog value, but since we have this effects list being all useless as booleans anyway...
nemo
parents:
6992
diff
changeset
|
616 |
HH^.Hedgehog^.Effects[hePoisoned] := 0; |
6581 | 617 |
str(Gear^.Health, s); |
618 |
s:= '+' + s; |
|
619 |
AddCaption(s, HH^.Hedgehog^.Team^.Clan^.Color, capgrpAmmoinfo); |
|
620 |
RenderHealth(HH^.Hedgehog^); |
|
621 |
RecountTeamHealth(HH^.Hedgehog^.Team); |
|
622 |
||
623 |
i:= 0; |
|
624 |
while i < Gear^.Health do |
|
625 |
begin |
|
626 |
vga:= AddVisualGear(hwRound(HH^.X), hwRound(HH^.Y), vgtStraightShot); |
|
627 |
if vga <> nil then |
|
628 |
with vga^ do |
|
629 |
begin |
|
630 |
Tint:= $00FF00FF; |
|
631 |
State:= ord(sprHealth) |
|
632 |
end; |
|
633 |
inc(i, 5); |
|
634 |
end; |
|
635 |
end; |
|
636 |
end |
|
637 |
end; |
|
638 |
||
639 |
procedure HedgehogStep(Gear: PGear); |
|
640 |
var PrevdX: LongInt; |
|
641 |
CurWeapon: PAmmo; |
|
642 |
begin |
|
6924 | 643 |
CurWeapon:= GetCurAmmoEntry(Gear^.Hedgehog^); |
6581 | 644 |
if ((Gear^.State and (gstAttacking or gstMoving)) = 0) then |
645 |
begin |
|
646 |
if isCursorVisible then |
|
647 |
with Gear^.Hedgehog^ do |
|
648 |
with CurWeapon^ do |
|
649 |
begin |
|
650 |
if (Gear^.Message and gmLeft ) <> 0 then |
|
651 |
Pos:= (Pos - 1 + Ammoz[AmmoType].PosCount) mod Ammoz[AmmoType].PosCount |
|
652 |
else |
|
653 |
if (Gear^.Message and gmRight ) <> 0 then |
|
654 |
Pos:= (Pos + 1) mod Ammoz[AmmoType].PosCount |
|
655 |
else |
|
656 |
exit; |
|
657 |
StepTicks:= 200; |
|
658 |
exit |
|
659 |
end; |
|
660 |
||
661 |
if ((Gear^.Message and gmAnimate) <> 0) then |
|
662 |
begin |
|
663 |
Gear^.Message:= 0; |
|
664 |
Gear^.State:= Gear^.State or gstAnimation; |
|
665 |
Gear^.Tag:= Gear^.MsgParam; |
|
666 |
Gear^.Timer:= 0; |
|
667 |
Gear^.Pos:= 0 |
|
668 |
end; |
|
669 |
||
670 |
if ((Gear^.Message and gmLJump ) <> 0) then |
|
671 |
begin |
|
672 |
Gear^.Message:= Gear^.Message and (not gmLJump); |
|
673 |
DeleteCI(Gear); |
|
674 |
if TestCollisionYwithGear(Gear, -1) = 0 then |
|
675 |
if not TestCollisionXwithXYShift(Gear, _0, -2, hwSign(Gear^.dX)) then |
|
676 |
Gear^.Y:= Gear^.Y - _2 |
|
677 |
else |
|
678 |
if not TestCollisionXwithXYShift(Gear, _0, -1, hwSign(Gear^.dX)) then |
|
679 |
Gear^.Y:= Gear^.Y - _1; |
|
680 |
if not (TestCollisionXwithGear(Gear, hwSign(Gear^.dX)) |
|
681 |
or (TestCollisionYwithGear(Gear, -1) <> 0)) then |
|
682 |
begin |
|
683 |
Gear^.dY:= -_0_15; |
|
684 |
if not cArtillery then |
|
685 |
Gear^.dX:= SignAs(_0_15, Gear^.dX); |
|
686 |
Gear^.State:= Gear^.State or gstMoving or gstHHJumping; |
|
687 |
PlaySound(sndJump1, Gear^.Hedgehog^.Team^.voicepack); |
|
688 |
exit |
|
689 |
end; |
|
690 |
end; |
|
691 |
||
692 |
if ((Gear^.Message and gmHJump ) <> 0) then |
|
693 |
begin |
|
694 |
DeleteCI(Gear); |
|
695 |
Gear^.Message:= Gear^.Message and (not gmHJump); |
|
696 |
||
697 |
Gear^.dY:= -_0_2; |
|
698 |
SetLittle(Gear^.dX); |
|
699 |
Gear^.State:= Gear^.State or gstMoving or gstHHJumping; |
|
700 |
PlaySound(sndJump3, Gear^.Hedgehog^.Team^.voicepack); |
|
701 |
exit |
|
702 |
end; |
|
703 |
||
704 |
PrevdX:= hwSign(Gear^.dX); |
|
705 |
if (Gear^.Message and gmLeft )<>0 then |
|
706 |
Gear^.dX:= -cLittle else |
|
707 |
if (Gear^.Message and gmRight )<>0 then |
|
708 |
Gear^.dX:= cLittle else exit; |
|
709 |
||
710 |
if (Gear^.Message and (gmLeft or gmRight)) <> 0 then |
|
711 |
begin |
|
712 |
StepSoundTimer:= cHHStepTicks; |
|
713 |
end; |
|
714 |
||
715 |
StepTicks:= cHHStepTicks; |
|
716 |
if PrevdX <> hwSign(Gear^.dX) then |
|
717 |
begin |
|
718 |
FollowGear:= Gear; |
|
719 |
exit |
|
720 |
end; |
|
721 |
DeleteCI(Gear); // must be after exit!! (see previous line) |
|
722 |
||
723 |
Gear^.Hedgehog^.visStepPos:= (Gear^.Hedgehog^.visStepPos + 1) and 7; |
|
724 |
if TestCollisionXwithGear(Gear, hwSign(Gear^.dX)) then |
|
725 |
begin |
|
726 |
if not (TestCollisionXwithXYShift(Gear, _0, -6, hwSign(Gear^.dX)) |
|
727 |
or (TestCollisionYwithGear(Gear, -1) <> 0)) then |
|
728 |
Gear^.Y:= Gear^.Y - _1; |
|
729 |
if not (TestCollisionXwithXYShift(Gear, _0, -5, hwSign(Gear^.dX)) |
|
730 |
or (TestCollisionYwithGear(Gear, -1) <> 0)) then |
|
731 |
Gear^.Y:= Gear^.Y - _1; |
|
732 |
if not (TestCollisionXwithXYShift(Gear, _0, -4, hwSign(Gear^.dX)) |
|
733 |
or (TestCollisionYwithGear(Gear, -1) <> 0)) then |
|
734 |
Gear^.Y:= Gear^.Y - _1; |
|
735 |
if not (TestCollisionXwithXYShift(Gear, _0, -3, hwSign(Gear^.dX)) |
|
736 |
or (TestCollisionYwithGear(Gear, -1) <> 0)) then |
|
737 |
Gear^.Y:= Gear^.Y - _1; |
|
738 |
if not (TestCollisionXwithXYShift(Gear, _0, -2, hwSign(Gear^.dX)) |
|
739 |
or (TestCollisionYwithGear(Gear, -1) <> 0)) then |
|
740 |
Gear^.Y:= Gear^.Y - _1; |
|
741 |
if not (TestCollisionXwithXYShift(Gear, _0, -1, hwSign(Gear^.dX)) |
|
742 |
or (TestCollisionYwithGear(Gear, -1) <> 0)) then |
|
743 |
Gear^.Y:= Gear^.Y - _1; |
|
744 |
end; |
|
745 |
||
746 |
if (not cArtillery) and ((Gear^.Message and gmPrecise) = 0) and (not TestCollisionXwithGear(Gear, hwSign(Gear^.dX))) then |
|
747 |
Gear^.X:= Gear^.X + SignAs(_1, Gear^.dX); |
|
748 |
||
749 |
SetAllHHToActive; |
|
750 |
||
751 |
if TestCollisionYwithGear(Gear, 1) = 0 then |
|
752 |
begin |
|
753 |
Gear^.Y:= Gear^.Y + _1; |
|
754 |
if TestCollisionYwithGear(Gear, 1) = 0 then |
|
755 |
begin |
|
756 |
Gear^.Y:= Gear^.Y + _1; |
|
757 |
if TestCollisionYwithGear(Gear, 1) = 0 then |
|
758 |
begin |
|
759 |
Gear^.Y:= Gear^.Y + _1; |
|
760 |
if TestCollisionYwithGear(Gear, 1) = 0 then |
|
761 |
begin |
|
762 |
Gear^.Y:= Gear^.Y + _1; |
|
763 |
if TestCollisionYwithGear(Gear, 1) = 0 then |
|
764 |
begin |
|
765 |
Gear^.Y:= Gear^.Y + _1; |
|
766 |
if TestCollisionYwithGear(Gear, 1) = 0 then |
|
767 |
begin |
|
768 |
Gear^.Y:= Gear^.Y + _1; |
|
769 |
if TestCollisionYwithGear(Gear, 1) = 0 then |
|
770 |
begin |
|
771 |
Gear^.Y:= Gear^.Y - _6; |
|
772 |
Gear^.dY:= _0; |
|
773 |
Gear^.State:= Gear^.State or gstMoving; |
|
774 |
exit |
|
775 |
end; |
|
776 |
end |
|
777 |
end |
|
778 |
end |
|
779 |
end |
|
780 |
end |
|
781 |
end; |
|
782 |
AddGearCI(Gear) |
|
783 |
end |
|
784 |
end; |
|
785 |
||
786 |
procedure HedgehogChAngle(HHGear: PGear); |
|
787 |
var da: LongWord; |
|
788 |
begin |
|
789 |
with HHGear^.Hedgehog^ do |
|
790 |
if ((CurAmmoType = amRope) and ((HHGear^.State and (gstMoving or gstHHJumping)) = gstMoving)) |
|
791 |
or ((CurAmmoType = amPortalGun) and ((HHGear^.State and gstMoving) <> 0)) then |
|
792 |
da:= 2 |
|
793 |
else da:= 1; |
|
794 |
||
795 |
if (((HHGear^.Message and gmPrecise) = 0) or ((GameTicks mod 5) = 1)) then |
|
796 |
if ((HHGear^.Message and gmUp) <> 0) and (HHGear^.Angle >= CurMinAngle + da) then |
|
797 |
dec(HHGear^.Angle, da) |
|
798 |
else |
|
799 |
if ((HHGear^.Message and gmDown) <> 0) and (HHGear^.Angle + da <= CurMaxAngle) then |
|
800 |
inc(HHGear^.Angle, da) |
|
801 |
end; |
|
802 |
||
803 |
||
804 |
//////////////////////////////////////////////////////////////////////////////// |
|
805 |
procedure doStepHedgehogMoving(Gear: PGear); |
|
806 |
var isFalling, isUnderwater: boolean; |
|
807 |
land: Word; |
|
808 |
begin |
|
809 |
land:= 0; |
|
810 |
isUnderwater:= cWaterLine < hwRound(Gear^.Y) + Gear^.Radius; |
|
811 |
if Gear^.dX.QWordValue > 8160437862 then |
|
812 |
Gear^.dX.QWordValue:= 8160437862; |
|
813 |
if Gear^.dY.QWordValue > 8160437862 then |
|
814 |
Gear^.dY.QWordValue:= 8160437862; |
|
815 |
||
816 |
if Gear^.Hedgehog^.Unplaced then |
|
817 |
begin |
|
818 |
Gear^.dY:= _0; |
|
819 |
Gear^.dX:= _0; |
|
820 |
Gear^.State:= Gear^.State and (not gstMoving); |
|
821 |
exit |
|
822 |
end; |
|
823 |
isFalling:= (Gear^.dY.isNegative) or not TestCollisionYKick(Gear, 1); |
|
824 |
if isFalling then |
|
825 |
begin |
|
826 |
if (Gear^.dY.isNegative) and TestCollisionYKick(Gear, -1) then |
|
827 |
Gear^.dY:= _0; |
|
828 |
Gear^.State:= Gear^.State or gstMoving; |
|
829 |
if (CurrentHedgehog^.Gear = Gear) |
|
830 |
and (hwSqr(Gear^.dX) + hwSqr(Gear^.dY) > _0_003) then |
|
831 |
begin |
|
832 |
FollowGear:= Gear; |
|
833 |
end; |
|
834 |
if isUnderwater then |
|
835 |
Gear^.dY:= Gear^.dY + cGravity / _2 |
|
836 |
else |
|
837 |
begin |
|
838 |
Gear^.dY:= Gear^.dY + cGravity; |
|
839 |
// this set of circumstances could be less complex if jumping was more clearly identified |
|
840 |
if ((GameFlags and gfMoreWind) <> 0) and (((Gear^.Damage <> 0) |
|
841 |
or ((CurAmmoGear <> nil) and ((CurAmmoGear^.AmmoType = amJetpack) or (CurAmmoGear^.AmmoType = amBirdy))) |
|
842 |
or ((Gear^.dY.QWordValue + Gear^.dX.QWordValue) > _0_55.QWordValue))) then |
|
843 |
Gear^.dX := Gear^.dX + cWindSpeed / Gear^.Density |
|
844 |
end |
|
845 |
end |
|
846 |
else |
|
847 |
begin |
|
848 |
land:= TestCollisionYwithGear(Gear, 1); |
|
849 |
if ((Gear^.dX.QWordValue + Gear^.dY.QWordValue) < _0_55.QWordValue) and ((land and lfIce) = 0) |
|
850 |
and ((Gear^.State and gstHHJumping) <> 0) then |
|
851 |
SetLittle(Gear^.dX); |
|
852 |
||
853 |
if not Gear^.dY.isNegative then |
|
854 |
begin |
|
855 |
CheckHHDamage(Gear); |
|
856 |
||
857 |
if ((Gear^.State and gstHHHJump) <> 0) and (not cArtillery) |
|
858 |
and (Gear^.dX.QWordValue < _0_02.QWordValue) then |
|
859 |
Gear^.dX.isNegative:= not Gear^.dX.isNegative; // landing after high jump |
|
860 |
Gear^.State:= Gear^.State and (not (gstHHJumping or gstHHHJump)); |
|
861 |
Gear^.dY:= _0; |
|
862 |
end |
|
863 |
else |
|
864 |
Gear^.dY:= Gear^.dY + cGravity; |
|
865 |
||
866 |
if ((Gear^.State and gstMoving) <> 0) then |
|
867 |
begin |
|
868 |
if land and lfIce <> 0 then |
|
869 |
begin |
|
870 |
Gear^.dX:= Gear^.dX * (_1 - (_1 - Gear^.Friction) / _2) |
|
871 |
end |
|
872 |
else |
|
873 |
Gear^.dX:= Gear^.dX * Gear^.Friction; |
|
874 |
end |
|
875 |
end; |
|
876 |
||
877 |
if (Gear^.State <> 0) then |
|
878 |
DeleteCI(Gear); |
|
879 |
||
880 |
if isUnderwater then |
|
881 |
begin |
|
882 |
Gear^.dY:= Gear^.dY * _0_999; |
|
883 |
Gear^.dX:= Gear^.dX * _0_999; |
|
884 |
end; |
|
885 |
||
886 |
if (Gear^.State and gstMoving) <> 0 then |
|
887 |
if TestCollisionXKick(Gear, hwSign(Gear^.dX)) then |
|
888 |
if not isFalling then |
|
889 |
if hwAbs(Gear^.dX) > _0_01 then |
|
890 |
if not TestCollisionXwithXYShift(Gear, int2hwFloat(hwSign(Gear^.dX)) - Gear^.dX, -1, hwSign(Gear^.dX)) then |
|
891 |
begin |
|
892 |
Gear^.X:= Gear^.X + Gear^.dX; |
|
893 |
Gear^.dX:= Gear^.dX * _0_96; |
|
894 |
Gear^.Y:= Gear^.Y - _1 |
|
895 |
end |
|
896 |
else |
|
897 |
if not TestCollisionXwithXYShift(Gear, int2hwFloat(hwSign(Gear^.dX)) - Gear^.dX, -2, hwSign(Gear^.dX)) then |
|
898 |
begin |
|
899 |
Gear^.X:= Gear^.X + Gear^.dX; |
|
900 |
Gear^.dX:= Gear^.dX * _0_93; |
|
901 |
Gear^.Y:= Gear^.Y - _2 |
|
902 |
end |
|
903 |
else |
|
904 |
if not TestCollisionXwithXYShift(Gear, int2hwFloat(hwSign(Gear^.dX)) - Gear^.dX, -3, hwSign(Gear^.dX)) then |
|
905 |
begin |
|
906 |
Gear^.X:= Gear^.X + Gear^.dX; |
|
907 |
Gear^.dX:= Gear^.dX * _0_9 ; |
|
908 |
Gear^.Y:= Gear^.Y - _3 |
|
909 |
end |
|
910 |
else |
|
911 |
if not TestCollisionXwithXYShift(Gear, int2hwFloat(hwSign(Gear^.dX)) - Gear^.dX, -4, hwSign(Gear^.dX)) then |
|
912 |
begin |
|
913 |
Gear^.X:= Gear^.X + Gear^.dX; |
|
914 |
Gear^.dX:= Gear^.dX * _0_87; |
|
915 |
Gear^.Y:= Gear^.Y - _4 |
|
916 |
end |
|
917 |
else |
|
918 |
if not TestCollisionXwithXYShift(Gear, int2hwFloat(hwSign(Gear^.dX)) - Gear^.dX, -5, hwSign(Gear^.dX)) then |
|
919 |
begin |
|
920 |
Gear^.X:= Gear^.X + Gear^.dX; |
|
921 |
Gear^.dX:= Gear^.dX * _0_84; |
|
922 |
Gear^.Y:= Gear^.Y - _5 |
|
923 |
end |
|
924 |
else |
|
925 |
if hwAbs(Gear^.dX) > _0_02 then |
|
926 |
Gear^.dX:= -Gear^.Elasticity * Gear^.dX |
|
927 |
else |
|
928 |
begin |
|
929 |
Gear^.State:= Gear^.State and (not gstMoving); |
|
930 |
while TestCollisionYWithGear(Gear,1) = 0 do |
|
931 |
Gear^.Y:= Gear^.Y+_1; |
|
932 |
SetLittle(Gear^.dX) |
|
933 |
end |
|
934 |
else |
|
935 |
begin |
|
936 |
Gear^.State:= Gear^.State and (not gstMoving); |
|
937 |
while TestCollisionYWithGear(Gear,1) = 0 do |
|
938 |
Gear^.Y:= Gear^.Y+_1; |
|
939 |
SetLittle(Gear^.dX) |
|
940 |
end |
|
941 |
else if (hwAbs(Gear^.dX) > cLittle) |
|
942 |
and ((Gear^.State and gstHHJumping) = 0) then |
|
943 |
Gear^.dX:= -Gear^.Elasticity * Gear^.dX |
|
944 |
else |
|
945 |
SetLittle(Gear^.dX); |
|
946 |
||
947 |
if (not isFalling) |
|
948 |
and (hwAbs(Gear^.dX) + hwAbs(Gear^.dY) < _0_03) then |
|
949 |
begin |
|
950 |
Gear^.State:= Gear^.State and (not gstWinner); |
|
951 |
Gear^.State:= Gear^.State and (not gstMoving); |
|
952 |
while TestCollisionYWithGear(Gear,1) = 0 do |
|
953 |
Gear^.Y:= Gear^.Y+_1; |
|
954 |
SetLittle(Gear^.dX); |
|
955 |
Gear^.dY:= _0 |
|
956 |
end |
|
957 |
else |
|
958 |
Gear^.State:= Gear^.State or gstMoving; |
|
959 |
||
960 |
if (Gear^.State and gstMoving) <> 0 then |
|
961 |
begin |
|
962 |
Gear^.State:= Gear^.State and (not gstAnimation); |
|
963 |
// ARTILLERY but not being moved by explosions |
|
964 |
Gear^.X:= Gear^.X + Gear^.dX; |
|
965 |
Gear^.Y:= Gear^.Y + Gear^.dY; |
|
966 |
if (not Gear^.dY.isNegative) and (not TestCollisionYKick(Gear, 1)) |
|
967 |
and TestCollisionYwithXYShift(Gear, 0, 1, 1) then |
|
968 |
begin |
|
969 |
CheckHHDamage(Gear); |
|
970 |
Gear^.dY:= _0; |
|
971 |
Gear^.Y:= Gear^.Y + _1 |
|
972 |
end; |
|
973 |
CheckGearDrowning(Gear); |
|
974 |
// hide target cursor if current hog is drowning |
|
975 |
if (Gear^.State and gstDrowning) <> 0 then |
|
976 |
if (CurrentHedgehog^.Gear = Gear) then |
|
977 |
isCursorVisible:= false |
|
978 |
end; |
|
979 |
||
980 |
if (hwAbs(Gear^.dY) > _0) and (Gear^.FlightTime > 0) and ((GameFlags and gfLowGravity) = 0) then |
|
981 |
begin |
|
982 |
inc(Gear^.FlightTime); |
|
983 |
if Gear^.FlightTime = 3000 then |
|
984 |
begin |
|
985 |
AddCaption(GetEventString(eidHomerun), cWhiteColor, capgrpMessage); |
|
986 |
PlaySound(sndHomerun) |
|
987 |
end; |
|
988 |
end |
|
989 |
else |
|
990 |
begin |
|
991 |
uStats.hedgehogFlight(Gear, Gear^.FlightTime); |
|
992 |
Gear^.FlightTime:= 0; |
|
993 |
end; |
|
994 |
||
995 |
end; |
|
996 |
||
997 |
procedure doStepHedgehogDriven(HHGear: PGear); |
|
998 |
var t: PGear; |
|
999 |
wasJumping: boolean; |
|
1000 |
Hedgehog: PHedgehog; |
|
1001 |
begin |
|
1002 |
Hedgehog:= HHGear^.Hedgehog; |
|
1003 |
if isInMultiShoot then |
|
1004 |
HHGear^.Message:= 0; |
|
1005 |
||
1006 |
if ((Ammoz[CurrentHedgehog^.CurAmmoType].Ammo.Propz and ammoprop_Utility) <> 0) and isInMultiShoot then |
|
1007 |
AllInactive:= true |
|
1008 |
else if not isInMultiShoot then |
|
1009 |
AllInactive:= false; |
|
1010 |
||
1011 |
if (TurnTimeLeft = 0) or (HHGear^.Damage > 0) then |
|
1012 |
begin |
|
1013 |
if TagTurnTimeLeft = 0 then |
|
1014 |
TagTurnTimeLeft:= TurnTimeLeft; |
|
1015 |
TurnTimeLeft:= 0; |
|
1016 |
isCursorVisible:= false; |
|
1017 |
HHGear^.State:= HHGear^.State and (not (gstHHDriven or gstAnimation or gstAttacking)); |
|
1018 |
AttackBar:= 0; |
|
1019 |
if HHGear^.Damage > 0 then |
|
1020 |
HHGear^.State:= HHGear^.State and (not (gstHHJumping or gstHHHJump)); |
|
1021 |
exit |
|
1022 |
end; |
|
1023 |
||
1024 |
if (HHGear^.State and gstAnimation) <> 0 then |
|
1025 |
begin |
|
1026 |
HHGear^.Message:= 0; |
|
1027 |
if (HHGear^.Pos = Wavez[TWave(HHGear^.Tag)].VoiceDelay) and (HHGear^.Timer = 0) then |
|
1028 |
PlaySound(Wavez[TWave(HHGear^.Tag)].Voice, Hedgehog^.Team^.voicepack); |
|
1029 |
inc(HHGear^.Timer); |
|
1030 |
if HHGear^.Timer = Wavez[TWave(HHGear^.Tag)].Interval then |
|
1031 |
begin |
|
1032 |
HHGear^.Timer:= 0; |
|
1033 |
inc(HHGear^.Pos); |
|
1034 |
if HHGear^.Pos = Wavez[TWave(HHGear^.Tag)].FramesCount then |
|
1035 |
HHGear^.State:= HHGear^.State and (not gstAnimation) |
|
1036 |
end; |
|
1037 |
exit |
|
1038 |
end; |
|
1039 |
||
1040 |
if ((HHGear^.State and gstMoving) <> 0) |
|
1041 |
or (StepTicks = cHHStepTicks) |
|
1042 |
or (CurAmmoGear <> nil) then // we are moving |
|
1043 |
begin |
|
1044 |
with Hedgehog^ do |
|
1045 |
if (CurAmmoGear = nil) |
|
1046 |
and (HHGear^.dY > _0_39) |
|
1047 |
and (CurAmmoType = amParachute) then |
|
1048 |
HHGear^.Message:= HHGear^.Message or gmAttack; |
|
1049 |
// check for case with ammo |
|
1050 |
t:= CheckGearNear(HHGear, gtCase, 36, 36); |
|
1051 |
if t <> nil then |
|
1052 |
PickUp(HHGear, t) |
|
1053 |
end; |
|
1054 |
||
1055 |
if (CurAmmoGear = nil) then |
|
1056 |
if (((HHGear^.Message and gmAttack) <> 0) |
|
1057 |
or ((HHGear^.State and gstAttacking) <> 0)) then |
|
1058 |
Attack(HHGear) // should be before others to avoid desync with '/put' msg and changing weapon msgs |
|
1059 |
else |
|
1060 |
else |
|
1061 |
with Hedgehog^ do |
|
1062 |
if ((Ammoz[CurAmmoGear^.AmmoType].Ammo.Propz and ammoprop_AltAttack) <> 0) |
|
1063 |
and ((HHGear^.Message and gmLJump) <> 0) |
|
1064 |
and ((Ammoz[CurAmmoType].Ammo.Propz and ammoprop_AltUse) <> 0) then |
|
1065 |
begin |
|
1066 |
Attack(HHGear); |
|
1067 |
HHGear^.Message:= HHGear^.Message and (not gmLJump) |
|
1068 |
end; |
|
1069 |
||
1070 |
if (CurAmmoGear = nil) |
|
1071 |
or ((Ammoz[CurAmmoGear^.AmmoType].Ammo.Propz and ammoprop_AltAttack) <> 0) |
|
1072 |
or ((Ammoz[CurAmmoGear^.AmmoType].Ammo.Propz and ammoprop_NoRoundEnd) <> 0) then |
|
1073 |
begin |
|
1074 |
if ((HHGear^.Message and gmSlot) <> 0) then |
|
1075 |
if ChangeAmmo(HHGear) then ApplyAmmoChanges(Hedgehog^); |
|
1076 |
||
1077 |
if ((HHGear^.Message and gmWeapon) <> 0) then |
|
1078 |
HHSetWeapon(HHGear); |
|
1079 |
||
1080 |
if ((HHGear^.Message and gmTimer) <> 0) then |
|
1081 |
HHSetTimer(HHGear); |
|
1082 |
end; |
|
1083 |
||
1084 |
if CurAmmoGear <> nil then |
|
1085 |
begin |
|
1086 |
CurAmmoGear^.Message:= HHGear^.Message; |
|
1087 |
exit |
|
1088 |
end; |
|
1089 |
||
1090 |
if not isInMultiShoot then |
|
1091 |
HedgehogChAngle(HHGear); |
|
1092 |
||
1093 |
if (HHGear^.State and gstMoving) <> 0 then |
|
1094 |
begin |
|
1095 |
wasJumping:= ((HHGear^.State and gstHHJumping) <> 0); |
|
1096 |
||
1097 |
if ((HHGear^.Message and gmHJump) <> 0) and wasJumping and ((HHGear^.State and gstHHHJump) = 0) then |
|
1098 |
if (not (hwAbs(HHGear^.dX) > cLittle)) and (HHGear^.dY < -_0_02) then |
|
1099 |
begin |
|
1100 |
HHGear^.State:= HHGear^.State or gstHHHJump; |
|
1101 |
HHGear^.dY:= -_0_25; |
|
1102 |
if not cArtillery then |
|
1103 |
HHGear^.dX:= -SignAs(_0_02, HHGear^.dX); |
|
1104 |
PlaySound(sndJump2, Hedgehog^.Team^.voicepack) |
|
1105 |
end; |
|
1106 |
||
1107 |
HHGear^.Message:= HHGear^.Message and (not (gmLJump or gmHJump)); |
|
1108 |
||
1109 |
if (not cArtillery) and wasJumping and TestCollisionXwithGear(HHGear, hwSign(HHGear^.dX)) then |
|
1110 |
SetLittle(HHGear^.dX); |
|
1111 |
||
1112 |
if Hedgehog^.Gear <> nil then |
|
1113 |
doStepHedgehogMoving(HHGear); |
|
1114 |
||
1115 |
if ((HHGear^.State and (gstMoving or gstDrowning)) = 0) then |
|
1116 |
begin |
|
1117 |
AddGearCI(HHGear); |
|
1118 |
if wasJumping then |
|
1119 |
StepTicks:= 410 |
|
1120 |
else |
|
1121 |
StepTicks:= 95 |
|
1122 |
end; |
|
1123 |
exit |
|
1124 |
end; |
|
1125 |
||
1126 |
if not isInMultiShoot and (Hedgehog^.Gear <> nil) then |
|
1127 |
begin |
|
1128 |
if StepTicks > 0 then |
|
1129 |
dec(StepTicks); |
|
1130 |
if (StepTicks = 0) then |
|
1131 |
HedgehogStep(HHGear) |
|
1132 |
end |
|
1133 |
end; |
|
1134 |
||
1135 |
//////////////////////////////////////////////////////////////////////////////// |
|
1136 |
procedure doStepHedgehogFree(Gear: PGear); |
|
1137 |
var prevState: Longword; |
|
1138 |
begin |
|
1139 |
prevState:= Gear^.State; |
|
1140 |
||
1141 |
doStepHedgehogMoving(Gear); |
|
1142 |
||
1143 |
if (Gear^.State and (gstMoving or gstDrowning)) <> 0 then |
|
1144 |
begin |
|
1145 |
if Gear^.Damage > 0 then |
|
1146 |
CalcRotationDirAngle(Gear); |
|
1147 |
AllInactive:= false; |
|
1148 |
exit |
|
1149 |
end; |
|
1150 |
||
1151 |
if (Gear^.Health = 0) then |
|
1152 |
begin |
|
1153 |
if PrvInactive or ((GameFlags and gfInfAttack) <> 0) then |
|
1154 |
begin |
|
1155 |
Gear^.Timer:= 0; |
|
1156 |
FollowGear:= Gear; |
|
1157 |
PrvInactive:= false; |
|
1158 |
AllInactive:= false; |
|
1159 |
||
1160 |
if (Gear^.State and gstHHGone) = 0 then |
|
1161 |
begin |
|
7010
10a0a31804f3
Switch effects to longint for convenience of tracking ice states. I could add a new Hedgehog value, but since we have this effects list being all useless as booleans anyway...
nemo
parents:
6992
diff
changeset
|
1162 |
Gear^.Hedgehog^.Effects[hePoisoned] := 0; |
10a0a31804f3
Switch effects to longint for convenience of tracking ice states. I could add a new Hedgehog value, but since we have this effects list being all useless as booleans anyway...
nemo
parents:
6992
diff
changeset
|
1163 |
if Gear^.Hedgehog^.Effects[heResurrectable] <> 0 then |
6581 | 1164 |
begin |
1165 |
ResurrectHedgehog(Gear); |
|
1166 |
end |
|
1167 |
else |
|
1168 |
begin |
|
1169 |
Gear^.State:= (Gear^.State or gstHHDeath) and (not gstAnimation); |
|
1170 |
Gear^.doStep:= @doStepHedgehogDead; |
|
1171 |
// Death message |
|
1172 |
AddCaption(Format(GetEventString(eidDied), Gear^.Hedgehog^.Name), cWhiteColor, capgrpMessage); |
|
1173 |
end; |
|
1174 |
end |
|
1175 |
else |
|
1176 |
begin |
|
1177 |
Gear^.State:= Gear^.State and (not gstAnimation); |
|
1178 |
Gear^.doStep:= @doStepHedgehogGone; |
|
1179 |
||
1180 |
// Gone message |
|
1181 |
AddCaption(Format(GetEventString(eidGone), Gear^.Hedgehog^.Name), cWhiteColor, capgrpMessage); |
|
1182 |
end |
|
1183 |
end; |
|
1184 |
exit |
|
1185 |
end; |
|
1186 |
||
1187 |
if ((Gear^.State and gstWait) = 0) and |
|
1188 |
(prevState <> Gear^.State) then |
|
1189 |
begin |
|
1190 |
Gear^.State:= Gear^.State or gstWait; |
|
1191 |
Gear^.Timer:= 150 |
|
1192 |
end |
|
1193 |
else |
|
1194 |
begin |
|
1195 |
if Gear^.Timer = 0 then |
|
1196 |
begin |
|
1197 |
Gear^.State:= Gear^.State and (not (gstWait or gstLoser or gstWinner or gstAttacked or gstNotKickable or gstHHChooseTarget)); |
|
1198 |
Gear^.Active:= false; |
|
1199 |
AddGearCI(Gear); |
|
1200 |
exit |
|
1201 |
end |
|
1202 |
else dec(Gear^.Timer) |
|
1203 |
end; |
|
1204 |
||
1205 |
AllInactive:= false |
|
1206 |
end; |
|
1207 |
||
1208 |
//////////////////////////////////////////////////////////////////////////////// |
|
1209 |
procedure doStepHedgehog(Gear: PGear); |
|
1210 |
(* |
|
1211 |
var x,y,tx,ty: LongInt; |
|
1212 |
tdX, tdY, slope: hwFloat; |
|
1213 |
land: Word; *) |
|
1214 |
var slope: hwFloat; |
|
1215 |
begin |
|
1216 |
if (Gear^.Message and gmDestroy) <> 0 then |
|
1217 |
begin |
|
1218 |
DeleteGear(Gear); |
|
1219 |
exit |
|
1220 |
end; |
|
1221 |
||
1222 |
if (Gear^.State and gstHHDriven) = 0 then |
|
1223 |
doStepHedgehogFree(Gear) |
|
1224 |
else |
|
1225 |
begin |
|
1226 |
with Gear^.Hedgehog^ do |
|
1227 |
if Team^.hasGone then |
|
1228 |
TeamGoneEffect(Team^) |
|
1229 |
else |
|
1230 |
doStepHedgehogDriven(Gear) |
|
1231 |
end; |
|
1232 |
if (Gear^.Message and (gmAllStoppable or gmLJump or gmHJump) = 0) |
|
1233 |
and (Gear^.State and (gstHHJumping or gstHHHJump or gstAttacking) = 0) |
|
1234 |
and (not Gear^.dY.isNegative) and (GameTicks mod (100*LongWOrd(hwRound(cMaxWindSpeed*2/cGravity))) = 0) |
|
1235 |
and (TestCollisionYwithGear(Gear, 1) and lfIce <> 0) then |
|
1236 |
begin |
|
1237 |
slope:= CalcSlopeBelowGear(Gear); |
|
1238 |
Gear^.dX:=Gear^.dX+slope*_0_07; |
|
1239 |
if slope.QWordValue <> 0 then |
|
1240 |
Gear^.State:= Gear^.State or gstMoving; |
|
1241 |
(* |
|
1242 |
x:= hwRound(Gear^.X); |
|
1243 |
y:= hwRound(Gear^.Y); |
|
1244 |
AddVisualGear(x, y, vgtSmokeTrace); |
|
1245 |
AddVisualGear(x - hwRound(_5*slope), y + hwRound(_5*slope), vgtSmokeTrace); |
|
1246 |
AddVisualGear(x + hwRound(_5*slope), y - hwRound(_5*slope), vgtSmokeTrace); |
|
1247 |
AddVisualGear(x - hwRound(_20 * slope), y + hwRound(_20 * slope), vgtSmokeTrace); |
|
1248 |
AddVisualGear(x + hwRound(_20 * slope), y - hwRound(_20 * slope), vgtSmokeTrace); |
|
1249 |
AddVisualGear(x - hwRound(_30 * slope), y + hwRound(_30 * slope), vgtSmokeTrace); |
|
1250 |
AddVisualGear(x + hwRound(_30 * slope), y - hwRound(_30 * slope), vgtSmokeTrace); |
|
1251 |
AddVisualGear(x - hwRound(_40 * slope), y + hwRound(_40 * slope), vgtSmokeTrace); |
|
1252 |
AddVisualGear(x + hwRound(_40 * slope), y - hwRound(_40 * slope), vgtSmokeTrace); |
|
1253 |
AddVisualGear(x - hwRound(_50 * slope), y + hwRound(_50 * slope), vgtSmokeTrace); |
|
1254 |
AddVisualGear(x + hwRound(_50 * slope), y - hwRound(_50 * slope), vgtSmokeTrace); *) |
|
1255 |
end |
|
1256 |
end; |
|
1257 |
||
1258 |
end. |