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