Gas grenade:
authormbait
Fri, 30 Apr 2010 12:19:25 +0000
changeset 3382 633046fa040c
parent 3381 f8800c44b3de
child 3383 45a73be4d8c1
Gas grenade: * code in doStepBomb * item in weapon list * english locale name
QTfrontend/hwconsts.cpp.in
hedgewars/GSHandlers.inc
hedgewars/HHHandlers.inc
hedgewars/uAIAmmoTests.pas
hedgewars/uConsts.pas
hedgewars/uGears.pas
hedgewars/uLocale.pas
share/hedgewars/Data/Locale/en.txt
--- a/QTfrontend/hwconsts.cpp.in	Thu Apr 29 21:25:51 2010 +0000
+++ b/QTfrontend/hwconsts.cpp.in	Fri Apr 30 12:19:25 2010 +0000
@@ -31,10 +31,10 @@
 QStringList * mapList;
 
 QString * cDefaultAmmoStore = new QString(
-        "9391929422199121032235111001201000000211190"
-        "0405040541600655546554464776576666666155501"
-        "0000000000000205500000040007004000000000200"
-        "1311110312111111123114111111111111111211101"
+        "93919294221991210322351110012010000002111909"
+        "04050405416006555465544647765766666661555010"
+        "00000000000002055000000400070040000000002000"
+        "13111103121111111231141111111111111112111011"
 		);
 int cAmmoNumber = cDefaultAmmoStore->size() / 4;
 
@@ -42,30 +42,30 @@
 	QList< QPair<QString, QString> >()
 	<< qMakePair(QString("Default"), *cDefaultAmmoStore)
 	<< qMakePair(QString("Crazy"),     QString(
-        "9999999999999999992999999999999999299999909" // TODO: Remove Piano's unlimited uses!
-        "1111110111111111111111111111111111111111111"
-        "0000000000000000000000000000000000000000000"
-        "1311110312111111123114111111111111111211100"))
+        "99999999999999999929999999999999992999999099" // TODO: Remove Piano's unlimited uses!
+        "11111101111111111111111111111111111111111111"
+        "00000000000000000000000000000000000000000000"
+        "13111103121111111231141111111111111112111001"))
 	<< qMakePair(QString("Pro mode"),  QString(
-        "9090009000000000000009000000000000000000000"
-        "0000000000000000000000000000000000000000000"
-        "0000000000000205500000040007004000000000200"
-        "1111111111111111111111111111111111111111100"))
+        "90900090000000000000090000000000000000000009"
+        "00000000000000000000000000000000000000000000"
+        "00000000000002055000000400070040000000002000"
+        "11111111111111111111111111111111111111111001"))
 	<< qMakePair(QString("Shoppa"),    QString(
-        "0000009900000000000000000000000000000000000"
-        "4444410044244402210112121222422000000002000"
-        "0000000000000000000000000000000000000000000"
-        "1111111111111111111111111111111111111111101"))
+        "00000099000000000000000000000000000000000000"
+        "44444100442444022101121212224220000000020004"
+        "00000000000000000000000000000000000000000000"
+        "11111111111111111111111111111111111111111011"))
 	<< qMakePair(QString("Basketball"),QString(
-		"0000009000000900000000000000000000000000000"
-		"0000000000000000000000000000000000000000000"
-		"0000000000000005500000040007004000000000200"
-		"1111111111111111111111111111111111111111111"))
+		"00000090000009000000000000000000000000000000"
+		"00000000000000000000000000000000000000000000"
+		"00000000000000055000000400070040000000002000"
+		"11111111111111111111111111111111111111111111"))
 	<< qMakePair(QString("Minefield"), QString(
-		"0000009900090000000300000000000000000000000"
-		"0000000000000000000000000000000000000000000"
-		"0000000000000205500000040007004000000000200"
-		"1111111111111111111111111111111111111111111"))
+		"00000099000900000003000000000000000000000000"
+		"00000000000000000000000000000000000000000000"
+		"00000000000002055000000400070040000000002000"
+		"11111111111111111111111111111111111111111111"))
 	;
 
 QColor * color1 = new QColor(221,   0,   0);
--- a/hedgewars/GSHandlers.inc	Thu Apr 29 21:25:51 2010 +0000
+++ b/hedgewars/GSHandlers.inc	Fri Apr 30 12:19:25 2010 +0000
@@ -270,6 +270,7 @@
         gtClusterBomb: makeHogsWorry(Gear^.X, Gear^.Y, 20);
         gtWatermelon: makeHogsWorry(Gear^.X, Gear^.Y, 75);
         gtHellishBomb: makeHogsWorry(Gear^.X, Gear^.Y, 90);
