set g_random_items_replace_item_bullets 1 "Whether to randomly replace bullets."
set g_random_items_replace_item_rockets 1 "Whether to randomly replace rockets."
set g_random_items_replace_item_cells 1 "Whether to randomly replace cells."
+set g_random_items_replace_item_plasma 1 "Whether to randomly replace plasma."
+set g_random_items_replace_item_fuel 1 "Whether to randomly replace fuel."
set g_random_items_replace_weapon_blaster 1 "Whether to randomly replace blaster."
set g_random_items_replace_weapon_shotgun 1 "Whether to randomly replace shotgun."
set g_random_items_replace_weapon_machinegun 1 "Whether to randomly replace machinegun."
set g_random_items_replace_weapon_vaporizer 1 "Whether to randomly replace vaporizer."
set g_random_items_replace_item_strength 1 "Whether to randomly replace strength."
set g_random_items_replace_item_shield 1 "Whether to randomly replace shield."
-set g_random_map_health_probability 1 "Probability of random health items spawning in the map."
-set g_random_map_armor_probability 1 "Probability of random armor items spawning in the map."
-set g_random_map_ammo_probability 1 "Probability of random ammo items spawning in the map."
-set g_random_map_weapon_probability 1 "Probability of random weapons spawning in the map."
-set g_random_map_powerup_probability 0.25 "Probability of random powerups spawning in the map."
-set g_random_map_health_small_probability 10 "Probability of random small health spawning in the map."
-set g_random_map_health_medium_probability 4 "Probability of random medium health spawning in the map."
-set g_random_map_health_big_probability 2 "Probability of random big health spawning in the map."
-set g_random_map_health_mega_probability 1 "Probability of random mega health spawning in the map."
-set g_random_map_armor_small_probability 10 "Probability of random small armor spawning in the map."
-set g_random_map_armor_medium_probability 4 "Probability of random medium armor spawning in the map."
-set g_random_map_armor_big_probability 2 "Probability of random big armor spawning in the map."
-set g_random_map_armor_mega_probability 1 "Probability of random mega armor spawning in the map."
-set g_random_map_ammo_shells_probability 1 "Probability of random shells spawning in the map."
-set g_random_map_ammo_bullets_probability 1 "Probability of random bullets spawning in the map."
-set g_random_map_ammo_rockets_probability 1 "Probability of random rockets spawning in the map."
-set g_random_map_ammo_cells_probability 1 "Probability of random cells spawning in the map."
-set g_random_map_weapon_blaster_probability 0 "Probability of random blaster spawning in the map."
-set g_random_map_weapon_shotgun_probability 0 "Probability of random shotgun spawning in the map."
-set g_random_map_weapon_machinegun_probability 1 "Probability of random machinegun spawning in the map."
-set g_random_map_weapon_mortar_probability 1 "Probability of random mortar spawning in the map."
-set g_random_map_weapon_electro_probability 1 "Probability of random electro spawning in the map."
-set g_random_map_weapon_crylink_probability 1 "Probability of random crylink spawning in the map."
-set g_random_map_weapon_vortex_probability 1 "Probability of random vortex spawning in the map."
-set g_random_map_weapon_hagar_probability 1 "Probability of random hagar spawning in the map."
-set g_random_map_weapon_devastator_probability 1 "Probability of random devastator spawning in the map."
-set g_random_map_weapon_shockwave_probability 0 "Probability of random shockwave spawning in the map."
-set g_random_map_weapon_arc_probability 0 "Probability of random arc spawning in the map."
-set g_random_map_weapon_hook_probability 0 "Probability of random hook spawning in the map."
-set g_random_map_weapon_tuba_probability 0 "Probability of random tuba spawning in the map."
-set g_random_map_weapon_porto_probability 0 "Probability of random port-o-launch spawning in the map."
-set g_random_map_weapon_fireball_probability 0 "Probability of random fireball spawning in the map."
-set g_random_map_weapon_minelayer_probability 0 "Probability of random mine layer spawning in the map."
-set g_random_map_weapon_hlac_probability 0 "Probability of random HLAC spawning in the map."
-set g_random_map_weapon_rifle_probability 0 "Probability of random rifle spawning in the map."
-set g_random_map_weapon_seeker_probability 0 "Probability of random TAG seeker spawning in the map."
-set g_random_map_weapon_vaporizer_probability 0 "Probability of random vaporizer spawning in the map."
-set g_random_map_strength_probability 1 "Probability of random strength spawning in the map."
-set g_random_map_shield_probability 1 "Probability of random shield spawning in the map."
+set g_random_items_replace_item_fuel_regen 1 "Whether to randomly replace fuel regeneration."
+set g_random_items_replace_item_jetpack 1 "Whether to randomly replace jetpack."
+set g_random_items_health_probability 1 "Probability of random health items spawning in the map."
+set g_random_items_armor_probability 1 "Probability of random armor items spawning in the map."
+set g_random_items_resource_probability 1 "Probability of random ammo items spawning in the map."
+set g_random_items_weapon_probability 1 "Probability of random weapons spawning in the map."
+set g_random_items_powerup_probability 0.2 "Probability of random powerups spawning in the map."
+set g_random_items_health_small_probability 10 "Probability of random small health spawning in the map."
+set g_random_items_health_medium_probability 4 "Probability of random medium health spawning in the map."
+set g_random_items_health_big_probability 2 "Probability of random big health spawning in the map."
+set g_random_items_health_mega_probability 1 "Probability of random mega health spawning in the map."
+set g_random_items_armor_small_probability 10 "Probability of random small armor spawning in the map."
+set g_random_items_armor_medium_probability 4 "Probability of random medium armor spawning in the map."
+set g_random_items_armor_big_probability 2 "Probability of random big armor spawning in the map."
+set g_random_items_armor_mega_probability 1 "Probability of random mega armor spawning in the map."
+set g_random_items_resource_shells_probability 1 "Probability of random shells spawning in the map."
+set g_random_items_resource_bullets_probability 1 "Probability of random bullets spawning in the map."
+set g_random_items_resource_rockets_probability 1 "Probability of random rockets spawning in the map."
+set g_random_items_resource_cells_probability 1 "Probability of random cells spawning in the map."
+set g_random_items_resource_plasma_probability 0 "Probability of random plasma spawning in the map."
+set g_random_items_resource_fuel_probability 0 "Probability of random fuel spawning in the map."
+set g_random_items_weapon_blaster_probability 0 "Probability of random blaster spawning in the map."
+set g_random_items_weapon_shotgun_probability 0 "Probability of random shotgun spawning in the map."
+set g_random_items_weapon_machinegun_probability 1 "Probability of random machinegun spawning in the map."
+set g_random_items_weapon_mortar_probability 1 "Probability of random mortar spawning in the map."
+set g_random_items_weapon_electro_probability 1 "Probability of random electro spawning in the map."
+set g_random_items_weapon_crylink_probability 1 "Probability of random crylink spawning in the map."
+set g_random_items_weapon_vortex_probability 1 "Probability of random vortex spawning in the map."
+set g_random_items_weapon_hagar_probability 1 "Probability of random hagar spawning in the map."
+set g_random_items_weapon_devastator_probability 1 "Probability of random devastator spawning in the map."
+set g_random_items_weapon_shockwave_probability 0 "Probability of random shockwave spawning in the map."
+set g_random_items_weapon_arc_probability 0 "Probability of random arc spawning in the map."
+set g_random_items_weapon_hook_probability 0 "Probability of random hook spawning in the map."
+set g_random_items_weapon_tuba_probability 0 "Probability of random tuba spawning in the map."
+set g_random_items_weapon_porto_probability 0 "Probability of random port-o-launch spawning in the map."
+set g_random_items_weapon_fireball_probability 0 "Probability of random fireball spawning in the map."
+set g_random_items_weapon_minelayer_probability 0 "Probability of random mine layer spawning in the map."
+set g_random_items_weapon_hlac_probability 0 "Probability of random HLAC spawning in the map."
+set g_random_items_weapon_rifle_probability 0 "Probability of random rifle spawning in the map."
+set g_random_items_weapon_seeker_probability 0 "Probability of random TAG seeker spawning in the map."
+set g_random_items_weapon_vaporizer_probability 0 "Probability of random vaporizer spawning in the map."
+set g_random_items_strength_probability 1 "Probability of random strength spawning in the map."
+set g_random_items_shield_probability 1 "Probability of random shield spawning in the map."
+set g_random_items_fuel_regen_probability 0 "Probability of random fuel regeneration spawning in the map."
+set g_random_items_jetpack_probability 0 "Probability of random jetpack spawning in the map."
+set g_random_loot 0 "Whether to enable random loot."
set g_random_loot_min 0 "Minimum amount of loot items."
set g_random_loot_max 4 "Minimum amount of loot items."
set g_random_loot_time 10 "Amount of time the loot will stay."
+set g_random_loot_spread 200 "How far can loot be thrown."
+set g_random_loot_health_probability 1 "Probability of random health items spawning as loot."
+set g_random_loot_armor_probability 1 "Probability of random armor items spawning as loot."
+set g_random_loot_resource_probability 1 "Probability of random ammo items spawning as loot."
+set g_random_loot_weapon_probability 1 "Probability of random weapons spawning as loot."
+set g_random_loot_powerup_probability 0.2 "Probability of random powerups spawning as loot."
+set g_random_loot_health_small_probability 4 "Probability of random small health spawning as loot."
+set g_random_loot_health_medium_probability 3 "Probability of random medium health spawning as loot."
+set g_random_loot_health_big_probability 2 "Probability of random big health spawning as loot."
+set g_random_loot_health_mega_probability 1 "Probability of random mega health spawning as loot."
+set g_random_loot_armor_small_probability 4 "Probability of random small armor spawning as loot."
+set g_random_loot_armor_medium_probability 3 "Probability of random medium armor spawning as loot."
+set g_random_loot_armor_big_probability 2 "Probability of random big armor spawning as loot."
+set g_random_loot_armor_mega_probability 1 "Probability of random mega armor spawning as loot."
+set g_random_loot_resource_shells_probability 1 "Probability of random shells spawning as loot."
+set g_random_loot_resource_bullets_probability 1 "Probability of random bullets spawning as loot."
+set g_random_loot_resource_rockets_probability 1 "Probability of random rockets spawning as loot."
+set g_random_loot_resource_cells_probability 1 "Probability of random cells spawning as loot."
+set g_random_loot_resource_plasma_probability 0 "Probability of random plasma spawning as loot."
+set g_random_loot_resource_fuel_probability 0 "Probability of random fuel spawning as loot."
+set g_random_loot_weapon_blaster_probability 0 "Probability of random blaster spawning as loot."
+set g_random_loot_weapon_shotgun_probability 0 "Probability of random shotgun spawning as loot."
+set g_random_loot_weapon_machinegun_probability 1 "Probability of random machinegun spawning as loot."
+set g_random_loot_weapon_mortar_probability 1 "Probability of random mortar spawning as loot."
+set g_random_loot_weapon_electro_probability 1 "Probability of random electro spawning as loot."
+set g_random_loot_weapon_crylink_probability 1 "Probability of random crylink spawning as loot."
+set g_random_loot_weapon_vortex_probability 1 "Probability of random vortex spawning as loot."
+set g_random_loot_weapon_hagar_probability 1 "Probability of random hagar spawning as loot."
+set g_random_loot_weapon_devastator_probability 1 "Probability of random devastator spawning as loot."
+set g_random_loot_weapon_shockwave_probability 0 "Probability of random shockwave spawning as loot."
+set g_random_loot_weapon_arc_probability 0 "Probability of random arc spawning as loot."
+set g_random_loot_weapon_hook_probability 0 "Probability of random hook spawning as loot."
+set g_random_loot_weapon_tuba_probability 0 "Probability of random tuba spawning as loot."
+set g_random_loot_weapon_porto_probability 0 "Probability of random port-o-launch spawning as loot."
+set g_random_loot_weapon_fireball_probability 0 "Probability of random fireball spawning as loot."
+set g_random_loot_weapon_minelayer_probability 0 "Probability of random mine layer spawning as loot."
+set g_random_loot_weapon_hlac_probability 0 "Probability of random HLAC spawning as loot."
+set g_random_loot_weapon_rifle_probability 0 "Probability of random rifle spawning as loot."
+set g_random_loot_weapon_seeker_probability 0 "Probability of random TAG seeker spawning as loot."
+set g_random_loot_weapon_vaporizer_probability 0 "Probability of random vaporizer spawning as loot."
+set g_random_loot_strength_probability 1 "Probability of random strength spawning as loot."
+set g_random_loot_shield_probability 1 "Probability of random shield spawning as loot."
+set g_random_loot_fuel_regen_probability 0 "Probability of random fuel regeneration spawning as loot."
+set g_random_loot_jetpack_probability 0 "Probability of random jetpack spawning as loot."
void Item_Touch(entity this, entity toucher)
{
-
// remove the item if it's currnetly in a NODROP brush or hits a NOIMPACT surface (such as sky)
if (Item_IsLoot(this))
{
toucher = M_ARGV(1, entity);
- if (Item_IsLoot(this))
+ // TODO: Proper way to handle expiring and not expiring loot.
+ // Expiring loot will have strength "ticking" will it's dropped.
+ // Not expiring will not tick.
+ // OTOH, do we really need expiring loot?
+ if (this.classname == "droppedweapon")
{
this.strength_finished = max(0, this.strength_finished - time);
this.invincible_finished = max(0, this.invincible_finished - time);
this.superweapons_finished = max(0, this.superweapons_finished - time);
}
- entity it = this.itemdef;
- bool gave = ITEM_HANDLE(Pickup, it, this, toucher);
+ bool gave = ITEM_HANDLE(Pickup, this.itemdef, this, toucher);
if (!gave)
{
if (Item_IsLoot(this))
if (Item_IsLoot(this))
{
this.reset = SUB_Remove;
- // it's a dropped weapon
set_movetype(this, MOVETYPE_TOSS);
// Savage: remove thrown items after a certain period of time ("garbage collection")
this.takedamage = DAMAGE_YES;
this.event_damage = Item_Damage;
- if(this.strength_finished || this.invincible_finished || this.superweapons_finished)
+ // TODO: Proper way to handle expiring and not expiring loot.
+ // Expiring loot will have strength "ticking" will it's dropped.
+ // Not expiring will not tick.
+ // OTOH, do we really need expiring loot?
+ if (this.strength_finished || this.invincible_finished || this.superweapons_finished)
{
// if item is worthless after a timer, have it expire then
this.nextthink = max(this.strength_finished, this.invincible_finished, this.superweapons_finished);