From: Mario <mario@smbclan.net>
Date: Wed, 3 Feb 2016 23:53:02 +0000 (+1000)
Subject: Add an option to allow re-fire right after releasing the button, rather than waiting... 
X-Git-Tag: xonotic-v0.8.2~1205
X-Git-Url: https://git.rm.cloudns.org/?a=commitdiff_plain;h=38b68bae7a959d48a76813393e0eaabb5975ec29;p=xonotic%2Fxonotic-data.pk3dir.git

Add an option to allow re-fire right after releasing the button, rather than waiting for the cooldown
---

diff --git a/bal-wep-nexuiz25.cfg b/bal-wep-nexuiz25.cfg
index c185c5ec72..bb7ab5f678 100644
--- a/bal-wep-nexuiz25.cfg
+++ b/bal-wep-nexuiz25.cfg
@@ -741,6 +741,7 @@ set g_balance_arc_beam_healing_aps 50
 set g_balance_arc_beam_healing_hmax 150
 set g_balance_arc_beam_healing_hps 50
 set g_balance_arc_cooldown 2.5
+set g_balance_arc_cooldown_release 1
 set g_balance_arc_overheat_max 5
 set g_balance_arc_overheat_min 3
 set g_balance_arc_beam_heat 1
diff --git a/bal-wep-overkill.cfg b/bal-wep-overkill.cfg
index 9f54315588..626ada04ea 100644
--- a/bal-wep-overkill.cfg
+++ b/bal-wep-overkill.cfg
@@ -764,6 +764,7 @@ set g_balance_arc_burst_healing_aps 100
 set g_balance_arc_burst_healing_hps 100
 set g_balance_arc_burst_heat 4
 set g_balance_arc_cooldown 2.5
+set g_balance_arc_cooldown_release 1
 set g_balance_arc_overheat_max 5
 set g_balance_arc_overheat_min 3
 set g_balance_arc_switchdelay_drop 0.3
diff --git a/bal-wep-samual.cfg b/bal-wep-samual.cfg
index e20a8700d4..5545c6502c 100644
--- a/bal-wep-samual.cfg
+++ b/bal-wep-samual.cfg
@@ -281,6 +281,7 @@ set g_balance_arc_burst_damage 500
 set g_balance_arc_burst_healing_aps 100
 set g_balance_arc_burst_healing_hps 100
 set g_balance_arc_cooldown 2.5
+set g_balance_arc_cooldown_release 1
 set g_balance_arc_overheat_max 5
 set g_balance_arc_overheat_min 3
 set g_balance_arc_beam_heat 1
diff --git a/bal-wep-xdf.cfg b/bal-wep-xdf.cfg
index f268507465..cf7a05f6b5 100644
--- a/bal-wep-xdf.cfg
+++ b/bal-wep-xdf.cfg
@@ -741,6 +741,7 @@ set g_balance_arc_beam_healing_aps 50
 set g_balance_arc_beam_healing_hmax 150
 set g_balance_arc_beam_healing_hps 50
 set g_balance_arc_cooldown 2.5
+set g_balance_arc_cooldown_release 1
 set g_balance_arc_overheat_max 5
 set g_balance_arc_overheat_min 3
 set g_balance_arc_beam_heat 1
diff --git a/bal-wep-xonotic.cfg b/bal-wep-xonotic.cfg
index 9ebab48989..07005ccc3f 100644
--- a/bal-wep-xonotic.cfg
+++ b/bal-wep-xonotic.cfg
@@ -741,6 +741,7 @@ set g_balance_arc_beam_healing_aps 50
 set g_balance_arc_beam_healing_hmax 150
 set g_balance_arc_beam_healing_hps 50
 set g_balance_arc_cooldown 2.5
+set g_balance_arc_cooldown_release 1
 set g_balance_arc_overheat_max 5
 set g_balance_arc_overheat_min 3
 set g_balance_arc_beam_heat 1
diff --git a/bal-wep-xpm.cfg b/bal-wep-xpm.cfg
index 9ebab48989..07005ccc3f 100644
--- a/bal-wep-xpm.cfg
+++ b/bal-wep-xpm.cfg
@@ -741,6 +741,7 @@ set g_balance_arc_beam_healing_aps 50
 set g_balance_arc_beam_healing_hmax 150
 set g_balance_arc_beam_healing_hps 50
 set g_balance_arc_cooldown 2.5
+set g_balance_arc_cooldown_release 1
 set g_balance_arc_overheat_max 5
 set g_balance_arc_overheat_min 3
 set g_balance_arc_beam_heat 1
diff --git a/qcsrc/common/weapons/weapon/arc.qc b/qcsrc/common/weapons/weapon/arc.qc
index 6f503d4243..531be194a5 100644
--- a/qcsrc/common/weapons/weapon/arc.qc
+++ b/qcsrc/common/weapons/weapon/arc.qc
@@ -57,6 +57,7 @@ CLASS(Arc, Weapon)
         P(class, prefix, burst_healing_hps, float, NONE) \
         P(class, prefix, burst_heat, float, NONE) /* heat increase per second (secondary) */ \
         P(class, prefix, cooldown, float, NONE) /* heat decrease per second when resting */ \
+        P(class, prefix, cooldown_release, float, NONE) /* delay weapon re-use when releasing button */ \
         P(class, prefix, overheat_max, float, NONE) /* maximum heat before jamming */ \
         P(class, prefix, overheat_min, float, NONE) /* minimum heat to wait for cooldown */ \
         P(class, prefix, switchdelay_drop, float, NONE) \
@@ -350,7 +351,8 @@ void W_Arc_Beam_Think()
 
 			if ( cooldown_speed )
 			{
-				self.owner.arc_overheat = time + self.beam_heat / cooldown_speed;
+				if ( WEP_CVAR(arc, cooldown_release) || (WEP_CVAR(arc, overheat_max) > 0 && self.beam_heat >= WEP_CVAR(arc, overheat_max)) )
+					self.owner.arc_overheat = time + self.beam_heat / cooldown_speed;
 				self.owner.arc_cooldown = cooldown_speed;
 			}