]> de.git.xonotic.org Git - xonotic/xonotic-data.pk3dir.git/blob - qcsrc/common/mutators/mutator/random_items/sv_random_items.qh
9ac738ca68ede11020c348c1a681d0b65a0eb7ca
[xonotic/xonotic-data.pk3dir.git] / qcsrc / common / mutators / mutator / random_items / sv_random_items.qh
1 #pragma once
2
3 /// \file
4 /// \brief Header file that describes the random items mutator.
5 /// \author Lyberta
6 /// \copyright GNU GPLv2 or any later version.
7
8 bool autocvar_g_random_items; ///< Whether to enable random items.
9
10 enum
11 {
12         RANDOM_ITEM_TYPE_HEALTH = BIT(0),
13         RANDOM_ITEM_TYPE_ARMOR = BIT(1),
14         RANDOM_ITEM_TYPE_RESOURCE = BIT(2),
15         RANDOM_ITEM_TYPE_WEAPON = BIT(3),
16         RANDOM_ITEM_TYPE_POWERUP = BIT(4),
17         RANDOM_ITEM_TYPE_ALL = BITS(5)
18 };
19
20 /// \brief Returns a random classname of the item.
21 /// \param[in] prefix Prefix of the cvars that hold probabilities.
22 /// \return Random classname of the item.
23 /// \note This function will automatically detect gamemode and use cvars from
24 /// that gamemode.
25 string RandomItems_GetRandomItemClassName(string prefix);
26
27 /// \brief Returns a random classname of the vanilla item.
28 /// \param[in] prefix Prefix of the cvars that hold probabilities.
29 /// \param[in] types Bitmask of the types. See RANDOM_ITEM_TYPE constants.
30 /// \return Random classname of the vanilla item.
31 /// \note This includes mutator items that don't change gameplay a lot such as
32 /// jetpack and new toys.
33 string RandomItems_GetRandomVanillaItemClassName(string prefix, int types);
34
35 /// \brief Returns a random classname of the instagib item.
36 /// \param[in] prefix Prefix of the cvars that hold probabilities.
37 /// \return Random classname of the instagib item.
38 string RandomItems_GetRandomInstagibItemClassName(string prefix);
39
40 /// \brief Returns a random classname of the overkill item.
41 /// \param[in] prefix Prefix of the cvars that hold probabilities.
42 /// \return Random classname of the overkill item.
43 string RandomItems_GetRandomOverkillItemClassName(string prefix);