|
Xonotic QuakeC
The free, fast arena FPS with crisp movement and a wide array of weapons
|
|
Source file that contains implementation of the random items mutator. More...
#include "sv_random_items.qh"Go to the source code of this file.
Functions | |
| MUTATOR_HOOKFUNCTION (random_items, BuildMutatorsPrettyString) | |
| MUTATOR_HOOKFUNCTION (random_items, BuildMutatorsString) | |
| MUTATOR_HOOKFUNCTION (random_items, FilterItem, CBC_ORDER_LAST) | |
| Hook that is called when an item is about to spawn. | |
| MUTATOR_HOOKFUNCTION (random_items, ItemTouched, CBC_ORDER_LAST) | |
| Hook that is called after the player has touched an item. | |
| MUTATOR_HOOKFUNCTION (random_items, PlayerDies) | |
| Hook which is called when the player dies. | |
| string | RandomItems_GetItemReplacementClassNames (entity item) |
| Returns list of classnames to replace a map item with. | |
| string | RandomItems_GetRandomItemClassName (string prefix) |
| Returns a random classname of the item. | |
| string | RandomItems_GetRandomItemClassNameWithProperty (string prefix,.bool item_property) |
| Returns a random classname of the item with specific property. | |
| string | RandomItems_GetRandomVanillaItemClassName (string prefix, int types) |
| Returns a random classname of the vanilla item. | |
| entity | RandomItems_ReplaceMapItem (entity item) |
| Replaces a map item. | |
| void | RandomItems_SpawnLootItem (vector position) |
| Spawns a random loot item. | |
Variables | |
| float | autocvar_g_random_loot_max |
| Maximum amount of loot items. | |
| float | autocvar_g_random_loot_min |
| Classnames to replace s with. | |
| float | autocvar_g_random_loot_spread |
| How far can loot be thrown. | |
| float | autocvar_g_random_loot_time |
| Amount of time the loot will stay. | |
| bool | random_items_is_spawning = false |
| Probability of random s spawning as loot. | |
Source file that contains implementation of the random items mutator.
Definition in file sv_random_items.qc.
| MUTATOR_HOOKFUNCTION | ( | random_items | , |
| BuildMutatorsPrettyString | ) |
Definition at line 317 of file sv_random_items.qc.
| MUTATOR_HOOKFUNCTION | ( | random_items | , |
| BuildMutatorsString | ) |
| MUTATOR_HOOKFUNCTION | ( | random_items | , |
| FilterItem | , | ||
| CBC_ORDER_LAST | ) |
Hook that is called when an item is about to spawn.
Definition at line 323 of file sv_random_items.qc.
References autocvar_g_random_items, CBC_ORDER_LAST, entity(), ITEM_IS_LOOT, M_ARGV, NULL, random_items_is_spawning, and RandomItems_ReplaceMapItem().
| MUTATOR_HOOKFUNCTION | ( | random_items | , |
| ItemTouched | , | ||
| CBC_ORDER_LAST | ) |
Hook that is called after the player has touched an item.
Definition at line 347 of file sv_random_items.qc.
References autocvar_g_random_items, CBC_ORDER_LAST, entity(), ITEM_IS_LOOT, Item_ScheduleRespawn(), M_ARGV, NULL, and RandomItems_ReplaceMapItem().
| MUTATOR_HOOKFUNCTION | ( | random_items | , |
| PlayerDies | ) |
Hook which is called when the player dies.
Definition at line 369 of file sv_random_items.qc.
References autocvar_g_random_loot, autocvar_g_random_loot_max, autocvar_g_random_loot_min, entity(), floor(), M_ARGV, random(), RandomItems_SpawnLootItem(), and vector.
Returns list of classnames to replace a map item with.
| [in] | item | Item to inspect. |
Definition at line 200 of file sv_random_items.qc.
References cvar_string(), CVAR_TYPEFLAG_EXISTS, entity(), and LOG_WARNF.
Referenced by RandomItems_ReplaceMapItem().
Returns a random classname of the item.
| [in] | prefix | Prefix of the cvars that hold probabilities. |
Definition at line 54 of file sv_random_items.qc.
References M_ARGV, MUTATOR_CALLHOOK, RANDOM_ITEM_TYPE_ALL, RandomItems_GetRandomItemClassName(), and RandomItems_GetRandomVanillaItemClassName().
Referenced by MUTATOR_HOOKABLE(), MUTATOR_HOOKFUNCTION(), MUTATOR_HOOKFUNCTION(), RandomItems_GetRandomItemClassName(), RandomItems_ReplaceMapItem(), and RandomItems_SpawnLootItem().
Returns a random classname of the item with specific property.
| [in] | prefix | Prefix of the cvars that hold probabilities. |
Definition at line 211 of file sv_random_items.qc.
References cvar(), CVAR_TYPEFLAG_EXISTS, FOREACH, ITEM_FLAG_NORMAL, Item_IsDefinitionAllowed(), LOG_WARNF, RandomSelection_AddString, RandomSelection_chosen_string, and RandomSelection_Init().
Referenced by RandomItems_GetRandomVanillaItemClassName().
Returns a random classname of the vanilla item.
| [in] | prefix | Prefix of the cvars that hold probabilities. |
| [in] | types | Bitmask of the types. See RANDOM_ITEM_TYPE constants. |
Definition at line 64 of file sv_random_items.qc.
References cvar(), CVAR_TYPEFLAG_EXISTS, FOREACH, instanceOfAmmo, instanceOfArmor, instanceOfHealth, instanceOfPowerup, LOG_WARNF, RANDOM_ITEM_TYPE_ARMOR, RANDOM_ITEM_TYPE_HEALTH, RANDOM_ITEM_TYPE_POWERUP, RANDOM_ITEM_TYPE_RESOURCE, RANDOM_ITEM_TYPE_WEAPON, RandomItems_GetRandomItemClassNameWithProperty(), RandomSelection_AddFloat, RandomSelection_AddString, RandomSelection_chosen_float, RandomSelection_chosen_string, RandomSelection_Init(), Weapons, and WEP_FLAG_MUTATORBLOCKED.
Referenced by RandomItems_GetRandomItemClassName().
Replaces a map item.
| [in] | item | Item to replace. |
Definition at line 233 of file sv_random_items.qc.
References argv(), entity(), floor(), Item_CopyFields(), Item_Initialise(), MUTATOR_IS_ENABLED, NULL, random(), random_items_is_spawning, RandomItems_GetItemReplacementClassNames(), RandomItems_GetRandomItemClassName(), spawn, strzone(), and tokenize_console.
Referenced by MUTATOR_HOOKFUNCTION(), and MUTATOR_HOOKFUNCTION().
Spawns a random loot item.
| [in] | position | Position of the item. |
Definition at line 286 of file sv_random_items.qc.
References autocvar_g_random_loot_spread, autocvar_g_random_loot_time, entity(), Item_Initialise(), MUTATOR_IS_ENABLED, random_items_is_spawning, RandomItems_GetRandomItemClassName(), randomvec(), spawn, and vector.
Referenced by MUTATOR_HOOKFUNCTION().
| float autocvar_g_random_loot_max |
Maximum amount of loot items.
Definition at line 28 of file sv_random_items.qc.
Referenced by MUTATOR_HOOKFUNCTION().
| float autocvar_g_random_loot_min |
Classnames to replace s with.
string autocvar_g_random_items_replace_s;
Probability of random s spawning in the map. float autocvar_g_random_items_s_probability;
Probability of random s spawning in the map during overkill. float autocvar_g_random_items_overkill_s_probability; Minimum amount of loot items.
Definition at line 27 of file sv_random_items.qc.
Referenced by MUTATOR_HOOKFUNCTION().
| float autocvar_g_random_loot_spread |
How far can loot be thrown.
Definition at line 30 of file sv_random_items.qc.
Referenced by RandomItems_SpawnLootItem().
| float autocvar_g_random_loot_time |
Amount of time the loot will stay.
Definition at line 29 of file sv_random_items.qc.
Referenced by RandomItems_SpawnLootItem().
Probability of random s spawning as loot.
float autocvar_g_random_loot_s_probability;
Probability of random s spawning as loot during overkill. float autocvar_g_random_loot_overkill_s_probability;
Holds whether random item is spawning. Used to prevent infinite recursion.
Definition at line 42 of file sv_random_items.qc.
Referenced by MUTATOR_HOOKFUNCTION(), RandomItems_ReplaceMapItem(), and RandomItems_SpawnLootItem().