]> de.git.xonotic.org Git - xonotic/xonotic-data.pk3dir.git/blob - qcsrc/server/items.qh
Refactoring item system.
[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);
43
44 // Item spawn functions.
45 // If a function is declared like this:
46 // spawnfunc(foo);
47 // You need to call it like this:
48 // spawnfunc_foo(item);
49
50 spawnfunc(item_health_small);
51 spawnfunc(item_health_medium);
52 spawnfunc(item_health_big);
53 spawnfunc(item_health_mega);
54 spawnfunc(item_armor_small);
55 spawnfunc(item_armor_medium);
56 spawnfunc(item_armor_big);
57 spawnfunc(item_armor_mega);
58 spawnfunc(item_shells);
59 spawnfunc(item_bullets);
60 spawnfunc(item_rockets);
61 spawnfunc(item_cells);
62 spawnfunc(item_plasma);
63 spawnfunc(item_fuel);
64 spawnfunc(item_strength);
65 spawnfunc(item_invincible);
66 spawnfunc(item_fuel_regen);
67 spawnfunc(item_jetpack);