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