]> git.xonotic.org Git - xonotic/xonotic-data.pk3dir.git/blob - qcsrc/server/items.qh
Random items: Polish.
[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 Creates a new item.
8 /// \param[in] class_name Class name of the item.
9 /// \param[in] position Position of the item.
10 /// \return Item on success, NULL otherwise.
11 entity Item_Create(string class_name, vector position);
12
13 /// \brief Initializes the item according to classname.
14 /// \param[in,out] item Item to initialize.
15 /// \param[in] class_name Class name to use.
16 /// \return No return.
17 /// \nore This function is useful if you want to set some item properties before
18 /// initialization.
19 void Item_Initialize(entity item, string class_name);
20
21 /// \brief Creates a loot item.
22 /// \param[in] class_name Class name of the item.
23 /// \param[in] position Position of the item.
24 /// \param[in] velocity of the item.
25 /// \param[in] time_to_live Amount of time after which the item will disappear.
26 /// \return Item on success, NULL otherwise.
27 entity Item_CreateLoot(string class_name, vector position, vector vel,
28         float time_to_live);
29
30 /// \brief Initializes the loot item.
31 /// \param[in] class_name Class name of the item.
32 /// \param[in] position Position of the item.
33 /// \param[in] velocity of the item.
34 /// \param[in] time_to_live Amount of time after which the item will disappear.
35 /// \return True on success, false otherwise.
36 /// \nore This function is useful if you want to set some item properties before
37 /// initialization.
38 bool Item_InitializeLoot(entity item, string class_name, vector position,
39         vector vel, float time_to_live);
40
41 /// \brief Returns whether the item is loot.
42 /// \param[in] item Item to check.
43 /// \return True if the item is loot, false otherwise.
44 bool Item_IsLoot(entity item);
45
46 /// \brief Sets the item loot status.
47 /// \param[in,out] item Item to adjust.
48 /// \param[in] loot Whether item is loot.
49 /// \return No return.
50 void Item_SetLoot(entity item, bool loot);
51
52 // Item spawn functions.
53 // If a function is declared like this:
54 // spawnfunc(foo);
55 // You need to call it like this:
56 // spawnfunc_foo(item);
57
58 spawnfunc(item_health_small);
59 spawnfunc(item_health_medium);
60 spawnfunc(item_health_big);
61 spawnfunc(item_health_mega);
62 spawnfunc(item_armor_small);
63 spawnfunc(item_armor_medium);
64 spawnfunc(item_armor_big);
65 spawnfunc(item_armor_mega);
66 spawnfunc(item_shells);
67 spawnfunc(item_bullets);
68 spawnfunc(item_rockets);
69 spawnfunc(item_cells);
70 spawnfunc(item_plasma);
71 spawnfunc(item_fuel);
72 spawnfunc(item_strength);
73 spawnfunc(item_invincible);
74 spawnfunc(item_fuel_regen);
75 spawnfunc(item_jetpack);