X-Git-Url: http://de.git.xonotic.org/?a=blobdiff_plain;f=qcsrc%2Fcommon%2Fitems%2Fitem.qh;h=b7fc933e8b5dbaf35dde8a37fca1762c51a4e08a;hb=88e815808cb794930e7a0d6257cfdb8b3456a9a1;hp=c302ae40281d43699b335ab24a7d382b7d3d667e;hpb=81062a39c99785039ceee2dcd187fed9352a08c5;p=xonotic%2Fxonotic-data.pk3dir.git diff --git a/qcsrc/common/items/item.qh b/qcsrc/common/items/item.qh index c302ae402..b7fc933e8 100644 --- a/qcsrc/common/items/item.qh +++ b/qcsrc/common/items/item.qh @@ -1,9 +1,10 @@ #pragma once -#include #ifdef GAMEQC +#include #include #include +#include #endif const int IT_UNLIMITED_WEAPON_AMMO = BIT(0); // when this bit is set, using a weapon does not reduce ammo. Checkpoints can give this powerup. @@ -45,11 +46,30 @@ const int IT_PICKUPMASK = IT_UNLIMITED_AMMO | IT_JETPACK | IT_FU #ifdef SVQC .float strength_finished = _STAT(STRENGTH_FINISHED); .float invincible_finished = _STAT(INVINCIBLE_FINISHED); + +#define SPAWNFUNC_ITEM(name, item) \ + spawnfunc(name) { StartItem(this, item); } + +#else + +#define SPAWNFUNC_ITEM(name, item) + #endif +enum +{ + ITEM_FLAG_NORMAL = BIT(0), ///< Item is usable during normal gameplay. + ITEM_FLAG_INSTAGIB = BIT(1), ///< Item is usable in instagib. + ITEM_FLAG_OVERKILL = BIT(2), ///< Item is usable in overkill. + ITEM_FLAG_MUTATORBLOCKED = BIT(3) +}; + #define ITEM_HANDLE(signal, ...) __Item_Send_##signal(__VA_ARGS__) CLASS(GameItem, Object) ATTRIB(GameItem, m_id, int, 0); + /** the canonical spawnfunc name */ + ATTRIB(GameItem, m_canonical_spawnfunc, string); + METHOD(GameItem, m_spawnfunc_hookreplace, GameItem(GameItem this, entity e)) { return this; } ATTRIB(GameItem, m_name, string); ATTRIB(GameItem, m_icon, string); ATTRIB(GameItem, m_color, vector, '1 1 1');