author | nemo |
Sat, 13 Nov 2010 14:56:35 -0500 | |
branch | 0.9.14 |
changeset 4296 | 53d98ea25ac0 |
parent 4222 | e0de341a75ab |
child 4246 | e5cb885492df |
permissions | -rw-r--r-- |
4077
e7d838d063a4
Avoid a flicker of tags if jiggling a hog, remove a bunch of calls to hwRound and hwSign
nemo
parents:
4044
diff
changeset
|
1 |
procedure DrawHH(Gear: PGear; ox, oy: LongInt); |
3387
733f4001b8b9
Break out DrawHH/DrawGear to reduce scrolling in uGears.pas, add portal graphics
nemo
parents:
diff
changeset
|
2 |
var i, t: LongInt; |
733f4001b8b9
Break out DrawHH/DrawGear to reduce scrolling in uGears.pas, add portal graphics
nemo
parents:
diff
changeset
|
3 |
amt: TAmmoType; |
4077
e7d838d063a4
Avoid a flicker of tags if jiggling a hog, remove a bunch of calls to hwRound and hwSign
nemo
parents:
4044
diff
changeset
|
4 |
sign, hx, hy, cx, cy, tx, ty, sx, sy, m: LongInt; // hedgehog, crosshair, temp, sprite, direction |
3483 | 5 |
dx, dy, ax, ay, aAngle, dAngle, hAngle, lx, ly: real; // laser, change |
3387
733f4001b8b9
Break out DrawHH/DrawGear to reduce scrolling in uGears.pas, add portal graphics
nemo
parents:
diff
changeset
|
6 |
defaultPos, HatVisible: boolean; |
3393 | 7 |
VertexBuffer: array [0..1] of TVertex2f; |
3387
733f4001b8b9
Break out DrawHH/DrawGear to reduce scrolling in uGears.pas, add portal graphics
nemo
parents:
diff
changeset
|
8 |
HH: PHedgehog; |
3836
833c0f32e326
Change all use of curslot/idx to CurAmmoType to try and avoid some bugs with use of last weapon.
nemo
parents:
3751
diff
changeset
|
9 |
CurWeapon: PAmmo; |
3387
733f4001b8b9
Break out DrawHH/DrawGear to reduce scrolling in uGears.pas, add portal graphics
nemo
parents:
diff
changeset
|
10 |
begin |
733f4001b8b9
Break out DrawHH/DrawGear to reduce scrolling in uGears.pas, add portal graphics
nemo
parents:
diff
changeset
|
11 |
HH:= PHedgehog(Gear^.Hedgehog); |
733f4001b8b9
Break out DrawHH/DrawGear to reduce scrolling in uGears.pas, add portal graphics
nemo
parents:
diff
changeset
|
12 |
if HH^.Unplaced then exit; |
733f4001b8b9
Break out DrawHH/DrawGear to reduce scrolling in uGears.pas, add portal graphics
nemo
parents:
diff
changeset
|
13 |
m:= 1; |
733f4001b8b9
Break out DrawHH/DrawGear to reduce scrolling in uGears.pas, add portal graphics
nemo
parents:
diff
changeset
|
14 |
if ((Gear^.State and gstHHHJump) <> 0) and not cArtillery then m:= -1; |
4077
e7d838d063a4
Avoid a flicker of tags if jiggling a hog, remove a bunch of calls to hwRound and hwSign
nemo
parents:
4044
diff
changeset
|
15 |
sx:= ox + 1; // this offset is very common |
e7d838d063a4
Avoid a flicker of tags if jiggling a hog, remove a bunch of calls to hwRound and hwSign
nemo
parents:
4044
diff
changeset
|
16 |
sy:= oy - 3; |
e7d838d063a4
Avoid a flicker of tags if jiggling a hog, remove a bunch of calls to hwRound and hwSign
nemo
parents:
4044
diff
changeset
|
17 |
sign:= hwSign(Gear^.dX); |
e7d838d063a4
Avoid a flicker of tags if jiggling a hog, remove a bunch of calls to hwRound and hwSign
nemo
parents:
4044
diff
changeset
|
18 |
|
3387
733f4001b8b9
Break out DrawHH/DrawGear to reduce scrolling in uGears.pas, add portal graphics
nemo
parents:
diff
changeset
|
19 |
if (Gear^.State and gstHHDeath) <> 0 then |
733f4001b8b9
Break out DrawHH/DrawGear to reduce scrolling in uGears.pas, add portal graphics
nemo
parents:
diff
changeset
|
20 |
begin |
4077
e7d838d063a4
Avoid a flicker of tags if jiggling a hog, remove a bunch of calls to hwRound and hwSign
nemo
parents:
4044
diff
changeset
|
21 |
DrawSprite(sprHHDeath, ox - 16, oy - 26, Gear^.Pos); |
3863 | 22 |
Tint(HH^.Team^.Clan^.Color); |
4077
e7d838d063a4
Avoid a flicker of tags if jiggling a hog, remove a bunch of calls to hwRound and hwSign
nemo
parents:
4044
diff
changeset
|
23 |
DrawSprite(sprHHDeath, ox - 16, oy - 26, Gear^.Pos + 8); |
3863 | 24 |
Tint($FF, $FF, $FF, $FF); |
3387
733f4001b8b9
Break out DrawHH/DrawGear to reduce scrolling in uGears.pas, add portal graphics
nemo
parents:
diff
changeset
|
25 |
exit |
733f4001b8b9
Break out DrawHH/DrawGear to reduce scrolling in uGears.pas, add portal graphics
nemo
parents:
diff
changeset
|
26 |
end |
733f4001b8b9
Break out DrawHH/DrawGear to reduce scrolling in uGears.pas, add portal graphics
nemo
parents:
diff
changeset
|
27 |
else if (Gear^.State and gstHHGone) <> 0 then |
733f4001b8b9
Break out DrawHH/DrawGear to reduce scrolling in uGears.pas, add portal graphics
nemo
parents:
diff
changeset
|
28 |
begin |
4077
e7d838d063a4
Avoid a flicker of tags if jiggling a hog, remove a bunch of calls to hwRound and hwSign
nemo
parents:
4044
diff
changeset
|
29 |
DrawRotatedF(sprTeleport, sx, sy, Gear^.Pos, sign, 0); |
3387
733f4001b8b9
Break out DrawHH/DrawGear to reduce scrolling in uGears.pas, add portal graphics
nemo
parents:
diff
changeset
|
30 |
exit |
733f4001b8b9
Break out DrawHH/DrawGear to reduce scrolling in uGears.pas, add portal graphics
nemo
parents:
diff
changeset
|
31 |
end; |
733f4001b8b9
Break out DrawHH/DrawGear to reduce scrolling in uGears.pas, add portal graphics
nemo
parents:
diff
changeset
|
32 |
|
733f4001b8b9
Break out DrawHH/DrawGear to reduce scrolling in uGears.pas, add portal graphics
nemo
parents:
diff
changeset
|
33 |
defaultPos:= true; |
733f4001b8b9
Break out DrawHH/DrawGear to reduce scrolling in uGears.pas, add portal graphics
nemo
parents:
diff
changeset
|
34 |
HatVisible:= false; |
733f4001b8b9
Break out DrawHH/DrawGear to reduce scrolling in uGears.pas, add portal graphics
nemo
parents:
diff
changeset
|
35 |
|
733f4001b8b9
Break out DrawHH/DrawGear to reduce scrolling in uGears.pas, add portal graphics
nemo
parents:
diff
changeset
|
36 |
|
733f4001b8b9
Break out DrawHH/DrawGear to reduce scrolling in uGears.pas, add portal graphics
nemo
parents:
diff
changeset
|
37 |
if HH^.Effects[hePoisoned] then |
733f4001b8b9
Break out DrawHH/DrawGear to reduce scrolling in uGears.pas, add portal graphics
nemo
parents:
diff
changeset
|
38 |
begin |
3392 | 39 |
Tint($00, $FF, $40, $40); |
3387
733f4001b8b9
Break out DrawHH/DrawGear to reduce scrolling in uGears.pas, add portal graphics
nemo
parents:
diff
changeset
|
40 |
DrawRotatedTextureF(SpritesData[sprSmokeWhite].texture, 2, 0, 0, sx, sy, 0, 1, 22, 22, (RealTicks shr 36) mod 360); |
3390 | 41 |
Tint($FF, $FF, $FF, $FF) |
3387
733f4001b8b9
Break out DrawHH/DrawGear to reduce scrolling in uGears.pas, add portal graphics
nemo
parents:
diff
changeset
|
42 |
end; |
733f4001b8b9
Break out DrawHH/DrawGear to reduce scrolling in uGears.pas, add portal graphics
nemo
parents:
diff
changeset
|
43 |
|
733f4001b8b9
Break out DrawHH/DrawGear to reduce scrolling in uGears.pas, add portal graphics
nemo
parents:
diff
changeset
|
44 |
if ((Gear^.State and gstWinner) <> 0) and |
733f4001b8b9
Break out DrawHH/DrawGear to reduce scrolling in uGears.pas, add portal graphics
nemo
parents:
diff
changeset
|
45 |
((CurAmmoGear = nil) or (CurAmmoGear^.Kind <> gtPickHammer)) then |
733f4001b8b9
Break out DrawHH/DrawGear to reduce scrolling in uGears.pas, add portal graphics
nemo
parents:
diff
changeset
|
46 |
begin |
733f4001b8b9
Break out DrawHH/DrawGear to reduce scrolling in uGears.pas, add portal graphics
nemo
parents:
diff
changeset
|
47 |
DrawHedgehog(sx, sy, |
4077
e7d838d063a4
Avoid a flicker of tags if jiggling a hog, remove a bunch of calls to hwRound and hwSign
nemo
parents:
4044
diff
changeset
|
48 |
sign, |
3387
733f4001b8b9
Break out DrawHH/DrawGear to reduce scrolling in uGears.pas, add portal graphics
nemo
parents:
diff
changeset
|
49 |
2, |
733f4001b8b9
Break out DrawHH/DrawGear to reduce scrolling in uGears.pas, add portal graphics
nemo
parents:
diff
changeset
|
50 |
0, |
733f4001b8b9
Break out DrawHH/DrawGear to reduce scrolling in uGears.pas, add portal graphics
nemo
parents:
diff
changeset
|
51 |
0); |
733f4001b8b9
Break out DrawHH/DrawGear to reduce scrolling in uGears.pas, add portal graphics
nemo
parents:
diff
changeset
|
52 |
defaultPos:= false |
733f4001b8b9
Break out DrawHH/DrawGear to reduce scrolling in uGears.pas, add portal graphics
nemo
parents:
diff
changeset
|
53 |
end; |
733f4001b8b9
Break out DrawHH/DrawGear to reduce scrolling in uGears.pas, add portal graphics
nemo
parents:
diff
changeset
|
54 |
if (Gear^.State and gstDrowning) <> 0 then |
733f4001b8b9
Break out DrawHH/DrawGear to reduce scrolling in uGears.pas, add portal graphics
nemo
parents:
diff
changeset
|
55 |
begin |
733f4001b8b9
Break out DrawHH/DrawGear to reduce scrolling in uGears.pas, add portal graphics
nemo
parents:
diff
changeset
|
56 |
DrawHedgehog(sx, sy, |
4077
e7d838d063a4
Avoid a flicker of tags if jiggling a hog, remove a bunch of calls to hwRound and hwSign
nemo
parents:
4044
diff
changeset
|
57 |
sign, |
3387
733f4001b8b9
Break out DrawHH/DrawGear to reduce scrolling in uGears.pas, add portal graphics
nemo
parents:
diff
changeset
|
58 |
1, |
733f4001b8b9
Break out DrawHH/DrawGear to reduce scrolling in uGears.pas, add portal graphics
nemo
parents:
diff
changeset
|
59 |
7, |
733f4001b8b9
Break out DrawHH/DrawGear to reduce scrolling in uGears.pas, add portal graphics
nemo
parents:
diff
changeset
|
60 |
0); |
733f4001b8b9
Break out DrawHH/DrawGear to reduce scrolling in uGears.pas, add portal graphics
nemo
parents:
diff
changeset
|
61 |
defaultPos:= false |
733f4001b8b9
Break out DrawHH/DrawGear to reduce scrolling in uGears.pas, add portal graphics
nemo
parents:
diff
changeset
|
62 |
end else |
733f4001b8b9
Break out DrawHH/DrawGear to reduce scrolling in uGears.pas, add portal graphics
nemo
parents:
diff
changeset
|
63 |
if (Gear^.State and gstLoser) <> 0 then |
733f4001b8b9
Break out DrawHH/DrawGear to reduce scrolling in uGears.pas, add portal graphics
nemo
parents:
diff
changeset
|
64 |
begin |
733f4001b8b9
Break out DrawHH/DrawGear to reduce scrolling in uGears.pas, add portal graphics
nemo
parents:
diff
changeset
|
65 |
DrawHedgehog(sx, sy, |
4077
e7d838d063a4
Avoid a flicker of tags if jiggling a hog, remove a bunch of calls to hwRound and hwSign
nemo
parents:
4044
diff
changeset
|
66 |
sign, |
3387
733f4001b8b9
Break out DrawHH/DrawGear to reduce scrolling in uGears.pas, add portal graphics
nemo
parents:
diff
changeset
|
67 |
2, |
733f4001b8b9
Break out DrawHH/DrawGear to reduce scrolling in uGears.pas, add portal graphics
nemo
parents:
diff
changeset
|
68 |
3, |
733f4001b8b9
Break out DrawHH/DrawGear to reduce scrolling in uGears.pas, add portal graphics
nemo
parents:
diff
changeset
|
69 |
0); |
733f4001b8b9
Break out DrawHH/DrawGear to reduce scrolling in uGears.pas, add portal graphics
nemo
parents:
diff
changeset
|
70 |
defaultPos:= false |
733f4001b8b9
Break out DrawHH/DrawGear to reduce scrolling in uGears.pas, add portal graphics
nemo
parents:
diff
changeset
|
71 |
end else |
733f4001b8b9
Break out DrawHH/DrawGear to reduce scrolling in uGears.pas, add portal graphics
nemo
parents:
diff
changeset
|
72 |
|
733f4001b8b9
Break out DrawHH/DrawGear to reduce scrolling in uGears.pas, add portal graphics
nemo
parents:
diff
changeset
|
73 |
if (Gear^.State and gstHHDriven) <> 0 then |
733f4001b8b9
Break out DrawHH/DrawGear to reduce scrolling in uGears.pas, add portal graphics
nemo
parents:
diff
changeset
|
74 |
begin |
733f4001b8b9
Break out DrawHH/DrawGear to reduce scrolling in uGears.pas, add portal graphics
nemo
parents:
diff
changeset
|
75 |
if ((Gear^.State and gstHHThinking) = 0) and |
733f4001b8b9
Break out DrawHH/DrawGear to reduce scrolling in uGears.pas, add portal graphics
nemo
parents:
diff
changeset
|
76 |
(ShowCrosshair or ((CurAmmoGear <> nil) and (CurAmmoGear^.Kind = gtRope))) and |
733f4001b8b9
Break out DrawHH/DrawGear to reduce scrolling in uGears.pas, add portal graphics
nemo
parents:
diff
changeset
|
77 |
((Gear^.State and (gstAttacked or gstAnimation)) = 0) then |
733f4001b8b9
Break out DrawHH/DrawGear to reduce scrolling in uGears.pas, add portal graphics
nemo
parents:
diff
changeset
|
78 |
begin |
733f4001b8b9
Break out DrawHH/DrawGear to reduce scrolling in uGears.pas, add portal graphics
nemo
parents:
diff
changeset
|
79 |
(* These calculations are a little complex for a few reasons: |
733f4001b8b9
Break out DrawHH/DrawGear to reduce scrolling in uGears.pas, add portal graphics
nemo
parents:
diff
changeset
|
80 |
1: I need to draw the laser from weapon origin to nearest land |
733f4001b8b9
Break out DrawHH/DrawGear to reduce scrolling in uGears.pas, add portal graphics
nemo
parents:
diff
changeset
|
81 |
2: I need to start the beam outside the hedgie for attractiveness. |
733f4001b8b9
Break out DrawHH/DrawGear to reduce scrolling in uGears.pas, add portal graphics
nemo
parents:
diff
changeset
|
82 |
3: I need to extend the beam beyond land. |
733f4001b8b9
Break out DrawHH/DrawGear to reduce scrolling in uGears.pas, add portal graphics
nemo
parents:
diff
changeset
|
83 |
This routine perhaps should be pushed into uStore or somesuch instead of continuuing the increase in size of this function. |
733f4001b8b9
Break out DrawHH/DrawGear to reduce scrolling in uGears.pas, add portal graphics
nemo
parents:
diff
changeset
|
84 |
*) |
4077
e7d838d063a4
Avoid a flicker of tags if jiggling a hog, remove a bunch of calls to hwRound and hwSign
nemo
parents:
4044
diff
changeset
|
85 |
dx:= sign * m * Sin(Gear^.Angle * pi / cMaxAngle); |
3483 | 86 |
dy:= -Cos(Gear^.Angle * pi / cMaxAngle); |
3387
733f4001b8b9
Break out DrawHH/DrawGear to reduce scrolling in uGears.pas, add portal graphics
nemo
parents:
diff
changeset
|
87 |
if cLaserSighting then |
733f4001b8b9
Break out DrawHH/DrawGear to reduce scrolling in uGears.pas, add portal graphics
nemo
parents:
diff
changeset
|
88 |
begin |
4077
e7d838d063a4
Avoid a flicker of tags if jiggling a hog, remove a bunch of calls to hwRound and hwSign
nemo
parents:
4044
diff
changeset
|
89 |
lx:= GetLaunchX(HH^.CurAmmoType, sign * m, Gear^.Angle); |
3836
833c0f32e326
Change all use of curslot/idx to CurAmmoType to try and avoid some bugs with use of last weapon.
nemo
parents:
3751
diff
changeset
|
90 |
ly:= GetLaunchY(HH^.CurAmmoType, Gear^.Angle); |
3387
733f4001b8b9
Break out DrawHH/DrawGear to reduce scrolling in uGears.pas, add portal graphics
nemo
parents:
diff
changeset
|
91 |
|
3496 | 92 |
// ensure we start outside the hedgehog (he's solid after all) |
93 |
while abs(lx * lx + ly * ly) < (Gear^.radius * Gear^.radius) do |
|
94 |
begin |
|
95 |
lx:= lx + dx; |
|
96 |
ly:= ly + dy |
|
97 |
end; |
|
98 |
||
99 |
// add hog's position |
|
4093 | 100 |
lx:= lx + ox - WorldDx; |
4094 | 101 |
ly:= ly + oy - WorldDy; |
3496 | 102 |
|
103 |
// decrease number of iterations required |
|
3387
733f4001b8b9
Break out DrawHH/DrawGear to reduce scrolling in uGears.pas, add portal graphics
nemo
parents:
diff
changeset
|
104 |
ax:= dx * 4; |
733f4001b8b9
Break out DrawHH/DrawGear to reduce scrolling in uGears.pas, add portal graphics
nemo
parents:
diff
changeset
|
105 |
ay:= dy * 4; |
733f4001b8b9
Break out DrawHH/DrawGear to reduce scrolling in uGears.pas, add portal graphics
nemo
parents:
diff
changeset
|
106 |
|
733f4001b8b9
Break out DrawHH/DrawGear to reduce scrolling in uGears.pas, add portal graphics
nemo
parents:
diff
changeset
|
107 |
tx:= round(lx); |
733f4001b8b9
Break out DrawHH/DrawGear to reduce scrolling in uGears.pas, add portal graphics
nemo
parents:
diff
changeset
|
108 |
ty:= round(ly); |
733f4001b8b9
Break out DrawHH/DrawGear to reduce scrolling in uGears.pas, add portal graphics
nemo
parents:
diff
changeset
|
109 |
hx:= tx; |
733f4001b8b9
Break out DrawHH/DrawGear to reduce scrolling in uGears.pas, add portal graphics
nemo
parents:
diff
changeset
|
110 |
hy:= ty; |
733f4001b8b9
Break out DrawHH/DrawGear to reduce scrolling in uGears.pas, add portal graphics
nemo
parents:
diff
changeset
|
111 |
while ((ty and LAND_HEIGHT_MASK) = 0) and |
733f4001b8b9
Break out DrawHH/DrawGear to reduce scrolling in uGears.pas, add portal graphics
nemo
parents:
diff
changeset
|
112 |
((tx and LAND_WIDTH_MASK) = 0) and |
3496 | 113 |
(Land[ty, tx] = 0) do // TODO: check for constant variable instead |
3387
733f4001b8b9
Break out DrawHH/DrawGear to reduce scrolling in uGears.pas, add portal graphics
nemo
parents:
diff
changeset
|
114 |
begin |
733f4001b8b9
Break out DrawHH/DrawGear to reduce scrolling in uGears.pas, add portal graphics
nemo
parents:
diff
changeset
|
115 |
lx:= lx + ax; |
733f4001b8b9
Break out DrawHH/DrawGear to reduce scrolling in uGears.pas, add portal graphics
nemo
parents:
diff
changeset
|
116 |
ly:= ly + ay; |
733f4001b8b9
Break out DrawHH/DrawGear to reduce scrolling in uGears.pas, add portal graphics
nemo
parents:
diff
changeset
|
117 |
tx:= round(lx); |
733f4001b8b9
Break out DrawHH/DrawGear to reduce scrolling in uGears.pas, add portal graphics
nemo
parents:
diff
changeset
|
118 |
ty:= round(ly) |
733f4001b8b9
Break out DrawHH/DrawGear to reduce scrolling in uGears.pas, add portal graphics
nemo
parents:
diff
changeset
|
119 |
end; |
733f4001b8b9
Break out DrawHH/DrawGear to reduce scrolling in uGears.pas, add portal graphics
nemo
parents:
diff
changeset
|
120 |
// reached edge of land. assume infinite beam. Extend it way out past camera |
733f4001b8b9
Break out DrawHH/DrawGear to reduce scrolling in uGears.pas, add portal graphics
nemo
parents:
diff
changeset
|
121 |
if ((ty and LAND_HEIGHT_MASK) <> 0) or ((tx and LAND_WIDTH_MASK) <> 0) then |
733f4001b8b9
Break out DrawHH/DrawGear to reduce scrolling in uGears.pas, add portal graphics
nemo
parents:
diff
changeset
|
122 |
begin |
733f4001b8b9
Break out DrawHH/DrawGear to reduce scrolling in uGears.pas, add portal graphics
nemo
parents:
diff
changeset
|
123 |
tx:= round(lx + ax * (LAND_WIDTH div 4)); |
733f4001b8b9
Break out DrawHH/DrawGear to reduce scrolling in uGears.pas, add portal graphics
nemo
parents:
diff
changeset
|
124 |
ty:= round(ly + ay * (LAND_WIDTH div 4)); |
733f4001b8b9
Break out DrawHH/DrawGear to reduce scrolling in uGears.pas, add portal graphics
nemo
parents:
diff
changeset
|
125 |
end; |
733f4001b8b9
Break out DrawHH/DrawGear to reduce scrolling in uGears.pas, add portal graphics
nemo
parents:
diff
changeset
|
126 |
|
733f4001b8b9
Break out DrawHH/DrawGear to reduce scrolling in uGears.pas, add portal graphics
nemo
parents:
diff
changeset
|
127 |
//if (abs(lx-tx)>8) or (abs(ly-ty)>8) then |
733f4001b8b9
Break out DrawHH/DrawGear to reduce scrolling in uGears.pas, add portal graphics
nemo
parents:
diff
changeset
|
128 |
begin |
3393 | 129 |
glDisable(GL_TEXTURE_2D); |
3390 | 130 |
glEnable(GL_LINE_SMOOTH); |
3393 | 131 |
|
3387
733f4001b8b9
Break out DrawHH/DrawGear to reduce scrolling in uGears.pas, add portal graphics
nemo
parents:
diff
changeset
|
132 |
glLineWidth(1.0); |
3393 | 133 |
|
3390 | 134 |
Tint($FF, $00, $00, $C0); |
3393 | 135 |
VertexBuffer[0].X:= hx + WorldDx; |
136 |
VertexBuffer[0].Y:= hy + WorldDy; |
|
137 |
VertexBuffer[1].X:= tx + WorldDx; |
|
138 |
VertexBuffer[1].Y:= ty + WorldDy; |
|
139 |
||
140 |
glVertexPointer(2, GL_FLOAT, 0, @VertexBuffer[0]); |
|
141 |
glDrawArrays(GL_LINES, 0, Length(VertexBuffer)); |
|
3390 | 142 |
Tint($FF, $FF, $FF, $FF); |
3393 | 143 |
glEnable(GL_TEXTURE_2D); |
3390 | 144 |
glDisable(GL_LINE_SMOOTH); |
3387
733f4001b8b9
Break out DrawHH/DrawGear to reduce scrolling in uGears.pas, add portal graphics
nemo
parents:
diff
changeset
|
145 |
end; |
733f4001b8b9
Break out DrawHH/DrawGear to reduce scrolling in uGears.pas, add portal graphics
nemo
parents:
diff
changeset
|
146 |
end; |
733f4001b8b9
Break out DrawHH/DrawGear to reduce scrolling in uGears.pas, add portal graphics
nemo
parents:
diff
changeset
|
147 |
// draw crosshair |
4077
e7d838d063a4
Avoid a flicker of tags if jiggling a hog, remove a bunch of calls to hwRound and hwSign
nemo
parents:
4044
diff
changeset
|
148 |
cx:= Round(hwRound(Gear^.X) + dx * 80 + GetLaunchX(HH^.CurAmmoType, sign * m, Gear^.Angle)); |
3836
833c0f32e326
Change all use of curslot/idx to CurAmmoType to try and avoid some bugs with use of last weapon.
nemo
parents:
3751
diff
changeset
|
149 |
cy:= Round(hwRound(Gear^.Y) + dy * 80 + GetLaunchY(HH^.CurAmmoType, Gear^.Angle)); |
3387
733f4001b8b9
Break out DrawHH/DrawGear to reduce scrolling in uGears.pas, add portal graphics
nemo
parents:
diff
changeset
|
150 |
DrawRotatedTex(HH^.Team^.CrosshairTex, |
733f4001b8b9
Break out DrawHH/DrawGear to reduce scrolling in uGears.pas, add portal graphics
nemo
parents:
diff
changeset
|
151 |
12, 12, cx + WorldDx, cy + WorldDy, 0, |
4077
e7d838d063a4
Avoid a flicker of tags if jiggling a hog, remove a bunch of calls to hwRound and hwSign
nemo
parents:
4044
diff
changeset
|
152 |
sign * (Gear^.Angle * 180.0) / cMaxAngle); |
3387
733f4001b8b9
Break out DrawHH/DrawGear to reduce scrolling in uGears.pas, add portal graphics
nemo
parents:
diff
changeset
|
153 |
end; |
4077
e7d838d063a4
Avoid a flicker of tags if jiggling a hog, remove a bunch of calls to hwRound and hwSign
nemo
parents:
4044
diff
changeset
|
154 |
hx:= ox + 8 * sign; |
e7d838d063a4
Avoid a flicker of tags if jiggling a hog, remove a bunch of calls to hwRound and hwSign
nemo
parents:
4044
diff
changeset
|
155 |
hy:= oy - 2; |
3387
733f4001b8b9
Break out DrawHH/DrawGear to reduce scrolling in uGears.pas, add portal graphics
nemo
parents:
diff
changeset
|
156 |
aangle:= Gear^.Angle * 180 / cMaxAngle - 90; |
733f4001b8b9
Break out DrawHH/DrawGear to reduce scrolling in uGears.pas, add portal graphics
nemo
parents:
diff
changeset
|
157 |
if CurAmmoGear <> nil then |
733f4001b8b9
Break out DrawHH/DrawGear to reduce scrolling in uGears.pas, add portal graphics
nemo
parents:
diff
changeset
|
158 |
begin |
733f4001b8b9
Break out DrawHH/DrawGear to reduce scrolling in uGears.pas, add portal graphics
nemo
parents:
diff
changeset
|
159 |
case CurAmmoGear^.Kind of |
733f4001b8b9
Break out DrawHH/DrawGear to reduce scrolling in uGears.pas, add portal graphics
nemo
parents:
diff
changeset
|
160 |
gtShotgunShot: begin |
733f4001b8b9
Break out DrawHH/DrawGear to reduce scrolling in uGears.pas, add portal graphics
nemo
parents:
diff
changeset
|
161 |
if (CurAmmoGear^.State and gstAnimation <> 0) then |
4077
e7d838d063a4
Avoid a flicker of tags if jiggling a hog, remove a bunch of calls to hwRound and hwSign
nemo
parents:
4044
diff
changeset
|
162 |
DrawRotated(sprShotgun, hx, hy, sign, aangle) |
3387
733f4001b8b9
Break out DrawHH/DrawGear to reduce scrolling in uGears.pas, add portal graphics
nemo
parents:
diff
changeset
|
163 |
else |
4077
e7d838d063a4
Avoid a flicker of tags if jiggling a hog, remove a bunch of calls to hwRound and hwSign
nemo
parents:
4044
diff
changeset
|
164 |
DrawRotated(sprHandShotgun, hx, hy, sign, aangle); |
3387
733f4001b8b9
Break out DrawHH/DrawGear to reduce scrolling in uGears.pas, add portal graphics
nemo
parents:
diff
changeset
|
165 |
end; |
4077
e7d838d063a4
Avoid a flicker of tags if jiggling a hog, remove a bunch of calls to hwRound and hwSign
nemo
parents:
4044
diff
changeset
|
166 |
gtDEagleShot: DrawRotated(sprDEagle, hx, hy, sign, aangle); |
3387
733f4001b8b9
Break out DrawHH/DrawGear to reduce scrolling in uGears.pas, add portal graphics
nemo
parents:
diff
changeset
|
167 |
gtSniperRifleShot: begin |
733f4001b8b9
Break out DrawHH/DrawGear to reduce scrolling in uGears.pas, add portal graphics
nemo
parents:
diff
changeset
|
168 |
if (CurAmmoGear^.State and gstAnimation <> 0) then |
4077
e7d838d063a4
Avoid a flicker of tags if jiggling a hog, remove a bunch of calls to hwRound and hwSign
nemo
parents:
4044
diff
changeset
|
169 |
DrawRotatedF(sprSniperRifle, hx, hy, 1, sign, aangle) |
3387
733f4001b8b9
Break out DrawHH/DrawGear to reduce scrolling in uGears.pas, add portal graphics
nemo
parents:
diff
changeset
|
170 |
else |
4077
e7d838d063a4
Avoid a flicker of tags if jiggling a hog, remove a bunch of calls to hwRound and hwSign
nemo
parents:
4044
diff
changeset
|
171 |
DrawRotatedF(sprSniperRifle, hx, hy, 0, sign, aangle) |
3387
733f4001b8b9
Break out DrawHH/DrawGear to reduce scrolling in uGears.pas, add portal graphics
nemo
parents:
diff
changeset
|
172 |
end; |
4077
e7d838d063a4
Avoid a flicker of tags if jiggling a hog, remove a bunch of calls to hwRound and hwSign
nemo
parents:
4044
diff
changeset
|
173 |
gtBallgun: DrawRotated(sprHandBallgun, hx, hy, sign, aangle); |
3387
733f4001b8b9
Break out DrawHH/DrawGear to reduce scrolling in uGears.pas, add portal graphics
nemo
parents:
diff
changeset
|
174 |
gtRCPlane: begin |
4077
e7d838d063a4
Avoid a flicker of tags if jiggling a hog, remove a bunch of calls to hwRound and hwSign
nemo
parents:
4044
diff
changeset
|
175 |
DrawRotated(sprHandPlane, hx, hy, sign, 0); |
3387
733f4001b8b9
Break out DrawHH/DrawGear to reduce scrolling in uGears.pas, add portal graphics
nemo
parents:
diff
changeset
|
176 |
defaultPos:= false |
733f4001b8b9
Break out DrawHH/DrawGear to reduce scrolling in uGears.pas, add portal graphics
nemo
parents:
diff
changeset
|
177 |
end; |
733f4001b8b9
Break out DrawHH/DrawGear to reduce scrolling in uGears.pas, add portal graphics
nemo
parents:
diff
changeset
|
178 |
gtRope: begin |
733f4001b8b9
Break out DrawHH/DrawGear to reduce scrolling in uGears.pas, add portal graphics
nemo
parents:
diff
changeset
|
179 |
if Gear^.X < CurAmmoGear^.X then |
733f4001b8b9
Break out DrawHH/DrawGear to reduce scrolling in uGears.pas, add portal graphics
nemo
parents:
diff
changeset
|
180 |
begin |
733f4001b8b9
Break out DrawHH/DrawGear to reduce scrolling in uGears.pas, add portal graphics
nemo
parents:
diff
changeset
|
181 |
dAngle:= 0; |
733f4001b8b9
Break out DrawHH/DrawGear to reduce scrolling in uGears.pas, add portal graphics
nemo
parents:
diff
changeset
|
182 |
hAngle:= 180; |
733f4001b8b9
Break out DrawHH/DrawGear to reduce scrolling in uGears.pas, add portal graphics
nemo
parents:
diff
changeset
|
183 |
i:= 1 |
733f4001b8b9
Break out DrawHH/DrawGear to reduce scrolling in uGears.pas, add portal graphics
nemo
parents:
diff
changeset
|
184 |
end else |
733f4001b8b9
Break out DrawHH/DrawGear to reduce scrolling in uGears.pas, add portal graphics
nemo
parents:
diff
changeset
|
185 |
begin |
733f4001b8b9
Break out DrawHH/DrawGear to reduce scrolling in uGears.pas, add portal graphics
nemo
parents:
diff
changeset
|
186 |
dAngle:= 180; |
733f4001b8b9
Break out DrawHH/DrawGear to reduce scrolling in uGears.pas, add portal graphics
nemo
parents:
diff
changeset
|
187 |
hAngle:= 0; |
733f4001b8b9
Break out DrawHH/DrawGear to reduce scrolling in uGears.pas, add portal graphics
nemo
parents:
diff
changeset
|
188 |
i:= -1 |
733f4001b8b9
Break out DrawHH/DrawGear to reduce scrolling in uGears.pas, add portal graphics
nemo
parents:
diff
changeset
|
189 |
end; |
733f4001b8b9
Break out DrawHH/DrawGear to reduce scrolling in uGears.pas, add portal graphics
nemo
parents:
diff
changeset
|
190 |
if ((Gear^.State and gstWinner) = 0) then |
733f4001b8b9
Break out DrawHH/DrawGear to reduce scrolling in uGears.pas, add portal graphics
nemo
parents:
diff
changeset
|
191 |
begin |
4077
e7d838d063a4
Avoid a flicker of tags if jiggling a hog, remove a bunch of calls to hwRound and hwSign
nemo
parents:
4044
diff
changeset
|
192 |
DrawHedgehog(ox, oy, |
3387
733f4001b8b9
Break out DrawHH/DrawGear to reduce scrolling in uGears.pas, add portal graphics
nemo
parents:
diff
changeset
|
193 |
i, |
733f4001b8b9
Break out DrawHH/DrawGear to reduce scrolling in uGears.pas, add portal graphics
nemo
parents:
diff
changeset
|
194 |
1, |
733f4001b8b9
Break out DrawHH/DrawGear to reduce scrolling in uGears.pas, add portal graphics
nemo
parents:
diff
changeset
|
195 |
0, |
733f4001b8b9
Break out DrawHH/DrawGear to reduce scrolling in uGears.pas, add portal graphics
nemo
parents:
diff
changeset
|
196 |
DxDy2Angle(CurAmmoGear^.dY, CurAmmoGear^.dX) + dAngle); |
733f4001b8b9
Break out DrawHH/DrawGear to reduce scrolling in uGears.pas, add portal graphics
nemo
parents:
diff
changeset
|
197 |
with HH^ do |
733f4001b8b9
Break out DrawHH/DrawGear to reduce scrolling in uGears.pas, add portal graphics
nemo
parents:
diff
changeset
|
198 |
if (HatTex <> nil) then |
3445 | 199 |
begin |
4077
e7d838d063a4
Avoid a flicker of tags if jiggling a hog, remove a bunch of calls to hwRound and hwSign
nemo
parents:
4044
diff
changeset
|
200 |
DrawRotatedTextureF(HatTex, 1.0, -1.0, -6.0, ox, oy, 0, i, 32, 32, |
3387
733f4001b8b9
Break out DrawHH/DrawGear to reduce scrolling in uGears.pas, add portal graphics
nemo
parents:
diff
changeset
|
201 |
i*DxDy2Angle(CurAmmoGear^.dY, CurAmmoGear^.dX) + hAngle); |
3854 | 202 |
if HatTex^.w > 64 then |
3445 | 203 |
begin |
204 |
Tint(HH^.Team^.Clan^.Color); |
|
4077
e7d838d063a4
Avoid a flicker of tags if jiggling a hog, remove a bunch of calls to hwRound and hwSign
nemo
parents:
4044
diff
changeset
|
205 |
DrawRotatedTextureF(HatTex, 1.0, -1.0, -6.0, ox, oy, 32, i, 32, 32, |
3445 | 206 |
i*DxDy2Angle(CurAmmoGear^.dY, CurAmmoGear^.dX) + hAngle); |
207 |
Tint($FF, $FF, $FF, $FF) |
|
208 |
end |
|
209 |
end |
|
3387
733f4001b8b9
Break out DrawHH/DrawGear to reduce scrolling in uGears.pas, add portal graphics
nemo
parents:
diff
changeset
|
210 |
end; |
4077
e7d838d063a4
Avoid a flicker of tags if jiggling a hog, remove a bunch of calls to hwRound and hwSign
nemo
parents:
4044
diff
changeset
|
211 |
DrawAltWeapon(Gear, ox, oy); |
3387
733f4001b8b9
Break out DrawHH/DrawGear to reduce scrolling in uGears.pas, add portal graphics
nemo
parents:
diff
changeset
|
212 |
defaultPos:= false |
733f4001b8b9
Break out DrawHH/DrawGear to reduce scrolling in uGears.pas, add portal graphics
nemo
parents:
diff
changeset
|
213 |
end; |
733f4001b8b9
Break out DrawHH/DrawGear to reduce scrolling in uGears.pas, add portal graphics
nemo
parents:
diff
changeset
|
214 |
gtBlowTorch: begin |
4077
e7d838d063a4
Avoid a flicker of tags if jiggling a hog, remove a bunch of calls to hwRound and hwSign
nemo
parents:
4044
diff
changeset
|
215 |
DrawRotated(sprBlowTorch, hx, hy, sign, aangle); |
3387
733f4001b8b9
Break out DrawHH/DrawGear to reduce scrolling in uGears.pas, add portal graphics
nemo
parents:
diff
changeset
|
216 |
DrawHedgehog(sx, sy, |
4077
e7d838d063a4
Avoid a flicker of tags if jiggling a hog, remove a bunch of calls to hwRound and hwSign
nemo
parents:
4044
diff
changeset
|
217 |
sign, |
3387
733f4001b8b9
Break out DrawHH/DrawGear to reduce scrolling in uGears.pas, add portal graphics
nemo
parents:
diff
changeset
|
218 |
3, |
733f4001b8b9
Break out DrawHH/DrawGear to reduce scrolling in uGears.pas, add portal graphics
nemo
parents:
diff
changeset
|
219 |
HH^.visStepPos div 2, |
733f4001b8b9
Break out DrawHH/DrawGear to reduce scrolling in uGears.pas, add portal graphics
nemo
parents:
diff
changeset
|
220 |
0); |
733f4001b8b9
Break out DrawHH/DrawGear to reduce scrolling in uGears.pas, add portal graphics
nemo
parents:
diff
changeset
|
221 |
with HH^ do |
733f4001b8b9
Break out DrawHH/DrawGear to reduce scrolling in uGears.pas, add portal graphics
nemo
parents:
diff
changeset
|
222 |
if (HatTex <> nil) then |
3445 | 223 |
begin |
224 |
DrawTextureF(HatTex, |
|
225 |
1, |
|
226 |
sx, |
|
4077
e7d838d063a4
Avoid a flicker of tags if jiggling a hog, remove a bunch of calls to hwRound and hwSign
nemo
parents:
4044
diff
changeset
|
227 |
sy - 5, |
3445 | 228 |
0, |
4077
e7d838d063a4
Avoid a flicker of tags if jiggling a hog, remove a bunch of calls to hwRound and hwSign
nemo
parents:
4044
diff
changeset
|
229 |
sign, |
3445 | 230 |
32, |
231 |
32); |
|
3854 | 232 |
if HatTex^.w > 64 then |
3445 | 233 |
begin |
234 |
Tint(HH^.Team^.Clan^.Color); |
|
235 |
DrawTextureF(HatTex, |
|
236 |
1, |
|
237 |
sx, |
|
4077
e7d838d063a4
Avoid a flicker of tags if jiggling a hog, remove a bunch of calls to hwRound and hwSign
nemo
parents:
4044
diff
changeset
|
238 |
sy - 5, |
3445 | 239 |
32, |
4077
e7d838d063a4
Avoid a flicker of tags if jiggling a hog, remove a bunch of calls to hwRound and hwSign
nemo
parents:
4044
diff
changeset
|
240 |
sign, |
3445 | 241 |
32, |
242 |
32); |
|
243 |
Tint($FF, $FF, $FF, $FF) |
|
244 |
end |
|
245 |
end; |
|
3387
733f4001b8b9
Break out DrawHH/DrawGear to reduce scrolling in uGears.pas, add portal graphics
nemo
parents:
diff
changeset
|
246 |
defaultPos:= false |
733f4001b8b9
Break out DrawHH/DrawGear to reduce scrolling in uGears.pas, add portal graphics
nemo
parents:
diff
changeset
|
247 |
end; |
4077
e7d838d063a4
Avoid a flicker of tags if jiggling a hog, remove a bunch of calls to hwRound and hwSign
nemo
parents:
4044
diff
changeset
|
248 |
gtShover: DrawRotated(sprHandBaseball, hx, hy, sign, aangle + 180); |
3387
733f4001b8b9
Break out DrawHH/DrawGear to reduce scrolling in uGears.pas, add portal graphics
nemo
parents:
diff
changeset
|
249 |
gtFirePunch: begin |
733f4001b8b9
Break out DrawHH/DrawGear to reduce scrolling in uGears.pas, add portal graphics
nemo
parents:
diff
changeset
|
250 |
DrawHedgehog(sx, sy, |
4077
e7d838d063a4
Avoid a flicker of tags if jiggling a hog, remove a bunch of calls to hwRound and hwSign
nemo
parents:
4044
diff
changeset
|
251 |
sign, |
3387
733f4001b8b9
Break out DrawHH/DrawGear to reduce scrolling in uGears.pas, add portal graphics
nemo
parents:
diff
changeset
|
252 |
1, |
733f4001b8b9
Break out DrawHH/DrawGear to reduce scrolling in uGears.pas, add portal graphics
nemo
parents:
diff
changeset
|
253 |
4, |
733f4001b8b9
Break out DrawHH/DrawGear to reduce scrolling in uGears.pas, add portal graphics
nemo
parents:
diff
changeset
|
254 |
0); |
733f4001b8b9
Break out DrawHH/DrawGear to reduce scrolling in uGears.pas, add portal graphics
nemo
parents:
diff
changeset
|
255 |
defaultPos:= false |
733f4001b8b9
Break out DrawHH/DrawGear to reduce scrolling in uGears.pas, add portal graphics
nemo
parents:
diff
changeset
|
256 |
end; |
733f4001b8b9
Break out DrawHH/DrawGear to reduce scrolling in uGears.pas, add portal graphics
nemo
parents:
diff
changeset
|
257 |
gtPickHammer: begin |
733f4001b8b9
Break out DrawHH/DrawGear to reduce scrolling in uGears.pas, add portal graphics
nemo
parents:
diff
changeset
|
258 |
defaultPos:= false; |
733f4001b8b9
Break out DrawHH/DrawGear to reduce scrolling in uGears.pas, add portal graphics
nemo
parents:
diff
changeset
|
259 |
dec(sy,20); |
733f4001b8b9
Break out DrawHH/DrawGear to reduce scrolling in uGears.pas, add portal graphics
nemo
parents:
diff
changeset
|
260 |
end; |
733f4001b8b9
Break out DrawHH/DrawGear to reduce scrolling in uGears.pas, add portal graphics
nemo
parents:
diff
changeset
|
261 |
gtTeleport: defaultPos:= false; |
733f4001b8b9
Break out DrawHH/DrawGear to reduce scrolling in uGears.pas, add portal graphics
nemo
parents:
diff
changeset
|
262 |
gtWhip: begin |
733f4001b8b9
Break out DrawHH/DrawGear to reduce scrolling in uGears.pas, add portal graphics
nemo
parents:
diff
changeset
|
263 |
DrawRotatedF(sprWhip, |
733f4001b8b9
Break out DrawHH/DrawGear to reduce scrolling in uGears.pas, add portal graphics
nemo
parents:
diff
changeset
|
264 |
sx, |
733f4001b8b9
Break out DrawHH/DrawGear to reduce scrolling in uGears.pas, add portal graphics
nemo
parents:
diff
changeset
|
265 |
sy, |
733f4001b8b9
Break out DrawHH/DrawGear to reduce scrolling in uGears.pas, add portal graphics
nemo
parents:
diff
changeset
|
266 |
1, |
4077
e7d838d063a4
Avoid a flicker of tags if jiggling a hog, remove a bunch of calls to hwRound and hwSign
nemo
parents:
4044
diff
changeset
|
267 |
sign, |
3387
733f4001b8b9
Break out DrawHH/DrawGear to reduce scrolling in uGears.pas, add portal graphics
nemo
parents:
diff
changeset
|
268 |
0); |
733f4001b8b9
Break out DrawHH/DrawGear to reduce scrolling in uGears.pas, add portal graphics
nemo
parents:
diff
changeset
|
269 |
defaultPos:= false |
733f4001b8b9
Break out DrawHH/DrawGear to reduce scrolling in uGears.pas, add portal graphics
nemo
parents:
diff
changeset
|
270 |
end; |
3717 | 271 |
gtHammer: begin |
272 |
DrawRotatedF(sprHammer, |
|
273 |
sx, |
|
274 |
sy, |
|
275 |
1, |
|
4077
e7d838d063a4
Avoid a flicker of tags if jiggling a hog, remove a bunch of calls to hwRound and hwSign
nemo
parents:
4044
diff
changeset
|
276 |
sign, |
3717 | 277 |
0); |
278 |
defaultPos:= false |
|
279 |
end; |
|
3963
6090d2a2472e
New Weapon: Resurrector (TODO: ammo icon + sprites)
Tobias Neumann <mail@tobias-neumann.eu>
parents:
3909
diff
changeset
|
280 |
gtResurrector: begin |
4044
de7170e51cc6
Check for collision with surfaces above when levitating hog, use more typical drawing syntax for the resurrector wep, restore typical indentation
nemo
parents:
4036
diff
changeset
|
281 |
DrawRotated(sprHandResurrector, sx, sy, 0, 0); |
de7170e51cc6
Check for collision with surfaces above when levitating hog, use more typical drawing syntax for the resurrector wep, restore typical indentation
nemo
parents:
4036
diff
changeset
|
282 |
defaultPos:= false |
4018
7f2c71638466
burp can always remove this if he doesn't like it. just making it a bit more interesting.
nemo
parents:
4016
diff
changeset
|
283 |
end; |
3387
733f4001b8b9
Break out DrawHH/DrawGear to reduce scrolling in uGears.pas, add portal graphics
nemo
parents:
diff
changeset
|
284 |
gtKamikaze: begin |
733f4001b8b9
Break out DrawHH/DrawGear to reduce scrolling in uGears.pas, add portal graphics
nemo
parents:
diff
changeset
|
285 |
if CurAmmoGear^.Pos = 0 then |
733f4001b8b9
Break out DrawHH/DrawGear to reduce scrolling in uGears.pas, add portal graphics
nemo
parents:
diff
changeset
|
286 |
DrawHedgehog(sx, sy, |
4077
e7d838d063a4
Avoid a flicker of tags if jiggling a hog, remove a bunch of calls to hwRound and hwSign
nemo
parents:
4044
diff
changeset
|
287 |
sign, |
3387
733f4001b8b9
Break out DrawHH/DrawGear to reduce scrolling in uGears.pas, add portal graphics
nemo
parents:
diff
changeset
|
288 |
1, |
733f4001b8b9
Break out DrawHH/DrawGear to reduce scrolling in uGears.pas, add portal graphics
nemo
parents:
diff
changeset
|
289 |
6, |
733f4001b8b9
Break out DrawHH/DrawGear to reduce scrolling in uGears.pas, add portal graphics
nemo
parents:
diff
changeset
|
290 |
0) |
733f4001b8b9
Break out DrawHH/DrawGear to reduce scrolling in uGears.pas, add portal graphics
nemo
parents:
diff
changeset
|
291 |
else |
733f4001b8b9
Break out DrawHH/DrawGear to reduce scrolling in uGears.pas, add portal graphics
nemo
parents:
diff
changeset
|
292 |
DrawRotatedF(sprKamikaze, |
4077
e7d838d063a4
Avoid a flicker of tags if jiggling a hog, remove a bunch of calls to hwRound and hwSign
nemo
parents:
4044
diff
changeset
|
293 |
ox, oy, |
3387
733f4001b8b9
Break out DrawHH/DrawGear to reduce scrolling in uGears.pas, add portal graphics
nemo
parents:
diff
changeset
|
294 |
CurAmmoGear^.Pos - 1, |
4077
e7d838d063a4
Avoid a flicker of tags if jiggling a hog, remove a bunch of calls to hwRound and hwSign
nemo
parents:
4044
diff
changeset
|
295 |
sign, |
3387
733f4001b8b9
Break out DrawHH/DrawGear to reduce scrolling in uGears.pas, add portal graphics
nemo
parents:
diff
changeset
|
296 |
aangle); |
733f4001b8b9
Break out DrawHH/DrawGear to reduce scrolling in uGears.pas, add portal graphics
nemo
parents:
diff
changeset
|
297 |
defaultPos:= false |
733f4001b8b9
Break out DrawHH/DrawGear to reduce scrolling in uGears.pas, add portal graphics
nemo
parents:
diff
changeset
|
298 |
end; |
733f4001b8b9
Break out DrawHH/DrawGear to reduce scrolling in uGears.pas, add portal graphics
nemo
parents:
diff
changeset
|
299 |
gtSeduction: begin |
733f4001b8b9
Break out DrawHH/DrawGear to reduce scrolling in uGears.pas, add portal graphics
nemo
parents:
diff
changeset
|
300 |
if CurAmmoGear^.Pos >= 6 then |
733f4001b8b9
Break out DrawHH/DrawGear to reduce scrolling in uGears.pas, add portal graphics
nemo
parents:
diff
changeset
|
301 |
DrawHedgehog(sx, sy, |
4077
e7d838d063a4
Avoid a flicker of tags if jiggling a hog, remove a bunch of calls to hwRound and hwSign
nemo
parents:
4044
diff
changeset
|
302 |
sign, |
3387
733f4001b8b9
Break out DrawHH/DrawGear to reduce scrolling in uGears.pas, add portal graphics
nemo
parents:
diff
changeset
|
303 |
2, |
733f4001b8b9
Break out DrawHH/DrawGear to reduce scrolling in uGears.pas, add portal graphics
nemo
parents:
diff
changeset
|
304 |
2, |
733f4001b8b9
Break out DrawHH/DrawGear to reduce scrolling in uGears.pas, add portal graphics
nemo
parents:
diff
changeset
|
305 |
0) |
733f4001b8b9
Break out DrawHH/DrawGear to reduce scrolling in uGears.pas, add portal graphics
nemo
parents:
diff
changeset
|
306 |
else |
733f4001b8b9
Break out DrawHH/DrawGear to reduce scrolling in uGears.pas, add portal graphics
nemo
parents:
diff
changeset
|
307 |
begin |
733f4001b8b9
Break out DrawHH/DrawGear to reduce scrolling in uGears.pas, add portal graphics
nemo
parents:
diff
changeset
|
308 |
DrawRotatedF(sprDress, |
4077
e7d838d063a4
Avoid a flicker of tags if jiggling a hog, remove a bunch of calls to hwRound and hwSign
nemo
parents:
4044
diff
changeset
|
309 |
ox, oy, |
3387
733f4001b8b9
Break out DrawHH/DrawGear to reduce scrolling in uGears.pas, add portal graphics
nemo
parents:
diff
changeset
|
310 |
CurAmmoGear^.Pos, |
4077
e7d838d063a4
Avoid a flicker of tags if jiggling a hog, remove a bunch of calls to hwRound and hwSign
nemo
parents:
4044
diff
changeset
|
311 |
sign, |
3387
733f4001b8b9
Break out DrawHH/DrawGear to reduce scrolling in uGears.pas, add portal graphics
nemo
parents:
diff
changeset
|
312 |
0); |
4077
e7d838d063a4
Avoid a flicker of tags if jiggling a hog, remove a bunch of calls to hwRound and hwSign
nemo
parents:
4044
diff
changeset
|
313 |
DrawSprite(sprCensored, ox - 32, oy - 20, 0) |
3387
733f4001b8b9
Break out DrawHH/DrawGear to reduce scrolling in uGears.pas, add portal graphics
nemo
parents:
diff
changeset
|
314 |
end; |
733f4001b8b9
Break out DrawHH/DrawGear to reduce scrolling in uGears.pas, add portal graphics
nemo
parents:
diff
changeset
|
315 |
defaultPos:= false |
733f4001b8b9
Break out DrawHH/DrawGear to reduce scrolling in uGears.pas, add portal graphics
nemo
parents:
diff
changeset
|
316 |
end; |
3485 | 317 |
gtFlamethrower: begin |
4077
e7d838d063a4
Avoid a flicker of tags if jiggling a hog, remove a bunch of calls to hwRound and hwSign
nemo
parents:
4044
diff
changeset
|
318 |
DrawRotatedF(sprHandFlamethrower, hx, hy, (RealTicks div 125) mod 4, sign, aangle); |
3485 | 319 |
if CurAmmoGear^.Tex <> nil then DrawCentered(sx, sy - 40, CurAmmoGear^.Tex) |
320 |
end; |
|
3387
733f4001b8b9
Break out DrawHH/DrawGear to reduce scrolling in uGears.pas, add portal graphics
nemo
parents:
diff
changeset
|
321 |
end; |
733f4001b8b9
Break out DrawHH/DrawGear to reduce scrolling in uGears.pas, add portal graphics
nemo
parents:
diff
changeset
|
322 |
|
733f4001b8b9
Break out DrawHH/DrawGear to reduce scrolling in uGears.pas, add portal graphics
nemo
parents:
diff
changeset
|
323 |
case CurAmmoGear^.Kind of |
733f4001b8b9
Break out DrawHH/DrawGear to reduce scrolling in uGears.pas, add portal graphics
nemo
parents:
diff
changeset
|
324 |
gtShotgunShot, |
733f4001b8b9
Break out DrawHH/DrawGear to reduce scrolling in uGears.pas, add portal graphics
nemo
parents:
diff
changeset
|
325 |
gtDEagleShot, |
733f4001b8b9
Break out DrawHH/DrawGear to reduce scrolling in uGears.pas, add portal graphics
nemo
parents:
diff
changeset
|
326 |
gtSniperRifleShot, |
733f4001b8b9
Break out DrawHH/DrawGear to reduce scrolling in uGears.pas, add portal graphics
nemo
parents:
diff
changeset
|
327 |
gtShover: begin |
733f4001b8b9
Break out DrawHH/DrawGear to reduce scrolling in uGears.pas, add portal graphics
nemo
parents:
diff
changeset
|
328 |
DrawHedgehog(sx, sy, |
4077
e7d838d063a4
Avoid a flicker of tags if jiggling a hog, remove a bunch of calls to hwRound and hwSign
nemo
parents:
4044
diff
changeset
|
329 |
sign, |
3387
733f4001b8b9
Break out DrawHH/DrawGear to reduce scrolling in uGears.pas, add portal graphics
nemo
parents:
diff
changeset
|
330 |
0, |
733f4001b8b9
Break out DrawHH/DrawGear to reduce scrolling in uGears.pas, add portal graphics
nemo
parents:
diff
changeset
|
331 |
4, |
733f4001b8b9
Break out DrawHH/DrawGear to reduce scrolling in uGears.pas, add portal graphics
nemo
parents:
diff
changeset
|
332 |
0); |
733f4001b8b9
Break out DrawHH/DrawGear to reduce scrolling in uGears.pas, add portal graphics
nemo
parents:
diff
changeset
|
333 |
defaultPos:= false; |
733f4001b8b9
Break out DrawHH/DrawGear to reduce scrolling in uGears.pas, add portal graphics
nemo
parents:
diff
changeset
|
334 |
HatVisible:= true |
733f4001b8b9
Break out DrawHH/DrawGear to reduce scrolling in uGears.pas, add portal graphics
nemo
parents:
diff
changeset
|
335 |
end |
733f4001b8b9
Break out DrawHH/DrawGear to reduce scrolling in uGears.pas, add portal graphics
nemo
parents:
diff
changeset
|
336 |
end |
733f4001b8b9
Break out DrawHH/DrawGear to reduce scrolling in uGears.pas, add portal graphics
nemo
parents:
diff
changeset
|
337 |
end else |
733f4001b8b9
Break out DrawHH/DrawGear to reduce scrolling in uGears.pas, add portal graphics
nemo
parents:
diff
changeset
|
338 |
|
733f4001b8b9
Break out DrawHH/DrawGear to reduce scrolling in uGears.pas, add portal graphics
nemo
parents:
diff
changeset
|
339 |
if ((Gear^.State and gstHHJumping) <> 0) then |
733f4001b8b9
Break out DrawHH/DrawGear to reduce scrolling in uGears.pas, add portal graphics
nemo
parents:
diff
changeset
|
340 |
begin |
733f4001b8b9
Break out DrawHH/DrawGear to reduce scrolling in uGears.pas, add portal graphics
nemo
parents:
diff
changeset
|
341 |
DrawHedgehog(sx, sy, |
4077
e7d838d063a4
Avoid a flicker of tags if jiggling a hog, remove a bunch of calls to hwRound and hwSign
nemo
parents:
4044
diff
changeset
|
342 |
sign*m, |
3387
733f4001b8b9
Break out DrawHH/DrawGear to reduce scrolling in uGears.pas, add portal graphics
nemo
parents:
diff
changeset
|
343 |
1, |
733f4001b8b9
Break out DrawHH/DrawGear to reduce scrolling in uGears.pas, add portal graphics
nemo
parents:
diff
changeset
|
344 |
1, |
733f4001b8b9
Break out DrawHH/DrawGear to reduce scrolling in uGears.pas, add portal graphics
nemo
parents:
diff
changeset
|
345 |
0); |
733f4001b8b9
Break out DrawHH/DrawGear to reduce scrolling in uGears.pas, add portal graphics
nemo
parents:
diff
changeset
|
346 |
HatVisible:= true; |
733f4001b8b9
Break out DrawHH/DrawGear to reduce scrolling in uGears.pas, add portal graphics
nemo
parents:
diff
changeset
|
347 |
defaultPos:= false |
733f4001b8b9
Break out DrawHH/DrawGear to reduce scrolling in uGears.pas, add portal graphics
nemo
parents:
diff
changeset
|
348 |
end else |
733f4001b8b9
Break out DrawHH/DrawGear to reduce scrolling in uGears.pas, add portal graphics
nemo
parents:
diff
changeset
|
349 |
|
3894 | 350 |
if (Gear^.Message and (gmLeft or gmRight) <> 0) and (not isCursorVisible) then |
3387
733f4001b8b9
Break out DrawHH/DrawGear to reduce scrolling in uGears.pas, add portal graphics
nemo
parents:
diff
changeset
|
351 |
begin |
733f4001b8b9
Break out DrawHH/DrawGear to reduce scrolling in uGears.pas, add portal graphics
nemo
parents:
diff
changeset
|
352 |
DrawHedgehog(sx, sy, |
4077
e7d838d063a4
Avoid a flicker of tags if jiggling a hog, remove a bunch of calls to hwRound and hwSign
nemo
parents:
4044
diff
changeset
|
353 |
sign, |
3387
733f4001b8b9
Break out DrawHH/DrawGear to reduce scrolling in uGears.pas, add portal graphics
nemo
parents:
diff
changeset
|
354 |
0, |
733f4001b8b9
Break out DrawHH/DrawGear to reduce scrolling in uGears.pas, add portal graphics
nemo
parents:
diff
changeset
|
355 |
HH^.visStepPos div 2, |
733f4001b8b9
Break out DrawHH/DrawGear to reduce scrolling in uGears.pas, add portal graphics
nemo
parents:
diff
changeset
|
356 |
0); |
733f4001b8b9
Break out DrawHH/DrawGear to reduce scrolling in uGears.pas, add portal graphics
nemo
parents:
diff
changeset
|
357 |
defaultPos:= false; |
733f4001b8b9
Break out DrawHH/DrawGear to reduce scrolling in uGears.pas, add portal graphics
nemo
parents:
diff
changeset
|
358 |
HatVisible:= true |
733f4001b8b9
Break out DrawHH/DrawGear to reduce scrolling in uGears.pas, add portal graphics
nemo
parents:
diff
changeset
|
359 |
end |
733f4001b8b9
Break out DrawHH/DrawGear to reduce scrolling in uGears.pas, add portal graphics
nemo
parents:
diff
changeset
|
360 |
else |
733f4001b8b9
Break out DrawHH/DrawGear to reduce scrolling in uGears.pas, add portal graphics
nemo
parents:
diff
changeset
|
361 |
|
733f4001b8b9
Break out DrawHH/DrawGear to reduce scrolling in uGears.pas, add portal graphics
nemo
parents:
diff
changeset
|
362 |
if ((Gear^.State and gstAnimation) <> 0) then |
733f4001b8b9
Break out DrawHH/DrawGear to reduce scrolling in uGears.pas, add portal graphics
nemo
parents:
diff
changeset
|
363 |
begin |
733f4001b8b9
Break out DrawHH/DrawGear to reduce scrolling in uGears.pas, add portal graphics
nemo
parents:
diff
changeset
|
364 |
if (TWave(Gear^.Tag) < Low(TWave)) or (TWave(Gear^.Tag) > High(TWave)) then |
733f4001b8b9
Break out DrawHH/DrawGear to reduce scrolling in uGears.pas, add portal graphics
nemo
parents:
diff
changeset
|
365 |
begin |
733f4001b8b9
Break out DrawHH/DrawGear to reduce scrolling in uGears.pas, add portal graphics
nemo
parents:
diff
changeset
|
366 |
Gear^.State:= Gear^.State and not gstAnimation; |
733f4001b8b9
Break out DrawHH/DrawGear to reduce scrolling in uGears.pas, add portal graphics
nemo
parents:
diff
changeset
|
367 |
end |
733f4001b8b9
Break out DrawHH/DrawGear to reduce scrolling in uGears.pas, add portal graphics
nemo
parents:
diff
changeset
|
368 |
else |
733f4001b8b9
Break out DrawHH/DrawGear to reduce scrolling in uGears.pas, add portal graphics
nemo
parents:
diff
changeset
|
369 |
begin |
733f4001b8b9
Break out DrawHH/DrawGear to reduce scrolling in uGears.pas, add portal graphics
nemo
parents:
diff
changeset
|
370 |
DrawRotatedF(Wavez[TWave(Gear^.Tag)].Sprite, |
733f4001b8b9
Break out DrawHH/DrawGear to reduce scrolling in uGears.pas, add portal graphics
nemo
parents:
diff
changeset
|
371 |
sx, |
733f4001b8b9
Break out DrawHH/DrawGear to reduce scrolling in uGears.pas, add portal graphics
nemo
parents:
diff
changeset
|
372 |
sy, |
733f4001b8b9
Break out DrawHH/DrawGear to reduce scrolling in uGears.pas, add portal graphics
nemo
parents:
diff
changeset
|
373 |
Gear^.Pos, |
4077
e7d838d063a4
Avoid a flicker of tags if jiggling a hog, remove a bunch of calls to hwRound and hwSign
nemo
parents:
4044
diff
changeset
|
374 |
sign, |
3387
733f4001b8b9
Break out DrawHH/DrawGear to reduce scrolling in uGears.pas, add portal graphics
nemo
parents:
diff
changeset
|
375 |
0.0); |
733f4001b8b9
Break out DrawHH/DrawGear to reduce scrolling in uGears.pas, add portal graphics
nemo
parents:
diff
changeset
|
376 |
defaultPos:= false |
733f4001b8b9
Break out DrawHH/DrawGear to reduce scrolling in uGears.pas, add portal graphics
nemo
parents:
diff
changeset
|
377 |
end |
733f4001b8b9
Break out DrawHH/DrawGear to reduce scrolling in uGears.pas, add portal graphics
nemo
parents:
diff
changeset
|
378 |
end |
733f4001b8b9
Break out DrawHH/DrawGear to reduce scrolling in uGears.pas, add portal graphics
nemo
parents:
diff
changeset
|
379 |
else |
733f4001b8b9
Break out DrawHH/DrawGear to reduce scrolling in uGears.pas, add portal graphics
nemo
parents:
diff
changeset
|
380 |
if ((Gear^.State and gstAttacked) = 0) then |
733f4001b8b9
Break out DrawHH/DrawGear to reduce scrolling in uGears.pas, add portal graphics
nemo
parents:
diff
changeset
|
381 |
begin |
733f4001b8b9
Break out DrawHH/DrawGear to reduce scrolling in uGears.pas, add portal graphics
nemo
parents:
diff
changeset
|
382 |
if HH^.Timer > 0 then |
733f4001b8b9
Break out DrawHH/DrawGear to reduce scrolling in uGears.pas, add portal graphics
nemo
parents:
diff
changeset
|
383 |
begin |
733f4001b8b9
Break out DrawHH/DrawGear to reduce scrolling in uGears.pas, add portal graphics
nemo
parents:
diff
changeset
|
384 |
// There must be a tidier way to do this. Anyone? |
733f4001b8b9
Break out DrawHH/DrawGear to reduce scrolling in uGears.pas, add portal graphics
nemo
parents:
diff
changeset
|
385 |
if aangle <= 90 then aangle:= aangle+360; |
733f4001b8b9
Break out DrawHH/DrawGear to reduce scrolling in uGears.pas, add portal graphics
nemo
parents:
diff
changeset
|
386 |
if Gear^.dX > _0 then aangle:= aangle-((aangle-240)*HH^.Timer/10) |
733f4001b8b9
Break out DrawHH/DrawGear to reduce scrolling in uGears.pas, add portal graphics
nemo
parents:
diff
changeset
|
387 |
else aangle:= aangle+((240-aangle)*HH^.Timer/10); |
733f4001b8b9
Break out DrawHH/DrawGear to reduce scrolling in uGears.pas, add portal graphics
nemo
parents:
diff
changeset
|
388 |
dec(HH^.Timer) |
733f4001b8b9
Break out DrawHH/DrawGear to reduce scrolling in uGears.pas, add portal graphics
nemo
parents:
diff
changeset
|
389 |
end; |
3836
833c0f32e326
Change all use of curslot/idx to CurAmmoType to try and avoid some bugs with use of last weapon.
nemo
parents:
3751
diff
changeset
|
390 |
amt:= CurrentHedgehog^.CurAmmoType; |
833c0f32e326
Change all use of curslot/idx to CurAmmoType to try and avoid some bugs with use of last weapon.
nemo
parents:
3751
diff
changeset
|
391 |
CurWeapon:= GetAmmoEntry(HH^); |
3387
733f4001b8b9
Break out DrawHH/DrawGear to reduce scrolling in uGears.pas, add portal graphics
nemo
parents:
diff
changeset
|
392 |
case amt of |
4077
e7d838d063a4
Avoid a flicker of tags if jiggling a hog, remove a bunch of calls to hwRound and hwSign
nemo
parents:
4044
diff
changeset
|
393 |
amBazooka: DrawRotated(sprHandBazooka, hx, hy, sign, aangle); |
e7d838d063a4
Avoid a flicker of tags if jiggling a hog, remove a bunch of calls to hwRound and hwSign
nemo
parents:
4044
diff
changeset
|
394 |
amMortar: DrawRotated(sprHandMortar, hx, hy, sign, aangle); |
e7d838d063a4
Avoid a flicker of tags if jiggling a hog, remove a bunch of calls to hwRound and hwSign
nemo
parents:
4044
diff
changeset
|
395 |
amMolotov: DrawRotated(sprHandMolotov, hx, hy, sign, aangle); |
e7d838d063a4
Avoid a flicker of tags if jiggling a hog, remove a bunch of calls to hwRound and hwSign
nemo
parents:
4044
diff
changeset
|
396 |
amBallgun: DrawRotated(sprHandBallgun, hx, hy, sign, aangle); |
e7d838d063a4
Avoid a flicker of tags if jiggling a hog, remove a bunch of calls to hwRound and hwSign
nemo
parents:
4044
diff
changeset
|
397 |
amDrill: DrawRotated(sprHandDrill, hx, hy, sign, aangle); |
e7d838d063a4
Avoid a flicker of tags if jiggling a hog, remove a bunch of calls to hwRound and hwSign
nemo
parents:
4044
diff
changeset
|
398 |
amRope: DrawRotated(sprHandRope, hx, hy, sign, aangle); |
e7d838d063a4
Avoid a flicker of tags if jiggling a hog, remove a bunch of calls to hwRound and hwSign
nemo
parents:
4044
diff
changeset
|
399 |
amShotgun: DrawRotated(sprHandShotgun, hx, hy, sign, aangle); |
e7d838d063a4
Avoid a flicker of tags if jiggling a hog, remove a bunch of calls to hwRound and hwSign
nemo
parents:
4044
diff
changeset
|
400 |
amDEagle: DrawRotated(sprHandDEagle, hx, hy, sign, aangle); |
e7d838d063a4
Avoid a flicker of tags if jiggling a hog, remove a bunch of calls to hwRound and hwSign
nemo
parents:
4044
diff
changeset
|
401 |
amSineGun: DrawRotated(sprHandShotgun, hx, hy, sign, aangle); |
3836
833c0f32e326
Change all use of curslot/idx to CurAmmoType to try and avoid some bugs with use of last weapon.
nemo
parents:
3751
diff
changeset
|
402 |
amPortalGun: if (CurWeapon^.Timer and 2) <> 0 then // Add a new Hedgehog value instead of abusing timer? |
4077
e7d838d063a4
Avoid a flicker of tags if jiggling a hog, remove a bunch of calls to hwRound and hwSign
nemo
parents:
4044
diff
changeset
|
403 |
DrawRotatedF(sprPortalGun, hx, hy, 0, sign, aangle) |
3396
e5b3e5f2818e
More portal changes. Allows for a multishoot utility. Hopefully not breaking anything.
nemo
parents:
3393
diff
changeset
|
404 |
else |
4077
e7d838d063a4
Avoid a flicker of tags if jiggling a hog, remove a bunch of calls to hwRound and hwSign
nemo
parents:
4044
diff
changeset
|
405 |
DrawRotatedF(sprPortalGun, hx, hy, 1+(CurWeapon^.Timer and 1), sign, aangle); |
e7d838d063a4
Avoid a flicker of tags if jiggling a hog, remove a bunch of calls to hwRound and hwSign
nemo
parents:
4044
diff
changeset
|
406 |
amSniperRifle: DrawRotatedF(sprSniperRifle, hx, hy, 0, sign, aangle); |
e7d838d063a4
Avoid a flicker of tags if jiggling a hog, remove a bunch of calls to hwRound and hwSign
nemo
parents:
4044
diff
changeset
|
407 |
amBlowTorch: DrawRotated(sprHandBlowTorch, hx, hy, sign, aangle); |
e7d838d063a4
Avoid a flicker of tags if jiggling a hog, remove a bunch of calls to hwRound and hwSign
nemo
parents:
4044
diff
changeset
|
408 |
amCake: DrawRotated(sprHandCake, hx, hy, sign, aangle); |
e7d838d063a4
Avoid a flicker of tags if jiggling a hog, remove a bunch of calls to hwRound and hwSign
nemo
parents:
4044
diff
changeset
|
409 |
amGrenade: DrawRotated(sprHandGrenade, hx, hy, sign, aangle); |
e7d838d063a4
Avoid a flicker of tags if jiggling a hog, remove a bunch of calls to hwRound and hwSign
nemo
parents:
4044
diff
changeset
|
410 |
amWatermelon: DrawRotated(sprHandMelon, hx, hy, sign, aangle); |
e7d838d063a4
Avoid a flicker of tags if jiggling a hog, remove a bunch of calls to hwRound and hwSign
nemo
parents:
4044
diff
changeset
|
411 |
amSkip: DrawRotated(sprHandSkip, hx, hy, sign, aangle); |
e7d838d063a4
Avoid a flicker of tags if jiggling a hog, remove a bunch of calls to hwRound and hwSign
nemo
parents:
4044
diff
changeset
|
412 |
amClusterBomb: DrawRotated(sprHandCluster, hx, hy, sign, aangle); |
e7d838d063a4
Avoid a flicker of tags if jiggling a hog, remove a bunch of calls to hwRound and hwSign
nemo
parents:
4044
diff
changeset
|
413 |
amDynamite: DrawRotated(sprHandDynamite, hx, hy, sign, aangle); |
e7d838d063a4
Avoid a flicker of tags if jiggling a hog, remove a bunch of calls to hwRound and hwSign
nemo
parents:
4044
diff
changeset
|
414 |
amHellishBomb: DrawRotated(sprHandHellish, hx, hy, sign, aangle); |
e7d838d063a4
Avoid a flicker of tags if jiggling a hog, remove a bunch of calls to hwRound and hwSign
nemo
parents:
4044
diff
changeset
|
415 |
amGasBomb: DrawRotated(sprHandCheese, hx, hy, sign, aangle); |
e7d838d063a4
Avoid a flicker of tags if jiggling a hog, remove a bunch of calls to hwRound and hwSign
nemo
parents:
4044
diff
changeset
|
416 |
amMine: DrawRotated(sprHandMine, hx, hy, sign, aangle); |
e7d838d063a4
Avoid a flicker of tags if jiggling a hog, remove a bunch of calls to hwRound and hwSign
nemo
parents:
4044
diff
changeset
|
417 |
amSMine: DrawRotated(sprHandSMine, hx, hy, sign, aangle); |
e7d838d063a4
Avoid a flicker of tags if jiggling a hog, remove a bunch of calls to hwRound and hwSign
nemo
parents:
4044
diff
changeset
|
418 |
amSeduction: DrawRotated(sprHandSeduction, hx, hy, sign, aangle); |
e7d838d063a4
Avoid a flicker of tags if jiggling a hog, remove a bunch of calls to hwRound and hwSign
nemo
parents:
4044
diff
changeset
|
419 |
amVampiric: DrawRotatedF(sprHandVamp, hx, hy, (RealTicks div 125) mod 4, sign, aangle); |
3387
733f4001b8b9
Break out DrawHH/DrawGear to reduce scrolling in uGears.pas, add portal graphics
nemo
parents:
diff
changeset
|
420 |
amRCPlane: begin |
4077
e7d838d063a4
Avoid a flicker of tags if jiggling a hog, remove a bunch of calls to hwRound and hwSign
nemo
parents:
4044
diff
changeset
|
421 |
DrawRotated(sprHandPlane, hx, hy, sign, 0); |
3387
733f4001b8b9
Break out DrawHH/DrawGear to reduce scrolling in uGears.pas, add portal graphics
nemo
parents:
diff
changeset
|
422 |
defaultPos:= false |
733f4001b8b9
Break out DrawHH/DrawGear to reduce scrolling in uGears.pas, add portal graphics
nemo
parents:
diff
changeset
|
423 |
end; |
733f4001b8b9
Break out DrawHH/DrawGear to reduce scrolling in uGears.pas, add portal graphics
nemo
parents:
diff
changeset
|
424 |
amGirder: begin |
4077
e7d838d063a4
Avoid a flicker of tags if jiggling a hog, remove a bunch of calls to hwRound and hwSign
nemo
parents:
4044
diff
changeset
|
425 |
DrawRotated(sprHandConstruction, hx, hy, sign, aangle); |
3387
733f4001b8b9
Break out DrawHH/DrawGear to reduce scrolling in uGears.pas, add portal graphics
nemo
parents:
diff
changeset
|
426 |
DrawSpriteClipped(sprGirder, |
4077
e7d838d063a4
Avoid a flicker of tags if jiggling a hog, remove a bunch of calls to hwRound and hwSign
nemo
parents:
4044
diff
changeset
|
427 |
ox-256, |
e7d838d063a4
Avoid a flicker of tags if jiggling a hog, remove a bunch of calls to hwRound and hwSign
nemo
parents:
4044
diff
changeset
|
428 |
oy-256, |
3387
733f4001b8b9
Break out DrawHH/DrawGear to reduce scrolling in uGears.pas, add portal graphics
nemo
parents:
diff
changeset
|
429 |
LongInt(topY)+WorldDy, |
733f4001b8b9
Break out DrawHH/DrawGear to reduce scrolling in uGears.pas, add portal graphics
nemo
parents:
diff
changeset
|
430 |
LongInt(rightX)+WorldDx, |
733f4001b8b9
Break out DrawHH/DrawGear to reduce scrolling in uGears.pas, add portal graphics
nemo
parents:
diff
changeset
|
431 |
cWaterLine+WorldDy, |
733f4001b8b9
Break out DrawHH/DrawGear to reduce scrolling in uGears.pas, add portal graphics
nemo
parents:
diff
changeset
|
432 |
LongInt(leftX)+WorldDx) |
733f4001b8b9
Break out DrawHH/DrawGear to reduce scrolling in uGears.pas, add portal graphics
nemo
parents:
diff
changeset
|
433 |
end; |
4077
e7d838d063a4
Avoid a flicker of tags if jiggling a hog, remove a bunch of calls to hwRound and hwSign
nemo
parents:
4044
diff
changeset
|
434 |
amBee: DrawRotatedF(sprHandBee, hx, hy, (RealTicks div 125) mod 4, sign, aangle); |
e7d838d063a4
Avoid a flicker of tags if jiggling a hog, remove a bunch of calls to hwRound and hwSign
nemo
parents:
4044
diff
changeset
|
435 |
amFlamethrower: DrawRotatedF(sprHandFlamethrower, hx, hy, (RealTicks div 125) mod 4, sign, aangle); |
4222 | 436 |
amResurrector: DrawCircle(ox, oy, 98, 4, $F5, $DB, $35, $AA); // I'd rather not like to hardcode 100 here |
3387
733f4001b8b9
Break out DrawHH/DrawGear to reduce scrolling in uGears.pas, add portal graphics
nemo
parents:
diff
changeset
|
437 |
end; |
733f4001b8b9
Break out DrawHH/DrawGear to reduce scrolling in uGears.pas, add portal graphics
nemo
parents:
diff
changeset
|
438 |
|
733f4001b8b9
Break out DrawHH/DrawGear to reduce scrolling in uGears.pas, add portal graphics
nemo
parents:
diff
changeset
|
439 |
case amt of |
733f4001b8b9
Break out DrawHH/DrawGear to reduce scrolling in uGears.pas, add portal graphics
nemo
parents:
diff
changeset
|
440 |
amAirAttack, |
4077
e7d838d063a4
Avoid a flicker of tags if jiggling a hog, remove a bunch of calls to hwRound and hwSign
nemo
parents:
4044
diff
changeset
|
441 |
amMineStrike: DrawRotated(sprHandAirAttack, sx, oy, sign, 0); |
3387
733f4001b8b9
Break out DrawHH/DrawGear to reduce scrolling in uGears.pas, add portal graphics
nemo
parents:
diff
changeset
|
442 |
amPickHammer: DrawHedgehog(sx, sy, |
4077
e7d838d063a4
Avoid a flicker of tags if jiggling a hog, remove a bunch of calls to hwRound and hwSign
nemo
parents:
4044
diff
changeset
|
443 |
sign, |
3387
733f4001b8b9
Break out DrawHH/DrawGear to reduce scrolling in uGears.pas, add portal graphics
nemo
parents:
diff
changeset
|
444 |
1, |
733f4001b8b9
Break out DrawHH/DrawGear to reduce scrolling in uGears.pas, add portal graphics
nemo
parents:
diff
changeset
|
445 |
2, |
733f4001b8b9
Break out DrawHH/DrawGear to reduce scrolling in uGears.pas, add portal graphics
nemo
parents:
diff
changeset
|
446 |
0); |
4077
e7d838d063a4
Avoid a flicker of tags if jiggling a hog, remove a bunch of calls to hwRound and hwSign
nemo
parents:
4044
diff
changeset
|
447 |
amTeleport: DrawRotatedF(sprTeleport, sx, sy, 0, sign, 0); |
3387
733f4001b8b9
Break out DrawHH/DrawGear to reduce scrolling in uGears.pas, add portal graphics
nemo
parents:
diff
changeset
|
448 |
amKamikaze: DrawHedgehog(sx, sy, |
4077
e7d838d063a4
Avoid a flicker of tags if jiggling a hog, remove a bunch of calls to hwRound and hwSign
nemo
parents:
4044
diff
changeset
|
449 |
sign, |
3387
733f4001b8b9
Break out DrawHH/DrawGear to reduce scrolling in uGears.pas, add portal graphics
nemo
parents:
diff
changeset
|
450 |
1, |
733f4001b8b9
Break out DrawHH/DrawGear to reduce scrolling in uGears.pas, add portal graphics
nemo
parents:
diff
changeset
|
451 |
5, |
733f4001b8b9
Break out DrawHH/DrawGear to reduce scrolling in uGears.pas, add portal graphics
nemo
parents:
diff
changeset
|
452 |
0); |
733f4001b8b9
Break out DrawHH/DrawGear to reduce scrolling in uGears.pas, add portal graphics
nemo
parents:
diff
changeset
|
453 |
amWhip: DrawRotatedF(sprWhip, |
733f4001b8b9
Break out DrawHH/DrawGear to reduce scrolling in uGears.pas, add portal graphics
nemo
parents:
diff
changeset
|
454 |
sx, |
733f4001b8b9
Break out DrawHH/DrawGear to reduce scrolling in uGears.pas, add portal graphics
nemo
parents:
diff
changeset
|
455 |
sy, |
733f4001b8b9
Break out DrawHH/DrawGear to reduce scrolling in uGears.pas, add portal graphics
nemo
parents:
diff
changeset
|
456 |
0, |
4077
e7d838d063a4
Avoid a flicker of tags if jiggling a hog, remove a bunch of calls to hwRound and hwSign
nemo
parents:
4044
diff
changeset
|
457 |
sign, |
3387
733f4001b8b9
Break out DrawHH/DrawGear to reduce scrolling in uGears.pas, add portal graphics
nemo
parents:
diff
changeset
|
458 |
0); |
3717 | 459 |
amHammer: DrawRotatedF(sprHammer, |
460 |
sx, |
|
461 |
sy, |
|
462 |
0, |
|
4077
e7d838d063a4
Avoid a flicker of tags if jiggling a hog, remove a bunch of calls to hwRound and hwSign
nemo
parents:
4044
diff
changeset
|
463 |
sign, |
3717 | 464 |
0); |
3387
733f4001b8b9
Break out DrawHH/DrawGear to reduce scrolling in uGears.pas, add portal graphics
nemo
parents:
diff
changeset
|
465 |
else |
733f4001b8b9
Break out DrawHH/DrawGear to reduce scrolling in uGears.pas, add portal graphics
nemo
parents:
diff
changeset
|
466 |
DrawHedgehog(sx, sy, |
4077
e7d838d063a4
Avoid a flicker of tags if jiggling a hog, remove a bunch of calls to hwRound and hwSign
nemo
parents:
4044
diff
changeset
|
467 |
sign, |
3387
733f4001b8b9
Break out DrawHH/DrawGear to reduce scrolling in uGears.pas, add portal graphics
nemo
parents:
diff
changeset
|
468 |
0, |
733f4001b8b9
Break out DrawHH/DrawGear to reduce scrolling in uGears.pas, add portal graphics
nemo
parents:
diff
changeset
|
469 |
4, |
733f4001b8b9
Break out DrawHH/DrawGear to reduce scrolling in uGears.pas, add portal graphics
nemo
parents:
diff
changeset
|
470 |
0); |
733f4001b8b9
Break out DrawHH/DrawGear to reduce scrolling in uGears.pas, add portal graphics
nemo
parents:
diff
changeset
|
471 |
|
733f4001b8b9
Break out DrawHH/DrawGear to reduce scrolling in uGears.pas, add portal graphics
nemo
parents:
diff
changeset
|
472 |
HatVisible:= true; |
733f4001b8b9
Break out DrawHH/DrawGear to reduce scrolling in uGears.pas, add portal graphics
nemo
parents:
diff
changeset
|
473 |
(* with HH^ do |
733f4001b8b9
Break out DrawHH/DrawGear to reduce scrolling in uGears.pas, add portal graphics
nemo
parents:
diff
changeset
|
474 |
if (HatTex <> nil) |
733f4001b8b9
Break out DrawHH/DrawGear to reduce scrolling in uGears.pas, add portal graphics
nemo
parents:
diff
changeset
|
475 |
and (HatVisibility > 0) then |
733f4001b8b9
Break out DrawHH/DrawGear to reduce scrolling in uGears.pas, add portal graphics
nemo
parents:
diff
changeset
|
476 |
DrawTextureF(HatTex, |
733f4001b8b9
Break out DrawHH/DrawGear to reduce scrolling in uGears.pas, add portal graphics
nemo
parents:
diff
changeset
|
477 |
HatVisibility, |
733f4001b8b9
Break out DrawHH/DrawGear to reduce scrolling in uGears.pas, add portal graphics
nemo
parents:
diff
changeset
|
478 |
sx, |
4077
e7d838d063a4
Avoid a flicker of tags if jiggling a hog, remove a bunch of calls to hwRound and hwSign
nemo
parents:
4044
diff
changeset
|
479 |
sy - 5, |
3387
733f4001b8b9
Break out DrawHH/DrawGear to reduce scrolling in uGears.pas, add portal graphics
nemo
parents:
diff
changeset
|
480 |
0, |
4077
e7d838d063a4
Avoid a flicker of tags if jiggling a hog, remove a bunch of calls to hwRound and hwSign
nemo
parents:
4044
diff
changeset
|
481 |
sign, |
3387
733f4001b8b9
Break out DrawHH/DrawGear to reduce scrolling in uGears.pas, add portal graphics
nemo
parents:
diff
changeset
|
482 |
32, |
733f4001b8b9
Break out DrawHH/DrawGear to reduce scrolling in uGears.pas, add portal graphics
nemo
parents:
diff
changeset
|
483 |
32); *) |
733f4001b8b9
Break out DrawHH/DrawGear to reduce scrolling in uGears.pas, add portal graphics
nemo
parents:
diff
changeset
|
484 |
end; |
733f4001b8b9
Break out DrawHH/DrawGear to reduce scrolling in uGears.pas, add portal graphics
nemo
parents:
diff
changeset
|
485 |
|
733f4001b8b9
Break out DrawHH/DrawGear to reduce scrolling in uGears.pas, add portal graphics
nemo
parents:
diff
changeset
|
486 |
case amt of |
733f4001b8b9
Break out DrawHH/DrawGear to reduce scrolling in uGears.pas, add portal graphics
nemo
parents:
diff
changeset
|
487 |
amBaseballBat: DrawRotated(sprHandBaseball, |
4077
e7d838d063a4
Avoid a flicker of tags if jiggling a hog, remove a bunch of calls to hwRound and hwSign
nemo
parents:
4044
diff
changeset
|
488 |
sx - 4 * sign, |
e7d838d063a4
Avoid a flicker of tags if jiggling a hog, remove a bunch of calls to hwRound and hwSign
nemo
parents:
4044
diff
changeset
|
489 |
sy + 9, sign, aangle); |
3387
733f4001b8b9
Break out DrawHH/DrawGear to reduce scrolling in uGears.pas, add portal graphics
nemo
parents:
diff
changeset
|
490 |
end; |
733f4001b8b9
Break out DrawHH/DrawGear to reduce scrolling in uGears.pas, add portal graphics
nemo
parents:
diff
changeset
|
491 |
|
733f4001b8b9
Break out DrawHH/DrawGear to reduce scrolling in uGears.pas, add portal graphics
nemo
parents:
diff
changeset
|
492 |
defaultPos:= false |
733f4001b8b9
Break out DrawHH/DrawGear to reduce scrolling in uGears.pas, add portal graphics
nemo
parents:
diff
changeset
|
493 |
end; |
733f4001b8b9
Break out DrawHH/DrawGear to reduce scrolling in uGears.pas, add portal graphics
nemo
parents:
diff
changeset
|
494 |
|
733f4001b8b9
Break out DrawHH/DrawGear to reduce scrolling in uGears.pas, add portal graphics
nemo
parents:
diff
changeset
|
495 |
end else // not gstHHDriven |
733f4001b8b9
Break out DrawHH/DrawGear to reduce scrolling in uGears.pas, add portal graphics
nemo
parents:
diff
changeset
|
496 |
begin |
733f4001b8b9
Break out DrawHH/DrawGear to reduce scrolling in uGears.pas, add portal graphics
nemo
parents:
diff
changeset
|
497 |
if (Gear^.Damage > 0) |
733f4001b8b9
Break out DrawHH/DrawGear to reduce scrolling in uGears.pas, add portal graphics
nemo
parents:
diff
changeset
|
498 |
and (hwSqr(Gear^.dX) + hwSqr(Gear^.dY) > _0_003) then |
733f4001b8b9
Break out DrawHH/DrawGear to reduce scrolling in uGears.pas, add portal graphics
nemo
parents:
diff
changeset
|
499 |
begin |
733f4001b8b9
Break out DrawHH/DrawGear to reduce scrolling in uGears.pas, add portal graphics
nemo
parents:
diff
changeset
|
500 |
DrawHedgehog(sx, sy, |
4077
e7d838d063a4
Avoid a flicker of tags if jiggling a hog, remove a bunch of calls to hwRound and hwSign
nemo
parents:
4044
diff
changeset
|
501 |
sign, |
3387
733f4001b8b9
Break out DrawHH/DrawGear to reduce scrolling in uGears.pas, add portal graphics
nemo
parents:
diff
changeset
|
502 |
2, |
733f4001b8b9
Break out DrawHH/DrawGear to reduce scrolling in uGears.pas, add portal graphics
nemo
parents:
diff
changeset
|
503 |
1, |
733f4001b8b9
Break out DrawHH/DrawGear to reduce scrolling in uGears.pas, add portal graphics
nemo
parents:
diff
changeset
|
504 |
Gear^.DirAngle); |
733f4001b8b9
Break out DrawHH/DrawGear to reduce scrolling in uGears.pas, add portal graphics
nemo
parents:
diff
changeset
|
505 |
defaultPos:= false |
733f4001b8b9
Break out DrawHH/DrawGear to reduce scrolling in uGears.pas, add portal graphics
nemo
parents:
diff
changeset
|
506 |
end else |
733f4001b8b9
Break out DrawHH/DrawGear to reduce scrolling in uGears.pas, add portal graphics
nemo
parents:
diff
changeset
|
507 |
|
733f4001b8b9
Break out DrawHH/DrawGear to reduce scrolling in uGears.pas, add portal graphics
nemo
parents:
diff
changeset
|
508 |
if ((Gear^.State and gstHHJumping) <> 0) then |
733f4001b8b9
Break out DrawHH/DrawGear to reduce scrolling in uGears.pas, add portal graphics
nemo
parents:
diff
changeset
|
509 |
begin |
733f4001b8b9
Break out DrawHH/DrawGear to reduce scrolling in uGears.pas, add portal graphics
nemo
parents:
diff
changeset
|
510 |
DrawHedgehog(sx, sy, |
4077
e7d838d063a4
Avoid a flicker of tags if jiggling a hog, remove a bunch of calls to hwRound and hwSign
nemo
parents:
4044
diff
changeset
|
511 |
sign*m, |
3387
733f4001b8b9
Break out DrawHH/DrawGear to reduce scrolling in uGears.pas, add portal graphics
nemo
parents:
diff
changeset
|
512 |
1, |
733f4001b8b9
Break out DrawHH/DrawGear to reduce scrolling in uGears.pas, add portal graphics
nemo
parents:
diff
changeset
|
513 |
1, |
733f4001b8b9
Break out DrawHH/DrawGear to reduce scrolling in uGears.pas, add portal graphics
nemo
parents:
diff
changeset
|
514 |
0); |
733f4001b8b9
Break out DrawHH/DrawGear to reduce scrolling in uGears.pas, add portal graphics
nemo
parents:
diff
changeset
|
515 |
defaultPos:= false |
733f4001b8b9
Break out DrawHH/DrawGear to reduce scrolling in uGears.pas, add portal graphics
nemo
parents:
diff
changeset
|
516 |
end; |
733f4001b8b9
Break out DrawHH/DrawGear to reduce scrolling in uGears.pas, add portal graphics
nemo
parents:
diff
changeset
|
517 |
end; |
733f4001b8b9
Break out DrawHH/DrawGear to reduce scrolling in uGears.pas, add portal graphics
nemo
parents:
diff
changeset
|
518 |
|
733f4001b8b9
Break out DrawHH/DrawGear to reduce scrolling in uGears.pas, add portal graphics
nemo
parents:
diff
changeset
|
519 |
with HH^ do |
733f4001b8b9
Break out DrawHH/DrawGear to reduce scrolling in uGears.pas, add portal graphics
nemo
parents:
diff
changeset
|
520 |
begin |
733f4001b8b9
Break out DrawHH/DrawGear to reduce scrolling in uGears.pas, add portal graphics
nemo
parents:
diff
changeset
|
521 |
if defaultPos then |
733f4001b8b9
Break out DrawHH/DrawGear to reduce scrolling in uGears.pas, add portal graphics
nemo
parents:
diff
changeset
|
522 |
begin |
733f4001b8b9
Break out DrawHH/DrawGear to reduce scrolling in uGears.pas, add portal graphics
nemo
parents:
diff
changeset
|
523 |
DrawRotatedF(sprHHIdle, |
733f4001b8b9
Break out DrawHH/DrawGear to reduce scrolling in uGears.pas, add portal graphics
nemo
parents:
diff
changeset
|
524 |
sx, |
733f4001b8b9
Break out DrawHH/DrawGear to reduce scrolling in uGears.pas, add portal graphics
nemo
parents:
diff
changeset
|
525 |
sy, |
733f4001b8b9
Break out DrawHH/DrawGear to reduce scrolling in uGears.pas, add portal graphics
nemo
parents:
diff
changeset
|
526 |
(RealTicks div 128 + Gear^.Pos) mod 19, |
4077
e7d838d063a4
Avoid a flicker of tags if jiggling a hog, remove a bunch of calls to hwRound and hwSign
nemo
parents:
4044
diff
changeset
|
527 |
sign, |
3387
733f4001b8b9
Break out DrawHH/DrawGear to reduce scrolling in uGears.pas, add portal graphics
nemo
parents:
diff
changeset
|
528 |
0); |
733f4001b8b9
Break out DrawHH/DrawGear to reduce scrolling in uGears.pas, add portal graphics
nemo
parents:
diff
changeset
|
529 |
HatVisible:= true; |
733f4001b8b9
Break out DrawHH/DrawGear to reduce scrolling in uGears.pas, add portal graphics
nemo
parents:
diff
changeset
|
530 |
end; |
733f4001b8b9
Break out DrawHH/DrawGear to reduce scrolling in uGears.pas, add portal graphics
nemo
parents:
diff
changeset
|
531 |
|
733f4001b8b9
Break out DrawHH/DrawGear to reduce scrolling in uGears.pas, add portal graphics
nemo
parents:
diff
changeset
|
532 |
if HatVisible then |
733f4001b8b9
Break out DrawHH/DrawGear to reduce scrolling in uGears.pas, add portal graphics
nemo
parents:
diff
changeset
|
533 |
if HatVisibility < 1.0 then |
733f4001b8b9
Break out DrawHH/DrawGear to reduce scrolling in uGears.pas, add portal graphics
nemo
parents:
diff
changeset
|
534 |
HatVisibility:= HatVisibility + 0.2 |
733f4001b8b9
Break out DrawHH/DrawGear to reduce scrolling in uGears.pas, add portal graphics
nemo
parents:
diff
changeset
|
535 |
else |
733f4001b8b9
Break out DrawHH/DrawGear to reduce scrolling in uGears.pas, add portal graphics
nemo
parents:
diff
changeset
|
536 |
else |
733f4001b8b9
Break out DrawHH/DrawGear to reduce scrolling in uGears.pas, add portal graphics
nemo
parents:
diff
changeset
|
537 |
if HatVisibility > 0.0 then |
733f4001b8b9
Break out DrawHH/DrawGear to reduce scrolling in uGears.pas, add portal graphics
nemo
parents:
diff
changeset
|
538 |
HatVisibility:= HatVisibility - 0.2; |
733f4001b8b9
Break out DrawHH/DrawGear to reduce scrolling in uGears.pas, add portal graphics
nemo
parents:
diff
changeset
|
539 |
|
733f4001b8b9
Break out DrawHH/DrawGear to reduce scrolling in uGears.pas, add portal graphics
nemo
parents:
diff
changeset
|
540 |
if (HatTex <> nil) |
733f4001b8b9
Break out DrawHH/DrawGear to reduce scrolling in uGears.pas, add portal graphics
nemo
parents:
diff
changeset
|
541 |
and (HatVisibility > 0) then |
733f4001b8b9
Break out DrawHH/DrawGear to reduce scrolling in uGears.pas, add portal graphics
nemo
parents:
diff
changeset
|
542 |
if DefaultPos then |
3445 | 543 |
begin |
3387
733f4001b8b9
Break out DrawHH/DrawGear to reduce scrolling in uGears.pas, add portal graphics
nemo
parents:
diff
changeset
|
544 |
DrawTextureF(HatTex, |
733f4001b8b9
Break out DrawHH/DrawGear to reduce scrolling in uGears.pas, add portal graphics
nemo
parents:
diff
changeset
|
545 |
HatVisibility, |
733f4001b8b9
Break out DrawHH/DrawGear to reduce scrolling in uGears.pas, add portal graphics
nemo
parents:
diff
changeset
|
546 |
sx, |
4077
e7d838d063a4
Avoid a flicker of tags if jiggling a hog, remove a bunch of calls to hwRound and hwSign
nemo
parents:
4044
diff
changeset
|
547 |
sy - 5, |
3387
733f4001b8b9
Break out DrawHH/DrawGear to reduce scrolling in uGears.pas, add portal graphics
nemo
parents:
diff
changeset
|
548 |
(RealTicks div 128 + Gear^.Pos) mod 19, |
4077
e7d838d063a4
Avoid a flicker of tags if jiggling a hog, remove a bunch of calls to hwRound and hwSign
nemo
parents:
4044
diff
changeset
|
549 |
sign, |
3387
733f4001b8b9
Break out DrawHH/DrawGear to reduce scrolling in uGears.pas, add portal graphics
nemo
parents:
diff
changeset
|
550 |
32, |
3445 | 551 |
32); |
3854 | 552 |
if HatTex^.w > 64 then |
3445 | 553 |
begin |
554 |
Tint(HH^.Team^.Clan^.Color); |
|
555 |
DrawTextureF(HatTex, |
|
556 |
HatVisibility, |
|
557 |
sx, |
|
4077
e7d838d063a4
Avoid a flicker of tags if jiggling a hog, remove a bunch of calls to hwRound and hwSign
nemo
parents:
4044
diff
changeset
|
558 |
sy - 5, |
3445 | 559 |
(RealTicks div 128 + Gear^.Pos) mod 19 + 32, |
4077
e7d838d063a4
Avoid a flicker of tags if jiggling a hog, remove a bunch of calls to hwRound and hwSign
nemo
parents:
4044
diff
changeset
|
560 |
sign, |
3445 | 561 |
32, |
562 |
32); |
|
563 |
Tint($FF, $FF, $FF, $FF) |
|
564 |
end |
|
565 |
end |
|
3387
733f4001b8b9
Break out DrawHH/DrawGear to reduce scrolling in uGears.pas, add portal graphics
nemo
parents:
diff
changeset
|
566 |
else |
3445 | 567 |
begin |
3387
733f4001b8b9
Break out DrawHH/DrawGear to reduce scrolling in uGears.pas, add portal graphics
nemo
parents:
diff
changeset
|
568 |
DrawTextureF(HatTex, |
733f4001b8b9
Break out DrawHH/DrawGear to reduce scrolling in uGears.pas, add portal graphics
nemo
parents:
diff
changeset
|
569 |
HatVisibility, |
733f4001b8b9
Break out DrawHH/DrawGear to reduce scrolling in uGears.pas, add portal graphics
nemo
parents:
diff
changeset
|
570 |
sx, |
4077
e7d838d063a4
Avoid a flicker of tags if jiggling a hog, remove a bunch of calls to hwRound and hwSign
nemo
parents:
4044
diff
changeset
|
571 |
sy - 5, |
3387
733f4001b8b9
Break out DrawHH/DrawGear to reduce scrolling in uGears.pas, add portal graphics
nemo
parents:
diff
changeset
|
572 |
0, |
4077
e7d838d063a4
Avoid a flicker of tags if jiggling a hog, remove a bunch of calls to hwRound and hwSign
nemo
parents:
4044
diff
changeset
|
573 |
sign*m, |
3387
733f4001b8b9
Break out DrawHH/DrawGear to reduce scrolling in uGears.pas, add portal graphics
nemo
parents:
diff
changeset
|
574 |
32, |
733f4001b8b9
Break out DrawHH/DrawGear to reduce scrolling in uGears.pas, add portal graphics
nemo
parents:
diff
changeset
|
575 |
32); |
3854 | 576 |
if HatTex^.w > 64 then |
3445 | 577 |
begin |
578 |
Tint(HH^.Team^.Clan^.Color); |
|
579 |
DrawTextureF(HatTex, |
|
580 |
HatVisibility, |
|
581 |
sx, |
|
4077
e7d838d063a4
Avoid a flicker of tags if jiggling a hog, remove a bunch of calls to hwRound and hwSign
nemo
parents:
4044
diff
changeset
|
582 |
sy - 5, |
3445 | 583 |
32, |
4077
e7d838d063a4
Avoid a flicker of tags if jiggling a hog, remove a bunch of calls to hwRound and hwSign
nemo
parents:
4044
diff
changeset
|
584 |
sign*m, |
3445 | 585 |
32, |
586 |
32); |
|
587 |
Tint($FF, $FF, $FF, $FF) |
|
588 |
end |
|
589 |
end |
|
3387
733f4001b8b9
Break out DrawHH/DrawGear to reduce scrolling in uGears.pas, add portal graphics
nemo
parents:
diff
changeset
|
590 |
end; |
733f4001b8b9
Break out DrawHH/DrawGear to reduce scrolling in uGears.pas, add portal graphics
nemo
parents:
diff
changeset
|
591 |
if (Gear^.State and gstHHDriven) <> 0 then |
733f4001b8b9
Break out DrawHH/DrawGear to reduce scrolling in uGears.pas, add portal graphics
nemo
parents:
diff
changeset
|
592 |
begin |
733f4001b8b9
Break out DrawHH/DrawGear to reduce scrolling in uGears.pas, add portal graphics
nemo
parents:
diff
changeset
|
593 |
(* if (CurAmmoGear = nil) then |
733f4001b8b9
Break out DrawHH/DrawGear to reduce scrolling in uGears.pas, add portal graphics
nemo
parents:
diff
changeset
|
594 |
begin |
3836
833c0f32e326
Change all use of curslot/idx to CurAmmoType to try and avoid some bugs with use of last weapon.
nemo
parents:
3751
diff
changeset
|
595 |
amt:= CurrentHedgehog^.CurAmmoType; |
3387
733f4001b8b9
Break out DrawHH/DrawGear to reduce scrolling in uGears.pas, add portal graphics
nemo
parents:
diff
changeset
|
596 |
case amt of |
733f4001b8b9
Break out DrawHH/DrawGear to reduce scrolling in uGears.pas, add portal graphics
nemo
parents:
diff
changeset
|
597 |
amJetpack: DrawSprite(sprJetpack, sx-32, sy-32, 0); |
733f4001b8b9
Break out DrawHH/DrawGear to reduce scrolling in uGears.pas, add portal graphics
nemo
parents:
diff
changeset
|
598 |
end |
733f4001b8b9
Break out DrawHH/DrawGear to reduce scrolling in uGears.pas, add portal graphics
nemo
parents:
diff
changeset
|
599 |
end; *) |
733f4001b8b9
Break out DrawHH/DrawGear to reduce scrolling in uGears.pas, add portal graphics
nemo
parents:
diff
changeset
|
600 |
if CurAmmoGear <> nil then |
733f4001b8b9
Break out DrawHH/DrawGear to reduce scrolling in uGears.pas, add portal graphics
nemo
parents:
diff
changeset
|
601 |
begin |
733f4001b8b9
Break out DrawHH/DrawGear to reduce scrolling in uGears.pas, add portal graphics
nemo
parents:
diff
changeset
|
602 |
case CurAmmoGear^.Kind of |
733f4001b8b9
Break out DrawHH/DrawGear to reduce scrolling in uGears.pas, add portal graphics
nemo
parents:
diff
changeset
|
603 |
gtJetpack: begin |
733f4001b8b9
Break out DrawHH/DrawGear to reduce scrolling in uGears.pas, add portal graphics
nemo
parents:
diff
changeset
|
604 |
DrawSprite(sprJetpack, sx-32, sy-32, 0); |
3909
4ba25a3d15af
remove windspeed from bubbles, remove initial dY from bubbles, apply dY/dX to bubbles, correct offsets on flying saucer flame graphics, add bubbles when flying saucer thrusts underwater, make flying saucer sink more slowly underwater
nemo
parents:
3894
diff
changeset
|
605 |
if cWaterLine > hwRound(Gear^.Y) + Gear^.Radius then |
4ba25a3d15af
remove windspeed from bubbles, remove initial dY from bubbles, apply dY/dX to bubbles, correct offsets on flying saucer flame graphics, add bubbles when flying saucer thrusts underwater, make flying saucer sink more slowly underwater
nemo
parents:
3894
diff
changeset
|
606 |
begin |
4ba25a3d15af
remove windspeed from bubbles, remove initial dY from bubbles, apply dY/dX to bubbles, correct offsets on flying saucer flame graphics, add bubbles when flying saucer thrusts underwater, make flying saucer sink more slowly underwater
nemo
parents:
3894
diff
changeset
|
607 |
if (CurAmmoGear^.MsgParam and gmUp) <> 0 then DrawSprite(sprJetpack, sx-32, sy-28, 1); |
4ba25a3d15af
remove windspeed from bubbles, remove initial dY from bubbles, apply dY/dX to bubbles, correct offsets on flying saucer flame graphics, add bubbles when flying saucer thrusts underwater, make flying saucer sink more slowly underwater
nemo
parents:
3894
diff
changeset
|
608 |
if (CurAmmoGear^.MsgParam and gmLeft) <> 0 then DrawSprite(sprJetpack, sx-28, sy-28, 2); |
4ba25a3d15af
remove windspeed from bubbles, remove initial dY from bubbles, apply dY/dX to bubbles, correct offsets on flying saucer flame graphics, add bubbles when flying saucer thrusts underwater, make flying saucer sink more slowly underwater
nemo
parents:
3894
diff
changeset
|
609 |
if (CurAmmoGear^.MsgParam and gmRight) <> 0 then DrawSprite(sprJetpack, sx-36, sy-28, 3) |
4ba25a3d15af
remove windspeed from bubbles, remove initial dY from bubbles, apply dY/dX to bubbles, correct offsets on flying saucer flame graphics, add bubbles when flying saucer thrusts underwater, make flying saucer sink more slowly underwater
nemo
parents:
3894
diff
changeset
|
610 |
end; |
3387
733f4001b8b9
Break out DrawHH/DrawGear to reduce scrolling in uGears.pas, add portal graphics
nemo
parents:
diff
changeset
|
611 |
if CurAmmoGear^.Tex <> nil then DrawCentered(sx, sy - 40, CurAmmoGear^.Tex); |
733f4001b8b9
Break out DrawHH/DrawGear to reduce scrolling in uGears.pas, add portal graphics
nemo
parents:
diff
changeset
|
612 |
DrawAltWeapon(Gear, sx, sy) |
733f4001b8b9
Break out DrawHH/DrawGear to reduce scrolling in uGears.pas, add portal graphics
nemo
parents:
diff
changeset
|
613 |
end; |
733f4001b8b9
Break out DrawHH/DrawGear to reduce scrolling in uGears.pas, add portal graphics
nemo
parents:
diff
changeset
|
614 |
end; |
733f4001b8b9
Break out DrawHH/DrawGear to reduce scrolling in uGears.pas, add portal graphics
nemo
parents:
diff
changeset
|
615 |
end |
733f4001b8b9
Break out DrawHH/DrawGear to reduce scrolling in uGears.pas, add portal graphics
nemo
parents:
diff
changeset
|
616 |
end; |
733f4001b8b9
Break out DrawHH/DrawGear to reduce scrolling in uGears.pas, add portal graphics
nemo
parents:
diff
changeset
|
617 |
|
733f4001b8b9
Break out DrawHH/DrawGear to reduce scrolling in uGears.pas, add portal graphics
nemo
parents:
diff
changeset
|
618 |
with HH^ do |
733f4001b8b9
Break out DrawHH/DrawGear to reduce scrolling in uGears.pas, add portal graphics
nemo
parents:
diff
changeset
|
619 |
begin |
733f4001b8b9
Break out DrawHH/DrawGear to reduce scrolling in uGears.pas, add portal graphics
nemo
parents:
diff
changeset
|
620 |
if ((Gear^.State and not gstWinner) = 0) |
4077
e7d838d063a4
Avoid a flicker of tags if jiggling a hog, remove a bunch of calls to hwRound and hwSign
nemo
parents:
4044
diff
changeset
|
621 |
or ((Gear^.State = gstWait) and (Gear^.dY.QWordValue = 0)) |
3387
733f4001b8b9
Break out DrawHH/DrawGear to reduce scrolling in uGears.pas, add portal graphics
nemo
parents:
diff
changeset
|
622 |
or (bShowFinger and ((Gear^.State and gstHHDriven) <> 0)) then |
733f4001b8b9
Break out DrawHH/DrawGear to reduce scrolling in uGears.pas, add portal graphics
nemo
parents:
diff
changeset
|
623 |
begin |
4077
e7d838d063a4
Avoid a flicker of tags if jiggling a hog, remove a bunch of calls to hwRound and hwSign
nemo
parents:
4044
diff
changeset
|
624 |
t:= sy - cHHRadius - 9; |
3387
733f4001b8b9
Break out DrawHH/DrawGear to reduce scrolling in uGears.pas, add portal graphics
nemo
parents:
diff
changeset
|
625 |
if (cTagsMask and htTransparent) <> 0 then |
3390 | 626 |
Tint($FF, $FF, $FF, $80); |
3387
733f4001b8b9
Break out DrawHH/DrawGear to reduce scrolling in uGears.pas, add portal graphics
nemo
parents:
diff
changeset
|
627 |
if ((cTagsMask and htHealth) <> 0) then |
733f4001b8b9
Break out DrawHH/DrawGear to reduce scrolling in uGears.pas, add portal graphics
nemo
parents:
diff
changeset
|
628 |
begin |
733f4001b8b9
Break out DrawHH/DrawGear to reduce scrolling in uGears.pas, add portal graphics
nemo
parents:
diff
changeset
|
629 |
dec(t, HealthTagTex^.h + 2); |
4077
e7d838d063a4
Avoid a flicker of tags if jiggling a hog, remove a bunch of calls to hwRound and hwSign
nemo
parents:
4044
diff
changeset
|
630 |
DrawCentered(ox, t, HealthTagTex) |
3387
733f4001b8b9
Break out DrawHH/DrawGear to reduce scrolling in uGears.pas, add portal graphics
nemo
parents:
diff
changeset
|
631 |
end; |
733f4001b8b9
Break out DrawHH/DrawGear to reduce scrolling in uGears.pas, add portal graphics
nemo
parents:
diff
changeset
|
632 |
if (cTagsMask and htName) <> 0 then |
733f4001b8b9
Break out DrawHH/DrawGear to reduce scrolling in uGears.pas, add portal graphics
nemo
parents:
diff
changeset
|
633 |
begin |
733f4001b8b9
Break out DrawHH/DrawGear to reduce scrolling in uGears.pas, add portal graphics
nemo
parents:
diff
changeset
|
634 |
dec(t, NameTagTex^.h + 2); |
4077
e7d838d063a4
Avoid a flicker of tags if jiggling a hog, remove a bunch of calls to hwRound and hwSign
nemo
parents:
4044
diff
changeset
|
635 |
DrawCentered(ox, t, NameTagTex) |
3387
733f4001b8b9
Break out DrawHH/DrawGear to reduce scrolling in uGears.pas, add portal graphics
nemo
parents:
diff
changeset
|
636 |
end; |
733f4001b8b9
Break out DrawHH/DrawGear to reduce scrolling in uGears.pas, add portal graphics
nemo
parents:
diff
changeset
|
637 |
if (cTagsMask and htTeamName) <> 0 then |
733f4001b8b9
Break out DrawHH/DrawGear to reduce scrolling in uGears.pas, add portal graphics
nemo
parents:
diff
changeset
|
638 |
begin |
733f4001b8b9
Break out DrawHH/DrawGear to reduce scrolling in uGears.pas, add portal graphics
nemo
parents:
diff
changeset
|
639 |
dec(t, Team^.NameTagTex^.h + 2); |
4077
e7d838d063a4
Avoid a flicker of tags if jiggling a hog, remove a bunch of calls to hwRound and hwSign
nemo
parents:
4044
diff
changeset
|
640 |
DrawCentered(ox, t, Team^.NameTagTex) |
3387
733f4001b8b9
Break out DrawHH/DrawGear to reduce scrolling in uGears.pas, add portal graphics
nemo
parents:
diff
changeset
|
641 |
end; |
733f4001b8b9
Break out DrawHH/DrawGear to reduce scrolling in uGears.pas, add portal graphics
nemo
parents:
diff
changeset
|
642 |
if (cTagsMask and htTransparent) <> 0 then |
3390 | 643 |
Tint($FF, $FF, $FF, $FF) |
3387
733f4001b8b9
Break out DrawHH/DrawGear to reduce scrolling in uGears.pas, add portal graphics
nemo
parents:
diff
changeset
|
644 |
end; |
733f4001b8b9
Break out DrawHH/DrawGear to reduce scrolling in uGears.pas, add portal graphics
nemo
parents:
diff
changeset
|
645 |
if (Gear^.State and gstHHDriven) <> 0 then // Current hedgehog |
733f4001b8b9
Break out DrawHH/DrawGear to reduce scrolling in uGears.pas, add portal graphics
nemo
parents:
diff
changeset
|
646 |
begin |
733f4001b8b9
Break out DrawHH/DrawGear to reduce scrolling in uGears.pas, add portal graphics
nemo
parents:
diff
changeset
|
647 |
if bShowFinger and ((Gear^.State and gstHHDriven) <> 0) then |
4077
e7d838d063a4
Avoid a flicker of tags if jiggling a hog, remove a bunch of calls to hwRound and hwSign
nemo
parents:
4044
diff
changeset
|
648 |
DrawSprite(sprFinger, ox - 16, oy - 64, |
3387
733f4001b8b9
Break out DrawHH/DrawGear to reduce scrolling in uGears.pas, add portal graphics
nemo
parents:
diff
changeset
|
649 |
GameTicks div 32 mod 16); |
733f4001b8b9
Break out DrawHH/DrawGear to reduce scrolling in uGears.pas, add portal graphics
nemo
parents:
diff
changeset
|
650 |
|
733f4001b8b9
Break out DrawHH/DrawGear to reduce scrolling in uGears.pas, add portal graphics
nemo
parents:
diff
changeset
|
651 |
if (Gear^.State and gstDrowning) = 0 then |
733f4001b8b9
Break out DrawHH/DrawGear to reduce scrolling in uGears.pas, add portal graphics
nemo
parents:
diff
changeset
|
652 |
if (Gear^.State and gstHHThinking) <> 0 then |
4077
e7d838d063a4
Avoid a flicker of tags if jiggling a hog, remove a bunch of calls to hwRound and hwSign
nemo
parents:
4044
diff
changeset
|
653 |
DrawSprite(sprQuestion, ox - 10, oy - cHHRadius - 34, (RealTicks shr 9) mod 8) |
3387
733f4001b8b9
Break out DrawHH/DrawGear to reduce scrolling in uGears.pas, add portal graphics
nemo
parents:
diff
changeset
|
654 |
end |
733f4001b8b9
Break out DrawHH/DrawGear to reduce scrolling in uGears.pas, add portal graphics
nemo
parents:
diff
changeset
|
655 |
end; |
733f4001b8b9
Break out DrawHH/DrawGear to reduce scrolling in uGears.pas, add portal graphics
nemo
parents:
diff
changeset
|
656 |
|
733f4001b8b9
Break out DrawHH/DrawGear to reduce scrolling in uGears.pas, add portal graphics
nemo
parents:
diff
changeset
|
657 |
if HH^.Effects[hePoisoned] then |
733f4001b8b9
Break out DrawHH/DrawGear to reduce scrolling in uGears.pas, add portal graphics
nemo
parents:
diff
changeset
|
658 |
begin |
3392 | 659 |
Tint($00, $FF, $40, $80); |
3387
733f4001b8b9
Break out DrawHH/DrawGear to reduce scrolling in uGears.pas, add portal graphics
nemo
parents:
diff
changeset
|
660 |
DrawRotatedTextureF(SpritesData[sprSmokeWhite].texture, 1.5, 0, 0, sx, sy, 0, 1, 22, 22, 360 - (RealTicks shr 37) mod 360); |
733f4001b8b9
Break out DrawHH/DrawGear to reduce scrolling in uGears.pas, add portal graphics
nemo
parents:
diff
changeset
|
661 |
end; |
4036
69e535a0e43a
make aura match cross colour, add a faint aura to resurrected hogs. basically mucking about w/ burp's weapon again.
nemo
parents:
4024
diff
changeset
|
662 |
if HH^.Effects[heResurrected] then |
69e535a0e43a
make aura match cross colour, add a faint aura to resurrected hogs. basically mucking about w/ burp's weapon again.
nemo
parents:
4024
diff
changeset
|
663 |
begin |
69e535a0e43a
make aura match cross colour, add a faint aura to resurrected hogs. basically mucking about w/ burp's weapon again.
nemo
parents:
4024
diff
changeset
|
664 |
Tint($f5, $db, $35, $20); |
69e535a0e43a
make aura match cross colour, add a faint aura to resurrected hogs. basically mucking about w/ burp's weapon again.
nemo
parents:
4024
diff
changeset
|
665 |
DrawSprite(sprVampiric, sx - 24, sy - 24, 0); |
69e535a0e43a
make aura match cross colour, add a faint aura to resurrected hogs. basically mucking about w/ burp's weapon again.
nemo
parents:
4024
diff
changeset
|
666 |
end; |
3387
733f4001b8b9
Break out DrawHH/DrawGear to reduce scrolling in uGears.pas, add portal graphics
nemo
parents:
diff
changeset
|
667 |
|
733f4001b8b9
Break out DrawHH/DrawGear to reduce scrolling in uGears.pas, add portal graphics
nemo
parents:
diff
changeset
|
668 |
if Gear^.Invulnerable then |
733f4001b8b9
Break out DrawHH/DrawGear to reduce scrolling in uGears.pas, add portal graphics
nemo
parents:
diff
changeset
|
669 |
begin |
733f4001b8b9
Break out DrawHH/DrawGear to reduce scrolling in uGears.pas, add portal graphics
nemo
parents:
diff
changeset
|
670 |
Tint($FF, $FF, $FF, max($40, floor($FF * abs(1 - ((RealTicks div 2 + Gear^.uid * 491) mod 1500) / 750)))); |
733f4001b8b9
Break out DrawHH/DrawGear to reduce scrolling in uGears.pas, add portal graphics
nemo
parents:
diff
changeset
|
671 |
DrawSprite(sprInvulnerable, sx - 24, sy - 24, 0); |
733f4001b8b9
Break out DrawHH/DrawGear to reduce scrolling in uGears.pas, add portal graphics
nemo
parents:
diff
changeset
|
672 |
end; |
733f4001b8b9
Break out DrawHH/DrawGear to reduce scrolling in uGears.pas, add portal graphics
nemo
parents:
diff
changeset
|
673 |
if cVampiric and |
733f4001b8b9
Break out DrawHH/DrawGear to reduce scrolling in uGears.pas, add portal graphics
nemo
parents:
diff
changeset
|
674 |
(CurrentHedgehog^.Gear <> nil) and |
733f4001b8b9
Break out DrawHH/DrawGear to reduce scrolling in uGears.pas, add portal graphics
nemo
parents:
diff
changeset
|
675 |
(CurrentHedgehog^.Gear = Gear) then |
733f4001b8b9
Break out DrawHH/DrawGear to reduce scrolling in uGears.pas, add portal graphics
nemo
parents:
diff
changeset
|
676 |
begin |
4016 | 677 |
Tint($FF, 0, 0, max($40, floor($FF * abs(1 - (RealTicks mod 1500) / 750)))); |
3387
733f4001b8b9
Break out DrawHH/DrawGear to reduce scrolling in uGears.pas, add portal graphics
nemo
parents:
diff
changeset
|
678 |
DrawSprite(sprVampiric, sx - 24, sy - 24, 0); |
733f4001b8b9
Break out DrawHH/DrawGear to reduce scrolling in uGears.pas, add portal graphics
nemo
parents:
diff
changeset
|
679 |
end; |
3390 | 680 |
Tint($FF, $FF, $FF, $FF) |
3387
733f4001b8b9
Break out DrawHH/DrawGear to reduce scrolling in uGears.pas, add portal graphics
nemo
parents:
diff
changeset
|
681 |
end; |
733f4001b8b9
Break out DrawHH/DrawGear to reduce scrolling in uGears.pas, add portal graphics
nemo
parents:
diff
changeset
|
682 |
|
733f4001b8b9
Break out DrawHH/DrawGear to reduce scrolling in uGears.pas, add portal graphics
nemo
parents:
diff
changeset
|
683 |
procedure DrawGears; |
733f4001b8b9
Break out DrawHH/DrawGear to reduce scrolling in uGears.pas, add portal graphics
nemo
parents:
diff
changeset
|
684 |
var Gear, HHGear: PGear; |
733f4001b8b9
Break out DrawHH/DrawGear to reduce scrolling in uGears.pas, add portal graphics
nemo
parents:
diff
changeset
|
685 |
i: Longword; |
4016 | 686 |
x, y, startX, endX, startY, endY: LongInt; |
3387
733f4001b8b9
Break out DrawHH/DrawGear to reduce scrolling in uGears.pas, add portal graphics
nemo
parents:
diff
changeset
|
687 |
begin |
733f4001b8b9
Break out DrawHH/DrawGear to reduce scrolling in uGears.pas, add portal graphics
nemo
parents:
diff
changeset
|
688 |
Gear:= GearsList; |
733f4001b8b9
Break out DrawHH/DrawGear to reduce scrolling in uGears.pas, add portal graphics
nemo
parents:
diff
changeset
|
689 |
while Gear<>nil do |
733f4001b8b9
Break out DrawHH/DrawGear to reduce scrolling in uGears.pas, add portal graphics
nemo
parents:
diff
changeset
|
690 |
begin |
4016 | 691 |
x:= hwRound(Gear^.X) + WorldDx; |
692 |
y:= hwRound(Gear^.Y) + WorldDy; |
|
3387
733f4001b8b9
Break out DrawHH/DrawGear to reduce scrolling in uGears.pas, add portal graphics
nemo
parents:
diff
changeset
|
693 |
case Gear^.Kind of |
4168 | 694 |
gtBomb: DrawRotated(sprBomb, x, y, 0, Gear^.DirAngle); |
4016 | 695 |
gtGasBomb: DrawRotated(sprCheese, x, y, 0, Gear^.DirAngle); |
696 |
gtMolotov: DrawRotated(sprMolotov, x, y, 0, Gear^.DirAngle); |
|
3387
733f4001b8b9
Break out DrawHH/DrawGear to reduce scrolling in uGears.pas, add portal graphics
nemo
parents:
diff
changeset
|
697 |
|
733f4001b8b9
Break out DrawHH/DrawGear to reduce scrolling in uGears.pas, add portal graphics
nemo
parents:
diff
changeset
|
698 |
gtRCPlane: begin |
733f4001b8b9
Break out DrawHH/DrawGear to reduce scrolling in uGears.pas, add portal graphics
nemo
parents:
diff
changeset
|
699 |
if (Gear^.Tag = -1) then |
4016 | 700 |
DrawRotated(sprPlane, x, y, -1, DxDy2Angle(Gear^.dX, Gear^.dY) + 90) |
3387
733f4001b8b9
Break out DrawHH/DrawGear to reduce scrolling in uGears.pas, add portal graphics
nemo
parents:
diff
changeset
|
701 |
else |
4016 | 702 |
DrawRotated(sprPlane, x, y,0,DxDy2Angle(Gear^.dY, Gear^.dX)); |
3387
733f4001b8b9
Break out DrawHH/DrawGear to reduce scrolling in uGears.pas, add portal graphics
nemo
parents:
diff
changeset
|
703 |
if ((TrainingFlags and tfRCPlane) <> 0) and (TrainingTargetGear <> nil) and ((Gear^.State and gstDrowning) = 0) then |
4016 | 704 |
DrawRotatedf(sprFinger, x, y, GameTicks div 32 mod 16, 0, DxDy2Angle(Gear^.X - TrainingTargetGear^.X, TrainingTargetGear^.Y - Gear^.Y)); |
3387
733f4001b8b9
Break out DrawHH/DrawGear to reduce scrolling in uGears.pas, add portal graphics
nemo
parents:
diff
changeset
|
705 |
end; |
4016 | 706 |
gtBall: DrawRotatedf(sprBalls, x, y, Gear^.Tag,0, Gear^.DirAngle); |
3428 | 707 |
|
708 |
gtPortal: if ((Gear^.Tag and 1) = 0) // still moving? |
|
709 |
or (Gear^.IntersectGear = nil) or (Gear^.IntersectGear^.IntersectGear <> Gear) // not linked&backlinked? |
|
710 |
or ((Gear^.IntersectGear^.Tag and 1) = 0) then // linked portal still moving? |
|
4016 | 711 |
DrawRotatedf(sprPortal, x, y, Gear^.Tag, hwSign(Gear^.dX), Gear^.DirAngle) |
712 |
else DrawRotatedf(sprPortal, x, y, 4 + Gear^.Tag div 2, hwSign(Gear^.dX), Gear^.DirAngle); |
|
3387
733f4001b8b9
Break out DrawHH/DrawGear to reduce scrolling in uGears.pas, add portal graphics
nemo
parents:
diff
changeset
|
713 |
|
4016 | 714 |
gtDrill: DrawRotated(sprDrill, x, y, 0, DxDy2Angle(Gear^.dY, Gear^.dX)); |
3387
733f4001b8b9
Break out DrawHH/DrawGear to reduce scrolling in uGears.pas, add portal graphics
nemo
parents:
diff
changeset
|
715 |
|
4077
e7d838d063a4
Avoid a flicker of tags if jiggling a hog, remove a bunch of calls to hwRound and hwSign
nemo
parents:
4044
diff
changeset
|
716 |
gtHedgehog: DrawHH(Gear, x, y); |
3387
733f4001b8b9
Break out DrawHH/DrawGear to reduce scrolling in uGears.pas, add portal graphics
nemo
parents:
diff
changeset
|
717 |
|
4168 | 718 |
gtShell: DrawRotated(sprBazookaShell, x, y, 0, DxDy2Angle(Gear^.dY, Gear^.dX)); |
3387
733f4001b8b9
Break out DrawHH/DrawGear to reduce scrolling in uGears.pas, add portal graphics
nemo
parents:
diff
changeset
|
719 |
|
4016 | 720 |
gtGrave: begin |
721 |
DrawTextureF(PHedgehog(Gear^.Hedgehog)^.Team^.GraveTex, 1, x, y, (GameTicks shr 7+Gear^.uid) and 7, 1, 32, 32); |
|
722 |
if Gear^.Health > 0 then |
|
723 |
begin |
|
724 |
//Tint($33, $33, $FF, max($40, floor($FF * abs(1 - (GameTicks mod (6000 div Gear^.Health)) / 750)))); |
|
4036
69e535a0e43a
make aura match cross colour, add a faint aura to resurrected hogs. basically mucking about w/ burp's weapon again.
nemo
parents:
4024
diff
changeset
|
725 |
Tint($f5, $db, $35, max($40, floor($FF * abs(1 - (GameTicks mod 1500) / (750 + Gear^.Health))))); |
4016 | 726 |
//Tint($FF, $FF, $FF, max($40, floor($FF * abs(1 - (RealTicks mod 1500) / 750)))); |
727 |
DrawSprite(sprVampiric, x - 24, y - 24, 0); |
|
728 |
Tint($FF, $FF, $FF, $FF) |
|
729 |
end |
|
730 |
end; |
|
3387
733f4001b8b9
Break out DrawHH/DrawGear to reduce scrolling in uGears.pas, add portal graphics
nemo
parents:
diff
changeset
|
731 |
|
4016 | 732 |
gtBee: DrawRotatedF(sprBee, x, y, (GameTicks shr 5) mod 2, 0, DxDy2Angle(Gear^.dY, Gear^.dX)); |
733 |
||
734 |
gtPickHammer: DrawSprite(sprPHammer, x - 16, y - 50 + LongInt(((GameTicks shr 5) and 1) * 2), 0); |
|
3387
733f4001b8b9
Break out DrawHH/DrawGear to reduce scrolling in uGears.pas, add portal graphics
nemo
parents:
diff
changeset
|
735 |
gtRope: DrawRope(Gear); |
733f4001b8b9
Break out DrawHH/DrawGear to reduce scrolling in uGears.pas, add portal graphics
nemo
parents:
diff
changeset
|
736 |
gtMine: if (((Gear^.State and gstAttacking) = 0)or((Gear^.Timer and $3FF) < 420)) and (Gear^.Health <> 0) then |
4016 | 737 |
DrawRotated(sprMineOff, x, y, 0, Gear^.DirAngle) |
738 |
else if Gear^.Health <> 0 then DrawRotated(sprMineOn, x, y, 0, Gear^.DirAngle) |
|
739 |
else DrawRotated(sprMineDead, x, y, 0, Gear^.DirAngle); |
|
3710 | 740 |
gtSMine: if (((Gear^.State and gstAttacking) = 0)or((Gear^.Timer and $3FF) < 420)) and (Gear^.Health <> 0) then |
4016 | 741 |
DrawRotated(sprSMineOff, x, y, 0, Gear^.DirAngle) |
742 |
else if Gear^.Health <> 0 then DrawRotated(sprSMineOn, x, y, 0, Gear^.DirAngle) |
|
743 |
else DrawRotated(sprMineDead, x, y, 0, Gear^.DirAngle); |
|
3387
733f4001b8b9
Break out DrawHH/DrawGear to reduce scrolling in uGears.pas, add portal graphics
nemo
parents:
diff
changeset
|
744 |
gtCase: case Gear^.Pos of |
733f4001b8b9
Break out DrawHH/DrawGear to reduce scrolling in uGears.pas, add portal graphics
nemo
parents:
diff
changeset
|
745 |
posCaseAmmo : begin |
733f4001b8b9
Break out DrawHH/DrawGear to reduce scrolling in uGears.pas, add portal graphics
nemo
parents:
diff
changeset
|
746 |
i:= (GameTicks shr 6) mod 64; |
733f4001b8b9
Break out DrawHH/DrawGear to reduce scrolling in uGears.pas, add portal graphics
nemo
parents:
diff
changeset
|
747 |
if i > 18 then i:= 0; |
4016 | 748 |
DrawSprite(sprCase, x - 24, y - 24, i); |
3387
733f4001b8b9
Break out DrawHH/DrawGear to reduce scrolling in uGears.pas, add portal graphics
nemo
parents:
diff
changeset
|
749 |
end; |
733f4001b8b9
Break out DrawHH/DrawGear to reduce scrolling in uGears.pas, add portal graphics
nemo
parents:
diff
changeset
|
750 |
posCaseHealth: begin |
733f4001b8b9
Break out DrawHH/DrawGear to reduce scrolling in uGears.pas, add portal graphics
nemo
parents:
diff
changeset
|
751 |
i:= ((GameTicks shr 6) + 38) mod 64; |
733f4001b8b9
Break out DrawHH/DrawGear to reduce scrolling in uGears.pas, add portal graphics
nemo
parents:
diff
changeset
|
752 |
if i > 13 then i:= 0; |
4016 | 753 |
DrawSprite(sprFAid, x - 24, y - 24, i); |
3387
733f4001b8b9
Break out DrawHH/DrawGear to reduce scrolling in uGears.pas, add portal graphics
nemo
parents:
diff
changeset
|
754 |
end; |
733f4001b8b9
Break out DrawHH/DrawGear to reduce scrolling in uGears.pas, add portal graphics
nemo
parents:
diff
changeset
|
755 |
posCaseUtility: begin |
733f4001b8b9
Break out DrawHH/DrawGear to reduce scrolling in uGears.pas, add portal graphics
nemo
parents:
diff
changeset
|
756 |
i:= (GameTicks shr 6) mod 70; |
733f4001b8b9
Break out DrawHH/DrawGear to reduce scrolling in uGears.pas, add portal graphics
nemo
parents:
diff
changeset
|
757 |
if i > 23 then i:= 0; |
733f4001b8b9
Break out DrawHH/DrawGear to reduce scrolling in uGears.pas, add portal graphics
nemo
parents:
diff
changeset
|
758 |
i:= i mod 12; |
4016 | 759 |
DrawSprite(sprUtility, x - 24, y - 24, i); |
3387
733f4001b8b9
Break out DrawHH/DrawGear to reduce scrolling in uGears.pas, add portal graphics
nemo
parents:
diff
changeset
|
760 |
end; |
733f4001b8b9
Break out DrawHH/DrawGear to reduce scrolling in uGears.pas, add portal graphics
nemo
parents:
diff
changeset
|
761 |
end; |
733f4001b8b9
Break out DrawHH/DrawGear to reduce scrolling in uGears.pas, add portal graphics
nemo
parents:
diff
changeset
|
762 |
gtExplosives: begin |
733f4001b8b9
Break out DrawHH/DrawGear to reduce scrolling in uGears.pas, add portal graphics
nemo
parents:
diff
changeset
|
763 |
if ((Gear^.State and gstDrowning) <> 0) then |
4016 | 764 |
DrawSprite(sprExplosivesRoll, x - 24, y - 24, 0) |
3387
733f4001b8b9
Break out DrawHH/DrawGear to reduce scrolling in uGears.pas, add portal graphics
nemo
parents:
diff
changeset
|
765 |
else if Gear^.State and gstAnimation = 0 then |
733f4001b8b9
Break out DrawHH/DrawGear to reduce scrolling in uGears.pas, add portal graphics
nemo
parents:
diff
changeset
|
766 |
begin |
733f4001b8b9
Break out DrawHH/DrawGear to reduce scrolling in uGears.pas, add portal graphics
nemo
parents:
diff
changeset
|
767 |
i:= (GameTicks shr 6 + Gear^.uid*3) mod 64; |
733f4001b8b9
Break out DrawHH/DrawGear to reduce scrolling in uGears.pas, add portal graphics
nemo
parents:
diff
changeset
|
768 |
if i > 18 then i:= 0; |
4016 | 769 |
DrawSprite(sprExplosives, x - 24, y - 24, i) |
3387
733f4001b8b9
Break out DrawHH/DrawGear to reduce scrolling in uGears.pas, add portal graphics
nemo
parents:
diff
changeset
|
770 |
end |
733f4001b8b9
Break out DrawHH/DrawGear to reduce scrolling in uGears.pas, add portal graphics
nemo
parents:
diff
changeset
|
771 |
else if Gear^.State and gsttmpFlag = 0 then |
4016 | 772 |
DrawRotatedF(sprExplosivesRoll, x, y + 4, 0, 0, Gear^.DirAngle) |
3387
733f4001b8b9
Break out DrawHH/DrawGear to reduce scrolling in uGears.pas, add portal graphics
nemo
parents:
diff
changeset
|
773 |
else |
4016 | 774 |
DrawRotatedF(sprExplosivesRoll, x, y + 4, 1, 0, Gear^.DirAngle); |
3387
733f4001b8b9
Break out DrawHH/DrawGear to reduce scrolling in uGears.pas, add portal graphics
nemo
parents:
diff
changeset
|
775 |
end; |
4016 | 776 |
gtDynamite: DrawSprite2(sprDynamite, x - 16, y - 25, Gear^.Tag and 1, Gear^.Tag shr 1); |
777 |
gtClusterBomb: DrawRotated(sprClusterBomb, x, y, 0, Gear^.DirAngle); |
|
778 |
gtCluster: DrawSprite(sprClusterParticle, x - 8, y - 8, 0); |
|
779 |
gtFlame: DrawTextureF(SpritesData[sprFlame].Texture, 2 / (Gear^.Tag mod 3 + 2), x, y, (GameTicks shr 7 + LongWord(Gear^.Tag)) mod 8, 1, 16, 16); |
|
3387
733f4001b8b9
Break out DrawHH/DrawGear to reduce scrolling in uGears.pas, add portal graphics
nemo
parents:
diff
changeset
|
780 |
gtParachute: begin |
4016 | 781 |
DrawSprite(sprParachute, x - 24, y - 48, 0); |
782 |
DrawAltWeapon(Gear, x + 1, y - 3) |
|
3387
733f4001b8b9
Break out DrawHH/DrawGear to reduce scrolling in uGears.pas, add portal graphics
nemo
parents:
diff
changeset
|
783 |
end; |
4016 | 784 |
gtAirAttack: if Gear^.Tag > 0 then DrawSprite(sprAirplane, x - SpritesData[sprAirplane].Width div 2, y - SpritesData[sprAirplane].Height div 2, 0) |
785 |
else DrawSprite(sprAirplane, x - SpritesData[sprAirplane].Width div 2, y - SpritesData[sprAirplane].Height div 2, 1); |
|
786 |
gtAirBomb: DrawRotated(sprAirBomb, x, y, 0, DxDy2Angle(Gear^.dY, Gear^.dX)); |
|
3387
733f4001b8b9
Break out DrawHH/DrawGear to reduce scrolling in uGears.pas, add portal graphics
nemo
parents:
diff
changeset
|
787 |
gtTeleport: begin |
733f4001b8b9
Break out DrawHH/DrawGear to reduce scrolling in uGears.pas, add portal graphics
nemo
parents:
diff
changeset
|
788 |
HHGear:= PHedgehog(Gear^.Hedgehog)^.Gear; |
4016 | 789 |
if not PHedgehog(Gear^.Hedgehog)^.Unplaced then DrawRotatedF(sprTeleport, x + 1, y - 3, Gear^.Pos, hwSign(Gear^.dX), 0); |
3387
733f4001b8b9
Break out DrawHH/DrawGear to reduce scrolling in uGears.pas, add portal graphics
nemo
parents:
diff
changeset
|
790 |
DrawRotatedF(sprTeleport, hwRound(HHGear^.X) + 1 + WorldDx, hwRound(HHGear^.Y) - 3 + WorldDy, 11 - Gear^.Pos, hwSign(HHGear^.dX), 0); |
733f4001b8b9
Break out DrawHH/DrawGear to reduce scrolling in uGears.pas, add portal graphics
nemo
parents:
diff
changeset
|
791 |
end; |
4016 | 792 |
gtSwitcher: DrawSprite(sprSwitch, x - 16, y - 56, (GameTicks shr 6) mod 12); |
3387
733f4001b8b9
Break out DrawHH/DrawGear to reduce scrolling in uGears.pas, add portal graphics
nemo
parents:
diff
changeset
|
793 |
gtTarget: begin |
733f4001b8b9
Break out DrawHH/DrawGear to reduce scrolling in uGears.pas, add portal graphics
nemo
parents:
diff
changeset
|
794 |
Tint($FF, $FF, $FF, floor($FF * Gear^.Timer / 1000)); |
4016 | 795 |
DrawSprite(sprTarget, x - 16, y - 16, 0); |
3390 | 796 |
Tint($FF, $FF, $FF, $FF); |
3387
733f4001b8b9
Break out DrawHH/DrawGear to reduce scrolling in uGears.pas, add portal graphics
nemo
parents:
diff
changeset
|
797 |
end; |
4016 | 798 |
gtMortar: DrawRotated(sprMortar, x, y, 0, DxDy2Angle(Gear^.dY, Gear^.dX)); |
3387
733f4001b8b9
Break out DrawHH/DrawGear to reduce scrolling in uGears.pas, add portal graphics
nemo
parents:
diff
changeset
|
799 |
gtCake: if Gear^.Pos = 6 then |
4016 | 800 |
DrawRotatedf(sprCakeWalk, x, y, (GameTicks div 40) mod 6, hwSign(Gear^.dX), Gear^.DirAngle * hwSign(Gear^.dX) + 90) |
3387
733f4001b8b9
Break out DrawHH/DrawGear to reduce scrolling in uGears.pas, add portal graphics
nemo
parents:
diff
changeset
|
801 |
else |
4016 | 802 |
DrawRotatedf(sprCakeDown, x, y, 5 - Gear^.Pos, hwSign(Gear^.dX), Gear^.DirAngle * hwSign(Gear^.dX) + 90); |
803 |
gtSeduction: if Gear^.Pos >= 14 then DrawSprite(sprSeduction, x - 16, y - 16, 0); |
|
804 |
gtWatermelon: DrawRotatedf(sprWatermelon, x, y, 0, 0, Gear^.DirAngle); |
|
805 |
gtMelonPiece: DrawRotatedf(sprWatermelon, x, y, 1, 0, Gear^.DirAngle); |
|
806 |
gtHellishBomb: DrawRotated(sprHellishBomb, x, y, 0, Gear^.DirAngle); |
|
3387
733f4001b8b9
Break out DrawHH/DrawGear to reduce scrolling in uGears.pas, add portal graphics
nemo
parents:
diff
changeset
|
807 |
gtBirdy: begin |
733f4001b8b9
Break out DrawHH/DrawGear to reduce scrolling in uGears.pas, add portal graphics
nemo
parents:
diff
changeset
|
808 |
if Gear^.State and gstAnimation = gstAnimation then |
733f4001b8b9
Break out DrawHH/DrawGear to reduce scrolling in uGears.pas, add portal graphics
nemo
parents:
diff
changeset
|
809 |
begin |
733f4001b8b9
Break out DrawHH/DrawGear to reduce scrolling in uGears.pas, add portal graphics
nemo
parents:
diff
changeset
|
810 |
if Gear^.State and gstTmpFlag = 0 then // Appearing |
733f4001b8b9
Break out DrawHH/DrawGear to reduce scrolling in uGears.pas, add portal graphics
nemo
parents:
diff
changeset
|
811 |
begin |
4016 | 812 |
endX:= x - WorldDx; |
813 |
endY:= y - WorldDy; |
|
3387
733f4001b8b9
Break out DrawHH/DrawGear to reduce scrolling in uGears.pas, add portal graphics
nemo
parents:
diff
changeset
|
814 |
if Gear^.Tag < 0 then |
733f4001b8b9
Break out DrawHH/DrawGear to reduce scrolling in uGears.pas, add portal graphics
nemo
parents:
diff
changeset
|
815 |
startX:= max(LAND_WIDTH + 1024, endX + 2048) |
733f4001b8b9
Break out DrawHH/DrawGear to reduce scrolling in uGears.pas, add portal graphics
nemo
parents:
diff
changeset
|
816 |
else |
733f4001b8b9
Break out DrawHH/DrawGear to reduce scrolling in uGears.pas, add portal graphics
nemo
parents:
diff
changeset
|
817 |
startX:= max(-LAND_WIDTH - 1024, endX - 2048); |
733f4001b8b9
Break out DrawHH/DrawGear to reduce scrolling in uGears.pas, add portal graphics
nemo
parents:
diff
changeset
|
818 |
startY:= endY - 256; |
3407 | 819 |
DrawTextureF(SpritesData[sprBirdy].Texture, 1, startX + WorldDx + floor((endX - startX) * (-power(2, -10 * LongInt(Gear^.Timer)/2000) + 1)), startY + WorldDy + floor((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); |
3387
733f4001b8b9
Break out DrawHH/DrawGear to reduce scrolling in uGears.pas, add portal graphics
nemo
parents:
diff
changeset
|
820 |
end |
733f4001b8b9
Break out DrawHH/DrawGear to reduce scrolling in uGears.pas, add portal graphics
nemo
parents:
diff
changeset
|
821 |
else // Disappearing |
733f4001b8b9
Break out DrawHH/DrawGear to reduce scrolling in uGears.pas, add portal graphics
nemo
parents:
diff
changeset
|
822 |
begin |
4016 | 823 |
startX:= x - WorldDx; |
824 |
startY:= y - WorldDy; |
|
3387
733f4001b8b9
Break out DrawHH/DrawGear to reduce scrolling in uGears.pas, add portal graphics
nemo
parents:
diff
changeset
|
825 |
if Gear^.Tag > 0 then |
733f4001b8b9
Break out DrawHH/DrawGear to reduce scrolling in uGears.pas, add portal graphics
nemo
parents:
diff
changeset
|
826 |
endX:= max(LAND_WIDTH + 1024, startX + 2048) |
733f4001b8b9
Break out DrawHH/DrawGear to reduce scrolling in uGears.pas, add portal graphics
nemo
parents:
diff
changeset
|
827 |
else |
733f4001b8b9
Break out DrawHH/DrawGear to reduce scrolling in uGears.pas, add portal graphics
nemo
parents:
diff
changeset
|
828 |
endX:= max(-LAND_WIDTH - 1024, startX - 2048); |
733f4001b8b9
Break out DrawHH/DrawGear to reduce scrolling in uGears.pas, add portal graphics
nemo
parents:
diff
changeset
|
829 |
endY:= startY + 256; |
3407 | 830 |
DrawTextureF(SpritesData[sprBirdy].Texture, 1, startX + WorldDx + floor((endX - startX) * power(2, 10 * (LongInt(Gear^.Timer)/2000 - 1))) + hwRound(Gear^.dX * Gear^.Timer), startY + WorldDy + floor((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); |
3387
733f4001b8b9
Break out DrawHH/DrawGear to reduce scrolling in uGears.pas, add portal graphics
nemo
parents:
diff
changeset
|
831 |
end; |
733f4001b8b9
Break out DrawHH/DrawGear to reduce scrolling in uGears.pas, add portal graphics
nemo
parents:
diff
changeset
|
832 |
end |
733f4001b8b9
Break out DrawHH/DrawGear to reduce scrolling in uGears.pas, add portal graphics
nemo
parents:
diff
changeset
|
833 |
else |
4016 | 834 |
DrawTextureF(SpritesData[sprBirdy].Texture, 1, x, y, ((Gear^.Pos shr 6) or (RealTicks shr 8)) mod 2, Gear^.Tag, 75, 75); |
3387
733f4001b8b9
Break out DrawHH/DrawGear to reduce scrolling in uGears.pas, add portal graphics
nemo
parents:
diff
changeset
|
835 |
end; |
4016 | 836 |
gtEgg: DrawRotatedTextureF(SpritesData[sprEgg].Texture, 1, 0, 0, x, y, 0, 1, 16, 16, Gear^.DirAngle); |
3387
733f4001b8b9
Break out DrawHH/DrawGear to reduce scrolling in uGears.pas, add portal graphics
nemo
parents:
diff
changeset
|
837 |
gtPiano: begin |
733f4001b8b9
Break out DrawHH/DrawGear to reduce scrolling in uGears.pas, add portal graphics
nemo
parents:
diff
changeset
|
838 |
if (Gear^.State and gstDrowning) = 0 then |
733f4001b8b9
Break out DrawHH/DrawGear to reduce scrolling in uGears.pas, add portal graphics
nemo
parents:
diff
changeset
|
839 |
begin |
3390 | 840 |
Tint($FF, $FF, $FF, $10); |
3387
733f4001b8b9
Break out DrawHH/DrawGear to reduce scrolling in uGears.pas, add portal graphics
nemo
parents:
diff
changeset
|
841 |
for i:= 8 downto 1 do |
4016 | 842 |
DrawRotatedTextureF(SpritesData[sprPiano].Texture, 1, 0, 0, x, y - hwRound(Gear^.dY * 4 * i), 0, 1, 128, 128, 0); |
3390 | 843 |
Tint($FF, $FF, $FF, $FF) |
3387
733f4001b8b9
Break out DrawHH/DrawGear to reduce scrolling in uGears.pas, add portal graphics
nemo
parents:
diff
changeset
|
844 |
end; |
4016 | 845 |
DrawRotatedTextureF(SpritesData[sprPiano].Texture, 1, 0, 0, x, y, 0, 1, 128, 128, 0); |
3387
733f4001b8b9
Break out DrawHH/DrawGear to reduce scrolling in uGears.pas, add portal graphics
nemo
parents:
diff
changeset
|
846 |
end; |
3712 | 847 |
gtPoisonCloud: begin |
3713 | 848 |
if Gear^.Timer < 1020 then |
849 |
Tint($C0, $C0, $00, Gear^.Timer div 8) |
|
850 |
else if Gear^.Timer > 3980 then |
|
851 |
Tint($C0, $C0, $00, (5000 - Gear^.Timer) div 8) |
|
3712 | 852 |
else |
3713 | 853 |
Tint($C0, $C0, $00, $C0); |
4016 | 854 |
DrawRotatedTextureF(SpritesData[sprSmokeWhite].texture, 3, 0, 0, x, y, 0, 1, 22, 22, (RealTicks shr 36 + Gear^.UID * 100) mod 360); |
3712 | 855 |
Tint($FF, $FF, $FF, $FF) |
856 |
end; |
|
4044
de7170e51cc6
Check for collision with surfaces above when levitating hog, use more typical drawing syntax for the resurrector wep, restore typical indentation
nemo
parents:
4036
diff
changeset
|
857 |
gtResurrector: begin |
de7170e51cc6
Check for collision with surfaces above when levitating hog, use more typical drawing syntax for the resurrector wep, restore typical indentation
nemo
parents:
4036
diff
changeset
|
858 |
DrawRotated(sprCross, x, y, 0, 0); |
de7170e51cc6
Check for collision with surfaces above when levitating hog, use more typical drawing syntax for the resurrector wep, restore typical indentation
nemo
parents:
4036
diff
changeset
|
859 |
Tint($f5, $db, $35, max($00, floor($C0 * abs(1 - (GameTicks mod 6000) / 3000)))); |
de7170e51cc6
Check for collision with surfaces above when levitating hog, use more typical drawing syntax for the resurrector wep, restore typical indentation
nemo
parents:
4036
diff
changeset
|
860 |
DrawTexture(x - 108, y - 108, SpritesData[sprVampiric].Texture, 4.5); |
de7170e51cc6
Check for collision with surfaces above when levitating hog, use more typical drawing syntax for the resurrector wep, restore typical indentation
nemo
parents:
4036
diff
changeset
|
861 |
Tint($FF, $FF, $FF, $FF); |
de7170e51cc6
Check for collision with surfaces above when levitating hog, use more typical drawing syntax for the resurrector wep, restore typical indentation
nemo
parents:
4036
diff
changeset
|
862 |
end; |
3387
733f4001b8b9
Break out DrawHH/DrawGear to reduce scrolling in uGears.pas, add portal graphics
nemo
parents:
diff
changeset
|
863 |
end; |
4016 | 864 |
if Gear^.RenderTimer and (Gear^.Tex <> nil) then DrawCentered(x + 8, y + 8, Gear^.Tex); |
3387
733f4001b8b9
Break out DrawHH/DrawGear to reduce scrolling in uGears.pas, add portal graphics
nemo
parents:
diff
changeset
|
865 |
Gear:= Gear^.NextGear |
733f4001b8b9
Break out DrawHH/DrawGear to reduce scrolling in uGears.pas, add portal graphics
nemo
parents:
diff
changeset
|
866 |
end; |
733f4001b8b9
Break out DrawHH/DrawGear to reduce scrolling in uGears.pas, add portal graphics
nemo
parents:
diff
changeset
|
867 |
end; |