#include "item/armor.qc"
#include "item/buff.qc"
#include "item/health.qc"
+#include "item/jetpack.qc"
#include "item/powerup.qc"
#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(Bullets
,IF(ALL, CONFIGURE
, model = "models/items/a_bullets.mdl"
- , sound = "misc/itempickup.wav"
, name = "bullets"
- , itemid = IT_NAILS
)
,IF(SV, CONFIGURE
, botvalue = 2000
+ , itemid = IT_NAILS
)
)
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
+ , itemid = IT_CELLS
)
)
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
+ , itemid = IT_PLASMA
)
)
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
+ , itemid = IT_ROCKETS
)
)
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
+ , itemid = IT_SHELLS
)
)
#include "armor.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__)
, model = "models/items/item_armor_small.md3"
, sound = "misc/armor1.wav"
, name = "5 Armor"
- , itemid = IT_ARMOR_SHARD
)
,IF(SV, CONFIGURE
, botvalue = BOT_PICKUP_RATING_LOW
+ , itemid = IT_ARMOR_SHARD
, respawntime = GET(g_pickup_respawntime_short)
, respawntimejitter = GET(g_pickup_respawntimejitter_short)
)
, model = "models/items/item_armor_medium.md3"
, sound = "misc/armor10.wav"
, name = "25 Armor"
- , itemid = IT_ARMOR
)
,IF(SV, CONFIGURE
, botvalue = BOT_PICKUP_RATING_MID
+ , itemid = IT_ARMOR
, respawntime = GET(g_pickup_respawntime_medium)
, respawntimejitter = GET(g_pickup_respawntimejitter_medium)
)
, model = "models/items/item_armor_big.md3"
, sound = "misc/armor17_5.wav"
, name = "50 Armor"
- , itemid = IT_ARMOR
)
,IF(SV, CONFIGURE
, botvalue = 20000 // FIXME: higher than BOT_PICKUP_RATING_HIGH?
+ , itemid = IT_ARMOR
, respawntime = GET(g_pickup_respawntime_long)
, respawntimejitter = GET(g_pickup_respawntimejitter_long)
)
, model = "models/items/item_armor_large.md3"
, sound = "misc/armor25.wav"
, name = "100 Armor"
- , itemid = IT_ARMOR
)
,IF(SV, CONFIGURE
, botvalue = BOT_PICKUP_RATING_HIGH
+ , itemid = IT_ARMOR
, respawntime = GET(g_pickup_respawntime_long)
, respawntimejitter = GET(g_pickup_respawntimejitter_long)
)
#include "health.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__)
, model = "models/items/g_h1.md3"
, sound = "misc/minihealth.wav"
, name = "5 Health"
- , itemid = IT_5HP
)
,IF(SV, CONFIGURE
, botvalue = BOT_PICKUP_RATING_LOW
+ , itemid = IT_5HP
, respawntime = GET(g_pickup_respawntime_short)
, respawntimejitter = GET(g_pickup_respawntimejitter_short)
)
, model = "models/items/g_h25.md3"
, sound = "misc/mediumhealth.wav"
, name = "25 Health"
- , itemid = IT_25HP
)
,IF(SV, CONFIGURE
, botvalue = BOT_PICKUP_RATING_MID
+ , itemid = IT_25HP
, respawntime = GET(g_pickup_respawntime_short)
, respawntimejitter = GET(g_pickup_respawntimejitter_short)
)
, model = "models/items/g_h50.md3"
, sound = "misc/mediumhealth.wav"
, name = "50 Health"
- , itemid = IT_25HP
)
,IF(SV, CONFIGURE
, botvalue = BOT_PICKUP_RATING_MID
+ , itemid = IT_25HP
, respawntime = GET(g_pickup_respawntime_medium)
, respawntimejitter = GET(g_pickup_respawntimejitter_medium)
)
, model = "models/items/g_h100.md3"
, sound = "misc/megahealth.wav"
, name = "100 Health"
- , itemid = IT_HEALTH
)
,IF(SV, CONFIGURE
, botvalue = BOT_PICKUP_RATING_HIGH
+ , itemid = IT_HEALTH
, respawntime = GET(g_pickup_respawntime_long)
, respawntimejitter = GET(g_pickup_respawntimejitter_long)
)
--- /dev/null
+#ifdef SVQC
+ #include "../../../server/t_items.qh"
+ #include "../../../server/constants.qh"
+#endif
+
+#define WITH(it) this.m_##it;
+#define CONFIGURE(...) MAP(WITH, __VA_ARGS__)
+#define DEFINE(id, ...) REGISTER_ITEM(id, Pickup, MAP(IDENTITY, __VA_ARGS__))
+
+DEFINE(Jetpack
+ ,IF(ALL, CONFIGURE
+ , model = "models/items/g_jetpack.md3"
+ , name = "Jet pack"
+ )
+ ,IF(SV, CONFIGURE
+ , botvalue = BOT_PICKUP_RATING_LOW
+ , itemflags = FL_POWERUP
+ , itemid = IT_JETPACK
+ , pickupevalfunc = commodity_pickupevalfunc
+ , respawntime = GET(g_pickup_respawntime_powerup)
+ , respawntimejitter = GET(g_pickup_respawntimejitter_powerup)
+ )
+)
+
+DEFINE(JetpackFuel
+ ,IF(ALL, CONFIGURE
+ , model = "models/items/g_fuel.md3"
+ , name = "Fuel"
+ )
+ ,IF(SV, CONFIGURE
+ , botvalue = BOT_PICKUP_RATING_LOW
+ , itemid = IT_FUEL
+ , pickupevalfunc = commodity_pickupevalfunc
+ , respawntime = GET(g_pickup_respawntime_ammo)
+ , respawntimejitter = GET(g_pickup_respawntimejitter_ammo)
+ )
+)
+
+DEFINE(JetpackRegen
+ ,IF(ALL, CONFIGURE
+ , model = "models/items/g_fuelregen.md3"
+ , name = "Fuel regenerator"
+ )
+ ,IF(SV, CONFIGURE
+ , botvalue = BOT_PICKUP_RATING_LOW
+ , itemflags = FL_POWERUP
+ , itemid = IT_FUEL_REGEN
+ , pickupevalfunc = commodity_pickupevalfunc
+ , respawntime = GET(g_pickup_respawntime_powerup)
+ , respawntimejitter = GET(g_pickup_respawntimejitter_powerup)
+ )
+)
+
+#undef WITH
+#undef CONFIGURE
+#undef DEFINE
CLASS(Pickup, GameItem)
METHOD(Pickup, respondTo, bool(entity, int))
ATTRIB(Pickup, m_model, string, string_null)
- ATTRIB(Pickup, m_sound, string, string_null)
+ ATTRIB(Pickup, m_sound, string, "misc/itempickup.wav")
ATTRIB(Pickup, m_name, string, string_null)
- ATTRIB(Pickup, m_itemid, int, 0)
#ifdef SVQC
ATTRIB(Pickup, m_botvalue, int, 0)
ATTRIB(Pickup, m_itemflags, int, 0)
+ ATTRIB(Pickup, m_itemid, int, 0)
ATTRIB(Pickup, m_pickupevalfunc, float(entity player, entity item), generic_pickupevalfunc)
ATTRIB(Pickup, m_respawntime, float(), func_null)
ATTRIB(Pickup, m_respawntimejitter, float(), func_null)
, model = "models/items/g_strength.md3"
, sound = "misc/powerup.wav"
, name = "Strength Powerup"
+ )
+ ,IF(SV, CONFIGURE
, itemid = IT_STRENGTH
)
)
, model = "models/items/g_invincible.md3"
, sound = "misc/powerup_shield.wav"
, name = "Shield"
+ )
+ ,IF(SV, CONFIGURE
, itemid = IT_INVINCIBLE
)
)
self.ammo_fuel = g_pickup_fuel;
if(!self.pickup_anyway)
self.pickup_anyway = g_pickup_ammo_anyway;
- StartItem ("models/items/g_fuel.md3", "misc/itempickup.wav", g_pickup_respawntime_ammo, g_pickup_respawntimejitter_ammo, "Fuel", IT_FUEL, 0, 0, commodity_pickupevalfunc, BOT_PICKUP_RATING_LOW);
+ StartItemA (ITEM_JetpackFuel);
}
void spawnfunc_item_fuel_regen(void)
spawnfunc_item_fuel();
return;
}
- StartItem ("models/items/g_fuelregen.md3", "misc/itempickup.wav", g_pickup_respawntime_powerup, g_pickup_respawntimejitter_powerup, "Fuel regenerator", IT_FUEL_REGEN, 0, FL_POWERUP, commodity_pickupevalfunc, BOT_PICKUP_RATING_LOW);
+ StartItemA (ITEM_JetpackRegen);
}
void spawnfunc_item_jetpack(void)
spawnfunc_item_fuel();
return;
}
- StartItem ("models/items/g_jetpack.md3", "misc/itempickup.wav", g_pickup_respawntime_powerup, g_pickup_respawntimejitter_powerup, "Jet pack", IT_JETPACK, 0, FL_POWERUP, commodity_pickupevalfunc, BOT_PICKUP_RATING_LOW);
+ StartItemA (ITEM_Jetpack);
}
float GiveWeapon(entity e, float wpn, float op, float val)