r5298 - in trunk/data: . qcsrc/server
DONOTREPLY at icculus.org
DONOTREPLY at icculus.org
Wed Dec 24 12:21:35 EST 2008
Author: div0
Date: 2008-12-24 12:21:34 -0500 (Wed, 24 Dec 2008)
New Revision: 5298
Modified:
trunk/data/qcsrc/server/constants.qh
trunk/data/qcsrc/server/w_hook.qc
trunk/data/weapons.cfg
trunk/data/weaponsPro.cfg
Log:
hook patch from Roffnan
Modified: trunk/data/qcsrc/server/constants.qh
===================================================================
--- trunk/data/qcsrc/server/constants.qh 2008-12-24 15:27:27 UTC (rev 5297)
+++ trunk/data/qcsrc/server/constants.qh 2008-12-24 17:21:34 UTC (rev 5298)
@@ -1,5 +1,5 @@
string CVAR_CHECK_DEFAULT = "3a4552d8adffd3ad69fec3f0c15c62d8";
-string CVAR_CHECK_WEAPONS = "7abbcf55140e618bfaa97b587fc7aef7";
+string CVAR_CHECK_WEAPONS = "0ce586134eb7097440e850031829efe6";
float FALSE = 0;
float TRUE = 1;
Modified: trunk/data/qcsrc/server/w_hook.qc
===================================================================
--- trunk/data/qcsrc/server/w_hook.qc 2008-12-24 15:27:27 UTC (rev 5297)
+++ trunk/data/qcsrc/server/w_hook.qc 2008-12-24 17:21:34 UTC (rev 5298)
@@ -6,6 +6,8 @@
.float dmg_duration;
.float dmg_last;
.float hook_refire;
+.float hook_datehooked;
+.float hook_datehooked_delay;
void W_Hook_ExplodeThink (void)
{
@@ -107,6 +109,8 @@
float w_hook(float req)
{
+ float hooked_time_max, hooked_ammodecrease_delay;
+
if (req == WR_AIM)
{
// ... sorry ...
@@ -123,7 +127,7 @@
if not(self.items & IT_UNLIMITED_WEAPON_AMMO)
self.ammo_cells = self.ammo_cells - cvar("g_balance_hook_primary_ammo");
self.hook_state |= HOOK_FIRING;
- weapon_thinkf(WFRAME_FIRE1, cvar("g_balance_hook_primary_animtime"), w_ready);
+ weapon_thinkf(WFRAME_FIRE1, cvar("g_balance_hook_primary_animtime"), w_ready);
}
}
@@ -142,6 +146,36 @@
self.hook_refire = max(self.hook_refire, time + cvar("g_balance_hook_primary_refire"));
}
+ if(self.hook && self.hook.state == 1)
+ {
+ hooked_time_max = cvar("g_balance_hook_primary_hooked_time_max");
+ if (hooked_time_max > 0)
+ {
+ if ( time > self.hook_datehooked + hooked_time_max )
+ self.hook_state |= HOOK_REMOVING;
+ }
+
+ hooked_ammodecrease_delay = cvar("g_balance_hook_primary_hooked_ammodecrease_delay");
+ if (hooked_ammodecrease_delay > 0)
+ {
+ if ( time > self.hook_datehooked_delay + hooked_ammodecrease_delay )
+ {
+ if ( self.ammo_cells >= 1 )
+ {
+ self.ammo_cells -= 1;
+ self.hook_datehooked_delay = time;
+ }
+ else
+ {
+ self.hook_state |= HOOK_REMOVING;
+ W_SwitchWeapon_Force(self, w_getbestweapon(self));
+ }
+ }
+ }
+ }
+ else
+ self.hook_datehooked = self.hook_datehooked_delay = time;
+
if (self.BUTTON_CROUCH)
{
self.hook_state &~= HOOK_PULLING;
@@ -185,7 +219,11 @@
}
else if (req == WR_CHECKAMMO1)
{
- return self.ammo_cells >= cvar("g_balance_hook_primary_ammo");
+ if ( cvar("g_balance_hook_primary_hooked_ammodecrease_delay") > 0 )
+ if not(cvar("g_balance_hook_primary_ammo"))
+ return self.ammo_cells >= cvar("g_balance_hook_primary_ammo") + 1;
+
+ return self.ammo_cells >= cvar("g_balance_hook_primary_ammo");
}
else if (req == WR_CHECKAMMO2)
{
Modified: trunk/data/weapons.cfg
===================================================================
--- trunk/data/weapons.cfg 2008-12-24 15:27:27 UTC (rev 5297)
+++ trunk/data/weapons.cfg 2008-12-24 17:21:34 UTC (rev 5298)
@@ -3,7 +3,7 @@
//
// And... don't forget to edit weaponsPro.cfg too.
-set cvar_check_weapons 7abbcf55140e618bfaa97b587fc7aef7
+set cvar_check_weapons 0ce586134eb7097440e850031829efe6
set g_start_weapon_laser 1
set g_start_weapon_shotgun 1
@@ -241,9 +241,11 @@
set g_balance_portal_lifetime 15 // these get recharged whenever the portal is used
// TESTING: on-hand hook with bomb
-set g_balance_hook_primary_ammo 0 // hook monkeys
+set g_balance_hook_primary_ammo 1 // hook monkeys
set g_balance_hook_primary_refire 0 // hook monkeys
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_ammodecrease_delay 2.5 // no ammo used if nagative or 0
set g_balance_hook_secondary_damage 25 // not much
set g_balance_hook_secondary_edgedamage 5 // not much
set g_balance_hook_secondary_radius 500 // LOTS
Modified: trunk/data/weaponsPro.cfg
===================================================================
--- trunk/data/weaponsPro.cfg 2008-12-24 15:27:27 UTC (rev 5297)
+++ trunk/data/weaponsPro.cfg 2008-12-24 17:21:34 UTC (rev 5298)
@@ -1,4 +1,4 @@
-set cvar_check_weapons 7abbcf55140e618bfaa97b587fc7aef7
+set cvar_check_weapons 0ce586134eb7097440e850031829efe6
set g_start_weapon_laser 1
set g_start_weapon_shotgun 1
@@ -236,9 +236,11 @@
set g_balance_portal_lifetime 15 // these get recharged whenever the portal is used
// TESTING: on-hand hook with bomb
-set g_balance_hook_primary_ammo 0 // hook monkeys
+set g_balance_hook_primary_ammo 1 // hook monkeys
set g_balance_hook_primary_refire 0 // hook monkeys
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_ammodecrease_delay 2.5 // no ammo used if nagative or 0
set g_balance_hook_secondary_damage 25 // not much
set g_balance_hook_secondary_edgedamage 5 // not much
set g_balance_hook_secondary_radius 500 // LOTS
More information about the nexuiz-commits
mailing list