X-Git-Url: http://git.xonotic.org/?a=blobdiff_plain;f=qcsrc%2Fcommon%2Fitems%2Fitem%2Fjetpack.qc;h=25dd9b131c2aadaeedf31117aebec7a63531bc06;hb=ae2c1407ec9a05e4f501a6604a7cce8e1030df9f;hp=d130b06cf52a4002b891385b3f7b453d18fd0eb1;hpb=ac7f397ceff9390594c5d9d331449192ba07f6f8;p=xonotic%2Fxonotic-data.pk3dir.git diff --git a/qcsrc/common/items/item/jetpack.qc b/qcsrc/common/items/item/jetpack.qc index d130b06cf..25dd9b131 100644 --- a/qcsrc/common/items/item/jetpack.qc +++ b/qcsrc/common/items/item/jetpack.qc @@ -3,54 +3,38 @@ #include "../../../server/constants.qh" #endif -#define WITH(it) this.m_##it; -#define CONFIGURE(...) MAP(WITH, __VA_ARGS__) -#define DEFINE(id, ...) REGISTER_ITEM(id, Pickup, MAP(IDENTITY, __VA_ARGS__)) +#include "ammo.qh" +#include "powerup.qh" -DEFINE(Jetpack - ,IF(ALL, CONFIGURE - , model = "models/items/g_jetpack.md3" - , name = "Jet pack" - ) - ,IF(SV, CONFIGURE - , botvalue = BOT_PICKUP_RATING_LOW - , itemflags = FL_POWERUP - , itemid = IT_JETPACK - , pickupevalfunc = commodity_pickupevalfunc - , respawntime = GET(g_pickup_respawntime_powerup) - , respawntimejitter = GET(g_pickup_respawntimejitter_powerup) - ) -) - -DEFINE(JetpackFuel - ,IF(ALL, CONFIGURE - , model = "models/items/g_fuel.md3" - , name = "Fuel" - ) - ,IF(SV, CONFIGURE - , botvalue = BOT_PICKUP_RATING_LOW - , itemid = IT_FUEL - , pickupevalfunc = commodity_pickupevalfunc - , respawntime = GET(g_pickup_respawntime_ammo) - , respawntimejitter = GET(g_pickup_respawntimejitter_ammo) - ) -) +REGISTER_ITEM(Jetpack, Powerup) { + this.m_model = "models/items/g_jetpack.md3"; + this.m_name = "Jet pack"; +#ifdef SVQC + this.m_botvalue = BOT_PICKUP_RATING_LOW; + this.m_itemid = IT_JETPACK; + this.m_pickupevalfunc = commodity_pickupevalfunc; +#endif +} -DEFINE(JetpackRegen - ,IF(ALL, CONFIGURE - , model = "models/items/g_fuelregen.md3" - , name = "Fuel regenerator" - ) - ,IF(SV, CONFIGURE - , botvalue = BOT_PICKUP_RATING_LOW - , itemflags = FL_POWERUP - , itemid = IT_FUEL_REGEN - , pickupevalfunc = commodity_pickupevalfunc - , respawntime = GET(g_pickup_respawntime_powerup) - , respawntimejitter = GET(g_pickup_respawntimejitter_powerup) - ) -) +REGISTER_ITEM(JetpackFuel, Ammo) { + this.m_model = "models/items/g_fuel.md3"; + this.m_name = "Fuel"; + this.m_ammoPic = "ammo_fuel"; +#ifdef SVQC + this.m_botvalue = BOT_PICKUP_RATING_LOW; + this.m_itemid = IT_FUEL; +#endif +} -#undef WITH -#undef CONFIGURE -#undef DEFINE +REGISTER_ITEM(JetpackRegen, Pickup) { + this.m_model = "models/items/g_fuelregen.md3"; + this.m_name = "Fuel regenerator"; +#ifdef SVQC + this.m_botvalue = BOT_PICKUP_RATING_LOW; + this.m_itemflags = FL_POWERUP; + this.m_itemid = IT_FUEL_REGEN; + this.m_pickupevalfunc = commodity_pickupevalfunc; + this.m_respawntime = GET(g_pickup_respawntime_powerup); + this.m_respawntimejitter = GET(g_pickup_respawntimejitter_powerup); +#endif +}