Separate health and armor regen pauses
authorMirceaKitsune <sonichedgehog_hyperblast00@yahoo.com>
Sat, 26 Feb 2011 23:28:50 +0000 (01:28 +0200)
committerMirceaKitsune <sonichedgehog_hyperblast00@yahoo.com>
Sat, 26 Feb 2011 23:28:50 +0000 (01:28 +0200)
data/balance.cfg
data/qcsrc/server/cheats.qc
data/qcsrc/server/cl_client.qc
data/qcsrc/server/cl_physics.qc
data/qcsrc/server/cl_player.qc
data/qcsrc/server/defs.qh
data/qcsrc/server/t_items.qc
data/qcsrc/server/w_grabber.qc

index 98de20e..bbbcbbb 100644 (file)
@@ -64,9 +64,11 @@ set g_pickup_respawntimejitter_ammo 0
 set g_balance_health_regen 0\r
 set g_balance_health_regenlinear 5\r
 set g_balance_armor_regen 0\r
-set g_balance_armor_regenlinear 0\r
+set g_balance_armor_regenlinear 25\r
 set g_balance_pause_health_regen 5\r
 set g_balance_pause_health_regen_spawn 0\r
+set g_balance_pause_armor_regen 6\r
+set g_balance_pause_armor_regen_spawn 6\r
 set g_balance_health_rot 0\r
 set g_balance_health_rotlinear 5\r
 set g_balance_armor_rot 0\r
index 4abb385..1f3a855 100644 (file)
@@ -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;
                                }
index 5eff6c8..dcafed6 100644 (file)
@@ -604,7 +604,8 @@ void PutObserverInServer (void)
        self.armorvalue = cvar("g_balance_armor_start");\r
        self.pauserotarmor_finished = 0;\r
        self.pauserothealth_finished = 0;\r
-       self.pauseregen_finished = 0;\r
+       self.pauseregenhealth_finished = 0;\r
+       self.pauseregenarmor_finished = 0;\r
        self.damageforcescale = 0;\r
        self.death_time = 0;\r
        self.dead_frame = 0;\r
@@ -873,13 +874,15 @@ void PutClientInServer (void)
                self.pauserotarmor_finished = time + cvar("g_balance_pause_armor_rot_spawn");\r
                self.pauserothealth_finished = time + cvar("g_balance_pause_health_rot_spawn");\r
                self.pauserotfuel_finished = time + cvar("g_balance_pause_fuel_rot_spawn");\r
-               self.pauseregen_finished = time + cvar("g_balance_pause_health_regen_spawn");\r
+               self.pauseregenhealth_finished = time + cvar("g_balance_pause_health_regen_spawn");\r
+               self.pauseregenarmor_finished = time + cvar("g_balance_pause_armor_regen_spawn");\r
                //extend the pause of rotting if client was reset at the beginning of the countdown\r
                if(!cvar("sv_ready_restart_after_countdown") && time < game_starttime) { // TODO why is this cvar NOTted?\r
                        self.spawnshieldtime += game_starttime - time;\r
                        self.pauserotarmor_finished += game_starttime - time;\r
                        self.pauserothealth_finished += game_starttime - time;\r
-                       self.pauseregen_finished += game_starttime - time;\r
+                       self.pauseregenhealth_finished += game_starttime - time;\r
+                       self.pauseregenarmor_finished += game_starttime - time;\r
                }\r
                self.damageforcescale = 2;\r
                self.death_time = 0;\r
@@ -1906,8 +1909,8 @@ void player_regen (void)
 \r
        if (!g_ca && (!g_lms || cvar("g_lms_regenerate")))\r
        {\r
-               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);\r
-               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);\r
+               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);\r
+               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);\r
 \r
                // if player rotted to death...  die!\r
                if(self.health < 1)\r
@@ -1915,7 +1918,7 @@ void player_regen (void)
        }\r
 \r
        if not(self.items & IT_UNLIMITED_WEAPON_AMMO)\r
-               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);\r
+               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);\r
 }\r
 \r
 float zoomstate_set;\r
