Skip to content

Commit

Permalink
Japro Update
Browse files Browse the repository at this point in the history
saber tweak options, remap drain, overheat fix, missile owner fix (#212)
(cherry picked from commit 0f8b19f)

Co-authored-by: videoP <[email protected]>
  • Loading branch information
taysta and videoP authored Sep 22, 2024
1 parent 3560d5b commit 100cdfc
Show file tree
Hide file tree
Showing 3 changed files with 42 additions and 3 deletions.
10 changes: 10 additions & 0 deletions codemp/game/g_cvar.c
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand Down
12 changes: 11 additions & 1 deletion codemp/game/g_weapon.c
Original file line number Diff line number Diff line change
Expand Up @@ -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)
{
Expand Down Expand Up @@ -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;
}

/*
Expand Down Expand Up @@ -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;
}
}

//---------------------------------------------------------
Expand Down
23 changes: 21 additions & 2 deletions codemp/game/w_saber.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down

0 comments on commit 100cdfc

Please sign in to comment.