Skip to content

Commit

Permalink
thrust buff, spread for light chain
Browse files Browse the repository at this point in the history
  • Loading branch information
videoP committed Feb 27, 2024
1 parent 22b2d56 commit 70ed83f
Show file tree
Hide file tree
Showing 3 changed files with 39 additions and 11 deletions.
9 changes: 4 additions & 5 deletions codemp/game/bg_pmove.c
Expand Up @@ -4126,6 +4126,7 @@ static void PM_ThrustMove(void)
{
if (!pm->ps->stats[STAT_WJTIME] && (pm->cmd.buttons & BUTTON_FORCE_LIGHTNING)) {
pm->ps->stats[STAT_WJTIME] = 800;
pm->ps->fd.forcePower = pm->ps->fd.forcePower * 0.25f;
#ifdef _GAME
gentity_t *self = (gentity_t *)pm_entSelf;
G_PlayEffect(EFFECT_LANDING_SNOW, pm->ps->origin, pml.forward);//Should be spot on wall, and wallnormal, a better, predicted way to do this?
Expand Down Expand Up @@ -4156,13 +4157,11 @@ static void PM_ThrustMove(void)

strength *= pm->ps->fd.forcePower;

VectorMA(pm->ps->velocity, 35 * strength * pml.frametime, pml.forward, pm->ps->velocity); //fall off the faster we go?
VectorMA(pm->ps->velocity, 140 * strength * pml.frametime, pml.forward, pm->ps->velocity); //fall off the faster we go?

pm->ps->fd.forcePowersActive |= (1 << FP_SPEED);
}
else if (pm->ps->stats[STAT_WJTIME] > 300) { //This is messed up but it works. otherwise can't really modify fp as we go because deltatime and cant get more discrete than 1fp.
pm->ps->fd.forcePower = 0;
//pm->ps->stats[STAT_WJTIME] = 0;
else if (pm->ps->stats[STAT_WJTIME] > 300) { //cooldown
}
else {
pm->ps->fd.forcePowersActive &= ~(1 << FP_SPEED);
Expand Down Expand Up @@ -13626,7 +13625,7 @@ void PmoveSingle (pmove_t *pmove) {
else if (xy_hackscale > 4)
xy_hackscale = 4;

Com_Printf("Hackscalexy is %.2f\n", xy_hackscale);
//Com_Printf("Hackscalexy is %.2f\n", xy_hackscale);

//Why does this behave so weird between 0-500 speed? so slow

Expand Down
4 changes: 2 additions & 2 deletions codemp/game/g_active.c
Expand Up @@ -3476,7 +3476,7 @@ void ClientThink_real( gentity_t *ent ) {
{
qboolean forceSingle = qfalse;
qboolean changeStyle = qfalse;
if ((g_saberDisable.integer || (!client->sess.raceMode && g_tweakWeapons.integer & WT_TRIBES) || (client->sess.raceMode && client->sess.movementStyle >= MV_COOP_JKA))
if ((g_saberDisable.integer || (!client->sess.raceMode && g_tweakWeapons.integer & WT_TRIBES) || (client->sess.raceMode && client->sess.movementStyle == MV_COOP_JKA))
&& ent->s.weapon == WP_SABER && ent->s.eType == ET_PLAYER && client->sess.sessionTeam != TEAM_SPECTATOR) {
//trap->Print("AnimLevel: %i, DrawLevel: %i, Baselevel: %i\n", ent->client->ps.fd.saberAnimLevel, ent->client->ps.fd.saberDrawAnimLevel, ent->client->ps.fd.saberAnimLevelBase);
if (!client->sess.raceMode && (g_tweakWeapons.integer & WT_TRIBES)) {
Expand Down Expand Up @@ -3526,7 +3526,7 @@ void ClientThink_real( gentity_t *ent ) {
forceSingle = qtrue;
}

if ((((g_saberDisable.integer & SABERSTYLE_STAFF) && (g_saberDisable.integer & SABERSTYLE_DUAL)) || (client->sess.raceMode && client->sess.movementStyle >= MV_COOP_JKA))
if ((((g_saberDisable.integer & SABERSTYLE_STAFF) && (g_saberDisable.integer & SABERSTYLE_DUAL)) || (client->sess.raceMode && client->sess.movementStyle == MV_COOP_JKA))
&& (Q_stricmp(client->pers.saber1, "kyle") || Q_stricmp(client->pers.saber2, "none")))
{//No staff or dual.. force single kyle saber if not already.
client->ps.fd.saberAnimLevel = client->ps.fd.saberDrawAnimLevel = client->ps.fd.saberAnimLevelBase = SS_STRONG;
Expand Down
37 changes: 33 additions & 4 deletions codemp/game/g_weapon.c
Expand Up @@ -236,11 +236,14 @@ BRYAR PISTOL
*/

//----------------------------------------------
static void WP_FireBryarPistol( gentity_t *ent, qboolean altFire )
static void WP_FireBryarPistol( gentity_t *ent, qboolean altFire, int seed )
//---------------------------------------------------------
{
int damage, vel, count, charge;
gentity_t *missile;
vec3_t dir;

VectorCopy(forward, dir);

if (ent && ent->client && g_tweakWeapons.integer & WT_TRIBES) { //Chaingun Overheat mechanic
damage = 6*g_weaponDamageScale.value;
Expand All @@ -256,8 +259,34 @@ static void WP_FireBryarPistol( gentity_t *ent, qboolean altFire )
damage = BRYAR_PISTOL_DAMAGE * g_projectileVelocityScale.value;
charge = BRYAR_CHARGE_UNIT;
}


if (!altFire && (g_tweakWeapons.integer & WT_TRIBES))
{
float slop = 0.4f;
vec3_t angs;

vectoangles(forward, angs);

// add some slop to the alt-fire direction
if (g_tweakWeapons.integer & WT_PSEUDORANDOM_FIRE)
{
float theta = M_PI * Q_crandom(&seed); //Lets use circular spread instead of the shitty box spread?
float r = Q_random(&seed);

angs[PITCH] += r*slop * sin(theta); //r should be squared? r*r
angs[YAW] += r*slop * cos(theta);
}
else
{
angs[PITCH] += crandom() * slop;
angs[YAW] += crandom() * slop;
}

AngleVectors(angs, dir, NULL, NULL);
}

missile = CreateMissileNew(muzzle, forward, vel, 10000, ent, altFire, qtrue, qtrue);
missile = CreateMissileNew(muzzle, dir, vel, 10000, ent, altFire, qtrue, qtrue);
missile->classname = "bryar_proj";
missile->s.weapon = WP_BRYAR_PISTOL;

Expand Down Expand Up @@ -6368,7 +6397,7 @@ void FireWeapon( gentity_t *ent, qboolean altFire ) {
break;

case WP_BRYAR_PISTOL:
WP_FireBryarPistol( ent, altFire );
WP_FireBryarPistol( ent, altFire, seed );
break;

case WP_CONCUSSION:
Expand All @@ -6379,7 +6408,7 @@ void FireWeapon( gentity_t *ent, qboolean altFire ) {
break;

case WP_BRYAR_OLD:
WP_FireBryarPistol( ent, altFire );
WP_FireBryarPistol( ent, altFire, seed );
break;

case WP_BLASTER:
Expand Down

0 comments on commit 70ed83f

Please sign in to comment.