Add Hellish bomb weapon
authorunc0rr
Thu, 18 Sep 2008 16:16:41 +0000
changeset 1263 24677a82531d
parent 1262 e9191c693e44
child 1264 e8ac58bbd10f
Add Hellish bomb weapon
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/Graphics/AmmoMenu/Ammos.png
share/hedgewars/Data/Graphics/EvilTrace.png
share/hedgewars/Data/Graphics/HellishBomb.png
share/hedgewars/Data/Locale/bg.txt
share/hedgewars/Data/Locale/de.txt
share/hedgewars/Data/Locale/en.txt
share/hedgewars/Data/Locale/es.txt
share/hedgewars/Data/Locale/fr.txt
share/hedgewars/Data/Locale/it.txt
share/hedgewars/Data/Locale/pl.txt
share/hedgewars/Data/Locale/ru.txt
share/hedgewars/Data/Locale/sk.txt
share/hedgewars/Data/Locale/sv.txt
share/hedgewars/Data/Locale/uk.txt
--- a/QTfrontend/hwconsts.cpp.in	Thu Sep 18 14:44:44 2008 +0000
+++ b/QTfrontend/hwconsts.cpp.in	Thu Sep 18 16:16:41 2008 +0000
@@ -29,7 +29,7 @@
 QStringList * Themes;
 QStringList * mapList;
 
-QString * cDefaultAmmoStore = new QString("eammstore 93919294221991210322351111");
+QString * cDefaultAmmoStore = new QString("eammstore 939192942219912103223511111");
 
 QColor * color1 = new QColor(  0, 255, 255);
 QColor * color2 = new QColor(255, 127, 127);
--- a/hedgewars/GSHandlers.inc	Thu Sep 18 14:44:44 2008 +0000
+++ b/hedgewars/GSHandlers.inc	Thu Sep 18 16:16:41 2008 +0000
@@ -125,7 +125,9 @@
     dX, dY: hwFloat;
 begin
 AllInactive:= false;
+
 doStepFallingGear(Gear);
+
 dec(Gear^.Timer);
 if Gear^.Timer = 0 then
 	begin
@@ -148,12 +150,20 @@
 					dY:= (GetRandom - _2) * _0_2;
 					AddGear(hwRound(Gear^.X), hwRound(Gear^.Y), gtMelonPiece, 0, dX, dY, 75)^.DirAngle:= i * 60;
 					end
-				end
+				end;
+		gtHellishBomb: doMakeExplosion(hwRound(Gear^.X), hwRound(Gear^.Y), 90, EXPLAutoSound);
 		end;
 	DeleteGear(Gear);
 	exit
 	end;
+
 CalcRotationDirAngle(Gear);
+
+if Gear^.Kind = gtHellishBomb then
+	if (GameTicks and $3F) = 0 then
+		if (Gear^.State and gstCollision) = 0 then
+			AddGear(hwRound(Gear^.X), hwRound(Gear^.Y), gtEvilTrace, 0, _0, _0, 0);
+
 if (Gear^.State and (gstCollision or gstMoving)) = (gstCollision or gstMoving) then
 	if (hwAbs(Gear^.dX) > _0_1) or
 	   (hwAbs(Gear^.dY) > _0_1) then
--- a/hedgewars/HHHandlers.inc	Thu Sep 18 14:44:44 2008 +0000
+++ b/hedgewars/HHHandlers.inc	Thu Sep 18 16:16:41 2008 +0000
@@ -168,6 +168,7 @@
                                  end;
                     amSeduction: FollowGear:= AddGear(hwRound(X), hwRound(Y), gtSeduction, 0, xx, yy, 0);
                    amWatermelon: FollowGear:= AddGear(hwRound(X), hwRound(Y), gtWatermelon,  0, xx*Power/cPowerDivisor, yy*Power/cPowerDivisor, Ammo^[CurSlot, CurAmmo].Timer);
+                  amHellishBomb: FollowGear:= AddGear(hwRound(X), hwRound(Y), gtHellishBomb,    0, xx*Power/cPowerDivisor, yy*Power/cPowerDivisor, 5000);
                   end;
 
         uStats.AmmoUsed(Ammo^[CurSlot, CurAmmo].AmmoType);
