From: TimePath Date: Tue, 6 Oct 2015 10:50:58 +0000 (+1100) Subject: Nades: rename registry globals X-Git-Tag: xonotic-v0.8.2~1865 X-Git-Url: https://git.rm.cloudns.org/?a=commitdiff_plain;h=b974a7cdcce185eede9dcf22d2c95772cab31401;p=xonotic%2Fxonotic-data.pk3dir.git Nades: rename registry globals --- diff --git a/qcsrc/client/hud.qc b/qcsrc/client/hud.qc index 1636b11e7..eb577f46b 100644 --- a/qcsrc/client/hud.qc +++ b/qcsrc/client/hud.qc @@ -14,7 +14,7 @@ #include "../common/deathtypes.qh" #include "../common/items/all.qc" #include "../common/mapinfo.qh" -#include "../common/nades.qh" +#include "../common/nades/all.qh" #include "../server/mutators/gamemode_ctf.qh" @@ -858,8 +858,8 @@ void DrawAmmoNades(vector myPos, vector mySize, bool draw_expanding, float expan float bonusNades = getstatf(STAT_NADE_BONUS); float bonusProgress = getstatf(STAT_NADE_BONUS_SCORE); float bonusType = getstati(STAT_NADE_BONUS_TYPE); - vector nadeColor = NADES[bonusType].m_color; - string nadeIcon = NADES[bonusType].m_icon; + vector nadeColor = Nades[bonusType].m_color; + string nadeIcon = Nades[bonusType].m_icon; vector iconPos, textPos; diff --git a/qcsrc/client/main.qc b/qcsrc/client/main.qc index 5ed049c60..e3f07b275 100644 --- a/qcsrc/client/main.qc +++ b/qcsrc/client/main.qc @@ -30,7 +30,7 @@ #include "../common/effects/effects.qh" #include "../common/mapinfo.qh" #include "../common/monsters/all.qh" -#include "../common/nades.qh" +#include "../common/nades/all.qh" #include "../common/net_notice.qh" #include "../common/notifications.qh" #include "../common/stats.qh" diff --git a/qcsrc/client/progs.inc b/qcsrc/client/progs.inc index fb5853f07..ec5c31844 100644 --- a/qcsrc/client/progs.inc +++ b/qcsrc/client/progs.inc @@ -40,7 +40,6 @@ #include "../common/effects/effectinfo.qc" #include "../common/mapinfo.qc" #include "../common/movetypes/include.qc" -#include "../common/nades.qc" #include "../common/net_notice.qc" #include "../common/notifications.qc" #include "../common/physics.qc" @@ -56,6 +55,7 @@ #include "../common/items/all.qc" #include "../common/monsters/all.qc" #include "../common/mutators/all.qc" +#include "../common/nades/all.qc" #include "../common/turrets/all.qc" #include "../common/vehicles/all.qc" #include "../common/weapons/all.qc" diff --git a/qcsrc/client/view.qc b/qcsrc/client/view.qc index 60fb4b0c5..9c20747fb 100644 --- a/qcsrc/client/view.qc +++ b/qcsrc/client/view.qc @@ -12,7 +12,7 @@ #include "../common/constants.qh" #include "../common/mapinfo.qh" -#include "../common/nades.qh" +#include "../common/nades/all.qh" #include "../common/stats.qh" #include "../common/triggers/target/music.qh" #include "../common/teams.qh" diff --git a/qcsrc/client/weapons/projectile.qc b/qcsrc/client/weapons/projectile.qc index 051bc4098..fc08f7ffd 100644 --- a/qcsrc/client/weapons/projectile.qc +++ b/qcsrc/client/weapons/projectile.qc @@ -5,7 +5,7 @@ #include "../main.qh" #include "../../common/constants.qh" -#include "../../common/nades.qh" +#include "../../common/nades/all.qh" #include "../../common/movetypes/movetypes.qh" #include "../../common/util.qh" diff --git a/qcsrc/common/nades.qc b/qcsrc/common/nades.qc deleted file mode 100644 index a6b000025..000000000 --- a/qcsrc/common/nades.qc +++ /dev/null @@ -1,91 +0,0 @@ -#if defined(CSQC) - #include "../dpdefs/csprogsdefs.qh" - #include "../client/defs.qh" - #include "nades.qh" - #include "buffs/all.qh" - #include "../common/movetypes/movetypes.qh" - #include "../client/main.qh" - #include "../csqcmodellib/cl_model.qh" -#elif defined(MENUQC) -#elif defined(SVQC) - #include "../dpdefs/progsdefs.qh" - #include "constants.qh" - #include "../server/constants.qh" - #include "../common/turrets/sv_turrets.qh" -#endif - - -#ifdef CSQC -.float ltime; -void healer_draw() -{SELFPARAM(); - float dt = time - self.move_time; - self.move_time = time; - if(dt <= 0) - return; - - self.alpha = (self.ltime - time) / self.healer_lifetime; - self.scale = min((1 - self.alpha)*self.healer_lifetime*4,1)*self.healer_radius; -} - -void healer_setup(entity e) -{ - setmodel(e, MDL_NADE_HEAL); - - setorigin(e, e.origin); - - float model_radius = e.maxs.x; - vector size = '1 1 1' * e.healer_radius / 2; - setsize(e,-size,size); - e.healer_radius = e.healer_radius/model_radius*0.6; - - e.draw = healer_draw; - e.health = 255; - e.movetype = MOVETYPE_NONE; - e.solid = SOLID_NOT; - e.drawmask = MASK_NORMAL; - e.scale = 0.01; - e.avelocity = e.move_avelocity = '7 0 11'; - e.colormod = '1 0 0'; - e.renderflags |= RF_ADDITIVE; -} -#endif // CSQC - -REGISTER_LINKED(Nade_Heal, bool isNew) -#ifdef CSQC -{ - int sf = ReadByte(); - if (sf & 1) { - this.origin_x = ReadCoord(); - this.origin_y = ReadCoord(); - this.origin_z = ReadCoord(); - setorigin(this, this.origin); - this.healer_lifetime = ReadByte(); - this.healer_radius = ReadShort(); - this.ltime = time + ReadByte()/10.0; - // this.ltime = time + this.healer_lifetime; - healer_setup(this); - } -} -#endif - -#ifdef SVQC -float healer_send(entity to, int sf) -{ - SELFPARAM(); - WriteByte(MSG_ENTITY, Linked_Nade_Heal.m_id); - WriteByte(MSG_ENTITY, sf); - if (sf & 1) { - WriteCoord(MSG_ENTITY, this.origin.x); - WriteCoord(MSG_ENTITY, this.origin.y); - WriteCoord(MSG_ENTITY, this.origin.z); - - WriteByte(MSG_ENTITY, this.healer_lifetime); - //WriteByte(MSG_ENTITY, this.ltime - time + 1); - WriteShort(MSG_ENTITY, this.healer_radius); - // round time delta to a 1/10th of a second - WriteByte(MSG_ENTITY, (this.ltime - time)*10.0+0.5); - } - return true; -} -#endif // SVQC diff --git a/qcsrc/common/nades.qh b/qcsrc/common/nades.qh deleted file mode 100644 index be9d353f3..000000000 --- a/qcsrc/common/nades.qh +++ /dev/null @@ -1,142 +0,0 @@ -#ifndef NADES_H -#define NADES_H - -#include "teams.qh" - -.float healer_lifetime; -.float healer_radius; - -// use slots 70-100 -const int PROJECTILE_NADE = 71; -const int PROJECTILE_NADE_BURN = 72; -const int PROJECTILE_NADE_NAPALM = 73; -const int PROJECTILE_NADE_NAPALM_BURN = 74; -const int PROJECTILE_NAPALM_FOUNTAIN = 75; -const int PROJECTILE_NADE_ICE = 76; -const int PROJECTILE_NADE_ICE_BURN = 77; -const int PROJECTILE_NADE_TRANSLOCATE = 78; -const int PROJECTILE_NADE_SPAWN = 79; -const int PROJECTILE_NADE_HEAL = 80; -const int PROJECTILE_NADE_HEAL_BURN = 81; -const int PROJECTILE_NADE_MONSTER = 82; -const int PROJECTILE_NADE_MONSTER_BURN = 83; - -void RegisterNades(); -const int NADES_MAX = 8; -entity NADES[NADES_MAX], NADES_first, NADES_last; -int NADES_COUNT; -#define REGISTER_NADE(id) REGISTER(RegisterNades, NADE_TYPE, NADES, NADES_COUNT, id, m_id, NEW(Nade)) -REGISTER_REGISTRY(RegisterNades) - -CLASS(Nade, Object) - ATTRIB(Nade, m_id, int, 0) - ATTRIB(Nade, m_color, vector, '0 0 0') - ATTRIB(Nade, m_name, string, _("Grenade")) - ATTRIB(Nade, m_icon, string, "nade_normal") - ATTRIBARRAY(Nade, m_projectile, int, 2) - ATTRIBARRAY(Nade, m_trail, entity, 2) - METHOD(Nade, display, void(entity this, void(string name, string icon) returns)) { - returns(this.m_name, sprintf("/gfx/hud/%s/%s", cvar_string("menu_skin"), this.m_icon)); - } -ENDCLASS(Nade) - -REGISTER_NADE(Null); - -#define NADE_PROJECTILE(i, projectile, trail) do { \ - this.m_projectile[i] = projectile; \ - this.m_trail[i] = trail; \ -} while (0) - -REGISTER_NADE(NORMAL) { - this.m_color = '1 1 1'; - NADE_PROJECTILE(0, PROJECTILE_NADE, EFFECT_Null); - NADE_PROJECTILE(1, PROJECTILE_NADE_BURN, EFFECT_Null); -} - -REGISTER_NADE(NAPALM) { - this.m_color = '2 0.5 0'; - this.m_name = _("Napalm grenade"); - this.m_icon = "nade_napalm"; - NADE_PROJECTILE(0, PROJECTILE_NADE_NAPALM, EFFECT_TR_ROCKET); - NADE_PROJECTILE(1, PROJECTILE_NADE_NAPALM_BURN, EFFECT_SPIDERBOT_ROCKET_TRAIL); -} - -REGISTER_NADE(ICE) { - this.m_color = '0 0.5 2'; - this.m_name = _("Ice grenade"); - this.m_icon = "nade_ice"; - NADE_PROJECTILE(0, PROJECTILE_NADE_ICE, EFFECT_TR_NEXUIZPLASMA); - NADE_PROJECTILE(1, PROJECTILE_NADE_ICE_BURN, EFFECT_RACER_ROCKET_TRAIL); -} - -REGISTER_NADE(TRANSLOCATE) { - this.m_color = '1 0 1'; - this.m_name = _("Translocate grenade"); - this.m_icon = "nade_translocate"; - NADE_PROJECTILE(0, PROJECTILE_NADE_TRANSLOCATE, EFFECT_TR_CRYLINKPLASMA); - NADE_PROJECTILE(1, PROJECTILE_NADE_TRANSLOCATE, EFFECT_TR_CRYLINKPLASMA); -} - -REGISTER_NADE(SPAWN) { - this.m_color = '1 0.9 0'; - this.m_name = _("Spawn grenade"); - this.m_icon = "nade_spawn"; - NADE_PROJECTILE(0, PROJECTILE_NADE_SPAWN, EFFECT_NADE_TRAIL_YELLOW); - NADE_PROJECTILE(1, PROJECTILE_NADE_SPAWN, EFFECT_NADE_TRAIL_YELLOW); -} - -REGISTER_NADE(HEAL) { - this.m_color = '1 0 0'; - this.m_name = _("Heal grenade"); - this.m_icon = "nade_heal"; - NADE_PROJECTILE(0, PROJECTILE_NADE_HEAL, EFFECT_NADE_TRAIL_RED); - NADE_PROJECTILE(1, PROJECTILE_NADE_HEAL_BURN, EFFECT_NADE_TRAIL_BURN_RED); -} - -REGISTER_NADE(MONSTER) { - this.m_color = '0.25 0.75 0'; - this.m_name = _("Monster grenade"); - this.m_icon = "nade_monster"; - NADE_PROJECTILE(0, PROJECTILE_NADE_MONSTER, EFFECT_NADE_TRAIL_RED); - NADE_PROJECTILE(1, PROJECTILE_NADE_MONSTER_BURN, EFFECT_NADE_TRAIL_BURN_RED); -} - -entity Nade_FromProjectile(float proj) -{ - FOREACH(NADES, true, LAMBDA( - for (int j = 0; j < 2; j++) - { - if (it.m_projectile[j] == proj) return it; - } - )); - return NADE_TYPE_Null; -} - -entity Nade_TrailEffect(int proj, int nade_team) -{ - switch (proj) - { - case PROJECTILE_NADE: return EFFECT_NADE_TRAIL(nade_team); - case PROJECTILE_NADE_BURN: return EFFECT_NADE_TRAIL_BURN(nade_team); - } - - FOREACH(NADES, true, LAMBDA( - for (int j = 0; j < 2; j++) - { - if (it.m_projectile[j] == proj) - { - string trail = it.m_trail[j].eent_eff_name; - if (trail) return it.m_trail[j]; - break; - } - } - )); - - return EFFECT_Null; -} - -#ifdef SVQC -float healer_send(entity to, int sf); -#endif - -#endif diff --git a/qcsrc/common/nades/all.inc b/qcsrc/common/nades/all.inc new file mode 100644 index 000000000..90326ede1 --- /dev/null +++ b/qcsrc/common/nades/all.inc @@ -0,0 +1,58 @@ +#define NADE_PROJECTILE(i, projectile, trail) do { \ + this.m_projectile[i] = projectile; \ + this.m_trail[i] = trail; \ +} while (0) + +REGISTER_NADE(NORMAL) { + this.m_color = '1 1 1'; + NADE_PROJECTILE(0, PROJECTILE_NADE, EFFECT_Null); + NADE_PROJECTILE(1, PROJECTILE_NADE_BURN, EFFECT_Null); +} + +REGISTER_NADE(NAPALM) { + this.m_color = '2 0.5 0'; + this.m_name = _("Napalm grenade"); + this.m_icon = "nade_napalm"; + NADE_PROJECTILE(0, PROJECTILE_NADE_NAPALM, EFFECT_TR_ROCKET); + NADE_PROJECTILE(1, PROJECTILE_NADE_NAPALM_BURN, EFFECT_SPIDERBOT_ROCKET_TRAIL); +} + +REGISTER_NADE(ICE) { + this.m_color = '0 0.5 2'; + this.m_name = _("Ice grenade"); + this.m_icon = "nade_ice"; + NADE_PROJECTILE(0, PROJECTILE_NADE_ICE, EFFECT_TR_NEXUIZPLASMA); + NADE_PROJECTILE(1, PROJECTILE_NADE_ICE_BURN, EFFECT_RACER_ROCKET_TRAIL); +} + +REGISTER_NADE(TRANSLOCATE) { + this.m_color = '1 0 1'; + this.m_name = _("Translocate grenade"); + this.m_icon = "nade_translocate"; + NADE_PROJECTILE(0, PROJECTILE_NADE_TRANSLOCATE, EFFECT_TR_CRYLINKPLASMA); + NADE_PROJECTILE(1, PROJECTILE_NADE_TRANSLOCATE, EFFECT_TR_CRYLINKPLASMA); +} + +REGISTER_NADE(SPAWN) { + this.m_color = '1 0.9 0'; + this.m_name = _("Spawn grenade"); + this.m_icon = "nade_spawn"; + NADE_PROJECTILE(0, PROJECTILE_NADE_SPAWN, EFFECT_NADE_TRAIL_YELLOW); + NADE_PROJECTILE(1, PROJECTILE_NADE_SPAWN, EFFECT_NADE_TRAIL_YELLOW); +} + +REGISTER_NADE(HEAL) { + this.m_color = '1 0 0'; + this.m_name = _("Heal grenade"); + this.m_icon = "nade_heal"; + NADE_PROJECTILE(0, PROJECTILE_NADE_HEAL, EFFECT_NADE_TRAIL_RED); + NADE_PROJECTILE(1, PROJECTILE_NADE_HEAL_BURN, EFFECT_NADE_TRAIL_BURN_RED); +} + +REGISTER_NADE(MONSTER) { + this.m_color = '0.25 0.75 0'; + this.m_name = _("Monster grenade"); + this.m_icon = "nade_monster"; + NADE_PROJECTILE(0, PROJECTILE_NADE_MONSTER, EFFECT_NADE_TRAIL_RED); + NADE_PROJECTILE(1, PROJECTILE_NADE_MONSTER_BURN, EFFECT_NADE_TRAIL_BURN_RED); +} diff --git a/qcsrc/common/nades/all.qc b/qcsrc/common/nades/all.qc new file mode 100644 index 000000000..86e6d278b --- /dev/null +++ b/qcsrc/common/nades/all.qc @@ -0,0 +1,91 @@ +#if defined(CSQC) + #include "../../dpdefs/csprogsdefs.qh" + #include "../../client/defs.qh" + #include "all.qh" + #include "../buffs/all.qh" + #include "../movetypes/movetypes.qh" + #include "../../client/main.qh" + #include "../../csqcmodellib/cl_model.qh" +#elif defined(MENUQC) +#elif defined(SVQC) + #include "../../dpdefs/progsdefs.qh" + #include "../constants.qh" + #include "../../server/constants.qh" + #include "../turrets/sv_turrets.qh" +#endif + + +#ifdef CSQC +.float ltime; +void healer_draw() +{SELFPARAM(); + float dt = time - self.move_time; + self.move_time = time; + if(dt <= 0) + return; + + self.alpha = (self.ltime - time) / self.healer_lifetime; + self.scale = min((1 - self.alpha)*self.healer_lifetime*4,1)*self.healer_radius; +} + +void healer_setup(entity e) +{ + setmodel(e, MDL_NADE_HEAL); + + setorigin(e, e.origin); + + float model_radius = e.maxs.x; + vector size = '1 1 1' * e.healer_radius / 2; + setsize(e,-size,size); + e.healer_radius = e.healer_radius/model_radius*0.6; + + e.draw = healer_draw; + e.health = 255; + e.movetype = MOVETYPE_NONE; + e.solid = SOLID_NOT; + e.drawmask = MASK_NORMAL; + e.scale = 0.01; + e.avelocity = e.move_avelocity = '7 0 11'; + e.colormod = '1 0 0'; + e.renderflags |= RF_ADDITIVE; +} +#endif // CSQC + +REGISTER_LINKED(Nade_Heal, bool isNew) +#ifdef CSQC +{ + int sf = ReadByte(); + if (sf & 1) { + this.origin_x = ReadCoord(); + this.origin_y = ReadCoord(); + this.origin_z = ReadCoord(); + setorigin(this, this.origin); + this.healer_lifetime = ReadByte(); + this.healer_radius = ReadShort(); + this.ltime = time + ReadByte()/10.0; + // this.ltime = time + this.healer_lifetime; + healer_setup(this); + } +} +#endif + +#ifdef SVQC +float healer_send(entity to, int sf) +{ + SELFPARAM(); + WriteByte(MSG_ENTITY, Linked_Nade_Heal.m_id); + WriteByte(MSG_ENTITY, sf); + if (sf & 1) { + WriteCoord(MSG_ENTITY, this.origin.x); + WriteCoord(MSG_ENTITY, this.origin.y); + WriteCoord(MSG_ENTITY, this.origin.z); + + WriteByte(MSG_ENTITY, this.healer_lifetime); + //WriteByte(MSG_ENTITY, this.ltime - time + 1); + WriteShort(MSG_ENTITY, this.healer_radius); + // round time delta to a 1/10th of a second + WriteByte(MSG_ENTITY, (this.ltime - time)*10.0+0.5); + } + return true; +} +#endif // SVQC diff --git a/qcsrc/common/nades/all.qh b/qcsrc/common/nades/all.qh new file mode 100644 index 000000000..f5a274d98 --- /dev/null +++ b/qcsrc/common/nades/all.qh @@ -0,0 +1,82 @@ +#ifndef NADES_ALL_H +#define NADES_ALL_H + +#include "../teams.qh" + +.float healer_lifetime; +.float healer_radius; + +// use slots 70-100 +const int PROJECTILE_NADE = 71; +const int PROJECTILE_NADE_BURN = 72; +const int PROJECTILE_NADE_NAPALM = 73; +const int PROJECTILE_NADE_NAPALM_BURN = 74; +const int PROJECTILE_NAPALM_FOUNTAIN = 75; +const int PROJECTILE_NADE_ICE = 76; +const int PROJECTILE_NADE_ICE_BURN = 77; +const int PROJECTILE_NADE_TRANSLOCATE = 78; +const int PROJECTILE_NADE_SPAWN = 79; +const int PROJECTILE_NADE_HEAL = 80; +const int PROJECTILE_NADE_HEAL_BURN = 81; +const int PROJECTILE_NADE_MONSTER = 82; +const int PROJECTILE_NADE_MONSTER_BURN = 83; + +REGISTRY(Nades, 8) +REGISTER_REGISTRY(RegisterNades) +#define REGISTER_NADE(id) REGISTER(RegisterNades, NADE_TYPE, Nades, Nades_COUNT, id, m_id, NEW(Nade)) + +CLASS(Nade, Object) + ATTRIB(Nade, m_id, int, 0) + ATTRIB(Nade, m_color, vector, '0 0 0') + ATTRIB(Nade, m_name, string, _("Grenade")) + ATTRIB(Nade, m_icon, string, "nade_normal") + ATTRIBARRAY(Nade, m_projectile, int, 2) + ATTRIBARRAY(Nade, m_trail, entity, 2) + METHOD(Nade, display, void(entity this, void(string name, string icon) returns)) { + returns(this.m_name, sprintf("/gfx/hud/%s/%s", cvar_string("menu_skin"), this.m_icon)); + } +ENDCLASS(Nade) + +REGISTER_NADE(Null); + +#ifdef SVQC +float healer_send(entity to, int sf); +#endif + +entity Nade_FromProjectile(float proj) +{ + FOREACH(Nades, true, LAMBDA( + for (int j = 0; j < 2; j++) + { + if (it.m_projectile[j] == proj) return it; + } + )); + return NADE_TYPE_Null; +} + +entity Nade_TrailEffect(int proj, int nade_team) +{ + switch (proj) + { + case PROJECTILE_NADE: return EFFECT_NADE_TRAIL(nade_team); + case PROJECTILE_NADE_BURN: return EFFECT_NADE_TRAIL_BURN(nade_team); + } + + FOREACH(Nades, true, LAMBDA( + for (int j = 0; j < 2; j++) + { + if (it.m_projectile[j] == proj) + { + string trail = it.m_trail[j].eent_eff_name; + if (trail) return it.m_trail[j]; + break; + } + } + )); + + return EFFECT_Null; +} + +#include "all.inc" + +#endif diff --git a/qcsrc/server/mutators/mutator_nades.qc b/qcsrc/server/mutators/mutator_nades.qc index f31bff4dc..d4cebf9d7 100644 --- a/qcsrc/server/mutators/mutator_nades.qc +++ b/qcsrc/server/mutators/mutator_nades.qc @@ -5,7 +5,7 @@ #include "gamemode_keyhunt.qh" #include "gamemode_freezetag.qh" -#include "../../common/nades.qh" +#include "../../common/nades/all.qh" #include "../../common/monsters/spawn.qh" #include "../../common/monsters/sv_monsters.qh" @@ -23,7 +23,7 @@ void nade_timer_think() void nade_burn_spawn(entity _nade) { - CSQCProjectile(_nade, true, NADES[_nade.nade_type].m_projectile[true], true); + CSQCProjectile(_nade, true, Nades[_nade.nade_type].m_projectile[true], true); } void nade_spawn(entity _nade) @@ -42,7 +42,7 @@ void nade_spawn(entity _nade) _nade.effects |= EF_LOWPRECISION; - CSQCProjectile(_nade, true, NADES[_nade.nade_type].m_projectile[false], true); + CSQCProjectile(_nade, true, Nades[_nade.nade_type].m_projectile[false], true); } void napalm_damage(float dist, float damage, float edgedamage, float burntime) @@ -477,7 +477,7 @@ void nade_boom() entity expef = NULL; bool nade_blast = true; - switch ( NADES[self.nade_type] ) + switch ( Nades[self.nade_type] ) { case NADE_TYPE_NAPALM: nade_blast = autocvar_g_nades_napalm_blast; @@ -529,7 +529,7 @@ void nade_boom() } if(self.takedamage) - switch ( NADES[self.nade_type] ) + switch ( Nades[self.nade_type] ) { case NADE_TYPE_NAPALM: nade_napalm_boom(); break; case NADE_TYPE_ICE: nade_ice_boom(); break; @@ -772,7 +772,7 @@ float nade_customize() { //self.effects = EF_ADDITIVE | EF_FULLBRIGHT | EF_LOWPRECISION; if(!self.traileffectnum) - self.traileffectnum = _particleeffectnum(Nade_TrailEffect(NADES[self.nade_type].m_projectile[false], self.team).eent_eff_name); + self.traileffectnum = _particleeffectnum(Nade_TrailEffect(Nades[self.nade_type].m_projectile[false], self.team).eent_eff_name); self.alpha = 1; } @@ -810,14 +810,14 @@ void nade_prime() n.pokenade_type = ((autocvar_g_nades_client_select) ? self.cvar_cl_pokenade_type : autocvar_g_nades_pokenade_monster_type); } - n.nade_type = bound(1, n.nade_type, NADES_COUNT); + n.nade_type = bound(1, n.nade_type, Nades_COUNT); setmodel(n, MDL_PROJECTILE_NADE); //setattachment(n, self, "bip01 l hand"); n.exteriormodeltoclient = self; n.customizeentityforclient = nade_customize; - n.traileffectnum = _particleeffectnum(Nade_TrailEffect(NADES[n.nade_type].m_projectile[false], self.team).eent_eff_name); - n.colormod = NADES[n.nade_type].m_color; + n.traileffectnum = _particleeffectnum(Nade_TrailEffect(Nades[n.nade_type].m_projectile[false], self.team).eent_eff_name); + n.colormod = Nades[n.nade_type].m_color; n.realowner = self; n.colormap = self.colormap; n.glowmod = self.glowmod; @@ -830,7 +830,7 @@ void nade_prime() setmodel(fn, MDL_NADE_VIEW); setattachment(fn, self.weaponentity, ""); fn.realowner = fn.owner = self; - fn.colormod = NADES[n.nade_type].m_color; + fn.colormod = Nades[n.nade_type].m_color; fn.colormap = self.colormap; fn.glowmod = self.glowmod; fn.think = SUB_Remove; @@ -993,7 +993,7 @@ MUTATOR_HOOKFUNCTION(nades_PlayerPreThink) self.pokenade_type = autocvar_g_nades_pokenade_monster_type; } - self.nade_type = bound(1, self.nade_type, NADES_COUNT); + self.nade_type = bound(1, self.nade_type, Nades_COUNT); if(self.bonus_nade_score >= 0 && autocvar_g_nades_bonus_score_max) nades_GiveBonus(self, time_score / autocvar_g_nades_bonus_score_max); diff --git a/qcsrc/server/mutators/mutators_include.qc b/qcsrc/server/mutators/mutators_include.qc index 8b432d3bf..8564d34c5 100644 --- a/qcsrc/server/mutators/mutators_include.qc +++ b/qcsrc/server/mutators/mutators_include.qc @@ -11,7 +11,7 @@ #include "../../common/stats.qh" #include "../../common/teams.qh" #include "../../common/util.qh" - #include "../../common/nades.qh" + #include "../../common/nades/all.qh" #include "../../common/buffs/all.qh" #include "../../common/command/markup.qh" #include "../../common/command/rpn.qh" diff --git a/qcsrc/server/progs.inc b/qcsrc/server/progs.inc index d9dec8f6f..adb8cf632 100644 --- a/qcsrc/server/progs.inc +++ b/qcsrc/server/progs.inc @@ -89,7 +89,6 @@ #include "../common/minigames/minigames.qc" #include "../common/minigames/sv_minigames.qc" #include "../common/movetypes/include.qc" -#include "../common/nades.qc" #include "../common/net_notice.qc" #include "../common/notifications.qc" #include "../common/physics.qc" @@ -102,6 +101,7 @@ #include "../common/items/all.qc" #include "../common/monsters/all.qc" #include "../common/mutators/all.qc" +#include "../common/nades/all.qc" #include "../common/turrets/all.qc" #include "../common/vehicles/all.qc" #include "../common/weapons/all.qc"