Parachute
authorunc0rr
Sat, 28 Oct 2006 12:56:04 +0000
changeset 211 558476056205
parent 210 440575778475
child 212 c8c650b23e32
Parachute
hedgewars/GSHandlers.inc
hedgewars/HHHandlers.inc
hedgewars/uAIAmmoTests.pas
hedgewars/uConsts.pas
hedgewars/uGears.pas
hedgewars/uLocale.pas
share/hedgewars/Data/Graphics/AmmoMenu/Ammos.png
share/hedgewars/Data/Locale/en.txt
share/hedgewars/Data/Locale/ru.txt
--- a/hedgewars/GSHandlers.inc	Fri Oct 27 22:14:02 2006 +0000
+++ b/hedgewars/GSHandlers.inc	Sat Oct 28 12:56:04 2006 +0000
@@ -876,4 +876,37 @@
 DrawTunnel(HHGear.X - cHHRadius, HHGear.Y + 1, 0.5, 0.0, cHHRadius * 4, 5);
 end;
 
+procedure doStepParachute(Gear: PGear);
+var HHGear: PGear;
+begin
+HHGear:= PHedgehog(Gear.Hedgehog).Gear;
 
+if TestCollisionYwithGear(HHGear, 1) or ((HHGear.State and gstHHDriven) = 0) then
+   begin
+   with HHGear^ do
+        begin
+        Message:= 0;
+        dx:= 0.0000001 * hwSign(dX);
+        dY:= 0;
+        State:= State and not (gstAttacking or gstAttacked);
+        State:= State or gstFalling;
+        end;
+   DeleteGear(Gear);
+   OnUsedAmmo(PHedgehog(HHGear.Hedgehog)^.Ammo);
+   ApplyAmmoChanges(PHedgehog(HHGear.Hedgehog)^);
+   exit
+   end;
+
+if not TestCollisionXwithGear(HHGear, hwSign(HHGear.dX)) then
+   HHGear.X:= HHGear.X + cWindSpeed * 200;
+
+if (Gear.Message and gm_Left) <> 0 then HHGear.X:= HHGear.X - cMaxWindSpeed * 40
+else if (Gear.Message and gm_Right) <> 0 then HHGear.X:= HHGear.X + cMaxWindSpeed * 40;
+if (Gear.Message and gm_Up) <> 0 then HHGear.Y:= HHGear.Y - cGravity * 40
+else if (Gear.Message and gm_Down) <> 0 then HHGear.Y:= HHGear.Y + cGravity * 40;
+
+HHGear.Y:= HHGear.Y + cGravity * 100;
+
+end;
+
+
--- a/hedgewars/HHHandlers.inc	Fri Oct 27 22:14:02 2006 +0000
+++ b/hedgewars/HHHandlers.inc	Sat Oct 28 12:56:04 2006 +0000
@@ -67,6 +67,7 @@
                      amDynamite: AddGear(round(X) + hwSign(dX) * 7, round(Y), gtDynamite, 0, hwSign(dX) * 0.035, 0, 5000);
                   amBaseballBat: AddGear(round(X) + hwSign(dX) * 10, round(Y), gtShover, 0, xx * 0.5, yy * 0.5).Radius:= 20;
                     amFirePunch: CurAmmoGear:= AddGear(round(X) + hwSign(dX) * 10, round(Y), gtFirePunch, 0);
+                    amParachute: CurAmmoGear:= AddGear(round(X), round(Y), gtParachute, 0)
                   end;
         Power:= 0;
         if CurAmmoGear <> nil then
--- a/hedgewars/uAIAmmoTests.pas	Fri Oct 27 22:14:02 2006 +0000
+++ b/hedgewars/uAIAmmoTests.pas	Sat Oct 28 12:56:04 2006 +0000
@@ -42,7 +42,8 @@
 {amDEagle}        TestDesertEagle,
 {amDynamite}      nil,
 {amFirePunch}     TestFirePunch,
-{amBaseballBat}   TestBaseballBat
+{amBaseballBat}   TestBaseballBat,
+{amParachute}     nil
                   );
 
 const BadTurn = Low(integer);
--- a/hedgewars/uConsts.pas	Fri Oct 27 22:14:02 2006 +0000
+++ b/hedgewars/uConsts.pas	Sat Oct 28 12:56:04 2006 +0000
@@ -38,13 +38,14 @@
                    gtGrave, gtUFO, gtShotgunShot, gtPickHammer, gtRope,
                    gtSmokeTrace, gtExplosion, gtMine, gtCase, gtDEagleShot, gtDynamite,
                    gtTeamHealthSorter, gtClusterBomb, gtCluster, gtShover, gtFlame,
