diff --git a/README.md b/README.md index 4641dc6c..6d47e465 100644 --- a/README.md +++ b/README.md @@ -381,6 +381,7 @@ * Decreased weapon pickup time from 15 seconds to 12 seconds ## Powerups +* Increased chance to drop from 3% to 4% * Grabbing time based powerups that are already active add to timer instead of resetting timer * An fx plays when a powerup drops if it is the last powerup of a cycle @@ -773,6 +774,7 @@ * Increased max radius for landing on top of an enemy player by 16.67% * Decreased max height for landing on top of an enemy player by 50% * M1911 upgraded: decreased stock ammo from 50 to 24 +* Powerups: decreased chance to drop from 3% to 2% * Max Ammo: decreased amount of ammo given from max stock to one clip * Max Ammo: unloads clip of all enemy players' weapons and takes away their grenades and claymores * Double Points: decreased duration from 30 seconds to 15 seconds diff --git a/scripts/zm/_zm_reimagined.gsc b/scripts/zm/_zm_reimagined.gsc index 7b36a4ee..928ebca0 100644 --- a/scripts/zm/_zm_reimagined.gsc +++ b/scripts/zm/_zm_reimagined.gsc @@ -102,6 +102,7 @@ main() replaceFunc(maps\mp\zombies\_zm_perks::perk_pause, scripts\zm\replaced\_zm_perks::perk_pause); replaceFunc(maps\mp\zombies\_zm_perks::perk_unpause, scripts\zm\replaced\_zm_perks::perk_unpause); replaceFunc(maps\mp\zombies\_zm_power::standard_powered_items, scripts\zm\replaced\_zm_power::standard_powered_items); + replaceFunc(maps\mp\zombies\_zm_powerups::powerup_drop, scripts\zm\replaced\_zm_powerups::powerup_drop); replaceFunc(maps\mp\zombies\_zm_powerups::get_next_powerup, scripts\zm\replaced\_zm_powerups::get_next_powerup); replaceFunc(maps\mp\zombies\_zm_powerups::powerup_grab, scripts\zm\replaced\_zm_powerups::powerup_grab); replaceFunc(maps\mp\zombies\_zm_powerups::full_ammo_powerup, scripts\zm\replaced\_zm_powerups::full_ammo_powerup); diff --git a/scripts/zm/replaced/_zm_powerups.gsc b/scripts/zm/replaced/_zm_powerups.gsc index 7dff1e8d..f0a9b03c 100644 --- a/scripts/zm/replaced/_zm_powerups.gsc +++ b/scripts/zm/replaced/_zm_powerups.gsc @@ -2,6 +2,74 @@ #include common_scripts\utility; #include maps\mp\zombies\_zm_utility; +powerup_drop( drop_point ) +{ + if ( level.powerup_drop_count >= level.zombie_vars["zombie_powerup_drop_max_per_round"] ) + { + return; + } + + if ( !isdefined( level.zombie_include_powerups ) || level.zombie_include_powerups.size == 0 ) + return; + + rand_drop = randomint( 100 ); + + powerup_chance = 4; + if ( is_gametype_active( "zgrief" ) ) + { + powerup_chance = 2; + } + + if ( rand_drop >= powerup_chance ) + { + if ( !level.zombie_vars["zombie_drop_item"] ) + return; + + debug = "score"; + } + else + debug = "random"; + + playable_area = getentarray( "player_volume", "script_noteworthy" ); + level.powerup_drop_count++; + powerup = maps\mp\zombies\_zm_net::network_safe_spawn( "powerup", 1, "script_model", drop_point + vectorscale( ( 0, 0, 1 ), 40.0 ) ); + valid_drop = 0; + + for ( i = 0; i < playable_area.size; i++ ) + { + if ( powerup istouching( playable_area[i] ) ) + valid_drop = 1; + } + + if ( valid_drop && level.rare_powerups_active ) + { + pos = ( drop_point[0], drop_point[1], drop_point[2] + 42 ); + + if ( check_for_rare_drop_override( pos ) ) + { + level.zombie_vars["zombie_drop_item"] = 0; + valid_drop = 0; + } + } + + if ( !valid_drop ) + { + level.powerup_drop_count--; + powerup delete(); + return; + } + + powerup powerup_setup(); + print_powerup_drop( powerup.powerup_name, debug ); + powerup thread powerup_timeout(); + powerup thread powerup_wobble(); + powerup thread powerup_grab(); + powerup thread powerup_move(); + powerup thread powerup_emp(); + level.zombie_vars["zombie_drop_item"] = 0; + level notify( "powerup_dropped", powerup ); +} + get_next_powerup() { powerup = level.zombie_powerup_array[level.zombie_powerup_index];