1
0
mirror of https://github.com/JezuzLizard/BO2-Reimagined.git synced 2025-06-22 13:10:28 -05:00

Die Rise: increase elevator disable zombie spawn distance

Die Rise: use centroid for elevator origin check to disable zombie spawn
This commit is contained in:
Jbleezy
2023-04-09 03:33:39 -07:00
parent d0010fcd67
commit f88f06bb10
3 changed files with 90 additions and 0 deletions

View File

@ -0,0 +1,87 @@
#include maps\mp\_utility;
#include common_scripts\utility;
#include maps\mp\zombies\_zm_utility;
#include maps\mp\gametypes_zm\_hostmigration;
#include maps\mp\zm_highrise_utility;
#include maps\mp\zm_highrise_distance_tracking;
#include maps\mp\animscripts\zm_shared;
#include maps\mp\zombies\_zm_ai_basic;
#include maps\mp\zombies\_zm_ai_leaper;
#include maps\mp\zm_highrise_elevators;
faller_location_logic()
{
wait 1;
faller_spawn_points = getstructarray( "faller_location", "script_noteworthy" );
leaper_spawn_points = getstructarray( "leaper_location", "script_noteworthy" );
spawn_points = arraycombine( faller_spawn_points, leaper_spawn_points, 1, 0 );
dist_check = 65536;
elevator_names = getarraykeys( level.elevators );
elevators = [];
for ( i = 0; i < elevator_names.size; i++ )
elevators[i] = getent( "elevator_" + elevator_names[i] + "_body", "targetname" );
elevator_volumes = [];
elevator_volumes[elevator_volumes.size] = getent( "elevator_1b", "targetname" );
elevator_volumes[elevator_volumes.size] = getent( "elevator_1c", "targetname" );
elevator_volumes[elevator_volumes.size] = getent( "elevator_1d", "targetname" );
elevator_volumes[elevator_volumes.size] = getent( "elevator_3a", "targetname" );
elevator_volumes[elevator_volumes.size] = getent( "elevator_3b", "targetname" );
elevator_volumes[elevator_volumes.size] = getent( "elevator_3c", "targetname" );
elevator_volumes[elevator_volumes.size] = getent( "elevator_3d", "targetname" );
level.elevator_volumes = elevator_volumes;
while ( true )
{
foreach ( point in spawn_points )
{
should_block = 0;
foreach ( elevator in elevators )
{
if ( distancesquared( elevator getCentroid(), point.origin ) <= dist_check )
should_block = 1;
}
if ( should_block )
{
point.is_enabled = 0;
point.is_blocked = 1;
continue;
}
if ( isdefined( point.is_blocked ) && point.is_blocked )
point.is_blocked = 0;
if ( !isdefined( point.zone_name ) )
continue;
zone = level.zones[point.zone_name];
if ( zone.is_enabled && zone.is_active && zone.is_spawning_allowed )
point.is_enabled = 1;
}
players = get_players();
foreach ( volume in elevator_volumes )
{
should_disable = 0;
foreach ( player in players )
{
if ( is_player_valid( player ) )
{
if ( player istouching( volume ) )
should_disable = 1;
}
}
if ( should_disable )
disable_elevator_spawners( volume, spawn_points );
}
wait 0.05;
}
}

View File

@ -9,6 +9,7 @@
#include scripts\zm\replaced\zm_highrise_gamemodes;
#include scripts\zm\replaced\zm_highrise_classic;
#include scripts\zm\replaced\zm_highrise_buildables;
#include scripts\zm\replaced\zm_highrise_elevators;
#include scripts\zm\replaced\_zm_chugabud;
#include scripts\zm\replaced\_zm_equip_springpad;
#include scripts\zm\replaced\_zm_weap_slipgun;
@ -31,6 +32,7 @@ main()
replaceFunc(maps\mp\zm_highrise_classic::insta_kill_player, scripts\zm\replaced\zm_highrise_classic::insta_kill_player);
replaceFunc(maps\mp\zm_highrise_buildables::init_buildables, scripts\zm\replaced\zm_highrise_buildables::init_buildables);
replaceFunc(maps\mp\zm_highrise_buildables::include_buildables, scripts\zm\replaced\zm_highrise_buildables::include_buildables);
replaceFunc(maps\mp\zm_highrise_elevators::faller_location_logic, scripts\zm\replaced\zm_highrise_elevators::faller_location_logic);
replaceFunc(maps\mp\zombies\_zm_chugabud::chugabud_bleed_timeout, scripts\zm\replaced\_zm_chugabud::chugabud_bleed_timeout);
replaceFunc(maps\mp\zombies\_zm_equip_springpad::springpadthink, scripts\zm\replaced\_zm_equip_springpad::springpadthink);
replaceFunc(maps\mp\zombies\_zm_weap_slipgun::init, scripts\zm\replaced\_zm_weap_slipgun::init);