index 0224bd0..9cd1165 100644 (file)
@@ -998,7 +998,7 @@ void SV_PlayerPhysics()
                        self.items |= IT_USING_JETPACK;\r
 \r
                        // jetpack also inhibits health regeneration, but only for 1 second\r
-                       self.pauseregen_finished = max(self.pauseregen_finished, time + cvar("g_balance_pause_fuel_regen"));\r
+                       self.pauseregenhealth_finished = max(self.pauseregenhealth_finished, time + cvar("g_balance_pause_fuel_regen"));\r
                }\r
        }\r
        else if (self.flags & FL_ONGROUND)\r
index 932d0b9..45bb087 100644 (file)
@@ -393,7 +393,8 @@ void PlayerCorpseDamage (entity inflictor, entity attacker, float damage, float
                self.armorvalue = self.armorvalue - save;\r
                self.health = self.health - take;\r
                // pause regeneration for 5 seconds\r
-               self.pauseregen_finished = max(self.pauseregen_finished, time + cvar("g_balance_pause_health_regen"));\r
+               self.pauseregenhealth_finished = max(self.pauseregenhealth_finished, time + cvar("g_balance_pause_health_regen"));\r
+               self.pauseregenarmor_finished = max(self.pauseregenarmor_finished, time + cvar("g_balance_pause_armor_regen"));\r
        }\r
        self.dmg_save = self.dmg_save + save;//max(save - 10, 0);\r
        self.dmg_take = self.dmg_take + take;//max(take - 10, 0);\r
@@ -470,7 +471,8 @@ void PlayerDamage (entity inflictor, entity attacker, float damage, float deatht
                        self.armorvalue = self.armorvalue - save;\r
                        self.health = self.health - take;\r
                        // pause regeneration for 5 seconds\r
-                       self.pauseregen_finished = max(self.pauseregen_finished, time + cvar("g_balance_pause_health_regen"));\r
+                       self.pauseregenhealth_finished = max(self.pauseregenhealth_finished, time + cvar("g_balance_pause_health_regen"));\r
+                       self.pauseregenarmor_finished = max(self.pauseregenarmor_finished, time + cvar("g_balance_pause_armor_regen"));\r
 \r
                        if (time > self.pain_finished)          //Don't switch pain sequences like crazy\r
                        {\r
index 8bfb0ac..ee87662 100644 (file)
@@ -200,8 +200,9 @@ void setanim(entity e, vector anim, float looping, float override, float restart
 .float iscreature;\r
 .vector oldvelocity;\r
 \r
-.float pauseregen_finished;\r
+.float pauseregenhealth_finished;\r
 .float pauserothealth_finished;\r
+.float pauseregenarmor_finished;\r
 .float pauserotarmor_finished;\r
 .float pauserotfuel_finished;\r
 .string item_pickupsound;\r
index 3505039..2ad8336 100644 (file)
@@ -1330,9 +1330,9 @@ float GiveItems(entity e, float beginarg, float endarg)
        }\r
        POSTGIVE_VALUE(e, strength_finished, 1, "misc/powerup.wav", "misc/poweroff.wav");\r
        POSTGIVE_VALUE(e, invincible_finished, 1, "misc/powerup_shield.wav", "misc/poweroff.wav");\r
-       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);\r
-       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);\r
-       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);\r
+       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);\r
+       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);\r
+       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);\r
 \r
        if(e.strength_finished <= 0)\r
                e.strength_finished = 0;\r
index 9cd4fa7..b1e4e13 100644 (file)
@@ -108,7 +108,7 @@ float w_grabber(float req)
 \r
                        // grabber also inhibits health regeneration, but only for 1 second\r
                        if not(self.items & IT_UNLIMITED_WEAPON_AMMO)\r
-                               self.pauseregen_finished = max(self.pauseregen_finished, time + cvar("g_balance_pause_fuel_regen"));\r
+                               self.pauseregenhealth_finished = max(self.pauseregenhealth_finished, time + cvar("g_balance_pause_fuel_regen"));\r
                }\r
 \r
                if(self.grabber && self.grabber.state == 1)\r