-                   gtFirePunch, gtATStartGame, gtATSmoothWindCh, gtATFinishGame);
+                   gtFirePunch, gtATStartGame, gtATSmoothWindCh, gtATFinishGame,
+                   gtParachute);
      TGearsType = set of TGearType;
      TSound     = (sndGrenadeImpact, sndExplosion, sndThrowPowerUp, sndThrowRelease, sndSplash,
                    sndShotgunReload, sndShotgunFire, sndGraveImpact, sndMineTick);
      TAmmoType  = (amGrenade, amClusterBomb, amBazooka, amUFO, amShotgun, amPickHammer,
                    amSkip, amRope, amMine, amDEagle, amDynamite, amFirePunch,
-                   amBaseballBat);
+                   amBaseballBat, amParachute);
      THWFont    = (fnt16, fntBig);
      TCapGroup  = (capgrpGameState, capgrpAmmoinfo, capgrpNetSay, capgrpVolume);
      THHFont    = record
@@ -375,7 +376,15 @@
                                            Timer: 0;
                                            AmmoType: amBaseballBat);
                                     Slot: 3;
-                                    TimeAfterTurn: 5000));
+                                    TimeAfterTurn: 5000),
+                                  (NameId: sidParachute;
+                                   Ammo: (Propz: ammoprop_ForwMsgs or ammoprop_AttackInJump or ammoprop_AttackInFall;
+                                          Count: 2;
+                                          NumPerTurn: 0;
+                                          Timer: 0;
+                                          AmmoType: amParachute);
+                                   Slot: 6;
+                                   TimeAfterTurn: 0));
 
 implementation
 
--- a/hedgewars/uGears.pas	Fri Oct 27 22:14:02 2006 +0000
+++ b/hedgewars/uGears.pas	Sat Oct 28 12:56:04 2006 +0000
@@ -111,7 +111,8 @@
                                                                doStepFirePunch,
                                                                doStepActionTimer,
                                                                doStepActionTimer,
-                                                               doStepActionTimer
+                                                               doStepActionTimer,
+                                                               doStepParachute
                                                                );
 
 function AddGear(X, Y: integer; Kind: TGearType; State: Longword; const dX: Double=0.0; dY: Double=0.0; Timer: LongWord=0): PGear;
--- a/hedgewars/uLocale.pas	Fri Oct 27 22:14:02 2006 +0000
+++ b/hedgewars/uLocale.pas	Sat Oct 28 12:56:04 2006 +0000
@@ -20,7 +20,8 @@
 interface
 type TAmmoStrId = (sidGrenade, sidClusterBomb, sidBazooka, sidUFO, sidShotgun,
                    sidPickHammer, sidSkip, sidRope, sidMine, sidDEagle,
-                   sidDynamite, sidBaseballBat, sidFirePunch, sidSeconds);
+                   sidDynamite, sidBaseballBat, sidFirePunch, sidSeconds,
+                   sidParachute);
      TMsgStrId = (sidStartFight, sidDraw, sidWinner, sidVolume);
 var trammo: array[TAmmoStrId] of string;
     trmsg: array[TMsgStrId] of string;
Binary file share/hedgewars/Data/Graphics/AmmoMenu/Ammos.png has changed
--- a/share/hedgewars/Data/Locale/en.txt	Fri Oct 27 22:14:02 2006 +0000
+++ b/share/hedgewars/Data/Locale/en.txt	Sat Oct 28 12:56:04 2006 +0000
@@ -14,6 +14,7 @@
 00:11=BaseballBat
 00:12=Fire Punch
 00:13=sec
+00:14=Parachute
 
 01:00=Let's fight!
 01:01=Round draw
--- a/share/hedgewars/Data/Locale/ru.txt	Fri Oct 27 22:14:02 2006 +0000
+++ b/share/hedgewars/Data/Locale/ru.txt	Sat Oct 28 12:56:04 2006 +0000
@@ -14,6 +14,7 @@
 00:11=Бейсбольная бита
 00:12=Огненный удар
 00:13=сек
+00:14=Парашют
 
 01:00=Вперёд к победе!
 01:01=Ничья