# HG changeset patch
# User Wuzzy <Wuzzy2@mail.ru>
# Date 1520642811 -3600
# Node ID 44351ea57b71b799f1e17eaeae15635b46d38c01
# Parent  2a53b598c1aebadcbbe010544550c061b7f7232e
Minigun: Move attack timer to Karma to make gear type more Lua-friendly

diff -r 2a53b598c1ae -r 44351ea57b71 hedgewars/uGearsHandlersMess.pas
--- a/hedgewars/uGearsHandlersMess.pas	Sat Mar 10 01:28:15 2018 +0100
+++ b/hedgewars/uGearsHandlersMess.pas	Sat Mar 10 01:46:51 2018 +0100
@@ -6741,7 +6741,7 @@
         HHGear^.Message := HHGear^.Message and (not (gmUp or gmDown));
         HHGear^.State := HHGear^.State or gstNotKickable;
 
-        Gear^.Timer := 3451;
+        Gear^.Timer := Gear^.Karma;
         Gear^.WDTimer := 0; // Order of the next bullet;
         ClearHitOrder();
         Gear^.doStep := @doStepMinigunWork
diff -r 2a53b598c1ae -r 44351ea57b71 hedgewars/uGearsList.pas
--- a/hedgewars/uGearsList.pas	Sat Mar 10 01:28:15 2018 +0100
+++ b/hedgewars/uGearsList.pas	Sat Mar 10 01:46:51 2018 +0100
@@ -746,8 +746,12 @@
                 gear^.Density:= _0_5;
                 gear^.AdvBounce:= 1;
                 end;
-       gtMinigun: begin
-                if gear^.Timer = 0 then gear^.Timer:= 601;
+     gtMinigun: begin
+                // Timer. First, it's the timer before shooting. Then it will become the shooting timer and is set to Karma
+                if gear^.Timer = 0 then
+                    gear^.Timer:= 601;
+                // minigun shooting time. 1 bullet is fired every 50ms
+                gear^.Karma:= 3451;
                 end;
  gtMinigunBullet: begin
                 gear^.Radius:= 1;