From: TimePath Date: Tue, 6 Oct 2015 10:37:02 +0000 (+1100) Subject: Buffs: rename registry globals X-Git-Tag: xonotic-v0.8.2~1866 X-Git-Url: https://git.rm.cloudns.org/?a=commitdiff_plain;h=6b8490ff79ca48220bd0023b5da4019d1bfdcd7d;p=xonotic%2Fxonotic-data.pk3dir.git Buffs: rename registry globals --- diff --git a/qcsrc/client/hud.qc b/qcsrc/client/hud.qc index cd1c6efee..1636b11e7 100644 --- a/qcsrc/client/hud.qc +++ b/qcsrc/client/hud.qc @@ -9,7 +9,7 @@ #include "../dpdefs/keycodes.qh" -#include "../common/buffs.qh" +#include "../common/buffs/all.qh" #include "../common/constants.qh" #include "../common/deathtypes.qh" #include "../common/items/all.qc" @@ -1283,7 +1283,7 @@ void HUD_Powerups() if(superTime) addPowerupItem("Superweapons", "superweapons", autocvar_hud_progressbar_superweapons_color, superTime, 30); - FOREACH(BUFFS, it.m_itemid & allBuffs, LAMBDA( + FOREACH(Buffs, it.m_itemid & allBuffs, LAMBDA( addPowerupItem(it.m_prettyName, strcat("buff_", it.m_name), it.m_color, bound(0, getstatf(STAT_BUFF_TIME) - time, 99), 60); )); diff --git a/qcsrc/client/laser.qc b/qcsrc/client/laser.qc index f5b6d54a9..d023ea9b5 100644 --- a/qcsrc/client/laser.qc +++ b/qcsrc/client/laser.qc @@ -3,7 +3,7 @@ #include "hook.qh" -#include "../common/buffs.qh" +#include "../common/buffs/all.qh" #include "../csqcmodellib/cl_model.qh" #include "../csqcmodellib/interpolate.qh" diff --git a/qcsrc/client/main.qc b/qcsrc/client/main.qc index 8ba551d9c..5ed049c60 100644 --- a/qcsrc/client/main.qc +++ b/qcsrc/client/main.qc @@ -25,7 +25,7 @@ #include "weapons/projectile.qh" -#include "../common/buffs.qh" +#include "../common/buffs/all.qh" #include "../common/deathtypes.qh" #include "../common/effects/effects.qh" #include "../common/mapinfo.qh" diff --git a/qcsrc/client/progs.inc b/qcsrc/client/progs.inc index 39faa989e..fb5853f07 100644 --- a/qcsrc/client/progs.inc +++ b/qcsrc/client/progs.inc @@ -36,7 +36,6 @@ #include "weapons/projectile.qc" // TODO #include "../common/animdecide.qc" -#include "../common/buffs.qc" #include "../common/effects/effects.qc" #include "../common/effects/effectinfo.qc" #include "../common/mapinfo.qc" @@ -53,6 +52,7 @@ #include "../common/minigames/minigames.qc" #include "../common/minigames/cl_minigames.qc" +#include "../common/buffs/all.qc" #include "../common/items/all.qc" #include "../common/monsters/all.qc" #include "../common/mutators/all.qc" diff --git a/qcsrc/client/t_items.qc b/qcsrc/client/t_items.qc index 3981b29eb..4e43a9662 100644 --- a/qcsrc/client/t_items.qc +++ b/qcsrc/client/t_items.qc @@ -1,6 +1,6 @@ #include "_all.qh" -#include "../common/buffs.qh" +#include "../common/buffs/all.qh" #include "../common/movetypes/movetypes.qh" #include "../common/util.qh" #include "../common/weapons/all.qh" diff --git a/qcsrc/common/buffs.qc b/qcsrc/common/buffs.qc deleted file mode 100644 index 612255dbb..000000000 --- a/qcsrc/common/buffs.qc +++ /dev/null @@ -1,10 +0,0 @@ -#if defined(CSQC) - #include "../dpdefs/csprogsdefs.qh" - #include "../client/defs.qh" -#elif defined(MENUQC) -#elif defined(SVQC) - #include "../dpdefs/progsdefs.qh" - #include "../dpdefs/dpextensions.qh" -#endif -#include "buffs.qh" - diff --git a/qcsrc/common/buffs.qh b/qcsrc/common/buffs.qh deleted file mode 100644 index 31654ebf8..000000000 --- a/qcsrc/common/buffs.qh +++ /dev/null @@ -1,192 +0,0 @@ -#ifndef BUFFS_H -#define BUFFS_H -// Welcome to the stuff behind the scenes -// Below, you will find the list of buffs -// Add new buffs here! -// Note: Buffs also need spawnfuncs, which are set below - -#include "teams.qh" -#include "util.qh" - -void RegisterBuffs(); -const int BUFFS_MAX = 16; -entity BUFFS[BUFFS_MAX], BUFFS_first, BUFFS_last; -int BUFFS_COUNT; -#define REGISTER_BUFF(id) \ - REGISTER(RegisterBuffs, BUFF, BUFFS, BUFFS_COUNT, id, m_id, NEW(Buff)); \ - REGISTER_INIT_POST(BUFF, id) { \ - this.netname = this.m_name; \ - this.m_itemid = BIT(this.m_id - 1); \ - this.m_sprite = strzone(strcat("buff-", this.m_name)); \ - } \ - REGISTER_INIT(BUFF, id) -REGISTER_REGISTRY(RegisterBuffs) - -#include "items/item/pickup.qh" -CLASS(Buff, Pickup) - /** bit index */ - ATTRIB(Buff, m_itemid, int, 0) - ATTRIB(Buff, m_name, string, "buff") - ATTRIB(Buff, m_color, vector, '1 1 1') - ATTRIB(Buff, m_prettyName, string, "Buff") - ATTRIB(Buff, m_skin, int, 0) - ATTRIB(Buff, m_sprite, string, "") - METHOD(Buff, display, void(entity this, void(string name, string icon) returns)) { - returns(this.m_prettyName, sprintf("/gfx/hud/%s/buff_%s", cvar_string("menu_skin"), this.m_name)); - } -#ifdef SVQC - METHOD(Buff, m_time, float(entity)); - float Buff_m_time(entity this) { return cvar(strcat("g_buffs_", this.netname, "_time")); } -#endif -ENDCLASS(Buff) - -REGISTER_BUFF(Null); - -REGISTER_BUFF(AMMO) { - this.m_prettyName = _("Ammo"); - this.m_name = "ammo"; - this.m_skin = 3; - this.m_color = '0.76 1 0.1'; -} - -REGISTER_BUFF(RESISTANCE) { - this.m_prettyName = _("Resistance"); - this.m_name = "resistance"; - this.m_skin = 0; - this.m_color = '0.36 1 0.07'; -} - -REGISTER_BUFF(SPEED) { - this.m_prettyName = _("Speed"); - this.m_name = "speed"; - this.m_skin = 9; - this.m_color = '0.1 1 0.84'; -} - -REGISTER_BUFF(MEDIC) { - this.m_prettyName = _("Medic"); - this.m_name = "medic"; - this.m_skin = 1; - this.m_color = '1 0.12 0'; -} - -REGISTER_BUFF(BASH) { - this.m_prettyName = _("Bash"); - this.m_name = "bash"; - this.m_skin = 5; - this.m_color = '1 0.39 0'; -} - -REGISTER_BUFF(VAMPIRE) { - this.m_prettyName = _("Vampire"); - this.m_name = "vampire"; - this.m_skin = 2; - this.m_color = '1 0 0.24'; -} - -REGISTER_BUFF(DISABILITY) { - this.m_prettyName = _("Disability"); - this.m_name = "disability"; - this.m_skin = 7; - this.m_color = '0.94 0.3 1'; -} - -REGISTER_BUFF(VENGEANCE) { - this.m_prettyName = _("Vengeance"); - this.m_name = "vengeance"; - this.m_skin = 15; - this.m_color = '1 0.23 0.61'; -} - -REGISTER_BUFF(JUMP) { - this.m_prettyName = _("Jump"); - this.m_name = "jump"; - this.m_skin = 10; - this.m_color = '0.24 0.78 1'; -} - -REGISTER_BUFF(FLIGHT) { - this.m_prettyName = _("Flight"); - this.m_name = "flight"; - this.m_skin = 11; - this.m_color = '0.33 0.56 1'; -} - -REGISTER_BUFF(INVISIBLE) { - this.m_prettyName = _("Invisible"); - this.m_name = "invisible"; - this.m_skin = 12; - this.m_color = '0.5 0.5 1'; -} - -REGISTER_BUFF(INFERNO) { - this.m_prettyName = _("Inferno"); - this.m_name = "inferno"; - this.m_skin = 16; - this.m_color = '1 0.62 0'; -} - -REGISTER_BUFF(SWAPPER) { - this.m_prettyName = _("Swapper"); - this.m_name = "swapper"; - this.m_skin = 17; - this.m_color = '0.63 0.36 1'; -} - -REGISTER_BUFF(MAGNET) { - this.m_prettyName = _("Magnet"); - this.m_name = "magnet"; - this.m_skin = 18; - this.m_color = '1 0.95 0.18'; -} - -#ifdef SVQC -.int buffs; -void buff_Init(entity ent); -void buff_Init_Compat(entity ent, entity replacement); - -#define BUFF_SPAWNFUNC(e, b, t) spawnfunc(item_buff_##e) { \ - self.buffs = b.m_itemid; \ - self.team = t; \ - buff_Init(self); \ -} -#define BUFF_SPAWNFUNCS(e, b) \ - BUFF_SPAWNFUNC(e, b, 0) \ - BUFF_SPAWNFUNC(e##_team1, b, NUM_TEAM_1) \ - BUFF_SPAWNFUNC(e##_team2, b, NUM_TEAM_2) \ - BUFF_SPAWNFUNC(e##_team3, b, NUM_TEAM_3) \ - BUFF_SPAWNFUNC(e##_team4, b, NUM_TEAM_4) -#define BUFF_SPAWNFUNC_Q3TA_COMPAT(o, r) spawnfunc(item_##o) { buff_Init_Compat(self, r); } - -BUFF_SPAWNFUNCS(resistance, BUFF_RESISTANCE) -BUFF_SPAWNFUNCS(ammo, BUFF_AMMO) -BUFF_SPAWNFUNCS(speed, BUFF_SPEED) -BUFF_SPAWNFUNCS(medic, BUFF_MEDIC) -BUFF_SPAWNFUNCS(bash, BUFF_BASH) -BUFF_SPAWNFUNCS(vampire, BUFF_VAMPIRE) -BUFF_SPAWNFUNCS(disability, BUFF_DISABILITY) -BUFF_SPAWNFUNCS(vengeance, BUFF_VENGEANCE) -BUFF_SPAWNFUNCS(jump, BUFF_JUMP) -BUFF_SPAWNFUNCS(flight, BUFF_FLIGHT) -BUFF_SPAWNFUNCS(invisible, BUFF_INVISIBLE) -BUFF_SPAWNFUNCS(inferno, BUFF_INFERNO) -BUFF_SPAWNFUNCS(swapper, BUFF_SWAPPER) -BUFF_SPAWNFUNCS(magnet, BUFF_MAGNET) -BUFF_SPAWNFUNCS(random, BUFF_Null) - -BUFF_SPAWNFUNC_Q3TA_COMPAT(doubler, BUFF_MEDIC) -BUFF_SPAWNFUNC_Q3TA_COMPAT(resistance, BUFF_RESISTANCE) -BUFF_SPAWNFUNC_Q3TA_COMPAT(scout, BUFF_SPEED) -BUFF_SPAWNFUNC_Q3TA_COMPAT(ammoregen, BUFF_AMMO) - -// actually Q3 -BUFF_SPAWNFUNC_Q3TA_COMPAT(haste, BUFF_SPEED) -BUFF_SPAWNFUNC_Q3TA_COMPAT(invis, BUFF_INVISIBLE) -BUFF_SPAWNFUNC_Q3TA_COMPAT(medic, BUFF_MEDIC) - -#undef BUFF_SPAWNFUNC -#undef BUFF_SPAWNFUNC_Q3TA_COMPAT -#undef BUFF_SPAWNFUNCS -#endif - -#endif diff --git a/qcsrc/common/buffs/all.inc b/qcsrc/common/buffs/all.inc new file mode 100644 index 000000000..25fa72236 --- /dev/null +++ b/qcsrc/common/buffs/all.inc @@ -0,0 +1,118 @@ +REGISTER_BUFF(AMMO) { + this.m_prettyName = _("Ammo"); + this.m_name = "ammo"; + this.m_skin = 3; + this.m_color = '0.76 1 0.1'; +} +BUFF_SPAWNFUNCS(ammo, BUFF_AMMO) +BUFF_SPAWNFUNC_Q3TA_COMPAT(ammoregen, BUFF_AMMO) + +REGISTER_BUFF(RESISTANCE) { + this.m_prettyName = _("Resistance"); + this.m_name = "resistance"; + this.m_skin = 0; + this.m_color = '0.36 1 0.07'; +} +BUFF_SPAWNFUNCS(resistance, BUFF_RESISTANCE) +BUFF_SPAWNFUNC_Q3TA_COMPAT(resistance, BUFF_RESISTANCE) + +REGISTER_BUFF(SPEED) { + this.m_prettyName = _("Speed"); + this.m_name = "speed"; + this.m_skin = 9; + this.m_color = '0.1 1 0.84'; +} +BUFF_SPAWNFUNCS(speed, BUFF_SPEED) +BUFF_SPAWNFUNC_Q3TA_COMPAT(haste, BUFF_SPEED) +BUFF_SPAWNFUNC_Q3TA_COMPAT(scout, BUFF_SPEED) + +REGISTER_BUFF(MEDIC) { + this.m_prettyName = _("Medic"); + this.m_name = "medic"; + this.m_skin = 1; + this.m_color = '1 0.12 0'; +} +BUFF_SPAWNFUNCS(medic, BUFF_MEDIC) +BUFF_SPAWNFUNC_Q3TA_COMPAT(doubler, BUFF_MEDIC) +BUFF_SPAWNFUNC_Q3TA_COMPAT(medic, BUFF_MEDIC) + +REGISTER_BUFF(BASH) { + this.m_prettyName = _("Bash"); + this.m_name = "bash"; + this.m_skin = 5; + this.m_color = '1 0.39 0'; +} +BUFF_SPAWNFUNCS(bash, BUFF_BASH) + +REGISTER_BUFF(VAMPIRE) { + this.m_prettyName = _("Vampire"); + this.m_name = "vampire"; + this.m_skin = 2; + this.m_color = '1 0 0.24'; +} +BUFF_SPAWNFUNCS(vampire, BUFF_VAMPIRE) + +REGISTER_BUFF(DISABILITY) { + this.m_prettyName = _("Disability"); + this.m_name = "disability"; + this.m_skin = 7; + this.m_color = '0.94 0.3 1'; +} +BUFF_SPAWNFUNCS(disability, BUFF_DISABILITY) + +REGISTER_BUFF(VENGEANCE) { + this.m_prettyName = _("Vengeance"); + this.m_name = "vengeance"; + this.m_skin = 15; + this.m_color = '1 0.23 0.61'; +} +BUFF_SPAWNFUNCS(vengeance, BUFF_VENGEANCE) + +REGISTER_BUFF(JUMP) { + this.m_prettyName = _("Jump"); + this.m_name = "jump"; + this.m_skin = 10; + this.m_color = '0.24 0.78 1'; +} +BUFF_SPAWNFUNCS(jump, BUFF_JUMP) + +REGISTER_BUFF(FLIGHT) { + this.m_prettyName = _("Flight"); + this.m_name = "flight"; + this.m_skin = 11; + this.m_color = '0.33 0.56 1'; +} +BUFF_SPAWNFUNCS(flight, BUFF_FLIGHT) + +REGISTER_BUFF(INVISIBLE) { + this.m_prettyName = _("Invisible"); + this.m_name = "invisible"; + this.m_skin = 12; + this.m_color = '0.5 0.5 1'; +} +BUFF_SPAWNFUNCS(invisible, BUFF_INVISIBLE) +BUFF_SPAWNFUNC_Q3TA_COMPAT(invis, BUFF_INVISIBLE) + +REGISTER_BUFF(INFERNO) { + this.m_prettyName = _("Inferno"); + this.m_name = "inferno"; + this.m_skin = 16; + this.m_color = '1 0.62 0'; +} +BUFF_SPAWNFUNCS(inferno, BUFF_INFERNO) + +REGISTER_BUFF(SWAPPER) { + this.m_prettyName = _("Swapper"); + this.m_name = "swapper"; + this.m_skin = 17; + this.m_color = '0.63 0.36 1'; +} +BUFF_SPAWNFUNCS(swapper, BUFF_SWAPPER) + +REGISTER_BUFF(MAGNET) { + this.m_prettyName = _("Magnet"); + this.m_name = "magnet"; + this.m_skin = 18; + this.m_color = '1 0.95 0.18'; +} +BUFF_SPAWNFUNCS(magnet, BUFF_MAGNET) diff --git a/qcsrc/common/buffs/all.qc b/qcsrc/common/buffs/all.qc new file mode 100644 index 000000000..56e9b1e41 --- /dev/null +++ b/qcsrc/common/buffs/all.qc @@ -0,0 +1,10 @@ +#if defined(CSQC) + #include "../dpdefs/csprogsdefs.qh" + #include "../client/defs.qh" +#elif defined(MENUQC) +#elif defined(SVQC) + #include "../dpdefs/progsdefs.qh" + #include "../dpdefs/dpextensions.qh" +#endif +#include "all.qh" + diff --git a/qcsrc/common/buffs/all.qh b/qcsrc/common/buffs/all.qh new file mode 100644 index 000000000..4cf371baa --- /dev/null +++ b/qcsrc/common/buffs/all.qh @@ -0,0 +1,68 @@ +#ifndef BUFFS_ALL_H +#define BUFFS_ALL_H +// Welcome to the stuff behind the scenes +// Below, you will find the list of buffs +// Add new buffs here! +// Note: Buffs also need spawnfuncs, which are set below + +#include "../teams.qh" +#include "../util.qh" + +REGISTRY(Buffs, 16) +REGISTER_REGISTRY(RegisterBuffs) + +#define REGISTER_BUFF(id) \ + REGISTER(RegisterBuffs, BUFF, Buffs, Buffs_COUNT, id, m_id, NEW(Buff)); \ + REGISTER_INIT_POST(BUFF, id) { \ + this.netname = this.m_name; \ + this.m_itemid = BIT(this.m_id - 1); \ + this.m_sprite = strzone(strcat("buff-", this.m_name)); \ + } \ + REGISTER_INIT(BUFF, id) + +#include "../items/item/pickup.qh" +CLASS(Buff, Pickup) + /** bit index */ + ATTRIB(Buff, m_itemid, int, 0) + ATTRIB(Buff, m_name, string, "buff") + ATTRIB(Buff, m_color, vector, '1 1 1') + ATTRIB(Buff, m_prettyName, string, "Buff") + ATTRIB(Buff, m_skin, int, 0) + ATTRIB(Buff, m_sprite, string, "") + METHOD(Buff, display, void(entity this, void(string name, string icon) returns)) { + returns(this.m_prettyName, sprintf("/gfx/hud/%s/buff_%s", cvar_string("menu_skin"), this.m_name)); + } +#ifdef SVQC + METHOD(Buff, m_time, float(entity)); + float Buff_m_time(entity this) { return cvar(strcat("g_buffs_", this.netname, "_time")); } +#endif +ENDCLASS(Buff) + +#ifdef SVQC + .int buffs; + void buff_Init(entity ent); + void buff_Init_Compat(entity ent, entity replacement); + #define BUFF_SPAWNFUNC(e, b, t) spawnfunc(item_buff_##e) { \ + self.buffs = b.m_itemid; \ + self.team = t; \ + buff_Init(self); \ + } + #define BUFF_SPAWNFUNCS(e, b) \ + BUFF_SPAWNFUNC(e, b, 0) \ + BUFF_SPAWNFUNC(e##_team1, b, NUM_TEAM_1) \ + BUFF_SPAWNFUNC(e##_team2, b, NUM_TEAM_2) \ + BUFF_SPAWNFUNC(e##_team3, b, NUM_TEAM_3) \ + BUFF_SPAWNFUNC(e##_team4, b, NUM_TEAM_4) + #define BUFF_SPAWNFUNC_Q3TA_COMPAT(o, r) spawnfunc(item_##o) { buff_Init_Compat(self, r); } +#else + #define BUFF_SPAWNFUNC(e, b, t) + #define BUFF_SPAWNFUNCS(e, b) + #define BUFF_SPAWNFUNC_Q3TA_COMPAT(o, r) +#endif + +REGISTER_BUFF(Null); +BUFF_SPAWNFUNCS(random, BUFF_Null) + +#include "all.inc" + +#endif diff --git a/qcsrc/common/mapinfo.qc b/qcsrc/common/mapinfo.qc index b17f2e7ba..8c898cc54 100644 --- a/qcsrc/common/mapinfo.qc +++ b/qcsrc/common/mapinfo.qc @@ -2,7 +2,7 @@ #include "../dpdefs/csprogsdefs.qh" #include "../client/defs.qh" #include "util.qh" - #include "buffs.qh" + #include "buffs/all.qh" #include "weapons/all.qh" #include "mapinfo.qh" #elif defined(MENUQC) @@ -10,7 +10,7 @@ #include "../dpdefs/progsdefs.qh" #include "../dpdefs/dpextensions.qh" #include "util.qh" - #include "buffs.qh" + #include "buffs/all.qh" #include "monsters/all.qh" #include "mapinfo.qh" #endif diff --git a/qcsrc/common/mutators/mutator/waypoints/waypointsprites.qc b/qcsrc/common/mutators/mutator/waypoints/waypointsprites.qc index a083ae159..d06fb6172 100644 --- a/qcsrc/common/mutators/mutator/waypoints/waypointsprites.qc +++ b/qcsrc/common/mutators/mutator/waypoints/waypointsprites.qc @@ -246,7 +246,7 @@ vector spritelookupcolor(string s, vector def) {SELFPARAM(); if (s == WP_Weapon.netname) return get_weaponinfo(self.wp_extra).wpcolor; if (s == WP_Item.netname) return Items[self.wp_extra].m_color; - if (s == WP_Buff.netname) return BUFFS[self.wp_extra].m_color; + if (s == WP_Buff.netname) return Buffs[self.wp_extra].m_color; return def; } @@ -255,7 +255,7 @@ string spritelookuptext(string s) if (s == WP_RaceStartFinish.netname) return (race_checkpointtime || race_mycheckpointtime) ? _("Finish") : _("Start"); if (s == WP_Weapon.netname) return get_weaponinfo(self.wp_extra).message; if (s == WP_Item.netname) return Items[self.wp_extra].m_waypoint; - if (s == WP_Buff.netname) return BUFFS[self.wp_extra].m_prettyName; + if (s == WP_Buff.netname) return Buffs[self.wp_extra].m_prettyName; if (s == WP_Monster.netname) return get_monsterinfo(self.wp_extra).monster_name; // need to loop, as our netname could be one of three diff --git a/qcsrc/common/nades.qc b/qcsrc/common/nades.qc index f0e72b7ec..a6b000025 100644 --- a/qcsrc/common/nades.qc +++ b/qcsrc/common/nades.qc @@ -2,7 +2,7 @@ #include "../dpdefs/csprogsdefs.qh" #include "../client/defs.qh" #include "nades.qh" - #include "buffs.qh" + #include "buffs/all.qh" #include "../common/movetypes/movetypes.qh" #include "../client/main.qh" #include "../csqcmodellib/cl_model.qh" diff --git a/qcsrc/common/notifications.qh b/qcsrc/common/notifications.qh index d44a65156..01d6cbe55 100644 --- a/qcsrc/common/notifications.qh +++ b/qcsrc/common/notifications.qh @@ -265,8 +265,8 @@ const float ARG_DC = 6; // unique result to durcnt/centerprint ARG_CASE(ARG_CS_SV, "spree_end", (autocvar_notification_show_sprees ? notif_arg_spree_inf(-1, "", "", f1) : "")) \ ARG_CASE(ARG_CS_SV, "spree_lost", (autocvar_notification_show_sprees ? notif_arg_spree_inf(-2, "", "", f1) : "")) \ ARG_CASE(ARG_CS_SV, "item_wepname", WEP_NAME(f1)) \ - ARG_CASE(ARG_CS_SV, "item_buffname", sprintf("%s%s", rgb_to_hexcolor(BUFFS[f1].m_color), BUFFS[f1].m_prettyName)) \ - ARG_CASE(ARG_CS_SV, "f3buffname", sprintf("%s%s", rgb_to_hexcolor(BUFFS[f3].m_color), BUFFS[f3].m_prettyName)) \ + ARG_CASE(ARG_CS_SV, "item_buffname", sprintf("%s%s", rgb_to_hexcolor(Buffs[f1].m_color), Buffs[f1].m_prettyName)) \ + ARG_CASE(ARG_CS_SV, "f3buffname", sprintf("%s%s", rgb_to_hexcolor(Buffs[f3].m_color), Buffs[f3].m_prettyName)) \ ARG_CASE(ARG_CS_SV, "item_wepammo", (s1 != "" ? sprintf(_(" with %s"), s1) : "")) \ ARG_CASE(ARG_DC, "item_centime", ftos(autocvar_notification_item_centerprinttime)) \ ARG_CASE(ARG_SV, "death_team", Team_ColoredFullName(f1)) \ diff --git a/qcsrc/common/triggers/misc/laser.qc b/qcsrc/common/triggers/misc/laser.qc index ec4a9e277..5f7707d5b 100644 --- a/qcsrc/common/triggers/misc/laser.qc +++ b/qcsrc/common/triggers/misc/laser.qc @@ -1,6 +1,6 @@ #if defined(CSQC) #include "../../../client/_all.qh" - #include "../../buffs.qh" + #include "../../buffs/all.qh" #include "../../../csqcmodellib/interpolate.qh" #include "../../../client/main.qh" #include "../../../csqcmodellib/cl_model.qh" diff --git a/qcsrc/common/weapons/all.qc b/qcsrc/common/weapons/all.qc index 8552f9730..2c72d380f 100644 --- a/qcsrc/common/weapons/all.qc +++ b/qcsrc/common/weapons/all.qc @@ -12,7 +12,7 @@ #include "../../warpzonelib/common.qh" #include "../../warpzonelib/client.qh" #include "../util.qh" - #include "../buffs.qh" + #include "../buffs/all.qh" #include "../../client/autocvars.qh" #include "../deathtypes.qh" #include "../../csqcmodellib/interpolate.qh" @@ -31,7 +31,7 @@ #include "../stats.qh" #include "../teams.qh" #include "../util.qh" - #include "../buffs.qh" + #include "../buffs/all.qh" #include "../monsters/all.qh" #include "config.qh" #include "../../server/weapons/csqcprojectile.qh" diff --git a/qcsrc/server/g_damage.qc b/qcsrc/server/g_damage.qc index 11812f85c..840ffe5c5 100644 --- a/qcsrc/server/g_damage.qc +++ b/qcsrc/server/g_damage.qc @@ -10,7 +10,7 @@ #include "weapons/accuracy.qh" #include "weapons/csqcprojectile.qh" #include "weapons/selection.qh" -#include "../common/buffs.qh" +#include "../common/buffs/all.qh" #include "../common/constants.qh" #include "../common/deathtypes.qh" #include "../common/notifications.qh" diff --git a/qcsrc/server/g_world.qc b/qcsrc/server/g_world.qc index 0e550db1e..654c8a77a 100644 --- a/qcsrc/server/g_world.qc +++ b/qcsrc/server/g_world.qc @@ -19,7 +19,7 @@ #include "scores.qh" #include "teamplay.qh" #include "weapons/weaponstats.qh" -#include "../common/buffs.qh" +#include "../common/buffs/all.qh" #include "../common/constants.qh" #include "../common/deathtypes.qh" #include "../common/effects/effects.qh" diff --git a/qcsrc/server/mutators/mutator_buffs.qc b/qcsrc/server/mutators/mutator_buffs.qc index fb0c2b7b6..da47be415 100644 --- a/qcsrc/server/mutators/mutator_buffs.qc +++ b/qcsrc/server/mutators/mutator_buffs.qc @@ -4,13 +4,13 @@ #include "mutator.qh" -#include "../../common/buffs.qh" +#include "../../common/buffs/all.qh" entity buff_FirstFromFlags(int _buffs) { if (flags) { - FOREACH(BUFFS, it.m_itemid & _buffs, LAMBDA(return it)); + FOREACH(Buffs, it.m_itemid & _buffs, LAMBDA(return it)); } return BUFF_Null; } @@ -211,7 +211,7 @@ float buff_Available(entity buff) void buff_NewType(entity ent, float cb) { RandomSelection_Init(); - FOREACH(BUFFS, buff_Available(it), LAMBDA( + FOREACH(Buffs, buff_Available(it), LAMBDA( it.buff_seencount += 1; // if it's already been chosen, give it a lower priority RandomSelection_Add(world, it.m_itemid, string_null, 1, max(0.2, 1 / it.buff_seencount)); diff --git a/qcsrc/server/mutators/mutator_instagib.qc b/qcsrc/server/mutators/mutator_instagib.qc index 5f057e582..9f88b2b6e 100644 --- a/qcsrc/server/mutators/mutator_instagib.qc +++ b/qcsrc/server/mutators/mutator_instagib.qc @@ -3,7 +3,7 @@ #include "mutator.qh" #include "../cl_client.qh" -#include "../../common/buffs.qh" +#include "../../common/buffs/all.qh" #include "../../common/items/all.qc" diff --git a/qcsrc/server/mutators/mutators_include.qc b/qcsrc/server/mutators/mutators_include.qc index 8e9a66583..8b432d3bf 100644 --- a/qcsrc/server/mutators/mutators_include.qc +++ b/qcsrc/server/mutators/mutators_include.qc @@ -12,7 +12,7 @@ #include "../../common/teams.qh" #include "../../common/util.qh" #include "../../common/nades.qh" - #include "../../common/buffs.qh" + #include "../../common/buffs/all.qh" #include "../../common/command/markup.qh" #include "../../common/command/rpn.qh" #include "../../common/command/generic.qh" diff --git a/qcsrc/server/progs.inc b/qcsrc/server/progs.inc index 52cf270bf..d9dec8f6f 100644 --- a/qcsrc/server/progs.inc +++ b/qcsrc/server/progs.inc @@ -79,7 +79,6 @@ #include "weapons/weaponsystem.qc" #include "../common/animdecide.qc" -#include "../common/buffs.qc" #include "../common/campaign_file.qc" #include "../common/campaign_setup.qc" #include "../common/effects/effects.qc" @@ -99,6 +98,7 @@ #include "../common/triggers/include.qc" #include "../common/util.qc" +#include "../common/buffs/all.qc" #include "../common/items/all.qc" #include "../common/monsters/all.qc" #include "../common/mutators/all.qc" diff --git a/qcsrc/server/t_quake3.qc b/qcsrc/server/t_quake3.qc index 8eecc5ee3..c8f595761 100644 --- a/qcsrc/server/t_quake3.qc +++ b/qcsrc/server/t_quake3.qc @@ -1,7 +1,7 @@ #include "_all.qh" #include "../common/weapons/all.qh" -#include "../common/buffs.qh" +#include "../common/buffs/all.qh" spawnfunc(weapon_crylink); spawnfunc(weapon_electro);