--- a/hedgewars/uAIAmmoTests.pas	Thu Sep 18 14:44:44 2008 +0000
+++ b/hedgewars/uAIAmmoTests.pas	Thu Sep 18 16:16:41 2008 +0000
@@ -70,7 +70,8 @@
                   (proc: nil;              flags: 0), // amKamikaze
                   (proc: nil;              flags: 0), // amCake
                   (proc: nil;              flags: 0), // amSeduction
-                  (proc: nil;              flags: 0)  // amBanana
+                  (proc: nil;              flags: 0), // amBanana
+                  (proc: nil;              flags: 0)  // amHellishBomb
                   );
 
 const BadTurn = Low(LongInt) div 4;
--- a/hedgewars/uConsts.pas	Thu Sep 18 14:44:44 2008 +0000
+++ b/hedgewars/uConsts.pas	Thu Sep 18 16:16:41 2008 +0000
@@ -47,7 +47,8 @@
 			sprShotgun, sprDEagle, sprHHIdle, sprMortar, sprTurnsLeft,
 			sprKamikaze, sprWhip, sprKowtow, sprSad, sprWave,
 			sprHurrah, sprLemonade, sprExplPart, sprExplPart2,
-			sprCakeWalk, sprCakeDown, sprAMAmmosBW, sprWatermelon);
+			sprCakeWalk, sprCakeDown, sprAMAmmosBW, sprWatermelon,
+			sprEvilTrace, sprHellishBomb);
 
 	TGearType = (gtAmmo_Bomb, gtHedgehog, gtAmmo_Grenade, gtHealthTag,
 			gtGrave, gtUFO, gtShotgunShot, gtPickHammer, gtRope,
@@ -56,7 +57,8 @@
 			gtFirePunch, gtATStartGame, gtATSmoothWindCh, gtATFinishGame,
 			gtParachute, gtAirAttack, gtAirBomb, gtBlowTorch, gtGirder,
 			gtTeleport, gtSmallDamage, gtSwitcher, gtTarget, gtMortar,
-			gtWhip, gtKamikaze, gtCake, gtSeduction, gtWatermelon, gtMelonPiece);
+			gtWhip, gtKamikaze, gtCake, gtSeduction, gtWatermelon, gtMelonPiece,
+			gtHellishBomb, gtEvilTrace);
 
 	TVisualGearType = (vgtFlake, vgtCloud, vgtExplPart, vgtExplPart2, vgtFire);
 
@@ -75,7 +77,7 @@
 			amSkip, amRope, amMine, amDEagle, amDynamite, amFirePunch, amWhip,
 			amBaseballBat, amParachute, amAirAttack, amMineStrike, amBlowTorch,
 			amGirder, amTeleport, amSwitch, amMortar, amKamikaze, amCake,
-			amSeduction, amWatermelon);
+			amSeduction, amWatermelon, amHellishBomb);
 
 	THWFont = (fnt16, fntBig, fntSmall);
 
@@ -425,7 +427,11 @@
 			(FileName:   'Ammos_bw'; Path: ptAmmoMenu; AltPath: ptNone; Texture: nil; Surface: nil;
 			Width:  32; Height: 32; saveSurf: false),// sprAMAmmosBW
 			(FileName: 'Watermelon'; Path: ptGraphics; AltPath: ptNone; Texture: nil; Surface: nil;
-			Width:  32; Height: 32; saveSurf: false) // sprWatermelon
+			Width:  32; Height: 32; saveSurf: false),// sprWatermelon
+			(FileName:  'EvilTrace'; Path: ptGraphics; AltPath: ptNone; Texture: nil; Surface: nil;
+			Width:  32; Height: 32; saveSurf: false),// sprEvilTrace
+			(FileName:'HellishBomb'; Path: ptGraphics; AltPath: ptNone; Texture: nil; Surface: nil;
+			Width:  16; Height: 16; saveSurf: false) // sprHellishBomb
 			);
 
 	Wavez: array [TWave] of record
@@ -1012,6 +1018,25 @@
 			isDamaging: true;
 			SkipTurns: 0;
 			PosCount: 1;
