author | unc0rr |
Sun, 07 Nov 2010 19:49:16 +0300 | |
changeset 4172 | 03fe080d99d6 |
parent 4168 | 49ad7bea4a33 |
child 4222 | e0de341a75ab |
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); |
3963
6090d2a2472e
New Weapon: Resurrector (TODO: ammo icon + sprites)
Tobias Neumann <mail@tobias-neumann.eu>
parents:
3909
diff
changeset
|
436 |
amResurrector: 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
|
437 |
DrawCircle(ox, oy, 100, 1.5, 0, 0, |
e7d838d063a4
Avoid a flicker of tags if jiggling a hog, remove a bunch of calls to hwRound and hwSign
nemo
parents:
4044
diff
changeset
|
438 |
$FF, $FF); // I'd rather not like to hardcode 100 here |
3963
6090d2a2472e
New Weapon: Resurrector (TODO: ammo icon + sprites)
Tobias Neumann <mail@tobias-neumann.eu>
parents:
3909
diff
changeset
|
439 |
end; |
3387
733f4001b8b9
Break out DrawHH/DrawGear to reduce scrolling in uGears.pas, add portal graphics
nemo
parents:
diff
changeset
|
440 |
end; |
733f4001b8b9
Break out DrawHH/DrawGear to reduce scrolling in uGears.pas, add portal graphics
nemo
parents:
diff
changeset
|
441 |
|
733f4001b8b9
Break out DrawHH/DrawGear to reduce scrolling in uGears.pas, add portal graphics
nemo
parents:
diff
changeset
|
442 |
case amt of |
733f4001b8b9
Break out DrawHH/DrawGear to reduce scrolling in uGears.pas, add portal graphics
nemo
parents:
diff
changeset
|
443 |
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
|
444 |
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
|
445 |
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
|
446 |
sign, |
3387
733f4001b8b9
Break out DrawHH/DrawGear to reduce scrolling in uGears.pas, add portal graphics
nemo
parents:
diff
changeset
|
447 |
1, |
733f4001b8b9
Break out DrawHH/DrawGear to reduce scrolling in uGears.pas, add portal graphics
nemo
parents:
diff
changeset
|
448 |
2, |
733f4001b8b9
Break out DrawHH/DrawGear to reduce scrolling in uGears.pas, add portal graphics
nemo
parents:
diff
changeset
|
449 |
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
|
450 |
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
|
451 |
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
|
452 |
sign, |
3387
733f4001b8b9
Break out DrawHH/DrawGear to reduce scrolling in uGears.pas, add portal graphics
nemo
parents:
diff
changeset
|
453 |
1, |
733f4001b8b9
Break out DrawHH/DrawGear to reduce scrolling in uGears.pas, add portal graphics
nemo
parents:
diff
changeset
|
454 |
5, |
733f4001b8b9
Break out DrawHH/DrawGear to reduce scrolling in uGears.pas, add portal graphics
nemo
parents:
diff
changeset
|
455 |
0); |
733f4001b8b9
Break out DrawHH/DrawGear to reduce scrolling in uGears.pas, add portal graphics
nemo
parents:
diff
changeset
|
456 |
amWhip: DrawRotatedF(sprWhip, |
733f4001b8b9
Break out DrawHH/DrawGear to reduce scrolling in uGears.pas, add portal graphics
nemo
parents:
diff
changeset
|
457 |
sx, |
733f4001b8b9
Break out DrawHH/DrawGear to reduce scrolling in uGears.pas, add portal graphics
nemo
parents:
diff
changeset
|
458 |
sy, |
733f4001b8b9
Break out DrawHH/DrawGear to reduce scrolling in uGears.pas, add portal graphics
nemo
parents:
diff
changeset
|
459 |
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
|
460 |
sign, |
3387
733f4001b8b9
Break out DrawHH/DrawGear to reduce scrolling in uGears.pas, add portal graphics
nemo
parents:
diff
changeset
|
461 |
0); |
3717 | 462 |
amHammer: DrawRotatedF(sprHammer, |
463 |
sx, |
|
464 |
sy, |
|
465 |
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
|
466 |
sign, |
3717 | 467 |
0); |
3387
733f4001b8b9
Break out DrawHH/DrawGear to reduce scrolling in uGears.pas, add portal graphics
nemo
parents:
diff
changeset
|
468 |
else |
733f4001b8b9
Break out DrawHH/DrawGear to reduce scrolling in uGears.pas, add portal graphics
nemo
parents:
diff
changeset
|
469 |
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
|
470 |
sign, |
3387
733f4001b8b9
Break out DrawHH/DrawGear to reduce scrolling in uGears.pas, add portal graphics
nemo
parents:
diff
changeset
|
471 |
0, |
733f4001b8b9
Break out DrawHH/DrawGear to reduce scrolling in uGears.pas, add portal graphics
nemo
parents:
diff
changeset
|
472 |
4, |
733f4001b8b9
Break out DrawHH/DrawGear to reduce scrolling in uGears.pas, add portal graphics
nemo
parents:
diff
changeset
|
473 |
0); |
733f4001b8b9
Break out DrawHH/DrawGear to reduce scrolling in uGears.pas, add portal graphics
nemo
parents:
diff
changeset
|
474 |
|
733f4001b8b9
Break out DrawHH/DrawGear to reduce scrolling in uGears.pas, add portal graphics
nemo
parents:
diff
changeset
|
475 |
HatVisible:= true; |
733f4001b8b9
Break out DrawHH/DrawGear to reduce scrolling in uGears.pas, add portal graphics
nemo
parents:
diff
changeset
|
476 |
(* with HH^ do |
733f4001b8b9
Break out DrawHH/DrawGear to reduce scrolling in uGears.pas, add portal graphics
nemo
parents:
diff
changeset
|
477 |
if (HatTex <> nil) |
733f4001b8b9
Break out DrawHH/DrawGear to reduce scrolling in uGears.pas, add portal graphics
nemo
parents:
diff
changeset
|
478 |
and (HatVisibility > 0) then |
733f4001b8b9
Break out DrawHH/DrawGear to reduce scrolling in uGears.pas, add portal graphics
nemo
parents:
diff
changeset
|
479 |
DrawTextureF(HatTex, |
733f4001b8b9
Break out DrawHH/DrawGear to reduce scrolling in uGears.pas, add portal graphics
nemo
parents:
diff
changeset
|
480 |
HatVisibility, |
733f4001b8b9
Break out DrawHH/DrawGear to reduce scrolling in uGears.pas, add portal graphics
nemo
parents:
diff
changeset
|
481 |
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
|
482 |
sy - 5, |
3387
733f4001b8b9
Break out DrawHH/DrawGear to reduce scrolling in uGears.pas, add portal graphics
nemo
parents:
diff
changeset
|
483 |
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
|
484 |
sign, |
3387
733f4001b8b9
Break out DrawHH/DrawGear to reduce scrolling in uGears.pas, add portal graphics
nemo
parents:
diff
changeset
|
485 |
32, |
733f4001b8b9
Break out DrawHH/DrawGear to reduce scrolling in uGears.pas, add portal graphics
nemo
parents:
diff
changeset
|
486 |
32); *) |
733f4001b8b9
Break out DrawHH/DrawGear to reduce scrolling in uGears.pas, add portal graphics
nemo
parents:
diff
changeset
|
487 |
end; |
733f4001b8b9
Break out DrawHH/DrawGear to reduce scrolling in uGears.pas, add portal graphics
nemo
parents:
diff
changeset
|
488 |
|
733f4001b8b9
Break out DrawHH/DrawGear to reduce scrolling in uGears.pas, add portal graphics
nemo
parents:
diff
changeset
|
489 |
case amt of |
733f4001b8b9
Break out DrawHH/DrawGear to reduce scrolling in uGears.pas, add portal graphics
nemo
parents:
diff
changeset
|
490 |
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
|
491 |
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
|
492 |
sy + 9, sign, aangle); |
3387
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 |
defaultPos:= false |
733f4001b8b9
Break out DrawHH/DrawGear to reduce scrolling in uGears.pas, add portal graphics
nemo
parents:
diff
changeset
|
496 |
end; |
733f4001b8b9
Break out DrawHH/DrawGear to reduce scrolling in uGears.pas, add portal graphics
nemo
parents:
diff
changeset
|
497 |
|
733f4001b8b9
Break out DrawHH/DrawGear to reduce scrolling in uGears.pas, add portal graphics
nemo
parents:
diff
changeset
|
498 |
end else // not gstHHDriven |
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 |
if (Gear^.Damage > 0) |
733f4001b8b9
Break out DrawHH/DrawGear to reduce scrolling in uGears.pas, add portal graphics
nemo
parents:
diff
changeset
|
501 |
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
|
502 |
begin |
733f4001b8b9
Break out DrawHH/DrawGear to reduce scrolling in uGears.pas, add portal graphics
nemo
parents:
diff
changeset
|
503 |
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
|
504 |
sign, |
3387
733f4001b8b9
Break out DrawHH/DrawGear to reduce scrolling in uGears.pas, add portal graphics
nemo
parents:
diff
changeset
|
505 |
2, |
733f4001b8b9
Break out DrawHH/DrawGear to reduce scrolling in uGears.pas, add portal graphics
nemo
parents:
diff
changeset
|
506 |
1, |
733f4001b8b9
Break out DrawHH/DrawGear to reduce scrolling in uGears.pas, add portal graphics
nemo
parents:
diff
changeset
|
507 |
Gear^.DirAngle); |
733f4001b8b9
Break out DrawHH/DrawGear to reduce scrolling in uGears.pas, add portal graphics
nemo
parents:
diff
changeset
|
508 |
defaultPos:= false |
733f4001b8b9
Break out DrawHH/DrawGear to reduce scrolling in uGears.pas, add portal graphics
nemo
parents:
diff
changeset
|
509 |
end else |
733f4001b8b9
Break out DrawHH/DrawGear to reduce scrolling in uGears.pas, add portal graphics
nemo
parents:
diff
changeset
|
510 |
|
733f4001b8b9
Break out DrawHH/DrawGear to reduce scrolling in uGears.pas, add portal graphics
nemo
parents:
diff
changeset
|
511 |
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
|
512 |
begin |
733f4001b8b9
Break out DrawHH/DrawGear to reduce scrolling in uGears.pas, add portal graphics
nemo
parents:
diff
changeset
|
513 |
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
|
514 |
sign*m, |
3387
733f4001b8b9
Break out DrawHH/DrawGear to reduce scrolling in uGears.pas, add portal graphics
nemo
parents:
diff
changeset
|
515 |
1, |
733f4001b8b9
Break out DrawHH/DrawGear to reduce scrolling in uGears.pas, add portal graphics
nemo
parents:
diff
changeset
|
516 |
1, |
733f4001b8b9
Break out DrawHH/DrawGear to reduce scrolling in uGears.pas, add portal graphics
nemo
parents:
diff
changeset
|
517 |
0); |
733f4001b8b9
Break out DrawHH/DrawGear to reduce scrolling in uGears.pas, add portal graphics
nemo
parents:
diff
changeset
|
518 |
defaultPos:= false |
733f4001b8b9
Break out DrawHH/DrawGear to reduce scrolling in uGears.pas, add portal graphics
nemo
parents:
diff
changeset
|
519 |
end; |
733f4001b8b9
Break out DrawHH/DrawGear to reduce scrolling in uGears.pas, add portal graphics
nemo
parents:
diff
changeset
|
520 |
end; |
733f4001b8b9
Break out DrawHH/DrawGear to reduce scrolling in uGears.pas, add portal graphics
nemo
parents:
diff
changeset
|
521 |
|
733f4001b8b9
Break out DrawHH/DrawGear to reduce scrolling in uGears.pas, add portal graphics
nemo
parents:
diff
changeset
|
522 |
with HH^ do |
733f4001b8b9
Break out DrawHH/DrawGear to reduce scrolling in uGears.pas, add portal graphics
nemo
parents:
diff
changeset
|
523 |
begin |
733f4001b8b9
Break out DrawHH/DrawGear to reduce scrolling in uGears.pas, add portal graphics
nemo
parents:
diff
changeset
|
524 |
if defaultPos then |
733f4001b8b9
Break out DrawHH/DrawGear to reduce scrolling in uGears.pas, add portal graphics
nemo
parents:
diff
changeset
|
525 |
begin |
733f4001b8b9
Break out DrawHH/DrawGear to reduce scrolling in uGears.pas, add portal graphics
nemo
parents:
diff
changeset
|
526 |
DrawRotatedF(sprHHIdle, |
733f4001b8b9
Break out DrawHH/DrawGear to reduce scrolling in uGears.pas, add portal graphics
nemo
parents:
diff
changeset
|
527 |
sx, |
733f4001b8b9
Break out DrawHH/DrawGear to reduce scrolling in uGears.pas, add portal graphics
nemo
parents:
diff
changeset
|
528 |
sy, |
733f4001b8b9
Break out DrawHH/DrawGear to reduce scrolling in uGears.pas, add portal graphics
nemo
parents:
diff
changeset
|
529 |
(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
|
530 |
sign, |
3387
733f4001b8b9
Break out DrawHH/DrawGear to reduce scrolling in uGears.pas, add portal graphics
nemo
parents:
diff
changeset
|
531 |
0); |
733f4001b8b9
Break out DrawHH/DrawGear to reduce scrolling in uGears.pas, add portal graphics
nemo
parents:
diff
changeset
|
532 |
HatVisible:= true; |
733f4001b8b9
Break out DrawHH/DrawGear to reduce scrolling in uGears.pas, add portal graphics
nemo
parents:
diff
changeset
|
533 |
end; |
733f4001b8b9
Break out DrawHH/DrawGear to reduce scrolling in uGears.pas, add portal graphics
nemo
parents:
diff
changeset
|
534 |
|
733f4001b8b9
Break out DrawHH/DrawGear to reduce scrolling in uGears.pas, add portal graphics
nemo
parents:
diff
changeset
|
535 |
if HatVisible then |
733f4001b8b9
Break out DrawHH/DrawGear to reduce scrolling in uGears.pas, add portal graphics
nemo
parents:
diff
changeset
|
536 |
if HatVisibility < 1.0 then |
733f4001b8b9
Break out DrawHH/DrawGear to reduce scrolling in uGears.pas, add portal graphics
nemo
parents:
diff
changeset
|
537 |
HatVisibility:= HatVisibility + 0.2 |
733f4001b8b9
Break out DrawHH/DrawGear to reduce scrolling in uGears.pas, add portal graphics
nemo
parents:
diff
changeset
|
538 |
else |
733f4001b8b9
Break out DrawHH/DrawGear to reduce scrolling in uGears.pas, add portal graphics
nemo
parents:
diff
changeset
|
539 |
else |
733f4001b8b9
Break out DrawHH/DrawGear to reduce scrolling in uGears.pas, add portal graphics
nemo
parents:
diff
changeset
|
540 |
if HatVisibility > 0.0 then |
733f4001b8b9
Break out DrawHH/DrawGear to reduce scrolling in uGears.pas, add portal graphics
nemo
parents:
diff
changeset
|
541 |
HatVisibility:= HatVisibility - 0.2; |
733f4001b8b9
Break out DrawHH/DrawGear to reduce scrolling in uGears.pas, add portal graphics
nemo
parents:
diff
changeset
|
542 |
|
733f4001b8b9
Break out DrawHH/DrawGear to reduce scrolling in uGears.pas, add portal graphics
nemo
parents:
diff
changeset
|
543 |
if (HatTex <> nil) |
733f4001b8b9
Break out DrawHH/DrawGear to reduce scrolling in uGears.pas, add portal graphics
nemo
parents:
diff
changeset
|
544 |
and (HatVisibility > 0) then |
733f4001b8b9
Break out DrawHH/DrawGear to reduce scrolling in uGears.pas, add portal graphics
nemo
parents:
diff
changeset
|
545 |
if DefaultPos then |
3445 | 546 |
begin |
3387
733f4001b8b9
Break out DrawHH/DrawGear to reduce scrolling in uGears.pas, add portal graphics
nemo
parents:
diff
changeset
|
547 |
DrawTextureF(HatTex, |
733f4001b8b9
Break out DrawHH/DrawGear to reduce scrolling in uGears.pas, add portal graphics
nemo
parents:
diff
changeset
|
548 |
HatVisibility, |
733f4001b8b9
Break out DrawHH/DrawGear to reduce scrolling in uGears.pas, add portal graphics
nemo
parents:
diff
changeset
|
549 |
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
|
550 |
sy - 5, |
3387
733f4001b8b9
Break out DrawHH/DrawGear to reduce scrolling in uGears.pas, add portal graphics
nemo
parents:
diff
changeset
|
551 |
(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
|
552 |
sign, |
3387
733f4001b8b9
Break out DrawHH/DrawGear to reduce scrolling in uGears.pas, add portal graphics
nemo
parents:
diff
changeset
|
553 |
32, |
3445 | 554 |
32); |
3854 | 555 |
if HatTex^.w > 64 then |
3445 | 556 |
begin |
557 |
Tint(HH^.Team^.Clan^.Color); |
|
558 |
DrawTextureF(HatTex, |
|
559 |
HatVisibility, |
|
560 |
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
|
561 |
sy - 5, |
3445 | 562 |
(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
|
563 |
sign, |
3445 | 564 |
32, |
565 |
32); |
|
566 |
Tint($FF, $FF, $FF, $FF) |
|
567 |
end |
|
568 |
end |
|
3387
733f4001b8b9
Break out DrawHH/DrawGear to reduce scrolling in uGears.pas, add portal graphics
nemo
parents:
diff
changeset
|
569 |
else |
3445 | 570 |
begin |
3387
733f4001b8b9
Break out DrawHH/DrawGear to reduce scrolling in uGears.pas, add portal graphics
nemo
parents:
diff
changeset
|
571 |
DrawTextureF(HatTex, |
733f4001b8b9
Break out DrawHH/DrawGear to reduce scrolling in uGears.pas, add portal graphics
nemo
parents:
diff
changeset
|
572 |
HatVisibility, |
733f4001b8b9
Break out DrawHH/DrawGear to reduce scrolling in uGears.pas, add portal graphics
nemo
parents:
diff
changeset
|
573 |
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
|
574 |
sy - 5, |
3387
733f4001b8b9
Break out DrawHH/DrawGear to reduce scrolling in uGears.pas, add portal graphics
nemo
parents:
diff
changeset
|
575 |
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
|
576 |
sign*m, |
3387
733f4001b8b9
Break out DrawHH/DrawGear to reduce scrolling in uGears.pas, add portal graphics
nemo
parents:
diff
changeset
|
577 |
32, |
733f4001b8b9
Break out DrawHH/DrawGear to reduce scrolling in uGears.pas, add portal graphics
nemo
parents:
diff
changeset
|
578 |
32); |
3854 | 579 |
if HatTex^.w > 64 then |
3445 | 580 |
begin |
581 |
Tint(HH^.Team^.Clan^.Color); |
|
582 |
DrawTextureF(HatTex, |
|
583 |
HatVisibility, |
|
584 |
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
|
585 |
sy - 5, |
3445 | 586 |
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
|
587 |
sign*m, |
3445 | 588 |
32, |
589 |
32); |
|
590 |
Tint($FF, $FF, $FF, $FF) |
|
591 |
end |
|
592 |
end |
|
3387
733f4001b8b9
Break out DrawHH/DrawGear to reduce scrolling in uGears.pas, add portal graphics
nemo
parents:
diff
changeset
|
593 |
end; |
733f4001b8b9
Break out DrawHH/DrawGear to reduce scrolling in uGears.pas, add portal graphics
nemo
parents:
diff
changeset
|
594 |
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
|
595 |
begin |
733f4001b8b9
Break out DrawHH/DrawGear to reduce scrolling in uGears.pas, add portal graphics
nemo
parents:
diff
changeset
|
596 |
(* if (CurAmmoGear = nil) then |
733f4001b8b9
Break out DrawHH/DrawGear to reduce scrolling in uGears.pas, add portal graphics
nemo
parents:
diff
changeset
|
597 |
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
|
598 |
amt:= CurrentHedgehog^.CurAmmoType; |
3387
733f4001b8b9
Break out DrawHH/DrawGear to reduce scrolling in uGears.pas, add portal graphics
nemo
parents:
diff
changeset
|
599 |
case amt of |
733f4001b8b9
Break out DrawHH/DrawGear to reduce scrolling in uGears.pas, add portal graphics
nemo
parents:
diff
changeset
|
600 |
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
|
601 |
end |
733f4001b8b9
Break out DrawHH/DrawGear to reduce scrolling in uGears.pas, add portal graphics
nemo
parents:
diff
changeset
|
602 |
end; *) |
733f4001b8b9
Break out DrawHH/DrawGear to reduce scrolling in uGears.pas, add portal graphics
nemo
parents:
diff
changeset
|
603 |
if CurAmmoGear <> nil then |
733f4001b8b9
Break out DrawHH/DrawGear to reduce scrolling in uGears.pas, add portal graphics
nemo
parents:
diff
changeset
|
604 |
begin |
733f4001b8b9
Break out DrawHH/DrawGear to reduce scrolling in uGears.pas, add portal graphics
nemo
parents:
diff
changeset
|
605 |
case CurAmmoGear^.Kind of |
733f4001b8b9
Break out DrawHH/DrawGear to reduce scrolling in uGears.pas, add portal graphics
nemo
parents:
diff
changeset
|
606 |
gtJetpack: begin |
733f4001b8b9
Break out DrawHH/DrawGear to reduce scrolling in uGears.pas, add portal graphics
nemo
parents:
diff
changeset
|
607 |
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
|
608 |
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
|
609 |
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
|
610 |
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
|
611 |
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
|
612 |
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
|
613 |
end; |
3387
733f4001b8b9
Break out DrawHH/DrawGear to reduce scrolling in uGears.pas, add portal graphics
nemo
parents:
diff
changeset
|
614 |
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
|
615 |
DrawAltWeapon(Gear, sx, sy) |
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 |
end; |
733f4001b8b9
Break out DrawHH/DrawGear to reduce scrolling in uGears.pas, add portal graphics
nemo
parents:
diff
changeset
|
618 |
end |
733f4001b8b9
Break out DrawHH/DrawGear to reduce scrolling in uGears.pas, add portal graphics
nemo
parents:
diff
changeset
|
619 |
end; |
733f4001b8b9
Break out DrawHH/DrawGear to reduce scrolling in uGears.pas, add portal graphics
nemo
parents:
diff
changeset
|
620 |
|
733f4001b8b9
Break out DrawHH/DrawGear to reduce scrolling in uGears.pas, add portal graphics
nemo
parents:
diff
changeset
|
621 |
with HH^ do |
733f4001b8b9
Break out DrawHH/DrawGear to reduce scrolling in uGears.pas, add portal graphics
nemo
parents:
diff
changeset
|
622 |
begin |
733f4001b8b9
Break out DrawHH/DrawGear to reduce scrolling in uGears.pas, add portal graphics
nemo
parents:
diff
changeset
|
623 |
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
|
624 |
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
|
625 |
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
|
626 |
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
|
627 |
t:= sy - cHHRadius - 9; |
3387
733f4001b8b9
Break out DrawHH/DrawGear to reduce scrolling in uGears.pas, add portal graphics
nemo
parents:
diff
changeset
|
628 |
if (cTagsMask and htTransparent) <> 0 then |
3390 | 629 |
Tint($FF, $FF, $FF, $80); |
3387
733f4001b8b9
Break out DrawHH/DrawGear to reduce scrolling in uGears.pas, add portal graphics
nemo
parents:
diff
changeset
|
630 |
if ((cTagsMask and htHealth) <> 0) then |
733f4001b8b9
Break out DrawHH/DrawGear to reduce scrolling in uGears.pas, add portal graphics
nemo
parents:
diff
changeset
|
631 |
begin |
733f4001b8b9
Break out DrawHH/DrawGear to reduce scrolling in uGears.pas, add portal graphics
nemo
parents:
diff
changeset
|
632 |
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
|
633 |
DrawCentered(ox, t, HealthTagTex) |
3387
733f4001b8b9
Break out DrawHH/DrawGear to reduce scrolling in uGears.pas, add portal graphics
nemo
parents:
diff
changeset
|
634 |
end; |
733f4001b8b9
Break out DrawHH/DrawGear to reduce scrolling in uGears.pas, add portal graphics
nemo
parents:
diff
changeset
|
635 |
if (cTagsMask and htName) <> 0 then |
733f4001b8b9
Break out DrawHH/DrawGear to reduce scrolling in uGears.pas, add portal graphics
nemo
parents:
diff
changeset
|
636 |
begin |
733f4001b8b9
Break out DrawHH/DrawGear to reduce scrolling in uGears.pas, add portal graphics
nemo
parents:
diff
changeset
|
637 |
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
|
638 |
DrawCentered(ox, t, NameTagTex) |
3387
733f4001b8b9
Break out DrawHH/DrawGear to reduce scrolling in uGears.pas, add portal graphics
nemo
parents:
diff
changeset
|
639 |
end; |
733f4001b8b9
Break out DrawHH/DrawGear to reduce scrolling in uGears.pas, add portal graphics
nemo
parents:
diff
changeset
|
640 |
if (cTagsMask and htTeamName) <> 0 then |
733f4001b8b9
Break out DrawHH/DrawGear to reduce scrolling in uGears.pas, add portal graphics
nemo
parents:
diff
changeset
|
641 |
begin |
733f4001b8b9
Break out DrawHH/DrawGear to reduce scrolling in uGears.pas, add portal graphics
nemo
parents:
diff
changeset
|
642 |
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
|
643 |
DrawCentered(ox, t, Team^.NameTagTex) |
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 (cTagsMask and htTransparent) <> 0 then |
3390 | 646 |
Tint($FF, $FF, $FF, $FF) |
3387
733f4001b8b9
Break out DrawHH/DrawGear to reduce scrolling in uGears.pas, add portal graphics
nemo
parents:
diff
changeset
|
647 |
end; |
733f4001b8b9
Break out DrawHH/DrawGear to reduce scrolling in uGears.pas, add portal graphics
nemo
parents:
diff
changeset
|
648 |
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
|
649 |
begin |
733f4001b8b9
Break out DrawHH/DrawGear to reduce scrolling in uGears.pas, add portal graphics
nemo
parents:
diff
changeset
|
650 |
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
|
651 |
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
|
652 |
GameTicks div 32 mod 16); |
733f4001b8b9
Break out DrawHH/DrawGear to reduce scrolling in uGears.pas, add portal graphics
nemo
parents:
diff
changeset
|
653 |
|
733f4001b8b9
Break out DrawHH/DrawGear to reduce scrolling in uGears.pas, add portal graphics
nemo
parents:
diff
changeset
|
654 |
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
|
655 |
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
|
656 |
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
|
657 |
end |
733f4001b8b9
Break out DrawHH/DrawGear to reduce scrolling in uGears.pas, add portal graphics
nemo
parents:
diff
changeset
|
658 |
end; |
733f4001b8b9
Break out DrawHH/DrawGear to reduce scrolling in uGears.pas, add portal graphics
nemo
parents:
diff
changeset
|
659 |
|
733f4001b8b9
Break out DrawHH/DrawGear to reduce scrolling in uGears.pas, add portal graphics
nemo
parents:
diff
changeset
|
660 |
if HH^.Effects[hePoisoned] then |
733f4001b8b9
Break out DrawHH/DrawGear to reduce scrolling in uGears.pas, add portal graphics
nemo
parents:
diff
changeset
|
661 |
begin |
3392 | 662 |
Tint($00, $FF, $40, $80); |
3387
733f4001b8b9
Break out DrawHH/DrawGear to reduce scrolling in uGears.pas, add portal graphics
nemo
parents:
diff
changeset
|
663 |
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
|
664 |
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
|
665 |
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
|
666 |
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
|
667 |
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
|
668 |
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
|
669 |
end; |
3387
733f4001b8b9
Break out DrawHH/DrawGear to reduce scrolling in uGears.pas, add portal graphics
nemo
parents:
diff
changeset
|
670 |
|
733f4001b8b9
Break out DrawHH/DrawGear to reduce scrolling in uGears.pas, add portal graphics
nemo
parents:
diff
changeset
|
671 |
if Gear^.Invulnerable then |
733f4001b8b9
Break out DrawHH/DrawGear to reduce scrolling in uGears.pas, add portal graphics
nemo
parents:
diff
changeset
|
672 |
begin |
733f4001b8b9
Break out DrawHH/DrawGear to reduce scrolling in uGears.pas, add portal graphics
nemo
parents:
diff
changeset
|
673 |
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
|
674 |
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
|
675 |
end; |
733f4001b8b9
Break out DrawHH/DrawGear to reduce scrolling in uGears.pas, add portal graphics
nemo
parents:
diff
changeset
|
676 |
if cVampiric and |
733f4001b8b9
Break out DrawHH/DrawGear to reduce scrolling in uGears.pas, add portal graphics
nemo
parents:
diff
changeset
|
677 |
(CurrentHedgehog^.Gear <> nil) and |
733f4001b8b9
Break out DrawHH/DrawGear to reduce scrolling in uGears.pas, add portal graphics
nemo
parents:
diff
changeset
|
678 |
(CurrentHedgehog^.Gear = Gear) then |
733f4001b8b9
Break out DrawHH/DrawGear to reduce scrolling in uGears.pas, add portal graphics
nemo
parents:
diff
changeset
|
679 |
begin |
4016 | 680 |
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
|
681 |
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
|
682 |
end; |
3390 | 683 |
Tint($FF, $FF, $FF, $FF) |
3387
733f4001b8b9
Break out DrawHH/DrawGear to reduce scrolling in uGears.pas, add portal graphics
nemo
parents:
diff
changeset
|
684 |
end; |
733f4001b8b9
Break out DrawHH/DrawGear to reduce scrolling in uGears.pas, add portal graphics
nemo
parents:
diff
changeset
|
685 |
|
733f4001b8b9
Break out DrawHH/DrawGear to reduce scrolling in uGears.pas, add portal graphics
nemo
parents:
diff
changeset
|
686 |
procedure DrawGears; |
733f4001b8b9
Break out DrawHH/DrawGear to reduce scrolling in uGears.pas, add portal graphics
nemo
parents:
diff
changeset
|
687 |
var Gear, HHGear: PGear; |
733f4001b8b9
Break out DrawHH/DrawGear to reduce scrolling in uGears.pas, add portal graphics
nemo
parents:
diff
changeset
|
688 |
i: Longword; |
4016 | 689 |
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
|
690 |
begin |
733f4001b8b9
Break out DrawHH/DrawGear to reduce scrolling in uGears.pas, add portal graphics
nemo
parents:
diff
changeset
|
691 |
Gear:= GearsList; |
733f4001b8b9
Break out DrawHH/DrawGear to reduce scrolling in uGears.pas, add portal graphics
nemo
parents:
diff
changeset
|
692 |
while Gear<>nil do |
733f4001b8b9
Break out DrawHH/DrawGear to reduce scrolling in uGears.pas, add portal graphics
nemo
parents:
diff
changeset
|
693 |
begin |
4016 | 694 |
x:= hwRound(Gear^.X) + WorldDx; |
695 |
y:= hwRound(Gear^.Y) + WorldDy; |
|
3387
733f4001b8b9
Break out DrawHH/DrawGear to reduce scrolling in uGears.pas, add portal graphics
nemo
parents:
diff
changeset
|
696 |
case Gear^.Kind of |
4168 | 697 |
gtBomb: DrawRotated(sprBomb, x, y, 0, Gear^.DirAngle); |
4016 | 698 |
gtGasBomb: DrawRotated(sprCheese, x, y, 0, Gear^.DirAngle); |
699 |
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
|
700 |
|
733f4001b8b9
Break out DrawHH/DrawGear to reduce scrolling in uGears.pas, add portal graphics
nemo
parents:
diff
changeset
|
701 |
gtRCPlane: begin |
733f4001b8b9
Break out DrawHH/DrawGear to reduce scrolling in uGears.pas, add portal graphics
nemo
parents:
diff
changeset
|
702 |
if (Gear^.Tag = -1) then |
4016 | 703 |
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
|
704 |
else |
4016 | 705 |
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
|
706 |
if ((TrainingFlags and tfRCPlane) <> 0) and (TrainingTargetGear <> nil) and ((Gear^.State and gstDrowning) = 0) then |
4016 | 707 |
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
|
708 |
end; |
4016 | 709 |
gtBall: DrawRotatedf(sprBalls, x, y, Gear^.Tag,0, Gear^.DirAngle); |
3428 | 710 |
|
711 |
gtPortal: if ((Gear^.Tag and 1) = 0) // still moving? |
|
712 |
or (Gear^.IntersectGear = nil) or (Gear^.IntersectGear^.IntersectGear <> Gear) // not linked&backlinked? |
|
713 |
or ((Gear^.IntersectGear^.Tag and 1) = 0) then // linked portal still moving? |
|
4016 | 714 |
DrawRotatedf(sprPortal, x, y, Gear^.Tag, hwSign(Gear^.dX), Gear^.DirAngle) |
715 |
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
|
716 |
|
4016 | 717 |
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
|
718 |
|
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
|
719 |
gtHedgehog: DrawHH(Gear, x, y); |
3387
733f4001b8b9
Break out DrawHH/DrawGear to reduce scrolling in uGears.pas, add portal graphics
nemo
parents:
diff
changeset
|
720 |
|
4168 | 721 |
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
|
722 |
|
4016 | 723 |
gtGrave: begin |
724 |
DrawTextureF(PHedgehog(Gear^.Hedgehog)^.Team^.GraveTex, 1, x, y, (GameTicks shr 7+Gear^.uid) and 7, 1, 32, 32); |
|
725 |
if Gear^.Health > 0 then |
|
726 |
begin |
|
727 |
//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
|
728 |
Tint($f5, $db, $35, max($40, floor($FF * abs(1 - (GameTicks mod 1500) / (750 + Gear^.Health))))); |
4016 | 729 |
//Tint($FF, $FF, $FF, max($40, floor($FF * abs(1 - (RealTicks mod 1500) / 750)))); |
730 |
DrawSprite(sprVampiric, x - 24, y - 24, 0); |
|
731 |
Tint($FF, $FF, $FF, $FF) |
|
732 |
end |
|
733 |
end; |
|
3387
733f4001b8b9
Break out DrawHH/DrawGear to reduce scrolling in uGears.pas, add portal graphics
nemo
parents:
diff
changeset
|
734 |
|
4016 | 735 |
gtBee: DrawRotatedF(sprBee, x, y, (GameTicks shr 5) mod 2, 0, DxDy2Angle(Gear^.dY, Gear^.dX)); |
736 |
||
737 |
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
|
738 |
gtRope: DrawRope(Gear); |
733f4001b8b9
Break out DrawHH/DrawGear to reduce scrolling in uGears.pas, add portal graphics
nemo
parents:
diff
changeset
|
739 |
gtMine: if (((Gear^.State and gstAttacking) = 0)or((Gear^.Timer and $3FF) < 420)) and (Gear^.Health <> 0) then |
4016 | 740 |
DrawRotated(sprMineOff, x, y, 0, Gear^.DirAngle) |
741 |
else if Gear^.Health <> 0 then DrawRotated(sprMineOn, x, y, 0, Gear^.DirAngle) |
|
742 |
else DrawRotated(sprMineDead, x, y, 0, Gear^.DirAngle); |
|
3710 | 743 |
gtSMine: if (((Gear^.State and gstAttacking) = 0)or((Gear^.Timer and $3FF) < 420)) and (Gear^.Health <> 0) then |
4016 | 744 |
DrawRotated(sprSMineOff, x, y, 0, Gear^.DirAngle) |
745 |
else if Gear^.Health <> 0 then DrawRotated(sprSMineOn, x, y, 0, Gear^.DirAngle) |
|
746 |
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
|
747 |
gtCase: case Gear^.Pos of |
733f4001b8b9
Break out DrawHH/DrawGear to reduce scrolling in uGears.pas, add portal graphics
nemo
parents:
diff
changeset
|
748 |
posCaseAmmo : begin |
733f4001b8b9
Break out DrawHH/DrawGear to reduce scrolling in uGears.pas, add portal graphics
nemo
parents:
diff
changeset
|
749 |
i:= (GameTicks shr 6) mod 64; |
733f4001b8b9
Break out DrawHH/DrawGear to reduce scrolling in uGears.pas, add portal graphics
nemo
parents:
diff
changeset
|
750 |
if i > 18 then i:= 0; |
4016 | 751 |
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
|
752 |
end; |
733f4001b8b9
Break out DrawHH/DrawGear to reduce scrolling in uGears.pas, add portal graphics
nemo
parents:
diff
changeset
|
753 |
posCaseHealth: begin |
733f4001b8b9
Break out DrawHH/DrawGear to reduce scrolling in uGears.pas, add portal graphics
nemo
parents:
diff
changeset
|
754 |
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
|
755 |
if i > 13 then i:= 0; |
4016 | 756 |
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
|
757 |
end; |
733f4001b8b9
Break out DrawHH/DrawGear to reduce scrolling in uGears.pas, add portal graphics
nemo
parents:
diff
changeset
|
758 |
posCaseUtility: begin |
733f4001b8b9
Break out DrawHH/DrawGear to reduce scrolling in uGears.pas, add portal graphics
nemo
parents:
diff
changeset
|
759 |
i:= (GameTicks shr 6) mod 70; |
733f4001b8b9
Break out DrawHH/DrawGear to reduce scrolling in uGears.pas, add portal graphics
nemo
parents:
diff
changeset
|
760 |
if i > 23 then i:= 0; |
733f4001b8b9
Break out DrawHH/DrawGear to reduce scrolling in uGears.pas, add portal graphics
nemo
parents:
diff
changeset
|
761 |
i:= i mod 12; |
4016 | 762 |
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
|
763 |
end; |
733f4001b8b9
Break out DrawHH/DrawGear to reduce scrolling in uGears.pas, add portal graphics
nemo
parents:
diff
changeset
|
764 |
end; |
733f4001b8b9
Break out DrawHH/DrawGear to reduce scrolling in uGears.pas, add portal graphics
nemo
parents:
diff
changeset
|
765 |
gtExplosives: begin |
733f4001b8b9
Break out DrawHH/DrawGear to reduce scrolling in uGears.pas, add portal graphics
nemo
parents:
diff
changeset
|
766 |
if ((Gear^.State and gstDrowning) <> 0) then |
4016 | 767 |
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
|
768 |
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
|
769 |
begin |
733f4001b8b9
Break out DrawHH/DrawGear to reduce scrolling in uGears.pas, add portal graphics
nemo
parents:
diff
changeset
|
770 |
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
|
771 |
if i > 18 then i:= 0; |
4016 | 772 |
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
|
773 |
end |
733f4001b8b9
Break out DrawHH/DrawGear to reduce scrolling in uGears.pas, add portal graphics
nemo
parents:
diff
changeset
|
774 |
else if Gear^.State and gsttmpFlag = 0 then |
4016 | 775 |
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
|
776 |
else |
4016 | 777 |
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
|
778 |
end; |
4016 | 779 |
gtDynamite: DrawSprite2(sprDynamite, x - 16, y - 25, Gear^.Tag and 1, Gear^.Tag shr 1); |
780 |
gtClusterBomb: DrawRotated(sprClusterBomb, x, y, 0, Gear^.DirAngle); |
|
781 |
gtCluster: DrawSprite(sprClusterParticle, x - 8, y - 8, 0); |
|
782 |
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
|
783 |
gtParachute: begin |
4016 | 784 |
DrawSprite(sprParachute, x - 24, y - 48, 0); |
785 |
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
|
786 |
end; |
4016 | 787 |
gtAirAttack: if Gear^.Tag > 0 then DrawSprite(sprAirplane, x - SpritesData[sprAirplane].Width div 2, y - SpritesData[sprAirplane].Height div 2, 0) |
788 |
else DrawSprite(sprAirplane, x - SpritesData[sprAirplane].Width div 2, y - SpritesData[sprAirplane].Height div 2, 1); |
|
789 |
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
|
790 |
gtTeleport: begin |
733f4001b8b9
Break out DrawHH/DrawGear to reduce scrolling in uGears.pas, add portal graphics
nemo
parents:
diff
changeset
|
791 |
HHGear:= PHedgehog(Gear^.Hedgehog)^.Gear; |
4016 | 792 |
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
|
793 |
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
|
794 |
end; |
4016 | 795 |
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
|
796 |
gtTarget: begin |
733f4001b8b9
Break out DrawHH/DrawGear to reduce scrolling in uGears.pas, add portal graphics
nemo
parents:
diff
changeset
|
797 |
Tint($FF, $FF, $FF, floor($FF * Gear^.Timer / 1000)); |
4016 | 798 |
DrawSprite(sprTarget, x - 16, y - 16, 0); |
3390 | 799 |
Tint($FF, $FF, $FF, $FF); |
3387
733f4001b8b9
Break out DrawHH/DrawGear to reduce scrolling in uGears.pas, add portal graphics
nemo
parents:
diff
changeset
|
800 |
end; |
4016 | 801 |
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
|
802 |
gtCake: if Gear^.Pos = 6 then |
4016 | 803 |
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
|
804 |
else |
4016 | 805 |
DrawRotatedf(sprCakeDown, x, y, 5 - Gear^.Pos, hwSign(Gear^.dX), Gear^.DirAngle * hwSign(Gear^.dX) + 90); |
806 |
gtSeduction: if Gear^.Pos >= 14 then DrawSprite(sprSeduction, x - 16, y - 16, 0); |
|
807 |
gtWatermelon: DrawRotatedf(sprWatermelon, x, y, 0, 0, Gear^.DirAngle); |
|
808 |
gtMelonPiece: DrawRotatedf(sprWatermelon, x, y, 1, 0, Gear^.DirAngle); |
|
809 |
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
|
810 |
gtBirdy: begin |
733f4001b8b9
Break out DrawHH/DrawGear to reduce scrolling in uGears.pas, add portal graphics
nemo
parents:
diff
changeset
|
811 |
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
|
812 |
begin |
733f4001b8b9
Break out DrawHH/DrawGear to reduce scrolling in uGears.pas, add portal graphics
nemo
parents:
diff
changeset
|
813 |
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
|
814 |
begin |
4016 | 815 |
endX:= x - WorldDx; |
816 |
endY:= y - WorldDy; |
|
3387
733f4001b8b9
Break out DrawHH/DrawGear to reduce scrolling in uGears.pas, add portal graphics
nemo
parents:
diff
changeset
|
817 |
if Gear^.Tag < 0 then |
733f4001b8b9
Break out DrawHH/DrawGear to reduce scrolling in uGears.pas, add portal graphics
nemo
parents:
diff
changeset
|
818 |
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
|
819 |
else |
733f4001b8b9
Break out DrawHH/DrawGear to reduce scrolling in uGears.pas, add portal graphics
nemo
parents:
diff
changeset
|
820 |
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
|
821 |
startY:= endY - 256; |
3407 | 822 |
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
|
823 |
end |
733f4001b8b9
Break out DrawHH/DrawGear to reduce scrolling in uGears.pas, add portal graphics
nemo
parents:
diff
changeset
|
824 |
else // Disappearing |
733f4001b8b9
Break out DrawHH/DrawGear to reduce scrolling in uGears.pas, add portal graphics
nemo
parents:
diff
changeset
|
825 |
begin |
4016 | 826 |
startX:= x - WorldDx; |
827 |
startY:= y - WorldDy; |
|
3387
733f4001b8b9
Break out DrawHH/DrawGear to reduce scrolling in uGears.pas, add portal graphics
nemo
parents:
diff
changeset
|
828 |
if Gear^.Tag > 0 then |
733f4001b8b9
Break out DrawHH/DrawGear to reduce scrolling in uGears.pas, add portal graphics
nemo
parents:
diff
changeset
|
829 |
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
|
830 |
else |
733f4001b8b9
Break out DrawHH/DrawGear to reduce scrolling in uGears.pas, add portal graphics
nemo
parents:
diff
changeset
|
831 |
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
|
832 |
endY:= startY + 256; |
3407 | 833 |
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
|
834 |
end; |
733f4001b8b9
Break out DrawHH/DrawGear to reduce scrolling in uGears.pas, add portal graphics
nemo
parents:
diff
changeset
|
835 |
end |
733f4001b8b9
Break out DrawHH/DrawGear to reduce scrolling in uGears.pas, add portal graphics
nemo
parents:
diff
changeset
|
836 |
else |
4016 | 837 |
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
|
838 |
end; |
4016 | 839 |
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
|
840 |
gtPiano: begin |
733f4001b8b9
Break out DrawHH/DrawGear to reduce scrolling in uGears.pas, add portal graphics
nemo
parents:
diff
changeset
|
841 |
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
|
842 |
begin |
3390 | 843 |
Tint($FF, $FF, $FF, $10); |
3387
733f4001b8b9
Break out DrawHH/DrawGear to reduce scrolling in uGears.pas, add portal graphics
nemo
parents:
diff
changeset
|
844 |
for i:= 8 downto 1 do |
4016 | 845 |
DrawRotatedTextureF(SpritesData[sprPiano].Texture, 1, 0, 0, x, y - hwRound(Gear^.dY * 4 * i), 0, 1, 128, 128, 0); |
3390 | 846 |
Tint($FF, $FF, $FF, $FF) |
3387
733f4001b8b9
Break out DrawHH/DrawGear to reduce scrolling in uGears.pas, add portal graphics
nemo
parents:
diff
changeset
|
847 |
end; |
4016 | 848 |
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
|
849 |
end; |
3712 | 850 |
gtPoisonCloud: begin |
3713 | 851 |
if Gear^.Timer < 1020 then |
852 |
Tint($C0, $C0, $00, Gear^.Timer div 8) |
|
853 |
else if Gear^.Timer > 3980 then |
|
854 |
Tint($C0, $C0, $00, (5000 - Gear^.Timer) div 8) |
|
3712 | 855 |
else |
3713 | 856 |
Tint($C0, $C0, $00, $C0); |
4016 | 857 |
DrawRotatedTextureF(SpritesData[sprSmokeWhite].texture, 3, 0, 0, x, y, 0, 1, 22, 22, (RealTicks shr 36 + Gear^.UID * 100) mod 360); |
3712 | 858 |
Tint($FF, $FF, $FF, $FF) |
859 |
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
|
860 |
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
|
861 |
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
|
862 |
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
|
863 |
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
|
864 |
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
|
865 |
end; |
3387
733f4001b8b9
Break out DrawHH/DrawGear to reduce scrolling in uGears.pas, add portal graphics
nemo
parents:
diff
changeset
|
866 |
end; |
4016 | 867 |
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
|
868 |
Gear:= Gear^.NextGear |
733f4001b8b9
Break out DrawHH/DrawGear to reduce scrolling in uGears.pas, add portal graphics
nemo
parents:
diff
changeset
|
869 |
end; |
733f4001b8b9
Break out DrawHH/DrawGear to reduce scrolling in uGears.pas, add portal graphics
nemo
parents:
diff
changeset
|
870 |
end; |