diff --git a/scripts/zm/_zm_reimagined.gsc b/scripts/zm/_zm_reimagined.gsc index 06c04a13..e1af5824 100644 --- a/scripts/zm/_zm_reimagined.gsc +++ b/scripts/zm/_zm_reimagined.gsc @@ -3,6 +3,7 @@ #include maps\mp\zombies\_zm_utility; #include maps\mp\gametypes_zm\_hud_util; +#include scripts/zm/replaced/utility; #include scripts/zm/replaced/_zm; #include scripts/zm/replaced/_zm_playerhealth; #include scripts/zm/replaced/_zm_utility; @@ -18,6 +19,7 @@ main() { + replaceFunc(common_scripts/utility::struct_class_init, scripts/zm/replaced/utility::struct_class_init); replaceFunc(maps/mp/zombies/_zm::check_quickrevive_for_hotjoin, scripts/zm/replaced/_zm::check_quickrevive_for_hotjoin); replaceFunc(maps/mp/zombies/_zm::last_stand_pistol_rank_init, scripts/zm/replaced/_zm::last_stand_pistol_rank_init); replaceFunc(maps/mp/zombies/_zm::actor_damage_override, scripts/zm/replaced/_zm::actor_damage_override); diff --git a/scripts/zm/locs/common.gsc b/scripts/zm/locs/common.gsc new file mode 100644 index 00000000..650b9df4 --- /dev/null +++ b/scripts/zm/locs/common.gsc @@ -0,0 +1,177 @@ +#include maps/mp/_utility; +#include maps/mp/zombies/_zm_utility; +#include common_scripts/utility; + +common_init() +{ + level.create_spawner_list_func = ::create_spawner_list; + level.enemy_location_override_func = ::enemy_location_override; + flag_wait( "initial_blackscreen_passed" ); + maps/mp/zombies/_zm_game_module::turn_power_on_and_open_doors(); + flag_wait( "start_zombie_round_logic" ); + wait 1; + level notify( "revive_on" ); + wait_network_frame(); + level notify( "doubletap_on" ); + wait_network_frame(); + level notify( "marathon_on" ); + wait_network_frame(); + level notify( "juggernog_on" ); + wait_network_frame(); + level notify( "sleight_on" ); + wait_network_frame(); + level notify( "tombstone_on" ); + wait_network_frame(); + level notify( "Pack_A_Punch_on" ); +} + +enemy_location_override( zombie, enemy ) +{ + location = enemy.origin; + if ( is_true( self.reroute ) ) + { + if ( isDefined( self.reroute_origin ) ) + { + location = self.reroute_origin; + } + } + return location; +} + +create_spawner_list( zkeys ) +{ + level.zombie_spawn_locations = []; + level.inert_locations = []; + level.enemy_dog_locations = []; + level.zombie_screecher_locations = []; + level.zombie_avogadro_locations = []; + level.quad_locations = []; + level.zombie_leaper_locations = []; + level.zombie_astro_locations = []; + level.zombie_brutus_locations = []; + level.zombie_mechz_locations = []; + level.zombie_napalm_locations = []; + for ( z = 0; z < zkeys.size; z++ ) + { + zone = level.zones[ zkeys[ z ] ]; + if ( zone.is_enabled && zone.is_active && zone.is_spawning_allowed ) + { + i = 0; + while ( i < zone.spawn_locations.size ) + { + if ( !is_true( zone.spawn_locations[ i ].checked ) ) + { + if ( zone.spawn_locations[ i ].origin == ( 8394, -2545, -205.16 ) ) + { + zone.spawn_locations[ i ].is_enabled = false; + } + else if ( zone.spawn_locations[ i ].origin == ( 10705, 7347, -576 ) ) + { + zone.spawn_locations[ i ].is_enabled = false; + } + else if ( zone.spawn_locations[ i ].origin == ( 10015, 6931, -571.7 ) ) + { + zone.spawn_locations[ i ].origin = ( 10249.4, 7691.71, -569.875 ); + } + else if ( zone.spawn_locations[ i ].origin == ( 9339, 6411, -566.9 ) ) + { + zone.spawn_locations[ i ].origin = ( 9993.29, 7486.83, -582.875 ); + } + else if ( zone.spawn_locations[ i ].origin == ( 9914, 8408, -576 ) ) + { + zone.spawn_locations[ i ].origin = ( 9993.29, 7550, -582.875 ); + } + else if ( zone.spawn_locations[ i ].origin == ( 9429, 5281, -539.6 ) ) + { + zone.spawn_locations[ i ].is_enabled = false; + } + else if ( zone.spawn_locations[ i ].origin == ( 10015, 6931, -571.7 ) ) + { + zone.spawn_locations[ i ].is_enabled = false; + } + else if ( zone.spawn_locations[ i ].origin == ( 13019.1, 7382.5, -754 ) ) + { + zone.spawn_locations[ i ].is_enabled = false; + } + else if ( zone.spawn_locations[ i ].origin == ( -3825, -6576, -52.7 ) ) + { + zone.spawn_locations[ i ].origin = ( -4061.03, -6754.44, -58.0897 ); + } + else if ( zone.spawn_locations[ i ].origin == ( -3450, -6559, -51.9 ) ) + { + zone.spawn_locations[ i ].origin = ( -4060.93, -6968.64, -65.3446 ); + } + else if ( zone.spawn_locations[ i ].origin == ( -4165, -6098, -64 ) ) + { + zone.spawn_locations[ i ].origin = ( -4239.78, -6902.81, -57.0494 ); + } + else if ( zone.spawn_locations[ i ].origin == ( -5058, -5902, -73.4 ) ) + { + zone.spawn_locations[ i ].origin = ( -4846.77, -6906.38, 54.8145 ); + } + else if ( zone.spawn_locations[ i ].origin == ( -6462, -7159, -64 ) ) + { + zone.spawn_locations[ i ].origin = ( -6201.18, -7107.83, -59.7182 ); + } + else if ( zone.spawn_locations[ i ].origin == ( -5130, -6512, -35.4 ) ) + { + zone.spawn_locations[ i ].origin = ( -5396.36, -6801.88, -60.0821 ); + } + else if ( zone.spawn_locations[ i ].origin == ( -6531, -6613, -54.4 ) ) + { + zone.spawn_locations[ i ].origin = ( -6116.62, -6586.81, -50.8905 ); + } + else if ( zone.spawn_locations[ i ].origin == ( -5373, -6231, -51.9 ) ) + { + zone.spawn_locations[ i ].origin = ( -4827.92, -7137.19, -62.9082 ); + } + else if ( zone.spawn_locations[ i ].origin == ( -5752, -6230, -53.4 ) ) + { + zone.spawn_locations[ i ].origin = ( -5572.47, -6426, -39.1894 ); + } + else if ( zone.spawn_locations[ i ].origin == ( -5540, -6508, -42 ) ) + { + zone.spawn_locations[ i ].origin = ( -5789.51, -6935.81, -57.875 ); + } + else if ( zone.spawn_locations[ i ].origin == ( -11093 , 393 , 192 ) ) + { + zone.spawn_locations[ i ].origin = ( -11431.3, -644.496, 192.125 ); + } + else if ( zone.spawn_locations[ i ].origin == ( -10944, -3846, 221.14 ) ) + { + zone.spawn_locations[ i ].origin = ( -11351.7, -1988.58, 184.125 ); + } + else if ( zone.spawn_locations[ i ].origin == ( -11251, -4397, 200.02 ) ) + { + zone.spawn_locations[ i ].origin = ( -11431.3, -644.496, 192.125 ); + } + else if ( zone.spawn_locations[ i ].origin == ( -11334 , -5280, 212.7 ) ) + { + zone.spawn_locations[ i ].origin = ( -11600.6, -1918.41, 192.125 ); + zone.spawn_locations[ i ].script_noteworthy = "riser_location"; + } + else if (zone.spawn_locations[ i ].origin == ( -10836, 1195, 209.7 ) ) + { + zone.spawn_locations[ i ].origin = ( -11241.2, -1118.76, 184.125 ); + } + else if ( zone.spawn_locations[ i ].targetname == "zone_trans_diner_spawners") + { + zone.spawn_locations[ i ].is_enabled = false; + } + else + { + zone.spawn_locations[ i ].is_enabled = true; + } + zone.spawn_locations[ i ].checked = true; + } + if ( !is_true( zone.spawn_locations[ i ].is_enabled ) ) + { + i++; + continue; + } + level.zombie_spawn_locations[ level.zombie_spawn_locations.size ] = zone.spawn_locations[ i ]; + i++; + } + } + } +} \ No newline at end of file diff --git a/scripts/zm/locs/zm_transit_diner.gsc b/scripts/zm/locs/zm_transit_diner.gsc new file mode 100644 index 00000000..1cf438bd --- /dev/null +++ b/scripts/zm/locs/zm_transit_diner.gsc @@ -0,0 +1,70 @@ +#include maps/mp/zombies/_zm_game_module; +#include maps/mp/zombies/_zm_utility; +#include common_scripts/utility; +#include maps/mp/_utility; +#include maps/mp/zombies/_zm; +#include scripts/zm/main/_gametype_setup; +#include scripts/zm/locs/common; + +struct_init() +{ + if ( !is_true( level.ctsm_disable_custom_perk_locations ) ) + { + scripts/zm/replaced/utility::register_perk_struct( "specialty_armorvest", "zombie_vending_jugg", ( 0, 176, 0 ), ( -3634, -7464, -58 ) ); + scripts/zm/replaced/utility::register_perk_struct( "specialty_quickrevive", "zombie_vending_quickrevive", ( 0, 137, 0 ), ( -5424, -7920, -64 ) ); + scripts/zm/replaced/utility::register_perk_struct( "specialty_fastreload", "zombie_vending_sleight", ( 0, 270, 0 ), ( -5470, -7859.5, 0 ) ); + scripts/zm/replaced/utility::register_perk_struct( "specialty_rof", "zombie_vending_doubletap2", ( 0, -90, 0 ), ( -4170, -7610, -61 ) ); + } + coordinates = array( ( -3991, -7317, -63 ), ( -4231, -7395, -60 ), ( -4127, -6757, -54 ), ( -4465, -7346, -58 ), + ( -5770, -6600, -55 ), ( -6135, -6671, -56 ), ( -6182, -7120, -60 ), ( -5882, -7174, -61 ) ); + angles = array( ( 0, 161, 0 ), ( 0, 120, 0 ), ( 0, 217, 0 ), ( 0, 173, 0 ), ( 0, -106, 0 ), ( 0, -46, 0 ), ( 0, 51, 0 ), ( 0, 99, 0 ) ); + for ( i = 0; i < coordinates.size; i++ ) + { + scripts/zm/replaced/utility::register_map_initial_spawnpoint( coordinates[ i ], angles[ i ] ); + } + gameObjects = getEntArray( "script_model", "classname" ); + foreach ( object in gameObjects ) + { + if ( object.script_gameobjectname == "zcleansed zturned" ) + { + object.script_gameobjectname = "zstandard zgrief zcleansed zturned"; + } + } +} + +precache() +{ + +} + +main() +{ + treasure_chest_init(); + init_wallbuys(); + init_barriers(); + scripts/zm/locs/common::common_init(); +} + +treasure_chest_init() +{ + chests = getstructarray( "treasure_chest_use", "targetname" ); + level.chests = []; + level.chests[0] = chests[3]; + maps/mp/zombies/_zm_magicbox::treasure_chest_init( "start_chest" ); +} + +init_wallbuys() +{ + scripts/zm/replaced/utility::wallbuy( ( 0, 0, 0 ), ( -4280, -7486, -5 ), "m14_zm_fx", "m14_zm", "t6_wpn_ar_m14_world", "m14", "weapon_upgrade" ); + scripts/zm/replaced/utility::wallbuy( ( 0, 0, 0 ), ( -5085, -7807, -5 ), "rottweil72_zm_fx", "rottweil72_zm", "t6_wpn_shotty_olympia_world", "olympia", "weapon_upgrade" ); + scripts/zm/replaced/utility::wallbuy( ( 0, 180, 0 ), ( -3578, -7181, 0 ), "m16_zm_fx", "m16_zm", "t6_wpn_ar_m16a2_world", "m16", "weapon_upgrade" ); + scripts/zm/replaced/utility::wallbuy( ( 0, 1, 0 ), ( -5489, -7982.7, 62 ), "mp5k_zm_fx", "mp5k_zm", "t6_wpn_smg_mp5_world", "mp5", "weapon_upgrade" ); +} + +init_barriers() +{ + precacheModel( "zm_collision_transit_diner_survival" ); + collision = spawn( "script_model", ( -5000, -6700, 0 ), 1 ); + collision setmodel( "zm_collision_transit_diner_survival" ); + collision disconnectpaths(); +} \ No newline at end of file diff --git a/scripts/zm/replaced/utility.gsc b/scripts/zm/replaced/utility.gsc new file mode 100644 index 00000000..92ebeee2 --- /dev/null +++ b/scripts/zm/replaced/utility.gsc @@ -0,0 +1,288 @@ +#include maps/mp/zombies/_load; +#include maps/mp/_utility; +#include common_scripts/utility; +#include maps/mp/zombies/_zm_zonemgr; +#include maps/mp/gametypes_zm/_zm_gametype; +#include maps/mp/zombies/_zm_utility; +#include maps/mp/zombies/_zm_weapons; +#include maps/mp/zombies/_zm_melee_weapon; +#include maps/mp/zombies/_zm_weap_claymore; +#include maps/mp/zombies/_zm_weap_ballistic_knife; +#include maps/mp/zombies/_zm_equipment; +#include maps/mp/zombies/_zm_magicbox; + +struct_class_init() +{ + level.struct_class_names = []; + level.struct_class_names[ "target" ] = []; + level.struct_class_names[ "targetname" ] = []; + level.struct_class_names[ "script_noteworthy" ] = []; + level.struct_class_names[ "script_linkname" ] = []; + level.struct_class_names[ "script_unitrigger_type" ] = []; + foreach ( s_struct in level.struct ) + { + if ( isDefined( s_struct.targetname ) ) + { + if ( !isDefined( level.struct_class_names[ "targetname" ][ s_struct.targetname ] ) ) + { + level.struct_class_names[ "targetname" ][ s_struct.targetname ] = []; + } + size = level.struct_class_names[ "targetname" ][ s_struct.targetname ].size; + level.struct_class_names[ "targetname" ][ s_struct.targetname ][ size ] = s_struct; + } + if ( isDefined( s_struct.target ) ) + { + if ( !isDefined( level.struct_class_names[ "target" ][ s_struct.target ] ) ) + { + level.struct_class_names[ "target" ][ s_struct.target ] = []; + } + size = level.struct_class_names[ "target" ][ s_struct.target ].size; + level.struct_class_names[ "target" ][ s_struct.target ][ size ] = s_struct; + } + if ( isDefined( s_struct.script_noteworthy ) ) + { + if ( !isDefined( level.struct_class_names[ "script_noteworthy" ][ s_struct.script_noteworthy ] ) ) + { + level.struct_class_names[ "script_noteworthy" ][ s_struct.script_noteworthy ] = []; + } + size = level.struct_class_names[ "script_noteworthy" ][ s_struct.script_noteworthy ].size; + level.struct_class_names[ "script_noteworthy" ][ s_struct.script_noteworthy ][ size ] = s_struct; + } + if ( isDefined( s_struct.script_linkname ) ) + { + level.struct_class_names[ "script_linkname" ][ s_struct.script_linkname ][ 0 ] = s_struct; + } + if ( isDefined( s_struct.script_unitrigger_type ) ) + { + if ( !isDefined( level.struct_class_names[ "script_unitrigger_type" ][ s_struct.script_unitrigger_type ] ) ) + { + level.struct_class_names[ "script_unitrigger_type" ][ s_struct.script_unitrigger_type ] = []; + } + size = level.struct_class_names[ "script_unitrigger_type" ][ s_struct.script_unitrigger_type ].size; + level.struct_class_names[ "script_unitrigger_type" ][ s_struct.script_unitrigger_type ][ size ] = s_struct; + } + } + gametype = getDvar( "g_gametype" ); + location = getDvar( "ui_zm_mapstartlocation" ); + if ( array_validate( level.add_struct_gamemode_location_funcs ) ) + { + if ( array_validate( level.add_struct_gamemode_location_funcs[ gametype ] ) ) + { + if ( array_validate( level.add_struct_gamemode_location_funcs[ gametype ][ location ] ) ) + { + for ( i = 0; i < level.add_struct_gamemode_location_funcs[ gametype ][ location ].size; i++ ) + { + [[ level.add_struct_gamemode_location_funcs[ gametype ][ location ][ i ] ]](); + } + } + } + } +} + +add_struct( s_struct ) +{ + if ( isDefined( s_struct.targetname ) ) + { + if ( !isDefined( level.struct_class_names[ "targetname" ][ s_struct.targetname ] ) ) + { + level.struct_class_names[ "targetname" ][ s_struct.targetname ] = []; + } + size = level.struct_class_names[ "targetname" ][ s_struct.targetname ].size; + level.struct_class_names[ "targetname" ][ s_struct.targetname ][ size ] = s_struct; + } + if ( isDefined( s_struct.script_noteworthy ) ) + { + if ( !isDefined( level.struct_class_names[ "script_noteworthy" ][ s_struct.script_noteworthy ] ) ) + { + level.struct_class_names[ "script_noteworthy" ][ s_struct.script_noteworthy ] = []; + } + size = level.struct_class_names[ "script_noteworthy" ][ s_struct.script_noteworthy ].size; + level.struct_class_names[ "script_noteworthy" ][ s_struct.script_noteworthy ][ size ] = s_struct; + } + if ( isDefined( s_struct.target ) ) + { + if ( !isDefined( level.struct_class_names[ "target" ][ s_struct.target ] ) ) + { + level.struct_class_names[ "target" ][ s_struct.target ] = []; + } + size = level.struct_class_names[ "target" ][ s_struct.target ].size; + level.struct_class_names[ "target" ][ s_struct.target ][ size ] = s_struct; + } + if ( isDefined( s_struct.script_linkname ) ) + { + level.struct_class_names[ "script_linkname" ][ s_struct.script_linkname ][ 0 ] = s_struct; + } + if ( isDefined( s_struct.script_unitrigger_type ) ) + { + if ( !isDefined( level.struct_class_names[ "script_unitrigger_type" ][ s_struct.script_unitrigger_type ] ) ) + { + level.struct_class_names[ "script_unitrigger_type" ][ s_struct.script_unitrigger_type ] = []; + } + size = level.struct_class_names[ "script_unitrigger_type" ][ s_struct.script_unitrigger_type ].size; + level.struct_class_names[ "script_unitrigger_type" ][ s_struct.script_unitrigger_type ][ size ] = s_struct; + } +} + +register_perk_struct( perk_name, perk_model, perk_angles, perk_coordinates ) +{ + perk_struct = spawnStruct(); + perk_struct.script_noteworthy = perk_name; + perk_struct.model = perk_model; + perk_struct.angles = perk_angles; + perk_struct.origin = perk_coordinates; + perk_struct.targetname = "zm_perk_machine"; + // if ( perk_name == "specialty_weapupgrade" ) + // { + // perk_struct.target = "weapupgrade_flag_targ"; + // flag = spawnStruct(); + // flag.targetname = "weapupgrade_flag_targ"; + // flag.model = "zombie_sign_please_wait"; + // flag.angles = ( 0, perk_angles[ 1 ] - 180, perk_angles[ 2 ] - 180 ); + // flag.origin = ( perk_coordinates[ 0 ] + 13.5, perk_coordinates[ 1 ] - 29, perk_coordinates[ 2 ] + 49.5 ); + // add_struct( flag ); + // } + add_struct( perk_struct ); +} + +register_map_initial_spawnpoint( spawnpoint_coordinates, spawnpoint_angles ) +{ + spawnpoint_struct = spawnStruct(); + spawnpoint_struct.origin = spawnpoint_coordinates; + if ( isDefined( spawnpoint_angles ) ) + { + spawnpoint_struct.angles = spawnpoint_angles; + } + else + { + spawnpoint_struct.angles = ( 0, 0, 0 ); + } + spawnpoint_struct.radius = 32; + spawnpoint_struct.script_noteworthy = "initial_spawn"; + spawnpoint_struct.script_int = 2048; + spawnpoint_struct.script_string = getDvar( "g_gametype" ) + "_" + getDvar( "ui_zm_mapstartlocation" ); + spawnpoint_struct.locked = 0; + player_respawn_point_size = level.struct_class_names[ "targetname" ][ "player_respawn_point" ].size; + player_initial_spawnpoint_size = level.struct_class_names[ "script_noteworthy" ][ "initial_spawn" ].size; + level.struct_class_names[ "targetname" ][ "player_respawn_point" ][ player_respawn_point_size ] = spawnpoint_struct; + level.struct_class_names[ "script_noteworthy" ][ "initial_spawn" ][ player_initial_spawnpoint_size ] = spawnpoint_struct; +} + +wallbuy( weapon_angles, weapon_coordinates, chalk_fx, weapon_name, weapon_model, target, targetname ) +{ + tempmodel = spawn( "script_model", ( 0, 0, 0 ) ); + precachemodel( weapon_model ); + unitrigger_stub = spawnstruct(); + unitrigger_stub.origin = weapon_coordinates; + unitrigger_stub.angles = weapon_angles; + tempmodel.origin = weapon_coordinates; + tempmodel.angles = weapon_angles; + mins = undefined; + maxs = undefined; + absmins = undefined; + absmaxs = undefined; + tempmodel setmodel( weapon_model ); + tempmodel useweaponhidetags( weapon_name ); + mins = tempmodel getmins(); + maxs = tempmodel getmaxs(); + absmins = tempmodel getabsmins(); + absmaxs = tempmodel getabsmaxs(); + bounds = absmaxs - absmins; + unitrigger_stub.script_length = bounds[ 0 ] * 0.25; + unitrigger_stub.script_width = bounds[ 1 ]; + unitrigger_stub.script_height = bounds[ 2 ]; + unitrigger_stub.origin -= anglesToRight( unitrigger_stub.angles ) * ( unitrigger_stub.script_length * 0.4 ); + unitrigger_stub.target = target; + unitrigger_stub.targetname = targetname; + unitrigger_stub.cursor_hint = "HINT_NOICON"; + if ( unitrigger_stub.targetname == "weapon_upgrade" ) + { + unitrigger_stub.cost = get_weapon_cost( weapon_name ); + if ( !is_true( level.monolingustic_prompt_format ) ) + { + unitrigger_stub.hint_string = get_weapon_hint( weapon_name ); + unitrigger_stub.hint_parm1 = unitrigger_stub.cost; + } + else + { + unitrigger_stub.hint_parm1 = get_weapon_display_name( weapon_name ); + if ( !isDefined( unitrigger_stub.hint_parm1 ) || unitrigger_stub.hint_parm1 == "" || unitrigger_stub.hint_parm1 == "none" ) + { + unitrigger_stub.hint_parm1 = "missing weapon name " + weapon_name; + } + unitrigger_stub.hint_parm2 = unitrigger_stub.cost; + unitrigger_stub.hint_string = &"ZOMBIE_WEAPONCOSTONLY"; + } + } + unitrigger_stub.weapon_upgrade = weapon_name; + unitrigger_stub.script_unitrigger_type = "unitrigger_box_use"; + unitrigger_stub.require_look_at = 1; + unitrigger_stub.require_look_from = 0; + unitrigger_stub.zombie_weapon_upgrade = weapon_name; + maps/mp/zombies/_zm_unitrigger::unitrigger_force_per_player_triggers( unitrigger_stub, 1 ); + if ( is_melee_weapon( weapon_name ) ) + { + if ( weapon_name == "tazer_knuckles_zm" && isDefined( level.taser_trig_adjustment ) ) + { + unitrigger_stub.origin += level.taser_trig_adjustment; + } + maps/mp/zombies/_zm_unitrigger::register_static_unitrigger( unitrigger_stub, ::melee_weapon_think ); + } + else if ( weapon_name == "claymore_zm" ) + { + unitrigger_stub.prompt_and_visibility_func = ::claymore_unitrigger_update_prompt; + maps/mp/zombies/_zm_unitrigger::register_static_unitrigger( unitrigger_stub, ::buy_claymores ); + } + else + { + unitrigger_stub.prompt_and_visibility_func = ::wall_weapon_update_prompt; + maps/mp/zombies/_zm_unitrigger::register_static_unitrigger( unitrigger_stub, ::weapon_spawn_think ); + } + tempmodel delete(); + thread playchalkfx( chalk_fx, weapon_coordinates, weapon_angles ); +} + +playchalkfx( effect, origin, angles ) +{ + while ( 1 ) + { + fx = SpawnFX( level._effect[ effect ], origin, AnglesToForward( angles ), AnglesToUp( angles ) ); + TriggerFX( fx ); + level waittill( "connected", player ); + fx Delete(); + } +} + +barrier( barrier_coordinates, barrier_model, barrier_angles, not_solid ) +{ + if ( !isDefined( level.survival_barriers ) ) + { + level.survival_barriers = []; + level.survival_barriers_index = 0; + } + level.survival_barriers[ level.survival_barriers_index ] = spawn( "script_model", barrier_coordinates ); + level.survival_barriers[ level.survival_barriers_index ] setModel( barrier_model ); + level.survival_barriers[ level.survival_barriers_index ] rotateTo( barrier_angles, 0.1 ); + level.survival_barriers[ level.survival_barriers_index ] disconnectPaths(); + if ( is_true( not_solid ) ) + { + level.survival_barriers[ level.survival_barriers_index ] notSolid(); + } + level.survival_barriers_index++; +} + +add_struct_location_gamemode_func( gametype, location, func ) +{ + if ( !isDefined( level.add_struct_gamemode_location_funcs ) ) + { + level.add_struct_gamemode_location_funcs = []; + } + if ( !isDefined( level.add_struct_gamemode_location_funcs[ gametype ] ) ) + { + level.add_struct_gamemode_location_funcs[ gametype ] = []; + } + if ( !isDefined( level.add_struct_gamemode_location_funcs[ gametype ][ location ] ) ) + { + level.add_struct_gamemode_location_funcs[ gametype ][ location ] = []; + } + level.add_struct_gamemode_location_funcs[ gametype ][ location ][ level.add_struct_gamemode_location_funcs[ gametype ][ location ].size ] = func; +} \ No newline at end of file diff --git a/scripts/zm/replaced/zm_transit_gamemodes.gsc b/scripts/zm/replaced/zm_transit_gamemodes.gsc new file mode 100644 index 00000000..07194aa1 --- /dev/null +++ b/scripts/zm/replaced/zm_transit_gamemodes.gsc @@ -0,0 +1,38 @@ +#include maps/mp/zm_transit_grief_town; +#include maps/mp/zm_transit_grief_farm; +#include maps/mp/zm_transit_grief_station; +#include maps/mp/zm_transit_standard_town; +#include maps/mp/zm_transit_standard_farm; +#include maps/mp/zm_transit_standard_station; +#include maps/mp/zm_transit_classic; +#include maps/mp/zm_transit; +#include maps/mp/gametypes_zm/_zm_gametype; +#include maps/mp/zm_transit_utility; +#include maps/mp/zombies/_zm_game_module; +#include maps/mp/zombies/_zm_utility; +#include maps/mp/_utility; +#include common_scripts/utility; + +#include scripts/zm/locs/zm_transit_diner; + +init() +{ + add_map_gamemode( "zclassic", maps/mp/zm_transit::zclassic_preinit, undefined, undefined ); + add_map_gamemode( "zgrief", maps/mp/zm_transit::zgrief_preinit, undefined, undefined ); + add_map_gamemode( "zstandard", maps/mp/zm_transit::zstandard_preinit, undefined, undefined ); + + add_map_location_gamemode( "zclassic", "transit", maps/mp/zm_transit_classic::precache, maps/mp/zm_transit_classic::main ); + + add_map_location_gamemode( "zstandard", "transit", maps/mp/zm_transit_standard_station::precache, maps/mp/zm_transit_standard_station::main ); + add_map_location_gamemode( "zstandard", "farm", maps/mp/zm_transit_standard_farm::precache, maps/mp/zm_transit_standard_farm::main ); + add_map_location_gamemode( "zstandard", "town", maps/mp/zm_transit_standard_town::precache, maps/mp/zm_transit_standard_town::main ); + add_map_location_gamemode( "zstandard", "diner", scripts/zm/locs/zm_transit_diner::precache, scripts/zm/locs/zm_transit_diner::main ); + + add_map_location_gamemode( "zgrief", "transit", maps/mp/zm_transit_grief_station::precache, maps/mp/zm_transit_grief_station::main ); + add_map_location_gamemode( "zgrief", "farm", maps/mp/zm_transit_grief_farm::precache, maps/mp/zm_transit_grief_farm::main ); + add_map_location_gamemode( "zgrief", "town", maps/mp/zm_transit_grief_town::precache, maps/mp/zm_transit_grief_town::main ); + add_map_location_gamemode( "zgrief", "diner", scripts/zm/locs/zm_transit_diner::precache, scripts/zm/locs/zm_transit_diner::main ); + + scripts/zm/replaced/utility::add_struct_location_gamemode_func( "zstandard", "diner", scripts/zm/locs/zm_transit_diner::struct_init ); + scripts/zm/replaced/utility::add_struct_location_gamemode_func( "zgrief", "diner", scripts/zm/locs/zm_transit_diner::struct_init ); +} \ No newline at end of file diff --git a/scripts/zm/zm_transit/zm_transit_reimagined.gsc b/scripts/zm/zm_transit/zm_transit_reimagined.gsc index 491239e5..b57b5fd1 100644 --- a/scripts/zm/zm_transit/zm_transit_reimagined.gsc +++ b/scripts/zm/zm_transit/zm_transit_reimagined.gsc @@ -3,6 +3,7 @@ #include maps\mp\zombies\_zm_utility; #include scripts/zm/replaced/zm_transit; +#include scripts/zm/replaced/zm_transit_gamemodes; #include scripts/zm/replaced/_zm_weap_emp_bomb; #include scripts/zm/replaced/_zm_equip_electrictrap; #include scripts/zm/replaced/_zm_equip_turret; @@ -10,6 +11,7 @@ main() { replaceFunc(maps/mp/zm_transit::lava_damage_depot, scripts/zm/replaced/zm_transit::lava_damage_depot); + replaceFunc(maps/mp/zm_transit_gamemodes::init, scripts/zm/replaced/zm_transit_gamemodes::init); replaceFunc(maps/mp/zombies/_zm_weap_emp_bomb::emp_detonate, scripts/zm/replaced/_zm_weap_emp_bomb::emp_detonate); replaceFunc(maps/mp/zombies/_zm_equip_electrictrap::startelectrictrapdeploy, scripts/zm/replaced/_zm_equip_electrictrap::startelectrictrapdeploy); replaceFunc(maps/mp/zombies/_zm_equip_turret::startturretdeploy, scripts/zm/replaced/_zm_equip_turret::startturretdeploy);