From 100cdfc116b94679dbdc41940a21b36acc492b7b Mon Sep 17 00:00:00 2001 From: tayst Date: Mon, 23 Sep 2024 02:21:51 +0800 Subject: [PATCH] Japro Update saber tweak options, remap drain, overheat fix, missile owner fix (#212) (cherry picked from commit 0f8b19ffe25af8f59a4a9b709b03e025ae69a2a0) Co-authored-by: videoP --- codemp/game/g_cvar.c | 10 ++++++++++ codemp/game/g_weapon.c | 12 +++++++++++- codemp/game/w_saber.c | 23 +++++++++++++++++++++-- 3 files changed, 42 insertions(+), 3 deletions(-) diff --git a/codemp/game/g_cvar.c b/codemp/game/g_cvar.c index a41080d712..78641902c3 100644 --- a/codemp/game/g_cvar.c +++ b/codemp/game/g_cvar.c @@ -207,6 +207,16 @@ void CVU_TweakForce(void) { (g_tweakForce.integer & FT_FASTGRIP) ? (jcinfo.integer |= JAPRO_CINFO_FASTGRIP) : (jcinfo.integer &= ~JAPRO_CINFO_FASTGRIP); trap->Cvar_Set("jcinfo", va("%i", jcinfo.integer)); + + //have to do this on startup somehow? + if (g_tweakForce.integer & FT_FIXLINEDRAIN) { + AddRemap("gfx/effects/redLine", "gfx/effects/drainedadd", level.time * 0.001f); + trap->SetConfigstring(CS_SHADERSTATE, BuildShaderStateConfig()); + } + else { + AddRemap("gfx/effects/drainedadd", "gfx/effects/redLine", level.time * 0.001f); + trap->SetConfigstring(CS_SHADERSTATE, BuildShaderStateConfig()); + } } static void CVU_LegDangle(void) { diff --git a/codemp/game/g_weapon.c b/codemp/game/g_weapon.c index cba41ccff5..7edd38b3c9 100644 --- a/codemp/game/g_weapon.c +++ b/codemp/game/g_weapon.c @@ -419,7 +419,9 @@ static void WP_FireBryarPistol( gentity_t *ent, qboolean altFire, int seed ) count = 5; } - ent->client->ps.jetpackFuel -= count * 6; + if (ent && ent->client && g_tweakWeapons.integer & WT_TRIBES) { //Chaingun Overheat mechanic + ent->client->ps.jetpackFuel -= count * 6; + } if (count > 1) { @@ -1743,6 +1745,9 @@ static void WP_RepeaterAltFire( gentity_t *ent ) // we don't want it to bounce forever missile->bounceCount = 8; + + if (ent && ent->client) + missile->s.teamowner = ent->client->sess.sessionTeam; } /* @@ -3328,6 +3333,11 @@ static void WP_CreateMortar( vec3_t start, vec3_t fwd, gentity_t *self) missile->splashMethodOfDeath = MOD_FLECHETTE_ALT_SPLASH; VectorCopy( start, missile->pos2 ); + + if (self && self->client) { + missile->s.teamowner = self->client->sess.sessionTeam; + missile->s.owner = self->s.number; + } } //--------------------------------------------------------- diff --git a/codemp/game/w_saber.c b/codemp/game/w_saber.c index c7a7add2a8..32a0f65128 100644 --- a/codemp/game/w_saber.c +++ b/codemp/game/w_saber.c @@ -4208,8 +4208,27 @@ static QINLINE qboolean CheckSaberDamage(gentity_t *self, int rSaberNum, int rBl //take saber vel out of dmg eq //We want to get the most powerful part of swing which I guess is the middle? The alternative is to normalize trancelength for the players own mouse movement (so it just is speed of saber tip when not moving mouse) //Todo, exclude katas and multi swing moves - dmg = G_GetAttackDamage(self, fDmg*0.25, fDmg*1, 0.5f); - //Com_Printf("NewDmg is %i\n", dmg); + + //Loda - Japro - Add SP DMG modifiers here ST_SPDMGTWEAKS or w/e. Probably nerf slower moving red swings e.g. vert? Buff blue/duals? To compensate for vel dmg removal + if (BG_SaberInSpecial(self->client->ps.saberMove)) { //Special moves + if (self->client->ps.saberMove == LS_A_LUNGE)//Lunge + dmg = fDmg * 0.4f; + else if (self->client->ps.saberMove == LS_ROLL_STAB)//All styles rollstab + dmg = fDmg *= 0.5f; + else if (self->client->ps.saberMove == LS_JUMPATTACK_STAFF_RIGHT)//Forward staff dfa + dmg = fDmg *= 0.5f; + else + dmg = fDmg * 0.7f; + } + else { + if (self->client->ps.saberInFlight) + dmg = fDmg *= 0.9f; + else if (self->client->ps.saberMove == LS_A_T2B) //Red Vert + dmg = G_GetAttackDamage(self, fDmg*0.25, fDmg * 0.5f, 0.5f); + else + dmg = G_GetAttackDamage(self, fDmg*0.25, fDmg * 0.7f, 0.5f); + } + //com_Printf("NewDmg is %i\n", dmg); } else if (fDmg && g_tweakSaber.integer & ST_NEWSPSABERDMGCAP) { float traceLength = Distance(saberEnd, saberStart);