Oh, dudes :(
authorunc0rr
Wed, 23 Oct 2013 22:25:17 +0400
changeset 9573 49bca2fabbd3
parent 9571 273567816538
child 9575 45d2d1ce0174
Oh, dudes :( (reduce number of hacks; see, is it terribly hard to do it properly?)
hedgewars/uConsts.pas
hedgewars/uGears.pas
hedgewars/uGearsHandlersRope.pas
hedgewars/uVariables.pas
--- a/hedgewars/uConsts.pas	Wed Oct 23 12:46:29 2013 -0400
+++ b/hedgewars/uConsts.pas	Wed Oct 23 22:25:17 2013 +0400
@@ -250,6 +250,8 @@
     ammoprop_NeedTarget   = $00000004;
     ammoprop_ForwMsgs     = $00000008;
     ammoprop_AttackInMove = $00000010;
+    ammoprop_DoesntStopTimerWhileAttacking
+                          = $00000020;
     ammoprop_NoCrosshair  = $00000040;
     ammoprop_AttackingPut = $00000080;
     ammoprop_DontHold     = $00000100;
@@ -263,6 +265,8 @@
     ammoprop_OscAim       = $00010000;
     ammoprop_NoMoveAfter  = $00020000;
     ammoprop_Track        = $00040000;
+    ammoprop_DoesntStopTimerInMultiShoot
+                          = $00080000;
     ammoprop_NoRoundEnd   = $10000000;
 
     AMMO_INFINITE = 100;
--- a/hedgewars/uGears.pas	Wed Oct 23 12:46:29 2013 -0400
+++ b/hedgewars/uGears.pas	Wed Oct 23 22:25:17 2013 +0400
@@ -420,8 +420,10 @@
 
 if TurnTimeLeft > 0 then
     if CurrentHedgehog^.Gear <> nil then
-        if ((CurrentHedgehog^.Gear^.State and gstAttacking) = 0) and
-            not(isInMultiShoot and (CurrentHedgehog^.CurAmmoType in [amShotgun, amDEagle, amSniperRifle])) then
+        if (((CurrentHedgehog^.Gear^.State and gstAttacking) = 0)
+            or ((CurAmmoGear = nil) or ((Ammoz[CurrentHedgehog^.CurAmmoType].Ammo.Propz and ammoprop_DoesntStopTimerWhileAttacking) <> 0)))
+            and not(isInMultiShoot and ((Ammoz[CurrentHedgehog^.CurAmmoType].Ammo.Propz and ammoprop_DoesntStopTimerInMultiShoot) <> 0)) then
+            //(CurrentHedgehog^.CurAmmoType in [amShotgun, amDEagle, amSniperRifle])
                 begin
                 if (TurnTimeLeft = 5000)
                 and (cHedgehogTurnTime >= 10000)
--- a/hedgewars/uGearsHandlersRope.pas	Wed Oct 23 12:46:29 2013 -0400
+++ b/hedgewars/uGearsHandlersRope.pas	Wed Oct 23 22:25:17 2013 +0400
@@ -409,8 +409,6 @@
     HHGear: PGear;
     tx, ty, tt: hwFloat;
 begin
-    if (TurnTimeLeft > 0) then dec(TurnTimeLeft);
-
     Gear^.X := Gear^.X - Gear^.dX;
     Gear^.Y := Gear^.Y - Gear^.dY;
     Gear^.Elasticity := Gear^.Elasticity + _1;
--- a/hedgewars/uVariables.pas	Wed Oct 23 12:46:29 2013 -0400
+++ b/hedgewars/uVariables.pas	Wed Oct 23 22:25:17 2013 +0400
@@ -844,7 +844,8 @@
             Probability: 0;
             NumberInCase: 1;
             Ammo: (Propz: ammoprop_ForwMsgs or
-                          ammoprop_NeedUpDown;
+                          ammoprop_NeedUpDown or
+                          ammoprop_DoesntStopTimerInMultiShoot;
                 Count: AMMO_INFINITE;
                 NumPerTurn: 1;
                 Timer: 0;
@@ -925,7 +926,8 @@
                           ammoprop_AttackInMove or
                           ammoprop_Utility or
                           ammoprop_AltAttack or
-                          ammoprop_NeedUpDown;
+                          ammoprop_NeedUpDown or
+                          ammoprop_DoesntStopTimerWhileAttacking;
                     Count: 5;
                     NumPerTurn: 0;
                     Timer: 0;
@@ -977,7 +979,7 @@
             NameTex: nil;
             Probability: 20;
             NumberInCase: 2;
-            Ammo: (Propz: ammoprop_NeedUpDown;
+            Ammo: (Propz: ammoprop_NeedUpDown or ammoprop_DoesntStopTimerInMultiShoot;
                 Count: 3;
                 NumPerTurn: 3;
                 Timer: 0;
@@ -1739,9 +1741,10 @@
             NameTex: nil;
             Probability: 20;
             NumberInCase: 2;
-            Ammo: (Propz: ammoprop_NeedUpDown or 
+            Ammo: (Propz: ammoprop_NeedUpDown or
                     ammoprop_OscAim or
-                    ammoprop_NoMoveAfter;
+                    ammoprop_NoMoveAfter or
+                    ammoprop_DoesntStopTimerInMultiShoot;
                 Count: 2;
                 NumPerTurn: 1;
                 Timer: 0;