Implement whip weapon
authorunc0rr
Sat, 10 May 2008 16:26:53 +0000
changeset 925 c20156328529
parent 924 227f9fcdc2f4
child 926 d231e007452a
Implement whip 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/Locale/en.txt
share/hedgewars/Data/Locale/pl.txt
share/hedgewars/Data/Locale/ru.txt
--- a/QTfrontend/hwconsts.cpp.in	Sat May 10 14:46:02 2008 +0000
+++ b/QTfrontend/hwconsts.cpp.in	Sat May 10 16:26:53 2008 +0000
@@ -28,7 +28,7 @@
 
 QStringList * Themes;
 
-QString * cDefaultAmmoStore = new QString("eammstore 939192942219121033235");
+QString * cDefaultAmmoStore = new QString("eammstore 9391929422199121033235");
 
 QColor * color1 = new QColor(  0, 255, 255);
 QColor * color2 = new QColor(255, 127, 127);
--- a/hedgewars/GSHandlers.inc	Sat May 10 14:46:02 2008 +0000
+++ b/hedgewars/GSHandlers.inc	Sat May 10 16:26:53 2008 +0000
@@ -968,7 +968,7 @@
 procedure doStepIdle(Gear: PGear);
 begin
 AllInactive:= false;
-dec(Gear^.Timer);addfilelog(inttostr(Gear^.Timer));
+dec(Gear^.Timer);
 if Gear^.Timer = 0 then
 	begin
 	DeleteGear(Gear);
@@ -988,6 +988,25 @@
 end;
 
 ////////////////////////////////////////////////////////////////////////////////
+procedure doStepWhip(Gear: PGear);
+var HHGear: PGear;
+    i: LongInt;
+begin
+HHGear:= PHedgehog(Gear^.Hedgehog)^.Gear;
+HHGear^.State:= HHGear^.State or gstNoDamage;
+
+for i:= 0 to 3 do
+	begin
+	AmmoShove(Gear, 30, 25);
+	Gear^.X:= Gear^.X + Gear^.dX * 5
+	end;
+
+HHGear^.State:= HHGear^.State and not gstNoDamage;
+Gear^.Timer:= 250;
+Gear^.doStep:= @doStepIdle
+end;
+
+////////////////////////////////////////////////////////////////////////////////
 procedure doStepFlame(Gear: PGear);
 begin
 AllInactive:= false;
--- a/hedgewars/HHHandlers.inc	Sat May 10 14:46:02 2008 +0000
+++ b/hedgewars/HHHandlers.inc	Sat May 10 16:26:53 2008 +0000
@@ -117,8 +117,9 @@
                                  end;
                        amDEagle: CurAmmoGear:= AddGear(hwRound(X + xx * cHHRadius), hwRound(Y + yy * cHHRadius), gtDEagleShot, 0, xx * _0_5, yy * _0_5, 0);
                      amDynamite: AddGear(hwRound(X) + hwSign(dX) * 7, hwRound(Y), gtDynamite, 0, SignAs(_0_03, dX), _0, 5000);
+                    amFirePunch: CurAmmoGear:= AddGear(hwRound(X) + hwSign(dX) * 10, hwRound(Y), gtFirePunch, 0, _0, _0, 0);
+                         amWhip: CurAmmoGear:= AddGear(hwRound(X) + hwSign(dX) * 10, hwRound(Y), gtWhip, 0, SignAs(_1, dX), - _0_8, 0);
                   amBaseballBat: CurAmmoGear:= AddGear(hwRound(X) + hwSign(dX) * 10, hwRound(Y), gtShover, 0, xx * _0_5, yy * _0_5, 0);
-                    amFirePunch: CurAmmoGear:= AddGear(hwRound(X) + hwSign(dX) * 10, hwRound(Y), gtFirePunch, 0, _0, _0, 0);
                     amParachute: CurAmmoGear:= AddGear(hwRound(X), hwRound(Y), gtParachute, 0, _0, _0, 0);
                     amAirAttack: AddGear(Ammo^[CurSlot, CurAmmo].Pos, 0, gtAirAttack, 0, _0, _0, 0);
                    amMineStrike: AddGear(Ammo^[CurSlot, CurAmmo].Pos, 0, gtAirAttack, 1, _0, _0, 0);
--- a/hedgewars/uAIAmmoTests.pas	Sat May 10 14:46:02 2008 +0000
+++ b/hedgewars/uAIAmmoTests.pas	Sat May 10 16:26:53 2008 +0000
@@ -56,6 +56,7 @@
                   (proc: @TestDesertEagle; flags: 0), // amDEagle
                   (proc: nil;              flags: 0), // amDynamite
                   (proc: @TestFirePunch;   flags: 0), // amFirePunch
+                  (proc: nil;              flags: 0), // amWhip
                   (proc: @TestBaseballBat; flags: 0), // amBaseballBat
                   (proc: nil;              flags: 0), // amParachute
                   (proc: @TestAirAttack;   flags: amtest_OnTurn), // amAirAttack
--- a/hedgewars/uConsts.pas	Sat May 10 14:46:02 2008 +0000
+++ b/hedgewars/uConsts.pas	Sat May 10 16:26:53 2008 +0000
@@ -52,7 +52,8 @@
                    gtTeamHealthSorter, gtClusterBomb, gtCluster, gtShover, gtFlame,
                    gtFirePunch, gtATStartGame, gtATSmoothWindCh, gtATFinishGame,
                    gtParachute, gtAirAttack, gtAirBomb, gtBlowTorch, gtGirder,
