Mortar sprite
authorunc0rr
Wed, 28 May 2008 18:54:45 +0000
changeset 959 18b05fc2d0a6
parent 958 92bb9fa046f9
child 960 e9200bdeaccc
Mortar sprite
hedgewars/uConsts.pas
hedgewars/uGears.pas
share/hedgewars/Data/Graphics/Mortar.png
--- a/hedgewars/uConsts.pas	Wed May 28 18:40:42 2008 +0000
+++ b/hedgewars/uConsts.pas	Wed May 28 18:54:45 2008 +0000
@@ -44,7 +44,7 @@
                    sprFlake, sprHandRope, sprHandBazooka, sprHandShotgun,
                    sprHandDEagle, sprHandAirAttack, sprHandBaseball, sprPHammer,
                    sprHandBlowTorch, sprBlowTorch, sprTeleport, sprHHDeath,
-                   sprShotgun, sprDEagle, sprHHIdle);
+                   sprShotgun, sprDEagle, sprHHIdle, sprMortar);
 
      TGearType  = (gtAmmo_Bomb, gtHedgehog, gtAmmo_Grenade, gtHealthTag,
                    gtGrave, gtUFO, gtShotgunShot, gtPickHammer, gtRope,
@@ -385,7 +385,9 @@
                      (FileName: 'amDEagle_w'; Path: ptHedgehog; AltPath: ptNone; Texture: nil; Surface: nil;
                       Width:  64; Height: 64; saveSurf: false),// sprDEagle
                      (FileName:       'Idle'; Path: ptHedgehog; AltPath: ptNone; Texture: nil; Surface: nil;
-                      Width:  32; Height: 32; saveSurf: false) // sprHHIdle
+                      Width:  32; Height: 32; saveSurf: false),// sprHHIdle
+                     (FileName:     'Mortar'; Path: ptGraphics; AltPath: ptNone; Texture: nil; Surface: nil;
+                      Width:  16; Height: 16; saveSurf: false) // sprMortar
                      );
 
       Soundz: array[TSound] of record
--- a/hedgewars/uGears.pas	Wed May 28 18:40:42 2008 +0000
+++ b/hedgewars/uGears.pas	Wed May 28 18:54:45 2008 +0000
@@ -605,7 +605,8 @@
 	begin
 		amt:= CurrentHedgehog^.Ammo^[CurrentHedgehog^.CurSlot, CurrentHedgehog^.CurAmmo].AmmoType;
 		case amt of
-			amBazooka: DrawRotated(sprHandBazooka, hx, hy, hwSign(Gear^.dX), aangle);
+			amBazooka,
+			amMortar: DrawRotated(sprHandBazooka, hx, hy, hwSign(Gear^.dX), aangle);
 			amRope: DrawRotated(sprHandRope, hx, hy, hwSign(Gear^.dX), aangle);
 			amShotgun: DrawRotated(sprHandShotgun, hx, hy, hwSign(Gear^.dX), aangle);
 			amDEagle: DrawRotated(sprHandDEagle, hx, hy, hwSign(Gear^.dX), aangle);
@@ -821,6 +822,7 @@
                     end;
         gtSwitcher: DrawSprite(sprSwitch, hwRound(Gear^.X) - 16 + WorldDx, hwRound(Gear^.Y) - 56 + WorldDy, (GameTicks shr 6) mod 12);
           gtTarget: DrawSprite(sprTarget, hwRound(Gear^.X) - 16 + WorldDx, hwRound(Gear^.Y) - 16 + WorldDy, 0);
+          gtMortar: DrawRotated(sprMortar, hwRound(Gear^.X) + WorldDx, hwRound(Gear^.Y) + WorldDy, 0, DxDy2Angle(Gear^.dY, Gear^.dX));
               end;
       Gear:= Gear^.NextGear
       end;
@@ -989,7 +991,7 @@
 							if (Gear <> nil) and (Gear^.X.QWordValue = 0) then
 								begin
 								FindPlace(Gear, false, t, t + 1024);
-								Gear^.Pos:= GetRandom(19);
+								Gear^.Pos:= GetRandom(19)
 								end;
 		inc(t, 1024)
 		end
@@ -1012,6 +1014,7 @@
 		begin
 		i:= GetRandom(Count);
 		FindPlace(ar[i], false, 0, 2048);
+		ar[i]^.Pos:= GetRandom(19);
 		ar[i]:= ar[Count - 1];
 		dec(Count)
 		end
Binary file share/hedgewars/Data/Graphics/Mortar.png has changed