Skip to content

Commit

Permalink
Merge pull request #1283 from newbytf/dev-cur
Browse files Browse the repository at this point in the history
Dev cur
  • Loading branch information
newbytf authored Jan 19, 2024
2 parents f5a98be + e5d53f8 commit 3ea6960
Show file tree
Hide file tree
Showing 6 changed files with 33 additions and 27 deletions.
4 changes: 4 additions & 0 deletions csqc/weapon_predict.qc
Original file line number Diff line number Diff line change
Expand Up @@ -275,6 +275,7 @@ void WPP_Status() {
PRINT_CONFIG(max_rewind_fast_projectile_ms);
PRINT_CONFIG(max_rewind_grenade_ms);
PRINT_CONFIG(rewind_fast_projectile_thresh);
PRINT_CONFIG(new_balance);
printf("\n");

PrintFlagField("Rewind Settings [rewind_flags=%d]\n",
Expand All @@ -286,6 +287,9 @@ void WPP_Status() {
PrintFlagField("Clown mode [clown_flags=%d]\n",
fo_config.clown_flags, CLOWN_DESC.length, CLOWN_DESC);

PrintFlagField("NewBalance Flags [newbalance_flags=%d]:\n",
fo_config.new_balance_flags, NBF_DESC.length, NBF_DESC);

PrintFlagField("Concs [fo_concuss=%d]\n",
fo_config.fo_concuss, FO_CONC.length, FO_CONC);
}
Expand Down
2 changes: 1 addition & 1 deletion share/classes.qc
Original file line number Diff line number Diff line change
Expand Up @@ -173,7 +173,7 @@ enum {
};

float NB_UseNewConc() {
return fo_config.new_balance_flags & NBF_OLD_CONC == 0;
return fo_config.new_balance_flags & NBF_CONC_NEW_CAP;
}

float NB_NoCap() {
Expand Down
7 changes: 6 additions & 1 deletion share/commondefs.qc
Original file line number Diff line number Diff line change
Expand Up @@ -307,6 +307,11 @@ float NewBalanceActive() {
}

enumflags {
NBF_OLD_CONC,
NBF_CONC_NEW_CAP,
NBF_NO_CAP,
};

string NBF_DESC[] = {
"Reworked conc speed cap",
"No conc speed cap",
};
1 change: 1 addition & 0 deletions share/defs.h
Original file line number Diff line number Diff line change
Expand Up @@ -1312,6 +1312,7 @@ enum {
#define DMSG_GREN_SHOCK 42
#define DMSG_GREN_BURST 43
#define DMSG_KNIFE 44
#define DMSG_IMPELLER 45

/*======================================================*/
/* Menus */
Expand Down
21 changes: 13 additions & 8 deletions ssqc/client.qc
Original file line number Diff line number Diff line change
Expand Up @@ -259,16 +259,16 @@ void ActivateNewBalance() {
PC_PYRO_AIRBLAST_COOLDOWN = 10;
PC_ENGINEER_GRENADE_TYPE_2_RANGE = 200;

float use_new_conc = CF_GetSetting("nbc", "new_balance_concs", "4");
if (use_new_conc == 4 && ServerRegion() == kRegionOCE)
use_new_conc = 1;
float use_new_cap = CF_GetSetting("nbcc", "new_balance_conc_cap", "4");
if (use_new_cap == 4 && ServerRegion() == kRegionOCE)
use_new_cap = 1;
else
use_new_conc = 0;
use_new_cap = 0;

if (!use_new_conc)
fo_config.new_balance_flags |= NBF_OLD_CONC;
float no_cap = CF_GetSetting("nbnc", "new_balance_no_cap", "0");
if (no_cap)
if (use_new_cap)
fo_config.new_balance_flags |= NBF_CONC_NEW_CAP;

if (CF_GetSetting("nbnc", "new_balance_no_cap", "0"))
fo_config.new_balance_flags |= NBF_NO_CAP;

if (NB_UseMinPing()) {
Expand Down Expand Up @@ -3391,6 +3391,8 @@ string (entity pe_target, entity pe_attacker, float pf_deathmsg) GetDeathMessage
s_deathstring = " gets too friendly with his sentry gun\n";
else if (pf_deathmsg == DMSG_DISPENSER_EXPLODE)
s_deathstring = " dispenses with himself\n";
else if (pf_deathmsg == DMSG_IMPELLER)
s_deathstring = " couldn't resist their inner impelsions\n";

return strcat(pe_target.netname, s_deathstring);

Expand Down Expand Up @@ -3658,6 +3660,9 @@ string (entity pe_target, entity pe_attacker, float pf_deathmsg) GetDeathMessage
} else if (pf_deathmsg == DMSG_LASERBOLT) {
s_deathstring = " gets a hole in his heart from ";
s_deathstring2 = "'s railgun\n";
} else if (pf_deathmsg == DMSG_IMPELLER) {
s_deathstring = " gets pushed around by ";
s_deathstring2 = "\n";
} else if (pf_deathmsg == DMSG_INCENDIARY) {
s_deathstring = " gets well done by ";
s_deathstring2 = "'s incendiary rocket\n";
Expand Down
25 changes: 8 additions & 17 deletions ssqc/engineer.qc
Original file line number Diff line number Diff line change
Expand Up @@ -78,32 +78,22 @@ void () LaserBolt_Touch = {
dremove(self);
};

static void ImpellerTouch() {
self.owner = self.real_owner;

if (other.health) {
deathmsg = DMSG_LASERBOLT;
TF_T_Damage(other, self, self.owner, 15, 2, TF_TD_ELECTRICITY | TF_TD_NOMOMENTUM);

float mag = 250;
if (other.has_flag)
mag *= 2;
other.velocity += normalize(self.velocity) * mag;
}
dremove(self);
}

static const float kImpellerTargetRange = 1500;

static float ValidImpellerTarget(entity t) {
if (t.classname != "player")
return FALSE;

if (vlen(t.origin - self.origin) > kImpellerTargetRange)
return FALSE;

if (cb_prematch) // Shoot anyone in prematch
return TRUE;

return (t.team_no != self.team_no && t.has_flag);
}


static entity FindImpellerTarget(vector org, float min_a, float* direct) {

traceline(org, org + 1500 * v_forward, MOVE_NORMAL, world);
Expand Down Expand Up @@ -199,7 +189,7 @@ void W_FireImpeller() {
end = t.origin;
draw_beam(org, t.origin, TE_LIGHTNING2);
} else {
vector a = org, b = org + 1000 * v_forward;
vector a = org, b = org + kImpellerTargetRange * v_forward;
traceline(a, b, MOVE_WORLDONLY, world);
if (trace_fraction == 1)
return;
Expand All @@ -217,7 +207,8 @@ void W_FireImpeller() {
end = t.origin;
}

TF_T_Damage(hit, self, self, 5, 2, TF_TD_ELECTRICITY | TF_TD_NOMOMENTUM);
deathmsg = DMSG_IMPELLER;
TF_T_Damage(hit, self, self, 5, TF_TD_NOTTEAM, TF_TD_ELECTRICITY | TF_TD_NOMOMENTUM);
hit.flags &= ~FL_ONGROUND;
hit.velocity -= mag * normalize(end - org);
if (other.has_flag)
Expand Down

0 comments on commit 3ea6960

Please sign in to comment.