author | unc0rr |
Thu, 18 Sep 2008 16:16:41 +0000 | |
changeset 1263 | 24677a82531d |
parent 1262 | e9191c693e44 |
child 1270 | ee024c14c904 |
permissions | -rw-r--r-- |
4 | 1 |
(* |
1066 | 2 |
* Hedgewars, a free turn based strategy game |
883 | 3 |
* Copyright (c) 2004-2008 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 |
unit uGears; |
|
20 |
interface |
|
351 | 21 |
uses SDLh, uConsts, uFloat; |
4 | 22 |
{$INCLUDE options.inc} |
23 |
const AllInactive: boolean = false; |
|
868 | 24 |
PrvInactive: boolean = false; |
4 | 25 |
|
26 |
type PGear = ^TGear; |
|
1259 | 27 |
TGearStepProcedure = procedure (Gear: PGear); |
28 |
TGear = record |
|
29 |
NextGear, PrevGear: PGear; |
|
30 |
Active: Boolean; |
|
31 |
Ammo : PAmmo; |
|
32 |
State : Longword; |
|
33 |
X : hwFloat; |
|
34 |
Y : hwFloat; |
|
35 |
dX: hwFloat; |
|
36 |
dY: hwFloat; |
|
37 |
Kind: TGearType; |
|
38 |
Pos: Longword; |
|
39 |
doStep: TGearStepProcedure; |
|
40 |
Radius: LongInt; |
|
41 |
Angle, Power : Longword; |
|
42 |
DirAngle: real; |
|
43 |
Timer : LongWord; |
|
44 |
Elasticity: hwFloat; |
|
45 |
Friction : hwFloat; |
|
46 |
Message, MsgParam : Longword; |
|
47 |
Hedgehog: pointer; |
|
48 |
Health, Damage: LongInt; |
|
49 |
CollisionIndex: LongInt; |
|
50 |
Tag: LongInt; |
|
51 |
Tex: PTexture; |
|
52 |
Z: Longword; |
|
53 |
IntersectGear: PGear; |
|
54 |
TriggerId: Longword; |
|
55 |
end; |
|
4 | 56 |
|
371 | 57 |
function AddGear(X, Y: LongInt; Kind: TGearType; State: Longword; dX, dY: hwFloat; Timer: LongWord): PGear; |
4 | 58 |
procedure ProcessGears; |
59 |
procedure SetAllToActive; |
|
60 |
procedure SetAllHHToActive; |
|
956 | 61 |
procedure DrawGears; |
4 | 62 |
procedure FreeGearsList; |
10 | 63 |
procedure AddMiscGears; |
4 | 64 |
procedure AssignHHCoords; |
294 | 65 |
procedure InsertGearToList(Gear: PGear); |
66 |
procedure RemoveGearFromList(Gear: PGear); |
|
4 | 67 |
|
68 |
var CurAmmoGear: PGear = nil; |
|
68 | 69 |
GearsList: PGear = nil; |
307 | 70 |
KilledHHs: Longword = 0; |
70 | 71 |
|
4 | 72 |
implementation |
81 | 73 |
uses uWorld, uMisc, uStore, uConsole, uSound, uTeams, uRandom, uCollisions, |
1259 | 74 |
uLand, uIO, uLandGraphics, uAIMisc, uLocale, uAI, uAmmos, uTriggers, GL, |
75 |
uStats, uVisualGears; |
|
789 | 76 |
|
1207
ceaab010269e
Some adjusting... it still doesn't solve problem fully
unc0rr
parents:
1200
diff
changeset
|
77 |
const MAXROPEPOINTS = 384; |
68 | 78 |
var RopePoints: record |
4 | 79 |
Count: Longword; |
776
8fc7e59d9cb4
Convert the rest of rotated sprites to be rotated by OpenGL
unc0rr
parents:
775
diff
changeset
|
80 |
HookAngle: GLfloat; |
789 | 81 |
ar: array[0..MAXROPEPOINTS] of record |
351 | 82 |
X, Y: hwFloat; |
83 |
dLen: hwFloat; |
|
4 | 84 |
b: boolean; |
85 |
end; |
|
86 |
end; |
|
87 |
||
88 |
procedure DeleteGear(Gear: PGear); forward; |
|
371 | 89 |
procedure doMakeExplosion(X, Y, Radius: LongInt; Mask: LongWord); forward; |
90 |
procedure AmmoShove(Ammo: PGear; Damage, Power: LongInt); forward; |
|
79 | 91 |
procedure AmmoFlameWork(Ammo: PGear); forward; |
371 | 92 |
function CheckGearNear(Gear: PGear; Kind: TGearType; rX, rY: LongInt): PGear; forward; |
15 | 93 |
procedure SpawnBoxOfSmth; forward; |
32
78bff13b11c0
With this patch the game doesn't crash when gaming by net
unc0rr
parents:
24
diff
changeset
|
94 |
procedure AfterAttack; forward; |
371 | 95 |
procedure FindPlace(Gear: PGear; withFall: boolean; Left, Right: LongInt); forward; |
302 | 96 |
procedure HedgehogStep(Gear: PGear); forward; |
303
1659c4aad5ab
Now blow torch angle can be changed during blowing :)
unc0rr
parents:
302
diff
changeset
|
97 |
procedure HedgehogChAngle(Gear: PGear); forward; |
506 | 98 |
procedure ShotgunShot(Gear: PGear); forward; |
522 | 99 |
procedure AddDamageTag(X, Y, Damage: LongWord; Gear: PGear); forward; |
4 | 100 |
|
101 |
{$INCLUDE GSHandlers.inc} |
|
102 |
{$INCLUDE HHHandlers.inc} |
|
103 |
||
104 |
const doStepHandlers: array[TGearType] of TGearStepProcedure = ( |
|
1259 | 105 |
@doStepBomb, |
106 |
@doStepHedgehog, |
|
107 |
@doStepGrenade, |
|
108 |
@doStepHealthTag, |
|
109 |
@doStepGrave, |
|
110 |
@doStepUFO, |
|
111 |
@doStepShotgunShot, |
|
112 |
@doStepPickHammer, |
|
113 |
@doStepRope, |
|
114 |
@doStepSmokeTrace, |
|
115 |
@doStepExplosion, |
|
116 |
@doStepMine, |
|
117 |
@doStepCase, |
|
118 |
@doStepDEagleShot, |
|
119 |
@doStepDynamite, |
|
120 |
@doStepTeamHealthSorter, |
|
121 |
@doStepBomb, |
|
122 |
@doStepCluster, |
|
123 |
@doStepShover, |
|
124 |
@doStepFlame, |
|
125 |
@doStepFirePunch, |
|
126 |
@doStepActionTimer, |
|
127 |
@doStepActionTimer, |
|
128 |
@doStepActionTimer, |
|
129 |
@doStepParachute, |
|
130 |
@doStepAirAttack, |
|
131 |
@doStepAirBomb, |
|
132 |
@doStepBlowTorch, |
|
133 |
@doStepGirder, |
|
134 |
@doStepTeleport, |
|
135 |
@doStepHealthTag, |
|
136 |
@doStepSwitcher, |
|
137 |
@doStepCase, |
|
138 |
@doStepMortar, |
|
139 |
@doStepWhip, |
|
140 |
@doStepKamikaze, |
|
141 |
@doStepCake, |
|
1261 | 142 |
@doStepSeduction, |
1262 | 143 |
@doStepBomb, |
1263 | 144 |
@doStepCluster, |
145 |
@doStepBomb, |
|
146 |
@doStepSmokeTrace |
|
1259 | 147 |
); |
4 | 148 |
|
294 | 149 |
procedure InsertGearToList(Gear: PGear); |
803 | 150 |
var tmp, ptmp: PGear; |
294 | 151 |
begin |
152 |
if GearsList = nil then |
|
153 |
GearsList:= Gear |
|
154 |
else begin |
|
155 |
tmp:= GearsList; |
|
803 | 156 |
ptmp:= GearsList; |
157 |
while (tmp <> nil) and (tmp^.Z <= Gear^.Z) do |
|
158 |
begin |
|
159 |
ptmp:= tmp; |
|
160 |
tmp:= tmp^.NextGear |
|
161 |
end; |
|
294 | 162 |
|
803 | 163 |
if ptmp <> nil then |
164 |
begin |
|
165 |
Gear^.NextGear:= ptmp^.NextGear; |
|
166 |
Gear^.PrevGear:= ptmp; |
|
167 |
if ptmp^.NextGear <> nil then ptmp^.NextGear^.PrevGear:= Gear; |
|
168 |
ptmp^.NextGear:= Gear |
|
169 |
end |
|
170 |
else GearsList:= Gear |
|
294 | 171 |
end |
172 |
end; |
|
173 |
||
174 |
procedure RemoveGearFromList(Gear: PGear); |
|
175 |
begin |
|
351 | 176 |
if Gear^.NextGear <> nil then Gear^.NextGear^.PrevGear:= Gear^.PrevGear; |
177 |
if Gear^.PrevGear <> nil then Gear^.PrevGear^.NextGear:= Gear^.NextGear |
|
809 | 178 |
else GearsList:= Gear^.NextGear |
294 | 179 |
end; |
180 |
||
371 | 181 |
function AddGear(X, Y: LongInt; Kind: TGearType; State: Longword; dX, dY: hwFloat; Timer: LongWord): PGear; |
79 | 182 |
const Counter: Longword = 0; |
351 | 183 |
var Result: PGear; |
4 | 184 |
begin |
79 | 185 |
inc(Counter); |
108 | 186 |
{$IFDEF DEBUGFILE}AddFileLog('AddGear: ('+inttostr(x)+','+inttostr(y)+'), d('+floattostr(dX)+','+floattostr(dY)+')');{$ENDIF} |
4 | 187 |
New(Result); |
357 | 188 |
{$IFDEF DEBUGFILE}AddFileLog('AddGear: type = ' + inttostr(ord(Kind)));{$ENDIF} |
4 | 189 |
FillChar(Result^, sizeof(TGear), 0); |
498 | 190 |
Result^.X:= int2hwFloat(X); |
191 |
Result^.Y:= int2hwFloat(Y); |
|
351 | 192 |
Result^.Kind := Kind; |
193 |
Result^.State:= State; |
|
194 |
Result^.Active:= true; |
|
195 |
Result^.dX:= dX; |
|
196 |
Result^.dY:= dY; |
|
197 |
Result^.doStep:= doStepHandlers[Kind]; |
|
511 | 198 |
Result^.CollisionIndex:= -1; |
351 | 199 |
Result^.Timer:= Timer; |
505
fcba7d7aea0d
Fix old bug with grenade(bomd, etc..) not colliding with attacking hedgehog
unc0rr
parents:
503
diff
changeset
|
200 |
|
4 | 201 |
if CurrentTeam <> nil then |
505
fcba7d7aea0d
Fix old bug with grenade(bomd, etc..) not colliding with attacking hedgehog
unc0rr
parents:
503
diff
changeset
|
202 |
begin |
602 | 203 |
Result^.Hedgehog:= CurrentHedgehog; |
204 |
Result^.IntersectGear:= CurrentHedgehog^.Gear |
|
505
fcba7d7aea0d
Fix old bug with grenade(bomd, etc..) not colliding with attacking hedgehog
unc0rr
parents:
503
diff
changeset
|
205 |
end; |
802
ed5450a89b96
Start implementing 'visual gears' - gears, that don't need to be synchronized (clouds and flakes)
unc0rr
parents:
789
diff
changeset
|
206 |
|
4 | 207 |
case Kind of |
915 | 208 |
gtAmmo_Bomb, |
209 |
gtClusterBomb: begin |
|
351 | 210 |
Result^.Radius:= 4; |
211 |
Result^.Elasticity:= _0_6; |
|
997 | 212 |
Result^.Friction:= _0_96; |
4 | 213 |
end; |
1261 | 214 |
gtWatermelon: begin |
215 |
Result^.Radius:= 4; |
|
216 |
Result^.Elasticity:= _0_8; |
|
217 |
Result^.Friction:= _0_995; |
|
218 |
end; |
|
4 | 219 |
gtHedgehog: begin |
351 | 220 |
Result^.Radius:= cHHRadius; |
221 |
Result^.Elasticity:= _0_35; |
|
222 |
Result^.Friction:= _0_999; |
|
223 |
Result^.Angle:= cMaxAngle div 2; |
|
224 |
Result^.Z:= cHHZ; |
|
4 | 225 |
end; |
226 |
gtAmmo_Grenade: begin |
|
351 | 227 |
Result^.Radius:= 4; |
4 | 228 |
end; |
229 |
gtHealthTag: begin |
|
351 | 230 |
Result^.Timer:= 1500; |
522 | 231 |
Result^.Z:= 2001; |
4 | 232 |
end; |
233 |
gtGrave: begin |
|
351 | 234 |
Result^.Radius:= 10; |
235 |
Result^.Elasticity:= _0_6; |
|
4 | 236 |
end; |
237 |
gtUFO: begin |
|
351 | 238 |
Result^.Radius:= 5; |
239 |
Result^.Timer:= 500; |
|
240 |
Result^.Elasticity:= _0_9 |
|
4 | 241 |
end; |
242 |
gtShotgunShot: begin |
|
351 | 243 |
Result^.Timer:= 900; |
244 |
Result^.Radius:= 2 |
|
4 | 245 |
end; |
246 |
gtPickHammer: begin |
|
351 | 247 |
Result^.Radius:= 10; |
248 |
Result^.Timer:= 4000 |
|
4 | 249 |
end; |
1263 | 250 |
gtSmokeTrace, |
251 |
gtEvilTrace: begin |
|
498 | 252 |
Result^.X:= Result^.X - _16; |
253 |
Result^.Y:= Result^.Y - _16; |
|
351 | 254 |
Result^.State:= 8 |
4 | 255 |
end; |
256 |
gtRope: begin |
|
351 | 257 |
Result^.Radius:= 3; |
498 | 258 |
Result^.Friction:= _450; |
4 | 259 |
RopePoints.Count:= 0; |
260 |
end; |
|
9 | 261 |
gtExplosion: begin |
1012 | 262 |
Result^.X:= Result^.X; |
263 |
Result^.Y:= Result^.Y; |
|
9 | 264 |
end; |
10 | 265 |
gtMine: begin |
503 | 266 |
Result^.State:= Result^.State or gstMoving; |
915 | 267 |
Result^.Radius:= 2; |
351 | 268 |
Result^.Elasticity:= _0_55; |
269 |
Result^.Friction:= _0_995; |
|
270 |
Result^.Timer:= 3000; |
|
10 | 271 |
end; |
14
81f125629b25
- Mine checks whether a hedgehog is near less frequently
unc0rr
parents:
10
diff
changeset
|
272 |
gtCase: begin |
351 | 273 |
Result^.Radius:= 16; |
601
78a68cc4d846
Special game mode allowing the only clan on map for training mode
unc0rr
parents:
595
diff
changeset
|
274 |
Result^.Elasticity:= _0_3 |
14
81f125629b25
- Mine checks whether a hedgehog is near less frequently
unc0rr
parents:
10
diff
changeset
|
275 |
end; |
37 | 276 |
gtDEagleShot: begin |
351 | 277 |
Result^.Radius:= 1; |
278 |
Result^.Health:= 50 |
|
37 | 279 |
end; |
39 | 280 |
gtDynamite: begin |
351 | 281 |
Result^.Radius:= 3; |
282 |
Result^.Elasticity:= _0_55; |
|
283 |
Result^.Friction:= _0_03; |
|
284 |
Result^.Timer:= 5000; |
|
39 | 285 |
end; |
910 | 286 |
gtCluster: Result^.Radius:= 2; |
878 | 287 |
gtShover: Result^.Radius:= 20; |
79 | 288 |
gtFlame: begin |
351 | 289 |
Result^.Angle:= Counter mod 64; |
290 |
Result^.Radius:= 1; |
|
291 |
Result^.Health:= 2; |
|
292 |
Result^.dY:= (getrandom - _0_8) * _0_03; |
|
293 |
Result^.dX:= (getrandom - _0_5) * _0_4 |
|
79 | 294 |
end; |
82 | 295 |
gtFirePunch: begin |
351 | 296 |
Result^.Radius:= 15; |
297 |
Result^.Tag:= Y |
|
82 | 298 |
end; |
302 | 299 |
gtAirBomb: begin |
543
465e2ec8f05f
- Better randomness of placing hedgehogs on the land
unc0rr
parents:
542
diff
changeset
|
300 |
Result^.Radius:= 5; |
302 | 301 |
end; |
302 |
gtBlowTorch: begin |
|
511 | 303 |
Result^.Radius:= cHHRadius + cBlowTorchC; |
351 | 304 |
Result^.Timer:= 7500; |
302 | 305 |
end; |
522 | 306 |
gtSmallDamage: begin |
307 |
Result^.Timer:= 1100; |
|
308 |
Result^.Z:= 2000; |
|
309 |
end; |
|
540 | 310 |
gtSwitcher: begin |
311 |
Result^.Z:= cCurrHHZ |
|
312 |
end; |
|
593 | 313 |
gtTarget: begin |
601
78a68cc4d846
Special game mode allowing the only clan on map for training mode
unc0rr
parents:
595
diff
changeset
|
314 |
Result^.Radius:= 16; |
78a68cc4d846
Special game mode allowing the only clan on map for training mode
unc0rr
parents:
595
diff
changeset
|
315 |
Result^.Elasticity:= _0_3 |
593 | 316 |
end; |
924 | 317 |
gtMortar: begin |
994 | 318 |
Result^.Radius:= 4; |
924 | 319 |
Result^.Elasticity:= _0_2; |
320 |
Result^.Friction:= _0_08 |
|
321 |
end; |
|
925 | 322 |
gtWhip: Result^.Radius:= 20; |
984 | 323 |
gtKamikaze: begin |
324 |
Result^.Health:= 2048; |
|
325 |
Result^.Radius:= 20 |
|
326 |
end; |
|
1089 | 327 |
gtCake: begin |
1261 | 328 |
Result^.Health:= 2048; |
1103 | 329 |
Result^.Radius:= 7; |
1109 | 330 |
Result^.Z:= cOnHHZ; |
1089 | 331 |
if hwSign(dX) > 0 then Result^.Angle:= 1 else Result^.Angle:= 3 |
332 |
end; |
|
1263 | 333 |
gtHellishBomb: begin |
334 |
Result^.Radius:= 4; |
|
335 |
Result^.Elasticity:= _0_5; |
|
336 |
Result^.Friction:= _0_96; |
|
337 |
end; |
|
4 | 338 |
end; |
351 | 339 |
InsertGearToList(Result); |
340 |
AddGear:= Result |
|
4 | 341 |
end; |
342 |
||
343 |
procedure DeleteGear(Gear: PGear); |
|
48 | 344 |
var team: PTeam; |
307 | 345 |
t: Longword; |
4 | 346 |
begin |
503 | 347 |
DeleteCI(Gear); |
762 | 348 |
|
349 |
if Gear^.Tex <> nil then |
|
522 | 350 |
begin |
762 | 351 |
FreeTexture(Gear^.Tex); |
352 |
Gear^.Tex:= nil |
|
522 | 353 |
end; |
762 | 354 |
|
351 | 355 |
if Gear^.Kind = gtHedgehog then |
4 | 356 |
if CurAmmoGear <> nil then |
357 |
begin |
|
351 | 358 |
Gear^.Message:= gm_Destroy; |
359 |
CurAmmoGear^.Message:= gm_Destroy; |
|
4 | 360 |
exit |
47 | 361 |
end else |
362 |
begin |
|
498 | 363 |
if not (hwRound(Gear^.Y) < cWaterLine) then |
307 | 364 |
begin |
351 | 365 |
t:= max(Gear^.Damage, Gear^.Health); |
867 | 366 |
Gear^.Damage:= t; |
498 | 367 |
AddGear(hwRound(Gear^.X), hwRound(Gear^.Y), gtHealthTag, t, _0, _0, 0)^.Hedgehog:= Gear^.Hedgehog; |
867 | 368 |
uStats.HedgehogDamaged(Gear) |
307 | 369 |
end; |
351 | 370 |
team:= PHedgehog(Gear^.Hedgehog)^.Team; |
602 | 371 |
if CurrentHedgehog^.Gear = Gear then |
145 | 372 |
FreeActionsList; // to avoid ThinkThread on drawned gear |
351 | 373 |
PHedgehog(Gear^.Hedgehog)^.Gear:= nil; |
307 | 374 |
inc(KilledHHs); |
48 | 375 |
RecountTeamHealth(team); |
47 | 376 |
end; |
357 | 377 |
{$IFDEF DEBUGFILE}AddFileLog('DeleteGear');{$ENDIF} |
595
5ee863f2f568
Triggers PoC: targets are spawned right after the previous damaged
unc0rr
parents:
593
diff
changeset
|
378 |
if Gear^.TriggerId <> 0 then TickTrigger(Gear^.TriggerId); |
82 | 379 |
if CurAmmoGear = Gear then CurAmmoGear:= nil; |
4 | 380 |
if FollowGear = Gear then FollowGear:= nil; |
294 | 381 |
RemoveGearFromList(Gear); |
4 | 382 |
Dispose(Gear) |
383 |
end; |
|
384 |
||
385 |
function CheckNoDamage: boolean; // returns TRUE in case of no damaged hhs |
|
386 |
var Gear: PGear; |
|
387 |
begin |
|
351 | 388 |
CheckNoDamage:= true; |
4 | 389 |
Gear:= GearsList; |
390 |
while Gear <> nil do |
|
867 | 391 |
begin |
392 |
if Gear^.Kind = gtHedgehog then |
|
393 |
if Gear^.Damage <> 0 then |
|
394 |
begin |
|
395 |
CheckNoDamage:= false; |
|
396 |
uStats.HedgehogDamaged(Gear); |
|
351 | 397 |
|
867 | 398 |
if Gear^.Health < Gear^.Damage then |
399 |
Gear^.Health:= 0 |
|
400 |
else |
|
401 |
dec(Gear^.Health, Gear^.Damage); |
|
402 |
||
403 |
AddGear(hwRound(Gear^.X), hwRound(Gear^.Y) - cHHRadius - 12, |
|
404 |
gtHealthTag, Gear^.Damage, _0, _0, 0)^.Hedgehog:= Gear^.Hedgehog; |
|
405 |
RenderHealth(PHedgehog(Gear^.Hedgehog)^); |
|
406 |
RecountTeamHealth(PHedgehog(Gear^.Hedgehog)^.Team); |
|
407 |
||
408 |
Gear^.Damage:= 0 |
|
409 |
end; |
|
410 |
Gear:= Gear^.NextGear |
|
411 |
end; |
|
4 | 412 |
end; |
413 |
||
1054 | 414 |
procedure HealthMachine; |
415 |
var Gear: PGear; |
|
416 |
begin |
|
417 |
Gear:= GearsList; |
|
418 |
||
419 |
while Gear <> nil do |
|
420 |
begin |
|
421 |
if Gear^.Kind = gtHedgehog then |
|
422 |
Gear^.Damage:= min(cHealthDecrease, Gear^.Health - 1); |
|
423 |
||
424 |
Gear:= Gear^.NextGear |
|
425 |
end; |
|
426 |
end; |
|
427 |
||
1055
9af540b23409
Water rises after 25 mins of round, health is decreased after 20 mins
unc0rr
parents:
1054
diff
changeset
|
428 |
function WaterMachine: boolean; |
9af540b23409
Water rises after 25 mins of round, health is decreased after 20 mins
unc0rr
parents:
1054
diff
changeset
|
429 |
const |
9af540b23409
Water rises after 25 mins of round, health is decreased after 20 mins
unc0rr
parents:
1054
diff
changeset
|
430 |
decStep: Longword = 0; |
1070 | 431 |
LastTurn: LongInt = 0; |
1055
9af540b23409
Water rises after 25 mins of round, health is decreased after 20 mins
unc0rr
parents:
1054
diff
changeset
|
432 |
var i: LongWord; |
9af540b23409
Water rises after 25 mins of round, health is decreased after 20 mins
unc0rr
parents:
1054
diff
changeset
|
433 |
begin |
9af540b23409
Water rises after 25 mins of round, health is decreased after 20 mins
unc0rr
parents:
1054
diff
changeset
|
434 |
if (decStep = 0) and (LastTurn < FinishedTurnsTotal) then |
9af540b23409
Water rises after 25 mins of round, health is decreased after 20 mins
unc0rr
parents:
1054
diff
changeset
|
435 |
begin |
9af540b23409
Water rises after 25 mins of round, health is decreased after 20 mins
unc0rr
parents:
1054
diff
changeset
|
436 |
LastTurn:= FinishedTurnsTotal; |
9af540b23409
Water rises after 25 mins of round, health is decreased after 20 mins
unc0rr
parents:
1054
diff
changeset
|
437 |
decStep:= 40 |
9af540b23409
Water rises after 25 mins of round, health is decreased after 20 mins
unc0rr
parents:
1054
diff
changeset
|
438 |
end; |
9af540b23409
Water rises after 25 mins of round, health is decreased after 20 mins
unc0rr
parents:
1054
diff
changeset
|
439 |
|
9af540b23409
Water rises after 25 mins of round, health is decreased after 20 mins
unc0rr
parents:
1054
diff
changeset
|
440 |
if decStep <> 0 then |
9af540b23409
Water rises after 25 mins of round, health is decreased after 20 mins
unc0rr
parents:
1054
diff
changeset
|
441 |
begin |
9af540b23409
Water rises after 25 mins of round, health is decreased after 20 mins
unc0rr
parents:
1054
diff
changeset
|
442 |
dec(decStep); |
9af540b23409
Water rises after 25 mins of round, health is decreased after 20 mins
unc0rr
parents:
1054
diff
changeset
|
443 |
dec(cWaterLine); |
9af540b23409
Water rises after 25 mins of round, health is decreased after 20 mins
unc0rr
parents:
1054
diff
changeset
|
444 |
for i:= 0 to 2047 do |
9af540b23409
Water rises after 25 mins of round, health is decreased after 20 mins
unc0rr
parents:
1054
diff
changeset
|
445 |
Land[cWaterLine, i]:= 0; |
9af540b23409
Water rises after 25 mins of round, health is decreased after 20 mins
unc0rr
parents:
1054
diff
changeset
|
446 |
SetAllToActive |
9af540b23409
Water rises after 25 mins of round, health is decreased after 20 mins
unc0rr
parents:
1054
diff
changeset
|
447 |
end; |
9af540b23409
Water rises after 25 mins of round, health is decreased after 20 mins
unc0rr
parents:
1054
diff
changeset
|
448 |
|
9af540b23409
Water rises after 25 mins of round, health is decreased after 20 mins
unc0rr
parents:
1054
diff
changeset
|
449 |
WaterMachine:= decStep <> 0; |
9af540b23409
Water rises after 25 mins of round, health is decreased after 20 mins
unc0rr
parents:
1054
diff
changeset
|
450 |
end; |
9af540b23409
Water rises after 25 mins of round, health is decreased after 20 mins
unc0rr
parents:
1054
diff
changeset
|
451 |
|
522 | 452 |
procedure AddDamageTag(X, Y, Damage: LongWord; Gear: PGear); |
453 |
begin |
|
529 | 454 |
if cAltDamage then |
455 |
AddGear(X, Y, gtSmallDamage, Damage, _0, _0, 0)^.Hedgehog:= Gear^.Hedgehog; |
|
522 | 456 |
end; |
457 |
||
4 | 458 |
procedure ProcessGears; |
614 | 459 |
const delay: LongWord = 0; |
869 | 460 |
step: (stDelay, stChDmg, stTurnReact, |
1055
9af540b23409
Water rises after 25 mins of round, health is decreased after 20 mins
unc0rr
parents:
1054
diff
changeset
|
461 |
stAfterDelay, stChWin, stWater, stHealth, |
9af540b23409
Water rises after 25 mins of round, health is decreased after 20 mins
unc0rr
parents:
1054
diff
changeset
|
462 |
stSpawn, stNTurn) = stDelay; |
1054 | 463 |
|
4 | 464 |
var Gear, t: PGear; |
465 |
begin |
|
868 | 466 |
PrvInactive:= AllInactive; |
4 | 467 |
AllInactive:= true; |
468 |
t:= GearsList; |
|
1054 | 469 |
while t <> nil do |
4 | 470 |
begin |
471 |
Gear:= t; |
|
351 | 472 |
t:= Gear^.NextGear; |
473 |
if Gear^.Active then Gear^.doStep(Gear); |
|
4 | 474 |
end; |
89 | 475 |
|
4 | 476 |
if AllInactive then |
15 | 477 |
case step of |
478 |
stDelay: begin |
|
479 |
if delay = 0 then |
|
480 |
delay:= cInactDelay |
|
614 | 481 |
else |
482 |
dec(delay); |
|
483 |
||
484 |
if delay = 0 then |
|
485 |
inc(step) |
|
15 | 486 |
end; |
487 |
stChDmg: if CheckNoDamage then inc(step) else step:= stDelay; |
|
814
7fb4417b7bc1
Start implementing better statistics implementation (does nothing yet)
unc0rr
parents:
809
diff
changeset
|
488 |
stTurnReact: begin |
1054 | 489 |
if (not bBetweenTurns) and (not isInMultiShoot) then |
855
8842c71d16bf
- Fix too long delay between shotgun and deagle shots
unc0rr
parents:
854
diff
changeset
|
490 |
begin |
8842c71d16bf
- Fix too long delay between shotgun and deagle shots
unc0rr
parents:
854
diff
changeset
|
491 |
uStats.TurnReaction; |
8842c71d16bf
- Fix too long delay between shotgun and deagle shots
unc0rr
parents:
854
diff
changeset
|
492 |
inc(step) |
8842c71d16bf
- Fix too long delay between shotgun and deagle shots
unc0rr
parents:
854
diff
changeset
|
493 |
end else |
8842c71d16bf
- Fix too long delay between shotgun and deagle shots
unc0rr
parents:
854
diff
changeset
|
494 |
inc(step, 2); |
814
7fb4417b7bc1
Start implementing better statistics implementation (does nothing yet)
unc0rr
parents:
809
diff
changeset
|
495 |
end; |
815 | 496 |
stAfterDelay: begin |
497 |
if delay = 0 then |
|
498 |
delay:= cInactDelay |
|
499 |
else |
|
500 |
dec(delay); |
|
501 |
||
502 |
if delay = 0 then |
|
503 |
inc(step) |
|
504 |
end; |
|
1058
c53c5c4e7b48
- Proper turns counting, split SwitchHedgehog into two functions
unc0rr
parents:
1056
diff
changeset
|
505 |
stChWin: if not CheckForWin then |
c53c5c4e7b48
- Proper turns counting, split SwitchHedgehog into two functions
unc0rr
parents:
1056
diff
changeset
|
506 |
begin |
1064
9e0701c56fb3
Fix another regression arising from splitting switchhedgehog
unc0rr
parents:
1063
diff
changeset
|
507 |
if not (bBetweenTurns or isInMultiShoot) then |
1060 | 508 |
begin |
1061 | 509 |
ParseCommand('/nextturn', true); |
1060 | 510 |
SwitchHedgehog; |
511 |
end; |
|
1058
c53c5c4e7b48
- Proper turns counting, split SwitchHedgehog into two functions
unc0rr
parents:
1056
diff
changeset
|
512 |
inc(step) |
c53c5c4e7b48
- Proper turns counting, split SwitchHedgehog into two functions
unc0rr
parents:
1056
diff
changeset
|
513 |
end else step:= stDelay; |
1055
9af540b23409
Water rises after 25 mins of round, health is decreased after 20 mins
unc0rr
parents:
1054
diff
changeset
|
514 |
stWater: begin |
1058
c53c5c4e7b48
- Proper turns counting, split SwitchHedgehog into two functions
unc0rr
parents:
1056
diff
changeset
|
515 |
if TotalRounds = 17 then bWaterRising:= true; |
1055
9af540b23409
Water rises after 25 mins of round, health is decreased after 20 mins
unc0rr
parents:
1054
diff
changeset
|
516 |
|
1056 | 517 |
if not bWaterRising then |
518 |
inc(step) |
|
1055
9af540b23409
Water rises after 25 mins of round, health is decreased after 20 mins
unc0rr
parents:
1054
diff
changeset
|
519 |
else |
1056 | 520 |
begin |
521 |
if delay = 0 then |
|
522 |
delay:= 17 |
|
523 |
else |
|
524 |
dec(delay); |
|
1055
9af540b23409
Water rises after 25 mins of round, health is decreased after 20 mins
unc0rr
parents:
1054
diff
changeset
|
525 |
|
1056 | 526 |
if delay = 0 then |
527 |
if not WaterMachine then inc(step) |
|
528 |
end |
|
1055
9af540b23409
Water rises after 25 mins of round, health is decreased after 20 mins
unc0rr
parents:
1054
diff
changeset
|
529 |
end; |
9af540b23409
Water rises after 25 mins of round, health is decreased after 20 mins
unc0rr
parents:
1054
diff
changeset
|
530 |
stHealth: begin |
1063 | 531 |
if (TotalRounds = 15) and (cHealthDecrease = 0) then |
532 |
begin |
|
533 |
cHealthDecrease:= 5; |
|
534 |
AddCaption(trmsg[sidSuddenDeath], $FFFFFF, capgrpGameState) |
|
535 |
end; |
|
1055
9af540b23409
Water rises after 25 mins of round, health is decreased after 20 mins
unc0rr
parents:
1054
diff
changeset
|
536 |
|
9af540b23409
Water rises after 25 mins of round, health is decreased after 20 mins
unc0rr
parents:
1054
diff
changeset
|
537 |
if (cHealthDecrease = 0) |
1054 | 538 |
or bBetweenTurns |
539 |
or isInMultiShoot |
|
1058
c53c5c4e7b48
- Proper turns counting, split SwitchHedgehog into two functions
unc0rr
parents:
1056
diff
changeset
|
540 |
or (TotalRounds = 0) then inc(step) |
1054 | 541 |
else begin |
542 |
bBetweenTurns:= true; |
|
543 |
HealthMachine; |
|
544 |
step:= stChDmg |
|
1055
9af540b23409
Water rises after 25 mins of round, health is decreased after 20 mins
unc0rr
parents:
1054
diff
changeset
|
545 |
end |
9af540b23409
Water rises after 25 mins of round, health is decreased after 20 mins
unc0rr
parents:
1054
diff
changeset
|
546 |
end; |
15 | 547 |
stSpawn: begin |
548 |
if not isInMultiShoot then SpawnBoxOfSmth; |
|
549 |
inc(step) |
|
550 |
end; |
|
551 |
stNTurn: begin |
|
552 |
if isInMultiShoot then isInMultiShoot:= false |
|
307 | 553 |
else begin |
1058
c53c5c4e7b48
- Proper turns counting, split SwitchHedgehog into two functions
unc0rr
parents:
1056
diff
changeset
|
554 |
AfterSwitchHedgehog; |
1054 | 555 |
bBetweenTurns:= false |
307 | 556 |
end; |
15 | 557 |
step:= Low(step) |
558 |
end; |
|
559 |
end; |
|
560 |
||
4 | 561 |
if TurnTimeLeft > 0 then |
870 | 562 |
if CurrentHedgehog^.Gear <> nil then |
563 |
if ((CurrentHedgehog^.Gear^.State and gstAttacking) = 0) |
|
564 |
and not isInMultiShoot then |
|
565 |
begin |
|
566 |
if (TurnTimeLeft = 5000) |
|
567 |
and (CurrentHedgehog^.Gear <> nil) |
|
568 |
and ((CurrentHedgehog^.Gear^.State and gstAttacked) = 0) then PlaySound(sndHurry, false); |
|
569 |
dec(TurnTimeLeft) |
|
570 |
end; |
|
351 | 571 |
|
651 | 572 |
if (not CurrentTeam^.ExtDriven) and |
917 | 573 |
((GameTicks and $FFFF) = $FFFF) then |
574 |
begin |
|
575 |
SendIPCTimeInc; |
|
576 |
inc(hiTicks) // we do not recieve a message for this |
|
577 |
end; |
|
656
6d6d9d7b1054
Fix network game bug caused by recent protocol changes
unc0rr
parents:
651
diff
changeset
|
578 |
|
515 | 579 |
inc(GameTicks) |
4 | 580 |
end; |
581 |
||
582 |
procedure SetAllToActive; |
|
583 |
var t: PGear; |
|
584 |
begin |
|
585 |
AllInactive:= false; |
|
586 |
t:= GearsList; |
|
351 | 587 |
while t <> nil do |
4 | 588 |
begin |
351 | 589 |
t^.Active:= true; |
590 |
t:= t^.NextGear |
|
4 | 591 |
end |
592 |
end; |
|
593 |
||
594 |
procedure SetAllHHToActive; |
|
595 |
var t: PGear; |
|
596 |
begin |
|
597 |
AllInactive:= false; |
|
598 |
t:= GearsList; |
|
351 | 599 |
while t <> nil do |
4 | 600 |
begin |
351 | 601 |
if t^.Kind = gtHedgehog then t^.Active:= true; |
602 |
t:= t^.NextGear |
|
4 | 603 |
end |
604 |
end; |
|
605 |
||
841
0700e3d3474d
Get rid if deprecated Surface parameter of Draw* calls
unc0rr
parents:
840
diff
changeset
|
606 |
procedure DrawHH(Gear: PGear); |
371 | 607 |
var t: LongInt; |
822 | 608 |
amt: TAmmoType; |
862 | 609 |
hx, hy, m: LongInt; |
610 |
aAngle, dAngle: real; |
|
1253 | 611 |
defaultPos, HatVisible: boolean; |
292 | 612 |
begin |
868 | 613 |
if (Gear^.State and gstHHDeath) <> 0 then |
614 |
begin |
|
615 |
DrawSprite(sprHHDeath, hwRound(Gear^.X) - 16 + WorldDx, hwRound(Gear^.Y) - 26 + WorldDy, Gear^.Pos); |
|
616 |
exit |
|
617 |
end; |
|
1002 | 618 |
|
824 | 619 |
defaultPos:= true; |
1253 | 620 |
HatVisible:= false; |
847 | 621 |
|
1002 | 622 |
if (Gear^.State and gstDrowning) <> 0 then |
623 |
begin |
|
624 |
DrawHedgehog(hwRound(Gear^.X) + 1 + WorldDx, hwRound(Gear^.Y) - 3 + WorldDy, |
|
625 |
hwSign(Gear^.dX), |
|
626 |
1, |
|
627 |
7, |
|
628 |
0); |
|
629 |
defaultPos:= false |
|
630 |
end else |
|
631 |
||
1011 | 632 |
if (Gear^.State and gstWinner) <> 0 then |
633 |
begin |
|
634 |
DrawHedgehog(hwRound(Gear^.X) + 1 + WorldDx, hwRound(Gear^.Y) - 3 + WorldDy, |
|
635 |
hwSign(Gear^.dX), |
|
636 |
2, |
|
637 |
0, |
|
638 |
0); |
|
639 |
defaultPos:= false |
|
640 |
end else |
|
641 |
||
821
e6c0408b54ed
Use 'regular standing' and 'rope swing' hedgehog sprites
unc0rr
parents:
815
diff
changeset
|
642 |
if (Gear^.State and gstHHDriven) <> 0 then |
966 | 643 |
begin |
1002 | 644 |
hx:= hwRound(Gear^.X) + 1 + 8 * hwSign(Gear^.dX) + WorldDx; |
645 |
hy:= hwRound(Gear^.Y) - 2 + WorldDy; |
|
646 |
aangle:= Gear^.Angle * 180 / cMaxAngle - 90; |
|
874 | 647 |
|
1002 | 648 |
if CurAmmoGear <> nil then |
649 |
begin |
|
650 |
case CurAmmoGear^.Kind of |
|
651 |
gtShotgunShot: if (CurAmmoGear^.State and gstAnimation <> 0) then |
|
652 |
DrawRotated(sprShotgun, hx, hy, hwSign(Gear^.dX), aangle) |
|
653 |
else |
|
654 |
DrawRotated(sprHandShotgun, hx, hy, hwSign(Gear^.dX), aangle); |
|
655 |
gtDEagleShot: DrawRotated(sprDEagle, hx, hy, hwSign(Gear^.dX), aangle); |
|
656 |
gtRope: begin |
|
657 |
if Gear^.X < CurAmmoGear^.X then |
|
658 |
begin |
|
659 |
dAngle:= 0; |
|
660 |
m:= 1 |
|
661 |
end else |
|
662 |
begin |
|
663 |
dAngle:= 180; |
|
664 |
m:= -1 |
|
966 | 665 |
end; |
1002 | 666 |
DrawHedgehog(hwRound(Gear^.X) + WorldDx, hwRound(Gear^.Y) + WorldDy, |
667 |
m, |
|
668 |
1, |
|
669 |
0, |
|
670 |
DxDy2Angle(CurAmmoGear^.dY, CurAmmoGear^.dX) + dAngle); |
|
671 |
defaultPos:= false |
|
672 |
end; |
|
673 |
gtBlowTorch: begin |
|
674 |
DrawRotated(sprBlowTorch, hx, hy, hwSign(Gear^.dX), aangle); |
|
675 |
DrawHedgehog(hwRound(Gear^.X) + 1 + WorldDx, hwRound(Gear^.Y) - 3 + WorldDy, |
|
676 |
hwSign(Gear^.dX), |
|
677 |
3, |
|
1113 | 678 |
PHedgehog(Gear^.Hedgehog)^.visStepPos div 2, |
1002 | 679 |
0); |
680 |
defaultPos:= false |
|
681 |
end; |
|
682 |
gtShover: DrawRotated(sprHandBaseball, hx, hy, hwSign(Gear^.dX), aangle + 180); |
|
683 |
gtFirePunch: begin |
|
684 |
DrawHedgehog(hwRound(Gear^.X) + 1 + WorldDx, hwRound(Gear^.Y) - 3 + WorldDy, |
|
685 |
hwSign(Gear^.dX), |
|
686 |
1, |
|
687 |
4, |
|
688 |
0); |
|
689 |
defaultPos:= false |
|
690 |
end; |
|
691 |
gtPickHammer, |
|
692 |
gtTeleport: defaultPos:= false; |
|
1010 | 693 |
gtWhip: begin |
694 |
DrawRotatedF(sprWhip, |
|
695 |
hwRound(Gear^.X) + 1 + WorldDx, |
|
696 |
hwRound(Gear^.Y) - 3 + WorldDy, |
|
697 |
1, |
|
698 |
hwSign(Gear^.dX), |
|
699 |
0); |
|
700 |
defaultPos:= false |
|
701 |
end; |
|
1002 | 702 |
gtKamikaze: begin |
703 |
if CurAmmoGear^.Pos = 0 then |
|
704 |
DrawHedgehog(hwRound(Gear^.X) + 1 + WorldDx, hwRound(Gear^.Y) - 3 + WorldDy, |
|
705 |
hwSign(Gear^.dX), |
|
706 |
1, |
|
707 |
6, |
|
708 |
0) |
|
709 |
else |
|
710 |
DrawRotatedF(sprKamikaze, |
|
711 |
hwRound(Gear^.X) + WorldDx, |
|
712 |
hwRound(Gear^.Y) + WorldDy, |
|
713 |
CurAmmoGear^.Pos - 1, |
|
714 |
1, |
|
715 |
DxDy2Angle(Gear^.dY, Gear^.dX)); |
|
716 |
||
717 |
defaultPos:= false |
|
718 |
end; |
|
719 |
end; |
|
720 |
||
721 |
case CurAmmoGear^.Kind of |
|
722 |
gtShotgunShot, |
|
723 |
gtDEagleShot, |
|
724 |
gtShover: begin |
|
725 |
DrawHedgehog(hwRound(Gear^.X) + 1 + WorldDx, hwRound(Gear^.Y) - 3 + WorldDy, |
|
726 |
hwSign(Gear^.dX), |
|
727 |
0, |
|
728 |
4, |
|
729 |
0); |
|
730 |
defaultPos:= false |
|
731 |
end |
|
732 |
end |
|
733 |
end else |
|
876 | 734 |
|
1002 | 735 |
if ((Gear^.State and gstHHJumping) <> 0) then |
736 |
begin |
|
737 |
if ((Gear^.State and gstHHHJump) <> 0) then |
|
738 |
DrawHedgehog(hwRound(Gear^.X) + 1 + WorldDx, hwRound(Gear^.Y) - 3 + WorldDy, |
|
739 |
- hwSign(Gear^.dX), |
|
740 |
1, |
|
741 |
1, |
|
742 |
0) |
|
743 |
else |
|
744 |
DrawHedgehog(hwRound(Gear^.X) + 1 + WorldDx, hwRound(Gear^.Y) - 3 + WorldDy, |
|
745 |
hwSign(Gear^.dX), |
|
746 |
1, |
|
747 |
1, |
|
748 |
0); |
|
749 |
defaultPos:= false |
|
750 |
end else |
|
874 | 751 |
|
1002 | 752 |
if (Gear^.Message and (gm_Left or gm_Right) <> 0) then |
824 | 753 |
begin |
1002 | 754 |
DrawHedgehog(hwRound(Gear^.X) + 1 + WorldDx, hwRound(Gear^.Y) - 3 + WorldDy, |
755 |
hwSign(Gear^.dX), |
|
756 |
0, |
|
757 |
PHedgehog(Gear^.Hedgehog)^.visStepPos div 2, |
|
758 |
0); |
|
1257 | 759 |
defaultPos:= false; |
760 |
HatVisible:= true |
|
1002 | 761 |
end |
762 |
else |
|
763 |
||
1033 | 764 |
if ((Gear^.State and gstAnimation) <> 0) then |
765 |
begin |
|
1034 | 766 |
DrawRotatedF(Wavez[TWave(Gear^.Tag)].Sprite, |
1033 | 767 |
hwRound(Gear^.X) + 1 + WorldDx, |
768 |
hwRound(Gear^.Y) - 3 + WorldDy, |
|
769 |
Gear^.Pos, |
|
770 |
hwSign(Gear^.dX), |
|
771 |
0.0); |
|
772 |
defaultPos:= false |
|
773 |
end |
|
774 |
else |
|
1002 | 775 |
if ((Gear^.State and gstAttacked) = 0) then |
776 |
begin |
|
777 |
amt:= CurrentHedgehog^.Ammo^[CurrentHedgehog^.CurSlot, CurrentHedgehog^.CurAmmo].AmmoType; |
|
778 |
case amt of |
|
779 |
amBazooka, |
|
780 |
amMortar: DrawRotated(sprHandBazooka, hx, hy, hwSign(Gear^.dX), aangle); |
|
781 |
amRope: DrawRotated(sprHandRope, hx, hy, hwSign(Gear^.dX), aangle); |
|
782 |
amShotgun: DrawRotated(sprHandShotgun, hx, hy, hwSign(Gear^.dX), aangle); |
|
783 |
amDEagle: DrawRotated(sprHandDEagle, hx, hy, hwSign(Gear^.dX), aangle); |
|
784 |
amBlowTorch: DrawRotated(sprHandBlowTorch, hx, hy, hwSign(Gear^.dX), aangle); |
|
785 |
end; |
|
786 |
||
787 |
case amt of |
|
788 |
amAirAttack, |
|
789 |
amMineStrike: DrawRotated(sprHandAirAttack, hwRound(Gear^.X) + 1 + WorldDx, hwRound(Gear^.Y) + WorldDy, hwSign(Gear^.dX), 0); |
|
790 |
amPickHammer: DrawHedgehog(hwRound(Gear^.X) + 1 + WorldDx, hwRound(Gear^.Y) - 3 + WorldDy, |
|
791 |
hwSign(Gear^.dX), |
|
792 |
1, |
|
793 |
2, |
|
794 |
0); |
|
795 |
amBlowTorch: DrawHedgehog(hwRound(Gear^.X) + 1 + WorldDx, hwRound(Gear^.Y) - 3 + WorldDy, |
|
796 |
hwSign(Gear^.dX), |
|
797 |
1, |
|
798 |
3, |
|
799 |
0); |
|
800 |
amTeleport: DrawRotatedF(sprTeleport, hwRound(Gear^.X) + 1 + WorldDx, hwRound(Gear^.Y) - 3 + WorldDy, 0, hwSign(Gear^.dX), 0); |
|
801 |
amKamikaze: DrawHedgehog(hwRound(Gear^.X) + 1 + WorldDx, hwRound(Gear^.Y) - 3 + WorldDy, |
|
802 |
hwSign(Gear^.dX), |
|
803 |
1, |
|
804 |
5, |
|
805 |
0); |
|
1221 | 806 |
amWhip: DrawRotatedF(sprWhip, |
1010 | 807 |
hwRound(Gear^.X) + 1 + WorldDx, |
808 |
hwRound(Gear^.Y) - 3 + WorldDy, |
|
809 |
0, |
|
810 |
hwSign(Gear^.dX), |
|
811 |
0); |
|
1221 | 812 |
amSeduction: DrawHedgehog(hwRound(Gear^.X) + 1 + WorldDx, hwRound(Gear^.Y) - 3 + WorldDy, |
813 |
hwSign(Gear^.dX), |
|
814 |
2, |
|
815 |
2, |
|
816 |
0); |
|
1002 | 817 |
else |
822 | 818 |
DrawHedgehog(hwRound(Gear^.X) + 1 + WorldDx, hwRound(Gear^.Y) - 3 + WorldDy, |
819 |
hwSign(Gear^.dX), |
|
820 |
0, |
|
1002 | 821 |
4, |
822 | 822 |
0); |
1253 | 823 |
|
824 |
HatVisible:= true; |
|
825 |
with PHedgehog(Gear^.Hedgehog)^ do |
|
826 |
if HatVisibility > 0 then |
|
827 |
DrawTextureF(HatTex, |
|
828 |
HatVisibility, |
|
829 |
hwRound(Gear^.X) + 1 + WorldDx, |
|
830 |
hwRound(Gear^.Y) - 8 + WorldDy, |
|
831 |
0, |
|
832 |
hwSign(Gear^.dX), |
|
833 |
32); |
|
1002 | 834 |
end; |
966 | 835 |
|
1002 | 836 |
case amt of |
837 |
amBaseballBat: DrawRotated(sprHandBaseball, |
|
838 |
hwRound(Gear^.X) + 1 - 4 * hwSign(Gear^.dX) + WorldDx, |
|
839 |
hwRound(Gear^.Y) + 6 + WorldDy, hwSign(Gear^.dX), aangle); |
|
840 |
end; |
|
966 | 841 |
|
1002 | 842 |
defaultPos:= false |
843 |
end |
|
844 |
end else // not gstHHDriven |
|
1012 | 845 |
begin |
1014
3c7d4e7ccdff
- Fix firepunch sprite direction when use in high jump
unc0rr
parents:
1013
diff
changeset
|
846 |
if (Gear^.Damage > 0) |
3c7d4e7ccdff
- Fix firepunch sprite direction when use in high jump
unc0rr
parents:
1013
diff
changeset
|
847 |
and (hwSqr(Gear^.dX) + hwSqr(Gear^.dY) > _0_003) then |
3c7d4e7ccdff
- Fix firepunch sprite direction when use in high jump
unc0rr
parents:
1013
diff
changeset
|
848 |
begin |
1012 | 849 |
DrawHedgehog(hwRound(Gear^.X) + 1 + WorldDx, hwRound(Gear^.Y) - 3 + WorldDy, |
850 |
hwSign(Gear^.dX), |
|
1014
3c7d4e7ccdff
- Fix firepunch sprite direction when use in high jump
unc0rr
parents:
1013
diff
changeset
|
851 |
2, |
1012 | 852 |
1, |
1014
3c7d4e7ccdff
- Fix firepunch sprite direction when use in high jump
unc0rr
parents:
1013
diff
changeset
|
853 |
Gear^.DirAngle); |
1012 | 854 |
defaultPos:= false |
1020 | 855 |
end else |
1014
3c7d4e7ccdff
- Fix firepunch sprite direction when use in high jump
unc0rr
parents:
1013
diff
changeset
|
856 |
|
3c7d4e7ccdff
- Fix firepunch sprite direction when use in high jump
unc0rr
parents:
1013
diff
changeset
|
857 |
if ((Gear^.State and gstHHJumping) <> 0) then |
3c7d4e7ccdff
- Fix firepunch sprite direction when use in high jump
unc0rr
parents:
1013
diff
changeset
|
858 |
begin |
3c7d4e7ccdff
- Fix firepunch sprite direction when use in high jump
unc0rr
parents:
1013
diff
changeset
|
859 |
if ((Gear^.State and gstHHHJump) <> 0) then |
3c7d4e7ccdff
- Fix firepunch sprite direction when use in high jump
unc0rr
parents:
1013
diff
changeset
|
860 |
DrawHedgehog(hwRound(Gear^.X) + 1 + WorldDx, hwRound(Gear^.Y) - 3 + WorldDy, |
3c7d4e7ccdff
- Fix firepunch sprite direction when use in high jump
unc0rr
parents:
1013
diff
changeset
|
861 |
- hwSign(Gear^.dX), |
3c7d4e7ccdff
- Fix firepunch sprite direction when use in high jump
unc0rr
parents:
1013
diff
changeset
|
862 |
1, |
3c7d4e7ccdff
- Fix firepunch sprite direction when use in high jump
unc0rr
parents:
1013
diff
changeset
|
863 |
1, |
3c7d4e7ccdff
- Fix firepunch sprite direction when use in high jump
unc0rr
parents:
1013
diff
changeset
|
864 |
0) |
3c7d4e7ccdff
- Fix firepunch sprite direction when use in high jump
unc0rr
parents:
1013
diff
changeset
|
865 |
else |
3c7d4e7ccdff
- Fix firepunch sprite direction when use in high jump
unc0rr
parents:
1013
diff
changeset
|
866 |
DrawHedgehog(hwRound(Gear^.X) + 1 + WorldDx, hwRound(Gear^.Y) - 3 + WorldDy, |
3c7d4e7ccdff
- Fix firepunch sprite direction when use in high jump
unc0rr
parents:
1013
diff
changeset
|
867 |
hwSign(Gear^.dX), |
3c7d4e7ccdff
- Fix firepunch sprite direction when use in high jump
unc0rr
parents:
1013
diff
changeset
|
868 |
1, |
3c7d4e7ccdff
- Fix firepunch sprite direction when use in high jump
unc0rr
parents:
1013
diff
changeset
|
869 |
1, |
3c7d4e7ccdff
- Fix firepunch sprite direction when use in high jump
unc0rr
parents:
1013
diff
changeset
|
870 |
0); |
3c7d4e7ccdff
- Fix firepunch sprite direction when use in high jump
unc0rr
parents:
1013
diff
changeset
|
871 |
defaultPos:= false |
3c7d4e7ccdff
- Fix firepunch sprite direction when use in high jump
unc0rr
parents:
1013
diff
changeset
|
872 |
end; |
1012 | 873 |
end; |
834 | 874 |
|
1251 | 875 |
with PHedgehog(Gear^.Hedgehog)^ do |
970 | 876 |
begin |
1251 | 877 |
if defaultPos then |
878 |
begin |
|
879 |
DrawRotatedF(sprHHIdle, |
|
880 |
hwRound(Gear^.X) + 1 + WorldDx, |
|
881 |
hwRound(Gear^.Y) - 3 + WorldDy, |
|
882 |
(RealTicks div 128 + Gear^.Pos) mod 19, |
|
883 |
hwSign(Gear^.dX), |
|
884 |
0); |
|
1253 | 885 |
HatVisible:= true; |
886 |
end; |
|
887 |
||
888 |
if HatVisible then |
|
1251 | 889 |
if HatVisibility < 1.0 then |
1254 | 890 |
HatVisibility:= HatVisibility + 0.2 |
1253 | 891 |
else |
1251 | 892 |
else |
893 |
if HatVisibility > 0.0 then |
|
1254 | 894 |
HatVisibility:= HatVisibility - 0.2; |
1253 | 895 |
|
1251 | 896 |
if HatVisibility > 0 then |
1255 | 897 |
if DefaultPos then |
898 |
DrawTextureF(HatTex, |
|
899 |
HatVisibility, |
|
900 |
hwRound(Gear^.X) + 1 + WorldDx, |
|
901 |
hwRound(Gear^.Y) - 8 + WorldDy, |
|
902 |
(RealTicks div 128 + Gear^.Pos) mod 19, |
|
903 |
hwSign(Gear^.dX), |
|
904 |
32) |
|
905 |
else |
|
906 |
DrawTextureF(HatTex, |
|
907 |
HatVisibility, |
|
908 |
hwRound(Gear^.X) + 1 + WorldDx, |
|
909 |
hwRound(Gear^.Y) - 8 + WorldDy, |
|
910 |
0, |
|
911 |
hwSign(Gear^.dX), |
|
912 |
32); |
|
970 | 913 |
end; |
292 | 914 |
|
1251 | 915 |
|
351 | 916 |
with PHedgehog(Gear^.Hedgehog)^ do |
994 | 917 |
begin |
1011 | 918 |
if ((Gear^.State and not gstWinner) = 0) |
994 | 919 |
or (bShowFinger and ((Gear^.State and gstHHDriven) <> 0)) then |
958 | 920 |
begin |
976 | 921 |
t:= hwRound(Gear^.Y) - cHHRadius - 12 + WorldDy; |
958 | 922 |
if (cTagsMask and 1) <> 0 then |
923 |
begin |
|
924 |
dec(t, HealthTagTex^.h + 2); |
|
925 |
DrawCentered(hwRound(Gear^.X) + WorldDx, t, HealthTagTex) |
|
926 |
end; |
|
927 |
if (cTagsMask and 2) <> 0 then |
|
928 |
begin |
|
929 |
dec(t, NameTagTex^.h + 2); |
|
930 |
DrawCentered(hwRound(Gear^.X) + WorldDx, t, NameTagTex) |
|
931 |
end; |
|
932 |
if (cTagsMask and 4) <> 0 then |
|
933 |
begin |
|
934 |
dec(t, Team^.NameTagTex^.h + 2); |
|
935 |
DrawCentered(hwRound(Gear^.X) + WorldDx, t, Team^.NameTagTex) |
|
936 |
end |
|
994 | 937 |
end; |
938 |
if (Gear^.State and gstHHDriven) <> 0 then // Current hedgehog |
|
958 | 939 |
begin |
940 |
if bShowFinger and ((Gear^.State and gstHHDriven) <> 0) then |
|
941 |
DrawSprite(sprFinger, hwRound(Gear^.X) - 16 + WorldDx, hwRound(Gear^.Y) - 64 + WorldDy, |
|
942 |
GameTicks div 32 mod 16); |
|
821
e6c0408b54ed
Use 'regular standing' and 'rope swing' hedgehog sprites
unc0rr
parents:
815
diff
changeset
|
943 |
|
958 | 944 |
if (Gear^.State and gstDrowning) = 0 then |
945 |
if (Gear^.State and gstHHThinking) <> 0 then |
|
946 |
DrawSprite(sprQuestion, hwRound(Gear^.X) - 10 + WorldDx, hwRound(Gear^.Y) - cHHRadius - 34 + WorldDy, 0) |
|
947 |
else |
|
1033 | 948 |
if ShowCrosshair and ((Gear^.State and (gstAttacked or gstAnimation)) = 0) then |
958 | 949 |
begin |
950 |
if ((Gear^.State and gstHHHJump) <> 0) then m:= -1 else m:= 1; |
|
951 |
DrawRotatedTex(Team^.CrosshairTex, |
|
952 |
12, 12, |
|
953 |
Round(hwRound(Gear^.X) + hwSign(Gear^.dX) * m * Sin(Gear^.Angle*pi/cMaxAngle) * 60) + WorldDx, |
|
954 |
Round(hwRound(Gear^.Y) - Cos(Gear^.Angle*pi/cMaxAngle) * 60) + WorldDy, 0, |
|
955 |
hwSign(Gear^.dX) * (Gear^.Angle * 180.0) / cMaxAngle) |
|
956 |
end |
|
994 | 957 |
end |
958 |
end |
|
292 | 959 |
end; |
960 |
||
956 | 961 |
procedure DrawGears; |
853 | 962 |
var Gear, HHGear: PGear; |
4 | 963 |
i: Longword; |
371 | 964 |
roplen: LongInt; |
4 | 965 |
|
371 | 966 |
procedure DrawRopeLine(X1, Y1, X2, Y2: LongInt); |
967 |
var eX, eY, dX, dY: LongInt; |
|
968 |
i, sX, sY, x, y, d: LongInt; |
|
366 | 969 |
b: boolean; |
4 | 970 |
begin |
37 | 971 |
if (X1 = X2) and (Y1 = Y2) then |
972 |
begin |
|
351 | 973 |
OutError('WARNING: zero length rope line!', false); |
37 | 974 |
exit |
975 |
end; |
|
366 | 976 |
eX:= 0; |
977 |
eY:= 0; |
|
978 |
dX:= X2 - X1; |
|
979 |
dY:= Y2 - Y1; |
|
980 |
||
981 |
if (dX > 0) then sX:= 1 |
|
982 |
else |
|
983 |
if (dX < 0) then |
|
984 |
begin |
|
985 |
sX:= -1; |
|
986 |
dX:= -dX |
|
987 |
end else sX:= dX; |
|
988 |
||
989 |
if (dY > 0) then sY:= 1 |
|
990 |
else |
|
991 |
if (dY < 0) then |
|
4 | 992 |
begin |
366 | 993 |
sY:= -1; |
994 |
dY:= -dY |
|
995 |
end else sY:= dY; |
|
996 |
||
997 |
if (dX > dY) then d:= dX |
|
998 |
else d:= dY; |
|
999 |
||
1000 |
x:= X1; |
|
1001 |
y:= Y1; |
|
1002 |
||
1003 |
for i:= 0 to d do |
|
1004 |
begin |
|
1005 |
inc(eX, dX); |
|
1006 |
inc(eY, dY); |
|
1007 |
b:= false; |
|
1008 |
if (eX > d) then |
|
35 | 1009 |
begin |
366 | 1010 |
dec(eX, d); |
1011 |
inc(x, sX); |
|
1012 |
b:= true |
|
35 | 1013 |
end; |
366 | 1014 |
if (eY > d) then |
35 | 1015 |
begin |
366 | 1016 |
dec(eY, d); |
1017 |
inc(y, sY); |
|
1018 |
b:= true |
|
35 | 1019 |
end; |
366 | 1020 |
if b then |
1021 |
begin |
|
1022 |
inc(roplen); |
|
841
0700e3d3474d
Get rid if deprecated Surface parameter of Draw* calls
unc0rr
parents:
840
diff
changeset
|
1023 |
if (roplen mod 4) = 0 then DrawSprite(sprRopeNode, x - 2, y - 2, 0) |
366 | 1024 |
end |
4 | 1025 |
end |
366 | 1026 |
end; |
4 | 1027 |
|
1028 |
begin |
|
1029 |
Gear:= GearsList; |
|
1030 |
while Gear<>nil do |
|
1031 |
begin |
|
351 | 1032 |
case Gear^.Kind of |
822 | 1033 |
gtAmmo_Bomb: DrawRotated(sprBomb, hwRound(Gear^.X) + WorldDx, hwRound(Gear^.Y) + WorldDy, 0, Gear^.DirAngle); |
841
0700e3d3474d
Get rid if deprecated Surface parameter of Draw* calls
unc0rr
parents:
840
diff
changeset
|
1034 |
gtHedgehog: DrawHH(Gear); |
822 | 1035 |
gtAmmo_Grenade: DrawRotated(sprGrenade, hwRound(Gear^.X) + WorldDx, hwRound(Gear^.Y) + WorldDy, 0, DxDy2Angle(Gear^.dY, Gear^.dX)); |
522 | 1036 |
gtHealthTag, |
762 | 1037 |
gtSmallDamage: if Gear^.Tex <> nil then DrawCentered(hwRound(Gear^.X) + WorldDx, hwRound(Gear^.Y) + WorldDy, Gear^.Tex); |
841
0700e3d3474d
Get rid if deprecated Surface parameter of Draw* calls
unc0rr
parents:
840
diff
changeset
|
1038 |
gtGrave: DrawSurfSprite(hwRound(Gear^.X) + WorldDx - 16, hwRound(Gear^.Y) + WorldDy - 16, 32, (GameTicks shr 7) and 7, PHedgehog(Gear^.Hedgehog)^.Team^.GraveTex); |
0700e3d3474d
Get rid if deprecated Surface parameter of Draw* calls
unc0rr
parents:
840
diff
changeset
|
1039 |
gtUFO: DrawSprite(sprUFO, hwRound(Gear^.X) - 16 + WorldDx, hwRound(Gear^.Y) - 16 + WorldDy, (GameTicks shr 7) mod 4); |
848 | 1040 |
gtPickHammer: DrawSprite(sprPHammer, hwRound(Gear^.X) - 16 + WorldDx, hwRound(Gear^.Y) - 50 + LongInt(((GameTicks shr 5) and 1) * 2) + WorldDy, 0); |
4 | 1041 |
gtRope: begin |
35 | 1042 |
roplen:= 0; |
4 | 1043 |
if RopePoints.Count > 0 then |
1044 |
begin |
|
1045 |
i:= 0; |
|
1046 |
while i < Pred(RopePoints.Count) do |
|
1047 |
begin |
|
351 | 1048 |
DrawRopeLine(hwRound(RopePoints.ar[i].X) + WorldDx, hwRound(RopePoints.ar[i].Y) + WorldDy, |
1049 |
hwRound(RopePoints.ar[Succ(i)].X) + WorldDx, hwRound(RopePoints.ar[Succ(i)].Y) + WorldDy); |
|
4 | 1050 |
inc(i) |
1051 |
end; |
|
351 | 1052 |
DrawRopeLine(hwRound(RopePoints.ar[i].X) + WorldDx, hwRound(RopePoints.ar[i].Y) + WorldDy, |
1053 |
hwRound(Gear^.X) + WorldDx, hwRound(Gear^.Y) + WorldDy); |
|
1054 |
DrawRopeLine(hwRound(Gear^.X) + WorldDx, hwRound(Gear^.Y) + WorldDy, |
|
1055 |
hwRound(PHedgehog(Gear^.Hedgehog)^.Gear^.X) + WorldDx, hwRound(PHedgehog(Gear^.Hedgehog)^.Gear^.Y) + WorldDy); |
|
822 | 1056 |
DrawRotated(sprRopeHook, hwRound(RopePoints.ar[0].X) + WorldDx, hwRound(RopePoints.ar[0].Y) + WorldDy, 1, RopePoints.HookAngle) |
4 | 1057 |
end else |
35 | 1058 |
begin |
351 | 1059 |
DrawRopeLine(hwRound(Gear^.X) + WorldDx, hwRound(Gear^.Y) + WorldDy, |
1060 |
hwRound(PHedgehog(Gear^.Hedgehog)^.Gear^.X) + WorldDx, hwRound(PHedgehog(Gear^.Hedgehog)^.Gear^.Y) + WorldDy); |
|
822 | 1061 |
DrawRotated(sprRopeHook, hwRound(Gear^.X) + WorldDx, hwRound(Gear^.Y) + WorldDy, 0, DxDy2Angle(Gear^.dY, Gear^.dX)); |
35 | 1062 |
end; |
4 | 1063 |
end; |
841
0700e3d3474d
Get rid if deprecated Surface parameter of Draw* calls
unc0rr
parents:
840
diff
changeset
|
1064 |
gtSmokeTrace: if Gear^.State < 8 then DrawSprite(sprSmokeTrace, hwRound(Gear^.X) + WorldDx, hwRound(Gear^.Y) + WorldDy, Gear^.State); |
1012 | 1065 |
gtExplosion: DrawSprite(sprExplosion50, hwRound(Gear^.X) - 32 + WorldDx, hwRound(Gear^.Y) - 32 + WorldDy, Gear^.State); |
351 | 1066 |
gtMine: if ((Gear^.State and gstAttacking) = 0)or((Gear^.Timer and $3FF) < 420) |
822 | 1067 |
then DrawRotated(sprMineOff, hwRound(Gear^.X) + WorldDx, hwRound(Gear^.Y) + WorldDy, 0, Gear^.DirAngle) |
1068 |
else DrawRotated(sprMineOn, hwRound(Gear^.X) + WorldDx, hwRound(Gear^.Y) + WorldDy, 0, Gear^.DirAngle); |
|
351 | 1069 |
gtCase: case Gear^.Pos of |
841
0700e3d3474d
Get rid if deprecated Surface parameter of Draw* calls
unc0rr
parents:
840
diff
changeset
|
1070 |
posCaseAmmo : DrawSprite(sprCase, hwRound(Gear^.X) - 16 + WorldDx, hwRound(Gear^.Y) - 16 + WorldDy, 0); |
1009 | 1071 |
posCaseHealth: begin |
1072 |
i:= (GameTicks shr 6) mod 64; |
|
1073 |
if i > 12 then i:= 0; |
|
1074 |
DrawSprite(sprFAid, hwRound(Gear^.X) - 24 + WorldDx, hwRound(Gear^.Y) - 24 + WorldDy, i); |
|
1075 |
end; |
|
42 | 1076 |
end; |
841
0700e3d3474d
Get rid if deprecated Surface parameter of Draw* calls
unc0rr
parents:
840
diff
changeset
|
1077 |
gtDynamite: DrawSprite2(sprDynamite, hwRound(Gear^.X) - 16 + WorldDx, hwRound(Gear^.Y) - 25 + WorldDy, Gear^.Tag and 1, Gear^.Tag shr 1); |
822 | 1078 |
gtClusterBomb: DrawRotated(sprClusterBomb, hwRound(Gear^.X) + WorldDx, hwRound(Gear^.Y) + WorldDy, 0, Gear^.DirAngle); |
841
0700e3d3474d
Get rid if deprecated Surface parameter of Draw* calls
unc0rr
parents:
840
diff
changeset
|
1079 |
gtCluster: DrawSprite(sprClusterParticle, hwRound(Gear^.X) - 8 + WorldDx, hwRound(Gear^.Y) - 8 + WorldDy, 0); |
0700e3d3474d
Get rid if deprecated Surface parameter of Draw* calls
unc0rr
parents:
840
diff
changeset
|
1080 |
gtFlame: DrawSprite(sprFlame, hwRound(Gear^.X) - 8 + WorldDx, hwRound(Gear^.Y) - 8 + WorldDy,(GameTicks div 128 + Gear^.Angle) mod 8); |
0700e3d3474d
Get rid if deprecated Surface parameter of Draw* calls
unc0rr
parents:
840
diff
changeset
|
1081 |
gtParachute: DrawSprite(sprParachute, hwRound(Gear^.X) - 24 + WorldDx, hwRound(Gear^.Y) - 48 + WorldDy, 0); |
0700e3d3474d
Get rid if deprecated Surface parameter of Draw* calls
unc0rr
parents:
840
diff
changeset
|
1082 |
gtAirAttack: if Gear^.Tag > 0 then DrawSprite(sprAirplane, hwRound(Gear^.X) - 60 + WorldDx, hwRound(Gear^.Y) - 25 + WorldDy, 0) |
0700e3d3474d
Get rid if deprecated Surface parameter of Draw* calls
unc0rr
parents:
840
diff
changeset
|
1083 |
else DrawSprite(sprAirplane, hwRound(Gear^.X) - 60 + WorldDx, hwRound(Gear^.Y) - 25 + WorldDy, 1); |
822 | 1084 |
gtAirBomb: DrawRotated(sprAirBomb, hwRound(Gear^.X) + WorldDx, hwRound(Gear^.Y) + WorldDy, 0, DxDy2Angle(Gear^.dY, Gear^.dX)); |
853 | 1085 |
gtTeleport: begin |
1086 |
HHGear:= PHedgehog(Gear^.Hedgehog)^.Gear; |
|
1087 |
DrawRotatedF(sprTeleport, hwRound(Gear^.X) + 1 + WorldDx, hwRound(Gear^.Y) - 3 + WorldDy, Gear^.Pos, hwSign(HHGear^.dX), 0); |
|
1088 |
DrawRotatedF(sprTeleport, hwRound(HHGear^.X) + 1 + WorldDx, hwRound(HHGear^.Y) - 3 + WorldDy, 11 - Gear^.Pos, hwSign(HHGear^.dX), 0); |
|
1089 |
end; |
|
841
0700e3d3474d
Get rid if deprecated Surface parameter of Draw* calls
unc0rr
parents:
840
diff
changeset
|
1090 |
gtSwitcher: DrawSprite(sprSwitch, hwRound(Gear^.X) - 16 + WorldDx, hwRound(Gear^.Y) - 56 + WorldDy, (GameTicks shr 6) mod 12); |
0700e3d3474d
Get rid if deprecated Surface parameter of Draw* calls
unc0rr
parents:
840
diff
changeset
|
1091 |
gtTarget: DrawSprite(sprTarget, hwRound(Gear^.X) - 16 + WorldDx, hwRound(Gear^.Y) - 16 + WorldDy, 0); |
959 | 1092 |
gtMortar: DrawRotated(sprMortar, hwRound(Gear^.X) + WorldDx, hwRound(Gear^.Y) + WorldDy, 0, DxDy2Angle(Gear^.dY, Gear^.dX)); |
1108 | 1093 |
gtCake: if Gear^.Pos = 6 then |
1094 |
DrawRotatedf(sprCakeWalk, hwRound(Gear^.X) + WorldDx, hwRound(Gear^.Y) + WorldDy, (GameTicks div 40) mod 6, hwSign(Gear^.dX), Gear^.DirAngle + hwSign(Gear^.dX) * 90) |
|
1095 |
else |
|
1262 | 1096 |
DrawRotatedf(sprCakeDown, hwRound(Gear^.X) + WorldDx, hwRound(Gear^.Y) + WorldDy, 5 - Gear^.Pos, hwSign(Gear^.dX), 0); |
1097 |
gtWatermelon: DrawRotatedf(sprWatermelon, hwRound(Gear^.X) + WorldDx, hwRound(Gear^.Y) + WorldDy, 0, 0, Gear^.DirAngle); |
|
1098 |
gtMelonPiece: DrawRotatedf(sprWatermelon, hwRound(Gear^.X) + WorldDx, hwRound(Gear^.Y) + WorldDy, 1, 0, Gear^.DirAngle); |
|
1263 | 1099 |
gtHellishBomb: DrawRotated(sprHellishBomb, hwRound(Gear^.X) + WorldDx, hwRound(Gear^.Y) + WorldDy, 0, Gear^.DirAngle); |
1100 |
gtEvilTrace: if Gear^.State < 8 then DrawSprite(sprEvilTrace, hwRound(Gear^.X) + WorldDx, hwRound(Gear^.Y) + WorldDy, Gear^.State); |
|
1101 |
end; |
|
351 | 1102 |
Gear:= Gear^.NextGear |
4 | 1103 |
end; |
1104 |
end; |
|
1105 |
||
1106 |
procedure FreeGearsList; |
|
1107 |
var t, tt: PGear; |
|
1108 |
begin |
|
1109 |
tt:= GearsList; |
|
1110 |
GearsList:= nil; |
|
1111 |
while tt<>nil do |
|
1112 |
begin |
|
1113 |
t:= tt; |
|
351 | 1114 |
tt:= tt^.NextGear; |
4 | 1115 |
Dispose(t) |
1116 |
end; |
|
1117 |
end; |
|
1118 |
||
10 | 1119 |
procedure AddMiscGears; |
371 | 1120 |
var i: LongInt; |
4 | 1121 |
begin |
498 | 1122 |
AddGear(0, 0, gtATStartGame, 0, _0, _0, 2000); |
22 | 1123 |
if (GameFlags and gfForts) = 0 then |
622 | 1124 |
for i:= 0 to Pred(cLandAdditions) do |
498 | 1125 |
FindPlace(AddGear(0, 0, gtMine, 0, _0, _0, 0), false, 0, 2048); |
4 | 1126 |
end; |
1127 |
||
371 | 1128 |
procedure doMakeExplosion(X, Y, Radius: LongInt; Mask: LongWord); |
4 | 1129 |
var Gear: PGear; |
506 | 1130 |
dmg, dmgRadius: LongInt; |
4 | 1131 |
begin |
1132 |
TargetPoint.X:= NoPointX; |
|
1133 |
{$IFDEF DEBUGFILE}if Radius > 3 then AddFileLog('Explosion: at (' + inttostr(x) + ',' + inttostr(y) + ')');{$ENDIF} |
|
1049 | 1134 |
if (Radius > 10) then AddGear(X, Y, gtExplosion, 0, _0, _0, 0); |
355 | 1135 |
if (Mask and EXPLAutoSound) <> 0 then PlaySound(sndExplosion, false); |
506 | 1136 |
if (Mask and EXPLAllDamageInRadius)=0 then dmgRadius:= Radius shl 1 |
1137 |
else dmgRadius:= Radius; |
|
4 | 1138 |
Gear:= GearsList; |
1139 |
while Gear <> nil do |
|
1200 | 1140 |
begin |
1141 |
dmg:= dmgRadius + cHHRadius div 2 - hwRound(Distance(Gear^.X - int2hwFloat(X), Gear^.Y - int2hwFloat(Y))); |
|
1142 |
if (dmg > 1) and |
|
1143 |
((Gear^.State and gstNoDamage) = 0) then |
|
1144 |
begin |
|
1145 |
dmg:= min(dmg div 2, Radius); |
|
1146 |
case Gear^.Kind of |
|
1147 |
gtHedgehog, |
|
1148 |
gtMine, |
|
1149 |
gtCase, |
|
1150 |
gtTarget, |
|
1151 |
gtFlame: begin |
|
1152 |
{$IFDEF DEBUGFILE}AddFileLog('Damage: ' + inttostr(dmg));{$ENDIF} |
|
1153 |
if (Mask and EXPLNoDamage) = 0 then |
|
1154 |
begin |
|
1155 |
inc(Gear^.Damage, dmg); |
|
1156 |
if Gear^.Kind = gtHedgehog then |
|
1157 |
AddDamageTag(hwRound(Gear^.X), hwRound(Gear^.Y), dmg, Gear) |
|
1158 |
end; |
|
1159 |
if ((Mask and EXPLDoNotTouchHH) = 0) or (Gear^.Kind <> gtHedgehog) then |
|
1160 |
begin |
|
1161 |
DeleteCI(Gear); |
|
1162 |
Gear^.dX:= Gear^.dX + SignAs(_0_005 * dmg + cHHKick, Gear^.X - int2hwFloat(X)); |
|
1163 |
Gear^.dY:= Gear^.dY + SignAs(_0_005 * dmg + cHHKick, Gear^.Y - int2hwFloat(Y)); |
|
1164 |
Gear^.State:= (Gear^.State or gstMoving) and (not gstWinner); |
|
1165 |
Gear^.Active:= true; |
|
1166 |
FollowGear:= Gear |
|
1167 |
end; |
|
1168 |
end; |
|
1169 |
gtGrave: begin |
|
1170 |
Gear^.dY:= - _0_004 * dmg; |
|
1171 |
Gear^.Active:= true; |
|
1172 |
end; |
|
1173 |
end; |
|
1174 |
end; |
|
1175 |
Gear:= Gear^.NextGear |
|
1176 |
end; |
|
1177 |
||
621 | 1178 |
if (Mask and EXPLDontDraw) = 0 then |
1200 | 1179 |
if (GameFlags and gfSolidLand) = 0 then DrawExplosion(X, Y, Radius); |
1180 |
||
498 | 1181 |
uAIMisc.AwareOfExplosion(0, 0, 0) |
4 | 1182 |
end; |
1183 |
||
506 | 1184 |
procedure ShotgunShot(Gear: PGear); |
1185 |
var t: PGear; |
|
955 | 1186 |
dmg: LongInt; |
506 | 1187 |
begin |
509 | 1188 |
Gear^.Radius:= cShotgunRadius; |
506 | 1189 |
t:= GearsList; |
1190 |
while t <> nil do |
|
1191 |
begin |
|
1192 |
dmg:= min(Gear^.Radius + t^.Radius - hwRound(Distance(Gear^.X - t^.X, Gear^.Y - t^.Y)), 25); |
|
538 | 1193 |
if dmg > 0 then |
506 | 1194 |
case t^.Kind of |
1195 |
gtHedgehog, |
|
1196 |
gtMine, |
|
593 | 1197 |
gtCase, |
1198 |
gtTarget: begin |
|
506 | 1199 |
inc(t^.Damage, dmg); |
867 | 1200 |
|
522 | 1201 |
if t^.Kind = gtHedgehog then |
531 | 1202 |
AddDamageTag(hwRound(Gear^.X), hwRound(Gear^.Y), dmg, t); |
867 | 1203 |
|
506 | 1204 |
DeleteCI(t); |
856 | 1205 |
t^.dX:= t^.dX + Gear^.dX * dmg * _0_01 + SignAs(cHHKick, Gear^.dX); |
506 | 1206 |
t^.dY:= t^.dY + Gear^.dY * dmg * _0_01; |
1207 |
t^.State:= t^.State or gstMoving; |
|
1208 |
t^.Active:= true; |
|
1209 |
FollowGear:= t |
|
1210 |
end; |
|
1211 |
gtGrave: begin |
|
1212 |
t^.dY:= - _0_1; |
|
1213 |
t^.Active:= true |
|
1214 |
end; |
|
1215 |
end; |
|
1216 |
t:= t^.NextGear |
|
1217 |
end; |
|
621 | 1218 |
if (GameFlags and gfSolidLand) = 0 then DrawExplosion(hwRound(Gear^.X), hwRound(Gear^.Y), cShotgunRadius) |
506 | 1219 |
end; |
1220 |
||
371 | 1221 |
procedure AmmoShove(Ammo: PGear; Damage, Power: LongInt); |
53 | 1222 |
var t: PGearArray; |
371 | 1223 |
i: LongInt; |
38 | 1224 |
begin |
53 | 1225 |
t:= CheckGearsCollision(Ammo); |
351 | 1226 |
i:= t^.Count; |
53 | 1227 |
while i > 0 do |
981 | 1228 |
begin |
1229 |
dec(i); |
|
1230 |
if (t^.ar[i]^.State and gstNoDamage) = 0 then |
|
1231 |
case t^.ar[i]^.Kind of |
|
1232 |
gtHedgehog, |
|
1233 |
gtMine, |
|
1234 |
gtTarget, |
|
1235 |
gtCase: begin |
|
1236 |
inc(t^.ar[i]^.Damage, Damage); |
|
1237 |
||
1238 |
if t^.ar[i]^.Kind = gtHedgehog then |
|
1239 |
AddDamageTag(hwRound(t^.ar[i]^.X), hwRound(t^.ar[i]^.Y), Damage, t^.ar[i]); |
|
867 | 1240 |
|
981 | 1241 |
DeleteCI(t^.ar[i]); |
1242 |
t^.ar[i]^.dX:= Ammo^.dX * Power * _0_01; |
|
1243 |
t^.ar[i]^.dY:= Ammo^.dY * Power * _0_01; |
|
1244 |
t^.ar[i]^.Active:= true; |
|
1245 |
t^.ar[i]^.State:= t^.ar[i]^.State or gstMoving; |
|
867 | 1246 |
|
982 | 1247 |
if TestCollisionXwithGear(t^.ar[i], hwSign(t^.ar[i]^.dX)) then |
981 | 1248 |
begin |
1249 |
if not (TestCollisionXwithXYShift(t^.ar[i], _0, -3, hwSign(t^.ar[i]^.dX)) |
|
1250 |
or TestCollisionYwithGear(t^.ar[i], -1)) then t^.ar[i]^.Y:= t^.ar[i]^.Y - _1; |
|
1251 |
if not (TestCollisionXwithXYShift(t^.ar[i], _0, -2, hwSign(t^.ar[i]^.dX)) |
|
1252 |
or TestCollisionYwithGear(t^.ar[i], -1)) then t^.ar[i]^.Y:= t^.ar[i]^.Y - _1; |
|
1253 |
if not (TestCollisionXwithXYShift(t^.ar[i], _0, -1, hwSign(t^.ar[i]^.dX)) |
|
1254 |
or TestCollisionYwithGear(t^.ar[i], -1)) then t^.ar[i]^.Y:= t^.ar[i]^.Y - _1; |
|
1255 |
end; |
|
982 | 1256 |
|
981 | 1257 |
FollowGear:= t^.ar[i] |
1258 |
end; |
|
1259 |
end |
|
1260 |
end; |
|
126 | 1261 |
SetAllToActive |
38 | 1262 |
end; |
1263 |
||
4 | 1264 |
procedure AssignHHCoords; |
955 | 1265 |
var i, t, p, j: LongInt; |
543
465e2ec8f05f
- Better randomness of placing hedgehogs on the land
unc0rr
parents:
542
diff
changeset
|
1266 |
ar: array[0..Pred(cMaxHHs)] of PGear; |
465e2ec8f05f
- Better randomness of placing hedgehogs on the land
unc0rr
parents:
542
diff
changeset
|
1267 |
Count: Longword; |
4 | 1268 |
begin |
543
465e2ec8f05f
- Better randomness of placing hedgehogs on the land
unc0rr
parents:
542
diff
changeset
|
1269 |
if (GameFlags and gfForts) <> 0 then |
955 | 1270 |
begin |
1271 |
t:= 0; |
|
1272 |
for p:= 0 to 1 do |
|
1273 |
begin |
|
1274 |
with ClansArray[p]^ do |
|
1275 |
for j:= 0 to Pred(TeamsNumber) do |
|
1276 |
with Teams[j]^ do |
|
1277 |
for i:= 0 to cMaxHHIndex do |
|
1278 |
with Hedgehogs[i] do |
|
958 | 1279 |
if (Gear <> nil) and (Gear^.X.QWordValue = 0) then |
1280 |
begin |
|
1281 |
FindPlace(Gear, false, t, t + 1024); |
|
999
8dcf263c9e8f
In forts mode, hedgehogs on the left look at the right, and vice-versa
unc0rr
parents:
997
diff
changeset
|
1282 |
Gear^.Pos:= GetRandom(19); |
8dcf263c9e8f
In forts mode, hedgehogs on the left look at the right, and vice-versa
unc0rr
parents:
997
diff
changeset
|
1283 |
Gear^.dX.isNegative:= p = 1; |
958 | 1284 |
end; |
955 | 1285 |
inc(t, 1024) |
1286 |
end |
|
1287 |
end else // mix hedgehogs |
|
1288 |
begin |
|
1289 |
Count:= 0; |
|
1290 |
for p:= 0 to Pred(TeamsCount) do |
|
1291 |
with TeamsArray[p]^ do |
|
1292 |
begin |
|
1293 |
for i:= 0 to cMaxHHIndex do |
|
1294 |
with Hedgehogs[i] do |
|
1295 |
if (Gear <> nil) and (Gear^.X.QWordValue = 0) then |
|
1296 |
begin |
|
1297 |
ar[Count]:= Gear; |
|
1298 |
inc(Count) |
|
1299 |
end; |
|
1300 |
end; |
|
543
465e2ec8f05f
- Better randomness of placing hedgehogs on the land
unc0rr
parents:
542
diff
changeset
|
1301 |
|
955 | 1302 |
while (Count > 0) do |
1303 |
begin |
|
1304 |
i:= GetRandom(Count); |
|
1305 |
FindPlace(ar[i], false, 0, 2048); |
|
1000
e7b204880318
Hedgehogs on the left side of the map look to the right and vice-versa
unc0rr
parents:
999
diff
changeset
|
1306 |
ar[i]^.dX.isNegative:= ar[i]^.X > _1024; |
959 | 1307 |
ar[i]^.Pos:= GetRandom(19); |
955 | 1308 |
ar[i]:= ar[Count - 1]; |
1309 |
dec(Count) |
|
1310 |
end |
|
1311 |
end |
|
4 | 1312 |
end; |
1313 |
||
371 | 1314 |
function CheckGearNear(Gear: PGear; Kind: TGearType; rX, rY: LongInt): PGear; |
10 | 1315 |
var t: PGear; |
1316 |
begin |
|
1317 |
t:= GearsList; |
|
1318 |
rX:= sqr(rX); |
|
1319 |
rY:= sqr(rY); |
|
1320 |
while t <> nil do |
|
1321 |
begin |
|
351 | 1322 |
if (t <> Gear) and (t^.Kind = Kind) then |
498 | 1323 |
if not((hwSqr(Gear^.X - t^.X) / rX + hwSqr(Gear^.Y - t^.Y) / rY) > _1) then |
351 | 1324 |
exit(t); |
1325 |
t:= t^.NextGear |
|
10 | 1326 |
end; |
351 | 1327 |
CheckGearNear:= nil |
15 | 1328 |
end; |
1329 |
||
79 | 1330 |
procedure AmmoFlameWork(Ammo: PGear); |
1331 |
var t: PGear; |
|
1332 |
begin |
|
1333 |
t:= GearsList; |
|
1334 |
while t <> nil do |
|
1335 |
begin |
|
351 | 1336 |
if (t^.Kind = gtHedgehog) and (t^.Y < Ammo^.Y) then |
498 | 1337 |
if not (hwSqr(Ammo^.X - t^.X) + hwSqr(Ammo^.Y - t^.Y - int2hwFloat(cHHRadius)) * 2 > _2) then |
79 | 1338 |
begin |
351 | 1339 |
inc(t^.Damage, 5); |
1340 |
t^.dX:= t^.dX + (t^.X - Ammo^.X) * _0_02; |
|
1341 |
t^.dY:= - _0_25; |
|
1342 |
t^.Active:= true; |
|
79 | 1343 |
DeleteCI(t); |
1344 |
FollowGear:= t |
|
1345 |
end; |
|
351 | 1346 |
t:= t^.NextGear |
79 | 1347 |
end; |
1348 |
end; |
|
1349 |
||
371 | 1350 |
function CheckGearsNear(mX, mY: LongInt; Kind: TGearsType; rX, rY: LongInt): PGear; |
16 | 1351 |
var t: PGear; |
1352 |
begin |
|
1353 |
t:= GearsList; |
|
1354 |
rX:= sqr(rX); |
|
1355 |
rY:= sqr(rY); |
|
1356 |
while t <> nil do |
|
1357 |
begin |
|
351 | 1358 |
if t^.Kind in Kind then |
498 | 1359 |
if not (hwSqr(int2hwFloat(mX) - t^.X) / rX + hwSqr(int2hwFloat(mY) - t^.Y) / rY > _1) then |
351 | 1360 |
exit(t); |
1361 |
t:= t^.NextGear |
|
16 | 1362 |
end; |
351 | 1363 |
CheckGearsNear:= nil |
16 | 1364 |
end; |
1365 |
||
1366 |
function CountGears(Kind: TGearType): Longword; |
|
1367 |
var t: PGear; |
|
351 | 1368 |
Result: Longword; |
16 | 1369 |
begin |
1370 |
Result:= 0; |
|
1371 |
t:= GearsList; |
|
1372 |
while t <> nil do |
|
1373 |
begin |
|
351 | 1374 |
if t^.Kind = Kind then inc(Result); |
1375 |
t:= t^.NextGear |
|
16 | 1376 |
end; |
351 | 1377 |
CountGears:= Result |
16 | 1378 |
end; |
1379 |
||
15 | 1380 |
procedure SpawnBoxOfSmth; |
394
4c017ae1226a
- Implement hack to let ammo stores work without needed assistance of frontend
unc0rr
parents:
393
diff
changeset
|
1381 |
var t: LongInt; |
4c017ae1226a
- Implement hack to let ammo stores work without needed assistance of frontend
unc0rr
parents:
393
diff
changeset
|
1382 |
i: TAmmoType; |
15 | 1383 |
begin |
614 | 1384 |
if (cCaseFactor = 0) or |
1385 |
(CountGears(gtCase) >= 5) or |
|
1386 |
(getrandom(cCaseFactor) <> 0) then exit; |
|
498 | 1387 |
FollowGear:= AddGear(0, 0, gtCase, 0, _0, _0, 0); |
295 | 1388 |
case getrandom(2) of |
1389 |
0: begin |
|
351 | 1390 |
FollowGear^.Health:= 25; |
1391 |
FollowGear^.Pos:= posCaseHealth |
|
295 | 1392 |
end; |
1393 |
1: begin |
|
394
4c017ae1226a
- Implement hack to let ammo stores work without needed assistance of frontend
unc0rr
parents:
393
diff
changeset
|
1394 |
t:= 0; |
4c017ae1226a
- Implement hack to let ammo stores work without needed assistance of frontend
unc0rr
parents:
393
diff
changeset
|
1395 |
for i:= Low(TAmmoType) to High(TAmmoType) do |
4c017ae1226a
- Implement hack to let ammo stores work without needed assistance of frontend
unc0rr
parents:
393
diff
changeset
|
1396 |
inc(t, Ammoz[i].Probability); |
4c017ae1226a
- Implement hack to let ammo stores work without needed assistance of frontend
unc0rr
parents:
393
diff
changeset
|
1397 |
t:= GetRandom(t); |
4c017ae1226a
- Implement hack to let ammo stores work without needed assistance of frontend
unc0rr
parents:
393
diff
changeset
|
1398 |
i:= Low(TAmmoType); |
4c017ae1226a
- Implement hack to let ammo stores work without needed assistance of frontend
unc0rr
parents:
393
diff
changeset
|
1399 |
dec(t, Ammoz[i].Probability); |
4c017ae1226a
- Implement hack to let ammo stores work without needed assistance of frontend
unc0rr
parents:
393
diff
changeset
|
1400 |
while t >= 0 do |
4c017ae1226a
- Implement hack to let ammo stores work without needed assistance of frontend
unc0rr
parents:
393
diff
changeset
|
1401 |
begin |
4c017ae1226a
- Implement hack to let ammo stores work without needed assistance of frontend
unc0rr
parents:
393
diff
changeset
|
1402 |
inc(i); |
4c017ae1226a
- Implement hack to let ammo stores work without needed assistance of frontend
unc0rr
parents:
393
diff
changeset
|
1403 |
dec(t, Ammoz[i].Probability) |
4c017ae1226a
- Implement hack to let ammo stores work without needed assistance of frontend
unc0rr
parents:
393
diff
changeset
|
1404 |
end; |
865 | 1405 |
PlaySound(sndReinforce, false); |
351 | 1406 |
FollowGear^.Pos:= posCaseAmmo; |
394
4c017ae1226a
- Implement hack to let ammo stores work without needed assistance of frontend
unc0rr
parents:
393
diff
changeset
|
1407 |
FollowGear^.State:= Longword(i) |
295 | 1408 |
end; |
1409 |
end; |
|
70 | 1410 |
FindPlace(FollowGear, true, 0, 2048) |
1411 |
end; |
|
1412 |
||
371 | 1413 |
procedure FindPlace(Gear: PGear; withFall: boolean; Left, Right: LongInt); |
70 | 1414 |
|
371 | 1415 |
function CountNonZeroz(x, y, r: LongInt): LongInt; |
1416 |
var i: LongInt; |
|
1417 |
Result: LongInt; |
|
70 | 1418 |
begin |
1419 |
Result:= 0; |
|
701 | 1420 |
if (y and $FFFFFC00) = 0 then |
1421 |
for i:= max(x - r, 0) to min(x + r, 2043) do |
|
351 | 1422 |
if Land[y, i] <> 0 then inc(Result); |
1423 |
CountNonZeroz:= Result |
|
70 | 1424 |
end; |
1425 |
||
495 | 1426 |
var x: LongInt; |
371 | 1427 |
y, sy: LongInt; |
386 | 1428 |
ar: array[0..511] of TPoint; |
1429 |
ar2: array[0..1023] of TPoint; |
|
392 | 1430 |
cnt, cnt2: Longword; |
1431 |
delta: LongInt; |
|
70 | 1432 |
begin |
386 | 1433 |
delta:= 250; |
1434 |
cnt2:= 0; |
|
16 | 1435 |
repeat |
392 | 1436 |
x:= Left + LongInt(GetRandom(Delta)); |
70 | 1437 |
repeat |
386 | 1438 |
inc(x, Delta); |
70 | 1439 |
cnt:= 0; |
351 | 1440 |
y:= -Gear^.Radius * 2; |
70 | 1441 |
while y < 1023 do |
16 | 1442 |
begin |
70 | 1443 |
repeat |
701 | 1444 |
inc(y, 2); |
351 | 1445 |
until (y > 1023) or (CountNonZeroz(x, y, Gear^.Radius - 1) = 0); |
70 | 1446 |
sy:= y; |
1447 |
repeat |
|
1448 |
inc(y); |
|
351 | 1449 |
until (y > 1023) or (CountNonZeroz(x, y, Gear^.Radius - 1) <> 0); |
1450 |
if (y - sy > Gear^.Radius * 2) |
|
70 | 1451 |
and (y < 1023) |
351 | 1452 |
and (CheckGearsNear(x, y - Gear^.Radius, [gtHedgehog, gtMine, gtCase], 110, 110) = nil) then |
70 | 1453 |
begin |
1454 |
ar[cnt].X:= x; |
|
351 | 1455 |
if withFall then ar[cnt].Y:= sy + Gear^.Radius |
1456 |
else ar[cnt].Y:= y - Gear^.Radius; |
|
70 | 1457 |
inc(cnt) |
1458 |
end; |
|
386 | 1459 |
inc(y, 45) |
16 | 1460 |
end; |
70 | 1461 |
if cnt > 0 then |
1462 |
with ar[GetRandom(cnt)] do |
|
1463 |
begin |
|
386 | 1464 |
ar2[cnt2].x:= x; |
1465 |
ar2[cnt2].y:= y; |
|
1466 |
inc(cnt2) |
|
70 | 1467 |
end |
386 | 1468 |
until (x + Delta > Right); |
1469 |
dec(Delta, 60) |
|
1470 |
until (cnt2 > 0) or (Delta < 70); |
|
1471 |
if cnt2 > 0 then |
|
1472 |
with ar2[GetRandom(cnt2)] do |
|
1473 |
begin |
|
498 | 1474 |
Gear^.X:= int2hwFloat(x); |
1475 |
Gear^.Y:= int2hwFloat(y); |
|
386 | 1476 |
{$IFDEF DEBUGFILE} |
1477 |
AddFileLog('Assigned Gear coordinates (' + inttostr(x) + ',' + inttostr(y) + ')'); |
|
1478 |
{$ENDIF} |
|
1479 |
end |
|
1480 |
else |
|
1481 |
begin |
|
1482 |
OutError('Can''t find place for Gear', false); |
|
1483 |
DeleteGear(Gear) |
|
1484 |
end |
|
10 | 1485 |
end; |
1486 |
||
4 | 1487 |
initialization |
1488 |
||
1489 |
finalization |
|
95 | 1490 |
FreeGearsList; |
4 | 1491 |
|
1492 |
end. |