4 hx, hy, cx, cy, tx, ty, sx, sy, m: LongInt; // hedgehog, crosshair, temp, sprite, direction |
4 hx, hy, cx, cy, tx, ty, sx, sy, m: LongInt; // hedgehog, crosshair, temp, sprite, direction |
5 dx, dy, ax, ay, aAngle, dAngle, hAngle, lx, ly: real; // laser, change |
5 dx, dy, ax, ay, aAngle, dAngle, hAngle, lx, ly: real; // laser, change |
6 defaultPos, HatVisible: boolean; |
6 defaultPos, HatVisible: boolean; |
7 VertexBuffer: array [0..1] of TVertex2f; |
7 VertexBuffer: array [0..1] of TVertex2f; |
8 HH: PHedgehog; |
8 HH: PHedgehog; |
|
9 CurWeapon: PAmmo; |
9 begin |
10 begin |
10 HH:= PHedgehog(Gear^.Hedgehog); |
11 HH:= PHedgehog(Gear^.Hedgehog); |
11 if HH^.Unplaced then exit; |
12 if HH^.Unplaced then exit; |
12 m:= 1; |
13 m:= 1; |
13 if ((Gear^.State and gstHHHJump) <> 0) and not cArtillery then m:= -1; |
14 if ((Gear^.State and gstHHHJump) <> 0) and not cArtillery then m:= -1; |
137 glEnable(GL_TEXTURE_2D); |
138 glEnable(GL_TEXTURE_2D); |
138 glDisable(GL_LINE_SMOOTH); |
139 glDisable(GL_LINE_SMOOTH); |
139 end; |
140 end; |
140 end; |
141 end; |
141 // draw crosshair |
142 // draw crosshair |
142 cx:= Round(hwRound(Gear^.X) + dx * 80 + GetLaunchX(HH^.Ammo^[HH^.CurSlot, HH^.CurAmmo].AmmoType, hwSign(Gear^.dX) * m, Gear^.Angle)); |
143 cx:= Round(hwRound(Gear^.X) + dx * 80 + GetLaunchX(HH^.CurAmmoType, hwSign(Gear^.dX) * m, Gear^.Angle)); |
143 cy:= Round(hwRound(Gear^.Y) + dy * 80 + GetLaunchY(HH^.Ammo^[HH^.CurSlot, HH^.CurAmmo].AmmoType, Gear^.Angle)); |
144 cy:= Round(hwRound(Gear^.Y) + dy * 80 + GetLaunchY(HH^.CurAmmoType, Gear^.Angle)); |
144 DrawRotatedTex(HH^.Team^.CrosshairTex, |
145 DrawRotatedTex(HH^.Team^.CrosshairTex, |
145 12, 12, cx + WorldDx, cy + WorldDy, 0, |
146 12, 12, cx + WorldDx, cy + WorldDy, 0, |
146 hwSign(Gear^.dX) * (Gear^.Angle * 180.0) / cMaxAngle); |
147 hwSign(Gear^.dX) * (Gear^.Angle * 180.0) / cMaxAngle); |
147 end; |
148 end; |
148 hx:= hwRound(Gear^.X) + 8 * hwSign(Gear^.dX) + WorldDx; |
149 hx:= hwRound(Gear^.X) + 8 * hwSign(Gear^.dX) + WorldDx; |
379 if aangle <= 90 then aangle:= aangle+360; |
380 if aangle <= 90 then aangle:= aangle+360; |
380 if Gear^.dX > _0 then aangle:= aangle-((aangle-240)*HH^.Timer/10) |
381 if Gear^.dX > _0 then aangle:= aangle-((aangle-240)*HH^.Timer/10) |
381 else aangle:= aangle+((240-aangle)*HH^.Timer/10); |
382 else aangle:= aangle+((240-aangle)*HH^.Timer/10); |
382 dec(HH^.Timer) |
383 dec(HH^.Timer) |
383 end; |
384 end; |
384 amt:= CurrentHedgehog^.Ammo^[CurrentHedgehog^.CurSlot, CurrentHedgehog^.CurAmmo].AmmoType; |
385 amt:= CurrentHedgehog^.CurAmmoType; |
|
386 CurWeapon:= GetAmmoEntry(HH^); |
385 case amt of |
387 case amt of |
386 amBazooka: DrawRotated(sprHandBazooka, hx, hy, hwSign(Gear^.dX), aangle); |
388 amBazooka: DrawRotated(sprHandBazooka, hx, hy, hwSign(Gear^.dX), aangle); |
387 amMortar: DrawRotated(sprHandMortar, hx, hy, hwSign(Gear^.dX), aangle); |
389 amMortar: DrawRotated(sprHandMortar, hx, hy, hwSign(Gear^.dX), aangle); |
388 amMolotov: DrawRotated(sprHandMolotov, hx, hy, hwSign(Gear^.dX), aangle); |
390 amMolotov: DrawRotated(sprHandMolotov, hx, hy, hwSign(Gear^.dX), aangle); |
389 amBallgun: DrawRotated(sprHandBallgun, hx, hy, hwSign(Gear^.dX), aangle); |
391 amBallgun: DrawRotated(sprHandBallgun, hx, hy, hwSign(Gear^.dX), aangle); |
390 amDrill: DrawRotated(sprHandDrill, hx, hy, hwSign(Gear^.dX), aangle); |
392 amDrill: DrawRotated(sprHandDrill, hx, hy, hwSign(Gear^.dX), aangle); |
391 amRope: DrawRotated(sprHandRope, hx, hy, hwSign(Gear^.dX), aangle); |
393 amRope: DrawRotated(sprHandRope, hx, hy, hwSign(Gear^.dX), aangle); |
392 amShotgun: DrawRotated(sprHandShotgun, hx, hy, hwSign(Gear^.dX), aangle); |
394 amShotgun: DrawRotated(sprHandShotgun, hx, hy, hwSign(Gear^.dX), aangle); |
393 amDEagle: DrawRotated(sprHandDEagle, hx, hy, hwSign(Gear^.dX), aangle); |
395 amDEagle: DrawRotated(sprHandDEagle, hx, hy, hwSign(Gear^.dX), aangle); |
394 amSineGun: DrawRotated(sprHandShotgun, hx, hy, hwSign(Gear^.dX), aangle); |
396 amSineGun: DrawRotated(sprHandShotgun, hx, hy, hwSign(Gear^.dX), aangle); |
395 amPortalGun: if (HH^.Ammo^[HH^.CurSlot, HH^.CurAmmo].Timer and 2) <> 0 then // Add a new Hedgehog value instead of abusing timer? |
397 amPortalGun: if (CurWeapon^.Timer and 2) <> 0 then // Add a new Hedgehog value instead of abusing timer? |
396 DrawRotatedF(sprPortalGun, hx, hy, 0, hwSign(Gear^.dX), aangle) |
398 DrawRotatedF(sprPortalGun, hx, hy, 0, hwSign(Gear^.dX), aangle) |
397 else |
399 else |
398 DrawRotatedF(sprPortalGun, hx, hy, 1+(HH^.Ammo^[HH^.CurSlot, HH^.CurAmmo].Timer and 1), hwSign(Gear^.dX), aangle); |
400 DrawRotatedF(sprPortalGun, hx, hy, 1+(CurWeapon^.Timer and 1), hwSign(Gear^.dX), aangle); |
399 amSniperRifle: DrawRotatedF(sprSniperRifle, hx, hy, 0, hwSign(Gear^.dX), aangle); |
401 amSniperRifle: DrawRotatedF(sprSniperRifle, hx, hy, 0, hwSign(Gear^.dX), aangle); |
400 amBlowTorch: DrawRotated(sprHandBlowTorch, hx, hy, hwSign(Gear^.dX), aangle); |
402 amBlowTorch: DrawRotated(sprHandBlowTorch, hx, hy, hwSign(Gear^.dX), aangle); |
401 amCake: DrawRotated(sprHandCake, hx, hy, hwSign(Gear^.dX), aangle); |
403 amCake: DrawRotated(sprHandCake, hx, hy, hwSign(Gear^.dX), aangle); |
402 amGrenade: DrawRotated(sprHandGrenade, hx, hy, hwSign(Gear^.dX), aangle); |
404 amGrenade: DrawRotated(sprHandGrenade, hx, hy, hwSign(Gear^.dX), aangle); |
403 amWatermelon: DrawRotated(sprHandMelon, hx, hy, hwSign(Gear^.dX), aangle); |
405 amWatermelon: DrawRotated(sprHandMelon, hx, hy, hwSign(Gear^.dX), aangle); |