#endif
REGISTER_ITEM(Bullets, Ammo) {
- this.m_model = "models/items/a_bullets.mdl";
+ this.m_model = "a_bullets.mdl";
this.m_name = "bullets";
this.m_icon = "ammo_bullets";
#ifdef SVQC
#endif
}
REGISTER_ITEM(Cells, Ammo) {
- this.m_model = "models/items/a_cells.md3";
+ this.m_model = "a_cells.md3";
this.m_name = "cells";
this.m_icon = "ammo_cells";
#ifdef SVQC
#endif
}
REGISTER_ITEM(Plasma, Ammo) {
- this.m_model = "models/items/a_cells.md3";
+ this.m_model = "a_cells.md3";
this.m_name = "plasma";
this.m_icon = "ammo_plasma";
#ifdef SVQC
#endif
}
REGISTER_ITEM(Rockets, Ammo) {
- this.m_model = "models/items/a_rockets.md3";
+ this.m_model = "a_rockets.md3";
this.m_name = "rockets";
this.m_icon = "ammo_rockets";
#ifdef SVQC
#endif
}
REGISTER_ITEM(Shells, Ammo) {
- this.m_model = "models/items/a_shells.md3";
+ this.m_model = "a_shells.md3";
this.m_name = "shells";
this.m_icon = "ammo_shells";
#ifdef SVQC
#endif
REGISTER_ITEM(ArmorSmall, Armor) {
- this.m_model = "models/items/item_armor_small.md3";
+ this.m_model = "item_armor_small.md3";
this.m_sound = "misc/armor1.wav";
this.m_name = "5 Armor";
this.m_icon = "armor";
}
REGISTER_ITEM(ArmorMedium, Armor) {
- this.m_model = "models/items/item_armor_medium.md3";
+ this.m_model = "item_armor_medium.md3";
this.m_sound = "misc/armor10.wav";
this.m_name = "25 Armor";
this.m_icon = "armor";
}
REGISTER_ITEM(ArmorLarge, Armor) {
- this.m_model = "models/items/item_armor_big.md3";
+ this.m_model = "item_armor_big.md3";
this.m_sound = "misc/armor17_5.wav";
this.m_name = "50 Armor";
this.m_icon = "armor";
}
REGISTER_ITEM(ArmorMega, Armor) {
- this.m_model = "models/items/item_armor_large.md3";
+ this.m_model = "item_armor_large.md3";
this.m_sound = "misc/armor25.wav";
this.m_name = "100 Armor";
this.m_icon = "item_large_armor";
#endif
REGISTER_ITEM(HealthSmall, Health) {
- this.m_model = "models/items/g_h1.md3";
+ this.m_model = "g_h1.md3";
this.m_sound = "misc/minihealth.wav";
this.m_name = "5 Health";
this.m_icon = "health";
}
REGISTER_ITEM(HealthMedium, Health) {
- this.m_model = "models/items/g_h25.md3";
+ this.m_model = "g_h25.md3";
this.m_sound = "misc/mediumhealth.wav";
this.m_name = "25 Health";
this.m_icon = "health";
}
REGISTER_ITEM(HealthLarge, Health) {
- this.m_model = "models/items/g_h50.md3";
+ this.m_model = "g_h50.md3";
this.m_sound = "misc/mediumhealth.wav";
this.m_name = "50 Health";
this.m_icon = "health";
}
REGISTER_ITEM(HealthMega, Health) {
- this.m_model = "models/items/g_h100.md3";
+ this.m_model = "g_h100.md3";
this.m_sound = "misc/megahealth.wav";
this.m_name = "100 Health";
this.m_icon = "item_mega_health";
#include "powerup.qh"
REGISTER_ITEM(Jetpack, Powerup) {
- this.m_model = "models/items/g_jetpack.md3";
+ this.m_model = "g_jetpack.md3";
this.m_name = "Jet pack";
this.m_icon = "jetpack";
#ifdef SVQC
}
REGISTER_ITEM(JetpackFuel, Ammo) {
- this.m_model = "models/items/g_fuel.md3";
+ this.m_model = "g_fuel.md3";
this.m_name = "Fuel";
this.m_icon = "ammo_fuel";
#ifdef SVQC
}
REGISTER_ITEM(JetpackRegen, Pickup) {
- this.m_model = "models/items/g_fuelregen.md3";
+ this.m_model = "g_fuelregen.md3";
this.m_name = "Fuel regenerator";
this.m_icon = "fuelregen";
#ifdef SVQC
.int m_itemid;
#endif
REGISTER_ITEM(Strength, Powerup) {
- this.m_model = "models/items/g_strength.md3";
+ this.m_model = "g_strength.md3";
this.m_sound = "misc/powerup.wav";
this.m_name = "Strength Powerup";
this.m_icon = "strength";
this.m_itemid = IT_STRENGTH;
}
REGISTER_ITEM(Shield, Powerup) {
- this.m_model = "models/items/g_invincible.md3";
+ this.m_model = "g_invincible.md3";
this.m_sound = "misc/powerup_shield.wav";
this.m_name = "Shield";
this.m_icon = "shield";
string weapon_model_output;
MUTATOR_HOOKABLE(WeaponModel, EV_WeaponModel);
+/** called when an item model is about to be set, allows custom paths etc. */
+#define EV_ItemModel(i, o) \
+ /**/ i(string, item_model) \
+ /**/ i(string, item_model_output) \
+ /**/ o(string, item_model_output) \
+ /**/
+string item_model;
+string item_model_output;
+MUTATOR_HOOKABLE(ItemModel, EV_ItemModel);
+
/** called when a player presses the jump key */
#define EV_PlayerJump(i, o) \
/**/ i(float, player_multijump) \
GETTER(float, instagib_respawntimejitter_ammo)
REGISTER_ITEM(VaporizerCells, Ammo) {
- this.m_model = "models/items/a_cells.md3";
+ this.m_model = "a_cells.md3";
this.m_sound = "misc/itempickup.wav";
this.m_name = "Vaporizer Ammo";
this.m_icon = "ammo_supercells";
}
REGISTER_ITEM(ExtraLife, Powerup) {
- this.m_model = "models/items/g_h100.md3";
+ this.m_model = "g_h100.md3";
this.m_sound = "misc/megahealth.wav";
this.m_name = "Extralife";
this.m_icon = "item_mega_health";
self.mdl = strzone(sprintf("%s%s.dpm", _fn2, autocvar_cl_simpleitems_postfix));
else if(fexists(sprintf("%s%s.iqm", _fn2, autocvar_cl_simpleitems_postfix)))
self.mdl = strzone(sprintf("%s%s.iqm", _fn2, autocvar_cl_simpleitems_postfix));
- else if(fexists(sprintf("%s%s.obj", _fn2, autocvar_cl_simpleitems_postfix)))
- self.mdl = strzone(sprintf("%s%s.obj", _fn2, autocvar_cl_simpleitems_postfix));
+ else if(fexists(sprintf("%s%s.mdl", _fn2, autocvar_cl_simpleitems_postfix)))
+ self.mdl = strzone(sprintf("%s%s.mdl", _fn2, autocvar_cl_simpleitems_postfix));
else
{
self.draw = ItemDraw;
- dprint("Simple item requested for ", _fn, " but no model exsist for it\n");
+ dprint("Simple item requested for ", _fn, " but no model exists for it\n");
}
}
}
}
+string Item_Model(string item_mdl)
+{
+ string output = strcat("models/items/", item_mdl);
+ MUTATOR_CALLHOOK(ItemModel, item_mdl, output);
+ return strzone(output);
+}
+
void StartItemA (entity a)
{
self.itemdef = a;
- StartItem(a.m_model, a.m_sound, a.m_respawntime(), a.m_respawntimejitter(), a.m_name, a.m_itemid, 0, a.m_itemflags, a.m_pickupevalfunc, a.m_botvalue);
+ StartItem(Item_Model(a.m_model), a.m_sound, a.m_respawntime(), a.m_respawntimejitter(), a.m_name, a.m_itemid, 0, a.m_itemflags, a.m_pickupevalfunc, a.m_botvalue);
}
void spawnfunc_item_rockets (void) {
void spawnfunc_item_health100() { spawnfunc_item_health_mega(); }
void spawnfunc_item_strength (void) {
- precache_sound(W_Sound("strength_fire"));
+ precache_sound("weapons/strength_fire.wav");
if(!self.strength_finished)
self.strength_finished = autocvar_g_balance_powerup_strength_time;
StartItemA (ITEM_Strength);
if(self.team)
f |= FL_NO_WEAPON_STAY;
- StartItem(e.model, W_Sound("weaponpickup"), self.respawntime, self.respawntimejitter, e.message, 0, e.weapon, f, weapon_pickupevalfunc, e.bot_pickupbasevalue);
+ StartItem(e.model, "weapons/weaponpickup.wav", self.respawntime, self.respawntimejitter, e.message, 0, e.weapon, f, weapon_pickupevalfunc, e.bot_pickupbasevalue);
#if 0 // WEAPONTODO
if (self.modelindex) // don't precache if self was removed
WEP_ACTION(e.weapon, WR_INIT);