+        gtGasBomb: makeHogsWorry(Gear^.X, Gear^.Y, 50);
     end;
 
 if (Gear^.Kind = gtBall) and ((Gear^.State and gstTmpFlag) <> 0) then
@@ -321,6 +322,7 @@
                     if i mod 2 <> 0 then Fire^.State:= Fire^.State or gsttmpFlag;
                     end
                 end;
+		gtGasBomb: doMakeExplosion(hwRound(Gear^.X), hwRound(Gear^.Y), 50, EXPLAutoSound or EXPLPoisoned);
         end;
     DeleteGear(Gear);
     exit
@@ -3106,4 +3108,4 @@
     end
 else
     Gear^.dY:= Gear^.dY + cGravity * 2; // let it fall faster so itdoesn't take too long for the whole attack
-end;
\ No newline at end of file
+end;
--- a/hedgewars/HHHandlers.inc	Thu Apr 29 21:25:51 2010 +0000
+++ b/hedgewars/HHHandlers.inc	Fri Apr 30 12:19:25 2010 +0000
@@ -143,6 +143,7 @@
                       amGrenade: FollowGear:= AddGear(hwRound(X), hwRound(Y), gtAmmo_Bomb,    0, xx*Power/cPowerDivisor, yy*Power/cPowerDivisor, Ammo^[CurSlot, CurAmmo].Timer);
                       amMolotov: FollowGear:= AddGear(hwRound(X), hwRound(Y), gtMolotov,      0, xx*Power/cPowerDivisor, yy*Power/cPowerDivisor, 0);
                   amClusterBomb: FollowGear:= AddGear(hwRound(X), hwRound(Y), gtClusterBomb,  0, xx*Power/cPowerDivisor, yy*Power/cPowerDivisor, Ammo^[CurSlot, CurAmmo].Timer);
+                      amGasBomb: FollowGear:= AddGear(hwRound(X), hwRound(Y), gtGasBomb,    0, xx*Power/cPowerDivisor, yy*Power/cPowerDivisor, Ammo^[CurSlot, CurAmmo].Timer);
                       amBazooka: FollowGear:= AddGear(hwRound(X), hwRound(Y), gtAmmo_Grenade, 0, xx*Power/cPowerDivisor, yy*Power/cPowerDivisor, 0);
                           amBee: FollowGear:= AddGear(hwRound(X), hwRound(Y), gtBee,          0, xx*Power/cPowerDivisor, yy*Power/cPowerDivisor, 0);
                       amShotgun: begin
--- a/hedgewars/uAIAmmoTests.pas	Thu Apr 29 21:25:51 2010 +0000
+++ b/hedgewars/uAIAmmoTests.pas	Fri Apr 30 12:19:25 2010 +0000
@@ -94,7 +94,8 @@
             (proc: @TestMolotov;     flags: 0), // amMolotov
             (proc: nil;              flags: 0), // amBirdy
             (proc: nil;              flags: 0), // amPortalGun
-            (proc: nil;              flags: 0)  // amPiano
+            (proc: nil;              flags: 0), // amPiano
+            (proc: @TestGrenade;     flags: 0)  // amGasBomb
             );
 
 const BadTurn = Low(LongInt) div 4;
--- a/hedgewars/uConsts.pas	Thu Apr 29 21:25:51 2010 +0000
+++ b/hedgewars/uConsts.pas	Fri Apr 30 12:19:25 2010 +0000
@@ -84,7 +84,7 @@
             gtWhip, gtKamikaze, gtCake, gtSeduction, gtWatermelon, gtMelonPiece, // 37
             gtHellishBomb, gtEvilTrace, gtWaterUp, gtDrill, gtBallGun, gtBall,gtRCPlane,
             gtSniperRifleShot, gtJetpack, gtMolotov, gtExplosives, gtBirdy, 
