Skip to content

Commit

Permalink
Japro update (JACoders#193)
Browse files Browse the repository at this point in the history
* serverconfig prints

(cherry picked from commit 38aab76)

* network health on duel start/end

(cherry picked from commit a200b23)

---------

Co-authored-by: videoP <videoprofess@gmail.com>
  • Loading branch information
taysta and videoP committed May 2, 2024
1 parent 8397d66 commit 13eac34
Show file tree
Hide file tree
Showing 4 changed files with 33 additions and 6 deletions.
3 changes: 3 additions & 0 deletions codemp/game/g_active.c
Original file line number Diff line number Diff line change
Expand Up @@ -4490,6 +4490,9 @@ void ClientThink_real( gentity_t *ent ) {
}
ent->client->ps.stats[STAT_HEALTH] = ent->health = ent->client->ps.stats[STAT_MAX_HEALTH];
ent->client->ps.stats[STAT_ARMOR] = 25;//JAPRO
if (g_showHealth.integer) {
G_ScaleNetHealth(ent);
}
if (g_spawnInvulnerability.integer) {
ent->client->ps.eFlags |= EF_INVULNERABLE;
ent->client->invulnerableTimer = level.time + g_spawnInvulnerability.integer;
Expand Down
18 changes: 18 additions & 0 deletions codemp/game/g_cmds.c
Original file line number Diff line number Diff line change
Expand Up @@ -4397,6 +4397,10 @@ void Cmd_EngageDuel_f(gentity_t *ent, int dueltype)//JAPRO - Serverside - Fullfo
ent->health = ent->client->ps.stats[STAT_HEALTH] = g_duelStartHealth.integer;
challenged->health = challenged->client->ps.stats[STAT_HEALTH] = g_duelStartHealth.integer;
}
if (g_showHealth.integer) {
G_ScaleNetHealth(ent);
G_ScaleNetHealth(challenged);
}
}
ent->client->ps.fd.forcePower = ent->client->ps.fd.forcePowerMax; //max force power too!
challenged->client->ps.fd.forcePower = challenged->client->ps.fd.forcePowerMax; //max force power too!
Expand Down Expand Up @@ -8357,6 +8361,14 @@ void Cmd_ServerConfig_f(gentity_t *ent) //loda fixme fix indenting on this, make
Q_strcat(buf, sizeof(buf), " ^5Red DFA boost exploit removed\n");
if (g_tweakSaber.integer & ST_REDDFANOFORCE)
Q_strcat(buf, sizeof(buf), " ^5Red DFA costs 0 forcepoints\n");
if (g_tweakSaber.integer & ST_NEWSPSABERDMG)
Q_strcat(buf, sizeof(buf), " ^5No velocity damgage boost for SP damages\n");
else if (g_tweakSaber.integer & ST_DUNESABER)
Q_strcat(buf, sizeof(buf), " ^5Negative velocity damage boost for SP damages\n");
else if (g_tweakSaber.integer & ST_NEWSPSABERDMGCAP)
Q_strcat(buf, sizeof(buf), " ^5Limited velocity damage boost for SP damages\n");


trap->SendServerCommand(ent-g_entities, va("print \"%s\"", buf));

//Gun changes
Expand Down Expand Up @@ -8560,6 +8572,12 @@ void Cmd_ServerConfig_f(gentity_t *ent) //loda fixme fix indenting on this, make
Q_strcat(buf, sizeof(buf), " ^5Pull resistance when shooting/charging weapons\n");
if (g_tweakForce.integer & FT_NORAGEFIRERATE)
Q_strcat(buf, sizeof(buf), " ^5Dark rage does not affect weapon firerate\n");
if (g_tweakForce.integer & FT_BUFFMINDTRICK)
Q_strcat(buf, sizeof(buf), " ^5Mind trick does not break when damaging target unless they are looking at you\n");
if (g_tweakForce.integer & FT_DRAINDMGNERF)
Q_strcat(buf, sizeof(buf), " ^5Drain takes 25% less forcepoints from target\n");
if (g_tweakForce.integer & FT_FIXGRIPPEDREGEN)
Q_strcat(buf, sizeof(buf), " ^5Jump does not pause your regen while being gripped\n");

