# HG changeset patch
# User nemo
# Date 1245598269 0
# Node ID c045698e044f0e0334d176a783365386cad5b666
# Parent  fc082baf448ceee2573f695b5f3cf7e1c1939f64
Initial attempt at jetpack.  Pluses, more like lunar lander (takes fall damage).  Minuses, can't seem to cancel it or use alt weapon

diff -r fc082baf448c -r c045698e044f QTfrontend/hwconsts.cpp.in
--- a/QTfrontend/hwconsts.cpp.in	Sat Jun 20 07:50:03 2009 +0000
+++ b/QTfrontend/hwconsts.cpp.in	Sun Jun 21 15:31:09 2009 +0000
@@ -29,15 +29,15 @@
 QStringList * Themes;
 QStringList * mapList;
 
-QString * cDefaultAmmoStore = new QString("93919294221991210322351110012010000002");
+QString * cDefaultAmmoStore = new QString("939192942219912103223511100120100000021");
 QList< QPair<QString, QString> > cDefaultAmmos =
 	QList< QPair<QString, QString> >()
 	<< qMakePair(QString("Default"), *cDefaultAmmoStore)
-	<< qMakePair(QString("Crazy"),     QString("99999999999999999929999999999999992999"))
-	<< qMakePair(QString("Pro mode"),  QString("90900090000000000000090000000000000000"))
-	<< qMakePair(QString("Shoppa"),    QString("00000099000000000000000000000000000000"))
-	<< qMakePair(QString("Basketball"),QString("00000090000009000000000000000000000000"))
-	<< qMakePair(QString("Minefield"),QString("00000099000900000003000000000000000000"))
+	<< qMakePair(QString("Crazy"),     QString("999999999999999999299999999999999929999"))
+	<< qMakePair(QString("Pro mode"),  QString("909000900000000000000900000000000000000"))
+	<< qMakePair(QString("Shoppa"),    QString("000000990000000000000000000000000000000"))
+	<< qMakePair(QString("Basketball"),QString("000000900000090000000000000000000000000"))
+	<< qMakePair(QString("Minefield"),QString("000000990009000000030000000000000000000"))
 	;
 
 QColor * color1 = new QColor(221,   0,   0);
diff -r fc082baf448c -r c045698e044f hedgewars/GSHandlers.inc
--- a/hedgewars/GSHandlers.inc	Sat Jun 20 07:50:03 2009 +0000
+++ b/hedgewars/GSHandlers.inc	Sun Jun 21 15:31:09 2009 +0000
@@ -2183,3 +2183,68 @@
 if HHGear^.dX.isNegative then Gear^.Angle:= 4096 - Gear^.Angle;
 Gear^.doStep:= @doStepRCPlaneWork
 end;
