X-Git-Url: https://de.git.xonotic.org/?a=blobdiff_plain;f=qcsrc%2Fcommon%2Fitems%2Fitem%2Fammo.qc;h=2d487a7b51be6723a030f44af5e14d5997da9883;hb=08e6497842b33529d0c1b0caa431b49ca98d79da;hp=032fcc3feaaca2c43187d1815d0691f92241c12a;hpb=fc62dfa34fa5b13d63660d5249633af1222d6476;p=xonotic%2Fxonotic-data.pk3dir.git diff --git a/qcsrc/common/items/item/ammo.qc b/qcsrc/common/items/item/ammo.qc index 032fcc3fe..2d487a7b5 100644 --- a/qcsrc/common/items/item/ammo.qc +++ b/qcsrc/common/items/item/ammo.qc @@ -3,68 +3,48 @@ #include "../../../server/t_items.qh" #endif -#define WITH(it) this.m_##it; -#define CONFIGURE(...) MAP(WITH, __VA_ARGS__) -#define DEFINE(id, ...) \ - REGISTER_ITEM(id, Ammo, LAMBDA( \ - IF(SV, CONFIGURE \ - , respawntime = GET(g_pickup_respawntime_ammo) \ - , respawntimejitter = GET(g_pickup_respawntimejitter_ammo) \ - ) \ - UNWORDS(__VA_ARGS__) \ - )) - -DEFINE(Bullets - ,APPLY(CONFIGURE - , model = "models/items/a_bullets.mdl" - , name = "bullets" - ) - ,IF(SV, CONFIGURE - , botvalue = 2000 - , itemid = IT_NAILS - ) -) -DEFINE(Cells - ,APPLY(CONFIGURE - , model = "models/items/a_cells.md3" - , name = "cells" - ) - ,IF(SV, CONFIGURE - , botvalue = 2000 - , itemid = IT_CELLS - ) -) -DEFINE(Plasma - ,APPLY(CONFIGURE - , model = "models/items/a_cells.md3" - , name = "plasma" - ) - ,IF(SV, CONFIGURE - , botvalue = 2000 - , itemid = IT_PLASMA - ) -) -DEFINE(Rockets - ,APPLY(CONFIGURE - , model = "models/items/a_rockets.md3" - , name = "rockets" - ) - ,IF(SV, CONFIGURE - , botvalue = 3000 - , itemid = IT_ROCKETS - ) -) -DEFINE(Shells - ,APPLY(CONFIGURE - , model = "models/items/a_shells.md3" - , name = "shells" - ) - ,IF(SV, CONFIGURE - , botvalue = 500 - , itemid = IT_SHELLS - ) -) - -#undef WITH -#undef CONFIGURE -#undef DEFINE +REGISTER_ITEM(Bullets, Ammo) { + this.m_model = "a_bullets.mdl"; + this.m_name = "bullets"; + this.m_icon = "ammo_bullets"; +#ifdef SVQC + this.m_botvalue = 2000; + this.m_itemid = IT_NAILS; +#endif +} +REGISTER_ITEM(Cells, Ammo) { + this.m_model = "a_cells.md3"; + this.m_name = "cells"; + this.m_icon = "ammo_cells"; +#ifdef SVQC + this.m_botvalue = 2000; + this.m_itemid = IT_CELLS; +#endif +} +REGISTER_ITEM(Plasma, Ammo) { + this.m_model = "a_cells.md3"; + this.m_name = "plasma"; + this.m_icon = "ammo_plasma"; +#ifdef SVQC + this.m_botvalue = 2000; + this.m_itemid = IT_PLASMA; +#endif +} +REGISTER_ITEM(Rockets, Ammo) { + this.m_model = "a_rockets.md3"; + this.m_name = "rockets"; + this.m_icon = "ammo_rockets"; +#ifdef SVQC + this.m_botvalue = 3000; + this.m_itemid = IT_ROCKETS; +#endif +} +REGISTER_ITEM(Shells, Ammo) { + this.m_model = "a_shells.md3"; + this.m_name = "shells"; + this.m_icon = "ammo_shells"; +#ifdef SVQC + this.m_botvalue = 500; + this.m_itemid = IT_SHELLS; +#endif +}