+			PosSprite: sprWater),
+			(NameId: sidHellishBomb;
+			NameTex: nil;
+			Probability: 200;
+			NumberInCase: 1;
+			Ammo: (Propz:  ammoprop_Power or
+							ammoprop_AltUse;
+					Count: 1;
+					NumPerTurn: 0;
+					Timer: 5000;
+					Pos: 0;
+					AmmoType: amHellishBomb);
+			Slot: 4;
+			TimeAfterTurn: 3000;
+			minAngle: 0;
+			maxAngle: 0;
+			isDamaging: true;
+			SkipTurns: 0;
+			PosCount: 1;
 			PosSprite: sprWater)
 			);
 
--- a/hedgewars/uGears.pas	Thu Sep 18 14:44:44 2008 +0000
+++ b/hedgewars/uGears.pas	Thu Sep 18 16:16:41 2008 +0000
@@ -141,7 +141,9 @@
 			@doStepCake,
 			@doStepSeduction,
 			@doStepBomb,
-			@doStepCluster
+			@doStepCluster,
+			@doStepBomb,
+			@doStepSmokeTrace
 			);
 
 procedure InsertGearToList(Gear: PGear);
@@ -245,7 +247,8 @@
                 Result^.Radius:= 10;
                 Result^.Timer:= 4000
                 end;
-  gtSmokeTrace: begin
+  gtSmokeTrace,
+   gtEvilTrace: begin
                 Result^.X:= Result^.X - _16;
                 Result^.Y:= Result^.Y - _16;
                 Result^.State:= 8
@@ -327,6 +330,11 @@
                 Result^.Z:= cOnHHZ;
                 if hwSign(dX) > 0 then Result^.Angle:= 1 else Result^.Angle:= 3
                 end;
+ gtHellishBomb: begin
+                Result^.Radius:= 4;
+                Result^.Elasticity:= _0_5;
+                Result^.Friction:= _0_96;
+                end;
      end;
 InsertGearToList(Result);
 AddGear:= Result
@@ -1088,7 +1096,9 @@
                      DrawRotatedf(sprCakeDown, hwRound(Gear^.X) + WorldDx, hwRound(Gear^.Y) + WorldDy, 5 - Gear^.Pos, hwSign(Gear^.dX), 0);
       gtWatermelon: DrawRotatedf(sprWatermelon, hwRound(Gear^.X) + WorldDx, hwRound(Gear^.Y) + WorldDy, 0, 0, Gear^.DirAngle);
       gtMelonPiece: DrawRotatedf(sprWatermelon, hwRound(Gear^.X) + WorldDx, hwRound(Gear^.Y) + WorldDy, 1, 0, Gear^.DirAngle);
-              end;
+     gtHellishBomb: DrawRotated(sprHellishBomb, hwRound(Gear^.X) + WorldDx, hwRound(Gear^.Y) + WorldDy, 0, Gear^.DirAngle);
+      gtEvilTrace: if Gear^.State < 8 then DrawSprite(sprEvilTrace, hwRound(Gear^.X) + WorldDx, hwRound(Gear^.Y) + WorldDy, Gear^.State);
+         end;
       Gear:= Gear^.NextGear
       end;
 end;
--- a/hedgewars/uLocale.pas	Thu Sep 18 14:44:44 2008 +0000
+++ b/hedgewars/uLocale.pas	Thu Sep 18 16:16:41 2008 +0000
@@ -19,14 +19,15 @@
 unit uLocale;
 interface
 type TAmmoStrId = (sidGrenade, sidClusterBomb, sidBazooka, sidUFO, sidShotgun,
-                   sidPickHammer, sidSkip, sidRope, sidMine, sidDEagle,
-                   sidDynamite, sidBaseballBat, sidFirePunch, sidSeconds,
-                   sidParachute, sidAirAttack, sidMineStrike, sidBlowTorch,
-                   sidGirder, sidTeleport, sidSwitch, sidMortar, sidWhip,
-                   sidKamikaze, sidCake, sidSeduction, sidWatermelon);
+			sidPickHammer, sidSkip, sidRope, sidMine, sidDEagle,
+			sidDynamite, sidBaseballBat, sidFirePunch, sidSeconds,
+			sidParachute, sidAirAttack, sidMineStrike, sidBlowTorch,
+			sidGirder, sidTeleport, sidSwitch, sidMortar, sidWhip,
+			sidKamikaze, sidCake, sidSeduction, sidWatermelon,
+			sidHellishBomb);
 
