From cb36d9a476cf05ed021b0b4e81ab2cfb701fc52c Mon Sep 17 00:00:00 2001 From: vermeulenl Date: Thu, 24 Feb 2005 07:48:46 +0000 Subject: [PATCH] Got rid of the gamecfgs stuff, added timing for the weapon switch, add savage's secret door code, updated todo git-svn-id: svn://svn.icculus.org/nexuiz/trunk@307 f962a42d-fe04-0410-a3ab-8c8b0445ebaa --- qcsrc/gamec/GameC.dsp | 4 + qcsrc/gamec/cl_client.c | 27 ++-- qcsrc/gamec/cl_physics.c | 5 +- qcsrc/gamec/cl_player.c | 5 +- qcsrc/gamec/cl_weaponsystem.c | 4 +- qcsrc/gamec/constants.h | 14 +- qcsrc/gamec/defs.h | 2 +- qcsrc/gamec/g_damage.c | 2 +- qcsrc/gamec/g_triggers.c | 221 ++++++++++++++++++++++++++++++++ qcsrc/gamec/t_items.c | 2 +- qcsrc/gamec/w_common.c | 2 +- qcsrc/gamec/w_crylink.c | 4 +- qcsrc/gamec/w_electro.c | 4 +- qcsrc/gamec/w_grenadelauncher.c | 4 +- qcsrc/gamec/w_hagar.c | 4 +- qcsrc/gamec/w_laser.c | 4 +- qcsrc/gamec/w_nex.c | 6 +- qcsrc/gamec/w_rocketlauncher.c | 6 +- qcsrc/gamec/w_shotgun.c | 4 +- qcsrc/gamec/w_uzi.c | 4 +- 20 files changed, 268 insertions(+), 60 deletions(-) diff --git a/qcsrc/gamec/GameC.dsp b/qcsrc/gamec/GameC.dsp index 602d05e13..46359d545 100644 --- a/qcsrc/gamec/GameC.dsp +++ b/qcsrc/gamec/GameC.dsp @@ -217,6 +217,10 @@ SOURCE=.\g_decors.c # End Source File # Begin Source File +SOURCE=.\g_lights.c +# End Source File +# Begin Source File + SOURCE=.\g_subs.c # End Source File # Begin Source File diff --git a/qcsrc/gamec/cl_client.c b/qcsrc/gamec/cl_client.c index b7d37b516..b51389f1b 100644 --- a/qcsrc/gamec/cl_client.c +++ b/qcsrc/gamec/cl_client.c @@ -76,7 +76,7 @@ void PutClientInServer (void) self.flags = FL_CLIENT; self.takedamage = DAMAGE_YES; self.effects = 0; - self.health = 150; + self.health = cvar("g_balance_health"); self.damageforcescale = 2; self.death_time = 0; self.dead_time = 0; @@ -117,7 +117,7 @@ void PutClientInServer (void) // self.items = IT_LASER | IT_UZI| IT_SHOTGUN | IT_GRENADE_LAUNCHER | IT_ELECTRO | IT_CRYLINK | IT_NEX | IT_HAGAR | IT_ROCKET_LAUNCHER; // self.weapon = IT_UZI; - if (game & GAME_INSTAGIB) + if (cvar("g_instagib") == 1) { self.items = IT_NEX; self.switchweapon = WEP_NEX; @@ -126,7 +126,7 @@ void PutClientInServer (void) self.ammo_rockets = 0; self.ammo_cells = 999; } - else if (game & GAME_ROCKET_ARENA) + else if (cvar("g_rocketarena") == 1) { self.items = IT_ROCKET_LAUNCHER; self.switchweapon = WEP_ROCKET_LAUNCHER; @@ -139,13 +139,13 @@ void PutClientInServer (void) { self.items = IT_LASER | IT_SHOTGUN; self.switchweapon = WEP_SHOTGUN; - self.ammo_shells = 25; + self.ammo_shells = 35; self.ammo_nails = 0; self.ammo_rockets = 0; self.ammo_cells = 0; } - if (game & GAME_FULLBRIGHT_PLAYERS) + if (cvar("g_fullbrightplayers") == 1) self.effects = EF_FULLBRIGHT; self.event_damage = PlayerDamage; @@ -253,7 +253,7 @@ void PlayerJump (void) if (self.items & IT_SPEED) self.velocity_z = self.velocity_z + POWERUP_SPEED_JUMPVELOCITY; else - self.velocity_z = self.velocity_z + JUMP_VELOCITY; + self.velocity_z = self.velocity_z + cvar("g_balance_jumpheight"); self.flags = self.flags - FL_ONGROUND; self.flags = self.flags - FL_JUMPRELEASED; @@ -440,18 +440,9 @@ void player_powerups (void) void player_regen (void) { - // GAME_REGENERATION does fast health regeneration up to 200. Note that your armour doesn't rot anymore either. - if (game & GAME_REGENERATION) - { - self.health = self.health + (200 - self.health) * 0.2 * frametime; - self.armorvalue = bound(0, self.armorvalue, 1000); - } - else - { - self.health = bound(0, self.health + (100 - self.health) * 0.05 * frametime, 1000); - if (self.armorvalue > 100) - self.armorvalue = bound(100, self.armorvalue + (100 - self.armorvalue) * 0.1 * frametime, 1000); - } + self.health = bound(0, self.health + (100 - self.health) * cvar("g_balance_healthregen") * frametime, 1000); + if (self.armorvalue > 100) + self.armorvalue = bound(100, self.armorvalue + (100 - self.armorvalue) * cvar("g_balance_armorrott") * frametime, 1000); } /* diff --git a/qcsrc/gamec/cl_physics.c b/qcsrc/gamec/cl_physics.c index 96a4ac156..133294e9a 100644 --- a/qcsrc/gamec/cl_physics.c +++ b/qcsrc/gamec/cl_physics.c @@ -153,9 +153,8 @@ void SV_PlayerPhysics() self.velocity = self.velocity * f; } } - else if (!(game & GAME_NO_AIR_CONTROL)) - if (wishspeed > 50) - wishspeed = 50; + else if (wishspeed > cvar("g_balance_maxairspeed")) + wishspeed = cvar("g_balance_maxairspeed"); //sv_accelerate = sv_accelerate * 0.1; self.velocity = self.velocity + wishdir * sv_accelerate * frametime * wishspeed; diff --git a/qcsrc/gamec/cl_player.c b/qcsrc/gamec/cl_player.c index 6c32d8326..8cb5484f9 100644 --- a/qcsrc/gamec/cl_player.c +++ b/qcsrc/gamec/cl_player.c @@ -102,7 +102,7 @@ void SpawnThrownWeapon (vector org, float w) { local entity oldself; - if (game & (GAME_INSTAGIB | GAME_ROCKET_ARENA)) + if ((cvar("g_instagib") == 1) | (cvar("g_rocketarena") == 1)) return; if (w == IT_LASER) return; @@ -185,9 +185,6 @@ void PlayerCorpseDamage (entity inflictor, entity attacker, float damage, float void PlayerDamage (entity inflictor, entity attacker, float damage, float deathtype, vector hitloc, vector force) { local float take, save; - if (attacker == self) - if (game & GAME_NO_SELF_DAMAGE) - return; te_blood (hitloc, force, damage); if (self.pain_finished < time) //Don't switch pain sequences like crazy diff --git a/qcsrc/gamec/cl_weaponsystem.c b/qcsrc/gamec/cl_weaponsystem.c index 8e7dd3c80..36727aa06 100644 --- a/qcsrc/gamec/cl_weaponsystem.c +++ b/qcsrc/gamec/cl_weaponsystem.c @@ -166,7 +166,7 @@ void(float x, float y, float z) weapon_shotdir = void(float() checkfunc1, float() checkfunc2, void() firefunc, float atktime) weapon_prepareattack = { // Change to best weapon if failed - if (!(game & GAME_INSTAGIB) && !(game & GAME_ROCKET_ARENA)) + if ((cvar("g_instagib") == 0) && (cvar("g_rocketarena") == 0)) { if (!checkfunc1()) { @@ -190,7 +190,7 @@ void(float() checkfunc1, float() checkfunc2, void() firefunc, float atktime) wea void(float() checkfunc1, float() checkfunc2, void() firefunc) weapon_doattack { // Change to best weapon if failed - if (!(game & GAME_INSTAGIB) && !(game & GAME_ROCKET_ARENA)) + if ((cvar("g_instagib") == 0) && (cvar("g_rocketarena") == 0)) { if (!checkfunc1()) { diff --git a/qcsrc/gamec/constants.h b/qcsrc/gamec/constants.h index 3f95ec0c0..732bdda99 100644 --- a/qcsrc/gamec/constants.h +++ b/qcsrc/gamec/constants.h @@ -165,14 +165,10 @@ vector PL_MAX = '16 16 45'; // Sajt - added these, just as constants. Not sure how you want them actually put in the game, but I just // did this so at least they worked // NOTE: instagib IS NOT compatible with rocket-arena, so make sure to prevent selecting both in a menu -float GAME_INSTAGIB = 1; /// everyone gets the nex gun with infinite ammo, and one shot kills -float GAME_SPAWNPROTECTION = 2; /// no time between shots for any gun -float GAME_REGENERATION = 4; /// Fast health regeneration -float GAME_NO_SELF_DAMAGE = 8; /// no self damage, so rocket jumping and such can be used a lot more -float GAME_ROCKET_ARENA = 16; /// Everyone starts with a rocket launcher -float GAME_NO_AIR_CONTROL = 32; /// turns off air control -float GAME_FULLBRIGHT_PLAYERS = 64; /// makes the players model fullbright -float GAME_TEAMS = 128; /// Teams, red/green/yellow/blue +//float GAME_INSTAGIB = 1; /// everyone gets the nex gun with infinite ammo, and one shot kills +//float GAME_ROCKET_ARENA = 16; /// Everyone starts with a rocket launcher +//float GAME_FULLBRIGHT_PLAYERS = 64; /// makes the players model fullbright +//float GAME_TEAMS = 128; /// Teams, red/green/yellow/blue float game; // set to "gamecfg" on worldspawn @@ -180,7 +176,7 @@ float game; // set to "gamecfg" on worldspawn float POWERUP_SPEED_MOVEMENT = 3; // movement multiplier for speed powerup float POWERUP_SPEED_JUMPVELOCITY = 640; // how much jump velocity with speed powerup -float JUMP_VELOCITY = 300; // normal jump velocity +//float JUMP_VELOCITY = ; // normal jump velocity float POWERUP_STRENGTH_DAMAGE = 2; // damage multiplier for strength powerup float POWERUP_STRENGTH_FORCE = 4; // force multiplier for strength powerup diff --git a/qcsrc/gamec/defs.h b/qcsrc/gamec/defs.h index eb4e2f412..486c41cc4 100644 --- a/qcsrc/gamec/defs.h +++ b/qcsrc/gamec/defs.h @@ -97,7 +97,7 @@ void() w_clear; .vector shotdir, shotorg; // new generic aiming system for all weapons (not finished yet, can be removed) float weapon_hasammo; // sets by WR_CHECKAMMO request -float PLAYER_WEAPONSELECTION_DELAY = 0.3; +//float PLAYER_WEAPONSELECTION_DELAY = ); float PLAYER_WEAPONSELECTION_SPEED = 18; vector PLAYER_WEAPONSELECTION_RANGE = '0 20 -40'; diff --git a/qcsrc/gamec/g_damage.c b/qcsrc/gamec/g_damage.c index bb99ea23a..e3f565800 100644 --- a/qcsrc/gamec/g_damage.c +++ b/qcsrc/gamec/g_damage.c @@ -135,7 +135,7 @@ void RadiusDamage (entity inflictor, entity attacker, float coredamage, float ed finaldmg = coredamage * power + edgedamage * (1 - power); force = normalize((m1 + m2) * 0.5 - blastorigin) * (finaldmg / coredamage) * forceintensity; if (targ == attacker) - finaldmg = finaldmg * 0.6; // Partial damage if the attacker hits himself + finaldmg = finaldmg * cvar("g_balance_selfdamagepercent"); // Partial damage if the attacker hits himself if (finaldmg > 0) Damage (targ, inflictor, attacker, finaldmg, deathtype, inflictor.origin, force); } diff --git a/qcsrc/gamec/g_triggers.c b/qcsrc/gamec/g_triggers.c index 647bd81ea..32f051bce 100644 --- a/qcsrc/gamec/g_triggers.c +++ b/qcsrc/gamec/g_triggers.c @@ -424,3 +424,224 @@ void() func_sparks = ambientsound (self.origin, self.noise, 1, ATTN_STATIC); } } + + + +/* +============================================================================= + +SECRET DOORS + +============================================================================= +*/ + +void() fd_secret_move1; +void() fd_secret_move2; +void() fd_secret_move3; +void() fd_secret_move4; +void() fd_secret_move5; +void() fd_secret_move6; +void() fd_secret_done; + +float SECRET_OPEN_ONCE = 1; // stays open +float SECRET_1ST_LEFT = 2; // 1st move is left of arrow +float SECRET_1ST_DOWN = 4; // 1st move is down from arrow +float SECRET_NO_SHOOT = 8; // only opened by trigger +float SECRET_YES_SHOOT = 16; // shootable even if targeted + + +void () fd_secret_use = +{ + local float temp; + + self.health = 10000; + //self.havocattack = TRUE; + + // exit if still moving around... + if (self.origin != self.oldorigin) + return; + + self.message = ""; // no more message + + SUB_UseTargets(); // fire all targets / killtargets + + self.velocity = '0 0 0'; + + // Make a sound, wait a little... + + if (self.noise1 != "") + sound(self, CHAN_VOICE, self.noise1, 1, ATTN_NORM); + self.nextthink = self.ltime + 0.1; + + temp = 1 - (self.spawnflags & SECRET_1ST_LEFT); // 1 or -1 + makevectors(self.mangle); + + if (!self.t_width) + { + if (self.spawnflags & SECRET_1ST_DOWN) + self.t_width = fabs(v_up * self.size); + else + self.t_width = fabs(v_right * self.size); + } + + if (!self.t_length) + self.t_length = fabs(v_forward * self.size); + + if (self.spawnflags & SECRET_1ST_DOWN) + self.dest1 = self.origin - v_up * self.t_width; + else + self.dest1 = self.origin + v_right * (self.t_width * temp); + + self.dest2 = self.dest1 + v_forward * self.t_length; + SUB_CalcMove(self.dest1, self.speed, fd_secret_move1); + if (self.noise2 != "") + sound(self, CHAN_VOICE, self.noise2, 1, ATTN_NORM); +}; + +// Wait after first movement... +void () fd_secret_move1 = +{ + self.nextthink = self.ltime + 1.0; + self.think = fd_secret_move2; + if (self.noise3 != "") + sound(self, CHAN_VOICE, self.noise3, 1, ATTN_NORM); +}; + +// Start moving sideways w/sound... +void () fd_secret_move2 = +{ + if (self.noise2 != "") + sound(self, CHAN_VOICE, self.noise2, 1, ATTN_NORM); + SUB_CalcMove(self.dest2, self.speed, fd_secret_move3); +}; + +// Wait here until time to go back... +void () fd_secret_move3 = +{ + if (self.noise3 != "") + sound(self, CHAN_VOICE, self.noise3, 1, ATTN_NORM); + if (!(self.spawnflags & SECRET_OPEN_ONCE)) + { + self.nextthink = self.ltime + self.wait; + self.think = fd_secret_move4; + } +}; + +// Move backward... +void () fd_secret_move4 = +{ + if (self.noise2 != "") + sound(self, CHAN_VOICE, self.noise2, 1, ATTN_NORM); + SUB_CalcMove(self.dest1, self.speed, fd_secret_move5); +}; + +// Wait 1 second... +void () fd_secret_move5 = +{ + self.nextthink = self.ltime + 1.0; + self.think = fd_secret_move6; + if (self.noise3 != "") + sound(self, CHAN_VOICE, self.noise3, 1, ATTN_NORM); +}; + +void () fd_secret_move6 = +{ + if (self.noise2 != "") + sound(self, CHAN_VOICE, self.noise2, 1, ATTN_NORM); + SUB_CalcMove(self.oldorigin, self.speed, fd_secret_done); +}; + +void () fd_secret_done = +{ + if (!self.targetname || self.spawnflags&SECRET_YES_SHOOT) + { + self.health = 10000; + self.takedamage = DAMAGE_YES; + //self.th_pain = fd_secret_use; + } + if (self.noise3 != "") + sound(self, CHAN_VOICE, self.noise3, 1, ATTN_NORM); +}; + +void () secret_blocked = +{ + if (time < self.attack_finished) + return; + self.attack_finished = time + 0.5; + //T_Damage (other, self, self, self.dmg, self.dmg, self.deathtype, DT_IMPACT, (self.absmin + self.absmax) * 0.5, '0 0 0', Obituary_Generic); +}; + +/* +============== +secret_touch + +Prints messages +================ +*/ +void() secret_touch = +{ + if (activator.classname != "player") + return; + if (self.attack_finished > time) + return; + + self.attack_finished = time + 2; + + if (self.message) + { + if (other.flags & FL_CLIENT) + centerprint (other, self.message); + sound (other, CHAN_BODY, "misc/talk.wav", 1, ATTN_NORM); + } +}; + + +/*QUAKED func_door_secret (0 .5 .8) ? open_once 1st_left 1st_down no_shoot always_shoot +Basic secret door. Slides back, then to the side. Angle determines direction. +wait = # of seconds before coming back +1st_left = 1st move is left of arrow +1st_down = 1st move is down from arrow +always_shoot = even if targeted, keep shootable +t_width = override WIDTH to move back (or height if going down) +t_length = override LENGTH to move sideways +"dmg" damage to inflict when blocked (2 default) + +If a secret door has a targetname, it will only be opened by it's botton or trigger, not by damage. +"sounds" +1) medieval +2) metal +3) base +*/ + +void () func_door_secret = +{ + /*if (!self.deathtype) // map makers can override this + self.deathtype = " got in the way";*/ + + if (!self.dmg) + self.dmg = 2; + + // Magic formula... + self.mangle = self.angles; + self.angles = '0 0 0'; + self.solid = SOLID_BSP; + self.movetype = MOVETYPE_PUSH; + self.classname = "door"; + setmodel (self, self.model); + setorigin (self, self.origin); + + self.touch = secret_touch; + self.blocked = secret_blocked; + self.speed = 50; + self.use = fd_secret_use; + if ( !self.targetname || self.spawnflags&SECRET_YES_SHOOT) + { + self.health = 10000; + self.takedamage = DAMAGE_YES; + self.event_damage = fd_secret_use; + } + self.oldorigin = self.origin; + if (!self.wait) + self.wait = 5; // 5 seconds before closing +}; + diff --git a/qcsrc/gamec/t_items.c b/qcsrc/gamec/t_items.c index 3a315ea3d..4a0fa4ca3 100644 --- a/qcsrc/gamec/t_items.c +++ b/qcsrc/gamec/t_items.c @@ -85,7 +85,7 @@ void Item_Touch (void) void StartItem (string itemmodel, string pickupsound, float defaultrespawntime, string itemname, float itemid, float itemflags) { - if (game & (GAME_INSTAGIB | GAME_ROCKET_ARENA)) + if ((cvar("g_instagib") == 1) | (cvar("g_rocketarena") == 1)) { remove (self); return; diff --git a/qcsrc/gamec/w_common.c b/qcsrc/gamec/w_common.c index 990e9d0ba..ed713ff8a 100644 --- a/qcsrc/gamec/w_common.c +++ b/qcsrc/gamec/w_common.c @@ -350,7 +350,7 @@ void W_PreviousWeapon (void) */ float W_CheckAmmo (void) { - if (game & (GAME_INSTAGIB | GAME_ROCKET_ARENA)) + if ((cvar("g_instagib") == 1) | (cvar("g_rocketarena") == 1)) return TRUE; W_UpdateAmmo (); diff --git a/qcsrc/gamec/w_crylink.c b/qcsrc/gamec/w_crylink.c index 55693e5d7..818ba92f2 100644 --- a/qcsrc/gamec/w_crylink.c +++ b/qcsrc/gamec/w_crylink.c @@ -135,8 +135,8 @@ void W_Crylink_Attack2 (void) // weapon frames void() crylink_ready_01 = {weapon_thinkf(WFRAME_IDLE, 0.1, crylink_ready_01); self.weaponentity.state = WS_READY;}; -void() crylink_select_01 = {weapon_thinkf(-1, PLAYER_WEAPONSELECTION_DELAY, w_ready); weapon_boblayer1(PLAYER_WEAPONSELECTION_SPEED, '0 0 0');}; -void() crylink_deselect_01 = {weapon_thinkf(-1, PLAYER_WEAPONSELECTION_DELAY, w_clear); weapon_boblayer1(PLAYER_WEAPONSELECTION_SPEED, PLAYER_WEAPONSELECTION_RANGE);}; +void() crylink_select_01 = {weapon_thinkf(-1, cvar("g_balance_weaponswitchdelay"), w_ready); weapon_boblayer1(PLAYER_WEAPONSELECTION_SPEED, '0 0 0');}; +void() crylink_deselect_01 = {weapon_thinkf(-1, cvar("g_balance_weaponswitchdelay"), w_clear); weapon_boblayer1(PLAYER_WEAPONSELECTION_SPEED, PLAYER_WEAPONSELECTION_RANGE);}; void() crylink_fire1_01 = { weapon_doattack(crylink_check, crylink_check, W_Crylink_Attack); diff --git a/qcsrc/gamec/w_electro.c b/qcsrc/gamec/w_electro.c index 0981f599c..37cce3311 100644 --- a/qcsrc/gamec/w_electro.c +++ b/qcsrc/gamec/w_electro.c @@ -181,8 +181,8 @@ void() W_Electro_Attack2 // weapon frames void() electro_ready_01 = {weapon_thinkf(WFRAME_IDLE, 0.1, electro_ready_01); self.weaponentity.state = WS_READY;}; -void() electro_select_01 = {weapon_thinkf(-1, PLAYER_WEAPONSELECTION_DELAY, w_ready); weapon_boblayer1(PLAYER_WEAPONSELECTION_SPEED, '0 0 0');}; -void() electro_deselect_01 = {weapon_thinkf(-1, PLAYER_WEAPONSELECTION_DELAY, w_clear); weapon_boblayer1(PLAYER_WEAPONSELECTION_SPEED, PLAYER_WEAPONSELECTION_RANGE);}; +void() electro_select_01 = {weapon_thinkf(-1, cvar("g_balance_weaponswitchdelay"), w_ready); weapon_boblayer1(PLAYER_WEAPONSELECTION_SPEED, '0 0 0');}; +void() electro_deselect_01 = {weapon_thinkf(-1, cvar("g_balance_weaponswitchdelay"), w_clear); weapon_boblayer1(PLAYER_WEAPONSELECTION_SPEED, PLAYER_WEAPONSELECTION_RANGE);}; void() electro_fire1_01 = { weapon_doattack(electro_check, electro_check, W_Electro_Attack); diff --git a/qcsrc/gamec/w_grenadelauncher.c b/qcsrc/gamec/w_grenadelauncher.c index ce8f7a56a..5711aaf02 100644 --- a/qcsrc/gamec/w_grenadelauncher.c +++ b/qcsrc/gamec/w_grenadelauncher.c @@ -128,8 +128,8 @@ void W_Grenade_Attack2 (void) // weapon frames void() glauncher_ready_01 = {weapon_thinkf(WFRAME_IDLE, 0.1, glauncher_ready_01); self.weaponentity.state = WS_READY;}; -void() glauncher_select_01 = {weapon_thinkf(-1, PLAYER_WEAPONSELECTION_DELAY, w_ready); weapon_boblayer1(PLAYER_WEAPONSELECTION_SPEED, '0 0 0');}; -void() glauncher_deselect_01 = {weapon_thinkf(-1, PLAYER_WEAPONSELECTION_DELAY, w_clear); weapon_boblayer1(PLAYER_WEAPONSELECTION_SPEED, PLAYER_WEAPONSELECTION_RANGE);}; +void() glauncher_select_01 = {weapon_thinkf(-1, cvar("g_balance_weaponswitchdelay"), w_ready); weapon_boblayer1(PLAYER_WEAPONSELECTION_SPEED, '0 0 0');}; +void() glauncher_deselect_01 = {weapon_thinkf(-1, cvar("g_balance_weaponswitchdelay"), w_clear); weapon_boblayer1(PLAYER_WEAPONSELECTION_SPEED, PLAYER_WEAPONSELECTION_RANGE);}; void() glauncher_fire1_01 = { weapon_doattack(glauncher_check, glauncher_check, W_Grenade_Attack); diff --git a/qcsrc/gamec/w_hagar.c b/qcsrc/gamec/w_hagar.c index d4bd2bafb..3b00a0e10 100644 --- a/qcsrc/gamec/w_hagar.c +++ b/qcsrc/gamec/w_hagar.c @@ -139,8 +139,8 @@ void W_Hagar_Attack2 (void) // weapon frames void() hagar_ready_01 = {weapon_thinkf(WFRAME_IDLE, 0.1, hagar_ready_01); self.weaponentity.state = WS_READY;}; -void() hagar_select_01 = {weapon_thinkf(-1, PLAYER_WEAPONSELECTION_DELAY, w_ready); weapon_boblayer1(PLAYER_WEAPONSELECTION_SPEED, '0 0 0');}; -void() hagar_deselect_01 = {weapon_thinkf(-1, PLAYER_WEAPONSELECTION_DELAY, w_clear); weapon_boblayer1(PLAYER_WEAPONSELECTION_SPEED, PLAYER_WEAPONSELECTION_RANGE);}; +void() hagar_select_01 = {weapon_thinkf(-1, cvar("g_balance_weaponswitchdelay"), w_ready); weapon_boblayer1(PLAYER_WEAPONSELECTION_SPEED, '0 0 0');}; +void() hagar_deselect_01 = {weapon_thinkf(-1, cvar("g_balance_weaponswitchdelay"), w_clear); weapon_boblayer1(PLAYER_WEAPONSELECTION_SPEED, PLAYER_WEAPONSELECTION_RANGE);}; void() hagar_fire1_01 = { weapon_doattack(hagar_check, hagar_check, W_Hagar_Attack); diff --git a/qcsrc/gamec/w_laser.c b/qcsrc/gamec/w_laser.c index d29a010b8..a0c641008 100644 --- a/qcsrc/gamec/w_laser.c +++ b/qcsrc/gamec/w_laser.c @@ -116,8 +116,8 @@ void W_Laser_Attack2 (void) // weapon frames void() laser_ready_01 = {weapon_thinkf(WFRAME_IDLE, 0.1, laser_ready_01); self.weaponentity.state = WS_READY;}; -void() laser_select_01 = {weapon_thinkf(-1, PLAYER_WEAPONSELECTION_DELAY, w_ready); weapon_boblayer1(PLAYER_WEAPONSELECTION_SPEED, '0 0 0');}; -void() laser_deselect_01 = {weapon_thinkf(-1, PLAYER_WEAPONSELECTION_DELAY, w_clear); weapon_boblayer1(PLAYER_WEAPONSELECTION_SPEED, PLAYER_WEAPONSELECTION_RANGE);}; +void() laser_select_01 = {weapon_thinkf(-1, cvar("g_balance_weaponswitchdelay"), w_ready); weapon_boblayer1(PLAYER_WEAPONSELECTION_SPEED, '0 0 0');}; +void() laser_deselect_01 = {weapon_thinkf(-1, cvar("g_balance_weaponswitchdelay"), w_clear); weapon_boblayer1(PLAYER_WEAPONSELECTION_SPEED, PLAYER_WEAPONSELECTION_RANGE);}; void() laser_fire1_01 = { weapon_doattack(laser_check, laser_check, W_Laser_Attack); diff --git a/qcsrc/gamec/w_nex.c b/qcsrc/gamec/w_nex.c index 3fc58e9b7..642a760d6 100644 --- a/qcsrc/gamec/w_nex.c +++ b/qcsrc/gamec/w_nex.c @@ -48,7 +48,7 @@ void W_Nex_Attack (void) self.attack_finished = time + 1; - if (!(game & GAME_INSTAGIB)) + if (cvar("g_instagib") == 0) self.ammo_cells = self.ammo_cells - 5; entity flash; @@ -70,8 +70,8 @@ void W_Nex_Attack2 (void) // weapon frames void() nex_ready_01 = {weapon_thinkf(WFRAME_IDLE, 0.1, nex_ready_01); self.weaponentity.state = WS_READY;}; -void() nex_select_01 = {weapon_thinkf(-1, PLAYER_WEAPONSELECTION_DELAY, w_ready); weapon_boblayer1(PLAYER_WEAPONSELECTION_SPEED, '0 0 0');}; -void() nex_deselect_01 = {weapon_thinkf(-1, PLAYER_WEAPONSELECTION_DELAY, w_clear); weapon_boblayer1(PLAYER_WEAPONSELECTION_SPEED, PLAYER_WEAPONSELECTION_RANGE);}; +void() nex_select_01 = {weapon_thinkf(-1, cvar("g_balance_weaponswitchdelay"), w_ready); weapon_boblayer1(PLAYER_WEAPONSELECTION_SPEED, '0 0 0');}; +void() nex_deselect_01 = {weapon_thinkf(-1, cvar("g_balance_weaponswitchdelay"), w_clear); weapon_boblayer1(PLAYER_WEAPONSELECTION_SPEED, PLAYER_WEAPONSELECTION_RANGE);}; void() nex_fire1_01 = { weapon_doattack(nex_check, nex_check, W_Nex_Attack); diff --git a/qcsrc/gamec/w_rocketlauncher.c b/qcsrc/gamec/w_rocketlauncher.c index 9f915378a..dfffaf547 100644 --- a/qcsrc/gamec/w_rocketlauncher.c +++ b/qcsrc/gamec/w_rocketlauncher.c @@ -104,7 +104,7 @@ void W_Rocket_Attack (void) self.attack_finished = time + 1.2; - if (!(game & GAME_ROCKET_ARENA)) + if (cvar("g_rocketarena") == 0) self.ammo_rockets = self.ammo_rockets - 3; entity flash; @@ -137,8 +137,8 @@ void W_Rocket_Attack2 (void) // weapon frames void() rlauncher_ready_01 = {weapon_thinkf(WFRAME_IDLE, 0.1, rlauncher_ready_01); self.weaponentity.state = WS_READY;}; -void() rlauncher_select_01 = {weapon_thinkf(-1, PLAYER_WEAPONSELECTION_DELAY, w_ready); weapon_boblayer1(PLAYER_WEAPONSELECTION_SPEED, '0 0 0');}; -void() rlauncher_deselect_01 = {weapon_thinkf(-1, PLAYER_WEAPONSELECTION_DELAY, w_clear); weapon_boblayer1(PLAYER_WEAPONSELECTION_SPEED, PLAYER_WEAPONSELECTION_RANGE);}; +void() rlauncher_select_01 = {weapon_thinkf(-1, cvar("g_balance_weaponswitchdelay"), w_ready); weapon_boblayer1(PLAYER_WEAPONSELECTION_SPEED, '0 0 0');}; +void() rlauncher_deselect_01 = {weapon_thinkf(-1, cvar("g_balance_weaponswitchdelay"), w_clear); weapon_boblayer1(PLAYER_WEAPONSELECTION_SPEED, PLAYER_WEAPONSELECTION_RANGE);}; void() rlauncher_fire1_01 = { weapon_doattack(rlauncher_check, rlauncher_check, W_Rocket_Attack); diff --git a/qcsrc/gamec/w_shotgun.c b/qcsrc/gamec/w_shotgun.c index 8a868dbf4..8f8066665 100644 --- a/qcsrc/gamec/w_shotgun.c +++ b/qcsrc/gamec/w_shotgun.c @@ -60,8 +60,8 @@ void W_Shotgun_Attack (void) // weapon frames void() shotgun_ready_01 = {weapon_thinkf(WFRAME_IDLE, 0.1, shotgun_ready_01); self.weaponentity.state = WS_READY;}; -void() shotgun_select_01 = {weapon_thinkf(-1, PLAYER_WEAPONSELECTION_DELAY, w_ready); weapon_boblayer1(PLAYER_WEAPONSELECTION_SPEED, '0 0 0');}; -void() shotgun_deselect_01 = {weapon_thinkf(-1, PLAYER_WEAPONSELECTION_DELAY, w_clear); weapon_boblayer1(PLAYER_WEAPONSELECTION_SPEED, PLAYER_WEAPONSELECTION_RANGE);}; +void() shotgun_select_01 = {weapon_thinkf(-1, cvar("g_balance_weaponswitchdelay"), w_ready); weapon_boblayer1(PLAYER_WEAPONSELECTION_SPEED, '0 0 0');}; +void() shotgun_deselect_01 = {weapon_thinkf(-1, cvar("g_balance_weaponswitchdelay"), w_clear); weapon_boblayer1(PLAYER_WEAPONSELECTION_SPEED, PLAYER_WEAPONSELECTION_RANGE);}; void() shotgun_fire1_01 = { weapon_doattack(shotgun_check, shotgun_check, W_Shotgun_Attack); diff --git a/qcsrc/gamec/w_uzi.c b/qcsrc/gamec/w_uzi.c index a73e26fd0..15ba592ad 100644 --- a/qcsrc/gamec/w_uzi.c +++ b/qcsrc/gamec/w_uzi.c @@ -64,8 +64,8 @@ void W_Uzi_Attack2 (void) // weapon frames void() uzi_ready_01 = {weapon_thinkf(WFRAME_IDLE, 0.1, uzi_ready_01); self.weaponentity.state = WS_READY;}; -void() uzi_select_01 = {weapon_thinkf(-1, PLAYER_WEAPONSELECTION_DELAY, w_ready); weapon_boblayer1(PLAYER_WEAPONSELECTION_SPEED, '0 0 0');}; -void() uzi_deselect_01 = {weapon_thinkf(-1, PLAYER_WEAPONSELECTION_DELAY, w_clear); weapon_boblayer1(PLAYER_WEAPONSELECTION_SPEED, PLAYER_WEAPONSELECTION_RANGE);}; +void() uzi_select_01 = {weapon_thinkf(-1, cvar("g_balance_weaponswitchdelay"), w_ready); weapon_boblayer1(PLAYER_WEAPONSELECTION_SPEED, '0 0 0');}; +void() uzi_deselect_01 = {weapon_thinkf(-1, cvar("g_balance_weaponswitchdelay"), w_clear); weapon_boblayer1(PLAYER_WEAPONSELECTION_SPEED, PLAYER_WEAPONSELECTION_RANGE);}; void() uzi_fire1_01 = { weapon_doattack(uzi_check, uzi_check, W_Uzi_Attack); -- 2.39.2