Xonotic
|
Source file that contains implementation of the functions related to creation of game items. More...
#include "spawning.qh"
#include <common/mapobjects/subs.qh>
#include <common/weapons/all.qh>
#include <server/items/items.qh>
#include <server/mutators/_mod.qh>
#include <server/weapons/spawning.qh>
Go to the source code of this file.
Functions | |
entity | Item_Create (string class_name, vector position, bool no_align) |
Creates a new item. More... | |
entity | Item_CreateLoot (string class_name, vector position, vector vel, float time_to_live) |
Creates a loot item. More... | |
entity | Item_DefinitionFromInternalName (string item_name) |
Returns the item definition corresponding to the given internal name. More... | |
entity | Item_FindDefinition (string class_name) |
Returns the item definition corresponding to the given class name. More... | |
void | Item_Initialize (entity item, string class_name) |
Initializes the item according to class name. More... | |
bool | Item_InitializeLoot (entity item, string class_name, vector position, vector vel, float time_to_live) |
Initializes the loot item. More... | |
bool | Item_IsAllowed (string class_name) |
Checks whether the items with the specified class name are allowed to spawn. More... | |
bool | Item_IsDefinitionAllowed (entity definition) |
Checks whether the items with the specified definition are allowed to spawn. More... | |
bool | Item_IsExpiring (entity item) |
Returns whether the item is expiring (i.e. More... | |
bool | Item_IsLoot (entity item) |
Returns whether the item is loot. More... | |
void | Item_SetExpiring (entity item, bool expiring) |
Sets the item expiring status (i.e. More... | |
void | Item_SetLoot (entity item, bool loot) |
Sets the item loot status. More... | |
bool | Item_ShouldKeepPosition (entity item) |
Returns whether item should keep its position or be dropped to the ground. More... | |
Variables | |
bool | m_isexpiring |
Holds whether strength, shield or superweapon timers expire while this item is on the ground. More... | |
bool | m_isloot |
Holds whether item is loot. More... | |
Source file that contains implementation of the functions related to creation of game items.
Definition in file spawning.qc.
Creates a new item.
[in] | class_name | Class name of the item. |
[in] | position | Position of the item. |
[in] | no_align | True if item should be placed directly at specified position, false to let it drop to the ground. |
Definition at line 60 of file spawning.qc.
References entity(), Item_Initialize(), NULL, setorigin(), and spawn().
Referenced by RandomItems_ReplaceMapItem().
Creates a loot item.
[in] | class_name | Class name of the item. |
[in] | position | Position of the item. |
[in] | velocity | of the item. |
[in] | time_to_live | Amount of time after which the item will disappear. |
Definition at line 90 of file spawning.qc.
References entity(), Item_InitializeLoot(), NULL, and spawn().
Referenced by RandomItems_SpawnLootItem().
Returns the item definition corresponding to the given internal name.
[in] | item_name | Internal netname to search for. |
Definition at line 32 of file spawning.qc.
Referenced by powerups_DropItem().
Returns the item definition corresponding to the given class name.
[in] | class_name | Class name to search for. |
Definition at line 19 of file spawning.qc.
Referenced by Item_IsAllowed().
Initializes the item according to class name.
[in,out] | item | Item to initialize. |
[in] | class_name | Class name to use. |
Definition at line 75 of file spawning.qc.
References FOREACH, and LOG_FATALF.
Referenced by Item_Create(), Item_InitializeLoot(), MUTATOR_HOOKFUNCTION(), and RandomItems_ReplaceMapItem().
bool Item_InitializeLoot | ( | entity | item, |
string | class_name, | ||
vector | position, | ||
vector | vel, | ||
float | time_to_live | ||
) |
Initializes the loot item.
[in] | class_name | Class name of the item. |
[in] | position | Position of the item. |
[in] | velocity | of the item. |
[in] | time_to_live | Amount of time after which the item will disappear. |
Definition at line 101 of file spawning.qc.
References Item_Initialize(), Item_SetLoot(), setorigin(), SUB_SetFade(), and time.
Referenced by Item_CreateLoot(), ok_DropItem(), powerups_DropItem(), and RandomItems_SpawnLootItem().
Checks whether the items with the specified class name are allowed to spawn.
[in] | class_name | Item class name to check. |
Definition at line 45 of file spawning.qc.
References entity(), Item_FindDefinition(), Item_IsDefinitionAllowed(), and NULL.
Checks whether the items with the specified definition are allowed to spawn.
[in] | definition | Item definition to check. |
Definition at line 55 of file spawning.qc.
References MUTATOR_CALLHOOK.
Referenced by Item_IsAllowed(), RandomItems_GetRandomInstagibItemClassName(), RandomItems_GetRandomItemClassNameWithProperty(), RandomItems_GetRandomOverkillItemClassName(), and weapon_defaultspawnfunc().
Returns whether the item is expiring (i.e.
its strength, shield and superweapon timers expire while it is on the ground).
[in] | item | Item to check. |
Definition at line 136 of file spawning.qc.
Referenced by _StartItem(), and Item_Touch().
Returns whether the item is loot.
[in] | item | Item to check. |
Definition at line 121 of file spawning.qc.
Referenced by _StartItem(), havocbot_goalrating_items(), havocbot_movetogoal(), isPushable(), Item_Reset(), Item_Touch(), MUTATOR_HOOKFUNCTION(), setItemGroup(), target_items_use(), and weapon_defaultspawnfunc().
Sets the item expiring status (i.e.
whether its strength, shield and superweapon timers expire while it is on the ground).
[in,out] | item | Item to adjust. |
[in] | expiring | Whether item is expiring. |
Definition at line 141 of file spawning.qc.
References cvar(), and SPAWNFUNC_ITEM().
Referenced by powerups_DropItem(), and W_ThrowNewWeapon().
Sets the item loot status.
[in,out] | item | Item to adjust. |
[in] | loot | Whether item is loot. |
Definition at line 126 of file spawning.qc.
Referenced by Item_InitializeLoot(), monster_dropitem(), and W_ThrowNewWeapon().
Returns whether item should keep its position or be dropped to the ground.
[in] | item | Item to check. |
Definition at line 131 of file spawning.qc.
Referenced by buff_SpawnReplacement(), MUTATOR_HOOKFUNCTION(), RandomItems_ReplaceMapItem(), and replace_with_insta_cells().
bool m_isexpiring |
Holds whether strength, shield or superweapon timers expire while this item is on the ground.
Definition at line 17 of file spawning.qc.
bool m_isloot |
Holds whether item is loot.
Definition at line 14 of file spawning.qc.