-     TMsgStrId = (sidStartFight, sidDraw, sidWinner, sidVolume, sidPaused,
-                  sidConfirm, sidSuddenDeath);
+	TMsgStrId = (sidStartFight, sidDraw, sidWinner, sidVolume, sidPaused,
+			sidConfirm, sidSuddenDeath);
 
 var trammo: array[TAmmoStrId] of string;
     trmsg: array[TMsgStrId] of string;
@@ -47,23 +48,23 @@
 reset(f);
 TryDo(IOResult = 0, 'Cannot load locale "' + FileName + '"', true);
 while not eof(f) do
-      begin
-      readln(f, s);
-      if Length(s) = 0 then continue;
-      if s[1] = ';' then continue;
-      TryDo(Length(s) > 6, 'Load locale: empty string', true);
-      val(s[1]+s[2], a, c);
-      TryDo(c = 0, 'Load locale: numbers should be two-digit: ' + s, true);
-      TryDo(s[3] = ':', 'Load locale: ":" expected', true);
-      val(s[4]+s[5], b, c);
-      TryDo(c = 0, 'Load locale: numbers should be two-digit' + s, true);
-      TryDo(s[6] = '=', 'Load locale: "=" expected', true);
-      Delete(s, 1, 6);
-      case a of
-           0: if (b >=0) and (b <= ord(High(TAmmoStrId))) then trammo[TAmmoStrId(b)]:= s;
-           1: if (b >=0) and (b <= ord(High(TMsgStrId))) then trmsg[TMsgStrId(b)]:= s;
-           end;
-      end;
+	begin
+	readln(f, s);
+	if Length(s) = 0 then continue;
+	if s[1] = ';' then continue;
+	TryDo(Length(s) > 6, 'Load locale: empty string', true);
+	val(s[1]+s[2], a, c);
+	TryDo(c = 0, 'Load locale: numbers should be two-digit: ' + s, true);
+	TryDo(s[3] = ':', 'Load locale: ":" expected', true);
+	val(s[4]+s[5], b, c);
+	TryDo(c = 0, 'Load locale: numbers should be two-digit' + s, true);
+	TryDo(s[6] = '=', 'Load locale: "=" expected', true);
+	Delete(s, 1, 6);
+	case a of
+		0: if (b >=0) and (b <= ord(High(TAmmoStrId))) then trammo[TAmmoStrId(b)]:= s;
+		1: if (b >=0) and (b <= ord(High(TMsgStrId))) then trmsg[TMsgStrId(b)]:= s;
+		end;
+	end;
 Close(f)
 {$I+}
 end;
Binary file share/hedgewars/Data/Graphics/AmmoMenu/Ammos.png has changed
Binary file share/hedgewars/Data/Graphics/EvilTrace.png has changed
Binary file share/hedgewars/Data/Graphics/HellishBomb.png has changed
--- a/share/hedgewars/Data/Locale/bg.txt	Thu Sep 18 14:44:44 2008 +0000
+++ b/share/hedgewars/Data/Locale/bg.txt	Thu Sep 18 16:16:41 2008 +0000
@@ -27,6 +27,7 @@
 00:24=Cake
 00:25=Seduction
 00:26=Watermelon bomb
+00:27=Hellish Bomb
 
 01:00=Бой!
 01:01=Равен рунд
--- a/share/hedgewars/Data/Locale/de.txt	Thu Sep 18 14:44:44 2008 +0000
+++ b/share/hedgewars/Data/Locale/de.txt	Thu Sep 18 16:16:41 2008 +0000
@@ -27,6 +27,7 @@
 00:24=Cake
 00:25=Seduction
 00:26=Watermelon bomb
+00:27=Hellish Bomb
 
 01:00=Auf in die Schlacht!
 01:01=Unentschieden
