4 /// \brief Header file that describes the functions related to game items.
5 /// \copyright GNU GPLv2 or any later version.
7 /// \brief Creates a new item.
8 /// \param[in] class_name Class name of the item.
9 /// \param[in] position Position of the item.
10 /// \param[in] no_align True if item should be placed directly at specified
11 /// position, false to let it drop to the ground.
12 /// \return Item on success, NULL otherwise.
13 entity Item_Create(string class_name, vector position, bool no_align);
15 /// \brief Initializes the item according to classname.
16 /// \param[in,out] item Item to initialize.
17 /// \param[in] class_name Class name to use.
18 /// \return No return.
19 /// \nore This function is useful if you want to set some item properties before
21 void Item_Initialize(entity item, string class_name);
23 /// \brief Creates a loot item.
24 /// \param[in] class_name Class name of the item.
25 /// \param[in] position Position of the item.
26 /// \param[in] velocity of the item.
27 /// \param[in] time_to_live Amount of time after which the item will disappear.
28 /// \return Item on success, NULL otherwise.
29 entity Item_CreateLoot(string class_name, vector position, vector vel,
32 /// \brief Initializes the loot item.
33 /// \param[in] class_name Class name of the item.
34 /// \param[in] position Position of the item.
35 /// \param[in] velocity of the item.
36 /// \param[in] time_to_live Amount of time after which the item will disappear.
37 /// \return True on success, false otherwise.
38 /// \nore This function is useful if you want to set some item properties before
40 bool Item_InitializeLoot(entity item, string class_name, vector position,
41 vector vel, float time_to_live);
43 /// \brief Returns whether the item is loot.
44 /// \param[in] item Item to check.
45 /// \return True if the item is loot, false otherwise.
46 bool Item_IsLoot(entity item);
48 /// \brief Sets the item loot status.
49 /// \param[in,out] item Item to adjust.
50 /// \param[in] loot Whether item is loot.
51 /// \return No return.
52 void Item_SetLoot(entity item, bool loot);
54 /// \brief Returns whether item should keep its position or be dropped to the
56 /// \param[in] item Item to check.
57 /// \return True if item should keep its position or false if it should be
58 /// dropped to the ground.
59 bool Item_ShouldKeepPosition(entity item);
61 /// \brief Returns whether the item is expiring (i.e. its strength, shield and
62 /// superweapon timers expire while it is on the ground).
63 /// \param[in] item Item to check.
64 /// \return True if the item is expiring, false otherwise.
65 bool Item_IsExpiring(entity item);
67 /// \brief Sets the item expiring status (i.e. whether its strength, shield
68 /// and superweapon timers expire while it is on the ground).
69 /// \param[in,out] item Item to adjust.
70 /// \param[in] expiring Whether item is expiring.
71 /// \return No return.
72 void Item_SetExpiring(entity item, bool expiring);