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