+
+procedure doStepJetpackWork(Gear: PGear);
+var HHGear: PGear;
+    fuel: LongInt;
+    move: hwFloat;
+begin
+AllInactive:= false;
+HHGear:=PHedgehog(Gear^.Hedgehog)^.Gear;
+//dec(Gear^.Timer);
+move:= _0_2;
+fuel:= 50;
+if (HHGear^.Message and gm_Precise) <> 0 then
+    begin
+    move:= _0_02;
+    fuel:= 5;
+    end;
+if (HHGear^.Message and gm_Left) <> 0 then move.isNegative:= true;
+
+if (HHGear^.Message and gm_Up) <> 0 then
+    begin
+    HHGear^.dY:= HHGear^.dY - move;
+    dec(Gear^.Health, fuel)
+    end;
+if (HHGear^.Message and (gm_Left or gm_Right)) <> 0 then
+    begin
+    HHGear^.dX:= HHGear^.dX + (move * _0_2);
+    dec(Gear^.Health, fuel div 5)
+    end;
+if Gear^.Health < 0 then Gear^.Health:= 0;
+if (GameTicks and $3F) = 0 then AddCaption('Fuel: '+inttostr(round(Gear^.Health/20))+'%', $FFFFFF, capgrpMessage);
+
+//AddCaption(inttostr(round(Gear^.Health/20))+'% : '+inttostr(round(Gear^.Timer/1000)), $FFFFFF, capgrpMessage);
+
+HHGear^.Message:= HHGear^.Message and not (gm_Up or gm_Precise or gm_Left or gm_Right);
+HHGear^.State:= HHGear^.State and gstMoving and (not gstNotKickable); 
+
+Gear^.X:= HHGear^.X;
+Gear^.Y:= HHGear^.Y;
+doStepHedgehogMoving(HHGear);
+
+if //(Gear^.Timer = 0) or
+   (Gear^.Health = 0) or 
+   ((HHGear^.Message and gm_Attack) <> 0) or
+   (HHGear^.Damage <> 0) then
+	begin
+	HHGear^.Message:= 0;
+	DeleteGear(Gear);
+	AfterAttack;
+    HHGear^.Active:= true;
+	end
+end;
+
+procedure doStepJetpack(Gear: PGear);
+var HHGear: PGear;
+begin
+Gear^.doStep:= @doStepJetpackWork;
+
+HHGear:= PHedgehog(Gear^.Hedgehog)^.Gear;
+FollowGear:= HHGear;
+with HHGear^ do
+	begin
+	State:= State and not gstAttacking;
+	Message:= Message and not gm_Attack
+	end
+end;
diff -r fc082baf448c -r c045698e044f hedgewars/HHHandlers.inc
--- a/hedgewars/HHHandlers.inc	Sat Jun 20 07:50:03 2009 +0000
+++ b/hedgewars/HHHandlers.inc	Sun Jun 21 15:31:09 2009 +0000
@@ -186,7 +186,8 @@
                   amHellishBomb: FollowGear:= AddGear(hwRound(X), hwRound(Y), gtHellishBomb,    0, xx*Power/cPowerDivisor, yy*Power/cPowerDivisor, 5000);
                        amNapalm: AddGear(Ammo^[CurSlot, CurAmmo].Pos, 0, gtAirAttack, 2, _0, _0, 0);
                         amDrill: FollowGear:= AddGear(hwRound(X), hwRound(Y), gtDrill, 0, xx*Power/cPowerDivisor, yy*Power/cPowerDivisor, 0);
-                        amBallgun: CurAmmoGear:= AddGear(hwRound(X), hwRound(Y), gtBallgun,  0, xx * _0_5, yy * _0_5, 0);
+                      amBallgun: CurAmmoGear:= AddGear(hwRound(X), hwRound(Y), gtBallgun,  0, xx * _0_5, yy * _0_5, 0);
+                    amJetpack: CurAmmoGear:= AddGear(hwRound(X), hwRound(Y), gtJetpack, 0, _0, _0, 0);
                       amLowGravity: cGravity:= cMaxWindSpeed / 2;
                       amExtraDamage: cDamageModifier:= _1_5;
                       amInvulnerable: Invulnerable:= true;
diff -r fc082baf448c -r c045698e044f hedgewars/uAIAmmoTests.pas
--- a/hedgewars/uAIAmmoTests.pas	Sat Jun 20 07:50:03 2009 +0000
+++ b/hedgewars/uAIAmmoTests.pas	Sun Jun 21 15:31:09 2009 +0000
@@ -82,7 +82,8 @@
 			(proc: nil;              flags: 0), // amExtraTime
 			(proc: nil;              flags: 0), // amLaserSight
 			(proc: nil;              flags: 0), // amVampiric
-			(proc: nil;              flags: 0)  // amSniperRifle
+			(proc: nil;              flags: 0), // amSniperRifle
+			(proc: nil;              flags: 0)  // amJetpack
 			);
 
 const BadTurn = Low(LongInt) div 4;
