author | unc0rr |
Fri, 10 Jan 2014 00:57:15 +0400 | |
branch | gl2 |
changeset 7387 | f8a79052fe97 |
parent 7374 | 514138949c76 |
child 11317 | 62287d4044e7 |
permissions | -rw-r--r-- |
4976 | 1 |
(* |
2 |
* Hedgewars, a free turn based strategy game |
|
6700 | 3 |
* Copyright (c) 2004-2012 Andrey Korotaev <unC0Rr@gmail.com> |
4976 | 4 |
* |
5 |
* This program is free software; you can redistribute it and/or modify |
|
6 |
* it under the terms of the GNU General Public License as published by |
|
7 |
* the Free Software Foundation; version 2 of the License |
|
8 |
* |
|
9 |
* This program is distributed in the hope that it will be useful, |
|
10 |
* but WITHOUT ANY WARRANTY; without even the implied warranty of |
|
11 |
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
|
12 |
* GNU General Public License for more details. |
|
13 |
* |
|
14 |
* You should have received a copy of the GNU General Public License |
|
15 |
* along with this program; if not, write to the Free Software |
|
16 |
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA |
|
17 |
*) |
|
18 |
||
4388 | 19 |
{$INCLUDE "options.inc"} |
4976 | 20 |
|
4388 | 21 |
unit uGearsRender; |
22 |
||
23 |
interface |
|
5041 | 24 |
uses uTypes, uConsts, GLunit, uFloat, SDLh; |
4388 | 25 |
|
26 |
procedure RenderGear(Gear: PGear; x, y: LongInt); |
|
27 |
||
28 |
var RopePoints: record |
|
29 |
Count: Longword; |
|
30 |
HookAngle: GLfloat; |
|
31 |
ar: array[0..MAXROPEPOINTS] of record |
|
6580
6155187bf599
A partial reformatting of the pascal code to have consistent syntax. Things that are still inconsistent.
lovelacer
parents:
6508
diff
changeset
|
32 |
X, Y: hwFloat; |
6155187bf599
A partial reformatting of the pascal code to have consistent syntax. Things that are still inconsistent.
lovelacer
parents:
6508
diff
changeset
|
33 |
dLen: hwFloat; |
6155187bf599
A partial reformatting of the pascal code to have consistent syntax. Things that are still inconsistent.
lovelacer
parents:
6508
diff
changeset
|
34 |
b: boolean; |
6155187bf599
A partial reformatting of the pascal code to have consistent syntax. Things that are still inconsistent.
lovelacer
parents:
6508
diff
changeset
|
35 |
end; |
4388 | 36 |
rounded: array[0..MAXROPEPOINTS + 2] of TVertex2f; |
37 |
end; |
|
38 |
||
39 |
implementation |
|
7188
580cd247511e
Removed leftover FFP code: We should now be GL2 GLSL1.30+ forward compatible.
Wolfgang Steffens <WolfgangSteff@gmail.com>
parents:
7186
diff
changeset
|
40 |
uses uRender, uStore, uUtils, uVariables, uAmmos, Math, uVisualGears; |
4388 | 41 |
|
42 |
procedure DrawRopeLinesRQ(Gear: PGear); |
|
43 |
begin |
|
44 |
with RopePoints do |
|
45 |
begin |
|
46 |
rounded[Count].X:= hwRound(Gear^.X); |
|
47 |
rounded[Count].Y:= hwRound(Gear^.Y); |
|
48 |
rounded[Count + 1].X:= hwRound(Gear^.Hedgehog^.Gear^.X); |
|
49 |
rounded[Count + 1].Y:= hwRound(Gear^.Hedgehog^.Gear^.Y); |
|
50 |
end; |
|
51 |
||
52 |
if (RopePoints.Count > 0) or (Gear^.Elasticity.QWordValue > 0) then |
|
53 |
begin |
|
54 |
glDisable(GL_TEXTURE_2D); |
|
55 |
//glEnable(GL_LINE_SMOOTH); |
|
56 |
||
7111
5ba5a92d74fb
Replaced matrix related FFP code with explicit matrix calculations.
Wolfgang Steffens <WolfgangSteff@gmail.com>
parents:
7098
diff
changeset
|
57 |
ResetRotation; |
5ba5a92d74fb
Replaced matrix related FFP code with explicit matrix calculations.
Wolfgang Steffens <WolfgangSteff@gmail.com>
parents:
7098
diff
changeset
|
58 |
SetOffset(WorldDx, WorldDy); |
5ba5a92d74fb
Replaced matrix related FFP code with explicit matrix calculations.
Wolfgang Steffens <WolfgangSteff@gmail.com>
parents:
7098
diff
changeset
|
59 |
UpdateModelview; |
4388 | 60 |
|
61 |
glLineWidth(4.0); |
|
62 |
||
63 |
Tint($C0, $C0, $C0, $FF); |
|
64 |
||
7188
580cd247511e
Removed leftover FFP code: We should now be GL2 GLSL1.30+ forward compatible.
Wolfgang Steffens <WolfgangSteff@gmail.com>
parents:
7186
diff
changeset
|
65 |
SetVertexPointer(@RopePoints.rounded[0]); |
4388 | 66 |
glDrawArrays(GL_LINE_STRIP, 0, RopePoints.Count + 2); |
67 |
Tint($FF, $FF, $FF, $FF); |
|
68 |
||
69 |
glEnable(GL_TEXTURE_2D); |
|
70 |
//glDisable(GL_LINE_SMOOTH) |
|
71 |
end |
|
72 |
end; |
|
73 |
||
74 |
||
6508
bf5db4517148
Fix regression from 6480 too. Extra assignments might make this slightly less efficient.
nemo
parents:
6490
diff
changeset
|
75 |
function DrawRopeLine(X1, Y1, X2, Y2, roplen: LongInt): LongInt; |
6490 | 76 |
var eX, eY, dX, dY: LongInt; |
77 |
i, sX, sY, x, y, d: LongInt; |
|
78 |
b: boolean; |
|
79 |
begin |
|
4388 | 80 |
if (X1 = X2) and (Y1 = Y2) then |
6490 | 81 |
begin |
82 |
//OutError('WARNING: zero length rope line!', false); |
|
83 |
exit |
|
84 |
end; |
|
4388 | 85 |
eX:= 0; |
86 |
eY:= 0; |
|
87 |
dX:= X2 - X1; |
|
88 |
dY:= Y2 - Y1; |
|
89 |
||
6580
6155187bf599
A partial reformatting of the pascal code to have consistent syntax. Things that are still inconsistent.
lovelacer
parents:
6508
diff
changeset
|
90 |
if (dX > 0) then |
6155187bf599
A partial reformatting of the pascal code to have consistent syntax. Things that are still inconsistent.
lovelacer
parents:
6508
diff
changeset
|
91 |
sX:= 1 |
4388 | 92 |
else |
6580
6155187bf599
A partial reformatting of the pascal code to have consistent syntax. Things that are still inconsistent.
lovelacer
parents:
6508
diff
changeset
|
93 |
if (dX < 0) then |
6155187bf599
A partial reformatting of the pascal code to have consistent syntax. Things that are still inconsistent.
lovelacer
parents:
6508
diff
changeset
|
94 |
begin |
6155187bf599
A partial reformatting of the pascal code to have consistent syntax. Things that are still inconsistent.
lovelacer
parents:
6508
diff
changeset
|
95 |
sX:= -1; |
6155187bf599
A partial reformatting of the pascal code to have consistent syntax. Things that are still inconsistent.
lovelacer
parents:
6508
diff
changeset
|
96 |
dX:= -dX |
6155187bf599
A partial reformatting of the pascal code to have consistent syntax. Things that are still inconsistent.
lovelacer
parents:
6508
diff
changeset
|
97 |
end |
6155187bf599
A partial reformatting of the pascal code to have consistent syntax. Things that are still inconsistent.
lovelacer
parents:
6508
diff
changeset
|
98 |
else sX:= dX; |
4388 | 99 |
|
6490 | 100 |
if (dY > 0) then |
101 |
sY:= 1 |
|
4388 | 102 |
else |
6490 | 103 |
if (dY < 0) then |
4388 | 104 |
begin |
6490 | 105 |
sY:= -1; |
106 |
dY:= -dY |
|
6580
6155187bf599
A partial reformatting of the pascal code to have consistent syntax. Things that are still inconsistent.
lovelacer
parents:
6508
diff
changeset
|
107 |
end |
6155187bf599
A partial reformatting of the pascal code to have consistent syntax. Things that are still inconsistent.
lovelacer
parents:
6508
diff
changeset
|
108 |
else |
6490 | 109 |
sY:= dY; |
110 |
||
6580
6155187bf599
A partial reformatting of the pascal code to have consistent syntax. Things that are still inconsistent.
lovelacer
parents:
6508
diff
changeset
|
111 |
if (dX > dY) then |
6155187bf599
A partial reformatting of the pascal code to have consistent syntax. Things that are still inconsistent.
lovelacer
parents:
6508
diff
changeset
|
112 |
d:= dX |
6155187bf599
A partial reformatting of the pascal code to have consistent syntax. Things that are still inconsistent.
lovelacer
parents:
6508
diff
changeset
|
113 |
else |
6155187bf599
A partial reformatting of the pascal code to have consistent syntax. Things that are still inconsistent.
lovelacer
parents:
6508
diff
changeset
|
114 |
d:= dY; |
6490 | 115 |
|
116 |
x:= X1; |
|
117 |
y:= Y1; |
|
118 |
||
119 |
for i:= 0 to d do |
|
120 |
begin |
|
121 |
inc(eX, dX); |
|
122 |
inc(eY, dY); |
|
123 |
b:= false; |
|
124 |
if (eX > d) then |
|
125 |
begin |
|
126 |
dec(eX, d); |
|
127 |
inc(x, sX); |
|
128 |
b:= true |
|
129 |
end; |
|
130 |
if (eY > d) then |
|
131 |
begin |
|
132 |
dec(eY, d); |
|
133 |
inc(y, sY); |
|
134 |
b:= true |
|
135 |
end; |
|
136 |
if b then |
|
137 |
begin |
|
138 |
inc(roplen); |
|
6580
6155187bf599
A partial reformatting of the pascal code to have consistent syntax. Things that are still inconsistent.
lovelacer
parents:
6508
diff
changeset
|
139 |
if (roplen mod 4) = 0 then |
6155187bf599
A partial reformatting of the pascal code to have consistent syntax. Things that are still inconsistent.
lovelacer
parents:
6508
diff
changeset
|
140 |
DrawSprite(sprRopeNode, x - 2, y - 2, 0) |
6490 | 141 |
end |
6508
bf5db4517148
Fix regression from 6480 too. Extra assignments might make this slightly less efficient.
nemo
parents:
6490
diff
changeset
|
142 |
end; |
bf5db4517148
Fix regression from 6480 too. Extra assignments might make this slightly less efficient.
nemo
parents:
6490
diff
changeset
|
143 |
DrawRopeLine:= roplen; |
6490 | 144 |
end; |
145 |
||
146 |
procedure DrawRope(Gear: PGear); |
|
147 |
var roplen: LongInt; |
|
148 |
i: Longword; |
|
4388 | 149 |
begin |
150 |
if (cReducedQuality and rqSimpleRope) <> 0 then |
|
151 |
DrawRopeLinesRQ(Gear) |
|
152 |
else |
|
153 |
begin |
|
154 |
roplen:= 0; |
|
155 |
if RopePoints.Count > 0 then |
|
156 |
begin |
|
157 |
i:= 0; |
|
158 |
while i < Pred(RopePoints.Count) do |
|
159 |
begin |
|
6508
bf5db4517148
Fix regression from 6480 too. Extra assignments might make this slightly less efficient.
nemo
parents:
6490
diff
changeset
|
160 |
roplen:= DrawRopeLine(hwRound(RopePoints.ar[i].X) + WorldDx, hwRound(RopePoints.ar[i].Y) + WorldDy, |
6490 | 161 |
hwRound(RopePoints.ar[Succ(i)].X) + WorldDx, hwRound(RopePoints.ar[Succ(i)].Y) + WorldDy, roplen); |
4388 | 162 |
inc(i) |
163 |
end; |
|
6508
bf5db4517148
Fix regression from 6480 too. Extra assignments might make this slightly less efficient.
nemo
parents:
6490
diff
changeset
|
164 |
roplen:= DrawRopeLine(hwRound(RopePoints.ar[i].X) + WorldDx, hwRound(RopePoints.ar[i].Y) + WorldDy, |
6490 | 165 |
hwRound(Gear^.X) + WorldDx, hwRound(Gear^.Y) + WorldDy, roplen); |
6508
bf5db4517148
Fix regression from 6480 too. Extra assignments might make this slightly less efficient.
nemo
parents:
6490
diff
changeset
|
166 |
roplen:= DrawRopeLine(hwRound(Gear^.X) + WorldDx, hwRound(Gear^.Y) + WorldDy, |
6490 | 167 |
hwRound(Gear^.Hedgehog^.Gear^.X) + WorldDx, hwRound(Gear^.Hedgehog^.Gear^.Y) + WorldDy, roplen); |
6580
6155187bf599
A partial reformatting of the pascal code to have consistent syntax. Things that are still inconsistent.
lovelacer
parents:
6508
diff
changeset
|
168 |
end |
6155187bf599
A partial reformatting of the pascal code to have consistent syntax. Things that are still inconsistent.
lovelacer
parents:
6508
diff
changeset
|
169 |
else |
4388 | 170 |
if Gear^.Elasticity.QWordValue > 0 then |
6508
bf5db4517148
Fix regression from 6480 too. Extra assignments might make this slightly less efficient.
nemo
parents:
6490
diff
changeset
|
171 |
roplen:= DrawRopeLine(hwRound(Gear^.X) + WorldDx, hwRound(Gear^.Y) + WorldDy, |
6490 | 172 |
hwRound(Gear^.Hedgehog^.Gear^.X) + WorldDx, hwRound(Gear^.Hedgehog^.Gear^.Y) + WorldDy, roplen); |
4388 | 173 |
end; |
174 |
||
175 |
||
176 |
if RopePoints.Count > 0 then |
|
6999 | 177 |
DrawSpriteRotated(sprRopeHook, hwRound(RopePoints.ar[0].X) + WorldDx, hwRound(RopePoints.ar[0].Y) + WorldDy, 1, RopePoints.HookAngle) |
6580
6155187bf599
A partial reformatting of the pascal code to have consistent syntax. Things that are still inconsistent.
lovelacer
parents:
6508
diff
changeset
|
178 |
else |
4388 | 179 |
if Gear^.Elasticity.QWordValue > 0 then |
6999 | 180 |
DrawSpriteRotated(sprRopeHook, hwRound(Gear^.X) + WorldDx, hwRound(Gear^.Y) + WorldDy, 0, DxDy2Angle(Gear^.dY, Gear^.dX)); |
4388 | 181 |
end; |
182 |
||
183 |
||
184 |
procedure DrawAltWeapon(Gear: PGear; sx, sy: LongInt); |
|
185 |
begin |
|
186 |
with Gear^.Hedgehog^ do |
|
187 |
begin |
|
188 |
if not (((Ammoz[CurAmmoType].Ammo.Propz and ammoprop_AltUse) <> 0) and ((Gear^.State and gstAttacked) = 0)) then |
|
189 |
exit; |
|
190 |
DrawTexture(sx + 16, sy + 16, ropeIconTex); |
|
191 |
DrawTextureF(SpritesData[sprAMAmmos].Texture, 0.75, sx + 30, sy + 30, ord(CurAmmoType) - 1, 1, 32, 32); |
|
192 |
end; |
|
193 |
end; |
|
194 |
||
195 |
||
196 |
procedure DrawHH(Gear: PGear; ox, oy: LongInt); |
|
197 |
var i, t: LongInt; |
|
198 |
amt: TAmmoType; |
|
5615
104f69e798bb
changed aiming to be triggered when touching the crosshair
Xeli
parents:
5561
diff
changeset
|
199 |
sign, hx, hy, tx, ty, sx, sy, m: LongInt; // hedgehog, crosshair, temp, sprite, direction |
4388 | 200 |
dx, dy, ax, ay, aAngle, dAngle, hAngle, lx, ly: real; // laser, change |
201 |
defaultPos, HatVisible: boolean; |
|
202 |
HH: PHedgehog; |
|
203 |
CurWeapon: PAmmo; |
|
204 |
begin |
|
205 |
HH:= Gear^.Hedgehog; |
|
6580
6155187bf599
A partial reformatting of the pascal code to have consistent syntax. Things that are still inconsistent.
lovelacer
parents:
6508
diff
changeset
|
206 |
if HH^.Unplaced then |
6155187bf599
A partial reformatting of the pascal code to have consistent syntax. Things that are still inconsistent.
lovelacer
parents:
6508
diff
changeset
|
207 |
exit; |
4388 | 208 |
m:= 1; |
6580
6155187bf599
A partial reformatting of the pascal code to have consistent syntax. Things that are still inconsistent.
lovelacer
parents:
6508
diff
changeset
|
209 |
if ((Gear^.State and gstHHHJump) <> 0) and (not cArtillery) then |
6155187bf599
A partial reformatting of the pascal code to have consistent syntax. Things that are still inconsistent.
lovelacer
parents:
6508
diff
changeset
|
210 |
m:= -1; |
4388 | 211 |
sx:= ox + 1; // this offset is very common |
212 |
sy:= oy - 3; |
|
213 |
sign:= hwSign(Gear^.dX); |
|
214 |
||
215 |
if (Gear^.State and gstHHDeath) <> 0 then |
|
216 |
begin |
|
217 |
DrawSprite(sprHHDeath, ox - 16, oy - 26, Gear^.Pos); |
|
4810 | 218 |
Tint(HH^.Team^.Clan^.Color shl 8 or $FF); |
4388 | 219 |
DrawSprite(sprHHDeath, ox - 16, oy - 26, Gear^.Pos + 8); |
220 |
Tint($FF, $FF, $FF, $FF); |
|
221 |
exit |
|
222 |
end |
|
223 |
else if (Gear^.State and gstHHGone) <> 0 then |
|
224 |
begin |
|
6999 | 225 |
DrawSpriteRotatedF(sprTeleport, sx, sy, Gear^.Pos, sign, 0); |
4388 | 226 |
exit |
227 |
end; |
|
228 |
||
229 |
defaultPos:= true; |
|
230 |
HatVisible:= false; |
|
231 |
||
232 |
||
7010
10a0a31804f3
Switch effects to longint for convenience of tracking ice states. I could add a new Hedgehog value, but since we have this effects list being all useless as booleans anyway...
nemo
parents:
6999
diff
changeset
|
233 |
if HH^.Effects[hePoisoned] <> 0 then |
4388 | 234 |
begin |
235 |
Tint($00, $FF, $40, $40); |
|
6999 | 236 |
DrawTextureRotatedF(SpritesData[sprSmokeWhite].texture, 2, 0, 0, sx, sy, 0, 1, 22, 22, (RealTicks shr 36) mod 360); |
4388 | 237 |
Tint($FF, $FF, $FF, $FF) |
238 |
end; |
|
239 |
||
240 |
if ((Gear^.State and gstWinner) <> 0) and |
|
241 |
((CurAmmoGear = nil) or (CurAmmoGear^.Kind <> gtPickHammer)) then |
|
242 |
begin |
|
243 |
DrawHedgehog(sx, sy, |
|
244 |
sign, |
|
245 |
2, |
|
246 |
0, |
|
247 |
0); |
|
248 |
defaultPos:= false |
|
249 |
end; |
|
250 |
if (Gear^.State and gstDrowning) <> 0 then |
|
251 |
begin |
|
252 |
DrawHedgehog(sx, sy, |
|
253 |
sign, |
|
254 |
1, |
|
255 |
7, |
|
256 |
0); |
|
257 |
defaultPos:= false |
|
258 |
end else |
|
259 |
if (Gear^.State and gstLoser) <> 0 then |
|
260 |
begin |
|
261 |
DrawHedgehog(sx, sy, |
|
262 |
sign, |
|
263 |
2, |
|
264 |
3, |
|
265 |
0); |
|
266 |
defaultPos:= false |
|
267 |
end else |
|
268 |
||
269 |
if (Gear^.State and gstHHDriven) <> 0 then |
|
270 |
begin |
|
5145
120f4271f197
adjust crosshair criteria again. this should take care of sniper rifle and crosshair after attacking
nemo
parents:
5137
diff
changeset
|
271 |
if ((Gear^.State and (gstHHThinking or gstAnimation)) = 0) and |
5136
948da1e50205
Fix a few crosshair bugs. Disable ShowCrosshair and just decide when drawing.
nemo
parents:
5041
diff
changeset
|
272 |
/// If current ammo is active, and current ammo has alt attack and uses a crosshair (rope, basically, right now, with no crosshair for parachute/saucer |
6580
6155187bf599
A partial reformatting of the pascal code to have consistent syntax. Things that are still inconsistent.
lovelacer
parents:
6508
diff
changeset
|
273 |
(((CurAmmoGear <> nil) and //((Ammoz[CurAmmoGear^.AmmoType].Ammo.Propz and ammoprop_AltAttack) <> 0) and |
5136
948da1e50205
Fix a few crosshair bugs. Disable ShowCrosshair and just decide when drawing.
nemo
parents:
5041
diff
changeset
|
274 |
((Ammoz[CurAmmoGear^.AmmoType].Ammo.Propz and ammoprop_NoCrossHair) = 0)) or |
948da1e50205
Fix a few crosshair bugs. Disable ShowCrosshair and just decide when drawing.
nemo
parents:
5041
diff
changeset
|
275 |
/// If no current ammo is active, and the selected ammo uses a crosshair |
6580
6155187bf599
A partial reformatting of the pascal code to have consistent syntax. Things that are still inconsistent.
lovelacer
parents:
6508
diff
changeset
|
276 |
((CurAmmoGear = nil) and ((Ammoz[HH^.CurAmmoType].Ammo.Propz and ammoprop_NoCrosshair) = 0) and ((Gear^.State and gstAttacked) = 0))) then |
4388 | 277 |
begin |
278 |
(* These calculations are a little complex for a few reasons: |
|
279 |
1: I need to draw the laser from weapon origin to nearest land |
|
280 |
2: I need to start the beam outside the hedgie for attractiveness. |
|
281 |
3: I need to extend the beam beyond land. |
|
282 |
This routine perhaps should be pushed into uStore or somesuch instead of continuuing the increase in size of this function. |
|
283 |
*) |
|
284 |
dx:= sign * m * Sin(Gear^.Angle * pi / cMaxAngle); |
|
285 |
dy:= -Cos(Gear^.Angle * pi / cMaxAngle); |
|
286 |
if cLaserSighting then |
|
287 |
begin |
|
288 |
lx:= GetLaunchX(HH^.CurAmmoType, sign * m, Gear^.Angle); |
|
289 |
ly:= GetLaunchY(HH^.CurAmmoType, Gear^.Angle); |
|
290 |
||
291 |
// ensure we start outside the hedgehog (he's solid after all) |
|
292 |
while abs(lx * lx + ly * ly) < (Gear^.radius * Gear^.radius) do |
|
293 |
begin |
|
294 |
lx:= lx + dx; |
|
295 |
ly:= ly + dy |
|
296 |
end; |
|
297 |
||
298 |
// add hog's position |
|
299 |
lx:= lx + ox - WorldDx; |
|
300 |
ly:= ly + oy - WorldDy; |
|
301 |
||
302 |
// decrease number of iterations required |
|
303 |
ax:= dx * 4; |
|
304 |
ay:= dy * 4; |
|
305 |
||
306 |
tx:= round(lx); |
|
307 |
ty:= round(ly); |
|
308 |
hx:= tx; |
|
309 |
hy:= ty; |
|
310 |
while ((ty and LAND_HEIGHT_MASK) = 0) and |
|
311 |
((tx and LAND_WIDTH_MASK) = 0) and |
|
312 |
(Land[ty, tx] = 0) do // TODO: check for constant variable instead |
|
313 |
begin |
|
314 |
lx:= lx + ax; |
|
315 |
ly:= ly + ay; |
|
316 |
tx:= round(lx); |
|
317 |
ty:= round(ly) |
|
318 |
end; |
|
319 |
// reached edge of land. assume infinite beam. Extend it way out past camera |
|
320 |
if ((ty and LAND_HEIGHT_MASK) <> 0) or ((tx and LAND_WIDTH_MASK) <> 0) then |
|
321 |
begin |
|
7165
aad1aea05f1e
add onGameTick20 to basic training, extend laser sight out way more (it was visible at top when completely zoomed out), move call of new turn to after AfterSwitchHedgehog to avoid lua issues in onNewTurn - if this causes problems, lua can do delayed actions in onGameTick
nemo
parents:
7098
diff
changeset
|
322 |
tx:= round(lx + ax * (LAND_WIDTH div 2)); |
aad1aea05f1e
add onGameTick20 to basic training, extend laser sight out way more (it was visible at top when completely zoomed out), move call of new turn to after AfterSwitchHedgehog to avoid lua issues in onNewTurn - if this causes problems, lua can do delayed actions in onGameTick
nemo
parents:
7098
diff
changeset
|
323 |
ty:= round(ly + ay * (LAND_WIDTH div 2)); |
4388 | 324 |
end; |
325 |
||
326 |
//if (abs(lx-tx)>8) or (abs(ly-ty)>8) then |
|
327 |
begin |
|
328 |
DrawLine(hx, hy, tx, ty, 1.0, $FF, $00, $00, $C0); |
|
329 |
end; |
|
330 |
end; |
|
331 |
// draw crosshair |
|
5615
104f69e798bb
changed aiming to be triggered when touching the crosshair
Xeli
parents:
5561
diff
changeset
|
332 |
CrosshairX := Round(hwRound(Gear^.X) + dx * 80 + GetLaunchX(HH^.CurAmmoType, sign * m, Gear^.Angle)); |
104f69e798bb
changed aiming to be triggered when touching the crosshair
Xeli
parents:
5561
diff
changeset
|
333 |
CrosshairY := Round(hwRound(Gear^.Y) + dy * 80 + GetLaunchY(HH^.CurAmmoType, Gear^.Angle)); |
104f69e798bb
changed aiming to be triggered when touching the crosshair
Xeli
parents:
5561
diff
changeset
|
334 |
|
104f69e798bb
changed aiming to be triggered when touching the crosshair
Xeli
parents:
5561
diff
changeset
|
335 |
|
6999 | 336 |
DrawTextureRotated(HH^.Team^.CrosshairTex, |
5615
104f69e798bb
changed aiming to be triggered when touching the crosshair
Xeli
parents:
5561
diff
changeset
|
337 |
12, 12, CrosshairX + WorldDx, CrosshairY + WorldDy, 0, |
4388 | 338 |
sign * (Gear^.Angle * 180.0) / cMaxAngle); |
339 |
end; |
|
340 |
hx:= ox + 8 * sign; |
|
341 |
hy:= oy - 2; |
|
342 |
aangle:= Gear^.Angle * 180 / cMaxAngle - 90; |
|
5935 | 343 |
if (CurAmmoGear <> nil) and (CurAmmoGear^.Kind <> gtTardis) then |
4388 | 344 |
begin |
345 |
case CurAmmoGear^.Kind of |
|
346 |
gtShotgunShot: begin |
|
347 |
if (CurAmmoGear^.State and gstAnimation <> 0) then |
|
6999 | 348 |
DrawSpriteRotated(sprShotgun, hx, hy, sign, aangle) |
4388 | 349 |
else |
6999 | 350 |
DrawSpriteRotated(sprHandShotgun, hx, hy, sign, aangle); |
4388 | 351 |
end; |
6999 | 352 |
gtDEagleShot: DrawSpriteRotated(sprDEagle, hx, hy, sign, aangle); |
4388 | 353 |
gtSniperRifleShot: begin |
354 |
if (CurAmmoGear^.State and gstAnimation <> 0) then |
|
6999 | 355 |
DrawSpriteRotatedF(sprSniperRifle, hx, hy, 1, sign, aangle) |
4388 | 356 |
else |
6999 | 357 |
DrawSpriteRotatedF(sprSniperRifle, hx, hy, 0, sign, aangle) |
4388 | 358 |
end; |
6999 | 359 |
gtBallgun: DrawSpriteRotated(sprHandBallgun, hx, hy, sign, aangle); |
4388 | 360 |
gtRCPlane: begin |
6999 | 361 |
DrawSpriteRotated(sprHandPlane, hx, hy, sign, 0); |
4388 | 362 |
defaultPos:= false |
363 |
end; |
|
364 |
gtRope: begin |
|
365 |
if Gear^.X < CurAmmoGear^.X then |
|
366 |
begin |
|
367 |
dAngle:= 0; |
|
368 |
hAngle:= 180; |
|
369 |
i:= 1 |
|
6580
6155187bf599
A partial reformatting of the pascal code to have consistent syntax. Things that are still inconsistent.
lovelacer
parents:
6508
diff
changeset
|
370 |
end |
6155187bf599
A partial reformatting of the pascal code to have consistent syntax. Things that are still inconsistent.
lovelacer
parents:
6508
diff
changeset
|
371 |
else |
4388 | 372 |
begin |
373 |
dAngle:= 180; |
|
374 |
hAngle:= 0; |
|
375 |
i:= -1 |
|
376 |
end; |
|
377 |
if ((Gear^.State and gstWinner) = 0) then |
|
378 |
begin |
|
379 |
DrawHedgehog(ox, oy, |
|
380 |
i, |
|
381 |
1, |
|
382 |
0, |
|
383 |
DxDy2Angle(CurAmmoGear^.dY, CurAmmoGear^.dX) + dAngle); |
|
384 |
with HH^ do |
|
385 |
if (HatTex <> nil) then |
|
386 |
begin |
|
6999 | 387 |
DrawTextureRotatedF(HatTex, 1.0, -1.0, -6.0, ox, oy, 0, i, 32, 32, |
4388 | 388 |
i*DxDy2Angle(CurAmmoGear^.dY, CurAmmoGear^.dX) + hAngle); |
389 |
if HatTex^.w > 64 then |
|
390 |
begin |
|
4810 | 391 |
Tint(HH^.Team^.Clan^.Color shl 8 or $FF); |
6999 | 392 |
DrawTextureRotatedF(HatTex, 1.0, -1.0, -6.0, ox, oy, 32, i, 32, 32, |
4388 | 393 |
i*DxDy2Angle(CurAmmoGear^.dY, CurAmmoGear^.dX) + hAngle); |
394 |
Tint($FF, $FF, $FF, $FF) |
|
395 |
end |
|
396 |
end |
|
397 |
end; |
|
398 |
DrawAltWeapon(Gear, ox, oy); |
|
399 |
defaultPos:= false |
|
400 |
end; |
|
6580
6155187bf599
A partial reformatting of the pascal code to have consistent syntax. Things that are still inconsistent.
lovelacer
parents:
6508
diff
changeset
|
401 |
gtBlowTorch: |
6155187bf599
A partial reformatting of the pascal code to have consistent syntax. Things that are still inconsistent.
lovelacer
parents:
6508
diff
changeset
|
402 |
begin |
6999 | 403 |
DrawSpriteRotated(sprBlowTorch, hx, hy, sign, aangle); |
4388 | 404 |
DrawHedgehog(sx, sy, |
405 |
sign, |
|
406 |
3, |
|
407 |
HH^.visStepPos div 2, |
|
408 |
0); |
|
409 |
with HH^ do |
|
410 |
if (HatTex <> nil) then |
|
411 |
begin |
|
412 |
DrawTextureF(HatTex, |
|
413 |
1, |
|
414 |
sx, |
|
415 |
sy - 5, |
|
416 |
0, |
|
417 |
sign, |
|
418 |
32, |
|
419 |
32); |
|
420 |
if HatTex^.w > 64 then |
|
421 |
begin |
|
4810 | 422 |
Tint(HH^.Team^.Clan^.Color shl 8 or $FF); |
4388 | 423 |
DrawTextureF(HatTex, |
424 |
1, |
|
425 |
sx, |
|
426 |
sy - 5, |
|
427 |
32, |
|
428 |
sign, |
|
429 |
32, |
|
430 |
32); |
|
431 |
Tint($FF, $FF, $FF, $FF) |
|
432 |
end |
|
433 |
end; |
|
434 |
defaultPos:= false |
|
435 |
end; |
|
6999 | 436 |
gtShover: DrawSpriteRotated(sprHandBaseball, hx, hy, sign, aangle + 180); |
6580
6155187bf599
A partial reformatting of the pascal code to have consistent syntax. Things that are still inconsistent.
lovelacer
parents:
6508
diff
changeset
|
437 |
gtFirePunch: |
6155187bf599
A partial reformatting of the pascal code to have consistent syntax. Things that are still inconsistent.
lovelacer
parents:
6508
diff
changeset
|
438 |
begin |
4388 | 439 |
DrawHedgehog(sx, sy, |
440 |
sign, |
|
441 |
1, |
|
442 |
4, |
|
443 |
0); |
|
444 |
defaultPos:= false |
|
445 |
end; |
|
6580
6155187bf599
A partial reformatting of the pascal code to have consistent syntax. Things that are still inconsistent.
lovelacer
parents:
6508
diff
changeset
|
446 |
gtPickHammer: |
6155187bf599
A partial reformatting of the pascal code to have consistent syntax. Things that are still inconsistent.
lovelacer
parents:
6508
diff
changeset
|
447 |
begin |
4388 | 448 |
defaultPos:= false; |
449 |
dec(sy,20); |
|
450 |
end; |
|
451 |
gtTeleport: defaultPos:= false; |
|
6580
6155187bf599
A partial reformatting of the pascal code to have consistent syntax. Things that are still inconsistent.
lovelacer
parents:
6508
diff
changeset
|
452 |
gtWhip: |
6155187bf599
A partial reformatting of the pascal code to have consistent syntax. Things that are still inconsistent.
lovelacer
parents:
6508
diff
changeset
|
453 |
begin |
6999 | 454 |
DrawSpriteRotatedF(sprWhip, |
4388 | 455 |
sx, |
456 |
sy, |
|
457 |
1, |
|
458 |
sign, |
|
459 |
0); |
|
460 |
defaultPos:= false |
|
461 |
end; |
|
6580
6155187bf599
A partial reformatting of the pascal code to have consistent syntax. Things that are still inconsistent.
lovelacer
parents:
6508
diff
changeset
|
462 |
gtHammer: |
6155187bf599
A partial reformatting of the pascal code to have consistent syntax. Things that are still inconsistent.
lovelacer
parents:
6508
diff
changeset
|
463 |
begin |
6999 | 464 |
DrawSpriteRotatedF(sprHammer, |
4388 | 465 |
sx, |
466 |
sy, |
|
467 |
1, |
|
468 |
sign, |
|
469 |
0); |
|
470 |
defaultPos:= false |
|
471 |
end; |
|
6580
6155187bf599
A partial reformatting of the pascal code to have consistent syntax. Things that are still inconsistent.
lovelacer
parents:
6508
diff
changeset
|
472 |
gtResurrector: |
6155187bf599
A partial reformatting of the pascal code to have consistent syntax. Things that are still inconsistent.
lovelacer
parents:
6508
diff
changeset
|
473 |
begin |
6999 | 474 |
DrawSpriteRotated(sprHandResurrector, sx, sy, 0, 0); |
4388 | 475 |
defaultPos:= false |
476 |
end; |
|
6580
6155187bf599
A partial reformatting of the pascal code to have consistent syntax. Things that are still inconsistent.
lovelacer
parents:
6508
diff
changeset
|
477 |
gtKamikaze: |
6155187bf599
A partial reformatting of the pascal code to have consistent syntax. Things that are still inconsistent.
lovelacer
parents:
6508
diff
changeset
|
478 |
begin |
4388 | 479 |
if CurAmmoGear^.Pos = 0 then |
480 |
DrawHedgehog(sx, sy, |
|
481 |
sign, |
|
482 |
1, |
|
483 |
6, |
|
484 |
0) |
|
485 |
else |
|
6999 | 486 |
DrawSpriteRotatedF(sprKamikaze, |
4388 | 487 |
ox, oy, |
488 |
CurAmmoGear^.Pos - 1, |
|
489 |
sign, |
|
490 |
aangle); |
|
491 |
defaultPos:= false |
|
492 |
end; |
|
6580
6155187bf599
A partial reformatting of the pascal code to have consistent syntax. Things that are still inconsistent.
lovelacer
parents:
6508
diff
changeset
|
493 |
gtSeduction: |
6155187bf599
A partial reformatting of the pascal code to have consistent syntax. Things that are still inconsistent.
lovelacer
parents:
6508
diff
changeset
|
494 |
begin |
4388 | 495 |
if CurAmmoGear^.Pos >= 6 then |
496 |
DrawHedgehog(sx, sy, |
|
497 |
sign, |
|
498 |
2, |
|
499 |
2, |
|
500 |
0) |
|
501 |
else |
|
502 |
begin |
|
6999 | 503 |
DrawSpriteRotatedF(sprDress, |
4388 | 504 |
ox, oy, |
505 |
CurAmmoGear^.Pos, |
|
506 |
sign, |
|
507 |
0); |
|
508 |
DrawSprite(sprCensored, ox - 32, oy - 20, 0) |
|
509 |
end; |
|
510 |
defaultPos:= false |
|
511 |
end; |
|
6580
6155187bf599
A partial reformatting of the pascal code to have consistent syntax. Things that are still inconsistent.
lovelacer
parents:
6508
diff
changeset
|
512 |
gtFlamethrower: |
6155187bf599
A partial reformatting of the pascal code to have consistent syntax. Things that are still inconsistent.
lovelacer
parents:
6508
diff
changeset
|
513 |
begin |
6999 | 514 |
DrawSpriteRotatedF(sprHandFlamethrower, hx, hy, (RealTicks div 125) mod 4, sign, aangle); |
6580
6155187bf599
A partial reformatting of the pascal code to have consistent syntax. Things that are still inconsistent.
lovelacer
parents:
6508
diff
changeset
|
515 |
if CurAmmoGear^.Tex <> nil then |
6999 | 516 |
DrawTextureCentered(sx, sy - 40, CurAmmoGear^.Tex) |
4388 | 517 |
end; |
6580
6155187bf599
A partial reformatting of the pascal code to have consistent syntax. Things that are still inconsistent.
lovelacer
parents:
6508
diff
changeset
|
518 |
gtLandGun: |
6999 | 519 |
begin DrawSpriteRotated(sprHandBallgun, hx, hy, sign, aangle); |
6580
6155187bf599
A partial reformatting of the pascal code to have consistent syntax. Things that are still inconsistent.
lovelacer
parents:
6508
diff
changeset
|
520 |
if CurAmmoGear^.Tex <> nil then |
6999 | 521 |
DrawTextureCentered(sx, sy - 40, CurAmmoGear^.Tex) |
5025
ac1691d35cf2
Land sprayer tweaks, make land spray and mudball not end turn
nemo
parents:
5024
diff
changeset
|
522 |
end; |
7093 | 523 |
gtIceGun: |
524 |
begin DrawSpriteRotated(sprHandBallgun, hx, hy, sign, aangle); |
|
525 |
if CurAmmoGear^.Tex <> nil then |
|
526 |
DrawTextureCentered(sx, sy - 40, CurAmmoGear^.Tex) |
|
527 |
end; |
|
4388 | 528 |
end; |
529 |
||
530 |
case CurAmmoGear^.Kind of |
|
531 |
gtShotgunShot, |
|
532 |
gtDEagleShot, |
|
533 |
gtSniperRifleShot, |
|
6580
6155187bf599
A partial reformatting of the pascal code to have consistent syntax. Things that are still inconsistent.
lovelacer
parents:
6508
diff
changeset
|
534 |
gtShover: |
6155187bf599
A partial reformatting of the pascal code to have consistent syntax. Things that are still inconsistent.
lovelacer
parents:
6508
diff
changeset
|
535 |
begin |
6155187bf599
A partial reformatting of the pascal code to have consistent syntax. Things that are still inconsistent.
lovelacer
parents:
6508
diff
changeset
|
536 |
DrawHedgehog(sx, sy, sign, 0, 4, 0); |
4388 | 537 |
defaultPos:= false; |
538 |
HatVisible:= true |
|
539 |
end |
|
540 |
end |
|
541 |
end else |
|
542 |
||
543 |
if ((Gear^.State and gstHHJumping) <> 0) then |
|
544 |
begin |
|
545 |
DrawHedgehog(sx, sy, |
|
546 |
sign*m, |
|
547 |
1, |
|
548 |
1, |
|
549 |
0); |
|
550 |
HatVisible:= true; |
|
551 |
defaultPos:= false |
|
552 |
end else |
|
553 |
||
554 |
if (Gear^.Message and (gmLeft or gmRight) <> 0) and (not isCursorVisible) then |
|
555 |
begin |
|
556 |
DrawHedgehog(sx, sy, |
|
557 |
sign, |
|
558 |
0, |
|
559 |
HH^.visStepPos div 2, |
|
560 |
0); |
|
561 |
defaultPos:= false; |
|
562 |
HatVisible:= true |
|
563 |
end |
|
564 |
else |
|
565 |
||
566 |
if ((Gear^.State and gstAnimation) <> 0) then |
|
567 |
begin |
|
568 |
if (TWave(Gear^.Tag) < Low(TWave)) or (TWave(Gear^.Tag) > High(TWave)) then |
|
569 |
begin |
|
6453
11c578d30bd3
Countless imporvements to the parser and countless help to the parser in sources.
unc0rr
parents:
6328
diff
changeset
|
570 |
Gear^.State:= Gear^.State and (not gstAnimation); |
4388 | 571 |
end |
572 |
else |
|
573 |
begin |
|
6999 | 574 |
DrawSpriteRotatedF(Wavez[TWave(Gear^.Tag)].Sprite, |
4388 | 575 |
sx, |
576 |
sy, |
|
577 |
Gear^.Pos, |
|
578 |
sign, |
|
579 |
0.0); |
|
580 |
defaultPos:= false |
|
581 |
end |
|
582 |
end |
|
583 |
else |
|
584 |
if ((Gear^.State and gstAttacked) = 0) then |
|
585 |
begin |
|
586 |
if HH^.Timer > 0 then |
|
587 |
begin |
|
588 |
// There must be a tidier way to do this. Anyone? |
|
6580
6155187bf599
A partial reformatting of the pascal code to have consistent syntax. Things that are still inconsistent.
lovelacer
parents:
6508
diff
changeset
|
589 |
if aangle <= 90 then |
6155187bf599
A partial reformatting of the pascal code to have consistent syntax. Things that are still inconsistent.
lovelacer
parents:
6508
diff
changeset
|
590 |
aangle:= aangle+360; |
6155187bf599
A partial reformatting of the pascal code to have consistent syntax. Things that are still inconsistent.
lovelacer
parents:
6508
diff
changeset
|
591 |
if Gear^.dX > _0 then |
6155187bf599
A partial reformatting of the pascal code to have consistent syntax. Things that are still inconsistent.
lovelacer
parents:
6508
diff
changeset
|
592 |
aangle:= aangle-((aangle-240)*HH^.Timer/10) |
6155187bf599
A partial reformatting of the pascal code to have consistent syntax. Things that are still inconsistent.
lovelacer
parents:
6508
diff
changeset
|
593 |
else |
6155187bf599
A partial reformatting of the pascal code to have consistent syntax. Things that are still inconsistent.
lovelacer
parents:
6508
diff
changeset
|
594 |
aangle:= aangle+((240-aangle)*HH^.Timer/10); |
4388 | 595 |
dec(HH^.Timer) |
596 |
end; |
|
597 |
amt:= CurrentHedgehog^.CurAmmoType; |
|
6924 | 598 |
CurWeapon:= GetCurAmmoEntry(HH^); |
4388 | 599 |
case amt of |
6999 | 600 |
amBazooka: DrawSpriteRotated(sprHandBazooka, hx, hy, sign, aangle); |
601 |
amSnowball: DrawSpriteRotated(sprHandSnowball, hx, hy, sign, aangle); |
|
602 |
amMortar: DrawSpriteRotated(sprHandMortar, hx, hy, sign, aangle); |
|
603 |
amMolotov: DrawSpriteRotated(sprHandMolotov, hx, hy, sign, aangle); |
|
604 |
amBallgun: DrawSpriteRotated(sprHandBallgun, hx, hy, sign, aangle); |
|
605 |
amDrill: DrawSpriteRotated(sprHandDrill, hx, hy, sign, aangle); |
|
606 |
amRope: DrawSpriteRotated(sprHandRope, hx, hy, sign, aangle); |
|
607 |
amShotgun: DrawSpriteRotated(sprHandShotgun, hx, hy, sign, aangle); |
|
608 |
amDEagle: DrawSpriteRotated(sprHandDEagle, hx, hy, sign, aangle); |
|
609 |
amSineGun: DrawSpriteRotatedF(sprHandSinegun, hx, hy, 73 + (sign * LongInt(RealTicks div 73)) mod 8, sign, aangle); |
|
6580
6155187bf599
A partial reformatting of the pascal code to have consistent syntax. Things that are still inconsistent.
lovelacer
parents:
6508
diff
changeset
|
610 |
|
6155187bf599
A partial reformatting of the pascal code to have consistent syntax. Things that are still inconsistent.
lovelacer
parents:
6508
diff
changeset
|
611 |
amPortalGun: |
6155187bf599
A partial reformatting of the pascal code to have consistent syntax. Things that are still inconsistent.
lovelacer
parents:
6508
diff
changeset
|
612 |
if (CurWeapon^.Timer and 2) <> 0 then // Add a new Hedgehog value instead of abusing timer? |
6999 | 613 |
DrawSpriteRotatedF(sprPortalGun, hx, hy, 0, sign, aangle) |
6580
6155187bf599
A partial reformatting of the pascal code to have consistent syntax. Things that are still inconsistent.
lovelacer
parents:
6508
diff
changeset
|
614 |
else |
6999 | 615 |
DrawSpriteRotatedF(sprPortalGun, hx, hy, 1+CurWeapon^.Pos, sign, aangle); |
6580
6155187bf599
A partial reformatting of the pascal code to have consistent syntax. Things that are still inconsistent.
lovelacer
parents:
6508
diff
changeset
|
616 |
|
6999 | 617 |
amSniperRifle: DrawSpriteRotatedF(sprSniperRifle, hx, hy, 0, sign, aangle); |
618 |
amBlowTorch: DrawSpriteRotated(sprHandBlowTorch, hx, hy, sign, aangle); |
|
619 |
amCake: DrawSpriteRotated(sprHandCake, hx, hy, sign, aangle); |
|
620 |
amGrenade: DrawSpriteRotated(sprHandGrenade, hx, hy, sign, aangle); |
|
621 |
amWatermelon: DrawSpriteRotated(sprHandMelon, hx, hy, sign, aangle); |
|
622 |
amSkip: DrawSpriteRotated(sprHandSkip, hx, hy, sign, aangle); |
|
623 |
amClusterBomb: DrawSpriteRotated(sprHandCluster, hx, hy, sign, aangle); |
|
624 |
amDynamite: DrawSpriteRotated(sprHandDynamite, hx, hy, sign, aangle); |
|
625 |
amHellishBomb: DrawSpriteRotated(sprHandHellish, hx, hy, sign, aangle); |
|
626 |
amGasBomb: DrawSpriteRotated(sprHandCheese, hx, hy, sign, aangle); |
|
627 |
amMine: DrawSpriteRotated(sprHandMine, hx, hy, sign, aangle); |
|
628 |
amSMine: DrawSpriteRotated(sprHandSMine, hx, hy, sign, aangle); |
|
5525 | 629 |
amSeduction: begin |
6999 | 630 |
DrawSpriteRotated(sprHandSeduction, hx, hy, sign, aangle); |
5561
dfbe55237c64
Shrink number of circle points to 60, reenable seduction circle (no longer crashes)
nemo
parents:
5560
diff
changeset
|
631 |
DrawCircle(ox, oy, 248, 4, $FF, $00, $00, $AA); |
dfbe55237c64
Shrink number of circle points to 60, reenable seduction circle (no longer crashes)
nemo
parents:
5560
diff
changeset
|
632 |
//Tint($FF, $0, $0, $AA); |
dfbe55237c64
Shrink number of circle points to 60, reenable seduction circle (no longer crashes)
nemo
parents:
5560
diff
changeset
|
633 |
//DrawTexture(ox - 240, oy - 240, SpritesData[sprVampiric].Texture, 10); |
dfbe55237c64
Shrink number of circle points to 60, reenable seduction circle (no longer crashes)
nemo
parents:
5560
diff
changeset
|
634 |
//Tint($FF, $FF, $FF, $FF); |
5525 | 635 |
end; |
6999 | 636 |
amVampiric: DrawSpriteRotatedF(sprHandVamp, hx, hy, (RealTicks div 125) mod 4, sign, aangle); |
4388 | 637 |
amRCPlane: begin |
6999 | 638 |
DrawSpriteRotated(sprHandPlane, hx, hy, sign, 0); |
4388 | 639 |
defaultPos:= false |
640 |
end; |
|
641 |
amGirder: begin |
|
6999 | 642 |
DrawSpriteRotated(sprHandConstruction, hx, hy, sign, aangle); |
4388 | 643 |
DrawSpriteClipped(sprGirder, |
644 |
ox-256, |
|
645 |
oy-256, |
|
646 |
LongInt(topY)+WorldDy, |
|
647 |
LongInt(rightX)+WorldDx, |
|
648 |
cWaterLine+WorldDy, |
|
649 |
LongInt(leftX)+WorldDx) |
|
650 |
end; |
|
6999 | 651 |
amBee: DrawSpriteRotatedF(sprHandBee, hx, hy, (RealTicks div 125) mod 4, sign, aangle); |
652 |
amFlamethrower: DrawSpriteRotatedF(sprHandFlamethrower, hx, hy, (RealTicks div 125) mod 4, sign, aangle); |
|
653 |
amLandGun: DrawSpriteRotated(sprHandBallgun, hx, hy, sign, aangle); |
|
7093 | 654 |
amIceGun: DrawSpriteRotated(sprHandBallgun, hx, hy, sign, aangle); |
4388 | 655 |
amResurrector: DrawCircle(ox, oy, 98, 4, $F5, $DB, $35, $AA); // I'd rather not like to hardcode 100 here |
656 |
end; |
|
657 |
||
658 |
case amt of |
|
659 |
amAirAttack, |
|
660 |
amMineStrike, |
|
6999 | 661 |
amDrillStrike: DrawSpriteRotated(sprHandAirAttack, sx, oy, sign, 0); |
4388 | 662 |
amPickHammer: DrawHedgehog(sx, sy, |
663 |
sign, |
|
664 |
1, |
|
665 |
2, |
|
666 |
0); |
|
6999 | 667 |
amTeleport: DrawSpriteRotatedF(sprTeleport, sx, sy, 0, sign, 0); |
4388 | 668 |
amKamikaze: DrawHedgehog(sx, sy, |
669 |
sign, |
|
670 |
1, |
|
671 |
5, |
|
672 |
0); |
|
6999 | 673 |
amWhip: DrawSpriteRotatedF(sprWhip, |
4388 | 674 |
sx, |
675 |
sy, |
|
676 |
0, |
|
677 |
sign, |
|
678 |
0); |
|
6999 | 679 |
amHammer: DrawSpriteRotatedF(sprHammer, |
4388 | 680 |
sx, |
681 |
sy, |
|
682 |
0, |
|
683 |
sign, |
|
684 |
0); |
|
685 |
else |
|
686 |
DrawHedgehog(sx, sy, |
|
687 |
sign, |
|
688 |
0, |
|
689 |
4, |
|
690 |
0); |
|
691 |
||
692 |
HatVisible:= true; |
|
693 |
(* with HH^ do |
|
694 |
if (HatTex <> nil) |
|
695 |
and (HatVisibility > 0) then |
|
696 |
DrawTextureF(HatTex, |
|
697 |
HatVisibility, |
|
698 |
sx, |
|
699 |
sy - 5, |
|
700 |
0, |
|
701 |
sign, |
|
702 |
32, |
|
703 |
32); *) |
|
704 |
end; |
|
705 |
||
706 |
case amt of |
|
6999 | 707 |
amBaseballBat: DrawSpriteRotated(sprHandBaseball, |
4388 | 708 |
sx - 4 * sign, |
709 |
sy + 9, sign, aangle); |
|
710 |
end; |
|
711 |
||
712 |
defaultPos:= false |
|
713 |
end; |
|
714 |
||
715 |
end else // not gstHHDriven |
|
716 |
begin |
|
717 |
if (Gear^.Damage > 0) |
|
718 |
and (hwSqr(Gear^.dX) + hwSqr(Gear^.dY) > _0_003) then |
|
719 |
begin |
|
720 |
DrawHedgehog(sx, sy, |
|
721 |
sign, |
|
722 |
2, |
|
723 |
1, |
|
724 |
Gear^.DirAngle); |
|
725 |
defaultPos:= false |
|
726 |
end else |
|
727 |
||
728 |
if ((Gear^.State and gstHHJumping) <> 0) then |
|
729 |
begin |
|
730 |
DrawHedgehog(sx, sy, |
|
731 |
sign*m, |
|
732 |
1, |
|
733 |
1, |
|
734 |
0); |
|
735 |
defaultPos:= false |
|
736 |
end; |
|
737 |
end; |
|
738 |
||
739 |
with HH^ do |
|
740 |
begin |
|
741 |
if defaultPos then |
|
742 |
begin |
|
6999 | 743 |
DrawSpriteRotatedF(sprHHIdle, |
4388 | 744 |
sx, |
745 |
sy, |
|
746 |
(RealTicks div 128 + Gear^.Pos) mod 19, |
|
747 |
sign, |
|
748 |
0); |
|
749 |
HatVisible:= true; |
|
750 |
end; |
|
751 |
||
752 |
if HatVisible then |
|
753 |
if HatVisibility < 1.0 then |
|
754 |
HatVisibility:= HatVisibility + 0.2 |
|
755 |
else |
|
756 |
else |
|
757 |
if HatVisibility > 0.0 then |
|
758 |
HatVisibility:= HatVisibility - 0.2; |
|
759 |
||
760 |
if (HatTex <> nil) |
|
761 |
and (HatVisibility > 0) then |
|
762 |
if DefaultPos then |
|
763 |
begin |
|
764 |
DrawTextureF(HatTex, |
|
765 |
HatVisibility, |
|
766 |
sx, |
|
767 |
sy - 5, |
|
768 |
(RealTicks div 128 + Gear^.Pos) mod 19, |
|
769 |
sign, |
|
770 |
32, |
|
771 |
32); |
|
772 |
if HatTex^.w > 64 then |
|
773 |
begin |
|
4810 | 774 |
Tint(HH^.Team^.Clan^.Color shl 8 or $FF); |
4388 | 775 |
DrawTextureF(HatTex, |
776 |
HatVisibility, |
|
777 |
sx, |
|
778 |
sy - 5, |
|
779 |
(RealTicks div 128 + Gear^.Pos) mod 19 + 32, |
|
780 |
sign, |
|
781 |
32, |
|
782 |
32); |
|
783 |
Tint($FF, $FF, $FF, $FF) |
|
784 |
end |
|
785 |
end |
|
786 |
else |
|
787 |
begin |
|
788 |
DrawTextureF(HatTex, |
|
789 |
HatVisibility, |
|
790 |
sx, |
|
791 |
sy - 5, |
|
792 |
0, |
|
793 |
sign*m, |
|
794 |
32, |
|
795 |
32); |
|
796 |
if HatTex^.w > 64 then |
|
797 |
begin |
|
4810 | 798 |
Tint(HH^.Team^.Clan^.Color shl 8 or $FF); |
4388 | 799 |
DrawTextureF(HatTex, |
800 |
HatVisibility, |
|
801 |
sx, |
|
802 |
sy - 5, |
|
803 |
32, |
|
804 |
sign*m, |
|
805 |
32, |
|
806 |
32); |
|
807 |
Tint($FF, $FF, $FF, $FF) |
|
808 |
end |
|
809 |
end |
|
810 |
end; |
|
811 |
if (Gear^.State and gstHHDriven) <> 0 then |
|
812 |
begin |
|
813 |
(* if (CurAmmoGear = nil) then |
|
814 |
begin |
|
815 |
amt:= CurrentHedgehog^.CurAmmoType; |
|
816 |
case amt of |
|
817 |
amJetpack: DrawSprite(sprJetpack, sx-32, sy-32, 0); |
|
818 |
end |
|
819 |
end; *) |
|
820 |
if CurAmmoGear <> nil then |
|
821 |
begin |
|
822 |
case CurAmmoGear^.Kind of |
|
823 |
gtJetpack: begin |
|
824 |
DrawSprite(sprJetpack, sx-32, sy-32, 0); |
|
825 |
if cWaterLine > hwRound(Gear^.Y) + Gear^.Radius then |
|
826 |
begin |
|
6580
6155187bf599
A partial reformatting of the pascal code to have consistent syntax. Things that are still inconsistent.
lovelacer
parents:
6508
diff
changeset
|
827 |
if (CurAmmoGear^.MsgParam and gmUp) <> 0 then |
6155187bf599
A partial reformatting of the pascal code to have consistent syntax. Things that are still inconsistent.
lovelacer
parents:
6508
diff
changeset
|
828 |
DrawSprite(sprJetpack, sx-32, sy-28, 1); |
6155187bf599
A partial reformatting of the pascal code to have consistent syntax. Things that are still inconsistent.
lovelacer
parents:
6508
diff
changeset
|
829 |
if (CurAmmoGear^.MsgParam and gmLeft) <> 0 then |
6155187bf599
A partial reformatting of the pascal code to have consistent syntax. Things that are still inconsistent.
lovelacer
parents:
6508
diff
changeset
|
830 |
DrawSprite(sprJetpack, sx-28, sy-28, 2); |
6155187bf599
A partial reformatting of the pascal code to have consistent syntax. Things that are still inconsistent.
lovelacer
parents:
6508
diff
changeset
|
831 |
if (CurAmmoGear^.MsgParam and gmRight) <> 0 then |
6155187bf599
A partial reformatting of the pascal code to have consistent syntax. Things that are still inconsistent.
lovelacer
parents:
6508
diff
changeset
|
832 |
DrawSprite(sprJetpack, sx-36, sy-28, 3) |
4388 | 833 |
end; |
6580
6155187bf599
A partial reformatting of the pascal code to have consistent syntax. Things that are still inconsistent.
lovelacer
parents:
6508
diff
changeset
|
834 |
if CurAmmoGear^.Tex <> nil then |
6999 | 835 |
DrawTextureCentered(sx, sy - 40, CurAmmoGear^.Tex); |
4388 | 836 |
DrawAltWeapon(Gear, sx, sy) |
837 |
end; |
|
838 |
end; |
|
839 |
end |
|
840 |
end; |
|
841 |
||
842 |
with HH^ do |
|
843 |
begin |
|
6453
11c578d30bd3
Countless imporvements to the parser and countless help to the parser in sources.
unc0rr
parents:
6328
diff
changeset
|
844 |
if ((Gear^.State and (not gstWinner)) = 0) |
4388 | 845 |
or ((Gear^.State = gstWait) and (Gear^.dY.QWordValue = 0)) |
846 |
or (bShowFinger and ((Gear^.State and gstHHDriven) <> 0)) then |
|
847 |
begin |
|
848 |
t:= sy - cHHRadius - 9; |
|
849 |
if (cTagsMask and htTransparent) <> 0 then |
|
850 |
Tint($FF, $FF, $FF, $80); |
|
851 |
if ((cTagsMask and htHealth) <> 0) then |
|
852 |
begin |
|
853 |
dec(t, HealthTagTex^.h + 2); |
|
6999 | 854 |
DrawTextureCentered(ox, t, HealthTagTex) |
4388 | 855 |
end; |
856 |
if (cTagsMask and htName) <> 0 then |
|
857 |
begin |
|
858 |
dec(t, NameTagTex^.h + 2); |
|
6999 | 859 |
DrawTextureCentered(ox, t, NameTagTex) |
4388 | 860 |
end; |
861 |
if (cTagsMask and htTeamName) <> 0 then |
|
862 |
begin |
|
863 |
dec(t, Team^.NameTagTex^.h + 2); |
|
6999 | 864 |
DrawTextureCentered(ox, t, Team^.NameTagTex) |
4388 | 865 |
end; |
866 |
if (cTagsMask and htTransparent) <> 0 then |
|
867 |
Tint($FF, $FF, $FF, $FF) |
|
868 |
end; |
|
869 |
if (Gear^.State and gstHHDriven) <> 0 then // Current hedgehog |
|
870 |
begin |
|
4394 | 871 |
if (CurAmmoGear <> nil) and (CurAmmoGear^.Kind = gtResurrector) then |
6999 | 872 |
DrawTextureCentered(ox, sy - cHHRadius - 7 - HealthTagTex^.h, HealthTagTex); |
4394 | 873 |
|
4388 | 874 |
if bShowFinger and ((Gear^.State and gstHHDriven) <> 0) then |
875 |
DrawSprite(sprFinger, ox - 16, oy - 64, |
|
876 |
GameTicks div 32 mod 16); |
|
877 |
||
878 |
if (Gear^.State and gstDrowning) = 0 then |
|
879 |
if (Gear^.State and gstHHThinking) <> 0 then |
|
880 |
DrawSprite(sprQuestion, ox - 10, oy - cHHRadius - 34, (RealTicks shr 9) mod 8) |
|
881 |
end |
|
882 |
end; |
|
883 |
||
7010
10a0a31804f3
Switch effects to longint for convenience of tracking ice states. I could add a new Hedgehog value, but since we have this effects list being all useless as booleans anyway...
nemo
parents:
6999
diff
changeset
|
884 |
if HH^.Effects[hePoisoned] <> 0 then |
4388 | 885 |
begin |
886 |
Tint($00, $FF, $40, $80); |
|
6999 | 887 |
DrawTextureRotatedF(SpritesData[sprSmokeWhite].texture, 1.5, 0, 0, sx, sy, 0, 1, 22, 22, 360 - (RealTicks shr 37) mod 360); |
4388 | 888 |
end; |
7010
10a0a31804f3
Switch effects to longint for convenience of tracking ice states. I could add a new Hedgehog value, but since we have this effects list being all useless as booleans anyway...
nemo
parents:
6999
diff
changeset
|
889 |
if HH^.Effects[heResurrected] <> 0 then |
4388 | 890 |
begin |
891 |
Tint($f5, $db, $35, $20); |
|
892 |
DrawSprite(sprVampiric, sx - 24, sy - 24, 0); |
|
893 |
end; |
|
894 |
||
895 |
if Gear^.Invulnerable then |
|
896 |
begin |
|
897 |
Tint($FF, $FF, $FF, max($40, round($FF * abs(1 - ((RealTicks div 2 + Gear^.uid * 491) mod 1500) / 750)))); |
|
898 |
DrawSprite(sprInvulnerable, sx - 24, sy - 24, 0); |
|
899 |
end; |
|
900 |
if cVampiric and |
|
901 |
(CurrentHedgehog^.Gear <> nil) and |
|
902 |
(CurrentHedgehog^.Gear = Gear) then |
|
903 |
begin |
|
904 |
Tint($FF, 0, 0, max($40, round($FF * abs(1 - (RealTicks mod 1500) / 750)))); |
|
905 |
DrawSprite(sprVampiric, sx - 24, sy - 24, 0); |
|
906 |
end; |
|
907 |
Tint($FF, $FF, $FF, $FF) |
|
908 |
end; |
|
909 |
||
910 |
||
911 |
procedure RenderGear(Gear: PGear; x, y: LongInt); |
|
912 |
var |
|
913 |
HHGear: PGear; |
|
7093 | 914 |
vg: PVisualGear; |
4388 | 915 |
i: Longword; |
6788
88036f0e0a92
I think this is a little more efficient than dxdy, and easier to read. We call DxDy2 a lot, can any of those use Angle/DirAngle?
nemo
parents:
6700
diff
changeset
|
916 |
aAngle: real; |
4388 | 917 |
startX, endX, startY, endY: LongInt; |
918 |
begin |
|
5612
2638dec1b323
This really should have been a TPoint for consistency
nemo
parents:
5561
diff
changeset
|
919 |
if Gear^.Target.X <> NoPointX then |
5507
1040c0946ef8
This should make bee/airstrikes play nicer with infinite attack mode
nemo
parents:
5472
diff
changeset
|
920 |
if Gear^.AmmoType = amBee then |
6999 | 921 |
DrawSpriteRotatedF(sprTargetBee, Gear^.Target.X + WorldDx, Gear^.Target.Y + WorldDy, 0, 0, (RealTicks shr 3) mod 360) |
7010
10a0a31804f3
Switch effects to longint for convenience of tracking ice states. I could add a new Hedgehog value, but since we have this effects list being all useless as booleans anyway...
nemo
parents:
6999
diff
changeset
|
922 |
else if Gear^.AmmoType = amIceGun then |
7093 | 923 |
//DrawSprite(sprSnowDust, Gear^.Target.X + WorldDx, Gear^.Target.Y + WorldDy, (RealTicks shr 2) mod 8) |
924 |
//DrawTextureRotatedF(SpritesData[sprSnowDust].Texture, 1, 0, 0, Gear^.Target.X + WorldDx, Gear^.Target.Y + WorldDy, (RealTicks shr 2) mod 8, 1, 22, 22, (RealTicks shr 3) mod 360) |
|
925 |
DrawTextureRotatedF(SpritesData[sprSnowDust].Texture, 1/(1+(RealTicks shr 8) mod 5), 0, 0, Gear^.Target.X + WorldDx, Gear^.Target.Y + WorldDy, (RealTicks shr 2) mod 8, 1, 22, 22, (RealTicks shr 3) mod 360) |
|
7010
10a0a31804f3
Switch effects to longint for convenience of tracking ice states. I could add a new Hedgehog value, but since we have this effects list being all useless as booleans anyway...
nemo
parents:
6999
diff
changeset
|
926 |
else |
10a0a31804f3
Switch effects to longint for convenience of tracking ice states. I could add a new Hedgehog value, but since we have this effects list being all useless as booleans anyway...
nemo
parents:
6999
diff
changeset
|
927 |
DrawSpriteRotatedF(sprTargetP, Gear^.Target.X + WorldDx, Gear^.Target.Y + WorldDy, 0, 0, (RealTicks shr 3) mod 360); |
5507
1040c0946ef8
This should make bee/airstrikes play nicer with infinite attack mode
nemo
parents:
5472
diff
changeset
|
928 |
|
4388 | 929 |
case Gear^.Kind of |
6999 | 930 |
gtGrenade: DrawSpriteRotated(sprBomb, x, y, 0, Gear^.DirAngle); |
931 |
gtSnowball: DrawSpriteRotated(sprSnowball, x, y, 0, Gear^.DirAngle); |
|
932 |
gtGasBomb: DrawSpriteRotated(sprCheese, x, y, 0, Gear^.DirAngle); |
|
5871
09daa06191d7
Since we are tweaking molotov. make the flame flickery and add a drowning frame
nemo
parents:
5787
diff
changeset
|
933 |
|
09daa06191d7
Since we are tweaking molotov. make the flame flickery and add a drowning frame
nemo
parents:
5787
diff
changeset
|
934 |
gtMolotov: if (Gear^.State and gstDrowning) = 0 then |
6999 | 935 |
DrawSpriteRotatedF(sprMolotov, x, y, (RealTicks div 125) mod 8, hwSign(Gear^.dX), Gear^.DirAngle * hwSign(Gear^.dX)) |
5871
09daa06191d7
Since we are tweaking molotov. make the flame flickery and add a drowning frame
nemo
parents:
5787
diff
changeset
|
936 |
else DrawSprite(sprMolotov, x, y, 8); |
4388 | 937 |
|
938 |
gtRCPlane: begin |
|
6788
88036f0e0a92
I think this is a little more efficient than dxdy, and easier to read. We call DxDy2 a lot, can any of those use Angle/DirAngle?
nemo
parents:
6700
diff
changeset
|
939 |
aangle:= Gear^.Angle * 360 / 4096; |
88036f0e0a92
I think this is a little more efficient than dxdy, and easier to read. We call DxDy2 a lot, can any of those use Angle/DirAngle?
nemo
parents:
6700
diff
changeset
|
940 |
if Gear^.Tag < 0 then aangle:= 360-aangle; |
6138 | 941 |
Tint(Gear^.Hedgehog^.Team^.Clan^.Color shl 8 or $FF); |
6999 | 942 |
DrawSpriteRotatedF(sprPlane, x, y, 0, Gear^.Tag, aangle - 90); |
6788
88036f0e0a92
I think this is a little more efficient than dxdy, and easier to read. We call DxDy2 a lot, can any of those use Angle/DirAngle?
nemo
parents:
6700
diff
changeset
|
943 |
Tint($FF, $FF, $FF, $FF); |
6999 | 944 |
DrawSpriteRotatedF(sprPlane, x, y, 1, Gear^.Tag, aangle - 90) |
4388 | 945 |
end; |
6999 | 946 |
gtBall: DrawSpriteRotatedF(sprBalls, x, y, Gear^.Tag,0, Gear^.DirAngle); |
4388 | 947 |
|
948 |
gtPortal: if ((Gear^.Tag and 1) = 0) // still moving? |
|
7272
71df899c4163
Second part of the change. Make collision check use the new mask bit.
nemo
parents:
7168
diff
changeset
|
949 |
or (Gear^.LinkedGear = nil) or (Gear^.LinkedGear^.LinkedGear <> Gear) // not linked&backlinked? |
71df899c4163
Second part of the change. Make collision check use the new mask bit.
nemo
parents:
7168
diff
changeset
|
950 |
or ((Gear^.LinkedGear^.Tag and 1) = 0) then // linked portal still moving? |
6999 | 951 |
DrawSpriteRotatedF(sprPortal, x, y, Gear^.Tag, hwSign(Gear^.dX), Gear^.DirAngle) |
952 |
else DrawSpriteRotatedF(sprPortal, x, y, 4 + Gear^.Tag div 2, hwSign(Gear^.dX), Gear^.DirAngle); |
|
4388 | 953 |
|
954 |
gtDrill: if (Gear^.State and gsttmpFlag) <> 0 then |
|
6999 | 955 |
DrawSpriteRotated(sprAirDrill, x, y, 0, DxDy2Angle(Gear^.dY, Gear^.dX)) |
4388 | 956 |
else |
6999 | 957 |
DrawSpriteRotated(sprDrill, x, y, 0, DxDy2Angle(Gear^.dY, Gear^.dX)); |
4388 | 958 |
|
959 |
gtHedgehog: DrawHH(Gear, x, y); |
|
960 |
||
6999 | 961 |
gtShell: DrawSpriteRotated(sprBazookaShell, x, y, 0, DxDy2Angle(Gear^.dY, Gear^.dX)); |
4388 | 962 |
|
963 |
gtGrave: begin |
|
964 |
DrawTextureF(Gear^.Hedgehog^.Team^.GraveTex, 1, x, y, (GameTicks shr 7+Gear^.uid) and 7, 1, 32, 32); |
|
965 |
if Gear^.Health > 0 then |
|
966 |
begin |
|
967 |
//Tint($33, $33, $FF, max($40, round($FF * abs(1 - (GameTicks mod (6000 div Gear^.Health)) / 750)))); |
|
968 |
Tint($f5, $db, $35, max($40, round($FF * abs(1 - (GameTicks mod 1500) / (750 + Gear^.Health))))); |
|
969 |
//Tint($FF, $FF, $FF, max($40, round($FF * abs(1 - (RealTicks mod 1500) / 750)))); |
|
970 |
DrawSprite(sprVampiric, x - 24, y - 24, 0); |
|
971 |
Tint($FF, $FF, $FF, $FF) |
|
972 |
end |
|
973 |
end; |
|
6999 | 974 |
gtBee: DrawSpriteRotatedF(sprBee, x, y, (GameTicks shr 5) mod 2, 0, DxDy2Angle(Gear^.dY, Gear^.dX)); |
4388 | 975 |
gtPickHammer: DrawSprite(sprPHammer, x - 16, y - 50 + LongInt(((GameTicks shr 5) and 1) * 2), 0); |
976 |
gtRope: DrawRope(Gear); |
|
6580
6155187bf599
A partial reformatting of the pascal code to have consistent syntax. Things that are still inconsistent.
lovelacer
parents:
6508
diff
changeset
|
977 |
|
4388 | 978 |
gtMine: if (((Gear^.State and gstAttacking) = 0)or((Gear^.Timer and $3FF) < 420)) and (Gear^.Health <> 0) then |
6999 | 979 |
DrawSpriteRotated(sprMineOff, x, y, 0, Gear^.DirAngle) |
6580
6155187bf599
A partial reformatting of the pascal code to have consistent syntax. Things that are still inconsistent.
lovelacer
parents:
6508
diff
changeset
|
980 |
else if Gear^.Health <> 0 then |
6999 | 981 |
DrawSpriteRotated(sprMineOn, x, y, 0, Gear^.DirAngle) |
982 |
else DrawSpriteRotated(sprMineDead, x, y, 0, Gear^.DirAngle); |
|
6580
6155187bf599
A partial reformatting of the pascal code to have consistent syntax. Things that are still inconsistent.
lovelacer
parents:
6508
diff
changeset
|
983 |
|
4388 | 984 |
gtSMine: if (((Gear^.State and gstAttacking) = 0)or((Gear^.Timer and $3FF) < 420)) and (Gear^.Health <> 0) then |
6999 | 985 |
DrawSpriteRotated(sprSMineOff, x, y, 0, Gear^.DirAngle) |
6580
6155187bf599
A partial reformatting of the pascal code to have consistent syntax. Things that are still inconsistent.
lovelacer
parents:
6508
diff
changeset
|
986 |
else if Gear^.Health <> 0 then |
6999 | 987 |
DrawSpriteRotated(sprSMineOn, x, y, 0, Gear^.DirAngle) |
988 |
else DrawSpriteRotated(sprMineDead, x, y, 0, Gear^.DirAngle); |
|
6580
6155187bf599
A partial reformatting of the pascal code to have consistent syntax. Things that are still inconsistent.
lovelacer
parents:
6508
diff
changeset
|
989 |
|
7168
8defaabce92e
warp sound when AI survival hog respawns. attempt at a bit of a crate spawn animation (moar sparkles and a quick fadein)
nemo
parents:
7165
diff
changeset
|
990 |
gtCase: begin |
7276 | 991 |
if Gear^.Timer > 1000 then |
5313
5e18eaef65d0
now scripts can create unique crates: dummy (empty) crates and booby traps. scripts can also set health crate values
Henek
parents:
5197
diff
changeset
|
992 |
begin |
7276 | 993 |
if ((Gear^.Pos and posCaseAmmo) <> 0) then |
994 |
begin |
|
995 |
i:= (GameTicks shr 6) mod 64; |
|
996 |
if i > 18 then |
|
997 |
i:= 0; |
|
998 |
DrawSprite(sprCase, x - 24, y - 24, i); |
|
999 |
end |
|
1000 |
else if ((Gear^.Pos and posCaseHealth) <> 0) then |
|
1001 |
begin |
|
1002 |
i:= ((GameTicks shr 6) + 38) mod 64; |
|
1003 |
if i > 13 then |
|
1004 |
i:= 0; |
|
1005 |
DrawSprite(sprFAid, x - 24, y - 24, i); |
|
1006 |
end |
|
1007 |
else if ((Gear^.Pos and posCaseUtility) <> 0) then |
|
1008 |
begin |
|
1009 |
i:= (GameTicks shr 6) mod 70; |
|
1010 |
if i > 23 then |
|
1011 |
i:= 0; |
|
1012 |
i:= i mod 12; |
|
1013 |
DrawSprite(sprUtility, x - 24, y - 24, i); |
|
1014 |
end; |
|
1015 |
end; |
|
7337
c224cd2d32f3
Allow script to set number of ammo in a crate. untested.
nemo
parents:
7276
diff
changeset
|
1016 |
if Gear^.Timer < 1833 then |
5313
5e18eaef65d0
now scripts can create unique crates: dummy (empty) crates and booby traps. scripts can also set health crate values
Henek
parents:
5197
diff
changeset
|
1017 |
begin |
7276 | 1018 |
DrawTextureRotatedF(SpritesData[sprPortal].texture, min(abs(1.25 - (Gear^.Timer mod 1333) / 400), 1.25), 0, 0, |
7339 | 1019 |
x, Gear^.Angle+WorldDy-16, 4+Gear^.Tag, 1, 32, 32, 270); |
7276 | 1020 |
end |
7168
8defaabce92e
warp sound when AI survival hog respawns. attempt at a bit of a crate spawn animation (moar sparkles and a quick fadein)
nemo
parents:
7165
diff
changeset
|
1021 |
end; |
4388 | 1022 |
gtExplosives: begin |
1023 |
if ((Gear^.State and gstDrowning) <> 0) then |
|
1024 |
DrawSprite(sprExplosivesRoll, x - 24, y - 24, 0) |
|
1025 |
else if Gear^.State and gstAnimation = 0 then |
|
1026 |
begin |
|
1027 |
i:= (GameTicks shr 6 + Gear^.uid*3) mod 64; |
|
6580
6155187bf599
A partial reformatting of the pascal code to have consistent syntax. Things that are still inconsistent.
lovelacer
parents:
6508
diff
changeset
|
1028 |
if i > 18 then |
6155187bf599
A partial reformatting of the pascal code to have consistent syntax. Things that are still inconsistent.
lovelacer
parents:
6508
diff
changeset
|
1029 |
i:= 0; |
4388 | 1030 |
DrawSprite(sprExplosives, x - 24, y - 24, i) |
1031 |
end |
|
1032 |
else if Gear^.State and gsttmpFlag = 0 then |
|
6999 | 1033 |
DrawSpriteRotatedF(sprExplosivesRoll, x, y + 4, 0, 0, Gear^.DirAngle) |
4388 | 1034 |
else |
6999 | 1035 |
DrawSpriteRotatedF(sprExplosivesRoll, x, y + 4, 1, 0, Gear^.DirAngle); |
4388 | 1036 |
end; |
7304
8b3575750cd2
Added auto cropping to atlasing
Wolfgang Steffens <WolfgangSteff@gmail.com>
parents:
7288
diff
changeset
|
1037 |
gtDynamite: begin writeln(stdout, 'FIXME'); halt(-3); end; //DrawSprite(sprDynamite, x - 16, y - 25, Gear^.Tag and 1, Gear^.Tag shr 1); |
6999 | 1038 |
gtClusterBomb: DrawSpriteRotated(sprClusterBomb, x, y, 0, Gear^.DirAngle); |
4388 | 1039 |
gtCluster: DrawSprite(sprClusterParticle, x - 8, y - 8, 0); |
6324 | 1040 |
gtFlame: if Gear^.Tag and 1 = 0 then |
1041 |
DrawTextureF(SpritesData[sprFlame].Texture, 2 / (Gear^.Tag mod 3 + 2), x, y, (GameTicks shr 7 + LongWord(Gear^.Tag)) mod 8, 1, 16, 16) |
|
1042 |
else DrawTextureF(SpritesData[sprFlame].Texture, 2 / (Gear^.Tag mod 3 + 2), x, y, (GameTicks shr 7 + LongWord(Gear^.Tag)) mod 8, -1, 16, 16); |
|
4388 | 1043 |
gtParachute: begin |
1044 |
DrawSprite(sprParachute, x - 24, y - 48, 0); |
|
1045 |
DrawAltWeapon(Gear, x + 1, y - 3) |
|
1046 |
end; |
|
6308 | 1047 |
gtAirAttack: begin |
1048 |
Tint(Gear^.Hedgehog^.Team^.Clan^.Color shl 8 or $FF); |
|
6999 | 1049 |
DrawSpriteRotatedF(sprAirplane, x, y, 0, Gear^.Tag, 0); |
6308 | 1050 |
Tint($FF, $FF, $FF, $FF); |
6999 | 1051 |
DrawSpriteRotatedF(sprAirplane, x, y, 1, Gear^.Tag, 0); |
6308 | 1052 |
end; |
6999 | 1053 |
gtAirBomb: DrawSpriteRotated(sprAirBomb, x, y, 0, DxDy2Angle(Gear^.dY, Gear^.dX)); |
4388 | 1054 |
gtTeleport: begin |
1055 |
HHGear:= Gear^.Hedgehog^.Gear; |
|
6580
6155187bf599
A partial reformatting of the pascal code to have consistent syntax. Things that are still inconsistent.
lovelacer
parents:
6508
diff
changeset
|
1056 |
if not Gear^.Hedgehog^.Unplaced then |
6999 | 1057 |
DrawSpriteRotatedF(sprTeleport, x + 1, y - 3, Gear^.Pos, hwSign(Gear^.dX), 0); |
1058 |
DrawSpriteRotatedF(sprTeleport, hwRound(HHGear^.X) + 1 + WorldDx, hwRound(HHGear^.Y) - 3 + WorldDy, 11 - Gear^.Pos, hwSign(HHGear^.dX), 0); |
|
4388 | 1059 |
end; |
1060 |
gtSwitcher: DrawSprite(sprSwitch, x - 16, y - 56, (GameTicks shr 6) mod 12); |
|
1061 |
gtTarget: begin |
|
1062 |
Tint($FF, $FF, $FF, round($FF * Gear^.Timer / 1000)); |
|
1063 |
DrawSprite(sprTarget, x - 16, y - 16, 0); |
|
1064 |
Tint($FF, $FF, $FF, $FF); |
|
1065 |
end; |
|
6999 | 1066 |
gtMortar: DrawSpriteRotated(sprMortar, x, y, 0, DxDy2Angle(Gear^.dY, Gear^.dX)); |
4388 | 1067 |
gtCake: if Gear^.Pos = 6 then |
6999 | 1068 |
DrawSpriteRotatedF(sprCakeWalk, x, y, (GameTicks div 40) mod 6, hwSign(Gear^.dX), Gear^.DirAngle * hwSign(Gear^.dX) + 90) |
4388 | 1069 |
else |
6999 | 1070 |
DrawSpriteRotatedF(sprCakeDown, x, y, 5 - Gear^.Pos, hwSign(Gear^.dX), Gear^.DirAngle * hwSign(Gear^.dX) + 90); |
6580
6155187bf599
A partial reformatting of the pascal code to have consistent syntax. Things that are still inconsistent.
lovelacer
parents:
6508
diff
changeset
|
1071 |
gtSeduction: if Gear^.Pos >= 14 then |
6155187bf599
A partial reformatting of the pascal code to have consistent syntax. Things that are still inconsistent.
lovelacer
parents:
6508
diff
changeset
|
1072 |
DrawSprite(sprSeduction, x - 16, y - 16, 0); |
6155187bf599
A partial reformatting of the pascal code to have consistent syntax. Things that are still inconsistent.
lovelacer
parents:
6508
diff
changeset
|
1073 |
|
6999 | 1074 |
gtWatermelon: DrawSpriteRotatedF(sprWatermelon, x, y, 0, 0, Gear^.DirAngle); |
1075 |
gtMelonPiece: DrawSpriteRotatedF(sprWatermelon, x, y, 1, 0, Gear^.DirAngle); |
|
1076 |
gtHellishBomb: DrawSpriteRotated(sprHellishBomb, x, y, 0, Gear^.DirAngle); |
|
4388 | 1077 |
gtBirdy: begin |
1078 |
if Gear^.State and gstAnimation = gstAnimation then |
|
1079 |
begin |
|
1080 |
if Gear^.State and gstTmpFlag = 0 then // Appearing |
|
1081 |
begin |
|
1082 |
endX:= x - WorldDx; |
|
1083 |
endY:= y - WorldDy; |
|
1084 |
if Gear^.Tag < 0 then |
|
1085 |
startX:= max(LAND_WIDTH + 1024, endX + 2048) |
|
1086 |
else |
|
1087 |
startX:= max(-LAND_WIDTH - 1024, endX - 2048); |
|
1088 |
startY:= endY - 256; |
|
5179
8d64dcb566ea
Fix "Mixing signed expressions and longwords gives a 64bit result" warnings
unc0rr
parents:
5145
diff
changeset
|
1089 |
DrawTextureF(SpritesData[sprBirdy].Texture, 1, startX + WorldDx + LongInt(round((endX - startX) * (-power(2, -10 * LongInt(Gear^.Timer)/2000) + 1))), startY + WorldDy + LongInt(round((endY - startY) * sqrt(1 - power((LongInt(Gear^.Timer)/2000)-1, 2)))), ((Gear^.Pos shr 6) or (RealTicks shr 8)) mod 2, Gear^.Tag, 75, 75); |
4388 | 1090 |
end |
1091 |
else // Disappearing |
|
1092 |
begin |
|
1093 |
startX:= x - WorldDx; |
|
1094 |
startY:= y - WorldDy; |
|
1095 |
if Gear^.Tag > 0 then |
|
1096 |
endX:= max(LAND_WIDTH + 1024, startX + 2048) |
|
1097 |
else |
|
1098 |
endX:= max(-LAND_WIDTH - 1024, startX - 2048); |
|
1099 |
endY:= startY + 256; |
|
5179
8d64dcb566ea
Fix "Mixing signed expressions and longwords gives a 64bit result" warnings
unc0rr
parents:
5145
diff
changeset
|
1100 |
DrawTextureF(SpritesData[sprBirdy].Texture, 1, startX + WorldDx + LongInt(round((endX - startX) * power(2, 10 * (LongInt(Gear^.Timer)/2000 - 1)))) + hwRound(Gear^.dX * Gear^.Timer), startY + WorldDy + LongInt(round((endY - startY) * cos(LongInt(Gear^.Timer)/2000 * (Pi/2)) - (endY - startY))) + hwRound(Gear^.dY * Gear^.Timer), ((Gear^.Pos shr 6) or (RealTicks shr 8)) mod 2, Gear^.Tag, 75, 75); |
4388 | 1101 |
end; |
1102 |
end |
|
1103 |
else |
|
5528
c539e5c81870
slight visual tweak. birdy's wings beat faster if he's just about tired out
nemo
parents:
5526
diff
changeset
|
1104 |
begin |
c539e5c81870
slight visual tweak. birdy's wings beat faster if he's just about tired out
nemo
parents:
5526
diff
changeset
|
1105 |
if Gear^.Health < 250 then |
c539e5c81870
slight visual tweak. birdy's wings beat faster if he's just about tired out
nemo
parents:
5526
diff
changeset
|
1106 |
DrawTextureF(SpritesData[sprBirdy].Texture, 1, x, y, ((Gear^.Pos shr 6) or (RealTicks shr 7)) mod 2, Gear^.Tag, 75, 75) |
c539e5c81870
slight visual tweak. birdy's wings beat faster if he's just about tired out
nemo
parents:
5526
diff
changeset
|
1107 |
else |
c539e5c81870
slight visual tweak. birdy's wings beat faster if he's just about tired out
nemo
parents:
5526
diff
changeset
|
1108 |
DrawTextureF(SpritesData[sprBirdy].Texture, 1, x, y, ((Gear^.Pos shr 6) or (RealTicks shr 8)) mod 2, Gear^.Tag, 75, 75); |
c539e5c81870
slight visual tweak. birdy's wings beat faster if he's just about tired out
nemo
parents:
5526
diff
changeset
|
1109 |
end; |
4388 | 1110 |
end; |
6999 | 1111 |
gtEgg: DrawTextureRotatedF(SpritesData[sprEgg].Texture, 1, 0, 0, x, y, 0, 1, 16, 16, Gear^.DirAngle); |
4388 | 1112 |
gtPiano: begin |
1113 |
if (Gear^.State and gstDrowning) = 0 then |
|
1114 |
begin |
|
1115 |
Tint($FF, $FF, $FF, $10); |
|
1116 |
for i:= 8 downto 1 do |
|
6322
b310f0bc8dde
If I'm going to be arbitrary about it, might as well go for the more minimal arbitrariness
nemo
parents:
6318
diff
changeset
|
1117 |
DrawTextureF(SpritesData[sprPiano].Texture, 1, x, y - hwRound(Gear^.dY * 4 * i), 0, 1, 128, 128); |
4388 | 1118 |
Tint($FF, $FF, $FF, $FF) |
1119 |
end; |
|
6322
b310f0bc8dde
If I'm going to be arbitrary about it, might as well go for the more minimal arbitrariness
nemo
parents:
6318
diff
changeset
|
1120 |
DrawTextureF(SpritesData[sprPiano].Texture, 1, x, y, 0, 1, 128, 128); |
4388 | 1121 |
end; |
1122 |
gtPoisonCloud: begin |
|
1123 |
if Gear^.Timer < 1020 then |
|
1124 |
Tint($C0, $C0, $00, Gear^.Timer div 8) |
|
1125 |
else if Gear^.Timer > 3980 then |
|
1126 |
Tint($C0, $C0, $00, (5000 - Gear^.Timer) div 8) |
|
1127 |
else |
|
1128 |
Tint($C0, $C0, $00, $C0); |
|
6999 | 1129 |
DrawTextureRotatedF(SpritesData[sprSmokeWhite].texture, 3, 0, 0, x, y, 0, 1, 22, 22, (RealTicks shr 36 + Gear^.UID * 100) mod 360); |
4388 | 1130 |
Tint($FF, $FF, $FF, $FF) |
1131 |
end; |
|
1132 |
gtResurrector: begin |
|
6999 | 1133 |
DrawSpriteRotated(sprCross, x, y, 0, 0); |
4388 | 1134 |
Tint($f5, $db, $35, max($00, round($C0 * abs(1 - (GameTicks mod 6000) / 3000)))); |
1135 |
DrawTexture(x - 108, y - 108, SpritesData[sprVampiric].Texture, 4.5); |
|
1136 |
Tint($FF, $FF, $FF, $FF); |
|
1137 |
end; |
|
6999 | 1138 |
gtNapalmBomb: DrawSpriteRotated(sprNapalmBomb, x, y, 0, DxDy2Angle(Gear^.dY, Gear^.dX)); |
5519 | 1139 |
gtFlake: if Gear^.State and (gstDrowning or gstTmpFlag) <> 0 then |
5024 | 1140 |
begin |
6982 | 1141 |
Tint((ExplosionBorderColor shr RShift) and $FF, |
1142 |
(ExplosionBorderColor shr GShift) and $FF, |
|
1143 |
(ExplosionBorderColor shr BShift) and $FF, |
|
5461 | 1144 |
$FF); |
5025
ac1691d35cf2
Land sprayer tweaks, make land spray and mudball not end turn
nemo
parents:
5024
diff
changeset
|
1145 |
// Needs a nicer white texture to tint |
6999 | 1146 |
DrawTextureRotatedF(SpritesData[sprSnowDust].Texture, 1, 0, 0, x, y, 0, 1, 8, 8, Gear^.DirAngle); |
1147 |
//DrawSpriteRotated(sprSnowDust, x, y, 0, Gear^.DirAngle); |
|
5472 | 1148 |
//DrawTexture(x, y, SpritesData[sprVampiric].Texture, 0.1); |
5024 | 1149 |
Tint($FF, $FF, $FF, $FF); |
1150 |
end |
|
5787 | 1151 |
else //if not isInLag then |
5024 | 1152 |
begin |
6580
6155187bf599
A partial reformatting of the pascal code to have consistent syntax. Things that are still inconsistent.
lovelacer
parents:
6508
diff
changeset
|
1153 |
if isInLag and (Gear^.FlightTime < 256) then |
6155187bf599
A partial reformatting of the pascal code to have consistent syntax. Things that are still inconsistent.
lovelacer
parents:
6508
diff
changeset
|
1154 |
inc(Gear^.FlightTime, 8) |
6155187bf599
A partial reformatting of the pascal code to have consistent syntax. Things that are still inconsistent.
lovelacer
parents:
6508
diff
changeset
|
1155 |
else if not isInLag and (Gear^.FlightTime > 0) then |
6155187bf599
A partial reformatting of the pascal code to have consistent syntax. Things that are still inconsistent.
lovelacer
parents:
6508
diff
changeset
|
1156 |
dec(Gear^.FlightTime, 8); |
6155187bf599
A partial reformatting of the pascal code to have consistent syntax. Things that are still inconsistent.
lovelacer
parents:
6508
diff
changeset
|
1157 |
if Gear^.FlightTime > 0 then |
6155187bf599
A partial reformatting of the pascal code to have consistent syntax. Things that are still inconsistent.
lovelacer
parents:
6508
diff
changeset
|
1158 |
Tint($FF, $FF, $FF, $FF-min(255,Gear^.FlightTime)); |
4617 | 1159 |
if vobVelocity = 0 then |
5024 | 1160 |
DrawSprite(sprFlake, x, y, Gear^.Timer) |
1161 |
else |
|
6999 | 1162 |
DrawSpriteRotatedF(sprFlake, x, y, Gear^.Timer, 1, Gear^.DirAngle); |
5024 | 1163 |
//DrawSprite(sprFlake, x-SpritesData[sprFlake].Width div 2, y-SpritesData[sprFlake].Height div 2, Gear^.Timer) |
6999 | 1164 |
//DrawSpriteRotatedF(sprFlake, x-SpritesData[sprFlake].Width div 2, y-SpritesData[sprFlake].Height div 2, Gear^.Timer, 1, Gear^.DirAngle); |
6580
6155187bf599
A partial reformatting of the pascal code to have consistent syntax. Things that are still inconsistent.
lovelacer
parents:
6508
diff
changeset
|
1165 |
if Gear^.FlightTime > 0 then |
6155187bf599
A partial reformatting of the pascal code to have consistent syntax. Things that are still inconsistent.
lovelacer
parents:
6508
diff
changeset
|
1166 |
Tint($FF, $FF, $FF, $FF); |
5024 | 1167 |
end; |
4883
7cddc9201a1d
added dummy for tardis and ugly icons for tardis and structure
Henek
parents:
4881
diff
changeset
|
1168 |
gtStructure: DrawSprite(sprTarget, x - 16, y - 16, 0); |
5706 | 1169 |
gtTardis: if Gear^.Pos <> 4 then |
1170 |
begin |
|
6580
6155187bf599
A partial reformatting of the pascal code to have consistent syntax. Things that are still inconsistent.
lovelacer
parents:
6508
diff
changeset
|
1171 |
if Gear^.Pos = 2 then |
6155187bf599
A partial reformatting of the pascal code to have consistent syntax. Things that are still inconsistent.
lovelacer
parents:
6508
diff
changeset
|
1172 |
Tint(Gear^.Hedgehog^.Team^.Clan^.Color shl 8 or $FF) |
6155187bf599
A partial reformatting of the pascal code to have consistent syntax. Things that are still inconsistent.
lovelacer
parents:
6508
diff
changeset
|
1173 |
else |
6155187bf599
A partial reformatting of the pascal code to have consistent syntax. Things that are still inconsistent.
lovelacer
parents:
6508
diff
changeset
|
1174 |
Tint(Gear^.Hedgehog^.Team^.Clan^.Color shl 8 or max($00, round(Gear^.Power * (1-abs(0.5 - (GameTicks mod 2000) / 2000))))); |
5706 | 1175 |
DrawSprite(sprTardis, x-24, y-63,0); |
6580
6155187bf599
A partial reformatting of the pascal code to have consistent syntax. Things that are still inconsistent.
lovelacer
parents:
6508
diff
changeset
|
1176 |
if Gear^.Pos = 2 then |
6155187bf599
A partial reformatting of the pascal code to have consistent syntax. Things that are still inconsistent.
lovelacer
parents:
6508
diff
changeset
|
1177 |
Tint($FF, $FF, $FF, $FF) |
6155187bf599
A partial reformatting of the pascal code to have consistent syntax. Things that are still inconsistent.
lovelacer
parents:
6508
diff
changeset
|
1178 |
else |
6155187bf599
A partial reformatting of the pascal code to have consistent syntax. Things that are still inconsistent.
lovelacer
parents:
6508
diff
changeset
|
1179 |
Tint($FF,$FF,$FF,max($00, round(Gear^.Power * (1-abs(0.5 - (GameTicks mod 2000) / 2000))))); |
5740 | 1180 |
DrawSprite(sprTardis, x-24, y-63,1); |
6580
6155187bf599
A partial reformatting of the pascal code to have consistent syntax. Things that are still inconsistent.
lovelacer
parents:
6508
diff
changeset
|
1181 |
if Gear^.Pos <> 2 then |
6155187bf599
A partial reformatting of the pascal code to have consistent syntax. Things that are still inconsistent.
lovelacer
parents:
6508
diff
changeset
|
1182 |
Tint($FF, $FF, $FF, $FF) |
5740 | 1183 |
(* |
5728 | 1184 |
Tint(Gear^.Hedgehog^.Team^.Clan^.Color shl 8 or max($00, round(Gear^.Power * abs(1 - (RealTicks mod 500) / 250)))); |
1185 |
DrawTexture(x-6, y-70, SpritesData[sprVampiric].Texture, 0.25); |
|
1186 |
Tint($FF, $FF, $FF, $FF) |
|
5740 | 1187 |
*) |
5706 | 1188 |
end; |
7093 | 1189 |
gtIceGun: begin |
1190 |
HHGear := Gear^.Hedgehog^.Gear; |
|
1191 |
if HHGear <> nil then |
|
1192 |
begin |
|
1193 |
i:= hwRound(hwSqr(Gear^.X-HHGear^.X)+hwSqr(Gear^.Y-HHGear^.Y)); |
|
1194 |
if RealTicks mod max(1,50-(round(sqrt(i)) div 4)) = 0 then // experiment in "intensifying" might not get used |
|
1195 |
begin |
|
1196 |
vg:= AddVisualGear(hwRound(Gear^.X), hwRound(Gear^.Y), vgtDust, 1); |
|
1197 |
if vg <> nil then |
|
1198 |
begin |
|
1199 |
i:= random(100)+155; |
|
1200 |
vg^.Tint:= i shl 24 or i shl 16 or $FF shl 8 or ((random(200)+55)); |
|
1201 |
vg^.Angle:= random(360); |
|
1202 |
vg^.dx:= 0.001 * (random(80)); |
|
1203 |
vg^.dy:= 0.001 * (random(80)) |
|
1204 |
end |
|
1205 |
end; |
|
1206 |
if RealTicks mod 2 = 0 then |
|
1207 |
begin |
|
1208 |
i:= random(100)+100; |
|
1209 |
if Gear^.Target.X <> NoPointX then |
|
7098
f8c453ade379
Minor tweaks to freezer, mostly to simplify current state to laptop
nemo
parents:
7093
diff
changeset
|
1210 |
DrawLine(Gear^.Target.X, Gear^.Target.Y, hwRound(HHGear^.X), hwRound(HHGear^.Y), 4.0, i, i, $FF, $40) |
f8c453ade379
Minor tweaks to freezer, mostly to simplify current state to laptop
nemo
parents:
7093
diff
changeset
|
1211 |
else DrawLine(hwRound(HHGear^.X), hwRound(HHGear^.Y), hwRound(Gear^.X), hwRound(Gear^.Y), 4.0, i, i, $FF, $40); |
7093 | 1212 |
end |
1213 |
end |
|
1214 |
end |
|
5706 | 1215 |
|
4611 | 1216 |
|
4388 | 1217 |
end; |
6580
6155187bf599
A partial reformatting of the pascal code to have consistent syntax. Things that are still inconsistent.
lovelacer
parents:
6508
diff
changeset
|
1218 |
if Gear^.RenderTimer and (Gear^.Tex <> nil) then |
6999 | 1219 |
DrawTextureCentered(x + 8, y + 8, Gear^.Tex); |
4388 | 1220 |
end; |
1221 |
||
1222 |
end. |