))
DEFINE(Bullets
- ,IF(ALL, CONFIGURE
+ ,APPLY(CONFIGURE
, model = "models/items/a_bullets.mdl"
, name = "bullets"
)
)
)
DEFINE(Cells
- ,IF(ALL, CONFIGURE
+ ,APPLY(CONFIGURE
, model = "models/items/a_cells.md3"
, name = "cells"
)
)
)
DEFINE(Plasma
- ,IF(ALL, CONFIGURE
+ ,APPLY(CONFIGURE
, model = "models/items/a_cells.md3"
, name = "plasma"
)
)
)
DEFINE(Rockets
- ,IF(ALL, CONFIGURE
+ ,APPLY(CONFIGURE
, model = "models/items/a_rockets.md3"
, name = "rockets"
)
)
)
DEFINE(Shells
- ,IF(ALL, CONFIGURE
+ ,APPLY(CONFIGURE
, model = "models/items/a_shells.md3"
, name = "shells"
)
#define DEFINE(id, ...) REGISTER_ITEM(id, Armor, MAP(IDENTITY, __VA_ARGS__))
DEFINE(ArmorSmall
- ,IF(ALL, CONFIGURE
+ ,APPLY(CONFIGURE
, model = "models/items/item_armor_small.md3"
, sound = "misc/armor1.wav"
, name = "5 Armor"
)
DEFINE(ArmorMedium
- ,IF(ALL, CONFIGURE
+ ,APPLY(CONFIGURE
, model = "models/items/item_armor_medium.md3"
, sound = "misc/armor10.wav"
, name = "25 Armor"
)
DEFINE(ArmorBig
- ,IF(ALL, CONFIGURE
+ ,APPLY(CONFIGURE
, model = "models/items/item_armor_big.md3"
, sound = "misc/armor17_5.wav"
, name = "50 Armor"
)
DEFINE(ArmorLarge
- ,IF(ALL, CONFIGURE
+ ,APPLY(CONFIGURE
, model = "models/items/item_armor_large.md3"
, sound = "misc/armor25.wav"
, name = "100 Armor"
#define DEFINE(id, ...) REGISTER_ITEM(id, Health, MAP(IDENTITY, __VA_ARGS__))
DEFINE(HealthSmall
- ,IF(ALL, CONFIGURE
+ ,APPLY(CONFIGURE
, model = "models/items/g_h1.md3"
, sound = "misc/minihealth.wav"
, name = "5 Health"
)
DEFINE(HealthMedium
- ,IF(ALL, CONFIGURE
+ ,APPLY(CONFIGURE
, model = "models/items/g_h25.md3"
, sound = "misc/mediumhealth.wav"
, name = "25 Health"
)
DEFINE(HealthLarge
- ,IF(ALL, CONFIGURE
+ ,APPLY(CONFIGURE
, model = "models/items/g_h50.md3"
, sound = "misc/mediumhealth.wav"
, name = "50 Health"
)
DEFINE(HealthMega
- ,IF(ALL, CONFIGURE
+ ,APPLY(CONFIGURE
, model = "models/items/g_h100.md3"
, sound = "misc/megahealth.wav"
, name = "100 Health"
#define DEFINE(id, ...) REGISTER_ITEM(id, Pickup, MAP(IDENTITY, __VA_ARGS__))
DEFINE(Jetpack
- ,IF(ALL, CONFIGURE
+ ,APPLY(CONFIGURE
, model = "models/items/g_jetpack.md3"
, name = "Jet pack"
)
)
DEFINE(JetpackFuel
- ,IF(ALL, CONFIGURE
+ ,APPLY(CONFIGURE
, model = "models/items/g_fuel.md3"
, name = "Fuel"
)
)
DEFINE(JetpackRegen
- ,IF(ALL, CONFIGURE
+ ,APPLY(CONFIGURE
, model = "models/items/g_fuelregen.md3"
, name = "Fuel regenerator"
)
))
DEFINE(Strength
- ,IF(ALL, CONFIGURE
+ ,APPLY(CONFIGURE
, model = "models/items/g_strength.md3"
, sound = "misc/powerup.wav"
, name = "Strength Powerup"
)
)
DEFINE(Shield
- ,IF(ALL, CONFIGURE
+ ,APPLY(CONFIGURE
, model = "models/items/g_invincible.md3"
, sound = "misc/powerup_shield.wav"
, name = "Shield"
#define IDENTITY(it) it
+#define APPLY(f, ...) f(__VA_ARGS__)
+
#ifdef SVQC
#define SV(f, ...) f(__VA_ARGS__)
#else
#define CL(f, ...)
#endif
-#define ALL(f, ...) f(__VA_ARGS__)
-
-#define IF(pred, f, ...) pred(f, __VA_ARGS__)
+#define IF(cond, f, ...) cond(f, __VA_ARGS__)
#define GET(name) name##get
#define GETTER(type, name) type GET(name)() { return name; }
GETTER(float, instagib_respawntimejitter_ammo)
REGISTER_ITEM(VaporizerCells, Pickup, MAP(IDENTITY
- ,IF(ALL, CONFIGURE
+ ,APPLY(CONFIGURE
, model = "models/items/a_cells.md3"
, sound = "misc/itempickup.wav"
, name = "Vaporizer Ammo"
))
REGISTER_ITEM(ExtraLife, Pickup, MAP(IDENTITY
- ,IF(ALL, CONFIGURE
+ ,APPLY(CONFIGURE
, model = "models/items/g_h100.md3"
, sound = "misc/megahealth.wav"
, name = "Extralife"