From 07ac1ce35983a1781435294f9e6ffd298acbb2bb Mon Sep 17 00:00:00 2001 From: MirceaKitsune Date: Sun, 27 Feb 2011 01:28:50 +0200 Subject: [PATCH] Separate health and armor regen pauses --- data/balance.cfg | 4 +++- data/qcsrc/server/cheats.qc | 9 ++++++--- data/qcsrc/server/cl_client.qc | 15 +++++++++------ data/qcsrc/server/cl_physics.qc | 2 +- data/qcsrc/server/cl_player.qc | 6 ++++-- data/qcsrc/server/defs.qh | 3 ++- data/qcsrc/server/t_items.qc | 6 +++--- data/qcsrc/server/w_grabber.qc | 2 +- 8 files changed, 29 insertions(+), 18 deletions(-) diff --git a/data/balance.cfg b/data/balance.cfg index 98de20ea..bbbcbbbf 100644 --- a/data/balance.cfg +++ b/data/balance.cfg @@ -64,9 +64,11 @@ set g_pickup_respawntimejitter_ammo 0 set g_balance_health_regen 0 set g_balance_health_regenlinear 5 set g_balance_armor_regen 0 -set g_balance_armor_regenlinear 0 +set g_balance_armor_regenlinear 25 set g_balance_pause_health_regen 5 set g_balance_pause_health_regen_spawn 0 +set g_balance_pause_armor_regen 6 +set g_balance_pause_armor_regen_spawn 6 set g_balance_health_rot 0 set g_balance_health_rotlinear 5 set g_balance_armor_rot 0 diff --git a/data/qcsrc/server/cheats.qc b/data/qcsrc/server/cheats.qc index 4abb3853..1f3a8553 100644 --- a/data/qcsrc/server/cheats.qc +++ b/data/qcsrc/server/cheats.qc @@ -120,7 +120,8 @@ float CheatImpulse(float i) self.personal.pauserotarmor_finished = self.pauserotarmor_finished; self.personal.pauserothealth_finished = self.pauserothealth_finished; self.personal.pauserotfuel_finished = self.pauserotfuel_finished; - self.personal.pauseregen_finished = self.pauseregen_finished; + self.personal.pauseregenhealth_finished = self.pauseregenhealth_finished; + self.personal.pauseregenarmor_finished = self.pauseregenarmor_finished; self.personal.strength_finished = self.strength_finished; self.personal.invincible_finished = self.invincible_finished; self.personal.teleport_time = time; @@ -176,7 +177,8 @@ float CheatImpulse(float i) self.pauserotarmor_finished = time + cvar("g_balance_pause_armor_rot_spawn"); self.pauserothealth_finished = time + cvar("g_balance_pause_health_rot_spawn"); self.pauserotfuel_finished = time + cvar("g_balance_pause_fuel_rot_spawn"); - self.pauseregen_finished = time + cvar("g_balance_pause_health_regen_spawn"); + self.pauseregenhealth_finished = time + cvar("g_balance_pause_health_regen_spawn"); + self.pauseregenarmor_finished = time + cvar("g_balance_pause_armor_regen_spawn"); self.strength_finished = 0; self.invincible_finished = 0; } @@ -190,7 +192,8 @@ float CheatImpulse(float i) self.pauserotarmor_finished = time + self.personal.pauserotarmor_finished - self.personal.teleport_time; self.pauserothealth_finished = time + self.personal.pauserothealth_finished - self.personal.teleport_time; self.pauserotfuel_finished = time + self.personal.pauserotfuel_finished - self.personal.teleport_time; - self.pauseregen_finished = time + self.personal.pauseregen_finished - self.personal.teleport_time; + self.pauseregenhealth_finished = time + self.personal.pauseregenhealth_finished - self.personal.teleport_time; + self.pauseregenarmor_finished = time + self.personal.pauseregenarmor_finished - self.personal.teleport_time; self.strength_finished = time + self.personal.strength_finished - self.personal.teleport_time; self.invincible_finished = time + self.personal.invincible_finished - self.personal.teleport_time; } diff --git a/data/qcsrc/server/cl_client.qc b/data/qcsrc/server/cl_client.qc index 5eff6c80..dcafed6c 100644 --- a/data/qcsrc/server/cl_client.qc +++ b/data/qcsrc/server/cl_client.qc @@ -604,7 +604,8 @@ void PutObserverInServer (void) self.armorvalue = cvar("g_balance_armor_start"); self.pauserotarmor_finished = 0; self.pauserothealth_finished = 0; - self.pauseregen_finished = 0; + self.pauseregenhealth_finished = 0; + self.pauseregenarmor_finished = 0; self.damageforcescale = 0; self.death_time = 0; self.dead_frame = 0; @@ -873,13 +874,15 @@ void PutClientInServer (void) self.pauserotarmor_finished = time + cvar("g_balance_pause_armor_rot_spawn"); self.pauserothealth_finished = time + cvar("g_balance_pause_health_rot_spawn"); self.pauserotfuel_finished = time + cvar("g_balance_pause_fuel_rot_spawn"); - self.pauseregen_finished = time + cvar("g_balance_pause_health_regen_spawn"); + self.pauseregenhealth_finished = time + cvar("g_balance_pause_health_regen_spawn"); + self.pauseregenarmor_finished = time + cvar("g_balance_pause_armor_regen_spawn"); //extend the pause of rotting if client was reset at the beginning of the countdown if(!cvar("sv_ready_restart_after_countdown") && time < game_starttime) { // TODO why is this cvar NOTted? self.spawnshieldtime += game_starttime - time; self.pauserotarmor_finished += game_starttime - time; self.pauserothealth_finished += game_starttime - time; - self.pauseregen_finished += game_starttime - time; + self.pauseregenhealth_finished += game_starttime - time; + self.pauseregenarmor_finished += game_starttime - time; } self.damageforcescale = 2; self.death_time = 0; @@ -1906,8 +1909,8 @@ void player_regen (void) if (!g_ca && (!g_lms || cvar("g_lms_regenerate"))) { - self.armorvalue = CalcRotRegen(self.armorvalue, mina, cvar("g_balance_armor_regen"), cvar("g_balance_armor_regenlinear"), regen_mod * frametime * (time > self.pauseregen_finished), maxa, cvar("g_balance_armor_rot"), cvar("g_balance_armor_rotlinear"), rot_mod * frametime * (time > self.pauserotarmor_finished), limita); - self.health = CalcRotRegen(self.health, minh, cvar("g_balance_health_regen"), cvar("g_balance_health_regenlinear"), regen_mod * frametime * (time > self.pauseregen_finished), maxh, cvar("g_balance_health_rot"), cvar("g_balance_health_rotlinear"), rot_mod * frametime * (time > self.pauserothealth_finished), limith); + self.armorvalue = CalcRotRegen(self.armorvalue, mina, cvar("g_balance_armor_regen"), cvar("g_balance_armor_regenlinear"), regen_mod * frametime * (time > self.pauseregenarmor_finished), maxa, cvar("g_balance_armor_rot"), cvar("g_balance_armor_rotlinear"), rot_mod * frametime * (time > self.pauserotarmor_finished), limita); + self.health = CalcRotRegen(self.health, minh, cvar("g_balance_health_regen"), cvar("g_balance_health_regenlinear"), regen_mod * frametime * (time > self.pauseregenhealth_finished), maxh, cvar("g_balance_health_rot"), cvar("g_balance_health_rotlinear"), rot_mod * frametime * (time > self.pauserothealth_finished), limith); // if player rotted to death... die! if(self.health < 1) @@ -1915,7 +1918,7 @@ void player_regen (void) } if not(self.items & IT_UNLIMITED_WEAPON_AMMO) - self.ammo_fuel = CalcRotRegen(self.ammo_fuel, minf, cvar("g_balance_fuel_regen"), cvar("g_balance_fuel_regenlinear"), regen_mod * frametime * (time > self.pauseregen_finished) * (self.items & IT_FUEL_REGEN != 0), maxf, cvar("g_balance_fuel_rot"), cvar("g_balance_fuel_rotlinear"), rot_mod * frametime * (time > self.pauserotfuel_finished), limitf); + self.ammo_fuel = CalcRotRegen(self.ammo_fuel, minf, cvar("g_balance_fuel_regen"), cvar("g_balance_fuel_regenlinear"), regen_mod * frametime * (time > self.pauseregenhealth_finished) * (self.items & IT_FUEL_REGEN != 0), maxf, cvar("g_balance_fuel_rot"), cvar("g_balance_fuel_rotlinear"), rot_mod * frametime * (time > self.pauserotfuel_finished), limitf); } float zoomstate_set; diff --git a/data/qcsrc/server/cl_physics.qc b/data/qcsrc/server/cl_physics.qc index 0224bd01..9cd11650 100644 --- a/data/qcsrc/server/cl_physics.qc +++ b/data/qcsrc/server/cl_physics.qc @@ -998,7 +998,7 @@ void SV_PlayerPhysics() self.items |= IT_USING_JETPACK; // jetpack also inhibits health regeneration, but only for 1 second - self.pauseregen_finished = max(self.pauseregen_finished, time + cvar("g_balance_pause_fuel_regen")); + self.pauseregenhealth_finished = max(self.pauseregenhealth_finished, time + cvar("g_balance_pause_fuel_regen")); } } else if (self.flags & FL_ONGROUND) diff --git a/data/qcsrc/server/cl_player.qc b/data/qcsrc/server/cl_player.qc index 932d0b96..45bb087a 100644 --- a/data/qcsrc/server/cl_player.qc +++ b/data/qcsrc/server/cl_player.qc @@ -393,7 +393,8 @@ void PlayerCorpseDamage (entity inflictor, entity attacker, float damage, float self.armorvalue = self.armorvalue - save; self.health = self.health - take; // pause regeneration for 5 seconds - self.pauseregen_finished = max(self.pauseregen_finished, time + cvar("g_balance_pause_health_regen")); + self.pauseregenhealth_finished = max(self.pauseregenhealth_finished, time + cvar("g_balance_pause_health_regen")); + self.pauseregenarmor_finished = max(self.pauseregenarmor_finished, time + cvar("g_balance_pause_armor_regen")); } self.dmg_save = self.dmg_save + save;//max(save - 10, 0); self.dmg_take = self.dmg_take + take;//max(take - 10, 0); @@ -470,7 +471,8 @@ void PlayerDamage (entity inflictor, entity attacker, float damage, float deatht self.armorvalue = self.armorvalue - save; self.health = self.health - take; // pause regeneration for 5 seconds - self.pauseregen_finished = max(self.pauseregen_finished, time + cvar("g_balance_pause_health_regen")); + self.pauseregenhealth_finished = max(self.pauseregenhealth_finished, time + cvar("g_balance_pause_health_regen")); + self.pauseregenarmor_finished = max(self.pauseregenarmor_finished, time + cvar("g_balance_pause_armor_regen")); if (time > self.pain_finished) //Don't switch pain sequences like crazy { diff --git a/data/qcsrc/server/defs.qh b/data/qcsrc/server/defs.qh index 8bfb0ac9..ee876623 100644 --- a/data/qcsrc/server/defs.qh +++ b/data/qcsrc/server/defs.qh @@ -200,8 +200,9 @@ void setanim(entity e, vector anim, float looping, float override, float restart .float iscreature; .vector oldvelocity; -.float pauseregen_finished; +.float pauseregenhealth_finished; .float pauserothealth_finished; +.float pauseregenarmor_finished; .float pauserotarmor_finished; .float pauserotfuel_finished; .string item_pickupsound; diff --git a/data/qcsrc/server/t_items.qc b/data/qcsrc/server/t_items.qc index 3505039f..2ad83362 100644 --- a/data/qcsrc/server/t_items.qc +++ b/data/qcsrc/server/t_items.qc @@ -1330,9 +1330,9 @@ float GiveItems(entity e, float beginarg, float endarg) } POSTGIVE_VALUE(e, strength_finished, 1, "misc/powerup.wav", "misc/poweroff.wav"); POSTGIVE_VALUE(e, invincible_finished, 1, "misc/powerup_shield.wav", "misc/poweroff.wav"); - POSTGIVE_VALUE_ROT(e, ammo_fuel, 1, pauserotfuel_finished, cvar("g_balance_pause_fuel_rot"), pauseregen_finished, cvar("g_balance_pause_fuel_regen"), "misc/itempickup.wav", string_null); - POSTGIVE_VALUE_ROT(e, armorvalue, 1, pauserotarmor_finished, cvar("g_balance_pause_armor_rot"), pauseregen_finished, cvar("g_balance_pause_health_regen"), "misc/armor25.wav", string_null); - POSTGIVE_VALUE_ROT(e, health, 1, pauserothealth_finished, cvar("g_balance_pause_health_rot"), pauseregen_finished, cvar("g_balance_pause_health_regen"), "misc/megahealth.wav", string_null); + POSTGIVE_VALUE_ROT(e, ammo_fuel, 1, pauserotfuel_finished, cvar("g_balance_pause_fuel_rot"), pauseregenhealth_finished, cvar("g_balance_pause_fuel_regen"), "misc/itempickup.wav", string_null); + POSTGIVE_VALUE_ROT(e, armorvalue, 1, pauserotarmor_finished, cvar("g_balance_pause_armor_rot"), pauseregenarmor_finished, cvar("g_balance_pause_armor_regen"), "misc/armor25.wav", string_null); + POSTGIVE_VALUE_ROT(e, health, 1, pauserothealth_finished, cvar("g_balance_pause_health_rot"), pauseregenhealth_finished, cvar("g_balance_pause_health_regen"), "misc/megahealth.wav", string_null); if(e.strength_finished <= 0) e.strength_finished = 0; diff --git a/data/qcsrc/server/w_grabber.qc b/data/qcsrc/server/w_grabber.qc index 9cd4fa77..b1e4e13b 100644 --- a/data/qcsrc/server/w_grabber.qc +++ b/data/qcsrc/server/w_grabber.qc @@ -108,7 +108,7 @@ float w_grabber(float req) // grabber also inhibits health regeneration, but only for 1 second if not(self.items & IT_UNLIMITED_WEAPON_AMMO) - self.pauseregen_finished = max(self.pauseregen_finished, time + cvar("g_balance_pause_fuel_regen")); + self.pauseregenhealth_finished = max(self.pauseregenhealth_finished, time + cvar("g_balance_pause_fuel_regen")); } if(self.grabber && self.grabber.state == 1) -- 2.39.2