X-Git-Url: https://git.xonotic.org/?a=blobdiff_plain;f=qcsrc%2Fcommon%2Fitems%2Fitem%2Fjetpack.qc;h=11b9d924309d32e5e666c38827ae841dce043ae3;hb=b661d07fc75cd9448da4fe89af98b426b4e94c7f;hp=9ff4ed05cbcd344a30433c27a4b562a8717b16a5;hpb=6e12e42c14caa13f188ad12ce1fce1358428bee4;p=xonotic%2Fxonotic-data.pk3dir.git diff --git a/qcsrc/common/items/item/jetpack.qc b/qcsrc/common/items/item/jetpack.qc index 9ff4ed05c..11b9d9243 100644 --- a/qcsrc/common/items/item/jetpack.qc +++ b/qcsrc/common/items/item/jetpack.qc @@ -1,56 +1,23 @@ -#ifdef SVQC - #include "../../../server/t_items.qh" - #include "../../../server/constants.qh" -#endif - -#define WITH(it) this.m_##it; -#define CONFIGURE(...) MAP(WITH, __VA_ARGS__) -#define DEFINE(id, ...) REGISTER_ITEM(id, Pickup, UNWORDS(__VA_ARGS__)) +#include "jetpack.qh" -DEFINE(Jetpack - ,APPLY(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) - ) -) +#ifdef SVQC -DEFINE(JetpackFuel - ,APPLY(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) - ) -) +METHOD(Jetpack, m_spawnfunc_hookreplace, GameItem(Jetpack this, entity e)) +{ + if(start_items & ITEM_Jetpack.m_itemid) + { + return ITEM_JetpackFuel; + } + return this; +} -DEFINE(JetpackRegen - ,APPLY(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) - ) -) +METHOD(JetpackRegen, m_spawnfunc_hookreplace, GameItem(JetpackRegen this, entity e)) +{ + if (start_items & ITEM_JetpackRegen.m_itemid) + { + return ITEM_JetpackFuel; + } + return this; +} -#undef WITH -#undef CONFIGURE -#undef DEFINE +#endif