X-Git-Url: https://de.git.xonotic.org/?a=blobdiff_plain;f=qcsrc%2Fcommon%2Fitems%2Fitem%2Fammo.qc;h=2d487a7b51be6723a030f44af5e14d5997da9883;hb=2718fac2d710f2c4e63a6de3cfe0ffc66dc7d6a3;hp=7267f8d07288729a89d3c60429334372e62094f5;hpb=f604d84f61f6db78cf9cb7c3cc6b9cfe7f14278f;p=xonotic%2Fxonotic-data.pk3dir.git diff --git a/qcsrc/common/items/item/ammo.qc b/qcsrc/common/items/item/ammo.qc index 7267f8d07..2d487a7b5 100644 --- a/qcsrc/common/items/item/ammo.qc +++ b/qcsrc/common/items/item/ammo.qc @@ -1,73 +1,50 @@ #include "ammo.qh" -#include "../../../server/t_items.qh" +#ifdef SVQC + #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 = g_pickup_respawntime_ammo \ - , respawntimejitter = g_pickup_respawntimejitter_ammo \ - ) \ - MAP(IDENTITY, __VA_ARGS__) \ - )) - -DEFINE(Bullets - ,IF(ALL, CONFIGURE - , model = "models/items/a_bullets.mdl" - , sound = "misc/itempickup.wav" - , name = "bullets" - , itemid = IT_NAILS - ) - ,IF(SV, CONFIGURE - , botvalue = 2000 - ) -) -DEFINE(Cells - ,IF(ALL, CONFIGURE - , model = "models/items/a_cells.md3" - , sound = "misc/itempickup.wav" - , name = "cells" - , itemid = IT_ROCKETS - ) - ,IF(SV, CONFIGURE - , botvalue = 2000 - ) -) -DEFINE(Plasma - ,IF(ALL, CONFIGURE - , model = "models/items/a_cells.md3" - , sound = "misc/itempickup.wav" - , name = "plasma" - , itemid = IT_ROCKETS - ) - ,IF(SV, CONFIGURE - , botvalue = 2000 - ) -) -DEFINE(Rockets - ,IF(ALL, CONFIGURE - , model = "models/items/a_rockets.md3" - , sound = "misc/itempickup.wav" - , name = "rockets" - , itemid = IT_ROCKETS - ) - ,IF(SV, CONFIGURE - , botvalue = 3000 - ) -) -DEFINE(Shells - ,IF(ALL, CONFIGURE - , model = "models/items/a_shells.md3" - , sound = "misc/itempickup.wav" - , name = "shells" - , itemid = IT_SHELLS - ) - ,IF(SV, CONFIGURE - , botvalue = 500 - ) -) - -#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 +}