--- a/share/hedgewars/Data/Locale/en.txt	Thu Sep 18 14:44:44 2008 +0000
+++ b/share/hedgewars/Data/Locale/en.txt	Thu Sep 18 16:16:41 2008 +0000
@@ -27,6 +27,7 @@
 00:24=Cake
 00:25=Seduction
 00:26=Watermelon bomb
+00:27=Hellish Bomb
 
 01:00=Let's fight!
 01:01=Round draw
--- a/share/hedgewars/Data/Locale/es.txt	Thu Sep 18 14:44:44 2008 +0000
+++ b/share/hedgewars/Data/Locale/es.txt	Thu Sep 18 16:16:41 2008 +0000
@@ -27,6 +27,7 @@
 00:24=Tarta
 00:25=Seducción
 00:26=Watermelon bomb
+00:27=Hellish Bomb
 
 01:00=Luchad!
 01:01=Empate
--- a/share/hedgewars/Data/Locale/fr.txt	Thu Sep 18 14:44:44 2008 +0000
+++ b/share/hedgewars/Data/Locale/fr.txt	Thu Sep 18 16:16:41 2008 +0000
@@ -27,6 +27,7 @@
 00:24=Gateau
 00:25=Seduction
 00:26=Watermelon bomb
+00:27=Hellish Bomb
 
 01:00=C'est parti!
 01:01=Round ex aequo
--- a/share/hedgewars/Data/Locale/it.txt	Thu Sep 18 14:44:44 2008 +0000
+++ b/share/hedgewars/Data/Locale/it.txt	Thu Sep 18 16:16:41 2008 +0000
@@ -27,6 +27,7 @@
 00:24=Torta
 00:25=Seduzione
 00:26=Watermelon bomb
+00:27=Hellish Bomb
 
 01:00=Combattiamo!
 01:01=Round in parità
--- a/share/hedgewars/Data/Locale/pl.txt	Thu Sep 18 14:44:44 2008 +0000
+++ b/share/hedgewars/Data/Locale/pl.txt	Thu Sep 18 16:16:41 2008 +0000
@@ -27,6 +27,7 @@
 00:24=Ciasto
 00:25=Uwodzenie
 00:26=Watermelon bomb
+00:27=Hellish Bomb
 
 01:00=Walczmy!
 01:01=Remis
--- a/share/hedgewars/Data/Locale/ru.txt	Thu Sep 18 14:44:44 2008 +0000
+++ b/share/hedgewars/Data/Locale/ru.txt	Thu Sep 18 16:16:41 2008 +0000
@@ -27,6 +27,7 @@
 00:24=Торт
 00:25=Соблазнение
 00:26=Арбузная бомба
+00:27=Адская бомба
 
 01:00=Вперёд к победе!
 01:01=Ничья
--- a/share/hedgewars/Data/Locale/sk.txt	Thu Sep 18 14:44:44 2008 +0000
+++ b/share/hedgewars/Data/Locale/sk.txt	Thu Sep 18 16:16:41 2008 +0000
@@ -27,6 +27,7 @@
 00:24=Cake
 00:25=Seduction
 00:26=Watermelon bomb
+00:27=Hellish Bomb
 
 01:00=Do boja!
 01:01=Remíza
--- a/share/hedgewars/Data/Locale/sv.txt	Thu Sep 18 14:44:44 2008 +0000
+++ b/share/hedgewars/Data/Locale/sv.txt	Thu Sep 18 16:16:41 2008 +0000
@@ -27,6 +27,7 @@
 00:24=Tårta
 00:25=Seduction
 00:26=Watermelon bomb
+00:27=Hellish Bomb
 
 01:00=Nu kör vi!
 01:01=Oavgjort
--- a/share/hedgewars/Data/Locale/uk.txt	Thu Sep 18 14:44:44 2008 +0000
+++ b/share/hedgewars/Data/Locale/uk.txt	Thu Sep 18 16:16:41 2008 +0000
@@ -27,6 +27,7 @@
 00:24=Торт
 00:25=Зваблення
 00:26=Watermelon bomb
+00:27=Hellish Bomb
 
 01:00=Уперед до перемоги!
 01:01=Нічия