diff -r fc082baf448c -r c045698e044f hedgewars/uConsts.pas
--- a/hedgewars/uConsts.pas	Sat Jun 20 07:50:03 2009 +0000
+++ b/hedgewars/uConsts.pas	Sun Jun 21 15:31:09 2009 +0000
@@ -74,7 +74,7 @@
 			gtTeleport, gtSwitcher, gtTarget, gtMortar, // 31
 			gtWhip, gtKamikaze, gtCake, gtSeduction, gtWatermelon, gtMelonPiece, // 37
 			gtHellishBomb, gtEvilTrace, gtWaterUp, gtDrill, gtBallGun, gtBall,gtRCPlane,
-			gtSniperRifleShot);
+			gtSniperRifleShot, gtJetpack);
 
 	TVisualGearType = (vgtFlake, vgtCloud, vgtExplPart, vgtExplPart2, vgtFire,
 			vgtSmallDamageTag, vgtTeamHealthSorter, vgtSpeechBubble, vgtBubble,
@@ -100,7 +100,7 @@
 			amGirder, amTeleport, amSwitch, amMortar, amKamikaze, amCake,
 			amSeduction, amWatermelon, amHellishBomb, amNapalm, amDrill, amBallgun, 
             amRCPlane, amLowGravity, amExtraDamage, amInvulnerable, amExtraTime,
-            amLaserSight, amVampiric, amSniperRifle);
+            amLaserSight, amVampiric, amSniperRifle, amJetpack);
 
 	THWFont = (fnt16, fntBig, fntSmall);
 
@@ -465,9 +465,9 @@
 			(FileName:     'Hammer'; Path: ptGraphics; AltPath: ptNone; Texture: nil; Surface: nil;
 			Width:  32; Height: 64; saveSurf: false),// sprPHammer
 			(FileName: 'amBTorch_i'; Path: ptHedgehog; AltPath: ptNone; Texture: nil; Surface: nil;
-			Width:  32; Height: 32; saveSurf: false),// sprHandBlowToch
+			Width:  32; Height: 32; saveSurf: false),// sprHandBlowTorch
 			(FileName: 'amBTorch_w'; Path: ptHedgehog; AltPath: ptNone; Texture: nil; Surface: nil;
-			Width:  32; Height: 32; saveSurf: false),// sprBlowToch
+			Width:  32; Height: 32; saveSurf: false),// sprBlowTorch
 			(FileName:   'Teleport'; Path: ptGraphics; AltPath: ptNone; Texture: nil; Surface: nil;
 			Width:  64; Height: 32; saveSurf: false),// sprTeleport
 			(FileName:    'HHDeath'; Path: ptGraphics; AltPath: ptNone; Texture: nil; Surface: nil;
@@ -1409,6 +1409,28 @@
 			isDamaging: true;
 			SkipTurns: 0;
 			PosCount: 1;
+			PosSprite: sprWater),
+			(NameId: sidJetpack;
+			NameTex: nil;
+			Probability: 20;
+			NumberInCase: 1;
+			Ammo: (Propz: ammoprop_ForwMsgs or
+							ammoprop_AttackInMove or
+							ammoprop_NoCrosshair or
+							ammoprop_DontHold or
+							ammoprop_AltAttack;
+					Count: 1;
+					NumPerTurn: 1;
+					Timer: 0;
+					Pos: 0;
+					AmmoType: amJetpack);
+			Slot: 3;
+			TimeAfterTurn: 3000;
+			minAngle: 0;
+			maxAngle: 0;
+			isDamaging: true;
+			SkipTurns: 0;
+			PosCount: 1;
 			PosSprite: sprWater)
 			);
 
diff -r fc082baf448c -r c045698e044f hedgewars/uGears.pas
--- a/hedgewars/uGears.pas	Sat Jun 20 07:50:03 2009 +0000
+++ b/hedgewars/uGears.pas	Sun Jun 21 15:31:09 2009 +0000
@@ -162,7 +162,8 @@
 			@doStepBallgun,
 			@doStepBomb,
 			@doStepRCPlane,
