21 FOREACH(Items, it.m_canonical_spawnfunc == class_name,
25 FOREACH(Weapons, it.m_canonical_spawnfunc == class_name,
34 FOREACH(Items, it.netname == item_name,
38 FOREACH(Weapons, it.netname == item_name,
48 if (definition ==
NULL)
63 item.classname = class_name;
64 item.spawnfunc_checked =
true;
66 item.noalign = no_align;
77 FOREACH(Weapons, it.m_canonical_spawnfunc == class_name,
79 weapon_defaultspawnfunc(item, it);
82 FOREACH(Items, it.m_canonical_spawnfunc == class_name,
87 LOG_FATALF(
"Item_Initialize: Invalid classname: %s", class_name);
102 vector vel,
float time_to_live)
104 item.classname = class_name;
108 item.pickup_anyway =
true;
109 item.spawnfunc_checked =
true;
123 return item.m_isloot || item.classname ==
"droppedweapon";
128 item.m_isloot = loot;
133 return item.noalign || (item.spawnflags & 1);
138 return item.m_isexpiring;
143 item.m_isexpiring = expiring;
149 SPAWNFUNC_ITEM_COND(item_armor1,
cvar(
"sv_mapformat_is_quake3"), ITEM_ArmorSmall, ITEM_ArmorMedium)
bool Item_IsDefinitionAllowed(entity definition)
Checks whether the items with the specified definition are allowed to spawn.
entity Item_DefinitionFromInternalName(string item_name)
Returns the item definition corresponding to the given internal name.
SPAWNFUNC_ITEM(item_armor_green, ITEM_ArmorMedium) .float wait
void Item_Initialize(entity item, string class_name)
Initializes the item according to class name.
bool Item_InitializeLoot(entity item, string class_name, vector position, vector vel, float time_to_live)
Initializes the loot item.
entity Item_FindDefinition(string class_name)
Returns the item definition corresponding to the given class name.
bool m_isexpiring
Holds whether strength, shield or superweapon timers expire while this item is on the ground...
bool m_isloot
Holds whether item is loot.
vector(float skel, float bonenum) _skel_get_boneabs_hidden
bool Item_ShouldKeepPosition(entity item)
Returns whether item should keep its position or be dropped to the ground.
entity Item_Create(string class_name, vector position, bool no_align)
Creates a new item.
#define MUTATOR_CALLHOOK(id,...)
bool Item_IsLoot(entity item)
Returns whether the item is loot.
void SUB_SetFade(entity ent, float vanish_time, float fading_time)
Header file that describes the functions related to game items.
void Item_SetExpiring(entity item, bool expiring)
Sets the item expiring status (i.e.
bool Item_IsExpiring(entity item)
Returns whether the item is expiring (i.e.
#define FOREACH(list, cond, body)
bool Item_IsAllowed(string class_name)
Checks whether the items with the specified class name are allowed to spawn.
entity Item_CreateLoot(string class_name, vector position, vector vel, float time_to_live)
Creates a loot item.
void Item_SetLoot(entity item, bool loot)
Sets the item loot status.