From 4192f3a1af613f8085e66c8c7a1c8a1c3bfc6332 Mon Sep 17 00:00:00 2001 From: otta8634 Date: Fri, 20 Dec 2024 16:26:17 +0800 Subject: [PATCH] Move attributes for items and nades into their classes This makes it more consistent with weapons, buffers, some powerups, monsters, and vehicles. Also this makes it possible to use the COLORED_NAME macro on them in the guide. This could be done for the rest of the powerups too, but they're a bit of a mess currently. --- qcsrc/common/items/item/ammo.qh | 144 +++++------ qcsrc/common/items/item/armor.qh | 234 ++++++++--------- qcsrc/common/items/item/health.qh | 236 +++++++++--------- qcsrc/common/items/item/jetpack.qh | 139 +++++------ .../common/mutators/mutator/instagib/items.qh | 83 +++--- qcsrc/common/mutators/mutator/nades/nades.inc | 66 ++--- 6 files changed, 452 insertions(+), 450 deletions(-) diff --git a/qcsrc/common/items/item/ammo.qh b/qcsrc/common/items/item/ammo.qh index ecd96b98b..74af3fd7d 100644 --- a/qcsrc/common/items/item/ammo.qh +++ b/qcsrc/common/items/item/ammo.qh @@ -51,30 +51,28 @@ void ammo_shells_init(Pickup this, entity item) #endif CLASS(Shells, Ammo) -#ifdef MENUQC - METHOD(Shells, describe, string(Shells this)) - { - TC(Shells, this); - return _("The Shells ammo type is used by the Shotgun and Overkill Shotgun"); - } -#endif -ENDCLASS(Shells) - -REGISTER_ITEM(Shells, NEW(Shells)) { - this.m_canonical_spawnfunc = "item_shells"; +/* spawnfunc */ ATTRIB(Shells, m_canonical_spawnfunc, string, "item_shells"); #ifdef GAMEQC - this.spawnflags = ITEM_FLAG_NORMAL | ITEM_FLAG_RESOURCE; - this.m_model = MDL_Shells_ITEM; +/* spawnflags */ ATTRIB(Shells, spawnflags, int, ITEM_FLAG_NORMAL | ITEM_FLAG_RESOURCE); +/* model */ ATTRIB(Shells, m_model, Model, MDL_Shells_ITEM); #endif - this.netname = "shells"; - this.m_name = _("Shells"); - this.m_icon = "ammo_shells"; +/* refname */ ATTRIB(Shells, netname, string, "shells"); +/* itemname */ ATTRIB(Shells, m_name, string, _("Shells")); +/* icon */ ATTRIB(Shells, m_icon, string, "ammo_shells"); #ifdef SVQC - this.m_botvalue = 1000; - this.m_itemid = IT_RESOURCE; - this.m_iteminit = ammo_shells_init; +/* botvalue */ ATTRIB(Shells, m_botvalue, int, 1000); +/* itemid */ ATTRIB(Shells, m_itemid, int, IT_RESOURCE); +/* iteminit */ ATTRIB(Shells, m_iteminit, void(Pickup this, entity item), ammo_shells_init); #endif +#ifdef MENUQC +METHOD(Shells, describe, string(Shells this)) +{ + TC(Shells, this); + return _("The Shells ammo type is used by the Shotgun and Overkill Shotgun"); } +#endif +ENDCLASS(Shells) +REGISTER_ITEM(Shells, NEW(Shells)); SPAWNFUNC_ITEM(item_shells, ITEM_Shells) @@ -94,30 +92,28 @@ void ammo_bullets_init(Pickup this, entity item) #endif CLASS(Bullets, Ammo) -#ifdef MENUQC - METHOD(Bullets, describe, string(Bullets this)) - { - TC(Bullets, this); - return _("The Bullets ammo type is used by the MachineGun, Rifle, Overkill MachineGun, and Overkill Heavy Machine Gun"); - } -#endif -ENDCLASS(Bullets) - -REGISTER_ITEM(Bullets, NEW(Bullets)) { - this.m_canonical_spawnfunc = "item_bullets"; +/* spawnfunc */ ATTRIB(Bullets, m_canonical_spawnfunc, string, "item_bullets"); #ifdef GAMEQC - this.spawnflags = ITEM_FLAG_NORMAL | ITEM_FLAG_RESOURCE; - this.m_model = MDL_Bullets_ITEM; +/* spawnflags */ ATTRIB(Bullets, spawnflags, int, ITEM_FLAG_NORMAL | ITEM_FLAG_RESOURCE); +/* model */ ATTRIB(Bullets, m_model, Model, MDL_Bullets_ITEM); #endif - this.netname = "bullets"; - this.m_name = _("Bullets"); - this.m_icon = "ammo_bullets"; +/* refname */ ATTRIB(Bullets, netname, string, "bullets"); +/* itemname */ ATTRIB(Bullets, m_name, string, _("Bullets")); +/* icon */ ATTRIB(Bullets, m_icon, string, "ammo_bullets"); #ifdef SVQC - this.m_botvalue = 1500; - this.m_itemid = IT_RESOURCE; - this.m_iteminit = ammo_bullets_init; +/* botvalue */ ATTRIB(Bullets, m_botvalue, int, 1500); +/* itemid */ ATTRIB(Bullets, m_itemid, int, IT_RESOURCE); +/* iteminit */ ATTRIB(Bullets, m_iteminit, void(Pickup this, entity item), ammo_bullets_init); #endif +#ifdef MENUQC +METHOD(Bullets, describe, string(Bullets this)) +{ + TC(Bullets, this); + return _("The Bullets ammo type is used by the MachineGun, Rifle, Overkill MachineGun, and Overkill Heavy Machine Gun"); } +#endif +ENDCLASS(Bullets) +REGISTER_ITEM(Bullets, NEW(Bullets)); SPAWNFUNC_ITEM(item_bullets, ITEM_Bullets) @@ -137,30 +133,28 @@ void ammo_rockets_init(Pickup this, entity item) #endif CLASS(Rockets, Ammo) -#ifdef MENUQC - METHOD(Rockets, describe, string(Rockets this)) - { - TC(Rockets, this); - return _("The Rockets ammo type is used by the Devastator, Mortar, Mine Layer, Hagar, T.A.G. Seeker, and Overkill Rocket Propelled Chainsaw"); - } -#endif -ENDCLASS(Rockets) - -REGISTER_ITEM(Rockets, NEW(Rockets)) { - this.m_canonical_spawnfunc = "item_rockets"; +/* spawnfunc */ ATTRIB(Rockets, m_canonical_spawnfunc, string, "item_rockets"); #ifdef GAMEQC - this.spawnflags = ITEM_FLAG_NORMAL | ITEM_FLAG_RESOURCE; - this.m_model = MDL_Rockets_ITEM; +/* spawnflags */ ATTRIB(Rockets, spawnflags, int, ITEM_FLAG_NORMAL | ITEM_FLAG_RESOURCE); +/* model */ ATTRIB(Rockets, m_model, Model, MDL_Rockets_ITEM); #endif - this.netname = "rockets"; - this.m_name = _("Rockets"); - this.m_icon = "ammo_rockets"; +/* refname */ ATTRIB(Rockets, netname, string, "rockets"); +/* itename */ ATTRIB(Rockets, m_name, string, _("Rockets")); +/* icon */ ATTRIB(Rockets, m_icon, string, "ammo_rockets"); #ifdef SVQC - this.m_botvalue = 1500; - this.m_itemid = IT_RESOURCE; - this.m_iteminit = ammo_rockets_init; +/* botvalue */ ATTRIB(Rockets, m_botvalue, int, 1500); +/* itemid */ ATTRIB(Rockets, m_itemid, int, IT_RESOURCE); +/* iteminit */ ATTRIB(Rockets, m_iteminit, void(Pickup this, entity item), ammo_rockets_init); #endif +#ifdef MENUQC +METHOD(Rockets, describe, string(Rockets this)) +{ + TC(Rockets, this); + return _("The Rockets ammo type is used by the Devastator, Mortar, Mine Layer, Hagar, T.A.G. Seeker, and Overkill Rocket Propelled Chainsaw"); } +#endif +ENDCLASS(Rockets) +REGISTER_ITEM(Rockets, NEW(Rockets)); SPAWNFUNC_ITEM(item_rockets, ITEM_Rockets) @@ -180,29 +174,27 @@ void ammo_cells_init(Pickup this, entity item) #endif CLASS(Cells, Ammo) -#ifdef MENUQC - METHOD(Cells, describe, string(Cells this)) - { - TC(Cells, this); - return _("The Cells ammo type is used by the Vortex, Crylink, Electro, Heavy Laser Assault Cannon, Arc, and Vaporizer"); - } -#endif -ENDCLASS(Cells) - -REGISTER_ITEM(Cells, NEW(Cells)) { - this.m_canonical_spawnfunc = "item_cells"; +/* spawnfunc */ ATTRIB(Cells, m_canonical_spawnfunc, string, "item_cells"); #ifdef GAMEQC - this.spawnflags = ITEM_FLAG_NORMAL | ITEM_FLAG_RESOURCE; - this.m_model = MDL_Cells_ITEM; +/* spawnflags */ ATTRIB(Cells, spawnflags, int, ITEM_FLAG_NORMAL | ITEM_FLAG_RESOURCE); +/* model */ ATTRIB(Cells, m_model, Model, MDL_Cells_ITEM); #endif - this.netname = "cells"; - this.m_name = _("Cells"); - this.m_icon = "ammo_cells"; +/* refname */ ATTRIB(Cells, netname, string, "cells"); +/* itemname */ ATTRIB(Cells, m_name, string, _("Cells")); +/* icon */ ATTRIB(Cells, m_icon, string, "ammo_cells"); #ifdef SVQC - this.m_botvalue = 1500; - this.m_itemid = IT_RESOURCE; - this.m_iteminit = ammo_cells_init; +/* botvalue */ ATTRIB(Cells, m_botvalue, int, 1500); +/* itemid */ ATTRIB(Cells, m_itemid, int, IT_RESOURCE); +/* iteminit */ ATTRIB(Cells, m_iteminit, void(Pickup this, entity item), ammo_cells_init); #endif +#ifdef MENUQC +METHOD(Cells, describe, string(Cells this)) +{ + TC(Cells, this); + return _("The Cells ammo type is used by the Vortex, Crylink, Electro, Heavy Laser Assault Cannon, Arc, and Vaporizer"); } +#endif +ENDCLASS(Cells) +REGISTER_ITEM(Cells, NEW(Cells)); SPAWNFUNC_ITEM(item_cells, ITEM_Cells) diff --git a/qcsrc/common/items/item/armor.qh b/qcsrc/common/items/item/armor.qh index 3021c40c6..8ea1297aa 100644 --- a/qcsrc/common/items/item/armor.qh +++ b/qcsrc/common/items/item/armor.qh @@ -33,40 +33,42 @@ void item_armorsmall_init(Pickup this, entity item) #endif CLASS(ArmorSmall, Armor) -#ifdef MENUQC - METHOD(ArmorSmall, describe, string(ArmorSmall this)) - { - TC(ArmorSmall, this); - return _("The Small armor provides you a small amount of armor when picked up, " - "protecting you from damage by absorbing incoming hits until it is depleted"); - } -#endif -ENDCLASS(ArmorSmall) - -REGISTER_ITEM(ArmorSmall, NEW(ArmorSmall)) { - this.m_canonical_spawnfunc = "item_armor_small"; +/* spawnfunc */ ATTRIB(ArmorSmall, m_canonical_spawnfunc, string, "item_armor_small"); #ifdef GAMEQC - this.spawnflags = ITEM_FLAG_NORMAL | ITEM_FLAG_RESOURCE; - this.m_model = MDL_ArmorSmall_ITEM; - this.m_sound = SND_ArmorSmall; +/* spawnflags */ ATTRIB(ArmorSmall, spawnflags, int, ITEM_FLAG_NORMAL | ITEM_FLAG_RESOURCE); +/* model */ ATTRIB(ArmorSmall, m_model, Model, MDL_ArmorSmall_ITEM); +/* sound */ ATTRIB(ArmorSmall, m_sound, Sound, SND_ArmorSmall); #endif - this.netname = "armor_small"; - this.m_name = _("Small armor"); - this.m_icon = "armor_small"; +/* refname */ ATTRIB(ArmorSmall, netname, string, "armor_small"); +/* itemname */ ATTRIB(ArmorSmall, m_name, string, _("Small armor")); +/* icon */ ATTRIB(ArmorSmall, m_icon, string, // ... #ifdef CSQC - if(precache_pic(strcat("gfx/hud/luma/", this.m_icon)) == "") - this.m_icon = "armor"; // compatible with Xonotic v0.8.2 or lower + (precache_pic(strcat("gfx/hud/luma/", "health_small")) == "") + ? "armor" // compatible with Xonotic v0.8.2 or lower + : "armor_small" +#else + "armor_small" #endif +); #ifdef SVQC - this.m_mins = ITEM_S_MINS; - this.m_maxs = ITEM_S_MAXS; - this.m_itemid = IT_RESOURCE; - this.m_respawntime = GET(g_pickup_respawntime_armor_small); - this.m_respawntimejitter = GET(g_pickup_respawntimejitter_armor_small); - this.m_pickupanyway = GET(g_pickup_armorsmall_anyway); - this.m_iteminit = item_armorsmall_init; +/* minsize */ ATTRIB(ArmorSmall, m_mins, vector, ITEM_S_MINS); +/* maxsize */ ATTRIB(ArmorSmall, m_maxs, vector, ITEM_S_MAXS); +/* itemid */ ATTRIB(ArmorSmall, m_itemid, int, IT_RESOURCE); +/* respawntime */ ATTRIB(ArmorSmall, m_respawntime, float, GET(g_pickup_respawntime_armor_small)); +/* */ ATTRIB(ArmorSmall, m_respawntimejitter, float, GET(g_pickup_respawntimejitter_armor_small)); +/* pickupanyway */ ATTRIB(ArmorSmall, m_pickupanyway, float, GET(g_pickup_armorsmall_anyway)); +/* iteminit */ ATTRIB(ArmorSmall, m_iteminit, void(Pickup this, entity item), item_armorsmall_init); #endif +#ifdef MENUQC +METHOD(ArmorSmall, describe, string(ArmorSmall this)) +{ + TC(ArmorSmall, this); + return _("The Small armor provides you a small amount of armor when picked up, " + "protecting you from damage by absorbing incoming hits until it is depleted"); } +#endif +ENDCLASS(ArmorSmall) +REGISTER_ITEM(ArmorSmall, NEW(ArmorSmall)); SPAWNFUNC_ITEM(item_armor_small, ITEM_ArmorSmall) @@ -89,40 +91,42 @@ void item_armormedium_init(Pickup this, entity item) #endif CLASS(ArmorMedium, Armor) -#ifdef MENUQC - METHOD(ArmorMedium, describe, string(ArmorMedium this)) - { - TC(ArmorMedium, this); - return _("The Medium armor provides you a medium amount of armor when picked up, " - "protecting you from damage by absorbing incoming hits until it is depleted"); - } -#endif -ENDCLASS(ArmorMedium) - -REGISTER_ITEM(ArmorMedium, NEW(ArmorMedium)) { - this.m_canonical_spawnfunc = "item_armor_medium"; +/* spawnfunc */ ATTRIB(ArmorMedium, m_canonical_spawnfunc, string, "item_armor_medium"); #ifdef GAMEQC - this.spawnflags = ITEM_FLAG_NORMAL | ITEM_FLAG_RESOURCE; - this.m_model = MDL_ArmorMedium_ITEM; - this.m_sound = SND_ArmorMedium; +/* spawnflags */ ATTRIB(ArmorMedium, spawnflags, int, ITEM_FLAG_NORMAL | ITEM_FLAG_RESOURCE); +/* model */ ATTRIB(ArmorMedium, m_model, Model, MDL_ArmorMedium_ITEM); +/* sound */ ATTRIB(ArmorMedium, m_sound, Sound, SND_ArmorMedium); #endif - this.netname = "armor_medium"; - this.m_name = _("Medium armor"); - this.m_icon = "armor_medium"; +/* refname */ ATTRIB(ArmorMedium, netname, string, "armor_medium"); +/* itemname */ ATTRIB(ArmorMedium, m_name, string, _("Medium armor")); +/* icon */ ATTRIB(ArmorMedium, m_icon, string, // ... #ifdef CSQC - if(precache_pic(strcat("gfx/hud/luma/", this.m_icon)) == "") - this.m_icon = "armor"; // compatible with Xonotic v0.8.2 or lower + (precache_pic(strcat("gfx/hud/luma/", "armor_medium")) == "") + ? "armor" // compatible with Xonotic v0.8.2 or lower + : "armor_medium" +#else + "armor_medium" #endif +); #ifdef SVQC - this.m_mins = ITEM_S_MINS; - this.m_maxs = ITEM_S_MAXS; - this.m_itemid = IT_RESOURCE; - this.m_respawntime = GET(g_pickup_respawntime_armor_medium); - this.m_respawntimejitter = GET(g_pickup_respawntimejitter_armor_medium); - this.m_pickupanyway = GET(g_pickup_armormedium_anyway); - this.m_iteminit = item_armormedium_init; +/* minsize */ ATTRIB(ArmorMedium, m_mins, vector, ITEM_S_MINS); +/* maxsize */ ATTRIB(ArmorMedium, m_maxs, vector, ITEM_S_MAXS); +/* itemid */ ATTRIB(ArmorMedium, m_itemid, int, IT_RESOURCE); +/* respawntime */ ATTRIB(ArmorMedium, m_respawntime, float, GET(g_pickup_respawntime_armor_medium)); +/* */ ATTRIB(ArmorMedium, m_respawntimejitter, float, GET(g_pickup_respawntimejitter_armor_medium)); +/* pickupanyway */ ATTRIB(ArmorMedium, m_pickupanyway, float, GET(g_pickup_armormedium_anyway)); +/* iteminit */ ATTRIB(ArmorMedium, m_iteminit, void(Pickup this, entity item), item_armormedium_init); #endif +#ifdef MENUQC +METHOD(ArmorMedium, describe, string(ArmorMedium this)) +{ + TC(ArmorMedium, this); + return _("The Medium armor provides you a medium amount of armor when picked up, " + "protecting you from damage by absorbing incoming hits until it is depleted"); } +#endif +ENDCLASS(ArmorMedium) +REGISTER_ITEM(ArmorMedium, NEW(ArmorMedium)); SPAWNFUNC_ITEM(item_armor_medium, ITEM_ArmorMedium) @@ -145,40 +149,42 @@ void item_armorbig_init(Pickup this, entity item) #endif CLASS(ArmorBig, Armor) -#ifdef MENUQC - METHOD(ArmorBig, describe, string(ArmorBig this)) - { - TC(ArmorBig, this); - return _("The Big armor provides you a large amount of armor when picked up, " - "protecting you from damage by absorbing incoming hits until it is depleted"); - } -#endif -ENDCLASS(ArmorBig) - -REGISTER_ITEM(ArmorBig, NEW(ArmorBig)) { - this.m_canonical_spawnfunc = "item_armor_big"; +/* spawnfunc */ ATTRIB(ArmorBig, m_canonical_spawnfunc, string, "item_armor_big"); #ifdef GAMEQC - this.spawnflags = ITEM_FLAG_NORMAL | ITEM_FLAG_RESOURCE; - this.m_model = MDL_ArmorBig_ITEM; - this.m_sound = SND_ArmorBig; +/* spawnflags */ ATTRIB(ArmorBig, spawnflags, int, ITEM_FLAG_NORMAL | ITEM_FLAG_RESOURCE); +/* model */ ATTRIB(ArmorBig, m_model, Model, MDL_ArmorBig_ITEM); +/* sound */ ATTRIB(ArmorBig, m_sound, Sound, SND_ArmorBig); #endif - this.netname = "armor_big"; - this.m_name = _("Big armor"); - this.m_icon = "armor_big"; +/* refname */ ATTRIB(ArmorBig, netname, string, "armor_big"); +/* itemname */ ATTRIB(ArmorBig, m_name, string, _("Big armor")); +/* icon */ ATTRIB(ArmorBig, m_icon, string, // ... #ifdef CSQC - if(precache_pic(strcat("gfx/hud/luma/", this.m_icon)) == "") - this.m_icon = "armor"; // compatible with Xonotic v0.8.2 or lower -#endif - this.m_color = COLOR_ITEM_ARMOR; - this.m_waypoint = _("Big armor"); + (precache_pic(strcat("gfx/hud/luma/", "armor_big")) == "") + ? "armor" // compatible with Xonotic v0.8.2 or lower + : "armor_big" +#else + "armor_big" +#endif +); +/* color */ ATTRIB(ArmorBig, m_color, vector, COLOR_ITEM_ARMOR); +/* wptext */ ATTRIB(ArmorBig, m_waypoint, string, _("Big armor")); #ifdef SVQC - this.m_itemid = IT_RESOURCE; - this.m_respawntime = GET(g_pickup_respawntime_armor_big); - this.m_respawntimejitter = GET(g_pickup_respawntimejitter_armor_big); - this.m_pickupanyway = GET(g_pickup_armorbig_anyway); - this.m_iteminit = item_armorbig_init; +/* itemid */ ATTRIB(ArmorBig, m_itemid, int, IT_RESOURCE); +/* respawntime */ ATTRIB(ArmorBig, m_respawntime, float, GET(g_pickup_respawntime_armor_big)); +/* */ ATTRIB(ArmorBig, m_respawntimejitter, float, GET(g_pickup_respawntimejitter_armor_big)); +/* pickupanyway */ ATTRIB(ArmorBig, m_pickupanyway, float, GET(g_pickup_armorbig_anyway)); +/* iteminit */ ATTRIB(ArmorBig, m_iteminit, void(Pickup this, entity item), item_armorbig_init); #endif +#ifdef MENUQC +METHOD(ArmorBig, describe, string(ArmorBig this)) +{ + TC(ArmorBig, this); + return _("The Big armor provides you a large amount of armor when picked up, " + "protecting you from damage by absorbing incoming hits until it is depleted"); } +#endif +ENDCLASS(ArmorBig) +REGISTER_ITEM(ArmorBig, NEW(ArmorBig)); SPAWNFUNC_ITEM(item_armor_big, ITEM_ArmorBig) @@ -201,42 +207,44 @@ void item_armormega_init(Pickup this, entity item) #endif CLASS(ArmorMega, Armor) -#ifdef MENUQC - METHOD(ArmorMega, describe, string(ArmorMega this)) - { - TC(ArmorMega, this); - return _("The Mega armor provides you a huge amount of armor when picked up, " - "protecting you from damage by absorbing incoming hits until it is depleted\n\n" - "It tends to be one of the most highly contested items on a map, particularly in game modes like Duel"); - } -#endif -ENDCLASS(ArmorMega) - -REGISTER_ITEM(ArmorMega, NEW(ArmorMega)) { - this.m_canonical_spawnfunc = "item_armor_mega"; +/* spawnfunc */ ATTRIB(ArmorMega, m_canonical_spawnfunc, string, "item_armor_mega"); #ifdef GAMEQC - this.spawnflags = ITEM_FLAG_NORMAL | ITEM_FLAG_RESOURCE; - this.m_model = MDL_ArmorMega_ITEM; - this.m_sound = SND_ArmorMega; +/* spawnflags */ ATTRIB(ArmorMega, spawnflags, int, ITEM_FLAG_NORMAL | ITEM_FLAG_RESOURCE); +/* model */ ATTRIB(ArmorMega, m_model, Model, MDL_ArmorMega_ITEM); +/* sound */ ATTRIB(ArmorMega, m_sound, Sound, SND_ArmorMega); #endif - this.netname = "armor_mega"; - this.m_name = _("Mega armor"); - this.m_icon = "armor_mega"; +/* refname */ ATTRIB(ArmorMega, netname, string, "armor_mega"); +/* itemname */ ATTRIB(ArmorMega, m_name, string, _("Mega armor")); +/* icon */ ATTRIB(ArmorMega, m_icon, string, // ... #ifdef CSQC - if(precache_pic(strcat("gfx/hud/luma/", this.m_icon)) == "") - this.m_icon = "item_large_armor"; // compatible with Xonotic v0.8.2 or lower -#endif - this.m_color = COLOR_ITEM_ARMOR; - this.m_waypoint = _("Mega armor"); - this.m_waypointblink = 2; + (precache_pic(strcat("gfx/hud/luma/", "armor_mega")) == "") + ? "item_large_armor" // compatible with Xonotic v0.8.2 or lower + : "armor_mega" +#else + "armor_mega" +#endif +); +/* color */ ATTRIB(ArmorMega, m_color, vector, COLOR_ITEM_ARMOR); +/* wptext */ ATTRIB(ArmorMega, m_waypoint, string, _("Mega armor")); +/* wpblink */ ATTRIB(ArmorMega, m_waypointblink, int, 2); #ifdef SVQC - this.m_maxs = ITEM_L_MAXS; - this.m_itemid = IT_RESOURCE; - this.m_respawntime = GET(g_pickup_respawntime_armor_mega); - this.m_respawntimejitter = GET(g_pickup_respawntimejitter_armor_mega); - this.m_pickupanyway = GET(g_pickup_armormega_anyway); - this.m_iteminit = item_armormega_init; +/* maxsize */ ATTRIB(ArmorMega, m_maxs, vector, ITEM_L_MAXS); +/* itemid */ ATTRIB(ArmorMega, m_itemid, int, IT_RESOURCE); +/* respawntime */ ATTRIB(ArmorMega, m_respawntime, float, GET(g_pickup_respawntime_armor_mega)); +/* */ ATTRIB(ArmorMega, m_respawntimejitter, float, GET(g_pickup_respawntimejitter_armor_mega)); +/* pickupanyway */ ATTRIB(ArmorMega, m_pickupanyway, float, GET(g_pickup_armormega_anyway)); +/* iteminit */ ATTRIB(ArmorMega, m_iteminit, void(Pickup this, entity item), item_armormega_init); #endif +#ifdef MENUQC +METHOD(ArmorMega, describe, string(ArmorMega this)) +{ + TC(ArmorMega, this); + return _("The Mega armor provides you a huge amount of armor when picked up, " + "protecting you from damage by absorbing incoming hits until it is depleted\n\n" + "It tends to be one of the most highly contested items on a map, particularly in game modes like Duel"); } +#endif +ENDCLASS(ArmorMega) +REGISTER_ITEM(ArmorMega, NEW(ArmorMega)); SPAWNFUNC_ITEM(item_armor_mega, ITEM_ArmorMega) diff --git a/qcsrc/common/items/item/health.qh b/qcsrc/common/items/item/health.qh index 45346dd35..0accf6aff 100644 --- a/qcsrc/common/items/item/health.qh +++ b/qcsrc/common/items/item/health.qh @@ -33,40 +33,42 @@ void item_healthsmall_init(Pickup this, entity item) #endif CLASS(HealthSmall, Health) -#ifdef MENUQC - METHOD(HealthSmall, describe, string(HealthSmall this)) - { - TC(HealthSmall, this); - return _("The Small health restores a small amount of health when picked up, " - "helping you recover from damage taken during combat"); - } -#endif -ENDCLASS(HealthSmall) - -REGISTER_ITEM(HealthSmall, NEW(HealthSmall)) { - this.m_canonical_spawnfunc = "item_health_small"; +/* spawnfunc */ ATTRIB(HealthSmall, m_canonical_spawnfunc, string, "item_health_small"); #ifdef GAMEQC - this.spawnflags = ITEM_FLAG_NORMAL | ITEM_FLAG_RESOURCE; - this.m_model = MDL_HealthSmall_ITEM; - this.m_sound = SND_HealthSmall; +/* spawnflags */ ATTRIB(HealthSmall, spawnflags, int, ITEM_FLAG_NORMAL | ITEM_FLAG_RESOURCE); +/* model */ ATTRIB(HealthSmall, m_model, Model, MDL_HealthSmall_ITEM); +/* sound */ ATTRIB(HealthSmall, m_sound, Sound, SND_HealthSmall); #endif - this.netname = "health_small"; - this.m_name = _("Small health"); - this.m_icon = "health_small"; +/* refname */ ATTRIB(HealthSmall, netname, string, "health_small"); +/* itemname */ ATTRIB(HealthSmall, m_name, string, _("Small health")); +/* icon */ ATTRIB(HealthSmall, m_icon, string, // ... #ifdef CSQC - if(precache_pic(strcat("gfx/hud/luma/", this.m_icon)) == "") - this.m_icon = "health"; // compatible with Xonotic v0.8.2 or lower + (precache_pic(strcat("gfx/hud/luma/", "health_small")) == "") + ? "health" // compatible with Xonotic v0.8.2 or lower + : "health_small" +#else + "health_small" #endif +); #ifdef SVQC - this.m_mins = ITEM_S_MINS; - this.m_maxs = ITEM_S_MAXS; - this.m_itemid = IT_RESOURCE; - this.m_respawntime = GET(g_pickup_respawntime_health_small); - this.m_respawntimejitter = GET(g_pickup_respawntimejitter_health_small); - this.m_pickupanyway = GET(g_pickup_healthsmall_anyway); - this.m_iteminit = item_healthsmall_init; +/* minsize */ ATTRIB(HealthSmall, m_mins, vector, ITEM_S_MINS); +/* maxsize */ ATTRIB(HealthSmall, m_maxs, vector, ITEM_S_MAXS); +/* itemid */ ATTRIB(HealthSmall, m_itemid, int, IT_RESOURCE); +/* respawntime */ ATTRIB(HealthSmall, m_respawntime, float, GET(g_pickup_respawntime_health_small)); +/* */ ATTRIB(HealthSmall, m_respawntimejitter, float, GET(g_pickup_respawntimejitter_health_small)); +/* pickupanyway */ ATTRIB(HealthSmall, m_pickupanyway, float, GET(g_pickup_healthsmall_anyway)); +/* iteminit */ ATTRIB(HealthSmall, m_iteminit, void(Pickup this, entity item), item_healthsmall_init); #endif +#ifdef MENUQC +METHOD(HealthSmall, describe, string(HealthSmall this)) +{ + TC(HealthSmall, this); + return _("The Small health restores a small amount of health when picked up, " + "helping you recover from damage taken during combat"); } +#endif +ENDCLASS(HealthSmall) +REGISTER_ITEM(HealthSmall, NEW(HealthSmall)); SPAWNFUNC_ITEM(item_health_small, ITEM_HealthSmall) @@ -89,40 +91,42 @@ void item_healthmedium_init(Pickup this, entity item) #endif CLASS(HealthMedium, Health) -#ifdef MENUQC - METHOD(HealthMedium, describe, string(HealthMedium this)) - { - TC(HealthMedium, this); - return _("The Medium health restores a medium amount of health when picked up, " - "helping you recover from damage taken during combat"); - } -#endif -ENDCLASS(HealthMedium) - -REGISTER_ITEM(HealthMedium, NEW(HealthMedium)) { - this.m_canonical_spawnfunc = "item_health_medium"; +/* spawnfunc */ ATTRIB(HealthMedium, m_canonical_spawnfunc, string, "item_health_medium"); #ifdef GAMEQC - this.spawnflags = ITEM_FLAG_NORMAL | ITEM_FLAG_RESOURCE; - this.m_model = MDL_HealthMedium_ITEM; - this.m_sound = SND_HealthMedium; +/* spawnflags */ ATTRIB(HealthMedium, spawnflags, int, ITEM_FLAG_NORMAL | ITEM_FLAG_RESOURCE); +/* model */ ATTRIB(HealthMedium, m_model, Model, MDL_HealthMedium_ITEM); +/* sound */ ATTRIB(HealthMedium, m_sound, Sound, SND_HealthMedium); #endif - this.netname = "health_medium"; - this.m_name = _("Medium health"); - this.m_icon = "health_medium"; +/* refname */ ATTRIB(HealthMedium, netname, string, "health_medium"); +/* itemname */ ATTRIB(HealthMedium, m_name, string, _("Medium health")); +/* icon */ ATTRIB(HealthMedium, m_icon, string, // ... #ifdef CSQC - if(precache_pic(strcat("gfx/hud/luma/", this.m_icon)) == "") - this.m_icon = "health"; // compatible with Xonotic v0.8.2 or lower + (precache_pic(strcat("gfx/hud/luma/", "health_medium")) == "") + ? "health" // compatible with Xonotic v0.8.2 or lower + : "health_medium" +#else + "health_medium" #endif +); #ifdef SVQC - this.m_mins = ITEM_S_MINS; - this.m_maxs = ITEM_S_MAXS; - this.m_itemid = IT_RESOURCE; - this.m_respawntime = GET(g_pickup_respawntime_health_medium); - this.m_respawntimejitter = GET(g_pickup_respawntimejitter_health_medium); - this.m_pickupanyway = GET(g_pickup_healthmedium_anyway); - this.m_iteminit = item_healthmedium_init; +/* minsize */ ATTRIB(HealthMedium, m_mins, vector, ITEM_S_MINS); +/* maxsize */ ATTRIB(HealthMedium, m_maxs, vector, ITEM_S_MAXS); +/* itemid */ ATTRIB(HealthMedium, m_itemid, int, IT_RESOURCE); +/* respawntime */ ATTRIB(HealthMedium, m_respawntime, float, GET(g_pickup_respawntime_health_medium)); +/* */ ATTRIB(HealthMedium, m_respawntimejitter, float, GET(g_pickup_respawntimejitter_health_medium)); +/* pickupanyway */ ATTRIB(HealthMedium, m_pickupanyway, float, GET(g_pickup_healthmedium_anyway)); +/* iteminit */ ATTRIB(HealthMedium, m_iteminit, void(Pickup this, entity item), item_healthmedium_init); #endif +#ifdef MENUQC +METHOD(HealthMedium, describe, string(HealthMedium this)) +{ + TC(HealthMedium, this); + return _("The Medium health restores a medium amount of health when picked up, " + "helping you recover from damage taken during combat"); } +#endif +ENDCLASS(HealthMedium) +REGISTER_ITEM(HealthMedium, NEW(HealthMedium)); SPAWNFUNC_ITEM(item_health_medium, ITEM_HealthMedium) @@ -145,40 +149,42 @@ void item_healthbig_init(Pickup this, entity item) #endif CLASS(HealthBig, Health) -#ifdef MENUQC - METHOD(HealthBig, describe, string(HealthBig this)) - { - TC(HealthBig, this); - return _("The Big health restores a large amount of health when picked up, " - "helping you recover from damage taken during combat"); - } -#endif -ENDCLASS(HealthBig) - -REGISTER_ITEM(HealthBig, NEW(HealthBig)) { - this.m_canonical_spawnfunc = "item_health_big"; +/* spawnfunc */ ATTRIB(HealthBig, m_canonical_spawnfunc, string, "item_health_big"); #ifdef GAMEQC - this.spawnflags = ITEM_FLAG_NORMAL | ITEM_FLAG_RESOURCE; - this.m_model = MDL_HealthBig_ITEM; - this.m_sound = SND_HealthBig; -#endif - this.netname = "health_big"; - this.m_name = _("Big health"); - this.m_icon = "health_big"; - this.m_color = COLOR_ITEM_HEALTH; - this.m_waypoint = _("Big health"); -#ifdef CSQC - if(precache_pic(strcat("gfx/hud/luma/", this.m_icon)) == "") - this.m_icon = "health"; // compatible with Xonotic v0.8.2 or lower +/* spawnflags */ ATTRIB(HealthBig, spawnflags, int, ITEM_FLAG_NORMAL | ITEM_FLAG_RESOURCE); +/* model */ ATTRIB(HealthBig, m_model, Model, MDL_HealthBig_ITEM); +/* sound */ ATTRIB(HealthBig, m_sound, Sound, SND_HealthBig); #endif +/* refname */ ATTRIB(HealthBig, netname, string, "health_big"); +/* itemname */ ATTRIB(HealthBig, m_name, string, _("Big health")); +/* icon */ ATTRIB(HealthBig, m_icon, string, // ... +#ifdef CSQC + (precache_pic(strcat("gfx/hud/luma/", "health_big")) == "") + ? "health" // compatible with Xonotic v0.8.2 or lower + : "health_big" +#else + "health_big" +#endif +); +/* color */ ATTRIB(HealthBig, m_color, vector, COLOR_ITEM_HEALTH); +/* wptext */ ATTRIB(HealthBig, m_waypoint, string, _("Big health")); #ifdef SVQC - this.m_itemid = IT_RESOURCE; - this.m_respawntime = GET(g_pickup_respawntime_health_big); - this.m_respawntimejitter = GET(g_pickup_respawntimejitter_health_big); - this.m_pickupanyway = GET(g_pickup_healthbig_anyway); - this.m_iteminit = item_healthbig_init; +/* itemid */ ATTRIB(HealthBig, m_itemid, int, IT_RESOURCE); +/* respawntime */ ATTRIB(HealthBig, m_respawntime, float, GET(g_pickup_respawntime_health_big)); +/* */ ATTRIB(HealthBig, m_respawntimejitter, float, GET(g_pickup_respawntimejitter_health_big)); +/* pickupanyway */ ATTRIB(HealthBig, m_pickupanyway, float, GET(g_pickup_healthbig_anyway)); +/* iteminit */ ATTRIB(HealthBig, m_iteminit, void(Pickup this, entity item), item_healthbig_init); #endif +#ifdef MENUQC +METHOD(HealthBig, describe, string(HealthBig this)) +{ + TC(HealthBig, this); + return _("The Big health restores a large amount of health when picked up, " + "helping you recover from damage taken during combat"); } +#endif +ENDCLASS(HealthBig) +REGISTER_ITEM(HealthBig, NEW(HealthBig)); SPAWNFUNC_ITEM(item_health_big, ITEM_HealthBig) @@ -200,42 +206,44 @@ void item_healthmega_init(Pickup this, entity item) #endif CLASS(HealthMega, Health) -#ifdef MENUQC - METHOD(HealthMega, describe, string(HealthMega this)) - { - TC(HealthMega, this); - return _("The Mega health restores a huge amount of health when picked up, " - "helping you recover from damage taken during combat\n\n" - "It tends to be one of the most highly contested items on a map, particularly in game modes like Duel"); - } -#endif -ENDCLASS(HealthMega) - -REGISTER_ITEM(HealthMega, NEW(HealthMega)) { - this.m_canonical_spawnfunc = "item_health_mega"; +/* spawnfunc */ ATTRIB(HealthMega, m_canonical_spawnfunc, string, "item_health_mega"); #ifdef GAMEQC - this.spawnflags = ITEM_FLAG_NORMAL | ITEM_FLAG_RESOURCE; - this.m_model = MDL_HealthMega_ITEM; - this.m_sound = SND_HealthMega; +/* spawnflags */ ATTRIB(HealthMega, spawnflags, int, ITEM_FLAG_NORMAL | ITEM_FLAG_RESOURCE); +/* model */ ATTRIB(HealthMega, m_model, Model, MDL_HealthMega_ITEM); +/* sound */ ATTRIB(HealthMega, m_sound, Sound, SND_HealthMega); #endif - this.netname = "health_mega"; - this.m_name = _("Mega health"); - this.m_icon = "health_mega"; +/* refname */ ATTRIB(HealthMega, netname, string, "health_mega"); +/* itemname */ ATTRIB(HealthMega, m_name, string, _("Mega health")); +/* icon */ ATTRIB(HealthMega, m_icon, string, // ... #ifdef CSQC - if(precache_pic(strcat("gfx/hud/luma/", this.m_icon)) == "") - this.m_icon = "item_mega_health"; // compatible with Xonotic v0.8.2 or lower -#endif - this.m_color = COLOR_ITEM_HEALTH; - this.m_waypoint = _("Mega health"); - this.m_waypointblink = 2; + (precache_pic(strcat("gfx/hud/luma/", "health_mega")) == "") + ? "item_mega_health" // compatible with Xonotic v0.8.2 or lower + : "health_mega" +#else + "health_mega" +#endif +); +/* color */ ATTRIB(HealthMega, m_color, vector, COLOR_ITEM_HEALTH); +/* wptext */ ATTRIB(HealthMega, m_waypoint, string, _("Mega health")); +/* wpblink */ ATTRIB(HealthMega, m_waypointblink, int, 2); #ifdef SVQC - this.m_maxs = ITEM_L_MAXS; - this.m_itemid = IT_RESOURCE; - this.m_respawntime = GET(g_pickup_respawntime_health_mega); - this.m_respawntimejitter = GET(g_pickup_respawntimejitter_health_mega); - this.m_pickupanyway = GET(g_pickup_healthmega_anyway); - this.m_iteminit = item_healthmega_init; +/* maxsize */ ATTRIB(HealthMega, m_maxs, vector, ITEM_L_MAXS); +/* itemid */ ATTRIB(HealthMega, m_itemid, int, IT_RESOURCE); +/* respawntime */ ATTRIB(HealthMega, m_respawntime, float, GET(g_pickup_respawntime_health_mega)); +/* */ ATTRIB(HealthMega, m_respawntimejitter, float, GET(g_pickup_respawntimejitter_health_mega)); +/* pickupanyway */ ATTRIB(HealthMega, m_pickupanyway, float, GET(g_pickup_healthmega_anyway)); +/* iteminit */ ATTRIB(HealthMega, m_iteminit, void(Pickup this, entity item), item_healthmega_init); #endif +#ifdef MENUQC +METHOD(HealthMega, describe, string(HealthMega this)) +{ + TC(HealthMega, this); + return _("The Mega health restores a huge amount of health when picked up, " + "helping you recover from damage taken during combat\n\n" + "It tends to be one of the most highly contested items on a map, particularly in game modes like Duel"); } +#endif +ENDCLASS(HealthMega) +REGISTER_ITEM(HealthMega, NEW(HealthMega)); SPAWNFUNC_ITEM(item_health_mega, ITEM_HealthMega) diff --git a/qcsrc/common/items/item/jetpack.qh b/qcsrc/common/items/item/jetpack.qh index ba68c5363..88bc12d95 100644 --- a/qcsrc/common/items/item/jetpack.qh +++ b/qcsrc/common/items/item/jetpack.qh @@ -31,36 +31,34 @@ void powerup_jetpack_init(Pickup def, entity item) #endif CLASS(Jetpack, Powerup) -#ifdef MENUQC - METHOD(Jetpack, describe, string(Jetpack this)) - { - TC(Jetpack, this); - return _("The Jetpack allows you to fly around the map for a short period, " - "providing increased mobility, maneuverability, and the ability to reach higher ground\n\n" - "It consumes Fuel ammo while operating, so make sure you don't run out when you're high up!"); - } -#endif -ENDCLASS(Jetpack) - -REGISTER_ITEM(Jetpack, NEW(Jetpack)) { - this.m_canonical_spawnfunc = "item_jetpack"; +/* spawnfunc */ ATTRIB(Jetpack, m_canonical_spawnfunc, string, "item_jetpack"); #ifdef GAMEQC - this.spawnflags = ITEM_FLAG_NORMAL; - this.m_model = MDL_Jetpack_ITEM; - this.m_itemid = IT_JETPACK; -#endif - this.netname = "jetpack"; - this.m_name = _("Jetpack"); - this.m_icon = "jetpack"; - this.m_color = COLOR_ITEM_JETPACK; - this.m_waypoint = _("Jetpack"); - this.m_waypointblink = 2; +/* spawnflags */ ATTRIB(Jetpack, spawnflags, int, ITEM_FLAG_NORMAL); +/* model */ ATTRIB(Jetpack, m_model, Model, MDL_Jetpack_ITEM); +/* sound */ ATTRIB(Jetpack, m_itemid, Sound, IT_JETPACK); +#endif +/* refnmae */ ATTRIB(Jetpack, netname, string, "jetpack"); +/* itemname */ ATTRIB(Jetpack, m_name, string, _("Jetpack")); +/* icon */ ATTRIB(Jetpack, m_icon, string, "jetpack"); +/* color */ ATTRIB(Jetpack, m_color, vector, COLOR_ITEM_JETPACK); +/* wptext */ ATTRIB(Jetpack, m_waypoint, string, _("Jetpack")); +/* wpblink */ ATTRIB(Jetpack, m_waypointblink, int, 2); #ifdef SVQC - this.m_botvalue = 3000; - this.m_pickupevalfunc = ammo_pickupevalfunc; - this.m_iteminit = powerup_jetpack_init; +/* botvalue */ ATTRIB(Jetpack, m_botvalue, int, 3000); +/* pickupfunc */ ATTRIB(Jetpack, m_pickupevalfunc, float(entity player, entity item), ammo_pickupevalfunc); +/* iteminit */ ATTRIB(Jetpack, m_iteminit, void(Pickup this, entity item), powerup_jetpack_init); #endif +#ifdef MENUQC +METHOD(Jetpack, describe, string(Jetpack this)) +{ + TC(Jetpack, this); + return _("The Jetpack allows you to fly around the map for a short period, " + "providing increased mobility, maneuverability, and the ability to reach higher ground\n\n" + "It consumes Fuel ammo while operating, so make sure you don't run out when you're high up!"); } +#endif +ENDCLASS(Jetpack) +REGISTER_ITEM(Jetpack, NEW(Jetpack)); SPAWNFUNC_ITEM(item_jetpack, ITEM_Jetpack) @@ -69,16 +67,6 @@ SPAWNFUNC_ITEM(item_jetpack, ITEM_Jetpack) MODEL(JetpackFuel_ITEM, Item_Model("g_fuel.md3")); #endif -CLASS(JetpackFuel, Ammo) -#ifdef MENUQC - METHOD(JetpackFuel, describe, string(JetpackFuel this)) - { - TC(JetpackFuel, this); - return _("The Fuel ammo type is used by the Jetpack"); - } -#endif -ENDCLASS(JetpackFuel) - #ifdef SVQC PROPERTY(int, g_pickup_fuel); void ammo_fuel_init(Pickup this, entity item) @@ -87,21 +75,30 @@ void ammo_fuel_init(Pickup this, entity item) SetResourceExplicit(item, RES_FUEL, g_pickup_fuel); } #endif -REGISTER_ITEM(JetpackFuel, NEW(JetpackFuel)) { - this.m_canonical_spawnfunc = "item_fuel"; + +CLASS(JetpackFuel, Ammo) +/* spawnfunc */ ATTRIB(JetpackFuel, m_canonical_spawnfunc, string, "item_fuel"); #ifdef GAMEQC - this.spawnflags = ITEM_FLAG_NORMAL | ITEM_FLAG_RESOURCE; - this.m_model = MDL_JetpackFuel_ITEM; +/* spawnflags */ ATTRIB(JetpackFuel, spawnflags, int, ITEM_FLAG_NORMAL | ITEM_FLAG_RESOURCE); +/* model */ ATTRIB(JetpackFuel, m_model, Model, MDL_JetpackFuel_ITEM); #endif - this.netname = "fuel"; - this.m_name = _("Fuel"); - this.m_icon = "ammo_fuel"; +/* refname */ ATTRIB(JetpackFuel, netname, string, "fuel"); +/* itemname */ ATTRIB(JetpackFuel, m_name, string, _("Fuel")); +/* icon */ ATTRIB(JetpackFuel, m_icon, string, "ammo_fuel"); #ifdef SVQC - this.m_botvalue = 2000; - this.m_itemid = IT_RESOURCE; - this.m_iteminit = ammo_fuel_init; +/* botvlaue */ ATTRIB(JetpackFuel, m_botvalue, int, 2000); +/* itemid */ ATTRIB(JetpackFuel, m_itemid, int, IT_RESOURCE); +/* iteminit */ ATTRIB(JetpackFuel, m_iteminit, void(Pickup this, entity item), ammo_fuel_init); #endif +#ifdef MENUQC +METHOD(JetpackFuel, describe, string(JetpackFuel this)) +{ + TC(JetpackFuel, this); + return _("The Fuel ammo type is used by the Jetpack"); } +#endif +ENDCLASS(JetpackFuel) +REGISTER_ITEM(JetpackFuel, NEW(JetpackFuel)); SPAWNFUNC_ITEM(item_fuel, ITEM_JetpackFuel) @@ -120,35 +117,33 @@ void powerup_fuelregen_init(Pickup def, entity item) #endif CLASS(JetpackRegen, Powerup) -#ifdef MENUQC - METHOD(JetpackRegen, describe, string(JetpackRegen this)) - { - TC(JetpackRegen, this); - return _("The Fuel Regenerator powerup regenerates Fuel needed for the Jetpack until the powerup expires, " - "so you can continue flying around for longer" - "Since it is a powerup, it will drop if you die while holding it"); - } -#endif -ENDCLASS(JetpackRegen) - -REGISTER_ITEM(JetpackRegen, NEW(JetpackRegen)) { - this.m_canonical_spawnfunc = "item_fuel_regen"; +/* spawnfunc */ ATTRIB(JetpackRegen, m_canonical_spawnfunc, string, "item_fuel_regen"); #ifdef GAMEQC - this.spawnflags = ITEM_FLAG_NORMAL; - this.m_model = MDL_JetpackRegen_ITEM; -#endif - this.netname = "fuel_regen"; - this.m_name = _("Fuel regenerator"); - this.m_icon = "fuelregen"; - this.m_color = COLOR_POWERUP_JETPACKREGEN; - this.m_waypoint = _("Fuel regen"); - this.m_waypointblink = 2; +/* spawnflags */ ATTRIB(JetpackRegen, spawnflags, int, ITEM_FLAG_NORMAL); +/* model */ ATTRIB(JetpackRegen, m_model, Model, MDL_JetpackRegen_ITEM); +#endif +/* refname */ ATTRIB(JetpackRegen, netname, string, "fuel_regen"); +/* itemname */ ATTRIB(JetpackRegen, m_name, string, _("Fuel regenerator")); +/* icon */ ATTRIB(JetpackRegen, m_icon, string, "fuelregen"); +/* color */ ATTRIB(JetpackRegen, m_color, vector, COLOR_POWERUP_JETPACKREGEN); +/* wptext */ ATTRIB(JetpackRegen, m_waypoint, string, _("Fuel regen")); +/* wpblink */ ATTRIB(JetpackRegen, m_waypointblink, int, 2); #ifdef SVQC - this.m_botvalue = 3000; - this.m_itemid = IT_FUEL_REGEN; - this.m_pickupevalfunc = ammo_pickupevalfunc; - this.m_iteminit = powerup_fuelregen_init; +/* botvalue */ ATTRIB(JetpackRegen, m_botvalue, int, 3000); +/* itemid */ ATTRIB(JetpackRegen, m_itemid, int, IT_FUEL_REGEN); +/* pickupfunc */ ATTRIB(JetpackRegen, m_pickupevalfunc, float(entity player, entity item), ammo_pickupevalfunc); +/* iteminit */ ATTRIB(JetpackRegen, m_iteminit, void(Pickup this, entity item), powerup_fuelregen_init); #endif +#ifdef MENUQC +METHOD(JetpackRegen, describe, string(JetpackRegen this)) +{ + TC(JetpackRegen, this); + return _("The Fuel Regenerator powerup regenerates Fuel needed for the Jetpack until the powerup expires, " + "so you can continue flying around for longer" + "Since it is a powerup, it will drop if you die while holding it"); } +#endif +ENDCLASS(JetpackRegen) +REGISTER_ITEM(JetpackRegen, NEW(JetpackRegen)); SPAWNFUNC_ITEM(item_fuel_regen, ITEM_JetpackRegen) diff --git a/qcsrc/common/mutators/mutator/instagib/items.qh b/qcsrc/common/mutators/mutator/instagib/items.qh index 6e893baaf..2182b491d 100644 --- a/qcsrc/common/mutators/mutator/instagib/items.qh +++ b/qcsrc/common/mutators/mutator/instagib/items.qh @@ -3,6 +3,7 @@ #include #include #include +#include float instagib_respawntime_ammo = 45; float instagib_respawntimejitter_ammo = 0; @@ -24,33 +25,31 @@ void ammo_vaporizercells_init(Pickup this, entity item) #endif CLASS(VaporizerCells, Ammo) -#ifdef MENUQC - METHOD(VaporizerCells, describe, string(VaporizerCells this)) - { - TC(VaporizerCells, this); - return _("The Vaporizer ammo is sometimes present on maps when InstaGib is enabled, providing ammo for the Vaporizer"); - } -#endif -ENDCLASS(VaporizerCells) - -REGISTER_ITEM(VaporizerCells, NEW(VaporizerCells)) { - this.m_canonical_spawnfunc = "item_vaporizer_cells"; +/* spawnfunc */ ATTRIB(VaporizerCells, m_canonical_spawnfunc, string, "item_vaporizer_cells"); #ifdef GAMEQC - this.spawnflags = ITEM_FLAG_MUTATORBLOCKED; - this.m_model = MDL_VaporizerCells_ITEM; - this.m_sound = SND_VaporizerCells; +/* spawnflags */ ATTRIB(VaporizerCells, spawnflags, int, ITEM_FLAG_MUTATORBLOCKED); +/* model */ ATTRIB(VaporizerCells, m_model, Model, MDL_VaporizerCells_ITEM); +/* sound */ ATTRIB(VaporizerCells, m_sound, Sound, SND_VaporizerCells); #endif - this.netname = "vaporizer_cells"; - this.m_name = _("Vaporizer ammo"); - this.m_icon = "ammo_supercells"; +/* refname */ ATTRIB(VaporizerCells, netname, string, "vaporizer_cells"); +/* itemname */ ATTRIB(VaporizerCells, m_name, string, _("Vaporizer ammo")); +/* icon */ ATTRIB(VaporizerCells, m_icon, string, "ammo_supercells"); #ifdef SVQC - this.m_botvalue = 2000; - this.m_itemid = IT_RESOURCE; - this.m_respawntime = GET(instagib_respawntime_ammo); - this.m_respawntimejitter = GET(instagib_respawntimejitter_ammo); - this.m_iteminit = ammo_vaporizercells_init; +/* botvalue */ ATTRIB(VaporizerCells, m_botvalue, int, 2000); +/* itemid */ ATTRIB(VaporizerCells, m_itemid, int, IT_RESOURCE); +/* respawntime */ ATTRIB(VaporizerCells, m_respawntime, float, GET(instagib_respawntime_ammo)); +/* */ ATTRIB(VaporizerCells, m_respawntimejitter, float, GET(instagib_respawntimejitter_ammo)); +/* iteminit */ ATTRIB(VaporizerCells, m_iteminit, void(Pickup this, entity item), ammo_vaporizercells_init); #endif +#ifdef MENUQC +METHOD(VaporizerCells, describe, string(VaporizerCells this)) +{ + TC(VaporizerCells, this); + return _("The Vaporizer ammo is sometimes present on maps when InstaGib is enabled, providing ammo for the Vaporizer"); } +#endif +ENDCLASS(VaporizerCells) +REGISTER_ITEM(VaporizerCells, NEW(VaporizerCells)); SPAWNFUNC_ITEM(item_vaporizer_cells, ITEM_VaporizerCells) SPAWNFUNC_ITEM(item_minst_cells, ITEM_VaporizerCells) @@ -61,31 +60,29 @@ SOUND(ExtraLife, Item_Sound("megahealth")); #endif CLASS(ExtraLife, Powerup) -#ifdef MENUQC - METHOD(ExtraLife, describe, string(ExtraLife this)) - { - TC(ExtraLife, this); - return _("The Extra Life powerup acts as armor in InstaGib. " - "If a player is shot while having one or more Extra Lives, they will survive the shot but suffer strong knockback"); - } -#endif -ENDCLASS(ExtraLife) - -REGISTER_ITEM(ExtraLife, NEW(ExtraLife)) { - this.m_canonical_spawnfunc = "item_extralife"; +/* spawnfunc */ ATTRIB(ExtraLife, m_canonical_spawnfun, string, "item_extralife"); #ifdef GAMEQC - this.m_model = MDL_ExtraLife_ITEM; - this.m_sound = SND_ExtraLife; +/* model */ ATTRIB(ExtraLife, m_model, Model, MDL_ExtraLife_ITEM); +/* sound */ ATTRIB(ExtraLife, m_sound, Sound, SND_ExtraLife); #endif - this.netname = "extralife"; - this.m_name = _("Extra life"); - this.m_icon = "item_mega_health"; - this.m_color = '1 0 0'; - this.m_waypoint = _("Extra life"); - this.m_waypointblink = 2; +/* refname */ ATTRIB(ExtraLife, netname, string, "extralife"); +/* itemname */ ATTRIB(ExtraLife, m_name, string, _("Extra life")); +/* icon */ ATTRIB(ExtraLife, m_icon, string, "item_mega_health"); +/* color */ ATTRIB(ExtraLife, m_color, vector, COLOR_POWERUP_EXTRALIFE); +/* wptext */ ATTRIB(ExtraLife, m_waypoint, string, _("Extra life")); +/* wpblink */ ATTRIB(ExtraLife, m_waypointblink, int, 2); #ifdef SVQC - this.m_itemid = IT_RESOURCE; +/* itemid */ ATTRIB(ExtraLife, m_itemid, int, IT_RESOURCE); #endif +#ifdef MENUQC +METHOD(ExtraLife, describe, string(ExtraLife this)) +{ + TC(ExtraLife, this); + return _("The Extra Life powerup acts as armor in InstaGib. " + "If a player is shot while having one or more Extra Lives, they will survive the shot but suffer strong knockback"); } +#endif +ENDCLASS(ExtraLife) +REGISTER_ITEM(ExtraLife, NEW(ExtraLife)); SPAWNFUNC_ITEM(item_extralife, ITEM_ExtraLife) diff --git a/qcsrc/common/mutators/mutator/nades/nades.inc b/qcsrc/common/mutators/mutator/nades/nades.inc index fb416ce29..902ad6522 100644 --- a/qcsrc/common/mutators/mutator/nades/nades.inc +++ b/qcsrc/common/mutators/mutator/nades/nades.inc @@ -8,6 +8,9 @@ MACRO_END #endif CLASS(NormalNade, Nade) + ATTRIB(NormalNade, m_color, vector, COLOR_NADE_NORMAL); + ATTRIB(NormalNade, m_name, string, _("Grenade")); + ATTRIB(NormalNade, m_icon, string, "nade_normal"); #ifdef MENUQC METHOD(NormalNade, describe, string(NormalNade this)) { @@ -18,7 +21,6 @@ CLASS(NormalNade, Nade) #endif ENDCLASS(NormalNade) REGISTER_NADE(NORMAL, NEW(NormalNade)) { - this.m_color = COLOR_NADE_NORMAL; #ifdef GAMEQC NADE_PROJECTILE(0, PROJECTILE_NADE, EFFECT_Null); NADE_PROJECTILE(1, PROJECTILE_NADE_BURN, EFFECT_Null); @@ -26,6 +28,9 @@ REGISTER_NADE(NORMAL, NEW(NormalNade)) { } CLASS(NapalmNade, Nade) + ATTRIB(NapalmNade, m_color, vector, COLOR_NADE_NAPALM); + ATTRIB(NapalmNade, m_name, string, _("Napalm grenade")); + ATTRIB(NapalmNade, m_icon, string, "nade_napalm"); #ifdef MENUQC METHOD(NapalmNade, describe, string(NapalmNade this)) { @@ -36,9 +41,6 @@ CLASS(NapalmNade, Nade) #endif ENDCLASS(NapalmNade) REGISTER_NADE(NAPALM, NEW(NapalmNade)) { - this.m_color = COLOR_NADE_NAPALM; - this.m_name = _("Napalm grenade"); - this.m_icon = "nade_napalm"; #ifdef GAMEQC NADE_PROJECTILE(0, PROJECTILE_NADE_NAPALM, EFFECT_TR_ROCKET); NADE_PROJECTILE(1, PROJECTILE_NADE_NAPALM_BURN, EFFECT_SPIDERBOT_ROCKET_TRAIL); @@ -46,6 +48,9 @@ REGISTER_NADE(NAPALM, NEW(NapalmNade)) { } CLASS(IceNade, Nade) + ATTRIB(IceNade, m_color, vector, COLOR_NADE_ICE); + ATTRIB(IceNade, m_name, string, _("Ice grenade")); + ATTRIB(IceNade, m_icon, string, "nade_ice"); #ifdef MENUQC METHOD(IceNade, describe, string(IceNade this)) { @@ -56,9 +61,6 @@ CLASS(IceNade, Nade) #endif ENDCLASS(IceNade) REGISTER_NADE(ICE, NEW(IceNade)) { - this.m_color = COLOR_NADE_ICE; - this.m_name = _("Ice grenade"); - this.m_icon = "nade_ice"; #ifdef GAMEQC NADE_PROJECTILE(0, PROJECTILE_NADE_ICE, EFFECT_TR_NEXUIZPLASMA); NADE_PROJECTILE(1, PROJECTILE_NADE_ICE_BURN, EFFECT_RACER_ROCKET_TRAIL); @@ -66,6 +68,9 @@ REGISTER_NADE(ICE, NEW(IceNade)) { } CLASS(TranslocateNade, Nade) + ATTRIB(TranslocateNade, m_color, vector, COLOR_NADE_TRANSLOCATE); + ATTRIB(TranslocateNade, m_name, string, _("Translocate grenade")); + ATTRIB(TranslocateNade, m_icon, string, "nade_translocate"); #ifdef MENUQC METHOD(TranslocateNade, describe, string(TranslocateNade this)) { @@ -75,9 +80,6 @@ CLASS(TranslocateNade, Nade) #endif ENDCLASS(TranslocateNade) REGISTER_NADE(TRANSLOCATE, NEW(TranslocateNade)) { - this.m_color = COLOR_NADE_TRANSLOCATE; - this.m_name = _("Translocate grenade"); - this.m_icon = "nade_translocate"; #ifdef GAMEQC NADE_PROJECTILE(0, PROJECTILE_NADE_TRANSLOCATE, EFFECT_TR_CRYLINKPLASMA); NADE_PROJECTILE(1, PROJECTILE_NADE_TRANSLOCATE, EFFECT_TR_CRYLINKPLASMA); @@ -85,6 +87,9 @@ REGISTER_NADE(TRANSLOCATE, NEW(TranslocateNade)) { } CLASS(SpawnNade, Nade) + ATTRIB(SpawnNade, m_color, vector, COLOR_NADE_SPAWN); + ATTRIB(SpawnNade, m_name, string, _("Spawn grenade")); + ATTRIB(SpawnNade, m_icon, string, "nade_spawn"); #ifdef MENUQC METHOD(SpawnNade, describe, string(SpawnNade this)) { @@ -95,9 +100,6 @@ CLASS(SpawnNade, Nade) #endif ENDCLASS(SpawnNade) REGISTER_NADE(SPAWN, NEW(SpawnNade)) { - this.m_color = COLOR_NADE_SPAWN; - this.m_name = _("Spawn grenade"); - this.m_icon = "nade_spawn"; #ifdef GAMEQC NADE_PROJECTILE(0, PROJECTILE_NADE_SPAWN, EFFECT_NADE_TRAIL_YELLOW); NADE_PROJECTILE(1, PROJECTILE_NADE_SPAWN, EFFECT_NADE_TRAIL_YELLOW); @@ -105,6 +107,9 @@ REGISTER_NADE(SPAWN, NEW(SpawnNade)) { } CLASS(HealNade, Nade) + ATTRIB(HealNade, m_color, vector, COLOR_NADE_HEAL); + ATTRIB(HealNade, m_name, string, _("Heal grenade")); + ATTRIB(HealNade, m_icon, string, "nade_heal"); #ifdef MENUQC METHOD(HealNade, describe, string(HealNade this)) { @@ -115,9 +120,6 @@ CLASS(HealNade, Nade) #endif ENDCLASS(HealNade) REGISTER_NADE(HEAL, NEW(HealNade)) { - this.m_color = COLOR_NADE_HEAL; - this.m_name = _("Heal grenade"); - this.m_icon = "nade_heal"; #ifdef GAMEQC NADE_PROJECTILE(0, PROJECTILE_NADE_HEAL, EFFECT_NADE_TRAIL_RED); NADE_PROJECTILE(1, PROJECTILE_NADE_HEAL_BURN, EFFECT_NADE_TRAIL_BURN_RED); @@ -125,6 +127,9 @@ REGISTER_NADE(HEAL, NEW(HealNade)) { } CLASS(MonsterNade, Nade) + ATTRIB(MonsterNade, m_color, vector, COLOR_NADE_MONSTER); + ATTRIB(MonsterNade, m_name, string, _("Monster grenade")); + ATTRIB(MonsterNade, m_icon, string, "nade_monster"); #ifdef MENUQC METHOD(MonsterNade, describe, string(MonsterNade this)) { @@ -134,9 +139,6 @@ CLASS(MonsterNade, Nade) #endif ENDCLASS(MonsterNade) REGISTER_NADE(MONSTER, NEW(MonsterNade)) { - this.m_color = COLOR_NADE_MONSTER; - this.m_name = _("Monster grenade"); - this.m_icon = "nade_monster"; #ifdef GAMEQC NADE_PROJECTILE(0, PROJECTILE_NADE_MONSTER, EFFECT_NADE_TRAIL_RED); NADE_PROJECTILE(1, PROJECTILE_NADE_MONSTER_BURN, EFFECT_NADE_TRAIL_BURN_RED); @@ -144,6 +146,9 @@ REGISTER_NADE(MONSTER, NEW(MonsterNade)) { } CLASS(EntrapNade, Nade) + ATTRIB(EntrapNade, m_color, vector, COLOR_NADE_ENTRAP); + ATTRIB(EntrapNade, m_name, string, _("Entrap grenade")); + ATTRIB(EntrapNade, m_icon, string, "nade_entrap"); #ifdef MENUQC METHOD(EntrapNade, describe, string(EntrapNade this)) { @@ -154,9 +159,6 @@ CLASS(EntrapNade, Nade) #endif ENDCLASS(EntrapNade) REGISTER_NADE(ENTRAP, NEW(EntrapNade)) { - this.m_color = COLOR_NADE_ENTRAP; - this.m_name = _("Entrap grenade"); - this.m_icon = "nade_entrap"; #ifdef GAMEQC NADE_PROJECTILE(0, PROJECTILE_NADE_ENTRAP, EFFECT_NADE_TRAIL_YELLOW); NADE_PROJECTILE(1, PROJECTILE_NADE_ENTRAP_BURN, EFFECT_NADE_TRAIL_BURN_YELLOW); @@ -164,6 +166,10 @@ REGISTER_NADE(ENTRAP, NEW(EntrapNade)) { } CLASS(VeilNade, Nade) + ATTRIB(VeilNade, m_color, vector, COLOR_NADE_VEIL); + ATTRIB(VeilNade, m_name, string, _("Veil grenade")); + ATTRIB(VeilNade, m_icon, string, "nade_veil"); + ATTRIB(VeilNade, m_alpha, float, 0.45); #ifdef MENUQC METHOD(VeilNade, describe, string(VeilNade this)) { @@ -174,10 +180,6 @@ CLASS(VeilNade, Nade) #endif ENDCLASS(VeilNade) REGISTER_NADE(VEIL, NEW(VeilNade)) { - this.m_color = COLOR_NADE_VEIL; - this.m_name = _("Veil grenade"); - this.m_icon = "nade_veil"; - this.m_alpha = 0.45; #ifdef GAMEQC NADE_PROJECTILE(0, PROJECTILE_NADE_VEIL, EFFECT_NADE_TRAIL_NEUTRAL); NADE_PROJECTILE(1, PROJECTILE_NADE_VEIL_BURN, EFFECT_NADE_TRAIL_BURN_NEUTRAL); @@ -185,6 +187,9 @@ REGISTER_NADE(VEIL, NEW(VeilNade)) { } CLASS(AmmoNade, Nade) + ATTRIB(AmmoNade, m_color, vector, COLOR_NADE_AMMO); + ATTRIB(AmmoNade, m_name, string, _("Ammo grenade")); + ATTRIB(AmmoNade, m_icon, string, "nade_ammo"); #ifdef MENUQC METHOD(AmmoNade, describe, string(AmmoNade this)) { @@ -196,9 +201,6 @@ CLASS(AmmoNade, Nade) #endif ENDCLASS(AmmoNade) REGISTER_NADE(AMMO, NEW(AmmoNade)) { - this.m_color = COLOR_NADE_AMMO; - this.m_name = _("Ammo grenade"); - this.m_icon = "nade_ammo"; #ifdef GAMEQC NADE_PROJECTILE(0, PROJECTILE_NADE_AMMO, EFFECT_NADE_TRAIL_BROWN); NADE_PROJECTILE(1, PROJECTILE_NADE_AMMO_BURN, EFFECT_NADE_TRAIL_BURN_BROWN); @@ -206,6 +208,9 @@ REGISTER_NADE(AMMO, NEW(AmmoNade)) { } CLASS(DarknessNade, Nade) + ATTRIB(DarknessNade, m_color, vector, COLOR_NADE_DARKNESS); + ATTRIB(DarknessNade, m_name, string, _("Darkness grenade")); + ATTRIB(DarknessNade, m_icon, string, "nade_darkness"); #ifdef MENUQC METHOD(DarknessNade, describe, string(DarknessNade this)) { @@ -215,9 +220,6 @@ CLASS(DarknessNade, Nade) #endif ENDCLASS(DarknessNade) REGISTER_NADE(DARKNESS, NEW(DarknessNade)) { - this.m_color = COLOR_NADE_DARKNESS; - this.m_name = _("Darkness grenade"); - this.m_icon = "nade_darkness"; #ifdef GAMEQC NADE_PROJECTILE(0, PROJECTILE_NADE_DARKNESS, EFFECT_NADE_TRAIL_PURPLE); NADE_PROJECTILE(1, PROJECTILE_NADE_DARKNESS_BURN, EFFECT_NADE_TRAIL_BURN_PURPLE); -- 2.39.2