From a0b89faa220429e57f78c253ccd4c426370e573a Mon Sep 17 00:00:00 2001 From: Steam Deck User Date: Fri, 10 Mar 2023 11:47:42 -0500 Subject: [PATCH] SERVER: Stop halfing all Juggernog damage, set Player Health appropriately instead --- source/server/damage.qc | 6 +++--- source/server/entities/machines.qc | 7 ++++++- source/server/player.qc | 4 +++- 3 files changed, 12 insertions(+), 5 deletions(-) diff --git a/source/server/damage.qc b/source/server/damage.qc index 37f41e9..28240f2 100644 --- a/source/server/damage.qc +++ b/source/server/damage.qc @@ -241,6 +241,9 @@ void() GetDown = self.currentmagbk = self.currentmag; self.currentmagbk2 = self.currentmag2; + // Reset Juggernog health + self.max_health = self.health = PLAYER_START_HEALTH; + if(Util_PlayerHasWeapon(self, W_BIATCH, false) || Util_PlayerHasWeapon(self, W_RAY, true) || Util_PlayerHasWeapon(self, W_357, true)) { @@ -477,9 +480,6 @@ void(entity victim,entity attacker, float damage, float d_style) DamageHandler = // Abstinence Program victim.ach_tracker_abst = 1; - if (victim.perks & P_JUG) - damage = ceil(damage*0.5); - victim.health = victim.health - damage; victim.health_delay = time + 2; diff --git a/source/server/entities/machines.qc b/source/server/entities/machines.qc index 60850d7..223caf6 100644 --- a/source/server/entities/machines.qc +++ b/source/server/entities/machines.qc @@ -49,12 +49,14 @@ void() mystery_touch; #define PERK_SPAWNFLAG_LIMELIGHT 256 #define PERK_SPAWNFLAG_YELLOWLIGHT 512 +#define PERK_JUGGERNOG_HEALTH 160 + // // GivePerk(p) // Restores View Model and tells the Client to draw the Perk. // void GivePerk(optional float p) { - local float perk; + float perk; // First of, check if our Client is holding anything, this holds // priority to prevent interruption. @@ -83,6 +85,9 @@ void GivePerk(optional float p) { break; case P_JUG: self.perks = self.perks | 1; + + // Instant re-gen, set health to Jugg health. + self.health = self.max_health = PERK_JUGGERNOG_HEALTH; break; case P_STAMIN: self.perks = self.perks | 32; diff --git a/source/server/player.qc b/source/server/player.qc index 253011a..13cb433 100644 --- a/source/server/player.qc +++ b/source/server/player.qc @@ -29,6 +29,8 @@ void(entity e) Light_None; +#define PLAYER_START_HEALTH 100 + // // Player 3rd Person Animations // @@ -529,7 +531,7 @@ void() PlayerSpawn = setmodel(self, "models/player.mdl"); self.movetype = MOVETYPE_WALK; - self.max_health = self.health = 100; + self.max_health = self.health = PLAYER_START_HEALTH; entity who = find(world,classname,"player"); while(who != self && !self.playernum)