]> git.xonotic.org Git - xonotic/xonotic-data.pk3dir.git/blobdiff - qcsrc/common/mutators/mutator/random_items/sv_random_items.qh
Better random item selection algorithm.
[xonotic/xonotic-data.pk3dir.git] / qcsrc / common / mutators / mutator / random_items / sv_random_items.qh
index c9b4dbb9011ca91cd905d0c7221e3f089f4745b0..575336301caff14b1df586142768a672d8a4f539 100644 (file)
@@ -7,6 +7,16 @@
 
 bool autocvar_g_random_items; ///< Whether to enable random items.
 
+enum
+{
+       RANDOM_ITEM_TYPE_HEALTH = BIT(1),
+       RANDOM_ITEM_TYPE_ARMOR = BIT(2),
+       RANDOM_ITEM_TYPE_RESOURCE = BIT(3),
+       RANDOM_ITEM_TYPE_WEAPON = BIT(4),
+       RANDOM_ITEM_TYPE_POWERUP = BIT(5),
+       RANDOM_ITEM_TYPE_ALL = BITS(6)
+};
+
 /// \brief Returns a random classname of the item.
 /// \param[in] prefix Prefix of the cvars that hold probabilities.
 /// \return Random classname of the item.
@@ -16,10 +26,11 @@ string RandomItems_GetRandomItemClassName(string prefix);
 
 /// \brief Returns a random classname of the vanilla item.
 /// \param[in] prefix Prefix of the cvars that hold probabilities.
+/// \param[in] types Bitmask of the types. See RANDOM_ITEM_TYPE constants.
 /// \return Random classname of the vanilla item.
 /// \note This includes mutator items that don't change gameplay a lot such as
 /// jetpack and new toys.
-string RandomItems_GetRandomVanillaItemClassName(string prefix);
+string RandomItems_GetRandomVanillaItemClassName(string prefix, int types);
 
 /// \brief Returns a random classname of the instagib item.
 /// \param[in] prefix Prefix of the cvars that hold probabilities.