author | nemo |
Thu, 04 Dec 2014 11:11:17 -0500 | |
changeset 10623 | 81f1cf934827 |
parent 10526 | b43d175d1577 |
child 10624 | 05bb44f4d92f |
permissions | -rw-r--r-- |
3441 | 1 |
(* |
2 |
* Hedgewars, a free turn based strategy game |
|
9998 | 3 |
* Copyright (c) 2004-2014 Andrey Korotaev <unC0Rr@gmail.com> |
3441 | 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 |
|
10108
c68cf030eded
update FSF address. note: two sdl include files (by Sam Lantinga) still have the old FSF address in their copyright - but I ain't gonna touch their copyright headers
sheepluva
parents:
10015
diff
changeset
|
16 |
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA |
3441 | 17 |
*) |
5121
2d34ec60992c
added some comments in order to confuse the GSoC students as much as possible ;D
sheepluva
parents:
4976
diff
changeset
|
18 |
|
2d34ec60992c
added some comments in order to confuse the GSoC students as much as possible ;D
sheepluva
parents:
4976
diff
changeset
|
19 |
(* |
2d34ec60992c
added some comments in order to confuse the GSoC students as much as possible ;D
sheepluva
parents:
4976
diff
changeset
|
20 |
* This file contains the step handlers for visual gears. |
2d34ec60992c
added some comments in order to confuse the GSoC students as much as possible ;D
sheepluva
parents:
4976
diff
changeset
|
21 |
* |
2d34ec60992c
added some comments in order to confuse the GSoC students as much as possible ;D
sheepluva
parents:
4976
diff
changeset
|
22 |
* Since the effects of visual gears do not affect the course of the game, |
2d34ec60992c
added some comments in order to confuse the GSoC students as much as possible ;D
sheepluva
parents:
4976
diff
changeset
|
23 |
* no "synchronization" between players is required. |
2d34ec60992c
added some comments in order to confuse the GSoC students as much as possible ;D
sheepluva
parents:
4976
diff
changeset
|
24 |
* => The usage of safe functions or data types (e.g. GetRandom() or hwFloat) |
2d34ec60992c
added some comments in order to confuse the GSoC students as much as possible ;D
sheepluva
parents:
4976
diff
changeset
|
25 |
* is usually not necessary and therefore undesirable. |
2d34ec60992c
added some comments in order to confuse the GSoC students as much as possible ;D
sheepluva
parents:
4976
diff
changeset
|
26 |
*) |
10015 | 27 |
|
28 |
{$INCLUDE "options.inc"} |
|
29 |
||
9283
76e68c136a11
Refactoring: VGSHandlers.inc -> uVisualGearsHandlers.pas
unc0rr
parents:
9080
diff
changeset
|
30 |
unit uVisualGearsHandlers; |
76e68c136a11
Refactoring: VGSHandlers.inc -> uVisualGearsHandlers.pas
unc0rr
parents:
9080
diff
changeset
|
31 |
|
76e68c136a11
Refactoring: VGSHandlers.inc -> uVisualGearsHandlers.pas
unc0rr
parents:
9080
diff
changeset
|
32 |
interface |
10193
d7cd5b43588f
By request. Allow lua to make random things "talk". I'm not sure if this is a good idea, buuuut.
nemo
parents:
10124
diff
changeset
|
33 |
uses uTypes, uGears; |
9283
76e68c136a11
Refactoring: VGSHandlers.inc -> uVisualGearsHandlers.pas
unc0rr
parents:
9080
diff
changeset
|
34 |
|
9960 | 35 |
var doStepVGHandlers: array[TVisualGearType] of TVGearStepProcedure; |
9283
76e68c136a11
Refactoring: VGSHandlers.inc -> uVisualGearsHandlers.pas
unc0rr
parents:
9080
diff
changeset
|
36 |
|
76e68c136a11
Refactoring: VGSHandlers.inc -> uVisualGearsHandlers.pas
unc0rr
parents:
9080
diff
changeset
|
37 |
procedure doStepFlake(Gear: PVisualGear; Steps: Longword); |
76e68c136a11
Refactoring: VGSHandlers.inc -> uVisualGearsHandlers.pas
unc0rr
parents:
9080
diff
changeset
|
38 |
procedure doStepBeeTrace(Gear: PVisualGear; Steps: Longword); |
76e68c136a11
Refactoring: VGSHandlers.inc -> uVisualGearsHandlers.pas
unc0rr
parents:
9080
diff
changeset
|
39 |
procedure doStepCloud(Gear: PVisualGear; Steps: Longword); |
76e68c136a11
Refactoring: VGSHandlers.inc -> uVisualGearsHandlers.pas
unc0rr
parents:
9080
diff
changeset
|
40 |
procedure doStepExpl(Gear: PVisualGear; Steps: Longword); |
76e68c136a11
Refactoring: VGSHandlers.inc -> uVisualGearsHandlers.pas
unc0rr
parents:
9080
diff
changeset
|
41 |
procedure doStepNote(Gear: PVisualGear; Steps: Longword); |
76e68c136a11
Refactoring: VGSHandlers.inc -> uVisualGearsHandlers.pas
unc0rr
parents:
9080
diff
changeset
|
42 |
procedure doStepLineTrail(Gear: PVisualGear; Steps: Longword); |
76e68c136a11
Refactoring: VGSHandlers.inc -> uVisualGearsHandlers.pas
unc0rr
parents:
9080
diff
changeset
|
43 |
procedure doStepEgg(Gear: PVisualGear; Steps: Longword); |
76e68c136a11
Refactoring: VGSHandlers.inc -> uVisualGearsHandlers.pas
unc0rr
parents:
9080
diff
changeset
|
44 |
procedure doStepFire(Gear: PVisualGear; Steps: Longword); |
76e68c136a11
Refactoring: VGSHandlers.inc -> uVisualGearsHandlers.pas
unc0rr
parents:
9080
diff
changeset
|
45 |
procedure doStepShell(Gear: PVisualGear; Steps: Longword); |
76e68c136a11
Refactoring: VGSHandlers.inc -> uVisualGearsHandlers.pas
unc0rr
parents:
9080
diff
changeset
|
46 |
procedure doStepSmallDamage(Gear: PVisualGear; Steps: Longword); |
76e68c136a11
Refactoring: VGSHandlers.inc -> uVisualGearsHandlers.pas
unc0rr
parents:
9080
diff
changeset
|
47 |
procedure doStepBubble(Gear: PVisualGear; Steps: Longword); |
76e68c136a11
Refactoring: VGSHandlers.inc -> uVisualGearsHandlers.pas
unc0rr
parents:
9080
diff
changeset
|
48 |
procedure doStepSteam(Gear: PVisualGear; Steps: Longword); |
76e68c136a11
Refactoring: VGSHandlers.inc -> uVisualGearsHandlers.pas
unc0rr
parents:
9080
diff
changeset
|
49 |
procedure doStepAmmo(Gear: PVisualGear; Steps: Longword); |
76e68c136a11
Refactoring: VGSHandlers.inc -> uVisualGearsHandlers.pas
unc0rr
parents:
9080
diff
changeset
|
50 |
procedure doStepSmoke(Gear: PVisualGear; Steps: Longword); |
76e68c136a11
Refactoring: VGSHandlers.inc -> uVisualGearsHandlers.pas
unc0rr
parents:
9080
diff
changeset
|
51 |
procedure doStepDust(Gear: PVisualGear; Steps: Longword); |
76e68c136a11
Refactoring: VGSHandlers.inc -> uVisualGearsHandlers.pas
unc0rr
parents:
9080
diff
changeset
|
52 |
procedure doStepSplash(Gear: PVisualGear; Steps: Longword); |
76e68c136a11
Refactoring: VGSHandlers.inc -> uVisualGearsHandlers.pas
unc0rr
parents:
9080
diff
changeset
|
53 |
procedure doStepDroplet(Gear: PVisualGear; Steps: Longword); |
76e68c136a11
Refactoring: VGSHandlers.inc -> uVisualGearsHandlers.pas
unc0rr
parents:
9080
diff
changeset
|
54 |
procedure doStepSmokeRing(Gear: PVisualGear; Steps: Longword); |
76e68c136a11
Refactoring: VGSHandlers.inc -> uVisualGearsHandlers.pas
unc0rr
parents:
9080
diff
changeset
|
55 |
procedure doStepFeather(Gear: PVisualGear; Steps: Longword); |
76e68c136a11
Refactoring: VGSHandlers.inc -> uVisualGearsHandlers.pas
unc0rr
parents:
9080
diff
changeset
|
56 |
procedure doStepTeamHealthSorterWork(Gear: PVisualGear; Steps: Longword); |
76e68c136a11
Refactoring: VGSHandlers.inc -> uVisualGearsHandlers.pas
unc0rr
parents:
9080
diff
changeset
|
57 |
procedure doStepTeamHealthSorter(Gear: PVisualGear; Steps: Longword); |
76e68c136a11
Refactoring: VGSHandlers.inc -> uVisualGearsHandlers.pas
unc0rr
parents:
9080
diff
changeset
|
58 |
procedure doStepSpeechBubbleWork(Gear: PVisualGear; Steps: Longword); |
76e68c136a11
Refactoring: VGSHandlers.inc -> uVisualGearsHandlers.pas
unc0rr
parents:
9080
diff
changeset
|
59 |
procedure doStepSpeechBubble(Gear: PVisualGear; Steps: Longword); |
76e68c136a11
Refactoring: VGSHandlers.inc -> uVisualGearsHandlers.pas
unc0rr
parents:
9080
diff
changeset
|
60 |
procedure doStepHealthTagWork(Gear: PVisualGear; Steps: Longword); |
76e68c136a11
Refactoring: VGSHandlers.inc -> uVisualGearsHandlers.pas
unc0rr
parents:
9080
diff
changeset
|
61 |
procedure doStepHealthTagWorkUnderWater(Gear: PVisualGear; Steps: Longword); |
76e68c136a11
Refactoring: VGSHandlers.inc -> uVisualGearsHandlers.pas
unc0rr
parents:
9080
diff
changeset
|
62 |
procedure doStepHealthTag(Gear: PVisualGear; Steps: Longword); |
76e68c136a11
Refactoring: VGSHandlers.inc -> uVisualGearsHandlers.pas
unc0rr
parents:
9080
diff
changeset
|
63 |
procedure doStepSmokeTrace(Gear: PVisualGear; Steps: Longword); |
76e68c136a11
Refactoring: VGSHandlers.inc -> uVisualGearsHandlers.pas
unc0rr
parents:
9080
diff
changeset
|
64 |
procedure doStepExplosionWork(Gear: PVisualGear; Steps: Longword); |
76e68c136a11
Refactoring: VGSHandlers.inc -> uVisualGearsHandlers.pas
unc0rr
parents:
9080
diff
changeset
|
65 |
procedure doStepExplosion(Gear: PVisualGear; Steps: Longword); |
76e68c136a11
Refactoring: VGSHandlers.inc -> uVisualGearsHandlers.pas
unc0rr
parents:
9080
diff
changeset
|
66 |
procedure doStepBigExplosionWork(Gear: PVisualGear; Steps: Longword); |
76e68c136a11
Refactoring: VGSHandlers.inc -> uVisualGearsHandlers.pas
unc0rr
parents:
9080
diff
changeset
|
67 |
procedure doStepBigExplosion(Gear: PVisualGear; Steps: Longword); |
76e68c136a11
Refactoring: VGSHandlers.inc -> uVisualGearsHandlers.pas
unc0rr
parents:
9080
diff
changeset
|
68 |
procedure doStepChunk(Gear: PVisualGear; Steps: Longword); |
76e68c136a11
Refactoring: VGSHandlers.inc -> uVisualGearsHandlers.pas
unc0rr
parents:
9080
diff
changeset
|
69 |
procedure doStepBulletHit(Gear: PVisualGear; Steps: Longword); |
76e68c136a11
Refactoring: VGSHandlers.inc -> uVisualGearsHandlers.pas
unc0rr
parents:
9080
diff
changeset
|
70 |
procedure doStepCircle(Gear: PVisualGear; Steps: Longword); |
76e68c136a11
Refactoring: VGSHandlers.inc -> uVisualGearsHandlers.pas
unc0rr
parents:
9080
diff
changeset
|
71 |
procedure doStepSmoothWindBar(Gear: PVisualGear; Steps: Longword); |
76e68c136a11
Refactoring: VGSHandlers.inc -> uVisualGearsHandlers.pas
unc0rr
parents:
9080
diff
changeset
|
72 |
procedure doStepStraightShot(Gear: PVisualGear; Steps: Longword); |
76e68c136a11
Refactoring: VGSHandlers.inc -> uVisualGearsHandlers.pas
unc0rr
parents:
9080
diff
changeset
|
73 |
|
9720
453a1c29b7e4
Animate hedgehogs healths inside team health bar. Proper animation for the case when max team health grows is lost though.
unc0rr
parents:
9656
diff
changeset
|
74 |
function isSorterActive: boolean; inline; |
9283
76e68c136a11
Refactoring: VGSHandlers.inc -> uVisualGearsHandlers.pas
unc0rr
parents:
9080
diff
changeset
|
75 |
procedure initModule; |
76e68c136a11
Refactoring: VGSHandlers.inc -> uVisualGearsHandlers.pas
unc0rr
parents:
9080
diff
changeset
|
76 |
|
76e68c136a11
Refactoring: VGSHandlers.inc -> uVisualGearsHandlers.pas
unc0rr
parents:
9080
diff
changeset
|
77 |
implementation |
10354 | 78 |
uses uCollisions, uVariables, Math, uConsts, uVisualGearsList, uFloat, uSound, uRenderUtils, uWorld; |
5121
2d34ec60992c
added some comments in order to confuse the GSoC students as much as possible ;D
sheepluva
parents:
4976
diff
changeset
|
79 |
|
3441 | 80 |
procedure doStepFlake(Gear: PVisualGear; Steps: Longword); |
4379
6cd6b77df8b8
No need for Extended data type just to draw some visual gears. It's a shame we have Math unit dependency
unC0Rr
parents:
4365
diff
changeset
|
81 |
var sign: real; |
7375
16ae2e1c9005
Tell AI to avoid edges, especially ones over water (this does not include checking whether a knock could drown yet). Also make flakes pick a new random dx/dy on respawn to further reduce patterns. Also disable a couple of weapons for the particularly dumb AI levels, and disable switching for the dumbest.
nemo
parents:
7206
diff
changeset
|
82 |
moved: boolean; |
3441 | 83 |
begin |
3641 | 84 |
if vobCount = 0 then exit; |
3611 | 85 |
|
3593
ae50f63e4fa9
Remove hwFloat from VisualGears - they don't need the precision for syncing purposes, and it saves a whole lot of operations.
nemo
parents:
3592
diff
changeset
|
86 |
sign:= 1; |
3441 | 87 |
with Gear^ do |
88 |
begin |
|
10623
81f1cf934827
Skip frame increments if FrameTicks is over 1000 seconds per frame, probably indicating static at that point.
nemo
parents:
10526
diff
changeset
|
89 |
if FrameTicks < 1000000 then |
3441 | 90 |
begin |
10623
81f1cf934827
Skip frame increments if FrameTicks is over 1000 seconds per frame, probably indicating static at that point.
nemo
parents:
10526
diff
changeset
|
91 |
inc(FrameTicks, Steps); |
81f1cf934827
Skip frame increments if FrameTicks is over 1000 seconds per frame, probably indicating static at that point.
nemo
parents:
10526
diff
changeset
|
92 |
if not SuddenDeathDmg and (FrameTicks > vobFrameTicks) then |
81f1cf934827
Skip frame increments if FrameTicks is over 1000 seconds per frame, probably indicating static at that point.
nemo
parents:
10526
diff
changeset
|
93 |
begin |
81f1cf934827
Skip frame increments if FrameTicks is over 1000 seconds per frame, probably indicating static at that point.
nemo
parents:
10526
diff
changeset
|
94 |
dec(FrameTicks, vobFrameTicks); |
81f1cf934827
Skip frame increments if FrameTicks is over 1000 seconds per frame, probably indicating static at that point.
nemo
parents:
10526
diff
changeset
|
95 |
inc(Frame); |
81f1cf934827
Skip frame increments if FrameTicks is over 1000 seconds per frame, probably indicating static at that point.
nemo
parents:
10526
diff
changeset
|
96 |
if Frame = vobFramesCount then |
81f1cf934827
Skip frame increments if FrameTicks is over 1000 seconds per frame, probably indicating static at that point.
nemo
parents:
10526
diff
changeset
|
97 |
Frame:= 0 |
81f1cf934827
Skip frame increments if FrameTicks is over 1000 seconds per frame, probably indicating static at that point.
nemo
parents:
10526
diff
changeset
|
98 |
end |
81f1cf934827
Skip frame increments if FrameTicks is over 1000 seconds per frame, probably indicating static at that point.
nemo
parents:
10526
diff
changeset
|
99 |
else if SuddenDeathDmg and (FrameTicks > vobSDFrameTicks) then |
81f1cf934827
Skip frame increments if FrameTicks is over 1000 seconds per frame, probably indicating static at that point.
nemo
parents:
10526
diff
changeset
|
100 |
begin |
81f1cf934827
Skip frame increments if FrameTicks is over 1000 seconds per frame, probably indicating static at that point.
nemo
parents:
10526
diff
changeset
|
101 |
dec(FrameTicks, vobSDFrameTicks); |
81f1cf934827
Skip frame increments if FrameTicks is over 1000 seconds per frame, probably indicating static at that point.
nemo
parents:
10526
diff
changeset
|
102 |
inc(Frame); |
81f1cf934827
Skip frame increments if FrameTicks is over 1000 seconds per frame, probably indicating static at that point.
nemo
parents:
10526
diff
changeset
|
103 |
if Frame = vobSDFramesCount then |
81f1cf934827
Skip frame increments if FrameTicks is over 1000 seconds per frame, probably indicating static at that point.
nemo
parents:
10526
diff
changeset
|
104 |
Frame:= 0 |
81f1cf934827
Skip frame increments if FrameTicks is over 1000 seconds per frame, probably indicating static at that point.
nemo
parents:
10526
diff
changeset
|
105 |
end; |
3441 | 106 |
end; |
6553
91365db8b82c
Slow down flakes/clouds that are farther away. Also unbreak NTPX w/ SDL 1.2
nemo
parents:
6302
diff
changeset
|
107 |
X:= X + (cWindSpeedf * 400 + dX + tdX) * Steps * Gear^.Scale; |
4806
48c1a395f0a7
added flake configuration also in sudden death and SDClouds for underwater
Henek
parents:
4475
diff
changeset
|
108 |
if SuddenDeathDmg then |
6553
91365db8b82c
Slow down flakes/clouds that are farther away. Also unbreak NTPX w/ SDL 1.2
nemo
parents:
6302
diff
changeset
|
109 |
Y:= Y + (dY + tdY + cGravityf * vobSDFallSpeed) * Steps * Gear^.Scale |
4806
48c1a395f0a7
added flake configuration also in sudden death and SDClouds for underwater
Henek
parents:
4475
diff
changeset
|
110 |
else |
6553
91365db8b82c
Slow down flakes/clouds that are farther away. Also unbreak NTPX w/ SDL 1.2
nemo
parents:
6302
diff
changeset
|
111 |
Y:= Y + (dY + tdY + cGravityf * vobFallSpeed) * Steps * Gear^.Scale; |
3441 | 112 |
Angle:= Angle + dAngle * Steps; |
4152
07008cb354f9
Prevent vgtFlake's rotation angle to grow too high in its absolute value
unc0rr
parents:
4034
diff
changeset
|
113 |
if Angle > 360 then |
07008cb354f9
Prevent vgtFlake's rotation angle to grow too high in its absolute value
unc0rr
parents:
4034
diff
changeset
|
114 |
Angle:= Angle - 360 |
07008cb354f9
Prevent vgtFlake's rotation angle to grow too high in its absolute value
unc0rr
parents:
4034
diff
changeset
|
115 |
else |
07008cb354f9
Prevent vgtFlake's rotation angle to grow too high in its absolute value
unc0rr
parents:
4034
diff
changeset
|
116 |
if Angle < - 360 then |
07008cb354f9
Prevent vgtFlake's rotation angle to grow too high in its absolute value
unc0rr
parents:
4034
diff
changeset
|
117 |
Angle:= Angle + 360; |
8330 | 118 |
|
119 |
||
6580
6155187bf599
A partial reformatting of the pascal code to have consistent syntax. Things that are still inconsistent.
lovelacer
parents:
6553
diff
changeset
|
120 |
if (round(X) >= cLeftScreenBorder) |
6155187bf599
A partial reformatting of the pascal code to have consistent syntax. Things that are still inconsistent.
lovelacer
parents:
6553
diff
changeset
|
121 |
and (round(X) <= cRightScreenBorder) |
6155187bf599
A partial reformatting of the pascal code to have consistent syntax. Things that are still inconsistent.
lovelacer
parents:
6553
diff
changeset
|
122 |
and (round(Y) - 75 <= LAND_HEIGHT) |
6155187bf599
A partial reformatting of the pascal code to have consistent syntax. Things that are still inconsistent.
lovelacer
parents:
6553
diff
changeset
|
123 |
and (Timer > 0) and (Timer-Steps > 0) then |
3441 | 124 |
begin |
6580
6155187bf599
A partial reformatting of the pascal code to have consistent syntax. Things that are still inconsistent.
lovelacer
parents:
6553
diff
changeset
|
125 |
if tdX > 0 then |
6155187bf599
A partial reformatting of the pascal code to have consistent syntax. Things that are still inconsistent.
lovelacer
parents:
6553
diff
changeset
|
126 |
sign := 1 |
6155187bf599
A partial reformatting of the pascal code to have consistent syntax. Things that are still inconsistent.
lovelacer
parents:
6553
diff
changeset
|
127 |
else |
6155187bf599
A partial reformatting of the pascal code to have consistent syntax. Things that are still inconsistent.
lovelacer
parents:
6553
diff
changeset
|
128 |
sign:= -1; |
3593
ae50f63e4fa9
Remove hwFloat from VisualGears - they don't need the precision for syncing purposes, and it saves a whole lot of operations.
nemo
parents:
3592
diff
changeset
|
129 |
tdX:= tdX - 0.005*Steps*sign; |
6580
6155187bf599
A partial reformatting of the pascal code to have consistent syntax. Things that are still inconsistent.
lovelacer
parents:
6553
diff
changeset
|
130 |
if ((sign < 0) and (tdX > 0)) or ((sign > 0) and (tdX < 0)) then |
6155187bf599
A partial reformatting of the pascal code to have consistent syntax. Things that are still inconsistent.
lovelacer
parents:
6553
diff
changeset
|
131 |
tdX:= 0; |
6155187bf599
A partial reformatting of the pascal code to have consistent syntax. Things that are still inconsistent.
lovelacer
parents:
6553
diff
changeset
|
132 |
if tdX > 0 then |
6155187bf599
A partial reformatting of the pascal code to have consistent syntax. Things that are still inconsistent.
lovelacer
parents:
6553
diff
changeset
|
133 |
sign := 1 |
6155187bf599
A partial reformatting of the pascal code to have consistent syntax. Things that are still inconsistent.
lovelacer
parents:
6553
diff
changeset
|
134 |
else |
6155187bf599
A partial reformatting of the pascal code to have consistent syntax. Things that are still inconsistent.
lovelacer
parents:
6553
diff
changeset
|
135 |
sign:= -1; |
3593
ae50f63e4fa9
Remove hwFloat from VisualGears - they don't need the precision for syncing purposes, and it saves a whole lot of operations.
nemo
parents:
3592
diff
changeset
|
136 |
tdY:= tdY - 0.005*Steps*sign; |
6580
6155187bf599
A partial reformatting of the pascal code to have consistent syntax. Things that are still inconsistent.
lovelacer
parents:
6553
diff
changeset
|
137 |
if ((sign < 0) and (tdY > 0)) or ((sign > 0) and (tdY < 0)) then |
6155187bf599
A partial reformatting of the pascal code to have consistent syntax. Things that are still inconsistent.
lovelacer
parents:
6553
diff
changeset
|
138 |
tdY:= 0; |
3441 | 139 |
dec(Timer, Steps) |
140 |
end |
|
141 |
else |
|
142 |
begin |
|
7375
16ae2e1c9005
Tell AI to avoid edges, especially ones over water (this does not include checking whether a knock could drown yet). Also make flakes pick a new random dx/dy on respawn to further reduce patterns. Also disable a couple of weapons for the particularly dumb AI levels, and disable switching for the dumbest.
nemo
parents:
7206
diff
changeset
|
143 |
moved:= false; |
6580
6155187bf599
A partial reformatting of the pascal code to have consistent syntax. Things that are still inconsistent.
lovelacer
parents:
6553
diff
changeset
|
144 |
if round(X) < cLeftScreenBorder then |
7375
16ae2e1c9005
Tell AI to avoid edges, especially ones over water (this does not include checking whether a knock could drown yet). Also make flakes pick a new random dx/dy on respawn to further reduce patterns. Also disable a couple of weapons for the particularly dumb AI levels, and disable switching for the dumbest.
nemo
parents:
7206
diff
changeset
|
145 |
begin |
16ae2e1c9005
Tell AI to avoid edges, especially ones over water (this does not include checking whether a knock could drown yet). Also make flakes pick a new random dx/dy on respawn to further reduce patterns. Also disable a couple of weapons for the particularly dumb AI levels, and disable switching for the dumbest.
nemo
parents:
7206
diff
changeset
|
146 |
X:= X + cScreenSpace; |
16ae2e1c9005
Tell AI to avoid edges, especially ones over water (this does not include checking whether a knock could drown yet). Also make flakes pick a new random dx/dy on respawn to further reduce patterns. Also disable a couple of weapons for the particularly dumb AI levels, and disable switching for the dumbest.
nemo
parents:
7206
diff
changeset
|
147 |
moved:= true |
16ae2e1c9005
Tell AI to avoid edges, especially ones over water (this does not include checking whether a knock could drown yet). Also make flakes pick a new random dx/dy on respawn to further reduce patterns. Also disable a couple of weapons for the particularly dumb AI levels, and disable switching for the dumbest.
nemo
parents:
7206
diff
changeset
|
148 |
end |
6580
6155187bf599
A partial reformatting of the pascal code to have consistent syntax. Things that are still inconsistent.
lovelacer
parents:
6553
diff
changeset
|
149 |
else |
6155187bf599
A partial reformatting of the pascal code to have consistent syntax. Things that are still inconsistent.
lovelacer
parents:
6553
diff
changeset
|
150 |
if round(X) > cRightScreenBorder then |
7375
16ae2e1c9005
Tell AI to avoid edges, especially ones over water (this does not include checking whether a knock could drown yet). Also make flakes pick a new random dx/dy on respawn to further reduce patterns. Also disable a couple of weapons for the particularly dumb AI levels, and disable switching for the dumbest.
nemo
parents:
7206
diff
changeset
|
151 |
begin |
6580
6155187bf599
A partial reformatting of the pascal code to have consistent syntax. Things that are still inconsistent.
lovelacer
parents:
6553
diff
changeset
|
152 |
X:= X - cScreenSpace; |
7375
16ae2e1c9005
Tell AI to avoid edges, especially ones over water (this does not include checking whether a knock could drown yet). Also make flakes pick a new random dx/dy on respawn to further reduce patterns. Also disable a couple of weapons for the particularly dumb AI levels, and disable switching for the dumbest.
nemo
parents:
7206
diff
changeset
|
153 |
moved:= true |
16ae2e1c9005
Tell AI to avoid edges, especially ones over water (this does not include checking whether a knock could drown yet). Also make flakes pick a new random dx/dy on respawn to further reduce patterns. Also disable a couple of weapons for the particularly dumb AI levels, and disable switching for the dumbest.
nemo
parents:
7206
diff
changeset
|
154 |
end; |
6580
6155187bf599
A partial reformatting of the pascal code to have consistent syntax. Things that are still inconsistent.
lovelacer
parents:
6553
diff
changeset
|
155 |
// if round(Y) < (LAND_HEIGHT - 1024 - 75) then Y:= Y + 25.0; // For if flag is set for flakes rising upwards? |
7206
ce46b56ae9f5
Double sniper rifle damage (AI seems unaware of second shot, when playing). Spread out flakes along X when looping and add a little Y variation. This avoids noticeable patterns. Especially on the rarer close layer or dense flakes like rain (for Y)
nemo
parents:
6913
diff
changeset
|
156 |
if (Gear^.Layer = 2) and (round(Y) - 225 > LAND_HEIGHT) then |
ce46b56ae9f5
Double sniper rifle damage (AI seems unaware of second shot, when playing). Spread out flakes along X when looping and add a little Y variation. This avoids noticeable patterns. Especially on the rarer close layer or dense flakes like rain (for Y)
nemo
parents:
6913
diff
changeset
|
157 |
begin |
ce46b56ae9f5
Double sniper rifle damage (AI seems unaware of second shot, when playing). Spread out flakes along X when looping and add a little Y variation. This avoids noticeable patterns. Especially on the rarer close layer or dense flakes like rain (for Y)
nemo
parents:
6913
diff
changeset
|
158 |
X:= cLeftScreenBorder + random(cScreenSpace); |
7375
16ae2e1c9005
Tell AI to avoid edges, especially ones over water (this does not include checking whether a knock could drown yet). Also make flakes pick a new random dx/dy on respawn to further reduce patterns. Also disable a couple of weapons for the particularly dumb AI levels, and disable switching for the dumbest.
nemo
parents:
7206
diff
changeset
|
159 |
Y:= Y - (1024 + 250 + random(50)); // TODO - configure in theme (jellies for example could use limited range) |
16ae2e1c9005
Tell AI to avoid edges, especially ones over water (this does not include checking whether a knock could drown yet). Also make flakes pick a new random dx/dy on respawn to further reduce patterns. Also disable a couple of weapons for the particularly dumb AI levels, and disable switching for the dumbest.
nemo
parents:
7206
diff
changeset
|
160 |
moved:= true |
7206
ce46b56ae9f5
Double sniper rifle damage (AI seems unaware of second shot, when playing). Spread out flakes along X when looping and add a little Y variation. This avoids noticeable patterns. Especially on the rarer close layer or dense flakes like rain (for Y)
nemo
parents:
6913
diff
changeset
|
161 |
end |
ce46b56ae9f5
Double sniper rifle damage (AI seems unaware of second shot, when playing). Spread out flakes along X when looping and add a little Y variation. This avoids noticeable patterns. Especially on the rarer close layer or dense flakes like rain (for Y)
nemo
parents:
6913
diff
changeset
|
162 |
else if (Gear^.Layer <> 2) and (round(Y) + 50 > LAND_HEIGHT) then |
ce46b56ae9f5
Double sniper rifle damage (AI seems unaware of second shot, when playing). Spread out flakes along X when looping and add a little Y variation. This avoids noticeable patterns. Especially on the rarer close layer or dense flakes like rain (for Y)
nemo
parents:
6913
diff
changeset
|
163 |
begin |
ce46b56ae9f5
Double sniper rifle damage (AI seems unaware of second shot, when playing). Spread out flakes along X when looping and add a little Y variation. This avoids noticeable patterns. Especially on the rarer close layer or dense flakes like rain (for Y)
nemo
parents:
6913
diff
changeset
|
164 |
X:= cLeftScreenBorder + random(cScreenSpace); |
7375
16ae2e1c9005
Tell AI to avoid edges, especially ones over water (this does not include checking whether a knock could drown yet). Also make flakes pick a new random dx/dy on respawn to further reduce patterns. Also disable a couple of weapons for the particularly dumb AI levels, and disable switching for the dumbest.
nemo
parents:
7206
diff
changeset
|
165 |
Y:= Y - (1024 + random(25)); |
16ae2e1c9005
Tell AI to avoid edges, especially ones over water (this does not include checking whether a knock could drown yet). Also make flakes pick a new random dx/dy on respawn to further reduce patterns. Also disable a couple of weapons for the particularly dumb AI levels, and disable switching for the dumbest.
nemo
parents:
7206
diff
changeset
|
166 |
moved:= true |
16ae2e1c9005
Tell AI to avoid edges, especially ones over water (this does not include checking whether a knock could drown yet). Also make flakes pick a new random dx/dy on respawn to further reduce patterns. Also disable a couple of weapons for the particularly dumb AI levels, and disable switching for the dumbest.
nemo
parents:
7206
diff
changeset
|
167 |
end; |
16ae2e1c9005
Tell AI to avoid edges, especially ones over water (this does not include checking whether a knock could drown yet). Also make flakes pick a new random dx/dy on respawn to further reduce patterns. Also disable a couple of weapons for the particularly dumb AI levels, and disable switching for the dumbest.
nemo
parents:
7206
diff
changeset
|
168 |
if moved then |
16ae2e1c9005
Tell AI to avoid edges, especially ones over water (this does not include checking whether a knock could drown yet). Also make flakes pick a new random dx/dy on respawn to further reduce patterns. Also disable a couple of weapons for the particularly dumb AI levels, and disable switching for the dumbest.
nemo
parents:
7206
diff
changeset
|
169 |
begin |
16ae2e1c9005
Tell AI to avoid edges, especially ones over water (this does not include checking whether a knock could drown yet). Also make flakes pick a new random dx/dy on respawn to further reduce patterns. Also disable a couple of weapons for the particularly dumb AI levels, and disable switching for the dumbest.
nemo
parents:
7206
diff
changeset
|
170 |
Angle:= random(360); |
16ae2e1c9005
Tell AI to avoid edges, especially ones over water (this does not include checking whether a knock could drown yet). Also make flakes pick a new random dx/dy on respawn to further reduce patterns. Also disable a couple of weapons for the particularly dumb AI levels, and disable switching for the dumbest.
nemo
parents:
7206
diff
changeset
|
171 |
dx:= 0.0000038654705 * random(10000); |
16ae2e1c9005
Tell AI to avoid edges, especially ones over water (this does not include checking whether a knock could drown yet). Also make flakes pick a new random dx/dy on respawn to further reduce patterns. Also disable a couple of weapons for the particularly dumb AI levels, and disable switching for the dumbest.
nemo
parents:
7206
diff
changeset
|
172 |
dy:= 0.000003506096 * random(7000); |
16ae2e1c9005
Tell AI to avoid edges, especially ones over water (this does not include checking whether a knock could drown yet). Also make flakes pick a new random dx/dy on respawn to further reduce patterns. Also disable a couple of weapons for the particularly dumb AI levels, and disable switching for the dumbest.
nemo
parents:
7206
diff
changeset
|
173 |
if random(2) = 0 then dx := -dx |
7206
ce46b56ae9f5
Double sniper rifle damage (AI seems unaware of second shot, when playing). Spread out flakes along X when looping and add a little Y variation. This avoids noticeable patterns. Especially on the rarer close layer or dense flakes like rain (for Y)
nemo
parents:
6913
diff
changeset
|
174 |
end; |
3441 | 175 |
Timer:= 0; |
3593
ae50f63e4fa9
Remove hwFloat from VisualGears - they don't need the precision for syncing purposes, and it saves a whole lot of operations.
nemo
parents:
3592
diff
changeset
|
176 |
tdX:= 0; |
ae50f63e4fa9
Remove hwFloat from VisualGears - they don't need the precision for syncing purposes, and it saves a whole lot of operations.
nemo
parents:
3592
diff
changeset
|
177 |
tdY:= 0 |
3441 | 178 |
end; |
179 |
end; |
|
180 |
||
181 |
end; |
|
182 |
||
183 |
//////////////////////////////////////////////////////////////////////////////// |
|
184 |
procedure doStepBeeTrace(Gear: PVisualGear; Steps: Longword); |
|
185 |
begin |
|
186 |
if Gear^.FrameTicks > Steps then |
|
187 |
dec(Gear^.FrameTicks, Steps) |
|
188 |
else |
|
189 |
DeleteVisualGear(Gear); |
|
190 |
end; |
|
191 |
||
192 |
//////////////////////////////////////////////////////////////////////////////// |
|
193 |
procedure doStepCloud(Gear: PVisualGear; Steps: Longword); |
|
3592
0bcad5c38c9e
clouds: up-and-down-bouncing now without evil loop
sheepluva
parents:
3590
diff
changeset
|
194 |
var s: Longword; |
4379
6cd6b77df8b8
No need for Extended data type just to draw some visual gears. It's a shame we have Math unit dependency
unC0Rr
parents:
4365
diff
changeset
|
195 |
t: real; |
3441 | 196 |
begin |
6553
91365db8b82c
Slow down flakes/clouds that are farther away. Also unbreak NTPX w/ SDL 1.2
nemo
parents:
6302
diff
changeset
|
197 |
Gear^.X:= Gear^.X + (cWindSpeedf * 750 * Gear^.dX * Gear^.Scale) * Steps; |
3441 | 198 |
|
3592
0bcad5c38c9e
clouds: up-and-down-bouncing now without evil loop
sheepluva
parents:
3590
diff
changeset
|
199 |
// up-and-down-bounce magic |
3593
ae50f63e4fa9
Remove hwFloat from VisualGears - they don't need the precision for syncing purposes, and it saves a whole lot of operations.
nemo
parents:
3592
diff
changeset
|
200 |
s := (GameTicks + Gear^.Timer) mod 4096; |
6553
91365db8b82c
Slow down flakes/clouds that are farther away. Also unbreak NTPX w/ SDL 1.2
nemo
parents:
6302
diff
changeset
|
201 |
t := 8 * Gear^.Scale * hwFloat2Float(AngleSin(s mod 2048)); |
3597
978c30ef50fc
visual gears: fixing nemo's c-style assignment/multiplications
sheepluva
parents:
3593
diff
changeset
|
202 |
if (s < 2048) then t := -t; |
3441 | 203 |
|
4161 | 204 |
Gear^.Y := LAND_HEIGHT - 1184 + LongInt(Gear^.Timer mod 8) + t; |
3441 | 205 |
|
6580
6155187bf599
A partial reformatting of the pascal code to have consistent syntax. Things that are still inconsistent.
lovelacer
parents:
6553
diff
changeset
|
206 |
if round(Gear^.X) < cLeftScreenBorder then |
6155187bf599
A partial reformatting of the pascal code to have consistent syntax. Things that are still inconsistent.
lovelacer
parents:
6553
diff
changeset
|
207 |
Gear^.X:= Gear^.X + cScreenSpace |
6155187bf599
A partial reformatting of the pascal code to have consistent syntax. Things that are still inconsistent.
lovelacer
parents:
6553
diff
changeset
|
208 |
else |
6155187bf599
A partial reformatting of the pascal code to have consistent syntax. Things that are still inconsistent.
lovelacer
parents:
6553
diff
changeset
|
209 |
if round(Gear^.X) > cRightScreenBorder then |
6155187bf599
A partial reformatting of the pascal code to have consistent syntax. Things that are still inconsistent.
lovelacer
parents:
6553
diff
changeset
|
210 |
Gear^.X:= Gear^.X - cScreenSpace |
3441 | 211 |
end; |
212 |
||
213 |
//////////////////////////////////////////////////////////////////////////////// |
|
214 |
procedure doStepExpl(Gear: PVisualGear; Steps: Longword); |
|
7808 | 215 |
var s: LongInt; |
3441 | 216 |
begin |
7808 | 217 |
s:= min(Steps, cExplFrameTicks); |
3441 | 218 |
|
7808 | 219 |
Gear^.X:= Gear^.X + Gear^.dX * s; |
220 |
Gear^.Y:= Gear^.Y + Gear^.dY * s; |
|
3593
ae50f63e4fa9
Remove hwFloat from VisualGears - they don't need the precision for syncing purposes, and it saves a whole lot of operations.
nemo
parents:
3592
diff
changeset
|
221 |
//Gear^.dY:= Gear^.dY + cGravityf; |
3441 | 222 |
|
223 |
if Gear^.FrameTicks <= Steps then |
|
6580
6155187bf599
A partial reformatting of the pascal code to have consistent syntax. Things that are still inconsistent.
lovelacer
parents:
6553
diff
changeset
|
224 |
if Gear^.Frame = 0 then |
6155187bf599
A partial reformatting of the pascal code to have consistent syntax. Things that are still inconsistent.
lovelacer
parents:
6553
diff
changeset
|
225 |
DeleteVisualGear(Gear) |
3441 | 226 |
else |
227 |
begin |
|
228 |
dec(Gear^.Frame); |
|
229 |
Gear^.FrameTicks:= cExplFrameTicks |
|
230 |
end |
|
231 |
else dec(Gear^.FrameTicks, Steps) |
|
232 |
end; |
|
233 |
||
234 |
//////////////////////////////////////////////////////////////////////////////// |
|
3704 | 235 |
procedure doStepNote(Gear: PVisualGear; Steps: Longword); |
236 |
begin |
|
237 |
Gear^.X:= Gear^.X + Gear^.dX * Steps; |
|
238 |
||
239 |
Gear^.Y:= Gear^.Y + Gear^.dY * Steps; |
|
3706 | 240 |
Gear^.dY:= Gear^.dY + cGravityf * Steps / 2; |
3704 | 241 |
|
3706 | 242 |
Gear^.Angle:= Gear^.Angle + (Gear^.Frame + 1) * Steps / 10; |
243 |
while Gear^.Angle > cMaxAngle do |
|
244 |
Gear^.Angle:= Gear^.Angle - cMaxAngle; |
|
3704 | 245 |
|
246 |
if Gear^.FrameTicks <= Steps then |
|
247 |
DeleteVisualGear(Gear) |
|
248 |
else |
|
249 |
dec(Gear^.FrameTicks, Steps) |
|
250 |
end; |
|
251 |
||
252 |
//////////////////////////////////////////////////////////////////////////////// |
|
4279 | 253 |
procedure doStepLineTrail(Gear: PVisualGear; Steps: Longword); |
254 |
begin |
|
8026
4a4f21070479
merge xymeng's gsoc engine with a few updates (and further checks on symbol definitions)
koda
parents:
7808
diff
changeset
|
255 |
{$IFNDEF PAS2C} |
4279 | 256 |
Steps := Steps; |
8026
4a4f21070479
merge xymeng's gsoc engine with a few updates (and further checks on symbol definitions)
koda
parents:
7808
diff
changeset
|
257 |
{$ENDIF} |
4279 | 258 |
if Gear^.Timer <= Steps then |
259 |
DeleteVisualGear(Gear) |
|
260 |
else |
|
261 |
dec(Gear^.Timer, Steps) |
|
262 |
end; |
|
263 |
||
264 |
//////////////////////////////////////////////////////////////////////////////// |
|
3441 | 265 |
procedure doStepEgg(Gear: PVisualGear; Steps: Longword); |
266 |
begin |
|
267 |
Gear^.X:= Gear^.X + Gear^.dX * Steps; |
|
268 |
||
269 |
Gear^.Y:= Gear^.Y + Gear^.dY * Steps; |
|
3593
ae50f63e4fa9
Remove hwFloat from VisualGears - they don't need the precision for syncing purposes, and it saves a whole lot of operations.
nemo
parents:
3592
diff
changeset
|
270 |
Gear^.dY:= Gear^.dY + cGravityf * Steps; |
3441 | 271 |
|
272 |
Gear^.Angle:= round(Gear^.Angle + Steps) mod cMaxAngle; |
|
273 |
||
274 |
if Gear^.FrameTicks <= Steps then |
|
6128 | 275 |
begin |
276 |
DeleteVisualGear(Gear); |
|
277 |
exit |
|
278 |
end |
|
3441 | 279 |
else |
5874
5cd329cf2460
nemo's molotov burst effect; with a slight color modification added
sheepluva
parents:
5855
diff
changeset
|
280 |
dec(Gear^.FrameTicks, Steps); |
5cd329cf2460
nemo's molotov burst effect; with a slight color modification added
sheepluva
parents:
5855
diff
changeset
|
281 |
|
5cd329cf2460
nemo's molotov burst effect; with a slight color modification added
sheepluva
parents:
5855
diff
changeset
|
282 |
if Gear^.FrameTicks < $FF then |
5cd329cf2460
nemo's molotov burst effect; with a slight color modification added
sheepluva
parents:
5855
diff
changeset
|
283 |
Gear^.Tint:= (Gear^.Tint and $FFFFFF00) or Gear^.FrameTicks |
3441 | 284 |
end; |
285 |
||
286 |
//////////////////////////////////////////////////////////////////////////////// |
|
287 |
procedure doStepFire(Gear: PVisualGear; Steps: Longword); |
|
3751 | 288 |
var vgt: PVisualGear; |
3441 | 289 |
begin |
290 |
Gear^.X:= Gear^.X + Gear^.dX * Steps; |
|
291 |
||
3593
ae50f63e4fa9
Remove hwFloat from VisualGears - they don't need the precision for syncing purposes, and it saves a whole lot of operations.
nemo
parents:
3592
diff
changeset
|
292 |
Gear^.Y:= Gear^.Y + Gear^.dY * Steps;// + cGravityf * (Steps * Steps); |
3751 | 293 |
if (Gear^.State and gstTmpFlag) = 0 then |
294 |
begin |
|
295 |
Gear^.dY:= Gear^.dY + cGravityf * Steps; |
|
3764 | 296 |
if ((GameTicks mod 200) < Steps + 1) then |
3751 | 297 |
begin |
298 |
vgt:= AddVisualGear(round(Gear^.X), round(Gear^.Y), vgtFire); |
|
299 |
if vgt <> nil then |
|
300 |
begin |
|
301 |
vgt^.dx:= 0; |
|
302 |
vgt^.dy:= 0; |
|
303 |
vgt^.State:= gstTmpFlag; |
|
304 |
end; |
|
305 |
end |
|
306 |
end |
|
307 |
else |
|
308 |
inc(Steps, Steps); |
|
3441 | 309 |
|
310 |
if Gear^.FrameTicks <= Steps then |
|
311 |
DeleteVisualGear(Gear) |
|
312 |
else |
|
313 |
dec(Gear^.FrameTicks, Steps) |
|
314 |
end; |
|
315 |
||
316 |
//////////////////////////////////////////////////////////////////////////////// |
|
317 |
procedure doStepShell(Gear: PVisualGear; Steps: Longword); |
|
318 |
begin |
|
319 |
Gear^.X:= Gear^.X + Gear^.dX * Steps; |
|
320 |
||
321 |
Gear^.Y:= Gear^.Y + Gear^.dY * Steps; |
|
3593
ae50f63e4fa9
Remove hwFloat from VisualGears - they don't need the precision for syncing purposes, and it saves a whole lot of operations.
nemo
parents:
3592
diff
changeset
|
322 |
Gear^.dY:= Gear^.dY + cGravityf * Steps; |
3441 | 323 |
|
324 |
Gear^.Angle:= round(Gear^.Angle + Steps) mod cMaxAngle; |
|
325 |
||
326 |
if Gear^.FrameTicks <= Steps then |
|
327 |
DeleteVisualGear(Gear) |
|
328 |
else |
|
329 |
dec(Gear^.FrameTicks, Steps) |
|
330 |
end; |
|
331 |
||
332 |
procedure doStepSmallDamage(Gear: PVisualGear; Steps: Longword); |
|
333 |
begin |
|
3593
ae50f63e4fa9
Remove hwFloat from VisualGears - they don't need the precision for syncing purposes, and it saves a whole lot of operations.
nemo
parents:
3592
diff
changeset
|
334 |
Gear^.Y:= Gear^.Y - 0.02 * Steps; |
3441 | 335 |
|
336 |
if Gear^.FrameTicks <= Steps then |
|
337 |
DeleteVisualGear(Gear) |
|
338 |
else |
|
339 |
dec(Gear^.FrameTicks, Steps) |
|
340 |
end; |
|
341 |
||
342 |
//////////////////////////////////////////////////////////////////////////////// |
|
343 |
procedure doStepBubble(Gear: PVisualGear; Steps: Longword); |
|
344 |
begin |
|
6580
6155187bf599
A partial reformatting of the pascal code to have consistent syntax. Things that are still inconsistent.
lovelacer
parents:
6553
diff
changeset
|
345 |
Gear^.X:= Gear^.X + Gear^.dX * Steps; |
6155187bf599
A partial reformatting of the pascal code to have consistent syntax. Things that are still inconsistent.
lovelacer
parents:
6553
diff
changeset
|
346 |
Gear^.Y:= Gear^.Y + Gear^.dY * Steps; |
6155187bf599
A partial reformatting of the pascal code to have consistent syntax. Things that are still inconsistent.
lovelacer
parents:
6553
diff
changeset
|
347 |
Gear^.Y:= Gear^.Y - cDrownSpeedf * Steps; |
6155187bf599
A partial reformatting of the pascal code to have consistent syntax. Things that are still inconsistent.
lovelacer
parents:
6553
diff
changeset
|
348 |
Gear^.dX := Gear^.dX / (1.001 * Steps); |
6155187bf599
A partial reformatting of the pascal code to have consistent syntax. Things that are still inconsistent.
lovelacer
parents:
6553
diff
changeset
|
349 |
Gear^.dY := Gear^.dY / (1.001 * Steps); |
3441 | 350 |
|
10355 | 351 |
if (Gear^.FrameTicks <= Steps) or (not CheckCoordInWater(round(Gear^.X), round(Gear^.Y))) then |
6580
6155187bf599
A partial reformatting of the pascal code to have consistent syntax. Things that are still inconsistent.
lovelacer
parents:
6553
diff
changeset
|
352 |
DeleteVisualGear(Gear) |
6155187bf599
A partial reformatting of the pascal code to have consistent syntax. Things that are still inconsistent.
lovelacer
parents:
6553
diff
changeset
|
353 |
else |
6155187bf599
A partial reformatting of the pascal code to have consistent syntax. Things that are still inconsistent.
lovelacer
parents:
6553
diff
changeset
|
354 |
dec(Gear^.FrameTicks, Steps) |
3441 | 355 |
end; |
356 |
||
357 |
//////////////////////////////////////////////////////////////////////////////// |
|
358 |
procedure doStepSteam(Gear: PVisualGear; Steps: Longword); |
|
359 |
begin |
|
10354 | 360 |
if ((cWindSpeedf > 0) and ( leftX > Gear^.X)) |
361 |
or ((cWindSpeedf < 0) and (rightX < Gear^.X)) then |
|
362 |
Gear^.X:= Gear^.X + (cWindSpeedf * 100 + Gear^.dX) * Steps; |
|
6580
6155187bf599
A partial reformatting of the pascal code to have consistent syntax. Things that are still inconsistent.
lovelacer
parents:
6553
diff
changeset
|
363 |
Gear^.Y:= Gear^.Y - cDrownSpeedf * Steps; |
3441 | 364 |
|
6580
6155187bf599
A partial reformatting of the pascal code to have consistent syntax. Things that are still inconsistent.
lovelacer
parents:
6553
diff
changeset
|
365 |
if Gear^.FrameTicks <= Steps then |
6155187bf599
A partial reformatting of the pascal code to have consistent syntax. Things that are still inconsistent.
lovelacer
parents:
6553
diff
changeset
|
366 |
if Gear^.Frame = 0 then |
6155187bf599
A partial reformatting of the pascal code to have consistent syntax. Things that are still inconsistent.
lovelacer
parents:
6553
diff
changeset
|
367 |
DeleteVisualGear(Gear) |
6155187bf599
A partial reformatting of the pascal code to have consistent syntax. Things that are still inconsistent.
lovelacer
parents:
6553
diff
changeset
|
368 |
else |
6155187bf599
A partial reformatting of the pascal code to have consistent syntax. Things that are still inconsistent.
lovelacer
parents:
6553
diff
changeset
|
369 |
begin |
6155187bf599
A partial reformatting of the pascal code to have consistent syntax. Things that are still inconsistent.
lovelacer
parents:
6553
diff
changeset
|
370 |
if Random(2) = 0 then |
6155187bf599
A partial reformatting of the pascal code to have consistent syntax. Things that are still inconsistent.
lovelacer
parents:
6553
diff
changeset
|
371 |
dec(Gear^.Frame); |
6155187bf599
A partial reformatting of the pascal code to have consistent syntax. Things that are still inconsistent.
lovelacer
parents:
6553
diff
changeset
|
372 |
Gear^.FrameTicks:= cExplFrameTicks |
6155187bf599
A partial reformatting of the pascal code to have consistent syntax. Things that are still inconsistent.
lovelacer
parents:
6553
diff
changeset
|
373 |
end |
6155187bf599
A partial reformatting of the pascal code to have consistent syntax. Things that are still inconsistent.
lovelacer
parents:
6553
diff
changeset
|
374 |
else dec(Gear^.FrameTicks, Steps) |
3441 | 375 |
end; |
376 |
||
377 |
//////////////////////////////////////////////////////////////////////////////// |
|
378 |
procedure doStepAmmo(Gear: PVisualGear; Steps: Longword); |
|
379 |
begin |
|
6580
6155187bf599
A partial reformatting of the pascal code to have consistent syntax. Things that are still inconsistent.
lovelacer
parents:
6553
diff
changeset
|
380 |
Gear^.Y:= Gear^.Y - cDrownSpeedf * Steps; |
3441 | 381 |
|
6580
6155187bf599
A partial reformatting of the pascal code to have consistent syntax. Things that are still inconsistent.
lovelacer
parents:
6553
diff
changeset
|
382 |
Gear^.scale:= Gear^.scale + 0.0025 * Steps; |
6155187bf599
A partial reformatting of the pascal code to have consistent syntax. Things that are still inconsistent.
lovelacer
parents:
6553
diff
changeset
|
383 |
Gear^.alpha:= Gear^.alpha - 0.0015 * Steps; |
3441 | 384 |
|
6580
6155187bf599
A partial reformatting of the pascal code to have consistent syntax. Things that are still inconsistent.
lovelacer
parents:
6553
diff
changeset
|
385 |
if Gear^.alpha < 0 then |
6155187bf599
A partial reformatting of the pascal code to have consistent syntax. Things that are still inconsistent.
lovelacer
parents:
6553
diff
changeset
|
386 |
DeleteVisualGear(Gear) |
3441 | 387 |
end; |
388 |
||
389 |
//////////////////////////////////////////////////////////////////////////////// |
|
390 |
procedure doStepSmoke(Gear: PVisualGear; Steps: Longword); |
|
391 |
begin |
|
6580
6155187bf599
A partial reformatting of the pascal code to have consistent syntax. Things that are still inconsistent.
lovelacer
parents:
6553
diff
changeset
|
392 |
Gear^.X:= Gear^.X + (cWindSpeedf + Gear^.dX) * Steps; |
6155187bf599
A partial reformatting of the pascal code to have consistent syntax. Things that are still inconsistent.
lovelacer
parents:
6553
diff
changeset
|
393 |
Gear^.Y:= Gear^.Y - (cDrownSpeedf + Gear^.dY) * Steps; |
3441 | 394 |
|
6580
6155187bf599
A partial reformatting of the pascal code to have consistent syntax. Things that are still inconsistent.
lovelacer
parents:
6553
diff
changeset
|
395 |
Gear^.dX := Gear^.dX + (cWindSpeedf * 0.3 * Steps); |
6155187bf599
A partial reformatting of the pascal code to have consistent syntax. Things that are still inconsistent.
lovelacer
parents:
6553
diff
changeset
|
396 |
//Gear^.dY := Gear^.dY - (cDrownSpeedf * 0.995); |
3441 | 397 |
|
6580
6155187bf599
A partial reformatting of the pascal code to have consistent syntax. Things that are still inconsistent.
lovelacer
parents:
6553
diff
changeset
|
398 |
if Gear^.FrameTicks <= Steps then |
6155187bf599
A partial reformatting of the pascal code to have consistent syntax. Things that are still inconsistent.
lovelacer
parents:
6553
diff
changeset
|
399 |
if Gear^.Frame = 0 then |
6155187bf599
A partial reformatting of the pascal code to have consistent syntax. Things that are still inconsistent.
lovelacer
parents:
6553
diff
changeset
|
400 |
DeleteVisualGear(Gear) |
6155187bf599
A partial reformatting of the pascal code to have consistent syntax. Things that are still inconsistent.
lovelacer
parents:
6553
diff
changeset
|
401 |
else |
6155187bf599
A partial reformatting of the pascal code to have consistent syntax. Things that are still inconsistent.
lovelacer
parents:
6553
diff
changeset
|
402 |
begin |
6155187bf599
A partial reformatting of the pascal code to have consistent syntax. Things that are still inconsistent.
lovelacer
parents:
6553
diff
changeset
|
403 |
if Random(2) = 0 then |
6155187bf599
A partial reformatting of the pascal code to have consistent syntax. Things that are still inconsistent.
lovelacer
parents:
6553
diff
changeset
|
404 |
dec(Gear^.Frame); |
6155187bf599
A partial reformatting of the pascal code to have consistent syntax. Things that are still inconsistent.
lovelacer
parents:
6553
diff
changeset
|
405 |
Gear^.FrameTicks:= cExplFrameTicks |
6155187bf599
A partial reformatting of the pascal code to have consistent syntax. Things that are still inconsistent.
lovelacer
parents:
6553
diff
changeset
|
406 |
end |
6155187bf599
A partial reformatting of the pascal code to have consistent syntax. Things that are still inconsistent.
lovelacer
parents:
6553
diff
changeset
|
407 |
else dec(Gear^.FrameTicks, Steps) |
3441 | 408 |
end; |
409 |
||
410 |
//////////////////////////////////////////////////////////////////////////////// |
|
411 |
procedure doStepDust(Gear: PVisualGear; Steps: Longword); |
|
412 |
begin |
|
6580
6155187bf599
A partial reformatting of the pascal code to have consistent syntax. Things that are still inconsistent.
lovelacer
parents:
6553
diff
changeset
|
413 |
Gear^.X:= Gear^.X + (cWindSpeedf + (cWindSpeedf * 0.03 * Steps) + Gear^.dX) * Steps; |
6155187bf599
A partial reformatting of the pascal code to have consistent syntax. Things that are still inconsistent.
lovelacer
parents:
6553
diff
changeset
|
414 |
Gear^.Y:= Gear^.Y - (Gear^.dY) * Steps; |
3441 | 415 |
|
6580
6155187bf599
A partial reformatting of the pascal code to have consistent syntax. Things that are still inconsistent.
lovelacer
parents:
6553
diff
changeset
|
416 |
Gear^.dX := Gear^.dX - (Gear^.dX * 0.005 * Steps); |
6155187bf599
A partial reformatting of the pascal code to have consistent syntax. Things that are still inconsistent.
lovelacer
parents:
6553
diff
changeset
|
417 |
Gear^.dY := Gear^.dY - (cDrownSpeedf * 0.001 * Steps); |
3441 | 418 |
|
6580
6155187bf599
A partial reformatting of the pascal code to have consistent syntax. Things that are still inconsistent.
lovelacer
parents:
6553
diff
changeset
|
419 |
if Gear^.FrameTicks <= Steps then |
6155187bf599
A partial reformatting of the pascal code to have consistent syntax. Things that are still inconsistent.
lovelacer
parents:
6553
diff
changeset
|
420 |
if Gear^.Frame = 0 then |
6155187bf599
A partial reformatting of the pascal code to have consistent syntax. Things that are still inconsistent.
lovelacer
parents:
6553
diff
changeset
|
421 |
DeleteVisualGear(Gear) |
6155187bf599
A partial reformatting of the pascal code to have consistent syntax. Things that are still inconsistent.
lovelacer
parents:
6553
diff
changeset
|
422 |
else |
6155187bf599
A partial reformatting of the pascal code to have consistent syntax. Things that are still inconsistent.
lovelacer
parents:
6553
diff
changeset
|
423 |
begin |
6155187bf599
A partial reformatting of the pascal code to have consistent syntax. Things that are still inconsistent.
lovelacer
parents:
6553
diff
changeset
|
424 |
dec(Gear^.Frame); |
6155187bf599
A partial reformatting of the pascal code to have consistent syntax. Things that are still inconsistent.
lovelacer
parents:
6553
diff
changeset
|
425 |
Gear^.FrameTicks:= cExplFrameTicks |
6155187bf599
A partial reformatting of the pascal code to have consistent syntax. Things that are still inconsistent.
lovelacer
parents:
6553
diff
changeset
|
426 |
end |
6155187bf599
A partial reformatting of the pascal code to have consistent syntax. Things that are still inconsistent.
lovelacer
parents:
6553
diff
changeset
|
427 |
else dec(Gear^.FrameTicks, Steps) |
3441 | 428 |
end; |
429 |
||
430 |
//////////////////////////////////////////////////////////////////////////////// |
|
431 |
procedure doStepSplash(Gear: PVisualGear; Steps: Longword); |
|
432 |
begin |
|
6580
6155187bf599
A partial reformatting of the pascal code to have consistent syntax. Things that are still inconsistent.
lovelacer
parents:
6553
diff
changeset
|
433 |
if Gear^.FrameTicks <= Steps then |
6155187bf599
A partial reformatting of the pascal code to have consistent syntax. Things that are still inconsistent.
lovelacer
parents:
6553
diff
changeset
|
434 |
DeleteVisualGear(Gear) |
6155187bf599
A partial reformatting of the pascal code to have consistent syntax. Things that are still inconsistent.
lovelacer
parents:
6553
diff
changeset
|
435 |
else |
6155187bf599
A partial reformatting of the pascal code to have consistent syntax. Things that are still inconsistent.
lovelacer
parents:
6553
diff
changeset
|
436 |
dec(Gear^.FrameTicks, Steps); |
3441 | 437 |
end; |
438 |
||
439 |
//////////////////////////////////////////////////////////////////////////////// |
|
440 |
procedure doStepDroplet(Gear: PVisualGear; Steps: Longword); |
|
441 |
begin |
|
6580
6155187bf599
A partial reformatting of the pascal code to have consistent syntax. Things that are still inconsistent.
lovelacer
parents:
6553
diff
changeset
|
442 |
Gear^.X:= Gear^.X + Gear^.dX * Steps; |
3441 | 443 |
|
6580
6155187bf599
A partial reformatting of the pascal code to have consistent syntax. Things that are still inconsistent.
lovelacer
parents:
6553
diff
changeset
|
444 |
Gear^.Y:= Gear^.Y + Gear^.dY * Steps; |
6155187bf599
A partial reformatting of the pascal code to have consistent syntax. Things that are still inconsistent.
lovelacer
parents:
6553
diff
changeset
|
445 |
Gear^.dY:= Gear^.dY + cGravityf * Steps; |
3441 | 446 |
|
6580
6155187bf599
A partial reformatting of the pascal code to have consistent syntax. Things that are still inconsistent.
lovelacer
parents:
6553
diff
changeset
|
447 |
if round(Gear^.Y) > cWaterLine then |
6155187bf599
A partial reformatting of the pascal code to have consistent syntax. Things that are still inconsistent.
lovelacer
parents:
6553
diff
changeset
|
448 |
begin |
3441 | 449 |
DeleteVisualGear(Gear); |
450 |
PlaySound(TSound(ord(sndDroplet1) + Random(3))); |
|
451 |
end; |
|
452 |
end; |
|
453 |
||
454 |
//////////////////////////////////////////////////////////////////////////////// |
|
455 |
procedure doStepSmokeRing(Gear: PVisualGear; Steps: Longword); |
|
456 |
begin |
|
457 |
inc(Gear^.Timer, Steps); |
|
6580
6155187bf599
A partial reformatting of the pascal code to have consistent syntax. Things that are still inconsistent.
lovelacer
parents:
6553
diff
changeset
|
458 |
if Gear^.Timer >= Gear^.FrameTicks then |
6155187bf599
A partial reformatting of the pascal code to have consistent syntax. Things that are still inconsistent.
lovelacer
parents:
6553
diff
changeset
|
459 |
DeleteVisualGear(Gear) |
3441 | 460 |
else |
461 |
begin |
|
462 |
Gear^.scale := 1.25 * (-power(2, -10 * Int(Gear^.Timer)/Gear^.FrameTicks) + 1) + 0.4; |
|
463 |
Gear^.alpha := 1 - power(Gear^.Timer / 350, 4); |
|
6580
6155187bf599
A partial reformatting of the pascal code to have consistent syntax. Things that are still inconsistent.
lovelacer
parents:
6553
diff
changeset
|
464 |
if Gear^.alpha < 0 then |
6155187bf599
A partial reformatting of the pascal code to have consistent syntax. Things that are still inconsistent.
lovelacer
parents:
6553
diff
changeset
|
465 |
Gear^.alpha:= 0; |
3441 | 466 |
end; |
467 |
end; |
|
468 |
||
469 |
//////////////////////////////////////////////////////////////////////////////// |
|
470 |
procedure doStepFeather(Gear: PVisualGear; Steps: Longword); |
|
471 |
begin |
|
472 |
Gear^.X:= Gear^.X + Gear^.dX * Steps; |
|
473 |
||
474 |
Gear^.Y:= Gear^.Y + Gear^.dY * Steps; |
|
3593
ae50f63e4fa9
Remove hwFloat from VisualGears - they don't need the precision for syncing purposes, and it saves a whole lot of operations.
nemo
parents:
3592
diff
changeset
|
475 |
Gear^.dY:= Gear^.dY + cGravityf * Steps; |
3441 | 476 |
|
477 |
Gear^.Angle:= round(Gear^.Angle + Steps) mod cMaxAngle; |
|
478 |
||
479 |
if Gear^.FrameTicks <= Steps then |
|
480 |
DeleteVisualGear(Gear) |
|
481 |
else |
|
482 |
dec(Gear^.FrameTicks, Steps) |
|
483 |
end; |
|
484 |
||
485 |
//////////////////////////////////////////////////////////////////////////////// |
|
486 |
const cSorterWorkTime = 640; |
|
487 |
var thexchar: array[0..cMaxTeams] of |
|
488 |
record |
|
489 |
dy, ny, dw: LongInt; |
|
490 |
team: PTeam; |
|
491 |
SortFactor: QWord; |
|
9720
453a1c29b7e4
Animate hedgehogs healths inside team health bar. Proper animation for the case when max team health grows is lost though.
unc0rr
parents:
9656
diff
changeset
|
492 |
hdw: array[0..cMaxHHIndex] of LongInt; |
3441 | 493 |
end; |
494 |
currsorter: PVisualGear = nil; |
|
495 |
||
9720
453a1c29b7e4
Animate hedgehogs healths inside team health bar. Proper animation for the case when max team health grows is lost though.
unc0rr
parents:
9656
diff
changeset
|
496 |
function isSorterActive: boolean; inline; |
453a1c29b7e4
Animate hedgehogs healths inside team health bar. Proper animation for the case when max team health grows is lost though.
unc0rr
parents:
9656
diff
changeset
|
497 |
begin |
453a1c29b7e4
Animate hedgehogs healths inside team health bar. Proper animation for the case when max team health grows is lost though.
unc0rr
parents:
9656
diff
changeset
|
498 |
isSorterActive:= currsorter <> nil |
453a1c29b7e4
Animate hedgehogs healths inside team health bar. Proper animation for the case when max team health grows is lost though.
unc0rr
parents:
9656
diff
changeset
|
499 |
end; |
453a1c29b7e4
Animate hedgehogs healths inside team health bar. Proper animation for the case when max team health grows is lost though.
unc0rr
parents:
9656
diff
changeset
|
500 |
|
3441 | 501 |
procedure doStepTeamHealthSorterWork(Gear: PVisualGear; Steps: Longword); |
9720
453a1c29b7e4
Animate hedgehogs healths inside team health bar. Proper animation for the case when max team health grows is lost though.
unc0rr
parents:
9656
diff
changeset
|
502 |
var i, t, h: LongInt; |
3441 | 503 |
begin |
7644 | 504 |
for t:= 1 to min(Steps, Gear^.Timer) do |
3441 | 505 |
begin |
506 |
dec(Gear^.Timer); |
|
507 |
if (Gear^.Timer and 15) = 0 then |
|
508 |
for i:= 0 to Pred(TeamsCount) do |
|
509 |
with thexchar[i] do |
|
510 |
begin |
|
511 |
{$WARNINGS OFF} |
|
7644 | 512 |
team^.DrawHealthY:= ny + dy * LongInt(Gear^.Timer) div cSorterWorkTime; |
9720
453a1c29b7e4
Animate hedgehogs healths inside team health bar. Proper animation for the case when max team health grows is lost though.
unc0rr
parents:
9656
diff
changeset
|
513 |
team^.TeamHealthBarHealth:= team^.TeamHealth + dw * LongInt(Gear^.Timer) div cSorterWorkTime; |
453a1c29b7e4
Animate hedgehogs healths inside team health bar. Proper animation for the case when max team health grows is lost though.
unc0rr
parents:
9656
diff
changeset
|
514 |
|
453a1c29b7e4
Animate hedgehogs healths inside team health bar. Proper animation for the case when max team health grows is lost though.
unc0rr
parents:
9656
diff
changeset
|
515 |
for h:= 0 to cMaxHHIndex do |
453a1c29b7e4
Animate hedgehogs healths inside team health bar. Proper animation for the case when max team health grows is lost though.
unc0rr
parents:
9656
diff
changeset
|
516 |
if (team^.Hedgehogs[h].Gear <> nil) then |
453a1c29b7e4
Animate hedgehogs healths inside team health bar. Proper animation for the case when max team health grows is lost though.
unc0rr
parents:
9656
diff
changeset
|
517 |
team^.Hedgehogs[h].HealthBarHealth:= team^.Hedgehogs[h].Gear^.Health + hdw[h] * LongInt(Gear^.Timer) div cSorterWorkTime |
453a1c29b7e4
Animate hedgehogs healths inside team health bar. Proper animation for the case when max team health grows is lost though.
unc0rr
parents:
9656
diff
changeset
|
518 |
else |
453a1c29b7e4
Animate hedgehogs healths inside team health bar. Proper animation for the case when max team health grows is lost though.
unc0rr
parents:
9656
diff
changeset
|
519 |
team^.Hedgehogs[h].HealthBarHealth:= hdw[h] * LongInt(Gear^.Timer) div cSorterWorkTime; |
3441 | 520 |
{$WARNINGS ON} |
521 |
end; |
|
7644 | 522 |
end; |
3441 | 523 |
|
7644 | 524 |
if (Gear^.Timer = 0) or (currsorter <> Gear) then |
525 |
begin |
|
526 |
if currsorter = Gear then |
|
527 |
currsorter:= nil; |
|
528 |
DeleteVisualGear(Gear); |
|
529 |
exit |
|
3441 | 530 |
end |
531 |
end; |
|
532 |
||
533 |
procedure doStepTeamHealthSorter(Gear: PVisualGear; Steps: Longword); |
|
534 |
var i: Longword; |
|
535 |
b: boolean; |
|
9720
453a1c29b7e4
Animate hedgehogs healths inside team health bar. Proper animation for the case when max team health grows is lost though.
unc0rr
parents:
9656
diff
changeset
|
536 |
t, h: LongInt; |
3441 | 537 |
begin |
8026
4a4f21070479
merge xymeng's gsoc engine with a few updates (and further checks on symbol definitions)
koda
parents:
7808
diff
changeset
|
538 |
{$IFNDEF PAS2C} |
3441 | 539 |
Steps:= Steps; // avoid compiler hint |
8026
4a4f21070479
merge xymeng's gsoc engine with a few updates (and further checks on symbol definitions)
koda
parents:
7808
diff
changeset
|
540 |
{$ENDIF} |
7644 | 541 |
|
3441 | 542 |
for t:= 0 to Pred(TeamsCount) do |
543 |
with thexchar[t] do |
|
544 |
begin |
|
545 |
team:= TeamsArray[t]; |
|
7644 | 546 |
dy:= team^.DrawHealthY; |
9720
453a1c29b7e4
Animate hedgehogs healths inside team health bar. Proper animation for the case when max team health grows is lost though.
unc0rr
parents:
9656
diff
changeset
|
547 |
dw:= team^.TeamHealthBarHealth - team^.TeamHealth; |
7644 | 548 |
if team^.TeamHealth > 0 then |
549 |
begin |
|
550 |
SortFactor:= team^.Clan^.ClanHealth; |
|
551 |
SortFactor:= (SortFactor shl 3) + team^.Clan^.ClanIndex; |
|
552 |
SortFactor:= (SortFactor shl 30) + team^.TeamHealth; |
|
553 |
end |
|
554 |
else |
|
555 |
SortFactor:= 0; |
|
9720
453a1c29b7e4
Animate hedgehogs healths inside team health bar. Proper animation for the case when max team health grows is lost though.
unc0rr
parents:
9656
diff
changeset
|
556 |
|
453a1c29b7e4
Animate hedgehogs healths inside team health bar. Proper animation for the case when max team health grows is lost though.
unc0rr
parents:
9656
diff
changeset
|
557 |
for h:= 0 to cMaxHHIndex do |
453a1c29b7e4
Animate hedgehogs healths inside team health bar. Proper animation for the case when max team health grows is lost though.
unc0rr
parents:
9656
diff
changeset
|
558 |
if (team^.Hedgehogs[h].Gear <> nil) then |
453a1c29b7e4
Animate hedgehogs healths inside team health bar. Proper animation for the case when max team health grows is lost though.
unc0rr
parents:
9656
diff
changeset
|
559 |
hdw[h]:= team^.Hedgehogs[h].HealthBarHealth - team^.Hedgehogs[h].Gear^.Health |
453a1c29b7e4
Animate hedgehogs healths inside team health bar. Proper animation for the case when max team health grows is lost though.
unc0rr
parents:
9656
diff
changeset
|
560 |
else |
453a1c29b7e4
Animate hedgehogs healths inside team health bar. Proper animation for the case when max team health grows is lost though.
unc0rr
parents:
9656
diff
changeset
|
561 |
hdw[h]:= team^.Hedgehogs[h].HealthBarHealth; |
3441 | 562 |
end; |
563 |
||
564 |
if TeamsCount > 1 then |
|
565 |
repeat |
|
566 |
b:= true; |
|
567 |
for t:= 0 to TeamsCount - 2 do |
|
568 |
if (thexchar[t].SortFactor > thexchar[Succ(t)].SortFactor) then |
|
569 |
begin |
|
570 |
thexchar[cMaxTeams]:= thexchar[t]; |
|
571 |
thexchar[t]:= thexchar[Succ(t)]; |
|
572 |
thexchar[Succ(t)]:= thexchar[cMaxTeams]; |
|
573 |
b:= false |
|
574 |
end |
|
575 |
until b; |
|
576 |
||
577 |
t:= - 4; |
|
578 |
for i:= 0 to Pred(TeamsCount) do |
|
7644 | 579 |
with thexchar[i] do |
580 |
if team^.TeamHealth > 0 then |
|
581 |
begin |
|
9656 | 582 |
dec(t, team^.Clan^.HealthTex^.h + 2); |
7644 | 583 |
ny:= t; |
584 |
dy:= dy - ny |
|
585 |
end; |
|
3441 | 586 |
|
587 |
Gear^.Timer:= cSorterWorkTime; |
|
588 |
Gear^.doStep:= @doStepTeamHealthSorterWork; |
|
589 |
currsorter:= Gear; |
|
590 |
//doStepTeamHealthSorterWork(Gear, Steps) |
|
591 |
end; |
|
592 |
||
593 |
//////////////////////////////////////////////////////////////////////////////// |
|
594 |
procedure doStepSpeechBubbleWork(Gear: PVisualGear; Steps: Longword); |
|
10193
d7cd5b43588f
By request. Allow lua to make random things "talk". I'm not sure if this is a good idea, buuuut.
nemo
parents:
10124
diff
changeset
|
595 |
var realgear: PGear; |
3441 | 596 |
begin |
597 |
if Gear^.Timer > Steps then dec(Gear^.Timer, Steps) else Gear^.Timer:= 0; |
|
10193
d7cd5b43588f
By request. Allow lua to make random things "talk". I'm not sure if this is a good idea, buuuut.
nemo
parents:
10124
diff
changeset
|
598 |
realgear:= nil; |
d7cd5b43588f
By request. Allow lua to make random things "talk". I'm not sure if this is a good idea, buuuut.
nemo
parents:
10124
diff
changeset
|
599 |
if Gear^.Frame <> 0 then // use a non-hedgehog gear - a lua trick that hopefully won't be overused |
d7cd5b43588f
By request. Allow lua to make random things "talk". I'm not sure if this is a good idea, buuuut.
nemo
parents:
10124
diff
changeset
|
600 |
begin |
d7cd5b43588f
By request. Allow lua to make random things "talk". I'm not sure if this is a good idea, buuuut.
nemo
parents:
10124
diff
changeset
|
601 |
realgear:= GearByUID(Gear^.Frame); |
d7cd5b43588f
By request. Allow lua to make random things "talk". I'm not sure if this is a good idea, buuuut.
nemo
parents:
10124
diff
changeset
|
602 |
if realgear <> nil then |
d7cd5b43588f
By request. Allow lua to make random things "talk". I'm not sure if this is a good idea, buuuut.
nemo
parents:
10124
diff
changeset
|
603 |
begin |
d7cd5b43588f
By request. Allow lua to make random things "talk". I'm not sure if this is a good idea, buuuut.
nemo
parents:
10124
diff
changeset
|
604 |
Gear^.X:= hwFloat2Float(realgear^.X) + (Gear^.Tex^.w div 2 - Gear^.Tag); |
d7cd5b43588f
By request. Allow lua to make random things "talk". I'm not sure if this is a good idea, buuuut.
nemo
parents:
10124
diff
changeset
|
605 |
Gear^.Y:= hwFloat2Float(realgear^.Y) - (realgear^.Radius + Gear^.Tex^.h); |
d7cd5b43588f
By request. Allow lua to make random things "talk". I'm not sure if this is a good idea, buuuut.
nemo
parents:
10124
diff
changeset
|
606 |
end |
d7cd5b43588f
By request. Allow lua to make random things "talk". I'm not sure if this is a good idea, buuuut.
nemo
parents:
10124
diff
changeset
|
607 |
end |
d7cd5b43588f
By request. Allow lua to make random things "talk". I'm not sure if this is a good idea, buuuut.
nemo
parents:
10124
diff
changeset
|
608 |
else if Gear^.Hedgehog^.Gear <> nil then |
3441 | 609 |
begin |
9763 | 610 |
Gear^.X:= hwFloat2Float(Gear^.Hedgehog^.Gear^.X) + (Gear^.Tex^.w div 2 - Gear^.Tag); |
10193
d7cd5b43588f
By request. Allow lua to make random things "talk". I'm not sure if this is a good idea, buuuut.
nemo
parents:
10124
diff
changeset
|
611 |
Gear^.Y:= hwFloat2Float(Gear^.Hedgehog^.Gear^.Y) - (cHHRadius + Gear^.Tex^.h); |
3441 | 612 |
end; |
613 |
||
10193
d7cd5b43588f
By request. Allow lua to make random things "talk". I'm not sure if this is a good idea, buuuut.
nemo
parents:
10124
diff
changeset
|
614 |
if (Gear^.Timer = 0) or ((realgear = nil) and (Gear^.Frame <> 0)) then |
3441 | 615 |
begin |
10193
d7cd5b43588f
By request. Allow lua to make random things "talk". I'm not sure if this is a good idea, buuuut.
nemo
parents:
10124
diff
changeset
|
616 |
if (Gear^.Hedgehog <> nil) and (Gear^.Hedgehog^.SpeechGear = Gear) then |
4365 | 617 |
Gear^.Hedgehog^.SpeechGear:= nil; |
3441 | 618 |
DeleteVisualGear(Gear) |
619 |
end; |
|
620 |
end; |
|
621 |
||
622 |
procedure doStepSpeechBubble(Gear: PVisualGear; Steps: Longword); |
|
10193
d7cd5b43588f
By request. Allow lua to make random things "talk". I'm not sure if this is a good idea, buuuut.
nemo
parents:
10124
diff
changeset
|
623 |
var realgear: PGear; |
3441 | 624 |
begin |
8026
4a4f21070479
merge xymeng's gsoc engine with a few updates (and further checks on symbol definitions)
koda
parents:
7808
diff
changeset
|
625 |
|
4a4f21070479
merge xymeng's gsoc engine with a few updates (and further checks on symbol definitions)
koda
parents:
7808
diff
changeset
|
626 |
{$IFNDEF PAS2C} |
3441 | 627 |
Steps:= Steps; // avoid compiler hint |
8026
4a4f21070479
merge xymeng's gsoc engine with a few updates (and further checks on symbol definitions)
koda
parents:
7808
diff
changeset
|
628 |
{$ENDIF} |
10193
d7cd5b43588f
By request. Allow lua to make random things "talk". I'm not sure if this is a good idea, buuuut.
nemo
parents:
10124
diff
changeset
|
629 |
if Gear^.Frame <> 0 then |
d7cd5b43588f
By request. Allow lua to make random things "talk". I'm not sure if this is a good idea, buuuut.
nemo
parents:
10124
diff
changeset
|
630 |
realgear:= GearByUID(Gear^.FrameTicks) |
d7cd5b43588f
By request. Allow lua to make random things "talk". I'm not sure if this is a good idea, buuuut.
nemo
parents:
10124
diff
changeset
|
631 |
else |
d7cd5b43588f
By request. Allow lua to make random things "talk". I'm not sure if this is a good idea, buuuut.
nemo
parents:
10124
diff
changeset
|
632 |
begin |
d7cd5b43588f
By request. Allow lua to make random things "talk". I'm not sure if this is a good idea, buuuut.
nemo
parents:
10124
diff
changeset
|
633 |
with Gear^.Hedgehog^ do |
d7cd5b43588f
By request. Allow lua to make random things "talk". I'm not sure if this is a good idea, buuuut.
nemo
parents:
10124
diff
changeset
|
634 |
if SpeechGear <> nil then |
d7cd5b43588f
By request. Allow lua to make random things "talk". I'm not sure if this is a good idea, buuuut.
nemo
parents:
10124
diff
changeset
|
635 |
SpeechGear^.Timer:= 0; |
d7cd5b43588f
By request. Allow lua to make random things "talk". I'm not sure if this is a good idea, buuuut.
nemo
parents:
10124
diff
changeset
|
636 |
realgear:= Gear^.Hedgehog^.Gear; |
d7cd5b43588f
By request. Allow lua to make random things "talk". I'm not sure if this is a good idea, buuuut.
nemo
parents:
10124
diff
changeset
|
637 |
Gear^.Hedgehog^.SpeechGear:= Gear; |
d7cd5b43588f
By request. Allow lua to make random things "talk". I'm not sure if this is a good idea, buuuut.
nemo
parents:
10124
diff
changeset
|
638 |
end; |
3441 | 639 |
|
10193
d7cd5b43588f
By request. Allow lua to make random things "talk". I'm not sure if this is a good idea, buuuut.
nemo
parents:
10124
diff
changeset
|
640 |
if realgear <> nil then |
d7cd5b43588f
By request. Allow lua to make random things "talk". I'm not sure if this is a good idea, buuuut.
nemo
parents:
10124
diff
changeset
|
641 |
case Gear^.FrameTicks of |
d7cd5b43588f
By request. Allow lua to make random things "talk". I'm not sure if this is a good idea, buuuut.
nemo
parents:
10124
diff
changeset
|
642 |
1: Gear^.Tag:= SpritesData[sprSpeechTail].Width-37+realgear^.Radius; |
d7cd5b43588f
By request. Allow lua to make random things "talk". I'm not sure if this is a good idea, buuuut.
nemo
parents:
10124
diff
changeset
|
643 |
2: Gear^.Tag:= SpritesData[sprThoughtTail].Width-29+realgear^.Radius; |
d7cd5b43588f
By request. Allow lua to make random things "talk". I'm not sure if this is a good idea, buuuut.
nemo
parents:
10124
diff
changeset
|
644 |
3: Gear^.Tag:= SpritesData[sprShoutTail].Width-19+realgear^.Radius; |
d7cd5b43588f
By request. Allow lua to make random things "talk". I'm not sure if this is a good idea, buuuut.
nemo
parents:
10124
diff
changeset
|
645 |
end; |
3441 | 646 |
|
5186 | 647 |
Gear^.Timer:= max(LongInt(Length(Gear^.Text)) * 150, 3000); |
10124
aabd1b75d5a3
Even more explicit type conversions and other stuff to help pas2c use ansistrings
unc0rr
parents:
10108
diff
changeset
|
648 |
Gear^.Tex:= RenderSpeechBubbleTex(ansistring(Gear^.Text), Gear^.FrameTicks, fnt16); |
3441 | 649 |
|
650 |
Gear^.doStep:= @doStepSpeechBubbleWork; |
|
651 |
||
4379
6cd6b77df8b8
No need for Extended data type just to draw some visual gears. It's a shame we have Math unit dependency
unC0Rr
parents:
4365
diff
changeset
|
652 |
Gear^.Y:= Gear^.Y - Gear^.Tex^.h |
3441 | 653 |
end; |
654 |
||
655 |
//////////////////////////////////////////////////////////////////////////////// |
|
656 |
procedure doStepHealthTagWork(Gear: PVisualGear; Steps: Longword); |
|
657 |
begin |
|
658 |
if Steps > Gear^.Timer then |
|
3459
c552aa44108d
hey sheepluva, how about just this? lets you have an anonymous one too.
nemo
parents:
3443
diff
changeset
|
659 |
DeleteVisualGear(Gear) |
3441 | 660 |
else |
661 |
begin |
|
662 |
dec(Gear^.Timer, Steps); |
|
663 |
Gear^.Y:= Gear^.Y + Gear^.dY * Steps; |
|
5581 | 664 |
Gear^.X:= Gear^.X + Gear^.dX * Steps |
3441 | 665 |
end; |
666 |
end; |
|
667 |
||
668 |
procedure doStepHealthTagWorkUnderWater(Gear: PVisualGear; Steps: Longword); |
|
669 |
begin |
|
4161 | 670 |
if round(Gear^.Y) - 10 < cWaterLine then |
3441 | 671 |
DeleteVisualGear(Gear) |
672 |
else |
|
3593
ae50f63e4fa9
Remove hwFloat from VisualGears - they don't need the precision for syncing purposes, and it saves a whole lot of operations.
nemo
parents:
3592
diff
changeset
|
673 |
Gear^.Y:= Gear^.Y - 0.08 * Steps; |
3441 | 674 |
|
675 |
end; |
|
676 |
||
677 |
procedure doStepHealthTag(Gear: PVisualGear; Steps: Longword); |
|
678 |
var s: shortstring; |
|
679 |
begin |
|
680 |
s:= ''; |
|
681 |
||
682 |
str(Gear^.State, s); |
|
3459
c552aa44108d
hey sheepluva, how about just this? lets you have an anonymous one too.
nemo
parents:
3443
diff
changeset
|
683 |
if Gear^.Hedgehog <> nil then |
10124
aabd1b75d5a3
Even more explicit type conversions and other stuff to help pas2c use ansistrings
unc0rr
parents:
10108
diff
changeset
|
684 |
Gear^.Tex:= RenderStringTex(ansistring(s), Gear^.Hedgehog^.Team^.Clan^.Color, fnt16) |
3459
c552aa44108d
hey sheepluva, how about just this? lets you have an anonymous one too.
nemo
parents:
3443
diff
changeset
|
685 |
else |
10124
aabd1b75d5a3
Even more explicit type conversions and other stuff to help pas2c use ansistrings
unc0rr
parents:
10108
diff
changeset
|
686 |
Gear^.Tex:= RenderStringTex(ansistring(s), cWhiteColor, fnt16); |
3441 | 687 |
|
5578 | 688 |
Gear^.doStep:= @doStepHealthTagWork; |
5576 | 689 |
|
5596 | 690 |
if (round(Gear^.Y) > cWaterLine) and (Gear^.Frame = 0) then |
3441 | 691 |
Gear^.doStep:= @doStepHealthTagWorkUnderWater; |
692 |
||
4379
6cd6b77df8b8
No need for Extended data type just to draw some visual gears. It's a shame we have Math unit dependency
unC0Rr
parents:
4365
diff
changeset
|
693 |
Gear^.Y:= Gear^.Y - Gear^.Tex^.h; |
3441 | 694 |
|
6580
6155187bf599
A partial reformatting of the pascal code to have consistent syntax. Things that are still inconsistent.
lovelacer
parents:
6553
diff
changeset
|
695 |
if Steps > 1 then |
6155187bf599
A partial reformatting of the pascal code to have consistent syntax. Things that are still inconsistent.
lovelacer
parents:
6553
diff
changeset
|
696 |
Gear^.doStep(Gear, Steps-1); |
3441 | 697 |
end; |
698 |
||
699 |
//////////////////////////////////////////////////////////////////////////////// |
|
700 |
procedure doStepSmokeTrace(Gear: PVisualGear; Steps: Longword); |
|
701 |
begin |
|
702 |
inc(Gear^.Timer, Steps ); |
|
703 |
if Gear^.Timer > 64 then |
|
704 |
begin |
|
3995
360332f8785f
SmokeTrace: animation got aborted before last animation frame was displayed
sheepluva
parents:
3994
diff
changeset
|
705 |
if Gear^.State = 0 then |
6580
6155187bf599
A partial reformatting of the pascal code to have consistent syntax. Things that are still inconsistent.
lovelacer
parents:
6553
diff
changeset
|
706 |
begin |
6155187bf599
A partial reformatting of the pascal code to have consistent syntax. Things that are still inconsistent.
lovelacer
parents:
6553
diff
changeset
|
707 |
DeleteVisualGear(Gear); |
6155187bf599
A partial reformatting of the pascal code to have consistent syntax. Things that are still inconsistent.
lovelacer
parents:
6553
diff
changeset
|
708 |
exit; |
6155187bf599
A partial reformatting of the pascal code to have consistent syntax. Things that are still inconsistent.
lovelacer
parents:
6553
diff
changeset
|
709 |
end; |
3441 | 710 |
dec(Gear^.State, Gear^.Timer div 65); |
711 |
Gear^.Timer:= Gear^.Timer mod 65; |
|
712 |
end; |
|
3593
ae50f63e4fa9
Remove hwFloat from VisualGears - they don't need the precision for syncing purposes, and it saves a whole lot of operations.
nemo
parents:
3592
diff
changeset
|
713 |
Gear^.dX:= Gear^.dX + cWindSpeedf * Steps; |
3587 | 714 |
Gear^.X:= Gear^.X + Gear^.dX; |
3441 | 715 |
end; |
716 |
||
717 |
//////////////////////////////////////////////////////////////////////////////// |
|
718 |
procedure doStepExplosionWork(Gear: PVisualGear; Steps: Longword); |
|
719 |
begin |
|
720 |
inc(Gear^.Timer, Steps); |
|
721 |
if Gear^.Timer > 75 then |
|
722 |
begin |
|
723 |
inc(Gear^.State, Gear^.Timer div 76); |
|
724 |
Gear^.Timer:= Gear^.Timer mod 76; |
|
6580
6155187bf599
A partial reformatting of the pascal code to have consistent syntax. Things that are still inconsistent.
lovelacer
parents:
6553
diff
changeset
|
725 |
if Gear^.State > 5 then |
6155187bf599
A partial reformatting of the pascal code to have consistent syntax. Things that are still inconsistent.
lovelacer
parents:
6553
diff
changeset
|
726 |
DeleteVisualGear(Gear); |
3441 | 727 |
end; |
728 |
end; |
|
729 |
||
730 |
procedure doStepExplosion(Gear: PVisualGear; Steps: Longword); |
|
731 |
var i: LongWord; |
|
4473 | 732 |
gX,gY: LongInt; |
733 |
vg: PVisualGear; |
|
3441 | 734 |
begin |
3593
ae50f63e4fa9
Remove hwFloat from VisualGears - they don't need the precision for syncing purposes, and it saves a whole lot of operations.
nemo
parents:
3592
diff
changeset
|
735 |
gX:= round(Gear^.X); |
ae50f63e4fa9
Remove hwFloat from VisualGears - they don't need the precision for syncing purposes, and it saves a whole lot of operations.
nemo
parents:
3592
diff
changeset
|
736 |
gY:= round(Gear^.Y); |
8330 | 737 |
for i:= 0 to 31 do |
4473 | 738 |
begin |
739 |
vg:= AddVisualGear(gX, gY, vgtFire); |
|
8330 | 740 |
if vg <> nil then |
4475
54e78c40970b
rendering optimisations. remove the recursive flames in explosions (might need more due to the gravity change in the new flames) but more usefully, eliminate a number of redundant Tint calls
nemo
parents:
4473
diff
changeset
|
741 |
begin |
54e78c40970b
rendering optimisations. remove the recursive flames in explosions (might need more due to the gravity change in the new flames) but more usefully, eliminate a number of redundant Tint calls
nemo
parents:
4473
diff
changeset
|
742 |
vg^.State:= gstTmpFlag; |
54e78c40970b
rendering optimisations. remove the recursive flames in explosions (might need more due to the gravity change in the new flames) but more usefully, eliminate a number of redundant Tint calls
nemo
parents:
4473
diff
changeset
|
743 |
inc(vg^.FrameTicks, vg^.FrameTicks) |
54e78c40970b
rendering optimisations. remove the recursive flames in explosions (might need more due to the gravity change in the new flames) but more usefully, eliminate a number of redundant Tint calls
nemo
parents:
4473
diff
changeset
|
744 |
end |
4473 | 745 |
end; |
3590 | 746 |
for i:= 0 to 8 do AddVisualGear(gX, gY, vgtExplPart); |
747 |
for i:= 0 to 8 do AddVisualGear(gX, gY, vgtExplPart2); |
|
3441 | 748 |
Gear^.doStep:= @doStepExplosionWork; |
6580
6155187bf599
A partial reformatting of the pascal code to have consistent syntax. Things that are still inconsistent.
lovelacer
parents:
6553
diff
changeset
|
749 |
if Steps > 1 then |
6155187bf599
A partial reformatting of the pascal code to have consistent syntax. Things that are still inconsistent.
lovelacer
parents:
6553
diff
changeset
|
750 |
Gear^.doStep(Gear, Steps-1); |
3441 | 751 |
end; |
752 |
||
753 |
||
754 |
//////////////////////////////////////////////////////////////////////////////// |
|
755 |
procedure doStepBigExplosionWork(Gear: PVisualGear; Steps: Longword); |
|
5855
74c621e12baa
I do believe the only thing that was *ever* wrong with camera shake was someone decided to use getRandom on something that had always been a visual effect anyway. Pretty sure WorldDx is in fact safe to modify.
nemo
parents:
5840
diff
changeset
|
756 |
var maxMovement: LongInt; |
3441 | 757 |
begin |
758 |
||
759 |
inc(Gear^.Timer, Steps); |
|
760 |
if (Gear^.Timer and 5) = 0 then |
|
761 |
begin |
|
762 |
maxMovement := max(1, 13 - ((Gear^.Timer * 15) div 250)); |
|
763 |
ShakeCamera(maxMovement); |
|
764 |
end; |
|
5804
98192121dc69
Since shakes are still proving unsafe until camera is reworked, try a mild flash instead
nemo
parents:
5803
diff
changeset
|
765 |
|
6580
6155187bf599
A partial reformatting of the pascal code to have consistent syntax. Things that are still inconsistent.
lovelacer
parents:
6553
diff
changeset
|
766 |
if Gear^.Timer > 250 then |
6155187bf599
A partial reformatting of the pascal code to have consistent syntax. Things that are still inconsistent.
lovelacer
parents:
6553
diff
changeset
|
767 |
DeleteVisualGear(Gear); |
3441 | 768 |
end; |
769 |
||
770 |
procedure doStepBigExplosion(Gear: PVisualGear; Steps: Longword); |
|
771 |
var i: LongWord; |
|
4473 | 772 |
gX,gY: LongInt; |
773 |
vg: PVisualGear; |
|
3441 | 774 |
begin |
5855
74c621e12baa
I do believe the only thing that was *ever* wrong with camera shake was someone decided to use getRandom on something that had always been a visual effect anyway. Pretty sure WorldDx is in fact safe to modify.
nemo
parents:
5840
diff
changeset
|
775 |
//ScreenFade:= sfFromWhite; |
74c621e12baa
I do believe the only thing that was *ever* wrong with camera shake was someone decided to use getRandom on something that had always been a visual effect anyway. Pretty sure WorldDx is in fact safe to modify.
nemo
parents:
5840
diff
changeset
|
776 |
//ScreenFadeValue:= round(60 * zoom * zoom); |
74c621e12baa
I do believe the only thing that was *ever* wrong with camera shake was someone decided to use getRandom on something that had always been a visual effect anyway. Pretty sure WorldDx is in fact safe to modify.
nemo
parents:
5840
diff
changeset
|
777 |
//ScreenFadeSpeed:= 5; |
3593
ae50f63e4fa9
Remove hwFloat from VisualGears - they don't need the precision for syncing purposes, and it saves a whole lot of operations.
nemo
parents:
3592
diff
changeset
|
778 |
gX:= round(Gear^.X); |
ae50f63e4fa9
Remove hwFloat from VisualGears - they don't need the precision for syncing purposes, and it saves a whole lot of operations.
nemo
parents:
3592
diff
changeset
|
779 |
gY:= round(Gear^.Y); |
3441 | 780 |
AddVisualGear(gX, gY, vgtSmokeRing); |
8330 | 781 |
for i:= 0 to 46 do |
4473 | 782 |
begin |
783 |
vg:= AddVisualGear(gX, gY, vgtFire); |
|
8330 | 784 |
if vg <> nil then |
4475
54e78c40970b
rendering optimisations. remove the recursive flames in explosions (might need more due to the gravity change in the new flames) but more usefully, eliminate a number of redundant Tint calls
nemo
parents:
4473
diff
changeset
|
785 |
begin |
54e78c40970b
rendering optimisations. remove the recursive flames in explosions (might need more due to the gravity change in the new flames) but more usefully, eliminate a number of redundant Tint calls
nemo
parents:
4473
diff
changeset
|
786 |
vg^.State:= gstTmpFlag; |
54e78c40970b
rendering optimisations. remove the recursive flames in explosions (might need more due to the gravity change in the new flames) but more usefully, eliminate a number of redundant Tint calls
nemo
parents:
4473
diff
changeset
|
787 |
inc(vg^.FrameTicks, vg^.FrameTicks) |
54e78c40970b
rendering optimisations. remove the recursive flames in explosions (might need more due to the gravity change in the new flames) but more usefully, eliminate a number of redundant Tint calls
nemo
parents:
4473
diff
changeset
|
788 |
end |
4473 | 789 |
end; |
6580
6155187bf599
A partial reformatting of the pascal code to have consistent syntax. Things that are still inconsistent.
lovelacer
parents:
6553
diff
changeset
|
790 |
for i:= 0 to 15 do |
6155187bf599
A partial reformatting of the pascal code to have consistent syntax. Things that are still inconsistent.
lovelacer
parents:
6553
diff
changeset
|
791 |
AddVisualGear(gX, gY, vgtExplPart); |
6155187bf599
A partial reformatting of the pascal code to have consistent syntax. Things that are still inconsistent.
lovelacer
parents:
6553
diff
changeset
|
792 |
for i:= 0 to 15 do |
6155187bf599
A partial reformatting of the pascal code to have consistent syntax. Things that are still inconsistent.
lovelacer
parents:
6553
diff
changeset
|
793 |
AddVisualGear(gX, gY, vgtExplPart2); |
3441 | 794 |
Gear^.doStep:= @doStepBigExplosionWork; |
6580
6155187bf599
A partial reformatting of the pascal code to have consistent syntax. Things that are still inconsistent.
lovelacer
parents:
6553
diff
changeset
|
795 |
if Steps > 1 then |
6155187bf599
A partial reformatting of the pascal code to have consistent syntax. Things that are still inconsistent.
lovelacer
parents:
6553
diff
changeset
|
796 |
Gear^.doStep(Gear, Steps-1); |
8446
c18ba8726f5a
Fix sources so pas2c written in haskell could render them again
unc0rr
parents:
8330
diff
changeset
|
797 |
|
c18ba8726f5a
Fix sources so pas2c written in haskell could render them again
unc0rr
parents:
8330
diff
changeset
|
798 |
{$IFNDEF PAS2C} |
8204 | 799 |
with mobileRecord do |
800 |
if (performRumble <> nil) and (not fastUntilLag) then |
|
801 |
performRumble(kSystemSoundID_Vibrate); |
|
8446
c18ba8726f5a
Fix sources so pas2c written in haskell could render them again
unc0rr
parents:
8330
diff
changeset
|
802 |
{$ENDIF} |
3441 | 803 |
end; |
3689 | 804 |
|
805 |
procedure doStepChunk(Gear: PVisualGear; Steps: Longword); |
|
806 |
begin |
|
807 |
Gear^.X:= Gear^.X + Gear^.dX * Steps; |
|
808 |
||
809 |
Gear^.Y:= Gear^.Y + Gear^.dY * Steps; |
|
810 |
Gear^.dY:= Gear^.dY + cGravityf * Steps; |
|
811 |
||
812 |
Gear^.Angle:= round(Gear^.Angle + Steps) mod cMaxAngle; |
|
813 |
||
5235
e30b06ffea3a
Skip droplets if plain splash is enabled, add a sanity check just in case.
nemo
parents:
5186
diff
changeset
|
814 |
if (round(Gear^.Y) > cWaterLine) and ((cReducedQuality and rqPlainSplash) = 0) then |
3689 | 815 |
begin |
3699 | 816 |
AddVisualGear(round(Gear^.X), round(Gear^.Y), vgtDroplet); |
3689 | 817 |
DeleteVisualGear(Gear); |
818 |
end |
|
819 |
end; |
|
4327 | 820 |
|
821 |
//////////////////////////////////////////////////////////////////////////////// |
|
822 |
procedure doStepBulletHit(Gear: PVisualGear; Steps: Longword); |
|
823 |
begin |
|
6580
6155187bf599
A partial reformatting of the pascal code to have consistent syntax. Things that are still inconsistent.
lovelacer
parents:
6553
diff
changeset
|
824 |
if Gear^.FrameTicks <= Steps then |
6155187bf599
A partial reformatting of the pascal code to have consistent syntax. Things that are still inconsistent.
lovelacer
parents:
6553
diff
changeset
|
825 |
DeleteVisualGear(Gear) |
6155187bf599
A partial reformatting of the pascal code to have consistent syntax. Things that are still inconsistent.
lovelacer
parents:
6553
diff
changeset
|
826 |
else |
6155187bf599
A partial reformatting of the pascal code to have consistent syntax. Things that are still inconsistent.
lovelacer
parents:
6553
diff
changeset
|
827 |
dec(Gear^.FrameTicks, Steps); |
4327 | 828 |
end; |
4420
6be946bcd17a
Add a visual gear for drawing circles. Intent is to allow specifying areas on map for lua scripts (such as to indicate a location to go to). Could also be used to, say, circle a hog in CTF. Also add a "Critical" flag for visual gears so a gear flagges as such will always be created.
nemo
parents:
4379
diff
changeset
|
829 |
|
6be946bcd17a
Add a visual gear for drawing circles. Intent is to allow specifying areas on map for lua scripts (such as to indicate a location to go to). Could also be used to, say, circle a hog in CTF. Also add a "Critical" flag for visual gears so a gear flagges as such will always be created.
nemo
parents:
4379
diff
changeset
|
830 |
//////////////////////////////////////////////////////////////////////////////// |
6be946bcd17a
Add a visual gear for drawing circles. Intent is to allow specifying areas on map for lua scripts (such as to indicate a location to go to). Could also be used to, say, circle a hog in CTF. Also add a "Critical" flag for visual gears so a gear flagges as such will always be created.
nemo
parents:
4379
diff
changeset
|
831 |
procedure doStepCircle(Gear: PVisualGear; Steps: Longword); |
4452 | 832 |
var tmp: LongInt; |
4421 | 833 |
i: LongWord; |
4420
6be946bcd17a
Add a visual gear for drawing circles. Intent is to allow specifying areas on map for lua scripts (such as to indicate a location to go to). Could also be used to, say, circle a hog in CTF. Also add a "Critical" flag for visual gears so a gear flagges as such will always be created.
nemo
parents:
4379
diff
changeset
|
834 |
begin |
6be946bcd17a
Add a visual gear for drawing circles. Intent is to allow specifying areas on map for lua scripts (such as to indicate a location to go to). Could also be used to, say, circle a hog in CTF. Also add a "Critical" flag for visual gears so a gear flagges as such will always be created.
nemo
parents:
4379
diff
changeset
|
835 |
with Gear^ do |
6be946bcd17a
Add a visual gear for drawing circles. Intent is to allow specifying areas on map for lua scripts (such as to indicate a location to go to). Could also be used to, say, circle a hog in CTF. Also add a "Critical" flag for visual gears so a gear flagges as such will always be created.
nemo
parents:
4379
diff
changeset
|
836 |
if Frame <> 0 then |
4421 | 837 |
for i:= 1 to Steps do |
4420
6be946bcd17a
Add a visual gear for drawing circles. Intent is to allow specifying areas on map for lua scripts (such as to indicate a location to go to). Could also be used to, say, circle a hog in CTF. Also add a "Critical" flag for visual gears so a gear flagges as such will always be created.
nemo
parents:
4379
diff
changeset
|
838 |
begin |
4421 | 839 |
inc(FrameTicks); |
840 |
if (FrameTicks mod Frame) = 0 then |
|
841 |
begin |
|
842 |
tmp:= Gear^.Tint and $FF; |
|
6580
6155187bf599
A partial reformatting of the pascal code to have consistent syntax. Things that are still inconsistent.
lovelacer
parents:
6553
diff
changeset
|
843 |
if tdY >= 0 then |
6155187bf599
A partial reformatting of the pascal code to have consistent syntax. Things that are still inconsistent.
lovelacer
parents:
6553
diff
changeset
|
844 |
inc(tmp) |
6155187bf599
A partial reformatting of the pascal code to have consistent syntax. Things that are still inconsistent.
lovelacer
parents:
6553
diff
changeset
|
845 |
else |
6155187bf599
A partial reformatting of the pascal code to have consistent syntax. Things that are still inconsistent.
lovelacer
parents:
6553
diff
changeset
|
846 |
dec(tmp); |
6155187bf599
A partial reformatting of the pascal code to have consistent syntax. Things that are still inconsistent.
lovelacer
parents:
6553
diff
changeset
|
847 |
if tmp < round(dX) then |
6155187bf599
A partial reformatting of the pascal code to have consistent syntax. Things that are still inconsistent.
lovelacer
parents:
6553
diff
changeset
|
848 |
tdY:= 1; |
6155187bf599
A partial reformatting of the pascal code to have consistent syntax. Things that are still inconsistent.
lovelacer
parents:
6553
diff
changeset
|
849 |
if tmp > round(dY) then |
6155187bf599
A partial reformatting of the pascal code to have consistent syntax. Things that are still inconsistent.
lovelacer
parents:
6553
diff
changeset
|
850 |
tdY:= -1; |
6155187bf599
A partial reformatting of the pascal code to have consistent syntax. Things that are still inconsistent.
lovelacer
parents:
6553
diff
changeset
|
851 |
if tmp > 255 then |
6155187bf599
A partial reformatting of the pascal code to have consistent syntax. Things that are still inconsistent.
lovelacer
parents:
6553
diff
changeset
|
852 |
tmp := 255; |
6155187bf599
A partial reformatting of the pascal code to have consistent syntax. Things that are still inconsistent.
lovelacer
parents:
6553
diff
changeset
|
853 |
if tmp < 0 then |
6155187bf599
A partial reformatting of the pascal code to have consistent syntax. Things that are still inconsistent.
lovelacer
parents:
6553
diff
changeset
|
854 |
tmp := 0; |
5179
8d64dcb566ea
Fix "Mixing signed expressions and longwords gives a 64bit result" warnings
unc0rr
parents:
5151
diff
changeset
|
855 |
Gear^.Tint:= (Gear^.Tint and $FFFFFF00) or Longword(tmp) |
4421 | 856 |
end |
4420
6be946bcd17a
Add a visual gear for drawing circles. Intent is to allow specifying areas on map for lua scripts (such as to indicate a location to go to). Could also be used to, say, circle a hog in CTF. Also add a "Critical" flag for visual gears so a gear flagges as such will always be created.
nemo
parents:
4379
diff
changeset
|
857 |
end |
6be946bcd17a
Add a visual gear for drawing circles. Intent is to allow specifying areas on map for lua scripts (such as to indicate a location to go to). Could also be used to, say, circle a hog in CTF. Also add a "Critical" flag for visual gears so a gear flagges as such will always be created.
nemo
parents:
4379
diff
changeset
|
858 |
end; |
5357
ec36f3d53f3c
Tiny optimization: convert smooth wind indicator change gear into visual gear
unc0rr
parents:
5236
diff
changeset
|
859 |
|
ec36f3d53f3c
Tiny optimization: convert smooth wind indicator change gear into visual gear
unc0rr
parents:
5236
diff
changeset
|
860 |
//////////////////////////////////////////////////////////////////////////////// |
ec36f3d53f3c
Tiny optimization: convert smooth wind indicator change gear into visual gear
unc0rr
parents:
5236
diff
changeset
|
861 |
procedure doStepSmoothWindBar(Gear: PVisualGear; Steps: Longword); |
ec36f3d53f3c
Tiny optimization: convert smooth wind indicator change gear into visual gear
unc0rr
parents:
5236
diff
changeset
|
862 |
begin |
6580
6155187bf599
A partial reformatting of the pascal code to have consistent syntax. Things that are still inconsistent.
lovelacer
parents:
6553
diff
changeset
|
863 |
inc(Gear^.Timer, Steps); |
8330 | 864 |
|
6913 | 865 |
while Gear^.Timer >= 10 do |
866 |
begin |
|
867 |
dec(Gear^.Timer, 10); |
|
868 |
if WindBarWidth < Gear^.Tag then |
|
869 |
inc(WindBarWidth) |
|
870 |
else if WindBarWidth > Gear^.Tag then |
|
871 |
dec(WindBarWidth); |
|
872 |
end; |
|
873 |
if cWindspeedf > Gear^.dAngle then |
|
874 |
begin |
|
875 |
cWindspeedf := cWindspeedf - Gear^.Angle*Steps; |
|
876 |
if cWindspeedf < Gear^.dAngle then cWindspeedf:= Gear^.dAngle; |
|
877 |
end |
|
878 |
else if cWindspeedf < Gear^.dAngle then |
|
879 |
begin |
|
880 |
cWindspeedf := cWindspeedf + Gear^.Angle*Steps; |
|
881 |
if cWindspeedf > Gear^.dAngle then cWindspeedf:= Gear^.dAngle; |
|
882 |
end; |
|
8330 | 883 |
|
884 |
if (WindBarWidth = Gear^.Tag) and (cWindspeedf = Gear^.dAngle) then |
|
5357
ec36f3d53f3c
Tiny optimization: convert smooth wind indicator change gear into visual gear
unc0rr
parents:
5236
diff
changeset
|
885 |
DeleteVisualGear(Gear) |
ec36f3d53f3c
Tiny optimization: convert smooth wind indicator change gear into visual gear
unc0rr
parents:
5236
diff
changeset
|
886 |
end; |
5562 | 887 |
//////////////////////////////////////////////////////////////////////////////// |
888 |
procedure doStepStraightShot(Gear: PVisualGear; Steps: Longword); |
|
889 |
begin |
|
890 |
Gear^.X:= Gear^.X + Gear^.dX * Steps; |
|
891 |
Gear^.Y:= Gear^.Y - Gear^.dY * Steps; |
|
5357
ec36f3d53f3c
Tiny optimization: convert smooth wind indicator change gear into visual gear
unc0rr
parents:
5236
diff
changeset
|
892 |
|
10526
b43d175d1577
Avoid promoting violence to hedgehogs. At least once a year.
nemo
parents:
10355
diff
changeset
|
893 |
Gear^.dY:= Gear^.dY + Gear^.tdY * Steps; |
b43d175d1577
Avoid promoting violence to hedgehogs. At least once a year.
nemo
parents:
10355
diff
changeset
|
894 |
Gear^.dX:= Gear^.dX + Gear^.tdX * Steps; |
b43d175d1577
Avoid promoting violence to hedgehogs. At least once a year.
nemo
parents:
10355
diff
changeset
|
895 |
|
5562 | 896 |
if Gear^.FrameTicks <= Steps then |
897 |
DeleteVisualGear(Gear) |
|
898 |
else |
|
899 |
begin |
|
900 |
dec(Gear^.FrameTicks, Steps); |
|
8330 | 901 |
if (Gear^.FrameTicks < 501) and (Gear^.FrameTicks mod 5 = 0) then |
5562 | 902 |
Gear^.Tint:= (Gear^.Tint and $FFFFFF00) or (((Gear^.Tint and $000000FF) * Gear^.FrameTicks) div 500) |
903 |
end |
|
904 |
end; |
|
905 |
||
10251
a3b42e81803c
collision indicator on failed girder placement (especially useful with rubberband I guess). still needs some tweaks but I am going to bed now :P
sheepluva
parents:
10193
diff
changeset
|
906 |
//////////////////////////////////////////////////////////////////////////////// |
a3b42e81803c
collision indicator on failed girder placement (especially useful with rubberband I guess). still needs some tweaks but I am going to bed now :P
sheepluva
parents:
10193
diff
changeset
|
907 |
procedure doStepNoPlaceWarn(Gear: PVisualGear; Steps: Longword); |
a3b42e81803c
collision indicator on failed girder placement (especially useful with rubberband I guess). still needs some tweaks but I am going to bed now :P
sheepluva
parents:
10193
diff
changeset
|
908 |
begin |
a3b42e81803c
collision indicator on failed girder placement (especially useful with rubberband I guess). still needs some tweaks but I am going to bed now :P
sheepluva
parents:
10193
diff
changeset
|
909 |
|
a3b42e81803c
collision indicator on failed girder placement (especially useful with rubberband I guess). still needs some tweaks but I am going to bed now :P
sheepluva
parents:
10193
diff
changeset
|
910 |
if Gear^.FrameTicks <= Steps then |
a3b42e81803c
collision indicator on failed girder placement (especially useful with rubberband I guess). still needs some tweaks but I am going to bed now :P
sheepluva
parents:
10193
diff
changeset
|
911 |
DeleteVisualGear(Gear) |
a3b42e81803c
collision indicator on failed girder placement (especially useful with rubberband I guess). still needs some tweaks but I am going to bed now :P
sheepluva
parents:
10193
diff
changeset
|
912 |
else |
a3b42e81803c
collision indicator on failed girder placement (especially useful with rubberband I guess). still needs some tweaks but I am going to bed now :P
sheepluva
parents:
10193
diff
changeset
|
913 |
begin |
a3b42e81803c
collision indicator on failed girder placement (especially useful with rubberband I guess). still needs some tweaks but I am going to bed now :P
sheepluva
parents:
10193
diff
changeset
|
914 |
// age |
a3b42e81803c
collision indicator on failed girder placement (especially useful with rubberband I guess). still needs some tweaks but I am going to bed now :P
sheepluva
parents:
10193
diff
changeset
|
915 |
dec(Gear^.FrameTicks, Steps); |
a3b42e81803c
collision indicator on failed girder placement (especially useful with rubberband I guess). still needs some tweaks but I am going to bed now :P
sheepluva
parents:
10193
diff
changeset
|
916 |
// toggle between orange and red every few ticks |
10298
7d5d93f9a515
make using the teleporter a bit less challenging
sheepluva
parents:
10251
diff
changeset
|
917 |
if (Gear^.FrameTicks div 256) mod 2 = 0 then |
10251
a3b42e81803c
collision indicator on failed girder placement (especially useful with rubberband I guess). still needs some tweaks but I am going to bed now :P
sheepluva
parents:
10193
diff
changeset
|
918 |
Gear^.Tint:= $FF400000 |
a3b42e81803c
collision indicator on failed girder placement (especially useful with rubberband I guess). still needs some tweaks but I am going to bed now :P
sheepluva
parents:
10193
diff
changeset
|
919 |
else |
a3b42e81803c
collision indicator on failed girder placement (especially useful with rubberband I guess). still needs some tweaks but I am going to bed now :P
sheepluva
parents:
10193
diff
changeset
|
920 |
Gear^.Tint:= $FF000000; |
a3b42e81803c
collision indicator on failed girder placement (especially useful with rubberband I guess). still needs some tweaks but I am going to bed now :P
sheepluva
parents:
10193
diff
changeset
|
921 |
// fade out alpha |
10299 | 922 |
Gear^.Tint:= (Gear^.Tint and (not $FF)) or (255 * Gear^.FrameTicks div 3000); |
10251
a3b42e81803c
collision indicator on failed girder placement (especially useful with rubberband I guess). still needs some tweaks but I am going to bed now :P
sheepluva
parents:
10193
diff
changeset
|
923 |
end |
a3b42e81803c
collision indicator on failed girder placement (especially useful with rubberband I guess). still needs some tweaks but I am going to bed now :P
sheepluva
parents:
10193
diff
changeset
|
924 |
end; |
9283
76e68c136a11
Refactoring: VGSHandlers.inc -> uVisualGearsHandlers.pas
unc0rr
parents:
9080
diff
changeset
|
925 |
|
76e68c136a11
Refactoring: VGSHandlers.inc -> uVisualGearsHandlers.pas
unc0rr
parents:
9080
diff
changeset
|
926 |
const handlers: array[TVisualGearType] of TVGearStepProcedure = |
76e68c136a11
Refactoring: VGSHandlers.inc -> uVisualGearsHandlers.pas
unc0rr
parents:
9080
diff
changeset
|
927 |
( |
76e68c136a11
Refactoring: VGSHandlers.inc -> uVisualGearsHandlers.pas
unc0rr
parents:
9080
diff
changeset
|
928 |
@doStepFlake, |
76e68c136a11
Refactoring: VGSHandlers.inc -> uVisualGearsHandlers.pas
unc0rr
parents:
9080
diff
changeset
|
929 |
@doStepCloud, |
76e68c136a11
Refactoring: VGSHandlers.inc -> uVisualGearsHandlers.pas
unc0rr
parents:
9080
diff
changeset
|
930 |
@doStepExpl, |
76e68c136a11
Refactoring: VGSHandlers.inc -> uVisualGearsHandlers.pas
unc0rr
parents:
9080
diff
changeset
|
931 |
@doStepExpl, |
76e68c136a11
Refactoring: VGSHandlers.inc -> uVisualGearsHandlers.pas
unc0rr
parents:
9080
diff
changeset
|
932 |
@doStepFire, |
76e68c136a11
Refactoring: VGSHandlers.inc -> uVisualGearsHandlers.pas
unc0rr
parents:
9080
diff
changeset
|
933 |
@doStepSmallDamage, |
76e68c136a11
Refactoring: VGSHandlers.inc -> uVisualGearsHandlers.pas
unc0rr
parents:
9080
diff
changeset
|
934 |
@doStepTeamHealthSorter, |
76e68c136a11
Refactoring: VGSHandlers.inc -> uVisualGearsHandlers.pas
unc0rr
parents:
9080
diff
changeset
|
935 |
@doStepSpeechBubble, |
76e68c136a11
Refactoring: VGSHandlers.inc -> uVisualGearsHandlers.pas
unc0rr
parents:
9080
diff
changeset
|
936 |
@doStepBubble, |
76e68c136a11
Refactoring: VGSHandlers.inc -> uVisualGearsHandlers.pas
unc0rr
parents:
9080
diff
changeset
|
937 |
@doStepSteam, |
76e68c136a11
Refactoring: VGSHandlers.inc -> uVisualGearsHandlers.pas
unc0rr
parents:
9080
diff
changeset
|
938 |
@doStepAmmo, |
76e68c136a11
Refactoring: VGSHandlers.inc -> uVisualGearsHandlers.pas
unc0rr
parents:
9080
diff
changeset
|
939 |
@doStepSmoke, |
76e68c136a11
Refactoring: VGSHandlers.inc -> uVisualGearsHandlers.pas
unc0rr
parents:
9080
diff
changeset
|
940 |
@doStepSmoke, |
76e68c136a11
Refactoring: VGSHandlers.inc -> uVisualGearsHandlers.pas
unc0rr
parents:
9080
diff
changeset
|
941 |
@doStepShell, |
76e68c136a11
Refactoring: VGSHandlers.inc -> uVisualGearsHandlers.pas
unc0rr
parents:
9080
diff
changeset
|
942 |
@doStepDust, |
76e68c136a11
Refactoring: VGSHandlers.inc -> uVisualGearsHandlers.pas
unc0rr
parents:
9080
diff
changeset
|
943 |
@doStepSplash, |
76e68c136a11
Refactoring: VGSHandlers.inc -> uVisualGearsHandlers.pas
unc0rr
parents:
9080
diff
changeset
|
944 |
@doStepDroplet, |
76e68c136a11
Refactoring: VGSHandlers.inc -> uVisualGearsHandlers.pas
unc0rr
parents:
9080
diff
changeset
|
945 |
@doStepSmokeRing, |
76e68c136a11
Refactoring: VGSHandlers.inc -> uVisualGearsHandlers.pas
unc0rr
parents:
9080
diff
changeset
|
946 |
@doStepBeeTrace, |
76e68c136a11
Refactoring: VGSHandlers.inc -> uVisualGearsHandlers.pas
unc0rr
parents:
9080
diff
changeset
|
947 |
@doStepEgg, |
76e68c136a11
Refactoring: VGSHandlers.inc -> uVisualGearsHandlers.pas
unc0rr
parents:
9080
diff
changeset
|
948 |
@doStepFeather, |
76e68c136a11
Refactoring: VGSHandlers.inc -> uVisualGearsHandlers.pas
unc0rr
parents:
9080
diff
changeset
|
949 |
@doStepHealthTag, |
76e68c136a11
Refactoring: VGSHandlers.inc -> uVisualGearsHandlers.pas
unc0rr
parents:
9080
diff
changeset
|
950 |
@doStepSmokeTrace, |
76e68c136a11
Refactoring: VGSHandlers.inc -> uVisualGearsHandlers.pas
unc0rr
parents:
9080
diff
changeset
|
951 |
@doStepSmokeTrace, |
76e68c136a11
Refactoring: VGSHandlers.inc -> uVisualGearsHandlers.pas
unc0rr
parents:
9080
diff
changeset
|
952 |
@doStepExplosion, |
76e68c136a11
Refactoring: VGSHandlers.inc -> uVisualGearsHandlers.pas
unc0rr
parents:
9080
diff
changeset
|
953 |
@doStepBigExplosion, |
76e68c136a11
Refactoring: VGSHandlers.inc -> uVisualGearsHandlers.pas
unc0rr
parents:
9080
diff
changeset
|
954 |
@doStepChunk, |
76e68c136a11
Refactoring: VGSHandlers.inc -> uVisualGearsHandlers.pas
unc0rr
parents:
9080
diff
changeset
|
955 |
@doStepNote, |
76e68c136a11
Refactoring: VGSHandlers.inc -> uVisualGearsHandlers.pas
unc0rr
parents:
9080
diff
changeset
|
956 |
@doStepLineTrail, |
76e68c136a11
Refactoring: VGSHandlers.inc -> uVisualGearsHandlers.pas
unc0rr
parents:
9080
diff
changeset
|
957 |
@doStepBulletHit, |
76e68c136a11
Refactoring: VGSHandlers.inc -> uVisualGearsHandlers.pas
unc0rr
parents:
9080
diff
changeset
|
958 |
@doStepCircle, |
76e68c136a11
Refactoring: VGSHandlers.inc -> uVisualGearsHandlers.pas
unc0rr
parents:
9080
diff
changeset
|
959 |
@doStepSmoothWindBar, |
10251
a3b42e81803c
collision indicator on failed girder placement (especially useful with rubberband I guess). still needs some tweaks but I am going to bed now :P
sheepluva
parents:
10193
diff
changeset
|
960 |
@doStepStraightShot, |
a3b42e81803c
collision indicator on failed girder placement (especially useful with rubberband I guess). still needs some tweaks but I am going to bed now :P
sheepluva
parents:
10193
diff
changeset
|
961 |
@doStepNoPlaceWarn |
9283
76e68c136a11
Refactoring: VGSHandlers.inc -> uVisualGearsHandlers.pas
unc0rr
parents:
9080
diff
changeset
|
962 |
); |
76e68c136a11
Refactoring: VGSHandlers.inc -> uVisualGearsHandlers.pas
unc0rr
parents:
9080
diff
changeset
|
963 |
|
76e68c136a11
Refactoring: VGSHandlers.inc -> uVisualGearsHandlers.pas
unc0rr
parents:
9080
diff
changeset
|
964 |
procedure initModule; |
76e68c136a11
Refactoring: VGSHandlers.inc -> uVisualGearsHandlers.pas
unc0rr
parents:
9080
diff
changeset
|
965 |
begin |
9960 | 966 |
doStepVGHandlers:= handlers |
9283
76e68c136a11
Refactoring: VGSHandlers.inc -> uVisualGearsHandlers.pas
unc0rr
parents:
9080
diff
changeset
|
967 |
end; |
76e68c136a11
Refactoring: VGSHandlers.inc -> uVisualGearsHandlers.pas
unc0rr
parents:
9080
diff
changeset
|
968 |
|
76e68c136a11
Refactoring: VGSHandlers.inc -> uVisualGearsHandlers.pas
unc0rr
parents:
9080
diff
changeset
|
969 |
end. |