42 Pos: Longword; |
42 Pos: Longword; |
43 doStep: TGearStepProcedure; |
43 doStep: TGearStepProcedure; |
44 Radius: LongInt; |
44 Radius: LongInt; |
45 Angle, Power : Longword; |
45 Angle, Power : Longword; |
46 DirAngle: real; |
46 DirAngle: real; |
47 Timer, Timer2 : LongWord; |
47 Timer : LongWord; |
48 Elasticity: hwFloat; |
48 Elasticity: hwFloat; |
49 Friction : hwFloat; |
49 Friction : hwFloat; |
50 Message, MsgParam : Longword; |
50 Message, MsgParam : Longword; |
51 Hedgehog: pointer; |
51 Hedgehog: pointer; |
52 Health, Damage, Karma: LongInt; |
52 Health, Damage, Karma: LongInt; |
877 amt: TAmmoType; |
877 amt: TAmmoType; |
878 hx, hy, cx, cy, tx, ty, sx, sy, m: LongInt; // hedgehog, crosshair, temp, sprite, direction |
878 hx, hy, cx, cy, tx, ty, sx, sy, m: LongInt; // hedgehog, crosshair, temp, sprite, direction |
879 lx, ly, dx, dy, ax, ay, aAngle, dAngle, hAngle: real; // laser, change |
879 lx, ly, dx, dy, ax, ay, aAngle, dAngle, hAngle: real; // laser, change |
880 defaultPos, HatVisible: boolean; |
880 defaultPos, HatVisible: boolean; |
881 VertexBuffer: array [0..1] of TVertex2f; |
881 VertexBuffer: array [0..1] of TVertex2f; |
882 begin |
882 HH: PHedgehog; |
883 |
883 begin |
884 if PHedgehog(Gear^.Hedgehog)^.Unplaced then exit; |
884 HH:= PHedgehog(Gear^.Hedgehog); |
|
885 if HH^.Unplaced then exit; |
885 m:= 1; |
886 m:= 1; |
886 if ((Gear^.State and gstHHHJump) <> 0) and not cArtillery then m:= -1; |
887 if ((Gear^.State and gstHHHJump) <> 0) and not cArtillery then m:= -1; |
887 if (Gear^.State and gstHHDeath) <> 0 then |
888 if (Gear^.State and gstHHDeath) <> 0 then |
888 begin |
889 begin |
889 DrawSprite(sprHHDeath, hwRound(Gear^.X) - 16 + WorldDx, hwRound(Gear^.Y) - 26 + WorldDy, Gear^.Pos); |
890 DrawSprite(sprHHDeath, hwRound(Gear^.X) - 16 + WorldDx, hwRound(Gear^.Y) - 26 + WorldDy, Gear^.Pos); |
990 end; |
991 end; |
991 end; |
992 end; |
992 // draw crosshair |
993 // draw crosshair |
993 cx:= Round(hwRound(Gear^.X) + dx * 80); |
994 cx:= Round(hwRound(Gear^.X) + dx * 80); |
994 cy:= Round(hwRound(Gear^.Y) + dy * 80); |
995 cy:= Round(hwRound(Gear^.Y) + dy * 80); |
995 DrawRotatedTex(PHedgehog(Gear^.Hedgehog)^.Team^.CrosshairTex, |
996 DrawRotatedTex(HH^.Team^.CrosshairTex, |
996 12, 12, cx + WorldDx, cy + WorldDy, 0, |
997 12, 12, cx + WorldDx, cy + WorldDy, 0, |
997 hwSign(Gear^.dX) * (Gear^.Angle * 180.0) / cMaxAngle); |
998 hwSign(Gear^.dX) * (Gear^.Angle * 180.0) / cMaxAngle); |
998 end; |
999 end; |
999 hx:= hwRound(Gear^.X) + 1 + 8 * hwSign(Gear^.dX) + WorldDx; |
1000 hx:= hwRound(Gear^.X) + 1 + 8 * hwSign(Gear^.dX) + WorldDx; |
1000 hy:= hwRound(Gear^.Y) - 2 + WorldDy; |
1001 hy:= hwRound(Gear^.Y) - 2 + WorldDy; |
1040 DrawHedgehog(sx, sy, |
1041 DrawHedgehog(sx, sy, |
1041 i, |
1042 i, |
1042 1, |
1043 1, |
1043 0, |
1044 0, |
1044 DxDy2Angle(CurAmmoGear^.dY, CurAmmoGear^.dX) + dAngle); |
1045 DxDy2Angle(CurAmmoGear^.dY, CurAmmoGear^.dX) + dAngle); |
1045 with PHedgehog(Gear^.Hedgehog)^ do |
1046 with HH^ do |
1046 if (HatTex <> nil) then |
1047 if (HatTex <> nil) then |
1047 DrawRotatedTextureF(HatTex, 1.0, -1.0, -6.0, sx, sy, 0, i, 32, 32, |
1048 DrawRotatedTextureF(HatTex, 1.0, -1.0, -6.0, sx, sy, 0, i, 32, 32, |
1048 i*DxDy2Angle(CurAmmoGear^.dY, CurAmmoGear^.dX) + hAngle); |
1049 i*DxDy2Angle(CurAmmoGear^.dY, CurAmmoGear^.dX) + hAngle); |
1049 end; |
1050 end; |
1050 DrawAltWeapon(Gear, sx, sy); |
1051 DrawAltWeapon(Gear, sx, sy); |
1053 gtBlowTorch: begin |
1054 gtBlowTorch: begin |
1054 DrawRotated(sprBlowTorch, hx, hy, hwSign(Gear^.dX), aangle); |
1055 DrawRotated(sprBlowTorch, hx, hy, hwSign(Gear^.dX), aangle); |
1055 DrawHedgehog(sx, sy, |
1056 DrawHedgehog(sx, sy, |
1056 hwSign(Gear^.dX), |
1057 hwSign(Gear^.dX), |
1057 3, |
1058 3, |
1058 PHedgehog(Gear^.Hedgehog)^.visStepPos div 2, |
1059 HH^.visStepPos div 2, |
1059 0); |
1060 0); |
1060 with PHedgehog(Gear^.Hedgehog)^ do |
1061 with HH^ do |
1061 if (HatTex <> nil) then |
1062 if (HatTex <> nil) then |
1062 DrawTextureF(HatTex, |
1063 DrawTextureF(HatTex, |
1063 1, |
1064 1, |
1064 sx, |
1065 sx, |
1065 hwRound(Gear^.Y) - 8 + WorldDy, |
1066 hwRound(Gear^.Y) - 8 + WorldDy, |
1179 defaultPos:= false |
1180 defaultPos:= false |
1180 end |
1181 end |
1181 else |
1182 else |
1182 if ((Gear^.State and gstAttacked) = 0) then |
1183 if ((Gear^.State and gstAttacked) = 0) then |
1183 begin |
1184 begin |
1184 if Gear^.Timer2 > 0 then |
1185 if HH^.Timer > 0 then |
1185 begin |
1186 begin |
1186 // There must be a tidier way to do this. Anyone? |
1187 // There must be a tidier way to do this. Anyone? |
1187 if aangle <= 90 then aangle:= aangle+360; |
1188 if aangle <= 90 then aangle:= aangle+360; |
1188 if Gear^.dX > _0 then aangle:= aangle-((aangle-240)*Gear^.Timer2/10) |
1189 if Gear^.dX > _0 then aangle:= aangle-((aangle-240)*HH^.Timer/10) |
1189 else aangle:= aangle+((240-aangle)*Gear^.Timer2/10); |
1190 else aangle:= aangle+((240-aangle)*HH^.Timer/10); |
1190 dec(Gear^.Timer2) |
1191 dec(HH^.Timer) |
1191 end; |
1192 end; |
1192 amt:= CurrentHedgehog^.Ammo^[CurrentHedgehog^.CurSlot, CurrentHedgehog^.CurAmmo].AmmoType; |
1193 amt:= CurrentHedgehog^.Ammo^[CurrentHedgehog^.CurSlot, CurrentHedgehog^.CurAmmo].AmmoType; |
1193 case amt of |
1194 case amt of |
1194 amBazooka: DrawRotated(sprHandBazooka, hx, hy, hwSign(Gear^.dX), aangle); |
1195 amBazooka: DrawRotated(sprHandBazooka, hx, hy, hwSign(Gear^.dX), aangle); |
1195 amMortar: DrawRotated(sprHandMortar, hx, hy, hwSign(Gear^.dX), aangle); |
1196 amMortar: DrawRotated(sprHandMortar, hx, hy, hwSign(Gear^.dX), aangle); |