-                   gtTeleport, gtSmallDamage, gtSwitcher, gtTarget, gtMortar);
+                   gtTeleport, gtSmallDamage, gtSwitcher, gtTarget, gtMortar,
+                   gtWhip);
 
      TVisualGearType = (vgtFlake, vgtCloud);
 
@@ -67,7 +68,7 @@
                    sndEnemyDown, sndCoward, sndHurry, sndWatchIt);
 
      TAmmoType  = (amGrenade, amClusterBomb, amBazooka, amUFO, amShotgun, amPickHammer,
-                   amSkip, amRope, amMine, amDEagle, amDynamite, amFirePunch,
+                   amSkip, amRope, amMine, amDEagle, amDynamite, amFirePunch, amWhip,
                    amBaseballBat, amParachute, amAirAttack, amMineStrike, amBlowTorch,
                    amGirder, amTeleport, amSwitch, amMortar);
 
@@ -650,6 +651,23 @@
                                    isDamaging: true;
                                    PosCount: 1;
                                    PosSprite: sprWater),
+                                  (NameId: sidWhip;
+                                   NameTex: nil;
+                                   Probability: 0;
+                                   NumberInCase: 1;
+                                   Ammo: (Propz: ammoprop_NoCrosshair;
+                                          Count: AMMO_INFINITE;
+                                          NumPerTurn: 0;
+                                          Timer: 0;
+                                          Pos: 0;
+                                          AmmoType: amWhip);
+                                   Slot: 3;
+                                   TimeAfterTurn: 3000;
+                                   MinAngle: 0;
+                                   maxAngle: 0;
+                                   isDamaging: true;
+                                   PosCount: 1;
+                                   PosSprite: sprWater),
                                   (NameId: sidBaseballBat;
                                    NameTex: nil;
                                    Probability: 100;
--- a/hedgewars/uGears.pas	Sat May 10 14:46:02 2008 +0000
+++ b/hedgewars/uGears.pas	Sat May 10 16:26:53 2008 +0000
@@ -134,7 +134,8 @@
                                                                @doStepHealthTag,
                                                                @doStepSwitcher,
                                                                @doStepCase,
-                                                               @doStepMortar
+                                                               @doStepMortar,
+                                                               @doStepWhip
                                                                );
 
 procedure InsertGearToList(Gear: PGear);
@@ -303,6 +304,7 @@
                 Result^.Elasticity:= _0_2;
                 Result^.Friction:= _0_08
                 end;
+        gtWhip: Result^.Radius:= 20;
      end;
 InsertGearToList(Result);
 AddGear:= Result
--- a/hedgewars/uLocale.pas	Sat May 10 14:46:02 2008 +0000
+++ b/hedgewars/uLocale.pas	Sat May 10 16:26:53 2008 +0000
@@ -1,6 +1,6 @@
 (*
  * Hedgewars, a worms-like game
- * Copyright (c) 2006, 2007 Andrey Korotaev <unC0Rr@gmail.com>
+ * Copyright (c) 2006-2008 Andrey Korotaev <unC0Rr@gmail.com>
  *
  * This program is free software; you can redistribute it and/or modify
  * it under the terms of the GNU General Public License as published by
@@ -22,7 +22,7 @@
                    sidPickHammer, sidSkip, sidRope, sidMine, sidDEagle,
                    sidDynamite, sidBaseballBat, sidFirePunch, sidSeconds,
                    sidParachute, sidAirAttack, sidMineStrike, sidBlowTorch,
-                   sidGirder, sidTeleport, sidSwitch, sidMortar);
+                   sidGirder, sidTeleport, sidSwitch, sidMortar, sidWhip);
 
      TMsgStrId = (sidStartFight, sidDraw, sidWinner, sidVolume, sidPaused);
 
Binary file share/hedgewars/Data/Graphics/AmmoMenu/Ammos.png has changed
--- a/share/hedgewars/Data/Locale/en.txt	Sat May 10 14:46:02 2008 +0000
+++ b/share/hedgewars/Data/Locale/en.txt	Sat May 10 16:26:53 2008 +0000
@@ -22,6 +22,7 @@
 00:19=Teleportation
 00:20=Switch Hedgehog
 00:21=Mortar
+00:22=Whip
 
 01:00=Let's fight!
 01:01=Round draw
--- a/share/hedgewars/Data/Locale/pl.txt	Sat May 10 14:46:02 2008 +0000
+++ b/share/hedgewars/Data/Locale/pl.txt	Sat May 10 16:26:53 2008 +0000
@@ -22,6 +22,7 @@
 00:19=Teleportacja
 00:20=Zmień jeża
 00:21=Mortar
+00:22=Whip
 
 01:00=Walczmy!
 01:01=Remis
--- a/share/hedgewars/Data/Locale/ru.txt	Sat May 10 14:46:02 2008 +0000
+++ b/share/hedgewars/Data/Locale/ru.txt	Sat May 10 16:26:53 2008 +0000
@@ -22,6 +22,7 @@
 00:19=Телепортация
 00:20=Переключить ежа
 00:21=Миномёт
+00:22=Кнут
 
 01:00=Вперёд к победе!
 01:01=Ничья