#endif
-enum {
- ITEM_FLAG_MUTATORBLOCKED = BIT(0)
+enum
+{
+ ITEM_FLAG_INSTAGIB = BIT(0), ///< Item is usable in instagib.
+ ITEM_FLAG_MUTATORBLOCKED = BIT(1)
};
#define ITEM_HANDLE(signal, ...) __Item_Send_##signal(__VA_ARGS__)
#endif
REGISTER_ITEM(VaporizerCells, Ammo) {
this.m_canonical_spawnfunc = "item_vaporizer_cells";
- this.spawnflags = ITEM_FLAG_MUTATORBLOCKED;
+ this.spawnflags = ITEM_FLAG_INSTAGIB | ITEM_FLAG_MUTATORBLOCKED;
#ifdef GAMEQC
this.m_model = MDL_VaporizerCells_ITEM;
this.m_sound = SND_VaporizerCells;
REGISTER_ITEM(ExtraLife, Powerup) {
this.m_canonical_spawnfunc = "item_extralife";
+ this.spawnflags = ITEM_FLAG_INSTAGIB;
#ifdef GAMEQC
this.m_model = MDL_ExtraLife_ITEM;
this.m_sound = SND_ExtraLife;
REGISTER_ITEM(Invisibility, Powerup) {
this.m_canonical_spawnfunc = "item_invisibility";
+ this.spawnflags = ITEM_FLAG_INSTAGIB;
#ifdef GAMEQC
this.m_model = MDL_Invisibility_ITEM;
this.m_sound = SND_Invisibility;
REGISTER_ITEM(Speed, Powerup) {
this.m_canonical_spawnfunc = "item_speed";
+ this.spawnflags = ITEM_FLAG_INSTAGIB;
#ifdef GAMEQC
this.m_model = MDL_Speed_ITEM;
this.m_sound = SND_Speed;
string RandomItems_GetRandomInstagibItemClassName(string prefix)
{
RandomSelection_Init();
- #define X(classname) \
- RandomSelection_AddString( \
- classname, \
- cvar(sprintf("g_%s_%s_probability", prefix, classname)), \
- 1 \
- )
- X("item_vaporizer_cells");
- X("item_invisibility");
- X("item_extralife");
- X("item_speed");
- #undef X
+ FOREACH(Items, it.spawnflags & ITEM_FLAG_INSTAGIB,
+ {
+ RandomSelection_AddString(it.m_canonical_spawnfunc,
+ cvar(sprintf("g_%s_%s_probability", prefix,
+ it.m_canonical_spawnfunc)), 1);
+ });
return RandomSelection_chosen_string;
}