Merge remote-tracking branch 'origin/Mario/hook_refire'
authorRudolf Polzer <divverent@xonotic.org>
Wed, 4 Jun 2014 09:32:05 +0000 (11:32 +0200)
committerRudolf Polzer <divverent@xonotic.org>
Wed, 4 Jun 2014 09:32:05 +0000 (11:32 +0200)
* origin/Mario/hook_refire:
  Add a new cvar for offhand hook refire
  Obey refire delay in offhand hook mode
  Also add delay to Nexuiz balance
  Add a 0.2 second delay on grappling hook to prevent spam

balance25.cfg
balanceFruitieX.cfg
balanceXDF.cfg
balanceXPM.cfg
balanceXonotic.cfg
qcsrc/server/autocvars.qh
qcsrc/server/g_hook.qc

index f0cc7d7..be0e84f 100644 (file)
@@ -223,6 +223,7 @@ set g_balance_grapplehook_stretch 50
 set g_balance_grapplehook_airfriction 0.2
 set g_balance_grapplehook_health 130
 set g_balance_grapplehook_damagedbycontents 0
+set g_balance_grapplehook_refire 0.2
 // }}}
 
 // {{{ weapon properties
@@ -629,7 +630,7 @@ set g_balance_portal_lifetime 15 // these get recharged whenever the portal is u
 // }}}
 // {{{ hook
 set g_balance_hook_primary_fuel 5 // hook monkeys set 0
-set g_balance_hook_primary_refire 0 // hook monkeys set 0
+set g_balance_hook_primary_refire 0.2 // hook monkeys set 0
 set g_balance_hook_primary_animtime 0.3 // good shoot anim
 set g_balance_hook_primary_hooked_time_max 0 // infinite
 set g_balance_hook_primary_hooked_time_free 2 // 2s being hooked are free
index 948d7e4..99d458d 100644 (file)
@@ -223,6 +223,7 @@ set g_balance_grapplehook_stretch 50
 set g_balance_grapplehook_airfriction 0.2
 set g_balance_grapplehook_health 130
 set g_balance_grapplehook_damagedbycontents 0
+set g_balance_grapplehook_refire 0.2
 // }}}
 
 // {{{ weapon properties
@@ -629,7 +630,7 @@ set g_balance_portal_lifetime 15 // these get recharged whenever the portal is u
 // }}}
 // {{{ hook
 set g_balance_hook_primary_fuel 5 // hook monkeys set 0
-set g_balance_hook_primary_refire 0 // hook monkeys set 0
+set g_balance_hook_primary_refire 0.2 // hook monkeys set 0
 set g_balance_hook_primary_animtime 0.2 // good shoot anim
 set g_balance_hook_primary_hooked_time_max 0 // infinite
 set g_balance_hook_primary_hooked_time_free 2 // 2s being hooked are free
index b7d3e02..41d1936 100644 (file)
@@ -223,6 +223,7 @@ set g_balance_grapplehook_stretch 50
 set g_balance_grapplehook_airfriction 0.2
 set g_balance_grapplehook_health 130
 set g_balance_grapplehook_damagedbycontents 0
+set g_balance_grapplehook_refire 0.2
 // }}}
 
 // {{{ weapon properties
@@ -629,7 +630,7 @@ set g_balance_portal_lifetime 15 // these get recharged whenever the portal is u
 // }}}
 // {{{ hook
 set g_balance_hook_primary_fuel 5 // hook monkeys set 0
-set g_balance_hook_primary_refire 0 // hook monkeys set 0
+set g_balance_hook_primary_refire 0.2 // hook monkeys set 0
 set g_balance_hook_primary_animtime 0.3 // good shoot anim
 set g_balance_hook_primary_hooked_time_max 0 // infinite
 set g_balance_hook_primary_hooked_time_free 2 // 2s being hooked are free
index 843e16a..f560aee 100644 (file)
@@ -223,6 +223,7 @@ set g_balance_grapplehook_stretch 50
 set g_balance_grapplehook_airfriction 0.2
 set g_balance_grapplehook_health 50
 set g_balance_grapplehook_damagedbycontents 1
+set g_balance_grapplehook_refire 0.2
 // }}}
 
 // {{{ weapon properties
@@ -629,7 +630,7 @@ set g_balance_portal_lifetime 15 // these get recharged whenever the portal is u
 // }}}
 // {{{ hook
 set g_balance_hook_primary_fuel 5 // hook monkeys set 0
-set g_balance_hook_primary_refire 0 // hook monkeys set 0
+set g_balance_hook_primary_refire 0.2 // hook monkeys set 0
 set g_balance_hook_primary_animtime 0.3 // good shoot anim
 set g_balance_hook_primary_hooked_time_max 0 // infinite
 set g_balance_hook_primary_hooked_time_free 2 // 2s being hooked are free
index de865fa..1988015 100644 (file)
@@ -223,6 +223,7 @@ set g_balance_grapplehook_stretch 50
 set g_balance_grapplehook_airfriction 0.2
 set g_balance_grapplehook_health 50
 set g_balance_grapplehook_damagedbycontents 1
+set g_balance_grapplehook_refire 0.2
 // }}}
 
 // {{{ weapon properties
@@ -629,7 +630,7 @@ set g_balance_portal_lifetime 15 // these get recharged whenever the portal is u
 // }}}
 // {{{ hook
 set g_balance_hook_primary_fuel 5 // hook monkeys set 0
-set g_balance_hook_primary_refire 0 // hook monkeys set 0
+set g_balance_hook_primary_refire 0.2 // hook monkeys set 0
 set g_balance_hook_primary_animtime 0.3 // good shoot anim
 set g_balance_hook_primary_hooked_time_max 0 // infinite
 set g_balance_hook_primary_hooked_time_free 2 // 2s being hooked are free
index ee7d24d..080d701 100644 (file)
@@ -260,6 +260,7 @@ float autocvar_g_balance_grapplehook_speed_fly;
 float autocvar_g_balance_grapplehook_speed_pull;
 float autocvar_g_balance_grapplehook_stretch;
 float autocvar_g_balance_grapplehook_damagedbycontents;
+float autocvar_g_balance_grapplehook_refire;
 float autocvar_g_balance_grenadelauncher_bouncefactor;
 float autocvar_g_balance_grenadelauncher_bouncestop;
 float autocvar_g_balance_grenadelauncher_primary_ammo;
index 0df6ba0..4e1b634 100644 (file)
@@ -383,7 +383,7 @@ void GrapplingHookFrame()
                // offhand hook controls
                if(self.BUTTON_HOOK)
                {
-                       if (!(self.hook || (self.hook_state & HOOK_WAITING_FOR_RELEASE)))
+                       if (!(self.hook || (self.hook_state & HOOK_WAITING_FOR_RELEASE)) && (time > self.hook_refire))
                        {
                                self.hook_state |= HOOK_FIRING;
                                self.hook_state |= HOOK_WAITING_FOR_RELEASE;
@@ -426,6 +426,7 @@ void GrapplingHookFrame()
                        RemoveGrapplingHook(self);
                FireGrapplingHook();
                self.hook_state &= ~HOOK_FIRING;
+               self.hook_refire = max(self.hook_refire, time + autocvar_g_balance_grapplehook_refire * W_WeaponRateFactor());
        }
        else if(self.hook_state & HOOK_REMOVING)
        {