]> de.git.xonotic.org Git - xonotic/xonotic-data.pk3dir.git/blob - qcsrc/server/items.qh
Merge branch 'Mario/target_teleporter_v2' into 'master'
[xonotic/xonotic-data.pk3dir.git] / qcsrc / server / items.qh
1 #pragma once
2
3 /// \file
4 /// \brief Header file that describes the functions related to game items.
5 /// \copyright GNU GPLv2 or any later version.
6
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);
14
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
20 /// initialization.
21 void Item_Initialize(entity item, string class_name);
22
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,
30         float time_to_live);
31
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
39 /// initialization.
40 bool Item_InitializeLoot(entity item, string class_name, vector position,
41         vector vel, float time_to_live);
42
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);
47
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);
53
54 /// \brief Returns whether the item is expiring (i.e. its strength, shield and
55 /// superweapon timers expire while it is on the ground).
56 /// \param[in] item Item to check.
57 /// \return True if the item is expiring, false otherwise.
58 bool Item_IsExpiring(entity item);
59
60 /// \brief Sets the item expiring status (i.e. whether its strength, shield
61 /// and superweapon timers expire while it is on the ground).
62 /// \param[in,out] item Item to adjust.
63 /// \param[in] expiring Whether item is expiring.
64 /// \return No return.
65 void Item_SetExpiring(entity item, bool expiring);