-			@doStepSniperRifleShot
+			@doStepSniperRifleShot,
+			@doStepJetpack
 			);
 
 procedure InsertGearToList(Gear: PGear);
@@ -386,6 +387,10 @@
                 Result^.Health:= 3;
                 Result^.Radius:= 8;
                 end;
+     gtJetpack: begin
+                Result^.Timer:= 20000;
+                Result^.Health:= 2000;
+                end;
      end;
 InsertGearToList(Result);
 AddGear:= Result
diff -r fc082baf448c -r c045698e044f hedgewars/uLocale.pas
--- a/hedgewars/uLocale.pas	Sat Jun 20 07:50:03 2009 +0000
+++ b/hedgewars/uLocale.pas	Sun Jun 21 15:31:09 2009 +0000
@@ -26,7 +26,7 @@
 			sidKamikaze, sidCake, sidSeduction, sidWatermelon,
 			sidHellishBomb, sidDrill, sidBallgun, sidNapalm, sidRCPlane, 
             sidLowGravity, sidExtraDamage, sidInvulnerable, sidExtraTime, 
-            sidLaserSight, sidVampiric, sidSniperRifle);
+            sidLaserSight, sidVampiric, sidSniperRifle, sidJetpack);
 
 	TMsgStrId = (sidStartFight, sidDraw, sidWinner, sidVolume, sidPaused,
 			sidConfirm, sidSuddenDeath);
diff -r fc082baf448c -r c045698e044f share/hedgewars/Data/Locale/cs.txt
--- a/share/hedgewars/Data/Locale/cs.txt	Sat Jun 20 07:50:03 2009 +0000
+++ b/share/hedgewars/Data/Locale/cs.txt	Sun Jun 21 15:31:09 2009 +0000
@@ -39,6 +39,7 @@
 00:36=Laser Sight
 00:37=Vampirism
 00:38=Sniper Rifle
+00:39=Jetpack
 
 01:00=Do boje!
 01:01=Kolo nerozhodně
diff -r fc082baf448c -r c045698e044f share/hedgewars/Data/Locale/de.txt
--- a/share/hedgewars/Data/Locale/de.txt	Sat Jun 20 07:50:03 2009 +0000
+++ b/share/hedgewars/Data/Locale/de.txt	Sun Jun 21 15:31:09 2009 +0000
@@ -39,6 +39,7 @@
 00:36=Laservisier
 00:37=Vampirismus
 00:38=Scharfschützengewehr
+00:39=Jetpack
 
 01:00=Auf in die Schlacht!
 01:01=Unentschieden
diff -r fc082baf448c -r c045698e044f share/hedgewars/Data/Locale/en.txt
--- a/share/hedgewars/Data/Locale/en.txt	Sat Jun 20 07:50:03 2009 +0000
+++ b/share/hedgewars/Data/Locale/en.txt	Sun Jun 21 15:31:09 2009 +0000
@@ -39,6 +39,7 @@
 00:36=Laser Sight
 00:37=Vampirism
 00:38=Sniper Rifle
+00:39=Jetpack
 
 01:00=Let's fight!
 01:01=Round draw
diff -r fc082baf448c -r c045698e044f share/hedgewars/Data/Locale/es.txt
--- a/share/hedgewars/Data/Locale/es.txt	Sat Jun 20 07:50:03 2009 +0000
+++ b/share/hedgewars/Data/Locale/es.txt	Sun Jun 21 15:31:09 2009 +0000
@@ -39,6 +39,7 @@
 00:36=Mira láser
 00:37=Vampirism
 00:38=Sniper Rifle
+00:39=Jetpack
 
 01:00=Luchad!
 01:01=Empate
diff -r fc082baf448c -r c045698e044f share/hedgewars/Data/Locale/fi.txt
--- a/share/hedgewars/Data/Locale/fi.txt	Sat Jun 20 07:50:03 2009 +0000
+++ b/share/hedgewars/Data/Locale/fi.txt	Sun Jun 21 15:31:09 2009 +0000
@@ -39,6 +39,7 @@
 00:36=Lasertähtäin
 00:37=Vampyrismi
 00:38=Tarkkuuskivääri
