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