From 4b9732d6c9377ecbf7e4449c2b3c400e5fb2aefa Mon Sep 17 00:00:00 2001 From: div0 Date: Mon, 27 Mar 2006 20:44:22 +0000 Subject: [PATCH] NixNex: renamed g_balance_nixnex_nextchange to g_balance_nixnex_roundtime; added g_balance_nixnex_incrtime (time between ammo increments) git-svn-id: svn://svn.icculus.org/nexuiz/trunk@1195 f962a42d-fe04-0410-a3ab-8c8b0445ebaa --- data/default.cfg | 19 ++++++++++--------- data/qcsrc/server/gamec/cl_weapons.c | 8 +++++--- 2 files changed, 15 insertions(+), 12 deletions(-) diff --git a/data/default.cfg b/data/default.cfg index f0e6d8c5e..94f9034a7 100644 --- a/data/default.cfg +++ b/data/default.cfg @@ -607,17 +607,18 @@ set urrebots_navopt "0" // you might want this: set g_start_weapon_laser 0 set g_nixnex 0 // TODO these need balancing: -set g_balance_nixnex_nextchange 25 +set g_balance_nixnex_roundtime 25 +set g_balance_nixnex_incrtime 1.6 // initial ammo -set g_balance_nixnex_ammo_shells 10 -set g_balance_nixnex_ammo_nails 30 -set g_balance_nixnex_ammo_rockets 10 -set g_balance_nixnex_ammo_cells 10 +set g_balance_nixnex_ammo_shells 15 +set g_balance_nixnex_ammo_nails 45 +set g_balance_nixnex_ammo_rockets 15 +set g_balance_nixnex_ammo_cells 15 // ammo increment per second -set g_balance_nixnex_ammoincr_shells 1 -set g_balance_nixnex_ammoincr_nails 3 -set g_balance_nixnex_ammoincr_rockets 1 -set g_balance_nixnex_ammoincr_cells 1 +set g_balance_nixnex_ammoincr_shells 2 +set g_balance_nixnex_ammoincr_nails 6 +set g_balance_nixnex_ammoincr_rockets 2 +set g_balance_nixnex_ammoincr_cells 2 // score log alias printstats "set _printstats 1" // print status on demand diff --git a/data/qcsrc/server/gamec/cl_weapons.c b/data/qcsrc/server/gamec/cl_weapons.c index 52f511edb..114b6effe 100644 --- a/data/qcsrc/server/gamec/cl_weapons.c +++ b/data/qcsrc/server/gamec/cl_weapons.c @@ -354,6 +354,7 @@ float nixnex_nextchange; float nixnex_nextweapon; .float nixnex_lastchange_id; .float nixnex_lastinfotime; +.float nixnex_nextincr; void Nixnex_ChooseNextWeapon() { @@ -411,7 +412,7 @@ void Nixnex_GiveCurrentWeapon() { nixnex_weapon = nixnex_nextweapon; nixnex_nextweapon = 0; - nixnex_nextchange = time + cvar("g_balance_nixnex_nextchange"); + nixnex_nextchange = time + cvar("g_balance_nixnex_roundtime"); } if(nixnex_nextchange != self.nixnex_lastchange_id) // this shall only be called once per round! @@ -431,12 +432,12 @@ void Nixnex_GiveCurrentWeapon() self.ammo_rockets = 999; self.ammo_cells = 999; } + self.nixnex_nextincr = time + cvar("g_balance_nixnex_incrtime"); if(dt >= 1 && dt <= 5) self.nixnex_lastinfotime = -42; else centerprint(self, strcat("\n\n^2Active weapon: ^3", W_Name(nixnex_weapon), "\n")); } - if(self.nixnex_lastinfotime != dt) { self.nixnex_lastinfotime = dt; // initial value 0 should count as "not seen" @@ -444,13 +445,14 @@ void Nixnex_GiveCurrentWeapon() centerprint(self, strcat("^3", ftos(dt), "^2 seconds until weapon change...\n\nNext weapon: ^3", W_Name(nixnex_nextweapon), "\n")); // this only happens once a second, so... - if(cvar("g_use_ammunition")) + if(cvar("g_use_ammunition") && time > self.nixnex_nextincr) { self.ammo_shells = self.ammo_shells + cvar("g_balance_nixnex_ammoincr_shells"); self.ammo_nails = self.ammo_nails + cvar("g_balance_nixnex_ammoincr_nails"); self.ammo_rockets = self.ammo_rockets + cvar("g_balance_nixnex_ammoincr_rockets"); self.ammo_cells = self.ammo_cells + cvar("g_balance_nixnex_ammoincr_cells"); weapon_action(self.weapon, WR_UPDATECOUNTS); + self.nixnex_nextincr = time + cvar("g_balance_nixnex_incrtime"); } } -- 2.39.2