+00:39=Jetpack
 
 01:00=Taistelu alkakoon!
 01:01=Tasapeli
diff -r fc082baf448c -r c045698e044f share/hedgewars/Data/Locale/fr.txt
--- a/share/hedgewars/Data/Locale/fr.txt	Sat Jun 20 07:50:03 2009 +0000
+++ b/share/hedgewars/Data/Locale/fr.txt	Sun Jun 21 15:31:09 2009 +0000
@@ -39,6 +39,7 @@
 00:36=Visée laser
 00:37=Vampirisme
 00:38=Fusil de sniper
+00:39=Jetpack
 
 01:00=C'est parti !
 01:01=Round ex-aequo
diff -r fc082baf448c -r c045698e044f share/hedgewars/Data/Locale/it.txt
--- a/share/hedgewars/Data/Locale/it.txt	Sat Jun 20 07:50:03 2009 +0000
+++ b/share/hedgewars/Data/Locale/it.txt	Sun Jun 21 15:31:09 2009 +0000
@@ -39,6 +39,7 @@
 00:36=Mirino Laser
 00:37=Vampirismo
 00:38=Fucile di precisione
+00:39=Jetpack
 
 01:00=Combattiamo!
 01:01=Round in parità
diff -r fc082baf448c -r c045698e044f share/hedgewars/Data/Locale/ja.txt
--- a/share/hedgewars/Data/Locale/ja.txt	Sat Jun 20 07:50:03 2009 +0000
+++ b/share/hedgewars/Data/Locale/ja.txt	Sun Jun 21 15:31:09 2009 +0000
@@ -39,6 +39,7 @@
 00:36=Laser Sight
 00:37=Vampirism
 00:38=Sniper Rifle
+00:39=Jetpack
 
 01:00=ヨシ、ファイト!
 01:01=ドロー!
diff -r fc082baf448c -r c045698e044f share/hedgewars/Data/Locale/pl.txt
--- a/share/hedgewars/Data/Locale/pl.txt	Sat Jun 20 07:50:03 2009 +0000
+++ b/share/hedgewars/Data/Locale/pl.txt	Sun Jun 21 15:31:09 2009 +0000
@@ -39,6 +39,7 @@
 00:36=Celownik laserowy
 00:37=Wampiryzm
 00:38=Karabin Snajperski
+00:39=Jetpack
 
 01:00=Walczmy!
 01:01=Remis
diff -r fc082baf448c -r c045698e044f share/hedgewars/Data/Locale/pt-br.txt
--- a/share/hedgewars/Data/Locale/pt-br.txt	Sat Jun 20 07:50:03 2009 +0000
+++ b/share/hedgewars/Data/Locale/pt-br.txt	Sun Jun 21 15:31:09 2009 +0000
@@ -39,6 +39,7 @@
 00:36=Laser Sight
 00:37=Vampirism
 00:38=Sniper Rifle
+00:39=Jetpack
 
 01:00=Hora de lutar!
 01:01=Partida empatou
diff -r fc082baf448c -r c045698e044f share/hedgewars/Data/Locale/pt-pt.txt
--- a/share/hedgewars/Data/Locale/pt-pt.txt	Sat Jun 20 07:50:03 2009 +0000
+++ b/share/hedgewars/Data/Locale/pt-pt.txt	Sun Jun 21 15:31:09 2009 +0000
@@ -39,6 +39,7 @@
 00:36=Mira Laser
 00:37=Vampirismo
 00:38=Sniper
+00:39=Jetpack
 
 01:00=Vamos lutar!
 01:01=Ronda empatada