-            gtBigExplosion, gtEgg, gtPortal, gtPortalGun, gtPiano);
+            gtBigExplosion, gtEgg, gtPortal, gtPortalGun, gtPiano, gtGasBomb);
 
     TVisualGearType = (vgtFlake, vgtCloud, vgtExplPart, vgtExplPart2, vgtFire,
             vgtSmallDamageTag, vgtTeamHealthSorter, vgtSpeechBubble, vgtBubble,
@@ -123,7 +123,7 @@
             amSeduction, amWatermelon, amHellishBomb, amNapalm, amDrill, amBallgun,
             amRCPlane, amLowGravity, amExtraDamage, amInvulnerable, amExtraTime,
             amLaserSight, amVampiric, amSniperRifle, amJetpack, amMolotov, amBirdy, amPortalGun,
-            amPiano);
+            amPiano, amGasBomb);
 
     THWFont = (fnt16, fntBig, fntSmall, CJKfnt16, CJKfntBig, CJKfntSmall);
 
@@ -1836,6 +1836,26 @@
             isDamaging: true;
             SkipTurns: 7;
             PosCount: 1;
+            PosSprite: sprWater),
+            (NameId: sidGasBomb;
+            NameTex: nil;
+            Probability: 0;
+            NumberInCase: 1;
+            Ammo: (Propz: ammoprop_Timerable or ammoprop_Power or ammoprop_AltUse;
+                Count: AMMO_INFINITE;
+                InitialCount: AMMO_INFINITE;
+                NumPerTurn: 0;
+                Timer: 3000;
+                Pos: 0;
+                AmmoType: amGasBomb;
+                AttackVoice: sndCover);
+            Slot: 1;
+            TimeAfterTurn: 3000;
+            minAngle: 0;
+            maxAngle: 0;
+            isDamaging: true;
+            SkipTurns: 0;
+            PosCount: 1;
             PosSprite: sprWater)
             );
 
--- a/hedgewars/uGears.pas	Thu Apr 29 21:25:51 2010 +0000
+++ b/hedgewars/uGears.pas	Fri Apr 30 12:19:25 2010 +0000
@@ -185,7 +185,8 @@
             @doStepEggWork,
             @doStepPortal,
             @doStepPortalGun,
-            @doStepPiano
+            @doStepPiano,
+            @doStepBomb
             );
 
 procedure InsertGearToList(Gear: PGear);
@@ -257,8 +258,9 @@
     end;
 
 case Kind of
-   gtAmmo_Bomb,
- gtClusterBomb: begin
+     gtAmmo_Bomb,
+     gtClusterBomb,
+     gtGasBomb: begin
                 gear^.ImpactSound:= sndGrenadeImpact;
                 gear^.nImpactSounds:= 1;
                 gear^.AdvBounce:= 1;
@@ -1649,6 +1651,7 @@
     begin
     case Gear^.Kind of
        gtAmmo_Bomb: DrawRotated(sprBomb, hwRound(Gear^.X) + WorldDx, hwRound(Gear^.Y) + WorldDy, 0, Gear^.DirAngle);
+       gtGasBomb: DrawRotated(sprBomb, hwRound(Gear^.X) + WorldDx, hwRound(Gear^.Y) + WorldDy, 0, Gear^.DirAngle);
     gtMolotov: DrawRotated(sprMolotov, hwRound(Gear^.X) + WorldDx, hwRound(Gear^.Y) + WorldDy, 0, Gear^.DirAngle);
 
        gtRCPlane: begin
--- a/hedgewars/uLocale.pas	Thu Apr 29 21:25:51 2010 +0000
+++ b/hedgewars/uLocale.pas	Fri Apr 30 12:19:25 2010 +0000
@@ -29,7 +29,7 @@
             sidHellishBomb, sidDrill, sidBallgun, sidNapalm, sidRCPlane,
             sidLowGravity, sidExtraDamage, sidInvulnerable, sidExtraTime,
             sidLaserSight, sidVampiric, sidSniperRifle, sidJetpack,
-            sidMolotov, sidBirdy, sidPortalGun, sidPiano);
+            sidMolotov, sidBirdy, sidPortalGun, sidPiano, sidGasBomb);
 
     TMsgStrId = (sidStartFight, sidDraw, sidWinner, sidVolume, sidPaused,
             sidConfirm, sidSuddenDeath, sidRemaining, sidFuel, sidSync,
--- a/share/hedgewars/Data/Locale/en.txt	Thu Apr 29 21:25:51 2010 +0000
+++ b/share/hedgewars/Data/Locale/en.txt	Fri Apr 30 12:19:25 2010 +0000
@@ -44,6 +44,7 @@
 00:41=Birdy
 00:42=Portable Portal Device
 00:43=Piano Strike
+00:44=Gas grenade
 
 01:00=Let's fight!
 01:01=Round draw