]> de.git.xonotic.org Git - xonotic/xonotic-data.pk3dir.git/blob - qcsrc/server/items.qh
f7e30136551f5a5d98467e5dc0c4a8bc7dc43a09
[xonotic/xonotic-data.pk3dir.git] / qcsrc / server / items.qh
1 #pragma once
2 /// \file
3 /// \brief Header file that describes the functions related to game items.
4 /// \copyright GNU GPLv2 or any later version.
5
6 #pragma once
7
8 /// \brief Creates a new item.
9 /// \param[in] class_name Class name of the item.
10 /// \param[in] position Position of the item.
11 /// \return Item on success, NULL otherwise.
12 entity Item_Create(string class_name, vector position);
13
14 /// \brief Initializes the item according to classname.
15 /// \param[in,out] item Item to initialize.
16 /// \param[in] class_name Class name to use.
17 /// \return No return.
18 /// \nore This function is useful if you want to set some item properties before
19 /// initialization.
20 void Item_Initialize(entity item, string class_name);
21
22 /// \brief Creates a loot item.
23 /// \param[in] class_name Class name of the item.
24 /// \param[in] position Position of the item.
25 /// \param[in] velocity of the item.
26 /// \param[in] time_to_live Amount of time after which the item will disappear.
27 /// \return Item on success, NULL otherwise.
28 entity Item_CreateLoot(string class_name, vector position, vector vel,
29         float time_to_live);
30
31 /// \brief Initializes the loot item.
32 /// \param[in] class_name Class name of the item.
33 /// \param[in] position Position of the item.
34 /// \param[in] velocity of the item.
35 /// \param[in] time_to_live Amount of time after which the item will disappear.
36 /// \return True on success, false otherwise.
37 /// \nore This function is useful if you want to set some item properties before
38 /// initialization.
39 bool Item_InitializeLoot(entity item, string class_name, vector position,
40         vector vel, float time_to_live);
41
42 /// \brief Returns whether the item is loot.
43 /// \param[in] item Item to check.
44 /// \return True if the item is loot, false otherwise.
45 bool Item_IsLoot(entity item);
46
47 /// \brief Sets the item loot status.
48 /// \param[in,out] item Item to adjust.
49 /// \param[in] loot Whether item is loot.
50 /// \return No return.
51 void Item_SetLoot(entity item, bool loot);
52