An animation requested by Tiy. Needs testing.
--- a/hedgewars/HHHandlers.inc Sun Mar 14 20:22:00 2010 +0000
+++ b/hedgewars/HHHandlers.inc Sun Mar 14 20:23:11 2010 +0000
@@ -395,6 +395,7 @@
if not cArtillery then Gear^.dX:= SignAs(_0_15, Gear^.dX);
Gear^.State:= Gear^.State or gstMoving or gstHHJumping;
PlaySound(sndJump1, PHedgehog(Gear^.Hedgehog)^.Team^.voicepack);
+ Gear^.Timer:= 10;
exit
end;
end;
@@ -408,6 +409,7 @@
SetLittle(Gear^.dX);
Gear^.State:= Gear^.State or gstMoving or gstHHJumping;
PlaySound(sndJump3, PHedgehog(Gear^.Hedgehog)^.Team^.voicepack);
+ Gear^.Timer:= 10;
exit
end;
--- a/hedgewars/uAmmos.pas Sun Mar 14 20:22:00 2010 +0000
+++ b/hedgewars/uAmmos.pas Sun Mar 14 20:23:11 2010 +0000
@@ -287,6 +287,7 @@
with Hedgehog do
begin
+ Gear^.Timer:= 10;
if (Ammo^[CurSlot, CurAmmo].Count = 0) then
SwitchToFirstLegalAmmo(Hedgehog);
--- a/hedgewars/uGears.pas Sun Mar 14 20:22:00 2010 +0000
+++ b/hedgewars/uGears.pas Sun Mar 14 20:23:11 2010 +0000
@@ -589,11 +589,12 @@
step: (stDelay, stChDmg, stSweep, stTurnReact,
stAfterDelay, stChWin, stWater, stChWin2, stHealth,
stSpawn, stNTurn) = stDelay;
-
+var StoppedSteps: boolean;
var Gear, t: PGear;
begin
PrvInactive:= AllInactive;
AllInactive:= true;
+StoppedSteps:= false;
if (StepSoundTimer > 0) and (StepSoundChannel < 0) then
StepSoundChannel:= LoopSound(sndSteps)
@@ -601,6 +602,7 @@
begin
StopSound(StepSoundChannel);
StepSoundChannel:= -1;
+ StoppedSteps:= true
end;
if StepSoundTimer > 0 then
@@ -611,6 +613,7 @@
begin
Gear:= t;
t:= Gear^.NextGear;
+ if (Gear = CurrentHedgehog^.Gear) and (StoppedSteps) then Gear^.Timer:= 10;
if Gear^.Active then
begin
if Gear^.RenderTimer and (Gear^.Timer > 500) and ((Gear^.Timer mod 1000) = 0) then
@@ -1181,10 +1184,17 @@
end
else
if ((Gear^.State and gstAttacked) = 0) then
- begin
+ begin
+ if Gear^.Timer > 0 then
+ begin
+ // There must be a tidier way to do this. Anyone?
+ if aangle <= 90 then aangle:= aangle+360;
+ if Gear^.dX > _0 then aangle:= aangle-((aangle-240)*Gear^.Timer/10)
+ else aangle:= aangle+((240-aangle)*Gear^.Timer/10);
+ dec(Gear^.Timer)
+ end;
amt:= CurrentHedgehog^.Ammo^[CurrentHedgehog^.CurSlot, CurrentHedgehog^.CurAmmo].AmmoType;
case amt of
-//, sprHandCake, sprHandConstruction, sprHandGrenade, sprHandMelon, sprHandMortar, sprHandSkip, sprHandCluster, sprHandDynamite, sprHandHellish, sprHandMine, sprHandSeduction, sprHandVamp
amBazooka: DrawRotated(sprHandBazooka, hx, hy, hwSign(Gear^.dX), aangle);
amMortar: DrawRotated(sprHandMortar, hx, hy, hwSign(Gear^.dX), aangle);
amMolotov: DrawRotated(sprHandMolotov, hx, hy, hwSign(Gear^.dX), aangle);