Cleanup scripts.

This commit is contained in:
JezuzLizard
2024-02-07 05:19:21 -08:00
parent 4bbd8bf1fb
commit 7c043cee57
25 changed files with 495 additions and 384 deletions

View File

@ -35,6 +35,11 @@ precache_fx()
level._effect["avogadro_health_low"] = loadfx( "maps/zombie/fx_zmb_avog_health_low" );
}
main()
{
precache();
}
init()
{
init_phase_anims();

View File

@ -19,6 +19,29 @@
#include maps\mp\animscripts\zm_death;
#include maps\mp\zombies\_zm_perks;
precache()
{
level._effect["brutus_flashlight"] = loadfx( "maps/zombie_alcatraz/fx_alcatraz_brut_light" );
level._effect["brutus_spawn"] = loadfx( "maps/zombie_alcatraz/fx_alcatraz_brut_spawn" );
level._effect["brutus_death"] = loadfx( "maps/zombie_alcatraz/fx_alcatraz_brut_spawn" );
level._effect["brutus_teargas"] = loadfx( "maps/zombie_alcatraz/fx_alcatraz_brut_gas" );
level._effect["brutus_lockdown"] = loadfx( "maps/zombie_alcatraz/fx_alcatraz_perk_lock" );
level._effect["brutus_lockdown_sm"] = loadfx( "maps/zombie_alcatraz/fx_alcatraz_perk_s_lock" );
level._effect["brutus_lockdown_lg"] = loadfx( "maps/zombie_alcatraz/fx_alcatraz_w_bench_lock" );
precachemodel( "c_zom_cellbreaker_helmet" );
precacheshellshock( "mp_radiation_high" );
precacheshellshock( "mp_radiation_med" );
precacheshellshock( "mp_radiation_low" );
precachestring( &"ZOMBIE_LOCKED_COST" );
precachestring( &"ZOMBIE_LOCKED_COST_2000" );
precachestring( &"ZOMBIE_LOCKED_COST_4000" );
precachestring( &"ZOMBIE_LOCKED_COST_6000" );
flag_init( "brutus_setup_complete" );
setdvar( "zombie_double_wide_checks", 1 );
registerclientfield( "actor", "helmet_off", 9000, 1, "int" );
registerclientfield( "actor", "brutus_lock_down", 9000, 1, "int" );
}
main()
{
level._effect["brutus_flashlight"] = loadfx( "maps/zombie_alcatraz/fx_alcatraz_brut_light" );
@ -118,8 +141,84 @@ main()
setup_devgui();
#/
level.custom_perk_validation = ::check_perk_machine_valid;
//level.custom_craftable_validation = ::check_craftable_table_valid;
//level.custom_plane_validation = ::check_plane_valid;
level.custom_craftable_validation = ::check_craftable_table_valid;
level.custom_plane_validation = ::check_plane_valid;
}
}
init()
{
level.brutus_spawners = getentarray( "brutus_zombie_spawner", "script_noteworthy" );
if ( level.brutus_spawners.size == 0 )
return;
array_thread( level.brutus_spawners, ::add_spawn_function, ::brutus_prespawn );
for ( i = 0; i < level.brutus_spawners.size; i++ )
{
level.brutus_spawners[i].is_enabled = 1;
level.brutus_spawners[i].script_forcespawn = 1;
}
level.brutus_spawn_positions = getstructarray( "brutus_location", "script_noteworthy" );
level thread setup_interaction_matrix();
level.sndbrutusistalking = 0;
level.brutus_health = 500;
level.brutus_health_increase = 1000;
level.brutus_round_count = 0;
level.brutus_last_spawn_round = 0;
level.brutus_count = 0;
level.brutus_max_count = 1;
level.brutus_damage_percent = 0.1;
level.brutus_helmet_shots = 5;
level.brutus_team_points_for_death = 500;
level.brutus_player_points_for_death = 250;
level.brutus_points_for_helmet = 250;
level.brutus_alarm_chance = 100;
level.brutus_min_alarm_chance = 100;
level.brutus_alarm_chance_increment = 10;
level.brutus_max_alarm_chance = 200;
level.brutus_min_round_fq = 4;
level.brutus_max_round_fq = 7;
level.brutus_reset_dist_sq = 262144;
level.brutus_aggro_dist_sq = 16384;
level.brutus_aggro_earlyout = 12;
level.brutus_blocker_pieces_req = 1;
level.brutus_zombie_per_round = 1;
level.brutus_players_in_zone_spawn_point_cap = 120;
level.brutus_teargas_duration = 7;
level.player_teargas_duration = 2;
level.brutus_teargas_radius = 64;
level.num_pulls_since_brutus_spawn = 0;
level.brutus_min_pulls_between_box_spawns = 4;
level.brutus_explosive_damage_for_helmet_pop = 1500;
level.brutus_explosive_damage_increase = 600;
level.brutus_failed_paths_to_teleport = 4;
level.brutus_do_prologue = 1;
level.brutus_min_spawn_delay = 10.0;
level.brutus_max_spawn_delay = 60.0;
level.brutus_respawn_after_despawn = 1;
level.brutus_in_grief = 0;
if ( getdvar( #"ui_gametype" ) == "zgrief" )
level.brutus_in_grief = 1;
level.brutus_shotgun_damage_mod = 1.5;
level.brutus_custom_goalradius = 48;
registerclientfield( "actor", "helmet_off", 9000, 1, "int" );
registerclientfield( "actor", "brutus_lock_down", 9000, 1, "int" );
level thread maps\mp\zombies\_zm_ai_brutus::brutus_spawning_logic();
if ( !level.brutus_in_grief )
{
level thread maps\mp\zombies\_zm_ai_brutus::get_brutus_interest_points();
/#
setup_devgui();
#/
level.custom_perk_validation = maps\mp\zombies\_zm_ai_brutus::check_perk_machine_valid;
level.custom_craftable_validation = maps\mp\zombies\_zm_ai_brutus::check_craftable_table_valid;
level.custom_plane_validation = maps\mp\zombies\_zm_ai_brutus::check_plane_valid;
}
}

View File

@ -40,6 +40,69 @@ precache_fx()
}
}
main()
{
precache_fx();
maps\mp\zombies\_zm_ai_ghost_ffotd::ghost_init_start();
register_client_fields();
flag_init( "spawn_ghosts" );
if ( !init_ghost_spawners() )
return;
level.slowgun_reset_anim_func = getFunction( "maps/mp/zombies/_zm_weap_slowgun", "reset_anim" );
level.slowgun_set_anim_rate_func = getFunction( "maps/mp/zombies/_zm_weap_slowgun", "set_anim_rate" );
level.slowgun_zombie_slow_for_time = getFunction( "maps/mp/zombies/_zm_weap_slowgun", "zombie_slow_for_time" );
level.time_bomb_get_time_bomb_saved_round_type = getFunction( "maps/mp/zombies/_zm_weap_time_bomb", "get_time_bomb_saved_round_type" );
level.time_bomb_time_bomb_add_custom_func_global_save = getFunction( "maps/mp/zombies/_zm_weap_time_bomb", "time_bomb_add_custom_func_global_save" );
level.time_bomb_time_bomb_add_custom_func_global_restore = getFunction( "maps/mp/zombies/_zm_weap_time_bomb", "time_bomb_add_custom_func_global_restore" );
level.time_bomb_register_time_bomb_enemy_save_filter = getFunction( "maps/mp/zombies/_zm_weap_time_bomb", "register_time_bomb_enemy_save_filter" );
level.time_bomb_register_time_bomb_enemy = getFunction( "maps/mp/zombies/_zm_weap_time_bomb", "register_time_bomb_enemy" );
init_ghost_zone();
init_ghost_sounds();
init_ghost_script_move_path_data();
level.zombie_ai_limit_ghost = 4;
level.zombie_ai_limit_ghost_per_player = 1;
level.zombie_ghost_count = 0;
level.ghost_health = 100;
level.zombie_ghost_round_states = spawnstruct();
level.zombie_ghost_round_states.any_player_in_ghost_zone = 0;
level.zombie_ghost_round_states.active_zombie_locations = [];
level.is_ghost_round_started = ::is_ghost_round_started;
level.zombie_ghost_round_states.is_started = 0;
level.zombie_ghost_round_states.is_first_ghost_round_finished = 0;
level.zombie_ghost_round_states.current_ghost_round_number = 0;
level.zombie_ghost_round_states.next_ghost_round_number = 0;
level.zombie_ghost_round_states.presentation_stage_1_started = 0;
level.zombie_ghost_round_states.presentation_stage_2_started = 0;
level.zombie_ghost_round_states.presentation_stage_3_started = 0;
level.zombie_ghost_round_states.is_teleporting = 0;
level.zombie_ghost_round_states.round_count = 0;
level thread ghost_round_presentation_think();
if ( isdefined( level.ghost_round_think_override_func ) )
level thread [[ level.ghost_round_think_override_func ]]();
else
level thread ghost_round_think();
level thread player_in_ghost_zone_monitor();
if ( isdefined( level.ghost_zone_spawning_think_override_func ) )
level thread [[ level.ghost_zone_spawning_think_override_func ]]();
else
level thread ghost_zone_spawning_think();
level thread ghost_vox_think();
init_time_bomb_ghost_rounds();
/#
level.force_no_ghost = 0;
level.ghost_devgui_toggle_no_ghost = ::devgui_toggle_no_ghost;
level.ghost_devgui_warp_to_mansion = ::devgui_warp_to_mansion;
#/
maps\mp\zombies\_zm_ai_ghost_ffotd::ghost_init_end();
}
init()
{
maps\mp\zombies\_zm_ai_ghost_ffotd::ghost_init_start();

View File

@ -45,6 +45,19 @@ precache()
precacheshellshock( "lava_small" );
}
register_clientfields()
{
registerclientfield( "actor", "mechz_fx", 14000, 12, "int" );
registerclientfield( "toplayer", "mechz_grab", 14000, 1, "int" );
registerclientfield( "actor", "anim_rate", 14000, 2, "float" );
}
main()
{
register_clientfields();
precache();
}
#using_animtree("mechz_claw");
init()
@ -1295,8 +1308,13 @@ mechz_find_flesh()
self.ai_state = "tracking_tank";
self.goalradius = level.mechz_custom_goalradius;
self.custom_goalradius_override = level.mechz_custom_goalradius;
closest_tank_tag = level.vh_tank get_closest_mechz_tag_on_tank( self, self.origin );
func = getFunction( "maps/mp/zm_tomb_tank", "get_closest_mechz_tag_on_tank" );
closest_tank_tag = undefined;
if ( isDefined( func ) )
{
closest_tank_tag = level.vh_tank [[ func ]]( self, self.origin );
}
if ( !isdefined( closest_tank_tag ) )
{
/#
@ -1319,7 +1337,7 @@ mechz_find_flesh()
self setgoalpos( self.goal_pos );
self waittill_any_or_timeout( 0.5, "goal", "bad_path" );
if ( !player entity_on_tank() )
if ( isDefined( entity_on_tank_func ) && !player [[ entity_on_tank_func ]]() )
{
/#
if ( getdvarint( #"_id_E7121222" ) > 1 )
@ -1666,14 +1684,15 @@ mechz_set_locomotion_speed()
self endon( "death" );
self.prev_move_speed = self.zombie_move_speed;
entity_on_tank_func = getFunction( "maps/mp/zm_tomb_tank", "entity_on_tank" );
if ( !isdefined( self.favoriteenemy ) )
self.zombie_move_speed = "walk";
else if ( isdefined( self.force_run ) && self.force_run )
self.zombie_move_speed = "run";
else if ( isdefined( self.force_sprint ) && self.force_sprint )
self.zombie_move_speed = "sprint";
// else if ( isdefined( self.favoriteenemy ) && self.favoriteenemy entity_on_tank() && isdefined( level.vh_tank ) && level.vh_tank ent_flag( "tank_activated" ) )
// self.zombie_move_speed = "run";
else if ( isDefined( entity_on_tank_func ) && isdefined( self.favoriteenemy ) && self.favoriteenemy [[ entity_on_tank_func ]]() && isdefined( level.vh_tank ) && level.vh_tank ent_flag( "tank_activated" ) )
self.zombie_move_speed = "run";
else if ( isdefined( self.favoriteenemy ) && distancesquared( self.origin, self.favoriteenemy.origin ) > level.mechz_dist_for_sprint )
self.zombie_move_speed = "run";
else if ( !( isdefined( self.has_powerplant ) && self.has_powerplant ) )

View File

@ -28,6 +28,18 @@ precache()
level._effect["screecher_death"] = loadfx( "maps/zombie/fx_zmb_screech_death_ash" );
}
register_clientfields()
{
maps\mp\_visionset_mgr::vsmgr_register_info( "overlay", "zm_ai_screecher_blur", 1, level.vsmgr_prio_overlay_zm_ai_screecher_blur, 1, 1, maps\mp\_visionset_mgr::vsmgr_timeout_lerp_thread_per_player, 0 );
registerclientfield( "actor", "render_third_person", 1, 1, "int" );
}
main()
{
register_clientfields();
precache();
}
init()
{
level.screecher_spawners = getentarray( "screecher_zombie_spawner", "script_noteworthy" );