Skip to content

Commit

Permalink
2 new forcetweaks
Browse files Browse the repository at this point in the history
  • Loading branch information
videoP committed Apr 14, 2024
1 parent 3fb5934 commit ab32ca0
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 6 deletions.
4 changes: 2 additions & 2 deletions codemp/game/g_local.h
Original file line number Diff line number Diff line change
Expand Up @@ -242,8 +242,8 @@ extern int dueltypes[MAX_CLIENTS];//JAPRO - Serverside - Fullforce Duels y is th
#define FT_NORAGEFIRERATE (1<<18)
#define FT_BUFFMINDTRICK (1<<19)
#define FT_BUFFMELEE (1<<20) //not really a forcetweak but no room in weapon tweaks!
#define FT_DRAINDMGNERF (1<<21)
#define FT_FIXGRIPPEDREGEN (1<<22) //not really a forcetweak but no room in weapon tweaks!
#define FT_DRAINDMGNERF (1<<21) //drain takes 3 instead of 4fp from enemy
#define FT_FIXGRIPPEDREGEN (1<<22) //lets you regen during a jump if you are caught and not holding jump (?)


//Saber tweaks
Expand Down
20 changes: 16 additions & 4 deletions codemp/game/w_force.c
Original file line number Diff line number Diff line change
Expand Up @@ -2095,23 +2095,30 @@ void ForceDrainDamage( gentity_t *self, gentity_t *traceEnt, vec3_t dir, vec3_t
int modPowerLevel = -1;
int dmg = 0; //Q_irand( 1, 3 );
int dmg2 = 0;
int healthoverride = 0;

if (self->client->ps.fd.forcePowerLevel[FP_DRAIN] == FORCE_LEVEL_1)
{
dmg = 2; //because it's one-shot
}
else if (self->client->ps.fd.forcePowerLevel[FP_DRAIN] == FORCE_LEVEL_2)
{
dmg = 3;
if (self->client->sess.raceMode)
dmg = -4;
else
dmg = 3;
}
else if (self->client->ps.fd.forcePowerLevel[FP_DRAIN] == FORCE_LEVEL_3)
{
#if _draintest
dmg = g_forceDrainDamage.integer;//4
#else
dmg = 4;
if (g_tweakForce.integer & FT_DRAINDMGNERF) {
healthoverride = 4;
dmg = 3;
}
else
dmg = 4;
#endif
}

Expand Down Expand Up @@ -2164,7 +2171,10 @@ void ForceDrainDamage( gentity_t *self, gentity_t *traceEnt, vec3_t dir, vec3_t
if (self->client->ps.stats[STAT_HEALTH] < self->client->ps.stats[STAT_MAX_HEALTH] &&
self->health > 0 && self->client->ps.stats[STAT_HEALTH] > 0)
{
self->health += dmg;
if (healthoverride)
self->health += healthoverride;
else
self->health += dmg;
if (self->health > self->client->ps.stats[STAT_MAX_HEALTH])
{
self->health = self->client->ps.stats[STAT_MAX_HEALTH];
Expand Down Expand Up @@ -5934,7 +5944,9 @@ void WP_ForcePowersUpdate( gentity_t *self, usercmd_t *ucmd )
if ( !(self->client->ps.fd.forcePowersActive & (1<<FP_LIGHTNING)) )
self->client->force.lightningDebounce = level.time;

if ( (!self->client->ps.fd.forcePowersActive || self->client->ps.fd.forcePowersActive == (1 << FP_DRAIN)) && //whats up with fp_drain being mentioned here
//Com_Printf("Forcepowers active %i for %s\n", self->client->ps.fd.forcePowersActive, self->client->pers.netname);

if ( (!self->client->ps.fd.forcePowersActive || self->client->ps.fd.forcePowersActive == (1 << FP_DRAIN) || (self->client->ps.fd.forceGripBeingGripped && g_tweakForce.integer & FT_FIXGRIPPEDREGEN && self->client->ps.fd.forcePowersActive == (1 << FP_LEVITATION) && self->client->pers.cmd.upmove <= 0)) && //whats up with fp_drain being mentioned here
((self->client->sess.movementStyle != MV_TRIBES) || !(self->client->ps.eFlags & EF_JETPACK_ACTIVE)) &&
((self->client->sess.movementStyle != MV_TRIBES) || ((self->client->jetPackDebReduce + 250) < level.time)) && //Extra time here?
!self->client->ps.saberInFlight && (self->client->ps.stats[STAT_MOVEMENTSTYLE] != MV_SPEED) && (self->client->ps.weapon != WP_SABER || !BG_SaberInSpecial(self->client->ps.saberMove)) )
Expand Down

0 comments on commit ab32ca0

Please sign in to comment.