From cc7e64b6fb0a89c8e1a424a1a2be6e632268c49c Mon Sep 17 00:00:00 2001 From: otta8634 Date: Sat, 22 Feb 2025 00:38:15 +0800 Subject: [PATCH] Remove nade blasts from all nades except normal nade If a nade can do what normal nade does but something extra, nobody would ever pick normal nade, and it's not well balanced. Also deleted g_nades_napalm_blast, since that only existed for the purpose of allowing the blast to be disabled for it. --- mutators.cfg | 1 - .../mutators/mutator/nades/nade/napalm.qh | 1 - .../common/mutators/mutator/nades/sv_nades.qc | 36 +++++++++---------- 3 files changed, 18 insertions(+), 20 deletions(-) diff --git a/mutators.cfg b/mutators.cfg index 9b1476868..540c0615b 100644 --- a/mutators.cfg +++ b/mutators.cfg @@ -240,7 +240,6 @@ set g_nades_bonus_score_time_flagcarrier 2 "bonus nade score given per second as // Napalm (2) set g_nades_napalm 0 "Napalm nade: spreads fire balls around the fountain and burns for a while; \"1\" = allow client selection of this nade type" // script-ignore -set g_nades_napalm_blast 1 "whether the napalm grenades also give damage with the usual grenade explosion" set g_nades_napalm_burntime 0.5 "time that the fire from napalm will stick to the player" set g_nades_napalm_selfdamage 1 "whether the player that tossed the nade can be harmed by its fire" // Napalm fireballs diff --git a/qcsrc/common/mutators/mutator/nades/nade/napalm.qh b/qcsrc/common/mutators/mutator/nades/nade/napalm.qh index e8ee871e4..e8092e9b8 100644 --- a/qcsrc/common/mutators/mutator/nades/nade/napalm.qh +++ b/qcsrc/common/mutators/mutator/nades/nade/napalm.qh @@ -10,7 +10,6 @@ float autocvar_g_nades_napalm_ball_damage; float autocvar_g_nades_napalm_ball_damageforcescale; float autocvar_g_nades_napalm_ball_lifetime; float autocvar_g_nades_napalm_ball_radius; -bool autocvar_g_nades_napalm_blast; float autocvar_g_nades_napalm_fountain_lifetime; float autocvar_g_nades_napalm_fountain_delay; float autocvar_g_nades_napalm_fountain_radius; diff --git a/qcsrc/common/mutators/mutator/nades/sv_nades.qc b/qcsrc/common/mutators/mutator/nades/sv_nades.qc index bd5249943..c037315c9 100644 --- a/qcsrc/common/mutators/mutator/nades/sv_nades.qc +++ b/qcsrc/common/mutators/mutator/nades/sv_nades.qc @@ -107,30 +107,30 @@ entity nades_spawn_orb(entity own, entity realown, vector org, float orb_ltime, void nade_boom(entity this) { entity expef = NULL; - bool nade_blast = true; vector expcol_min = '0 0 0', expcol_max = '0 0 0'; -#define SET_NADE_EFFECT(nade_type, blast, exp_effect, exp_color_min, exp_color_max) \ + Nade ntype = REGISTRY_GET(Nades, STAT(NADE_BONUS_TYPE, this)); + +#define SET_NADE_EFFECT(nade_type, exp_effect, exp_color_min, exp_color_max) \ case nade_type: \ - nade_blast = blast; \ expef = exp_effect; \ expcol_min = exp_color_min; \ expcol_max = exp_color_max; \ break - switch ( REGISTRY_GET(Nades, STAT(NADE_BONUS_TYPE, this)) ) - { - SET_NADE_EFFECT(NADE_TYPE_NAPALM, autocvar_g_nades_napalm_blast, EFFECT_EXPLOSION_MEDIUM, '0 0 0', '0 0 0'); - SET_NADE_EFFECT(NADE_TYPE_ICE, false, EFFECT_ELECTRO_COMBO, '0 0 0', '0 0 0'); - SET_NADE_EFFECT(NADE_TYPE_TRANSLOCATE, false, NULL, '0 0 0', '0 0 0'); - SET_NADE_EFFECT(NADE_TYPE_MONSTER, true, NULL, nades_PlayerColor(this.realowner, false), nades_PlayerColor(this.realowner, true)); - SET_NADE_EFFECT(NADE_TYPE_SPAWN, false, EFFECT_SPAWN, nades_PlayerColor(this.realowner, false), nades_PlayerColor(this.realowner, true)); - SET_NADE_EFFECT(NADE_TYPE_HEAL, false, EFFECT_SPAWN, '1 0 0', '1 0 0'); - SET_NADE_EFFECT(NADE_TYPE_ENTRAP, false, EFFECT_SPAWN, '1 1 0', '1 1 0'); - SET_NADE_EFFECT(NADE_TYPE_VEIL, false, EFFECT_SPAWN, '0 0 0', '0 0 0'); - SET_NADE_EFFECT(NADE_TYPE_AMMO, false, EFFECT_SPAWN, '0.66 0.33 0', '0.66 0.33 0'); - SET_NADE_EFFECT(NADE_TYPE_DARKNESS, false, EFFECT_EXPLOSION_MEDIUM, '0 0 0', '0 0 0'); - SET_NADE_EFFECT(NADE_TYPE_NORMAL, true, EFFECT_NADE_EXPLODE, nades_PlayerColor(this.realowner, false), nades_PlayerColor(this.realowner, true)); + switch(ntype) + { + SET_NADE_EFFECT(NADE_TYPE_NAPALM, EFFECT_EXPLOSION_MEDIUM, '0 0 0', '0 0 0'); + SET_NADE_EFFECT(NADE_TYPE_ICE, EFFECT_ELECTRO_COMBO, '0 0 0', '0 0 0'); + SET_NADE_EFFECT(NADE_TYPE_TRANSLOCATE, NULL, '0 0 0', '0 0 0'); + SET_NADE_EFFECT(NADE_TYPE_MONSTER, NULL, nades_PlayerColor(this.realowner, false), nades_PlayerColor(this.realowner, true)); + SET_NADE_EFFECT(NADE_TYPE_SPAWN, EFFECT_SPAWN, nades_PlayerColor(this.realowner, false), nades_PlayerColor(this.realowner, true)); + SET_NADE_EFFECT(NADE_TYPE_HEAL, EFFECT_SPAWN, '1 0 0', '1 0 0'); + SET_NADE_EFFECT(NADE_TYPE_ENTRAP, EFFECT_SPAWN, '1 1 0', '1 1 0'); + SET_NADE_EFFECT(NADE_TYPE_VEIL, EFFECT_SPAWN, '0 0 0', '0 0 0'); + SET_NADE_EFFECT(NADE_TYPE_AMMO, EFFECT_SPAWN, '0.66 0.33 0', '0.66 0.33 0'); + SET_NADE_EFFECT(NADE_TYPE_DARKNESS, EFFECT_EXPLOSION_MEDIUM, '0 0 0', '0 0 0'); + SET_NADE_EFFECT(NADE_TYPE_NORMAL, EFFECT_NADE_EXPLODE, nades_PlayerColor(this.realowner, false), nades_PlayerColor(this.realowner, true)); default: expef = EFFECT_NADE_EXPLODE; expcol_min = nades_PlayerColor(this.realowner, false); expcol_max = nades_PlayerColor(this.realowner, true); break; } #undef SET_NADE_EFFECT @@ -143,11 +143,11 @@ void nade_boom(entity this) this.event_damage = func_null; // prevent somehow calling damage in the next call - if(nade_blast) + if(ntype == NADE_TYPE_NORMAL) normal_nade_boom(this); if(this.takedamage) - switch ( REGISTRY_GET(Nades, STAT(NADE_BONUS_TYPE, this)) ) + switch(ntype) { case NADE_TYPE_NAPALM: nade_napalm_boom(this); break; case NADE_TYPE_ICE: nade_ice_boom(this); break; -- 2.39.5