From aff8ccfc3fa13e04da2d0ec7dc2a6a92c5fa89fa Mon Sep 17 00:00:00 2001 From: videoP Date: Mon, 27 May 2024 09:44:54 +0800 Subject: [PATCH 1/4] fixes & tribes weapon stuff, superjump restrict (cherry picked from commit c342b56586af75fc6a88854c47588094b59eda12) --- codemp/game/bg_pmove.c | 10 ++- codemp/game/bg_public.h | 1 + codemp/game/g_active.c | 3 + codemp/game/g_client.c | 6 +- codemp/game/g_cmds.c | 41 +++++++-- codemp/game/g_combat.c | 4 +- codemp/game/g_items.c | 5 +- codemp/game/g_local.h | 2 + codemp/game/g_trigger.c | 12 ++- codemp/game/g_weapon.c | 181 ++++++++++++++++++++++++++++++++++------ 10 files changed, 221 insertions(+), 44 deletions(-) diff --git a/codemp/game/bg_pmove.c b/codemp/game/bg_pmove.c index 9034a3ce2a..0920dc3d2a 100644 --- a/codemp/game/bg_pmove.c +++ b/codemp/game/bg_pmove.c @@ -3452,6 +3452,10 @@ static qboolean PM_CheckJump( void ) else { pm->ps->velocity[2] = JUMP_VELOCITY; } + + if (pm->ps->stats[STAT_RESTRICTIONS] & JAPRO_RESTRICT_SUPERJUMP) { + pm->ps->velocity[2] *= 3.0f; + } } //Jumping @@ -9921,6 +9925,10 @@ if (pm->ps->duelInProgress) addTime = 100; break; case WP_BRYAR_PISTOL: + if ((pm->cmd.buttons & BUTTON_ALT_ATTACK) && !pm->ps->stats[STAT_RACEMODE] && (g_tweakWeapons.integer & WT_TRIBES)) + addTime = 1000; + else if (!(pm->cmd.buttons & BUTTON_ALT_ATTACK) && !pm->ps->stats[STAT_RACEMODE] && (g_tweakWeapons.integer & WT_TRIBES)) + addTime = 1000; break; case WP_BLASTER: if ((pm->cmd.buttons & BUTTON_ALT_ATTACK) && pm->ps->stats[STAT_RACEMODE]) @@ -9972,7 +9980,7 @@ if (pm->ps->duelInProgress) break; case WP_CONCUSSION: if ((pm->cmd.buttons & BUTTON_ALT_ATTACK) && !pm->ps->stats[STAT_RACEMODE] && (g_tweakWeapons.integer & WT_TRIBES)) - addTime = 800; + addTime = 1400; else if (!(pm->cmd.buttons & BUTTON_ALT_ATTACK) && !pm->ps->stats[STAT_RACEMODE] && (g_tweakWeapons.integer & WT_TRIBES)) addTime = 1200; break; diff --git a/codemp/game/bg_public.h b/codemp/game/bg_public.h index e621b37562..66b7845fca 100644 --- a/codemp/game/bg_public.h +++ b/codemp/game/bg_public.h @@ -509,6 +509,7 @@ extern int bgForcePowerCost[NUM_FORCE_POWERS][NUM_FORCE_POWER_LEVELS]; #define JAPRO_RESTRICT_CROUCHJUMP (1<<1) #define JAPRO_RESTRICT_DOUBLEJUMP (1<<2) #define JAPRO_RESTRICT_ALLOWTELES (1<<3) +#define JAPRO_RESTRICT_SUPERJUMP (1<<4) //ja+ cp_plugindisable stuff #define JAPRO_PLUGIN_NEWDRAINEFX (1<<0) diff --git a/codemp/game/g_active.c b/codemp/game/g_active.c index 29937556df..549681bf4d 100644 --- a/codemp/game/g_active.c +++ b/codemp/game/g_active.c @@ -4363,6 +4363,9 @@ void ClientThink_real( gentity_t *ent ) { client->ps.gravity *= 1.5f; } } + if (client->ps.stats[STAT_RESTRICTIONS] & JAPRO_RESTRICT_SUPERJUMP) { + client->ps.gravity *= 1.75f; + } } } } diff --git a/codemp/game/g_client.c b/codemp/game/g_client.c index 4fb0239440..0f0d84b59b 100644 --- a/codemp/game/g_client.c +++ b/codemp/game/g_client.c @@ -3831,7 +3831,7 @@ void GiveClientWeapons(gclient_t *client) { //Give tribes loadout. else if (client->pers.tribesClass == 1) { //Light - client->ps.stats[STAT_WEAPONS] |= ((1 << WP_DISRUPTOR) + (1 << WP_BOWCASTER) + (1 << WP_THERMAL) + (1 << WP_SABER) + (1 << WP_BRYAR_OLD)); + client->ps.stats[STAT_WEAPONS] |= ((1 << WP_DISRUPTOR) + (1 << WP_BOWCASTER) + (1 << WP_SABER) + (1 << WP_BRYAR_OLD)); client->ps.ammo[AMMO_THERMAL] = 2; client->ps.ammo[AMMO_BLASTER] = 500; client->ps.ammo[AMMO_POWERCELL] = 900; @@ -3842,10 +3842,12 @@ void GiveClientWeapons(gclient_t *client) { client->ps.ammo[AMMO_POWERCELL] = 900; client->ps.ammo[AMMO_BLASTER] = 500; client->ps.ammo[AMMO_METAL_BOLTS] = 800; + client->ps.ammo[AMMO_DETPACK] = 2; } else if (client->pers.tribesClass == 3) { //Heavy - client->ps.stats[STAT_WEAPONS] |= ((1 << WP_REPEATER) + (1 << WP_DEMP2) + (1 << WP_ROCKET_LAUNCHER) + (1 << WP_TRIP_MINE) + (1 << WP_SABER)); + client->ps.stats[STAT_WEAPONS] |= ((1 << WP_BRYAR_PISTOL) + (1 << WP_REPEATER) + (1 << WP_DEMP2) + (1 << WP_ROCKET_LAUNCHER) + (1 << WP_SABER)); + client->ps.ammo[AMMO_BLASTER] = 200; client->ps.ammo[AMMO_POWERCELL] = 600; client->ps.ammo[AMMO_METAL_BOLTS] = 800; client->ps.ammo[AMMO_ROCKETS] = 30; diff --git a/codemp/game/g_cmds.c b/codemp/game/g_cmds.c index 66e41d3e8a..54481963f3 100644 --- a/codemp/game/g_cmds.c +++ b/codemp/game/g_cmds.c @@ -8658,13 +8658,40 @@ void Cmd_Throwflag_f( gentity_t *ent ) { void WP_ThrowGrenade(gentity_t *ent); void Cmd_ThrowNade_f(gentity_t *ent) { - if (ent && ent->client && (ent->client->specificWeaponTime[WP_THERMAL] <= 0) && (ent->client->ps.ammo[AMMO_THERMAL] > 0) && !ent->client->sess.raceMode && (g_tweakWeapons.integer & WT_TRIBES)) { - ent->client->ps.weaponTime += 1000; - ent->client->specificWeaponTime[WP_THERMAL] += 1000; - if (!(g_tweakWeapons.integer & WT_INFINITE_AMMO)) - ent->client->ps.ammo[AMMO_THERMAL] -= 1; - WP_ThrowGrenade(ent); - StandardSetBodyAnim(ent, BOTH_THERMAL_THROW, SETANIM_FLAG_OVERRIDE | SETANIM_FLAG_HOLD | SETANIM_FLAG_HOLDLESS, SETANIM_TORSO); + if (ent && ent->client && !ent->client->sess.raceMode && (g_tweakWeapons.integer & WT_TRIBES)) { + if (ent->client->pers.tribesClass == 3) { + if (ent->client->ps.ammo[AMMO_TRIPMINE] > 0) { + WP_ThrowGrenade(ent); + StandardSetBodyAnim(ent, BOTH_MELEE1, SETANIM_FLAG_OVERRIDE | SETANIM_FLAG_HOLD | SETANIM_FLAG_HOLDLESS, SETANIM_TORSO); + ent->client->specificWeaponTime[WP_TRIP_MINE] += 1000; + ent->client->ps.weaponTime += 1000; + if (!(g_tweakWeapons.integer & WT_INFINITE_AMMO)) + ent->client->ps.ammo[AMMO_TRIPMINE] -= 1; + } + } + else if (ent->client->pers.tribesClass == 2) { + if (ent->client->ps.ammo[AMMO_DETPACK] > 0) { + WP_ThrowGrenade(ent); + if (ent->client->ps.ammo[AMMO_DETPACK] > 0) + StandardSetBodyAnim(ent, BOTH_MELEE1, SETANIM_FLAG_OVERRIDE | SETANIM_FLAG_HOLD | SETANIM_FLAG_HOLDLESS, SETANIM_TORSO); + else + StandardSetBodyAnim(ent, BOTH_MELEE2, SETANIM_FLAG_OVERRIDE | SETANIM_FLAG_HOLD | SETANIM_FLAG_HOLDLESS, SETANIM_TORSO); + ent->client->specificWeaponTime[WP_DET_PACK] += 1000; + ent->client->ps.weaponTime += 1000; + if (!(g_tweakWeapons.integer & WT_INFINITE_AMMO)) + ent->client->ps.ammo[AMMO_DETPACK] -= 1; + } + } + else { + if (ent->client->ps.ammo[AMMO_THERMAL] > 0) { + WP_ThrowGrenade(ent); + StandardSetBodyAnim(ent, BOTH_THERMAL_THROW, SETANIM_FLAG_OVERRIDE | SETANIM_FLAG_HOLD | SETANIM_FLAG_HOLDLESS, SETANIM_TORSO); + ent->client->specificWeaponTime[WP_THERMAL] += 1000; + ent->client->ps.weaponTime += 1000; + if (!(g_tweakWeapons.integer & WT_INFINITE_AMMO)) + ent->client->ps.ammo[AMMO_THERMAL] -= 1; + } + } } } diff --git a/codemp/game/g_combat.c b/codemp/game/g_combat.c index 48170362da..5511c60abd 100644 --- a/codemp/game/g_combat.c +++ b/codemp/game/g_combat.c @@ -4986,11 +4986,11 @@ void G_Damage( gentity_t *targ, gentity_t *inflictor, gentity_t *attacker, vec3_ VectorScale(targ->client->ps.velocity, cut, targ->client->ps.velocity); } - if (targ->client->ps.electrifyTime > level.time && (g_tweakWeapons.integer & WT_TRIBES)) { + if (targ && targ->client && targ->client->ps.electrifyTime > level.time && (g_tweakWeapons.integer & WT_TRIBES)) { damage *= 1.5f; } - if ((mod == MOD_DISRUPTOR || mod == MOD_DISRUPTOR_SNIPER) && (g_tweakWeapons.integer & WT_TRIBES)) { //Zenyatta expose shit + if ((mod == MOD_DISRUPTOR || mod == MOD_DISRUPTOR_SNIPER) && targ && targ->client && (g_tweakWeapons.integer & WT_TRIBES)) { //Zenyatta expose shit targ->client->ps.electrifyTime = level.time + 4000; } diff --git a/codemp/game/g_items.c b/codemp/game/g_items.c index 4cd6a5024c..fe743718e4 100644 --- a/codemp/game/g_items.c +++ b/codemp/game/g_items.c @@ -2267,22 +2267,23 @@ int Pickup_Ammo (gentity_t *ent, gentity_t *other) other->client->ps.ammo[AMMO_POWERCELL] = 600; other->client->ps.ammo[AMMO_METAL_BOLTS] = 900; other->client->ps.ammo[AMMO_ROCKETS] = 30; - other->client->ps.ammo[AMMO_THERMAL] = 2; - other->client->ps.ammo[AMMO_TRIPMINE] = 2; if (other->health > 0 && other->health < other->client->ps.stats[STAT_MAX_HEALTH]) { other->client->passiveHealthDebReduce = level.time; //Passif regen if (other->client->pers.tribesClass == 1) { other->health += 250; other->client->ps.stats[STAT_HOLDABLE_ITEMS] |= (1 << HI_SENTRY_GUN); + other->client->ps.ammo[AMMO_THERMAL] = 2; } else if (other->client->pers.tribesClass == 2) { other->health += 300; other->client->ps.stats[STAT_HOLDABLE_ITEMS] |= (1 << HI_EWEB); + other->client->ps.ammo[AMMO_DETPACK] = 2; } else if (other->client->pers.tribesClass == 3) { other->health += 350; other->client->ps.stats[STAT_HOLDABLE_ITEMS] |= (1 << HI_SHIELD); + other->client->ps.ammo[AMMO_TRIPMINE] = 2; } if (other->health > other->client->ps.stats[STAT_MAX_HEALTH]) diff --git a/codemp/game/g_local.h b/codemp/game/g_local.h index 6c1115cb75..fd65e72b3c 100644 --- a/codemp/game/g_local.h +++ b/codemp/game/g_local.h @@ -312,6 +312,8 @@ extern int dueltypes[MAX_CLIENTS];//JAPRO - Serverside - Fullforce Duels y is th #define RESTRICT_FLAG_DOUBLEJUMP (1<<7) #define RESTRICT_FLAG_ALLOWTELES (1<<8) #define RESTRICT_FLAG_RESET (1<<9) +#define RESTRICT_FLAG_SUPERJUMP (1<<10) + //JAPRO - Serverside - Unlagged bitvalues #define UNLAGGED_PROJ_NUDGE (1<<0) diff --git a/codemp/game/g_trigger.c b/codemp/game/g_trigger.c index fc2f43ec49..9f517671f4 100644 --- a/codemp/game/g_trigger.c +++ b/codemp/game/g_trigger.c @@ -2097,7 +2097,9 @@ void Use_target_restrict_on(gentity_t *trigger, gentity_t *other, gentity_t *pla if (player->client->sess.raceMode) player->client->ps.duelTime = 0; trap->SendServerCommand(player - g_entities, "cp \"Timer reset\n\n\n\n\n\n\n\n\n\n\""); //Send message?` - return; + } + if (trigger->spawnflags & RESTRICT_FLAG_SUPERJUMP) { + player->client->ps.stats[STAT_RESTRICTIONS] |= JAPRO_RESTRICT_SUPERJUMP; } } @@ -2137,9 +2139,13 @@ void Use_target_restrict_off( gentity_t *trigger, gentity_t *other, gentity_t *p player->client->savedJumpLevel = 0; } } - if (player->client->oobTime) + if (player->client->oobTime) { trap->SendServerCommand(player - g_entities, "cp \""); //clear previous flag warning print? - player->client->oobTime = 0; + player->client->oobTime = 0; + } + if (trigger->spawnflags & RESTRICT_FLAG_SUPERJUMP) { + player->client->ps.stats[STAT_RESTRICTIONS] &= ~JAPRO_RESTRICT_SUPERJUMP; + } } void FreePersonalSpeaker(gentity_t *speaker) { diff --git a/codemp/game/g_weapon.c b/codemp/game/g_weapon.c index 61e74c77cc..884c6ce82f 100644 --- a/codemp/game/g_weapon.c +++ b/codemp/game/g_weapon.c @@ -256,6 +256,93 @@ BRYAR PISTOL ====================================================================== */ +//--------------------------------------------------------- +static void WP_FireColt(gentity_t *ent) +//--------------------------------------------------------- +{ + int damage = 40; + qboolean render_impact = qtrue; + vec3_t start, end; + trace_t tr; + gentity_t *traceEnt, *tent; + float shotRange = 32768; + int ignore; + + memset(&tr, 0, sizeof(tr)); //to shut the compiler up + + VectorCopy(ent->client->ps.origin, start); + start[2] += ent->client->ps.viewheight;//By eyes - but why??? + VectorMA(start, shotRange, forward, end); + VectorMA(start, 1, vright, start); + + if (g_unlagged.integer & UNLAGGED_HITSCAN) + G_TimeShiftAllClients(ent->client->pers.cmd.serverTime, ent, qfalse); + + ignore = ent->s.number; + + JP_Trace(&tr, start, NULL, NULL, end, ignore, MASK_SHOT, qfalse, 0, 0); //Never use small hitbox for shocklance + + if (tr.entityNum == ENTITYNUM_NONE) + { + if (g_unlagged.integer & UNLAGGED_HITSCAN) + G_UnTimeShiftAllClients(ent, qfalse); + return; + } + //fix: shooting ourselves shouldn't be allowed + if (tr.entityNum == ent->s.number) + { + if (g_unlagged.integer & UNLAGGED_HITSCAN) + G_UnTimeShiftAllClients(ent, qfalse); + return; + } + + traceEnt = &g_entities[tr.entityNum]; + + if (g_unlagged.integer & UNLAGGED_HITSCAN) + G_UnTimeShiftAllClients(ent, qfalse); + + /* + // always render a shot beam, doing this the old way because I don't much feel like overriding the effect. + tent = G_TempEntity(tr.endpos, EV_DISRUPTOR_MAIN_SHOT); + VectorCopy(muzzle, tent->s.origin2); + tent->s.eventParm = ent->s.number; + */ + + traceEnt = &g_entities[tr.entityNum]; + + + if (tr.entityNum < ENTITYNUM_WORLD && traceEnt->takedamage) + { + if (traceEnt->client && LogAccuracyHit(traceEnt, ent)) + { + ent->client->accuracy_hits++; + } + + damage *= 1 - tr.fraction; + if (damage < 20) + damage = 20; + damage *= g_weaponDamageScale.value; + + G_Damage(traceEnt, ent, ent, forward, tr.endpos, damage, DAMAGE_NORMAL, MOD_BRYAR_PISTOL); //I guess keep this as turblast since MOD_STUN is used for healgun .. and we dont want shocklance to heal :\ + + tent = G_TempEntity(tr.endpos, EV_MISSILE_HIT); + tent->s.eventParm = DirToByte(tr.plane.normal); + if (traceEnt->client) + { + tent->s.weapon = 1; + } + } + else + { + // Hmmm, maybe don't make any marks on things that could break + tent = G_TempEntity(tr.endpos, EV_DISRUPTOR_SNIPER_MISS); + tent->s.eventParm = DirToByte(tr.plane.normal); + tent->s.weapon = 1; + } + + +} + //---------------------------------------------- static void WP_FireBryarPistol( gentity_t *ent, qboolean altFire, int seed ) //--------------------------------------------------------- @@ -3425,7 +3512,6 @@ gentity_t *WP_FireThermalDetonator( gentity_t *ent, qboolean altFire ) if (g_tweakWeapons.integer & WT_TRIBES) { chargeAmount = 1.0f; - altFire = qtrue; } else if (g_tweakWeapons.integer & WT_IMPACT_NITRON) { chargeAmount = 1.0f; @@ -3510,16 +3596,6 @@ gentity_t *WP_FireThermalDetonator( gentity_t *ent, qboolean altFire ) return bolt; } -void WP_ThrowGrenade( gentity_t *ent ) //Unused in JKA so repurpose this for tribes -{ - if (ent && ent->client) { - AngleVectors(ent->client->ps.viewangles, forward, vright, up); - CalcMuzzlePoint(ent, forward, vright, up, muzzle); - WP_FireThermalDetonator(ent, qfalse); - } -} - - //--------------------------------------------------------- qboolean WP_LobFire( gentity_t *self, vec3_t start, vec3_t target, vec3_t mins, vec3_t maxs, int clipmask, vec3_t velocity, qboolean tracePath, int ignoreEntNum, int enemyNum, @@ -4091,7 +4167,6 @@ void WP_PlaceLaserTrap( gentity_t *ent, qboolean alt_fire ) trap->LinkEntity((sharedEntity_t *)laserTrap); } - /* ====================================================================== @@ -4496,11 +4571,33 @@ void WP_DropDetPack( gentity_t *ent, qboolean alt_fire ) } } +void WP_ThrowGrenade(gentity_t *ent) //Unused in JKA so repurpose this for tribes +{ + if (ent && ent->client) { + AngleVectors(ent->client->ps.viewangles, forward, vright, up); + CalcMuzzlePoint(ent, forward, vright, up, muzzle); + + if (ent->client->pers.tribesClass == 3) { + WP_PlaceLaserTrap(ent, qtrue); + } + else if (ent->client->pers.tribesClass == 2) { + if (ent->client->ps.ammo[AMMO_DETPACK] > 1) + WP_DropDetPack(ent, qfalse); + else + WP_DropDetPack(ent, qtrue); + } + else { + WP_FireThermalDetonator(ent, qtrue); + } + } +} + void WP_FireSpinfusorAlt(gentity_t* ent) { gentity_t* missile; - int damage; - float vel = 32000; + int damage = 1000; + float count; + float vel = 1000; VectorMA(muzzle, -6, vright, muzzle);//temp fix but we should rewrite calcmuzzlepoint since this actually affects all weapons but is only really noticible with sniper @@ -4509,25 +4606,32 @@ void WP_FireSpinfusorAlt(gentity_t* ent) missile = CreateMissileNew(muzzle, forward, vel * g_projectileVelocityScale.value, 10000, ent, qtrue, qtrue, qtrue); - if (ent->client) { - damage = ent->client->ps.fd.forcePower * 0.5f * g_weaponDamageScale.value; - ent->client->jetPackDebReduce = level.time + 300; - if (damage < 10) - damage = 10; - ent->client->ps.fd.forcePower = 0; + + damage = ent->client->ps.fd.forcePower * 2; + missile->s.generic1 = damage * 0.02f; // The missile will then render according to the charge level. + if (damage < 100) { + damage = 100; } - else { - damage = 30 * g_weaponDamageScale.value; + if (missile->s.generic1 < 2) { + missile->s.generic1 = 2; } - missile->s.generic1 = damage; // The missile will then render according to the charge level. + damage *= g_weaponDamageScale.value; + + ent->client->ps.fd.forcePower = 0; + + + Com_Printf("Generic 1 %i\n", missile->s.generic1); if (!d_projectileGhoul2Collision.integer) { VectorSet(missile->r.maxs, 2, 2, 2); //constant hitbox VectorSet(missile->r.mins, -2, -2, -2); } - missile->classname = "bryar_proj"; - missile->s.weapon = WP_BRYAR_PISTOL; + //missile->classname = "bryar_proj"; + //missile->s.weapon = WP_BRYAR_PISTOL; + + missile->classname = "conc_proj"; + missile->s.weapon = WP_CONCUSSION; //VectorSet( missile->r.maxs, BOWCASTER_SIZE, BOWCASTER_SIZE, BOWCASTER_SIZE ); //VectorScale( missile->r.maxs, -1, missile->r.mins ); @@ -4537,6 +4641,9 @@ void WP_FireSpinfusorAlt(gentity_t* ent) missile->methodOfDeath = MOD_BLASTER; missile->clipmask = MASK_SHOT;// | CONTENTS_LIGHTSABER; + missile->splashDamage = damage; + missile->splashRadius = CONC_SPLASH_RADIUS; + //missile->flags |= FL_BOUNCE; missile->bounceCount = 8;//was 3 @@ -5128,6 +5235,16 @@ static void WP_FireLightningGun( gentity_t *ent ) if (d_projectileGhoul2Collision.integer) ghoul2 = qtrue; + if (g_tweakWeapons.integer & WT_TRIBES) { + shotRange = 1024; + + //damage = ent->client->ps.fd.forcePower * 0.5f * g_weaponDamageScale.value; + //if (damage < 10) + //damage = 10; + //ent->client->ps.fd.forcePower -= 1; + + } + memset(&tr, 0, sizeof(tr)); //to shut the compiler up @@ -5161,6 +5278,10 @@ static void WP_FireLightningGun( gentity_t *ent ) return; } + if (ent->client && g_tweakWeapons.integer & WT_TRIBES) { + ent->client->jetPackDebReduce = level.time + 200; + } + traceEnt = &g_entities[tr.entityNum]; if (ghoul2 && traceEnt->inuse && traceEnt->client) @@ -5236,6 +5357,9 @@ static void WP_FireShockLance( gentity_t *ent ) float shotRange = 240; int ignore; + if (g_tweakWeapons.integer & WT_TRIBES) + shotRange = 384; + memset(&tr, 0, sizeof(tr)); //to shut the compiler up VectorCopy( ent->client->ps.origin, start ); @@ -6462,7 +6586,7 @@ void FireWeapon( gentity_t *ent, qboolean altFire ) { CalcMuzzlePoint ( ent, forward, vright, up, muzzle ); // fire the specific weapon - switch( ent->s.weapon ) { + switch (ent->s.weapon) { case WP_STUN_BATON: if (g_tweakWeapons.integer & WT_STUN_LG && altFire)//JAPRO - Lightning Gun WP_FireLightningGun(ent); @@ -6480,7 +6604,10 @@ void FireWeapon( gentity_t *ent, qboolean altFire ) { break; case WP_BRYAR_PISTOL: - WP_FireBryarPistol( ent, altFire, seed ); + if (g_tweakWeapons.integer & WT_TRIBES) + WP_FireColt(ent, altFire); + else + WP_FireBryarPistol( ent, altFire, seed ); break; case WP_CONCUSSION: From 3399d12dde2770d3356feab2fadcdd4c87323a32 Mon Sep 17 00:00:00 2001 From: videoP Date: Sun, 26 May 2024 21:48:03 -0400 Subject: [PATCH 2/4] opsi (cherry picked from commit c71db031ac8553a6056974521eac0a397b904af0) --- codemp/game/g_weapon.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/codemp/game/g_weapon.c b/codemp/game/g_weapon.c index 884c6ce82f..4d4bff8c9c 100644 --- a/codemp/game/g_weapon.c +++ b/codemp/game/g_weapon.c @@ -257,7 +257,7 @@ BRYAR PISTOL */ //--------------------------------------------------------- -static void WP_FireColt(gentity_t *ent) +static void WP_FireColt(gentity_t *ent, qboolean altFire) //--------------------------------------------------------- { int damage = 40; From 55b65074446fc8d665739123aa38ae631f75b0cf Mon Sep 17 00:00:00 2001 From: videoP Date: Sun, 26 May 2024 22:21:55 -0400 Subject: [PATCH 3/4] colt falloff chng (cherry picked from commit df607e96607dc0b8b10c2f30592086d7ba489637) --- codemp/game/g_weapon.c | 16 ++++++++++------ 1 file changed, 10 insertions(+), 6 deletions(-) diff --git a/codemp/game/g_weapon.c b/codemp/game/g_weapon.c index 4d4bff8c9c..871c28afc8 100644 --- a/codemp/game/g_weapon.c +++ b/codemp/game/g_weapon.c @@ -260,7 +260,7 @@ BRYAR PISTOL static void WP_FireColt(gentity_t *ent, qboolean altFire) //--------------------------------------------------------- { - int damage = 40; + int damage = 35; qboolean render_impact = qtrue; vec3_t start, end; trace_t tr; @@ -313,16 +313,20 @@ static void WP_FireColt(gentity_t *ent, qboolean altFire) if (tr.entityNum < ENTITYNUM_WORLD && traceEnt->takedamage) { + int distance = tr.fraction * shotRange; + + if (distance < 5000) + damage = -0.004 * distance + 35; + else + damage = 15; + + damage *= g_weaponDamageScale.value; + if (traceEnt->client && LogAccuracyHit(traceEnt, ent)) { ent->client->accuracy_hits++; } - damage *= 1 - tr.fraction; - if (damage < 20) - damage = 20; - damage *= g_weaponDamageScale.value; - G_Damage(traceEnt, ent, ent, forward, tr.endpos, damage, DAMAGE_NORMAL, MOD_BRYAR_PISTOL); //I guess keep this as turblast since MOD_STUN is used for healgun .. and we dont want shocklance to heal :\ tent = G_TempEntity(tr.endpos, EV_MISSILE_HIT); From 8eb82f536838670e62e0e3a2ca79a8bbbd8dbe35 Mon Sep 17 00:00:00 2001 From: taysta Date: Tue, 28 May 2024 18:33:56 +0800 Subject: [PATCH 4/4] [jaPRO/Tribes] Weapon tweaks --- codemp/cgame/cg_weaponinit.c | 3 +++ codemp/cgame/fx_bryarpistol.c | 13 ++++++++++++- codemp/game/g_weapon.c | 2 +- 3 files changed, 16 insertions(+), 2 deletions(-) diff --git a/codemp/cgame/cg_weaponinit.c b/codemp/cgame/cg_weaponinit.c index 2b3a2b21f9..2e170f20f0 100644 --- a/codemp/cgame/cg_weaponinit.c +++ b/codemp/cgame/cg_weaponinit.c @@ -177,6 +177,9 @@ void CG_RegisterWeapon( int weaponNum) { break; case WP_CONCUSSION: + if (cgs.serverMod == SVMOD_JAPRO) { + cgs.effects.repeaterAltProjectileEffect = trap->FX_RegisterEffect("repeater/alt_projectile");//load this cuz spinfusor uses it in tribes mode + } weaponInfo->selectSound = trap->S_RegisterSound("sound/weapons/concussion/select.wav"); weaponInfo->flashSound[0] = trap->S_RegisterSound("sound/weapons/concussion/fire"); diff --git a/codemp/cgame/fx_bryarpistol.c b/codemp/cgame/fx_bryarpistol.c index 58ae911592..076024e7b3 100644 --- a/codemp/cgame/fx_bryarpistol.c +++ b/codemp/cgame/fx_bryarpistol.c @@ -230,7 +230,18 @@ void FX_ConcussionProjectileThink( centity_t *cent, const struct weaponInfo_s * forward[2] = 1.0f; } - trap->FX_PlayEffectID( cgs.effects.concussionShotEffect, cent->lerpOrigin, forward, -1, -1, qfalse ); + if (cent->currentState.generic1 && cgs.jcinfo2 & JAPRO_CINFO2_WTTRIBES) { + int t; + // see if we have some sort of extra charge going on + for (t = 1; t < cent->currentState.generic1; t++) + { + // just add ourselves over, and over, and over when we are charged + trap->FX_PlayEffectID(cgs.effects.repeaterAltProjectileEffect, cent->lerpOrigin, forward, -1, -1, qfalse); + } + } + else { + trap->FX_PlayEffectID(cgs.effects.concussionShotEffect, cent->lerpOrigin, forward, -1, -1, qfalse); + } } /* diff --git a/codemp/game/g_weapon.c b/codemp/game/g_weapon.c index 871c28afc8..cba41ccff5 100644 --- a/codemp/game/g_weapon.c +++ b/codemp/game/g_weapon.c @@ -4600,7 +4600,7 @@ void WP_FireSpinfusorAlt(gentity_t* ent) { gentity_t* missile; int damage = 1000; - float count; + //float count; float vel = 1000;