Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Japro update #206

Merged
merged 4 commits into from
May 28, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions codemp/cgame/cg_weaponinit.c
Original file line number Diff line number Diff line change
Expand Up @@ -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");
Expand Down
13 changes: 12 additions & 1 deletion codemp/cgame/fx_bryarpistol.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}
}

/*
Expand Down
10 changes: 9 additions & 1 deletion codemp/game/bg_pmove.c
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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])
Expand Down Expand Up @@ -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;
Expand Down
1 change: 1 addition & 0 deletions codemp/game/bg_public.h
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
3 changes: 3 additions & 0 deletions codemp/game/g_active.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
}
}
}
Expand Down
6 changes: 4 additions & 2 deletions codemp/game/g_client.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand All @@ -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;
Expand Down
41 changes: 34 additions & 7 deletions codemp/game/g_cmds.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
}
}
}

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

Expand Down
5 changes: 3 additions & 2 deletions codemp/game/g_items.c
Original file line number Diff line number Diff line change
Expand Up @@ -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])
Expand Down
2 changes: 2 additions & 0 deletions codemp/game/g_local.h
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
12 changes: 9 additions & 3 deletions codemp/game/g_trigger.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
}

Expand Down Expand Up @@ -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) {
Expand Down
Loading