trap->SendServerCommand(ent-g_entities, va("print \"%s\"", buf));
}
Expand Down
6 changes: 4 additions & 2 deletions codemp/game/g_svcmds.c
Original file line number Diff line number Diff line change
Expand Up @@ -994,8 +994,10 @@ static bitInfo_T forceTweaks[] = {
{"Nerfed weapon pull distance"},//17
{"Force resistance while firing/charging weapon"},//18
{"Stop rage from affecting firerate of weapons"},//19
{"Don't break mindtrick on attack unless trickee is looking at you"},//19
{"Stronger / different Melee attack"}//19
{"Don't break mindtrick on attack unless trickee is looking at you"},//20
{"Stronger / different Melee attack"},//21
{ "Drain takes 25% less force from target" },//22
{ "Regen force while being gripped if mid jump" },//23
};
static const int MAX_FORCE_TWEAKS = ARRAY_LEN( forceTweaks );

Expand Down
12 changes: 8 additions & 4 deletions codemp/game/g_trigger.c
Original file line number Diff line number Diff line change
Expand Up @@ -1314,6 +1314,8 @@ qboolean ValidRaceSettings(int restrictions, gentity_t *player)
return qfalse;
if (sv_fps.integer != 20 && sv_fps.integer != 30 && sv_fps.integer != 40)//Dosnt really make a difference.. but eh.... loda fixme
return qfalse;
//if (com_timescale.value != 1.0f) //umm..
//return qfalse;
if (sv_pluginKey.integer) {
if (!player->client->pers.validPlugin && player->client->pers.userName[0]) { //Meh.. only do this if they are logged in to keep the print colors working right i guess..
trap->SendServerCommand( player-g_entities, "cp \"^3Warning: a newer client plugin version\nis required!\n\n\n\n\n\n\n\n\n\n\""); //Since times wont be saved if they arnt logged in anyway
Expand Down Expand Up @@ -1968,21 +1970,23 @@ void Use_target_restrict_on(gentity_t *trigger, gentity_t *other, gentity_t *pla
if (level.time - player->client->oobTime > trigger->count * 1000) {
//trap->SendServerCommand(player - g_entities, "cp \"^1Flag Returned!\n\n\n\n\n\n\n\n\n\n\""); //Send message?
trap->SendServerCommand(player - g_entities, "cp \""); //clear previous flag warning print?
if (player->client->ps.powerups[PW_NEUTRALFLAG]) { // only happens in One Flag CTF
if (player->client->ps.powerups[PW_NEUTRALFLAG]) {
Team_ReturnFlag(TEAM_FREE);
player->client->ps.powerups[PW_NEUTRALFLAG] = 0;
}
else if (player->client->ps.powerups[PW_REDFLAG]) { // only happens in standard CTF
else if (player->client->ps.powerups[PW_REDFLAG]) {
Team_ReturnFlag(TEAM_RED);
player->client->ps.powerups[PW_REDFLAG] = 0;
}
else if (player->client->ps.powerups[PW_BLUEFLAG]) { // only happens in standard CTF
else if (player->client->ps.powerups[PW_BLUEFLAG]) {
Team_ReturnFlag(TEAM_BLUE);
player->client->ps.powerups[PW_BLUEFLAG] = 0;
}
}
else {
trap->SendServerCommand(player - g_entities, va("cp \"^3Flag returning in %.1fs\n\n\n\n\n\n\n\n\n\n\"", 0.001*(trigger->count * 1000 - (level.time - player->client->oobTime)))); //Send message?`
if (player->client->ps.powerups[PW_NEUTRALFLAG] || player->client->ps.powerups[PW_REDFLAG] || player->client->ps.powerups[PW_BLUEFLAG]) {
trap->SendServerCommand(player - g_entities, va("cp \"^3Flag returning in %.1fs\n\n\n\n\n\n\n\n\n\n\"", 0.001*(trigger->count * 1000 - (level.time - player->client->oobTime)))); //Send message?`
}
}

}
Expand Down

0 comments on commit 13eac34

Please sign in to comment.