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