1
0
mirror of https://github.com/JezuzLizard/BO2-Reimagined.git synced 2025-06-11 15:48:05 -05:00

Powerups: change chance to drop

This commit is contained in:
Jbleezy
2023-04-29 09:35:53 -07:00
parent 527ec9a470
commit b2909a7a1e
3 changed files with 71 additions and 0 deletions

View File

@ -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);

View File

@ -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];