diff -r fc082baf448c -r c045698e044f share/hedgewars/Data/Locale/ru.txt
--- a/share/hedgewars/Data/Locale/ru.txt	Sat Jun 20 07:50:03 2009 +0000
+++ b/share/hedgewars/Data/Locale/ru.txt	Sun Jun 21 15:31:09 2009 +0000
@@ -39,6 +39,7 @@
 00:36=Лазерный прицел
 00:37=Вампиризм
 00:38=Снайперская винтовка
+00:39=Jetpack
 
 01:00=Вперёд к победе!
 01:01=Ничья
diff -r fc082baf448c -r c045698e044f share/hedgewars/Data/Locale/sk.txt
--- a/share/hedgewars/Data/Locale/sk.txt	Sat Jun 20 07:50:03 2009 +0000
+++ b/share/hedgewars/Data/Locale/sk.txt	Sun Jun 21 15:31:09 2009 +0000
@@ -39,6 +39,7 @@
 00:36=Laserové zameriavanie
 00:37=Režim vampíra
 00:38=Ostreľovačka
+00:39=Jetpack
 
 01:00=Do boja!
 01:01=Remíza
diff -r fc082baf448c -r c045698e044f share/hedgewars/Data/Locale/sv.txt
--- a/share/hedgewars/Data/Locale/sv.txt	Sat Jun 20 07:50:03 2009 +0000
+++ b/share/hedgewars/Data/Locale/sv.txt	Sun Jun 21 15:31:09 2009 +0000
@@ -39,6 +39,7 @@
 00:36=Laser Sight
 00:37=Vampirism
 00:38=Sniper Rifle
+00:39=Jetpack
 
 01:00=Nu kör vi!
 01:01=Oavgjort
diff -r fc082baf448c -r c045698e044f share/hedgewars/Data/Locale/tr.txt
--- a/share/hedgewars/Data/Locale/tr.txt	Sat Jun 20 07:50:03 2009 +0000
+++ b/share/hedgewars/Data/Locale/tr.txt	Sun Jun 21 15:31:09 2009 +0000
@@ -39,6 +39,7 @@
 00:36=Lazer Görüşü
 00:37=Vampirism
 00:38=Sniper Rifle
+00:39=Jetpack
 
 01:00=Savaş başlasın!
 01:01=Beraberlik
diff -r fc082baf448c -r c045698e044f share/hedgewars/Data/Locale/uk.txt
--- a/share/hedgewars/Data/Locale/uk.txt	Sat Jun 20 07:50:03 2009 +0000
+++ b/share/hedgewars/Data/Locale/uk.txt	Sun Jun 21 15:31:09 2009 +0000
@@ -39,6 +39,7 @@
 00:36=Laser Sight
 00:37=Vampirism
 00:38=Sniper Rifle
+00:39=Jetpack
 
 01:00=Уперед до перемоги!
 01:01=Нічия
diff -r fc082baf448c -r c045698e044f share/hedgewars/Data/Locale/zh_CN.txt
--- a/share/hedgewars/Data/Locale/zh_CN.txt	Sat Jun 20 07:50:03 2009 +0000
+++ b/share/hedgewars/Data/Locale/zh_CN.txt	Sun Jun 21 15:31:09 2009 +0000
@@ -39,6 +39,7 @@
 00:36=激光瞄准
 00:37=吸血鬼
 00:38=狙擊槍
+00:39=Jetpack
 
 01:00=战斗啦!
 01:01=平手
diff -r fc082baf448c -r c045698e044f share/hedgewars/Data/Locale/zh_TW.txt
--- a/share/hedgewars/Data/Locale/zh_TW.txt	Sat Jun 20 07:50:03 2009 +0000
+++ b/share/hedgewars/Data/Locale/zh_TW.txt	Sun Jun 21 15:31:09 2009 +0000
@@ -39,6 +39,7 @@
 00:36=雷射瞄准
 00:37=吸血鬼
 00:38=狙擊槍
+00:39=Jetpack
 
 01:00=戰鬥開始!
 01:01=平手