4 /// \brief Header file that describes the random items mutator.
6 /// \copyright GNU GPLv2 or any later version.
8 bool autocvar_g_random_items; ///< Whether to enable random items.
9 bool autocvar_g_random_loot; ///< Whether to enable random loot.
13 RANDOM_ITEM_TYPE_HEALTH = BIT(0),
14 RANDOM_ITEM_TYPE_ARMOR = BIT(1),
15 RANDOM_ITEM_TYPE_RESOURCE = BIT(2),
16 RANDOM_ITEM_TYPE_WEAPON = BIT(3),
17 RANDOM_ITEM_TYPE_POWERUP = BIT(4),
18 RANDOM_ITEM_TYPE_ALL = BITS(5)
21 /// \brief Returns a random classname of the item.
22 /// \param[in] prefix Prefix of the cvars that hold probabilities.
23 /// \return Random classname of the item.
24 /// \note This function will automatically detect gamemode and use cvars from
26 string RandomItems_GetRandomItemClassName(string prefix);
28 /// \brief Returns a random classname of the vanilla item.
29 /// \param[in] prefix Prefix of the cvars that hold probabilities.
30 /// \param[in] types Bitmask of the types. See RANDOM_ITEM_TYPE constants.
31 /// \return Random classname of the vanilla item.
32 /// \note This includes mutator items that don't change gameplay a lot such as
33 /// jetpack and new toys.
34 string RandomItems_GetRandomVanillaItemClassName(string prefix, int types);
36 /// \brief Returns a random classname of the instagib item.
37 /// \param[in] prefix Prefix of the cvars that hold probabilities.
38 /// \return Random classname of the instagib item.
39 string RandomItems_GetRandomInstagibItemClassName(string prefix);
41 /// \brief Returns a random classname of the overkill item.
42 /// \param[in] prefix Prefix of the cvars that hold probabilities.
43 /// \return Random classname of the overkill item.
44 string RandomItems_GetRandomOverkillItemClassName(string prefix);
46 REGISTER_MUTATOR(random_items, (autocvar_g_random_items ||
47 autocvar_g_random_loot));