# HG changeset patch # User unc0rr # Date 1206481836 0 # Node ID e632cc7caf3aeb3d0ef9d68101272e77ba8f0678 # Parent 90d651e755473c09b659dc384833011d56791373 - Use hedgehog jumping sprite - Fix invisible hedgehog state bug diff -r 90d651e75547 -r e632cc7caf3a hedgewars/uGears.pas --- a/hedgewars/uGears.pas Tue Mar 25 16:07:23 2008 +0000 +++ b/hedgewars/uGears.pas Tue Mar 25 21:50:36 2008 +0000 @@ -474,24 +474,42 @@ amt: TAmmoType; hx, hy: LongInt; aangle: real; + defaultPos: boolean; begin +defaultPos:= true; if (Gear^.State and gstHHDriven) <> 0 then begin if CurAmmoGear <> nil then begin if (CurAmmoGear^.Kind = gtRope) then - DrawHedgehog(hwRound(Gear^.X) + WorldDx, hwRound(Gear^.Y) + WorldDy, - 1, - 1, - 0, - DxDy2Angle(CurAmmoGear^.dY, CurAmmoGear^.dX) - 110); + begin + DrawHedgehog(hwRound(Gear^.X) + WorldDx, hwRound(Gear^.Y) + WorldDy, + 1, + 1, + 0, + DxDy2Angle(CurAmmoGear^.dY, CurAmmoGear^.dX) - 110); + defaultPos:= false + end end else - if (Gear^.Message and (gm_Left or gm_Right) <> 0) then + if ((Gear^.State and gstHHJumping) <> 0) then + begin + DrawHedgehog(hwRound(Gear^.X) + 1 + WorldDx, hwRound(Gear^.Y) - 3 + WorldDy, + hwSign(Gear^.dX), + 1, + 1, + 0); + defaultPos:= false + end else + if (Gear^.Message and (gm_Left or gm_Right) <> 0) + or ((Gear^.State and gstAttacked) <> 0) then + begin DrawHedgehog(hwRound(Gear^.X) + 1 + WorldDx, hwRound(Gear^.Y) - 3 + WorldDy, hwSign(Gear^.dX), 0, PHedgehog(Gear^.Hedgehog)^.visStepPos div 2, - 0) + 0); + defaultPos:= false + end else begin amt:= CurrentHedgehog^.Ammo^[CurrentHedgehog^.CurSlot, CurrentHedgehog^.CurAmmo].AmmoType; @@ -509,20 +527,26 @@ amBazooka, amRope, amShotgun, - amDEagle: DrawHedgehog(hwRound(Gear^.X) + 1 + WorldDx, hwRound(Gear^.Y) - 3 + WorldDy, - hwSign(Gear^.dX), - 0, - 4, - 0); + amDEagle: begin + DrawHedgehog(hwRound(Gear^.X) + 1 + WorldDx, hwRound(Gear^.Y) - 3 + WorldDy, + hwSign(Gear^.dX), + 0, + 4, + 0); + defaultPos:= false + end else DrawHedgehog(hwRound(Gear^.X) + 1 + WorldDx, hwRound(Gear^.Y) - 3 + WorldDy, hwSign(Gear^.dX), 0, 3, 0); + defaultPos:= false end end -end else +end; + +if defaultPos then DrawHedgehog(hwRound(Gear^.X) + 1 + WorldDx, hwRound(Gear^.Y) - 3 + WorldDy, hwSign(Gear^.dX), 0, diff -r 90d651e75547 -r e632cc7caf3a share/hedgewars/Data/Graphics/Hedgehog.png Binary file share/hedgewars/Data/Graphics/Hedgehog.png has changed