mirror of
https://github.com/JezuzLizard/Recompilable-gscs-for-BO2-zombies-and-multiplayer.git
synced 2025-06-08 01:47:50 -05:00
uploading 61 zm_buried_patch scripts as a baseline
This commit is contained in:
parent
fec278cb3b
commit
0500c630f7
2154
zm_buried_patch/maps/mp/gametypes_zm/zcleansed.gsc
Normal file
2154
zm_buried_patch/maps/mp/gametypes_zm/zcleansed.gsc
Normal file
File diff suppressed because it is too large
Load Diff
876
zm_buried_patch/maps/mp/gametypes_zm/zgrief.gsc
Normal file
876
zm_buried_patch/maps/mp/gametypes_zm/zgrief.gsc
Normal file
@ -0,0 +1,876 @@
|
|||||||
|
#include maps/mp/zombies/_zm_equipment;
|
||||||
|
#include maps/mp/zombies/_zm_weapons;
|
||||||
|
#include maps/mp/zombies/_zm_audio_announcer;
|
||||||
|
#include maps/mp/zombies/_zm_zonemgr;
|
||||||
|
#include maps/mp/_demo;
|
||||||
|
#include maps/mp/zombies/_zm_laststand;
|
||||||
|
#include maps/mp/zombies/_zm_weap_cymbal_monkey;
|
||||||
|
#include maps/mp/zombies/_zm_magicbox;
|
||||||
|
#include maps/mp/zombies/_zm_game_module;
|
||||||
|
#include maps/mp/zombies/_zm;
|
||||||
|
#include maps/mp/zombies/_zm_game_module_meat_utility;
|
||||||
|
#include maps/mp/zombies/_zm_powerups;
|
||||||
|
#include maps/mp/gametypes_zm/zmeat;
|
||||||
|
#include maps/mp/zombies/_zm_stats;
|
||||||
|
#include maps/mp/zombies/_zm_utility;
|
||||||
|
#include common_scripts/utility;
|
||||||
|
#include maps/mp/gametypes_zm/_hud_util;
|
||||||
|
#include maps/mp/_utility;
|
||||||
|
|
||||||
|
main()
|
||||||
|
{
|
||||||
|
maps/mp/gametypes_zm/_zm_gametype::main();
|
||||||
|
level.onprecachegametype = ::onprecachegametype;
|
||||||
|
level.onstartgametype = ::onstartgametype;
|
||||||
|
level.custom_spectate_permissions = ::setspectatepermissionsgrief;
|
||||||
|
level._game_module_custom_spawn_init_func = ::maps/mp/gametypes_zm/_zm_gametype::custom_spawn_init_func;
|
||||||
|
level._game_module_stat_update_func = ::maps/mp/zombies/_zm_stats::grief_custom_stat_update;
|
||||||
|
level._game_module_player_damage_callback = ::maps/mp/gametypes_zm/_zm_gametype::game_module_player_damage_callback;
|
||||||
|
level.custom_end_screen = ::custom_end_screen;
|
||||||
|
level.gamemode_map_postinit[ "zgrief" ] = ::postinit_func;
|
||||||
|
level._supress_survived_screen = 1;
|
||||||
|
level.game_module_team_name_override_og_x = 155;
|
||||||
|
level.prevent_player_damage = ::player_prevent_damage;
|
||||||
|
level._game_module_player_damage_grief_callback = ::game_module_player_damage_grief_callback;
|
||||||
|
level._grief_reset_message = ::grief_reset_message;
|
||||||
|
level._game_module_player_laststand_callback = ::grief_laststand_weapon_save;
|
||||||
|
level.onplayerspawned_restore_previous_weapons = ::grief_laststand_weapons_return;
|
||||||
|
level.game_module_onplayerconnect = ::grief_onplayerconnect;
|
||||||
|
level.game_mode_spawn_player_logic = ::game_mode_spawn_player_logic;
|
||||||
|
level.game_mode_custom_onplayerdisconnect = ::grief_onplayerdisconnect;
|
||||||
|
maps/mp/gametypes_zm/_zm_gametype::post_gametype_main( "zgrief" );
|
||||||
|
}
|
||||||
|
|
||||||
|
grief_onplayerconnect()
|
||||||
|
{
|
||||||
|
self thread move_team_icons();
|
||||||
|
self thread maps/mp/gametypes_zm/zmeat::create_item_meat_watcher();
|
||||||
|
self thread zgrief_player_bled_out_msg();
|
||||||
|
}
|
||||||
|
|
||||||
|
grief_onplayerdisconnect( disconnecting_player )
|
||||||
|
{
|
||||||
|
level thread update_players_on_bleedout_or_disconnect( disconnecting_player );
|
||||||
|
}
|
||||||
|
|
||||||
|
setspectatepermissionsgrief()
|
||||||
|
{
|
||||||
|
self allowspectateteam( "allies", 1 );
|
||||||
|
self allowspectateteam( "axis", 1 );
|
||||||
|
self allowspectateteam( "freelook", 0 );
|
||||||
|
self allowspectateteam( "none", 1 );
|
||||||
|
}
|
||||||
|
|
||||||
|
custom_end_screen()
|
||||||
|
{
|
||||||
|
players = get_players();
|
||||||
|
i = 0;
|
||||||
|
while ( i < players.size )
|
||||||
|
{
|
||||||
|
players[ i ].game_over_hud = newclienthudelem( players[ i ] );
|
||||||
|
players[ i ].game_over_hud.alignx = "center";
|
||||||
|
players[ i ].game_over_hud.aligny = "middle";
|
||||||
|
players[ i ].game_over_hud.horzalign = "center";
|
||||||
|
players[ i ].game_over_hud.vertalign = "middle";
|
||||||
|
players[ i ].game_over_hud.y -= 130;
|
||||||
|
players[ i ].game_over_hud.foreground = 1;
|
||||||
|
players[ i ].game_over_hud.fontscale = 3;
|
||||||
|
players[ i ].game_over_hud.alpha = 0;
|
||||||
|
players[ i ].game_over_hud.color = ( 1, 1, 1 );
|
||||||
|
players[ i ].game_over_hud.hidewheninmenu = 1;
|
||||||
|
players[ i ].game_over_hud settext( &"ZOMBIE_GAME_OVER" );
|
||||||
|
players[ i ].game_over_hud fadeovertime( 1 );
|
||||||
|
players[ i ].game_over_hud.alpha = 1;
|
||||||
|
if ( players[ i ] issplitscreen() )
|
||||||
|
{
|
||||||
|
players[ i ].game_over_hud.fontscale = 2;
|
||||||
|
players[ i ].game_over_hud.y += 40;
|
||||||
|
}
|
||||||
|
players[ i ].survived_hud = newclienthudelem( players[ i ] );
|
||||||
|
players[ i ].survived_hud.alignx = "center";
|
||||||
|
players[ i ].survived_hud.aligny = "middle";
|
||||||
|
players[ i ].survived_hud.horzalign = "center";
|
||||||
|
players[ i ].survived_hud.vertalign = "middle";
|
||||||
|
players[ i ].survived_hud.y -= 100;
|
||||||
|
players[ i ].survived_hud.foreground = 1;
|
||||||
|
players[ i ].survived_hud.fontscale = 2;
|
||||||
|
players[ i ].survived_hud.alpha = 0;
|
||||||
|
players[ i ].survived_hud.color = ( 1, 1, 1 );
|
||||||
|
players[ i ].survived_hud.hidewheninmenu = 1;
|
||||||
|
if ( players[ i ] issplitscreen() )
|
||||||
|
{
|
||||||
|
players[ i ].survived_hud.fontscale = 1,5;
|
||||||
|
players[ i ].survived_hud.y += 40;
|
||||||
|
}
|
||||||
|
winner_text = &"ZOMBIE_GRIEF_WIN";
|
||||||
|
loser_text = &"ZOMBIE_GRIEF_LOSE";
|
||||||
|
if ( level.round_number < 2 )
|
||||||
|
{
|
||||||
|
winner_text = &"ZOMBIE_GRIEF_WIN_SINGLE";
|
||||||
|
loser_text = &"ZOMBIE_GRIEF_LOSE_SINGLE";
|
||||||
|
}
|
||||||
|
if ( isDefined( level.host_ended_game ) && level.host_ended_game )
|
||||||
|
{
|
||||||
|
players[ i ].survived_hud settext( &"MP_HOST_ENDED_GAME" );
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
if ( isDefined( level.gamemodulewinningteam ) && players[ i ]._encounters_team == level.gamemodulewinningteam )
|
||||||
|
{
|
||||||
|
players[ i ].survived_hud settext( winner_text, level.round_number );
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
players[ i ].survived_hud settext( loser_text, level.round_number );
|
||||||
|
}
|
||||||
|
}
|
||||||
|
players[ i ].survived_hud fadeovertime( 1 );
|
||||||
|
players[ i ].survived_hud.alpha = 1;
|
||||||
|
i++;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
postinit_func()
|
||||||
|
{
|
||||||
|
level.min_humans = 1;
|
||||||
|
level.zombie_ai_limit = 24;
|
||||||
|
level.prevent_player_damage = ::player_prevent_damage;
|
||||||
|
level.lock_player_on_team_score = 1;
|
||||||
|
level._zombiemode_powerup_grab = ::meat_stink_powerup_grab;
|
||||||
|
level.meat_bounce_override = ::meat_bounce_override;
|
||||||
|
level._zombie_spawning = 0;
|
||||||
|
level._get_game_module_players = undefined;
|
||||||
|
level.powerup_drop_count = 0;
|
||||||
|
level.is_zombie_level = 1;
|
||||||
|
level._effect[ "meat_impact" ] = loadfx( "maps/zombie/fx_zmb_meat_impact" );
|
||||||
|
level._effect[ "spawn_cloud" ] = loadfx( "maps/zombie/fx_zmb_race_zombie_spawn_cloud" );
|
||||||
|
level._effect[ "meat_stink_camera" ] = loadfx( "maps/zombie/fx_zmb_meat_stink_camera" );
|
||||||
|
level._effect[ "meat_stink_torso" ] = loadfx( "maps/zombie/fx_zmb_meat_stink_torso" );
|
||||||
|
include_powerup( "meat_stink" );
|
||||||
|
maps/mp/zombies/_zm_powerups::add_zombie_powerup( "meat_stink", "t6_wpn_zmb_meat_world", &"ZOMBIE_POWERUP_MAX_AMMO", ::func_should_drop_meat, 0, 0, 0 );
|
||||||
|
setmatchtalkflag( "DeadChatWithDead", 1 );
|
||||||
|
setmatchtalkflag( "DeadChatWithTeam", 1 );
|
||||||
|
setmatchtalkflag( "DeadHearTeamLiving", 1 );
|
||||||
|
setmatchtalkflag( "DeadHearAllLiving", 1 );
|
||||||
|
setmatchtalkflag( "EveryoneHearsEveryone", 1 );
|
||||||
|
}
|
||||||
|
|
||||||
|
func_should_drop_meat()
|
||||||
|
{
|
||||||
|
if ( minigun_no_drop() )
|
||||||
|
{
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
return 1;
|
||||||
|
}
|
||||||
|
|
||||||
|
minigun_no_drop()
|
||||||
|
{
|
||||||
|
players = get_players();
|
||||||
|
i = 0;
|
||||||
|
while ( i < players.size )
|
||||||
|
{
|
||||||
|
if ( players[ i ].ignoreme == 1 )
|
||||||
|
{
|
||||||
|
return 1;
|
||||||
|
}
|
||||||
|
i++;
|
||||||
|
}
|
||||||
|
if ( isDefined( level.meat_on_ground ) && level.meat_on_ground )
|
||||||
|
{
|
||||||
|
return 1;
|
||||||
|
}
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
grief_game_end_check_func()
|
||||||
|
{
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
player_prevent_damage( einflictor, eattacker, idamage, idflags, smeansofdeath, sweapon, vpoint, vdir, shitloc, psoffsettime )
|
||||||
|
{
|
||||||
|
if ( isDefined( eattacker ) && isplayer( eattacker ) && self != eattacker && !eattacker hasperk( "specialty_noname" ) && isDefined( self.is_zombie ) && !self.is_zombie )
|
||||||
|
{
|
||||||
|
return 1;
|
||||||
|
}
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
game_module_player_damage_grief_callback( einflictor, eattacker, idamage, idflags, smeansofdeath, sweapon, vpoint, vdir, shitloc, psoffsettime )
|
||||||
|
{
|
||||||
|
penalty = 10;
|
||||||
|
if ( isDefined( eattacker ) && isplayer( eattacker ) && eattacker != self && eattacker.team != self.team && smeansofdeath == "MOD_MELEE" )
|
||||||
|
{
|
||||||
|
self applyknockback( idamage, vdir );
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
onprecachegametype()
|
||||||
|
{
|
||||||
|
level.playersuicideallowed = 1;
|
||||||
|
level.canplayersuicide = ::canplayersuicide;
|
||||||
|
level.suicide_weapon = "death_self_zm";
|
||||||
|
precacheitem( "death_self_zm" );
|
||||||
|
precacheshellshock( "grief_stab_zm" );
|
||||||
|
precacheshader( "faction_cdc" );
|
||||||
|
precacheshader( "faction_cia" );
|
||||||
|
precacheshader( "waypoint_revive_cdc_zm" );
|
||||||
|
precacheshader( "waypoint_revive_cia_zm" );
|
||||||
|
level._effect[ "butterflies" ] = loadfx( "maps/zombie/fx_zmb_impact_noharm" );
|
||||||
|
level thread maps/mp/zombies/_zm_game_module_meat_utility::init_item_meat( "zgrief" );
|
||||||
|
level thread maps/mp/gametypes_zm/_zm_gametype::init();
|
||||||
|
maps/mp/gametypes_zm/_zm_gametype::rungametypeprecache( "zgrief" );
|
||||||
|
}
|
||||||
|
|
||||||
|
onstartgametype()
|
||||||
|
{
|
||||||
|
level.no_end_game_check = 1;
|
||||||
|
level._game_module_game_end_check = ::grief_game_end_check_func;
|
||||||
|
level.round_end_custom_logic = ::grief_round_end_custom_logic;
|
||||||
|
maps/mp/gametypes_zm/_zm_gametype::setup_classic_gametype();
|
||||||
|
maps/mp/gametypes_zm/_zm_gametype::rungametypemain( "zgrief", ::zgrief_main );
|
||||||
|
}
|
||||||
|
|
||||||
|
zgrief_main()
|
||||||
|
{
|
||||||
|
level thread maps/mp/zombies/_zm::round_start();
|
||||||
|
level thread maps/mp/gametypes_zm/_zm_gametype::kill_all_zombies();
|
||||||
|
flag_wait( "initial_blackscreen_passed" );
|
||||||
|
level thread maps/mp/zombies/_zm_game_module::wait_for_team_death_and_round_end();
|
||||||
|
players = get_players();
|
||||||
|
_a302 = players;
|
||||||
|
_k302 = getFirstArrayKey( _a302 );
|
||||||
|
while ( isDefined( _k302 ) )
|
||||||
|
{
|
||||||
|
player = _a302[ _k302 ];
|
||||||
|
player.is_hotjoin = 0;
|
||||||
|
_k302 = getNextArrayKey( _a302, _k302 );
|
||||||
|
}
|
||||||
|
wait 1;
|
||||||
|
playsoundatposition( "vox_zmba_grief_intro_0", ( 1, 1, 1 ) );
|
||||||
|
}
|
||||||
|
|
||||||
|
move_team_icons()
|
||||||
|
{
|
||||||
|
self endon( "disconnect" );
|
||||||
|
flag_wait( "initial_blackscreen_passed" );
|
||||||
|
wait 0,5;
|
||||||
|
}
|
||||||
|
|
||||||
|
kill_start_chest()
|
||||||
|
{
|
||||||
|
flag_wait( "initial_blackscreen_passed" );
|
||||||
|
wait 2;
|
||||||
|
start_chest = getstruct( "start_chest", "script_noteworthy" );
|
||||||
|
start_chest maps/mp/zombies/_zm_magicbox::hide_chest();
|
||||||
|
}
|
||||||
|
|
||||||
|
meat_stink_powerup_grab( powerup, who )
|
||||||
|
{
|
||||||
|
switch( powerup.powerup_name )
|
||||||
|
{
|
||||||
|
case "meat_stink":
|
||||||
|
level thread meat_stink( who );
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
meat_stink( who )
|
||||||
|
{
|
||||||
|
weapons = who getweaponslist();
|
||||||
|
has_meat = 0;
|
||||||
|
_a353 = weapons;
|
||||||
|
_k353 = getFirstArrayKey( _a353 );
|
||||||
|
while ( isDefined( _k353 ) )
|
||||||
|
{
|
||||||
|
weapon = _a353[ _k353 ];
|
||||||
|
if ( weapon == "item_meat_zm" )
|
||||||
|
{
|
||||||
|
has_meat = 1;
|
||||||
|
}
|
||||||
|
_k353 = getNextArrayKey( _a353, _k353 );
|
||||||
|
}
|
||||||
|
if ( has_meat )
|
||||||
|
{
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
who.pre_meat_weapon = who getcurrentweapon();
|
||||||
|
level notify( "meat_grabbed" );
|
||||||
|
who notify( "meat_grabbed" );
|
||||||
|
who playsound( "zmb_pickup_meat" );
|
||||||
|
who increment_is_drinking();
|
||||||
|
who giveweapon( "item_meat_zm" );
|
||||||
|
who switchtoweapon( "item_meat_zm" );
|
||||||
|
who setweaponammoclip( "item_meat_zm", 1 );
|
||||||
|
}
|
||||||
|
|
||||||
|
meat_stink_on_ground( position_to_play )
|
||||||
|
{
|
||||||
|
level.meat_on_ground = 1;
|
||||||
|
attractor_point = spawn( "script_model", position_to_play );
|
||||||
|
attractor_point setmodel( "tag_origin" );
|
||||||
|
attractor_point playsound( "zmb_land_meat" );
|
||||||
|
wait 0,2;
|
||||||
|
playfxontag( level._effect[ "meat_stink_torso" ], attractor_point, "tag_origin" );
|
||||||
|
attractor_point playloopsound( "zmb_meat_flies" );
|
||||||
|
attractor_point create_zombie_point_of_interest( 1536, 32, 10000 );
|
||||||
|
attractor_point.attract_to_origin = 1;
|
||||||
|
attractor_point thread create_zombie_point_of_interest_attractor_positions( 4, 45 );
|
||||||
|
attractor_point thread maps/mp/zombies/_zm_weap_cymbal_monkey::wait_for_attractor_positions_complete();
|
||||||
|
attractor_point delay_thread( 15, ::self_delete );
|
||||||
|
wait 16;
|
||||||
|
level.meat_on_ground = undefined;
|
||||||
|
}
|
||||||
|
|
||||||
|
meat_bounce_override( pos, normal, ent )
|
||||||
|
{
|
||||||
|
if ( isDefined( ent ) && isplayer( ent ) )
|
||||||
|
{
|
||||||
|
if ( !ent maps/mp/zombies/_zm_laststand::player_is_in_laststand() )
|
||||||
|
{
|
||||||
|
level thread meat_stink_player( ent );
|
||||||
|
if ( isDefined( self.owner ) )
|
||||||
|
{
|
||||||
|
maps/mp/_demo::bookmark( "zm_player_meat_stink", getTime(), ent, self.owner, 0, self );
|
||||||
|
self.owner maps/mp/zombies/_zm_stats::increment_client_stat( "contaminations_given" );
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
players = getplayers();
|
||||||
|
closest_player = undefined;
|
||||||
|
closest_player_dist = 10000;
|
||||||
|
player_index = 0;
|
||||||
|
while ( player_index < players.size )
|
||||||
|
{
|
||||||
|
player_to_check = players[ player_index ];
|
||||||
|
if ( self.owner == player_to_check )
|
||||||
|
{
|
||||||
|
player_index++;
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
else if ( player_to_check maps/mp/zombies/_zm_laststand::player_is_in_laststand() )
|
||||||
|
{
|
||||||
|
player_index++;
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
distsq = distancesquared( pos, player_to_check.origin );
|
||||||
|
if ( distsq < closest_player_dist )
|
||||||
|
{
|
||||||
|
closest_player = player_to_check;
|
||||||
|
closest_player_dist = distsq;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
player_index++;
|
||||||
|
}
|
||||||
|
if ( isDefined( closest_player ) )
|
||||||
|
{
|
||||||
|
level thread meat_stink_player( closest_player );
|
||||||
|
if ( isDefined( self.owner ) )
|
||||||
|
{
|
||||||
|
maps/mp/_demo::bookmark( "zm_player_meat_stink", getTime(), closest_player, self.owner, 0, self );
|
||||||
|
self.owner maps/mp/zombies/_zm_stats::increment_client_stat( "contaminations_given" );
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
valid_poi = check_point_in_enabled_zone( pos, undefined, undefined );
|
||||||
|
if ( valid_poi )
|
||||||
|
{
|
||||||
|
self hide();
|
||||||
|
level thread meat_stink_on_ground( self.origin );
|
||||||
|
}
|
||||||
|
}
|
||||||
|
playfx( level._effect[ "meat_impact" ], self.origin );
|
||||||
|
}
|
||||||
|
self delete();
|
||||||
|
}
|
||||||
|
|
||||||
|
meat_stink_player( who )
|
||||||
|
{
|
||||||
|
level notify( "new_meat_stink_player" );
|
||||||
|
level endon( "new_meat_stink_player" );
|
||||||
|
who.ignoreme = 0;
|
||||||
|
players = get_players();
|
||||||
|
_a486 = players;
|
||||||
|
_k486 = getFirstArrayKey( _a486 );
|
||||||
|
while ( isDefined( _k486 ) )
|
||||||
|
{
|
||||||
|
player = _a486[ _k486 ];
|
||||||
|
player thread meat_stink_player_cleanup();
|
||||||
|
if ( player != who )
|
||||||
|
{
|
||||||
|
player.ignoreme = 1;
|
||||||
|
}
|
||||||
|
_k486 = getNextArrayKey( _a486, _k486 );
|
||||||
|
}
|
||||||
|
who thread meat_stink_player_create();
|
||||||
|
who waittill_any_or_timeout( 30, "disconnect", "player_downed", "bled_out" );
|
||||||
|
players = get_players();
|
||||||
|
_a501 = players;
|
||||||
|
_k501 = getFirstArrayKey( _a501 );
|
||||||
|
while ( isDefined( _k501 ) )
|
||||||
|
{
|
||||||
|
player = _a501[ _k501 ];
|
||||||
|
player thread meat_stink_player_cleanup();
|
||||||
|
player.ignoreme = 0;
|
||||||
|
_k501 = getNextArrayKey( _a501, _k501 );
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
meat_stink_player_create()
|
||||||
|
{
|
||||||
|
self maps/mp/zombies/_zm_stats::increment_client_stat( "contaminations_received" );
|
||||||
|
self endon( "disconnect" );
|
||||||
|
self endon( "death" );
|
||||||
|
tagname = "J_SpineLower";
|
||||||
|
self.meat_stink_3p = spawn( "script_model", self gettagorigin( tagname ) );
|
||||||
|
self.meat_stink_3p setmodel( "tag_origin" );
|
||||||
|
self.meat_stink_3p linkto( self, tagname );
|
||||||
|
wait 0,5;
|
||||||
|
playfxontag( level._effect[ "meat_stink_torso" ], self.meat_stink_3p, "tag_origin" );
|
||||||
|
self setclientfieldtoplayer( "meat_stink", 1 );
|
||||||
|
}
|
||||||
|
|
||||||
|
meat_stink_player_cleanup()
|
||||||
|
{
|
||||||
|
if ( isDefined( self.meat_stink_3p ) )
|
||||||
|
{
|
||||||
|
self.meat_stink_3p unlink();
|
||||||
|
self.meat_stink_3p delete();
|
||||||
|
}
|
||||||
|
self setclientfieldtoplayer( "meat_stink", 0 );
|
||||||
|
}
|
||||||
|
|
||||||
|
door_close_zombie_think()
|
||||||
|
{
|
||||||
|
self endon( "death" );
|
||||||
|
while ( isalive( self ) )
|
||||||
|
{
|
||||||
|
if ( isDefined( self.enemy ) && isplayer( self.enemy ) )
|
||||||
|
{
|
||||||
|
insamezone = 0;
|
||||||
|
keys = getarraykeys( level.zones );
|
||||||
|
i = 0;
|
||||||
|
while ( i < keys.size )
|
||||||
|
{
|
||||||
|
if ( self maps/mp/zombies/_zm_zonemgr::entity_in_zone( keys[ i ] ) && self.enemy maps/mp/zombies/_zm_zonemgr::entity_in_zone( keys[ i ] ) )
|
||||||
|
{
|
||||||
|
insamezone = 1;
|
||||||
|
}
|
||||||
|
i++;
|
||||||
|
}
|
||||||
|
while ( insamezone )
|
||||||
|
{
|
||||||
|
wait 3;
|
||||||
|
}
|
||||||
|
nearestzombienode = getnearestnode( self.origin );
|
||||||
|
nearestplayernode = getnearestnode( self.enemy.origin );
|
||||||
|
if ( isDefined( nearestzombienode ) && isDefined( nearestplayernode ) )
|
||||||
|
{
|
||||||
|
if ( !nodesvisible( nearestzombienode, nearestplayernode ) && !nodescanpath( nearestzombienode, nearestplayernode ) )
|
||||||
|
{
|
||||||
|
self silentlyremovezombie();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
wait 1;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
silentlyremovezombie()
|
||||||
|
{
|
||||||
|
level.zombie_total++;
|
||||||
|
playfx( level._effect[ "spawn_cloud" ], self.origin );
|
||||||
|
self.skip_death_notetracks = 1;
|
||||||
|
self.nodeathragdoll = 1;
|
||||||
|
self dodamage( self.maxhealth * 2, self.origin, self, self, "none", "MOD_SUICIDE" );
|
||||||
|
self self_delete();
|
||||||
|
}
|
||||||
|
|
||||||
|
zgrief_player_bled_out_msg()
|
||||||
|
{
|
||||||
|
level endon( "end_game" );
|
||||||
|
self endon( "disconnect" );
|
||||||
|
while ( 1 )
|
||||||
|
{
|
||||||
|
self waittill( "bled_out" );
|
||||||
|
level thread update_players_on_bleedout_or_disconnect( self );
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
show_grief_hud_msg( msg, msg_parm, offset, cleanup_end_game )
|
||||||
|
{
|
||||||
|
self endon( "disconnect" );
|
||||||
|
while ( isDefined( level.hostmigrationtimer ) )
|
||||||
|
{
|
||||||
|
wait 0,05;
|
||||||
|
}
|
||||||
|
zgrief_hudmsg = newclienthudelem( self );
|
||||||
|
zgrief_hudmsg.alignx = "center";
|
||||||
|
zgrief_hudmsg.aligny = "middle";
|
||||||
|
zgrief_hudmsg.horzalign = "center";
|
||||||
|
zgrief_hudmsg.vertalign = "middle";
|
||||||
|
zgrief_hudmsg.y -= 130;
|
||||||
|
if ( self issplitscreen() )
|
||||||
|
{
|
||||||
|
zgrief_hudmsg.y += 70;
|
||||||
|
}
|
||||||
|
if ( isDefined( offset ) )
|
||||||
|
{
|
||||||
|
zgrief_hudmsg.y += offset;
|
||||||
|
}
|
||||||
|
zgrief_hudmsg.foreground = 1;
|
||||||
|
zgrief_hudmsg.fontscale = 5;
|
||||||
|
zgrief_hudmsg.alpha = 0;
|
||||||
|
zgrief_hudmsg.color = ( 1, 1, 1 );
|
||||||
|
zgrief_hudmsg.hidewheninmenu = 1;
|
||||||
|
zgrief_hudmsg.font = "default";
|
||||||
|
if ( isDefined( cleanup_end_game ) && cleanup_end_game )
|
||||||
|
{
|
||||||
|
level endon( "end_game" );
|
||||||
|
zgrief_hudmsg thread show_grief_hud_msg_cleanup();
|
||||||
|
}
|
||||||
|
if ( isDefined( msg_parm ) )
|
||||||
|
{
|
||||||
|
zgrief_hudmsg settext( msg, msg_parm );
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
zgrief_hudmsg settext( msg );
|
||||||
|
}
|
||||||
|
zgrief_hudmsg changefontscaleovertime( 0,25 );
|
||||||
|
zgrief_hudmsg fadeovertime( 0,25 );
|
||||||
|
zgrief_hudmsg.alpha = 1;
|
||||||
|
zgrief_hudmsg.fontscale = 2;
|
||||||
|
wait 3,25;
|
||||||
|
zgrief_hudmsg changefontscaleovertime( 1 );
|
||||||
|
zgrief_hudmsg fadeovertime( 1 );
|
||||||
|
zgrief_hudmsg.alpha = 0;
|
||||||
|
zgrief_hudmsg.fontscale = 5;
|
||||||
|
wait 1;
|
||||||
|
zgrief_hudmsg notify( "death" );
|
||||||
|
if ( isDefined( zgrief_hudmsg ) )
|
||||||
|
{
|
||||||
|
zgrief_hudmsg destroy();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
show_grief_hud_msg_cleanup()
|
||||||
|
{
|
||||||
|
self endon( "death" );
|
||||||
|
level waittill( "end_game" );
|
||||||
|
if ( isDefined( self ) )
|
||||||
|
{
|
||||||
|
self destroy();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
grief_reset_message()
|
||||||
|
{
|
||||||
|
msg = &"ZOMBIE_GRIEF_RESET";
|
||||||
|
players = get_players();
|
||||||
|
if ( isDefined( level.hostmigrationtimer ) )
|
||||||
|
{
|
||||||
|
while ( isDefined( level.hostmigrationtimer ) )
|
||||||
|
{
|
||||||
|
wait 0,05;
|
||||||
|
}
|
||||||
|
wait 4;
|
||||||
|
}
|
||||||
|
_a697 = players;
|
||||||
|
_k697 = getFirstArrayKey( _a697 );
|
||||||
|
while ( isDefined( _k697 ) )
|
||||||
|
{
|
||||||
|
player = _a697[ _k697 ];
|
||||||
|
player thread show_grief_hud_msg( msg );
|
||||||
|
_k697 = getNextArrayKey( _a697, _k697 );
|
||||||
|
}
|
||||||
|
level thread maps/mp/zombies/_zm_audio_announcer::leaderdialog( "grief_restarted" );
|
||||||
|
}
|
||||||
|
|
||||||
|
grief_laststand_weapon_save( einflictor, attacker, idamage, smeansofdeath, sweapon, vdir, shitloc, psoffsettime, deathanimduration )
|
||||||
|
{
|
||||||
|
self.grief_savedweapon_weapons = self getweaponslist();
|
||||||
|
self.grief_savedweapon_weaponsammo_stock = [];
|
||||||
|
self.grief_savedweapon_weaponsammo_clip = [];
|
||||||
|
self.grief_savedweapon_currentweapon = self getcurrentweapon();
|
||||||
|
self.grief_savedweapon_grenades = self get_player_lethal_grenade();
|
||||||
|
if ( isDefined( self.grief_savedweapon_grenades ) )
|
||||||
|
{
|
||||||
|
self.grief_savedweapon_grenades_clip = self getweaponammoclip( self.grief_savedweapon_grenades );
|
||||||
|
}
|
||||||
|
self.grief_savedweapon_tactical = self get_player_tactical_grenade();
|
||||||
|
if ( isDefined( self.grief_savedweapon_tactical ) )
|
||||||
|
{
|
||||||
|
self.grief_savedweapon_tactical_clip = self getweaponammoclip( self.grief_savedweapon_tactical );
|
||||||
|
}
|
||||||
|
i = 0;
|
||||||
|
while ( i < self.grief_savedweapon_weapons.size )
|
||||||
|
{
|
||||||
|
self.grief_savedweapon_weaponsammo_clip[ i ] = self getweaponammoclip( self.grief_savedweapon_weapons[ i ] );
|
||||||
|
self.grief_savedweapon_weaponsammo_stock[ i ] = self getweaponammostock( self.grief_savedweapon_weapons[ i ] );
|
||||||
|
i++;
|
||||||
|
}
|
||||||
|
if ( isDefined( self.hasriotshield ) && self.hasriotshield )
|
||||||
|
{
|
||||||
|
self.grief_hasriotshield = 1;
|
||||||
|
}
|
||||||
|
if ( self hasweapon( "claymore_zm" ) )
|
||||||
|
{
|
||||||
|
self.grief_savedweapon_claymore = 1;
|
||||||
|
self.grief_savedweapon_claymore_clip = self getweaponammoclip( "claymore_zm" );
|
||||||
|
}
|
||||||
|
if ( isDefined( self.current_equipment ) )
|
||||||
|
{
|
||||||
|
self.grief_savedweapon_equipment = self.current_equipment;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
grief_laststand_weapons_return()
|
||||||
|
{
|
||||||
|
if ( isDefined( level.isresetting_grief ) && !level.isresetting_grief )
|
||||||
|
{
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
if ( !isDefined( self.grief_savedweapon_weapons ) )
|
||||||
|
{
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
primary_weapons_returned = 0;
|
||||||
|
_a766 = self.grief_savedweapon_weapons;
|
||||||
|
index = getFirstArrayKey( _a766 );
|
||||||
|
while ( isDefined( index ) )
|
||||||
|
{
|
||||||
|
weapon = _a766[ index ];
|
||||||
|
if ( isDefined( self.grief_savedweapon_grenades ) || weapon == self.grief_savedweapon_grenades && isDefined( self.grief_savedweapon_tactical ) && weapon == self.grief_savedweapon_tactical )
|
||||||
|
{
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
if ( isweaponprimary( weapon ) )
|
||||||
|
{
|
||||||
|
if ( primary_weapons_returned >= 2 )
|
||||||
|
{
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
else primary_weapons_returned++;
|
||||||
|
}
|
||||||
|
if ( weapon == "item_meat_zm" )
|
||||||
|
{
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
self giveweapon( weapon, 0, self maps/mp/zombies/_zm_weapons::get_pack_a_punch_weapon_options( weapon ) );
|
||||||
|
if ( isDefined( self.grief_savedweapon_weaponsammo_clip[ index ] ) )
|
||||||
|
{
|
||||||
|
self setweaponammoclip( weapon, self.grief_savedweapon_weaponsammo_clip[ index ] );
|
||||||
|
}
|
||||||
|
if ( isDefined( self.grief_savedweapon_weaponsammo_stock[ index ] ) )
|
||||||
|
{
|
||||||
|
self setweaponammostock( weapon, self.grief_savedweapon_weaponsammo_stock[ index ] );
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
index = getNextArrayKey( _a766, index );
|
||||||
|
}
|
||||||
|
if ( isDefined( self.grief_savedweapon_grenades ) )
|
||||||
|
{
|
||||||
|
self giveweapon( self.grief_savedweapon_grenades );
|
||||||
|
if ( isDefined( self.grief_savedweapon_grenades_clip ) )
|
||||||
|
{
|
||||||
|
self setweaponammoclip( self.grief_savedweapon_grenades, self.grief_savedweapon_grenades_clip );
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if ( isDefined( self.grief_savedweapon_tactical ) )
|
||||||
|
{
|
||||||
|
self giveweapon( self.grief_savedweapon_tactical );
|
||||||
|
if ( isDefined( self.grief_savedweapon_tactical_clip ) )
|
||||||
|
{
|
||||||
|
self setweaponammoclip( self.grief_savedweapon_tactical, self.grief_savedweapon_tactical_clip );
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if ( isDefined( self.current_equipment ) )
|
||||||
|
{
|
||||||
|
self maps/mp/zombies/_zm_equipment::equipment_take( self.current_equipment );
|
||||||
|
}
|
||||||
|
if ( isDefined( self.grief_savedweapon_equipment ) )
|
||||||
|
{
|
||||||
|
self.do_not_display_equipment_pickup_hint = 1;
|
||||||
|
self maps/mp/zombies/_zm_equipment::equipment_give( self.grief_savedweapon_equipment );
|
||||||
|
self.do_not_display_equipment_pickup_hint = undefined;
|
||||||
|
}
|
||||||
|
if ( isDefined( self.grief_hasriotshield ) && self.grief_hasriotshield )
|
||||||
|
{
|
||||||
|
if ( isDefined( self.player_shield_reset_health ) )
|
||||||
|
{
|
||||||
|
self [[ self.player_shield_reset_health ]]();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if ( isDefined( self.grief_savedweapon_claymore ) && self.grief_savedweapon_claymore )
|
||||||
|
{
|
||||||
|
self giveweapon( "claymore_zm" );
|
||||||
|
self set_player_placeable_mine( "claymore_zm" );
|
||||||
|
self setactionslot( 4, "weapon", "claymore_zm" );
|
||||||
|
self setweaponammoclip( "claymore_zm", self.grief_savedweapon_claymore_clip );
|
||||||
|
}
|
||||||
|
primaries = self getweaponslistprimaries();
|
||||||
|
_a859 = primaries;
|
||||||
|
_k859 = getFirstArrayKey( _a859 );
|
||||||
|
while ( isDefined( _k859 ) )
|
||||||
|
{
|
||||||
|
weapon = _a859[ _k859 ];
|
||||||
|
if ( isDefined( self.grief_savedweapon_currentweapon ) && self.grief_savedweapon_currentweapon == weapon )
|
||||||
|
{
|
||||||
|
self switchtoweapon( weapon );
|
||||||
|
return 1;
|
||||||
|
}
|
||||||
|
_k859 = getNextArrayKey( _a859, _k859 );
|
||||||
|
}
|
||||||
|
if ( primaries.size > 0 )
|
||||||
|
{
|
||||||
|
self switchtoweapon( primaries[ 0 ] );
|
||||||
|
return 1;
|
||||||
|
}
|
||||||
|
/#
|
||||||
|
assert( primaries.size > 0, "GRIEF: There was a problem restoring the weapons" );
|
||||||
|
#/
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
grief_store_player_scores()
|
||||||
|
{
|
||||||
|
players = get_players();
|
||||||
|
_a883 = players;
|
||||||
|
_k883 = getFirstArrayKey( _a883 );
|
||||||
|
while ( isDefined( _k883 ) )
|
||||||
|
{
|
||||||
|
player = _a883[ _k883 ];
|
||||||
|
player._pre_round_score = player.score;
|
||||||
|
_k883 = getNextArrayKey( _a883, _k883 );
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
grief_restore_player_score()
|
||||||
|
{
|
||||||
|
if ( !isDefined( self._pre_round_score ) )
|
||||||
|
{
|
||||||
|
self._pre_round_score = self.score;
|
||||||
|
}
|
||||||
|
if ( isDefined( self._pre_round_score ) )
|
||||||
|
{
|
||||||
|
self.score = self._pre_round_score;
|
||||||
|
self.pers[ "score" ] = self._pre_round_score;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
game_mode_spawn_player_logic()
|
||||||
|
{
|
||||||
|
if ( flag( "start_zombie_round_logic" ) && !isDefined( self.is_hotjoin ) )
|
||||||
|
{
|
||||||
|
self.is_hotjoin = 1;
|
||||||
|
return 1;
|
||||||
|
}
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
update_players_on_bleedout_or_disconnect( excluded_player )
|
||||||
|
{
|
||||||
|
other_team = undefined;
|
||||||
|
players = get_players();
|
||||||
|
players_remaining = 0;
|
||||||
|
_a920 = players;
|
||||||
|
_k920 = getFirstArrayKey( _a920 );
|
||||||
|
while ( isDefined( _k920 ) )
|
||||||
|
{
|
||||||
|
player = _a920[ _k920 ];
|
||||||
|
if ( player == excluded_player )
|
||||||
|
{
|
||||||
|
}
|
||||||
|
else if ( player.team == excluded_player.team )
|
||||||
|
{
|
||||||
|
if ( is_player_valid( player ) )
|
||||||
|
{
|
||||||
|
players_remaining++;
|
||||||
|
}
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
_k920 = getNextArrayKey( _a920, _k920 );
|
||||||
|
}
|
||||||
|
_a937 = players;
|
||||||
|
_k937 = getFirstArrayKey( _a937 );
|
||||||
|
while ( isDefined( _k937 ) )
|
||||||
|
{
|
||||||
|
player = _a937[ _k937 ];
|
||||||
|
if ( player == excluded_player )
|
||||||
|
{
|
||||||
|
}
|
||||||
|
else if ( player.team != excluded_player.team )
|
||||||
|
{
|
||||||
|
other_team = player.team;
|
||||||
|
if ( players_remaining < 1 )
|
||||||
|
{
|
||||||
|
player thread show_grief_hud_msg( &"ZOMBIE_ZGRIEF_ALL_PLAYERS_DOWN", undefined, undefined, 1 );
|
||||||
|
player delay_thread_watch_host_migrate( 2, ::show_grief_hud_msg, &"ZOMBIE_ZGRIEF_SURVIVE", undefined, 30, 1 );
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
player thread show_grief_hud_msg( &"ZOMBIE_ZGRIEF_PLAYER_BLED_OUT", players_remaining );
|
||||||
|
}
|
||||||
|
}
|
||||||
|
_k937 = getNextArrayKey( _a937, _k937 );
|
||||||
|
}
|
||||||
|
if ( players_remaining == 1 )
|
||||||
|
{
|
||||||
|
level thread maps/mp/zombies/_zm_audio_announcer::leaderdialog( "last_player", excluded_player.team );
|
||||||
|
}
|
||||||
|
if ( !isDefined( other_team ) )
|
||||||
|
{
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
if ( players_remaining < 1 )
|
||||||
|
{
|
||||||
|
level thread maps/mp/zombies/_zm_audio_announcer::leaderdialog( "4_player_down", other_team );
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
level thread maps/mp/zombies/_zm_audio_announcer::leaderdialog( players_remaining + "_player_left", other_team );
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
delay_thread_watch_host_migrate( timer, func, param1, param2, param3, param4, param5, param6 )
|
||||||
|
{
|
||||||
|
self thread _delay_thread_watch_host_migrate_proc( func, timer, param1, param2, param3, param4, param5, param6 );
|
||||||
|
}
|
||||||
|
|
||||||
|
_delay_thread_watch_host_migrate_proc( func, timer, param1, param2, param3, param4, param5, param6 )
|
||||||
|
{
|
||||||
|
self endon( "death" );
|
||||||
|
self endon( "disconnect" );
|
||||||
|
wait timer;
|
||||||
|
if ( isDefined( level.hostmigrationtimer ) )
|
||||||
|
{
|
||||||
|
while ( isDefined( level.hostmigrationtimer ) )
|
||||||
|
{
|
||||||
|
wait 0,05;
|
||||||
|
}
|
||||||
|
wait timer;
|
||||||
|
}
|
||||||
|
single_thread( self, func, param1, param2, param3, param4, param5, param6 );
|
||||||
|
}
|
||||||
|
|
||||||
|
grief_round_end_custom_logic()
|
||||||
|
{
|
||||||
|
waittillframeend;
|
||||||
|
if ( isDefined( level.gamemodulewinningteam ) )
|
||||||
|
{
|
||||||
|
level notify( "end_round_think" );
|
||||||
|
}
|
||||||
|
}
|
2473
zm_buried_patch/maps/mp/gametypes_zm/zmeat.gsc
Normal file
2473
zm_buried_patch/maps/mp/gametypes_zm/zmeat.gsc
Normal file
File diff suppressed because it is too large
Load Diff
43
zm_buried_patch/maps/mp/gametypes_zm/zstandard.gsc
Normal file
43
zm_buried_patch/maps/mp/gametypes_zm/zstandard.gsc
Normal file
@ -0,0 +1,43 @@
|
|||||||
|
#include maps/mp/zombies/_zm;
|
||||||
|
#include maps/mp/zombies/_zm_ai_dogs;
|
||||||
|
#include maps/mp/zombies/_zm_stats;
|
||||||
|
#include common_scripts/utility;
|
||||||
|
#include maps/mp/gametypes_zm/_hud_util;
|
||||||
|
#include maps/mp/_utility;
|
||||||
|
|
||||||
|
main()
|
||||||
|
{
|
||||||
|
maps/mp/gametypes_zm/_zm_gametype::main();
|
||||||
|
level.onprecachegametype = ::onprecachegametype;
|
||||||
|
level.onstartgametype = ::onstartgametype;
|
||||||
|
level._game_module_custom_spawn_init_func = ::maps/mp/gametypes_zm/_zm_gametype::custom_spawn_init_func;
|
||||||
|
level._game_module_stat_update_func = ::maps/mp/zombies/_zm_stats::survival_classic_custom_stat_update;
|
||||||
|
maps/mp/gametypes_zm/_zm_gametype::post_gametype_main( "zstandard" );
|
||||||
|
}
|
||||||
|
|
||||||
|
onprecachegametype()
|
||||||
|
{
|
||||||
|
level.playersuicideallowed = 1;
|
||||||
|
level.canplayersuicide = ::canplayersuicide;
|
||||||
|
level.suicide_weapon = "death_self_zm";
|
||||||
|
precacheitem( "death_self_zm" );
|
||||||
|
maps/mp/zombies/_zm_ai_dogs::init();
|
||||||
|
maps/mp/gametypes_zm/_zm_gametype::rungametypeprecache( "zstandard" );
|
||||||
|
}
|
||||||
|
|
||||||
|
onstartgametype()
|
||||||
|
{
|
||||||
|
maps/mp/gametypes_zm/_zm_gametype::setup_classic_gametype();
|
||||||
|
maps/mp/gametypes_zm/_zm_gametype::rungametypemain( "zstandard", ::zstandard_main );
|
||||||
|
}
|
||||||
|
|
||||||
|
zstandard_main()
|
||||||
|
{
|
||||||
|
level.dog_rounds_allowed = getgametypesetting( "allowdogs" );
|
||||||
|
if ( level.dog_rounds_allowed )
|
||||||
|
{
|
||||||
|
maps/mp/zombies/_zm_ai_dogs::enable_dog_rounds();
|
||||||
|
}
|
||||||
|
level thread maps/mp/zombies/_zm::round_start();
|
||||||
|
level thread maps/mp/gametypes_zm/_zm_gametype::kill_all_zombies();
|
||||||
|
}
|
51
zm_buried_patch/maps/mp/teams/_teamset_cdc.gsc
Normal file
51
zm_buried_patch/maps/mp/teams/_teamset_cdc.gsc
Normal file
@ -0,0 +1,51 @@
|
|||||||
|
|
||||||
|
register()
|
||||||
|
{
|
||||||
|
game[ "teamset" ] = [];
|
||||||
|
game[ "teamset" ][ "cdc" ] = ::cdc;
|
||||||
|
}
|
||||||
|
|
||||||
|
level_init()
|
||||||
|
{
|
||||||
|
game[ "allies" ] = "cdc";
|
||||||
|
game[ "axis" ] = "cia";
|
||||||
|
setdvar( "g_TeamName_Allies", &"ZMUI_CDC_SHORT" );
|
||||||
|
setdvar( "g_TeamName_Axis", &"ZMUI_CIA_SHORT" );
|
||||||
|
game[ "strings" ][ "allies_win" ] = &"ZM_CDC_WIN_MATCH";
|
||||||
|
game[ "strings" ][ "allies_win_round" ] = &"ZM_CDC_WIN_ROUND";
|
||||||
|
game[ "strings" ][ "allies_mission_accomplished" ] = &"ZM_CDC_MISSION_ACCOMPLISHED";
|
||||||
|
game[ "strings" ][ "allies_eliminated" ] = &"ZM_CDC_ELIMINATED";
|
||||||
|
game[ "strings" ][ "allies_forfeited" ] = &"ZM_CDC_FORFEITED";
|
||||||
|
game[ "strings" ][ "allies_name" ] = &"ZM_CDC_NAME";
|
||||||
|
game[ "music" ][ "spawn_allies" ] = "SPAWN_OPS";
|
||||||
|
game[ "music" ][ "victory_allies" ] = "mus_victory_usa";
|
||||||
|
game[ "icons" ][ "allies" ] = "faction_cdc";
|
||||||
|
game[ "colors" ][ "allies" ] = ( 0, 0, 0 );
|
||||||
|
game[ "voice" ][ "allies" ] = "vox_st6_";
|
||||||
|
setdvar( "scr_allies", "marines" );
|
||||||
|
game[ "strings" ][ "axis_win" ] = &"ZM_CIA_WIN_MATCH";
|
||||||
|
game[ "strings" ][ "axis_win_round" ] = &"ZM_CIA_WIN_ROUND";
|
||||||
|
game[ "strings" ][ "axis_mission_accomplished" ] = &"ZM_CIA_MISSION_ACCOMPLISHED";
|
||||||
|
game[ "strings" ][ "axis_eliminated" ] = &"ZM_CIA_ELIMINATED";
|
||||||
|
game[ "strings" ][ "axis_forfeited" ] = &"ZM_CIA_FORFEITED";
|
||||||
|
game[ "strings" ][ "axis_name" ] = &"ZM_CIA_NAME";
|
||||||
|
game[ "music" ][ "spawn_axis" ] = "SPAWN_RUS";
|
||||||
|
game[ "music" ][ "victory_axis" ] = "mus_victory_soviet";
|
||||||
|
game[ "icons" ][ "axis" ] = "faction_cia";
|
||||||
|
game[ "colors" ][ "axis" ] = ( 0,65, 0,57, 0,41 );
|
||||||
|
game[ "voice" ][ "axis" ] = "vox_pmc_";
|
||||||
|
}
|
||||||
|
|
||||||
|
cdc()
|
||||||
|
{
|
||||||
|
allies();
|
||||||
|
axis();
|
||||||
|
}
|
||||||
|
|
||||||
|
allies()
|
||||||
|
{
|
||||||
|
}
|
||||||
|
|
||||||
|
axis()
|
||||||
|
{
|
||||||
|
}
|
2517
zm_buried_patch/maps/mp/zm_buried.gsc
Normal file
2517
zm_buried_patch/maps/mp/zm_buried.gsc
Normal file
File diff suppressed because it is too large
Load Diff
184
zm_buried_patch/maps/mp/zm_buried_achievement.gsc
Normal file
184
zm_buried_patch/maps/mp/zm_buried_achievement.gsc
Normal file
@ -0,0 +1,184 @@
|
|||||||
|
#include maps/mp/gametypes_zm/_globallogic_score;
|
||||||
|
#include maps/mp/zombies/_zm_utility;
|
||||||
|
#include common_scripts/utility;
|
||||||
|
#include maps/mp/_utility;
|
||||||
|
|
||||||
|
init()
|
||||||
|
{
|
||||||
|
if ( !is_gametype_active( "zclassic" ) )
|
||||||
|
{
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
level thread achievement_buried_sidequest();
|
||||||
|
level thread achievement_im_your_huckleberry();
|
||||||
|
level.achievement_sound_func = ::achievement_sound_func;
|
||||||
|
onplayerconnect_callback( ::onplayerconnect );
|
||||||
|
}
|
||||||
|
|
||||||
|
achievement_sound_func( achievement_name_lower )
|
||||||
|
{
|
||||||
|
if ( !sessionmodeisonlinegame() )
|
||||||
|
{
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
self thread do_player_general_vox( "general", "achievement" );
|
||||||
|
}
|
||||||
|
|
||||||
|
init_player_achievement_stats()
|
||||||
|
{
|
||||||
|
if ( !is_gametype_active( "zclassic" ) )
|
||||||
|
{
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
self maps/mp/gametypes_zm/_globallogic_score::initpersstat( "zm_dlc3_buried_sidequest", 0 );
|
||||||
|
self maps/mp/gametypes_zm/_globallogic_score::initpersstat( "zm_dlc3_ectoplasmic_residue", 0 );
|
||||||
|
self maps/mp/gametypes_zm/_globallogic_score::initpersstat( "zm_dlc3_im_your_huckleberry", 0 );
|
||||||
|
self maps/mp/gametypes_zm/_globallogic_score::initpersstat( "zm_dlc3_death_from_below", 0 );
|
||||||
|
self maps/mp/gametypes_zm/_globallogic_score::initpersstat( "zm_dlc3_candygram", 0 );
|
||||||
|
self maps/mp/gametypes_zm/_globallogic_score::initpersstat( "zm_dlc3_awaken_the_gazebo", 0 );
|
||||||
|
self maps/mp/gametypes_zm/_globallogic_score::initpersstat( "zm_dlc3_revisionist_historian", 0 );
|
||||||
|
self maps/mp/gametypes_zm/_globallogic_score::initpersstat( "zm_dlc3_mazed_and_confused", 0 );
|
||||||
|
self maps/mp/gametypes_zm/_globallogic_score::initpersstat( "zm_dlc3_fsirt_against_the_wall", 0 );
|
||||||
|
self maps/mp/gametypes_zm/_globallogic_score::initpersstat( "zm_dlc3_when_the_revolution_comes", 0 );
|
||||||
|
}
|
||||||
|
|
||||||
|
onplayerconnect()
|
||||||
|
{
|
||||||
|
self thread achievement_ectoplasmic_residue();
|
||||||
|
self thread achievement_death_from_below();
|
||||||
|
self thread achievement_candygram();
|
||||||
|
self thread achievement_awaken_the_gazebo();
|
||||||
|
self thread achievement_revisionist_historian();
|
||||||
|
self thread achievement_mazed_and_confused();
|
||||||
|
self thread achievement_fsirt_against_the_wall();
|
||||||
|
self thread achievement_when_the_revolution_comes();
|
||||||
|
}
|
||||||
|
|
||||||
|
achievement_buried_sidequest()
|
||||||
|
{
|
||||||
|
level endon( "end_game" );
|
||||||
|
level waittill_any( "sq_richtofen_complete", "sq_maxis_complete" );
|
||||||
|
/#
|
||||||
|
#/
|
||||||
|
level giveachievement_wrapper( "ZM_DLC3_BURIED_SIDEQUEST", 1 );
|
||||||
|
}
|
||||||
|
|
||||||
|
achievement_im_your_huckleberry()
|
||||||
|
{
|
||||||
|
level endon( "end_game" );
|
||||||
|
num_barriers_broken = 0;
|
||||||
|
while ( 1 )
|
||||||
|
{
|
||||||
|
level waittill( "sloth_breaks_barrier" );
|
||||||
|
num_barriers_broken++;
|
||||||
|
if ( num_barriers_broken >= 8 )
|
||||||
|
{
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
}
|
||||||
|
}
|
||||||
|
/#
|
||||||
|
#/
|
||||||
|
level giveachievement_wrapper( "ZM_DLC3_IM_YOUR_HUCKLEBERRY", 1 );
|
||||||
|
}
|
||||||
|
|
||||||
|
achievement_ectoplasmic_residue()
|
||||||
|
{
|
||||||
|
level endon( "end_game" );
|
||||||
|
self endon( "disconnect" );
|
||||||
|
self waittill( "player_received_ghost_round_free_perk" );
|
||||||
|
/#
|
||||||
|
#/
|
||||||
|
self giveachievement_wrapper( "ZM_DLC3_ECTOPLASMIC_RESIDUE" );
|
||||||
|
}
|
||||||
|
|
||||||
|
achievement_death_from_below()
|
||||||
|
{
|
||||||
|
level endon( "end_game" );
|
||||||
|
self endon( "disconnect" );
|
||||||
|
num_subwoofer_deaths = 0;
|
||||||
|
while ( 1 )
|
||||||
|
{
|
||||||
|
self waittill( "zombie_subwoofer_kill" );
|
||||||
|
num_subwoofer_deaths++;
|
||||||
|
if ( num_subwoofer_deaths >= 10 )
|
||||||
|
{
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
}
|
||||||
|
}
|
||||||
|
/#
|
||||||
|
#/
|
||||||
|
self giveachievement_wrapper( "ZM_DLC3_DEATH_FROM_BELOW" );
|
||||||
|
}
|
||||||
|
|
||||||
|
achievement_candygram()
|
||||||
|
{
|
||||||
|
level endon( "end_game" );
|
||||||
|
self endon( "disconnect" );
|
||||||
|
self waittill( "player_gives_sloth_candy" );
|
||||||
|
/#
|
||||||
|
#/
|
||||||
|
self giveachievement_wrapper( "ZM_DLC3_CANDYGRAM" );
|
||||||
|
}
|
||||||
|
|
||||||
|
achievement_awaken_the_gazebo()
|
||||||
|
{
|
||||||
|
level endon( "end_game" );
|
||||||
|
self endon( "disconnect" );
|
||||||
|
level endon( "bank_withdrawal" );
|
||||||
|
level endon( "bank_teller_used" );
|
||||||
|
level endon( "weapon_locker_grab" );
|
||||||
|
self waittill( "pap_taken" );
|
||||||
|
if ( level.round_number > 1 )
|
||||||
|
{
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
/#
|
||||||
|
#/
|
||||||
|
self giveachievement_wrapper( "ZM_DLC3_AWAKEN_THE_GAZEBO" );
|
||||||
|
}
|
||||||
|
|
||||||
|
achievement_revisionist_historian()
|
||||||
|
{
|
||||||
|
level endon( "end_game" );
|
||||||
|
self endon( "disconnect" );
|
||||||
|
self waittill( "player_activates_timebomb" );
|
||||||
|
/#
|
||||||
|
#/
|
||||||
|
self giveachievement_wrapper( "ZM_DLC3_REVISIONIST_HISTORIAN" );
|
||||||
|
}
|
||||||
|
|
||||||
|
achievement_mazed_and_confused()
|
||||||
|
{
|
||||||
|
level endon( "end_game" );
|
||||||
|
self endon( "disconnect" );
|
||||||
|
self waittill( "player_stayed_in_maze_for_entire_high_level_round" );
|
||||||
|
/#
|
||||||
|
#/
|
||||||
|
self giveachievement_wrapper( "ZM_DLC3_MAZED_AND_CONFUSED" );
|
||||||
|
}
|
||||||
|
|
||||||
|
achievement_fsirt_against_the_wall()
|
||||||
|
{
|
||||||
|
level endon( "end_game" );
|
||||||
|
self endon( "disconnect" );
|
||||||
|
self waittill( "player_upgraded_lsat_from_wall" );
|
||||||
|
/#
|
||||||
|
#/
|
||||||
|
self giveachievement_wrapper( "ZM_DLC3_FSIRT_AGAINST_THE_WALL" );
|
||||||
|
}
|
||||||
|
|
||||||
|
achievement_when_the_revolution_comes()
|
||||||
|
{
|
||||||
|
level endon( "end_game" );
|
||||||
|
self endon( "disconnect" );
|
||||||
|
self waittill( "player_used_fountain_teleporter" );
|
||||||
|
/#
|
||||||
|
#/
|
||||||
|
self giveachievement_wrapper( "ZM_DLC3_WHEN_THE_REVOLUTION_COMES" );
|
||||||
|
}
|
679
zm_buried_patch/maps/mp/zm_buried_amb.gsc
Normal file
679
zm_buried_patch/maps/mp/zm_buried_amb.gsc
Normal file
@ -0,0 +1,679 @@
|
|||||||
|
#include maps/mp/zombies/_zm_zonemgr;
|
||||||
|
#include maps/mp/zombies/_zm_audio;
|
||||||
|
#include maps/mp/zombies/_zm_sidequests;
|
||||||
|
#include maps/mp/_ambientpackage;
|
||||||
|
#include maps/mp/zm_alcatraz_utility;
|
||||||
|
#include maps/mp/zombies/_zm_utility;
|
||||||
|
#include maps/mp/_utility;
|
||||||
|
#include common_scripts/utility;
|
||||||
|
|
||||||
|
main()
|
||||||
|
{
|
||||||
|
level.sndzombieentcontext = 1;
|
||||||
|
if ( is_classic() )
|
||||||
|
{
|
||||||
|
thread sndmusicegg();
|
||||||
|
thread sndstingersetup();
|
||||||
|
onplayerconnect_callback( ::sndtrackers );
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
sndtrackers()
|
||||||
|
{
|
||||||
|
self thread sndbackgroundmustracker();
|
||||||
|
}
|
||||||
|
|
||||||
|
sndstingersetup()
|
||||||
|
{
|
||||||
|
level.sndmusicstingerevent = ::sndplaystinger;
|
||||||
|
level.sndstinger = spawnstruct();
|
||||||
|
level.sndstinger.ent = spawn( "script_origin", ( 0, 0, 0 ) );
|
||||||
|
level.sndstinger.queue = 0;
|
||||||
|
level.sndstinger.isplaying = 0;
|
||||||
|
level.sndstinger.states = [];
|
||||||
|
level.sndroundwait = 1;
|
||||||
|
flag_wait( "start_zombie_round_logic" );
|
||||||
|
level sndstingersetupstates();
|
||||||
|
level thread sndstingerroundwait();
|
||||||
|
level thread sndboardmonitor();
|
||||||
|
level thread locationstingerwait();
|
||||||
|
}
|
||||||
|
|
||||||
|
sndstingersetupstates()
|
||||||
|
{
|
||||||
|
createstingerstate( "door_open", "mus_event_group_03", 2,5, "ignore" );
|
||||||
|
createstingerstate( "boards_gone", "mus_event_group_02", 0,5, "ignore" );
|
||||||
|
createstingerstate( "zone_tunnels_center", "mus_event_location_tunnels", 0,75, "queue" );
|
||||||
|
createstingerstate( "zone_stables", "mus_event_location_stables", 0,75, "queue" );
|
||||||
|
createstingerstate( "zone_underground_courthouse", "mus_event_location_courthouse", 0,75, "queue" );
|
||||||
|
createstingerstate( "zone_underground_bar", "mus_event_location_bar", 0,75, "queue" );
|
||||||
|
createstingerstate( "zone_toy_store", "mus_event_location_toystore", 0,75, "queue" );
|
||||||
|
createstingerstate( "zone_underground_jail", "mus_event_location_jail", 0,75, "queue" );
|
||||||
|
createstingerstate( "zone_general_store", "mus_event_location_genstore", 0,75, "queue" );
|
||||||
|
createstingerstate( "zone_morgue", "mus_event_location_morgue", 0,75, "queue" );
|
||||||
|
createstingerstate( "zone_church_main", "mus_event_location_church", 0,75, "queue" );
|
||||||
|
createstingerstate( "zone_mansion_lawn", "mus_event_location_mansionlawn", 0,75, "queue" );
|
||||||
|
createstingerstate( "zone_mansion", "mus_event_location_mansion", 0,75, "queue" );
|
||||||
|
createstingerstate( "zone_maze", "mus_event_location_maze", 0,75, "queue" );
|
||||||
|
createstingerstate( "zone_maze_staircase", "mus_event_location_mazeend", 0,75, "queue" );
|
||||||
|
createstingerstate( "zone_candy_store", "mus_event_location_candystore", 0,75, "queue" );
|
||||||
|
createstingerstate( "zone_street_lighteast", "mus_event_location_street_east", 0,75, "queue" );
|
||||||
|
createstingerstate( "zone_street_lightwest", "mus_event_location_street_west", 0,75, "queue" );
|
||||||
|
createstingerstate( "zone_start_lower", "mus_event_location_diamondmine", 0,75, "queue" );
|
||||||
|
createstingerstate( "sloth_escape", "mus_event_sloth_breakout", 0, "reject" );
|
||||||
|
createstingerstate( "poweron", "mus_event_poweron", 0, "reject" );
|
||||||
|
createstingerstate( "sidequest_1", "mus_sidequest_0", 0, "reject" );
|
||||||
|
createstingerstate( "sidequest_2", "mus_sidequest_1", 0, "reject" );
|
||||||
|
createstingerstate( "sidequest_3", "mus_sidequest_2", 0, "reject" );
|
||||||
|
createstingerstate( "sidequest_4", "mus_sidequest_3", 0, "reject" );
|
||||||
|
createstingerstate( "sidequest_5", "mus_sidequest_4", 0, "reject" );
|
||||||
|
createstingerstate( "sidequest_6", "mus_sidequest_5", 0, "reject" );
|
||||||
|
createstingerstate( "sidequest_7", "mus_sidequest_6", 0, "reject" );
|
||||||
|
createstingerstate( "sidequest_8", "mus_sidequest_7", 0, "reject" );
|
||||||
|
}
|
||||||
|
|
||||||
|
createstingerstate( state, alias, prewait, interrupt )
|
||||||
|
{
|
||||||
|
s = level.sndstinger;
|
||||||
|
if ( !isDefined( s.states[ state ] ) )
|
||||||
|
{
|
||||||
|
s.states[ state ] = spawnstruct();
|
||||||
|
s.states[ state ].alias = alias;
|
||||||
|
s.states[ state ].prewait = prewait;
|
||||||
|
s.states[ state ].interrupt = interrupt;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
sndboardmonitor()
|
||||||
|
{
|
||||||
|
while ( 1 )
|
||||||
|
{
|
||||||
|
level waittill( "last_board_torn", barrier_origin );
|
||||||
|
players = getplayers();
|
||||||
|
_a110 = players;
|
||||||
|
_k110 = getFirstArrayKey( _a110 );
|
||||||
|
while ( isDefined( _k110 ) )
|
||||||
|
{
|
||||||
|
player = _a110[ _k110 ];
|
||||||
|
if ( distancesquared( player.origin, barrier_origin ) <= 22500 )
|
||||||
|
{
|
||||||
|
level thread maps/mp/zombies/_zm_audio::sndmusicstingerevent( "boards_gone" );
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
_k110 = getNextArrayKey( _a110, _k110 );
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
locationstingerwait( zone_name, type )
|
||||||
|
{
|
||||||
|
array = sndlocationsarray();
|
||||||
|
sndnorepeats = 3;
|
||||||
|
numcut = 0;
|
||||||
|
level.sndlastzone = undefined;
|
||||||
|
level.sndlocationplayed = 0;
|
||||||
|
level thread sndlocationbetweenroundswait();
|
||||||
|
for ( ;; )
|
||||||
|
{
|
||||||
|
while ( 1 )
|
||||||
|
{
|
||||||
|
level waittill( "newzoneActive", activezone );
|
||||||
|
wait 0,1;
|
||||||
|
while ( !sndlocationshouldplay( array, activezone ) )
|
||||||
|
{
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
if ( is_true( level.sndroundwait ) )
|
||||||
|
{
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else while ( is_true( level.sndstinger.isplaying ) )
|
||||||
|
{
|
||||||
|
level thread sndlocationqueue( activezone );
|
||||||
|
}
|
||||||
|
level thread maps/mp/zombies/_zm_audio::sndmusicstingerevent( activezone );
|
||||||
|
level.sndlocationplayed = 1;
|
||||||
|
array = sndcurrentlocationarray( array, activezone, numcut, sndnorepeats );
|
||||||
|
level.sndlastzone = activezone;
|
||||||
|
if ( numcut >= sndnorepeats )
|
||||||
|
{
|
||||||
|
numcut = 0;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
numcut++;
|
||||||
|
}
|
||||||
|
level waittill( "between_round_over" );
|
||||||
|
while ( is_true( level.sndroundwait ) )
|
||||||
|
{
|
||||||
|
wait 0,1;
|
||||||
|
}
|
||||||
|
level.sndlocationplayed = 0;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
sndlocationsarray()
|
||||||
|
{
|
||||||
|
array = [];
|
||||||
|
array[ 0 ] = "zone_tunnels_center";
|
||||||
|
array[ 1 ] = "zone_church_main";
|
||||||
|
array[ 2 ] = "zone_mansion";
|
||||||
|
array[ 3 ] = "zone_maze";
|
||||||
|
array[ 4 ] = "zone_maze_staircase";
|
||||||
|
array[ 5 ] = "zone_street_lightwest";
|
||||||
|
array[ 6 ] = "zone_toy_store";
|
||||||
|
array[ 7 ] = "zone_candy_store";
|
||||||
|
array[ 8 ] = "zone_underground_courthouse";
|
||||||
|
array[ 9 ] = "zone_start_lower";
|
||||||
|
return array;
|
||||||
|
}
|
||||||
|
|
||||||
|
sndlocationshouldplay( array, activezone )
|
||||||
|
{
|
||||||
|
shouldplay = 0;
|
||||||
|
if ( activezone == "zone_start_lower" && !flag( "fountain_transport_active" ) )
|
||||||
|
{
|
||||||
|
return shouldplay;
|
||||||
|
}
|
||||||
|
if ( is_true( level.music_override ) )
|
||||||
|
{
|
||||||
|
return shouldplay;
|
||||||
|
}
|
||||||
|
_a197 = array;
|
||||||
|
_k197 = getFirstArrayKey( _a197 );
|
||||||
|
while ( isDefined( _k197 ) )
|
||||||
|
{
|
||||||
|
place = _a197[ _k197 ];
|
||||||
|
if ( place == activezone )
|
||||||
|
{
|
||||||
|
shouldplay = 1;
|
||||||
|
}
|
||||||
|
_k197 = getNextArrayKey( _a197, _k197 );
|
||||||
|
}
|
||||||
|
if ( shouldplay == 0 )
|
||||||
|
{
|
||||||
|
return shouldplay;
|
||||||
|
}
|
||||||
|
playersinlocal = 0;
|
||||||
|
players = getplayers();
|
||||||
|
_a208 = players;
|
||||||
|
_k208 = getFirstArrayKey( _a208 );
|
||||||
|
while ( isDefined( _k208 ) )
|
||||||
|
{
|
||||||
|
player = _a208[ _k208 ];
|
||||||
|
if ( player maps/mp/zombies/_zm_zonemgr::is_player_in_zone( activezone ) )
|
||||||
|
{
|
||||||
|
if ( !is_true( player.afterlife ) )
|
||||||
|
{
|
||||||
|
playersinlocal++;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
_k208 = getNextArrayKey( _a208, _k208 );
|
||||||
|
}
|
||||||
|
if ( playersinlocal >= 1 )
|
||||||
|
{
|
||||||
|
shouldplay = 1;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
shouldplay = 0;
|
||||||
|
}
|
||||||
|
return shouldplay;
|
||||||
|
}
|
||||||
|
|
||||||
|
sndcurrentlocationarray( current_array, activezone, numcut, max_num_removed )
|
||||||
|
{
|
||||||
|
if ( numcut >= max_num_removed )
|
||||||
|
{
|
||||||
|
current_array = sndlocationsarray();
|
||||||
|
}
|
||||||
|
_a231 = current_array;
|
||||||
|
_k231 = getFirstArrayKey( _a231 );
|
||||||
|
while ( isDefined( _k231 ) )
|
||||||
|
{
|
||||||
|
place = _a231[ _k231 ];
|
||||||
|
if ( place == activezone )
|
||||||
|
{
|
||||||
|
arrayremovevalue( current_array, place );
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
_k231 = getNextArrayKey( _a231, _k231 );
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return current_array;
|
||||||
|
}
|
||||||
|
|
||||||
|
sndlocationbetweenrounds()
|
||||||
|
{
|
||||||
|
level endon( "newzoneActive" );
|
||||||
|
activezones = maps/mp/zombies/_zm_zonemgr::get_active_zone_names();
|
||||||
|
_a248 = activezones;
|
||||||
|
_k248 = getFirstArrayKey( _a248 );
|
||||||
|
while ( isDefined( _k248 ) )
|
||||||
|
{
|
||||||
|
zone = _a248[ _k248 ];
|
||||||
|
if ( isDefined( level.sndlastzone ) && zone == level.sndlastzone )
|
||||||
|
{
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
players = getplayers();
|
||||||
|
_a254 = players;
|
||||||
|
_k254 = getFirstArrayKey( _a254 );
|
||||||
|
while ( isDefined( _k254 ) )
|
||||||
|
{
|
||||||
|
player = _a254[ _k254 ];
|
||||||
|
if ( is_true( player.afterlife ) )
|
||||||
|
{
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
if ( player maps/mp/zombies/_zm_zonemgr::is_player_in_zone( zone ) )
|
||||||
|
{
|
||||||
|
wait 0,1;
|
||||||
|
level notify( "newzoneActive" );
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
_k254 = getNextArrayKey( _a254, _k254 );
|
||||||
|
}
|
||||||
|
}
|
||||||
|
_k248 = getNextArrayKey( _a248, _k248 );
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
sndlocationbetweenroundswait()
|
||||||
|
{
|
||||||
|
while ( is_true( level.sndroundwait ) )
|
||||||
|
{
|
||||||
|
wait 0,1;
|
||||||
|
}
|
||||||
|
while ( 1 )
|
||||||
|
{
|
||||||
|
level thread sndlocationbetweenrounds();
|
||||||
|
level waittill( "between_round_over" );
|
||||||
|
while ( is_true( level.sndroundwait ) )
|
||||||
|
{
|
||||||
|
wait 0,1;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
sndlocationqueue( zone )
|
||||||
|
{
|
||||||
|
level endon( "newzoneActive" );
|
||||||
|
while ( is_true( level.sndstinger.isplaying ) )
|
||||||
|
{
|
||||||
|
wait 0,5;
|
||||||
|
}
|
||||||
|
level notify( "newzoneActive" );
|
||||||
|
}
|
||||||
|
|
||||||
|
sndplaystinger( state, player )
|
||||||
|
{
|
||||||
|
s = level.sndstinger;
|
||||||
|
if ( !isDefined( s.states[ state ] ) )
|
||||||
|
{
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
interrupt = s.states[ state ].interrupt == "ignore";
|
||||||
|
if ( !is_true( s.isplaying ) || is_true( interrupt ) )
|
||||||
|
{
|
||||||
|
if ( interrupt )
|
||||||
|
{
|
||||||
|
wait s.states[ state ].prewait;
|
||||||
|
playstinger( state, player, 1 );
|
||||||
|
}
|
||||||
|
else if ( !level.sndroundwait )
|
||||||
|
{
|
||||||
|
s.isplaying = 1;
|
||||||
|
wait s.states[ state ].prewait;
|
||||||
|
playstinger( state, player, 0 );
|
||||||
|
level notify( "sndStingerDone" );
|
||||||
|
s.isplaying = 0;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
if ( s.states[ state ].interrupt == "queue" )
|
||||||
|
{
|
||||||
|
level thread sndqueuestinger( state, player );
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
if ( s.states[ state ].interrupt == "queue" )
|
||||||
|
{
|
||||||
|
level thread sndqueuestinger( state, player );
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
playstinger( state, player, ignore )
|
||||||
|
{
|
||||||
|
s = level.sndstinger;
|
||||||
|
if ( !isDefined( s.states[ state ] ) )
|
||||||
|
{
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
if ( is_true( level.music_override ) )
|
||||||
|
{
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
if ( is_true( ignore ) )
|
||||||
|
{
|
||||||
|
if ( isDefined( player ) )
|
||||||
|
{
|
||||||
|
player playsoundtoplayer( s.states[ state ].alias, player );
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
s.ent playsound( s.states[ state ].alias );
|
||||||
|
s.ent thread playstingerstop();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else if ( isDefined( player ) )
|
||||||
|
{
|
||||||
|
player playsoundtoplayer( s.states[ state ].alias, player );
|
||||||
|
wait 8;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
s.ent playsoundwithnotify( s.states[ state ].alias, "sndStingerDone" );
|
||||||
|
s.ent thread playstingerstop();
|
||||||
|
s.ent waittill( "sndStingerDone" );
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
sndqueuestinger( state, player )
|
||||||
|
{
|
||||||
|
s = level.sndstinger;
|
||||||
|
if ( is_true( s.queue ) )
|
||||||
|
{
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
s.queue = 1;
|
||||||
|
while ( 1 )
|
||||||
|
{
|
||||||
|
if ( is_true( level.sndroundwait ) || is_true( s.isplaying ) )
|
||||||
|
{
|
||||||
|
wait 0,5;
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
}
|
||||||
|
}
|
||||||
|
level thread sndplaystinger( state, player );
|
||||||
|
s.queue = 0;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
sndstingerroundwait()
|
||||||
|
{
|
||||||
|
wait 25;
|
||||||
|
level.sndroundwait = 0;
|
||||||
|
while ( 1 )
|
||||||
|
{
|
||||||
|
level waittill( "end_of_round" );
|
||||||
|
level thread sndstingerroundwait_start();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
sndstingerroundwait_start()
|
||||||
|
{
|
||||||
|
level.sndroundwait = 1;
|
||||||
|
wait 0,05;
|
||||||
|
level thread sndstingerroundwait_end();
|
||||||
|
}
|
||||||
|
|
||||||
|
sndstingerroundwait_end()
|
||||||
|
{
|
||||||
|
level endon( "end_of_round" );
|
||||||
|
level waittill( "between_round_over" );
|
||||||
|
wait 28;
|
||||||
|
level.sndroundwait = 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
playstingerstop()
|
||||||
|
{
|
||||||
|
self endon( "sndStingerDone" );
|
||||||
|
level endon( "sndStingerDone" );
|
||||||
|
level waittill( "end_of_round" );
|
||||||
|
wait 2;
|
||||||
|
self stopsounds();
|
||||||
|
}
|
||||||
|
|
||||||
|
sndbackgroundmustracker()
|
||||||
|
{
|
||||||
|
self endon( "disconnect" );
|
||||||
|
self.prevzone = "null";
|
||||||
|
self.prevcase = 99;
|
||||||
|
while ( 1 )
|
||||||
|
{
|
||||||
|
level waittill( "newzoneActive", activezone );
|
||||||
|
if ( self.prevzone != activezone )
|
||||||
|
{
|
||||||
|
if ( self maps/mp/zombies/_zm_zonemgr::is_player_in_zone( activezone ) )
|
||||||
|
{
|
||||||
|
self.prevzone = activezone;
|
||||||
|
switch( activezone )
|
||||||
|
{
|
||||||
|
case "zone_start":
|
||||||
|
case "zone_start_lower":
|
||||||
|
if ( self.prevcase != 0 )
|
||||||
|
{
|
||||||
|
self setclientfieldtoplayer( "sndBackgroundMus", 0 );
|
||||||
|
self.prevcase = 0;
|
||||||
|
}
|
||||||
|
break;
|
||||||
|
break;
|
||||||
|
case "zone_mansion":
|
||||||
|
case "zone_mansion_backyard":
|
||||||
|
case "zone_mansion_lawn":
|
||||||
|
case "zone_maze":
|
||||||
|
case "zone_maze_staircase":
|
||||||
|
if ( self.prevcase != 2 )
|
||||||
|
{
|
||||||
|
self setclientfieldtoplayer( "sndBackgroundMus", 2 );
|
||||||
|
self.prevcase = 2;
|
||||||
|
}
|
||||||
|
break;
|
||||||
|
break;
|
||||||
|
default:
|
||||||
|
if ( self.prevcase != 1 )
|
||||||
|
{
|
||||||
|
self setclientfieldtoplayer( "sndBackgroundMus", 1 );
|
||||||
|
self.prevcase = 1;
|
||||||
|
}
|
||||||
|
break;
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
sndshoulditplay( activezone )
|
||||||
|
{
|
||||||
|
if ( self.prevzone == activezone )
|
||||||
|
{
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
if ( !self maps/mp/zombies/_zm_zonemgr::is_player_in_zone( activezone ) )
|
||||||
|
{
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
return 1;
|
||||||
|
}
|
||||||
|
|
||||||
|
sndlastlifesetup()
|
||||||
|
{
|
||||||
|
flag_wait( "start_zombie_round_logic" );
|
||||||
|
level thread sndlastlife_multi();
|
||||||
|
}
|
||||||
|
|
||||||
|
sndlastlife_multi()
|
||||||
|
{
|
||||||
|
level endon( "end_of_round" );
|
||||||
|
level thread sndlastlife_multi_reset();
|
||||||
|
sndplayersdead = 0;
|
||||||
|
while ( 1 )
|
||||||
|
{
|
||||||
|
level waittill( "bleed_out" );
|
||||||
|
sndplayersdead++;
|
||||||
|
players = getplayers();
|
||||||
|
if ( ( players.size - sndplayersdead ) <= 1 )
|
||||||
|
{
|
||||||
|
last_alive = sndlastlife_multi_getlastplayer();
|
||||||
|
level thread maps/mp/zombies/_zm_audio::change_zombie_music( "last_life" );
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
sndlastlife_multi_getlastplayer()
|
||||||
|
{
|
||||||
|
level endon( "end_of_round" );
|
||||||
|
wait 0,5;
|
||||||
|
players = getplayers();
|
||||||
|
_a572 = players;
|
||||||
|
_k572 = getFirstArrayKey( _a572 );
|
||||||
|
while ( isDefined( _k572 ) )
|
||||||
|
{
|
||||||
|
dude = _a572[ _k572 ];
|
||||||
|
if ( dude.sessionstate == "spectator" )
|
||||||
|
{
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
return dude;
|
||||||
|
}
|
||||||
|
_k572 = getNextArrayKey( _a572, _k572 );
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
sndlastlife_multi_reset()
|
||||||
|
{
|
||||||
|
level waittill( "end_of_round" );
|
||||||
|
level thread sndlastlife_multi();
|
||||||
|
}
|
||||||
|
|
||||||
|
sndmusicegg()
|
||||||
|
{
|
||||||
|
origins = [];
|
||||||
|
origins[ 0 ] = ( -1215,63, -499,975, 291,89 );
|
||||||
|
origins[ 1 ] = ( 552,009, -342,824, 27,3921 );
|
||||||
|
origins[ 2 ] = ( 2827,28, 306,468, 92,783 );
|
||||||
|
level.meteor_counter = 0;
|
||||||
|
level.music_override = 0;
|
||||||
|
i = 0;
|
||||||
|
while ( i < origins.size )
|
||||||
|
{
|
||||||
|
level thread sndmusicegg_wait( origins[ i ] );
|
||||||
|
i++;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
sndmusicegg_wait( bottle_origin )
|
||||||
|
{
|
||||||
|
temp_ent = spawn( "script_origin", bottle_origin );
|
||||||
|
temp_ent playloopsound( "zmb_meteor_loop" );
|
||||||
|
temp_ent thread maps/mp/zombies/_zm_sidequests::fake_use( "main_music_egg_hit", ::sndmusicegg_override );
|
||||||
|
temp_ent waittill( "main_music_egg_hit", player );
|
||||||
|
temp_ent stoploopsound( 1 );
|
||||||
|
player playsound( "zmb_meteor_activate" );
|
||||||
|
level.meteor_counter += 1;
|
||||||
|
if ( level.meteor_counter == 3 )
|
||||||
|
{
|
||||||
|
level thread sndmuseggplay( temp_ent, "mus_zmb_secret_song", 363 );
|
||||||
|
level thread easter_egg_song_vo( player );
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
wait 1,5;
|
||||||
|
temp_ent delete();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
sndmusicegg_override()
|
||||||
|
{
|
||||||
|
if ( is_true( level.music_override ) )
|
||||||
|
{
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
return 1;
|
||||||
|
}
|
||||||
|
|
||||||
|
sndmuseggplay( ent, alias, time )
|
||||||
|
{
|
||||||
|
level.music_override = 1;
|
||||||
|
wait 1;
|
||||||
|
ent playsound( alias );
|
||||||
|
level setclientfield( "mus_zmb_egg_snapshot_loop", 1 );
|
||||||
|
level thread sndeggmusicwait( time );
|
||||||
|
level waittill_either( "end_game", "sndSongDone" );
|
||||||
|
ent stopsounds();
|
||||||
|
level setclientfield( "mus_zmb_egg_snapshot_loop", 0 );
|
||||||
|
wait 0,05;
|
||||||
|
ent delete();
|
||||||
|
level.music_override = 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
sndeggmusicwait( time )
|
||||||
|
{
|
||||||
|
level endon( "end_game" );
|
||||||
|
wait time;
|
||||||
|
level notify( "sndSongDone" );
|
||||||
|
}
|
||||||
|
|
||||||
|
sndmusicquestendgame( alias, length )
|
||||||
|
{
|
||||||
|
while ( is_true( level.music_override ) )
|
||||||
|
{
|
||||||
|
wait 1;
|
||||||
|
}
|
||||||
|
level.music_override = 1;
|
||||||
|
level setclientfield( "mus_zmb_egg_snapshot_loop", 1 );
|
||||||
|
ent = spawn( "script_origin", ( 0, 0, 0 ) );
|
||||||
|
ent playsound( alias );
|
||||||
|
wait length;
|
||||||
|
level setclientfield( "mus_zmb_egg_snapshot_loop", 0 );
|
||||||
|
level.music_override = 0;
|
||||||
|
wait 0,05;
|
||||||
|
ent delete();
|
||||||
|
wait 1;
|
||||||
|
level thread sndendgamemusicredux( alias, length );
|
||||||
|
}
|
||||||
|
|
||||||
|
easter_egg_song_vo( player )
|
||||||
|
{
|
||||||
|
if ( isalive( player ) )
|
||||||
|
{
|
||||||
|
player thread maps/mp/zombies/_zm_audio::create_and_play_dialog( "quest", "find_secret" );
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
sndendgamemusicredux( alias, length )
|
||||||
|
{
|
||||||
|
m_endgame_machine = getstruct( "sq_endgame_machine", "targetname" );
|
||||||
|
temp_ent = spawn( "script_origin", m_endgame_machine.origin );
|
||||||
|
temp_ent thread maps/mp/zombies/_zm_sidequests::fake_use( "main_music_egg_hit", ::sndmusicegg_override );
|
||||||
|
temp_ent playloopsound( "zmb_meteor_loop" );
|
||||||
|
temp_ent waittill( "main_music_egg_hit", player );
|
||||||
|
temp_ent stoploopsound( 1 );
|
||||||
|
level.music_override = 1;
|
||||||
|
temp_ent playsound( "zmb_endgame_mach_button" );
|
||||||
|
level setclientfield( "mus_zmb_egg_snapshot_loop", 1 );
|
||||||
|
temp_ent playsound( alias );
|
||||||
|
wait length;
|
||||||
|
level setclientfield( "mus_zmb_egg_snapshot_loop", 0 );
|
||||||
|
level.music_override = 0;
|
||||||
|
wait 0,05;
|
||||||
|
temp_ent delete();
|
||||||
|
}
|
1487
zm_buried_patch/maps/mp/zm_buried_buildables.gsc
Normal file
1487
zm_buried_patch/maps/mp/zm_buried_buildables.gsc
Normal file
File diff suppressed because it is too large
Load Diff
1861
zm_buried_patch/maps/mp/zm_buried_classic.gsc
Normal file
1861
zm_buried_patch/maps/mp/zm_buried_classic.gsc
Normal file
File diff suppressed because it is too large
Load Diff
428
zm_buried_patch/maps/mp/zm_buried_distance_tracking.gsc
Normal file
428
zm_buried_patch/maps/mp/zm_buried_distance_tracking.gsc
Normal file
@ -0,0 +1,428 @@
|
|||||||
|
#include maps/mp/zombies/_zm_ai_basic;
|
||||||
|
#include maps/mp/zombies/_zm_zonemgr;
|
||||||
|
#include maps/mp/zombies/_zm_spawner;
|
||||||
|
#include maps/mp/zombies/_zm_utility;
|
||||||
|
#include maps/mp/_utility;
|
||||||
|
#include common_scripts/utility;
|
||||||
|
|
||||||
|
zombie_tracking_init()
|
||||||
|
{
|
||||||
|
level.zombie_respawned_health = [];
|
||||||
|
if ( !isDefined( level.zombie_tracking_dist ) )
|
||||||
|
{
|
||||||
|
level.zombie_tracking_dist = 1600;
|
||||||
|
}
|
||||||
|
if ( !isDefined( level.zombie_tracking_high ) )
|
||||||
|
{
|
||||||
|
level.zombie_tracking_high = 600;
|
||||||
|
}
|
||||||
|
if ( !isDefined( level.zombie_tracking_wait ) )
|
||||||
|
{
|
||||||
|
level.zombie_tracking_wait = 0,4;
|
||||||
|
}
|
||||||
|
for ( ;; )
|
||||||
|
{
|
||||||
|
while ( 1 )
|
||||||
|
{
|
||||||
|
zombies = get_round_enemy_array();
|
||||||
|
if ( !isDefined( zombies ) || isDefined( level.ignore_distance_tracking ) && level.ignore_distance_tracking )
|
||||||
|
{
|
||||||
|
wait level.zombie_tracking_wait;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else i = 0;
|
||||||
|
while ( i < zombies.size )
|
||||||
|
{
|
||||||
|
if ( isDefined( zombies[ i ] ) && isDefined( zombies[ i ].ignore_distance_tracking ) && !zombies[ i ].ignore_distance_tracking && isDefined( zombies[ i ].ignoreall ) && !zombies[ i ].ignoreall )
|
||||||
|
{
|
||||||
|
zombies[ i ] thread delete_zombie_noone_looking( level.zombie_tracking_dist, level.zombie_tracking_high );
|
||||||
|
}
|
||||||
|
i++;
|
||||||
|
}
|
||||||
|
wait level.zombie_tracking_wait;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
delete_zombie_noone_looking( how_close, how_high )
|
||||||
|
{
|
||||||
|
self endon( "death" );
|
||||||
|
if ( self can_be_deleted_from_buried_special_zones() )
|
||||||
|
{
|
||||||
|
self.inview = 0;
|
||||||
|
self.player_close = 0;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
if ( !isDefined( how_close ) )
|
||||||
|
{
|
||||||
|
how_close = 1000;
|
||||||
|
}
|
||||||
|
if ( !isDefined( how_high ) )
|
||||||
|
{
|
||||||
|
how_high = 500;
|
||||||
|
}
|
||||||
|
if ( isDefined( self.has_legs ) && !self.has_legs )
|
||||||
|
{
|
||||||
|
how_close *= 1,5;
|
||||||
|
}
|
||||||
|
distance_squared_check = how_close * how_close;
|
||||||
|
height_squared_check = how_high * how_high;
|
||||||
|
too_far_dist = distance_squared_check * 3;
|
||||||
|
if ( isDefined( level.zombie_tracking_too_far_dist ) )
|
||||||
|
{
|
||||||
|
too_far_dist = level.zombie_tracking_too_far_dist * level.zombie_tracking_too_far_dist;
|
||||||
|
}
|
||||||
|
self.inview = 0;
|
||||||
|
self.player_close = 0;
|
||||||
|
players = get_players();
|
||||||
|
_a98 = players;
|
||||||
|
_k98 = getFirstArrayKey( _a98 );
|
||||||
|
while ( isDefined( _k98 ) )
|
||||||
|
{
|
||||||
|
player = _a98[ _k98 ];
|
||||||
|
if ( player.sessionstate == "spectator" )
|
||||||
|
{
|
||||||
|
}
|
||||||
|
else if ( isDefined( player.laststand ) && player.laststand && isDefined( self.favoriteenemy ) && self.favoriteenemy == player )
|
||||||
|
{
|
||||||
|
if ( !self can_zombie_see_any_player() )
|
||||||
|
{
|
||||||
|
self.favoriteenemy = undefined;
|
||||||
|
self.zombie_path_bad = 1;
|
||||||
|
self thread escaped_zombies_cleanup();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if ( isDefined( level.only_track_targeted_players ) )
|
||||||
|
{
|
||||||
|
if ( !isDefined( self.favoriteenemy ) || self.favoriteenemy != player )
|
||||||
|
{
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
can_be_seen = self player_can_see_me( player );
|
||||||
|
distance_squared = distancesquared( self.origin, player.origin );
|
||||||
|
if ( can_be_seen && distance_squared < too_far_dist )
|
||||||
|
{
|
||||||
|
self.inview++;
|
||||||
|
}
|
||||||
|
if ( distance_squared < distance_squared_check && abs( self.origin[ 2 ] - player.origin[ 2 ] ) < how_high )
|
||||||
|
{
|
||||||
|
self.player_close++;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
_k98 = getNextArrayKey( _a98, _k98 );
|
||||||
|
}
|
||||||
|
}
|
||||||
|
wait 0,1;
|
||||||
|
if ( self.inview == 0 && self.player_close == 0 )
|
||||||
|
{
|
||||||
|
if ( !isDefined( self.animname ) || isDefined( self.animname ) && self.animname != "zombie" )
|
||||||
|
{
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
if ( isDefined( self.electrified ) && self.electrified == 1 )
|
||||||
|
{
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
zombies = getaiarray( "axis" );
|
||||||
|
if ( ( zombies.size + level.zombie_total ) > 24 || ( zombies.size + level.zombie_total ) <= 24 && self.health >= self.maxhealth )
|
||||||
|
{
|
||||||
|
if ( isDefined( self.exclude_distance_cleanup_adding_to_total ) && !self.exclude_distance_cleanup_adding_to_total && isDefined( self.isscreecher ) && !self.isscreecher )
|
||||||
|
{
|
||||||
|
level.zombie_total++;
|
||||||
|
if ( self.health < level.zombie_health )
|
||||||
|
{
|
||||||
|
level.zombie_respawned_health[ level.zombie_respawned_health.size ] = self.health;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
self maps/mp/zombies/_zm_spawner::reset_attack_spot();
|
||||||
|
self notify( "zombie_delete" );
|
||||||
|
if ( isDefined( self.anchor ) )
|
||||||
|
{
|
||||||
|
self.anchor delete();
|
||||||
|
}
|
||||||
|
self delete();
|
||||||
|
recalc_zombie_array();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
player_can_see_me( player )
|
||||||
|
{
|
||||||
|
playerangles = player getplayerangles();
|
||||||
|
playerforwardvec = anglesToForward( playerangles );
|
||||||
|
playerunitforwardvec = vectornormalize( playerforwardvec );
|
||||||
|
banzaipos = self.origin;
|
||||||
|
playerpos = player getorigin();
|
||||||
|
playertobanzaivec = banzaipos - playerpos;
|
||||||
|
playertobanzaiunitvec = vectornormalize( playertobanzaivec );
|
||||||
|
forwarddotbanzai = vectordot( playerunitforwardvec, playertobanzaiunitvec );
|
||||||
|
if ( forwarddotbanzai >= 1 )
|
||||||
|
{
|
||||||
|
anglefromcenter = 0;
|
||||||
|
}
|
||||||
|
else if ( forwarddotbanzai <= -1 )
|
||||||
|
{
|
||||||
|
anglefromcenter = 180;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
anglefromcenter = acos( forwarddotbanzai );
|
||||||
|
}
|
||||||
|
playerfov = getDvarFloat( "cg_fov" );
|
||||||
|
banzaivsplayerfovbuffer = getDvarFloat( "g_banzai_player_fov_buffer" );
|
||||||
|
if ( banzaivsplayerfovbuffer <= 0 )
|
||||||
|
{
|
||||||
|
banzaivsplayerfovbuffer = 0,2;
|
||||||
|
}
|
||||||
|
playercanseeme = anglefromcenter <= ( ( playerfov * 0,5 ) * ( 1 - banzaivsplayerfovbuffer ) );
|
||||||
|
return playercanseeme;
|
||||||
|
}
|
||||||
|
|
||||||
|
can_be_deleted_from_buried_special_zones()
|
||||||
|
{
|
||||||
|
if ( self can_be_deleted_from_start_area() )
|
||||||
|
{
|
||||||
|
return 1;
|
||||||
|
}
|
||||||
|
if ( self can_be_deleted_from_maze_area() )
|
||||||
|
{
|
||||||
|
return 1;
|
||||||
|
}
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
can_be_deleted_from_start_area()
|
||||||
|
{
|
||||||
|
start_zones = [];
|
||||||
|
start_zones[ start_zones.size ] = "zone_start";
|
||||||
|
start_zones[ start_zones.size ] = "zone_start_lower";
|
||||||
|
return self can_be_deleted_from_area( start_zones );
|
||||||
|
}
|
||||||
|
|
||||||
|
can_be_deleted_from_maze_area()
|
||||||
|
{
|
||||||
|
maze_zones = [];
|
||||||
|
maze_zones[ maze_zones.size ] = "zone_mansion_backyard";
|
||||||
|
maze_zones[ maze_zones.size ] = "zone_maze";
|
||||||
|
maze_zones[ maze_zones.size ] = "zone_maze_staircase";
|
||||||
|
return self can_be_deleted_from_area( maze_zones );
|
||||||
|
}
|
||||||
|
|
||||||
|
can_be_deleted_from_area( zone_names )
|
||||||
|
{
|
||||||
|
self_in_zone = 0;
|
||||||
|
_a265 = zone_names;
|
||||||
|
_k265 = getFirstArrayKey( _a265 );
|
||||||
|
while ( isDefined( _k265 ) )
|
||||||
|
{
|
||||||
|
zone_name = _a265[ _k265 ];
|
||||||
|
if ( isDefined( level.zones[ zone_name ] ) && isDefined( level.zones[ zone_name ].is_occupied ) && level.zones[ zone_name ].is_occupied )
|
||||||
|
{
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
if ( !self_in_zone && self maps/mp/zombies/_zm_zonemgr::entity_in_zone( zone_name ) )
|
||||||
|
{
|
||||||
|
self_in_zone = 1;
|
||||||
|
}
|
||||||
|
_k265 = getNextArrayKey( _a265, _k265 );
|
||||||
|
}
|
||||||
|
if ( self_in_zone )
|
||||||
|
{
|
||||||
|
return 1;
|
||||||
|
}
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
escaped_zombies_cleanup_init()
|
||||||
|
{
|
||||||
|
self endon( "death" );
|
||||||
|
self.zombie_path_bad = 0;
|
||||||
|
while ( 1 )
|
||||||
|
{
|
||||||
|
if ( !self.zombie_path_bad )
|
||||||
|
{
|
||||||
|
self waittill( "bad_path" );
|
||||||
|
}
|
||||||
|
found_player = undefined;
|
||||||
|
players = get_players();
|
||||||
|
i = 0;
|
||||||
|
while ( i < players.size )
|
||||||
|
{
|
||||||
|
if ( is_player_valid( players[ i ] ) && !is_true( players[ i ].is_in_ghost_zone ) && self maymovetopoint( players[ i ].origin, 1 ) )
|
||||||
|
{
|
||||||
|
self.favoriteenemy = players[ i ];
|
||||||
|
found_player = 1;
|
||||||
|
i++;
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
i++;
|
||||||
|
}
|
||||||
|
n_delete_distance = 800;
|
||||||
|
n_delete_height = 300;
|
||||||
|
if ( !isDefined( found_player ) && isDefined( self.completed_emerging_into_playable_area ) && self.completed_emerging_into_playable_area )
|
||||||
|
{
|
||||||
|
self thread delete_zombie_noone_looking( n_delete_distance, n_delete_height );
|
||||||
|
self.zombie_path_bad = 1;
|
||||||
|
self escaped_zombies_cleanup();
|
||||||
|
}
|
||||||
|
wait 0,1;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
escaped_zombies_cleanup()
|
||||||
|
{
|
||||||
|
self endon( "death" );
|
||||||
|
s_escape = self get_escape_position();
|
||||||
|
self notify( "stop_find_flesh" );
|
||||||
|
self notify( "zombie_acquire_enemy" );
|
||||||
|
if ( isDefined( s_escape ) )
|
||||||
|
{
|
||||||
|
self setgoalpos( s_escape.origin );
|
||||||
|
self thread check_player_available();
|
||||||
|
self waittill_any( "goal", "reaquire_player" );
|
||||||
|
}
|
||||||
|
self.zombie_path_bad = !can_zombie_path_to_any_player();
|
||||||
|
wait 0,1;
|
||||||
|
if ( !self.zombie_path_bad )
|
||||||
|
{
|
||||||
|
self thread maps/mp/zombies/_zm_ai_basic::find_flesh();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
get_escape_position()
|
||||||
|
{
|
||||||
|
self endon( "death" );
|
||||||
|
str_zone = get_current_zone();
|
||||||
|
if ( isDefined( str_zone ) )
|
||||||
|
{
|
||||||
|
a_zones = get_adjacencies_to_zone( str_zone );
|
||||||
|
a_dog_locations = get_dog_locations_in_zones( a_zones );
|
||||||
|
s_farthest = self get_farthest_dog_location( a_dog_locations );
|
||||||
|
}
|
||||||
|
return s_farthest;
|
||||||
|
}
|
||||||
|
|
||||||
|
check_player_available()
|
||||||
|
{
|
||||||
|
self notify( "_check_player_available" );
|
||||||
|
self endon( "_check_player_available" );
|
||||||
|
self endon( "death" );
|
||||||
|
self endon( "goal" );
|
||||||
|
while ( self.zombie_path_bad )
|
||||||
|
{
|
||||||
|
if ( self can_zombie_see_any_player() )
|
||||||
|
{
|
||||||
|
self notify( "reaquire_player" );
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
wait randomfloatrange( 0,2, 0,5 );
|
||||||
|
}
|
||||||
|
self notify( "reaquire_player" );
|
||||||
|
}
|
||||||
|
|
||||||
|
can_zombie_path_to_any_player()
|
||||||
|
{
|
||||||
|
a_players = get_players();
|
||||||
|
i = 0;
|
||||||
|
while ( i < a_players.size )
|
||||||
|
{
|
||||||
|
if ( !is_player_valid( a_players[ i ] ) )
|
||||||
|
{
|
||||||
|
i++;
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
else if ( is_true( a_players[ i ].is_in_ghost_zone ) )
|
||||||
|
{
|
||||||
|
i++;
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
if ( findpath( self.origin, a_players[ i ].origin ) )
|
||||||
|
{
|
||||||
|
return 1;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
i++;
|
||||||
|
}
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
can_zombie_see_any_player()
|
||||||
|
{
|
||||||
|
a_players = get_players();
|
||||||
|
i = 0;
|
||||||
|
while ( i < a_players.size )
|
||||||
|
{
|
||||||
|
if ( !is_player_valid( a_players[ i ] ) )
|
||||||
|
{
|
||||||
|
i++;
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
path_length = 0;
|
||||||
|
if ( !is_true( a_players[ i ].is_in_ghost_zone ) )
|
||||||
|
{
|
||||||
|
path_length = self calcpathlength( a_players[ i ].origin );
|
||||||
|
}
|
||||||
|
if ( self maymovetopoint( a_players[ i ].origin, 1 ) || path_length != 0 )
|
||||||
|
{
|
||||||
|
return 1;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
i++;
|
||||||
|
}
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
get_adjacencies_to_zone( str_zone )
|
||||||
|
{
|
||||||
|
a_adjacencies = [];
|
||||||
|
a_adjacencies[ 0 ] = str_zone;
|
||||||
|
a_adjacent_zones = getarraykeys( level.zones[ str_zone ].adjacent_zones );
|
||||||
|
i = 0;
|
||||||
|
while ( i < a_adjacent_zones.size )
|
||||||
|
{
|
||||||
|
if ( level.zones[ str_zone ].adjacent_zones[ a_adjacent_zones[ i ] ].is_connected )
|
||||||
|
{
|
||||||
|
a_adjacencies[ a_adjacencies.size ] = a_adjacent_zones[ i ];
|
||||||
|
}
|
||||||
|
i++;
|
||||||
|
}
|
||||||
|
return a_adjacencies;
|
||||||
|
}
|
||||||
|
|
||||||
|
get_dog_locations_in_zones( a_zones )
|
||||||
|
{
|
||||||
|
a_dog_locations = [];
|
||||||
|
_a479 = a_zones;
|
||||||
|
_k479 = getFirstArrayKey( _a479 );
|
||||||
|
while ( isDefined( _k479 ) )
|
||||||
|
{
|
||||||
|
zone = _a479[ _k479 ];
|
||||||
|
a_dog_locations = arraycombine( a_dog_locations, level.zones[ zone ].dog_locations, 0, 0 );
|
||||||
|
_k479 = getNextArrayKey( _a479, _k479 );
|
||||||
|
}
|
||||||
|
return a_dog_locations;
|
||||||
|
}
|
||||||
|
|
||||||
|
get_farthest_dog_location( a_dog_locations )
|
||||||
|
{
|
||||||
|
n_farthest_index = 0;
|
||||||
|
n_distance_farthest = 0;
|
||||||
|
i = 0;
|
||||||
|
while ( i < a_dog_locations.size )
|
||||||
|
{
|
||||||
|
n_distance_sq = distancesquared( self.origin, a_dog_locations[ i ].origin );
|
||||||
|
if ( n_distance_sq > n_distance_farthest )
|
||||||
|
{
|
||||||
|
n_distance_farthest = n_distance_sq;
|
||||||
|
n_farthest_index = i;
|
||||||
|
}
|
||||||
|
i++;
|
||||||
|
}
|
||||||
|
return a_dog_locations[ n_farthest_index ];
|
||||||
|
}
|
222
zm_buried_patch/maps/mp/zm_buried_ee.gsc
Normal file
222
zm_buried_patch/maps/mp/zm_buried_ee.gsc
Normal file
@ -0,0 +1,222 @@
|
|||||||
|
#include maps/mp/zombies/_zm_powerups;
|
||||||
|
#include maps/mp/zombies/_zm_perks;
|
||||||
|
#include maps/mp/zombies/_zm_score;
|
||||||
|
#include maps/mp/zombies/_zm_utility;
|
||||||
|
#include maps/mp/_utility;
|
||||||
|
#include common_scripts/utility;
|
||||||
|
|
||||||
|
#using_animtree( "zm_buried_ghost" );
|
||||||
|
#using_animtree( "fxanim_props_dlc3" );
|
||||||
|
|
||||||
|
init_ghost_piano()
|
||||||
|
{
|
||||||
|
t_bullseye = getent( "bullseye", "script_noteworthy" );
|
||||||
|
t_chalk_line = getent( "ee_bar_chalk_line_trigger", "targetname" );
|
||||||
|
if ( !isDefined( t_bullseye ) || !isDefined( t_chalk_line ) )
|
||||||
|
{
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
t_bullseye thread wait_for_valid_damage();
|
||||||
|
t_chalk_line thread set_flags_while_players_stand_in_trigger();
|
||||||
|
level thread mansion_ghost_plays_piano();
|
||||||
|
level thread reward_think();
|
||||||
|
/#
|
||||||
|
level thread devgui_support_ee();
|
||||||
|
#/
|
||||||
|
flag_init( "player_piano_song_active" );
|
||||||
|
}
|
||||||
|
|
||||||
|
init_ee_ghost_piano_flags()
|
||||||
|
{
|
||||||
|
self ent_flag_init( "ee_standing_behind_chalk_line" );
|
||||||
|
}
|
||||||
|
|
||||||
|
wait_for_valid_damage()
|
||||||
|
{
|
||||||
|
self setcandamage( 1 );
|
||||||
|
while ( 1 )
|
||||||
|
{
|
||||||
|
self waittill( "damage" );
|
||||||
|
if ( is_ballistic_knife_variant( str_weapon_name ) )
|
||||||
|
{
|
||||||
|
if ( isDefined( e_inflictor ) && e_inflictor ent_flag_exist( "ee_standing_behind_chalk_line" ) && e_inflictor ent_flag( "ee_standing_behind_chalk_line" ) && !flag( "player_piano_song_active" ) )
|
||||||
|
{
|
||||||
|
level notify( "player_can_interact_with_ghost_piano_player" );
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
is_ballistic_knife_variant( str_weapon )
|
||||||
|
{
|
||||||
|
return issubstr( str_weapon, "knife_ballistic_" );
|
||||||
|
}
|
||||||
|
|
||||||
|
set_flags_while_players_stand_in_trigger()
|
||||||
|
{
|
||||||
|
while ( 1 )
|
||||||
|
{
|
||||||
|
self waittill( "trigger", player );
|
||||||
|
if ( !player ent_flag_exist( "ee_standing_behind_chalk_line" ) )
|
||||||
|
{
|
||||||
|
player ent_flag_init( "ee_standing_behind_chalk_line" );
|
||||||
|
}
|
||||||
|
if ( !player ent_flag( "ee_standing_behind_chalk_line" ) )
|
||||||
|
{
|
||||||
|
player thread clear_flag_when_player_leaves_trigger( self );
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
clear_flag_when_player_leaves_trigger( trigger )
|
||||||
|
{
|
||||||
|
self endon( "death_or_disconnect" );
|
||||||
|
self ent_flag_set( "ee_standing_behind_chalk_line" );
|
||||||
|
while ( self istouching( trigger ) )
|
||||||
|
{
|
||||||
|
wait 0,25;
|
||||||
|
}
|
||||||
|
self ent_flag_clear( "ee_standing_behind_chalk_line" );
|
||||||
|
}
|
||||||
|
|
||||||
|
player_piano_starts()
|
||||||
|
{
|
||||||
|
/#
|
||||||
|
iprintln( "player piano tune song start" );
|
||||||
|
#/
|
||||||
|
flag_set( "player_piano_song_active" );
|
||||||
|
level notify( "piano_play" );
|
||||||
|
level setclientfield( "mansion_piano_play", 1 );
|
||||||
|
level setclientfield( "saloon_piano_play", 1 );
|
||||||
|
wait getanimlength( %fxanim_gp_piano_old_anim );
|
||||||
|
/#
|
||||||
|
iprintln( "player piano song done" );
|
||||||
|
#/
|
||||||
|
level setclientfield( "mansion_piano_play", 0 );
|
||||||
|
level setclientfield( "saloon_piano_play", 0 );
|
||||||
|
flag_clear( "player_piano_song_active" );
|
||||||
|
}
|
||||||
|
|
||||||
|
mansion_ghost_plays_piano()
|
||||||
|
{
|
||||||
|
while ( 1 )
|
||||||
|
{
|
||||||
|
flag_wait( "player_piano_song_active" );
|
||||||
|
e_ghost = spawn_and_animate_ghost_pianist();
|
||||||
|
flag_waitopen( "player_piano_song_active" );
|
||||||
|
e_ghost thread delete_ghost_pianist();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
spawn_and_animate_ghost_pianist()
|
||||||
|
{
|
||||||
|
s_anim = getstruct( "ee_mansion_piano_anim_struct", "targetname" );
|
||||||
|
e_temp = spawn( "script_model", s_anim.origin );
|
||||||
|
e_temp.angles = s_anim.angles;
|
||||||
|
e_temp setclientfield( "ghost_fx", 3 );
|
||||||
|
e_temp setmodel( "c_zom_zombie_buried_ghost_woman_fb" );
|
||||||
|
e_temp useanimtree( -1 );
|
||||||
|
e_temp setanim( %ai_zombie_ghost_playing_piano );
|
||||||
|
e_temp setclientfield( "sndGhostAudio", 1 );
|
||||||
|
/#
|
||||||
|
iprintln( "ghost piano player spawned" );
|
||||||
|
#/
|
||||||
|
return e_temp;
|
||||||
|
}
|
||||||
|
|
||||||
|
reward_think()
|
||||||
|
{
|
||||||
|
t_use = getent( "ee_ghost_piano_mansion_use_trigger", "targetname" );
|
||||||
|
t_use sethintstring( &"ZM_BURIED_HINT_GHOST_PIANO", 10 );
|
||||||
|
t_use setinvisibletoall();
|
||||||
|
while ( 1 )
|
||||||
|
{
|
||||||
|
level waittill( "player_can_interact_with_ghost_piano_player", player );
|
||||||
|
level thread player_piano_starts();
|
||||||
|
if ( !player has_player_received_reward() )
|
||||||
|
{
|
||||||
|
t_use setvisibletoplayer( player );
|
||||||
|
t_use thread player_can_use_ghost_piano_trigger( player );
|
||||||
|
}
|
||||||
|
flag_waitopen( "player_piano_song_active" );
|
||||||
|
t_use setinvisibletoall();
|
||||||
|
level notify( "ghost_piano_reward_unavailable" );
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
player_can_use_ghost_piano_trigger( player )
|
||||||
|
{
|
||||||
|
player endon( "death_or_disconnect" );
|
||||||
|
level endon( "ghost_piano_reward_unavailable" );
|
||||||
|
self waittill( "trigger", user );
|
||||||
|
if ( user != player && player.score < 10 && !player has_player_received_reward() )
|
||||||
|
{
|
||||||
|
self give_reward( player );
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
give_reward( player )
|
||||||
|
{
|
||||||
|
player maps/mp/zombies/_zm_score::minus_to_player_score( 10 );
|
||||||
|
player.got_easter_egg_reward = 1;
|
||||||
|
self setinvisibletoplayer( player );
|
||||||
|
player notify( "player_received_ghost_round_free_perk" );
|
||||||
|
free_perk = player maps/mp/zombies/_zm_perks::give_random_perk();
|
||||||
|
if ( is_true( level.disable_free_perks_before_power ) )
|
||||||
|
{
|
||||||
|
player thread maps/mp/zombies/_zm_powerups::disable_perk_before_power( free_perk );
|
||||||
|
}
|
||||||
|
/#
|
||||||
|
iprintln( "player got reward!!" );
|
||||||
|
#/
|
||||||
|
}
|
||||||
|
|
||||||
|
has_player_received_reward()
|
||||||
|
{
|
||||||
|
return is_true( self.got_easter_egg_reward );
|
||||||
|
}
|
||||||
|
|
||||||
|
delete_ghost_pianist()
|
||||||
|
{
|
||||||
|
self setclientfield( "ghost_fx", 5 );
|
||||||
|
self playsound( "zmb_ai_ghost_death" );
|
||||||
|
wait_network_frame();
|
||||||
|
self delete();
|
||||||
|
/#
|
||||||
|
iprintln( "ghost piano player deleted" );
|
||||||
|
#/
|
||||||
|
}
|
||||||
|
|
||||||
|
devgui_support_ee()
|
||||||
|
{
|
||||||
|
while ( 1 )
|
||||||
|
{
|
||||||
|
str_notify = level waittill_any_return( "ghost_piano_warp_to_mansion_piano", "ghost_piano_warp_to_bar" );
|
||||||
|
if ( str_notify == "ghost_piano_warp_to_mansion_piano" )
|
||||||
|
{
|
||||||
|
get_players()[ 0 ] warp_to_struct( "ee_warp_mansion_piano", "targetname" );
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
if ( str_notify == "ghost_piano_warp_to_bar" )
|
||||||
|
{
|
||||||
|
get_players()[ 0 ] warp_to_struct( "ee_warp_bar", "targetname" );
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
warp_to_struct( str_value, str_key )
|
||||||
|
{
|
||||||
|
if ( !isDefined( str_key ) )
|
||||||
|
{
|
||||||
|
str_key = "targetname";
|
||||||
|
}
|
||||||
|
s_warp = getstruct( str_value, str_key );
|
||||||
|
self setorigin( s_warp.origin );
|
||||||
|
if ( isDefined( s_warp.angles ) )
|
||||||
|
{
|
||||||
|
self setplayerangles( s_warp.angles );
|
||||||
|
}
|
||||||
|
}
|
704
zm_buried_patch/maps/mp/zm_buried_ffotd.gsc
Normal file
704
zm_buried_patch/maps/mp/zm_buried_ffotd.gsc
Normal file
@ -0,0 +1,704 @@
|
|||||||
|
#include maps/mp/zombies/_zm;
|
||||||
|
#include maps/mp/gametypes_zm/_zm_gametype;
|
||||||
|
#include maps/mp/zm_buried;
|
||||||
|
#include maps/mp/zombies/_zm_zonemgr;
|
||||||
|
#include maps/mp/zombies/_zm_utility;
|
||||||
|
#include common_scripts/utility;
|
||||||
|
#include maps/mp/_utility;
|
||||||
|
|
||||||
|
main_start()
|
||||||
|
{
|
||||||
|
level thread spawned_collision_ffotd();
|
||||||
|
level thread ghost_round_override_init();
|
||||||
|
level thread init_push_triggers();
|
||||||
|
level thread init_dtp_triggers();
|
||||||
|
level thread spawned_slide_push_trigger();
|
||||||
|
level thread spawned_slide_prone_trigger();
|
||||||
|
level thread spawned_life_triggers();
|
||||||
|
onplayerconnect_callback( ::ffotd_player_threads );
|
||||||
|
}
|
||||||
|
|
||||||
|
main_end()
|
||||||
|
{
|
||||||
|
if ( is_gametype_active( "zgrief" ) )
|
||||||
|
{
|
||||||
|
level thread zgrief_mode_fix();
|
||||||
|
level.check_for_valid_spawn_near_team_callback = ::zgrief_respawn_override;
|
||||||
|
}
|
||||||
|
level.zombie_init_done = ::ffotd_zombie_init_done;
|
||||||
|
level thread bar_spawner_fix();
|
||||||
|
level thread maze_blocker_fix();
|
||||||
|
level thread door_clip_fix();
|
||||||
|
level thread player_respawn_fix();
|
||||||
|
}
|
||||||
|
|
||||||
|
ffotd_zombie_init_done()
|
||||||
|
{
|
||||||
|
self maps/mp/zm_buried::zombie_init_done();
|
||||||
|
self thread jail_traversal_fix();
|
||||||
|
}
|
||||||
|
|
||||||
|
jail_traversal_fix()
|
||||||
|
{
|
||||||
|
self endon( "death" );
|
||||||
|
window_pos = ( -837, 496, 8 );
|
||||||
|
fix_dist = 64;
|
||||||
|
while ( 1 )
|
||||||
|
{
|
||||||
|
dist = distancesquared( self.origin, window_pos );
|
||||||
|
if ( dist < fix_dist )
|
||||||
|
{
|
||||||
|
node = self getnegotiationstartnode();
|
||||||
|
if ( isDefined( node ) )
|
||||||
|
{
|
||||||
|
if ( node.animscript == "zm_jump_down_48" && node.type == "Begin" )
|
||||||
|
{
|
||||||
|
self setphysparams( 25, 0, 72 );
|
||||||
|
wait 1;
|
||||||
|
if ( is_true( self.has_legs ) )
|
||||||
|
{
|
||||||
|
self setphysparams( 15, 0, 72 );
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
self setphysparams( 15, 0, 24 );
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
wait 0,25;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
ghost_round_override_init()
|
||||||
|
{
|
||||||
|
origin = ( 2593, 562, 290 );
|
||||||
|
length = 512;
|
||||||
|
width = 91;
|
||||||
|
height = 290;
|
||||||
|
trig1 = spawn( "trigger_box", origin, 0, length, width, height );
|
||||||
|
trig1.angles = vectorScale( ( 0, 0, 0 ), 69 );
|
||||||
|
trig1.script_noteworthy = "ghost_round_override";
|
||||||
|
}
|
||||||
|
|
||||||
|
zgrief_mode_fix()
|
||||||
|
{
|
||||||
|
speed_trigger = getentarray( "specialty_fastreload", "script_noteworthy" );
|
||||||
|
_a98 = speed_trigger;
|
||||||
|
_k98 = getFirstArrayKey( _a98 );
|
||||||
|
while ( isDefined( _k98 ) )
|
||||||
|
{
|
||||||
|
trig = _a98[ _k98 ];
|
||||||
|
if ( trig.origin == ( -170,5, -328,25, 174 ) )
|
||||||
|
{
|
||||||
|
trig.origin += vectorScale( ( 0, 0, 0 ), 32 );
|
||||||
|
if ( isDefined( trig.clip ) )
|
||||||
|
{
|
||||||
|
trig.clip.origin += vectorScale( ( 0, 0, 0 ), 32 );
|
||||||
|
}
|
||||||
|
if ( isDefined( trig.machine ) )
|
||||||
|
{
|
||||||
|
trig.machine.origin += vectorScale( ( 0, 0, 0 ), 32 );
|
||||||
|
}
|
||||||
|
}
|
||||||
|
_k98 = getNextArrayKey( _a98, _k98 );
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
zgrief_respawn_override( revivee, return_struct )
|
||||||
|
{
|
||||||
|
players = get_players();
|
||||||
|
spawn_points = maps/mp/gametypes_zm/_zm_gametype::get_player_spawns_for_gametype();
|
||||||
|
grief_initial = getstructarray( "street_standard_player_spawns", "targetname" );
|
||||||
|
_a119 = grief_initial;
|
||||||
|
_k119 = getFirstArrayKey( _a119 );
|
||||||
|
while ( isDefined( _k119 ) )
|
||||||
|
{
|
||||||
|
struct = _a119[ _k119 ];
|
||||||
|
if ( isDefined( struct.script_int ) && struct.script_int == 2000 )
|
||||||
|
{
|
||||||
|
spawn_points[ spawn_points.size ] = struct;
|
||||||
|
initial_point = struct;
|
||||||
|
initial_point.locked = 0;
|
||||||
|
}
|
||||||
|
_k119 = getNextArrayKey( _a119, _k119 );
|
||||||
|
}
|
||||||
|
closest_group = undefined;
|
||||||
|
closest_distance = 100000000;
|
||||||
|
backup_group = undefined;
|
||||||
|
backup_distance = 100000000;
|
||||||
|
if ( spawn_points.size == 0 )
|
||||||
|
{
|
||||||
|
return undefined;
|
||||||
|
}
|
||||||
|
i = 0;
|
||||||
|
while ( i < players.size )
|
||||||
|
{
|
||||||
|
while ( is_player_valid( players[ i ], undefined, 1 ) && players[ i ] != self )
|
||||||
|
{
|
||||||
|
j = 0;
|
||||||
|
while ( j < spawn_points.size )
|
||||||
|
{
|
||||||
|
if ( isDefined( spawn_points[ j ].script_int ) )
|
||||||
|
{
|
||||||
|
ideal_distance = spawn_points[ j ].script_int;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
ideal_distance = 1000;
|
||||||
|
}
|
||||||
|
if ( spawn_points[ j ].locked == 0 )
|
||||||
|
{
|
||||||
|
plyr_dist = distancesquared( players[ i ].origin, spawn_points[ j ].origin );
|
||||||
|
if ( plyr_dist < ( ideal_distance * ideal_distance ) )
|
||||||
|
{
|
||||||
|
if ( plyr_dist < closest_distance )
|
||||||
|
{
|
||||||
|
closest_distance = plyr_dist;
|
||||||
|
closest_group = j;
|
||||||
|
}
|
||||||
|
j++;
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
if ( plyr_dist < backup_distance )
|
||||||
|
{
|
||||||
|
backup_group = j;
|
||||||
|
backup_distance = plyr_dist;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
j++;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if ( !isDefined( closest_group ) )
|
||||||
|
{
|
||||||
|
closest_group = backup_group;
|
||||||
|
}
|
||||||
|
if ( isDefined( closest_group ) )
|
||||||
|
{
|
||||||
|
spawn_location = maps/mp/zombies/_zm::get_valid_spawn_location( revivee, spawn_points, closest_group, return_struct );
|
||||||
|
if ( isDefined( spawn_location ) && !positionwouldtelefrag( spawn_location.origin ) )
|
||||||
|
{
|
||||||
|
if ( isDefined( spawn_location.plyr ) && spawn_location.plyr != revivee getentitynumber() )
|
||||||
|
{
|
||||||
|
i++;
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
return spawn_location;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
i++;
|
||||||
|
}
|
||||||
|
while ( isDefined( initial_point ) )
|
||||||
|
{
|
||||||
|
k = 0;
|
||||||
|
while ( k < spawn_points.size )
|
||||||
|
{
|
||||||
|
if ( spawn_points[ k ] == initial_point )
|
||||||
|
{
|
||||||
|
closest_group = k;
|
||||||
|
spawn_location = maps/mp/zombies/_zm::get_valid_spawn_location( revivee, spawn_points, closest_group, return_struct );
|
||||||
|
return spawn_location;
|
||||||
|
}
|
||||||
|
k++;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return undefined;
|
||||||
|
}
|
||||||
|
|
||||||
|
spawned_slide_prone_trigger()
|
||||||
|
{
|
||||||
|
origin = ( -2820, -412, 1438 );
|
||||||
|
length = 216;
|
||||||
|
width = 216;
|
||||||
|
height = 108;
|
||||||
|
trig1 = spawn( "trigger_box", origin, 0, length, width, height );
|
||||||
|
trig1.angles = ( 0, 0, 0 );
|
||||||
|
trig1.targetname = "force_from_prone";
|
||||||
|
}
|
||||||
|
|
||||||
|
spawned_slide_push_trigger()
|
||||||
|
{
|
||||||
|
origin = ( -1416,5, -324, 428,5 );
|
||||||
|
length = 111;
|
||||||
|
width = 394;
|
||||||
|
height = 189;
|
||||||
|
trig1 = spawn( "trigger_box", origin, 0, length, width, height );
|
||||||
|
trig1.angles = ( 0, 0, 0 );
|
||||||
|
trig1.targetname = "push_from_prone";
|
||||||
|
trig1.push_player_towards_point = ( -1336, -320, 360 );
|
||||||
|
while ( 1 )
|
||||||
|
{
|
||||||
|
trig1 waittill( "trigger", who );
|
||||||
|
if ( who getstance() == "prone" && isplayer( who ) )
|
||||||
|
{
|
||||||
|
who setstance( "crouch" );
|
||||||
|
}
|
||||||
|
trig1 thread slide_push_think( who );
|
||||||
|
wait 0,1;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
slide_push_think( who )
|
||||||
|
{
|
||||||
|
whopos = ( 0, 0, 0 );
|
||||||
|
while ( who istouching( self ) )
|
||||||
|
{
|
||||||
|
if ( who.origin == whopos )
|
||||||
|
{
|
||||||
|
who setvelocity( self get_push_vector() );
|
||||||
|
}
|
||||||
|
whopos = who.origin;
|
||||||
|
wait 2;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
slide_push_in_trigger( player )
|
||||||
|
{
|
||||||
|
if ( !player is_player_using_thumbstick() )
|
||||||
|
{
|
||||||
|
player setvelocity( self get_push_vector() );
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
spawned_life_triggers()
|
||||||
|
{
|
||||||
|
origin = ( 6637, 516, -580 );
|
||||||
|
length = 1110;
|
||||||
|
width = 982;
|
||||||
|
height = 824;
|
||||||
|
trig1 = spawn( "trigger_box", origin, 0, length, width, height );
|
||||||
|
trig1.angles = ( 0, 0, 0 );
|
||||||
|
trig1.script_noteworthy = "life_brush";
|
||||||
|
}
|
||||||
|
|
||||||
|
spawned_collision_ffotd()
|
||||||
|
{
|
||||||
|
precachemodel( "collision_geo_64x64x10_slick" );
|
||||||
|
precachemodel( "collision_geo_64x64x128_slick" );
|
||||||
|
precachemodel( "collision_geo_128x128x10_slick" );
|
||||||
|
precachemodel( "collision_geo_64x64x10_standard" );
|
||||||
|
precachemodel( "collision_geo_64x64x64_standard" );
|
||||||
|
precachemodel( "collision_geo_128x128x10_standard" );
|
||||||
|
precachemodel( "collision_geo_128x128x128_standard" );
|
||||||
|
precachemodel( "collision_geo_256x256x10_standard" );
|
||||||
|
precachemodel( "collision_geo_256x256x256_standard" );
|
||||||
|
precachemodel( "p6_zm_bu_rock_strata_column_01" );
|
||||||
|
precachemodel( "p6_zm_bu_rock_strata_01" );
|
||||||
|
precachemodel( "p6_zm_bu_rock_strata_04" );
|
||||||
|
precachemodel( "p6_zm_bu_wood_planks_106x171" );
|
||||||
|
flag_wait( "start_zombie_round_logic" );
|
||||||
|
if ( isDefined( level.optimise_for_splitscreen ) && !level.optimise_for_splitscreen )
|
||||||
|
{
|
||||||
|
collision1 = spawn( "script_model", ( 3731,5, 736, 6,5 ) );
|
||||||
|
collision1 setmodel( "collision_geo_64x64x128_slick" );
|
||||||
|
collision1.angles = ( 4,54625, 313,41, -4,78954 );
|
||||||
|
collision1 ghost();
|
||||||
|
collision2 = spawn( "script_model", ( 34, -1691, 375 ) );
|
||||||
|
collision2 setmodel( "collision_geo_256x256x10_standard" );
|
||||||
|
collision2.angles = vectorScale( ( 0, 0, 0 ), 3,80002 );
|
||||||
|
collision2 ghost();
|
||||||
|
collision3 = spawn( "script_model", ( 641, 545, -1,21359 ) );
|
||||||
|
collision3 setmodel( "collision_geo_64x64x128_slick" );
|
||||||
|
collision3.angles = ( 1,27355, 320,806, -5,38137 );
|
||||||
|
collision3 ghost();
|
||||||
|
saloon1 = spawn( "script_model", ( 1032,22, -1744,09, 309 ) );
|
||||||
|
saloon1 setmodel( "collision_geo_64x64x64_standard" );
|
||||||
|
saloon1.angles = vectorScale( ( 0, 0, 0 ), 40,8 );
|
||||||
|
saloon1 ghost();
|
||||||
|
saloon2 = spawn( "script_model", ( 1005,78, -1766,91, 309 ) );
|
||||||
|
saloon2 setmodel( "collision_geo_64x64x64_standard" );
|
||||||
|
saloon2.angles = vectorScale( ( 0, 0, 0 ), 40,8 );
|
||||||
|
saloon2 ghost();
|
||||||
|
gs1 = spawn( "script_model", ( 118,001, -537,037, 236 ) );
|
||||||
|
gs1 setmodel( "collision_geo_64x64x64_standard" );
|
||||||
|
gs1.angles = vectorScale( ( 0, 0, 0 ), 90 );
|
||||||
|
gs1 ghost();
|
||||||
|
gs1 thread delete_upon_flag( "general_store_porch_door1" );
|
||||||
|
gs2 = spawn( "script_model", ( 117,999, -571,963, 236 ) );
|
||||||
|
gs2 setmodel( "collision_geo_64x64x64_standard" );
|
||||||
|
gs2.angles = vectorScale( ( 0, 0, 0 ), 90 );
|
||||||
|
gs2 ghost();
|
||||||
|
gs2 thread delete_upon_flag( "general_store_porch_door1" );
|
||||||
|
collision4 = spawn( "script_model", ( 1672, 692, 99 ) );
|
||||||
|
collision4 setmodel( "collision_geo_128x128x10_slick" );
|
||||||
|
collision4.angles = ( 280,6, 270, 86,6 );
|
||||||
|
collision4 ghost();
|
||||||
|
cw1 = spawn( "script_model", ( 320, -1988, 116 ) );
|
||||||
|
cw1 setmodel( "collision_geo_128x128x128_standard" );
|
||||||
|
cw1.angles = ( 0, 0, 0 );
|
||||||
|
cw1 ghost();
|
||||||
|
rock1 = spawn( "script_model", ( 311, -1945, 104 ) );
|
||||||
|
rock1 setmodel( "p6_zm_bu_rock_strata_column_01" );
|
||||||
|
rock1.angles = vectorScale( ( 0, 0, 0 ), 90 );
|
||||||
|
st1 = spawn( "script_model", ( -736, -2, 25 ) );
|
||||||
|
st1 setmodel( "collision_geo_128x128x10_standard" );
|
||||||
|
st1.angles = ( 270, 45, 0 );
|
||||||
|
st1 ghost();
|
||||||
|
ml1 = spawn( "script_model", ( 2831, 440, 405 ) );
|
||||||
|
ml1 setmodel( "collision_geo_128x128x128_standard" );
|
||||||
|
ml1.angles = ( 0, 0, 0 );
|
||||||
|
ml1 ghost();
|
||||||
|
ml2 = spawn( "script_model", ( 2831, 680, 420 ) );
|
||||||
|
ml2 setmodel( "collision_geo_128x128x128_standard" );
|
||||||
|
ml2.angles = ( 0, 0, 0 );
|
||||||
|
ml2 ghost();
|
||||||
|
mr1 = spawn( "script_model", ( 2380, 1123, 350 ) );
|
||||||
|
mr1 setmodel( "collision_geo_256x256x10_standard" );
|
||||||
|
mr1.angles = ( 0, 13,8, -90 );
|
||||||
|
mr1 ghost();
|
||||||
|
th1 = spawn( "script_model", ( 2072, 1168, 360 ) );
|
||||||
|
th1 setmodel( "collision_geo_128x128x128_standard" );
|
||||||
|
th1.angles = ( 0, 0, 0 );
|
||||||
|
th1 ghost();
|
||||||
|
th1a = spawn( "script_model", ( 2296, 1088, 400 ) );
|
||||||
|
th1a setmodel( "collision_geo_128x128x128_standard" );
|
||||||
|
th1a.angles = ( 0, 0, 0 );
|
||||||
|
th1a ghost();
|
||||||
|
th2 = spawn( "script_model", ( -544, 510, 286 ) );
|
||||||
|
th2 setmodel( "collision_geo_256x256x10_standard" );
|
||||||
|
th2.angles = ( 0, 7,2, -7,8 );
|
||||||
|
th2 ghost();
|
||||||
|
th2a = spawn( "script_model", ( -296,95, 537,996, 312,557 ) );
|
||||||
|
th2a setmodel( "collision_geo_256x256x10_standard" );
|
||||||
|
th2a.angles = ( 347,355, 6,47392, -7,41809 );
|
||||||
|
th2a ghost();
|
||||||
|
th3 = spawn( "script_model", ( 864, 872, 420 ) );
|
||||||
|
th3 setmodel( "collision_geo_256x256x256_standard" );
|
||||||
|
th3.angles = ( 0, 0, 0 );
|
||||||
|
th3 ghost();
|
||||||
|
th4 = spawn( "script_model", ( 2361, 1056, 398 ) );
|
||||||
|
th4 setmodel( "collision_geo_256x256x10_standard" );
|
||||||
|
th4.angles = vectorScale( ( 0, 0, 0 ), 270 );
|
||||||
|
th4 ghost();
|
||||||
|
ch1 = spawn( "script_model", ( 1954, 1996, 222 ) );
|
||||||
|
ch1 setmodel( "collision_geo_256x256x10_standard" );
|
||||||
|
ch1.angles = ( 270, 340, 0,32 );
|
||||||
|
ch1 ghost();
|
||||||
|
ch2 = spawn( "script_model", ( 1945, 1972, 222 ) );
|
||||||
|
ch2 setmodel( "collision_geo_256x256x10_standard" );
|
||||||
|
ch2.angles = ( 270, 340, 0,32 );
|
||||||
|
ch2 ghost();
|
||||||
|
rock1 = spawn( "script_model", ( 3259,54, -189,38, 146,23 ) );
|
||||||
|
rock1 setmodel( "p6_zm_bu_rock_strata_column_01" );
|
||||||
|
rock1.angles = ( 7,87264, 94,015, 4,57899 );
|
||||||
|
rock2 = spawn( "script_model", ( 3351,97, -254,58, 95 ) );
|
||||||
|
rock2 setmodel( "p6_zm_bu_rock_strata_01" );
|
||||||
|
rock2.angles = vectorScale( ( 0, 0, 0 ), 169,1 );
|
||||||
|
yt1 = spawn( "script_model", ( 671, -1412, 214 ) );
|
||||||
|
yt1 setmodel( "collision_geo_64x64x10_slick" );
|
||||||
|
yt1.angles = ( 62,8, 315, 0 );
|
||||||
|
yt1 ghost();
|
||||||
|
yt2 = spawn( "script_model", ( 676, -1407, 214 ) );
|
||||||
|
yt2 setmodel( "collision_geo_64x64x10_slick" );
|
||||||
|
yt2.angles = ( 62,8, 315, 0 );
|
||||||
|
yt2 ghost();
|
||||||
|
stb1 = spawn( "script_model", ( -807, 59, 127 ) );
|
||||||
|
stb1 setmodel( "collision_geo_64x64x10_standard" );
|
||||||
|
stb1.angles = vectorScale( ( 0, 0, 0 ), 90 );
|
||||||
|
stb1 ghost();
|
||||||
|
stb2 = spawn( "script_model", ( -807, 59, 191 ) );
|
||||||
|
stb2 setmodel( "collision_geo_64x64x10_standard" );
|
||||||
|
stb2.angles = vectorScale( ( 0, 0, 0 ), 90 );
|
||||||
|
stb2 ghost();
|
||||||
|
stb3 = spawn( "script_model", ( -861, 59, 31 ) );
|
||||||
|
stb3 setmodel( "collision_geo_128x128x10_standard" );
|
||||||
|
stb3.angles = vectorScale( ( 0, 0, 0 ), 90 );
|
||||||
|
stb3 ghost();
|
||||||
|
j162 = spawn( "script_model", ( 912, -936, 214 ) );
|
||||||
|
j162 setmodel( "collision_geo_128x128x10_standard" );
|
||||||
|
j162.angles = ( 0, 0, 0 );
|
||||||
|
j162 ghost();
|
||||||
|
j156 = spawn( "script_model", ( 434, 1213, 184 ) );
|
||||||
|
j156 setmodel( "collision_geo_128x128x10_standard" );
|
||||||
|
j156.angles = vectorScale( ( 0, 0, 0 ), 273 );
|
||||||
|
j156 ghost();
|
||||||
|
j163_1 = spawn( "script_model", ( 1663, 68, 29 ) );
|
||||||
|
j163_1 setmodel( "collision_geo_128x128x10_slick" );
|
||||||
|
j163_1.angles = vectorScale( ( 0, 0, 0 ), 270 );
|
||||||
|
j163_1 ghost();
|
||||||
|
j163_2 = spawn( "script_model", ( 1663, 259, 29 ) );
|
||||||
|
j163_2 setmodel( "collision_geo_128x128x10_slick" );
|
||||||
|
j163_2.angles = vectorScale( ( 0, 0, 0 ), 270 );
|
||||||
|
j163_2 ghost();
|
||||||
|
j125_1 = spawn( "script_model", ( 2443,65, 1013,54, 236,213 ) );
|
||||||
|
j125_1 setmodel( "p6_zm_bu_rock_strata_04" );
|
||||||
|
j125_1.angles = ( 13,345, 103,42, -13,4657 );
|
||||||
|
j125_3 = spawn( "script_model", ( 2448,7, 852,791, 272,051 ) );
|
||||||
|
j125_3 setmodel( "p6_zm_bu_wood_planks_106x171" );
|
||||||
|
j125_3.angles = ( 0, 270, 19,4 );
|
||||||
|
j125_4 = spawn( "script_model", ( 2313,21, 872,54, 241,01 ) );
|
||||||
|
j125_4 setmodel( "p6_zm_bu_wood_planks_106x171" );
|
||||||
|
j125_4.angles = ( 0, 0, 0 );
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
delete_upon_flag( flag_notify )
|
||||||
|
{
|
||||||
|
level flag_wait( flag_notify );
|
||||||
|
self delete();
|
||||||
|
}
|
||||||
|
|
||||||
|
init_push_triggers()
|
||||||
|
{
|
||||||
|
ghost_mansion_to_maze_push_trigger_left();
|
||||||
|
ghost_mansion_to_maze_push_trigger_right();
|
||||||
|
ghost_mansion_from_maze_push_trigger();
|
||||||
|
a_push_triggers = getentarray( "push_trigger", "script_noteworthy" );
|
||||||
|
array_thread( a_push_triggers, ::push_players_standing_in_trigger_volumes );
|
||||||
|
}
|
||||||
|
|
||||||
|
ghost_mansion_to_maze_push_trigger_left()
|
||||||
|
{
|
||||||
|
origin = ( 2656, 689, 183 );
|
||||||
|
length = 128;
|
||||||
|
width = 8;
|
||||||
|
height = 64;
|
||||||
|
trig1 = spawn( "trigger_box", origin, 0, width, length, height );
|
||||||
|
trig1.angles = vectorScale( ( 0, 0, 0 ), 325,6 );
|
||||||
|
trig1.script_noteworthy = "push_trigger";
|
||||||
|
trig1.push_player_towards_point = ( 2666, 685, 183 );
|
||||||
|
}
|
||||||
|
|
||||||
|
ghost_mansion_to_maze_push_trigger_right()
|
||||||
|
{
|
||||||
|
origin = ( 2592, 453, 183 );
|
||||||
|
length = 32;
|
||||||
|
width = 16;
|
||||||
|
height = 64;
|
||||||
|
trig1 = spawn( "trigger_box", origin, 0, width, length, height );
|
||||||
|
trig1.angles = vectorScale( ( 0, 0, 0 ), 325,6 );
|
||||||
|
trig1.script_noteworthy = "push_trigger";
|
||||||
|
trig1.push_player_towards_point = ( 2686, 440, 174 );
|
||||||
|
}
|
||||||
|
|
||||||
|
ghost_mansion_from_maze_push_trigger()
|
||||||
|
{
|
||||||
|
origin = ( 3425, 1067, 53 );
|
||||||
|
length = 128;
|
||||||
|
width = 16;
|
||||||
|
height = 64;
|
||||||
|
trig1 = spawn( "trigger_box", origin, 0, width, length, height );
|
||||||
|
trig1.angles = ( 0, 0, 0 );
|
||||||
|
trig1.script_noteworthy = "push_trigger";
|
||||||
|
trig1.push_player_towards_point = ( 3337, 1067, 90 );
|
||||||
|
}
|
||||||
|
|
||||||
|
push_players_standing_in_trigger_volumes()
|
||||||
|
{
|
||||||
|
/#
|
||||||
|
assert( isDefined( self.push_player_towards_point ), "push_player_towards_point field is undefined on push_trigger! This is required for the push functionality to work" );
|
||||||
|
#/
|
||||||
|
while ( 1 )
|
||||||
|
{
|
||||||
|
self waittill( "trigger", player );
|
||||||
|
if ( !player is_player_using_thumbstick() )
|
||||||
|
{
|
||||||
|
player setvelocity( self get_push_vector() );
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
is_player_using_thumbstick()
|
||||||
|
{
|
||||||
|
b_using_thumbstick = 1;
|
||||||
|
v_thumbstick = self getnormalizedmovement();
|
||||||
|
if ( length( v_thumbstick ) < 0,3 )
|
||||||
|
{
|
||||||
|
b_using_thumbstick = 0;
|
||||||
|
}
|
||||||
|
return b_using_thumbstick;
|
||||||
|
}
|
||||||
|
|
||||||
|
get_push_vector()
|
||||||
|
{
|
||||||
|
return vectornormalize( self.push_player_towards_point - self.origin ) * 100;
|
||||||
|
}
|
||||||
|
|
||||||
|
bar_spawner_fix()
|
||||||
|
{
|
||||||
|
bad_pos = ( 459,5, -1984, 84 );
|
||||||
|
dist_fix = 64;
|
||||||
|
bar_spawners = getstructarray( "zone_bar_spawners", "targetname" );
|
||||||
|
_a586 = bar_spawners;
|
||||||
|
_k586 = getFirstArrayKey( _a586 );
|
||||||
|
while ( isDefined( _k586 ) )
|
||||||
|
{
|
||||||
|
spawner = _a586[ _k586 ];
|
||||||
|
if ( isDefined( spawner.script_string ) && spawner.script_string == "bar2" )
|
||||||
|
{
|
||||||
|
dist = distancesquared( spawner.origin, bad_pos );
|
||||||
|
if ( dist < dist_fix )
|
||||||
|
{
|
||||||
|
spawner.origin = ( 459,5, -2020, 84 );
|
||||||
|
}
|
||||||
|
}
|
||||||
|
_k586 = getNextArrayKey( _a586, _k586 );
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
player_respawn_fix()
|
||||||
|
{
|
||||||
|
maze_spawners = getstructarray( "maze_spawn_points", "targetname" );
|
||||||
|
_a602 = maze_spawners;
|
||||||
|
_k602 = getFirstArrayKey( _a602 );
|
||||||
|
while ( isDefined( _k602 ) )
|
||||||
|
{
|
||||||
|
spawner = _a602[ _k602 ];
|
||||||
|
if ( spawner.origin == ( 3469, 1026, 20 ) )
|
||||||
|
{
|
||||||
|
spawner.origin = ( 3509, 1032, 76 );
|
||||||
|
}
|
||||||
|
_k602 = getNextArrayKey( _a602, _k602 );
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
door_clip_fix()
|
||||||
|
{
|
||||||
|
bank1 = getentarray( "pf728_auto2510", "targetname" );
|
||||||
|
i = 0;
|
||||||
|
while ( i < bank1.size )
|
||||||
|
{
|
||||||
|
if ( isDefined( bank1[ i ].script_noteworthy ) && bank1[ i ].script_noteworthy == "clip" )
|
||||||
|
{
|
||||||
|
bank1[ i ] delete();
|
||||||
|
}
|
||||||
|
i++;
|
||||||
|
}
|
||||||
|
bank2 = getentarray( "pf728_auto2507", "targetname" );
|
||||||
|
i = 0;
|
||||||
|
while ( i < bank2.size )
|
||||||
|
{
|
||||||
|
if ( isDefined( bank2[ i ].script_noteworthy ) && bank2[ i ].script_noteworthy == "clip" )
|
||||||
|
{
|
||||||
|
bank2[ i ] delete();
|
||||||
|
}
|
||||||
|
i++;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
maze_blocker_fix()
|
||||||
|
{
|
||||||
|
node_org = ( 4732, 960, 32 );
|
||||||
|
node_target_org = ( 4734, 1198, 32 );
|
||||||
|
blocker_node = getnearestnode( node_org );
|
||||||
|
blocker_node_target = getnearestnode( node_target_org );
|
||||||
|
while ( 1 )
|
||||||
|
{
|
||||||
|
level waittill( "zm_buried_maze_changed" );
|
||||||
|
found = 0;
|
||||||
|
perm_list = level._maze._perms[ level._maze._cur_perm ];
|
||||||
|
_a648 = perm_list;
|
||||||
|
_k648 = getFirstArrayKey( _a648 );
|
||||||
|
while ( isDefined( _k648 ) )
|
||||||
|
{
|
||||||
|
blocker = _a648[ _k648 ];
|
||||||
|
if ( blocker == "blocker_10" )
|
||||||
|
{
|
||||||
|
found = 1;
|
||||||
|
if ( isDefined( blocker_node ) && isDefined( blocker_node_target ) )
|
||||||
|
{
|
||||||
|
unlink_nodes( blocker_node, blocker_node_target, 0 );
|
||||||
|
unlink_nodes( blocker_node_target, blocker_node, 0 );
|
||||||
|
}
|
||||||
|
}
|
||||||
|
_k648 = getNextArrayKey( _a648, _k648 );
|
||||||
|
}
|
||||||
|
if ( !found )
|
||||||
|
{
|
||||||
|
if ( isDefined( blocker_node ) && isDefined( blocker_node_target ) )
|
||||||
|
{
|
||||||
|
link_nodes( blocker_node, blocker_node_target, 1 );
|
||||||
|
link_nodes( blocker_node_target, blocker_node, 1 );
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
time_bomb_takeaway()
|
||||||
|
{
|
||||||
|
self endon( "disconnect" );
|
||||||
|
while ( 1 )
|
||||||
|
{
|
||||||
|
self waittill( "new_tactical_grenade", new_weapon );
|
||||||
|
if ( isDefined( new_weapon ) && new_weapon != "time_bomb_zm" && self hasweapon( "time_bomb_detonator_zm" ) )
|
||||||
|
{
|
||||||
|
self takeweapon( "time_bomb_detonator_zm" );
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
ffotd_player_threads()
|
||||||
|
{
|
||||||
|
self thread time_bomb_takeaway();
|
||||||
|
}
|
||||||
|
|
||||||
|
init_dtp_triggers()
|
||||||
|
{
|
||||||
|
barn_hay_push_trigger();
|
||||||
|
barn_rail_push_trigger();
|
||||||
|
church_fence_push_trigger();
|
||||||
|
a_push_triggers = getentarray( "push_from_dtp", "script_noteworthy" );
|
||||||
|
array_thread( a_push_triggers, ::dtp_push );
|
||||||
|
}
|
||||||
|
|
||||||
|
barn_hay_push_trigger()
|
||||||
|
{
|
||||||
|
origin = ( -1137, -190, 188 );
|
||||||
|
length = 48;
|
||||||
|
width = 64;
|
||||||
|
height = 64;
|
||||||
|
trig1 = spawn( "trigger_box", origin, 0, width, length, height );
|
||||||
|
trig1.angles = ( 0, 0, 0 );
|
||||||
|
trig1.script_noteworthy = "push_from_dtp";
|
||||||
|
trig1.push_player_towards_point = ( -1137, -264, 200 );
|
||||||
|
}
|
||||||
|
|
||||||
|
barn_rail_push_trigger()
|
||||||
|
{
|
||||||
|
origin = ( -1137, -211, 188 );
|
||||||
|
length = 32;
|
||||||
|
width = 128;
|
||||||
|
height = 64;
|
||||||
|
trig1 = spawn( "trigger_box", origin, 0, width, length, height );
|
||||||
|
trig1.angles = ( 0, 0, 0 );
|
||||||
|
trig1.script_noteworthy = "push_from_dtp";
|
||||||
|
trig1.push_player_towards_point = ( -1137, -285, 200 );
|
||||||
|
}
|
||||||
|
|
||||||
|
church_fence_push_trigger()
|
||||||
|
{
|
||||||
|
origin = ( 900, 1000, 54 );
|
||||||
|
length = 64;
|
||||||
|
width = 192;
|
||||||
|
height = 64;
|
||||||
|
trig1 = spawn( "trigger_box", origin, 0, width, length, height );
|
||||||
|
trig1.angles = ( 0, 0, 0 );
|
||||||
|
trig1.script_noteworthy = "push_from_dtp";
|
||||||
|
trig1.push_player_towards_point = ( 929, 943, 64 );
|
||||||
|
}
|
||||||
|
|
||||||
|
dtp_push()
|
||||||
|
{
|
||||||
|
pos = ( 0, 0, 0 );
|
||||||
|
while ( 1 )
|
||||||
|
{
|
||||||
|
self waittill( "trigger", player );
|
||||||
|
if ( pos == player.origin )
|
||||||
|
{
|
||||||
|
if ( player getstance() == "prone" )
|
||||||
|
{
|
||||||
|
player setstance( "crouch" );
|
||||||
|
}
|
||||||
|
player setvelocity( self get_push_vector() );
|
||||||
|
}
|
||||||
|
pos = player.origin;
|
||||||
|
wait 0,5;
|
||||||
|
}
|
||||||
|
}
|
297
zm_buried_patch/maps/mp/zm_buried_fountain.gsc
Normal file
297
zm_buried_patch/maps/mp/zm_buried_fountain.gsc
Normal file
@ -0,0 +1,297 @@
|
|||||||
|
#include maps/mp/zombies/_zm_stats;
|
||||||
|
#include maps/mp/zombies/_zm_ai_ghost;
|
||||||
|
#include maps/mp/zm_buried_classic;
|
||||||
|
#include maps/mp/zombies/_zm_utility;
|
||||||
|
#include common_scripts/utility;
|
||||||
|
#include maps/mp/_utility;
|
||||||
|
|
||||||
|
init_fountain()
|
||||||
|
{
|
||||||
|
flag_init( "courtyard_fountain_broken" );
|
||||||
|
flag_init( "maze_fountain_broken" );
|
||||||
|
flag_init( "fountain_transport_active" );
|
||||||
|
level._effect[ "fountain_break" ] = loadfx( "maps/zombie_buried/fx_buried_fountain_break" );
|
||||||
|
level._effect[ "fountain_spray" ] = loadfx( "maps/zombie_buried/fx_buried_fountain_spray" );
|
||||||
|
level._effect[ "fountain_teleport" ] = loadfx( "maps/zombie_buried/fx_buried_teleport_flash" );
|
||||||
|
level thread fountain_setup();
|
||||||
|
level thread maze_fountain_collmap();
|
||||||
|
}
|
||||||
|
|
||||||
|
fountain_setup()
|
||||||
|
{
|
||||||
|
flag_wait( "initial_blackscreen_passed" );
|
||||||
|
fountain_debug_print( "fountain scripts running" );
|
||||||
|
level thread set_flag_on_notify( "courtyard_fountain_open", "courtyard_fountain_broken" );
|
||||||
|
level thread sloth_fountain_think();
|
||||||
|
level thread maze_fountain_think();
|
||||||
|
level thread fountain_transport_think();
|
||||||
|
/#
|
||||||
|
level thread debug_warp_player_to_fountain();
|
||||||
|
#/
|
||||||
|
}
|
||||||
|
|
||||||
|
maze_fountain_collmap()
|
||||||
|
{
|
||||||
|
collmap = getentarray( "maze_fountain_collmap", "targetname" );
|
||||||
|
flag_wait( "maze_fountain_broken" );
|
||||||
|
array_thread( collmap, ::self_delete );
|
||||||
|
}
|
||||||
|
|
||||||
|
sloth_fountain_think()
|
||||||
|
{
|
||||||
|
flag_wait( "courtyard_fountain_broken" );
|
||||||
|
level setclientfield( "sloth_fountain_start", 1 );
|
||||||
|
s_courtyard_fountain = getstruct( "courtyard_fountain_struct", "targetname" );
|
||||||
|
if ( isDefined( s_courtyard_fountain ) )
|
||||||
|
{
|
||||||
|
sound_offset = vectorScale( ( 0, 0, 1 ), 100 );
|
||||||
|
sound_ent = spawn( "script_origin", s_courtyard_fountain.origin + sound_offset );
|
||||||
|
playfx( level._effect[ "fx_buried_fountain_spray" ], s_courtyard_fountain.origin );
|
||||||
|
playfx( level._effect[ "fountain_break" ], s_courtyard_fountain.origin );
|
||||||
|
sound_ent playloopsound( "zmb_fountain_spray", 0,2 );
|
||||||
|
}
|
||||||
|
show_maze_fountain_water();
|
||||||
|
fountain_debug_print( "courtyard_fountain_broken" );
|
||||||
|
}
|
||||||
|
|
||||||
|
set_flag_on_notify( notifystr, strflag )
|
||||||
|
{
|
||||||
|
if ( notifystr != "death" )
|
||||||
|
{
|
||||||
|
self endon( "death" );
|
||||||
|
}
|
||||||
|
if ( !level.flag[ strflag ] )
|
||||||
|
{
|
||||||
|
self waittill( notifystr );
|
||||||
|
flag_set( strflag );
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
maze_fountain_think()
|
||||||
|
{
|
||||||
|
hide_maze_fountain_water();
|
||||||
|
wait_for_maze_fountain_to_be_destroyed();
|
||||||
|
destroy_maze_fountain();
|
||||||
|
flag_wait( "courtyard_fountain_broken" );
|
||||||
|
flag_set( "fountain_transport_active" );
|
||||||
|
}
|
||||||
|
|
||||||
|
hide_maze_fountain_water()
|
||||||
|
{
|
||||||
|
t_water = getent( "maze_fountain_water_trigger", "targetname" );
|
||||||
|
t_water enablelinkto();
|
||||||
|
m_water = getent( "maze_fountain_water", "targetname" );
|
||||||
|
t_water linkto( m_water );
|
||||||
|
m_water movez( -475, 0,05 );
|
||||||
|
}
|
||||||
|
|
||||||
|
show_maze_fountain_water()
|
||||||
|
{
|
||||||
|
m_water = getent( "maze_fountain_water", "targetname" );
|
||||||
|
m_water movez( 398, 6 );
|
||||||
|
m_water ghost();
|
||||||
|
fountain_debug_print( "maze water ready" );
|
||||||
|
}
|
||||||
|
|
||||||
|
wait_for_maze_fountain_to_be_destroyed()
|
||||||
|
{
|
||||||
|
/#
|
||||||
|
level endon( "_destroy_maze_fountain" );
|
||||||
|
#/
|
||||||
|
t_damage = getent( "maze_fountain_trigger", "targetname" );
|
||||||
|
health = 1000;
|
||||||
|
while ( health > 0 )
|
||||||
|
{
|
||||||
|
t_damage waittill( "damage", damage, attacker, direction, point, type, tagname, modelname, partname, weaponname, idflags );
|
||||||
|
if ( damage < 50 )
|
||||||
|
{
|
||||||
|
damage = 0;
|
||||||
|
}
|
||||||
|
if ( isDefined( type ) && type != "MOD_EXPLOSIVE" && type != "MOD_EXPLOSIVE_SPLASH" && type != "MOD_GRENADE" && type != "MOD_GRENADE_SPLASH" || type == "MOD_PROJECTILE" && type == "MOD_PROJECTILE_SPLASH" )
|
||||||
|
{
|
||||||
|
health -= damage;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
destroy_maze_fountain()
|
||||||
|
{
|
||||||
|
s_fountain = getstruct( "maze_fountain_struct", "targetname" );
|
||||||
|
level setclientfield( "maze_fountain_start", 1 );
|
||||||
|
if ( isDefined( s_fountain ) )
|
||||||
|
{
|
||||||
|
playfx( level._effect[ "fountain_break" ], s_fountain.origin );
|
||||||
|
}
|
||||||
|
s_fountain_clip = getent( "maze_fountain_clip", "targetname" );
|
||||||
|
s_fountain_clip delete();
|
||||||
|
flag_set( "maze_fountain_broken" );
|
||||||
|
}
|
||||||
|
|
||||||
|
fountain_transport_think()
|
||||||
|
{
|
||||||
|
t_transporter = getent( "maze_fountain_water_trigger", "targetname" );
|
||||||
|
while ( 1 )
|
||||||
|
{
|
||||||
|
t_transporter waittill( "trigger", player );
|
||||||
|
if ( !isDefined( player.is_in_fountain_transport_trigger ) || !player.is_in_fountain_transport_trigger )
|
||||||
|
{
|
||||||
|
player.is_in_fountain_transport_trigger = 1;
|
||||||
|
if ( flag( "fountain_transport_active" ) )
|
||||||
|
{
|
||||||
|
player thread transport_player_to_start_zone();
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
player thread delay_transport_check();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
delay_transport_check()
|
||||||
|
{
|
||||||
|
self endon( "death" );
|
||||||
|
self endon( "bled_out" );
|
||||||
|
wait 1;
|
||||||
|
self.is_in_fountain_transport_trigger = 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
transport_player_to_start_zone()
|
||||||
|
{
|
||||||
|
self endon( "death_or_disconnect" );
|
||||||
|
fountain_debug_print( "transport player!" );
|
||||||
|
if ( !isDefined( level._fountain_transporter ) )
|
||||||
|
{
|
||||||
|
level._fountain_transporter = spawnstruct();
|
||||||
|
level._fountain_transporter.index = 0;
|
||||||
|
level._fountain_transporter.end_points = getstructarray( "fountain_transport_end_location", "targetname" );
|
||||||
|
}
|
||||||
|
self playsoundtoplayer( "zmb_buried_teleport", self );
|
||||||
|
self play_teleport_fx();
|
||||||
|
self flash_screen_white();
|
||||||
|
wait_network_frame();
|
||||||
|
if ( level._fountain_transporter.index >= level._fountain_transporter.end_points.size )
|
||||||
|
{
|
||||||
|
level._fountain_transporter.index = 0;
|
||||||
|
}
|
||||||
|
tries = 0;
|
||||||
|
while ( positionwouldtelefrag( level._fountain_transporter.end_points[ level._fountain_transporter.index ].origin ) )
|
||||||
|
{
|
||||||
|
tries++;
|
||||||
|
if ( tries >= 4 )
|
||||||
|
{
|
||||||
|
tries = 0;
|
||||||
|
wait 0,05;
|
||||||
|
}
|
||||||
|
level._fountain_transporter.index++;
|
||||||
|
if ( level._fountain_transporter.index >= level._fountain_transporter.end_points.size )
|
||||||
|
{
|
||||||
|
level._fountain_transporter.index = 0;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
self setorigin( level._fountain_transporter.end_points[ level._fountain_transporter.index ].origin );
|
||||||
|
self setplayerangles( level._fountain_transporter.end_points[ level._fountain_transporter.index ].angles );
|
||||||
|
level._fountain_transporter.index++;
|
||||||
|
wait_network_frame();
|
||||||
|
self play_teleport_fx();
|
||||||
|
self thread flash_screen_fade_out();
|
||||||
|
self maps/mp/zm_buried_classic::buried_set_start_area_lighting();
|
||||||
|
self thread maps/mp/zombies/_zm_ai_ghost::behave_after_fountain_transport( self );
|
||||||
|
self maps/mp/zombies/_zm_stats::increment_client_stat( "buried_fountain_transporter_used", 0 );
|
||||||
|
self maps/mp/zombies/_zm_stats::increment_player_stat( "buried_fountain_transporter_used" );
|
||||||
|
self notify( "player_used_fountain_teleporter" );
|
||||||
|
wait_network_frame();
|
||||||
|
wait_network_frame();
|
||||||
|
self.is_in_fountain_transport_trigger = 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
play_teleport_fx()
|
||||||
|
{
|
||||||
|
playfx( level._effect[ "fountain_teleport" ], self gettagorigin( "J_SpineLower" ) );
|
||||||
|
}
|
||||||
|
|
||||||
|
flash_screen_white()
|
||||||
|
{
|
||||||
|
self endon( "death_or_disconnect" );
|
||||||
|
self.hud_transporter_flash = self create_client_hud_elem();
|
||||||
|
self.hud_transporter_flash fadeovertime( 0,2 );
|
||||||
|
self.hud_transporter_flash.alpha = 1;
|
||||||
|
wait 0,2;
|
||||||
|
}
|
||||||
|
|
||||||
|
flash_screen_fade_out()
|
||||||
|
{
|
||||||
|
self.hud_transporter_flash fadeovertime( 0,2 );
|
||||||
|
self.hud_transporter_flash.alpha = 0;
|
||||||
|
wait 0,2;
|
||||||
|
self.hud_transporter_flash destroy();
|
||||||
|
self.hud_transporter_flash = undefined;
|
||||||
|
}
|
||||||
|
|
||||||
|
create_client_hud_elem()
|
||||||
|
{
|
||||||
|
hud_elem = newclienthudelem( self );
|
||||||
|
hud_elem.x = 0;
|
||||||
|
hud_elem.y = 0;
|
||||||
|
hud_elem.horzalign = "fullscreen";
|
||||||
|
hud_elem.vertalign = "fullscreen";
|
||||||
|
hud_elem.foreground = 1;
|
||||||
|
hud_elem.alpha = 0;
|
||||||
|
hud_elem.hidewheninmenu = 0;
|
||||||
|
hud_elem.shader = "white";
|
||||||
|
hud_elem setshader( "white", 640, 480 );
|
||||||
|
return hud_elem;
|
||||||
|
}
|
||||||
|
|
||||||
|
debug_warp_player_to_fountain()
|
||||||
|
{
|
||||||
|
while ( 1 )
|
||||||
|
{
|
||||||
|
str_notify = level waittill_any_return( "warp_player_to_maze_fountain", "warp_player_to_courtyard_fountain" );
|
||||||
|
if ( str_notify == "warp_player_to_maze_fountain" )
|
||||||
|
{
|
||||||
|
str_warp_point = "teleport_player_to_maze_fountain";
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
if ( str_notify == "warp_player_to_courtyard_fountain" )
|
||||||
|
{
|
||||||
|
str_warp_point = "teleport_player_to_courtyard_fountain";
|
||||||
|
}
|
||||||
|
}
|
||||||
|
_a332 = get_players();
|
||||||
|
_k332 = getFirstArrayKey( _a332 );
|
||||||
|
while ( isDefined( _k332 ) )
|
||||||
|
{
|
||||||
|
player = _a332[ _k332 ];
|
||||||
|
_warp_player_to_maze_fountain( player, str_warp_point );
|
||||||
|
wait 0,25;
|
||||||
|
_k332 = getNextArrayKey( _a332, _k332 );
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
_warp_player_to_maze_fountain( player, str_teleport_point )
|
||||||
|
{
|
||||||
|
fountain_debug_print( "teleporting player to " + str_teleport_point );
|
||||||
|
s_warp = getstruct( str_teleport_point, "targetname" );
|
||||||
|
origin = s_warp.origin;
|
||||||
|
while ( positionwouldtelefrag( origin ) )
|
||||||
|
{
|
||||||
|
wait 0,05;
|
||||||
|
origin = s_warp.origin + ( randomfloatrange( -64, 64 ), randomfloatrange( -64, 64 ), 0 );
|
||||||
|
}
|
||||||
|
player setorigin( origin );
|
||||||
|
player setplayerangles( s_warp.angles );
|
||||||
|
}
|
||||||
|
|
||||||
|
fountain_debug_print( str_text )
|
||||||
|
{
|
||||||
|
/#
|
||||||
|
if ( getDvarInt( #"AE3F04F6" ) > 0 )
|
||||||
|
{
|
||||||
|
iprintlnbold( str_text );
|
||||||
|
#/
|
||||||
|
}
|
||||||
|
}
|
150
zm_buried_patch/maps/mp/zm_buried_fx.gsc
Normal file
150
zm_buried_patch/maps/mp/zm_buried_fx.gsc
Normal file
@ -0,0 +1,150 @@
|
|||||||
|
#include maps/mp/_utility;
|
||||||
|
|
||||||
|
#using_animtree( "fxanim_props_dlc3" );
|
||||||
|
|
||||||
|
main()
|
||||||
|
{
|
||||||
|
precache_createfx_fx();
|
||||||
|
precache_scripted_fx();
|
||||||
|
precache_fxanim_props();
|
||||||
|
maps/mp/createfx/zm_buried_fx::main();
|
||||||
|
}
|
||||||
|
|
||||||
|
precache_scripted_fx()
|
||||||
|
{
|
||||||
|
level._effect[ "switch_sparks" ] = loadfx( "maps/zombie/fx_zmb_pswitch_spark" );
|
||||||
|
level._effect[ "lght_marker" ] = loadfx( "maps/zombie/fx_zmb_tranzit_marker" );
|
||||||
|
level._effect[ "lght_marker_flare" ] = loadfx( "maps/zombie/fx_zmb_tranzit_marker_fl" );
|
||||||
|
level._effect[ "poltergeist" ] = loadfx( "misc/fx_zombie_couch_effect" );
|
||||||
|
level._effect[ "zomb_gib" ] = loadfx( "maps/zombie/fx_zmb_tranzit_lava_torso_explo" );
|
||||||
|
level._effect[ "blue_eyes" ] = loadfx( "maps/zombie/fx_zombie_eye_single_blue" );
|
||||||
|
level._effect[ "orange_eyes" ] = loadfx( "misc/fx_zombie_eye_single" );
|
||||||
|
level._effect[ "player_possessed_eyes" ] = loadfx( "maps/zombie_buried/fx_buried_eye_stulhinger" );
|
||||||
|
gametype = getDvar( "ui_gametype" );
|
||||||
|
if ( gametype == "zcleansed" )
|
||||||
|
{
|
||||||
|
level._effect[ "blue_eyes_player" ] = loadfx( "maps/zombie/fx_zombie_eye_returned_blue" );
|
||||||
|
level._effect[ "lava_burning" ] = loadfx( "env/fire/fx_fire_lava_player_torso" );
|
||||||
|
}
|
||||||
|
if ( isDefined( 0 ) && 0 )
|
||||||
|
{
|
||||||
|
level._effect[ "player_3rd_spotlight_lite" ] = loadfx( "maps/zombie_buried/fx_buried_spot_flkr_lite" );
|
||||||
|
level._effect[ "player_3rd_spotlight_med" ] = loadfx( "maps/zombie_buried/fx_buried_spot_flkr_med" );
|
||||||
|
level._effect[ "player_3rd_spotlight_high" ] = loadfx( "maps/zombie_buried/fx_buried_spot_flkr_hvy" );
|
||||||
|
level._effect[ "oillamp" ] = loadfx( "maps/zombie_buried/fx_buried_glow_lantern" );
|
||||||
|
}
|
||||||
|
level._effect[ "booze_candy_spawn" ] = loadfx( "maps/zombie_buried/fx_buried_booze_candy_spawn" );
|
||||||
|
level._effect[ "crusher_sparks" ] = loadfx( "maps/zombie_buried/fx_buried_crusher_sparks" );
|
||||||
|
level._effect[ "rise_burst_foliage" ] = loadfx( "maps/zombie/fx_zm_buried_hedge_billow_body" );
|
||||||
|
level._effect[ "rise_billow_foliage" ] = loadfx( "maps/zombie/fx_zm_buried_hedge_burst_hand" );
|
||||||
|
level._effect[ "rise_dust_foliage" ] = loadfx( "maps/zombie/fx_zm_buried_hedge_dustfall_body" );
|
||||||
|
level._effect[ "fx_buried_key_glint" ] = loadfx( "maps/zombie_buried/fx_buried_key_glint" );
|
||||||
|
level._effect[ "sq_glow" ] = loadfx( "maps/zombie_buried/fx_buried_glow_lantern_ghost" );
|
||||||
|
level._effect[ "vulture_fx_wisp" ] = loadfx( "maps/zombie_buried/fx_buried_richt_whisp_center" );
|
||||||
|
level._effect[ "vulture_fx_wisp_orb" ] = loadfx( "maps/zombie_buried/fx_buried_richt_whisp_orbit" );
|
||||||
|
level._effect[ "fx_wisp_m" ] = loadfx( "maps/zombie_buried/fx_buried_maxis_whisp_os" );
|
||||||
|
level._effect[ "fx_wisp_lg_m" ] = loadfx( "maps/zombie_buried/fx_buried_maxis_whisp_lg_os" );
|
||||||
|
level._effect[ "sq_bulb_blue" ] = loadfx( "maps/zombie_buried/fx_buried_eg_blu" );
|
||||||
|
level._effect[ "sq_bulb_orange" ] = loadfx( "maps/zombie_buried/fx_buried_eg_orng" );
|
||||||
|
level._effect[ "sq_bulb_green" ] = loadfx( "maps/zombie_buried/fx_buried_sq_bulb_green" );
|
||||||
|
level._effect[ "sq_bulb_yellow" ] = loadfx( "maps/zombie_buried/fx_buried_sq_bulb_yellow" );
|
||||||
|
level._effect[ "sq_ether_amp_trail" ] = loadfx( "maps/zombie_buried/fx_buried_ether_amp_trail" );
|
||||||
|
level._effect[ "sq_tower_r" ] = loadfx( "maps/zombie_buried/fx_buried_tower_power_blue" );
|
||||||
|
level._effect[ "sq_tower_m" ] = loadfx( "maps/zombie_buried/fx_buried_tower_power_orange" );
|
||||||
|
level._effect[ "sq_tower_bolts" ] = loadfx( "maps/zombie_buried/fx_buried_tower_power_bolts" );
|
||||||
|
level._effect[ "sq_spark" ] = loadfx( "maps/zombie_buried/fx_buried_spark_gen" );
|
||||||
|
level._effect[ "sq_spawn" ] = loadfx( "maps/zombie_buried/fx_buried_time_bomb_spawn" );
|
||||||
|
level._effect[ "sq_vulture_orange_eye_glow" ] = loadfx( "misc/fx_zombie_eye_side_quest" );
|
||||||
|
}
|
||||||
|
|
||||||
|
precache_createfx_fx()
|
||||||
|
{
|
||||||
|
level._effect[ "fx_buried_ash_blowing" ] = loadfx( "maps/zombie_buried/fx_buried_ash_blowing" );
|
||||||
|
level._effect[ "fx_buried_bats_group" ] = loadfx( "maps/zombie_buried/fx_buried_bats_group" );
|
||||||
|
level._effect[ "fx_buried_cloud_low" ] = loadfx( "maps/zombie_buried/fx_buried_cloud_low" );
|
||||||
|
level._effect[ "fx_buried_conveyor_belt_edge" ] = loadfx( "maps/zombie_buried/fx_buried_conveyor_belt_edge" );
|
||||||
|
level._effect[ "fx_buried_dust_ceiling_hole" ] = loadfx( "maps/zombie_buried/fx_buried_dust_ceiling_hole" );
|
||||||
|
level._effect[ "fx_buried_dust_edge_100" ] = loadfx( "maps/zombie_buried/fx_buried_dust_edge_100" );
|
||||||
|
level._effect[ "fx_buried_dust_edge_xlg" ] = loadfx( "maps/zombie_buried/fx_buried_dust_edge_xlg" );
|
||||||
|
level._effect[ "fx_buried_dust_edge_blown" ] = loadfx( "maps/zombie_buried/fx_buried_dust_edge_blown" );
|
||||||
|
level._effect[ "fx_buried_dust_flurry" ] = loadfx( "maps/zombie_buried/fx_buried_dust_flurry" );
|
||||||
|
level._effect[ "fx_buried_dust_int_25x50" ] = loadfx( "maps/zombie_buried/fx_buried_dust_int_25x50" );
|
||||||
|
level._effect[ "fx_buried_dust_motes_xlg" ] = loadfx( "maps/zombie_buried/fx_buried_dust_motes_xlg" );
|
||||||
|
level._effect[ "fx_buried_dust_motes_ext_xlg" ] = loadfx( "maps/zombie_buried/fx_buried_dust_motes_ext_xlg" );
|
||||||
|
level._effect[ "fx_buried_dust_motes_ext_sm" ] = loadfx( "maps/zombie_buried/fx_buried_dust_motes_ext_sm" );
|
||||||
|
level._effect[ "fx_buried_dust_rising_sm" ] = loadfx( "maps/zombie_buried/fx_buried_dust_rising_sm" );
|
||||||
|
level._effect[ "fx_buried_dust_rising_md" ] = loadfx( "maps/zombie_buried/fx_buried_dust_rising_md" );
|
||||||
|
level._effect[ "fx_buried_dust_tunnel_ceiling" ] = loadfx( "maps/zombie_buried/fx_buried_dust_tunnel_ceiling" );
|
||||||
|
level._effect[ "fx_buried_fireplace" ] = loadfx( "maps/zombie_buried/fx_buried_fireplace" );
|
||||||
|
level._effect[ "fx_buried_fog_sm" ] = loadfx( "maps/zombie_buried/fx_buried_fog_sm" );
|
||||||
|
level._effect[ "fx_buried_fog_md" ] = loadfx( "maps/zombie_buried/fx_buried_fog_md" );
|
||||||
|
level._effect[ "fx_buried_glow_kerosene_lamp" ] = loadfx( "maps/zombie_buried/fx_buried_glow_kerosene_lamp" );
|
||||||
|
level._effect[ "fx_buried_glow_sconce" ] = loadfx( "maps/zombie_buried/fx_buried_glow_sconce" );
|
||||||
|
level._effect[ "fx_buried_god_ray_sm" ] = loadfx( "maps/zombie_buried/fx_buried_god_ray_sm" );
|
||||||
|
level._effect[ "fx_buried_godray_church" ] = loadfx( "maps/zombie_buried/fx_buried_godray_church" );
|
||||||
|
level._effect[ "fx_buried_godray_ext_sm" ] = loadfx( "maps/zombie_buried/fx_buried_godray_ext_sm" );
|
||||||
|
level._effect[ "fx_buried_godray_ext_md" ] = loadfx( "maps/zombie_buried/fx_buried_godray_ext_md" );
|
||||||
|
level._effect[ "fx_buried_godray_ext_lg" ] = loadfx( "maps/zombie_buried/fx_buried_godray_ext_lg" );
|
||||||
|
level._effect[ "fx_buried_godray_ext_thin" ] = loadfx( "maps/zombie_buried/fx_buried_godray_ext_thin" );
|
||||||
|
level._effect[ "fx_buried_insects" ] = loadfx( "maps/zombie_buried/fx_buried_insects" );
|
||||||
|
level._effect[ "fx_buried_sand_windy_sm" ] = loadfx( "maps/zombie_buried/fx_buried_sand_windy_sm" );
|
||||||
|
level._effect[ "fx_buried_sand_windy_md" ] = loadfx( "maps/zombie_buried/fx_buried_sand_windy_md" );
|
||||||
|
level._effect[ "fx_buried_sandstorm_edge" ] = loadfx( "maps/zombie_buried/fx_buried_sandstorm_edge" );
|
||||||
|
level._effect[ "fx_buried_sandstorm_distant" ] = loadfx( "maps/zombie_buried/fx_buried_sandstorm_distant" );
|
||||||
|
level._effect[ "fx_buried_smk_plume_lg" ] = loadfx( "maps/zombie_buried/fx_buried_smk_plume_lg" );
|
||||||
|
level._effect[ "fx_buried_steam_md" ] = loadfx( "maps/zombie_buried/fx_buried_steam_md" );
|
||||||
|
level._effect[ "fx_buried_water_dripping" ] = loadfx( "maps/zombie_buried/fx_buried_water_dripping" );
|
||||||
|
level._effect[ "fx_buried_water_spilling" ] = loadfx( "maps/zombie_buried/fx_buried_water_spilling" );
|
||||||
|
level._effect[ "fx_buried_water_spilling_lg" ] = loadfx( "maps/zombie_buried/fx_buried_water_spilling_lg" );
|
||||||
|
level._effect[ "fx_buried_barrier_break" ] = loadfx( "maps/zombie_buried/fx_buried_barrier_break" );
|
||||||
|
level._effect[ "fx_buried_barrier_break_sm" ] = loadfx( "maps/zombie_buried/fx_buried_barrier_break_sm" );
|
||||||
|
level._effect[ "fx_buried_dest_floor_lg" ] = loadfx( "maps/zombie_buried/fx_buried_dest_floor_lg" );
|
||||||
|
level._effect[ "fx_buried_dest_floor_sm" ] = loadfx( "maps/zombie_buried/fx_buried_dest_floor_sm" );
|
||||||
|
level._effect[ "fx_buried_dest_platform_lsat" ] = loadfx( "maps/zombie_buried/fx_buried_dest_platform_lsat" );
|
||||||
|
level._effect[ "fx_buried_fountain_spray" ] = loadfx( "maps/zombie_buried/fx_buried_fountain_spray" );
|
||||||
|
level._effect[ "fx_buried_fountain_swirl" ] = loadfx( "maps/zombie_buried/fx_buried_fountain_swirl" );
|
||||||
|
level._effect[ "fx_buried_meteor_sm_runner" ] = loadfx( "maps/zombie_buried/fx_buried_meteor_sm_runner" );
|
||||||
|
level._effect[ "fx_buried_meteor_lg_runner" ] = loadfx( "maps/zombie_buried/fx_buried_meteor_lg_runner" );
|
||||||
|
}
|
||||||
|
|
||||||
|
precache_fxanim_props()
|
||||||
|
{
|
||||||
|
level.scr_anim[ "fxanim_props" ][ "sheriff_sign" ] = %fxanim_zom_buried_sign_sheriff_anim;
|
||||||
|
level.scr_anim[ "fxanim_props" ][ "balcony_rope" ] = %fxanim_zom_buried_rope_balcony_anim;
|
||||||
|
level.scr_anim[ "fxanim_props" ][ "livingstone_sign" ] = %fxanim_zom_buried_sign_livingstone_anim;
|
||||||
|
level.scr_anim[ "fxanim_props" ][ "livingstone_sign_fast" ] = %fxanim_zom_buried_sign_livingstone_fast_anim;
|
||||||
|
level.scr_anim[ "fxanim_props" ][ "noose_lrg" ] = %fxanim_zom_buried_noose_lrg_anim;
|
||||||
|
level.scr_anim[ "fxanim_props" ][ "noose_med" ] = %fxanim_zom_buried_noose_med_anim;
|
||||||
|
level.scr_anim[ "fxanim_props" ][ "noose_sml" ] = %fxanim_zom_buried_noose_sml_anim;
|
||||||
|
level.scr_anim[ "fxanim_props" ][ "rope_barn" ] = %fxanim_zom_buried_rope_barn_anim;
|
||||||
|
level.scr_anim[ "fxanim_props" ][ "lsat_catwalk" ] = %fxanim_zom_buried_catwalk_anim;
|
||||||
|
level.scr_anim[ "fxanim_props" ][ "sq_orbs" ] = %fxanim_zom_buried_orbs_anim;
|
||||||
|
level.scr_anim[ "fxanim_props" ][ "endgame_machine_open" ] = %o_zombie_end_game_open;
|
||||||
|
level.scr_anim[ "fxanim_props" ][ "endgame_machine_close" ] = %o_zombie_end_game_close;
|
||||||
|
level.scr_anim[ "fxanim_props" ][ "gunsmith_sign" ] = %fxanim_zom_buried_sign_gunsmith_anim;
|
||||||
|
level.scr_anim[ "fxanim_props" ][ "corrugated_panels" ] = %fxanim_zom_buried_corrugated_panels_anim;
|
||||||
|
level.scr_anim[ "fxanim_props" ][ "clock_old" ] = %fxanim_gp_clock_old_anim;
|
||||||
|
level.scr_anim[ "fxanim_props" ][ "chandelier" ] = %fxanim_gp_chandelier_anim;
|
||||||
|
level.scr_anim[ "fxanim_props" ][ "track_board" ] = %fxanim_zom_buried_track_board_anim;
|
||||||
|
level.scr_anim[ "fxanim_props" ][ "wood_plank_hole" ] = %fxanim_zom_buried_wood_plank_hole_anim;
|
||||||
|
level.scr_anim[ "fxanim_props" ][ "wood_plank_bridge" ] = %fxanim_zom_buried_wood_plank_bridge_anim;
|
||||||
|
level.scr_anim[ "fxanim_props" ][ "drop_start" ] = %fxanim_zom_buried_board_drop_start_anim;
|
||||||
|
level.scr_anim[ "fxanim_props" ][ "rock_crusher" ] = %fxanim_zom_buried_rock_crusher_anim;
|
||||||
|
level.scr_anim[ "fxanim_props" ][ "rock_crusher_btm" ] = %fxanim_zom_buried_rock_crusher_btm_anim;
|
||||||
|
level.scr_anim[ "fxanim_props" ][ "piano_old" ] = %fxanim_gp_piano_old_anim;
|
||||||
|
level.scr_anim[ "fxanim_props" ][ "general_store_sign" ] = %fxanim_zom_buried_sign_general_store_anim;
|
||||||
|
level.scr_anim[ "fxanim_props" ][ "tree_vines" ] = %fxanim_zom_buried_tree_vines_anim;
|
||||||
|
level.scr_anim[ "fxanim_props" ][ "ice_cream_sign" ] = %fxanim_zom_buried_sign_ice_cream_anim;
|
||||||
|
level.scr_anim[ "fxanim_props" ][ "conveyor" ] = %fxanim_zom_buried_conveyor_anim;
|
||||||
|
level.scr_anim[ "fxanim_props" ][ "conveyor_lrg" ] = %fxanim_zom_buried_conveyor_lrg_anim;
|
||||||
|
level.scr_anim[ "fxanim_props" ][ "fountain_grave" ] = %fxanim_zom_buried_fountain_grave_anim;
|
||||||
|
level.scr_anim[ "fxanim_props" ][ "fountain_maze" ] = %fxanim_zom_buried_fountain_maze_anim;
|
||||||
|
level.scr_anim[ "fxanim_props" ][ "rocks_church" ] = %fxanim_zom_buried_falling_rocks_church_anim;
|
||||||
|
level.scr_anim[ "fxanim_props" ][ "rocks_graveyard" ] = %fxanim_zom_buried_falling_rocks_graveyard_anim;
|
||||||
|
level.scr_anim[ "fxanim_props" ][ "rocks_mansion" ] = %fxanim_zom_buried_falling_rocks_mansion_anim;
|
||||||
|
level.maze_switch_anim[ "switch_up" ] = %o_zombie_maze_switch_up;
|
||||||
|
level.maze_switch_anim[ "switch_down" ] = %o_zombie_maze_switch_down;
|
||||||
|
level.maze_switch_anim[ "switch_neutral" ] = %o_zombie_maze_switch_neutral;
|
||||||
|
level.scr_anim[ "fxanim_props" ][ "bank_sign" ] = %fxanim_zom_buried_sign_bank_anim;
|
||||||
|
scriptmodelsuseanimtree( -1 );
|
||||||
|
}
|
284
zm_buried_patch/maps/mp/zm_buried_gamemodes.gsc
Normal file
284
zm_buried_patch/maps/mp/zm_buried_gamemodes.gsc
Normal file
@ -0,0 +1,284 @@
|
|||||||
|
#include maps/mp/zombies/_zm_unitrigger;
|
||||||
|
#include maps/mp/zombies/_zm_weapons;
|
||||||
|
#include maps/mp/zombies/_zm_zonemgr;
|
||||||
|
#include maps/mp/zm_buried;
|
||||||
|
#include maps/mp/gametypes_zm/_zm_gametype;
|
||||||
|
#include maps/mp/zombies/_zm_game_module;
|
||||||
|
#include maps/mp/zombies/_zm_utility;
|
||||||
|
#include maps/mp/_utility;
|
||||||
|
#include common_scripts/utility;
|
||||||
|
|
||||||
|
init()
|
||||||
|
{
|
||||||
|
add_map_gamemode( "zclassic", ::maps/mp/zm_buried::zclassic_preinit, undefined, undefined );
|
||||||
|
add_map_gamemode( "zcleansed", ::maps/mp/zm_buried::zcleansed_preinit, undefined, undefined );
|
||||||
|
add_map_gamemode( "zgrief", ::maps/mp/zm_buried::zgrief_preinit, undefined, undefined );
|
||||||
|
add_map_location_gamemode( "zclassic", "processing", ::maps/mp/zm_buried_classic::precache, ::maps/mp/zm_buried_classic::main );
|
||||||
|
add_map_location_gamemode( "zcleansed", "street", ::maps/mp/zm_buried_turned_street::precache, ::maps/mp/zm_buried_turned_street::main );
|
||||||
|
add_map_location_gamemode( "zgrief", "street", ::maps/mp/zm_buried_grief_street::precache, ::maps/mp/zm_buried_grief_street::main );
|
||||||
|
}
|
||||||
|
|
||||||
|
deletechalktriggers()
|
||||||
|
{
|
||||||
|
chalk_triggers = getentarray( "chalk_buildable_trigger", "targetname" );
|
||||||
|
array_thread( chalk_triggers, ::self_delete );
|
||||||
|
}
|
||||||
|
|
||||||
|
deletebuyabledoors()
|
||||||
|
{
|
||||||
|
doors_trigs = getentarray( "zombie_door", "targetname" );
|
||||||
|
_a41 = doors_trigs;
|
||||||
|
_k41 = getFirstArrayKey( _a41 );
|
||||||
|
while ( isDefined( _k41 ) )
|
||||||
|
{
|
||||||
|
door = _a41[ _k41 ];
|
||||||
|
doors = getentarray( door.target, "targetname" );
|
||||||
|
array_thread( doors, ::self_delete );
|
||||||
|
_k41 = getNextArrayKey( _a41, _k41 );
|
||||||
|
}
|
||||||
|
array_thread( doors_trigs, ::self_delete );
|
||||||
|
}
|
||||||
|
|
||||||
|
deletebuyabledebris( justtriggers )
|
||||||
|
{
|
||||||
|
debris_trigs = getentarray( "zombie_debris", "targetname" );
|
||||||
|
while ( !is_true( justtriggers ) )
|
||||||
|
{
|
||||||
|
_a56 = debris_trigs;
|
||||||
|
_k56 = getFirstArrayKey( _a56 );
|
||||||
|
while ( isDefined( _k56 ) )
|
||||||
|
{
|
||||||
|
trig = _a56[ _k56 ];
|
||||||
|
if ( isDefined( trig.script_flag ) )
|
||||||
|
{
|
||||||
|
flag_set( trig.script_flag );
|
||||||
|
}
|
||||||
|
parts = getentarray( trig.target, "targetname" );
|
||||||
|
array_thread( parts, ::self_delete );
|
||||||
|
_k56 = getNextArrayKey( _a56, _k56 );
|
||||||
|
}
|
||||||
|
}
|
||||||
|
array_thread( debris_trigs, ::self_delete );
|
||||||
|
}
|
||||||
|
|
||||||
|
deleteslothbarricades( justtriggers )
|
||||||
|
{
|
||||||
|
sloth_trigs = getentarray( "sloth_barricade", "targetname" );
|
||||||
|
while ( !is_true( justtriggers ) )
|
||||||
|
{
|
||||||
|
_a77 = sloth_trigs;
|
||||||
|
_k77 = getFirstArrayKey( _a77 );
|
||||||
|
while ( isDefined( _k77 ) )
|
||||||
|
{
|
||||||
|
trig = _a77[ _k77 ];
|
||||||
|
if ( isDefined( trig.script_flag ) && level flag_exists( trig.script_flag ) )
|
||||||
|
{
|
||||||
|
flag_set( trig.script_flag );
|
||||||
|
}
|
||||||
|
parts = getentarray( trig.target, "targetname" );
|
||||||
|
array_thread( parts, ::self_delete );
|
||||||
|
_k77 = getNextArrayKey( _a77, _k77 );
|
||||||
|
}
|
||||||
|
}
|
||||||
|
array_thread( sloth_trigs, ::self_delete );
|
||||||
|
}
|
||||||
|
|
||||||
|
deleteslothbarricade( location )
|
||||||
|
{
|
||||||
|
sloth_trigs = getentarray( "sloth_barricade", "targetname" );
|
||||||
|
_a96 = sloth_trigs;
|
||||||
|
_k96 = getFirstArrayKey( _a96 );
|
||||||
|
while ( isDefined( _k96 ) )
|
||||||
|
{
|
||||||
|
trig = _a96[ _k96 ];
|
||||||
|
if ( isDefined( trig.script_location ) && trig.script_location == location )
|
||||||
|
{
|
||||||
|
if ( isDefined( trig.script_flag ) )
|
||||||
|
{
|
||||||
|
flag_set( trig.script_flag );
|
||||||
|
}
|
||||||
|
parts = getentarray( trig.target, "targetname" );
|
||||||
|
array_thread( parts, ::self_delete );
|
||||||
|
}
|
||||||
|
_k96 = getNextArrayKey( _a96, _k96 );
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
spawnmapcollision( collision_model, origin )
|
||||||
|
{
|
||||||
|
if ( !isDefined( origin ) )
|
||||||
|
{
|
||||||
|
origin = ( 0, 0, 0 );
|
||||||
|
}
|
||||||
|
collision = spawn( "script_model", origin, 1 );
|
||||||
|
collision setmodel( collision_model );
|
||||||
|
collision disconnectpaths();
|
||||||
|
}
|
||||||
|
|
||||||
|
turnperkon( perk )
|
||||||
|
{
|
||||||
|
level notify( perk + "_on" );
|
||||||
|
wait_network_frame();
|
||||||
|
}
|
||||||
|
|
||||||
|
disableallzonesexcept( zones )
|
||||||
|
{
|
||||||
|
_a133 = zones;
|
||||||
|
_k133 = getFirstArrayKey( _a133 );
|
||||||
|
while ( isDefined( _k133 ) )
|
||||||
|
{
|
||||||
|
zone = _a133[ _k133 ];
|
||||||
|
level thread maps/mp/zombies/_zm_zonemgr::enable_zone( zone );
|
||||||
|
_k133 = getNextArrayKey( _a133, _k133 );
|
||||||
|
}
|
||||||
|
_a140 = level.zones;
|
||||||
|
zoneindex = getFirstArrayKey( _a140 );
|
||||||
|
while ( isDefined( zoneindex ) )
|
||||||
|
{
|
||||||
|
zone = _a140[ zoneindex ];
|
||||||
|
should_disable = 1;
|
||||||
|
_a144 = zones;
|
||||||
|
_k144 = getFirstArrayKey( _a144 );
|
||||||
|
while ( isDefined( _k144 ) )
|
||||||
|
{
|
||||||
|
cleared_zone = _a144[ _k144 ];
|
||||||
|
if ( zoneindex == cleared_zone )
|
||||||
|
{
|
||||||
|
should_disable = 0;
|
||||||
|
}
|
||||||
|
_k144 = getNextArrayKey( _a144, _k144 );
|
||||||
|
}
|
||||||
|
if ( is_true( should_disable ) )
|
||||||
|
{
|
||||||
|
zone.is_enabled = 0;
|
||||||
|
zone.is_spawning_allowed = 0;
|
||||||
|
}
|
||||||
|
zoneindex = getNextArrayKey( _a140, zoneindex );
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
remove_adjacent_zone( main_zone, adjacent_zone )
|
||||||
|
{
|
||||||
|
if ( isDefined( level.zones[ main_zone ].adjacent_zones ) && isDefined( level.zones[ main_zone ].adjacent_zones[ adjacent_zone ] ) )
|
||||||
|
{
|
||||||
|
}
|
||||||
|
if ( isDefined( level.zones[ adjacent_zone ].adjacent_zones ) && isDefined( level.zones[ adjacent_zone ].adjacent_zones[ main_zone ] ) )
|
||||||
|
{
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
builddynamicwallbuy( location, weaponname )
|
||||||
|
{
|
||||||
|
match_string = ( level.scr_zm_ui_gametype + "_" ) + level.scr_zm_map_start_location;
|
||||||
|
_a177 = level.chalk_builds;
|
||||||
|
_k177 = getFirstArrayKey( _a177 );
|
||||||
|
while ( isDefined( _k177 ) )
|
||||||
|
{
|
||||||
|
stub = _a177[ _k177 ];
|
||||||
|
wallbuy = getstruct( stub.target, "targetname" );
|
||||||
|
if ( isDefined( wallbuy.script_location ) && wallbuy.script_location == location )
|
||||||
|
{
|
||||||
|
if ( !isDefined( wallbuy.script_noteworthy ) || issubstr( wallbuy.script_noteworthy, match_string ) )
|
||||||
|
{
|
||||||
|
maps/mp/zombies/_zm_weapons::add_dynamic_wallbuy( weaponname, wallbuy.targetname, 1 );
|
||||||
|
thread wait_and_remove( stub, stub.buildablezone.pieces[ 0 ] );
|
||||||
|
}
|
||||||
|
}
|
||||||
|
_k177 = getNextArrayKey( _a177, _k177 );
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
buildbuildable( buildable )
|
||||||
|
{
|
||||||
|
player = get_players()[ 0 ];
|
||||||
|
_a197 = level.buildable_stubs;
|
||||||
|
_k197 = getFirstArrayKey( _a197 );
|
||||||
|
while ( isDefined( _k197 ) )
|
||||||
|
{
|
||||||
|
stub = _a197[ _k197 ];
|
||||||
|
if ( !isDefined( buildable ) || stub.equipname == buildable )
|
||||||
|
{
|
||||||
|
if ( isDefined( buildable ) || stub.persistent != 3 )
|
||||||
|
{
|
||||||
|
stub maps/mp/zombies/_zm_buildables::buildablestub_finish_build( player );
|
||||||
|
stub maps/mp/zombies/_zm_buildables::buildablestub_remove();
|
||||||
|
_a206 = stub.buildablezone.pieces;
|
||||||
|
_k206 = getFirstArrayKey( _a206 );
|
||||||
|
while ( isDefined( _k206 ) )
|
||||||
|
{
|
||||||
|
piece = _a206[ _k206 ];
|
||||||
|
piece maps/mp/zombies/_zm_buildables::piece_unspawn();
|
||||||
|
_k206 = getNextArrayKey( _a206, _k206 );
|
||||||
|
}
|
||||||
|
stub.model notsolid();
|
||||||
|
stub.model show();
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
_k197 = getNextArrayKey( _a197, _k197 );
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
wait_and_remove( stub, piece )
|
||||||
|
{
|
||||||
|
wait 0,1;
|
||||||
|
self buildablestub_remove();
|
||||||
|
thread maps/mp/zombies/_zm_unitrigger::unregister_unitrigger( stub );
|
||||||
|
piece piece_unspawn();
|
||||||
|
}
|
||||||
|
|
||||||
|
generatebuildabletarps()
|
||||||
|
{
|
||||||
|
struct_locations = getstructarray( "buildables_tarp", "targetname" );
|
||||||
|
level.buildable_tarps = [];
|
||||||
|
_a234 = struct_locations;
|
||||||
|
_k234 = getFirstArrayKey( _a234 );
|
||||||
|
while ( isDefined( _k234 ) )
|
||||||
|
{
|
||||||
|
struct = _a234[ _k234 ];
|
||||||
|
tarp = spawn( "script_model", struct.origin );
|
||||||
|
tarp.angles = struct.angles;
|
||||||
|
tarp setmodel( "p6_zm_bu_buildable_bench_tarp" );
|
||||||
|
tarp.targetname = "buildable_tarp";
|
||||||
|
if ( isDefined( struct.script_location ) )
|
||||||
|
{
|
||||||
|
tarp.script_location = struct.script_location;
|
||||||
|
}
|
||||||
|
level.buildable_tarps[ level.buildable_tarps.size ] = tarp;
|
||||||
|
_k234 = getNextArrayKey( _a234, _k234 );
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
deletebuildabletarp( location )
|
||||||
|
{
|
||||||
|
_a252 = level.buildable_tarps;
|
||||||
|
_k252 = getFirstArrayKey( _a252 );
|
||||||
|
while ( isDefined( _k252 ) )
|
||||||
|
{
|
||||||
|
tarp = _a252[ _k252 ];
|
||||||
|
if ( isDefined( tarp.script_location ) && tarp.script_location == location )
|
||||||
|
{
|
||||||
|
tarp delete();
|
||||||
|
}
|
||||||
|
_k252 = getNextArrayKey( _a252, _k252 );
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
powerswitchstate( on )
|
||||||
|
{
|
||||||
|
trigger = getent( "use_elec_switch", "targetname" );
|
||||||
|
if ( isDefined( trigger ) )
|
||||||
|
{
|
||||||
|
trigger delete();
|
||||||
|
}
|
||||||
|
master_switch = getent( "elec_switch", "targetname" );
|
||||||
|
if ( isDefined( master_switch ) )
|
||||||
|
{
|
||||||
|
master_switch notsolid();
|
||||||
|
if ( is_true( on ) )
|
||||||
|
{
|
||||||
|
master_switch rotateroll( -90, 0,3 );
|
||||||
|
flag_set( "power_on" );
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
105
zm_buried_patch/maps/mp/zm_buried_grief_street.gsc
Normal file
105
zm_buried_patch/maps/mp/zm_buried_grief_street.gsc
Normal file
@ -0,0 +1,105 @@
|
|||||||
|
#include maps/mp/gametypes_zm/_zm_gametype;
|
||||||
|
#include maps/mp/zombies/_zm_buildables;
|
||||||
|
#include maps/mp/zombies/_zm_magicbox;
|
||||||
|
#include maps/mp/zm_buried_buildables;
|
||||||
|
#include maps/mp/zm_buried_gamemodes;
|
||||||
|
#include maps/mp/zombies/_zm_race_utility;
|
||||||
|
#include maps/mp/zombies/_zm_utility;
|
||||||
|
#include common_scripts/utility;
|
||||||
|
#include maps/mp/_utility;
|
||||||
|
|
||||||
|
precache()
|
||||||
|
{
|
||||||
|
precachemodel( "zm_collision_buried_street_grief" );
|
||||||
|
precachemodel( "p6_zm_bu_buildable_bench_tarp" );
|
||||||
|
level.chalk_buildable_pieces_hide = 1;
|
||||||
|
griefbuildables = array( "chalk", "turbine", "springpad_zm", "subwoofer_zm" );
|
||||||
|
maps/mp/zm_buried_buildables::include_buildables( griefbuildables );
|
||||||
|
maps/mp/zm_buried_buildables::init_buildables( griefbuildables );
|
||||||
|
maps/mp/zombies/_zm_equip_turbine::init();
|
||||||
|
maps/mp/zombies/_zm_equip_turbine::init_animtree();
|
||||||
|
maps/mp/zombies/_zm_equip_springpad::init( &"ZM_BURIED_EQ_SP_PHS", &"ZM_BURIED_EQ_SP_HTS" );
|
||||||
|
maps/mp/zombies/_zm_equip_subwoofer::init( &"ZM_BURIED_EQ_SW_PHS", &"ZM_BURIED_EQ_SW_HTS" );
|
||||||
|
}
|
||||||
|
|
||||||
|
street_treasure_chest_init()
|
||||||
|
{
|
||||||
|
start_chest = getstruct( "start_chest", "script_noteworthy" );
|
||||||
|
court_chest = getstruct( "courtroom_chest1", "script_noteworthy" );
|
||||||
|
tunnel_chest = getstruct( "tunnels_chest1", "script_noteworthy" );
|
||||||
|
jail_chest = getstruct( "jail_chest1", "script_noteworthy" );
|
||||||
|
gun_chest = getstruct( "gunshop_chest", "script_noteworthy" );
|
||||||
|
setdvar( "disableLookAtEntityLogic", 1 );
|
||||||
|
level.chests = [];
|
||||||
|
level.chests[ level.chests.size ] = start_chest;
|
||||||
|
level.chests[ level.chests.size ] = court_chest;
|
||||||
|
level.chests[ level.chests.size ] = tunnel_chest;
|
||||||
|
level.chests[ level.chests.size ] = jail_chest;
|
||||||
|
level.chests[ level.chests.size ] = gun_chest;
|
||||||
|
maps/mp/zombies/_zm_magicbox::treasure_chest_init( "start_chest" );
|
||||||
|
}
|
||||||
|
|
||||||
|
main()
|
||||||
|
{
|
||||||
|
level.buildables_built[ "pap" ] = 1;
|
||||||
|
level.equipment_team_pick_up = 1;
|
||||||
|
level thread maps/mp/zombies/_zm_buildables::think_buildables();
|
||||||
|
maps/mp/gametypes_zm/_zm_gametype::setup_standard_objects( "street" );
|
||||||
|
street_treasure_chest_init();
|
||||||
|
generatebuildabletarps();
|
||||||
|
deletebuildabletarp( "courthouse" );
|
||||||
|
deletebuildabletarp( "bar" );
|
||||||
|
deletebuildabletarp( "generalstore" );
|
||||||
|
deleteslothbarricades();
|
||||||
|
powerswitchstate( 1 );
|
||||||
|
level.enemy_location_override_func = ::enemy_location_override;
|
||||||
|
spawnmapcollision( "zm_collision_buried_street_grief" );
|
||||||
|
flag_wait( "initial_blackscreen_passed" );
|
||||||
|
flag_wait( "start_zombie_round_logic" );
|
||||||
|
wait 1;
|
||||||
|
builddynamicwallbuys();
|
||||||
|
buildbuildables();
|
||||||
|
turnperkon( "revive" );
|
||||||
|
turnperkon( "doubletap" );
|
||||||
|
turnperkon( "marathon" );
|
||||||
|
turnperkon( "juggernog" );
|
||||||
|
turnperkon( "sleight" );
|
||||||
|
turnperkon( "additionalprimaryweapon" );
|
||||||
|
turnperkon( "Pack_A_Punch" );
|
||||||
|
}
|
||||||
|
|
||||||
|
enemy_location_override( zombie, enemy )
|
||||||
|
{
|
||||||
|
location = enemy.origin;
|
||||||
|
if ( isDefined( self.reroute ) && self.reroute )
|
||||||
|
{
|
||||||
|
if ( isDefined( self.reroute_origin ) )
|
||||||
|
{
|
||||||
|
location = self.reroute_origin;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return location;
|
||||||
|
}
|
||||||
|
|
||||||
|
builddynamicwallbuys()
|
||||||
|
{
|
||||||
|
builddynamicwallbuy( "bank", "beretta93r_zm" );
|
||||||
|
builddynamicwallbuy( "bar", "pdw57_zm" );
|
||||||
|
builddynamicwallbuy( "church", "ak74u_zm" );
|
||||||
|
builddynamicwallbuy( "courthouse", "mp5k_zm" );
|
||||||
|
builddynamicwallbuy( "generalstore", "m16_zm" );
|
||||||
|
builddynamicwallbuy( "mansion", "an94_zm" );
|
||||||
|
builddynamicwallbuy( "morgue", "svu_zm" );
|
||||||
|
builddynamicwallbuy( "prison", "claymore_zm" );
|
||||||
|
builddynamicwallbuy( "stables", "bowie_knife_zm" );
|
||||||
|
builddynamicwallbuy( "stablesroof", "frag_grenade_zm" );
|
||||||
|
builddynamicwallbuy( "toystore", "tazer_knuckles_zm" );
|
||||||
|
builddynamicwallbuy( "candyshop", "870mcs_zm" );
|
||||||
|
}
|
||||||
|
|
||||||
|
buildbuildables()
|
||||||
|
{
|
||||||
|
buildbuildable( "springpad_zm" );
|
||||||
|
buildbuildable( "subwoofer_zm" );
|
||||||
|
buildbuildable( "turbine" );
|
||||||
|
}
|
62
zm_buried_patch/maps/mp/zm_buried_jail.gsc
Normal file
62
zm_buried_patch/maps/mp/zm_buried_jail.gsc
Normal file
@ -0,0 +1,62 @@
|
|||||||
|
#include maps/mp/zombies/_zm_utility;
|
||||||
|
#include common_scripts/utility;
|
||||||
|
#include maps/mp/_utility;
|
||||||
|
|
||||||
|
#using_animtree( "zm_buried_props" );
|
||||||
|
|
||||||
|
init_jail_animtree()
|
||||||
|
{
|
||||||
|
scriptmodelsuseanimtree( -1 );
|
||||||
|
}
|
||||||
|
|
||||||
|
init_jail_anims()
|
||||||
|
{
|
||||||
|
level.jail_open = %o_zombie_sloth_idle_jail_2_cower_door;
|
||||||
|
level.jail_open_jumpback = %o_zombie_sloth_idle_jail_2_cower_jumpback_door;
|
||||||
|
level.jail_close_idle = %o_zombie_sloth_run_into_jail_2_idle_jail;
|
||||||
|
level.jail_close_cower = %o_zombie_sloth_cower_2_close_door;
|
||||||
|
}
|
||||||
|
|
||||||
|
jailuseanimtree()
|
||||||
|
{
|
||||||
|
self useanimtree( -1 );
|
||||||
|
}
|
||||||
|
|
||||||
|
init_jail()
|
||||||
|
{
|
||||||
|
init_jail_anims();
|
||||||
|
level.cell_door = getent( "sloth_cell_door", "targetname" );
|
||||||
|
level.cell_door.clip = getent( level.cell_door.target, "targetname" );
|
||||||
|
level.cell_door jailuseanimtree();
|
||||||
|
level.jail_open_door = ::jail_open_door;
|
||||||
|
level.jail_close_door = ::jail_close_door;
|
||||||
|
}
|
||||||
|
|
||||||
|
jail_open_door( jumpback )
|
||||||
|
{
|
||||||
|
level.cell_door playsound( "zmb_jail_door_open" );
|
||||||
|
if ( is_true( jumpback ) )
|
||||||
|
{
|
||||||
|
level.cell_door setanim( level.jail_open_jumpback, 1, 1, 1 );
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
level.cell_door setanim( level.jail_open, 1, 1, 1 );
|
||||||
|
}
|
||||||
|
if ( isDefined( level.cell_door.clip ) )
|
||||||
|
{
|
||||||
|
level.cell_door.clip notsolid();
|
||||||
|
level.cell_door.clip connectpaths();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
jail_close_door()
|
||||||
|
{
|
||||||
|
level.cell_door playsound( "zmb_jail_door_close" );
|
||||||
|
level.cell_door setanim( level.jail_close_cower, 1, 1, 1 );
|
||||||
|
if ( isDefined( level.cell_door.clip ) )
|
||||||
|
{
|
||||||
|
level.cell_door.clip solid();
|
||||||
|
level.cell_door.clip disconnectpaths();
|
||||||
|
}
|
||||||
|
}
|
578
zm_buried_patch/maps/mp/zm_buried_maze.gsc
Normal file
578
zm_buried_patch/maps/mp/zm_buried_maze.gsc
Normal file
@ -0,0 +1,578 @@
|
|||||||
|
#include maps/mp/zombies/_zm_audio;
|
||||||
|
#include maps/mp/zombies/_zm_weap_time_bomb;
|
||||||
|
#include maps/mp/zombies/_zm_spawner;
|
||||||
|
#include maps/mp/zombies/_zm_zonemgr;
|
||||||
|
#include maps/mp/zombies/_zm_equip_headchopper;
|
||||||
|
#include maps/mp/zombies/_zm_net;
|
||||||
|
#include maps/mp/zombies/_zm_utility;
|
||||||
|
#include maps/mp/_utility;
|
||||||
|
#include common_scripts/utility;
|
||||||
|
|
||||||
|
maze_precache()
|
||||||
|
{
|
||||||
|
blocker_locations = getstructarray( "maze_blocker", "targetname" );
|
||||||
|
model_list = [];
|
||||||
|
i = 0;
|
||||||
|
while ( i < blocker_locations.size )
|
||||||
|
{
|
||||||
|
model_list[ blocker_locations[ i ].model ] = 1;
|
||||||
|
i++;
|
||||||
|
}
|
||||||
|
model_names = getarraykeys( model_list );
|
||||||
|
i = 0;
|
||||||
|
while ( i < model_names.size )
|
||||||
|
{
|
||||||
|
precachemodel( model_names[ i ] );
|
||||||
|
i++;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
maze_nodes_link_unlink_internal( func_ptr, bignorechangeonmigrate )
|
||||||
|
{
|
||||||
|
i = 0;
|
||||||
|
while ( i < self.blocked_nodes.size )
|
||||||
|
{
|
||||||
|
j = 0;
|
||||||
|
while ( j < self.blocked_nodes[ i ].connected_nodes.size )
|
||||||
|
{
|
||||||
|
[[ func_ptr ]]( self.blocked_nodes[ i ], self.blocked_nodes[ i ].connected_nodes[ j ], bignorechangeonmigrate );
|
||||||
|
[[ func_ptr ]]( self.blocked_nodes[ i ].connected_nodes[ j ], self.blocked_nodes[ i ], bignorechangeonmigrate );
|
||||||
|
j++;
|
||||||
|
}
|
||||||
|
i++;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
link_nodes_for_blocker_location()
|
||||||
|
{
|
||||||
|
self maze_nodes_link_unlink_internal( ::maps/mp/zombies/_zm_utility::link_nodes, 1 );
|
||||||
|
}
|
||||||
|
|
||||||
|
unlink_nodes_for_blocker_location()
|
||||||
|
{
|
||||||
|
self maze_nodes_link_unlink_internal( ::maps/mp/zombies/_zm_utility::unlink_nodes, 0 );
|
||||||
|
}
|
||||||
|
|
||||||
|
init_maze_clientfields()
|
||||||
|
{
|
||||||
|
blocker_locations = getstructarray( "maze_blocker", "targetname" );
|
||||||
|
_a77 = blocker_locations;
|
||||||
|
_k77 = getFirstArrayKey( _a77 );
|
||||||
|
while ( isDefined( _k77 ) )
|
||||||
|
{
|
||||||
|
blocker = _a77[ _k77 ];
|
||||||
|
registerclientfield( "world", "maze_blocker_" + blocker.script_noteworthy, 12000, 1, "int" );
|
||||||
|
_k77 = getNextArrayKey( _a77, _k77 );
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
init_maze_permutations()
|
||||||
|
{
|
||||||
|
blocker_locations = getstructarray( "maze_blocker", "targetname" );
|
||||||
|
level._maze._blocker_locations = [];
|
||||||
|
i = 0;
|
||||||
|
while ( i < blocker_locations.size )
|
||||||
|
{
|
||||||
|
if ( isDefined( blocker_locations[ i ].target ) )
|
||||||
|
{
|
||||||
|
blocker_locations[ i ].blocked_nodes = getnodearray( blocker_locations[ i ].target, "targetname" );
|
||||||
|
j = 0;
|
||||||
|
while ( j < blocker_locations[ i ].blocked_nodes.size )
|
||||||
|
{
|
||||||
|
blocker_locations[ i ].blocked_nodes[ j ].connected_nodes = getnodearray( blocker_locations[ i ].blocked_nodes[ j ].target, "targetname" );
|
||||||
|
j++;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else blocker_locations[ i ].blocked_nodes = [];
|
||||||
|
level._maze._blocker_locations[ blocker_locations[ i ].script_noteworthy ] = blocker_locations[ i ];
|
||||||
|
i++;
|
||||||
|
}
|
||||||
|
level._maze._perms = array( array( "blocker_1", "blocker_2", "blocker_3", "blocker_4" ), array( "blocker_5", "blocker_6", "blocker_7", "blocker_8", "blocker_9" ), array( "blocker_1", "blocker_10", "blocker_6", "blocker_4", "blocker_11" ), array( "blocker_1", "blocker_3", "blocker_4", "blocker_12" ), array( "blocker_5", "blocker_6", "blocker_12", "blocker_13" ), array( "blocker_4", "blocker_6", "blocker_14" ) );
|
||||||
|
randomize_maze_perms();
|
||||||
|
level._maze._active_perm_list = [];
|
||||||
|
}
|
||||||
|
|
||||||
|
init_maze_blocker_pool()
|
||||||
|
{
|
||||||
|
pool_size = 0;
|
||||||
|
i = 0;
|
||||||
|
while ( i < level._maze._perms.size )
|
||||||
|
{
|
||||||
|
if ( level._maze._perms[ i ].size > pool_size )
|
||||||
|
{
|
||||||
|
pool_size = level._maze._perms[ i ].size;
|
||||||
|
}
|
||||||
|
i++;
|
||||||
|
}
|
||||||
|
level._maze._blocker_pool = [];
|
||||||
|
i = 0;
|
||||||
|
while ( i < pool_size )
|
||||||
|
{
|
||||||
|
ent = spawn( "script_model", level._maze.players_in_maze_volume.origin - vectorScale( ( 0, 0, 0 ), 300 ) );
|
||||||
|
ent ghost();
|
||||||
|
ent.in_use = 0;
|
||||||
|
level._maze._blocker_pool[ i ] = ent;
|
||||||
|
i++;
|
||||||
|
}
|
||||||
|
level._maze._blocker_pool_num_free = pool_size;
|
||||||
|
}
|
||||||
|
|
||||||
|
free_blockers_available()
|
||||||
|
{
|
||||||
|
return level._maze._blocker_pool_num_free > 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
get_free_blocker_model_from_pool()
|
||||||
|
{
|
||||||
|
i = 0;
|
||||||
|
while ( i < level._maze._blocker_pool.size )
|
||||||
|
{
|
||||||
|
if ( !level._maze._blocker_pool[ i ].in_use )
|
||||||
|
{
|
||||||
|
level._maze._blocker_pool[ i ].in_use = 1;
|
||||||
|
level._maze._blocker_pool_num_free--;
|
||||||
|
|
||||||
|
return level._maze._blocker_pool[ i ];
|
||||||
|
}
|
||||||
|
i++;
|
||||||
|
}
|
||||||
|
/#
|
||||||
|
assertmsg( "zm_buried_maze : Blocker pool is empty." );
|
||||||
|
#/
|
||||||
|
return undefined;
|
||||||
|
}
|
||||||
|
|
||||||
|
return_blocker_model_to_pool( ent )
|
||||||
|
{
|
||||||
|
ent ghost();
|
||||||
|
ent.origin = level._maze.players_in_maze_volume.origin - vectorScale( ( 0, 0, 0 ), 300 );
|
||||||
|
ent dontinterpolate();
|
||||||
|
ent.in_use = 0;
|
||||||
|
level._maze._blocker_pool_num_free++;
|
||||||
|
}
|
||||||
|
|
||||||
|
randomize_maze_perms()
|
||||||
|
{
|
||||||
|
level._maze._perms = array_randomize( level._maze._perms );
|
||||||
|
level._maze._cur_perm = 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
init()
|
||||||
|
{
|
||||||
|
level._maze = spawnstruct();
|
||||||
|
level._maze.players_in_maze_volume = getent( "maze_player_volume", "targetname" );
|
||||||
|
level._maze.players_can_see_maze_volume = getent( "maze_player_can_see_volume", "targetname" );
|
||||||
|
init_maze_clientfields();
|
||||||
|
init_maze_permutations();
|
||||||
|
init_maze_blocker_pool();
|
||||||
|
init_hedge_maze_spawnpoints();
|
||||||
|
register_custom_spawner_entry( "hedge_location", ::maze_do_zombie_spawn );
|
||||||
|
level thread maze_achievement_watcher();
|
||||||
|
level thread vo_in_maze();
|
||||||
|
}
|
||||||
|
|
||||||
|
maze_blocker_sinks_thread( blocker )
|
||||||
|
{
|
||||||
|
self waittill( "lower_" + self.script_noteworthy );
|
||||||
|
if ( flag( "start_zombie_round_logic" ) )
|
||||||
|
{
|
||||||
|
level setclientfield( "maze_blocker_" + self.script_noteworthy, 1 );
|
||||||
|
}
|
||||||
|
blocker maps/mp/zombies/_zm_equip_headchopper::destroyheadchopperstouching();
|
||||||
|
blocker moveto( self.origin - vectorScale( ( 0, 0, 0 ), 96 ), 1 );
|
||||||
|
blocker waittill( "movedone" );
|
||||||
|
if ( flag( "start_zombie_round_logic" ) )
|
||||||
|
{
|
||||||
|
level setclientfield( "maze_blocker_" + self.script_noteworthy, 0 );
|
||||||
|
}
|
||||||
|
return_blocker_model_to_pool( blocker );
|
||||||
|
self link_nodes_for_blocker_location();
|
||||||
|
}
|
||||||
|
|
||||||
|
delay_destroy_corpses_near_blocker()
|
||||||
|
{
|
||||||
|
wait 0,2;
|
||||||
|
corpses = getcorpsearray();
|
||||||
|
while ( isDefined( corpses ) )
|
||||||
|
{
|
||||||
|
_a247 = corpses;
|
||||||
|
_k247 = getFirstArrayKey( _a247 );
|
||||||
|
while ( isDefined( _k247 ) )
|
||||||
|
{
|
||||||
|
corpse = _a247[ _k247 ];
|
||||||
|
if ( distancesquared( corpse.origin, self.origin ) < 2304 )
|
||||||
|
{
|
||||||
|
corpse delete();
|
||||||
|
}
|
||||||
|
_k247 = getNextArrayKey( _a247, _k247 );
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
maze_blocker_rises_thread()
|
||||||
|
{
|
||||||
|
blocker = get_free_blocker_model_from_pool();
|
||||||
|
self thread maze_blocker_sinks_thread( blocker );
|
||||||
|
self unlink_nodes_for_blocker_location();
|
||||||
|
blocker.origin = self.origin - vectorScale( ( 0, 0, 0 ), 96 );
|
||||||
|
blocker.angles = self.angles;
|
||||||
|
blocker setmodel( self.model );
|
||||||
|
blocker dontinterpolate();
|
||||||
|
blocker show();
|
||||||
|
wait 0,05;
|
||||||
|
if ( flag( "start_zombie_round_logic" ) )
|
||||||
|
{
|
||||||
|
level setclientfield( "maze_blocker_" + self.script_noteworthy, 1 );
|
||||||
|
}
|
||||||
|
blocker maps/mp/zombies/_zm_equip_headchopper::destroyheadchopperstouching();
|
||||||
|
blocker moveto( self.origin, 0,65 );
|
||||||
|
blocker thread delay_destroy_corpses_near_blocker();
|
||||||
|
blocker waittill( "movedone" );
|
||||||
|
if ( flag( "start_zombie_round_logic" ) )
|
||||||
|
{
|
||||||
|
level setclientfield( "maze_blocker_" + self.script_noteworthy, 0 );
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
maze_do_perm_change()
|
||||||
|
{
|
||||||
|
level._maze._cur_perm++;
|
||||||
|
if ( level._maze._cur_perm == level._maze._perms.size )
|
||||||
|
{
|
||||||
|
randomize_maze_perms();
|
||||||
|
}
|
||||||
|
new_perm_list = level._maze._perms[ level._maze._cur_perm ];
|
||||||
|
blockers_raise_list = [];
|
||||||
|
blockers_lower_list = level._maze._active_perm_list;
|
||||||
|
i = 0;
|
||||||
|
while ( i < new_perm_list.size )
|
||||||
|
{
|
||||||
|
found = 0;
|
||||||
|
j = 0;
|
||||||
|
while ( j < level._maze._active_perm_list.size )
|
||||||
|
{
|
||||||
|
if ( new_perm_list[ i ] == level._maze._active_perm_list[ j ] )
|
||||||
|
{
|
||||||
|
found = 1;
|
||||||
|
blockers_lower_list[ j ] = "";
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
j++;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if ( !found )
|
||||||
|
{
|
||||||
|
blockers_raise_list[ blockers_raise_list.size ] = new_perm_list[ i ];
|
||||||
|
}
|
||||||
|
i++;
|
||||||
|
}
|
||||||
|
level thread raise_new_perm_blockers( blockers_raise_list );
|
||||||
|
level thread lower_old_perm_blockers( blockers_lower_list );
|
||||||
|
level._maze._active_perm_list = level._maze._perms[ level._maze._cur_perm ];
|
||||||
|
}
|
||||||
|
|
||||||
|
raise_new_perm_blockers( list )
|
||||||
|
{
|
||||||
|
i = 0;
|
||||||
|
while ( i < list.size )
|
||||||
|
{
|
||||||
|
while ( !free_blockers_available() )
|
||||||
|
{
|
||||||
|
wait 0,1;
|
||||||
|
}
|
||||||
|
level._maze._blocker_locations[ list[ i ] ] thread maze_blocker_rises_thread();
|
||||||
|
wait 0,25;
|
||||||
|
i++;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
lower_old_perm_blockers( list )
|
||||||
|
{
|
||||||
|
i = 0;
|
||||||
|
while ( i < list.size )
|
||||||
|
{
|
||||||
|
if ( list[ i ] != "" )
|
||||||
|
{
|
||||||
|
level._maze._blocker_locations[ list[ i ] ] notify( "lower_" + list[ i ] );
|
||||||
|
}
|
||||||
|
wait 0,25;
|
||||||
|
i++;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
maze_debug_print( str )
|
||||||
|
{
|
||||||
|
/#
|
||||||
|
if ( getDvar( #"55B04A98" ) != "" )
|
||||||
|
{
|
||||||
|
println( "Maze : " + str );
|
||||||
|
#/
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
maze_can_change()
|
||||||
|
{
|
||||||
|
players = getplayers();
|
||||||
|
_a384 = players;
|
||||||
|
_k384 = getFirstArrayKey( _a384 );
|
||||||
|
while ( isDefined( _k384 ) )
|
||||||
|
{
|
||||||
|
player = _a384[ _k384 ];
|
||||||
|
if ( player.sessionstate != "spectator" && player istouching( level._maze.players_in_maze_volume ) )
|
||||||
|
{
|
||||||
|
maze_debug_print( "Player " + player getentitynumber() + " in maze volume. Maze cannot change." );
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
_k384 = getNextArrayKey( _a384, _k384 );
|
||||||
|
}
|
||||||
|
_a398 = players;
|
||||||
|
_k398 = getFirstArrayKey( _a398 );
|
||||||
|
while ( isDefined( _k398 ) )
|
||||||
|
{
|
||||||
|
player = _a398[ _k398 ];
|
||||||
|
if ( player.sessionstate != "spectator" && player istouching( level._maze.players_can_see_maze_volume ) )
|
||||||
|
{
|
||||||
|
if ( player maps/mp/zombies/_zm_utility::is_player_looking_at( level._maze.players_in_maze_volume.origin, 0,5, 0 ) )
|
||||||
|
{
|
||||||
|
maze_debug_print( "Player " + player getentitynumber() + " looking at maze. Maze cannot change." );
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
_k398 = getNextArrayKey( _a398, _k398 );
|
||||||
|
}
|
||||||
|
maze_debug_print( "Maze mutating." );
|
||||||
|
return 1;
|
||||||
|
}
|
||||||
|
|
||||||
|
maze_think()
|
||||||
|
{
|
||||||
|
wait 0,1;
|
||||||
|
while ( 1 )
|
||||||
|
{
|
||||||
|
if ( maze_can_change() )
|
||||||
|
{
|
||||||
|
maze_do_perm_change();
|
||||||
|
level notify( "zm_buried_maze_changed" );
|
||||||
|
}
|
||||||
|
wait 10;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
init_hedge_maze_spawnpoints()
|
||||||
|
{
|
||||||
|
level.maze_hedge_spawnpoints = getstructarray( "custom_spawner_entry hedge_location", "script_noteworthy" );
|
||||||
|
}
|
||||||
|
|
||||||
|
maze_do_zombie_spawn( spot )
|
||||||
|
{
|
||||||
|
self endon( "death" );
|
||||||
|
spots = level.maze_hedge_spawnpoints;
|
||||||
|
spot = undefined;
|
||||||
|
/#
|
||||||
|
assert( spots.size > 0, "No spawn locations found" );
|
||||||
|
#/
|
||||||
|
players_in_maze = maps/mp/zombies/_zm_zonemgr::get_players_in_zone( "zone_maze", 1 );
|
||||||
|
if ( isDefined( players_in_maze ) && players_in_maze.size != 0 )
|
||||||
|
{
|
||||||
|
player = random( players_in_maze );
|
||||||
|
maxdistance = 256;
|
||||||
|
if ( randomint( 100 ) > 75 )
|
||||||
|
{
|
||||||
|
maxdistance = 512;
|
||||||
|
}
|
||||||
|
closest_spots = get_array_of_closest( player.origin, spots, undefined, undefined, maxdistance );
|
||||||
|
favoritespots = [];
|
||||||
|
_a469 = closest_spots;
|
||||||
|
_k469 = getFirstArrayKey( _a469 );
|
||||||
|
while ( isDefined( _k469 ) )
|
||||||
|
{
|
||||||
|
close_spot = _a469[ _k469 ];
|
||||||
|
if ( within_fov( close_spot.origin, close_spot.angles, player.origin, -0,75 ) )
|
||||||
|
{
|
||||||
|
favoritespots[ favoritespots.size ] = close_spot;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
if ( randomint( 100 ) > 75 )
|
||||||
|
{
|
||||||
|
favoritespots[ favoritespots.size ] = close_spot;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
_k469 = getNextArrayKey( _a469, _k469 );
|
||||||
|
}
|
||||||
|
if ( isDefined( favoritespots ) && favoritespots.size >= 2 )
|
||||||
|
{
|
||||||
|
spot = random( favoritespots );
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
if ( isDefined( closest_spots ) && closest_spots.size > 0 )
|
||||||
|
{
|
||||||
|
spot = random( closest_spots );
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if ( !isDefined( spot ) )
|
||||||
|
{
|
||||||
|
spot = random( spots );
|
||||||
|
}
|
||||||
|
self.spawn_point = spot;
|
||||||
|
if ( isDefined( spot.target ) )
|
||||||
|
{
|
||||||
|
self.target = spot.target;
|
||||||
|
}
|
||||||
|
if ( isDefined( spot.zone_name ) )
|
||||||
|
{
|
||||||
|
self.zone_name = spot.zone_name;
|
||||||
|
}
|
||||||
|
if ( isDefined( spot.script_parameters ) )
|
||||||
|
{
|
||||||
|
self.script_parameters = spot.script_parameters;
|
||||||
|
}
|
||||||
|
self thread maze_do_zombie_rise( spot );
|
||||||
|
}
|
||||||
|
|
||||||
|
maze_do_zombie_rise( spot )
|
||||||
|
{
|
||||||
|
self endon( "death" );
|
||||||
|
self.in_the_ground = 1;
|
||||||
|
if ( isDefined( self.anchor ) )
|
||||||
|
{
|
||||||
|
self.anchor delete();
|
||||||
|
}
|
||||||
|
self.anchor = spawn( "script_origin", self.origin );
|
||||||
|
self.anchor.angles = self.angles;
|
||||||
|
self linkto( self.anchor );
|
||||||
|
if ( !isDefined( spot.angles ) )
|
||||||
|
{
|
||||||
|
spot.angles = ( 0, 0, 0 );
|
||||||
|
}
|
||||||
|
anim_org = spot.origin;
|
||||||
|
anim_ang = spot.angles;
|
||||||
|
anim_org += ( 0, 0, 0 );
|
||||||
|
self ghost();
|
||||||
|
self.anchor moveto( anim_org, 0,05 );
|
||||||
|
self.anchor waittill( "movedone" );
|
||||||
|
target_org = get_desired_origin();
|
||||||
|
if ( isDefined( target_org ) )
|
||||||
|
{
|
||||||
|
anim_ang = vectorToAngle( target_org - self.origin );
|
||||||
|
self.anchor rotateto( ( 0, anim_ang[ 1 ], 0 ), 0,05 );
|
||||||
|
self.anchor waittill( "rotatedone" );
|
||||||
|
}
|
||||||
|
self unlink();
|
||||||
|
if ( isDefined( self.anchor ) )
|
||||||
|
{
|
||||||
|
self.anchor delete();
|
||||||
|
}
|
||||||
|
self thread maps/mp/zombies/_zm_spawner::hide_pop();
|
||||||
|
level thread maps/mp/zombies/_zm_spawner::zombie_rise_death( self, spot );
|
||||||
|
spot thread maps/mp/zombies/_zm_spawner::zombie_rise_fx( self );
|
||||||
|
substate = 0;
|
||||||
|
if ( self.zombie_move_speed == "walk" )
|
||||||
|
{
|
||||||
|
substate = randomint( 2 );
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
substate = 1;
|
||||||
|
}
|
||||||
|
self orientmode( "face default" );
|
||||||
|
self animscripted( spot.origin, spot.angles, "zm_rise_hedge", substate );
|
||||||
|
self notify( "rise_anim_finished" );
|
||||||
|
spot notify( "stop_zombie_rise_fx" );
|
||||||
|
self.in_the_ground = 0;
|
||||||
|
self notify( "risen" );
|
||||||
|
}
|
||||||
|
|
||||||
|
maze_achievement_watcher()
|
||||||
|
{
|
||||||
|
while ( 1 )
|
||||||
|
{
|
||||||
|
level waittill( "start_of_round" );
|
||||||
|
start_maze_achievement_threads();
|
||||||
|
level waittill( "end_of_round" );
|
||||||
|
check_maze_achievement_threads();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
start_maze_achievement_threads()
|
||||||
|
{
|
||||||
|
while ( level.round_number >= 20 )
|
||||||
|
{
|
||||||
|
_a607 = get_players();
|
||||||
|
_k607 = getFirstArrayKey( _a607 );
|
||||||
|
while ( isDefined( _k607 ) )
|
||||||
|
{
|
||||||
|
player = _a607[ _k607 ];
|
||||||
|
player.achievement_player_started_round_in_maze = player is_player_in_zone( "zone_maze" );
|
||||||
|
if ( player.achievement_player_started_round_in_maze )
|
||||||
|
{
|
||||||
|
player thread watch_player_in_maze();
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
player notify( "_maze_achievement_think_done" );
|
||||||
|
}
|
||||||
|
_k607 = getNextArrayKey( _a607, _k607 );
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
watch_player_in_maze()
|
||||||
|
{
|
||||||
|
self notify( "_maze_achievement_think_done" );
|
||||||
|
self endon( "_maze_achievement_think_done" );
|
||||||
|
self endon( "death_or_disconnect" );
|
||||||
|
self.achievement_player_stayed_in_maze_for_entire_round = 1;
|
||||||
|
while ( self.achievement_player_stayed_in_maze_for_entire_round )
|
||||||
|
{
|
||||||
|
self.achievement_player_stayed_in_maze_for_entire_round = self is_player_in_zone( "zone_maze" );
|
||||||
|
wait randomfloatrange( 0,5, 1 );
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
check_maze_achievement_threads()
|
||||||
|
{
|
||||||
|
while ( level.round_number >= 20 )
|
||||||
|
{
|
||||||
|
_a643 = get_players();
|
||||||
|
_k643 = getFirstArrayKey( _a643 );
|
||||||
|
while ( isDefined( _k643 ) )
|
||||||
|
{
|
||||||
|
player = _a643[ _k643 ];
|
||||||
|
if ( isDefined( player.achievement_player_started_round_in_maze ) && player.achievement_player_started_round_in_maze && isDefined( player.achievement_player_stayed_in_maze_for_entire_round ) && player.achievement_player_stayed_in_maze_for_entire_round && level._time_bomb.last_round_restored != ( level.round_number - 1 ) && !maps/mp/zombies/_zm_weap_time_bomb::is_time_bomb_round_change() )
|
||||||
|
{
|
||||||
|
/#
|
||||||
|
iprintlnbold( player.name + " got achievement MAZED AND CONFUSED" );
|
||||||
|
#/
|
||||||
|
player notify( "player_stayed_in_maze_for_entire_high_level_round" );
|
||||||
|
player notify( "_maze_achievement_think_done" );
|
||||||
|
}
|
||||||
|
_k643 = getNextArrayKey( _a643, _k643 );
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
vo_in_maze()
|
||||||
|
{
|
||||||
|
flag_wait( "mansion_door1" );
|
||||||
|
nwaittime = 300;
|
||||||
|
nminwait = 5;
|
||||||
|
nmaxwait = 10;
|
||||||
|
while ( 1 )
|
||||||
|
{
|
||||||
|
aplayersinzone = maps/mp/zombies/_zm_zonemgr::get_players_in_zone( "zone_maze", 1 );
|
||||||
|
while ( !isDefined( aplayersinzone ) || aplayersinzone.size == 0 )
|
||||||
|
{
|
||||||
|
wait randomint( nminwait, nmaxwait );
|
||||||
|
aplayersinzone = maps/mp/zombies/_zm_zonemgr::get_players_in_zone( "zone_maze", 1 );
|
||||||
|
}
|
||||||
|
random( aplayersinzone ) maps/mp/zombies/_zm_audio::create_and_play_dialog( "general", "in_maze" );
|
||||||
|
nminwait = 13;
|
||||||
|
nmaxwait = 37;
|
||||||
|
wait nwaittime;
|
||||||
|
}
|
||||||
|
}
|
37
zm_buried_patch/maps/mp/zm_buried_power.gsc
Normal file
37
zm_buried_patch/maps/mp/zm_buried_power.gsc
Normal file
@ -0,0 +1,37 @@
|
|||||||
|
#include maps/mp/zombies/_zm_perks;
|
||||||
|
#include maps/mp/zombies/_zm_audio;
|
||||||
|
#include maps/mp/zombies/_zm_utility;
|
||||||
|
#include maps/mp/_utility;
|
||||||
|
#include common_scripts/utility;
|
||||||
|
|
||||||
|
electric_switch()
|
||||||
|
{
|
||||||
|
trig = getent( "use_elec_switch", "targetname" );
|
||||||
|
master_switch = getent( "elec_switch", "targetname" );
|
||||||
|
master_switch notsolid();
|
||||||
|
trig sethintstring( &"ZOMBIE_ELECTRIC_SWITCH" );
|
||||||
|
trig setvisibletoall();
|
||||||
|
trig waittill( "trigger", user );
|
||||||
|
trig setinvisibletoall();
|
||||||
|
master_switch rotateroll( -90, 0,3 );
|
||||||
|
master_switch playsound( "zmb_switch_flip" );
|
||||||
|
master_switch playsound( "zmb_poweron" );
|
||||||
|
level delay_thread( 11,8, ::sndpoweronmusicstinger );
|
||||||
|
if ( isDefined( user ) )
|
||||||
|
{
|
||||||
|
user thread maps/mp/zombies/_zm_audio::create_and_play_dialog( "power", "power_on" );
|
||||||
|
}
|
||||||
|
level thread maps/mp/zombies/_zm_perks::perk_unpause_all_perks();
|
||||||
|
master_switch waittill( "rotatedone" );
|
||||||
|
playfx( level._effect[ "switch_sparks" ], master_switch.origin + ( 0, 12, -60 ), anglesToForward( master_switch.angles ) );
|
||||||
|
master_switch playsound( "zmb_turn_on" );
|
||||||
|
level notify( "electric_door" );
|
||||||
|
clientnotify( "power_on" );
|
||||||
|
flag_set( "power_on" );
|
||||||
|
level setclientfield( "zombie_power_on", 1 );
|
||||||
|
}
|
||||||
|
|
||||||
|
sndpoweronmusicstinger()
|
||||||
|
{
|
||||||
|
level thread maps/mp/zombies/_zm_audio::sndmusicstingerevent( "poweron" );
|
||||||
|
}
|
1763
zm_buried_patch/maps/mp/zm_buried_sq.gsc
Normal file
1763
zm_buried_patch/maps/mp/zm_buried_sq.gsc
Normal file
File diff suppressed because it is too large
Load Diff
208
zm_buried_patch/maps/mp/zm_buried_sq_bt.gsc
Normal file
208
zm_buried_patch/maps/mp/zm_buried_sq_bt.gsc
Normal file
@ -0,0 +1,208 @@
|
|||||||
|
#include maps/mp/zm_buried_sq;
|
||||||
|
#include maps/mp/zombies/_zm_sidequests;
|
||||||
|
#include maps/mp/zombies/_zm_utility;
|
||||||
|
#include maps/mp/_utility;
|
||||||
|
#include common_scripts/utility;
|
||||||
|
|
||||||
|
init()
|
||||||
|
{
|
||||||
|
declare_sidequest_stage( "sq", "bt", ::init_stage, ::stage_logic, ::exit_stage );
|
||||||
|
}
|
||||||
|
|
||||||
|
init_stage()
|
||||||
|
{
|
||||||
|
flag_init( "sq_player_underground" );
|
||||||
|
level thread stage_vo();
|
||||||
|
level thread stage_start_watcher();
|
||||||
|
level._cur_stage_name = "bt";
|
||||||
|
clientnotify( "bt" );
|
||||||
|
}
|
||||||
|
|
||||||
|
stage_vo()
|
||||||
|
{
|
||||||
|
level waittill( "start_of_round" );
|
||||||
|
level thread stage_vo_watch_underground();
|
||||||
|
wait 5;
|
||||||
|
maxissay( "vox_maxi_sidequest_maxis_start_1_0" );
|
||||||
|
maxissay( "vox_maxi_sidequest_maxis_start_2_0" );
|
||||||
|
maxissay( "vox_maxi_sidequest_maxis_start_3_0" );
|
||||||
|
maxissay( "vox_maxi_sidequest_maxis_start_4_0" );
|
||||||
|
maxissay( "vox_maxi_sidequest_maxis_start_5_0" );
|
||||||
|
flag_wait( "sq_player_underground" );
|
||||||
|
level.m_maxis_vo_spot.origin = ( -728, -344, 280 );
|
||||||
|
while ( isDefined( level.vo_player_who_discovered_stables_roof ) && is_true( level.vo_player_who_discovered_stables_roof.isspeaking ) )
|
||||||
|
{
|
||||||
|
wait 0,05;
|
||||||
|
}
|
||||||
|
maxissay( "vox_maxi_sidequest_town_0" );
|
||||||
|
maxissay( "vox_maxi_sidequest_town_1" );
|
||||||
|
wait 1;
|
||||||
|
level thread stage_vo_watch_gallows();
|
||||||
|
if ( !level.richcompleted )
|
||||||
|
{
|
||||||
|
if ( isDefined( level.rich_sq_player ) )
|
||||||
|
{
|
||||||
|
level.rich_sq_player.dontspeak = 1;
|
||||||
|
level.rich_sq_player setclientfieldtoplayer( "isspeaking", 1 );
|
||||||
|
}
|
||||||
|
richtofensay( "vox_zmba_sidequest_zmba_start_1_0", 3 );
|
||||||
|
if ( isDefined( level.rich_sq_player ) )
|
||||||
|
{
|
||||||
|
while ( isDefined( level.rich_sq_player ) || is_true( level.rich_sq_player.isspeaking ) && is_true( level.rich_sq_player.dontspeak ) )
|
||||||
|
{
|
||||||
|
wait 1;
|
||||||
|
}
|
||||||
|
level.rich_sq_player.dontspeak = 1;
|
||||||
|
level.rich_sq_player setclientfieldtoplayer( "isspeaking", 1 );
|
||||||
|
level.rich_sq_player playsoundwithnotify( "vox_plr_1_respond_richtofen_0", "sound_done_vox_plr_1_respond_richtofen_0" );
|
||||||
|
level.rich_sq_player waittill( "sound_done_vox_plr_1_respond_richtofen_0" );
|
||||||
|
wait 1;
|
||||||
|
level.rich_sq_player setclientfieldtoplayer( "isspeaking", 0 );
|
||||||
|
}
|
||||||
|
richtofensay( "vox_zmba_sidequest_zmba_start_3_0", 4 );
|
||||||
|
if ( isDefined( level.rich_sq_player ) )
|
||||||
|
{
|
||||||
|
while ( isDefined( level.rich_sq_player ) || is_true( level.rich_sq_player.isspeaking ) && is_true( level.rich_sq_player.dontspeak ) )
|
||||||
|
{
|
||||||
|
wait 1;
|
||||||
|
}
|
||||||
|
level.rich_sq_player.dontspeak = 1;
|
||||||
|
level.rich_sq_player setclientfieldtoplayer( "isspeaking", 1 );
|
||||||
|
level.rich_sq_player playsoundwithnotify( "vox_plr_1_respond_richtofen_1", "sound_done_vox_plr_1_respond_richtofen_1" );
|
||||||
|
level.rich_sq_player waittill( "sound_done_vox_plr_1_respond_richtofen_1" );
|
||||||
|
wait 1;
|
||||||
|
level.rich_sq_player setclientfieldtoplayer( "isspeaking", 0 );
|
||||||
|
}
|
||||||
|
richtofensay( "vox_zmba_sidequest_zmba_start_5_0", 12 );
|
||||||
|
richtofensay( "vox_zmba_sidequest_zmba_start_6_0", 8 );
|
||||||
|
if ( isDefined( level.rich_sq_player ) )
|
||||||
|
{
|
||||||
|
while ( isDefined( level.rich_sq_player ) || is_true( level.rich_sq_player.isspeaking ) && is_true( level.rich_sq_player.dontspeak ) )
|
||||||
|
{
|
||||||
|
wait 1;
|
||||||
|
}
|
||||||
|
level.rich_sq_player.dontspeak = 1;
|
||||||
|
level.rich_sq_player setclientfieldtoplayer( "isspeaking", 1 );
|
||||||
|
level.rich_sq_player playsoundwithnotify( "vox_plr_1_respond_richtofen_2", "sound_done_vox_plr_1_respond_richtofen_2" );
|
||||||
|
level.rich_sq_player waittill( "sound_done_vox_plr_1_respond_richtofen_2" );
|
||||||
|
wait 1;
|
||||||
|
level.rich_sq_player setclientfieldtoplayer( "isspeaking", 0 );
|
||||||
|
}
|
||||||
|
richtofensay( "vox_zmba_sidequest_town_0", 6 );
|
||||||
|
richtofensay( "vox_zmba_sidequest_town_1", 6 );
|
||||||
|
}
|
||||||
|
flag_set( "sq_intro_vo_done" );
|
||||||
|
level thread stage_vo_nag();
|
||||||
|
level thread stage_vo_watch_guillotine();
|
||||||
|
}
|
||||||
|
|
||||||
|
stage_vo_nag()
|
||||||
|
{
|
||||||
|
level endon( "sq_is_max_tower_built" );
|
||||||
|
level endon( "sq_is_ric_tower_built" );
|
||||||
|
level endon( "end_game_reward_starts_maxis" );
|
||||||
|
level endon( "end_game_reward_starts_richtofen" );
|
||||||
|
s_struct = getstruct( "sq_gallows", "targetname" );
|
||||||
|
m_maxis_vo_spot = spawn( "script_model", s_struct.origin );
|
||||||
|
m_maxis_vo_spot setmodel( "tag_origin" );
|
||||||
|
i = 0;
|
||||||
|
while ( i < 5 )
|
||||||
|
{
|
||||||
|
level waittill( "end_of_round" );
|
||||||
|
maxissay( "vox_maxi_sidequest_nag_" + i, m_maxis_vo_spot );
|
||||||
|
richtofensay( "vox_zmba_sidequest_nag_" + i, 10 );
|
||||||
|
i++;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
stage_vo_watch_guillotine()
|
||||||
|
{
|
||||||
|
level endon( "sq_bt_over" );
|
||||||
|
level endon( "end_game_reward_starts_maxis" );
|
||||||
|
level endon( "end_game_reward_starts_richtofen" );
|
||||||
|
s_struct = getstruct( "sq_guillotine", "targetname" );
|
||||||
|
trigger = spawn( "trigger_radius", s_struct.origin, 0, 128, 72 );
|
||||||
|
trigger waittill( "trigger" );
|
||||||
|
trigger delete();
|
||||||
|
richtofensay( "vox_zmba_sidequest_gallows_0", 9 );
|
||||||
|
richtofensay( "vox_zmba_sidequest_gallows_1", 12 );
|
||||||
|
level waittill( "rtower_object_planted" );
|
||||||
|
richtofensay( "vox_zmba_sidequest_parts_0", 9 );
|
||||||
|
level waittill( "rtower_object_planted" );
|
||||||
|
richtofensay( "vox_zmba_sidequest_parts_1", 3 );
|
||||||
|
level waittill( "rtower_object_planted" );
|
||||||
|
richtofensay( "vox_zmba_sidequest_parts_2", 5 );
|
||||||
|
level waittill( "rtower_object_planted" );
|
||||||
|
richtofensay( "vox_zmba_sidequest_parts_3", 11 );
|
||||||
|
}
|
||||||
|
|
||||||
|
stage_vo_watch_gallows()
|
||||||
|
{
|
||||||
|
level endon( "sq_bt_over" );
|
||||||
|
level endon( "end_game_reward_starts_maxis" );
|
||||||
|
level endon( "end_game_reward_starts_richtofen" );
|
||||||
|
s_struct = getstruct( "sq_gallows", "targetname" );
|
||||||
|
trigger = spawn( "trigger_radius", s_struct.origin, 0, 128, 72 );
|
||||||
|
trigger waittill( "trigger" );
|
||||||
|
trigger delete();
|
||||||
|
m_maxis_vo_spot = spawn( "script_model", s_struct.origin );
|
||||||
|
m_maxis_vo_spot setmodel( "tag_origin" );
|
||||||
|
if ( flag( "sq_intro_vo_done" ) )
|
||||||
|
{
|
||||||
|
maxissay( "vox_maxi_sidequest_gallows_0", m_maxis_vo_spot );
|
||||||
|
}
|
||||||
|
i = 0;
|
||||||
|
while ( i < 4 )
|
||||||
|
{
|
||||||
|
level waittill( "mtower_object_planted" );
|
||||||
|
if ( flag( "sq_intro_vo_done" ) )
|
||||||
|
{
|
||||||
|
maxissay( "vox_maxi_sidequest_parts_" + i, m_maxis_vo_spot, 1 );
|
||||||
|
}
|
||||||
|
wait_network_frame();
|
||||||
|
i++;
|
||||||
|
}
|
||||||
|
m_maxis_vo_spot delete();
|
||||||
|
}
|
||||||
|
|
||||||
|
stage_vo_watch_underground()
|
||||||
|
{
|
||||||
|
trigger_wait( "sq_player_underground", "targetname" );
|
||||||
|
flag_set( "sq_player_underground" );
|
||||||
|
}
|
||||||
|
|
||||||
|
stage_start_watcher()
|
||||||
|
{
|
||||||
|
level waittill_either( "mtower_object_planted", "rtower_object_planted" );
|
||||||
|
flag_set( "sq_started" );
|
||||||
|
}
|
||||||
|
|
||||||
|
stage_logic()
|
||||||
|
{
|
||||||
|
/#
|
||||||
|
iprintlnbold( "BT Started" );
|
||||||
|
#/
|
||||||
|
level thread wait_for_maxis_tower();
|
||||||
|
level thread wait_for_richtofen_tower();
|
||||||
|
flag_wait_any( "sq_is_max_tower_built", "sq_is_ric_tower_built" );
|
||||||
|
wait_network_frame();
|
||||||
|
stage_completed( "sq", level._cur_stage_name );
|
||||||
|
}
|
||||||
|
|
||||||
|
wait_for_maxis_tower()
|
||||||
|
{
|
||||||
|
level endon( "sq_is_ric_tower_built" );
|
||||||
|
wait_for_buildable( "buried_sq_bt_m_tower" );
|
||||||
|
flag_set( "sq_is_max_tower_built" );
|
||||||
|
}
|
||||||
|
|
||||||
|
wait_for_richtofen_tower()
|
||||||
|
{
|
||||||
|
level endon( "sq_is_max_tower_built" );
|
||||||
|
wait_for_buildable( "buried_sq_bt_r_tower" );
|
||||||
|
flag_set( "sq_is_ric_tower_built" );
|
||||||
|
}
|
||||||
|
|
||||||
|
exit_stage( success )
|
||||||
|
{
|
||||||
|
}
|
428
zm_buried_patch/maps/mp/zm_buried_sq_ctw.gsc
Normal file
428
zm_buried_patch/maps/mp/zm_buried_sq_ctw.gsc
Normal file
@ -0,0 +1,428 @@
|
|||||||
|
#include maps/mp/zm_buried_sq;
|
||||||
|
#include maps/mp/zombies/_zm_sidequests;
|
||||||
|
#include maps/mp/zombies/_zm_utility;
|
||||||
|
#include maps/mp/_utility;
|
||||||
|
#include common_scripts/utility;
|
||||||
|
|
||||||
|
init()
|
||||||
|
{
|
||||||
|
flag_init( "sq_wisp_failed" );
|
||||||
|
flag_init( "sq_m_wisp_weak" );
|
||||||
|
level.sq_ctw_m_tubes_lit = 0;
|
||||||
|
declare_sidequest_stage( "sq", "ctw", ::init_stage, ::stage_logic, ::exit_stage );
|
||||||
|
}
|
||||||
|
|
||||||
|
init_stage()
|
||||||
|
{
|
||||||
|
flag_clear( "sq_wisp_failed" );
|
||||||
|
level._cur_stage_name = "ctw";
|
||||||
|
clientnotify( "ctw" );
|
||||||
|
}
|
||||||
|
|
||||||
|
stage_logic()
|
||||||
|
{
|
||||||
|
/#
|
||||||
|
iprintlnbold( "CTW Started" );
|
||||||
|
#/
|
||||||
|
if ( flag( "sq_is_max_tower_built" ) )
|
||||||
|
{
|
||||||
|
level thread stage_vo_max();
|
||||||
|
ctw_max_start_wisp();
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
level thread stage_vo_ric();
|
||||||
|
ctw_ric_start_wisp();
|
||||||
|
}
|
||||||
|
flag_wait_any( "sq_wisp_success", "sq_wisp_failed" );
|
||||||
|
wait_network_frame();
|
||||||
|
stage_completed( "sq", level._cur_stage_name );
|
||||||
|
}
|
||||||
|
|
||||||
|
exit_stage( success )
|
||||||
|
{
|
||||||
|
}
|
||||||
|
|
||||||
|
stage_vo_max()
|
||||||
|
{
|
||||||
|
level endon( "sq_wisp_failed" );
|
||||||
|
while ( !isDefined( level.vh_wisp ) )
|
||||||
|
{
|
||||||
|
wait 1;
|
||||||
|
}
|
||||||
|
level.vh_wisp endon( "delete" );
|
||||||
|
maxissay( "vox_maxi_sidequest_ctw_0", level.e_sq_sign_attacker );
|
||||||
|
maxissay( "vox_maxi_sidequest_ctw_1", level.e_sq_sign_attacker );
|
||||||
|
wait 15;
|
||||||
|
maxissay( "vox_maxis_sidequest_ctw_4", level.e_sq_sign_attacker );
|
||||||
|
}
|
||||||
|
|
||||||
|
stage_vo_ric()
|
||||||
|
{
|
||||||
|
level endon( "sq_wisp_failed" );
|
||||||
|
richtofensay( "vox_zmba_sidequest_ctw_0", 12 );
|
||||||
|
richtofensay( "vox_zmba_sidequest_ctw_1", 8 );
|
||||||
|
level waittill( "sq_ctw_zombie_powered_up" );
|
||||||
|
richtofensay( "vox_zmba_sidequest_ctw_3", 8 );
|
||||||
|
}
|
||||||
|
|
||||||
|
wisp_move_from_sign_to_start( s_start )
|
||||||
|
{
|
||||||
|
self.origin = level.m_sq_start_sign.origin - vectorScale( ( 1, 0, 0 ), 20 );
|
||||||
|
self moveto( s_start.origin, 2, 0,5, 0,5 );
|
||||||
|
self waittill( "movedone" );
|
||||||
|
wait 1;
|
||||||
|
}
|
||||||
|
|
||||||
|
ctw_ric_start_wisp()
|
||||||
|
{
|
||||||
|
if ( !isDefined( level.m_sq_start_sign ) )
|
||||||
|
{
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
s_start = getstruct( level.m_sq_start_sign.target, "targetname" );
|
||||||
|
m_wisp = getent( "sq_wisp", "targetname" );
|
||||||
|
m_wisp setclientfield( "vulture_wisp", 1 );
|
||||||
|
m_wisp wisp_move_from_sign_to_start( s_start );
|
||||||
|
m_wisp thread ctw_ric_move_wisp( s_start );
|
||||||
|
}
|
||||||
|
|
||||||
|
ctw_ric_move_wisp( s_current )
|
||||||
|
{
|
||||||
|
self endon( "ctw_wisp_timeout" );
|
||||||
|
self setclientfield( "vulture_wisp", 0 );
|
||||||
|
self.origin = s_current.origin;
|
||||||
|
wait_network_frame();
|
||||||
|
self setclientfield( "vulture_wisp", 1 );
|
||||||
|
self thread ctw_ric_watch_wisp_timeout();
|
||||||
|
ctw_ric_watch_wisp_dist();
|
||||||
|
s_current = ctw_ric_get_next_wisp_struct( s_current );
|
||||||
|
self endon( "ctw_wisp_moved" );
|
||||||
|
self ctw_ric_power_towers();
|
||||||
|
flag_set( "sq_wisp_success" );
|
||||||
|
}
|
||||||
|
|
||||||
|
ctw_ric_get_next_wisp_struct( s_current )
|
||||||
|
{
|
||||||
|
if ( !isDefined( s_current.target ) )
|
||||||
|
{
|
||||||
|
return undefined;
|
||||||
|
}
|
||||||
|
a_structs = getstructarray( s_current.target, "targetname" );
|
||||||
|
return array_randomize( a_structs )[ 0 ];
|
||||||
|
}
|
||||||
|
|
||||||
|
ctw_ric_watch_wisp_timeout()
|
||||||
|
{
|
||||||
|
self endon( "ctw_wisp_moved" );
|
||||||
|
wait 12;
|
||||||
|
flag_set( "sq_wisp_failed" );
|
||||||
|
self setclientfield( "vulture_wisp", 0 );
|
||||||
|
self notify( "ctw_wisp_timeout" );
|
||||||
|
}
|
||||||
|
|
||||||
|
ctw_ric_watch_wisp_dist( s_current )
|
||||||
|
{
|
||||||
|
self endon( "ctw_wisp_timeout" );
|
||||||
|
is_near_wisp = 0;
|
||||||
|
while ( !is_near_wisp )
|
||||||
|
{
|
||||||
|
players = getplayers();
|
||||||
|
_a185 = players;
|
||||||
|
_k185 = getFirstArrayKey( _a185 );
|
||||||
|
while ( isDefined( _k185 ) )
|
||||||
|
{
|
||||||
|
player = _a185[ _k185 ];
|
||||||
|
if ( !player hasperk( "specialty_nomotionsensor" ) )
|
||||||
|
{
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
if ( distancesquared( player.origin, self.origin ) < 4096 )
|
||||||
|
{
|
||||||
|
is_near_wisp = 1;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
_k185 = getNextArrayKey( _a185, _k185 );
|
||||||
|
}
|
||||||
|
wait 0,1;
|
||||||
|
}
|
||||||
|
self notify( "ctw_wisp_moved" );
|
||||||
|
}
|
||||||
|
|
||||||
|
ctw_ric_power_towers()
|
||||||
|
{
|
||||||
|
m_tower = getent( "sq_guillotine", "targetname" );
|
||||||
|
level setclientfield( "vulture_wisp_orb_count", 1 );
|
||||||
|
wait_network_frame();
|
||||||
|
level setclientfield( "vulture_wisp_orb_count", 0 );
|
||||||
|
wait 2;
|
||||||
|
v_guillotine_spot = self.origin;
|
||||||
|
self.origin = m_tower gettagorigin( "j_crystal_01" );
|
||||||
|
m_tower thread ctw_ric_guillotine_glow( v_guillotine_spot );
|
||||||
|
i = 0;
|
||||||
|
while ( i < 5 )
|
||||||
|
{
|
||||||
|
wait 3;
|
||||||
|
e_powered_zombie = undefined;
|
||||||
|
while ( !isDefined( e_powered_zombie ) )
|
||||||
|
{
|
||||||
|
wait 1;
|
||||||
|
a_zombies = ctw_find_zombies_for_powerup( self.origin, 512, m_tower );
|
||||||
|
e_powered_zombie = array_randomize( a_zombies )[ 0 ];
|
||||||
|
}
|
||||||
|
level notify( "stop_ctw_ric_guillotine_glow" );
|
||||||
|
e_powered_zombie ctw_power_up_ric_zombie( m_tower.m_glow );
|
||||||
|
e_powered_zombie waittill( "death" );
|
||||||
|
level setclientfield( "vulture_wisp_orb_count", i + 1 );
|
||||||
|
m_tower ctw_return_wisp_to_guillotine( v_guillotine_spot, e_powered_zombie.origin );
|
||||||
|
i++;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
ctw_ric_guillotine_glow( v_spot )
|
||||||
|
{
|
||||||
|
level endon( "stop_ctw_ric_guillotine_glow" );
|
||||||
|
if ( !isDefined( self.m_glow ) )
|
||||||
|
{
|
||||||
|
self.m_glow = spawn( "script_model", v_spot );
|
||||||
|
self.m_glow setmodel( "tag_origin" );
|
||||||
|
}
|
||||||
|
while ( 1 )
|
||||||
|
{
|
||||||
|
playfxontag( level._effect[ "vulture_fx_wisp" ], self.m_glow, "tag_origin" );
|
||||||
|
wait 0,25;
|
||||||
|
self.m_glow playloopsound( "zmb_sq_wisp_loop_guillotine" );
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
ctw_power_up_ric_zombie( m_wisp )
|
||||||
|
{
|
||||||
|
wait_network_frame();
|
||||||
|
v_to_zombie = vectornormalize( self gettagorigin( "J_SpineLower" ) - m_wisp.origin );
|
||||||
|
v_move_spot = m_wisp.origin + ( v_to_zombie * 32 );
|
||||||
|
m_wisp.origin = v_move_spot;
|
||||||
|
self ctw_power_up_zombie();
|
||||||
|
}
|
||||||
|
|
||||||
|
ctw_return_wisp_to_guillotine( v_spot, v_start )
|
||||||
|
{
|
||||||
|
self.m_glow.origin = v_start;
|
||||||
|
self thread ctw_ric_guillotine_glow( v_start );
|
||||||
|
wait_network_frame();
|
||||||
|
v_to_tower = vectornormalize( v_spot - self.m_glow.origin );
|
||||||
|
v_move_spot = self.m_glow.origin + ( v_to_tower * 32 );
|
||||||
|
self.m_glow.origin = v_move_spot;
|
||||||
|
self.m_glow.origin = v_spot;
|
||||||
|
}
|
||||||
|
|
||||||
|
ctw_max_start_wisp()
|
||||||
|
{
|
||||||
|
nd_start = getvehiclenode( level.m_sq_start_sign.target, "targetname" );
|
||||||
|
vh_wisp = spawnvehicle( "tag_origin", "wisp_ai", "heli_quadrotor2_zm", nd_start.origin, nd_start.angles );
|
||||||
|
vh_wisp makevehicleunusable();
|
||||||
|
level.vh_wisp = vh_wisp;
|
||||||
|
vh_wisp.n_sq_max_energy = 30;
|
||||||
|
vh_wisp.n_sq_energy = vh_wisp.n_sq_max_energy;
|
||||||
|
vh_wisp thread ctw_max_wisp_play_fx();
|
||||||
|
vh_wisp_mover = spawn( "script_model", vh_wisp.origin );
|
||||||
|
vh_wisp_mover setmodel( "tag_origin" );
|
||||||
|
vh_wisp linkto( vh_wisp_mover );
|
||||||
|
vh_wisp_mover wisp_move_from_sign_to_start( nd_start );
|
||||||
|
vh_wisp unlink();
|
||||||
|
vh_wisp_mover delete();
|
||||||
|
vh_wisp attachpath( nd_start );
|
||||||
|
vh_wisp startpath();
|
||||||
|
vh_wisp thread ctw_max_success_watch();
|
||||||
|
vh_wisp thread ctw_max_fail_watch();
|
||||||
|
vh_wisp thread ctw_max_wisp_enery_watch();
|
||||||
|
wait_network_frame();
|
||||||
|
flag_wait_any( "sq_wisp_success", "sq_wisp_failed" );
|
||||||
|
vh_wisp cancelaimove();
|
||||||
|
vh_wisp clearvehgoalpos();
|
||||||
|
vh_wisp delete();
|
||||||
|
if ( isDefined( level.vh_wisp ) )
|
||||||
|
{
|
||||||
|
level.vh_wisp delete();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
ctw_max_wisp_play_fx()
|
||||||
|
{
|
||||||
|
self playloopsound( "zmb_sq_wisp_loop" );
|
||||||
|
while ( isDefined( self ) )
|
||||||
|
{
|
||||||
|
playfxontag( level._effect[ "fx_wisp_m" ], self, "tag_origin" );
|
||||||
|
if ( !flag( "sq_m_wisp_weak" ) )
|
||||||
|
{
|
||||||
|
playfxontag( level._effect[ "fx_wisp_lg_m" ], self, "tag_origin" );
|
||||||
|
}
|
||||||
|
wait 0,3;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
ctw_max_success_watch()
|
||||||
|
{
|
||||||
|
self endon( "death" );
|
||||||
|
self waittill( "reached_end_node" );
|
||||||
|
/#
|
||||||
|
iprintlnbold( "Wisp Success!" );
|
||||||
|
#/
|
||||||
|
flag_set( "sq_wisp_success" );
|
||||||
|
level thread ctw_light_tube();
|
||||||
|
}
|
||||||
|
|
||||||
|
ctw_light_tube()
|
||||||
|
{
|
||||||
|
level.sq_ctw_m_tubes_lit++;
|
||||||
|
level setclientfield( "sq_ctw_m_t_l", level.sq_ctw_m_tubes_lit );
|
||||||
|
}
|
||||||
|
|
||||||
|
ctw_max_fail_watch()
|
||||||
|
{
|
||||||
|
self endon( "death" );
|
||||||
|
wait 1;
|
||||||
|
n_starter_dist = distancesquared( self.origin, level.e_sq_sign_attacker.origin );
|
||||||
|
a_players = getplayers();
|
||||||
|
_a382 = a_players;
|
||||||
|
_k382 = getFirstArrayKey( _a382 );
|
||||||
|
while ( isDefined( _k382 ) )
|
||||||
|
{
|
||||||
|
player = _a382[ _k382 ];
|
||||||
|
if ( distancesquared( self.origin, player.origin ) < 16384 )
|
||||||
|
{
|
||||||
|
/#
|
||||||
|
iprintlnbold( "Too Close to Wisp" );
|
||||||
|
#/
|
||||||
|
}
|
||||||
|
_k382 = getNextArrayKey( _a382, _k382 );
|
||||||
|
}
|
||||||
|
a_zombies = ctw_find_zombies_for_powerup( self.origin, 256 );
|
||||||
|
array_thread( a_zombies, ::ctw_power_up_zombie );
|
||||||
|
if ( a_zombies.size )
|
||||||
|
{
|
||||||
|
self.n_sq_energy += 10;
|
||||||
|
if ( self.n_sq_energy > 30 )
|
||||||
|
{
|
||||||
|
self.n_sq_energy = 30;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
self.n_sq_energy--;
|
||||||
|
|
||||||
|
}
|
||||||
|
if ( self.n_sq_energy <= 15 && !flag( "sq_m_wisp_weak" ) )
|
||||||
|
{
|
||||||
|
flag_set( "sq_m_wisp_weak" );
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
if ( self.n_sq_energy > 15 && flag( "sq_m_wisp_weak" ) )
|
||||||
|
{
|
||||||
|
flag_clear( "sq_m_wisp_weak" );
|
||||||
|
}
|
||||||
|
}
|
||||||
|
/#
|
||||||
|
iprintlnbold( self.n_sq_energy );
|
||||||
|
#/
|
||||||
|
level thread ctw_max_fail_vo();
|
||||||
|
flag_set( "sq_wisp_failed" );
|
||||||
|
}
|
||||||
|
|
||||||
|
ctw_max_fail_vo()
|
||||||
|
{
|
||||||
|
maxissay( "vox_maxi_sidequest_ctw_8", level.e_sq_sign_attacker );
|
||||||
|
}
|
||||||
|
|
||||||
|
ctw_max_wisp_enery_watch()
|
||||||
|
{
|
||||||
|
self endon( "death" );
|
||||||
|
while ( 1 )
|
||||||
|
{
|
||||||
|
if ( self.n_sq_energy <= 0 )
|
||||||
|
{
|
||||||
|
flag_set( "sq_wisp_failed" );
|
||||||
|
}
|
||||||
|
wait 1;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
debug_origin()
|
||||||
|
{
|
||||||
|
/#
|
||||||
|
self endon( "death" );
|
||||||
|
while ( 1 )
|
||||||
|
{
|
||||||
|
debugstar( self.origin, 1, ( 1, 0, 0 ) );
|
||||||
|
wait 0,05;
|
||||||
|
#/
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
ctw_find_zombies_for_powerup( v_origin, n_radius, m_ignore )
|
||||||
|
{
|
||||||
|
if ( !isDefined( m_ignore ) )
|
||||||
|
{
|
||||||
|
m_ignore = undefined;
|
||||||
|
}
|
||||||
|
a_zombies = getaispeciesarray( level.zombie_team, "zombie" );
|
||||||
|
n_radius_sq = n_radius * n_radius;
|
||||||
|
a_near_zombies = [];
|
||||||
|
_a473 = a_zombies;
|
||||||
|
_k473 = getFirstArrayKey( _a473 );
|
||||||
|
while ( isDefined( _k473 ) )
|
||||||
|
{
|
||||||
|
e_zombie = _a473[ _k473 ];
|
||||||
|
if ( distancesquared( e_zombie.origin, v_origin ) < n_radius_sq && !isDefined( e_zombie.sq_wisp_powered ) )
|
||||||
|
{
|
||||||
|
if ( sighttracepassed( v_origin, e_zombie gettagorigin( "J_SpineLower" ), 1, m_ignore ) )
|
||||||
|
{
|
||||||
|
a_near_zombies[ a_near_zombies.size ] = e_zombie;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
_k473 = getNextArrayKey( _a473, _k473 );
|
||||||
|
}
|
||||||
|
return a_near_zombies;
|
||||||
|
}
|
||||||
|
|
||||||
|
ctw_power_up_zombie()
|
||||||
|
{
|
||||||
|
level notify( "sq_ctw_zombie_powered_up" );
|
||||||
|
self.sq_wisp_powered = 1;
|
||||||
|
n_oldhealth = self.maxhealth;
|
||||||
|
self.maxhealth *= 2;
|
||||||
|
if ( self.maxhealth < n_oldhealth )
|
||||||
|
{
|
||||||
|
self.maxhealth = n_oldhealth;
|
||||||
|
}
|
||||||
|
self.health = self.maxhealth;
|
||||||
|
if ( self.zombie_move_speed != "sprint" )
|
||||||
|
{
|
||||||
|
self set_zombie_run_cycle( "sprint" );
|
||||||
|
self.zombie_move_speed_original = self.zombie_move_speed;
|
||||||
|
}
|
||||||
|
if ( flag( "sq_is_max_tower_built" ) )
|
||||||
|
{
|
||||||
|
str_fx = "fx_wisp_m";
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
str_fx = "vulture_fx_wisp";
|
||||||
|
}
|
||||||
|
self thread ctw_power_up_zombie_m_fx( str_fx );
|
||||||
|
}
|
||||||
|
|
||||||
|
ctw_power_up_zombie_m_fx( str_fx )
|
||||||
|
{
|
||||||
|
self endon( "delete" );
|
||||||
|
self endon( "death" );
|
||||||
|
while ( isDefined( self ) && isalive( self ) )
|
||||||
|
{
|
||||||
|
playfxontag( level._effect[ str_fx ], self, "J_Wrist_RI" );
|
||||||
|
wait 0,25;
|
||||||
|
playfxontag( level._effect[ str_fx ], self, "J_Wrist_LE" );
|
||||||
|
wait 0,25;
|
||||||
|
self playloopsound( "zmb_sq_wisp_possess" );
|
||||||
|
}
|
||||||
|
}
|
216
zm_buried_patch/maps/mp/zm_buried_sq_ftl.gsc
Normal file
216
zm_buried_patch/maps/mp/zm_buried_sq_ftl.gsc
Normal file
@ -0,0 +1,216 @@
|
|||||||
|
#include maps/mp/zombies/_zm_spawner;
|
||||||
|
#include maps/mp/zm_buried_sq_ftl;
|
||||||
|
#include maps/mp/zm_buried_sq;
|
||||||
|
#include maps/mp/zombies/_zm_buildables;
|
||||||
|
#include maps/mp/zombies/_zm_sidequests;
|
||||||
|
#include maps/mp/zombies/_zm_utility;
|
||||||
|
#include maps/mp/_utility;
|
||||||
|
#include common_scripts/utility;
|
||||||
|
|
||||||
|
init()
|
||||||
|
{
|
||||||
|
flag_init( "ftl_lantern_charged" );
|
||||||
|
declare_sidequest_stage( "sq", "ftl", ::init_stage, ::stage_logic, ::exit_stage );
|
||||||
|
}
|
||||||
|
|
||||||
|
init_stage()
|
||||||
|
{
|
||||||
|
level.sq_ftl_lantern_fuel = 0;
|
||||||
|
if ( flag( "sq_is_max_tower_built" ) )
|
||||||
|
{
|
||||||
|
level thread stage_vo_max();
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
level thread stage_vo_ric();
|
||||||
|
}
|
||||||
|
level._cur_stage_name = "ftl";
|
||||||
|
clientnotify( "ftl" );
|
||||||
|
}
|
||||||
|
|
||||||
|
stage_logic()
|
||||||
|
{
|
||||||
|
/#
|
||||||
|
iprintlnbold( "FTL Started" );
|
||||||
|
#/
|
||||||
|
if ( flag( "sq_is_max_tower_built" ) )
|
||||||
|
{
|
||||||
|
max_fill_lantern_watcher();
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
ric_fill_lantern_watcher();
|
||||||
|
}
|
||||||
|
flag_wait( "ftl_lantern_charged" );
|
||||||
|
if ( flag( "sq_is_max_tower_built" ) )
|
||||||
|
{
|
||||||
|
thread stage_vo_filled_max();
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
thread stage_vo_filled_ric();
|
||||||
|
}
|
||||||
|
sq_ftl_show_marker();
|
||||||
|
wait_for_buildable( "buried_sq_oillamp" );
|
||||||
|
wait_network_frame();
|
||||||
|
stage_completed( "sq", level._cur_stage_name );
|
||||||
|
}
|
||||||
|
|
||||||
|
exit_stage( success )
|
||||||
|
{
|
||||||
|
}
|
||||||
|
|
||||||
|
stage_vo_max()
|
||||||
|
{
|
||||||
|
sq_ftl_maxis_vo_on_holder( "vox_maxi_sidequest_pl_0" );
|
||||||
|
sq_ftl_maxis_vo_on_holder( "vox_maxi_sidequest_pl_1" );
|
||||||
|
sq_ftl_maxis_vo_on_holder( "vox_maxi_sidequest_pl_3" );
|
||||||
|
level waittill( "sq_ftl_lantern_inc" );
|
||||||
|
sq_ftl_maxis_vo_on_holder( "vox_maxi_sidequest_pl_2" );
|
||||||
|
}
|
||||||
|
|
||||||
|
sq_ftl_maxis_vo_on_holder( str_vox )
|
||||||
|
{
|
||||||
|
player = sq_ftl_get_lantern_holder();
|
||||||
|
if ( isDefined( player ) )
|
||||||
|
{
|
||||||
|
maxissay( str_vox, player );
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
sq_ftl_show_marker()
|
||||||
|
{
|
||||||
|
m_marker = getent( "sq_lantern_symbol", "targetname" );
|
||||||
|
m_marker.origin += vectorScale( ( 0, 0, 1 ), 2 );
|
||||||
|
level.sq_lamp_generator_unitrig.origin = level.sq_lamp_generator_unitrig.realorigin;
|
||||||
|
}
|
||||||
|
|
||||||
|
sq_ftl_get_lantern_holder()
|
||||||
|
{
|
||||||
|
players = get_players();
|
||||||
|
_a107 = players;
|
||||||
|
_k107 = getFirstArrayKey( _a107 );
|
||||||
|
while ( isDefined( _k107 ) )
|
||||||
|
{
|
||||||
|
player = _a107[ _k107 ];
|
||||||
|
if ( isDefined( player player_get_buildable_piece( 2 ) ) && isDefined( player player_get_buildable_piece( 2 ).buildablename == "sq_ghost_lamp" ) )
|
||||||
|
{
|
||||||
|
return player;
|
||||||
|
}
|
||||||
|
_k107 = getNextArrayKey( _a107, _k107 );
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
stage_vo_filled_max()
|
||||||
|
{
|
||||||
|
maps/mp/zm_buried_sq_ftl::sq_ftl_maxis_vo_on_holder( "vox_maxi_sidequest_ll_0" );
|
||||||
|
}
|
||||||
|
|
||||||
|
stage_vo_ric()
|
||||||
|
{
|
||||||
|
richtofensay( "vox_zmba_sidequest_pl_0", 12 );
|
||||||
|
level waittill( "sq_ftl_lantern_inc" );
|
||||||
|
richtofensay( "vox_zmba_sidequest_pl_1", 6 );
|
||||||
|
}
|
||||||
|
|
||||||
|
stage_vo_filled_ric()
|
||||||
|
{
|
||||||
|
richtofensay( "vox_zmba_sidequest_ll_0", 10 );
|
||||||
|
richtofensay( "vox_zmba_sidequest_ll_1", 7 );
|
||||||
|
}
|
||||||
|
|
||||||
|
max_fill_lantern_watcher()
|
||||||
|
{
|
||||||
|
a_zombies = getaispeciesarray( level.zombie_team, "zombie" );
|
||||||
|
array_thread( a_zombies, ::max_lantern_zombie_death_watcher );
|
||||||
|
maps/mp/zombies/_zm_spawner::add_custom_zombie_spawn_logic( ::max_lantern_zombie_death_watcher );
|
||||||
|
}
|
||||||
|
|
||||||
|
max_lantern_zombie_death_watcher()
|
||||||
|
{
|
||||||
|
level endon( "ftl_lantern_charged" );
|
||||||
|
if ( flag( "ftl_lantern_charged" ) )
|
||||||
|
{
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
self waittill( "death", attacker );
|
||||||
|
if ( !isDefined( attacker ) || isplayer( attacker ) )
|
||||||
|
{
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
players = getplayers();
|
||||||
|
_a164 = players;
|
||||||
|
_k164 = getFirstArrayKey( _a164 );
|
||||||
|
while ( isDefined( _k164 ) )
|
||||||
|
{
|
||||||
|
player = _a164[ _k164 ];
|
||||||
|
if ( isDefined( player player_get_buildable_piece( 2 ) ) && isDefined( player player_get_buildable_piece( 2 ).buildablename == "sq_ghost_lamp" ) )
|
||||||
|
{
|
||||||
|
if ( isDefined( self ) && distancesquared( player.origin, self.origin ) < 65536 )
|
||||||
|
{
|
||||||
|
player ftl_lantern_increment();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
_k164 = getNextArrayKey( _a164, _k164 );
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
ric_fill_lantern_watcher()
|
||||||
|
{
|
||||||
|
a_axis = getaiarray( "axis" );
|
||||||
|
a_ghost = [];
|
||||||
|
_a183 = a_axis;
|
||||||
|
_k183 = getFirstArrayKey( _a183 );
|
||||||
|
while ( isDefined( _k183 ) )
|
||||||
|
{
|
||||||
|
e_axis = _a183[ _k183 ];
|
||||||
|
if ( is_true( e_axis.is_ghost ) )
|
||||||
|
{
|
||||||
|
a_ghost[ a_ghost.size ] = e_axis;
|
||||||
|
}
|
||||||
|
_k183 = getNextArrayKey( _a183, _k183 );
|
||||||
|
}
|
||||||
|
array_thread( a_ghost, ::ric_lantern_ghost_death_watcher );
|
||||||
|
a_ghost_spawners = getspawnerarray( "ghost_zombie_spawner", "script_noteworthy" );
|
||||||
|
array_thread( a_ghost_spawners, ::add_spawn_function, ::ric_lantern_ghost_death_watcher );
|
||||||
|
}
|
||||||
|
|
||||||
|
ric_lantern_ghost_death_watcher()
|
||||||
|
{
|
||||||
|
level endon( "ftl_lantern_charged" );
|
||||||
|
if ( flag( "ftl_lantern_charged" ) )
|
||||||
|
{
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
self waittill( "death", attacker );
|
||||||
|
players = getplayers();
|
||||||
|
_a210 = players;
|
||||||
|
_k210 = getFirstArrayKey( _a210 );
|
||||||
|
while ( isDefined( _k210 ) )
|
||||||
|
{
|
||||||
|
player = _a210[ _k210 ];
|
||||||
|
if ( isDefined( player player_get_buildable_piece( 2 ) ) && isDefined( player player_get_buildable_piece( 2 ).buildablename == "sq_ghost_lamp" ) )
|
||||||
|
{
|
||||||
|
if ( isDefined( self ) && distancesquared( player.origin, self.origin ) < 65536 )
|
||||||
|
{
|
||||||
|
player ftl_lantern_increment();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
_k210 = getNextArrayKey( _a210, _k210 );
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
ftl_lantern_increment()
|
||||||
|
{
|
||||||
|
level.sq_ftl_lantern_fuel++;
|
||||||
|
level notify( "sq_ftl_lantern_inc" );
|
||||||
|
self playsound( "zmb_lantern_fill_" + level.sq_ftl_lantern_fuel );
|
||||||
|
/#
|
||||||
|
iprintlnbold( "Fuel Level: " + level.sq_ftl_lantern_fuel );
|
||||||
|
#/
|
||||||
|
if ( level.sq_ftl_lantern_fuel >= 10 )
|
||||||
|
{
|
||||||
|
self playsound( "zmb_lantern_fill_done" );
|
||||||
|
flag_set( "ftl_lantern_charged" );
|
||||||
|
}
|
||||||
|
}
|
257
zm_buried_patch/maps/mp/zm_buried_sq_gl.gsc
Normal file
257
zm_buried_patch/maps/mp/zm_buried_sq_gl.gsc
Normal file
@ -0,0 +1,257 @@
|
|||||||
|
#include maps/mp/zm_buried_sq;
|
||||||
|
#include maps/mp/zombies/_zm_buildables;
|
||||||
|
#include maps/mp/zombies/_zm_sidequests;
|
||||||
|
#include maps/mp/zombies/_zm_utility;
|
||||||
|
#include maps/mp/_utility;
|
||||||
|
#include common_scripts/utility;
|
||||||
|
|
||||||
|
init()
|
||||||
|
{
|
||||||
|
flag_init( "sq_gl_lantern_aquired" );
|
||||||
|
declare_sidequest_stage( "sq", "gl", ::init_stage, ::stage_logic, ::exit_stage );
|
||||||
|
level thread sq_gl_setup_buildable_trig();
|
||||||
|
}
|
||||||
|
|
||||||
|
sq_gl_setup_buildable_trig()
|
||||||
|
{
|
||||||
|
while ( !isDefined( level.sq_lamp_generator_unitrig ) )
|
||||||
|
{
|
||||||
|
wait 1;
|
||||||
|
}
|
||||||
|
level.sq_lamp_generator_unitrig.realorigin = level.sq_lamp_generator_unitrig.origin;
|
||||||
|
level.sq_lamp_generator_unitrig.origin += vectorScale( ( 0, 0, 1 ), 10000 );
|
||||||
|
}
|
||||||
|
|
||||||
|
init_stage()
|
||||||
|
{
|
||||||
|
s_start = getstruct( "sq_ghost_lamp_start", "script_noteworthy" );
|
||||||
|
gl_lantern_spawn( s_start );
|
||||||
|
if ( flag( "sq_is_max_tower_built" ) )
|
||||||
|
{
|
||||||
|
level thread stage_vo_max();
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
level thread stage_vo_ric();
|
||||||
|
}
|
||||||
|
level._cur_stage_name = "gl";
|
||||||
|
clientnotify( "gl" );
|
||||||
|
}
|
||||||
|
|
||||||
|
stage_logic()
|
||||||
|
{
|
||||||
|
/#
|
||||||
|
iprintlnbold( "GL Started" );
|
||||||
|
#/
|
||||||
|
s_start = getstruct( "sq_ghost_lamp_start", "script_noteworthy" );
|
||||||
|
gl_lantern_move( s_start );
|
||||||
|
flag_wait( "sq_gl_lantern_aquired" );
|
||||||
|
wait_network_frame();
|
||||||
|
stage_completed( "sq", level._cur_stage_name );
|
||||||
|
}
|
||||||
|
|
||||||
|
exit_stage( success )
|
||||||
|
{
|
||||||
|
}
|
||||||
|
|
||||||
|
stage_vo_max()
|
||||||
|
{
|
||||||
|
level waittill( "lantern_crashing" );
|
||||||
|
maxissay( "vox_maxi_sidequest_gl_2", level.vh_lantern );
|
||||||
|
}
|
||||||
|
|
||||||
|
stage_vo_ric()
|
||||||
|
{
|
||||||
|
richtofensay( "vox_zmba_sidequest_gl_0", 8 );
|
||||||
|
level waittill( "lantern_crashing" );
|
||||||
|
richtofensay( "vox_zmba_sidequest_gl_1", 6 );
|
||||||
|
}
|
||||||
|
|
||||||
|
gl_lantern_spawn( s_start )
|
||||||
|
{
|
||||||
|
level.vh_lantern = spawnvehicle( "tag_origin", "ghost_lantern_ai", "heli_quadrotor2_zm", s_start.origin, ( 0, 0, 1 ) );
|
||||||
|
level.vh_lantern makevehicleunusable();
|
||||||
|
level.vh_lantern setneargoalnotifydist( 128 );
|
||||||
|
level.vh_lantern.m_lantern = spawn( "script_model", level.vh_lantern.origin );
|
||||||
|
level.vh_lantern.m_lantern setmodel( "p6_zm_bu_lantern_silver_on" );
|
||||||
|
level.vh_lantern.m_lantern linkto( level.vh_lantern, "tag_origin" );
|
||||||
|
playfxontag( level._effect[ "sq_glow" ], level.vh_lantern.m_lantern, "tag_origin" );
|
||||||
|
level.vh_lantern.m_lantern playsound( "zmb_sq_glantern_impact" );
|
||||||
|
level.vh_lantern.m_lantern playloopsound( "zmb_sq_glantern_full_loop_3d" );
|
||||||
|
level.vh_lantern thread gl_lantern_damage_watcher();
|
||||||
|
wait_network_frame();
|
||||||
|
}
|
||||||
|
|
||||||
|
gl_lantern_delete()
|
||||||
|
{
|
||||||
|
if ( isDefined( level.vh_lantern ) )
|
||||||
|
{
|
||||||
|
if ( isDefined( level.vh_lantern.m_lantern ) )
|
||||||
|
{
|
||||||
|
level.vh_lantern.m_lantern delete();
|
||||||
|
}
|
||||||
|
if ( isDefined( level.vh_lantern.t_pickup ) )
|
||||||
|
{
|
||||||
|
level.vh_lantern.t_pickup delete();
|
||||||
|
}
|
||||||
|
level.vh_lantern cancelaimove();
|
||||||
|
level.vh_lantern clearvehgoalpos();
|
||||||
|
if ( isDefined( level.vh_lantern.m_link ) )
|
||||||
|
{
|
||||||
|
level.vh_lantern.m_link delete();
|
||||||
|
}
|
||||||
|
level.vh_lantern delete();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
gl_lantern_move( s_current )
|
||||||
|
{
|
||||||
|
level endon( "lantern_crashing" );
|
||||||
|
while ( 1 )
|
||||||
|
{
|
||||||
|
s_current = gl_lantern_get_next_struct( s_current );
|
||||||
|
if ( flag( "sq_is_max_tower_built" ) )
|
||||||
|
{
|
||||||
|
if ( randomint( 100 ) < 50 )
|
||||||
|
{
|
||||||
|
s_current = level.vh_lantern gl_lantern_teleport();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
level.vh_lantern gl_lantern_move_to_struct( s_current );
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
gl_lantern_get_next_struct( s_current )
|
||||||
|
{
|
||||||
|
a_struct_links = [];
|
||||||
|
a_target_structs = getstructarray( s_current.target, "targetname" );
|
||||||
|
while ( isDefined( s_current.script_string ) )
|
||||||
|
{
|
||||||
|
a_names = strtok( s_current.script_string, " " );
|
||||||
|
_a171 = a_names;
|
||||||
|
_k171 = getFirstArrayKey( _a171 );
|
||||||
|
while ( isDefined( _k171 ) )
|
||||||
|
{
|
||||||
|
str_name = _a171[ _k171 ];
|
||||||
|
a_new_structs = getstructarray( str_name, "targetname" );
|
||||||
|
a_target_structs = arraycombine( a_target_structs, a_new_structs, 0, 0 );
|
||||||
|
_k171 = getNextArrayKey( _a171, _k171 );
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return array_randomize( a_target_structs )[ 0 ];
|
||||||
|
}
|
||||||
|
|
||||||
|
gl_lantern_move_to_struct( s_goto )
|
||||||
|
{
|
||||||
|
self endon( "death" );
|
||||||
|
self endon( "delete" );
|
||||||
|
self setvehgoalpos( s_goto.origin, 1 );
|
||||||
|
self pathvariableoffset( vectorScale( ( 0, 0, 1 ), 128 ), 1 );
|
||||||
|
self waittill_either( "goal", "near_goal" );
|
||||||
|
}
|
||||||
|
|
||||||
|
gl_lantern_teleport()
|
||||||
|
{
|
||||||
|
self notify( "lantern_teleporting" );
|
||||||
|
playfx( level._effect[ "fx_wisp_lg_m" ], self.origin );
|
||||||
|
playsoundatposition( "zmb_sq_glantern_impact", self.origin );
|
||||||
|
gl_lantern_delete();
|
||||||
|
a_path_spots = getstructarray( "sq_ghost_lamp_path", "script_noteworthy" );
|
||||||
|
s_teleport_spot = array_randomize( a_path_spots )[ 0 ];
|
||||||
|
gl_lantern_spawn( s_teleport_spot );
|
||||||
|
return s_teleport_spot;
|
||||||
|
}
|
||||||
|
|
||||||
|
gl_lantern_damage_watcher()
|
||||||
|
{
|
||||||
|
self.m_lantern endon( "delete" );
|
||||||
|
self.m_lantern setcandamage( 1 );
|
||||||
|
while ( 1 )
|
||||||
|
{
|
||||||
|
self.m_lantern waittill( "damage", amount, attacker, dir, point, dmg_type );
|
||||||
|
if ( dmg_type == "MOD_GRENADE" || dmg_type == "MOD_GRENADE_SPLASH" )
|
||||||
|
{
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
}
|
||||||
|
}
|
||||||
|
self.m_lantern playsound( "zmb_sq_glantern_impact" );
|
||||||
|
self gl_lantern_crash_movement();
|
||||||
|
self thread gl_lantern_pickup_watch();
|
||||||
|
self thread gl_lantern_stop_spin_on_land();
|
||||||
|
level thread gl_lantern_respawn_wait();
|
||||||
|
level waittill( "gl_lantern_respawn" );
|
||||||
|
if ( isDefined( self.m_lantern ) )
|
||||||
|
{
|
||||||
|
s_start_spot = gl_lantern_teleport();
|
||||||
|
gl_lantern_move( s_start_spot );
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
gl_lantern_stop_spin_on_land()
|
||||||
|
{
|
||||||
|
self endon( "delete" );
|
||||||
|
while ( isDefined( self ) && length( self.velocity ) > 3 )
|
||||||
|
{
|
||||||
|
wait 0,1;
|
||||||
|
}
|
||||||
|
if ( isDefined( self ) )
|
||||||
|
{
|
||||||
|
self.m_link = spawn( "script_model", self.origin );
|
||||||
|
self.m_link setmodel( "tag_origin" );
|
||||||
|
self linkto( self.m_link );
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
gl_lantern_respawn_wait()
|
||||||
|
{
|
||||||
|
wait 30;
|
||||||
|
level notify( "gl_lantern_respawn" );
|
||||||
|
}
|
||||||
|
|
||||||
|
gl_lantern_pickup_watch()
|
||||||
|
{
|
||||||
|
self endon( "lantern_teleporting" );
|
||||||
|
self.t_pickup = spawn( "trigger_radius_use", self.origin, 0, 48, 32 );
|
||||||
|
self.t_pickup setcursorhint( "HINT_NOICON" );
|
||||||
|
self.t_pickup sethintstring( &"ZM_BURIED_SQ_LANTERN_G" );
|
||||||
|
self.t_pickup triggerignoreteam();
|
||||||
|
self.t_pickup enablelinkto();
|
||||||
|
self.t_pickup linkto( self );
|
||||||
|
self.t_pickup waittill( "trigger", player );
|
||||||
|
player player_take_piece( level.zombie_buildables[ "buried_sq_oillamp" ].buildablepieces[ 0 ] );
|
||||||
|
piece = player player_get_buildable_piece( 2 );
|
||||||
|
if ( isDefined( piece ) )
|
||||||
|
{
|
||||||
|
piece.sq_is_ghost_lamp = 1;
|
||||||
|
piece.start_origin = vectorScale( ( 0, 0, 1 ), 512 );
|
||||||
|
piece.start_angles = ( 0, 0, 1 );
|
||||||
|
}
|
||||||
|
self.t_pickup delete();
|
||||||
|
self.m_lantern delete();
|
||||||
|
self delete();
|
||||||
|
flag_set( "sq_gl_lantern_aquired" );
|
||||||
|
}
|
||||||
|
|
||||||
|
gl_lantern_crash_movement()
|
||||||
|
{
|
||||||
|
level notify( "lantern_crashing" );
|
||||||
|
self cancelaimove();
|
||||||
|
self clearvehgoalpos();
|
||||||
|
self setphysacceleration( vectorScale( ( 0, 0, 1 ), 800 ) );
|
||||||
|
hitdir = ( 0, 0, 1 );
|
||||||
|
side_dir = vectorcross( hitdir, ( 0, 0, 1 ) );
|
||||||
|
side_dir_mag = randomfloatrange( -100, 100 );
|
||||||
|
side_dir_mag += sign( side_dir_mag ) * 80;
|
||||||
|
side_dir *= side_dir_mag;
|
||||||
|
self setvehvelocity( self.velocity + vectorScale( ( 0, 0, 1 ), 100 ) + vectornormalize( side_dir ) );
|
||||||
|
ang_vel = self getangularvelocity();
|
||||||
|
ang_vel = ( ang_vel[ 0 ] * 0,3, ang_vel[ 1 ], ang_vel[ 2 ] * 0,3 );
|
||||||
|
yaw_vel = randomfloatrange( 0, 210 ) * sign( ang_vel[ 1 ] );
|
||||||
|
yaw_vel += sign( yaw_vel ) * 180;
|
||||||
|
ang_vel += ( randomfloatrange( -1, 1 ), yaw_vel, randomfloatrange( -1, 1 ) );
|
||||||
|
self setangularvelocity( ang_vel );
|
||||||
|
self.crash_accel = randomfloatrange( 75, 110 );
|
||||||
|
}
|
420
zm_buried_patch/maps/mp/zm_buried_sq_ip.gsc
Normal file
420
zm_buried_patch/maps/mp/zm_buried_sq_ip.gsc
Normal file
@ -0,0 +1,420 @@
|
|||||||
|
#include maps/mp/zombies/_zm_zonemgr;
|
||||||
|
#include maps/mp/zm_buried_sq;
|
||||||
|
#include maps/mp/zombies/_zm_sidequests;
|
||||||
|
#include maps/mp/zombies/_zm_utility;
|
||||||
|
#include maps/mp/_utility;
|
||||||
|
#include common_scripts/utility;
|
||||||
|
|
||||||
|
#using_animtree( "fxanim_props_dlc3" );
|
||||||
|
|
||||||
|
init()
|
||||||
|
{
|
||||||
|
flag_init( "sq_ip_puzzle_complete" );
|
||||||
|
level.sq_bp_buttons = [];
|
||||||
|
s_lightboard = getstruct( "zm_sq_lightboard", "targetname" );
|
||||||
|
s_lightboard sq_bp_spawn_board();
|
||||||
|
declare_sidequest_stage( "sq", "ip", ::init_stage, ::stage_logic, ::exit_stage );
|
||||||
|
}
|
||||||
|
|
||||||
|
init_stage()
|
||||||
|
{
|
||||||
|
if ( flag( "sq_is_max_tower_built" ) )
|
||||||
|
{
|
||||||
|
level thread stage_vo_max();
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
level thread stage_vo_ric();
|
||||||
|
}
|
||||||
|
level._cur_stage_name = "ip";
|
||||||
|
clientnotify( "ip" );
|
||||||
|
}
|
||||||
|
|
||||||
|
stage_vo_max()
|
||||||
|
{
|
||||||
|
s_struct = getstruct( "sq_gallows", "targetname" );
|
||||||
|
trigger = spawn( "trigger_radius", s_struct.origin, 0, 128, 72 );
|
||||||
|
m_maxis_vo_spot = spawn( "script_model", s_struct.origin );
|
||||||
|
m_maxis_vo_spot setmodel( "tag_origin" );
|
||||||
|
maxissay( "vox_maxi_sidequest_ip_0", m_maxis_vo_spot );
|
||||||
|
maxissay( "vox_maxi_sidequest_ip_1", m_maxis_vo_spot );
|
||||||
|
m_lightboard = getent( "sq_bp_board", "targetname" );
|
||||||
|
trigger = spawn( "trigger_radius", m_lightboard.origin, 0, 128, 72 );
|
||||||
|
trigger waittill( "trigger" );
|
||||||
|
maxissay( "vox_maxi_sidequest_ip_2", m_lightboard );
|
||||||
|
maxissay( "vox_maxi_sidequest_ip_3", m_lightboard );
|
||||||
|
}
|
||||||
|
|
||||||
|
stage_vo_ric()
|
||||||
|
{
|
||||||
|
richtofensay( "vox_zmba_sidequest_ip_0", 10 );
|
||||||
|
richtofensay( "vox_zmba_sidequest_ip_1", 5,5 );
|
||||||
|
richtofensay( "vox_zmba_sidequest_ip_2", 8 );
|
||||||
|
richtofensay( "vox_zmba_sidequest_ip_3", 11 );
|
||||||
|
if ( !isDefined( level.rich_sq_player ) )
|
||||||
|
{
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
while ( !level.rich_sq_player maps/mp/zombies/_zm_zonemgr::entity_in_zone( "zone_maze" ) )
|
||||||
|
{
|
||||||
|
wait 1;
|
||||||
|
}
|
||||||
|
richtofensay( "vox_zmba_sidequest_ip_4", 8 );
|
||||||
|
}
|
||||||
|
|
||||||
|
stage_logic()
|
||||||
|
{
|
||||||
|
/#
|
||||||
|
iprintlnbold( "IP Started" );
|
||||||
|
#/
|
||||||
|
if ( flag( "sq_is_max_tower_built" ) )
|
||||||
|
{
|
||||||
|
a_button_structs = getstructarray( "sq_bp_button", "targetname" );
|
||||||
|
array_thread( a_button_structs, ::sq_bp_spawn_trigger );
|
||||||
|
m_lightboard = getent( "sq_bp_board", "targetname" );
|
||||||
|
m_lightboard setclientfield( "buried_sq_bp_set_lightboard", 1 );
|
||||||
|
while ( !flag( "sq_ip_puzzle_complete" ) )
|
||||||
|
{
|
||||||
|
sq_bp_start_puzzle_lights();
|
||||||
|
sq_bp_delete_green_lights();
|
||||||
|
wait_network_frame();
|
||||||
|
wait_network_frame();
|
||||||
|
wait_network_frame();
|
||||||
|
wait_network_frame();
|
||||||
|
wait_network_frame();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else sq_ml_spawn_levers();
|
||||||
|
a_levers = getentarray( "sq_ml_lever", "targetname" );
|
||||||
|
array_thread( a_levers, ::sq_ml_spawn_trigger );
|
||||||
|
level thread sq_ml_puzzle_logic();
|
||||||
|
flag_wait( "sq_ip_puzzle_complete" );
|
||||||
|
wait_network_frame();
|
||||||
|
stage_completed( "sq", level._cur_stage_name );
|
||||||
|
}
|
||||||
|
|
||||||
|
exit_stage( success )
|
||||||
|
{
|
||||||
|
}
|
||||||
|
|
||||||
|
sq_bp_spawn_trigger()
|
||||||
|
{
|
||||||
|
level endon( "sq_ip_puzzle_complete" );
|
||||||
|
self.trig = spawn( "trigger_radius_use", self.origin, 0, 16, 16 );
|
||||||
|
self.trig setcursorhint( "HINT_NOICON" );
|
||||||
|
self.trig sethintstring( &"ZM_BURIED_SQ_BUT_U" );
|
||||||
|
self.trig triggerignoreteam();
|
||||||
|
self.trig usetriggerrequirelookat();
|
||||||
|
while ( 1 )
|
||||||
|
{
|
||||||
|
self.trig waittill( "trigger" );
|
||||||
|
self.trig sethintstring( "" );
|
||||||
|
level thread sq_bp_button_pressed( self.script_string, self.trig );
|
||||||
|
wait 1;
|
||||||
|
self.trig sethintstring( &"ZM_BURIED_SQ_BUT_U" );
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
sq_bp_spawn_board()
|
||||||
|
{
|
||||||
|
m_board = spawn( "script_model", self.origin );
|
||||||
|
m_board.angles = self.angles;
|
||||||
|
m_board setmodel( "p6_zm_bu_bulb_puzzle_machine" );
|
||||||
|
m_board.targetname = "sq_bp_board";
|
||||||
|
}
|
||||||
|
|
||||||
|
sq_bp_button_pressed( str_tag, trig )
|
||||||
|
{
|
||||||
|
if ( isDefined( level.str_sq_bp_active_light ) )
|
||||||
|
{
|
||||||
|
if ( level.str_sq_bp_active_light == str_tag )
|
||||||
|
{
|
||||||
|
trig playsound( "zmb_sq_bell_yes" );
|
||||||
|
sq_bp_light_on( str_tag, "green" );
|
||||||
|
level notify( "sq_bp_correct_button" );
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
trig playsound( "zmb_sq_bell_no" );
|
||||||
|
level notify( "sq_bp_wrong_button" );
|
||||||
|
m_light = sq_bp_light_on( str_tag, "yellow" );
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
m_light = sq_bp_light_on( str_tag, "yellow" );
|
||||||
|
trig playsound( "zmb_sq_bell_no" );
|
||||||
|
}
|
||||||
|
wait 1;
|
||||||
|
if ( isDefined( m_light ) )
|
||||||
|
{
|
||||||
|
level setclientfield( m_light, 0 );
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
sq_bp_start_puzzle_lights()
|
||||||
|
{
|
||||||
|
level endon( "sq_bp_wrong_button" );
|
||||||
|
level endon( "sq_bp_timeout" );
|
||||||
|
a_button_structs = getstructarray( "sq_bp_button", "targetname" );
|
||||||
|
a_tags = [];
|
||||||
|
_a190 = a_button_structs;
|
||||||
|
_k190 = getFirstArrayKey( _a190 );
|
||||||
|
while ( isDefined( _k190 ) )
|
||||||
|
{
|
||||||
|
m_button = _a190[ _k190 ];
|
||||||
|
a_tags[ a_tags.size ] = m_button.script_string;
|
||||||
|
_k190 = getNextArrayKey( _a190, _k190 );
|
||||||
|
}
|
||||||
|
a_tags = array_randomize( a_tags );
|
||||||
|
m_lightboard = getent( "sq_bp_board", "targetname" );
|
||||||
|
if ( !isDefined( level.t_start ) )
|
||||||
|
{
|
||||||
|
level.t_start = spawn( "trigger_radius_use", m_lightboard.origin, 0, 16, 16 );
|
||||||
|
}
|
||||||
|
level.t_start setcursorhint( "HINT_NOICON" );
|
||||||
|
level.t_start sethintstring( &"ZM_BURIED_SQ_SWIT_U" );
|
||||||
|
level.t_start triggerignoreteam();
|
||||||
|
level.t_start usetriggerrequirelookat();
|
||||||
|
level.t_start waittill( "trigger" );
|
||||||
|
level.t_start delete();
|
||||||
|
_a210 = a_tags;
|
||||||
|
_k210 = getFirstArrayKey( _a210 );
|
||||||
|
while ( isDefined( _k210 ) )
|
||||||
|
{
|
||||||
|
str_tag = _a210[ _k210 ];
|
||||||
|
wait_network_frame();
|
||||||
|
wait_network_frame();
|
||||||
|
level thread sq_bp_set_current_bulb( str_tag );
|
||||||
|
level waittill( "sq_bp_correct_button" );
|
||||||
|
_k210 = getNextArrayKey( _a210, _k210 );
|
||||||
|
}
|
||||||
|
flag_set( "sq_ip_puzzle_complete" );
|
||||||
|
a_button_structs = getstructarray( "sq_bp_button", "targetname" );
|
||||||
|
_a221 = a_button_structs;
|
||||||
|
_k221 = getFirstArrayKey( _a221 );
|
||||||
|
while ( isDefined( _k221 ) )
|
||||||
|
{
|
||||||
|
s_button = _a221[ _k221 ];
|
||||||
|
if ( isDefined( s_button.trig ) )
|
||||||
|
{
|
||||||
|
s_button.trig delete();
|
||||||
|
}
|
||||||
|
_k221 = getNextArrayKey( _a221, _k221 );
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
sq_bp_set_current_bulb( str_tag )
|
||||||
|
{
|
||||||
|
level endon( "sq_bp_correct_button" );
|
||||||
|
level endon( "sq_bp_wrong_button" );
|
||||||
|
level endon( "sq_bp_timeout" );
|
||||||
|
if ( isDefined( level.m_sq_bp_active_light ) )
|
||||||
|
{
|
||||||
|
level.str_sq_bp_active_light = "";
|
||||||
|
}
|
||||||
|
level.m_sq_bp_active_light = sq_bp_light_on( str_tag, "yellow" );
|
||||||
|
level.str_sq_bp_active_light = str_tag;
|
||||||
|
wait 10;
|
||||||
|
level notify( "sq_bp_timeout" );
|
||||||
|
}
|
||||||
|
|
||||||
|
sq_bp_delete_green_lights()
|
||||||
|
{
|
||||||
|
a_button_structs = getstructarray( "sq_bp_button", "targetname" );
|
||||||
|
_a251 = a_button_structs;
|
||||||
|
_k251 = getFirstArrayKey( _a251 );
|
||||||
|
while ( isDefined( _k251 ) )
|
||||||
|
{
|
||||||
|
m_button = _a251[ _k251 ];
|
||||||
|
str_clientfield = "buried_sq_bp_" + m_button.script_string;
|
||||||
|
level setclientfield( str_clientfield, 0 );
|
||||||
|
_k251 = getNextArrayKey( _a251, _k251 );
|
||||||
|
}
|
||||||
|
if ( isDefined( level.m_sq_bp_active_light ) )
|
||||||
|
{
|
||||||
|
level.str_sq_bp_active_light = "";
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
sq_bp_light_on( str_tag, str_color )
|
||||||
|
{
|
||||||
|
str_clientfield = "buried_sq_bp_" + str_tag;
|
||||||
|
n_color = 1;
|
||||||
|
if ( str_color == "green" )
|
||||||
|
{
|
||||||
|
n_color = 2;
|
||||||
|
}
|
||||||
|
level setclientfield( str_clientfield, 0 );
|
||||||
|
wait_network_frame();
|
||||||
|
level setclientfield( str_clientfield, n_color );
|
||||||
|
return str_clientfield;
|
||||||
|
}
|
||||||
|
|
||||||
|
debug_tag( str_tag )
|
||||||
|
{
|
||||||
|
/#
|
||||||
|
self endon( "death" );
|
||||||
|
while ( 1 )
|
||||||
|
{
|
||||||
|
debugstar( self gettagorigin( str_tag ), 1, ( 0, 1, 0 ) );
|
||||||
|
wait 0,05;
|
||||||
|
#/
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
sq_ml_spawn_lever( n_index )
|
||||||
|
{
|
||||||
|
m_lever = spawn( "script_model", ( 0, 1, 0 ) );
|
||||||
|
m_lever setmodel( self.model );
|
||||||
|
m_lever.targetname = "sq_ml_lever";
|
||||||
|
while ( 1 )
|
||||||
|
{
|
||||||
|
v_spot = self.origin;
|
||||||
|
v_angles = self.angles;
|
||||||
|
if ( isDefined( level._maze._active_perm_list[ n_index ] ) )
|
||||||
|
{
|
||||||
|
is_flip = randomint( 2 );
|
||||||
|
s_spot = getstruct( level._maze._active_perm_list[ n_index ], "script_noteworthy" );
|
||||||
|
v_right = anglesToRight( s_spot.angles );
|
||||||
|
v_offset = vectornormalize( v_right ) * 2;
|
||||||
|
if ( is_flip )
|
||||||
|
{
|
||||||
|
v_offset *= -1;
|
||||||
|
}
|
||||||
|
v_spot = s_spot.origin + vectorScale( ( 0, 1, 0 ), 48 ) + v_offset;
|
||||||
|
v_angles = s_spot.angles + vectorScale( ( 0, 1, 0 ), 90 );
|
||||||
|
if ( is_flip )
|
||||||
|
{
|
||||||
|
v_angles = s_spot.angles - vectorScale( ( 0, 1, 0 ), 90 );
|
||||||
|
}
|
||||||
|
}
|
||||||
|
m_lever.origin = v_spot;
|
||||||
|
m_lever.angles = v_angles;
|
||||||
|
/#
|
||||||
|
m_lever thread sq_ml_show_lever_debug( v_spot, n_index );
|
||||||
|
#/
|
||||||
|
level waittill( "zm_buried_maze_changed" );
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
sq_ml_show_lever_debug( v_spot, n_index )
|
||||||
|
{
|
||||||
|
level endon( "zm_buried_maze_changed" );
|
||||||
|
/#
|
||||||
|
while ( 1 )
|
||||||
|
{
|
||||||
|
line( self.origin, v_spot, ( 0, 1, 0 ) );
|
||||||
|
print3d( self.origin, "" + n_index, ( 0, 1, 0 ), 1, 2 );
|
||||||
|
wait 0,05;
|
||||||
|
#/
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
sq_ml_spawn_trigger()
|
||||||
|
{
|
||||||
|
v_right = anglesToForward( self.angles );
|
||||||
|
v_offset = vectornormalize( v_right ) * 8;
|
||||||
|
self.trig = spawn( "trigger_box_use", self.origin - v_offset, 0, 16, 16, 16 );
|
||||||
|
self.trig enablelinkto();
|
||||||
|
self.trig linkto( self );
|
||||||
|
self.trig setcursorhint( "HINT_NOICON" );
|
||||||
|
self.trig sethintstring( &"ZM_BURIED_SQ_SWIT_U" );
|
||||||
|
self.trig triggerignoreteam();
|
||||||
|
self.trig usetriggerrequirelookat();
|
||||||
|
self.is_flipped = 0;
|
||||||
|
self useanimtree( -1 );
|
||||||
|
while ( 1 )
|
||||||
|
{
|
||||||
|
self.trig waittill( "trigger" );
|
||||||
|
self setanim( level.maze_switch_anim[ "switch_down" ] );
|
||||||
|
self.trig sethintstring( "" );
|
||||||
|
self.is_flipped = 1;
|
||||||
|
self.n_flip_number = level.sq_ml_curr_lever;
|
||||||
|
level.sq_ml_curr_lever++;
|
||||||
|
self.trig playsound( "zmb_sq_maze_switch" );
|
||||||
|
level waittill( "sq_ml_reset_levers" );
|
||||||
|
self setanim( level.maze_switch_anim[ "switch_up" ] );
|
||||||
|
self.trig sethintstring( &"ZM_BURIED_SQ_SWIT_U" );
|
||||||
|
self.is_flipped = 0;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
sq_ml_spawn_levers()
|
||||||
|
{
|
||||||
|
if ( maps/mp/zombies/_zm_zonemgr::player_in_zone( "zone_maze" ) )
|
||||||
|
{
|
||||||
|
level waittill( "zm_buried_maze_changed" );
|
||||||
|
}
|
||||||
|
a_lever_structs = getstructarray( "sq_maze_lever", "targetname" );
|
||||||
|
i = 0;
|
||||||
|
while ( i < a_lever_structs.size )
|
||||||
|
{
|
||||||
|
a_lever_structs[ i ] thread sq_ml_spawn_lever( i );
|
||||||
|
i++;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
sq_ml_puzzle_logic()
|
||||||
|
{
|
||||||
|
a_levers = getentarray( "sq_ml_lever", "targetname" );
|
||||||
|
level.sq_ml_curr_lever = 0;
|
||||||
|
a_levers = array_randomize( a_levers );
|
||||||
|
i = 0;
|
||||||
|
while ( i < a_levers.size )
|
||||||
|
{
|
||||||
|
a_levers[ i ].n_lever_order = i;
|
||||||
|
i++;
|
||||||
|
}
|
||||||
|
while ( 1 )
|
||||||
|
{
|
||||||
|
level.sq_ml_curr_lever = 0;
|
||||||
|
sq_ml_puzzle_wait_for_levers();
|
||||||
|
n_correct = 0;
|
||||||
|
_a424 = a_levers;
|
||||||
|
_k424 = getFirstArrayKey( _a424 );
|
||||||
|
while ( isDefined( _k424 ) )
|
||||||
|
{
|
||||||
|
m_lever = _a424[ _k424 ];
|
||||||
|
if ( m_lever.n_flip_number == m_lever.n_lever_order )
|
||||||
|
{
|
||||||
|
playfxontag( level._effect[ "sq_spark" ], m_lever, "tag_origin" );
|
||||||
|
n_correct++;
|
||||||
|
m_lever playsound( "zmb_sq_maze_correct_spark" );
|
||||||
|
}
|
||||||
|
_k424 = getNextArrayKey( _a424, _k424 );
|
||||||
|
}
|
||||||
|
/#
|
||||||
|
iprintlnbold( "Levers Correct: " + n_correct );
|
||||||
|
#/
|
||||||
|
if ( n_correct == a_levers.size )
|
||||||
|
{
|
||||||
|
flag_set( "sq_ip_puzzle_complete" );
|
||||||
|
}
|
||||||
|
level waittill( "zm_buried_maze_changed" );
|
||||||
|
level notify( "sq_ml_reset_levers" );
|
||||||
|
wait 1;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
sq_ml_puzzle_wait_for_levers()
|
||||||
|
{
|
||||||
|
a_levers = getentarray( "sq_ml_lever", "targetname" );
|
||||||
|
are_all_flipped = 0;
|
||||||
|
while ( !are_all_flipped )
|
||||||
|
{
|
||||||
|
are_all_flipped = 1;
|
||||||
|
_a458 = a_levers;
|
||||||
|
_k458 = getFirstArrayKey( _a458 );
|
||||||
|
while ( isDefined( _k458 ) )
|
||||||
|
{
|
||||||
|
m_lever = _a458[ _k458 ];
|
||||||
|
if ( m_lever.is_flipped == 0 )
|
||||||
|
{
|
||||||
|
are_all_flipped = 0;
|
||||||
|
}
|
||||||
|
_k458 = getNextArrayKey( _a458, _k458 );
|
||||||
|
}
|
||||||
|
wait 1;
|
||||||
|
}
|
||||||
|
}
|
102
zm_buried_patch/maps/mp/zm_buried_sq_ll.gsc
Normal file
102
zm_buried_patch/maps/mp/zm_buried_sq_ll.gsc
Normal file
@ -0,0 +1,102 @@
|
|||||||
|
#include maps/mp/zm_buried_sq;
|
||||||
|
#include maps/mp/zombies/_zm_sidequests;
|
||||||
|
#include maps/mp/zombies/_zm_utility;
|
||||||
|
#include maps/mp/_utility;
|
||||||
|
#include common_scripts/utility;
|
||||||
|
|
||||||
|
init()
|
||||||
|
{
|
||||||
|
flag_init( "sq_ll_generator_on" );
|
||||||
|
declare_sidequest_stage( "sq", "ll", ::init_stage, ::stage_logic, ::exit_stage );
|
||||||
|
}
|
||||||
|
|
||||||
|
init_stage()
|
||||||
|
{
|
||||||
|
level._cur_stage_name = "ll";
|
||||||
|
clientnotify( "ll" );
|
||||||
|
}
|
||||||
|
|
||||||
|
stage_logic()
|
||||||
|
{
|
||||||
|
/#
|
||||||
|
iprintlnbold( "LL Started" );
|
||||||
|
#/
|
||||||
|
if ( !isDefined( level.generator_power_states_color ) )
|
||||||
|
{
|
||||||
|
level.generator_power_states_color = 0;
|
||||||
|
}
|
||||||
|
sq_ll_show_code();
|
||||||
|
wait_network_frame();
|
||||||
|
stage_completed( "sq", level._cur_stage_name );
|
||||||
|
}
|
||||||
|
|
||||||
|
sq_ll_show_code()
|
||||||
|
{
|
||||||
|
a_spots = getstructarray( "sq_code_pos", "targetname" );
|
||||||
|
a_signs = getentarray( "sq_tunnel_sign", "targetname" );
|
||||||
|
a_codes = [];
|
||||||
|
_a50 = a_signs;
|
||||||
|
_k50 = getFirstArrayKey( _a50 );
|
||||||
|
while ( isDefined( _k50 ) )
|
||||||
|
{
|
||||||
|
m_sign = _a50[ _k50 ];
|
||||||
|
if ( flag( "sq_is_max_tower_built" ) )
|
||||||
|
{
|
||||||
|
if ( isDefined( m_sign.is_max_sign ) )
|
||||||
|
{
|
||||||
|
a_codes[ a_codes.size ] = m_sign.model + "_code";
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
if ( isDefined( m_sign.is_ric_sign ) )
|
||||||
|
{
|
||||||
|
a_codes[ a_codes.size ] = m_sign.model + "_code";
|
||||||
|
}
|
||||||
|
}
|
||||||
|
_k50 = getNextArrayKey( _a50, _k50 );
|
||||||
|
}
|
||||||
|
i = 0;
|
||||||
|
while ( i < a_codes.size )
|
||||||
|
{
|
||||||
|
if ( a_codes[ i ] == "p6_zm_bu_sign_tunnel_consumption_code" )
|
||||||
|
{
|
||||||
|
a_codes[ i ] = "p6_zm_bu_sign_tunnel_consump_code";
|
||||||
|
}
|
||||||
|
i++;
|
||||||
|
}
|
||||||
|
i = 0;
|
||||||
|
while ( i < a_codes.size )
|
||||||
|
{
|
||||||
|
m_code = spawn( "script_model", a_spots[ i ].origin );
|
||||||
|
m_code.angles = a_spots[ i ].angles;
|
||||||
|
m_code setmodel( a_codes[ i ] );
|
||||||
|
i++;
|
||||||
|
}
|
||||||
|
if ( flag( "sq_is_max_tower_built" ) )
|
||||||
|
{
|
||||||
|
level thread sq_ll_show_code_vo_max();
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
level thread sq_ll_show_code_vo_ric();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
exit_stage( success )
|
||||||
|
{
|
||||||
|
}
|
||||||
|
|
||||||
|
sq_ll_show_code_vo_max()
|
||||||
|
{
|
||||||
|
a_signs = getentarray( "sq_tunnel_sign", "targetname" );
|
||||||
|
maxissay( "vox_maxi_sidequest_signs_0", a_signs[ 0 ] );
|
||||||
|
maxissay( "vox_maxi_sidequest_signs_1", a_signs[ 0 ] );
|
||||||
|
}
|
||||||
|
|
||||||
|
sq_ll_show_code_vo_ric()
|
||||||
|
{
|
||||||
|
richtofensay( "vox_zmba_sidequest_signs_0", 7 );
|
||||||
|
richtofensay( "vox_zmba_sidequest_signs_1", 10 );
|
||||||
|
richtofensay( "vox_zmba_sidequest_signs_2", 9 );
|
||||||
|
}
|
204
zm_buried_patch/maps/mp/zm_buried_sq_mta.gsc
Normal file
204
zm_buried_patch/maps/mp/zm_buried_sq_mta.gsc
Normal file
@ -0,0 +1,204 @@
|
|||||||
|
#include maps/mp/zm_buried_sq;
|
||||||
|
#include maps/mp/zombies/_zm_sidequests;
|
||||||
|
#include maps/mp/zombies/_zm_utility;
|
||||||
|
#include maps/mp/_utility;
|
||||||
|
#include common_scripts/utility;
|
||||||
|
|
||||||
|
init()
|
||||||
|
{
|
||||||
|
flag_init( "sq_amplifiers_on" );
|
||||||
|
a_amp_structs = getstructarray( "sq_amplifier_spot" );
|
||||||
|
_a16 = a_amp_structs;
|
||||||
|
_k16 = getFirstArrayKey( _a16 );
|
||||||
|
while ( isDefined( _k16 ) )
|
||||||
|
{
|
||||||
|
s_amp_spot = _a16[ _k16 ];
|
||||||
|
m_amplifier = spawn( "script_model", s_amp_spot.origin );
|
||||||
|
m_amplifier thread mta_amplifier_init();
|
||||||
|
_k16 = getNextArrayKey( _a16, _k16 );
|
||||||
|
}
|
||||||
|
declare_sidequest_stage( "sq", "mta", ::init_stage, ::stage_logic, ::exit_stage );
|
||||||
|
}
|
||||||
|
|
||||||
|
init_stage()
|
||||||
|
{
|
||||||
|
a_amplifiers = getentarray( "sq_amplifier", "targetname" );
|
||||||
|
array_thread( a_amplifiers, ::mta_amplifier_found_watcher );
|
||||||
|
level thread stage_vo_max();
|
||||||
|
level thread stage_vo_ric();
|
||||||
|
level._cur_stage_name = "mta";
|
||||||
|
clientnotify( "mta" );
|
||||||
|
}
|
||||||
|
|
||||||
|
stage_logic()
|
||||||
|
{
|
||||||
|
/#
|
||||||
|
iprintlnbold( "MTA Started" );
|
||||||
|
#/
|
||||||
|
flag_wait_any( "sq_amplifiers_on", "sq_amplifiers_broken" );
|
||||||
|
wait_network_frame();
|
||||||
|
stage_completed( "sq", level._cur_stage_name );
|
||||||
|
}
|
||||||
|
|
||||||
|
exit_stage( success )
|
||||||
|
{
|
||||||
|
}
|
||||||
|
|
||||||
|
stage_vo_max()
|
||||||
|
{
|
||||||
|
level thread stage_vo_max_amp_broken();
|
||||||
|
level waittill( "mta_amp_found", amp );
|
||||||
|
maxissay( "vox_maxi_sidequest_amp_0", amp );
|
||||||
|
maxissay( "vox_maxi_sidequest_amp_1", amp );
|
||||||
|
}
|
||||||
|
|
||||||
|
stage_vo_max_amp_broken()
|
||||||
|
{
|
||||||
|
level waittill( "mta_amp_broken", amp );
|
||||||
|
maxissay( "vox_maxi_sidequest_amp_2", amp );
|
||||||
|
level waittill( "mta_amp_broken", amp );
|
||||||
|
maxissay( "vox_maxi_sidequest_amp_3", amp );
|
||||||
|
level waittill( "mta_amp_broken", amp );
|
||||||
|
maxissay( "vox_maxi_sidequest_amp_4", amp );
|
||||||
|
level waittill( "mta_amp_broken", amp );
|
||||||
|
maxissay( "vox_maxi_sidequest_amp_5", amp );
|
||||||
|
maxissay( "vox_maxi_sidequest_gl_0", amp );
|
||||||
|
maxissay( "vox_maxi_sidequest_gl_1", amp );
|
||||||
|
}
|
||||||
|
|
||||||
|
stage_vo_ric()
|
||||||
|
{
|
||||||
|
level thread stage_vo_ric_amp_amplified();
|
||||||
|
level waittill( "mta_amp_found_by_sam" );
|
||||||
|
richtofensay( "vox_zmba_sidequest_amp_0", 10 );
|
||||||
|
richtofensay( "vox_zmba_sidequest_amp_1", 7 );
|
||||||
|
}
|
||||||
|
|
||||||
|
stage_vo_ric_amp_amplified()
|
||||||
|
{
|
||||||
|
level waittill( "mta_amp_amplified" );
|
||||||
|
richtofensay( "vox_zmba_sidequest_amp_2", 6 );
|
||||||
|
richtofensay( "vox_zmba_sidequest_amp_3", 4 );
|
||||||
|
}
|
||||||
|
|
||||||
|
mta_amplifier_found_watcher()
|
||||||
|
{
|
||||||
|
self endon( "damaged_by_subwoofer" );
|
||||||
|
self endon( "amplifier_filled" );
|
||||||
|
if ( self.amplifier_state != "base" )
|
||||||
|
{
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
trigger = spawn( "trigger_radius", self.origin, 0, 128, 72 );
|
||||||
|
trigger waittill( "trigger", who );
|
||||||
|
if ( isDefined( level.rich_sq_player ) && who == level.rich_sq_player )
|
||||||
|
{
|
||||||
|
level notify( "mta_amp_found_by_sam" );
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
level notify( "mta_amp_found" );
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
mta_amplifier_init()
|
||||||
|
{
|
||||||
|
self setmodel( "p6_zm_bu_ether_amplifier" );
|
||||||
|
self.targetname = "sq_amplifier";
|
||||||
|
self.script_noteworthy = "subwoofer_target";
|
||||||
|
self.amplifier_state = "base";
|
||||||
|
self playloopsound( "zmb_sq_amplifier_empty_loop", 1 );
|
||||||
|
self setcandamage( 1 );
|
||||||
|
self thread mta_amplifier_subwoofer_watch();
|
||||||
|
self mta_amplifier_damage_watch();
|
||||||
|
}
|
||||||
|
|
||||||
|
mta_amplifier_subwoofer_watch()
|
||||||
|
{
|
||||||
|
self waittill( "damaged_by_subwoofer" );
|
||||||
|
/#
|
||||||
|
iprintlnbold( "Amplifier Broken" );
|
||||||
|
#/
|
||||||
|
self.amplifier_state = "broken";
|
||||||
|
self setmodel( "p6_zm_bu_ether_amplifier_dmg" );
|
||||||
|
self stoploopsound( 0,1 );
|
||||||
|
self playsound( "zmb_sq_amplifier_destroy" );
|
||||||
|
level notify( "mta_amp_broken" );
|
||||||
|
mta_check_all_amplifier_states();
|
||||||
|
}
|
||||||
|
|
||||||
|
mta_amplifier_damage_watch()
|
||||||
|
{
|
||||||
|
self endon( "damaged_by_subwoofer" );
|
||||||
|
n_slowgun_count = 0;
|
||||||
|
while ( 1 )
|
||||||
|
{
|
||||||
|
self waittill( "damage", n_damage, e_attacker, v_direction, v_point, str_type, str_tag, str_model, str_part, str_weapon );
|
||||||
|
if ( str_weapon == "slowgun_zm" || str_weapon == "slowgun_upgraded_zm" )
|
||||||
|
{
|
||||||
|
n_slowgun_count++;
|
||||||
|
shader_amount = linear_map( n_slowgun_count, 0, 25, 0, 1 );
|
||||||
|
self setclientfield( "AmplifierShaderConstant", shader_amount );
|
||||||
|
if ( n_slowgun_count >= 25 )
|
||||||
|
{
|
||||||
|
/#
|
||||||
|
iprintlnbold( "Amplifier Filled" );
|
||||||
|
#/
|
||||||
|
self thread mta_amplifier_filled_fx();
|
||||||
|
self.amplifier_state = "filled";
|
||||||
|
self playsound( "zmb_sq_amplifier_fill" );
|
||||||
|
self playloopsound( "zmb_sq_amplifier_full_loop", 1 );
|
||||||
|
self notify( "amplifier_filled" );
|
||||||
|
level notify( "mta_amp_amplified" );
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
wait_network_frame();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
mta_check_all_amplifier_states();
|
||||||
|
}
|
||||||
|
|
||||||
|
mta_amplifier_filled_fx()
|
||||||
|
{
|
||||||
|
while ( 1 )
|
||||||
|
{
|
||||||
|
playfx( level._effect[ "sq_ether_amp_trail" ], self.origin + vectorScale( ( 0, 0, 1 ), 46 ) );
|
||||||
|
wait 1;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
mta_check_all_amplifier_states()
|
||||||
|
{
|
||||||
|
is_all_broken = 1;
|
||||||
|
is_all_filled = 1;
|
||||||
|
a_amplifiers = getentarray( "sq_amplifier", "targetname" );
|
||||||
|
_a226 = a_amplifiers;
|
||||||
|
_k226 = getFirstArrayKey( _a226 );
|
||||||
|
while ( isDefined( _k226 ) )
|
||||||
|
{
|
||||||
|
m_amplifier = _a226[ _k226 ];
|
||||||
|
if ( m_amplifier.amplifier_state != "filled" )
|
||||||
|
{
|
||||||
|
is_all_filled = 0;
|
||||||
|
}
|
||||||
|
if ( m_amplifier.amplifier_state != "broken" )
|
||||||
|
{
|
||||||
|
is_all_broken = 0;
|
||||||
|
}
|
||||||
|
_k226 = getNextArrayKey( _a226, _k226 );
|
||||||
|
}
|
||||||
|
if ( is_all_filled )
|
||||||
|
{
|
||||||
|
flag_set( "sq_amplifiers_on" );
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
if ( is_all_broken )
|
||||||
|
{
|
||||||
|
flag_set( "sq_amplifiers_broken" );
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
223
zm_buried_patch/maps/mp/zm_buried_sq_ows.gsc
Normal file
223
zm_buried_patch/maps/mp/zm_buried_sq_ows.gsc
Normal file
@ -0,0 +1,223 @@
|
|||||||
|
#include maps/mp/zm_buried_sq;
|
||||||
|
#include maps/mp/zombies/_zm_sidequests;
|
||||||
|
#include maps/mp/zombies/_zm_utility;
|
||||||
|
#include maps/mp/_utility;
|
||||||
|
#include common_scripts/utility;
|
||||||
|
|
||||||
|
init()
|
||||||
|
{
|
||||||
|
flag_init( "sq_ows_start" );
|
||||||
|
flag_init( "sq_ows_target_missed" );
|
||||||
|
flag_init( "sq_ows_success" );
|
||||||
|
declare_sidequest_stage( "sq", "ows", ::init_stage, ::stage_logic, ::exit_stage );
|
||||||
|
}
|
||||||
|
|
||||||
|
init_stage()
|
||||||
|
{
|
||||||
|
if ( flag( "sq_is_max_tower_built" ) )
|
||||||
|
{
|
||||||
|
level thread stage_vo_max();
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
level thread stage_vo_ric();
|
||||||
|
}
|
||||||
|
level._cur_stage_name = "ows";
|
||||||
|
clientnotify( "ows" );
|
||||||
|
}
|
||||||
|
|
||||||
|
stage_vo_max()
|
||||||
|
{
|
||||||
|
m_lightboard = getent( "sq_bp_board", "targetname" );
|
||||||
|
maxissay( "vox_maxi_sidequest_ip_4", m_lightboard );
|
||||||
|
}
|
||||||
|
|
||||||
|
stage_vo_ric()
|
||||||
|
{
|
||||||
|
richtofensay( "vox_zmba_sidequest_ip_5", 8 );
|
||||||
|
richtofensay( "vox_zmba_sidequest_ip_6", 8 );
|
||||||
|
richtofensay( "vox_zmba_sidequest_ip_7", 11 );
|
||||||
|
}
|
||||||
|
|
||||||
|
stage_logic()
|
||||||
|
{
|
||||||
|
/#
|
||||||
|
iprintlnbold( "OWS Started" );
|
||||||
|
#/
|
||||||
|
while ( !flag( "sq_ows_success" ) )
|
||||||
|
{
|
||||||
|
level thread ows_fountain_wait();
|
||||||
|
flag_wait( "sq_ows_start" );
|
||||||
|
ows_targets_start();
|
||||||
|
flag_clear( "sq_ows_start" );
|
||||||
|
}
|
||||||
|
stage_completed( "sq", level._cur_stage_name );
|
||||||
|
}
|
||||||
|
|
||||||
|
exit_stage( success )
|
||||||
|
{
|
||||||
|
}
|
||||||
|
|
||||||
|
ows_fountain_wait()
|
||||||
|
{
|
||||||
|
level endon( "sq_ows_start" );
|
||||||
|
s_fountain_spot = getstruct( "sq_ows_fountain", "targetname" );
|
||||||
|
t_fountain = spawn( "trigger_radius_use", s_fountain_spot.origin, 0, 55, 64 );
|
||||||
|
t_fountain setcursorhint( "HINT_NOICON" );
|
||||||
|
t_fountain sethintstring( &"ZM_BURIED_SQ_FOUNT_U" );
|
||||||
|
t_fountain triggerignoreteam();
|
||||||
|
t_fountain usetriggerrequirelookat();
|
||||||
|
t_fountain waittill( "trigger" );
|
||||||
|
t_fountain playsound( "zmb_sq_coin_toss" );
|
||||||
|
t_fountain delete();
|
||||||
|
flag_set( "sq_ows_start" );
|
||||||
|
}
|
||||||
|
|
||||||
|
ows_targets_start()
|
||||||
|
{
|
||||||
|
n_cur_second = 0;
|
||||||
|
flag_clear( "sq_ows_target_missed" );
|
||||||
|
level thread sndsidequestowsmusic();
|
||||||
|
a_sign_spots = getstructarray( "otw_target_spot", "script_noteworthy" );
|
||||||
|
while ( n_cur_second < 40 )
|
||||||
|
{
|
||||||
|
a_spawn_spots = ows_targets_get_cur_spots( n_cur_second );
|
||||||
|
if ( isDefined( a_spawn_spots ) && a_spawn_spots.size > 0 )
|
||||||
|
{
|
||||||
|
ows_targets_spawn( a_spawn_spots );
|
||||||
|
}
|
||||||
|
wait 1;
|
||||||
|
n_cur_second++;
|
||||||
|
}
|
||||||
|
if ( !flag( "sq_ows_target_missed" ) )
|
||||||
|
{
|
||||||
|
flag_set( "sq_ows_success" );
|
||||||
|
playsoundatposition( "zmb_sq_target_success", ( 0, 0, 0 ) );
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
playsoundatposition( "zmb_sq_target_fail", ( 0, 0, 0 ) );
|
||||||
|
}
|
||||||
|
level notify( "sndEndOWSMusic" );
|
||||||
|
}
|
||||||
|
|
||||||
|
ows_targets_get_cur_spots( n_time )
|
||||||
|
{
|
||||||
|
a_target_spots = getstructarray( "otw_target_spot", "script_noteworthy" );
|
||||||
|
a_to_spawn = [];
|
||||||
|
str_time = "" + n_time;
|
||||||
|
_a133 = a_target_spots;
|
||||||
|
_k133 = getFirstArrayKey( _a133 );
|
||||||
|
while ( isDefined( _k133 ) )
|
||||||
|
{
|
||||||
|
s_spot = _a133[ _k133 ];
|
||||||
|
if ( isDefined( s_spot.script_string ) )
|
||||||
|
{
|
||||||
|
a_spawn_times = strtok( s_spot.script_string, " " );
|
||||||
|
if ( isinarray( a_spawn_times, str_time ) )
|
||||||
|
{
|
||||||
|
a_to_spawn[ a_to_spawn.size ] = s_spot;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
_k133 = getNextArrayKey( _a133, _k133 );
|
||||||
|
}
|
||||||
|
return a_to_spawn;
|
||||||
|
}
|
||||||
|
|
||||||
|
ows_targets_spawn( a_spawn_spots )
|
||||||
|
{
|
||||||
|
_a151 = a_spawn_spots;
|
||||||
|
_k151 = getFirstArrayKey( _a151 );
|
||||||
|
while ( isDefined( _k151 ) )
|
||||||
|
{
|
||||||
|
s_spot = _a151[ _k151 ];
|
||||||
|
m_target = spawn( "script_model", s_spot.origin );
|
||||||
|
m_target.angles = s_spot.angles;
|
||||||
|
m_target setmodel( "p6_zm_bu_target" );
|
||||||
|
m_target ghost();
|
||||||
|
wait_network_frame();
|
||||||
|
m_target show();
|
||||||
|
playfxontag( level._effect[ "sq_spawn" ], m_target, "tag_origin" );
|
||||||
|
m_target playsound( "zmb_sq_target_spawn" );
|
||||||
|
if ( isDefined( s_spot.target ) )
|
||||||
|
{
|
||||||
|
m_target thread ows_target_move( s_spot.target );
|
||||||
|
}
|
||||||
|
m_target thread ows_target_think();
|
||||||
|
m_target thread sndhit();
|
||||||
|
m_target thread sndtime();
|
||||||
|
_k151 = getNextArrayKey( _a151, _k151 );
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
ows_target_think()
|
||||||
|
{
|
||||||
|
self setcandamage( 1 );
|
||||||
|
self thread ows_target_delete_timer();
|
||||||
|
self waittill_either( "ows_target_timeout", "damage" );
|
||||||
|
if ( isDefined( self.m_linker ) )
|
||||||
|
{
|
||||||
|
self unlink();
|
||||||
|
self.m_linker delete();
|
||||||
|
}
|
||||||
|
self rotatepitch( -90, 0,15, 0,05, 0,05 );
|
||||||
|
self waittill( "rotatedone" );
|
||||||
|
self delete();
|
||||||
|
}
|
||||||
|
|
||||||
|
ows_target_move( str_target )
|
||||||
|
{
|
||||||
|
s_target = getstruct( str_target, "targetname" );
|
||||||
|
self.m_linker = spawn( "script_model", self.origin );
|
||||||
|
self.m_linker.angles = self.angles;
|
||||||
|
self linkto( self.m_linker );
|
||||||
|
self.m_linker moveto( s_target.origin, 4, 0,05, 0,05 );
|
||||||
|
}
|
||||||
|
|
||||||
|
ows_target_delete_timer()
|
||||||
|
{
|
||||||
|
self endon( "death" );
|
||||||
|
wait 4;
|
||||||
|
self notify( "ows_target_timeout" );
|
||||||
|
flag_set( "sq_ows_target_missed" );
|
||||||
|
/#
|
||||||
|
iprintlnbold( "missed target! step failed. target @ " + self.origin );
|
||||||
|
#/
|
||||||
|
}
|
||||||
|
|
||||||
|
sndsidequestowsmusic()
|
||||||
|
{
|
||||||
|
while ( is_true( level.music_override ) )
|
||||||
|
{
|
||||||
|
wait 0,1;
|
||||||
|
}
|
||||||
|
level.music_override = 1;
|
||||||
|
level setclientfield( "mus_zmb_egg_snapshot_loop", 1 );
|
||||||
|
ent = spawn( "script_origin", ( 0, 0, 0 ) );
|
||||||
|
ent playloopsound( "mus_sidequest_ows" );
|
||||||
|
level waittill( "sndEndOWSMusic" );
|
||||||
|
level setclientfield( "mus_zmb_egg_snapshot_loop", 0 );
|
||||||
|
level.music_override = 0;
|
||||||
|
ent stoploopsound( 4 );
|
||||||
|
if ( !flag( "sq_ows_success" ) )
|
||||||
|
{
|
||||||
|
wait 0,5;
|
||||||
|
ent playsound( "mus_sidequest_0" );
|
||||||
|
}
|
||||||
|
wait 3,5;
|
||||||
|
ent delete();
|
||||||
|
}
|
||||||
|
|
||||||
|
sndhit()
|
||||||
|
{
|
||||||
|
self endon( "ows_target_timeout" );
|
||||||
|
self waittill( "damage" );
|
||||||
|
self playsound( "zmb_sq_target_hit" );
|
||||||
|
}
|
||||||
|
|
||||||
|
sndtime()
|
||||||
|
{
|
||||||
|
self endon( "zmb_sq_target_hit" );
|
||||||
|
self waittill( "ows_target_timeout" );
|
||||||
|
self playsound( "zmb_sq_target_flip" );
|
||||||
|
}
|
696
zm_buried_patch/maps/mp/zm_buried_sq_tpo.gsc
Normal file
696
zm_buried_patch/maps/mp/zm_buried_sq_tpo.gsc
Normal file
@ -0,0 +1,696 @@
|
|||||||
|
#include maps/mp/zm_buried_buildables;
|
||||||
|
#include maps/mp/zombies/_zm_unitrigger;
|
||||||
|
#include maps/mp/zombies/_zm_weap_time_bomb;
|
||||||
|
#include maps/mp/zm_buried_sq;
|
||||||
|
#include maps/mp/zombies/_zm;
|
||||||
|
#include maps/mp/zombies/_zm_buildables;
|
||||||
|
#include maps/mp/gametypes_zm/_hud_util;
|
||||||
|
#include maps/mp/_visionset_mgr;
|
||||||
|
#include maps/mp/zombies/_zm_sidequests;
|
||||||
|
#include maps/mp/zombies/_zm_utility;
|
||||||
|
#include maps/mp/_utility;
|
||||||
|
#include common_scripts/utility;
|
||||||
|
|
||||||
|
#using_animtree( "zm_buried_props" );
|
||||||
|
|
||||||
|
init()
|
||||||
|
{
|
||||||
|
declare_sidequest_stage( "sq", "tpo", ::init_stage, ::stage_logic, ::exit_stage );
|
||||||
|
flag_init( "sq_tpo_time_bomb_in_valid_location" );
|
||||||
|
flag_init( "sq_tpo_players_in_position_for_time_warp" );
|
||||||
|
flag_init( "sq_tpo_special_round_active" );
|
||||||
|
flag_init( "sq_tpo_found_item" );
|
||||||
|
flag_init( "sq_tpo_generator_powered" );
|
||||||
|
flag_init( "sq_wisp_saved_with_time_bomb" );
|
||||||
|
flag_init( "sq_tpo_stage_started" );
|
||||||
|
maps/mp/zombies/_zm_weap_time_bomb::time_bomb_add_custom_func_global_save( ::time_bomb_saves_wisp_state );
|
||||||
|
maps/mp/zombies/_zm_weap_time_bomb::time_bomb_add_custom_func_global_restore( ::time_bomb_restores_wisp_state );
|
||||||
|
/#
|
||||||
|
level thread debug_give_piece();
|
||||||
|
#/
|
||||||
|
level._effect[ "sq_tpo_time_bomb_fx" ] = loadfx( "maps/zombie_buried/fx_buried_ghost_drain" );
|
||||||
|
level.sq_tpo = spawnstruct();
|
||||||
|
level thread setup_buildable_switch();
|
||||||
|
}
|
||||||
|
|
||||||
|
init_stage()
|
||||||
|
{
|
||||||
|
if ( flag( "sq_is_max_tower_built" ) )
|
||||||
|
{
|
||||||
|
level thread stage_vo_max();
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
level thread stage_vo_ric();
|
||||||
|
}
|
||||||
|
level._cur_stage_name = "tpo";
|
||||||
|
clientnotify( "tpo" );
|
||||||
|
}
|
||||||
|
|
||||||
|
stage_vo_max()
|
||||||
|
{
|
||||||
|
s_struct = getstruct( "sq_gallows", "targetname" );
|
||||||
|
m_maxis_vo_spot = spawn( "script_model", s_struct.origin );
|
||||||
|
m_maxis_vo_spot setmodel( "tag_origin" );
|
||||||
|
maxissay( "vox_maxi_sidequest_ctw_5", m_maxis_vo_spot );
|
||||||
|
maxissay( "vox_maxi_sidequest_ctw_6", m_maxis_vo_spot );
|
||||||
|
maxissay( "vox_maxi_sidequest_ctw_7", m_maxis_vo_spot );
|
||||||
|
m_maxis_vo_spot delete();
|
||||||
|
}
|
||||||
|
|
||||||
|
stage_vo_ric()
|
||||||
|
{
|
||||||
|
richtofensay( "vox_zmba_sidequest_ctw_4", 10 );
|
||||||
|
richtofensay( "vox_zmba_sidequest_step8_0", 11 );
|
||||||
|
richtofensay( "vox_zmba_sidequest_step8_1", 6 );
|
||||||
|
richtofensay( "vox_zmba_sidequest_step8_2", 6 );
|
||||||
|
level waittill( "sq_tpo_special_round_started" );
|
||||||
|
wait 2;
|
||||||
|
richtofensay( "vox_zmba_sidequest_step8_3", 6 );
|
||||||
|
level waittill( "sq_tpo_special_round_ended" );
|
||||||
|
richtofensay( "vox_zmba_sidequest_step8_6", 4 );
|
||||||
|
}
|
||||||
|
|
||||||
|
stage_logic()
|
||||||
|
{
|
||||||
|
/#
|
||||||
|
iprintlnbold( "TPO Started" );
|
||||||
|
#/
|
||||||
|
flag_set( "sq_tpo_stage_started" );
|
||||||
|
if ( flag( "sq_is_ric_tower_built" ) )
|
||||||
|
{
|
||||||
|
stage_logic_richtofen();
|
||||||
|
}
|
||||||
|
else if ( flag( "sq_is_max_tower_built" ) )
|
||||||
|
{
|
||||||
|
stage_logic_maxis();
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
/#
|
||||||
|
assertmsg( "SQ TPO: no sidequest side picked!" );
|
||||||
|
#/
|
||||||
|
}
|
||||||
|
/#
|
||||||
|
iprintlnbold( "TPO done" );
|
||||||
|
#/
|
||||||
|
stage_completed( "sq", level._cur_stage_name );
|
||||||
|
}
|
||||||
|
|
||||||
|
stage_logic_richtofen()
|
||||||
|
{
|
||||||
|
level endon( "sq_tpo_generator_powered" );
|
||||||
|
/#
|
||||||
|
iprintlnbold( "TPO: Richtofen started" );
|
||||||
|
#/
|
||||||
|
e_time_bomb_volume = getent( "sq_tpo_timebomb_volume", "targetname" );
|
||||||
|
flag_clear( "sq_tpo_time_bomb_in_valid_location" );
|
||||||
|
if ( isDefined( level.time_bomb_save_data ) && isDefined( level.time_bomb_save_data.time_bomb_model ) && isDefined( level.time_bomb_save_data.time_bomb_model.sq_location_valid ) )
|
||||||
|
{
|
||||||
|
level waittill( "new_time_bomb_set" );
|
||||||
|
}
|
||||||
|
b_time_bomb_in_valid_location = level.time_bomb_save_data.time_bomb_model istouching( e_time_bomb_volume );
|
||||||
|
level.time_bomb_save_data.time_bomb_model.sq_location_valid = b_time_bomb_in_valid_location;
|
||||||
|
playfxontag( level._effect[ "sq_tpo_time_bomb_fx" ], level.time_bomb_save_data.time_bomb_model, "tag_origin" );
|
||||||
|
flag_set( "sq_tpo_time_bomb_in_valid_location" );
|
||||||
|
level thread sq_tpo_check_players_in_time_bomb_volume( e_time_bomb_volume );
|
||||||
|
wait_for_time_bomb_to_be_detonated_or_thrown_again();
|
||||||
|
level notify( "sq_tpo_stop_checking_time_bomb_volume" );
|
||||||
|
if ( flag( "time_bomb_restore_active" ) )
|
||||||
|
{
|
||||||
|
if ( flag( "sq_tpo_players_in_position_for_time_warp" ) )
|
||||||
|
{
|
||||||
|
special_round_start();
|
||||||
|
level notify( "sq_tpo_special_round_started" );
|
||||||
|
start_item_hunt_with_timeout( 60 );
|
||||||
|
special_round_end();
|
||||||
|
level notify( "sq_tpo_special_round_ended" );
|
||||||
|
}
|
||||||
|
}
|
||||||
|
wait_network_frame();
|
||||||
|
}
|
||||||
|
|
||||||
|
stage_logic_maxis()
|
||||||
|
{
|
||||||
|
/#
|
||||||
|
iprintlnbold( "TPO: Maxis started" );
|
||||||
|
#/
|
||||||
|
flag_wait( "sq_wisp_saved_with_time_bomb" );
|
||||||
|
while ( !flag( "sq_wisp_success" ) )
|
||||||
|
{
|
||||||
|
stage_start( "sq", "ts" );
|
||||||
|
level waittill( "sq_ts_over" );
|
||||||
|
stage_start( "sq", "ctw" );
|
||||||
|
level waittill( "sq_ctw_over" );
|
||||||
|
}
|
||||||
|
level._cur_stage_name = "tpo";
|
||||||
|
}
|
||||||
|
|
||||||
|
sq_tpo_check_players_in_time_bomb_volume( e_volume )
|
||||||
|
{
|
||||||
|
level endon( "sq_tpo_stop_checking_time_bomb_volume" );
|
||||||
|
while ( 1 )
|
||||||
|
{
|
||||||
|
b_players_ready = _are_all_players_in_time_bomb_volume( e_volume );
|
||||||
|
level._time_bomb.functionality_override = b_players_ready;
|
||||||
|
if ( b_players_ready )
|
||||||
|
{
|
||||||
|
flag_set( "sq_tpo_players_in_position_for_time_warp" );
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
flag_clear( "sq_tpo_players_in_position_for_time_warp" );
|
||||||
|
}
|
||||||
|
wait 0,25;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
_are_all_players_in_time_bomb_volume( e_volume )
|
||||||
|
{
|
||||||
|
n_required_players = 4;
|
||||||
|
a_players = get_players();
|
||||||
|
/#
|
||||||
|
if ( getDvarInt( #"5256118F" ) > 0 )
|
||||||
|
{
|
||||||
|
n_required_players = a_players.size;
|
||||||
|
#/
|
||||||
|
}
|
||||||
|
n_players_in_position = 0;
|
||||||
|
_a239 = a_players;
|
||||||
|
_k239 = getFirstArrayKey( _a239 );
|
||||||
|
while ( isDefined( _k239 ) )
|
||||||
|
{
|
||||||
|
player = _a239[ _k239 ];
|
||||||
|
if ( player istouching( e_volume ) )
|
||||||
|
{
|
||||||
|
n_players_in_position++;
|
||||||
|
}
|
||||||
|
_k239 = getNextArrayKey( _a239, _k239 );
|
||||||
|
}
|
||||||
|
b_all_in_valid_position = n_players_in_position == n_required_players;
|
||||||
|
return b_all_in_valid_position;
|
||||||
|
}
|
||||||
|
|
||||||
|
wait_for_time_bomb_to_be_detonated_or_thrown_again()
|
||||||
|
{
|
||||||
|
level endon( "new_time_bomb_set" );
|
||||||
|
flag_wait( "time_bomb_restore_active" );
|
||||||
|
}
|
||||||
|
|
||||||
|
special_round_start()
|
||||||
|
{
|
||||||
|
/#
|
||||||
|
iprintlnbold( "SPECIAL ROUND START" );
|
||||||
|
#/
|
||||||
|
flag_set( "sq_tpo_special_round_active" );
|
||||||
|
level.sq_tpo.times_searched = 0;
|
||||||
|
maps/mp/zombies/_zm_weap_time_bomb::time_bomb_saves_data( 0 );
|
||||||
|
flag_clear( "time_bomb_detonation_enabled" );
|
||||||
|
fake_time_warp();
|
||||||
|
level thread sndsidequestnoirmusic();
|
||||||
|
make_super_zombies( 1 );
|
||||||
|
level thread spawn_zombies_after_time_bomb_round_killed();
|
||||||
|
a_players = get_players();
|
||||||
|
_a279 = a_players;
|
||||||
|
_k279 = getFirstArrayKey( _a279 );
|
||||||
|
while ( isDefined( _k279 ) )
|
||||||
|
{
|
||||||
|
player = _a279[ _k279 ];
|
||||||
|
vsmgr_activate( "visionset", "cheat_bw", player );
|
||||||
|
_k279 = getNextArrayKey( _a279, _k279 );
|
||||||
|
}
|
||||||
|
level setclientfield( "sq_tpo_special_round_active", 1 );
|
||||||
|
}
|
||||||
|
|
||||||
|
make_super_zombies( b_toggle )
|
||||||
|
{
|
||||||
|
if ( b_toggle )
|
||||||
|
{
|
||||||
|
n_round = 115;
|
||||||
|
level thread watch_for_time_bombs( n_round );
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
n_round = level.round_number;
|
||||||
|
level notify( "super_zombies_end" );
|
||||||
|
}
|
||||||
|
level.zombie_total = n_round;
|
||||||
|
ai_calculate_health( n_round );
|
||||||
|
level.zombie_move_speed = n_round * level.zombie_vars[ "zombie_move_speed_multiplier" ];
|
||||||
|
}
|
||||||
|
|
||||||
|
watch_for_time_bombs( n_round )
|
||||||
|
{
|
||||||
|
level notify( "super_zombies_end" );
|
||||||
|
level endon( "super_zombies_end" );
|
||||||
|
while ( 1 )
|
||||||
|
{
|
||||||
|
level waittill_any( "time_bomb_detonation_complete", "start_of_round" );
|
||||||
|
level.zombie_total = n_round;
|
||||||
|
ai_calculate_health( n_round );
|
||||||
|
level.zombie_move_speed = n_round * level.zombie_vars[ "zombie_move_speed_multiplier" ];
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
spawn_zombies_after_time_bomb_round_killed()
|
||||||
|
{
|
||||||
|
flag_wait( "time_bomb_round_killed" );
|
||||||
|
flag_set( "spawn_zombies" );
|
||||||
|
}
|
||||||
|
|
||||||
|
fake_time_warp()
|
||||||
|
{
|
||||||
|
maps/mp/zombies/_zm_weap_time_bomb::time_bomb_destroy_hud_elem();
|
||||||
|
maps/mp/zombies/_zm_weap_time_bomb::_time_bomb_show_overlay();
|
||||||
|
maps/mp/zombies/_zm_weap_time_bomb::_time_bomb_kill_all_active_enemies();
|
||||||
|
playsoundatposition( "zmb_timebomb_timechange_2d_sq", ( 0, 0, 0 ) );
|
||||||
|
maps/mp/zombies/_zm_weap_time_bomb::_time_bomb_hide_overlay();
|
||||||
|
}
|
||||||
|
|
||||||
|
special_round_end()
|
||||||
|
{
|
||||||
|
/#
|
||||||
|
iprintlnbold( "SPECIAL ROUND END" );
|
||||||
|
#/
|
||||||
|
level setclientfield( "sq_tpo_special_round_active", 0 );
|
||||||
|
level notify( "sndEndNoirMusic" );
|
||||||
|
make_super_zombies( 0 );
|
||||||
|
level._time_bomb.functionality_override = 0;
|
||||||
|
flag_set( "time_bomb_detonation_enabled" );
|
||||||
|
maps/mp/zombies/_zm_weap_time_bomb::time_bomb_restores_saved_data();
|
||||||
|
a_players = get_players();
|
||||||
|
_a356 = a_players;
|
||||||
|
_k356 = getFirstArrayKey( _a356 );
|
||||||
|
while ( isDefined( _k356 ) )
|
||||||
|
{
|
||||||
|
player = _a356[ _k356 ];
|
||||||
|
vsmgr_deactivate( "visionset", "cheat_bw", player );
|
||||||
|
player notify( "search_done" );
|
||||||
|
_k356 = getNextArrayKey( _a356, _k356 );
|
||||||
|
}
|
||||||
|
clean_up_special_round();
|
||||||
|
flag_clear( "sq_tpo_special_round_active" );
|
||||||
|
}
|
||||||
|
|
||||||
|
clean_up_special_round()
|
||||||
|
{
|
||||||
|
a_models = getentarray( "sq_tpo_corpse_model", "targetname" );
|
||||||
|
_a370 = a_models;
|
||||||
|
_k370 = getFirstArrayKey( _a370 );
|
||||||
|
while ( isDefined( _k370 ) )
|
||||||
|
{
|
||||||
|
model = _a370[ _k370 ];
|
||||||
|
model _delete_unitrigger();
|
||||||
|
model delete();
|
||||||
|
_k370 = getNextArrayKey( _a370, _k370 );
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
_delete_unitrigger()
|
||||||
|
{
|
||||||
|
if ( isDefined( self.unitrigger ) )
|
||||||
|
{
|
||||||
|
self.unitrigger.registered = 0;
|
||||||
|
}
|
||||||
|
if ( isDefined( self.unitrigger.trigger ) )
|
||||||
|
{
|
||||||
|
if ( isDefined( self.unitrigger.trigger.stub ) )
|
||||||
|
{
|
||||||
|
self.unitrigger.trigger maps/mp/zombies/_zm_unitrigger::unregister_unitrigger( self.unitrigger.trigger.stub );
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
self.trigger notify( "kill_trigger" );
|
||||||
|
self.trigger delete();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
start_item_hunt_with_timeout( n_timeout )
|
||||||
|
{
|
||||||
|
setup_random_corpse_positions();
|
||||||
|
level delay_notify( "sq_tpo_item_hunt_done", n_timeout );
|
||||||
|
/#
|
||||||
|
iprintlnbold( "ITEM HUNT STARTED" );
|
||||||
|
#/
|
||||||
|
level waittill( "sq_tpo_item_hunt_done" );
|
||||||
|
}
|
||||||
|
|
||||||
|
exit_stage( success )
|
||||||
|
{
|
||||||
|
}
|
||||||
|
|
||||||
|
debug_give_piece()
|
||||||
|
{
|
||||||
|
while ( 1 )
|
||||||
|
{
|
||||||
|
level waittill( "sq_tpo_give_item" );
|
||||||
|
get_players()[ 0 ] give_player_sq_tpo_switch();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
get_randomized_corpse_list()
|
||||||
|
{
|
||||||
|
a_corpses = array( "c_zom_player_farmgirl_fb", "c_zom_player_oldman_fb", "c_zom_player_reporter_dam_fb", "c_zom_player_engineer_fb" );
|
||||||
|
a_corpses = array_randomize( a_corpses );
|
||||||
|
return a_corpses;
|
||||||
|
}
|
||||||
|
|
||||||
|
setup_random_corpse_positions()
|
||||||
|
{
|
||||||
|
a_corpse_models = get_randomized_corpse_list();
|
||||||
|
a_corpse_structs = array_randomize( getstructarray( "sq_tpo_corpse_spawn_location", "targetname" ) );
|
||||||
|
i = 0;
|
||||||
|
while ( i < a_corpse_models.size )
|
||||||
|
{
|
||||||
|
a_corpse_structs[ i ] promote_to_corpse_model( a_corpse_models[ i ] );
|
||||||
|
a_corpse_structs[ i ] thread _debug_show_location();
|
||||||
|
i++;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
_debug_show_location()
|
||||||
|
{
|
||||||
|
/#
|
||||||
|
level endon( "sq_tpo_item_hunt_done" );
|
||||||
|
while ( 1 )
|
||||||
|
{
|
||||||
|
if ( getDvarInt( #"5256118F" ) > 0 )
|
||||||
|
{
|
||||||
|
debugstar( self.origin, 20, ( 0, 0, 0 ) );
|
||||||
|
}
|
||||||
|
wait 1;
|
||||||
|
#/
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
promote_to_corpse_model( str_model )
|
||||||
|
{
|
||||||
|
v_spawn_point = groundtrace( self.origin + vectorScale( ( 0, 0, 0 ), 10 ), self.origin + vectorScale( ( 0, 0, 0 ), 300 ), 0, undefined )[ "position" ];
|
||||||
|
self.corpse_model = spawn( "script_model", v_spawn_point );
|
||||||
|
self.corpse_model.angles = self.angles;
|
||||||
|
self.corpse_model setmodel( str_model );
|
||||||
|
self.corpse_model.targetname = "sq_tpo_corpse_model";
|
||||||
|
self _pose_corpse();
|
||||||
|
self.corpse_model.unitrigger = setup_unitrigger( &"ZM_BURIED_SQ_SCH", ::unitrigger_think );
|
||||||
|
}
|
||||||
|
|
||||||
|
_pose_corpse()
|
||||||
|
{
|
||||||
|
/#
|
||||||
|
assert( isDefined( self.script_noteworthy ), "sq_tpo_corpse_spawn_location at " + self.origin + " is missing script_noteworthy! This is required to set deadpose" );
|
||||||
|
#/
|
||||||
|
switch( self.script_noteworthy )
|
||||||
|
{
|
||||||
|
case "deadpose_1":
|
||||||
|
anim_pose = %pb_gen_m_floor_armdown_onback_deathpose;
|
||||||
|
break;
|
||||||
|
case "deadpose_2":
|
||||||
|
anim_pose = %pb_gen_m_floor_armdown_onfront_deathpose;
|
||||||
|
break;
|
||||||
|
case "deadpose_3":
|
||||||
|
anim_pose = %pb_gen_m_floor_armover_onrightside_deathpose;
|
||||||
|
break;
|
||||||
|
case "deadpose_4":
|
||||||
|
anim_pose = %pb_gen_m_floor_armrelaxed_onleftside_deathpose;
|
||||||
|
break;
|
||||||
|
case "deadpose_5":
|
||||||
|
anim_pose = %pb_gen_m_floor_armspread_legaskew_onback_deathpose;
|
||||||
|
break;
|
||||||
|
case "deadpose_6":
|
||||||
|
anim_pose = %pb_gen_m_floor_armspreadwide_legspread_onback_deathpose;
|
||||||
|
break;
|
||||||
|
case "deadpose_7":
|
||||||
|
anim_pose = %pb_gen_m_floor_armstomach_onrightside_deathpose;
|
||||||
|
break;
|
||||||
|
case "deadpose_8":
|
||||||
|
anim_pose = %pb_gen_m_floor_armstretched_onleftside_deathpose;
|
||||||
|
break;
|
||||||
|
case "deadpose_9":
|
||||||
|
anim_pose = %pb_gen_m_wall_armcraddle_leanleft_deathpose;
|
||||||
|
break;
|
||||||
|
case "deadpose_10":
|
||||||
|
anim_pose = %pb_gen_m_wall_legin_armcraddle_hunchright_deathpose;
|
||||||
|
break;
|
||||||
|
case "deadpose_11":
|
||||||
|
anim_pose = %pb_gen_m_wall_legspread_armdown_leanleft_deathpose;
|
||||||
|
break;
|
||||||
|
case "deadpose_12":
|
||||||
|
anim_pose = %pb_gen_m_floor_armsopen_onback_deathpose;
|
||||||
|
break;
|
||||||
|
case "deadpose_13":
|
||||||
|
anim_pose = %pb_gen_m_floor_armstomach_onback_deathpose;
|
||||||
|
break;
|
||||||
|
default:
|
||||||
|
/#
|
||||||
|
assertmsg( "sq_tpo_corpse_struct with script_noteworthy '" + self.script_noteworthy + "' is not supported by existing anim list!" );
|
||||||
|
#/
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
self.corpse_model useanimtree( -1 );
|
||||||
|
self.corpse_model setanim( anim_pose, 1, 0,05, 1 );
|
||||||
|
}
|
||||||
|
|
||||||
|
setup_unitrigger( str_hint, func_update )
|
||||||
|
{
|
||||||
|
radius = 32;
|
||||||
|
script_height = 32;
|
||||||
|
script_width = 0;
|
||||||
|
script_length = undefined;
|
||||||
|
unitrigger_stub = spawnstruct();
|
||||||
|
unitrigger_stub.origin = self.origin + vectorScale( ( 0, 0, 0 ), 10 );
|
||||||
|
unitrigger_stub.script_length = 13,5;
|
||||||
|
unitrigger_stub.script_width = script_width;
|
||||||
|
unitrigger_stub.script_height = script_height;
|
||||||
|
unitrigger_stub.radius = radius;
|
||||||
|
unitrigger_stub.cursor_hint = "HINT_NOICON";
|
||||||
|
unitrigger_stub.hint_string = str_hint;
|
||||||
|
unitrigger_stub.script_unitrigger_type = "unitrigger_radius_use";
|
||||||
|
unitrigger_stub.require_look_at = 1;
|
||||||
|
unitrigger_stub.prompt_and_visibility_func = ::piecetrigger_update_prompt;
|
||||||
|
maps/mp/zombies/_zm_unitrigger::register_static_unitrigger( unitrigger_stub, func_update );
|
||||||
|
return unitrigger_stub;
|
||||||
|
}
|
||||||
|
|
||||||
|
piecetrigger_update_prompt( player )
|
||||||
|
{
|
||||||
|
can_use = self.stub piecestub_update_prompt( player );
|
||||||
|
self setinvisibletoplayer( player, !can_use );
|
||||||
|
self sethintstring( self.stub.hint_string );
|
||||||
|
return can_use;
|
||||||
|
}
|
||||||
|
|
||||||
|
piecestub_update_prompt( player )
|
||||||
|
{
|
||||||
|
return 1;
|
||||||
|
}
|
||||||
|
|
||||||
|
unitrigger_killed()
|
||||||
|
{
|
||||||
|
self waittill( "kill_trigger" );
|
||||||
|
self _delete_progress_bar();
|
||||||
|
}
|
||||||
|
|
||||||
|
unitrigger_think()
|
||||||
|
{
|
||||||
|
self endon( "kill_trigger" );
|
||||||
|
self thread unitrigger_killed();
|
||||||
|
b_trigger_used = 0;
|
||||||
|
while ( !b_trigger_used )
|
||||||
|
{
|
||||||
|
self waittill( "trigger", player );
|
||||||
|
b_progress_bar_done = 0;
|
||||||
|
n_frame_count = 0;
|
||||||
|
while ( player usebuttonpressed() && !b_progress_bar_done )
|
||||||
|
{
|
||||||
|
if ( !isDefined( self.progress_bar ) )
|
||||||
|
{
|
||||||
|
self.progress_bar = player createprimaryprogressbar();
|
||||||
|
self.progress_bar_text = player createprimaryprogressbartext();
|
||||||
|
self.progress_bar_text settext( &"ZM_BURIED_SQ_SEARCHING" );
|
||||||
|
self thread _kill_progress_bar();
|
||||||
|
}
|
||||||
|
n_progress_amount = n_frame_count / 30;
|
||||||
|
self.progress_bar updatebar( n_progress_amount );
|
||||||
|
n_frame_count++;
|
||||||
|
if ( n_progress_amount == 1 )
|
||||||
|
{
|
||||||
|
b_progress_bar_done = 1;
|
||||||
|
}
|
||||||
|
wait 0,05;
|
||||||
|
}
|
||||||
|
self _delete_progress_bar();
|
||||||
|
if ( b_progress_bar_done )
|
||||||
|
{
|
||||||
|
b_trigger_used = 1;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if ( b_progress_bar_done )
|
||||||
|
{
|
||||||
|
self.stub.hint_string = "";
|
||||||
|
self sethintstring( self.stub.hint_string );
|
||||||
|
if ( item_is_on_corpse() )
|
||||||
|
{
|
||||||
|
iprintlnbold( &"ZM_BURIED_SQ_FND" );
|
||||||
|
player give_player_sq_tpo_switch();
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
iprintlnbold( &"ZM_BURIED_SQ_NFND" );
|
||||||
|
}
|
||||||
|
self thread maps/mp/zombies/_zm_unitrigger::unregister_unitrigger( self.stub );
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
give_player_sq_tpo_switch()
|
||||||
|
{
|
||||||
|
self player_take_piece( level.zombie_buildables[ "buried_sq_tpo_switch" ].buildablepieces[ 0 ] );
|
||||||
|
flag_set( "sq_tpo_found_item" );
|
||||||
|
level.sq_tpo_unitrig.origin = level.sq_tpo_unitrig.realorigin;
|
||||||
|
}
|
||||||
|
|
||||||
|
item_is_on_corpse()
|
||||||
|
{
|
||||||
|
if ( !isDefined( level.sq_tpo.times_searched ) )
|
||||||
|
{
|
||||||
|
level.sq_tpo.times_searched = 0;
|
||||||
|
}
|
||||||
|
switch( level.sq_tpo.times_searched )
|
||||||
|
{
|
||||||
|
case 0:
|
||||||
|
n_chance = 1;
|
||||||
|
break;
|
||||||
|
case 1:
|
||||||
|
n_chance = 15;
|
||||||
|
break;
|
||||||
|
case 2:
|
||||||
|
n_chance = 33;
|
||||||
|
break;
|
||||||
|
case 3:
|
||||||
|
n_chance = 100;
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
if ( randomint( 100 ) > ( 100 - n_chance ) )
|
||||||
|
{
|
||||||
|
b_found_item = !flag( "sq_tpo_found_item" );
|
||||||
|
}
|
||||||
|
level.sq_tpo.times_searched++;
|
||||||
|
return b_found_item;
|
||||||
|
}
|
||||||
|
|
||||||
|
_delete_progress_bar()
|
||||||
|
{
|
||||||
|
if ( isDefined( self.progress_bar ) )
|
||||||
|
{
|
||||||
|
self.progress_bar destroyelem();
|
||||||
|
self.progress_bar_text destroyelem();
|
||||||
|
self.progress_bar = undefined;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
_kill_progress_bar()
|
||||||
|
{
|
||||||
|
self endon( "death" );
|
||||||
|
self endon( "disconnect" );
|
||||||
|
self waittill( "search_done" );
|
||||||
|
self _delete_progress_bar();
|
||||||
|
}
|
||||||
|
|
||||||
|
setup_buildable_switch()
|
||||||
|
{
|
||||||
|
s_switch_piece = generate_zombie_buildable_piece( "buried_sq_tpo_switch", "p6_zm_buildable_pswitch_lever_handed", 32, 64, 2,4, "zom_icon_trap_switch_handle", ::onpickup_switch, ::ondrop_switch, undefined, undefined, 0, 5, 2 );
|
||||||
|
s_switch_piece.hint_grab = level.str_buildables_grab_part;
|
||||||
|
s_switch_piece.hint_swap = level.str_buildables_swap_part;
|
||||||
|
s_switch_piece manage_multiple_pieces( 1 );
|
||||||
|
s_switch_piece.onspawn = ::onspawn_switch;
|
||||||
|
s_switch = spawnstruct();
|
||||||
|
s_switch.name = "buried_sq_tpo_switch";
|
||||||
|
s_switch add_buildable_piece( s_switch_piece );
|
||||||
|
s_switch.triggerthink = ::triggerthink_switch;
|
||||||
|
s_switch.onuseplantobject = ::onuseplantobject_switch;
|
||||||
|
include_buildable( s_switch );
|
||||||
|
while ( !isDefined( level.sq_tpo_unitrig ) )
|
||||||
|
{
|
||||||
|
wait 1;
|
||||||
|
}
|
||||||
|
level.sq_tpo_unitrig.realorigin = level.sq_tpo_unitrig.origin;
|
||||||
|
level.sq_tpo_unitrig.origin += vectorScale( ( 0, 0, 0 ), 10000 );
|
||||||
|
}
|
||||||
|
|
||||||
|
onuseplantobject_switch( player )
|
||||||
|
{
|
||||||
|
flag_set( "sq_tpo_generator_powered" );
|
||||||
|
}
|
||||||
|
|
||||||
|
onpickup_switch( player )
|
||||||
|
{
|
||||||
|
maps/mp/zm_buried_buildables::onpickup_common( player );
|
||||||
|
}
|
||||||
|
|
||||||
|
ondrop_switch( player )
|
||||||
|
{
|
||||||
|
maps/mp/zm_buried_buildables::ondrop_common( player );
|
||||||
|
}
|
||||||
|
|
||||||
|
onspawn_switch( player )
|
||||||
|
{
|
||||||
|
}
|
||||||
|
|
||||||
|
triggerthink_switch()
|
||||||
|
{
|
||||||
|
if ( isDefined( getent( "guillotine_trigger", "targetname" ) ) )
|
||||||
|
{
|
||||||
|
str_trigger_generator_name = "guillotine_trigger";
|
||||||
|
level.sq_tpo_unitrig = maps/mp/zombies/_zm_buildables::buildable_trigger_think( str_trigger_generator_name, "buried_sq_tpo_switch", "none", "", 1, 0 );
|
||||||
|
level.sq_tpo_unitrig.ignore_open_sesame = 1;
|
||||||
|
level.sq_tpo_unitrig.buildablestub_reject_func = ::guillotine_trigger_reject_func;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
guillotine_trigger_reject_func( player )
|
||||||
|
{
|
||||||
|
b_should_reject = 0;
|
||||||
|
if ( flag( "sq_tpo_special_round_active" ) )
|
||||||
|
{
|
||||||
|
b_should_reject = 1;
|
||||||
|
}
|
||||||
|
return b_should_reject;
|
||||||
|
}
|
||||||
|
|
||||||
|
time_bomb_saves_wisp_state()
|
||||||
|
{
|
||||||
|
if ( !isDefined( self.sq_data ) )
|
||||||
|
{
|
||||||
|
self.sq_data = spawnstruct();
|
||||||
|
}
|
||||||
|
self.sq_data.wisp_stage_complete = flag( "sq_wisp_success" );
|
||||||
|
}
|
||||||
|
|
||||||
|
time_bomb_restores_wisp_state()
|
||||||
|
{
|
||||||
|
if ( isDefined( self.sq_data ) && isDefined( self.sq_data.wisp_stage_complete ) && !self.sq_data.wisp_stage_complete && flag( "sq_tpo_stage_started" ) )
|
||||||
|
{
|
||||||
|
flag_clear( "sq_wisp_success" );
|
||||||
|
flag_clear( "sq_wisp_failed" );
|
||||||
|
flag_set( "sq_wisp_saved_with_time_bomb" );
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
sndsidequestnoirmusic()
|
||||||
|
{
|
||||||
|
if ( is_true( level.music_override ) )
|
||||||
|
{
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
level.music_override = 1;
|
||||||
|
level setclientfield( "mus_noir_snapshot_loop", 1 );
|
||||||
|
ent = spawn( "script_origin", ( 0, 0, 0 ) );
|
||||||
|
ent playloopsound( "mus_sidequest_noir" );
|
||||||
|
level waittill( "sndEndNoirMusic" );
|
||||||
|
level setclientfield( "mus_noir_snapshot_loop", 0 );
|
||||||
|
level.music_override = 0;
|
||||||
|
ent stoploopsound( 2 );
|
||||||
|
wait 2;
|
||||||
|
ent delete();
|
||||||
|
}
|
152
zm_buried_patch/maps/mp/zm_buried_sq_ts.gsc
Normal file
152
zm_buried_patch/maps/mp/zm_buried_sq_ts.gsc
Normal file
@ -0,0 +1,152 @@
|
|||||||
|
#include maps/mp/zombies/_zm_sidequests;
|
||||||
|
#include maps/mp/zombies/_zm_utility;
|
||||||
|
#include maps/mp/_utility;
|
||||||
|
#include common_scripts/utility;
|
||||||
|
|
||||||
|
init()
|
||||||
|
{
|
||||||
|
flag_init( "sq_ts_quicktest" );
|
||||||
|
declare_sidequest_stage( "sq", "ts", ::init_stage, ::stage_logic, ::exit_stage );
|
||||||
|
}
|
||||||
|
|
||||||
|
init_stage()
|
||||||
|
{
|
||||||
|
a_signs = getentarray( "sq_tunnel_sign", "targetname" );
|
||||||
|
_a18 = a_signs;
|
||||||
|
_k18 = getFirstArrayKey( _a18 );
|
||||||
|
while ( isDefined( _k18 ) )
|
||||||
|
{
|
||||||
|
m_sign = _a18[ _k18 ];
|
||||||
|
m_sign setcandamage( 1 );
|
||||||
|
m_sign thread ts_sign_damage_watch();
|
||||||
|
_k18 = getNextArrayKey( _a18, _k18 );
|
||||||
|
}
|
||||||
|
level._cur_stage_name = "ts";
|
||||||
|
clientnotify( "ts" );
|
||||||
|
}
|
||||||
|
|
||||||
|
stage_logic()
|
||||||
|
{
|
||||||
|
/#
|
||||||
|
iprintlnbold( "TS Started" );
|
||||||
|
#/
|
||||||
|
level waittill( "sq_sign_damaged" );
|
||||||
|
wait_network_frame();
|
||||||
|
stage_completed( "sq", level._cur_stage_name );
|
||||||
|
}
|
||||||
|
|
||||||
|
exit_stage( success )
|
||||||
|
{
|
||||||
|
}
|
||||||
|
|
||||||
|
ts_sign_damage_watch()
|
||||||
|
{
|
||||||
|
level endon( "sq_sign_damaged" );
|
||||||
|
self ts_sign_deactivate();
|
||||||
|
while ( 1 )
|
||||||
|
{
|
||||||
|
self waittill( "damage", n_damage, e_attacker, v_direction, v_point, str_type, str_tag, str_model, str_part, str_weapon );
|
||||||
|
if ( flag( "sq_ts_quicktest" ) )
|
||||||
|
{
|
||||||
|
level.m_sq_start_sign = self;
|
||||||
|
level.e_sq_sign_attacker = e_attacker;
|
||||||
|
level notify( "sq_sign_damaged" );
|
||||||
|
}
|
||||||
|
if ( ts_is_bowie_knife( str_weapon ) || ts_is_galvaknuckles( str_weapon ) )
|
||||||
|
{
|
||||||
|
if ( self.ts_sign_activated )
|
||||||
|
{
|
||||||
|
self thread ts_sign_deactivate();
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
self thread ts_sign_activate();
|
||||||
|
}
|
||||||
|
ts_sign_check_all_activated( e_attacker, self );
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
ts_sign_activate()
|
||||||
|
{
|
||||||
|
self.ts_sign_activated = 1;
|
||||||
|
while ( !isDefined( self.fx_ent ) )
|
||||||
|
{
|
||||||
|
v_forward = anglesToForward( self.angles );
|
||||||
|
v_offset = vectornormalize( v_forward ) * 2;
|
||||||
|
self.fx_ent = spawn( "script_model", ( self.origin - vectorScale( ( 0, 0, 1 ), 20 ) ) + v_offset );
|
||||||
|
self.fx_ent.angles = anglesToForward( self.angles );
|
||||||
|
self.fx_ent setmodel( "tag_origin" );
|
||||||
|
self.fx_ent playsound( "zmb_sq_wisp_spawn" );
|
||||||
|
self.fx_ent playloopsound( "zmb_sq_wisp_wall_loop" );
|
||||||
|
while ( isDefined( self.fx_ent ) )
|
||||||
|
{
|
||||||
|
playfxontag( level._effect[ "sq_ether_amp_trail" ], self.fx_ent, "tag_origin" );
|
||||||
|
wait 0,3;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
ts_sign_deactivate()
|
||||||
|
{
|
||||||
|
self.ts_sign_activated = 0;
|
||||||
|
if ( isDefined( self.fx_ent ) )
|
||||||
|
{
|
||||||
|
self.fx_ent stoploopsound( 2 );
|
||||||
|
self.fx_ent delete();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
ts_sign_check_all_activated( e_attacker, m_last_touched )
|
||||||
|
{
|
||||||
|
a_signs = getentarray( "sq_tunnel_sign", "targetname" );
|
||||||
|
a_signs_active = [];
|
||||||
|
is_max_complete = 1;
|
||||||
|
is_ric_complete = 1;
|
||||||
|
_a125 = a_signs;
|
||||||
|
_k125 = getFirstArrayKey( _a125 );
|
||||||
|
while ( isDefined( _k125 ) )
|
||||||
|
{
|
||||||
|
m_sign = _a125[ _k125 ];
|
||||||
|
if ( m_sign.ts_sign_activated )
|
||||||
|
{
|
||||||
|
a_signs_active[ a_signs_active.size ] = m_sign;
|
||||||
|
if ( !is_true( m_sign.is_max_sign ) )
|
||||||
|
{
|
||||||
|
is_max_complete = 0;
|
||||||
|
}
|
||||||
|
if ( !is_true( m_sign.is_ric_sign ) )
|
||||||
|
{
|
||||||
|
is_ric_complete = 0;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
_k125 = getNextArrayKey( _a125, _k125 );
|
||||||
|
}
|
||||||
|
if ( a_signs_active.size == 3 )
|
||||||
|
{
|
||||||
|
if ( is_max_complete || is_ric_complete )
|
||||||
|
{
|
||||||
|
level.m_sq_start_sign = m_last_touched;
|
||||||
|
level.e_sq_sign_attacker = e_attacker;
|
||||||
|
level notify( "sq_sign_damaged" );
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
ts_is_bowie_knife( str_weapon )
|
||||||
|
{
|
||||||
|
if ( str_weapon != "knife_ballistic_bowie_zm" || str_weapon == "knife_ballistic_bowie_upgraded_zm" && str_weapon == "bowie_knife_zm" )
|
||||||
|
{
|
||||||
|
return 1;
|
||||||
|
}
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
ts_is_galvaknuckles( str_weapon )
|
||||||
|
{
|
||||||
|
if ( str_weapon == "tazer_knuckles_zm" )
|
||||||
|
{
|
||||||
|
return 1;
|
||||||
|
}
|
||||||
|
return 0;
|
||||||
|
}
|
26
zm_buried_patch/maps/mp/zm_buried_standard.gsc
Normal file
26
zm_buried_patch/maps/mp/zm_buried_standard.gsc
Normal file
@ -0,0 +1,26 @@
|
|||||||
|
#include maps/mp/zombies/_zm_magicbox;
|
||||||
|
#include maps/mp/zombies/_zm_game_module;
|
||||||
|
#include maps/mp/gametypes_zm/_zm_gametype;
|
||||||
|
#include maps/mp/zombies/_zm_utility;
|
||||||
|
#include common_scripts/utility;
|
||||||
|
#include maps/mp/_utility;
|
||||||
|
|
||||||
|
precache()
|
||||||
|
{
|
||||||
|
}
|
||||||
|
|
||||||
|
main()
|
||||||
|
{
|
||||||
|
maps/mp/gametypes_zm/_zm_gametype::setup_standard_objects( "processing" );
|
||||||
|
maps/mp/zombies/_zm_game_module::set_current_game_module( level.game_module_standard_index );
|
||||||
|
flag_wait( "initial_blackscreen_passed" );
|
||||||
|
zm_treasure_chest_init();
|
||||||
|
}
|
||||||
|
|
||||||
|
zm_treasure_chest_init()
|
||||||
|
{
|
||||||
|
chest1 = getstruct( "start_chest", "script_noteworthy" );
|
||||||
|
level.chests = [];
|
||||||
|
level.chests[ level.chests.size ] = chest1;
|
||||||
|
maps/mp/zombies/_zm_magicbox::treasure_chest_init( "start_chest" );
|
||||||
|
}
|
64
zm_buried_patch/maps/mp/zm_buried_turned_street.gsc
Normal file
64
zm_buried_patch/maps/mp/zm_buried_turned_street.gsc
Normal file
@ -0,0 +1,64 @@
|
|||||||
|
#include maps/mp/gametypes_zm/zcleansed;
|
||||||
|
#include maps/mp/gametypes_zm/_zm_gametype;
|
||||||
|
#include maps/mp/_visionset_mgr;
|
||||||
|
#include maps/mp/zm_buried_gamemodes;
|
||||||
|
#include maps/mp/zombies/_zm_utility;
|
||||||
|
#include common_scripts/utility;
|
||||||
|
#include maps/mp/_utility;
|
||||||
|
|
||||||
|
precache()
|
||||||
|
{
|
||||||
|
precachemodel( "zm_collision_buried_street_turned" );
|
||||||
|
precachemodel( "p6_zm_bu_buildable_bench_tarp" );
|
||||||
|
character/c_zom_zombie_buried_saloongirl_mp::precache();
|
||||||
|
precachemodel( "c_zom_buried_zombie_sgirl_viewhands" );
|
||||||
|
maps/mp/_visionset_mgr::vsmgr_register_info( "overlay", "zm_transit_burn", 1, 21, 15, 1, ::maps/mp/_visionset_mgr::vsmgr_duration_lerp_thread_per_player, 0 );
|
||||||
|
}
|
||||||
|
|
||||||
|
main()
|
||||||
|
{
|
||||||
|
flag_init( "sloth_blocker_towneast" );
|
||||||
|
level.custom_zombie_player_loadout = ::custom_zombie_player_loadout;
|
||||||
|
getspawnpoints();
|
||||||
|
maps/mp/gametypes_zm/_zm_gametype::setup_standard_objects( "street" );
|
||||||
|
generatebuildabletarps();
|
||||||
|
deletechalktriggers();
|
||||||
|
deleteslothbarricade( "candystore_alley" );
|
||||||
|
deleteslothbarricades( 1 );
|
||||||
|
deletebuyabledebris( 1 );
|
||||||
|
powerswitchstate( 1 );
|
||||||
|
level.cleansed_loadout = getgametypesetting( "cleansedLoadout" );
|
||||||
|
if ( level.cleansed_loadout )
|
||||||
|
{
|
||||||
|
level.humanify_custom_loadout = ::maps/mp/gametypes_zm/zcleansed::gunprogressionthink;
|
||||||
|
level.cleansed_zombie_round = 5;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
level.humanify_custom_loadout = ::maps/mp/gametypes_zm/zcleansed::shotgunloadout;
|
||||||
|
level.cleansed_zombie_round = 2;
|
||||||
|
}
|
||||||
|
spawnmapcollision( "zm_collision_buried_street_turned" );
|
||||||
|
flag_wait( "initial_blackscreen_passed" );
|
||||||
|
flag_wait( "start_zombie_round_logic" );
|
||||||
|
flag_set( "power_on" );
|
||||||
|
clientnotify( "pwr" );
|
||||||
|
}
|
||||||
|
|
||||||
|
custom_zombie_player_loadout()
|
||||||
|
{
|
||||||
|
self character/c_zom_zombie_buried_saloongirl_mp::main();
|
||||||
|
self setviewmodel( "c_zom_buried_zombie_sgirl_viewhands" );
|
||||||
|
}
|
||||||
|
|
||||||
|
getspawnpoints()
|
||||||
|
{
|
||||||
|
level._turned_zombie_spawners = getentarray( "game_mode_spawners", "targetname" );
|
||||||
|
level._turned_zombie_spawnpoints = getstructarray( "street_turned_zombie_spawn", "targetname" );
|
||||||
|
level._turned_zombie_respawnpoints = getstructarray( "street_turned_player_respawns", "targetname" );
|
||||||
|
level._turned_powerup_spawnpoints = getstructarray( "street_turned_powerups", "targetname" );
|
||||||
|
}
|
||||||
|
|
||||||
|
onendgame()
|
||||||
|
{
|
||||||
|
}
|
2977
zm_buried_patch/maps/mp/zombies/_zm_ai_ghost.gsc
Normal file
2977
zm_buried_patch/maps/mp/zombies/_zm_ai_ghost.gsc
Normal file
File diff suppressed because it is too large
Load Diff
333
zm_buried_patch/maps/mp/zombies/_zm_ai_ghost_ffotd.gsc
Normal file
333
zm_buried_patch/maps/mp/zombies/_zm_ai_ghost_ffotd.gsc
Normal file
@ -0,0 +1,333 @@
|
|||||||
|
#include maps/mp/zombies/_zm_ai_ghost;
|
||||||
|
#include maps/mp/zombies/_zm_zonemgr;
|
||||||
|
#include maps/mp/zm_buried;
|
||||||
|
#include maps/mp/zombies/_zm_utility;
|
||||||
|
#include maps/mp/_utility;
|
||||||
|
#include common_scripts/utility;
|
||||||
|
|
||||||
|
ghost_init_start()
|
||||||
|
{
|
||||||
|
level ghost_bad_path_init();
|
||||||
|
level.is_player_in_ghost_zone = ::is_player_in_ghost_zone;
|
||||||
|
level ghost_bad_spawn_zone_init();
|
||||||
|
level.ghost_round_start_monitor_time = 10;
|
||||||
|
}
|
||||||
|
|
||||||
|
ghost_init_end()
|
||||||
|
{
|
||||||
|
disable_traversal_clip_around_mansion();
|
||||||
|
}
|
||||||
|
|
||||||
|
prespawn_start()
|
||||||
|
{
|
||||||
|
}
|
||||||
|
|
||||||
|
prespawn_end()
|
||||||
|
{
|
||||||
|
}
|
||||||
|
|
||||||
|
ghost_round_start()
|
||||||
|
{
|
||||||
|
level thread ghost_teleport_to_playable_area();
|
||||||
|
}
|
||||||
|
|
||||||
|
ghost_round_end()
|
||||||
|
{
|
||||||
|
disable_traversal_clip_around_mansion();
|
||||||
|
}
|
||||||
|
|
||||||
|
is_player_in_ghost_zone( player )
|
||||||
|
{
|
||||||
|
result = 0;
|
||||||
|
if ( !isDefined( level.ghost_zone_overrides ) )
|
||||||
|
{
|
||||||
|
level.ghost_zone_overrides = getentarray( "ghost_round_override", "script_noteworthy" );
|
||||||
|
}
|
||||||
|
is_player_in_override_trigger = 0;
|
||||||
|
while ( isDefined( level.zombie_ghost_round_states ) && !is_true( level.zombie_ghost_round_states.is_started ) )
|
||||||
|
{
|
||||||
|
_a86 = level.ghost_zone_overrides;
|
||||||
|
_k86 = getFirstArrayKey( _a86 );
|
||||||
|
while ( isDefined( _k86 ) )
|
||||||
|
{
|
||||||
|
trigger = _a86[ _k86 ];
|
||||||
|
if ( player istouching( trigger ) )
|
||||||
|
{
|
||||||
|
is_player_in_override_trigger = 1;
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
_k86 = getNextArrayKey( _a86, _k86 );
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
curr_zone = player get_current_zone();
|
||||||
|
if ( !is_player_in_override_trigger && isDefined( curr_zone ) && curr_zone == "zone_mansion" )
|
||||||
|
{
|
||||||
|
result = 1;
|
||||||
|
}
|
||||||
|
return result;
|
||||||
|
}
|
||||||
|
|
||||||
|
ghost_bad_path_init()
|
||||||
|
{
|
||||||
|
level.bad_zones = [];
|
||||||
|
level.bad_zones[ 0 ] = spawnstruct();
|
||||||
|
level.bad_zones[ 0 ].name = "zone_underground_courthouse";
|
||||||
|
level.bad_zones[ 0 ].adjacent = [];
|
||||||
|
level.bad_zones[ 0 ].adjacent[ 0 ] = "zone_underground_courthouse2";
|
||||||
|
level.bad_zones[ 0 ].adjacent[ 1 ] = "zone_tunnels_north2";
|
||||||
|
level.bad_zones[ 0 ].ignore_func = ::maps/mp/zm_buried::is_courthouse_open;
|
||||||
|
level.bad_zones[ 1 ] = spawnstruct();
|
||||||
|
level.bad_zones[ 1 ].name = "zone_underground_courthouse2";
|
||||||
|
level.bad_zones[ 1 ].adjacent = [];
|
||||||
|
level.bad_zones[ 1 ].adjacent[ 0 ] = "zone_underground_courthouse";
|
||||||
|
level.bad_zones[ 1 ].adjacent[ 1 ] = "zone_tunnels_north2";
|
||||||
|
level.bad_zones[ 1 ].ignore_func = ::maps/mp/zm_buried::is_courthouse_open;
|
||||||
|
level.bad_zones[ 2 ] = spawnstruct();
|
||||||
|
level.bad_zones[ 2 ].name = "zone_tunnels_north2";
|
||||||
|
level.bad_zones[ 2 ].adjacent = [];
|
||||||
|
level.bad_zones[ 2 ].adjacent[ 0 ] = "zone_underground_courthouse2";
|
||||||
|
level.bad_zones[ 2 ].adjacent[ 1 ] = "zone_underground_courthouse";
|
||||||
|
level.bad_zones[ 2 ].flag = "tunnels2courthouse";
|
||||||
|
level.bad_zones[ 2 ].flag_adjacent = "zone_tunnels_north";
|
||||||
|
level.bad_zones[ 2 ].ignore_func = ::maps/mp/zm_buried::is_courthouse_open;
|
||||||
|
level.bad_zones[ 3 ] = spawnstruct();
|
||||||
|
level.bad_zones[ 3 ].name = "zone_tunnels_north";
|
||||||
|
level.bad_zones[ 3 ].adjacent = [];
|
||||||
|
level.bad_zones[ 3 ].adjacent[ 0 ] = "zone_tunnels_center";
|
||||||
|
level.bad_zones[ 3 ].flag = "tunnels2courthouse";
|
||||||
|
level.bad_zones[ 3 ].flag_adjacent = "zone_tunnels_north2";
|
||||||
|
level.bad_zones[ 3 ].ignore_func = ::maps/mp/zm_buried::is_tunnel_open;
|
||||||
|
level.bad_zones[ 4 ] = spawnstruct();
|
||||||
|
level.bad_zones[ 4 ].name = "zone_tunnels_center";
|
||||||
|
level.bad_zones[ 4 ].adjacent = [];
|
||||||
|
level.bad_zones[ 4 ].adjacent[ 0 ] = "zone_tunnels_north";
|
||||||
|
level.bad_zones[ 4 ].adjacent[ 1 ] = "zone_tunnels_south";
|
||||||
|
level.bad_zones[ 4 ].ignore_func = ::maps/mp/zm_buried::is_tunnel_open;
|
||||||
|
level.bad_zones[ 5 ] = spawnstruct();
|
||||||
|
level.bad_zones[ 5 ].name = "zone_tunnels_south";
|
||||||
|
level.bad_zones[ 5 ].adjacent = [];
|
||||||
|
level.bad_zones[ 5 ].adjacent[ 0 ] = "zone_tunnels_center";
|
||||||
|
level.bad_zones[ 5 ].ignore_func = ::maps/mp/zm_buried::is_tunnel_open;
|
||||||
|
}
|
||||||
|
|
||||||
|
ghost_bad_path_failsafe()
|
||||||
|
{
|
||||||
|
self endon( "death" );
|
||||||
|
self notify( "stop_bad_path_failsafe" );
|
||||||
|
self endon( "stop_bad_path_failsafe" );
|
||||||
|
self thread non_ghost_round_failsafe();
|
||||||
|
while ( 1 )
|
||||||
|
{
|
||||||
|
player = self.favoriteenemy;
|
||||||
|
if ( isDefined( player ) )
|
||||||
|
{
|
||||||
|
in_bad_zone = 0;
|
||||||
|
_a174 = level.bad_zones;
|
||||||
|
_k174 = getFirstArrayKey( _a174 );
|
||||||
|
while ( isDefined( _k174 ) )
|
||||||
|
{
|
||||||
|
zone = _a174[ _k174 ];
|
||||||
|
if ( isDefined( zone.ignore_func ) )
|
||||||
|
{
|
||||||
|
if ( level [[ zone.ignore_func ]]() )
|
||||||
|
{
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else if ( player maps/mp/zombies/_zm_zonemgr::entity_in_zone( zone.name ) )
|
||||||
|
{
|
||||||
|
if ( self maps/mp/zombies/_zm_zonemgr::entity_in_zone( zone.name ) )
|
||||||
|
{
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
else ghost_is_adjacent = 0;
|
||||||
|
_a192 = zone.adjacent;
|
||||||
|
_k192 = getFirstArrayKey( _a192 );
|
||||||
|
while ( isDefined( _k192 ) )
|
||||||
|
{
|
||||||
|
adjacent = _a192[ _k192 ];
|
||||||
|
if ( self maps/mp/zombies/_zm_zonemgr::entity_in_zone( adjacent ) )
|
||||||
|
{
|
||||||
|
ghost_is_adjacent = 1;
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
_k192 = getNextArrayKey( _a192, _k192 );
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if ( isDefined( zone.flag ) && flag( zone.flag ) )
|
||||||
|
{
|
||||||
|
if ( self maps/mp/zombies/_zm_zonemgr::entity_in_zone( zone.flag_adjacent ) )
|
||||||
|
{
|
||||||
|
ghost_is_adjacent = 1;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if ( !ghost_is_adjacent )
|
||||||
|
{
|
||||||
|
in_bad_zone = 1;
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
_k174 = getNextArrayKey( _a174, _k174 );
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if ( in_bad_zone )
|
||||||
|
{
|
||||||
|
nodes = getnodesinradiussorted( player.origin, 540, 180, 60, "Path" );
|
||||||
|
if ( nodes.size > 0 )
|
||||||
|
{
|
||||||
|
node = nodes[ randomint( nodes.size ) ];
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
node = getnearestnode( player.origin );
|
||||||
|
}
|
||||||
|
if ( isDefined( node ) )
|
||||||
|
{
|
||||||
|
while ( 1 )
|
||||||
|
{
|
||||||
|
if ( !is_true( self.is_traversing ) )
|
||||||
|
{
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
wait 0,1;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
self forceteleport( node.origin, ( 0, 0, 0 ) );
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
wait 0,25;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
non_ghost_round_failsafe()
|
||||||
|
{
|
||||||
|
self endon( "death" );
|
||||||
|
while ( 1 )
|
||||||
|
{
|
||||||
|
self waittill( "bad_path" );
|
||||||
|
if ( self.state == "runaway_update" )
|
||||||
|
{
|
||||||
|
if ( !maps/mp/zombies/_zm_ai_ghost::is_ghost_round_started() && is_true( self.is_spawned_in_ghost_zone ) )
|
||||||
|
{
|
||||||
|
self maps/mp/zombies/_zm_ai_ghost::start_evaporate( 1 );
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
wait 0,25;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
disable_traversal_clip_around_mansion()
|
||||||
|
{
|
||||||
|
while ( isDefined( level.ghost_zone_door_clips ) && level.ghost_zone_door_clips.size > 0 )
|
||||||
|
{
|
||||||
|
_a276 = level.ghost_zone_door_clips;
|
||||||
|
_k276 = getFirstArrayKey( _a276 );
|
||||||
|
while ( isDefined( _k276 ) )
|
||||||
|
{
|
||||||
|
door_clip = _a276[ _k276 ];
|
||||||
|
door_clip notsolid();
|
||||||
|
_k276 = getNextArrayKey( _a276, _k276 );
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
ghost_bad_spawn_zone_init()
|
||||||
|
{
|
||||||
|
level.ghost_bad_spawn_zones = [];
|
||||||
|
level.ghost_bad_spawn_zones[ 0 ] = "zone_mansion_backyard";
|
||||||
|
level.ghost_bad_spawn_zones[ 1 ] = "zone_maze";
|
||||||
|
level.ghost_bad_spawn_zones[ 2 ] = "zone_maze_staircase";
|
||||||
|
}
|
||||||
|
|
||||||
|
can_use_mansion_back_flying_out_node( zone_name )
|
||||||
|
{
|
||||||
|
if ( zone_name == "zone_mansion_backyard" )
|
||||||
|
{
|
||||||
|
return 1;
|
||||||
|
}
|
||||||
|
if ( zone_name == "zone_maze" )
|
||||||
|
{
|
||||||
|
return 1;
|
||||||
|
}
|
||||||
|
if ( zone_name == "zone_maze_staircase" )
|
||||||
|
{
|
||||||
|
return 1;
|
||||||
|
}
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
ghost_teleport_to_playable_area()
|
||||||
|
{
|
||||||
|
level endon( "intermission" );
|
||||||
|
if ( level.intermission )
|
||||||
|
{
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
level endon( "ghost_round_end" );
|
||||||
|
monitor_time = 0;
|
||||||
|
while ( 1 )
|
||||||
|
{
|
||||||
|
ghosts = get_current_ghosts();
|
||||||
|
_a332 = ghosts;
|
||||||
|
_k332 = getFirstArrayKey( _a332 );
|
||||||
|
while ( isDefined( _k332 ) )
|
||||||
|
{
|
||||||
|
ghost = _a332[ _k332 ];
|
||||||
|
while ( !is_true( self.is_spawned_in_ghost_zone ) && !is_true( self.is_teleported_in_bad_zone ) )
|
||||||
|
{
|
||||||
|
_a336 = level.ghost_bad_spawn_zones;
|
||||||
|
_k336 = getFirstArrayKey( _a336 );
|
||||||
|
while ( isDefined( _k336 ) )
|
||||||
|
{
|
||||||
|
bad_spawn_zone_name = _a336[ _k336 ];
|
||||||
|
if ( ghost maps/mp/zombies/_zm_zonemgr::entity_in_zone( bad_spawn_zone_name ) )
|
||||||
|
{
|
||||||
|
if ( is_player_valid( ghost.favoriteenemy ) )
|
||||||
|
{
|
||||||
|
destination_node = ghost maps/mp/zombies/_zm_ai_ghost::get_best_flying_target_node( ghost.favoriteenemy );
|
||||||
|
if ( isDefined( destination_node ) )
|
||||||
|
{
|
||||||
|
ghost forceteleport( destination_node.origin, ( 0, 0, 0 ) );
|
||||||
|
self.is_teleported_in_bad_zone = 1;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if ( !is_true( self.is_teleported_in_bad_zone ) )
|
||||||
|
{
|
||||||
|
if ( can_use_mansion_back_flying_out_node( bad_spawn_zone_name ) )
|
||||||
|
{
|
||||||
|
ghost forceteleport( level.ghost_back_flying_out_path_starts[ 0 ].origin, ( 0, 0, 0 ) );
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
ghost forceteleport( level.ghost_front_flying_out_path_starts[ 0 ].origin, ( 0, 0, 0 ) );
|
||||||
|
}
|
||||||
|
self.is_teleported_in_bad_zone = 1;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
_k336 = getNextArrayKey( _a336, _k336 );
|
||||||
|
}
|
||||||
|
}
|
||||||
|
_k332 = getNextArrayKey( _a332, _k332 );
|
||||||
|
}
|
||||||
|
monitor_time += 0,1;
|
||||||
|
if ( monitor_time > level.ghost_round_start_monitor_time )
|
||||||
|
{
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
wait 0,1;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
4593
zm_buried_patch/maps/mp/zombies/_zm_ai_sloth.gsc
Normal file
4593
zm_buried_patch/maps/mp/zombies/_zm_ai_sloth.gsc
Normal file
File diff suppressed because it is too large
Load Diff
897
zm_buried_patch/maps/mp/zombies/_zm_ai_sloth_buildables.gsc
Normal file
897
zm_buried_patch/maps/mp/zombies/_zm_ai_sloth_buildables.gsc
Normal file
@ -0,0 +1,897 @@
|
|||||||
|
#include maps/mp/zombies/_zm_unitrigger;
|
||||||
|
#include maps/mp/zm_buried_buildables;
|
||||||
|
#include maps/mp/zm_buried;
|
||||||
|
#include maps/mp/zombies/_zm_zonemgr;
|
||||||
|
#include maps/mp/zombies/_zm_equipment;
|
||||||
|
#include maps/mp/animscripts/zm_shared;
|
||||||
|
#include maps/mp/zombies/_zm_buildables;
|
||||||
|
#include maps/mp/zombies/_zm_ai_sloth;
|
||||||
|
#include maps/mp/zombies/_zm_ai_sloth_utility;
|
||||||
|
#include maps/mp/zombies/_zm_utility;
|
||||||
|
#include maps/mp/_utility;
|
||||||
|
#include common_scripts/utility;
|
||||||
|
|
||||||
|
build_buildable_condition()
|
||||||
|
{
|
||||||
|
while ( level.sloth_buildable_zones.size > 0 )
|
||||||
|
{
|
||||||
|
i = 0;
|
||||||
|
while ( i < level.sloth_buildable_zones.size )
|
||||||
|
{
|
||||||
|
zone = level.sloth_buildable_zones[ i ];
|
||||||
|
if ( is_true( zone.built ) )
|
||||||
|
{
|
||||||
|
remove_zone = zone;
|
||||||
|
i++;
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
else piece_remaining = 0;
|
||||||
|
pieces = zone.pieces;
|
||||||
|
j = 0;
|
||||||
|
while ( j < pieces.size )
|
||||||
|
{
|
||||||
|
if ( isDefined( pieces[ j ].unitrigger ) && !is_true( pieces[ j ].built ) )
|
||||||
|
{
|
||||||
|
piece_remaining = 1;
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
j++;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if ( !piece_remaining )
|
||||||
|
{
|
||||||
|
i++;
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
dist = distancesquared( zone.stub.origin, self.origin );
|
||||||
|
if ( dist < 32400 )
|
||||||
|
{
|
||||||
|
self.buildable_zone = zone;
|
||||||
|
return 1;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
i++;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if ( isDefined( remove_zone ) )
|
||||||
|
{
|
||||||
|
arrayremovevalue( level.sloth_buildable_zones, remove_zone );
|
||||||
|
}
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
common_move_to_table( stub, table, asd_name, check_pickup )
|
||||||
|
{
|
||||||
|
if ( !isDefined( table ) )
|
||||||
|
{
|
||||||
|
/#
|
||||||
|
assertmsg( "Table not found for " + self.buildable_zone.buildable_name );
|
||||||
|
#/
|
||||||
|
self.context_done = 1;
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
anim_id = self getanimfromasd( asd_name, 0 );
|
||||||
|
start_org = getstartorigin( table.origin, table.angles, anim_id );
|
||||||
|
start_ang = getstartangles( table.origin, table.angles, anim_id );
|
||||||
|
self setgoalpos( start_org );
|
||||||
|
while ( 1 )
|
||||||
|
{
|
||||||
|
if ( is_true( check_pickup ) )
|
||||||
|
{
|
||||||
|
if ( self.candy_player is_player_equipment( stub.weaponname ) )
|
||||||
|
{
|
||||||
|
/#
|
||||||
|
sloth_print( stub.weaponname + " was picked up" );
|
||||||
|
#/
|
||||||
|
self.context_done = 1;
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if ( isDefined( self.buildable_zone ) && stub != self.buildable_zone.stub )
|
||||||
|
{
|
||||||
|
/#
|
||||||
|
sloth_print( "location change during pathing" );
|
||||||
|
#/
|
||||||
|
stub = self.buildable_zone.stub;
|
||||||
|
table = getent( stub.model.target, "targetname" );
|
||||||
|
if ( !isDefined( table ) )
|
||||||
|
{
|
||||||
|
/#
|
||||||
|
assertmsg( "Table not found for " + self.buildable_zone.buildable_name );
|
||||||
|
#/
|
||||||
|
self.context_done = 1;
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
start_org = getstartorigin( table.origin, table.angles, anim_id );
|
||||||
|
start_ang = getstartangles( table.origin, table.angles, anim_id );
|
||||||
|
self setgoalpos( start_org );
|
||||||
|
}
|
||||||
|
dist = distancesquared( self.origin, start_org );
|
||||||
|
if ( dist < 1024 )
|
||||||
|
{
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
wait 0,1;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
self setgoalpos( self.origin );
|
||||||
|
self sloth_face_object( table, "angle", start_ang[ 1 ], 0,9 );
|
||||||
|
return 1;
|
||||||
|
}
|
||||||
|
|
||||||
|
build_buildable_action()
|
||||||
|
{
|
||||||
|
self endon( "death" );
|
||||||
|
self endon( "stop_action" );
|
||||||
|
self maps/mp/zombies/_zm_ai_sloth::common_context_action();
|
||||||
|
stub = self.buildable_zone.stub;
|
||||||
|
table = getent( stub.model.target, "targetname" );
|
||||||
|
if ( !self common_move_to_table( stub, table, "zm_make_buildable_intro" ) )
|
||||||
|
{
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
self maps/mp/zombies/_zm_ai_sloth::action_animscripted( "zm_make_buildable_intro", "make_buildable_intro_anim", table.origin, table.angles );
|
||||||
|
/#
|
||||||
|
sloth_print( "looking for " + self.buildable_zone.buildable_name + " pieces" );
|
||||||
|
#/
|
||||||
|
store = getstruct( "sloth_general_store", "targetname" );
|
||||||
|
self setgoalpos( store.origin );
|
||||||
|
self waittill( "goal" );
|
||||||
|
self.pieces = [];
|
||||||
|
while ( isDefined( self.buildable_zone ) )
|
||||||
|
{
|
||||||
|
pieces = self.buildable_zone.pieces;
|
||||||
|
if ( pieces.size == 0 )
|
||||||
|
{
|
||||||
|
/#
|
||||||
|
sloth_print( "no pieces available" );
|
||||||
|
#/
|
||||||
|
self.context_done = 1;
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
i = 0;
|
||||||
|
while ( i < pieces.size )
|
||||||
|
{
|
||||||
|
if ( isDefined( pieces[ i ].unitrigger ) && !is_true( pieces[ i ].built ) )
|
||||||
|
{
|
||||||
|
/#
|
||||||
|
if ( getDvarInt( #"B6252E7C" ) == 2 )
|
||||||
|
{
|
||||||
|
line( self.origin, pieces[ i ].start_origin, ( 1, 1, 1 ), 1, 0, 1000 );
|
||||||
|
#/
|
||||||
|
}
|
||||||
|
self maps/mp/zombies/_zm_buildables::player_take_piece( pieces[ i ] );
|
||||||
|
self.pieces[ self.pieces.size ] = pieces[ i ];
|
||||||
|
}
|
||||||
|
i++;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
self animscripted( self.origin, self.angles, "zm_pickup_part" );
|
||||||
|
maps/mp/animscripts/zm_shared::donotetracks( "pickup_part_anim" );
|
||||||
|
/#
|
||||||
|
sloth_print( "took " + self.pieces.size + " pieces" );
|
||||||
|
#/
|
||||||
|
if ( !self common_move_to_table( stub, table, "zm_make_buildable" ) )
|
||||||
|
{
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
self.buildable_zone.stub.bound_to_buildable = self.buildable_zone.stub;
|
||||||
|
if ( stub != self.buildable_zone.stub )
|
||||||
|
{
|
||||||
|
stub = self.buildable_zone.stub;
|
||||||
|
table = getent( stub.model.target, "targetname" );
|
||||||
|
}
|
||||||
|
self thread build_buildable_fx( table );
|
||||||
|
self animscripted( table.origin, table.angles, "zm_make_buildable" );
|
||||||
|
wait 2,5;
|
||||||
|
self notify( "stop_buildable_fx" );
|
||||||
|
self maps/mp/zombies/_zm_buildables::player_build( self.buildable_zone, self.pieces );
|
||||||
|
if ( isDefined( self.buildable_zone.stub.onuse ) )
|
||||||
|
{
|
||||||
|
self.buildable_zone.stub [[ self.buildable_zone.stub.onuse ]]( self );
|
||||||
|
}
|
||||||
|
self.pieces = undefined;
|
||||||
|
self.context_done = 1;
|
||||||
|
}
|
||||||
|
|
||||||
|
build_buildable_fx( table )
|
||||||
|
{
|
||||||
|
self endon( "death" );
|
||||||
|
self notify( "stop_buildable_fx" );
|
||||||
|
self endon( "stop_buildable_fx" );
|
||||||
|
while ( 1 )
|
||||||
|
{
|
||||||
|
playfx( level._effect[ "fx_buried_sloth_building" ], table.origin );
|
||||||
|
wait 0,25;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
build_buildable_interrupt()
|
||||||
|
{
|
||||||
|
while ( isDefined( self.pieces ) && self.pieces.size > 0 )
|
||||||
|
{
|
||||||
|
_a238 = self.pieces;
|
||||||
|
_k238 = getFirstArrayKey( _a238 );
|
||||||
|
while ( isDefined( _k238 ) )
|
||||||
|
{
|
||||||
|
piece = _a238[ _k238 ];
|
||||||
|
piece maps/mp/zombies/_zm_buildables::piece_spawn_at();
|
||||||
|
_k238 = getNextArrayKey( _a238, _k238 );
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
fetch_buildable_condition()
|
||||||
|
{
|
||||||
|
self.turbine = undefined;
|
||||||
|
turbines = [];
|
||||||
|
equipment = maps/mp/zombies/_zm_equipment::get_destructible_equipment_list();
|
||||||
|
_a254 = equipment;
|
||||||
|
_k254 = getFirstArrayKey( _a254 );
|
||||||
|
while ( isDefined( _k254 ) )
|
||||||
|
{
|
||||||
|
item = _a254[ _k254 ];
|
||||||
|
if ( !isDefined( item.equipname ) )
|
||||||
|
{
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
if ( item.equipname == "equip_turbine_zm" )
|
||||||
|
{
|
||||||
|
/#
|
||||||
|
self sloth_debug_context( item, sqrt( 32400 ) );
|
||||||
|
#/
|
||||||
|
dist = distancesquared( item.origin, self.origin );
|
||||||
|
if ( dist < 32400 )
|
||||||
|
{
|
||||||
|
self.power_stubs = get_power_stubs( self.candy_player );
|
||||||
|
if ( self.power_stubs.size > 0 )
|
||||||
|
{
|
||||||
|
self.turbine = item;
|
||||||
|
return 1;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
localpower = item.owner.localpower;
|
||||||
|
if ( check_localpower_list( localpower.added_list ) || check_localpower_list( localpower.enabled_list ) )
|
||||||
|
{
|
||||||
|
self.turbine = item;
|
||||||
|
return 1;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
turbines[ turbines.size ] = item;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
_k254 = getNextArrayKey( _a254, _k254 );
|
||||||
|
}
|
||||||
|
_a290 = equipment;
|
||||||
|
_k290 = getFirstArrayKey( _a290 );
|
||||||
|
while ( isDefined( _k290 ) )
|
||||||
|
{
|
||||||
|
item = _a290[ _k290 ];
|
||||||
|
if ( !isDefined( item.equipname ) )
|
||||||
|
{
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
while ( item.equipname != "equip_turret_zm" || item.equipname == "equip_electrictrap_zm" && item.equipname == "equip_subwoofer_zm" )
|
||||||
|
{
|
||||||
|
/#
|
||||||
|
self sloth_debug_context( item, sqrt( 32400 ) );
|
||||||
|
#/
|
||||||
|
dist = distancesquared( item.origin, self.origin );
|
||||||
|
while ( dist < 32400 )
|
||||||
|
{
|
||||||
|
while ( is_true( item.power_on ) )
|
||||||
|
{
|
||||||
|
_a307 = turbines;
|
||||||
|
_k307 = getFirstArrayKey( _a307 );
|
||||||
|
while ( isDefined( _k307 ) )
|
||||||
|
{
|
||||||
|
turbine = _a307[ _k307 ];
|
||||||
|
if ( is_turbine_powering_item( turbine, item ) )
|
||||||
|
{
|
||||||
|
self.turbine = turbine;
|
||||||
|
return 1;
|
||||||
|
}
|
||||||
|
_k307 = getNextArrayKey( _a307, _k307 );
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
_k290 = getNextArrayKey( _a290, _k290 );
|
||||||
|
}
|
||||||
|
_a320 = equipment;
|
||||||
|
_k320 = getFirstArrayKey( _a320 );
|
||||||
|
while ( isDefined( _k320 ) )
|
||||||
|
{
|
||||||
|
item = _a320[ _k320 ];
|
||||||
|
if ( !isDefined( item.equipname ) )
|
||||||
|
{
|
||||||
|
}
|
||||||
|
else if ( item.equipname != "equip_turret_zm" || item.equipname == "equip_electrictrap_zm" && item.equipname == "equip_subwoofer_zm" )
|
||||||
|
{
|
||||||
|
/#
|
||||||
|
self sloth_debug_context( item, sqrt( 32400 ) );
|
||||||
|
#/
|
||||||
|
dist = distancesquared( item.origin, self.origin );
|
||||||
|
if ( dist < 32400 )
|
||||||
|
{
|
||||||
|
if ( is_true( level.turbine_zone.built ) )
|
||||||
|
{
|
||||||
|
self.power_item = item;
|
||||||
|
return 1;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
/#
|
||||||
|
sloth_print( "turbine not built" );
|
||||||
|
#/
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
_k320 = getNextArrayKey( _a320, _k320 );
|
||||||
|
}
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
is_turbine_powering_item( turbine, item )
|
||||||
|
{
|
||||||
|
localpower = turbine.owner.localpower;
|
||||||
|
while ( isDefined( localpower.added_list ) )
|
||||||
|
{
|
||||||
|
_a358 = localpower.added_list;
|
||||||
|
_k358 = getFirstArrayKey( _a358 );
|
||||||
|
while ( isDefined( _k358 ) )
|
||||||
|
{
|
||||||
|
added = _a358[ _k358 ];
|
||||||
|
if ( added == item )
|
||||||
|
{
|
||||||
|
return 1;
|
||||||
|
}
|
||||||
|
_k358 = getNextArrayKey( _a358, _k358 );
|
||||||
|
}
|
||||||
|
}
|
||||||
|
while ( isDefined( localpower.enabled_list ) )
|
||||||
|
{
|
||||||
|
_a368 = localpower.enabled_list;
|
||||||
|
_k368 = getFirstArrayKey( _a368 );
|
||||||
|
while ( isDefined( _k368 ) )
|
||||||
|
{
|
||||||
|
enabled = _a368[ _k368 ];
|
||||||
|
if ( enabled == item )
|
||||||
|
{
|
||||||
|
return 1;
|
||||||
|
}
|
||||||
|
_k368 = getNextArrayKey( _a368, _k368 );
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
get_power_stubs( player )
|
||||||
|
{
|
||||||
|
power_stubs = [];
|
||||||
|
_a382 = level.power_zones;
|
||||||
|
_k382 = getFirstArrayKey( _a382 );
|
||||||
|
while ( isDefined( _k382 ) )
|
||||||
|
{
|
||||||
|
zone = _a382[ _k382 ];
|
||||||
|
if ( is_true( zone.built ) )
|
||||||
|
{
|
||||||
|
if ( !player has_player_equipment( zone.stub.weaponname ) )
|
||||||
|
{
|
||||||
|
power_stubs[ power_stubs.size ] = zone.stub;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
_k382 = getNextArrayKey( _a382, _k382 );
|
||||||
|
}
|
||||||
|
return power_stubs;
|
||||||
|
}
|
||||||
|
|
||||||
|
fetch_buildable_start()
|
||||||
|
{
|
||||||
|
/#
|
||||||
|
sloth_print( self.context.name );
|
||||||
|
#/
|
||||||
|
self.context_done = 0;
|
||||||
|
self.pi_origin = undefined;
|
||||||
|
if ( isDefined( self.turbine ) )
|
||||||
|
{
|
||||||
|
localpower = self.turbine.owner.localpower;
|
||||||
|
if ( check_localpower_list( localpower.added_list ) || check_localpower_list( localpower.enabled_list ) )
|
||||||
|
{
|
||||||
|
/#
|
||||||
|
sloth_print( "has powered item, go get turbine" );
|
||||||
|
#/
|
||||||
|
self thread fetch_buildable_action( "turbine" );
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
/#
|
||||||
|
sloth_print( "find a power item" );
|
||||||
|
#/
|
||||||
|
self thread fetch_buildable_action( "power_item" );
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
if ( isDefined( self.power_item ) )
|
||||||
|
{
|
||||||
|
/#
|
||||||
|
sloth_print( "power item needs turbine" );
|
||||||
|
#/
|
||||||
|
self.pi_origin = self.power_item.origin;
|
||||||
|
self thread fetch_buildable_action( "turbine" );
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
check_localpower_list( list )
|
||||||
|
{
|
||||||
|
while ( isDefined( list ) )
|
||||||
|
{
|
||||||
|
_a436 = list;
|
||||||
|
_k436 = getFirstArrayKey( _a436 );
|
||||||
|
while ( isDefined( _k436 ) )
|
||||||
|
{
|
||||||
|
item = _a436[ _k436 ];
|
||||||
|
item_name = item.target.name;
|
||||||
|
if ( !isDefined( item_name ) )
|
||||||
|
{
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
if ( item_name != "equip_turret_zm" || item_name == "equip_electrictrap_zm" && item_name == "equip_subwoofer_zm" )
|
||||||
|
{
|
||||||
|
return 1;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
_k436 = getNextArrayKey( _a436, _k436 );
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
fetch_buildable_action( item )
|
||||||
|
{
|
||||||
|
self endon( "death" );
|
||||||
|
self endon( "stop_action" );
|
||||||
|
self maps/mp/zombies/_zm_ai_sloth::common_context_action();
|
||||||
|
player = self.candy_player;
|
||||||
|
if ( item == "turbine" )
|
||||||
|
{
|
||||||
|
if ( isDefined( self.turbine ) )
|
||||||
|
{
|
||||||
|
plant_origin = self.turbine.origin;
|
||||||
|
plant_angles = self.turbine.angles;
|
||||||
|
}
|
||||||
|
stub = level.turbine_zone.stub;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
if ( item == "power_item" )
|
||||||
|
{
|
||||||
|
self.power_stubs = array_randomize( self.power_stubs );
|
||||||
|
stub = self.power_stubs[ 0 ];
|
||||||
|
}
|
||||||
|
}
|
||||||
|
append_name = "equipment";
|
||||||
|
pickup_asd = "zm_pickup_" + append_name;
|
||||||
|
table = getent( stub.model.target, "targetname" );
|
||||||
|
if ( !self common_move_to_table( stub, table, pickup_asd, 1 ) )
|
||||||
|
{
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
self.buildable_item = item;
|
||||||
|
self animscripted( table.origin, table.angles, pickup_asd );
|
||||||
|
maps/mp/animscripts/zm_shared::donotetracks( "pickup_equipment_anim", ::pickup_notetracks, stub );
|
||||||
|
if ( player is_player_equipment( stub.weaponname ) )
|
||||||
|
{
|
||||||
|
/#
|
||||||
|
sloth_print( "during anim player picked up " + stub.weaponname );
|
||||||
|
#/
|
||||||
|
self.context_done = 1;
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
if ( !player has_deployed_equipment( stub.weaponname ) )
|
||||||
|
{
|
||||||
|
player.deployed_equipment[ player.deployed_equipment.size ] = stub.weaponname;
|
||||||
|
}
|
||||||
|
/#
|
||||||
|
sloth_print( "got " + stub.equipname );
|
||||||
|
#/
|
||||||
|
if ( isDefined( self.turbine ) )
|
||||||
|
{
|
||||||
|
ground_pos = self.turbine.origin;
|
||||||
|
}
|
||||||
|
else if ( isDefined( self.power_item ) )
|
||||||
|
{
|
||||||
|
ground_pos = self.power_item.origin;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
ground_pos = self.pi_origin;
|
||||||
|
}
|
||||||
|
run_asd = "run_holding_" + append_name;
|
||||||
|
self.ignore_common_run = 1;
|
||||||
|
self set_zombie_run_cycle( run_asd );
|
||||||
|
self.locomotion = run_asd;
|
||||||
|
self setgoalpos( ground_pos );
|
||||||
|
range = 10000;
|
||||||
|
if ( item == "power_item" || isDefined( self.power_item ) )
|
||||||
|
{
|
||||||
|
range = 25600;
|
||||||
|
}
|
||||||
|
while ( 1 )
|
||||||
|
{
|
||||||
|
while ( self sloth_is_traversing() )
|
||||||
|
{
|
||||||
|
wait 0,1;
|
||||||
|
}
|
||||||
|
dist = distancesquared( self.origin, ground_pos );
|
||||||
|
if ( dist < range )
|
||||||
|
{
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
wait 0,1;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if ( item == "turbine" )
|
||||||
|
{
|
||||||
|
if ( isDefined( self.turbine ) )
|
||||||
|
{
|
||||||
|
self orientmode( "face point", self.turbine.origin );
|
||||||
|
self animscripted( self.origin, flat_angle( vectorToAngle( self.turbine.origin - self.origin ) ), "zm_kick_equipment" );
|
||||||
|
maps/mp/animscripts/zm_shared::donotetracks( "kick_equipment_anim", ::destroy_item, self.turbine );
|
||||||
|
self orientmode( "face default" );
|
||||||
|
self animscripted( self.origin, self.angles, "zm_idle_equipment" );
|
||||||
|
wait 3;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if ( !isDefined( plant_origin ) )
|
||||||
|
{
|
||||||
|
plant_origin = self.origin;
|
||||||
|
plant_angles = self.angles;
|
||||||
|
}
|
||||||
|
drop_asd = "zm_drop_" + append_name;
|
||||||
|
self maps/mp/zombies/_zm_ai_sloth::action_animscripted( drop_asd, "drop_equipment_anim" );
|
||||||
|
if ( player has_player_equipment( stub.weaponname ) )
|
||||||
|
{
|
||||||
|
player equipment_take( stub.weaponname );
|
||||||
|
}
|
||||||
|
player player_set_equipment_damage( stub.weaponname, 0 );
|
||||||
|
if ( !player has_deployed_equipment( stub.weaponname ) )
|
||||||
|
{
|
||||||
|
player.deployed_equipment[ player.deployed_equipment.size ] = stub.weaponname;
|
||||||
|
}
|
||||||
|
if ( isDefined( self.buildable_model ) )
|
||||||
|
{
|
||||||
|
self.buildable_model unlink();
|
||||||
|
self.buildable_model delete();
|
||||||
|
}
|
||||||
|
equipment = stub.weaponname;
|
||||||
|
plant_origin = self gettagorigin( "tag_weapon_right" );
|
||||||
|
plant_angles = self gettagangles( "tag_weapon_right" );
|
||||||
|
replacement = player [[ level.zombie_equipment[ equipment ].place_fn ]]( plant_origin, plant_angles );
|
||||||
|
if ( isDefined( replacement ) )
|
||||||
|
{
|
||||||
|
replacement.owner = player;
|
||||||
|
replacement.original_owner = player;
|
||||||
|
replacement.name = equipment;
|
||||||
|
player notify( "equipment_placed" );
|
||||||
|
if ( isDefined( level.equipment_planted ) )
|
||||||
|
{
|
||||||
|
player [[ level.equipment_planted ]]( replacement, equipment, self );
|
||||||
|
}
|
||||||
|
}
|
||||||
|
self.context_done = 1;
|
||||||
|
}
|
||||||
|
|
||||||
|
pickup_notetracks( note, stub )
|
||||||
|
{
|
||||||
|
if ( note == "pickup" )
|
||||||
|
{
|
||||||
|
tag_name = "tag_stowed_back";
|
||||||
|
twr_origin = self gettagorigin( tag_name );
|
||||||
|
twr_angles = self gettagangles( tag_name );
|
||||||
|
self.buildable_model = spawn( "script_model", twr_origin );
|
||||||
|
self.buildable_model.angles = twr_angles;
|
||||||
|
if ( self.buildable_item == "turbine" )
|
||||||
|
{
|
||||||
|
self.buildable_model setmodel( level.small_turbine );
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
self.buildable_model setmodel( stub.model.model );
|
||||||
|
}
|
||||||
|
self.buildable_model linkto( self, tag_name );
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
destroy_item( note, item )
|
||||||
|
{
|
||||||
|
if ( note == "kick" )
|
||||||
|
{
|
||||||
|
if ( isDefined( item ) )
|
||||||
|
{
|
||||||
|
if ( isDefined( item.owner ) )
|
||||||
|
{
|
||||||
|
item.owner thread maps/mp/zombies/_zm_equipment::player_damage_equipment( item.equipname, 1001, item.origin );
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
item thread maps/mp/zombies/_zm_equipment::dropped_equipment_destroy( 1 );
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
fetch_buildable_interrupt()
|
||||||
|
{
|
||||||
|
if ( isDefined( self.buildable_model ) )
|
||||||
|
{
|
||||||
|
self.buildable_model unlink();
|
||||||
|
self.buildable_model delete();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
wallbuy_condition()
|
||||||
|
{
|
||||||
|
if ( !wallbuy_get_stub_array().size )
|
||||||
|
{
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
if ( !wallbuy_get_piece_array().size )
|
||||||
|
{
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
if ( isDefined( level.gunshop_zone ) )
|
||||||
|
{
|
||||||
|
if ( self istouching( level.gunshop_zone ) )
|
||||||
|
{
|
||||||
|
/#
|
||||||
|
sloth_print( "using new gunshop zone" );
|
||||||
|
#/
|
||||||
|
return 1;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
if ( self maps/mp/zombies/_zm_zonemgr::entity_in_zone( "zone_gun_store" ) )
|
||||||
|
{
|
||||||
|
return 1;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
wallbuy_get_stub_array()
|
||||||
|
{
|
||||||
|
stubs = [];
|
||||||
|
i = 0;
|
||||||
|
while ( i < level.sloth_wallbuy_stubs.size )
|
||||||
|
{
|
||||||
|
stub = level.sloth_wallbuy_stubs[ i ];
|
||||||
|
if ( !isDefined( stub.in_zone ) )
|
||||||
|
{
|
||||||
|
/#
|
||||||
|
iprintln( "WALLBUY NOT IN VALID ZONE" );
|
||||||
|
#/
|
||||||
|
i++;
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
else if ( !level.zones[ stub.in_zone ].is_enabled )
|
||||||
|
{
|
||||||
|
i++;
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
else if ( is_true( stub.built ) )
|
||||||
|
{
|
||||||
|
remove_stub = stub;
|
||||||
|
i++;
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
else if ( stub.in_zone == "zone_general_store" )
|
||||||
|
{
|
||||||
|
if ( !is_general_store_open() )
|
||||||
|
{
|
||||||
|
i++;
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else if ( stub.in_zone == "zone_underground_courthouse2" )
|
||||||
|
{
|
||||||
|
if ( !maps/mp/zm_buried::is_courthouse_open() )
|
||||||
|
{
|
||||||
|
i++;
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else if ( stub.in_zone == "zone_tunnels_center" )
|
||||||
|
{
|
||||||
|
if ( !maps/mp/zm_buried::is_tunnel_open() )
|
||||||
|
{
|
||||||
|
i++;
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
stubs[ stubs.size ] = stub;
|
||||||
|
}
|
||||||
|
i++;
|
||||||
|
}
|
||||||
|
if ( isDefined( remove_stub ) )
|
||||||
|
{
|
||||||
|
arrayremovevalue( level.sloth_wallbuy_stubs, remove_stub );
|
||||||
|
}
|
||||||
|
return stubs;
|
||||||
|
}
|
||||||
|
|
||||||
|
wallbuy_get_piece_array()
|
||||||
|
{
|
||||||
|
pieces = [];
|
||||||
|
i = 0;
|
||||||
|
while ( i < level.chalk_pieces.size )
|
||||||
|
{
|
||||||
|
piece = level.chalk_pieces[ i ];
|
||||||
|
if ( isDefined( piece.unitrigger ) && !is_true( piece.built ) )
|
||||||
|
{
|
||||||
|
pieces[ pieces.size ] = piece;
|
||||||
|
}
|
||||||
|
i++;
|
||||||
|
}
|
||||||
|
return pieces;
|
||||||
|
}
|
||||||
|
|
||||||
|
wallbuy_action()
|
||||||
|
{
|
||||||
|
self endon( "death" );
|
||||||
|
self endon( "stop_action" );
|
||||||
|
self maps/mp/zombies/_zm_ai_sloth::common_context_action();
|
||||||
|
wallbuy_struct = getstruct( "sloth_allign_gunshop", "targetname" );
|
||||||
|
asd_name = "zm_wallbuy_remove";
|
||||||
|
anim_id = self getanimfromasd( asd_name, 0 );
|
||||||
|
start_org = getstartorigin( wallbuy_struct.origin, wallbuy_struct.angles, anim_id );
|
||||||
|
start_ang = getstartangles( wallbuy_struct.origin, wallbuy_struct.angles, anim_id );
|
||||||
|
self setgoalpos( start_org );
|
||||||
|
self waittill( "goal" );
|
||||||
|
self setgoalpos( self.origin );
|
||||||
|
self sloth_face_object( undefined, "angle", start_ang[ 1 ], 0,9 );
|
||||||
|
self animscripted( wallbuy_struct.origin, wallbuy_struct.angles, asd_name );
|
||||||
|
maps/mp/animscripts/zm_shared::donotetracks( "wallbuy_remove_anim", ::wallbuy_grab_pieces );
|
||||||
|
if ( !self.wallbuy_stubs.size || !self.wallbuy_pieces.size )
|
||||||
|
{
|
||||||
|
self.context_done = 1;
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
i = 0;
|
||||||
|
while ( i < self.pieces_needed )
|
||||||
|
{
|
||||||
|
stub = self.wallbuy_stubs[ i ];
|
||||||
|
vec_right = vectornormalize( anglesToRight( stub.angles ) );
|
||||||
|
org = stub.origin - ( vec_right * 60 );
|
||||||
|
org = groundpos( org );
|
||||||
|
self setgoalpos( org );
|
||||||
|
skip_piece = 0;
|
||||||
|
while ( 1 )
|
||||||
|
{
|
||||||
|
if ( is_true( stub.built ) )
|
||||||
|
{
|
||||||
|
/#
|
||||||
|
sloth_print( "stub was built during pathing" );
|
||||||
|
#/
|
||||||
|
skip_piece = 1;
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
else dist = distancesquared( self.origin, org );
|
||||||
|
if ( dist < 576 )
|
||||||
|
{
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
wait 0,1;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if ( !skip_piece )
|
||||||
|
{
|
||||||
|
self setgoalpos( self.origin );
|
||||||
|
chalk_angle = vectorToAngle( vec_right );
|
||||||
|
self sloth_face_object( stub, "angle", chalk_angle[ 1 ], 0,9 );
|
||||||
|
if ( is_true( stub.built ) )
|
||||||
|
{
|
||||||
|
/#
|
||||||
|
sloth_print( "stub was built during facing" );
|
||||||
|
#/
|
||||||
|
skip_piece = 1;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
self player_set_buildable_piece( self.wallbuy_pieces[ i ], 1 );
|
||||||
|
current_piece = self player_get_buildable_piece( 1 );
|
||||||
|
if ( skip_piece )
|
||||||
|
{
|
||||||
|
arrayremovevalue( self.wallbuy_pieces_taken, current_piece );
|
||||||
|
current_piece maps/mp/zm_buried_buildables::ondrop_chalk( self );
|
||||||
|
self orientmode( "face default" );
|
||||||
|
i++;
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
self thread player_draw_chalk( stub );
|
||||||
|
self maps/mp/zombies/_zm_ai_sloth::action_animscripted( "zm_wallbuy_add", "wallbuy_add_anim", org, chalk_angle );
|
||||||
|
self notify( "end_chalk_dust" );
|
||||||
|
playsoundatposition( "zmb_cha_ching_loud", stub.origin );
|
||||||
|
if ( is_true( stub.built ) )
|
||||||
|
{
|
||||||
|
current_piece maps/mp/zm_buried_buildables::ondrop_chalk( self );
|
||||||
|
/#
|
||||||
|
sloth_print( "stub was built during anim" );
|
||||||
|
#/
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
stub maps/mp/zm_buried_buildables::onuseplantobject_chalk( self );
|
||||||
|
stub buildablestub_finish_build( self );
|
||||||
|
stub buildablestub_remove();
|
||||||
|
thread maps/mp/zombies/_zm_unitrigger::unregister_unitrigger( stub );
|
||||||
|
/#
|
||||||
|
sloth_print( "built " + self player_get_buildable_piece( 1 ).script_noteworthy );
|
||||||
|
#/
|
||||||
|
}
|
||||||
|
arrayremovevalue( self.wallbuy_pieces_taken, self player_get_buildable_piece( 1 ) );
|
||||||
|
self orientmode( "face default" );
|
||||||
|
}
|
||||||
|
i++;
|
||||||
|
}
|
||||||
|
self.context_done = 1;
|
||||||
|
}
|
||||||
|
|
||||||
|
wallbuy_grab_pieces( note )
|
||||||
|
{
|
||||||
|
while ( note == "pulled" )
|
||||||
|
{
|
||||||
|
self.wallbuy_stubs = wallbuy_get_stub_array();
|
||||||
|
self.wallbuy_pieces = wallbuy_get_piece_array();
|
||||||
|
self.pieces_needed = self.wallbuy_stubs.size;
|
||||||
|
if ( self.pieces_needed > self.wallbuy_pieces.size )
|
||||||
|
{
|
||||||
|
self.pieces_needed = self.wallbuy_pieces.size;
|
||||||
|
}
|
||||||
|
self.wallbuy_pieces = array_randomize( self.wallbuy_pieces );
|
||||||
|
self.wallbuy_pieces_taken = [];
|
||||||
|
i = 0;
|
||||||
|
while ( i < self.pieces_needed )
|
||||||
|
{
|
||||||
|
self.wallbuy_pieces_taken[ i ] = self.wallbuy_pieces[ i ];
|
||||||
|
self.wallbuy_pieces[ i ] maps/mp/zombies/_zm_buildables::piece_unspawn();
|
||||||
|
i++;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
wallbuy_interrupt()
|
||||||
|
{
|
||||||
|
while ( isDefined( self.wallbuy_pieces_taken ) && self.wallbuy_pieces_taken.size > 0 )
|
||||||
|
{
|
||||||
|
_a920 = self.wallbuy_pieces_taken;
|
||||||
|
_k920 = getFirstArrayKey( _a920 );
|
||||||
|
while ( isDefined( _k920 ) )
|
||||||
|
{
|
||||||
|
wallbuy = _a920[ _k920 ];
|
||||||
|
wallbuy maps/mp/zm_buried_buildables::ondrop_chalk( self );
|
||||||
|
_k920 = getNextArrayKey( _a920, _k920 );
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
434
zm_buried_patch/maps/mp/zombies/_zm_ai_sloth_crawler.gsc
Normal file
434
zm_buried_patch/maps/mp/zombies/_zm_ai_sloth_crawler.gsc
Normal file
@ -0,0 +1,434 @@
|
|||||||
|
#include maps/mp/animscripts/zm_shared;
|
||||||
|
#include maps/mp/animscripts/zm_run;
|
||||||
|
#include maps/mp/zombies/_zm_ai_sloth;
|
||||||
|
#include maps/mp/zombies/_zm_ai_sloth_utility;
|
||||||
|
#include maps/mp/zombies/_zm_utility;
|
||||||
|
#include maps/mp/_utility;
|
||||||
|
#include common_scripts/utility;
|
||||||
|
|
||||||
|
crawler_condition()
|
||||||
|
{
|
||||||
|
zombies = get_round_enemy_array();
|
||||||
|
i = 0;
|
||||||
|
while ( i < zombies.size )
|
||||||
|
{
|
||||||
|
zombie = zombies[ i ];
|
||||||
|
if ( !is_true( zombie.has_legs ) )
|
||||||
|
{
|
||||||
|
dist = distancesquared( self.origin, zombie.origin );
|
||||||
|
if ( dist < 32400 )
|
||||||
|
{
|
||||||
|
self.crawler = zombie;
|
||||||
|
if ( isDefined( level.sloth.custom_crawler_pickup_func ) )
|
||||||
|
{
|
||||||
|
self.crawler thread [[ level.sloth.custom_crawler_pickup_func ]]();
|
||||||
|
}
|
||||||
|
return 1;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
i++;
|
||||||
|
}
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
crawler_action()
|
||||||
|
{
|
||||||
|
self endon( "death" );
|
||||||
|
self endon( "stop_action" );
|
||||||
|
self maps/mp/zombies/_zm_ai_sloth::common_context_action();
|
||||||
|
self thread watch_sloth_on_exit_side();
|
||||||
|
self thread watch_sloth_on_same_side();
|
||||||
|
self thread crawler_watch_death();
|
||||||
|
self.release_crawler = 0;
|
||||||
|
anim_id = self getanimfromasd( "zm_sloth_pickup_crawler", 0 );
|
||||||
|
sloth_goal = getstartorigin( self.crawler.origin, self.crawler.angles, anim_id );
|
||||||
|
sloth_offset = distance( sloth_goal, self.crawler.origin );
|
||||||
|
while ( 1 )
|
||||||
|
{
|
||||||
|
while ( self sloth_is_traversing() )
|
||||||
|
{
|
||||||
|
wait 0,1;
|
||||||
|
}
|
||||||
|
vec_forward = vectornormalize( anglesToForward( self.crawler.angles ) );
|
||||||
|
start_pos = self.crawler.origin - ( vec_forward * sloth_offset );
|
||||||
|
raised_start_pos = ( start_pos[ 0 ], start_pos[ 1 ], start_pos[ 2 ] + sloth_offset );
|
||||||
|
ground_pos = groundpos( raised_start_pos );
|
||||||
|
height_check = abs( self.crawler.origin[ 2 ] - ground_pos[ 2 ] );
|
||||||
|
if ( height_check > 8 )
|
||||||
|
{
|
||||||
|
self setanimstatefromasd( "zm_player_idle" );
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
self maps/mp/animscripts/zm_run::needsupdate();
|
||||||
|
self setgoalpos( start_pos );
|
||||||
|
}
|
||||||
|
if ( !isDefined( self.crawler ) || self.crawler.health <= 0 )
|
||||||
|
{
|
||||||
|
self.context_done = 1;
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
dist = distancesquared( self.origin, start_pos );
|
||||||
|
z_dist = abs( self.origin[ 2 ] - start_pos[ 2 ] );
|
||||||
|
if ( dist < 1024 && z_dist < 12 )
|
||||||
|
{
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
wait 0,1;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
self orientmode( "face angle", self.crawler.angles[ 1 ] );
|
||||||
|
wait 0,25;
|
||||||
|
self.crawler.is_inert = 1;
|
||||||
|
self.crawler.ignoreall = 1;
|
||||||
|
self.crawler notify( "stop_find_flesh" );
|
||||||
|
self.crawler notify( "zombie_acquire_enemy" );
|
||||||
|
self.anchor.origin = self.crawler.origin;
|
||||||
|
self.anchor.angles = self.crawler.angles;
|
||||||
|
sloth_pickup = self append_hunched( "zm_sloth_pickup_crawler" );
|
||||||
|
crawler_pickup = self append_hunched( "zm_crawler_pickup_by_sloth" );
|
||||||
|
self animscripted( self.anchor.origin, self.anchor.angles, sloth_pickup );
|
||||||
|
self.crawler animscripted( self.anchor.origin, self.anchor.angles, crawler_pickup );
|
||||||
|
maps/mp/animscripts/zm_shared::donotetracks( "sloth_pickup_crawler_anim" );
|
||||||
|
self.carrying_crawler = 1;
|
||||||
|
self.crawler.guts_explosion = 1;
|
||||||
|
self.pre_traverse = ::crawler_pre_traverse;
|
||||||
|
self.post_traverse = ::crawler_post_traverse;
|
||||||
|
self.crawler notsolid();
|
||||||
|
self.crawler linkto( self, "tag_weapon_right" );
|
||||||
|
self.ignore_common_run = 1;
|
||||||
|
self set_zombie_run_cycle( "walk_crawlerhold" );
|
||||||
|
self.locomotion = "walk_crawlerhold";
|
||||||
|
self.setanimstatefromspeed = ::slothanimstatefromspeed;
|
||||||
|
self.crawler_end = getTime() + 5000;
|
||||||
|
self.crawler.actor_damage_func = ::crawler_damage_func;
|
||||||
|
self.sloth_damage_func = ::crawler_damage_func;
|
||||||
|
roam = array_randomize( level.roam_points );
|
||||||
|
roam_index = 0;
|
||||||
|
while ( 1 )
|
||||||
|
{
|
||||||
|
if ( is_true( self.release_crawler ) )
|
||||||
|
{
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
while ( self sloth_is_traversing() )
|
||||||
|
{
|
||||||
|
wait 0,1;
|
||||||
|
}
|
||||||
|
dist = distancesquared( self.origin, self.candy_player.origin );
|
||||||
|
if ( dist < 25600 || is_true( self.candy_player.is_in_ghost_zone ) && is_true( self.on_exit_side ) )
|
||||||
|
{
|
||||||
|
self.check_turn = 1;
|
||||||
|
self setgoalpos( self.origin );
|
||||||
|
sloth_idle = self append_hunched( "zm_sloth_crawlerhold_idle" );
|
||||||
|
crawler_idle = self append_hunched( "zm_crawler_crawlerhold_idle" );
|
||||||
|
self animscripted( self.origin, self.angles, sloth_idle );
|
||||||
|
self.crawler animscripted( self.origin, self.angles, crawler_idle );
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
self stopanimscripted();
|
||||||
|
self.crawler stopanimscripted();
|
||||||
|
if ( should_ignore_candybooze( self.candy_player ) )
|
||||||
|
{
|
||||||
|
dist = distancesquared( self.origin, roam[ roam_index ].origin );
|
||||||
|
if ( dist < 1024 )
|
||||||
|
{
|
||||||
|
roam_index++;
|
||||||
|
if ( roam_index >= roam.size )
|
||||||
|
{
|
||||||
|
roam_index = 0;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
self maps/mp/zombies/_zm_ai_sloth::sloth_check_turn( roam[ roam_index ].origin );
|
||||||
|
self setgoalpos( roam[ roam_index ].origin );
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
if ( !self sloth_move_to_same_side() )
|
||||||
|
{
|
||||||
|
if ( is_true( self.check_turn ) )
|
||||||
|
{
|
||||||
|
self.check_turn = 0;
|
||||||
|
if ( self sloth_is_same_zone( self.candy_player ) )
|
||||||
|
{
|
||||||
|
self maps/mp/zombies/_zm_ai_sloth::sloth_check_turn( self.candy_player.origin, -0,965 );
|
||||||
|
}
|
||||||
|
}
|
||||||
|
self setgoalpos( self.candy_player.origin );
|
||||||
|
}
|
||||||
|
}
|
||||||
|
self crawler_update_locomotion();
|
||||||
|
}
|
||||||
|
wait 0,1;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
self.setanimstatefromspeed = undefined;
|
||||||
|
self.crawler unlink();
|
||||||
|
sloth_putdown = self append_hunched( "zm_sloth_putdown_crawler" );
|
||||||
|
crawler_putdown = self append_hunched( "zm_crawler_putdown_by_sloth" );
|
||||||
|
self animscripted( self.origin, self.angles, sloth_putdown );
|
||||||
|
self.crawler animscripted( self.origin, self.angles, crawler_putdown );
|
||||||
|
maps/mp/animscripts/zm_shared::donotetracks( "sloth_putdown_crawler_anim" );
|
||||||
|
self.carrying_crawler = 0;
|
||||||
|
self.crawler.deathfunction = ::crawler_death;
|
||||||
|
sloth_kill = self append_hunched( "zm_sloth_kill_crawler_stomp" );
|
||||||
|
crawler_kill = self append_hunched( "zm_crawler_slothkill_stomp" );
|
||||||
|
self notify( "stop_crawler_watch" );
|
||||||
|
self animscripted( self.origin, self.angles, sloth_kill );
|
||||||
|
self.crawler animscripted( self.origin, self.angles, crawler_kill );
|
||||||
|
maps/mp/animscripts/zm_shared::donotetracks( "sloth_kill_crawler_anim" );
|
||||||
|
if ( isDefined( self.crawler ) )
|
||||||
|
{
|
||||||
|
self.crawler dodamage( self.crawler.health * 10, self.crawler.origin );
|
||||||
|
self.crawler playsound( "zmb_ai_sloth_attack_impact" );
|
||||||
|
}
|
||||||
|
self.sloth_damage_func = undefined;
|
||||||
|
self maps/mp/zombies/_zm_ai_sloth::sloth_set_traverse_funcs();
|
||||||
|
self.crawler = undefined;
|
||||||
|
self.context_done = 1;
|
||||||
|
}
|
||||||
|
|
||||||
|
watch_sloth_on_exit_side()
|
||||||
|
{
|
||||||
|
self endon( "death" );
|
||||||
|
while ( 1 )
|
||||||
|
{
|
||||||
|
if ( is_true( self.context_done ) )
|
||||||
|
{
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
self.on_exit_side = 0;
|
||||||
|
player = self.candy_player;
|
||||||
|
if ( isDefined( player ) && is_true( player.is_in_ghost_zone ) )
|
||||||
|
{
|
||||||
|
name = player.current_ghost_room_name;
|
||||||
|
if ( isDefined( name ) )
|
||||||
|
{
|
||||||
|
room = level.ghost_rooms[ name ];
|
||||||
|
if ( is_true( room.to_maze ) )
|
||||||
|
{
|
||||||
|
if ( self maps/mp/zombies/_zm_ai_sloth::sloth_behind_mansion() )
|
||||||
|
{
|
||||||
|
self.on_exit_side = 1;
|
||||||
|
}
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
if ( is_true( room.from_maze ) )
|
||||||
|
{
|
||||||
|
if ( !self maps/mp/zombies/_zm_ai_sloth::sloth_behind_mansion() )
|
||||||
|
{
|
||||||
|
self.on_exit_side = 1;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
wait 0,25;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
watch_sloth_on_same_side()
|
||||||
|
{
|
||||||
|
self endon( "death" );
|
||||||
|
while ( 1 )
|
||||||
|
{
|
||||||
|
if ( is_true( self.context_done ) )
|
||||||
|
{
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
self.on_same_side = 0;
|
||||||
|
player = self.candy_player;
|
||||||
|
if ( isDefined( player ) )
|
||||||
|
{
|
||||||
|
if ( self maps/mp/zombies/_zm_ai_sloth::sloth_behind_mansion() )
|
||||||
|
{
|
||||||
|
if ( player maps/mp/zombies/_zm_ai_sloth::behind_mansion_zone() )
|
||||||
|
{
|
||||||
|
self.on_same_side = 1;
|
||||||
|
}
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
if ( !player maps/mp/zombies/_zm_ai_sloth::behind_mansion_zone() )
|
||||||
|
{
|
||||||
|
self.on_same_side = 1;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
wait 0,25;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
sloth_move_to_same_side()
|
||||||
|
{
|
||||||
|
self endon( "death" );
|
||||||
|
if ( isDefined( self.teleport_time ) )
|
||||||
|
{
|
||||||
|
if ( ( getTime() - self.teleport_time ) < 1000 )
|
||||||
|
{
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
player = self.candy_player;
|
||||||
|
if ( is_true( player.is_in_ghost_zone ) )
|
||||||
|
{
|
||||||
|
if ( is_true( self.on_exit_side ) )
|
||||||
|
{
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
if ( is_true( self.on_same_side ) )
|
||||||
|
{
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if ( self maps/mp/zombies/_zm_ai_sloth::sloth_behind_mansion() )
|
||||||
|
{
|
||||||
|
self maps/mp/zombies/_zm_ai_sloth::action_navigate_mansion( level.courtyard_depart, level.courtyard_arrive );
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
self maps/mp/zombies/_zm_ai_sloth::action_navigate_mansion( level.maze_depart, level.maze_arrive );
|
||||||
|
}
|
||||||
|
return 1;
|
||||||
|
}
|
||||||
|
|
||||||
|
sloth_is_same_zone( player )
|
||||||
|
{
|
||||||
|
zone_sloth = self get_current_zone();
|
||||||
|
zone_player = player get_current_zone();
|
||||||
|
if ( !isDefined( zone_sloth ) || !isDefined( zone_player ) )
|
||||||
|
{
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
if ( zone_sloth == zone_player )
|
||||||
|
{
|
||||||
|
return 1;
|
||||||
|
}
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
append_hunched( asd_name )
|
||||||
|
{
|
||||||
|
if ( self.is_inside )
|
||||||
|
{
|
||||||
|
return asd_name + "_hunched";
|
||||||
|
}
|
||||||
|
return asd_name;
|
||||||
|
}
|
||||||
|
|
||||||
|
crawler_update_locomotion()
|
||||||
|
{
|
||||||
|
if ( self.zombie_move_speed == "walk_crawlerhold" )
|
||||||
|
{
|
||||||
|
if ( self.is_inside )
|
||||||
|
{
|
||||||
|
self set_zombie_run_cycle( "walk_crawlerhold_hunched" );
|
||||||
|
self.locomotion = "walk_crawlerhold_hunched";
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
if ( self.zombie_move_speed == "walk_crawlerhold_hunched" )
|
||||||
|
{
|
||||||
|
if ( !self.is_inside )
|
||||||
|
{
|
||||||
|
self set_zombie_run_cycle( "walk_crawlerhold" );
|
||||||
|
self.locomotion = "walk_crawlerhold";
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
crawler_watch_death()
|
||||||
|
{
|
||||||
|
self endon( "stop_crawler_watch" );
|
||||||
|
self.crawler waittill( "death" );
|
||||||
|
self stop_action();
|
||||||
|
/#
|
||||||
|
sloth_print( "crawler died" );
|
||||||
|
#/
|
||||||
|
if ( isDefined( self.crawler ) )
|
||||||
|
{
|
||||||
|
self.crawler unlink();
|
||||||
|
}
|
||||||
|
self.setanimstatefromspeed = undefined;
|
||||||
|
self.sloth_damage_func = undefined;
|
||||||
|
self maps/mp/zombies/_zm_ai_sloth::sloth_set_traverse_funcs();
|
||||||
|
self.crawler = undefined;
|
||||||
|
self.context_done = 1;
|
||||||
|
}
|
||||||
|
|
||||||
|
crawler_pre_traverse()
|
||||||
|
{
|
||||||
|
sloth_sling = self append_hunched( "zm_sloth_crawlerhold_sling" );
|
||||||
|
crawler_sling = self append_hunched( "zm_crawler_sloth_crawlerhold_sling" );
|
||||||
|
self setanimstatefromasd( sloth_sling );
|
||||||
|
self.crawler setanimstatefromasd( crawler_sling );
|
||||||
|
self maps/mp/animscripts/zm_shared::donotetracks( "sloth_crawlerhold_sling_anim" );
|
||||||
|
self.crawler thread crawler_traverse_idle();
|
||||||
|
}
|
||||||
|
|
||||||
|
crawler_traverse_idle()
|
||||||
|
{
|
||||||
|
self endon( "death" );
|
||||||
|
self endon( "stop_traverse_idle" );
|
||||||
|
while ( 1 )
|
||||||
|
{
|
||||||
|
self setanimstatefromasd( "zm_crawler_sloth_crawlerhold_slung_idle" );
|
||||||
|
wait 0,1;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
crawler_post_traverse()
|
||||||
|
{
|
||||||
|
self.crawler notify( "stop_traverse_idle" );
|
||||||
|
sloth_unsling = self append_hunched( "zm_sloth_crawlerhold_unsling" );
|
||||||
|
crawler_unsling = self append_hunched( "zm_crawler_sloth_crawlerhold_unsling" );
|
||||||
|
self setanimstatefromasd( sloth_unsling );
|
||||||
|
self.crawler setanimstatefromasd( crawler_unsling );
|
||||||
|
self maps/mp/animscripts/zm_shared::donotetracks( "sloth_crawlerhold_unsling_anim" );
|
||||||
|
}
|
||||||
|
|
||||||
|
crawler_death()
|
||||||
|
{
|
||||||
|
return 1;
|
||||||
|
}
|
||||||
|
|
||||||
|
crawler_damage_func( einflictor, eattacker, idamage, idflags, smeansofdeath, sweapon, vpoint, vdir, shitloc, psoffsettime, boneindex )
|
||||||
|
{
|
||||||
|
level.sloth.release_crawler = 1;
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
is_crawler_alive()
|
||||||
|
{
|
||||||
|
if ( isDefined( self.crawler ) && self.crawler.health > 0 )
|
||||||
|
{
|
||||||
|
return 1;
|
||||||
|
}
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
slothanimstatefromspeed( animstate, substate )
|
||||||
|
{
|
||||||
|
if ( isDefined( self.crawler ) )
|
||||||
|
{
|
||||||
|
crawler_walk = "zm_crawler_crawlerhold_walk";
|
||||||
|
if ( self.is_inside )
|
||||||
|
{
|
||||||
|
crawler_walk += "_hunched";
|
||||||
|
}
|
||||||
|
self.crawler setanimstatefromasd( crawler_walk );
|
||||||
|
}
|
||||||
|
}
|
14
zm_buried_patch/maps/mp/zombies/_zm_ai_sloth_ffotd.gsc
Normal file
14
zm_buried_patch/maps/mp/zombies/_zm_ai_sloth_ffotd.gsc
Normal file
@ -0,0 +1,14 @@
|
|||||||
|
#include maps/mp/zombies/_zm_ai_sloth_utility;
|
||||||
|
#include maps/mp/zombies/_zm_utility;
|
||||||
|
#include maps/mp/_utility;
|
||||||
|
#include common_scripts/utility;
|
||||||
|
|
||||||
|
sloth_ffotd_init()
|
||||||
|
{
|
||||||
|
level.double_wide_override = undefined;
|
||||||
|
level.interior_override = undefined;
|
||||||
|
}
|
||||||
|
|
||||||
|
sloth_ffotd_prespawn()
|
||||||
|
{
|
||||||
|
}
|
519
zm_buried_patch/maps/mp/zombies/_zm_ai_sloth_magicbox.gsc
Normal file
519
zm_buried_patch/maps/mp/zombies/_zm_ai_sloth_magicbox.gsc
Normal file
@ -0,0 +1,519 @@
|
|||||||
|
#include maps/mp/zombies/_zm_unitrigger;
|
||||||
|
#include maps/mp/zombies/_zm_hackables_box;
|
||||||
|
#include maps/mp/zombies/_zm_magicbox;
|
||||||
|
#include maps/mp/zm_buried;
|
||||||
|
#include maps/mp/animscripts/zm_shared;
|
||||||
|
#include maps/mp/zombies/_zm_ai_sloth;
|
||||||
|
#include maps/mp/zombies/_zm_ai_sloth_utility;
|
||||||
|
#include maps/mp/zombies/_zm_utility;
|
||||||
|
#include maps/mp/_utility;
|
||||||
|
#include common_scripts/utility;
|
||||||
|
|
||||||
|
box_lock_condition()
|
||||||
|
{
|
||||||
|
box = level.chests[ level.chest_index ];
|
||||||
|
if ( !isDefined( box ) )
|
||||||
|
{
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
/#
|
||||||
|
self sloth_debug_context( box, sqrt( 32400 ) );
|
||||||
|
#/
|
||||||
|
if ( flag( "moving_chest_now" ) )
|
||||||
|
{
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
if ( is_true( box._box_open ) || is_true( box._box_opened_by_fire_sale ) )
|
||||||
|
{
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
dist = distancesquared( self.origin, box.origin );
|
||||||
|
if ( dist < 32400 )
|
||||||
|
{
|
||||||
|
return 1;
|
||||||
|
}
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
box_get_ground_offset()
|
||||||
|
{
|
||||||
|
vec_right = vectornormalize( anglesToRight( self.angles ) );
|
||||||
|
box_pos = self.origin - ( vec_right * 36 );
|
||||||
|
ground_pos = groundpos( box_pos );
|
||||||
|
return ground_pos;
|
||||||
|
}
|
||||||
|
|
||||||
|
common_abort_box( box )
|
||||||
|
{
|
||||||
|
if ( flag( "moving_chest_now" ) )
|
||||||
|
{
|
||||||
|
self.context_done = 1;
|
||||||
|
return 1;
|
||||||
|
}
|
||||||
|
if ( isDefined( box ) )
|
||||||
|
{
|
||||||
|
if ( is_true( box._box_open ) || is_true( box._box_opened_by_fire_sale ) )
|
||||||
|
{
|
||||||
|
/#
|
||||||
|
sloth_print( "box was opened...abort" );
|
||||||
|
#/
|
||||||
|
self.context_done = 1;
|
||||||
|
return 1;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
common_move_to_maze( box )
|
||||||
|
{
|
||||||
|
self endon( "death" );
|
||||||
|
while ( 1 )
|
||||||
|
{
|
||||||
|
if ( self common_abort_box( box ) )
|
||||||
|
{
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
if ( self maps/mp/zombies/_zm_ai_sloth::sloth_behind_mansion() )
|
||||||
|
{
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
self maps/mp/zombies/_zm_ai_sloth::action_navigate_mansion( level.maze_depart, level.maze_arrive );
|
||||||
|
wait 0,2;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return 1;
|
||||||
|
}
|
||||||
|
|
||||||
|
common_move_to_courtyard( box )
|
||||||
|
{
|
||||||
|
self endon( "death" );
|
||||||
|
while ( 1 )
|
||||||
|
{
|
||||||
|
if ( self common_abort_box( box ) )
|
||||||
|
{
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
if ( !self maps/mp/zombies/_zm_ai_sloth::sloth_behind_mansion() )
|
||||||
|
{
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
self maps/mp/zombies/_zm_ai_sloth::action_navigate_mansion( level.courtyard_depart, level.courtyard_arrive );
|
||||||
|
wait 0,2;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return 1;
|
||||||
|
}
|
||||||
|
|
||||||
|
common_move_to_box( box, range, ignore_open, asd_name )
|
||||||
|
{
|
||||||
|
if ( isDefined( asd_name ) )
|
||||||
|
{
|
||||||
|
anim_id = self getanimfromasd( asd_name, 0 );
|
||||||
|
start_org = getstartorigin( box.origin, box.angles, anim_id );
|
||||||
|
start_ang = getstartangles( box.origin, box.angles, anim_id );
|
||||||
|
self setgoalpos( start_org );
|
||||||
|
ground_pos = start_org;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
vec_right = vectornormalize( anglesToRight( box.angles ) );
|
||||||
|
box_pos = box.origin - ( vec_right * 36 );
|
||||||
|
ground_pos = groundpos( box_pos );
|
||||||
|
self setgoalpos( ground_pos );
|
||||||
|
}
|
||||||
|
while ( 1 )
|
||||||
|
{
|
||||||
|
if ( flag( "moving_chest_now" ) )
|
||||||
|
{
|
||||||
|
self.context_done = 1;
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
if ( !is_true( ignore_open ) || is_true( box._box_open ) && is_true( box._box_opened_by_fire_sale ) )
|
||||||
|
{
|
||||||
|
/#
|
||||||
|
sloth_print( "box was opened...abort" );
|
||||||
|
#/
|
||||||
|
self.context_done = 1;
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
dist = distancesquared( self.origin, ground_pos );
|
||||||
|
if ( dist < range )
|
||||||
|
{
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
wait 0,1;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if ( isDefined( asd_name ) )
|
||||||
|
{
|
||||||
|
self setgoalpos( self.origin );
|
||||||
|
self sloth_face_object( box, "angle", start_ang[ 1 ], 0,9 );
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
angles = vectorToAngle( vec_right );
|
||||||
|
self.anchor.origin = self.origin;
|
||||||
|
self.anchor.angles = angles;
|
||||||
|
self orientmode( "face angle", angles[ 1 ] );
|
||||||
|
wait 0,2;
|
||||||
|
}
|
||||||
|
if ( flag( "moving_chest_now" ) )
|
||||||
|
{
|
||||||
|
self.context_done = 1;
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
return 1;
|
||||||
|
}
|
||||||
|
|
||||||
|
box_lock_action()
|
||||||
|
{
|
||||||
|
self endon( "death" );
|
||||||
|
self endon( "stop_action" );
|
||||||
|
self maps/mp/zombies/_zm_ai_sloth::common_context_action();
|
||||||
|
box = level.chests[ level.chest_index ];
|
||||||
|
if ( !self common_move_to_box( box, 1024 ) )
|
||||||
|
{
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
self animscripted( box.origin, box.angles, "zm_lock_magicbox" );
|
||||||
|
maps/mp/animscripts/zm_shared::donotetracks( "lock_magicbox_anim", ::box_notetracks, box );
|
||||||
|
if ( flag( "moving_chest_now" ) )
|
||||||
|
{
|
||||||
|
self.context_done = 1;
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
setdvar( "magic_chest_movable", "0" );
|
||||||
|
/#
|
||||||
|
sloth_print( "box will not move" );
|
||||||
|
#/
|
||||||
|
maps/mp/zombies/_zm_ai_sloth::unregister_candy_context( "box_lock" );
|
||||||
|
maps/mp/zombies/_zm_ai_sloth::unregister_candy_context( "box_move" );
|
||||||
|
self.context_done = 1;
|
||||||
|
}
|
||||||
|
|
||||||
|
box_move_condition()
|
||||||
|
{
|
||||||
|
if ( flag( "moving_chest_now" ) )
|
||||||
|
{
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
self.box_move = undefined;
|
||||||
|
self.box_current = undefined;
|
||||||
|
self.box_current_in_maze = 0;
|
||||||
|
box_current = level.chests[ level.chest_index ];
|
||||||
|
if ( is_true( box_current._box_open ) || is_true( box_current._box_opened_by_fire_sale ) )
|
||||||
|
{
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
if ( box_current.script_noteworthy == "courtroom_chest1" )
|
||||||
|
{
|
||||||
|
if ( !maps/mp/zm_buried::is_courthouse_open() )
|
||||||
|
{
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if ( box_current.script_noteworthy == "tunnels_chest1" )
|
||||||
|
{
|
||||||
|
if ( !maps/mp/zm_buried::is_tunnel_open() )
|
||||||
|
{
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if ( box_current.script_noteworthy == "maze_chest1" || box_current.script_noteworthy == "maze_chest2" )
|
||||||
|
{
|
||||||
|
self.box_current_in_maze = 1;
|
||||||
|
if ( !is_maze_open() )
|
||||||
|
{
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
i = 0;
|
||||||
|
while ( i < level.chests.size )
|
||||||
|
{
|
||||||
|
if ( i == level.chest_index )
|
||||||
|
{
|
||||||
|
i++;
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
box = level.chests[ i ];
|
||||||
|
if ( box.script_noteworthy != "maze_chest1" )
|
||||||
|
{
|
||||||
|
self.box_move_in_maze = box.script_noteworthy == "maze_chest2";
|
||||||
|
}
|
||||||
|
dist = distancesquared( self.origin, box.origin );
|
||||||
|
if ( dist < 32400 )
|
||||||
|
{
|
||||||
|
self.box_move_index = i;
|
||||||
|
self.box_move = box;
|
||||||
|
self.box_current = box_current;
|
||||||
|
return 1;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
i++;
|
||||||
|
}
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
box_move_action()
|
||||||
|
{
|
||||||
|
self endon( "death" );
|
||||||
|
self endon( "stop_action" );
|
||||||
|
self maps/mp/zombies/_zm_ai_sloth::common_context_action();
|
||||||
|
/#
|
||||||
|
sloth_print( "moving box from: " + self.box_current.script_noteworthy + " to: " + self.box_move.script_noteworthy );
|
||||||
|
#/
|
||||||
|
if ( !self common_move_to_box( self.box_move, 1024, 0, "zm_magicbox_point" ) )
|
||||||
|
{
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
self maps/mp/zombies/_zm_ai_sloth::action_animscripted( "zm_magicbox_point", "magicbox_point_anim", self.box_move.origin, self.box_move.angles );
|
||||||
|
if ( is_true( self.box_current_in_maze ) )
|
||||||
|
{
|
||||||
|
if ( !is_true( self.box_move_in_maze ) )
|
||||||
|
{
|
||||||
|
if ( !self common_move_to_maze( self.box_current ) )
|
||||||
|
{
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
if ( is_true( self.box_move_in_maze ) )
|
||||||
|
{
|
||||||
|
if ( !self common_move_to_courtyard( self.box_current ) )
|
||||||
|
{
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if ( !self common_move_to_box( self.box_current, 1024, 0, "zm_pull_magicbox" ) )
|
||||||
|
{
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
self animscripted( self.box_current.origin, self.box_current.angles, "zm_pull_magicbox" );
|
||||||
|
maps/mp/animscripts/zm_shared::donotetracks( "pull_magicbox_anim", ::box_notetracks, self.box_current );
|
||||||
|
if ( self common_abort_box( self.box_current ) )
|
||||||
|
{
|
||||||
|
self box_move_interrupt();
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
if ( isDefined( level.sloth.custom_box_move_func ) )
|
||||||
|
{
|
||||||
|
self thread [[ level.sloth.custom_box_move_func ]]( 0 );
|
||||||
|
}
|
||||||
|
level.sloth_moving_box = 1;
|
||||||
|
self.ignore_common_run = 1;
|
||||||
|
self set_zombie_run_cycle( "run_holding_magicbox" );
|
||||||
|
self.locomotion = "run_holding_magicbox";
|
||||||
|
if ( is_true( self.box_current_in_maze ) )
|
||||||
|
{
|
||||||
|
if ( !is_true( self.box_move_in_maze ) )
|
||||||
|
{
|
||||||
|
if ( !self common_move_to_courtyard( undefined ) )
|
||||||
|
{
|
||||||
|
self box_move_interrupt();
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
if ( is_true( self.box_move_in_maze ) )
|
||||||
|
{
|
||||||
|
if ( !self common_move_to_maze( undefined ) )
|
||||||
|
{
|
||||||
|
self box_move_interrupt();
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if ( !self common_move_to_box( self.box_move, 1024, 0, "zm_place_magicbox" ) )
|
||||||
|
{
|
||||||
|
self box_move_interrupt();
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
self animscripted( self.box_move.origin, self.box_move.angles, "zm_place_magicbox" );
|
||||||
|
maps/mp/animscripts/zm_shared::donotetracks( "place_magicbox_anim", ::box_notetracks, self.box_move );
|
||||||
|
self.box_current = undefined;
|
||||||
|
self.context_done = 1;
|
||||||
|
level.sloth_moving_box = undefined;
|
||||||
|
if ( isDefined( level.sloth.custom_box_move_func ) )
|
||||||
|
{
|
||||||
|
self thread [[ level.sloth.custom_box_move_func ]]( 1 );
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
box_notetracks( note, box )
|
||||||
|
{
|
||||||
|
if ( !flag( "moving_chest_now" ) || is_true( box._box_open ) && is_true( box._box_opened_by_fire_sale ) )
|
||||||
|
{
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
if ( note == "pulled" )
|
||||||
|
{
|
||||||
|
playfx( level._effect[ "fx_buried_sloth_box_slam" ], box.origin );
|
||||||
|
tag_name = "tag_stowed_back";
|
||||||
|
twr_origin = self gettagorigin( tag_name );
|
||||||
|
twr_angles = self gettagangles( tag_name );
|
||||||
|
if ( !isDefined( self.box_model ) )
|
||||||
|
{
|
||||||
|
self.box_model = spawn( "script_model", twr_origin );
|
||||||
|
self.box_model.angles = twr_angles;
|
||||||
|
self.box_model setmodel( level.small_magic_box );
|
||||||
|
self.box_model linkto( self, tag_name );
|
||||||
|
self.box_model_visible = 1;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
self.box_model show();
|
||||||
|
self.box_model_visible = 1;
|
||||||
|
}
|
||||||
|
self.box_current maps/mp/zombies/_zm_magicbox::hide_chest();
|
||||||
|
}
|
||||||
|
else if ( note == "placed" )
|
||||||
|
{
|
||||||
|
playfx( level._effect[ "fx_buried_sloth_box_slam" ], box.origin );
|
||||||
|
self box_model_hide();
|
||||||
|
if ( isDefined( self.box_move.zbarrier ) )
|
||||||
|
{
|
||||||
|
self.box_move.zbarrier maps/mp/zombies/_zm_magicbox::set_magic_box_zbarrier_state( "initial" );
|
||||||
|
self.box_move.hidden = 0;
|
||||||
|
self.box_move thread [[ level.pandora_show_func ]]();
|
||||||
|
level.chest_index = self.box_move_index;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
if ( note == "locked" )
|
||||||
|
{
|
||||||
|
playfx( level._effect[ "fx_buried_sloth_box_slam" ], box.origin );
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
box_model_hide()
|
||||||
|
{
|
||||||
|
if ( isDefined( self.box_model ) )
|
||||||
|
{
|
||||||
|
self.box_model ghost();
|
||||||
|
self.box_model_visible = 0;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
box_move_interrupt()
|
||||||
|
{
|
||||||
|
if ( isDefined( self.box_current ) )
|
||||||
|
{
|
||||||
|
if ( isDefined( self.box_current.zbarrier ) )
|
||||||
|
{
|
||||||
|
self.box_current.zbarrier maps/mp/zombies/_zm_magicbox::set_magic_box_zbarrier_state( "initial" );
|
||||||
|
self.box_current.hidden = 0;
|
||||||
|
self.box_current thread [[ level.pandora_show_func ]]();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if ( isDefined( level.sloth.custom_box_move_func ) )
|
||||||
|
{
|
||||||
|
self thread [[ level.sloth.custom_box_move_func ]]( 1 );
|
||||||
|
}
|
||||||
|
level.sloth_moving_box = undefined;
|
||||||
|
self box_model_hide();
|
||||||
|
}
|
||||||
|
|
||||||
|
box_spin_condition()
|
||||||
|
{
|
||||||
|
if ( flag( "moving_chest_now" ) )
|
||||||
|
{
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
box = level.chests[ level.chest_index ];
|
||||||
|
if ( is_true( box._box_open ) || is_true( box._box_opened_by_fire_sale ) )
|
||||||
|
{
|
||||||
|
ground_pos = groundpos( box.origin );
|
||||||
|
dist = distancesquared( self.origin, ground_pos );
|
||||||
|
if ( dist < 32400 )
|
||||||
|
{
|
||||||
|
return 1;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
box_spin_action()
|
||||||
|
{
|
||||||
|
self endon( "death" );
|
||||||
|
self endon( "stop_action" );
|
||||||
|
self maps/mp/zombies/_zm_ai_sloth::common_context_action();
|
||||||
|
box = level.chests[ level.chest_index ];
|
||||||
|
hackable = spawnstruct();
|
||||||
|
hackable.chest = box;
|
||||||
|
if ( !self common_move_to_box( box, 1024, 1, "zm_cycle_magicbox" ) )
|
||||||
|
{
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
if ( !self box_spin_qualifier( hackable ) )
|
||||||
|
{
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
self animscripted( box.origin, box.angles, "zm_cycle_magicbox" );
|
||||||
|
maps/mp/animscripts/zm_shared::donotetracks( "cycle_magicbox_anim", ::box_kick, hackable );
|
||||||
|
self.context_done = 1;
|
||||||
|
}
|
||||||
|
|
||||||
|
box_kick( note, hackable )
|
||||||
|
{
|
||||||
|
if ( note == "kick" )
|
||||||
|
{
|
||||||
|
if ( !self box_spin_qualifier( hackable ) )
|
||||||
|
{
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
if ( !flag( "moving_chest_now" ) )
|
||||||
|
{
|
||||||
|
hackable thread box_trigger();
|
||||||
|
hackable maps/mp/zombies/_zm_hackables_box::respin_box( self.candy_player );
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
box_trigger()
|
||||||
|
{
|
||||||
|
if ( isDefined( self.chest ) )
|
||||||
|
{
|
||||||
|
thread maps/mp/zombies/_zm_unitrigger::unregister_unitrigger( self.chest.unitrigger_stub );
|
||||||
|
self.chest.zbarrier waittill( "randomization_done" );
|
||||||
|
if ( !flag( "moving_chest_now" ) )
|
||||||
|
{
|
||||||
|
thread maps/mp/zombies/_zm_unitrigger::register_static_unitrigger( self.chest.unitrigger_stub, ::maps/mp/zombies/_zm_magicbox::magicbox_unitrigger_think );
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
box_spin_qualifier( hackable )
|
||||||
|
{
|
||||||
|
if ( isDefined( hackable.chest ) )
|
||||||
|
{
|
||||||
|
if ( !isDefined( hackable.chest.chest_user ) )
|
||||||
|
{
|
||||||
|
self.context_done = 1;
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if ( !hackable maps/mp/zombies/_zm_hackables_box::hack_box_qualifier( self.candy_player ) )
|
||||||
|
{
|
||||||
|
/#
|
||||||
|
sloth_print( "hack_box_qualifier failed" );
|
||||||
|
#/
|
||||||
|
self.context_done = 1;
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
return 1;
|
||||||
|
}
|
211
zm_buried_patch/maps/mp/zombies/_zm_ai_sloth_utility.gsc
Normal file
211
zm_buried_patch/maps/mp/zombies/_zm_ai_sloth_utility.gsc
Normal file
@ -0,0 +1,211 @@
|
|||||||
|
#include maps/mp/zombies/_zm_ai_sloth;
|
||||||
|
#include maps/mp/zm_buried;
|
||||||
|
#include maps/mp/zombies/_zm_zonemgr;
|
||||||
|
#include maps/mp/animscripts/zm_utility;
|
||||||
|
#include maps/mp/zombies/_zm_utility;
|
||||||
|
#include maps/mp/_utility;
|
||||||
|
#include common_scripts/utility;
|
||||||
|
|
||||||
|
should_ignore_candybooze( player )
|
||||||
|
{
|
||||||
|
if ( player maps/mp/zombies/_zm_zonemgr::entity_in_zone( "zone_underground_courthouse" ) || player maps/mp/zombies/_zm_zonemgr::entity_in_zone( "zone_underground_courthouse2" ) )
|
||||||
|
{
|
||||||
|
if ( !maps/mp/zm_buried::is_courthouse_open() )
|
||||||
|
{
|
||||||
|
return 1;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if ( player maps/mp/zombies/_zm_zonemgr::entity_in_zone( "zone_tunnels_north2" ) )
|
||||||
|
{
|
||||||
|
if ( !maps/mp/zm_buried::is_courthouse_open() )
|
||||||
|
{
|
||||||
|
return 1;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if ( !player maps/mp/zombies/_zm_zonemgr::entity_in_zone( "zone_tunnels_center" ) || player maps/mp/zombies/_zm_zonemgr::entity_in_zone( "zone_tunnels_north" ) && player maps/mp/zombies/_zm_zonemgr::entity_in_zone( "zone_tunnels_south" ) )
|
||||||
|
{
|
||||||
|
if ( !maps/mp/zm_buried::is_tunnel_open() )
|
||||||
|
{
|
||||||
|
return 1;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if ( player maps/mp/zombies/_zm_zonemgr::entity_in_zone( "zone_start_lower" ) )
|
||||||
|
{
|
||||||
|
return 1;
|
||||||
|
}
|
||||||
|
if ( player maps/mp/zombies/_zm_zonemgr::entity_in_zone( "zone_underground_bar" ) )
|
||||||
|
{
|
||||||
|
if ( !maps/mp/zombies/_zm_ai_sloth::is_bar_open() )
|
||||||
|
{
|
||||||
|
return 1;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
watch_crash_pos()
|
||||||
|
{
|
||||||
|
dist_crash = 4096;
|
||||||
|
level.crash_pos = [];
|
||||||
|
level.crash_pos[ level.crash_pos.size ] = ( 3452, 1012, 56 );
|
||||||
|
level.crash_pos[ level.crash_pos.size ] = ( 3452, 1092, 56 );
|
||||||
|
level.crash_pos[ level.crash_pos.size ] = ( 3452, 1056, 56 );
|
||||||
|
while ( 1 )
|
||||||
|
{
|
||||||
|
while ( !isDefined( self.state ) || self.state != "berserk" )
|
||||||
|
{
|
||||||
|
wait 0,1;
|
||||||
|
}
|
||||||
|
_a82 = level.crash_pos;
|
||||||
|
_k82 = getFirstArrayKey( _a82 );
|
||||||
|
while ( isDefined( _k82 ) )
|
||||||
|
{
|
||||||
|
pos = _a82[ _k82 ];
|
||||||
|
dist = distancesquared( self.origin, pos );
|
||||||
|
if ( dist < dist_crash )
|
||||||
|
{
|
||||||
|
self.anchor.origin = self.origin;
|
||||||
|
self.anchor.angles = self.angles;
|
||||||
|
self linkto( self.anchor );
|
||||||
|
self setclientfield( "sloth_berserk", 0 );
|
||||||
|
self sloth_set_state( "crash", 0 );
|
||||||
|
wait 0,25;
|
||||||
|
self unlink();
|
||||||
|
}
|
||||||
|
_k82 = getNextArrayKey( _a82, _k82 );
|
||||||
|
}
|
||||||
|
wait 0,05;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
sloth_is_pain()
|
||||||
|
{
|
||||||
|
if ( is_true( self.is_pain ) )
|
||||||
|
{
|
||||||
|
anim_state = self getanimstatefromasd();
|
||||||
|
if ( anim_state == "zm_pain" || anim_state == "zm_pain_no_restart" )
|
||||||
|
{
|
||||||
|
return 1;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
self.reset_asd = undefined;
|
||||||
|
self animmode( "normal" );
|
||||||
|
self.is_pain = 0;
|
||||||
|
self.damage_accumulating = 0;
|
||||||
|
self notify( "stop_accumulation" );
|
||||||
|
/#
|
||||||
|
sloth_print( "pain was interrupted" );
|
||||||
|
#/
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
sloth_is_traversing()
|
||||||
|
{
|
||||||
|
if ( is_true( self.is_traversing ) )
|
||||||
|
{
|
||||||
|
anim_state = self getanimstatefromasd();
|
||||||
|
if ( anim_state != "zm_traverse" && anim_state != "zm_traverse_no_restart" && anim_state != "zm_traverse_barrier" && anim_state != "zm_traverse_barrier_no_restart" && anim_state != "zm_sling_equipment" && anim_state != "zm_unsling_equipment" && anim_state != "zm_sling_magicbox" && anim_state != "zm_unsling_magicbox" && anim_state != "zm_sloth_crawlerhold_sling" && anim_state != "zm_sloth_crawlerhold_unsling" || anim_state == "zm_sloth_crawlerhold_sling_hunched" && anim_state == "zm_sloth_crawlerhold_unsling_hunched" )
|
||||||
|
{
|
||||||
|
return 1;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
self.is_traversing = 0;
|
||||||
|
/#
|
||||||
|
sloth_print( "traverse was interrupted" );
|
||||||
|
#/
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
sloth_face_object( facee, type, data, dot_limit )
|
||||||
|
{
|
||||||
|
if ( type == "angle" )
|
||||||
|
{
|
||||||
|
self orientmode( "face angle", data );
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
if ( type == "point" )
|
||||||
|
{
|
||||||
|
self orientmode( "face point", data );
|
||||||
|
}
|
||||||
|
}
|
||||||
|
time_started = getTime();
|
||||||
|
while ( 1 )
|
||||||
|
{
|
||||||
|
if ( type == "angle" )
|
||||||
|
{
|
||||||
|
delta = abs( self.angles[ 1 ] - data );
|
||||||
|
if ( delta <= 15 )
|
||||||
|
{
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
else }
|
||||||
|
else if ( isDefined( dot_limit ) )
|
||||||
|
{
|
||||||
|
if ( self is_facing( facee, dot_limit ) )
|
||||||
|
{
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
else }
|
||||||
|
else if ( self is_facing( facee ) )
|
||||||
|
{
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
else if ( ( getTime() - time_started ) > 1000 )
|
||||||
|
{
|
||||||
|
/#
|
||||||
|
sloth_print( "face took too long" );
|
||||||
|
#/
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
wait 0,1;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
/#
|
||||||
|
time_elapsed = getTime() - time_started;
|
||||||
|
sloth_print( "time to face: " + time_elapsed );
|
||||||
|
#/
|
||||||
|
}
|
||||||
|
|
||||||
|
sloth_print( str )
|
||||||
|
{
|
||||||
|
/#
|
||||||
|
if ( getDvarInt( #"B6252E7C" ) )
|
||||||
|
{
|
||||||
|
iprintln( "sloth: " + str );
|
||||||
|
if ( isDefined( self.debug_msg ) )
|
||||||
|
{
|
||||||
|
self.debug_msg[ self.debug_msg.size ] = str;
|
||||||
|
if ( self.debug_msg.size > 64 )
|
||||||
|
{
|
||||||
|
self.debug_msg = [];
|
||||||
|
}
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
self.debug_msg = [];
|
||||||
|
self.debug_msg[ self.debug_msg.size ] = str;
|
||||||
|
#/
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
sloth_debug_context( item, dist )
|
||||||
|
{
|
||||||
|
/#
|
||||||
|
if ( is_true( self.context_debug ) )
|
||||||
|
{
|
||||||
|
debugstar( item.origin, 100, ( 1, 1, 1 ) );
|
||||||
|
circle( item.origin, dist, ( 1, 1, 1 ), 0, 1, 100 );
|
||||||
|
#/
|
||||||
|
}
|
||||||
|
}
|
326
zm_buried_patch/maps/mp/zombies/_zm_banking.gsc
Normal file
326
zm_buried_patch/maps/mp/zombies/_zm_banking.gsc
Normal file
@ -0,0 +1,326 @@
|
|||||||
|
#include maps/mp/zombies/_zm_unitrigger;
|
||||||
|
#include maps/mp/zombies/_zm_stats;
|
||||||
|
#include maps/mp/zombies/_zm_score;
|
||||||
|
#include maps/mp/zombies/_zm_powerups;
|
||||||
|
#include maps/mp/zombies/_zm_weapons;
|
||||||
|
#include maps/mp/zombies/_zm_magicbox;
|
||||||
|
#include maps/mp/zombies/_zm_utility;
|
||||||
|
#include maps/mp/_utility;
|
||||||
|
#include common_scripts/utility;
|
||||||
|
|
||||||
|
init()
|
||||||
|
{
|
||||||
|
onplayerconnect_callback( ::onplayerconnect_bank_deposit_box );
|
||||||
|
if ( !isDefined( level.ta_vaultfee ) )
|
||||||
|
{
|
||||||
|
level.ta_vaultfee = 100;
|
||||||
|
}
|
||||||
|
if ( !isDefined( level.ta_tellerfee ) )
|
||||||
|
{
|
||||||
|
level.ta_tellerfee = 100;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
main()
|
||||||
|
{
|
||||||
|
if ( !isDefined( level.banking_map ) )
|
||||||
|
{
|
||||||
|
level.banking_map = level.script;
|
||||||
|
}
|
||||||
|
level thread bank_teller_init();
|
||||||
|
level thread bank_deposit_box();
|
||||||
|
}
|
||||||
|
|
||||||
|
bank_teller_init()
|
||||||
|
{
|
||||||
|
level.bank_teller_dmg_trig = getent( "bank_teller_tazer_trig", "targetname" );
|
||||||
|
if ( isDefined( level.bank_teller_dmg_trig ) )
|
||||||
|
{
|
||||||
|
level.bank_teller_transfer_trig = getent( level.bank_teller_dmg_trig.target, "targetname" );
|
||||||
|
level.bank_teller_powerup_spot = getstruct( level.bank_teller_transfer_trig.target, "targetname" );
|
||||||
|
level thread bank_teller_logic();
|
||||||
|
level.bank_teller_transfer_trig.origin += vectorScale( ( 0, 0, -1 ), 25 );
|
||||||
|
level.bank_teller_transfer_trig trigger_off();
|
||||||
|
level.bank_teller_transfer_trig sethintstring( &"ZOMBIE_TELLER_GIVE_MONEY", level.ta_tellerfee );
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
bank_teller_logic()
|
||||||
|
{
|
||||||
|
level endon( "end_game" );
|
||||||
|
while ( 1 )
|
||||||
|
{
|
||||||
|
level.bank_teller_dmg_trig waittill( "damage", damage, attacker, direction, point, type, tagname, modelname, partname, weaponname, blah );
|
||||||
|
if ( isDefined( attacker ) && isplayer( attacker ) && damage == 1500 && type == "MOD_MELEE" )
|
||||||
|
{
|
||||||
|
bank_teller_give_money();
|
||||||
|
level.bank_teller_transfer_trig trigger_off();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
bank_teller_give_money()
|
||||||
|
{
|
||||||
|
level endon( "end_game" );
|
||||||
|
level endon( "stop_bank_teller" );
|
||||||
|
level.bank_teller_transfer_trig trigger_on();
|
||||||
|
bank_transfer = undefined;
|
||||||
|
while ( 1 )
|
||||||
|
{
|
||||||
|
level.bank_teller_transfer_trig waittill( "trigger", player );
|
||||||
|
if ( !is_player_valid( player, 0 ) || player.score < ( 1000 + level.ta_tellerfee ) )
|
||||||
|
{
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
if ( !isDefined( bank_transfer ) )
|
||||||
|
{
|
||||||
|
bank_transfer = maps/mp/zombies/_zm_powerups::specific_powerup_drop( "teller_withdrawl", level.bank_teller_powerup_spot.origin + vectorScale( ( 0, 0, -1 ), 40 ) );
|
||||||
|
bank_transfer thread stop_bank_teller();
|
||||||
|
bank_transfer.value = 0;
|
||||||
|
}
|
||||||
|
bank_transfer.value += 1000;
|
||||||
|
bank_transfer notify( "powerup_reset" );
|
||||||
|
bank_transfer thread maps/mp/zombies/_zm_powerups::powerup_timeout();
|
||||||
|
player maps/mp/zombies/_zm_score::minus_to_player_score( 1000 + level.ta_tellerfee );
|
||||||
|
level notify( "bank_teller_used" );
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
stop_bank_teller()
|
||||||
|
{
|
||||||
|
level endon( "end_game" );
|
||||||
|
self waittill( "death" );
|
||||||
|
level notify( "stop_bank_teller" );
|
||||||
|
}
|
||||||
|
|
||||||
|
delete_bank_teller()
|
||||||
|
{
|
||||||
|
wait 1;
|
||||||
|
level notify( "stop_bank_teller" );
|
||||||
|
bank_teller_dmg_trig = getent( "bank_teller_tazer_trig", "targetname" );
|
||||||
|
bank_teller_transfer_trig = getent( bank_teller_dmg_trig.target, "targetname" );
|
||||||
|
bank_teller_dmg_trig delete();
|
||||||
|
bank_teller_transfer_trig delete();
|
||||||
|
}
|
||||||
|
|
||||||
|
onplayerconnect_bank_deposit_box()
|
||||||
|
{
|
||||||
|
online_game = sessionmodeisonlinegame();
|
||||||
|
if ( !online_game )
|
||||||
|
{
|
||||||
|
self.account_value = 0;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
self.account_value = self maps/mp/zombies/_zm_stats::get_map_stat( "depositBox", level.banking_map );
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
bank_deposit_box()
|
||||||
|
{
|
||||||
|
level.bank_deposit_max_amount = 250000;
|
||||||
|
level.bank_deposit_ddl_increment_amount = 1000;
|
||||||
|
level.bank_account_max = level.bank_deposit_max_amount / level.bank_deposit_ddl_increment_amount;
|
||||||
|
level.bank_account_increment = int( level.bank_deposit_ddl_increment_amount / 1000 );
|
||||||
|
deposit_triggers = getstructarray( "bank_deposit", "targetname" );
|
||||||
|
array_thread( deposit_triggers, ::bank_deposit_unitrigger );
|
||||||
|
withdraw_triggers = getstructarray( "bank_withdraw", "targetname" );
|
||||||
|
array_thread( withdraw_triggers, ::bank_withdraw_unitrigger );
|
||||||
|
}
|
||||||
|
|
||||||
|
bank_deposit_unitrigger()
|
||||||
|
{
|
||||||
|
bank_unitrigger( "bank_deposit", ::trigger_deposit_update_prompt, ::trigger_deposit_think, 5, 5, undefined, 5 );
|
||||||
|
}
|
||||||
|
|
||||||
|
bank_withdraw_unitrigger()
|
||||||
|
{
|
||||||
|
bank_unitrigger( "bank_withdraw", ::trigger_withdraw_update_prompt, ::trigger_withdraw_think, 5, 5, undefined, 5 );
|
||||||
|
}
|
||||||
|
|
||||||
|
bank_unitrigger( name, prompt_fn, think_fn, override_length, override_width, override_height, override_radius )
|
||||||
|
{
|
||||||
|
unitrigger_stub = spawnstruct();
|
||||||
|
unitrigger_stub.origin = self.origin;
|
||||||
|
if ( isDefined( self.script_angles ) )
|
||||||
|
{
|
||||||
|
unitrigger_stub.angles = self.script_angles;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
unitrigger_stub.angles = self.angles;
|
||||||
|
}
|
||||||
|
unitrigger_stub.script_angles = unitrigger_stub.angles;
|
||||||
|
if ( isDefined( override_length ) )
|
||||||
|
{
|
||||||
|
unitrigger_stub.script_length = override_length;
|
||||||
|
}
|
||||||
|
else if ( isDefined( self.script_length ) )
|
||||||
|
{
|
||||||
|
unitrigger_stub.script_length = self.script_length;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
unitrigger_stub.script_length = 32;
|
||||||
|
}
|
||||||
|
if ( isDefined( override_width ) )
|
||||||
|
{
|
||||||
|
unitrigger_stub.script_width = override_width;
|
||||||
|
}
|
||||||
|
else if ( isDefined( self.script_width ) )
|
||||||
|
{
|
||||||
|
unitrigger_stub.script_width = self.script_width;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
unitrigger_stub.script_width = 32;
|
||||||
|
}
|
||||||
|
if ( isDefined( override_height ) )
|
||||||
|
{
|
||||||
|
unitrigger_stub.script_height = override_height;
|
||||||
|
}
|
||||||
|
else if ( isDefined( self.script_height ) )
|
||||||
|
{
|
||||||
|
unitrigger_stub.script_height = self.script_height;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
unitrigger_stub.script_height = 64;
|
||||||
|
}
|
||||||
|
if ( isDefined( override_radius ) )
|
||||||
|
{
|
||||||
|
unitrigger_stub.script_radius = override_radius;
|
||||||
|
}
|
||||||
|
else if ( isDefined( self.radius ) )
|
||||||
|
{
|
||||||
|
unitrigger_stub.radius = self.radius;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
unitrigger_stub.radius = 32;
|
||||||
|
}
|
||||||
|
if ( isDefined( self.script_unitrigger_type ) )
|
||||||
|
{
|
||||||
|
unitrigger_stub.script_unitrigger_type = self.script_unitrigger_type;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
unitrigger_stub.script_unitrigger_type = "unitrigger_box_use";
|
||||||
|
unitrigger_stub.origin -= anglesToRight( unitrigger_stub.angles ) * ( unitrigger_stub.script_length / 2 );
|
||||||
|
}
|
||||||
|
unitrigger_stub.cursor_hint = "HINT_NOICON";
|
||||||
|
unitrigger_stub.targetname = name;
|
||||||
|
maps/mp/zombies/_zm_unitrigger::unitrigger_force_per_player_triggers( unitrigger_stub, 1 );
|
||||||
|
unitrigger_stub.prompt_and_visibility_func = prompt_fn;
|
||||||
|
maps/mp/zombies/_zm_unitrigger::register_static_unitrigger( unitrigger_stub, think_fn );
|
||||||
|
}
|
||||||
|
|
||||||
|
trigger_deposit_update_prompt( player )
|
||||||
|
{
|
||||||
|
if ( player.score < level.bank_deposit_ddl_increment_amount || player.account_value >= level.bank_account_max )
|
||||||
|
{
|
||||||
|
player show_balance();
|
||||||
|
self sethintstring( "" );
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
self sethintstring( &"ZOMBIE_BANK_DEPOSIT_PROMPT", level.bank_deposit_ddl_increment_amount );
|
||||||
|
return 1;
|
||||||
|
}
|
||||||
|
|
||||||
|
trigger_deposit_think()
|
||||||
|
{
|
||||||
|
self endon( "kill_trigger" );
|
||||||
|
while ( 1 )
|
||||||
|
{
|
||||||
|
self waittill( "trigger", player );
|
||||||
|
while ( !is_player_valid( player ) )
|
||||||
|
{
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
if ( player.score >= level.bank_deposit_ddl_increment_amount && player.account_value < level.bank_account_max )
|
||||||
|
{
|
||||||
|
player playsoundtoplayer( "zmb_vault_bank_deposit", player );
|
||||||
|
player.score -= level.bank_deposit_ddl_increment_amount;
|
||||||
|
player.account_value += level.bank_account_increment;
|
||||||
|
player maps/mp/zombies/_zm_stats::set_map_stat( "depositBox", player.account_value, level.banking_map );
|
||||||
|
if ( isDefined( level.custom_bank_deposit_vo ) )
|
||||||
|
{
|
||||||
|
player thread [[ level.custom_bank_deposit_vo ]]();
|
||||||
|
}
|
||||||
|
if ( player.account_value >= level.bank_account_max )
|
||||||
|
{
|
||||||
|
self sethintstring( "" );
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
player thread do_player_general_vox( "general", "exert_sigh", 10, 50 );
|
||||||
|
}
|
||||||
|
player show_balance();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
trigger_withdraw_update_prompt( player )
|
||||||
|
{
|
||||||
|
if ( player.account_value <= 0 )
|
||||||
|
{
|
||||||
|
self sethintstring( "" );
|
||||||
|
player show_balance();
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
self sethintstring( &"ZOMBIE_BANK_WITHDRAW_PROMPT", level.bank_deposit_ddl_increment_amount, level.ta_vaultfee );
|
||||||
|
return 1;
|
||||||
|
}
|
||||||
|
|
||||||
|
trigger_withdraw_think()
|
||||||
|
{
|
||||||
|
self endon( "kill_trigger" );
|
||||||
|
while ( 1 )
|
||||||
|
{
|
||||||
|
self waittill( "trigger", player );
|
||||||
|
while ( !is_player_valid( player ) )
|
||||||
|
{
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
if ( player.account_value >= level.bank_account_increment )
|
||||||
|
{
|
||||||
|
player playsoundtoplayer( "zmb_vault_bank_withdraw", player );
|
||||||
|
player.score += level.bank_deposit_ddl_increment_amount;
|
||||||
|
level notify( "bank_withdrawal" );
|
||||||
|
player.account_value -= level.bank_account_increment;
|
||||||
|
player maps/mp/zombies/_zm_stats::set_map_stat( "depositBox", player.account_value, level.banking_map );
|
||||||
|
if ( isDefined( level.custom_bank_withdrawl_vo ) )
|
||||||
|
{
|
||||||
|
player thread [[ level.custom_bank_withdrawl_vo ]]();
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
player thread do_player_general_vox( "general", "exert_laugh", 10, 50 );
|
||||||
|
}
|
||||||
|
player thread player_withdraw_fee();
|
||||||
|
if ( player.account_value < level.bank_account_increment )
|
||||||
|
{
|
||||||
|
self sethintstring( "" );
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
player thread do_player_general_vox( "general", "exert_sigh", 10, 50 );
|
||||||
|
}
|
||||||
|
player show_balance();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
player_withdraw_fee()
|
||||||
|
{
|
||||||
|
self endon( "disconnect" );
|
||||||
|
wait_network_frame();
|
||||||
|
self.score -= level.ta_vaultfee;
|
||||||
|
}
|
||||||
|
|
||||||
|
show_balance()
|
||||||
|
{
|
||||||
|
/#
|
||||||
|
iprintlnbold( "DEBUG BANKER: " + self.name + " account worth " + self.account_value );
|
||||||
|
#/
|
||||||
|
}
|
443
zm_buried_patch/maps/mp/zombies/_zm_buildables_pooled.gsc
Normal file
443
zm_buried_patch/maps/mp/zombies/_zm_buildables_pooled.gsc
Normal file
@ -0,0 +1,443 @@
|
|||||||
|
#include maps/mp/gametypes_zm/_hud_util;
|
||||||
|
#include maps/mp/zombies/_zm_unitrigger;
|
||||||
|
#include maps/mp/zombies/_zm_buildables;
|
||||||
|
#include maps/mp/zombies/_zm_utility;
|
||||||
|
#include maps/mp/_utility;
|
||||||
|
#include common_scripts/utility;
|
||||||
|
|
||||||
|
add_buildable_to_pool( stub, poolname )
|
||||||
|
{
|
||||||
|
if ( !isDefined( level.buildablepools ) )
|
||||||
|
{
|
||||||
|
level.buildablepools = [];
|
||||||
|
}
|
||||||
|
if ( !isDefined( level.buildablepools[ poolname ] ) )
|
||||||
|
{
|
||||||
|
level.buildablepools[ poolname ] = spawnstruct();
|
||||||
|
level.buildablepools[ poolname ].stubs = [];
|
||||||
|
}
|
||||||
|
level.buildablepools[ poolname ].stubs[ level.buildablepools[ poolname ].stubs.size ] = stub;
|
||||||
|
if ( !isDefined( level.buildablepools[ poolname ].buildable_slot ) )
|
||||||
|
{
|
||||||
|
level.buildablepools[ poolname ].buildable_slot = stub.buildablestruct.buildable_slot;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
/#
|
||||||
|
assert( level.buildablepools[ poolname ].buildable_slot == stub.buildablestruct.buildable_slot );
|
||||||
|
#/
|
||||||
|
}
|
||||||
|
stub.buildable_pool = level.buildablepools[ poolname ];
|
||||||
|
stub.original_prompt_and_visibility_func = stub.prompt_and_visibility_func;
|
||||||
|
stub.original_trigger_func = stub.trigger_func;
|
||||||
|
stub.prompt_and_visibility_func = ::pooledbuildabletrigger_update_prompt;
|
||||||
|
reregister_unitrigger( stub, ::pooled_buildable_place_think );
|
||||||
|
}
|
||||||
|
|
||||||
|
reregister_unitrigger( unitrigger_stub, new_trigger_func )
|
||||||
|
{
|
||||||
|
static = 0;
|
||||||
|
if ( isDefined( unitrigger_stub.in_zone ) )
|
||||||
|
{
|
||||||
|
static = 1;
|
||||||
|
}
|
||||||
|
unregister_unitrigger( unitrigger_stub );
|
||||||
|
unitrigger_stub.trigger_func = new_trigger_func;
|
||||||
|
if ( static )
|
||||||
|
{
|
||||||
|
register_static_unitrigger( unitrigger_stub, new_trigger_func, 0 );
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
register_unitrigger( unitrigger_stub, new_trigger_func );
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
randomize_pooled_buildables( poolname )
|
||||||
|
{
|
||||||
|
level waittill( "buildables_setup" );
|
||||||
|
while ( isDefined( level.buildablepools[ poolname ] ) )
|
||||||
|
{
|
||||||
|
count = level.buildablepools[ poolname ].stubs.size;
|
||||||
|
while ( count > 1 )
|
||||||
|
{
|
||||||
|
targets = [];
|
||||||
|
i = 0;
|
||||||
|
while ( i < count )
|
||||||
|
{
|
||||||
|
while ( 1 )
|
||||||
|
{
|
||||||
|
p = randomint( count );
|
||||||
|
if ( !isDefined( targets[ p ] ) )
|
||||||
|
{
|
||||||
|
targets[ p ] = i;
|
||||||
|
i++;
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
}
|
||||||
|
}
|
||||||
|
i++;
|
||||||
|
}
|
||||||
|
i = 0;
|
||||||
|
while ( i < count )
|
||||||
|
{
|
||||||
|
if ( isDefined( targets[ i ] ) && targets[ i ] != i )
|
||||||
|
{
|
||||||
|
swap_buildable_fields( level.buildablepools[ poolname ].stubs[ i ], level.buildablepools[ poolname ].stubs[ targets[ i ] ] );
|
||||||
|
}
|
||||||
|
i++;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
pooledbuildable_has_piece( piece )
|
||||||
|
{
|
||||||
|
return isDefined( self pooledbuildable_stub_for_piece( piece ) );
|
||||||
|
}
|
||||||
|
|
||||||
|
pooledbuildable_stub_for_piece( piece )
|
||||||
|
{
|
||||||
|
_a104 = self.stubs;
|
||||||
|
_k104 = getFirstArrayKey( _a104 );
|
||||||
|
while ( isDefined( _k104 ) )
|
||||||
|
{
|
||||||
|
stub = _a104[ _k104 ];
|
||||||
|
if ( isDefined( stub.bound_to_buildable ) )
|
||||||
|
{
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
if ( stub.buildablezone buildable_has_piece( piece ) )
|
||||||
|
{
|
||||||
|
return stub;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
_k104 = getNextArrayKey( _a104, _k104 );
|
||||||
|
}
|
||||||
|
return undefined;
|
||||||
|
}
|
||||||
|
|
||||||
|
pooledbuildabletrigger_update_prompt( player )
|
||||||
|
{
|
||||||
|
can_use = self.stub pooledbuildablestub_update_prompt( player, self );
|
||||||
|
self sethintstring( self.stub.hint_string );
|
||||||
|
if ( isDefined( self.stub.cursor_hint ) )
|
||||||
|
{
|
||||||
|
if ( self.stub.cursor_hint == "HINT_WEAPON" && isDefined( self.stub.cursor_hint_weapon ) )
|
||||||
|
{
|
||||||
|
self setcursorhint( self.stub.cursor_hint, self.stub.cursor_hint_weapon );
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
self setcursorhint( self.stub.cursor_hint );
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return can_use;
|
||||||
|
}
|
||||||
|
|
||||||
|
pooledbuildablestub_update_prompt( player, trigger )
|
||||||
|
{
|
||||||
|
if ( !self anystub_update_prompt( player ) )
|
||||||
|
{
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
can_use = 1;
|
||||||
|
if ( isDefined( self.custom_buildablestub_update_prompt ) && !( self [[ self.custom_buildablestub_update_prompt ]]( player ) ) )
|
||||||
|
{
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
self.cursor_hint = "HINT_NOICON";
|
||||||
|
self.cursor_hint_weapon = undefined;
|
||||||
|
if ( isDefined( self.built ) && !self.built )
|
||||||
|
{
|
||||||
|
slot = self.buildablestruct.buildable_slot;
|
||||||
|
if ( !isDefined( player player_get_buildable_piece( slot ) ) )
|
||||||
|
{
|
||||||
|
if ( isDefined( level.zombie_buildables[ self.equipname ].hint_more ) )
|
||||||
|
{
|
||||||
|
self.hint_string = level.zombie_buildables[ self.equipname ].hint_more;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
self.hint_string = &"ZOMBIE_BUILD_PIECE_MORE";
|
||||||
|
}
|
||||||
|
if ( isDefined( level.custom_buildable_need_part_vo ) )
|
||||||
|
{
|
||||||
|
player thread [[ level.custom_buildable_need_part_vo ]]();
|
||||||
|
}
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
if ( isDefined( self.bound_to_buildable ) && !self.bound_to_buildable.buildablezone buildable_has_piece( player player_get_buildable_piece( slot ) ) )
|
||||||
|
{
|
||||||
|
if ( isDefined( level.zombie_buildables[ self.bound_to_buildable.equipname ].hint_wrong ) )
|
||||||
|
{
|
||||||
|
self.hint_string = level.zombie_buildables[ self.bound_to_buildable.equipname ].hint_wrong;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
self.hint_string = &"ZOMBIE_BUILD_PIECE_WRONG";
|
||||||
|
}
|
||||||
|
if ( isDefined( level.custom_buildable_wrong_part_vo ) )
|
||||||
|
{
|
||||||
|
player thread [[ level.custom_buildable_wrong_part_vo ]]();
|
||||||
|
}
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
if ( !isDefined( self.bound_to_buildable ) && !self.buildable_pool pooledbuildable_has_piece( player player_get_buildable_piece( slot ) ) )
|
||||||
|
{
|
||||||
|
if ( isDefined( level.zombie_buildables[ self.equipname ].hint_wrong ) )
|
||||||
|
{
|
||||||
|
self.hint_string = level.zombie_buildables[ self.equipname ].hint_wrong;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
self.hint_string = &"ZOMBIE_BUILD_PIECE_WRONG";
|
||||||
|
}
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
if ( isDefined( self.bound_to_buildable ) )
|
||||||
|
{
|
||||||
|
/#
|
||||||
|
assert( isDefined( level.zombie_buildables[ self.equipname ].hint ), "Missing buildable hint" );
|
||||||
|
#/
|
||||||
|
if ( isDefined( level.zombie_buildables[ self.equipname ].hint ) )
|
||||||
|
{
|
||||||
|
self.hint_string = level.zombie_buildables[ self.equipname ].hint;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
self.hint_string = "Missing buildable hint";
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else /#
|
||||||
|
assert( isDefined( level.zombie_buildables[ self.equipname ].hint ), "Missing buildable hint" );
|
||||||
|
#/
|
||||||
|
if ( isDefined( level.zombie_buildables[ self.equipname ].hint ) )
|
||||||
|
{
|
||||||
|
self.hint_string = level.zombie_buildables[ self.equipname ].hint;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
self.hint_string = "Missing buildable hint";
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
return trigger [[ self.original_prompt_and_visibility_func ]]( player );
|
||||||
|
}
|
||||||
|
return 1;
|
||||||
|
}
|
||||||
|
|
||||||
|
find_bench( bench_name )
|
||||||
|
{
|
||||||
|
return getent( bench_name, "targetname" );
|
||||||
|
}
|
||||||
|
|
||||||
|
swap_buildable_fields( stub1, stub2 )
|
||||||
|
{
|
||||||
|
tbz = stub2.buildablezone;
|
||||||
|
stub2.buildablezone = stub1.buildablezone;
|
||||||
|
stub2.buildablezone.stub = stub2;
|
||||||
|
stub1.buildablezone = tbz;
|
||||||
|
stub1.buildablezone.stub = stub1;
|
||||||
|
tbs = stub2.buildablestruct;
|
||||||
|
stub2.buildablestruct = stub1.buildablestruct;
|
||||||
|
stub1.buildablestruct = tbs;
|
||||||
|
te = stub2.equipname;
|
||||||
|
stub2.equipname = stub1.equipname;
|
||||||
|
stub1.equipname = te;
|
||||||
|
th = stub2.hint_string;
|
||||||
|
stub2.hint_string = stub1.hint_string;
|
||||||
|
stub1.hint_string = th;
|
||||||
|
ths = stub2.trigger_hintstring;
|
||||||
|
stub2.trigger_hintstring = stub1.trigger_hintstring;
|
||||||
|
stub1.trigger_hintstring = ths;
|
||||||
|
tp = stub2.persistent;
|
||||||
|
stub2.persistent = stub1.persistent;
|
||||||
|
stub1.persistent = tp;
|
||||||
|
tobu = stub2.onbeginuse;
|
||||||
|
stub2.onbeginuse = stub1.onbeginuse;
|
||||||
|
stub1.onbeginuse = tobu;
|
||||||
|
tocu = stub2.oncantuse;
|
||||||
|
stub2.oncantuse = stub1.oncantuse;
|
||||||
|
stub1.oncantuse = tocu;
|
||||||
|
toeu = stub2.onenduse;
|
||||||
|
stub2.onenduse = stub1.onenduse;
|
||||||
|
stub1.onenduse = toeu;
|
||||||
|
tt = stub2.target;
|
||||||
|
stub2.target = stub1.target;
|
||||||
|
stub1.target = tt;
|
||||||
|
ttn = stub2.targetname;
|
||||||
|
stub2.targetname = stub1.targetname;
|
||||||
|
stub1.targetname = ttn;
|
||||||
|
twn = stub2.weaponname;
|
||||||
|
stub2.weaponname = stub1.weaponname;
|
||||||
|
stub1.weaponname = twn;
|
||||||
|
pav = stub2.original_prompt_and_visibility_func;
|
||||||
|
stub2.original_prompt_and_visibility_func = stub1.original_prompt_and_visibility_func;
|
||||||
|
stub1.original_prompt_and_visibility_func = pav;
|
||||||
|
bench1 = undefined;
|
||||||
|
bench2 = undefined;
|
||||||
|
transfer_pos_as_is = 1;
|
||||||
|
if ( isDefined( stub1.model.target ) && isDefined( stub2.model.target ) )
|
||||||
|
{
|
||||||
|
bench1 = find_bench( stub1.model.target );
|
||||||
|
bench2 = find_bench( stub2.model.target );
|
||||||
|
if ( isDefined( bench1 ) && isDefined( bench2 ) )
|
||||||
|
{
|
||||||
|
transfer_pos_as_is = 0;
|
||||||
|
w2lo1 = bench1 worldtolocalcoords( stub1.model.origin );
|
||||||
|
w2la1 = stub1.model.angles - bench1.angles;
|
||||||
|
w2lo2 = bench2 worldtolocalcoords( stub2.model.origin );
|
||||||
|
w2la2 = stub2.model.angles - bench2.angles;
|
||||||
|
stub1.model.origin = bench2 localtoworldcoords( w2lo1 );
|
||||||
|
stub1.model.angles = bench2.angles + w2la1;
|
||||||
|
stub2.model.origin = bench1 localtoworldcoords( w2lo2 );
|
||||||
|
stub2.model.angles = bench1.angles + w2la2;
|
||||||
|
}
|
||||||
|
tmt = stub2.model.target;
|
||||||
|
stub2.model.target = stub1.model.target;
|
||||||
|
stub1.model.target = tmt;
|
||||||
|
}
|
||||||
|
tm = stub2.model;
|
||||||
|
stub2.model = stub1.model;
|
||||||
|
stub1.model = tm;
|
||||||
|
if ( transfer_pos_as_is )
|
||||||
|
{
|
||||||
|
tmo = stub2.model.origin;
|
||||||
|
tma = stub2.model.angles;
|
||||||
|
stub2.model.origin = stub1.model.origin;
|
||||||
|
stub2.model.angles = stub1.model.angles;
|
||||||
|
stub1.model.origin = tmo;
|
||||||
|
stub1.model.angles = tma;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
pooled_buildable_place_think()
|
||||||
|
{
|
||||||
|
self endon( "kill_trigger" );
|
||||||
|
if ( isDefined( self.stub.built ) && self.stub.built )
|
||||||
|
{
|
||||||
|
return buildable_place_think();
|
||||||
|
}
|
||||||
|
player_built = undefined;
|
||||||
|
while ( isDefined( self.stub.built ) && !self.stub.built )
|
||||||
|
{
|
||||||
|
self waittill( "trigger", player );
|
||||||
|
while ( player != self.parent_player )
|
||||||
|
{
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
while ( isDefined( player.screecher_weapon ) )
|
||||||
|
{
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
while ( !is_player_valid( player ) )
|
||||||
|
{
|
||||||
|
player thread ignore_triggers( 0,5 );
|
||||||
|
}
|
||||||
|
bind_to = self.stub;
|
||||||
|
slot = bind_to.buildablestruct.buildable_slot;
|
||||||
|
if ( !isDefined( self.stub.bound_to_buildable ) )
|
||||||
|
{
|
||||||
|
bind_to = self.stub.buildable_pool pooledbuildable_stub_for_piece( player player_get_buildable_piece( slot ) );
|
||||||
|
}
|
||||||
|
while ( isDefined( bind_to ) && isDefined( self.stub.bound_to_buildable ) || self.stub.bound_to_buildable != bind_to && isDefined( bind_to.bound_to_buildable ) && self.stub != bind_to.bound_to_buildable )
|
||||||
|
{
|
||||||
|
self.stub.hint_string = "";
|
||||||
|
self sethintstring( self.stub.hint_string );
|
||||||
|
if ( isDefined( self.stub.oncantuse ) )
|
||||||
|
{
|
||||||
|
self.stub [[ self.stub.oncantuse ]]( player );
|
||||||
|
}
|
||||||
|
}
|
||||||
|
status = player player_can_build( bind_to.buildablezone );
|
||||||
|
if ( !status )
|
||||||
|
{
|
||||||
|
self.stub.hint_string = "";
|
||||||
|
self sethintstring( self.stub.hint_string );
|
||||||
|
if ( isDefined( bind_to.oncantuse ) )
|
||||||
|
{
|
||||||
|
bind_to [[ bind_to.oncantuse ]]( player );
|
||||||
|
}
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
if ( isDefined( bind_to.onbeginuse ) )
|
||||||
|
{
|
||||||
|
self.stub [[ bind_to.onbeginuse ]]( player );
|
||||||
|
}
|
||||||
|
result = self buildable_use_hold_think( player, bind_to );
|
||||||
|
team = player.pers[ "team" ];
|
||||||
|
if ( result )
|
||||||
|
{
|
||||||
|
if ( isDefined( self.stub.bound_to_buildable ) && self.stub.bound_to_buildable != bind_to )
|
||||||
|
{
|
||||||
|
result = 0;
|
||||||
|
}
|
||||||
|
if ( isDefined( bind_to.bound_to_buildable ) && self.stub != bind_to.bound_to_buildable )
|
||||||
|
{
|
||||||
|
result = 0;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if ( isDefined( bind_to.onenduse ) )
|
||||||
|
{
|
||||||
|
self.stub [[ bind_to.onenduse ]]( team, player, result );
|
||||||
|
}
|
||||||
|
while ( !result )
|
||||||
|
{
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
if ( !isDefined( self.stub.bound_to_buildable ) && isDefined( bind_to ) )
|
||||||
|
{
|
||||||
|
if ( bind_to != self.stub )
|
||||||
|
{
|
||||||
|
swap_buildable_fields( self.stub, bind_to );
|
||||||
|
}
|
||||||
|
self.stub.bound_to_buildable = self.stub;
|
||||||
|
}
|
||||||
|
if ( isDefined( self.stub.onuse ) )
|
||||||
|
{
|
||||||
|
self.stub [[ self.stub.onuse ]]( player );
|
||||||
|
}
|
||||||
|
if ( isDefined( player player_get_buildable_piece( slot ) ) )
|
||||||
|
{
|
||||||
|
prompt = player player_build( self.stub.buildablezone );
|
||||||
|
player_built = player;
|
||||||
|
self.stub.hint_string = prompt;
|
||||||
|
self sethintstring( self.stub.hint_string );
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
switch( self.stub.persistent )
|
||||||
|
{
|
||||||
|
case 1:
|
||||||
|
self bptrigger_think_persistent( player_built );
|
||||||
|
break;
|
||||||
|
case 0:
|
||||||
|
self bptrigger_think_one_time( player_built );
|
||||||
|
break;
|
||||||
|
case 3:
|
||||||
|
self bptrigger_think_unbuild( player_built );
|
||||||
|
break;
|
||||||
|
case 2:
|
||||||
|
self bptrigger_think_one_use_and_fly( player_built );
|
||||||
|
break;
|
||||||
|
case 4:
|
||||||
|
self [[ self.stub.custom_completion_callback ]]( player_built );
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
1002
zm_buried_patch/maps/mp/zombies/_zm_equip_headchopper.gsc
Normal file
1002
zm_buried_patch/maps/mp/zombies/_zm_equip_headchopper.gsc
Normal file
File diff suppressed because it is too large
Load Diff
631
zm_buried_patch/maps/mp/zombies/_zm_equip_springpad.gsc
Normal file
631
zm_buried_patch/maps/mp/zombies/_zm_equip_springpad.gsc
Normal file
@ -0,0 +1,631 @@
|
|||||||
|
#include maps/mp/zombies/_zm_buildables;
|
||||||
|
#include maps/mp/zombies/_zm_power;
|
||||||
|
#include maps/mp/zombies/_zm_unitrigger;
|
||||||
|
#include maps/mp/zombies/_zm;
|
||||||
|
#include maps/mp/gametypes_zm/_weaponobjects;
|
||||||
|
#include maps/mp/zombies/_zm_equipment;
|
||||||
|
#include maps/mp/zombies/_zm_utility;
|
||||||
|
#include maps/mp/_utility;
|
||||||
|
#include common_scripts/utility;
|
||||||
|
|
||||||
|
#using_animtree( "zombie_springpad" );
|
||||||
|
|
||||||
|
init( pickupstring, howtostring )
|
||||||
|
{
|
||||||
|
if ( !maps/mp/zombies/_zm_equipment::is_equipment_included( "equip_springpad_zm" ) )
|
||||||
|
{
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
level.springpad_name = "equip_springpad_zm";
|
||||||
|
init_animtree();
|
||||||
|
maps/mp/zombies/_zm_equipment::register_equipment( "equip_springpad_zm", pickupstring, howtostring, "zom_hud_trample_steam_complete", "springpad", undefined, ::transferspringpad, ::dropspringpad, ::pickupspringpad, ::placespringpad );
|
||||||
|
maps/mp/zombies/_zm_equipment::add_placeable_equipment( "equip_springpad_zm", "p6_anim_zm_buildable_view_tramplesteam" );
|
||||||
|
level thread onplayerconnect();
|
||||||
|
maps/mp/gametypes_zm/_weaponobjects::createretrievablehint( "equip_springpad", pickupstring );
|
||||||
|
level._effect[ "springpade_on" ] = loadfx( "maps/zombie_highrise/fx_highrise_trmpl_steam_os" );
|
||||||
|
if ( !isDefined( level.springpad_trigger_radius ) )
|
||||||
|
{
|
||||||
|
level.springpad_trigger_radius = 72;
|
||||||
|
}
|
||||||
|
thread wait_init_damage();
|
||||||
|
}
|
||||||
|
|
||||||
|
wait_init_damage()
|
||||||
|
{
|
||||||
|
while ( !isDefined( level.zombie_vars ) || !isDefined( level.zombie_vars[ "zombie_health_start" ] ) )
|
||||||
|
{
|
||||||
|
wait 1;
|
||||||
|
}
|
||||||
|
level.springpad_damage = maps/mp/zombies/_zm::ai_zombie_health( 50 );
|
||||||
|
}
|
||||||
|
|
||||||
|
onplayerconnect()
|
||||||
|
{
|
||||||
|
for ( ;; )
|
||||||
|
{
|
||||||
|
level waittill( "connecting", player );
|
||||||
|
player thread onplayerspawned();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
onplayerspawned()
|
||||||
|
{
|
||||||
|
self endon( "disconnect" );
|
||||||
|
self thread setupwatchers();
|
||||||
|
for ( ;; )
|
||||||
|
{
|
||||||
|
self waittill( "spawned_player" );
|
||||||
|
self thread watchspringpaduse();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
setupwatchers()
|
||||||
|
{
|
||||||
|
self waittill( "weapon_watchers_created" );
|
||||||
|
watcher = maps/mp/gametypes_zm/_weaponobjects::getweaponobjectwatcher( "equip_springpad" );
|
||||||
|
watcher.onspawnretrievetriggers = ::maps/mp/zombies/_zm_equipment::equipment_onspawnretrievableweaponobject;
|
||||||
|
}
|
||||||
|
|
||||||
|
watchspringpaduse()
|
||||||
|
{
|
||||||
|
self notify( "watchSpringPadUse" );
|
||||||
|
self endon( "watchSpringPadUse" );
|
||||||
|
self endon( "death" );
|
||||||
|
self endon( "disconnect" );
|
||||||
|
for ( ;; )
|
||||||
|
{
|
||||||
|
self waittill( "equipment_placed", weapon, weapname );
|
||||||
|
if ( weapname == level.springpad_name )
|
||||||
|
{
|
||||||
|
self cleanupoldspringpad();
|
||||||
|
self.buildablespringpad = weapon;
|
||||||
|
self thread startspringpaddeploy( weapon );
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
cleanupoldspringpad()
|
||||||
|
{
|
||||||
|
if ( isDefined( self.buildablespringpad ) )
|
||||||
|
{
|
||||||
|
if ( isDefined( self.buildablespringpad.stub ) )
|
||||||
|
{
|
||||||
|
thread maps/mp/zombies/_zm_unitrigger::unregister_unitrigger( self.buildablespringpad.stub );
|
||||||
|
self.buildablespringpad.stub = undefined;
|
||||||
|
}
|
||||||
|
self.buildablespringpad delete();
|
||||||
|
self.springpad_kills = undefined;
|
||||||
|
}
|
||||||
|
if ( isDefined( level.springpad_sound_ent ) )
|
||||||
|
{
|
||||||
|
level.springpad_sound_ent delete();
|
||||||
|
level.springpad_sound_ent = undefined;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
watchforcleanup()
|
||||||
|
{
|
||||||
|
self notify( "springpad_cleanup" );
|
||||||
|
self endon( "springpad_cleanup" );
|
||||||
|
self waittill_any( "death_or_disconnect", "equip_springpad_zm_taken", "equip_springpad_zm_pickup" );
|
||||||
|
cleanupoldspringpad();
|
||||||
|
}
|
||||||
|
|
||||||
|
placespringpad( origin, angles )
|
||||||
|
{
|
||||||
|
if ( isDefined( self.turret_placement ) && !self.turret_placement[ "result" ] )
|
||||||
|
{
|
||||||
|
forward = anglesToForward( angles );
|
||||||
|
origin -= -24 * forward;
|
||||||
|
}
|
||||||
|
item = self maps/mp/zombies/_zm_equipment::placed_equipment_think( "p6_anim_zm_buildable_tramplesteam", "equip_springpad_zm", origin, angles, level.springpad_trigger_radius, -24 );
|
||||||
|
if ( isDefined( item ) )
|
||||||
|
{
|
||||||
|
item.springpad_kills = self.springpad_kills;
|
||||||
|
item.requires_pickup = 1;
|
||||||
|
item.zombie_attack_callback = ::springpad_fling_attacker;
|
||||||
|
}
|
||||||
|
self.springpad_kills = undefined;
|
||||||
|
return item;
|
||||||
|
}
|
||||||
|
|
||||||
|
dropspringpad()
|
||||||
|
{
|
||||||
|
item = self maps/mp/zombies/_zm_equipment::dropped_equipment_think( "p6_anim_zm_buildable_tramplesteam", "equip_springpad_zm", self.origin, self.angles, level.springpad_trigger_radius, -24 );
|
||||||
|
if ( isDefined( item ) )
|
||||||
|
{
|
||||||
|
item.springpad_kills = self.springpad_kills;
|
||||||
|
item.requires_pickup = 1;
|
||||||
|
}
|
||||||
|
self.springpad_kills = undefined;
|
||||||
|
return item;
|
||||||
|
}
|
||||||
|
|
||||||
|
pickupspringpad( item )
|
||||||
|
{
|
||||||
|
self.springpad_kills = item.springpad_kills;
|
||||||
|
item.springpad_kills = undefined;
|
||||||
|
}
|
||||||
|
|
||||||
|
transferspringpad( fromplayer, toplayer )
|
||||||
|
{
|
||||||
|
buildablespringpad = toplayer.buildablespringpad;
|
||||||
|
toarmed = 0;
|
||||||
|
if ( isDefined( buildablespringpad ) )
|
||||||
|
{
|
||||||
|
if ( isDefined( buildablespringpad.is_armed ) )
|
||||||
|
{
|
||||||
|
toarmed = buildablespringpad.is_armed;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
springpad_kills = toplayer.springpad_kills;
|
||||||
|
fromarmed = 0;
|
||||||
|
if ( isDefined( fromplayer.buildablespringpad ) )
|
||||||
|
{
|
||||||
|
if ( isDefined( fromplayer.buildablespringpad.is_armed ) )
|
||||||
|
{
|
||||||
|
fromarmed = fromplayer.buildablespringpad.is_armed;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
toplayer.buildablespringpad = fromplayer.buildablespringpad;
|
||||||
|
toplayer.buildablespringpad.original_owner = toplayer;
|
||||||
|
toplayer.buildablespringpad.owner = toplayer;
|
||||||
|
toplayer notify( "equip_springpad_zm_taken" );
|
||||||
|
toplayer.springpad_kills = fromplayer.springpad_kills;
|
||||||
|
toplayer thread startspringpaddeploy( toplayer.buildablespringpad, fromarmed );
|
||||||
|
fromplayer.buildablespringpad = buildablespringpad;
|
||||||
|
fromplayer.springpad_kills = springpad_kills;
|
||||||
|
fromplayer notify( "equip_springpad_zm_taken" );
|
||||||
|
if ( isDefined( fromplayer.buildablespringpad ) )
|
||||||
|
{
|
||||||
|
fromplayer thread startspringpaddeploy( fromplayer.buildablespringpad, toarmed );
|
||||||
|
fromplayer.buildablespringpad.original_owner = fromplayer;
|
||||||
|
fromplayer.buildablespringpad.owner = fromplayer;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
fromplayer maps/mp/zombies/_zm_equipment::equipment_release( "equip_springpad_zm" );
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
springpad_in_range( delta, origin, radius )
|
||||||
|
{
|
||||||
|
if ( distancesquared( self.target.origin, origin ) < ( radius * radius ) )
|
||||||
|
{
|
||||||
|
return 1;
|
||||||
|
}
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
springpad_power_on( origin, radius )
|
||||||
|
{
|
||||||
|
/#
|
||||||
|
println( "^1ZM POWER: trap on\n" );
|
||||||
|
#/
|
||||||
|
if ( !isDefined( self.target ) )
|
||||||
|
{
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
self.target.power_on = 1;
|
||||||
|
self.target.power_on_time = getTime();
|
||||||
|
}
|
||||||
|
|
||||||
|
springpad_power_off( origin, radius )
|
||||||
|
{
|
||||||
|
/#
|
||||||
|
println( "^1ZM POWER: trap off\n" );
|
||||||
|
#/
|
||||||
|
if ( !isDefined( self.target ) )
|
||||||
|
{
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
self.target.power_on = 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
startspringpaddeploy( weapon, armed )
|
||||||
|
{
|
||||||
|
self endon( "death" );
|
||||||
|
self endon( "disconnect" );
|
||||||
|
self endon( "equip_springpad_zm_taken" );
|
||||||
|
self thread watchforcleanup();
|
||||||
|
electricradius = 45;
|
||||||
|
if ( isDefined( self.springpad_kills ) )
|
||||||
|
{
|
||||||
|
weapon.springpad_kills = self.springpad_kills;
|
||||||
|
self.springpad_kills = undefined;
|
||||||
|
}
|
||||||
|
if ( !isDefined( weapon.springpad_kills ) )
|
||||||
|
{
|
||||||
|
weapon.springpad_kills = 0;
|
||||||
|
}
|
||||||
|
if ( isDefined( weapon ) )
|
||||||
|
{
|
||||||
|
/#
|
||||||
|
weapon thread debugspringpad( electricradius );
|
||||||
|
#/
|
||||||
|
if ( isDefined( level.equipment_springpad_needs_power ) && level.equipment_springpad_needs_power )
|
||||||
|
{
|
||||||
|
weapon.power_on = 0;
|
||||||
|
maps/mp/zombies/_zm_power::add_temp_powered_item( ::springpad_power_on, ::springpad_power_off, ::springpad_in_range, ::maps/mp/zombies/_zm_power::cost_high, 1, weapon.power_on, weapon );
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
weapon.power_on = 1;
|
||||||
|
}
|
||||||
|
if ( !weapon.power_on )
|
||||||
|
{
|
||||||
|
self iprintlnbold( &"ZOMBIE_NEED_LOCAL_POWER" );
|
||||||
|
}
|
||||||
|
self thread springpadthink( weapon, electricradius, armed );
|
||||||
|
if ( isDefined( level.equipment_springpad_needs_power ) && !level.equipment_springpad_needs_power )
|
||||||
|
{
|
||||||
|
}
|
||||||
|
self thread maps/mp/zombies/_zm_buildables::delete_on_disconnect( weapon );
|
||||||
|
weapon waittill( "death" );
|
||||||
|
if ( isDefined( level.springpad_sound_ent ) )
|
||||||
|
{
|
||||||
|
level.springpad_sound_ent playsound( "wpn_zmb_electrap_stop" );
|
||||||
|
level.springpad_sound_ent delete();
|
||||||
|
level.springpad_sound_ent = undefined;
|
||||||
|
}
|
||||||
|
self notify( "springpad_cleanup" );
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
init_animtree()
|
||||||
|
{
|
||||||
|
scriptmodelsuseanimtree( -1 );
|
||||||
|
}
|
||||||
|
|
||||||
|
springpad_animate( weapon, armed )
|
||||||
|
{
|
||||||
|
self endon( "death" );
|
||||||
|
self endon( "disconnect" );
|
||||||
|
self endon( "equip_springpad_zm_taken" );
|
||||||
|
weapon endon( "death" );
|
||||||
|
weapon useanimtree( -1 );
|
||||||
|
f_animlength = getanimlength( %o_zombie_buildable_tramplesteam_reset_zombie );
|
||||||
|
r_animlength = getanimlength( %o_zombie_buildable_tramplesteam_reset );
|
||||||
|
l_animlength = getanimlength( %o_zombie_buildable_tramplesteam_launch );
|
||||||
|
weapon thread springpad_audio();
|
||||||
|
prearmed = 0;
|
||||||
|
if ( isDefined( armed ) && armed )
|
||||||
|
{
|
||||||
|
prearmed = 1;
|
||||||
|
}
|
||||||
|
fast_reset = 0;
|
||||||
|
while ( isDefined( weapon ) )
|
||||||
|
{
|
||||||
|
if ( !prearmed )
|
||||||
|
{
|
||||||
|
if ( fast_reset )
|
||||||
|
{
|
||||||
|
weapon setanim( %o_zombie_buildable_tramplesteam_reset_zombie );
|
||||||
|
weapon thread playspringpadresetaudio( f_animlength );
|
||||||
|
wait f_animlength;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
weapon setanim( %o_zombie_buildable_tramplesteam_reset );
|
||||||
|
weapon thread playspringpadresetaudio( r_animlength );
|
||||||
|
wait r_animlength;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
wait 0,05;
|
||||||
|
}
|
||||||
|
prearmed = 0;
|
||||||
|
weapon notify( "armed" );
|
||||||
|
fast_reset = 0;
|
||||||
|
if ( isDefined( weapon ) )
|
||||||
|
{
|
||||||
|
weapon setanim( %o_zombie_buildable_tramplesteam_compressed_idle );
|
||||||
|
weapon waittill( "fling", fast );
|
||||||
|
fast_reset = fast;
|
||||||
|
}
|
||||||
|
if ( isDefined( weapon ) )
|
||||||
|
{
|
||||||
|
weapon setanim( %o_zombie_buildable_tramplesteam_launch );
|
||||||
|
wait l_animlength;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
playspringpadresetaudio( time )
|
||||||
|
{
|
||||||
|
self endon( "springpadAudioCleanup" );
|
||||||
|
ent = spawn( "script_origin", self.origin );
|
||||||
|
ent playloopsound( "zmb_highrise_launcher_reset_loop" );
|
||||||
|
self thread deleteentwhensounddone( time, ent );
|
||||||
|
self waittill( "death" );
|
||||||
|
ent delete();
|
||||||
|
}
|
||||||
|
|
||||||
|
deleteentwhensounddone( time, ent )
|
||||||
|
{
|
||||||
|
self endon( "death" );
|
||||||
|
wait time;
|
||||||
|
self notify( "springpadAudioCleanup" );
|
||||||
|
ent delete();
|
||||||
|
}
|
||||||
|
|
||||||
|
springpad_audio()
|
||||||
|
{
|
||||||
|
loop_ent = spawn( "script_origin", self.origin );
|
||||||
|
loop_ent playloopsound( "zmb_highrise_launcher_loop" );
|
||||||
|
self waittill( "death" );
|
||||||
|
loop_ent delete();
|
||||||
|
}
|
||||||
|
|
||||||
|
springpad_fx( weapon )
|
||||||
|
{
|
||||||
|
weapon endon( "death" );
|
||||||
|
self endon( "equip_springpad_zm_taken" );
|
||||||
|
while ( isDefined( weapon ) )
|
||||||
|
{
|
||||||
|
playfxontag( level._effect[ "springpade_on" ], weapon, "tag_origin" );
|
||||||
|
wait 1;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
springpadthink( weapon, electricradius, armed )
|
||||||
|
{
|
||||||
|
self endon( "death" );
|
||||||
|
self endon( "disconnect" );
|
||||||
|
self endon( "equip_springpad_zm_taken" );
|
||||||
|
weapon endon( "death" );
|
||||||
|
radiussquared = electricradius * electricradius;
|
||||||
|
trigger = spawn( "trigger_box", weapon getcentroid(), 1, 48, 48, 32 );
|
||||||
|
trigger.origin += anglesToForward( flat_angle( weapon.angles ) ) * -15;
|
||||||
|
trigger.angles = weapon.angles;
|
||||||
|
trigger enablelinkto();
|
||||||
|
trigger linkto( weapon );
|
||||||
|
weapon.trigger = trigger;
|
||||||
|
/#
|
||||||
|
trigger.extent = ( 24, 24, 16 );
|
||||||
|
#/
|
||||||
|
weapon thread springpadthinkcleanup( trigger );
|
||||||
|
direction_forward = anglesToForward( flat_angle( weapon.angles ) + vectorScale( ( 0, 0, 1 ), 60 ) );
|
||||||
|
direction_vector = vectorScale( direction_forward, 1024 );
|
||||||
|
direction_origin = weapon.origin + direction_vector;
|
||||||
|
home_angles = weapon.angles;
|
||||||
|
weapon.is_armed = 0;
|
||||||
|
self thread springpad_fx( weapon );
|
||||||
|
self thread springpad_animate( weapon, armed );
|
||||||
|
weapon waittill( "armed" );
|
||||||
|
weapon.is_armed = 1;
|
||||||
|
weapon.fling_targets = [];
|
||||||
|
self thread targeting_thread( weapon, trigger );
|
||||||
|
while ( isDefined( weapon ) )
|
||||||
|
{
|
||||||
|
wait_for_targets( weapon );
|
||||||
|
if ( isDefined( weapon.fling_targets ) && weapon.fling_targets.size > 0 )
|
||||||
|
{
|
||||||
|
weapon notify( "fling" );
|
||||||
|
weapon.is_armed = 0;
|
||||||
|
weapon.zombies_only = 1;
|
||||||
|
_a490 = weapon.fling_targets;
|
||||||
|
_k490 = getFirstArrayKey( _a490 );
|
||||||
|
while ( isDefined( _k490 ) )
|
||||||
|
{
|
||||||
|
ent = _a490[ _k490 ];
|
||||||
|
if ( isplayer( ent ) )
|
||||||
|
{
|
||||||
|
ent thread player_fling( weapon.origin + vectorScale( ( 0, 0, 1 ), 30 ), weapon.angles, direction_vector, weapon );
|
||||||
|
}
|
||||||
|
else if ( isDefined( ent ) && isDefined( ent.custom_springpad_fling ) )
|
||||||
|
{
|
||||||
|
if ( !isDefined( self.num_zombies_flung ) )
|
||||||
|
{
|
||||||
|
self.num_zombies_flung = 0;
|
||||||
|
}
|
||||||
|
self.num_zombies_flung++;
|
||||||
|
self notify( "zombie_flung" );
|
||||||
|
ent thread [[ ent.custom_springpad_fling ]]( weapon, self );
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
if ( isDefined( ent ) )
|
||||||
|
{
|
||||||
|
if ( !isDefined( self.num_zombies_flung ) )
|
||||||
|
{
|
||||||
|
self.num_zombies_flung = 0;
|
||||||
|
}
|
||||||
|
self.num_zombies_flung++;
|
||||||
|
self notify( "zombie_flung" );
|
||||||
|
if ( !isDefined( weapon.fling_scaler ) )
|
||||||
|
{
|
||||||
|
weapon.fling_scaler = 1;
|
||||||
|
}
|
||||||
|
if ( isDefined( weapon.direction_vec_override ) )
|
||||||
|
{
|
||||||
|
direction_vector = weapon.direction_vec_override;
|
||||||
|
}
|
||||||
|
ent dodamage( ent.health + 666, ent.origin );
|
||||||
|
ent startragdoll();
|
||||||
|
ent launchragdoll( ( direction_vector / 4 ) * weapon.fling_scaler );
|
||||||
|
weapon.springpad_kills++;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
_k490 = getNextArrayKey( _a490, _k490 );
|
||||||
|
}
|
||||||
|
if ( weapon.springpad_kills >= 28 )
|
||||||
|
{
|
||||||
|
self thread springpad_expired( weapon );
|
||||||
|
}
|
||||||
|
weapon.fling_targets = [];
|
||||||
|
weapon waittill( "armed" );
|
||||||
|
weapon.is_armed = 1;
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
wait 0,1;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
wait_for_targets( weapon )
|
||||||
|
{
|
||||||
|
weapon endon( "hi_priority_target" );
|
||||||
|
while ( isDefined( weapon ) )
|
||||||
|
{
|
||||||
|
if ( isDefined( weapon.fling_targets ) && weapon.fling_targets.size > 0 )
|
||||||
|
{
|
||||||
|
wait 0,15;
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
wait 0,05;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
targeting_thread( weapon, trigger )
|
||||||
|
{
|
||||||
|
self endon( "death" );
|
||||||
|
self endon( "disconnect" );
|
||||||
|
self endon( "equip_springpad_zm_taken" );
|
||||||
|
weapon endon( "death" );
|
||||||
|
weapon.zombies_only = 1;
|
||||||
|
while ( isDefined( weapon ) )
|
||||||
|
{
|
||||||
|
if ( weapon.is_armed )
|
||||||
|
{
|
||||||
|
zombies = getaiarray( level.zombie_team );
|
||||||
|
_a577 = zombies;
|
||||||
|
_k577 = getFirstArrayKey( _a577 );
|
||||||
|
while ( isDefined( _k577 ) )
|
||||||
|
{
|
||||||
|
zombie = _a577[ _k577 ];
|
||||||
|
if ( !isDefined( zombie ) || !isalive( zombie ) )
|
||||||
|
{
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
if ( isDefined( zombie.ignore_spring_pad ) && zombie.ignore_spring_pad )
|
||||||
|
{
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
if ( zombie istouching( trigger ) )
|
||||||
|
{
|
||||||
|
weapon springpad_add_fling_ent( zombie );
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
_k577 = getNextArrayKey( _a577, _k577 );
|
||||||
|
}
|
||||||
|
players = get_players();
|
||||||
|
_a605 = players;
|
||||||
|
_k605 = getFirstArrayKey( _a605 );
|
||||||
|
while ( isDefined( _k605 ) )
|
||||||
|
{
|
||||||
|
player = _a605[ _k605 ];
|
||||||
|
if ( is_player_valid( player ) && player istouching( trigger ) )
|
||||||
|
{
|
||||||
|
weapon springpad_add_fling_ent( player );
|
||||||
|
weapon.zombies_only = 0;
|
||||||
|
}
|
||||||
|
_k605 = getNextArrayKey( _a605, _k605 );
|
||||||
|
}
|
||||||
|
if ( !weapon.zombies_only )
|
||||||
|
{
|
||||||
|
weapon notify( "hi_priority_target" );
|
||||||
|
}
|
||||||
|
}
|
||||||
|
wait 0,05;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
springpad_fling_attacker( ent )
|
||||||
|
{
|
||||||
|
springpad_add_fling_ent( ent );
|
||||||
|
if ( isDefined( level.springpad_attack_delay ) )
|
||||||
|
{
|
||||||
|
wait level.springpad_attack_delay;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
springpad_add_fling_ent( ent )
|
||||||
|
{
|
||||||
|
self.fling_targets = add_to_array( self.fling_targets, ent, 0 );
|
||||||
|
}
|
||||||
|
|
||||||
|
springpad_expired( weapon )
|
||||||
|
{
|
||||||
|
weapon maps/mp/zombies/_zm_equipment::dropped_equipment_destroy( 1 );
|
||||||
|
self maps/mp/zombies/_zm_equipment::equipment_release( "equip_springpad_zm" );
|
||||||
|
self.springpad_kills = 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
player_fling( origin, angles, velocity, weapon )
|
||||||
|
{
|
||||||
|
torigin = ( self.origin[ 0 ], self.origin[ 1 ], origin[ 2 ] );
|
||||||
|
aorigin = ( origin + torigin ) * 0,5;
|
||||||
|
trace = physicstrace( origin, torigin, vectorScale( ( 0, 0, 1 ), 15 ), ( 15, 15, 30 ), self );
|
||||||
|
if ( isDefined( trace ) || !isDefined( trace[ "fraction" ] ) && trace[ "fraction" ] < 1 )
|
||||||
|
{
|
||||||
|
if ( !isDefined( weapon.springpad_kills ) )
|
||||||
|
{
|
||||||
|
weapon.springpad_kills = 0;
|
||||||
|
}
|
||||||
|
weapon.springpad_kills += 5;
|
||||||
|
if ( weapon.springpad_kills >= 28 )
|
||||||
|
{
|
||||||
|
weapon.owner thread springpad_expired( weapon );
|
||||||
|
}
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
self setorigin( aorigin );
|
||||||
|
wait_network_frame();
|
||||||
|
self setvelocity( velocity );
|
||||||
|
}
|
||||||
|
|
||||||
|
springpadthinkcleanup( trigger )
|
||||||
|
{
|
||||||
|
self waittill( "death" );
|
||||||
|
if ( isDefined( trigger ) )
|
||||||
|
{
|
||||||
|
trigger delete();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
debugspringpad( radius )
|
||||||
|
{
|
||||||
|
/#
|
||||||
|
color_armed = ( 0, 0, 1 );
|
||||||
|
color_unarmed = vectorScale( ( 0, 0, 1 ), 0,65 );
|
||||||
|
while ( isDefined( self ) )
|
||||||
|
{
|
||||||
|
if ( getDvarInt( #"EB512CB7" ) )
|
||||||
|
{
|
||||||
|
if ( isDefined( self.trigger ) )
|
||||||
|
{
|
||||||
|
color = color_unarmed;
|
||||||
|
if ( isDefined( self.is_armed ) && self.is_armed )
|
||||||
|
{
|
||||||
|
color = color_armed;
|
||||||
|
}
|
||||||
|
vec = self.trigger.extent;
|
||||||
|
box( self.trigger.origin, vec * -1, vec, self.trigger.angles[ 1 ], color, 1, 0, 1 );
|
||||||
|
}
|
||||||
|
color = ( 0, 0, 1 );
|
||||||
|
text = "";
|
||||||
|
if ( isDefined( self.springpad_kills ) )
|
||||||
|
{
|
||||||
|
text = "" + self.springpad_kills + "";
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
if ( isDefined( self.owner.springpad_kills ) )
|
||||||
|
{
|
||||||
|
text = "[" + self.owner.springpad_kills + "]";
|
||||||
|
}
|
||||||
|
}
|
||||||
|
print3d( self.origin + vectorScale( ( 0, 0, 1 ), 30 ), text, color, 1, 0,5, 1 );
|
||||||
|
}
|
||||||
|
wait 0,05;
|
||||||
|
#/
|
||||||
|
}
|
||||||
|
}
|
992
zm_buried_patch/maps/mp/zombies/_zm_equip_subwoofer.gsc
Normal file
992
zm_buried_patch/maps/mp/zombies/_zm_equip_subwoofer.gsc
Normal file
@ -0,0 +1,992 @@
|
|||||||
|
#include maps/mp/animscripts/zm_shared;
|
||||||
|
#include maps/mp/animscripts/zm_death;
|
||||||
|
#include maps/mp/zombies/_zm_audio;
|
||||||
|
#include maps/mp/zombies/_zm_buildables;
|
||||||
|
#include maps/mp/zombies/_zm_power;
|
||||||
|
#include maps/mp/zombies/_zm_unitrigger;
|
||||||
|
#include maps/mp/zombies/_zm;
|
||||||
|
#include maps/mp/gametypes_zm/_weaponobjects;
|
||||||
|
#include maps/mp/zombies/_zm_equipment;
|
||||||
|
#include maps/mp/zombies/_zm_utility;
|
||||||
|
#include maps/mp/_utility;
|
||||||
|
#include common_scripts/utility;
|
||||||
|
|
||||||
|
init( pickupstring, howtostring )
|
||||||
|
{
|
||||||
|
if ( !maps/mp/zombies/_zm_equipment::is_equipment_included( "equip_subwoofer_zm" ) )
|
||||||
|
{
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
level.subwoofer_name = "equip_subwoofer_zm";
|
||||||
|
precacherumble( "subwoofer_light" );
|
||||||
|
precacherumble( "subwoofer_medium" );
|
||||||
|
precacherumble( "subwoofer_heavy" );
|
||||||
|
init_animtree();
|
||||||
|
maps/mp/zombies/_zm_equipment::register_equipment( level.subwoofer_name, pickupstring, howtostring, "zom_hud_subwoofer_complete", "subwoofer", undefined, ::transfersubwoofer, ::dropsubwoofer, ::pickupsubwoofer, ::placesubwoofer );
|
||||||
|
maps/mp/zombies/_zm_equipment::add_placeable_equipment( level.subwoofer_name, "t6_wpn_turret_zmb_subwoofer_view" );
|
||||||
|
level thread onplayerconnect();
|
||||||
|
maps/mp/gametypes_zm/_weaponobjects::createretrievablehint( "equip_subwoofer", pickupstring );
|
||||||
|
level._effect[ "subwoofer_on" ] = loadfx( "maps/zombie_highrise/fx_highrise_trmpl_steam_os" );
|
||||||
|
level._effect[ "subwoofer_audio_wave" ] = loadfx( "maps/zombie_buried/fx_buried_subwoofer_blast" );
|
||||||
|
level._effect[ "subwoofer_knockdown_ground" ] = loadfx( "weapon/thunder_gun/fx_thundergun_knockback_ground" );
|
||||||
|
level._effect[ "subwoofer_disappear" ] = loadfx( "maps/zombie/fx_zmb_tranzit_turbine_explo" );
|
||||||
|
level.subwoofer_gib_refs = [];
|
||||||
|
level.subwoofer_gib_refs[ level.subwoofer_gib_refs.size ] = "guts";
|
||||||
|
level.subwoofer_gib_refs[ level.subwoofer_gib_refs.size ] = "right_arm";
|
||||||
|
level.subwoofer_gib_refs[ level.subwoofer_gib_refs.size ] = "left_arm";
|
||||||
|
registerclientfield( "actor", "subwoofer_flings_zombie", 12000, 1, "int" );
|
||||||
|
thread wait_init_damage();
|
||||||
|
}
|
||||||
|
|
||||||
|
wait_init_damage()
|
||||||
|
{
|
||||||
|
while ( !isDefined( level.zombie_vars ) || !isDefined( level.zombie_vars[ "zombie_health_start" ] ) )
|
||||||
|
{
|
||||||
|
wait 1;
|
||||||
|
}
|
||||||
|
level.subwoofer_damage = maps/mp/zombies/_zm::ai_zombie_health( 50 );
|
||||||
|
}
|
||||||
|
|
||||||
|
onplayerconnect()
|
||||||
|
{
|
||||||
|
for ( ;; )
|
||||||
|
{
|
||||||
|
level waittill( "connecting", player );
|
||||||
|
player thread onplayerspawned();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
onplayerspawned()
|
||||||
|
{
|
||||||
|
self endon( "disconnect" );
|
||||||
|
self thread setupwatchers();
|
||||||
|
for ( ;; )
|
||||||
|
{
|
||||||
|
self waittill( "spawned_player" );
|
||||||
|
self thread watchsubwooferuse();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
setupwatchers()
|
||||||
|
{
|
||||||
|
self waittill( "weapon_watchers_created" );
|
||||||
|
watcher = maps/mp/gametypes_zm/_weaponobjects::getweaponobjectwatcher( "equip_subwoofer" );
|
||||||
|
watcher.onspawnretrievetriggers = ::maps/mp/zombies/_zm_equipment::equipment_onspawnretrievableweaponobject;
|
||||||
|
}
|
||||||
|
|
||||||
|
watchsubwooferuse()
|
||||||
|
{
|
||||||
|
self notify( "watchSubwooferUse" );
|
||||||
|
self endon( "watchSubwooferUse" );
|
||||||
|
self endon( "death" );
|
||||||
|
self endon( "disconnect" );
|
||||||
|
for ( ;; )
|
||||||
|
{
|
||||||
|
self waittill( "equipment_placed", weapon, weapname );
|
||||||
|
if ( weapname == level.subwoofer_name )
|
||||||
|
{
|
||||||
|
self cleanupoldsubwoofer();
|
||||||
|
self.buildablesubwoofer = weapon;
|
||||||
|
self thread startsubwooferdeploy( weapon );
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
cleanupoldsubwoofer( preserve_state )
|
||||||
|
{
|
||||||
|
if ( isDefined( self.buildablesubwoofer ) )
|
||||||
|
{
|
||||||
|
if ( isDefined( self.buildablesubwoofer.stub ) )
|
||||||
|
{
|
||||||
|
thread maps/mp/zombies/_zm_unitrigger::unregister_unitrigger( self.buildablesubwoofer.stub );
|
||||||
|
self.buildablesubwoofer.stub = undefined;
|
||||||
|
}
|
||||||
|
self.buildablesubwoofer delete();
|
||||||
|
self.subwoofer_kills = undefined;
|
||||||
|
if ( isDefined( preserve_state ) && !preserve_state )
|
||||||
|
{
|
||||||
|
self.subwoofer_health = undefined;
|
||||||
|
self.subwoofer_emped = undefined;
|
||||||
|
self.subwoofer_emp_time = undefined;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if ( isDefined( level.subwoofer_sound_ent ) )
|
||||||
|
{
|
||||||
|
level.subwoofer_sound_ent delete();
|
||||||
|
level.subwoofer_sound_ent = undefined;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
watchforcleanup()
|
||||||
|
{
|
||||||
|
self notify( "subwoofer_cleanup" );
|
||||||
|
self endon( "subwoofer_cleanup" );
|
||||||
|
evt = self waittill_any_return( "death_or_disconnect", "equip_subwoofer_zm_taken", "equip_subwoofer_zm_pickup" );
|
||||||
|
if ( isDefined( self ) )
|
||||||
|
{
|
||||||
|
self cleanupoldsubwoofer( evt == "equip_subwoofer_zm_pickup" );
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
placesubwoofer( origin, angles )
|
||||||
|
{
|
||||||
|
item = self maps/mp/zombies/_zm_equipment::placed_equipment_think( "t6_wpn_zmb_subwoofer", level.subwoofer_name, origin, angles, 32, 0 );
|
||||||
|
if ( isDefined( item ) )
|
||||||
|
{
|
||||||
|
item.subwoofer_kills = self.subwoofer_kills;
|
||||||
|
item.requires_pickup = 1;
|
||||||
|
}
|
||||||
|
self.subwoofer_kills = undefined;
|
||||||
|
return item;
|
||||||
|
}
|
||||||
|
|
||||||
|
dropsubwoofer()
|
||||||
|
{
|
||||||
|
item = self maps/mp/zombies/_zm_equipment::dropped_equipment_think( "t6_wpn_zmb_subwoofer", level.subwoofer_name, self.origin, self.angles, 32, 0 );
|
||||||
|
if ( isDefined( item ) )
|
||||||
|
{
|
||||||
|
item.subwoofer_kills = self.subwoofer_kills;
|
||||||
|
item.requires_pickup = 1;
|
||||||
|
item.subwoofer_power_on = self.subwoofer_power_on;
|
||||||
|
item.subwoofer_power_level = self.subwoofer_power_level;
|
||||||
|
item.subwoofer_round_start = self.subwoofer_round_start;
|
||||||
|
item.subwoofer_health = self.subwoofer_health;
|
||||||
|
item.subwoofer_emped = self.subwoofer_emped;
|
||||||
|
item.subwoofer_emp_time = self.subwoofer_emp_time;
|
||||||
|
}
|
||||||
|
self.subwoofer_kills = undefined;
|
||||||
|
self.subwoofer_is_powering_on = undefined;
|
||||||
|
self.subwoofer_power_on = undefined;
|
||||||
|
self.subwoofer_power_level = undefined;
|
||||||
|
self.subwoofer_round_start = undefined;
|
||||||
|
self.subwoofer_health = undefined;
|
||||||
|
self.subwoofer_emped = undefined;
|
||||||
|
self.subwoofer_emp_time = undefined;
|
||||||
|
return item;
|
||||||
|
}
|
||||||
|
|
||||||
|
pickupsubwoofer( item )
|
||||||
|
{
|
||||||
|
self.subwoofer_kills = item.subwoofer_kills;
|
||||||
|
item.subwoofer_kills = undefined;
|
||||||
|
}
|
||||||
|
|
||||||
|
transfersubwoofer( fromplayer, toplayer )
|
||||||
|
{
|
||||||
|
buildablesubwoofer = toplayer.buildablesubwoofer;
|
||||||
|
toarmed = 0;
|
||||||
|
if ( isDefined( buildablesubwoofer ) )
|
||||||
|
{
|
||||||
|
if ( isDefined( buildablesubwoofer.is_armed ) )
|
||||||
|
{
|
||||||
|
toarmed = buildablesubwoofer.is_armed;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
subwoofer_kills = toplayer.subwoofer_kills;
|
||||||
|
fromarmed = 0;
|
||||||
|
if ( isDefined( fromplayer.buildablesubwoofer ) )
|
||||||
|
{
|
||||||
|
if ( isDefined( fromplayer.buildablesubwoofer.is_armed ) )
|
||||||
|
{
|
||||||
|
fromarmed = fromplayer.buildablesubwoofer.is_armed;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
toplayer.buildablesubwoofer = fromplayer.buildablesubwoofer;
|
||||||
|
subwoofer_power_on = toplayer.subwoofer_power_on;
|
||||||
|
subwoofer_power_level = toplayer.subwoofer_power_level;
|
||||||
|
subwoofer_round_start = toplayer.subwoofer_round_start;
|
||||||
|
subwoofer_health = toplayer.subwoofer_health;
|
||||||
|
subwoofer_emped = toplayer.subwoofer_emped;
|
||||||
|
subwoofer_emp_time = toplayer.subwoofer_emp_time;
|
||||||
|
toplayer.buildablesubwoofer = fromplayer.buildablesubwoofer;
|
||||||
|
fromplayer.buildablesubwoofer = buildablesubwoofer;
|
||||||
|
toplayer.subwoofer_emped = fromplayer.subwoofer_emped;
|
||||||
|
fromplayer.subwoofer_emped = subwoofer_emped;
|
||||||
|
toplayer.subwoofer_emp_time = fromplayer.subwoofer_emp_time;
|
||||||
|
fromplayer.subwoofer_emp_time = subwoofer_emp_time;
|
||||||
|
toplayer.subwoofer_is_powering_on = undefined;
|
||||||
|
fromplayer.subwoofer_is_powering_on = undefined;
|
||||||
|
toplayer.subwoofer_power_on = fromplayer.subwoofer_power_on;
|
||||||
|
fromplayer.subwoofer_power_on = subwoofer_power_on;
|
||||||
|
toplayer.subwoofer_power_level = fromplayer.subwoofer_power_level;
|
||||||
|
toplayer.subwoofer_round_start = fromplayer.subwoofer_round_start;
|
||||||
|
fromplayer.subwoofer_power_level = subwoofer_power_level;
|
||||||
|
fromplayer.subwoofer_round_start = subwoofer_round_start;
|
||||||
|
toplayer.subwoofer_health = fromplayer.subwoofer_health;
|
||||||
|
fromplayer.subwoofer_health = subwoofer_health;
|
||||||
|
toplayer.buildablesubwoofer.original_owner = toplayer;
|
||||||
|
toplayer.buildablesubwoofer.owner = toplayer;
|
||||||
|
toplayer notify( "equip_subwoofer_zm_taken" );
|
||||||
|
toplayer.subwoofer_kills = fromplayer.subwoofer_kills;
|
||||||
|
toplayer thread startsubwooferdeploy( toplayer.buildablesubwoofer, fromarmed );
|
||||||
|
fromplayer.subwoofer_kills = subwoofer_kills;
|
||||||
|
fromplayer notify( "equip_subwoofer_zm_taken" );
|
||||||
|
if ( isDefined( fromplayer.buildablesubwoofer ) )
|
||||||
|
{
|
||||||
|
fromplayer thread startsubwooferdeploy( fromplayer.buildablesubwoofer, toarmed );
|
||||||
|
fromplayer.buildablesubwoofer.original_owner = fromplayer;
|
||||||
|
fromplayer.buildablesubwoofer.owner = fromplayer;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
fromplayer maps/mp/zombies/_zm_equipment::equipment_release( level.subwoofer_name );
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
subwoofer_in_range( delta, origin, radius )
|
||||||
|
{
|
||||||
|
if ( distancesquared( self.target.origin, origin ) < ( radius * radius ) )
|
||||||
|
{
|
||||||
|
return 1;
|
||||||
|
}
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
subwoofer_power_on( origin, radius )
|
||||||
|
{
|
||||||
|
/#
|
||||||
|
println( "^1ZM POWER: trap on\n" );
|
||||||
|
#/
|
||||||
|
if ( !isDefined( self.target ) )
|
||||||
|
{
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
self.target.power_on = 1;
|
||||||
|
self.target.power_on_time = getTime();
|
||||||
|
self.target.owner thread subwooferthink( self.target );
|
||||||
|
}
|
||||||
|
|
||||||
|
subwoofer_power_off( origin, radius )
|
||||||
|
{
|
||||||
|
/#
|
||||||
|
println( "^1ZM POWER: trap off\n" );
|
||||||
|
#/
|
||||||
|
if ( !isDefined( self.target ) )
|
||||||
|
{
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
self.target.power_on = 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
subwoofer_cost()
|
||||||
|
{
|
||||||
|
return maps/mp/zombies/_zm_power::cost_high() / 2;
|
||||||
|
}
|
||||||
|
|
||||||
|
startsubwooferdeploy( weapon, armed )
|
||||||
|
{
|
||||||
|
self endon( "death" );
|
||||||
|
self endon( "disconnect" );
|
||||||
|
self endon( "equip_subwoofer_zm_taken" );
|
||||||
|
self thread watchforcleanup();
|
||||||
|
if ( isDefined( self.subwoofer_kills ) )
|
||||||
|
{
|
||||||
|
weapon.subwoofer_kills = self.subwoofer_kills;
|
||||||
|
self.subwoofer_kills = undefined;
|
||||||
|
}
|
||||||
|
if ( !isDefined( weapon.subwoofer_kills ) )
|
||||||
|
{
|
||||||
|
weapon.subwoofer_kills = 0;
|
||||||
|
}
|
||||||
|
if ( !isDefined( self.subwoofer_health ) )
|
||||||
|
{
|
||||||
|
self.subwoofer_health = 60;
|
||||||
|
self.subwoofer_power_level = 4;
|
||||||
|
}
|
||||||
|
if ( isDefined( weapon ) )
|
||||||
|
{
|
||||||
|
/#
|
||||||
|
self thread debugsubwoofer();
|
||||||
|
#/
|
||||||
|
if ( isDefined( level.equipment_subwoofer_needs_power ) && level.equipment_subwoofer_needs_power )
|
||||||
|
{
|
||||||
|
weapon.power_on = 0;
|
||||||
|
maps/mp/zombies/_zm_power::add_temp_powered_item( ::subwoofer_power_on, ::subwoofer_power_off, ::subwoofer_in_range, ::subwoofer_cost, 1, weapon.power_on, weapon );
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
weapon.power_on = 1;
|
||||||
|
}
|
||||||
|
if ( weapon.power_on )
|
||||||
|
{
|
||||||
|
self thread subwooferthink( weapon, armed );
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
self iprintlnbold( &"ZOMBIE_NEED_LOCAL_POWER" );
|
||||||
|
}
|
||||||
|
if ( isDefined( level.equipment_subwoofer_needs_power ) && !level.equipment_subwoofer_needs_power )
|
||||||
|
{
|
||||||
|
self thread startsubwooferdecay( weapon );
|
||||||
|
}
|
||||||
|
self thread maps/mp/zombies/_zm_buildables::delete_on_disconnect( weapon );
|
||||||
|
weapon waittill( "death" );
|
||||||
|
if ( isDefined( level.subwoofer_sound_ent ) )
|
||||||
|
{
|
||||||
|
level.subwoofer_sound_ent playsound( "wpn_zmb_electrap_stop" );
|
||||||
|
level.subwoofer_sound_ent delete();
|
||||||
|
level.subwoofer_sound_ent = undefined;
|
||||||
|
}
|
||||||
|
self notify( "subwoofer_cleanup" );
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
startsubwooferdecay( weapon )
|
||||||
|
{
|
||||||
|
self notify( "subwooferDecay" );
|
||||||
|
self endon( "subwooferDecay" );
|
||||||
|
self endon( "death" );
|
||||||
|
self endon( "disconnect" );
|
||||||
|
self endon( "equip_subwoofer_zm_taken" );
|
||||||
|
weapon endon( "death" );
|
||||||
|
roundlives = 4;
|
||||||
|
if ( !isDefined( self.subwoofer_power_level ) )
|
||||||
|
{
|
||||||
|
self.subwoofer_power_level = roundlives;
|
||||||
|
}
|
||||||
|
while ( weapon.subwoofer_kills < 45 )
|
||||||
|
{
|
||||||
|
old_power_level = self.subwoofer_power_level;
|
||||||
|
if ( isDefined( self.subwoofer_emped ) && self.subwoofer_emped && isDefined( self.subwoofer_is_powering_on ) && !self.subwoofer_is_powering_on )
|
||||||
|
{
|
||||||
|
emp_time = level.zombie_vars[ "emp_perk_off_time" ];
|
||||||
|
now = getTime();
|
||||||
|
emp_time_left = emp_time - ( ( now - self.subwoofer_emp_time ) / 1000 );
|
||||||
|
if ( emp_time_left <= 0 )
|
||||||
|
{
|
||||||
|
self.subwoofer_emped = undefined;
|
||||||
|
self.subwoofer_emp_time = undefined;
|
||||||
|
old_power_level = -1;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if ( isDefined( self.subwoofer_emped ) && self.subwoofer_emped )
|
||||||
|
{
|
||||||
|
self.subwoofer_power_level = 0;
|
||||||
|
}
|
||||||
|
cost = 1;
|
||||||
|
if ( weapon.subwoofer_kills > 30 )
|
||||||
|
{
|
||||||
|
self.subwoofer_power_level = 1;
|
||||||
|
if ( isDefined( weapon.low_health_sparks ) && !weapon.low_health_sparks )
|
||||||
|
{
|
||||||
|
weapon.low_health_sparks = 1;
|
||||||
|
playfxontag( level._effect[ "switch_sparks" ], weapon, "tag_origin" );
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else if ( weapon.subwoofer_kills > 15 )
|
||||||
|
{
|
||||||
|
self.subwoofer_power_level = 2;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
self.subwoofer_power_level = 4;
|
||||||
|
}
|
||||||
|
if ( old_power_level != self.subwoofer_power_level )
|
||||||
|
{
|
||||||
|
self notify( "subwoofer_power_change" );
|
||||||
|
}
|
||||||
|
wait 1;
|
||||||
|
}
|
||||||
|
if ( isDefined( weapon ) )
|
||||||
|
{
|
||||||
|
self destroy_placed_subwoofer();
|
||||||
|
subwoofer_disappear_fx( weapon );
|
||||||
|
}
|
||||||
|
self thread wait_and_take_equipment();
|
||||||
|
self.subwoofer_health = undefined;
|
||||||
|
self.subwoofer_power_level = undefined;
|
||||||
|
self.subwoofer_round_start = undefined;
|
||||||
|
self.subwoofer_power_on = undefined;
|
||||||
|
self.subwoofer_emped = undefined;
|
||||||
|
self.subwoofer_emp_time = undefined;
|
||||||
|
self cleanupoldsubwoofer();
|
||||||
|
}
|
||||||
|
|
||||||
|
destroy_placed_subwoofer()
|
||||||
|
{
|
||||||
|
if ( isDefined( self.buildablesubwoofer ) )
|
||||||
|
{
|
||||||
|
if ( isDefined( self.buildablesubwoofer.dying ) && self.buildablesubwoofer.dying )
|
||||||
|
{
|
||||||
|
while ( isDefined( self.buildablesubwoofer ) )
|
||||||
|
{
|
||||||
|
wait 0,05;
|
||||||
|
}
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
if ( isDefined( self.buildablesubwoofer.stub ) )
|
||||||
|
{
|
||||||
|
thread maps/mp/zombies/_zm_unitrigger::unregister_unitrigger( self.buildablesubwoofer.stub );
|
||||||
|
}
|
||||||
|
thread subwoofer_disappear_fx( self.buildablesubwoofer, 0,75 );
|
||||||
|
self.buildablesubwoofer.dying = 1;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
wait_and_take_equipment()
|
||||||
|
{
|
||||||
|
wait 0,05;
|
||||||
|
self thread maps/mp/zombies/_zm_equipment::equipment_release( level.subwoofer_name );
|
||||||
|
}
|
||||||
|
|
||||||
|
init_animtree()
|
||||||
|
{
|
||||||
|
}
|
||||||
|
|
||||||
|
subwoofer_fx( weapon )
|
||||||
|
{
|
||||||
|
weapon endon( "death" );
|
||||||
|
self endon( "equip_subwoofer_zm_taken" );
|
||||||
|
while ( isDefined( weapon ) )
|
||||||
|
{
|
||||||
|
wait 1;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
subwoofer_disappear_fx( weapon, waittime )
|
||||||
|
{
|
||||||
|
if ( isDefined( waittime ) && waittime > 0 )
|
||||||
|
{
|
||||||
|
wait waittime;
|
||||||
|
}
|
||||||
|
if ( isDefined( weapon ) )
|
||||||
|
{
|
||||||
|
playfx( level._effect[ "subwoofer_disappear" ], weapon.origin );
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
subwoofer_choke()
|
||||||
|
{
|
||||||
|
while ( 1 )
|
||||||
|
{
|
||||||
|
level._subwoofer_choke = 0;
|
||||||
|
wait_network_frame();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
subwooferthink( weapon, armed )
|
||||||
|
{
|
||||||
|
self endon( "death" );
|
||||||
|
self endon( "disconnect" );
|
||||||
|
self endon( "equip_subwoofer_zm_taken" );
|
||||||
|
weapon notify( "subwooferthink" );
|
||||||
|
weapon endon( "subwooferthink" );
|
||||||
|
weapon endon( "death" );
|
||||||
|
direction_forward = anglesToForward( flat_angle( weapon.angles ) + vectorScale( ( 0, 0, 1 ), 30 ) );
|
||||||
|
direction_vector = vectorScale( direction_forward, 512 );
|
||||||
|
direction_origin = weapon.origin + direction_vector;
|
||||||
|
original_angles = weapon.angles;
|
||||||
|
original_origin = weapon.origin;
|
||||||
|
tag_spin_origin = weapon gettagorigin( "tag_spin" );
|
||||||
|
wait 0,05;
|
||||||
|
while ( 1 )
|
||||||
|
{
|
||||||
|
while ( isDefined( weapon.power_on ) && !weapon.power_on )
|
||||||
|
{
|
||||||
|
wait 1;
|
||||||
|
}
|
||||||
|
wait 2;
|
||||||
|
if ( isDefined( weapon.power_on ) && !weapon.power_on )
|
||||||
|
{
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
if ( !isDefined( level._subwoofer_choke ) )
|
||||||
|
{
|
||||||
|
level thread subwoofer_choke();
|
||||||
|
}
|
||||||
|
while ( level._subwoofer_choke )
|
||||||
|
{
|
||||||
|
wait 0,05;
|
||||||
|
}
|
||||||
|
level._subwoofer_choke++;
|
||||||
|
weapon.subwoofer_network_choke_count = 0;
|
||||||
|
weapon thread maps/mp/zombies/_zm_equipment::signal_equipment_activated( 1 );
|
||||||
|
vibrateamplitude = 4;
|
||||||
|
if ( self.subwoofer_power_level == 3 )
|
||||||
|
{
|
||||||
|
vibrateamplitude = 8;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
if ( self.subwoofer_power_level == 2 )
|
||||||
|
{
|
||||||
|
vibrateamplitude = 13;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if ( self.subwoofer_power_level == 1 )
|
||||||
|
{
|
||||||
|
vibrateamplitude = 17;
|
||||||
|
}
|
||||||
|
weapon vibrate( vectorScale( ( 0, 0, 1 ), 100 ), vibrateamplitude, 0,2, 0,3 );
|
||||||
|
zombies = get_array_of_closest( weapon.origin, get_round_enemy_array(), undefined, undefined, 1200 );
|
||||||
|
players = get_array_of_closest( weapon.origin, get_players(), undefined, undefined, 1200 );
|
||||||
|
props = get_array_of_closest( weapon.origin, getentarray( "subwoofer_target", "script_noteworthy" ), undefined, undefined, 1200 );
|
||||||
|
entities = arraycombine( zombies, players, 0, 0 );
|
||||||
|
entities = arraycombine( entities, props, 0, 0 );
|
||||||
|
_a681 = entities;
|
||||||
|
_k681 = getFirstArrayKey( _a681 );
|
||||||
|
while ( isDefined( _k681 ) )
|
||||||
|
{
|
||||||
|
ent = _a681[ _k681 ];
|
||||||
|
if ( !isDefined( ent ) || !isplayer( ent ) && isai( ent ) && !isalive( ent ) )
|
||||||
|
{
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
if ( isDefined( ent.ignore_subwoofer ) && ent.ignore_subwoofer )
|
||||||
|
{
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
distanceentityandsubwoofer = distance2dsquared( original_origin, ent.origin );
|
||||||
|
onlydamage = 0;
|
||||||
|
action = undefined;
|
||||||
|
if ( distanceentityandsubwoofer <= 32400 )
|
||||||
|
{
|
||||||
|
action = "burst";
|
||||||
|
}
|
||||||
|
else if ( distanceentityandsubwoofer <= 230400 )
|
||||||
|
{
|
||||||
|
action = "fling";
|
||||||
|
}
|
||||||
|
else if ( distanceentityandsubwoofer <= 1440000 )
|
||||||
|
{
|
||||||
|
action = "stumble";
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
}
|
||||||
|
if ( !within_fov( original_origin, original_angles, ent.origin, cos( 45 ) ) )
|
||||||
|
{
|
||||||
|
if ( isplayer( ent ) )
|
||||||
|
{
|
||||||
|
ent hit_player( action, 0 );
|
||||||
|
}
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
else weapon subwoofer_network_choke();
|
||||||
|
ent_trace_origin = ent.origin;
|
||||||
|
if ( isai( ent ) || isplayer( ent ) )
|
||||||
|
{
|
||||||
|
ent_trace_origin = ent geteye();
|
||||||
|
}
|
||||||
|
if ( isDefined( ent.script_noteworthy ) && ent.script_noteworthy == "subwoofer_target" )
|
||||||
|
{
|
||||||
|
ent_trace_origin += vectorScale( ( 0, 0, 1 ), 48 );
|
||||||
|
}
|
||||||
|
if ( !sighttracepassed( tag_spin_origin, ent_trace_origin, 1, weapon ) )
|
||||||
|
{
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
else if ( isDefined( ent.script_noteworthy ) && ent.script_noteworthy == "subwoofer_target" )
|
||||||
|
{
|
||||||
|
ent notify( "damaged_by_subwoofer" );
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
if ( isDefined( ent.in_the_ground ) && !ent.in_the_ground && isDefined( ent.in_the_ceiling ) && !ent.in_the_ceiling && isDefined( ent.ai_state ) || ent.ai_state == "zombie_goto_entrance" && isDefined( ent.completed_emerging_into_playable_area ) && !ent.completed_emerging_into_playable_area )
|
||||||
|
{
|
||||||
|
onlydamage = 1;
|
||||||
|
}
|
||||||
|
if ( isplayer( ent ) )
|
||||||
|
{
|
||||||
|
ent notify( "player_" + action );
|
||||||
|
ent hit_player( action, 1 );
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
else if ( isDefined( ent ) )
|
||||||
|
{
|
||||||
|
ent notify( "zombie_" + action );
|
||||||
|
/#
|
||||||
|
ent thread subwoofer_debug_print( action, ( 0, 0, 1 ) );
|
||||||
|
#/
|
||||||
|
shouldgib = distanceentityandsubwoofer <= 810000;
|
||||||
|
if ( action == "fling" )
|
||||||
|
{
|
||||||
|
ent thread fling_zombie( weapon, direction_vector / 4, self, onlydamage );
|
||||||
|
weapon.subwoofer_kills++;
|
||||||
|
self thread maps/mp/zombies/_zm_audio::create_and_play_dialog( "kill", "subwoofer" );
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
else if ( action == "burst" )
|
||||||
|
{
|
||||||
|
ent thread burst_zombie( weapon, self );
|
||||||
|
weapon.subwoofer_kills++;
|
||||||
|
self thread maps/mp/zombies/_zm_audio::create_and_play_dialog( "kill", "subwoofer" );
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
if ( action == "stumble" )
|
||||||
|
{
|
||||||
|
ent thread knockdown_zombie( weapon, shouldgib, onlydamage );
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
_k681 = getNextArrayKey( _a681, _k681 );
|
||||||
|
}
|
||||||
|
if ( weapon.subwoofer_kills >= 45 )
|
||||||
|
{
|
||||||
|
self thread subwoofer_expired( weapon );
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
subwoofer_expired( weapon )
|
||||||
|
{
|
||||||
|
weapon maps/mp/zombies/_zm_equipment::dropped_equipment_destroy( 1 );
|
||||||
|
self maps/mp/zombies/_zm_equipment::equipment_release( level.subwoofer_name );
|
||||||
|
self.subwoofer_kills = 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
hit_player( action, doshellshock )
|
||||||
|
{
|
||||||
|
if ( action == "burst" )
|
||||||
|
{
|
||||||
|
self playrumbleonentity( "subwoofer_heavy" );
|
||||||
|
if ( isDefined( doshellshock ) && doshellshock )
|
||||||
|
{
|
||||||
|
self shellshock( "frag_grenade_mp", 1,5 );
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else if ( action == "fling" )
|
||||||
|
{
|
||||||
|
self playrumbleonentity( "subwoofer_medium" );
|
||||||
|
if ( isDefined( doshellshock ) && doshellshock )
|
||||||
|
{
|
||||||
|
self shellshock( "frag_grenade_mp", 0,5 );
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
if ( action == "stumble" )
|
||||||
|
{
|
||||||
|
if ( isDefined( doshellshock ) && doshellshock )
|
||||||
|
{
|
||||||
|
self playrumbleonentity( "subwoofer_light" );
|
||||||
|
self shellshock( "frag_grenade_mp", 0,13 );
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
burst_zombie( weapon, player )
|
||||||
|
{
|
||||||
|
if ( !isDefined( self ) || !isalive( self ) )
|
||||||
|
{
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
if ( isDefined( self.subwoofer_burst_func ) )
|
||||||
|
{
|
||||||
|
self thread [[ self.subwoofer_burst_func ]]( weapon );
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
self dodamage( self.health + 666, weapon.origin );
|
||||||
|
player notify( "zombie_subwoofer_kill" );
|
||||||
|
if ( isDefined( self.guts_explosion ) && !self.guts_explosion )
|
||||||
|
{
|
||||||
|
self.guts_explosion = 1;
|
||||||
|
self setclientfield( "zombie_gut_explosion", 1 );
|
||||||
|
if ( isDefined( self.isdog ) && !self.isdog )
|
||||||
|
{
|
||||||
|
wait 0,1;
|
||||||
|
}
|
||||||
|
self ghost();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
fling_zombie( weapon, fling_vec, player, onlydamage )
|
||||||
|
{
|
||||||
|
if ( !isDefined( self ) || !isalive( self ) )
|
||||||
|
{
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
if ( isDefined( self.subwoofer_fling_func ) )
|
||||||
|
{
|
||||||
|
self thread [[ self.subwoofer_fling_func ]]( weapon, fling_vec );
|
||||||
|
player notify( "zombie_subwoofer_kill" );
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
self dodamage( self.health + 666, weapon.origin );
|
||||||
|
player notify( "zombie_subwoofer_kill" );
|
||||||
|
if ( self.health <= 0 )
|
||||||
|
{
|
||||||
|
if ( isDefined( onlydamage ) && !onlydamage )
|
||||||
|
{
|
||||||
|
self startragdoll();
|
||||||
|
self setclientfield( "subwoofer_flings_zombie", 1 );
|
||||||
|
}
|
||||||
|
self.subwoofer_death = 1;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
knockdown_zombie( weapon, gib, onlydamage )
|
||||||
|
{
|
||||||
|
self endon( "death" );
|
||||||
|
if ( isDefined( self.is_knocked_down ) && self.is_knocked_down )
|
||||||
|
{
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
if ( !isDefined( self ) || !isalive( self ) )
|
||||||
|
{
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
if ( isDefined( self.subwoofer_knockdown_func ) )
|
||||||
|
{
|
||||||
|
self thread [[ self.subwoofer_knockdown_func ]]( weapon, gib );
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
if ( isDefined( onlydamage ) && onlydamage )
|
||||||
|
{
|
||||||
|
self thread knockdown_zombie_damage( weapon );
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
if ( gib && isDefined( self.gibbed ) && !self.gibbed )
|
||||||
|
{
|
||||||
|
self thread knockdown_zombie_damage( weapon );
|
||||||
|
self.a.gib_ref = random( level.subwoofer_gib_refs );
|
||||||
|
self thread maps/mp/animscripts/zm_death::do_gib();
|
||||||
|
}
|
||||||
|
self.subwoofer_handle_pain_notetracks = ::handle_subwoofer_pain_notetracks;
|
||||||
|
self thread knockdown_zombie_damage( weapon );
|
||||||
|
self animcustom( ::knockdown_zombie_animate );
|
||||||
|
}
|
||||||
|
|
||||||
|
knockdown_zombie_damage( weapon )
|
||||||
|
{
|
||||||
|
if ( self.health <= 15 )
|
||||||
|
{
|
||||||
|
weapon.subwoofer_kills++;
|
||||||
|
self thread maps/mp/zombies/_zm_audio::create_and_play_dialog( "kill", "subwoofer" );
|
||||||
|
}
|
||||||
|
self dodamage( 15, weapon.origin );
|
||||||
|
}
|
||||||
|
|
||||||
|
handle_subwoofer_pain_notetracks( note )
|
||||||
|
{
|
||||||
|
if ( note == "zombie_knockdown_ground_impact" )
|
||||||
|
{
|
||||||
|
playfx( level._effect[ "subwoofer_knockdown_ground" ], self.origin, anglesToForward( self.angles ), anglesToUp( self.angles ) );
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
knockdown_zombie_animate()
|
||||||
|
{
|
||||||
|
self notify( "end_play_subwoofer_pain_anim" );
|
||||||
|
self endon( "killanimscript" );
|
||||||
|
self endon( "death" );
|
||||||
|
self endon( "end_play_subwoofer_pain_anim" );
|
||||||
|
if ( isDefined( self.marked_for_death ) && self.marked_for_death )
|
||||||
|
{
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
if ( isDefined( self.has_legs ) && !self.has_legs )
|
||||||
|
{
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
if ( isDefined( self.barricade_enter ) && self.barricade_enter )
|
||||||
|
{
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
if ( !issubstr( self.animstatedef, "buried" ) )
|
||||||
|
{
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
animation_direction = undefined;
|
||||||
|
animation_side = undefined;
|
||||||
|
animation_duration = "_default";
|
||||||
|
if ( self.damageyaw <= -135 || self.damageyaw >= 135 )
|
||||||
|
{
|
||||||
|
animation_direction = "back";
|
||||||
|
animation_side = "back";
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
if ( self.damageyaw > -135 && self.damageyaw < -45 )
|
||||||
|
{
|
||||||
|
animation_direction = "left";
|
||||||
|
animation_side = "back";
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
if ( self.damageyaw > 45 && self.damageyaw < 135 )
|
||||||
|
{
|
||||||
|
animation_direction = "right";
|
||||||
|
animation_side = "belly";
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
animation_direction = "front";
|
||||||
|
animation_side = "belly";
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
wait randomfloatrange( 0,05, 0,35 );
|
||||||
|
self thread knockdown_zombie_animate_state();
|
||||||
|
/#
|
||||||
|
self thread subwoofer_debug_animation_print( animation_direction, animation_side );
|
||||||
|
#/
|
||||||
|
self setanimstatefromasd( "zm_subwoofer_fall_" + animation_direction );
|
||||||
|
self maps/mp/animscripts/zm_shared::donotetracks( "subwoofer_fall_anim", self.subwoofer_handle_pain_notetracks );
|
||||||
|
if ( isDefined( self ) && isalive( self ) && isDefined( self.has_legs ) || !self.has_legs && isDefined( self.marked_for_death ) && self.marked_for_death )
|
||||||
|
{
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
if ( isDefined( self.a.gib_ref ) )
|
||||||
|
{
|
||||||
|
if ( self.a.gib_ref != "no_legs" && self.a.gib_ref != "no_arms" && self.a.gib_ref != "left_leg" && self.a.gib_ref == "right_leg" || randomint( 100 ) > 25 && self.a.gib_ref != "left_arm" && self.a.gib_ref == "right_arm" && randomint( 100 ) > 75 )
|
||||||
|
{
|
||||||
|
animation_duration = "_late";
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
if ( randomint( 100 ) > 75 )
|
||||||
|
{
|
||||||
|
animation_duration = "_early";
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
if ( randomint( 100 ) > 25 )
|
||||||
|
{
|
||||||
|
animation_duration = "_early";
|
||||||
|
}
|
||||||
|
}
|
||||||
|
self setanimstatefromasd( "zm_subwoofer_getup_" + animation_side + animation_duration );
|
||||||
|
self maps/mp/animscripts/zm_shared::donotetracks( "subwoofer_getup_anim" );
|
||||||
|
self notify( "back_up" );
|
||||||
|
}
|
||||||
|
|
||||||
|
knockdown_zombie_animate_state()
|
||||||
|
{
|
||||||
|
self endon( "death" );
|
||||||
|
self.is_knocked_down = 1;
|
||||||
|
self waittill_any( "damage", "back_up" );
|
||||||
|
self.is_knocked_down = 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
subwoofer_network_choke()
|
||||||
|
{
|
||||||
|
self.subwoofer_network_choke_count++;
|
||||||
|
if ( self.subwoofer_network_choke_count % 10 )
|
||||||
|
{
|
||||||
|
wait_network_frame();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
enemy_killed_by_subwoofer()
|
||||||
|
{
|
||||||
|
if ( isDefined( self.subwoofer_death ) )
|
||||||
|
{
|
||||||
|
return self.subwoofer_death;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
debugsubwoofer()
|
||||||
|
{
|
||||||
|
/#
|
||||||
|
self endon( "death" );
|
||||||
|
self endon( "disconnect" );
|
||||||
|
self endon( "equip_subwoofer_zm_taken" );
|
||||||
|
self.buildablesubwoofer endon( "death" );
|
||||||
|
red = ( 0, 0, 1 );
|
||||||
|
green = ( 0, 0, 1 );
|
||||||
|
blue = ( 0, 0, 1 );
|
||||||
|
yellow = vectorScale( ( 0, 0, 1 ), 0,65 );
|
||||||
|
while ( isDefined( self.buildablesubwoofer ) )
|
||||||
|
{
|
||||||
|
if ( getDvarInt( #"EB512CB7" ) )
|
||||||
|
{
|
||||||
|
row = 1;
|
||||||
|
health_color = green;
|
||||||
|
if ( self.subwoofer_power_level <= 1 )
|
||||||
|
{
|
||||||
|
health_color = red;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
if ( self.subwoofer_power_level <= 3 )
|
||||||
|
{
|
||||||
|
health_color = yellow;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if ( isDefined( self.buildablesubwoofer.subwoofer_kills ) )
|
||||||
|
{
|
||||||
|
row = self debugsubwooferprint3d( row, "Kills: " + self.buildablesubwoofer.subwoofer_kills, health_color );
|
||||||
|
}
|
||||||
|
if ( isDefined( self.subwoofer_health ) )
|
||||||
|
{
|
||||||
|
row = self debugsubwooferprint3d( row, "Use Time: " + self.subwoofer_health, health_color );
|
||||||
|
}
|
||||||
|
if ( isDefined( self.buildablesubwoofer.original_owner ) )
|
||||||
|
{
|
||||||
|
row = self debugsubwooferprint3d( row, "Original Owner: " + self.buildablesubwoofer.original_owner.name, green );
|
||||||
|
}
|
||||||
|
if ( isDefined( self.buildablesubwoofer.owner ) )
|
||||||
|
{
|
||||||
|
row = self debugsubwooferprint3d( row, "Current Owner: " + self.buildablesubwoofer.owner.name, green );
|
||||||
|
}
|
||||||
|
}
|
||||||
|
wait 0,05;
|
||||||
|
#/
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
debugsubwooferprint3d( row, text, color )
|
||||||
|
{
|
||||||
|
/#
|
||||||
|
self endon( "death" );
|
||||||
|
self endon( "disconnect" );
|
||||||
|
self endon( "equip_subwoofer_zm_taken" );
|
||||||
|
self.buildablesubwoofer endon( "death" );
|
||||||
|
print3dspace = vectorScale( ( 0, 0, 1 ), 10 );
|
||||||
|
print3d( self.buildablesubwoofer.origin + vectorScale( ( 0, 0, 1 ), 30 ) + ( print3dspace * row ), text, color, 1, 0,5, 1 );
|
||||||
|
row++;
|
||||||
|
return row;
|
||||||
|
#/
|
||||||
|
}
|
||||||
|
|
||||||
|
subwoofer_debug_print( msg, color, offset )
|
||||||
|
{
|
||||||
|
/#
|
||||||
|
if ( !getDvarInt( #"EB512CB7" ) )
|
||||||
|
{
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
if ( !isDefined( color ) )
|
||||||
|
{
|
||||||
|
color = ( 0, 0, 1 );
|
||||||
|
}
|
||||||
|
if ( !isDefined( offset ) )
|
||||||
|
{
|
||||||
|
offset = ( 0, 0, 1 );
|
||||||
|
}
|
||||||
|
print3d( self.origin + vectorScale( ( 0, 0, 1 ), 60 ) + offset, msg, color, 1, 1, 40 );
|
||||||
|
#/
|
||||||
|
}
|
||||||
|
|
||||||
|
subwoofer_debug_animation_print( msg1, msg2 )
|
||||||
|
{
|
||||||
|
/#
|
||||||
|
if ( getDvarInt( #"EB512CB7" ) != 1 )
|
||||||
|
{
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
self endon( "death" );
|
||||||
|
self endon( "damage" );
|
||||||
|
self endon( "back_up" );
|
||||||
|
color = ( 0, 0, 1 );
|
||||||
|
while ( 1 )
|
||||||
|
{
|
||||||
|
print3d( self.origin + vectorScale( ( 0, 0, 1 ), 50 ), "FallDown: " + msg1, color, 1, 0,75 );
|
||||||
|
print3d( self.origin + vectorScale( ( 0, 0, 1 ), 40 ), "GetUp: " + msg2, color, 1, 0,75 );
|
||||||
|
wait 0,05;
|
||||||
|
#/
|
||||||
|
}
|
||||||
|
}
|
17
zm_buried_patch/maps/mp/zombies/_zm_game_module_cleansed.gsc
Normal file
17
zm_buried_patch/maps/mp/zombies/_zm_game_module_cleansed.gsc
Normal file
@ -0,0 +1,17 @@
|
|||||||
|
#include maps/mp/zombies/_zm_turned;
|
||||||
|
#include maps/mp/zombies/_zm_utility;
|
||||||
|
#include common_scripts/utility;
|
||||||
|
#include maps/mp/gametypes_zm/_hud_util;
|
||||||
|
#include maps/mp/_utility;
|
||||||
|
|
||||||
|
register_game_module()
|
||||||
|
{
|
||||||
|
}
|
||||||
|
|
||||||
|
onstartgametype( name )
|
||||||
|
{
|
||||||
|
}
|
||||||
|
|
||||||
|
onstartcleansedgametype()
|
||||||
|
{
|
||||||
|
}
|
11
zm_buried_patch/maps/mp/zombies/_zm_game_module_grief.gsc
Normal file
11
zm_buried_patch/maps/mp/zombies/_zm_game_module_grief.gsc
Normal file
@ -0,0 +1,11 @@
|
|||||||
|
#include maps/mp/zombies/_zm_game_module_utility;
|
||||||
|
#include maps/mp/zombies/_zm_utility;
|
||||||
|
#include common_scripts/utility;
|
||||||
|
#include maps/mp/gametypes_zm/_hud_util;
|
||||||
|
#include maps/mp/_utility;
|
||||||
|
|
||||||
|
register_game_module()
|
||||||
|
{
|
||||||
|
level.game_module_grief_index = 9;
|
||||||
|
maps/mp/zombies/_zm_game_module::register_game_module( level.game_module_grief_index, "zgrief", ::onpreinitgametype, ::onpostinitgametype, undefined, ::onspawnzombie, ::onstartgametype );
|
||||||
|
}
|
6
zm_buried_patch/maps/mp/zombies/_zm_game_module_meat.gsc
Normal file
6
zm_buried_patch/maps/mp/zombies/_zm_game_module_meat.gsc
Normal file
@ -0,0 +1,6 @@
|
|||||||
|
#include maps/mp/zombies/_zm_game_module_utility;
|
||||||
|
#include maps/mp/zombies/_zm_game_module_meat_utility;
|
||||||
|
#include maps/mp/zombies/_zm_utility;
|
||||||
|
#include common_scripts/utility;
|
||||||
|
#include maps/mp/gametypes_zm/_hud_util;
|
||||||
|
#include maps/mp/_utility;
|
685
zm_buried_patch/maps/mp/zombies/_zm_game_module_meat_utility.gsc
Normal file
685
zm_buried_patch/maps/mp/zombies/_zm_game_module_meat_utility.gsc
Normal file
@ -0,0 +1,685 @@
|
|||||||
|
#include maps/mp/zombies/_zm_powerups;
|
||||||
|
#include maps/mp/gametypes_zm/zmeat;
|
||||||
|
#include maps/mp/zombies/_zm_audio_announcer;
|
||||||
|
#include maps/mp/zombies/_zm_laststand;
|
||||||
|
#include maps/mp/zombies/_zm_game_module_utility;
|
||||||
|
#include maps/mp/zombies/_zm_utility;
|
||||||
|
#include maps/mp/_utility;
|
||||||
|
#include common_scripts/utility;
|
||||||
|
|
||||||
|
award_grenades_for_team( team )
|
||||||
|
{
|
||||||
|
players = get_players();
|
||||||
|
i = 0;
|
||||||
|
while ( i < players.size )
|
||||||
|
{
|
||||||
|
if ( !isDefined( players[ i ]._meat_team ) || players[ i ]._meat_team != team )
|
||||||
|
{
|
||||||
|
i++;
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
lethal_grenade = players[ i ] get_player_lethal_grenade();
|
||||||
|
players[ i ] giveweapon( lethal_grenade );
|
||||||
|
players[ i ] setweaponammoclip( lethal_grenade, 4 );
|
||||||
|
}
|
||||||
|
i++;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
get_players_on_meat_team( team )
|
||||||
|
{
|
||||||
|
players = get_players();
|
||||||
|
players_on_team = [];
|
||||||
|
i = 0;
|
||||||
|
while ( i < players.size )
|
||||||
|
{
|
||||||
|
if ( !isDefined( players[ i ]._meat_team ) || players[ i ]._meat_team != team )
|
||||||
|
{
|
||||||
|
i++;
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
players_on_team[ players_on_team.size ] = players[ i ];
|
||||||
|
}
|
||||||
|
i++;
|
||||||
|
}
|
||||||
|
return players_on_team;
|
||||||
|
}
|
||||||
|
|
||||||
|
get_alive_players_on_meat_team( team )
|
||||||
|
{
|
||||||
|
players = get_players();
|
||||||
|
players_on_team = [];
|
||||||
|
i = 0;
|
||||||
|
while ( i < players.size )
|
||||||
|
{
|
||||||
|
if ( !isDefined( players[ i ]._meat_team ) || players[ i ]._meat_team != team )
|
||||||
|
{
|
||||||
|
i++;
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
if ( players[ i ].sessionstate == "spectator" || players[ i ] maps/mp/zombies/_zm_laststand::player_is_in_laststand() )
|
||||||
|
{
|
||||||
|
i++;
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
players_on_team[ players_on_team.size ] = players[ i ];
|
||||||
|
}
|
||||||
|
}
|
||||||
|
i++;
|
||||||
|
}
|
||||||
|
return players_on_team;
|
||||||
|
}
|
||||||
|
|
||||||
|
init_minigun_ring()
|
||||||
|
{
|
||||||
|
if ( isDefined( level._minigun_ring ) )
|
||||||
|
{
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
ring_pos = getstruct( level._meat_location + "_meat_minigun", "script_noteworthy" );
|
||||||
|
if ( !isDefined( ring_pos ) )
|
||||||
|
{
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
level._minigun_ring = spawn( "script_model", ring_pos.origin );
|
||||||
|
level._minigun_ring.angles = ring_pos.angles;
|
||||||
|
level._minigun_ring setmodel( ring_pos.script_parameters );
|
||||||
|
level._minigun_ring_clip = getent( level._meat_location + "_meat_minigun_clip", "script_noteworthy" );
|
||||||
|
if ( isDefined( level._minigun_ring_clip ) )
|
||||||
|
{
|
||||||
|
level._minigun_ring_clip linkto( level._minigun_ring );
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
iprintlnbold( "BUG: no level._minigun_ring_clip" );
|
||||||
|
}
|
||||||
|
level._minigun_ring_trig = getent( level._meat_location + "_meat_minigun_trig", "targetname" );
|
||||||
|
if ( isDefined( level._minigun_ring_trig ) )
|
||||||
|
{
|
||||||
|
level._minigun_ring_trig enablelinkto();
|
||||||
|
level._minigun_ring_trig linkto( level._minigun_ring );
|
||||||
|
level._minigun_icon = spawn( "script_model", level._minigun_ring_trig.origin );
|
||||||
|
level._minigun_icon setmodel( getweaponmodel( "minigun_zm" ) );
|
||||||
|
level._minigun_icon linkto( level._minigun_ring );
|
||||||
|
level._minigun_icon setclientfield( "ring_glowfx", 1 );
|
||||||
|
level thread ring_toss( level._minigun_ring_trig, "minigun" );
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
iprintlnbold( "BUG: no level._minigun_ring_trig" );
|
||||||
|
}
|
||||||
|
level._minigun_ring thread move_ring( ring_pos );
|
||||||
|
level._minigun_ring thread rotate_ring( 1 );
|
||||||
|
}
|
||||||
|
|
||||||
|
init_ammo_ring()
|
||||||
|
{
|
||||||
|
if ( isDefined( level._ammo_ring ) )
|
||||||
|
{
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
name = level._meat_location + "_meat_ammo";
|
||||||
|
ring_pos = getstruct( name, "script_noteworthy" );
|
||||||
|
if ( !isDefined( ring_pos ) )
|
||||||
|
{
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
level._ammo_ring = spawn( "script_model", ring_pos.origin );
|
||||||
|
level._ammo_ring.angles = ring_pos.angles;
|
||||||
|
level._ammo_ring setmodel( ring_pos.script_parameters );
|
||||||
|
name = level._meat_location + "_meat_ammo_clip";
|
||||||
|
level._ammo_ring_clip = getent( name, "script_noteworthy" );
|
||||||
|
if ( isDefined( level._ammo_ring_clip ) )
|
||||||
|
{
|
||||||
|
level._ammo_ring_clip linkto( level._ammo_ring );
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
iprintlnbold( "BUG: no level._ammo_ring_clip" );
|
||||||
|
}
|
||||||
|
name = level._meat_location + "_meat_ammo_trig";
|
||||||
|
level._ammo_ring_trig = getent( name, "targetname" );
|
||||||
|
if ( isDefined( level._ammo_ring_clip ) )
|
||||||
|
{
|
||||||
|
level._ammo_ring_trig enablelinkto();
|
||||||
|
level._ammo_ring_trig linkto( level._ammo_ring );
|
||||||
|
level._ammo_icon = spawn( "script_model", level._ammo_ring_trig.origin );
|
||||||
|
level._ammo_icon setmodel( "zombie_ammocan" );
|
||||||
|
level._ammo_icon linkto( level._ammo_ring );
|
||||||
|
level._ammo_icon setclientfield( "ring_glowfx", 1 );
|
||||||
|
level thread ring_toss( level._ammo_ring_trig, "ammo" );
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
iprintlnbold( "BUG: no level._ammo_ring_trig" );
|
||||||
|
}
|
||||||
|
level._ammo_ring thread move_ring( ring_pos );
|
||||||
|
level._ammo_ring thread rotate_ring( 1 );
|
||||||
|
}
|
||||||
|
|
||||||
|
init_splitter_ring()
|
||||||
|
{
|
||||||
|
if ( isDefined( level._splitter_ring ) )
|
||||||
|
{
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
ring_pos = getstruct( level._meat_location + "_meat_splitter", "script_noteworthy" );
|
||||||
|
if ( !isDefined( ring_pos ) )
|
||||||
|
{
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
level._splitter_ring = spawn( "script_model", ring_pos.origin );
|
||||||
|
level._splitter_ring.angles = ring_pos.angles;
|
||||||
|
level._splitter_ring setmodel( ring_pos.script_parameters );
|
||||||
|
level._splitter_ring_trig1 = getent( level._meat_location + "_meat_splitter_trig_1", "targetname" );
|
||||||
|
level._splitter_ring_trig2 = getent( level._meat_location + "_meat_splitter_trig_2", "targetname" );
|
||||||
|
if ( isDefined( level._splitter_ring_trig1 ) && isDefined( level._splitter_ring_trig2 ) )
|
||||||
|
{
|
||||||
|
level._splitter_ring_trig1 enablelinkto();
|
||||||
|
level._splitter_ring_trig2 enablelinkto();
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
iprintlnbold( "BUG: missing at least one level._splitter_ring_trig" );
|
||||||
|
}
|
||||||
|
level._splitter_ring notsolid();
|
||||||
|
level._meat_icon = spawn( "script_model", level._splitter_ring.origin );
|
||||||
|
level._meat_icon setmodel( getweaponmodel( get_gamemode_var( "item_meat_name" ) ) );
|
||||||
|
level._meat_icon linkto( level._splitter_ring );
|
||||||
|
level._meat_icon setclientfield( "ring_glow_meatfx", 1 );
|
||||||
|
if ( isDefined( level._splitter_ring_trig1 ) && isDefined( level._splitter_ring_trig2 ) )
|
||||||
|
{
|
||||||
|
level._splitter_ring_trig1 linkto( level._splitter_ring );
|
||||||
|
level._splitter_ring_trig2 linkto( level._splitter_ring );
|
||||||
|
level thread ring_toss( level._splitter_ring_trig1, "splitter" );
|
||||||
|
level thread ring_toss( level._splitter_ring_trig2, "splitter" );
|
||||||
|
}
|
||||||
|
level._splitter_ring thread move_ring( ring_pos );
|
||||||
|
}
|
||||||
|
|
||||||
|
ring_toss( trig, type )
|
||||||
|
{
|
||||||
|
level endon( "end_game" );
|
||||||
|
while ( 1 )
|
||||||
|
{
|
||||||
|
while ( isDefined( level._ring_triggered ) && level._ring_triggered )
|
||||||
|
{
|
||||||
|
wait 0,05;
|
||||||
|
}
|
||||||
|
if ( isDefined( level.item_meat ) && isDefined( level.item_meat.meat_is_moving ) && level.item_meat.meat_is_moving )
|
||||||
|
{
|
||||||
|
if ( level.item_meat istouching( trig ) )
|
||||||
|
{
|
||||||
|
level thread ring_toss_prize( type, trig );
|
||||||
|
level._ring_triggered = 1;
|
||||||
|
level thread ring_cooldown();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
wait 0,05;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
ring_cooldown()
|
||||||
|
{
|
||||||
|
wait 3;
|
||||||
|
level._ring_triggered = 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
ring_toss_prize( type, trig )
|
||||||
|
{
|
||||||
|
switch( type )
|
||||||
|
{
|
||||||
|
case "splitter":
|
||||||
|
level thread meat_splitter( trig );
|
||||||
|
break;
|
||||||
|
case "minigun":
|
||||||
|
level thread minigun_prize( trig );
|
||||||
|
break;
|
||||||
|
case "ammo":
|
||||||
|
level thread ammo_prize( trig );
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
meat_splitter( trig )
|
||||||
|
{
|
||||||
|
level endon( "meat_grabbed" );
|
||||||
|
level endon( "meat_kicked" );
|
||||||
|
while ( isDefined( level.item_meat ) && level.item_meat istouching( trig ) )
|
||||||
|
{
|
||||||
|
wait 0,05;
|
||||||
|
}
|
||||||
|
exit_trig = getent( trig.target, "targetname" );
|
||||||
|
exit_struct = getstruct( trig.target, "targetname" );
|
||||||
|
while ( isDefined( level.item_meat ) && !level.item_meat istouching( exit_trig ) )
|
||||||
|
{
|
||||||
|
wait 0,05;
|
||||||
|
}
|
||||||
|
while ( isDefined( level.item_meat ) && level.item_meat istouching( exit_trig ) )
|
||||||
|
{
|
||||||
|
wait 0,05;
|
||||||
|
}
|
||||||
|
if ( !isDefined( level.item_meat ) )
|
||||||
|
{
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
playfx( level._effect[ "fw_burst" ], exit_trig.origin );
|
||||||
|
flare_dir = vectornormalize( anglesToForward( exit_struct.angles ) );
|
||||||
|
velocity = vectorScale( flare_dir, randomintrange( 400, 600 ) );
|
||||||
|
velocity1 = ( velocity[ 0 ] + 75, velocity[ 1 ] + 75, randomintrange( 75, 125 ) );
|
||||||
|
velocity2 = ( velocity[ 0 ] - 75, velocity[ 1 ] - 75, randomintrange( 75, 125 ) );
|
||||||
|
velocity3 = ( velocity[ 0 ], velocity[ 1 ], 100 );
|
||||||
|
level._fake_meats = [];
|
||||||
|
level._meat_splitter_activated = 1;
|
||||||
|
org = exit_trig.origin;
|
||||||
|
player = get_players()[ 0 ];
|
||||||
|
player._spawning_meat = 1;
|
||||||
|
player endon( "disconnect" );
|
||||||
|
thread split_meat( player, org, velocity1, velocity2, velocity );
|
||||||
|
level thread maps/mp/zombies/_zm_audio_announcer::leaderdialog( "meat_ring_splitter", undefined, undefined, 1 );
|
||||||
|
wait 0,1;
|
||||||
|
while ( isDefined( level.splitting_meat ) && level.splitting_meat )
|
||||||
|
{
|
||||||
|
wait 0,05;
|
||||||
|
}
|
||||||
|
player._spawning_meat = 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
split_meat( player, org, vel1, vel2, vel3 )
|
||||||
|
{
|
||||||
|
level.splitting_meat = 1;
|
||||||
|
level.item_meat cleanup_meat();
|
||||||
|
wait_network_frame();
|
||||||
|
level._fake_meats[ level._fake_meats.size ] = player magicgrenadetype( get_gamemode_var( "item_meat_name" ), org, vel1 );
|
||||||
|
wait_network_frame();
|
||||||
|
level._fake_meats[ level._fake_meats.size ] = player magicgrenadetype( get_gamemode_var( "item_meat_name" ), org, vel2 );
|
||||||
|
wait_network_frame();
|
||||||
|
level._fake_meats[ level._fake_meats.size ] = player magicgrenadetype( get_gamemode_var( "item_meat_name" ), org, vel3 );
|
||||||
|
real_meat = random( level._fake_meats );
|
||||||
|
_a330 = level._fake_meats;
|
||||||
|
_k330 = getFirstArrayKey( _a330 );
|
||||||
|
while ( isDefined( _k330 ) )
|
||||||
|
{
|
||||||
|
meat = _a330[ _k330 ];
|
||||||
|
if ( real_meat != meat )
|
||||||
|
{
|
||||||
|
meat._fake_meat = 1;
|
||||||
|
meat thread maps/mp/gametypes_zm/zmeat::delete_on_real_meat_pickup();
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
meat._fake_meat = 0;
|
||||||
|
level.item_meat = meat;
|
||||||
|
}
|
||||||
|
_k330 = getNextArrayKey( _a330, _k330 );
|
||||||
|
}
|
||||||
|
level.splitting_meat = 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
minigun_prize( trig )
|
||||||
|
{
|
||||||
|
while ( isDefined( level.item_meat ) && level.item_meat istouching( trig ) )
|
||||||
|
{
|
||||||
|
wait 0,05;
|
||||||
|
}
|
||||||
|
if ( !isDefined( level.item_meat ) )
|
||||||
|
{
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
if ( isDefined( level._minigun_toss_cooldown ) && level._minigun_toss_cooldown )
|
||||||
|
{
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
level thread minigun_toss_cooldown();
|
||||||
|
if ( !is_player_valid( level._last_person_to_throw_meat ) )
|
||||||
|
{
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
level._last_person_to_throw_meat thread maps/mp/zombies/_zm_powerups::powerup_vo( "minigun" );
|
||||||
|
level thread maps/mp/zombies/_zm_powerups::minigun_weapon_powerup( level._last_person_to_throw_meat );
|
||||||
|
level thread maps/mp/zombies/_zm_audio_announcer::leaderdialog( "meat_ring_minigun", undefined, undefined, 1 );
|
||||||
|
}
|
||||||
|
|
||||||
|
ammo_prize( trig )
|
||||||
|
{
|
||||||
|
while ( isDefined( level.item_meat ) && level.item_meat istouching( trig ) )
|
||||||
|
{
|
||||||
|
wait 0,05;
|
||||||
|
}
|
||||||
|
if ( !isDefined( level.item_meat ) )
|
||||||
|
{
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
if ( isDefined( level._ammo_toss_cooldown ) && level._ammo_toss_cooldown )
|
||||||
|
{
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
playfx( level._effect[ "poltergeist" ], trig.origin );
|
||||||
|
level thread ammo_toss_cooldown();
|
||||||
|
level._last_person_to_throw_meat thread maps/mp/zombies/_zm_powerups::powerup_vo( "full_ammo" );
|
||||||
|
level thread maps/mp/zombies/_zm_powerups::full_ammo_powerup( undefined, level._last_person_to_throw_meat );
|
||||||
|
level thread maps/mp/zombies/_zm_audio_announcer::leaderdialog( "meat_ring_ammo", undefined, undefined, 1 );
|
||||||
|
}
|
||||||
|
|
||||||
|
minigun_toss_cooldown()
|
||||||
|
{
|
||||||
|
level._minigun_toss_cooldown = 1;
|
||||||
|
if ( isDefined( level._minigun_icon ) )
|
||||||
|
{
|
||||||
|
level._minigun_icon delete();
|
||||||
|
}
|
||||||
|
waittill_any_or_timeout( 120, "meat_end" );
|
||||||
|
playfx( level._effect[ "poltergeist" ], level._minigun_ring_trig.origin );
|
||||||
|
level._minigun_icon = spawn( "script_model", level._minigun_ring_trig.origin );
|
||||||
|
level._minigun_icon setmodel( getweaponmodel( "minigun_zm" ) );
|
||||||
|
level._minigun_icon linkto( level._minigun_ring );
|
||||||
|
level._minigun_icon setclientfield( "ring_glowfx", 1 );
|
||||||
|
level._minigun_toss_cooldown = 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
ammo_toss_cooldown()
|
||||||
|
{
|
||||||
|
level._ammo_toss_cooldown = 1;
|
||||||
|
if ( isDefined( level._ammo_icon ) )
|
||||||
|
{
|
||||||
|
level._ammo_icon delete();
|
||||||
|
}
|
||||||
|
waittill_any_or_timeout( 60, "meat_end" );
|
||||||
|
playfx( level._effect[ "poltergeist" ], level._ammo_ring_trig.origin );
|
||||||
|
level._ammo_icon = spawn( "script_model", level._ammo_ring_trig.origin );
|
||||||
|
level._ammo_icon setmodel( "zombie_ammocan" );
|
||||||
|
level._ammo_icon linkto( level._ammo_ring );
|
||||||
|
level._ammo_icon setclientfield( "ring_glowfx", 1 );
|
||||||
|
level._ammo_toss_cooldown = 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
wait_for_team_death( team )
|
||||||
|
{
|
||||||
|
level endon( "meat_end" );
|
||||||
|
encounters_team = undefined;
|
||||||
|
while ( 1 )
|
||||||
|
{
|
||||||
|
wait 1;
|
||||||
|
while ( isDefined( level._checking_for_save ) && level._checking_for_save )
|
||||||
|
{
|
||||||
|
wait 0,1;
|
||||||
|
}
|
||||||
|
alive_team_players = get_alive_players_on_meat_team( team );
|
||||||
|
while ( alive_team_players.size > 0 )
|
||||||
|
{
|
||||||
|
encounters_team = alive_team_players[ 0 ]._encounters_team;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if ( !isDefined( encounters_team ) )
|
||||||
|
{
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
winning_team = "A";
|
||||||
|
if ( encounters_team == "A" )
|
||||||
|
{
|
||||||
|
winning_team = "B";
|
||||||
|
}
|
||||||
|
level notify( "meat_end" );
|
||||||
|
}
|
||||||
|
|
||||||
|
check_should_save_player( team )
|
||||||
|
{
|
||||||
|
if ( !isDefined( level._meat_on_team ) )
|
||||||
|
{
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
level._checking_for_save = 1;
|
||||||
|
players = get_players_on_meat_team( team );
|
||||||
|
i = 0;
|
||||||
|
while ( i < players.size )
|
||||||
|
{
|
||||||
|
player = players[ i ];
|
||||||
|
if ( isDefined( level._last_person_to_throw_meat ) && level._last_person_to_throw_meat == player )
|
||||||
|
{
|
||||||
|
while ( isDefined( level.item_meat.meat_is_moving ) && !level.item_meat.meat_is_moving && isDefined( level._meat_splitter_activated ) || level._meat_splitter_activated && isDefined( level.item_meat.meat_is_flying ) && level.item_meat.meat_is_flying )
|
||||||
|
{
|
||||||
|
if ( level._meat_on_team != player._meat_team )
|
||||||
|
{
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
else if ( isDefined( level.item_meat.meat_is_rolling ) && level.item_meat.meat_is_rolling && level._meat_on_team == player._meat_team )
|
||||||
|
{
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
wait 0,05;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if ( !isDefined( player ) )
|
||||||
|
{
|
||||||
|
level._checking_for_save = 0;
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
if ( isDefined( player.last_damage_from_zombie_or_player ) && !player.last_damage_from_zombie_or_player )
|
||||||
|
{
|
||||||
|
level._checking_for_save = 0;
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
if ( level._meat_on_team != player._meat_team && isDefined( level._last_person_to_throw_meat ) && level._last_person_to_throw_meat == player )
|
||||||
|
{
|
||||||
|
if ( player maps/mp/zombies/_zm_laststand::player_is_in_laststand() )
|
||||||
|
{
|
||||||
|
level thread revive_saved_player( player );
|
||||||
|
return 1;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
i++;
|
||||||
|
}
|
||||||
|
level._checking_for_save = 0;
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
watch_save_player()
|
||||||
|
{
|
||||||
|
if ( !isDefined( level._meat_on_team ) )
|
||||||
|
{
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
if ( !isDefined( level._last_person_to_throw_meat ) || level._last_person_to_throw_meat != self )
|
||||||
|
{
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
level._checking_for_save = 1;
|
||||||
|
while ( isDefined( level.splitting_meat ) || level.splitting_meat && isDefined( level.item_meat ) && isDefined( level.item_meat.meat_is_moving ) || level.item_meat.meat_is_moving && isDefined( level.item_meat.meat_is_flying ) && level.item_meat.meat_is_flying )
|
||||||
|
{
|
||||||
|
if ( level._meat_on_team != self._meat_team )
|
||||||
|
{
|
||||||
|
}
|
||||||
|
else if ( isDefined( level.item_meat ) && isDefined( level.item_meat.meat_is_rolling ) && level.item_meat.meat_is_rolling && level._meat_on_team == self._meat_team )
|
||||||
|
{
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
wait 0,05;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if ( level._meat_on_team != self._meat_team && isDefined( level._last_person_to_throw_meat ) && level._last_person_to_throw_meat == self )
|
||||||
|
{
|
||||||
|
if ( self maps/mp/zombies/_zm_laststand::player_is_in_laststand() )
|
||||||
|
{
|
||||||
|
level thread revive_saved_player( self );
|
||||||
|
return 1;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
level._checking_for_save = 0;
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
revive_saved_player( player )
|
||||||
|
{
|
||||||
|
player endon( "disconnect" );
|
||||||
|
player iprintlnbold( &"ZOMBIE_PLAYER_SAVED" );
|
||||||
|
player playsound( level.zmb_laugh_alias );
|
||||||
|
wait 0,25;
|
||||||
|
playfx( level._effect[ "poltergeist" ], player.origin );
|
||||||
|
playsoundatposition( "zmb_bolt", player.origin );
|
||||||
|
earthquake( 0,5, 0,75, player.origin, 1000 );
|
||||||
|
player thread maps/mp/zombies/_zm_laststand::auto_revive( player );
|
||||||
|
player._saved_by_throw++;
|
||||||
|
level._checking_for_save = 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
get_game_module_players( player )
|
||||||
|
{
|
||||||
|
return get_players_on_meat_team( player._meat_team );
|
||||||
|
}
|
||||||
|
|
||||||
|
item_meat_spawn( origin )
|
||||||
|
{
|
||||||
|
org = origin;
|
||||||
|
player = get_players()[ 0 ];
|
||||||
|
player._spawning_meat = 1;
|
||||||
|
player magicgrenadetype( get_gamemode_var( "item_meat_name" ), org, ( 0, 0, 1 ) );
|
||||||
|
playsoundatposition( "zmb_spawn_powerup", org );
|
||||||
|
wait 0,1;
|
||||||
|
player._spawning_meat = undefined;
|
||||||
|
}
|
||||||
|
|
||||||
|
init_item_meat( gametype )
|
||||||
|
{
|
||||||
|
if ( gametype == "zgrief" )
|
||||||
|
{
|
||||||
|
set_gamemode_var_once( "item_meat_name", "item_meat_zm" );
|
||||||
|
set_gamemode_var_once( "item_meat_model", "t6_wpn_zmb_meat_world" );
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
set_gamemode_var_once( "item_meat_name", "item_head_zm" );
|
||||||
|
set_gamemode_var_once( "item_meat_model", "t6_wpn_zmb_severedhead_world" );
|
||||||
|
}
|
||||||
|
precacheitem( get_gamemode_var( "item_meat_name" ) );
|
||||||
|
set_gamemode_var_once( "start_item_meat_name", get_gamemode_var( "item_meat_name" ) );
|
||||||
|
level.meat_weaponidx = getweaponindexfromname( get_gamemode_var( "item_meat_name" ) );
|
||||||
|
level.meat_pickupsound = getweaponpickupsound( level.meat_weaponidx );
|
||||||
|
level.meat_pickupsoundplayer = getweaponpickupsoundplayer( level.meat_weaponidx );
|
||||||
|
}
|
||||||
|
|
||||||
|
meat_intro( launch_spot )
|
||||||
|
{
|
||||||
|
flag_wait( "start_encounters_match_logic" );
|
||||||
|
wait 3;
|
||||||
|
level thread multi_launch( launch_spot );
|
||||||
|
launch_meat( launch_spot );
|
||||||
|
drop_meat( level._meat_start_point );
|
||||||
|
level thread maps/mp/zombies/_zm_audio_announcer::leaderdialog( "meat_drop", undefined, undefined, 1 );
|
||||||
|
}
|
||||||
|
|
||||||
|
launch_meat( launch_spot )
|
||||||
|
{
|
||||||
|
level waittill( "launch_meat" );
|
||||||
|
spots = getstructarray( launch_spot, "targetname" );
|
||||||
|
if ( isDefined( spots ) && spots.size > 0 )
|
||||||
|
{
|
||||||
|
spot = random( spots );
|
||||||
|
meat = spawn( "script_model", spot.origin );
|
||||||
|
meat setmodel( "tag_origin" );
|
||||||
|
wait_network_frame();
|
||||||
|
playfxontag( level._effect[ "fw_trail" ], meat, "tag_origin" );
|
||||||
|
meat playloopsound( "zmb_souls_loop", 0,75 );
|
||||||
|
dest = spot;
|
||||||
|
while ( isDefined( dest ) && isDefined( dest.target ) )
|
||||||
|
{
|
||||||
|
new_dest = getstruct( dest.target, "targetname" );
|
||||||
|
dest = new_dest;
|
||||||
|
dist = distance( new_dest.origin, meat.origin );
|
||||||
|
time = dist / 700;
|
||||||
|
meat moveto( new_dest.origin, time );
|
||||||
|
meat waittill( "movedone" );
|
||||||
|
}
|
||||||
|
meat playsound( "zmb_souls_end" );
|
||||||
|
playfx( level._effect[ "fw_burst" ], meat.origin );
|
||||||
|
wait randomfloatrange( 0,2, 0,5 );
|
||||||
|
meat playsound( "zmb_souls_end" );
|
||||||
|
playfx( level._effect[ "fw_burst" ], meat.origin + ( randomintrange( 50, 150 ), randomintrange( 50, 150 ), randomintrange( -20, 20 ) ) );
|
||||||
|
wait randomfloatrange( 0,5, 0,75 );
|
||||||
|
meat playsound( "zmb_souls_end" );
|
||||||
|
playfx( level._effect[ "fw_burst" ], meat.origin + ( randomintrange( -150, -50 ), randomintrange( -150, 50 ), randomintrange( -20, 20 ) ) );
|
||||||
|
wait randomfloatrange( 0,5, 0,75 );
|
||||||
|
meat playsound( "zmb_souls_end" );
|
||||||
|
playfx( level._effect[ "fw_burst" ], meat.origin );
|
||||||
|
meat delete();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
multi_launch( launch_spot )
|
||||||
|
{
|
||||||
|
spots = getstructarray( launch_spot, "targetname" );
|
||||||
|
if ( isDefined( spots ) && spots.size > 0 )
|
||||||
|
{
|
||||||
|
x = 0;
|
||||||
|
while ( x < 3 )
|
||||||
|
{
|
||||||
|
i = 0;
|
||||||
|
while ( i < spots.size )
|
||||||
|
{
|
||||||
|
delay = randomfloatrange( 0,1, 0,25 );
|
||||||
|
level thread fake_launch( spots[ i ], delay );
|
||||||
|
i++;
|
||||||
|
}
|
||||||
|
wait randomfloatrange( 0,25, 0,75 );
|
||||||
|
if ( x > 1 )
|
||||||
|
{
|
||||||
|
level notify( "launch_meat" );
|
||||||
|
}
|
||||||
|
x++;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else wait randomfloatrange( 0,25, 0,75 );
|
||||||
|
level notify( "launch_meat" );
|
||||||
|
}
|
||||||
|
|
||||||
|
fake_launch( launch_spot, delay )
|
||||||
|
{
|
||||||
|
wait delay;
|
||||||
|
wait randomfloatrange( 0,1, 4 );
|
||||||
|
meat = spawn( "script_model", launch_spot.origin + ( randomintrange( -60, 60 ), randomintrange( -60, 60 ), 0 ) );
|
||||||
|
meat setmodel( "tag_origin" );
|
||||||
|
wait_network_frame();
|
||||||
|
playfxontag( level._effect[ "fw_trail_cheap" ], meat, "tag_origin" );
|
||||||
|
meat playloopsound( "zmb_souls_loop", 0,75 );
|
||||||
|
dest = launch_spot;
|
||||||
|
while ( isDefined( dest ) && isDefined( dest.target ) )
|
||||||
|
{
|
||||||
|
random_offset = ( randomintrange( -60, 60 ), randomintrange( -60, 60 ), 0 );
|
||||||
|
new_dest = getstruct( dest.target, "targetname" );
|
||||||
|
dest = new_dest;
|
||||||
|
dist = distance( new_dest.origin + random_offset, meat.origin );
|
||||||
|
time = dist / 700;
|
||||||
|
meat moveto( new_dest.origin + random_offset, time );
|
||||||
|
meat waittill( "movedone" );
|
||||||
|
}
|
||||||
|
meat playsound( "zmb_souls_end" );
|
||||||
|
playfx( level._effect[ "fw_pre_burst" ], meat.origin );
|
||||||
|
meat delete();
|
||||||
|
}
|
||||||
|
|
||||||
|
drop_meat( drop_spot )
|
||||||
|
{
|
||||||
|
meat = spawn( "script_model", drop_spot + vectorScale( ( 0, 0, 1 ), 600 ) );
|
||||||
|
meat setmodel( "tag_origin" );
|
||||||
|
dist = distance( meat.origin, drop_spot );
|
||||||
|
time = dist / 400;
|
||||||
|
wait 2;
|
||||||
|
meat moveto( drop_spot, time );
|
||||||
|
wait_network_frame();
|
||||||
|
playfxontag( level._effect[ "fw_drop" ], meat, "tag_origin" );
|
||||||
|
meat waittill( "movedone" );
|
||||||
|
playfx( level._effect[ "fw_impact" ], drop_spot );
|
||||||
|
level notify( "reset_meat" );
|
||||||
|
meat delete();
|
||||||
|
}
|
64
zm_buried_patch/maps/mp/zombies/_zm_game_module_turned.gsc
Normal file
64
zm_buried_patch/maps/mp/zombies/_zm_game_module_turned.gsc
Normal file
@ -0,0 +1,64 @@
|
|||||||
|
#include maps/mp/zombies/_zm_game_module_cleansed;
|
||||||
|
#include maps/mp/zombies/_zm_turned;
|
||||||
|
#include maps/mp/zombies/_zm_utility;
|
||||||
|
#include common_scripts/utility;
|
||||||
|
#include maps/mp/gametypes_zm/_hud_util;
|
||||||
|
#include maps/mp/_utility;
|
||||||
|
|
||||||
|
register_game_module()
|
||||||
|
{
|
||||||
|
level.game_module_turned_index = 6;
|
||||||
|
maps/mp/zombies/_zm_game_module::register_game_module( level.game_module_turned_index, "zturned", ::maps/mp/zombies/_zm_game_module_cleansed::onpreinitgametype, ::onpostinitgametype, undefined, ::maps/mp/zombies/_zm_game_module_cleansed::onspawnzombie, ::maps/mp/zombies/_zm_game_module_cleansed::onstartgametype );
|
||||||
|
}
|
||||||
|
|
||||||
|
register_turned_match( start_func, end_func, name )
|
||||||
|
{
|
||||||
|
if ( !isDefined( level._registered_turned_matches ) )
|
||||||
|
{
|
||||||
|
level._registered_turned_matches = [];
|
||||||
|
}
|
||||||
|
match = spawnstruct();
|
||||||
|
match.match_name = name;
|
||||||
|
match.match_start_func = start_func;
|
||||||
|
match.match_end_func = end_func;
|
||||||
|
level._registered_turned_matches[ level._registered_turned_matches.size ] = match;
|
||||||
|
}
|
||||||
|
|
||||||
|
get_registered_turned_match( name )
|
||||||
|
{
|
||||||
|
_a41 = level._registered_turned_matches;
|
||||||
|
_k41 = getFirstArrayKey( _a41 );
|
||||||
|
while ( isDefined( _k41 ) )
|
||||||
|
{
|
||||||
|
struct = _a41[ _k41 ];
|
||||||
|
if ( struct.match_name == name )
|
||||||
|
{
|
||||||
|
return struct;
|
||||||
|
}
|
||||||
|
_k41 = getNextArrayKey( _a41, _k41 );
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
set_current_turned_match( name )
|
||||||
|
{
|
||||||
|
level._current_turned_match = name;
|
||||||
|
}
|
||||||
|
|
||||||
|
get_current_turned_match()
|
||||||
|
{
|
||||||
|
return level._current_turned_match;
|
||||||
|
}
|
||||||
|
|
||||||
|
init_zombie_weapon()
|
||||||
|
{
|
||||||
|
maps/mp/zombies/_zm_turned::init();
|
||||||
|
}
|
||||||
|
|
||||||
|
onpostinitgametype()
|
||||||
|
{
|
||||||
|
if ( level.scr_zm_game_module != level.game_module_turned_index )
|
||||||
|
{
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
level thread init_zombie_weapon();
|
||||||
|
}
|
46
zm_buried_patch/maps/mp/zombies/_zm_game_module_utility.gsc
Normal file
46
zm_buried_patch/maps/mp/zombies/_zm_game_module_utility.gsc
Normal file
@ -0,0 +1,46 @@
|
|||||||
|
#include maps/mp/zombies/_zm_game_module_meat;
|
||||||
|
#include maps/mp/zombies/_zm_game_module_meat_utility;
|
||||||
|
#include maps/mp/zombies/_zm_utility;
|
||||||
|
#include common_scripts/utility;
|
||||||
|
#include maps/mp/gametypes_zm/_hud_util;
|
||||||
|
#include maps/mp/_utility;
|
||||||
|
|
||||||
|
init_item_meat()
|
||||||
|
{
|
||||||
|
level.item_meat_name = "item_meat_zm";
|
||||||
|
precacheitem( level.item_meat_name );
|
||||||
|
}
|
||||||
|
|
||||||
|
move_ring( ring )
|
||||||
|
{
|
||||||
|
positions = getstructarray( ring.target, "targetname" );
|
||||||
|
positions = array_randomize( positions );
|
||||||
|
level endon( "end_game" );
|
||||||
|
while ( 1 )
|
||||||
|
{
|
||||||
|
_a23 = positions;
|
||||||
|
_k23 = getFirstArrayKey( _a23 );
|
||||||
|
while ( isDefined( _k23 ) )
|
||||||
|
{
|
||||||
|
position = _a23[ _k23 ];
|
||||||
|
self moveto( position.origin, randomintrange( 30, 45 ) );
|
||||||
|
self waittill( "movedone" );
|
||||||
|
_k23 = getNextArrayKey( _a23, _k23 );
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
rotate_ring( forward )
|
||||||
|
{
|
||||||
|
level endon( "end_game" );
|
||||||
|
dir = -360;
|
||||||
|
if ( forward )
|
||||||
|
{
|
||||||
|
dir = 360;
|
||||||
|
}
|
||||||
|
while ( 1 )
|
||||||
|
{
|
||||||
|
self rotateyaw( dir, 9 );
|
||||||
|
wait 9;
|
||||||
|
}
|
||||||
|
}
|
621
zm_buried_patch/maps/mp/zombies/_zm_melee_weapon.gsc
Normal file
621
zm_buried_patch/maps/mp/zombies/_zm_melee_weapon.gsc
Normal file
@ -0,0 +1,621 @@
|
|||||||
|
#include maps/mp/zombies/_zm_audio;
|
||||||
|
#include maps/mp/zombies/_zm_score;
|
||||||
|
#include maps/mp/zombies/_zm_laststand;
|
||||||
|
#include maps/mp/zombies/_zm_weapons;
|
||||||
|
#include maps/mp/zombies/_zm_utility;
|
||||||
|
#include maps/mp/_utility;
|
||||||
|
#include common_scripts/utility;
|
||||||
|
|
||||||
|
init( weapon_name, flourish_weapon_name, ballistic_weapon_name, ballistic_upgraded_weapon_name, cost, wallbuy_targetname, hint_string, vo_dialog_id, flourish_fn )
|
||||||
|
{
|
||||||
|
precacheitem( weapon_name );
|
||||||
|
precacheitem( flourish_weapon_name );
|
||||||
|
add_melee_weapon( weapon_name, flourish_weapon_name, ballistic_weapon_name, ballistic_upgraded_weapon_name, cost, wallbuy_targetname, hint_string, vo_dialog_id, flourish_fn );
|
||||||
|
melee_weapon_triggers = getentarray( wallbuy_targetname, "targetname" );
|
||||||
|
i = 0;
|
||||||
|
while ( i < melee_weapon_triggers.size )
|
||||||
|
{
|
||||||
|
knife_model = getent( melee_weapon_triggers[ i ].target, "targetname" );
|
||||||
|
if ( isDefined( knife_model ) )
|
||||||
|
{
|
||||||
|
knife_model hide();
|
||||||
|
}
|
||||||
|
melee_weapon_triggers[ i ] thread melee_weapon_think( weapon_name, cost, flourish_fn, vo_dialog_id, flourish_weapon_name, ballistic_weapon_name, ballistic_upgraded_weapon_name );
|
||||||
|
if ( isDefined( level.monolingustic_prompt_format ) && !level.monolingustic_prompt_format )
|
||||||
|
{
|
||||||
|
melee_weapon_triggers[ i ] sethintstring( hint_string, cost );
|
||||||
|
if ( getDvarInt( #"1F0A2129" ) && isDefined( level.disable_melee_wallbuy_icons ) && !level.disable_melee_wallbuy_icons )
|
||||||
|
{
|
||||||
|
cursor_hint = "HINT_WEAPON";
|
||||||
|
cursor_hint_weapon = weapon_name;
|
||||||
|
melee_weapon_triggers[ i ] setcursorhint( cursor_hint, cursor_hint_weapon );
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
melee_weapon_triggers[ i ] setcursorhint( "HINT_NOICON" );
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
weapon_display = get_weapon_display_name( weapon_name );
|
||||||
|
hint_string = &"ZOMBIE_WEAPONCOSTONLY";
|
||||||
|
melee_weapon_triggers[ i ] sethintstring( hint_string, weapon_display, cost );
|
||||||
|
if ( getDvarInt( #"1F0A2129" ) && isDefined( level.disable_melee_wallbuy_icons ) && !level.disable_melee_wallbuy_icons )
|
||||||
|
{
|
||||||
|
cursor_hint = "HINT_WEAPON";
|
||||||
|
cursor_hint_weapon = weapon_name;
|
||||||
|
melee_weapon_triggers[ i ] setcursorhint( cursor_hint, cursor_hint_weapon );
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
melee_weapon_triggers[ i ] setcursorhint( "HINT_NOICON" );
|
||||||
|
}
|
||||||
|
}
|
||||||
|
melee_weapon_triggers[ i ] usetriggerrequirelookat();
|
||||||
|
i++;
|
||||||
|
}
|
||||||
|
melee_weapon_structs = getstructarray( wallbuy_targetname, "targetname" );
|
||||||
|
i = 0;
|
||||||
|
while ( i < melee_weapon_structs.size )
|
||||||
|
{
|
||||||
|
prepare_stub( melee_weapon_structs[ i ].trigger_stub, weapon_name, flourish_weapon_name, ballistic_weapon_name, ballistic_upgraded_weapon_name, cost, wallbuy_targetname, hint_string, vo_dialog_id, flourish_fn );
|
||||||
|
i++;
|
||||||
|
}
|
||||||
|
register_melee_weapon_for_level( weapon_name );
|
||||||
|
if ( !isDefined( level.ballistic_weapon_name ) )
|
||||||
|
{
|
||||||
|
level.ballistic_weapon_name = [];
|
||||||
|
}
|
||||||
|
level.ballistic_weapon_name[ weapon_name ] = ballistic_weapon_name;
|
||||||
|
if ( !isDefined( level.ballistic_upgraded_weapon_name ) )
|
||||||
|
{
|
||||||
|
level.ballistic_upgraded_weapon_name = [];
|
||||||
|
}
|
||||||
|
level.ballistic_upgraded_weapon_name[ weapon_name ] = ballistic_upgraded_weapon_name;
|
||||||
|
/#
|
||||||
|
if ( !isDefined( level.zombie_weapons[ weapon_name ] ) )
|
||||||
|
{
|
||||||
|
if ( isDefined( level.devgui_add_weapon ) )
|
||||||
|
{
|
||||||
|
[[ level.devgui_add_weapon ]]( weapon_name, "", weapon_name, cost );
|
||||||
|
#/
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
prepare_stub( stub, weapon_name, flourish_weapon_name, ballistic_weapon_name, ballistic_upgraded_weapon_name, cost, wallbuy_targetname, hint_string, vo_dialog_id, flourish_fn )
|
||||||
|
{
|
||||||
|
if ( isDefined( stub ) )
|
||||||
|
{
|
||||||
|
if ( isDefined( level.monolingustic_prompt_format ) && !level.monolingustic_prompt_format )
|
||||||
|
{
|
||||||
|
stub.hint_string = hint_string;
|
||||||
|
if ( getDvarInt( #"1F0A2129" ) && isDefined( level.disable_melee_wallbuy_icons ) && !level.disable_melee_wallbuy_icons )
|
||||||
|
{
|
||||||
|
stub.cursor_hint = "HINT_WEAPON";
|
||||||
|
stub.cursor_hint_weapon = weapon_name;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
stub.cursor_hint = "HINT_NOICON";
|
||||||
|
stub.cursor_hint_weapon = undefined;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
stub.hint_parm1 = get_weapon_display_name( weapon_name );
|
||||||
|
stub.hint_parm2 = cost;
|
||||||
|
stub.hint_string = &"ZOMBIE_WEAPONCOSTONLY";
|
||||||
|
if ( getDvarInt( #"1F0A2129" ) && isDefined( level.disable_melee_wallbuy_icons ) && !level.disable_melee_wallbuy_icons )
|
||||||
|
{
|
||||||
|
stub.cursor_hint = "HINT_WEAPON";
|
||||||
|
stub.cursor_hint_weapon = weapon_name;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
stub.cursor_hint = "HINT_NOICON";
|
||||||
|
stub.cursor_hint_weapon = undefined;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
stub.cost = cost;
|
||||||
|
stub.weapon_name = weapon_name;
|
||||||
|
stub.vo_dialog_id = vo_dialog_id;
|
||||||
|
stub.flourish_weapon_name = flourish_weapon_name;
|
||||||
|
stub.ballistic_weapon_name = ballistic_weapon_name;
|
||||||
|
stub.ballistic_upgraded_weapon_name = ballistic_upgraded_weapon_name;
|
||||||
|
stub.trigger_func = ::melee_weapon_think;
|
||||||
|
stub.flourish_fn = flourish_fn;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
add_stub( stub, weapon_name )
|
||||||
|
{
|
||||||
|
melee_weapon = undefined;
|
||||||
|
i = 0;
|
||||||
|
while ( i < level._melee_weapons.size )
|
||||||
|
{
|
||||||
|
if ( level._melee_weapons[ i ].weapon_name == weapon_name )
|
||||||
|
{
|
||||||
|
melee_weapon = level._melee_weapons[ i ];
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
i++;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if ( isDefined( stub ) && isDefined( melee_weapon ) )
|
||||||
|
{
|
||||||
|
prepare_stub( stub, melee_weapon.weapon_name, melee_weapon.flourish_weapon_name, melee_weapon.ballistic_weapon_name, melee_weapon.ballistic_upgraded_weapon_name, melee_weapon.cost, melee_weapon.wallbuy_targetname, melee_weapon.hint_string, melee_weapon.vo_dialog_id, melee_weapon.flourish_fn );
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
give_melee_weapon_by_name( weapon_name )
|
||||||
|
{
|
||||||
|
melee_weapon = undefined;
|
||||||
|
i = 0;
|
||||||
|
while ( i < level._melee_weapons.size )
|
||||||
|
{
|
||||||
|
if ( level._melee_weapons[ i ].weapon_name == weapon_name )
|
||||||
|
{
|
||||||
|
melee_weapon = level._melee_weapons[ i ];
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
i++;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if ( isDefined( melee_weapon ) )
|
||||||
|
{
|
||||||
|
self thread give_melee_weapon( melee_weapon.vo_dialog_id, melee_weapon.flourish_weapon_name, melee_weapon.weapon_name, melee_weapon.ballistic_weapon_name, melee_weapon.ballistic_upgraded_weapon_name, melee_weapon.flourish_fn, undefined );
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
add_melee_weapon( weapon_name, flourish_weapon_name, ballistic_weapon_name, ballistic_upgraded_weapon_name, cost, wallbuy_targetname, hint_string, vo_dialog_id, flourish_fn )
|
||||||
|
{
|
||||||
|
melee_weapon = spawnstruct();
|
||||||
|
melee_weapon.weapon_name = weapon_name;
|
||||||
|
melee_weapon.flourish_weapon_name = flourish_weapon_name;
|
||||||
|
melee_weapon.ballistic_weapon_name = ballistic_weapon_name;
|
||||||
|
melee_weapon.ballistic_upgraded_weapon_name = ballistic_upgraded_weapon_name;
|
||||||
|
melee_weapon.cost = cost;
|
||||||
|
melee_weapon.wallbuy_targetname = wallbuy_targetname;
|
||||||
|
melee_weapon.hint_string = hint_string;
|
||||||
|
melee_weapon.vo_dialog_id = vo_dialog_id;
|
||||||
|
melee_weapon.flourish_fn = flourish_fn;
|
||||||
|
if ( !isDefined( level._melee_weapons ) )
|
||||||
|
{
|
||||||
|
level._melee_weapons = [];
|
||||||
|
}
|
||||||
|
level._melee_weapons[ level._melee_weapons.size ] = melee_weapon;
|
||||||
|
}
|
||||||
|
|
||||||
|
player_can_see_weapon_prompt( weapon_name )
|
||||||
|
{
|
||||||
|
if ( is_true( level._allow_melee_weapon_switching ) )
|
||||||
|
{
|
||||||
|
return 1;
|
||||||
|
}
|
||||||
|
if ( isDefined( self get_player_melee_weapon() ) && self hasweapon( self get_player_melee_weapon() ) )
|
||||||
|
{
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
return 1;
|
||||||
|
}
|
||||||
|
|
||||||
|
spectator_respawn_all()
|
||||||
|
{
|
||||||
|
i = 0;
|
||||||
|
while ( i < level._melee_weapons.size )
|
||||||
|
{
|
||||||
|
self spectator_respawn( level._melee_weapons[ i ].wallbuy_targetname, level._melee_weapons[ i ].weapon_name );
|
||||||
|
i++;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
spectator_respawn( wallbuy_targetname, weapon_name )
|
||||||
|
{
|
||||||
|
melee_triggers = getentarray( wallbuy_targetname, "targetname" );
|
||||||
|
players = get_players();
|
||||||
|
i = 0;
|
||||||
|
while ( i < melee_triggers.size )
|
||||||
|
{
|
||||||
|
melee_triggers[ i ] setvisibletoall();
|
||||||
|
while ( isDefined( level._allow_melee_weapon_switching ) && !level._allow_melee_weapon_switching )
|
||||||
|
{
|
||||||
|
j = 0;
|
||||||
|
while ( j < players.size )
|
||||||
|
{
|
||||||
|
if ( !players[ j ] player_can_see_weapon_prompt( weapon_name ) )
|
||||||
|
{
|
||||||
|
melee_triggers[ i ] setinvisibletoplayer( players[ j ] );
|
||||||
|
}
|
||||||
|
j++;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
i++;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
trigger_hide_all()
|
||||||
|
{
|
||||||
|
i = 0;
|
||||||
|
while ( i < level._melee_weapons.size )
|
||||||
|
{
|
||||||
|
self trigger_hide( level._melee_weapons[ i ].wallbuy_targetname );
|
||||||
|
i++;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
trigger_hide( wallbuy_targetname )
|
||||||
|
{
|
||||||
|
melee_triggers = getentarray( wallbuy_targetname, "targetname" );
|
||||||
|
i = 0;
|
||||||
|
while ( i < melee_triggers.size )
|
||||||
|
{
|
||||||
|
melee_triggers[ i ] setinvisibletoplayer( self );
|
||||||
|
i++;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
has_any_ballistic_knife()
|
||||||
|
{
|
||||||
|
if ( self hasweapon( "knife_ballistic_zm" ) )
|
||||||
|
{
|
||||||
|
return 1;
|
||||||
|
}
|
||||||
|
if ( self hasweapon( "knife_ballistic_upgraded_zm" ) )
|
||||||
|
{
|
||||||
|
return 1;
|
||||||
|
}
|
||||||
|
i = 0;
|
||||||
|
while ( i < level._melee_weapons.size )
|
||||||
|
{
|
||||||
|
if ( self hasweapon( level._melee_weapons[ i ].ballistic_weapon_name ) )
|
||||||
|
{
|
||||||
|
return 1;
|
||||||
|
}
|
||||||
|
if ( self hasweapon( level._melee_weapons[ i ].ballistic_upgraded_weapon_name ) )
|
||||||
|
{
|
||||||
|
return 1;
|
||||||
|
}
|
||||||
|
i++;
|
||||||
|
}
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
has_upgraded_ballistic_knife()
|
||||||
|
{
|
||||||
|
if ( self hasweapon( "knife_ballistic_upgraded_zm" ) )
|
||||||
|
{
|
||||||
|
return 1;
|
||||||
|
}
|
||||||
|
i = 0;
|
||||||
|
while ( i < level._melee_weapons.size )
|
||||||
|
{
|
||||||
|
if ( self hasweapon( level._melee_weapons[ i ].ballistic_upgraded_weapon_name ) )
|
||||||
|
{
|
||||||
|
return 1;
|
||||||
|
}
|
||||||
|
i++;
|
||||||
|
}
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
give_ballistic_knife( weapon_string, upgraded )
|
||||||
|
{
|
||||||
|
current_melee_weapon = self get_player_melee_weapon();
|
||||||
|
if ( isDefined( current_melee_weapon ) )
|
||||||
|
{
|
||||||
|
if ( upgraded && isDefined( level.ballistic_upgraded_weapon_name ) && isDefined( level.ballistic_upgraded_weapon_name[ current_melee_weapon ] ) )
|
||||||
|
{
|
||||||
|
weapon_string = level.ballistic_upgraded_weapon_name[ current_melee_weapon ];
|
||||||
|
}
|
||||||
|
if ( !upgraded && isDefined( level.ballistic_weapon_name ) && isDefined( level.ballistic_weapon_name[ current_melee_weapon ] ) )
|
||||||
|
{
|
||||||
|
weapon_string = level.ballistic_weapon_name[ current_melee_weapon ];
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return weapon_string;
|
||||||
|
}
|
||||||
|
|
||||||
|
change_melee_weapon( weapon_name, current_weapon )
|
||||||
|
{
|
||||||
|
current_melee_weapon = self get_player_melee_weapon();
|
||||||
|
if ( isDefined( current_melee_weapon ) && current_melee_weapon != weapon_name )
|
||||||
|
{
|
||||||
|
self takeweapon( current_melee_weapon );
|
||||||
|
unacquire_weapon_toggle( current_melee_weapon );
|
||||||
|
}
|
||||||
|
self set_player_melee_weapon( weapon_name );
|
||||||
|
had_ballistic = 0;
|
||||||
|
had_ballistic_upgraded = 0;
|
||||||
|
ballistic_was_primary = 0;
|
||||||
|
primaryweapons = self getweaponslistprimaries();
|
||||||
|
i = 0;
|
||||||
|
while ( i < primaryweapons.size )
|
||||||
|
{
|
||||||
|
primary_weapon = primaryweapons[ i ];
|
||||||
|
if ( issubstr( primary_weapon, "knife_ballistic_" ) )
|
||||||
|
{
|
||||||
|
had_ballistic = 1;
|
||||||
|
if ( primary_weapon == current_weapon )
|
||||||
|
{
|
||||||
|
ballistic_was_primary = 1;
|
||||||
|
}
|
||||||
|
self notify( "zmb_lost_knife" );
|
||||||
|
self takeweapon( primary_weapon );
|
||||||
|
unacquire_weapon_toggle( primary_weapon );
|
||||||
|
if ( issubstr( primary_weapon, "upgraded" ) )
|
||||||
|
{
|
||||||
|
had_ballistic_upgraded = 1;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
i++;
|
||||||
|
}
|
||||||
|
if ( had_ballistic )
|
||||||
|
{
|
||||||
|
if ( had_ballistic_upgraded )
|
||||||
|
{
|
||||||
|
new_ballistic = level.ballistic_upgraded_weapon_name[ weapon_name ];
|
||||||
|
if ( ballistic_was_primary )
|
||||||
|
{
|
||||||
|
current_weapon = new_ballistic;
|
||||||
|
}
|
||||||
|
self giveweapon( new_ballistic, 0, self maps/mp/zombies/_zm_weapons::get_pack_a_punch_weapon_options( new_ballistic ) );
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
new_ballistic = level.ballistic_weapon_name[ weapon_name ];
|
||||||
|
if ( ballistic_was_primary )
|
||||||
|
{
|
||||||
|
current_weapon = new_ballistic;
|
||||||
|
}
|
||||||
|
self giveweapon( new_ballistic, 0 );
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return current_weapon;
|
||||||
|
}
|
||||||
|
|
||||||
|
melee_weapon_think( weapon_name, cost, flourish_fn, vo_dialog_id, flourish_weapon_name, ballistic_weapon_name, ballistic_upgraded_weapon_name )
|
||||||
|
{
|
||||||
|
self.first_time_triggered = 0;
|
||||||
|
while ( isDefined( self.stub ) )
|
||||||
|
{
|
||||||
|
self endon( "kill_trigger" );
|
||||||
|
if ( isDefined( self.stub.first_time_triggered ) )
|
||||||
|
{
|
||||||
|
self.first_time_triggered = self.stub.first_time_triggered;
|
||||||
|
}
|
||||||
|
weapon_name = self.stub.weapon_name;
|
||||||
|
cost = self.stub.cost;
|
||||||
|
flourish_fn = self.stub.flourish_fn;
|
||||||
|
vo_dialog_id = self.stub.vo_dialog_id;
|
||||||
|
flourish_weapon_name = self.stub.flourish_weapon_name;
|
||||||
|
ballistic_weapon_name = self.stub.ballistic_weapon_name;
|
||||||
|
ballistic_upgraded_weapon_name = self.stub.ballistic_upgraded_weapon_name;
|
||||||
|
players = getplayers();
|
||||||
|
while ( isDefined( level._allow_melee_weapon_switching ) && !level._allow_melee_weapon_switching )
|
||||||
|
{
|
||||||
|
i = 0;
|
||||||
|
while ( i < players.size )
|
||||||
|
{
|
||||||
|
if ( !players[ i ] player_can_see_weapon_prompt( weapon_name ) )
|
||||||
|
{
|
||||||
|
self setinvisibletoplayer( players[ i ] );
|
||||||
|
}
|
||||||
|
i++;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
for ( ;; )
|
||||||
|
{
|
||||||
|
self waittill( "trigger", player );
|
||||||
|
if ( !is_player_valid( player ) )
|
||||||
|
{
|
||||||
|
player thread ignore_triggers( 0,5 );
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
else if ( player in_revive_trigger() )
|
||||||
|
{
|
||||||
|
wait 0,1;
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
else if ( player isthrowinggrenade() )
|
||||||
|
{
|
||||||
|
wait 0,1;
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
else if ( player.is_drinking > 0 )
|
||||||
|
{
|
||||||
|
wait 0,1;
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
else if ( player hasweapon( weapon_name ) || player has_powerup_weapon() )
|
||||||
|
{
|
||||||
|
wait 0,1;
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
if ( player isswitchingweapons() )
|
||||||
|
{
|
||||||
|
wait 0,1;
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
else current_weapon = player getcurrentweapon();
|
||||||
|
if ( !is_placeable_mine( current_weapon ) || is_equipment( current_weapon ) && player has_powerup_weapon() )
|
||||||
|
{
|
||||||
|
wait 0,1;
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
if ( player maps/mp/zombies/_zm_laststand::player_is_in_laststand() || isDefined( player.intermission ) && player.intermission )
|
||||||
|
{
|
||||||
|
wait 0,1;
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
player_has_weapon = player hasweapon( weapon_name );
|
||||||
|
if ( !player_has_weapon )
|
||||||
|
{
|
||||||
|
if ( player.score >= cost )
|
||||||
|
{
|
||||||
|
if ( self.first_time_triggered == 0 )
|
||||||
|
{
|
||||||
|
model = getent( self.target, "targetname" );
|
||||||
|
if ( isDefined( model ) )
|
||||||
|
{
|
||||||
|
model thread melee_weapon_show( player );
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
if ( isDefined( self.clientfieldname ) )
|
||||||
|
{
|
||||||
|
level setclientfield( self.clientfieldname, 1 );
|
||||||
|
}
|
||||||
|
}
|
||||||
|
self.first_time_triggered = 1;
|
||||||
|
if ( isDefined( self.stub ) )
|
||||||
|
{
|
||||||
|
self.stub.first_time_triggered = 1;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
player maps/mp/zombies/_zm_score::minus_to_player_score( cost );
|
||||||
|
bbprint( "zombie_uses", "playername %s playerscore %d round %d cost %d name %s x %f y %f z %f type %s", player.name, player.score, level.round_number, cost, weapon_name, self.origin, "weapon" );
|
||||||
|
player thread give_melee_weapon( vo_dialog_id, flourish_weapon_name, weapon_name, ballistic_weapon_name, ballistic_upgraded_weapon_name, flourish_fn, self );
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
play_sound_on_ent( "no_purchase" );
|
||||||
|
player maps/mp/zombies/_zm_audio::create_and_play_dialog( "general", "no_money_weapon", undefined, 1 );
|
||||||
|
}
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
if ( isDefined( level._allow_melee_weapon_switching ) && !level._allow_melee_weapon_switching )
|
||||||
|
{
|
||||||
|
self setinvisibletoplayer( player );
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
melee_weapon_show( player )
|
||||||
|
{
|
||||||
|
player_angles = vectorToAngle( player.origin - self.origin );
|
||||||
|
player_yaw = player_angles[ 1 ];
|
||||||
|
weapon_yaw = self.angles[ 1 ];
|
||||||
|
yaw_diff = angleClamp180( player_yaw - weapon_yaw );
|
||||||
|
if ( yaw_diff > 0 )
|
||||||
|
{
|
||||||
|
yaw = weapon_yaw - 90;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
yaw = weapon_yaw + 90;
|
||||||
|
}
|
||||||
|
self.og_origin = self.origin;
|
||||||
|
self.origin += anglesToForward( ( 0, yaw, 0 ) ) * 8;
|
||||||
|
wait 0,05;
|
||||||
|
self show();
|
||||||
|
play_sound_at_pos( "weapon_show", self.origin, self );
|
||||||
|
time = 1;
|
||||||
|
self moveto( self.og_origin, time );
|
||||||
|
}
|
||||||
|
|
||||||
|
give_melee_weapon( vo_dialog_id, flourish_weapon_name, weapon_name, ballistic_weapon_name, ballistic_upgraded_weapon_name, flourish_fn, trigger )
|
||||||
|
{
|
||||||
|
if ( isDefined( flourish_fn ) )
|
||||||
|
{
|
||||||
|
self thread [[ flourish_fn ]]();
|
||||||
|
}
|
||||||
|
gun = self do_melee_weapon_flourish_begin( flourish_weapon_name );
|
||||||
|
self maps/mp/zombies/_zm_audio::create_and_play_dialog( "weapon_pickup", vo_dialog_id );
|
||||||
|
self waittill_any( "fake_death", "death", "player_downed", "weapon_change_complete" );
|
||||||
|
self do_melee_weapon_flourish_end( gun, flourish_weapon_name, weapon_name, ballistic_weapon_name, ballistic_upgraded_weapon_name );
|
||||||
|
if ( self maps/mp/zombies/_zm_laststand::player_is_in_laststand() || isDefined( self.intermission ) && self.intermission )
|
||||||
|
{
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
if ( isDefined( level._allow_melee_weapon_switching ) && !level._allow_melee_weapon_switching )
|
||||||
|
{
|
||||||
|
if ( isDefined( trigger ) )
|
||||||
|
{
|
||||||
|
trigger setinvisibletoplayer( self );
|
||||||
|
}
|
||||||
|
self trigger_hide_all();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
do_melee_weapon_flourish_begin( flourish_weapon_name )
|
||||||
|
{
|
||||||
|
self increment_is_drinking();
|
||||||
|
self disable_player_move_states( 1 );
|
||||||
|
gun = self getcurrentweapon();
|
||||||
|
weapon = flourish_weapon_name;
|
||||||
|
self giveweapon( weapon );
|
||||||
|
self switchtoweapon( weapon );
|
||||||
|
return gun;
|
||||||
|
}
|
||||||
|
|
||||||
|
do_melee_weapon_flourish_end( gun, flourish_weapon_name, weapon_name, ballistic_weapon_name, ballistic_upgraded_weapon_name )
|
||||||
|
{
|
||||||
|
/#
|
||||||
|
assert( !is_zombie_perk_bottle( gun ) );
|
||||||
|
#/
|
||||||
|
/#
|
||||||
|
assert( gun != level.revive_tool );
|
||||||
|
#/
|
||||||
|
self enable_player_move_states();
|
||||||
|
weapon = flourish_weapon_name;
|
||||||
|
if ( self maps/mp/zombies/_zm_laststand::player_is_in_laststand() || isDefined( self.intermission ) && self.intermission )
|
||||||
|
{
|
||||||
|
self takeweapon( weapon );
|
||||||
|
self.lastactiveweapon = "none";
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
self takeweapon( weapon );
|
||||||
|
self giveweapon( weapon_name );
|
||||||
|
gun = change_melee_weapon( weapon_name, gun );
|
||||||
|
if ( self hasweapon( "knife_zm" ) )
|
||||||
|
{
|
||||||
|
self takeweapon( "knife_zm" );
|
||||||
|
}
|
||||||
|
if ( self is_multiple_drinking() )
|
||||||
|
{
|
||||||
|
self decrement_is_drinking();
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
else if ( gun == "knife_zm" )
|
||||||
|
{
|
||||||
|
self switchtoweapon( weapon_name );
|
||||||
|
self decrement_is_drinking();
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
else if ( gun != "none" && !is_placeable_mine( gun ) && !is_equipment( gun ) )
|
||||||
|
{
|
||||||
|
self switchtoweapon( gun );
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
primaryweapons = self getweaponslistprimaries();
|
||||||
|
if ( isDefined( primaryweapons ) && primaryweapons.size > 0 )
|
||||||
|
{
|
||||||
|
self switchtoweapon( primaryweapons[ 0 ] );
|
||||||
|
}
|
||||||
|
}
|
||||||
|
self waittill( "weapon_change_complete" );
|
||||||
|
if ( !self maps/mp/zombies/_zm_laststand::player_is_in_laststand() && isDefined( self.intermission ) && !self.intermission )
|
||||||
|
{
|
||||||
|
self decrement_is_drinking();
|
||||||
|
}
|
||||||
|
}
|
139
zm_buried_patch/maps/mp/zombies/_zm_perk_divetonuke.gsc
Normal file
139
zm_buried_patch/maps/mp/zombies/_zm_perk_divetonuke.gsc
Normal file
@ -0,0 +1,139 @@
|
|||||||
|
#include maps/mp/_visionset_mgr;
|
||||||
|
#include maps/mp/zombies/_zm_perks;
|
||||||
|
#include maps/mp/zombies/_zm_net;
|
||||||
|
#include maps/mp/zombies/_zm_utility;
|
||||||
|
#include common_scripts/utility;
|
||||||
|
#include maps/mp/_utility;
|
||||||
|
|
||||||
|
enable_divetonuke_perk_for_level()
|
||||||
|
{
|
||||||
|
maps/mp/zombies/_zm_perks::register_perk_basic_info( "specialty_flakjacket", "divetonuke", 2000, &"ZOMBIE_PERK_DIVETONUKE", "zombie_perk_bottle_nuke" );
|
||||||
|
maps/mp/zombies/_zm_perks::register_perk_precache_func( "specialty_flakjacket", ::divetonuke_precache );
|
||||||
|
maps/mp/zombies/_zm_perks::register_perk_clientfields( "specialty_flakjacket", ::divetonuke_register_clientfield, ::divetonuke_set_clientfield );
|
||||||
|
maps/mp/zombies/_zm_perks::register_perk_machine( "specialty_flakjacket", ::divetonuke_perk_machine_setup, ::divetonuke_perk_machine_think );
|
||||||
|
maps/mp/zombies/_zm_perks::register_perk_host_migration_func( "specialty_flakjacket", ::divetonuke_host_migration_func );
|
||||||
|
}
|
||||||
|
|
||||||
|
init_divetonuke()
|
||||||
|
{
|
||||||
|
level.zombiemode_divetonuke_perk_func = ::divetonuke_explode;
|
||||||
|
maps/mp/_visionset_mgr::vsmgr_register_info( "visionset", "zm_perk_divetonuke", 9000, 400, 5, 1 );
|
||||||
|
level._effect[ "divetonuke_groundhit" ] = loadfx( "maps/zombie/fx_zmb_phdflopper_exp" );
|
||||||
|
set_zombie_var( "zombie_perk_divetonuke_radius", 300 );
|
||||||
|
set_zombie_var( "zombie_perk_divetonuke_min_damage", 1000 );
|
||||||
|
set_zombie_var( "zombie_perk_divetonuke_max_damage", 5000 );
|
||||||
|
}
|
||||||
|
|
||||||
|
divetonuke_precache()
|
||||||
|
{
|
||||||
|
if ( isDefined( level.divetonuke_precache_override_func ) )
|
||||||
|
{
|
||||||
|
[[ level.divetonuke_precache_override_func ]]();
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
precacheitem( "zombie_perk_bottle_nuke" );
|
||||||
|
precacheshader( "specialty_divetonuke_zombies" );
|
||||||
|
precachemodel( "zombie_vending_nuke" );
|
||||||
|
precachemodel( "zombie_vending_nuke_on" );
|
||||||
|
precachestring( &"ZOMBIE_PERK_DIVETONUKE" );
|
||||||
|
level._effect[ "divetonuke_light" ] = loadfx( "misc/fx_zombie_cola_dtap_on" );
|
||||||
|
level.machine_assets[ "divetonuke" ] = spawnstruct();
|
||||||
|
level.machine_assets[ "divetonuke" ].weapon = "zombie_perk_bottle_nuke";
|
||||||
|
level.machine_assets[ "divetonuke" ].off_model = "zombie_vending_nuke";
|
||||||
|
level.machine_assets[ "divetonuke" ].on_model = "zombie_vending_nuke_on";
|
||||||
|
}
|
||||||
|
|
||||||
|
divetonuke_register_clientfield()
|
||||||
|
{
|
||||||
|
registerclientfield( "toplayer", "perk_dive_to_nuke", 9000, 1, "int" );
|
||||||
|
}
|
||||||
|
|
||||||
|
divetonuke_set_clientfield( state )
|
||||||
|
{
|
||||||
|
self setclientfieldtoplayer( "perk_dive_to_nuke", state );
|
||||||
|
}
|
||||||
|
|
||||||
|
divetonuke_perk_machine_setup( use_trigger, perk_machine, bump_trigger, collision )
|
||||||
|
{
|
||||||
|
use_trigger.script_sound = "mus_perks_phd_jingle";
|
||||||
|
use_trigger.script_string = "divetonuke_perk";
|
||||||
|
use_trigger.script_label = "mus_perks_phd_sting";
|
||||||
|
use_trigger.target = "vending_divetonuke";
|
||||||
|
perk_machine.script_string = "divetonuke_perk";
|
||||||
|
perk_machine.targetname = "vending_divetonuke";
|
||||||
|
if ( isDefined( bump_trigger ) )
|
||||||
|
{
|
||||||
|
bump_trigger.script_string = "divetonuke_perk";
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
divetonuke_perk_machine_think()
|
||||||
|
{
|
||||||
|
init_divetonuke();
|
||||||
|
while ( 1 )
|
||||||
|
{
|
||||||
|
machine = getentarray( "vending_divetonuke", "targetname" );
|
||||||
|
machine_triggers = getentarray( "vending_divetonuke", "target" );
|
||||||
|
i = 0;
|
||||||
|
while ( i < machine.size )
|
||||||
|
{
|
||||||
|
machine[ i ] setmodel( level.machine_assets[ "divetonuke" ].off_model );
|
||||||
|
i++;
|
||||||
|
}
|
||||||
|
array_thread( machine_triggers, ::set_power_on, 0 );
|
||||||
|
level thread do_initial_power_off_callback( machine, "divetonuke" );
|
||||||
|
level waittill( "divetonuke_on" );
|
||||||
|
i = 0;
|
||||||
|
while ( i < machine.size )
|
||||||
|
{
|
||||||
|
machine[ i ] setmodel( level.machine_assets[ "divetonuke" ].on_model );
|
||||||
|
machine[ i ] vibrate( vectorScale( ( 0, -1, 0 ), 100 ), 0,3, 0,4, 3 );
|
||||||
|
machine[ i ] playsound( "zmb_perks_power_on" );
|
||||||
|
machine[ i ] thread perk_fx( "divetonuke_light" );
|
||||||
|
machine[ i ] thread play_loop_on_machine();
|
||||||
|
i++;
|
||||||
|
}
|
||||||
|
level notify( "specialty_flakjacket_power_on" );
|
||||||
|
array_thread( machine_triggers, ::set_power_on, 1 );
|
||||||
|
if ( isDefined( level.machine_assets[ "divetonuke" ].power_on_callback ) )
|
||||||
|
{
|
||||||
|
array_thread( machine, level.machine_assets[ "divetonuke" ].power_on_callback );
|
||||||
|
}
|
||||||
|
level waittill( "divetonuke_off" );
|
||||||
|
if ( isDefined( level.machine_assets[ "divetonuke" ].power_off_callback ) )
|
||||||
|
{
|
||||||
|
array_thread( machine, level.machine_assets[ "divetonuke" ].power_off_callback );
|
||||||
|
}
|
||||||
|
array_thread( machine, ::turn_perk_off );
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
divetonuke_host_migration_func()
|
||||||
|
{
|
||||||
|
flop = getentarray( "vending_divetonuke", "targetname" );
|
||||||
|
_a138 = flop;
|
||||||
|
_k138 = getFirstArrayKey( _a138 );
|
||||||
|
while ( isDefined( _k138 ) )
|
||||||
|
{
|
||||||
|
perk = _a138[ _k138 ];
|
||||||
|
if ( isDefined( perk.model ) && perk.model == level.machine_assets[ "divetonuke" ].on_model )
|
||||||
|
{
|
||||||
|
perk perk_fx( undefined, 1 );
|
||||||
|
perk thread perk_fx( "divetonuke_light" );
|
||||||
|
}
|
||||||
|
_k138 = getNextArrayKey( _a138, _k138 );
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
divetonuke_explode( attacker, origin )
|
||||||
|
{
|
||||||
|
radius = level.zombie_vars[ "zombie_perk_divetonuke_radius" ];
|
||||||
|
min_damage = level.zombie_vars[ "zombie_perk_divetonuke_min_damage" ];
|
||||||
|
max_damage = level.zombie_vars[ "zombie_perk_divetonuke_max_damage" ];
|
||||||
|
radiusdamage( origin, radius, max_damage, min_damage, attacker, "MOD_GRENADE_SPLASH" );
|
||||||
|
playfx( level._effect[ "divetonuke_groundhit" ], origin );
|
||||||
|
attacker playsound( "zmb_phdflop_explo" );
|
||||||
|
maps/mp/_visionset_mgr::vsmgr_activate( "visionset", "zm_perk_divetonuke", attacker );
|
||||||
|
wait 1;
|
||||||
|
maps/mp/_visionset_mgr::vsmgr_deactivate( "visionset", "zm_perk_divetonuke", attacker );
|
||||||
|
}
|
1622
zm_buried_patch/maps/mp/zombies/_zm_perk_vulture.gsc
Normal file
1622
zm_buried_patch/maps/mp/zombies/_zm_perk_vulture.gsc
Normal file
File diff suppressed because it is too large
Load Diff
308
zm_buried_patch/maps/mp/zombies/_zm_weap_ballistic_knife.gsc
Normal file
308
zm_buried_patch/maps/mp/zombies/_zm_weap_ballistic_knife.gsc
Normal file
@ -0,0 +1,308 @@
|
|||||||
|
#include maps/mp/zombies/_zm_stats;
|
||||||
|
#include common_scripts/utility;
|
||||||
|
#include maps/mp/_utility;
|
||||||
|
|
||||||
|
init()
|
||||||
|
{
|
||||||
|
if ( !isDefined( level.ballistic_knife_autorecover ) )
|
||||||
|
{
|
||||||
|
level.ballistic_knife_autorecover = 1;
|
||||||
|
}
|
||||||
|
if ( isDefined( level._uses_retrievable_ballisitic_knives ) && level._uses_retrievable_ballisitic_knives == 1 )
|
||||||
|
{
|
||||||
|
precachemodel( "t5_weapon_ballistic_knife_projectile" );
|
||||||
|
precachemodel( "t5_weapon_ballistic_knife_blade_retrieve" );
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
on_spawn( watcher, player )
|
||||||
|
{
|
||||||
|
player endon( "death" );
|
||||||
|
player endon( "disconnect" );
|
||||||
|
player endon( "zmb_lost_knife" );
|
||||||
|
level endon( "game_ended" );
|
||||||
|
self waittill( "stationary", endpos, normal, angles, attacker, prey, bone );
|
||||||
|
isfriendly = 0;
|
||||||
|
if ( isDefined( endpos ) )
|
||||||
|
{
|
||||||
|
retrievable_model = spawn( "script_model", endpos );
|
||||||
|
retrievable_model setmodel( "t5_weapon_ballistic_knife_blade_retrieve" );
|
||||||
|
retrievable_model setowner( player );
|
||||||
|
retrievable_model.owner = player;
|
||||||
|
retrievable_model.angles = angles;
|
||||||
|
retrievable_model.name = watcher.weapon;
|
||||||
|
if ( isDefined( prey ) )
|
||||||
|
{
|
||||||
|
if ( isplayer( prey ) && player.team == prey.team )
|
||||||
|
{
|
||||||
|
isfriendly = 1;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
if ( isai( prey ) && player.team == prey.team )
|
||||||
|
{
|
||||||
|
isfriendly = 1;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if ( !isfriendly )
|
||||||
|
{
|
||||||
|
retrievable_model linkto( prey, bone );
|
||||||
|
retrievable_model thread force_drop_knives_to_ground_on_death( player, prey );
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
if ( isfriendly )
|
||||||
|
{
|
||||||
|
retrievable_model physicslaunch( normal, ( randomint( 10 ), randomint( 10 ), randomint( 10 ) ) );
|
||||||
|
normal = ( 0, 0, 1 );
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
watcher.objectarray[ watcher.objectarray.size ] = retrievable_model;
|
||||||
|
if ( isfriendly )
|
||||||
|
{
|
||||||
|
retrievable_model waittill( "stationary" );
|
||||||
|
}
|
||||||
|
retrievable_model thread drop_knives_to_ground( player );
|
||||||
|
if ( isfriendly )
|
||||||
|
{
|
||||||
|
player notify( "ballistic_knife_stationary" );
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
player notify( "ballistic_knife_stationary" );
|
||||||
|
}
|
||||||
|
retrievable_model thread wait_to_show_glowing_model( prey );
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
wait_to_show_glowing_model( prey )
|
||||||
|
{
|
||||||
|
level endon( "game_ended" );
|
||||||
|
self endon( "death" );
|
||||||
|
wait 2;
|
||||||
|
self setmodel( "t5_weapon_ballistic_knife_blade_retrieve" );
|
||||||
|
}
|
||||||
|
|
||||||
|
on_spawn_retrieve_trigger( watcher, player )
|
||||||
|
{
|
||||||
|
player endon( "death" );
|
||||||
|
player endon( "disconnect" );
|
||||||
|
player endon( "zmb_lost_knife" );
|
||||||
|
level endon( "game_ended" );
|
||||||
|
player waittill( "ballistic_knife_stationary", retrievable_model, normal, prey );
|
||||||
|
if ( !isDefined( retrievable_model ) )
|
||||||
|
{
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
trigger_pos = [];
|
||||||
|
if ( isDefined( prey ) || isplayer( prey ) && isai( prey ) )
|
||||||
|
{
|
||||||
|
trigger_pos[ 0 ] = prey.origin[ 0 ];
|
||||||
|
trigger_pos[ 1 ] = prey.origin[ 1 ];
|
||||||
|
trigger_pos[ 2 ] = prey.origin[ 2 ] + 10;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
trigger_pos[ 0 ] = retrievable_model.origin[ 0 ] + ( 10 * normal[ 0 ] );
|
||||||
|
trigger_pos[ 1 ] = retrievable_model.origin[ 1 ] + ( 10 * normal[ 1 ] );
|
||||||
|
trigger_pos[ 2 ] = retrievable_model.origin[ 2 ] + ( 10 * normal[ 2 ] );
|
||||||
|
}
|
||||||
|
if ( is_true( level.ballistic_knife_autorecover ) )
|
||||||
|
{
|
||||||
|
trigger_pos[ 2 ] -= 50;
|
||||||
|
pickup_trigger = spawn( "trigger_radius", ( trigger_pos[ 0 ], trigger_pos[ 1 ], trigger_pos[ 2 ] ), 0, 50, 100 );
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
pickup_trigger = spawn( "trigger_radius_use", ( trigger_pos[ 0 ], trigger_pos[ 1 ], trigger_pos[ 2 ] ) );
|
||||||
|
pickup_trigger setcursorhint( "HINT_NOICON" );
|
||||||
|
}
|
||||||
|
pickup_trigger.owner = player;
|
||||||
|
retrievable_model.retrievabletrigger = pickup_trigger;
|
||||||
|
hint_string = &"WEAPON_BALLISTIC_KNIFE_PICKUP";
|
||||||
|
if ( isDefined( hint_string ) )
|
||||||
|
{
|
||||||
|
pickup_trigger sethintstring( hint_string );
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
pickup_trigger sethintstring( &"GENERIC_PICKUP" );
|
||||||
|
}
|
||||||
|
pickup_trigger setteamfortrigger( player.team );
|
||||||
|
player clientclaimtrigger( pickup_trigger );
|
||||||
|
pickup_trigger enablelinkto();
|
||||||
|
if ( isDefined( prey ) )
|
||||||
|
{
|
||||||
|
pickup_trigger linkto( prey );
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
pickup_trigger linkto( retrievable_model );
|
||||||
|
}
|
||||||
|
if ( isDefined( level.knife_planted ) )
|
||||||
|
{
|
||||||
|
[[ level.knife_planted ]]( retrievable_model, pickup_trigger, prey );
|
||||||
|
}
|
||||||
|
retrievable_model thread watch_use_trigger( pickup_trigger, retrievable_model, ::pick_up, watcher.weapon, watcher.pickupsoundplayer, watcher.pickupsound );
|
||||||
|
player thread watch_shutdown( pickup_trigger, retrievable_model );
|
||||||
|
}
|
||||||
|
|
||||||
|
debug_print( endpos )
|
||||||
|
{
|
||||||
|
/#
|
||||||
|
self endon( "death" );
|
||||||
|
while ( 1 )
|
||||||
|
{
|
||||||
|
print3d( endpos, "pickup_trigger" );
|
||||||
|
wait 0,05;
|
||||||
|
#/
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
watch_use_trigger( trigger, model, callback, weapon, playersoundonuse, npcsoundonuse )
|
||||||
|
{
|
||||||
|
self endon( "death" );
|
||||||
|
self endon( "delete" );
|
||||||
|
level endon( "game_ended" );
|
||||||
|
max_ammo = weaponmaxammo( weapon ) + 1;
|
||||||
|
autorecover = is_true( level.ballistic_knife_autorecover );
|
||||||
|
while ( 1 )
|
||||||
|
{
|
||||||
|
trigger waittill( "trigger", player );
|
||||||
|
while ( !isalive( player ) )
|
||||||
|
{
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
if ( !player isonground() && !is_true( trigger.force_pickup ) )
|
||||||
|
{
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
if ( isDefined( trigger.triggerteam ) && player.team != trigger.triggerteam )
|
||||||
|
{
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
if ( isDefined( trigger.claimedby ) && player != trigger.claimedby )
|
||||||
|
{
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
ammo_stock = player getweaponammostock( weapon );
|
||||||
|
ammo_clip = player getweaponammoclip( weapon );
|
||||||
|
current_weapon = player getcurrentweapon();
|
||||||
|
total_ammo = ammo_stock + ammo_clip;
|
||||||
|
hasreloaded = 1;
|
||||||
|
if ( total_ammo > 0 && ammo_stock == total_ammo && current_weapon == weapon )
|
||||||
|
{
|
||||||
|
hasreloaded = 0;
|
||||||
|
}
|
||||||
|
if ( total_ammo >= max_ammo || !hasreloaded )
|
||||||
|
{
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
if ( !autorecover && player usebuttonpressed() && !player.throwinggrenade || !player meleebuttonpressed() && is_true( trigger.force_pickup ) )
|
||||||
|
{
|
||||||
|
if ( isDefined( playersoundonuse ) )
|
||||||
|
{
|
||||||
|
player playlocalsound( playersoundonuse );
|
||||||
|
}
|
||||||
|
if ( isDefined( npcsoundonuse ) )
|
||||||
|
{
|
||||||
|
player playsound( npcsoundonuse );
|
||||||
|
}
|
||||||
|
player thread [[ callback ]]( weapon, model, trigger );
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
pick_up( weapon, model, trigger )
|
||||||
|
{
|
||||||
|
if ( self hasweapon( weapon ) )
|
||||||
|
{
|
||||||
|
current_weapon = self getcurrentweapon();
|
||||||
|
if ( current_weapon != weapon )
|
||||||
|
{
|
||||||
|
clip_ammo = self getweaponammoclip( weapon );
|
||||||
|
if ( !clip_ammo )
|
||||||
|
{
|
||||||
|
self setweaponammoclip( weapon, 1 );
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
new_ammo_stock = self getweaponammostock( weapon ) + 1;
|
||||||
|
self setweaponammostock( weapon, new_ammo_stock );
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
new_ammo_stock = self getweaponammostock( weapon ) + 1;
|
||||||
|
self setweaponammostock( weapon, new_ammo_stock );
|
||||||
|
}
|
||||||
|
}
|
||||||
|
self maps/mp/zombies/_zm_stats::increment_client_stat( "ballistic_knives_pickedup" );
|
||||||
|
self maps/mp/zombies/_zm_stats::increment_player_stat( "ballistic_knives_pickedup" );
|
||||||
|
model destroy_ent();
|
||||||
|
trigger destroy_ent();
|
||||||
|
}
|
||||||
|
|
||||||
|
destroy_ent()
|
||||||
|
{
|
||||||
|
if ( isDefined( self ) )
|
||||||
|
{
|
||||||
|
if ( isDefined( self.glowing_model ) )
|
||||||
|
{
|
||||||
|
self.glowing_model delete();
|
||||||
|
}
|
||||||
|
self delete();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
watch_shutdown( trigger, model )
|
||||||
|
{
|
||||||
|
self waittill_any( "death_or_disconnect", "zmb_lost_knife" );
|
||||||
|
trigger destroy_ent();
|
||||||
|
model destroy_ent();
|
||||||
|
}
|
||||||
|
|
||||||
|
drop_knives_to_ground( player )
|
||||||
|
{
|
||||||
|
player endon( "death" );
|
||||||
|
player endon( "zmb_lost_knife" );
|
||||||
|
for ( ;; )
|
||||||
|
{
|
||||||
|
level waittill( "drop_objects_to_ground", origin, radius );
|
||||||
|
if ( distancesquared( origin, self.origin ) < ( radius * radius ) )
|
||||||
|
{
|
||||||
|
self physicslaunch( ( 0, 0, 1 ), vectorScale( ( 0, 0, 1 ), 5 ) );
|
||||||
|
self thread update_retrieve_trigger( player );
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
force_drop_knives_to_ground_on_death( player, prey )
|
||||||
|
{
|
||||||
|
self endon( "death" );
|
||||||
|
player endon( "zmb_lost_knife" );
|
||||||
|
prey waittill( "death" );
|
||||||
|
self unlink();
|
||||||
|
self physicslaunch( ( 0, 0, 1 ), vectorScale( ( 0, 0, 1 ), 5 ) );
|
||||||
|
self thread update_retrieve_trigger( player );
|
||||||
|
}
|
||||||
|
|
||||||
|
update_retrieve_trigger( player )
|
||||||
|
{
|
||||||
|
self endon( "death" );
|
||||||
|
player endon( "zmb_lost_knife" );
|
||||||
|
if ( isDefined( level.custom_update_retrieve_trigger ) )
|
||||||
|
{
|
||||||
|
self [[ level.custom_update_retrieve_trigger ]]( player );
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
self waittill( "stationary" );
|
||||||
|
trigger = self.retrievabletrigger;
|
||||||
|
trigger.origin = ( self.origin[ 0 ], self.origin[ 1 ], self.origin[ 2 ] + 10 );
|
||||||
|
trigger linkto( self );
|
||||||
|
}
|
19
zm_buried_patch/maps/mp/zombies/_zm_weap_bowie.gsc
Normal file
19
zm_buried_patch/maps/mp/zombies/_zm_weap_bowie.gsc
Normal file
@ -0,0 +1,19 @@
|
|||||||
|
#include maps/mp/zombies/_zm_weapons;
|
||||||
|
#include maps/mp/zombies/_zm_utility;
|
||||||
|
#include maps/mp/_utility;
|
||||||
|
#include common_scripts/utility;
|
||||||
|
|
||||||
|
init()
|
||||||
|
{
|
||||||
|
if ( isDefined( level.bowie_cost ) )
|
||||||
|
{
|
||||||
|
cost = level.bowie_cost;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
cost = 3000;
|
||||||
|
}
|
||||||
|
maps/mp/zombies/_zm_melee_weapon::init( "bowie_knife_zm", "zombie_bowie_flourish", "knife_ballistic_bowie_zm", "knife_ballistic_bowie_upgraded_zm", cost, "bowie_upgrade", &"ZOMBIE_WEAPON_BOWIE_BUY", "bowie", undefined );
|
||||||
|
maps/mp/zombies/_zm_weapons::add_retrievable_knife_init_name( "knife_ballistic_bowie" );
|
||||||
|
maps/mp/zombies/_zm_weapons::add_retrievable_knife_init_name( "knife_ballistic_bowie_upgraded" );
|
||||||
|
}
|
476
zm_buried_patch/maps/mp/zombies/_zm_weap_claymore.gsc
Normal file
476
zm_buried_patch/maps/mp/zombies/_zm_weap_claymore.gsc
Normal file
@ -0,0 +1,476 @@
|
|||||||
|
#include maps/mp/gametypes_zm/_weaponobjects;
|
||||||
|
#include maps/mp/zombies/_zm_stats;
|
||||||
|
#include maps/mp/zombies/_zm_weapons;
|
||||||
|
#include maps/mp/zombies/_zm_audio;
|
||||||
|
#include maps/mp/zombies/_zm_score;
|
||||||
|
#include maps/mp/zombies/_zm_equipment;
|
||||||
|
#include maps/mp/zombies/_zm_utility;
|
||||||
|
#include maps/mp/_utility;
|
||||||
|
#include common_scripts/utility;
|
||||||
|
|
||||||
|
init()
|
||||||
|
{
|
||||||
|
if ( !isDefined( level.claymores_max_per_player ) )
|
||||||
|
{
|
||||||
|
level.claymores_max_per_player = 12;
|
||||||
|
}
|
||||||
|
trigs = getentarray( "claymore_purchase", "targetname" );
|
||||||
|
i = 0;
|
||||||
|
while ( i < trigs.size )
|
||||||
|
{
|
||||||
|
model = getent( trigs[ i ].target, "targetname" );
|
||||||
|
if ( isDefined( model ) )
|
||||||
|
{
|
||||||
|
model hide();
|
||||||
|
}
|
||||||
|
i++;
|
||||||
|
}
|
||||||
|
array_thread( trigs, ::buy_claymores );
|
||||||
|
level thread give_claymores_after_rounds();
|
||||||
|
level.claymores_on_damage = ::satchel_damage;
|
||||||
|
level.pickup_claymores = ::pickup_claymores;
|
||||||
|
level.pickup_claymores_trigger_listener = ::pickup_claymores_trigger_listener;
|
||||||
|
level.claymore_detectiondot = cos( 70 );
|
||||||
|
level.claymore_detectionmindist = 20;
|
||||||
|
level._effect[ "claymore_laser" ] = loadfx( "weapon/claymore/fx_claymore_laser" );
|
||||||
|
}
|
||||||
|
|
||||||
|
buy_claymores()
|
||||||
|
{
|
||||||
|
self.zombie_cost = 1000;
|
||||||
|
self sethintstring( &"ZOMBIE_CLAYMORE_PURCHASE" );
|
||||||
|
self setcursorhint( "HINT_WEAPON", "claymore_zm" );
|
||||||
|
self endon( "kill_trigger" );
|
||||||
|
if ( !isDefined( self.stub ) )
|
||||||
|
{
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
if ( isDefined( self.stub ) && !isDefined( self.stub.claymores_triggered ) )
|
||||||
|
{
|
||||||
|
self.stub.claymores_triggered = 0;
|
||||||
|
}
|
||||||
|
self.claymores_triggered = self.stub.claymores_triggered;
|
||||||
|
while ( 1 )
|
||||||
|
{
|
||||||
|
self waittill( "trigger", who );
|
||||||
|
while ( who in_revive_trigger() )
|
||||||
|
{
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
while ( who has_powerup_weapon() )
|
||||||
|
{
|
||||||
|
wait 0,1;
|
||||||
|
}
|
||||||
|
if ( is_player_valid( who ) )
|
||||||
|
{
|
||||||
|
if ( who.score >= self.zombie_cost )
|
||||||
|
{
|
||||||
|
if ( !who is_player_placeable_mine( "claymore_zm" ) )
|
||||||
|
{
|
||||||
|
play_sound_at_pos( "purchase", self.origin );
|
||||||
|
who maps/mp/zombies/_zm_score::minus_to_player_score( self.zombie_cost );
|
||||||
|
who thread claymore_setup();
|
||||||
|
who thread show_claymore_hint( "claymore_purchased" );
|
||||||
|
who thread maps/mp/zombies/_zm_audio::create_and_play_dialog( "weapon_pickup", "grenade" );
|
||||||
|
if ( isDefined( self.stub ) )
|
||||||
|
{
|
||||||
|
self.claymores_triggered = self.stub.claymores_triggered;
|
||||||
|
}
|
||||||
|
if ( self.claymores_triggered == 0 )
|
||||||
|
{
|
||||||
|
model = getent( self.target, "targetname" );
|
||||||
|
if ( isDefined( model ) )
|
||||||
|
{
|
||||||
|
model thread maps/mp/zombies/_zm_weapons::weapon_show( who );
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
if ( isDefined( self.clientfieldname ) )
|
||||||
|
{
|
||||||
|
level setclientfield( self.clientfieldname, 1 );
|
||||||
|
}
|
||||||
|
}
|
||||||
|
self.claymores_triggered = 1;
|
||||||
|
if ( isDefined( self.stub ) )
|
||||||
|
{
|
||||||
|
self.stub.claymores_triggered = 1;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
trigs = getentarray( "claymore_purchase", "targetname" );
|
||||||
|
i = 0;
|
||||||
|
while ( i < trigs.size )
|
||||||
|
{
|
||||||
|
trigs[ i ] setinvisibletoplayer( who );
|
||||||
|
i++;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else who thread show_claymore_hint( "already_purchased" );
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
claymore_unitrigger_update_prompt( player )
|
||||||
|
{
|
||||||
|
if ( player is_player_placeable_mine( "claymore_zm" ) )
|
||||||
|
{
|
||||||
|
self sethintstring( "" );
|
||||||
|
self setcursorhint( "HINT_NOICON" );
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
self sethintstring( &"ZOMBIE_CLAYMORE_PURCHASE" );
|
||||||
|
self setcursorhint( "HINT_WEAPON", "claymore_zm" );
|
||||||
|
return 1;
|
||||||
|
}
|
||||||
|
|
||||||
|
set_claymore_visible()
|
||||||
|
{
|
||||||
|
players = get_players();
|
||||||
|
trigs = getentarray( "claymore_purchase", "targetname" );
|
||||||
|
while ( 1 )
|
||||||
|
{
|
||||||
|
j = 0;
|
||||||
|
while ( j < players.size )
|
||||||
|
{
|
||||||
|
while ( !players[ j ] is_player_placeable_mine( "claymore_zm" ) )
|
||||||
|
{
|
||||||
|
i = 0;
|
||||||
|
while ( i < trigs.size )
|
||||||
|
{
|
||||||
|
trigs[ i ] setinvisibletoplayer( players[ j ], 0 );
|
||||||
|
i++;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
j++;
|
||||||
|
}
|
||||||
|
wait 1;
|
||||||
|
players = get_players();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
claymore_safe_to_plant()
|
||||||
|
{
|
||||||
|
if ( self.owner.claymores.size >= level.claymores_max_per_player )
|
||||||
|
{
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
if ( isDefined( level.claymore_safe_to_plant ) )
|
||||||
|
{
|
||||||
|
return self [[ level.claymore_safe_to_plant ]]();
|
||||||
|
}
|
||||||
|
return 1;
|
||||||
|
}
|
||||||
|
|
||||||
|
claymore_wait_and_detonate()
|
||||||
|
{
|
||||||
|
wait 0,1;
|
||||||
|
self detonate( self.owner );
|
||||||
|
}
|
||||||
|
|
||||||
|
claymore_watch()
|
||||||
|
{
|
||||||
|
self endon( "death" );
|
||||||
|
self notify( "claymore_watch" );
|
||||||
|
self endon( "claymore_watch" );
|
||||||
|
while ( 1 )
|
||||||
|
{
|
||||||
|
self waittill( "grenade_fire", claymore, weapname );
|
||||||
|
if ( weapname == "claymore_zm" )
|
||||||
|
{
|
||||||
|
claymore.owner = self;
|
||||||
|
claymore.team = self.team;
|
||||||
|
self notify( "zmb_enable_claymore_prompt" );
|
||||||
|
if ( claymore claymore_safe_to_plant() )
|
||||||
|
{
|
||||||
|
if ( isDefined( level.claymore_planted ) )
|
||||||
|
{
|
||||||
|
self thread [[ level.claymore_planted ]]( claymore );
|
||||||
|
}
|
||||||
|
claymore thread claymore_detonation();
|
||||||
|
claymore thread play_claymore_effects();
|
||||||
|
self maps/mp/zombies/_zm_stats::increment_client_stat( "claymores_planted" );
|
||||||
|
self maps/mp/zombies/_zm_stats::increment_player_stat( "claymores_planted" );
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
claymore thread claymore_wait_and_detonate();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
claymore_setup()
|
||||||
|
{
|
||||||
|
if ( !isDefined( self.claymores ) )
|
||||||
|
{
|
||||||
|
self.claymores = [];
|
||||||
|
}
|
||||||
|
self thread claymore_watch();
|
||||||
|
self giveweapon( "claymore_zm" );
|
||||||
|
self set_player_placeable_mine( "claymore_zm" );
|
||||||
|
self setactionslot( 4, "weapon", "claymore_zm" );
|
||||||
|
self setweaponammostock( "claymore_zm", 2 );
|
||||||
|
}
|
||||||
|
|
||||||
|
adjust_trigger_origin( origin )
|
||||||
|
{
|
||||||
|
origin += vectorScale( ( 0, 0, 1 ), 20 );
|
||||||
|
return origin;
|
||||||
|
}
|
||||||
|
|
||||||
|
on_spawn_retrieve_trigger( watcher, player )
|
||||||
|
{
|
||||||
|
self maps/mp/gametypes_zm/_weaponobjects::onspawnretrievableweaponobject( watcher, player );
|
||||||
|
if ( isDefined( self.pickuptrigger ) )
|
||||||
|
{
|
||||||
|
self.pickuptrigger sethintlowpriority( 0 );
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
pickup_claymores()
|
||||||
|
{
|
||||||
|
player = self.owner;
|
||||||
|
if ( !player hasweapon( "claymore_zm" ) )
|
||||||
|
{
|
||||||
|
player thread claymore_watch();
|
||||||
|
player giveweapon( "claymore_zm" );
|
||||||
|
player set_player_placeable_mine( "claymore_zm" );
|
||||||
|
player setactionslot( 4, "weapon", "claymore_zm" );
|
||||||
|
player setweaponammoclip( "claymore_zm", 0 );
|
||||||
|
player notify( "zmb_enable_claymore_prompt" );
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
clip_ammo = player getweaponammoclip( self.name );
|
||||||
|
clip_max_ammo = weaponclipsize( self.name );
|
||||||
|
if ( clip_ammo >= clip_max_ammo )
|
||||||
|
{
|
||||||
|
self destroy_ent();
|
||||||
|
player notify( "zmb_disable_claymore_prompt" );
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
self pick_up();
|
||||||
|
clip_ammo = player getweaponammoclip( self.name );
|
||||||
|
clip_max_ammo = weaponclipsize( self.name );
|
||||||
|
if ( clip_ammo >= clip_max_ammo )
|
||||||
|
{
|
||||||
|
player notify( "zmb_disable_claymore_prompt" );
|
||||||
|
}
|
||||||
|
player maps/mp/zombies/_zm_stats::increment_client_stat( "claymores_pickedup" );
|
||||||
|
player maps/mp/zombies/_zm_stats::increment_player_stat( "claymores_pickedup" );
|
||||||
|
}
|
||||||
|
|
||||||
|
pickup_claymores_trigger_listener( trigger, player )
|
||||||
|
{
|
||||||
|
self thread pickup_claymores_trigger_listener_enable( trigger, player );
|
||||||
|
self thread pickup_claymores_trigger_listener_disable( trigger, player );
|
||||||
|
}
|
||||||
|
|
||||||
|
pickup_claymores_trigger_listener_enable( trigger, player )
|
||||||
|
{
|
||||||
|
self endon( "delete" );
|
||||||
|
self endon( "death" );
|
||||||
|
while ( 1 )
|
||||||
|
{
|
||||||
|
player waittill_any( "zmb_enable_claymore_prompt", "spawned_player" );
|
||||||
|
if ( !isDefined( trigger ) )
|
||||||
|
{
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
trigger trigger_on();
|
||||||
|
trigger linkto( self );
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
pickup_claymores_trigger_listener_disable( trigger, player )
|
||||||
|
{
|
||||||
|
self endon( "delete" );
|
||||||
|
self endon( "death" );
|
||||||
|
while ( 1 )
|
||||||
|
{
|
||||||
|
player waittill( "zmb_disable_claymore_prompt" );
|
||||||
|
if ( !isDefined( trigger ) )
|
||||||
|
{
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
trigger unlink();
|
||||||
|
trigger trigger_off();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
shouldaffectweaponobject( object )
|
||||||
|
{
|
||||||
|
pos = self.origin + vectorScale( ( 0, 0, 1 ), 32 );
|
||||||
|
dirtopos = pos - object.origin;
|
||||||
|
objectforward = anglesToForward( object.angles );
|
||||||
|
dist = vectordot( dirtopos, objectforward );
|
||||||
|
if ( dist < level.claymore_detectionmindist )
|
||||||
|
{
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
dirtopos = vectornormalize( dirtopos );
|
||||||
|
dot = vectordot( dirtopos, objectforward );
|
||||||
|
return dot > level.claymore_detectiondot;
|
||||||
|
}
|
||||||
|
|
||||||
|
claymore_detonation()
|
||||||
|
{
|
||||||
|
self endon( "death" );
|
||||||
|
self waittill_not_moving();
|
||||||
|
detonateradius = 96;
|
||||||
|
damagearea = spawn( "trigger_radius", self.origin + ( 0, 0, 0 - detonateradius ), 4, detonateradius, detonateradius * 2 );
|
||||||
|
damagearea setexcludeteamfortrigger( self.team );
|
||||||
|
damagearea enablelinkto();
|
||||||
|
damagearea linkto( self );
|
||||||
|
if ( is_true( self.isonbus ) )
|
||||||
|
{
|
||||||
|
damagearea setmovingplatformenabled( 1 );
|
||||||
|
}
|
||||||
|
self.damagearea = damagearea;
|
||||||
|
self thread delete_claymores_on_death( self.owner, damagearea );
|
||||||
|
self.owner.claymores[ self.owner.claymores.size ] = self;
|
||||||
|
while ( 1 )
|
||||||
|
{
|
||||||
|
damagearea waittill( "trigger", ent );
|
||||||
|
if ( isDefined( self.owner ) && ent == self.owner )
|
||||||
|
{
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
while ( isDefined( ent.pers ) && isDefined( ent.pers[ "team" ] ) && ent.pers[ "team" ] == self.team )
|
||||||
|
{
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
if ( isDefined( ent.ignore_claymore ) && ent.ignore_claymore )
|
||||||
|
{
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
while ( !ent shouldaffectweaponobject( self ) )
|
||||||
|
{
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
if ( ent damageconetrace( self.origin, self ) > 0 )
|
||||||
|
{
|
||||||
|
self playsound( "wpn_claymore_alert" );
|
||||||
|
wait 0,4;
|
||||||
|
if ( isDefined( self.owner ) )
|
||||||
|
{
|
||||||
|
self detonate( self.owner );
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
self detonate( undefined );
|
||||||
|
}
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
delete_claymores_on_death( player, ent )
|
||||||
|
{
|
||||||
|
self waittill( "death" );
|
||||||
|
if ( isDefined( player ) )
|
||||||
|
{
|
||||||
|
arrayremovevalue( player.claymores, self );
|
||||||
|
}
|
||||||
|
wait 0,05;
|
||||||
|
if ( isDefined( ent ) )
|
||||||
|
{
|
||||||
|
ent delete();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
satchel_damage()
|
||||||
|
{
|
||||||
|
self endon( "death" );
|
||||||
|
self setcandamage( 1 );
|
||||||
|
self.health = 100000;
|
||||||
|
self.maxhealth = self.health;
|
||||||
|
attacker = undefined;
|
||||||
|
while ( 1 )
|
||||||
|
{
|
||||||
|
self waittill( "damage", amount, attacker );
|
||||||
|
if ( !isDefined( self ) )
|
||||||
|
{
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
self.health = self.maxhealth;
|
||||||
|
while ( !isplayer( attacker ) )
|
||||||
|
{
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
if ( isDefined( self.owner ) && attacker == self.owner )
|
||||||
|
{
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
while ( isDefined( attacker.pers ) && isDefined( attacker.pers[ "team" ] ) && attacker.pers[ "team" ] != level.zombie_team )
|
||||||
|
{
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if ( level.satchelexplodethisframe )
|
||||||
|
{
|
||||||
|
wait ( 0,1 + randomfloat( 0,4 ) );
|
||||||
|
}
|
||||||
|
else wait 0,05;
|
||||||
|
if ( !isDefined( self ) )
|
||||||
|
{
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
level.satchelexplodethisframe = 1;
|
||||||
|
thread reset_satchel_explode_this_frame();
|
||||||
|
self detonate( attacker );
|
||||||
|
}
|
||||||
|
|
||||||
|
reset_satchel_explode_this_frame()
|
||||||
|
{
|
||||||
|
wait 0,05;
|
||||||
|
level.satchelexplodethisframe = 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
play_claymore_effects()
|
||||||
|
{
|
||||||
|
self endon( "death" );
|
||||||
|
self waittill_not_moving();
|
||||||
|
playfxontag( level._effect[ "claymore_laser" ], self, "tag_fx" );
|
||||||
|
}
|
||||||
|
|
||||||
|
give_claymores_after_rounds()
|
||||||
|
{
|
||||||
|
while ( 1 )
|
||||||
|
{
|
||||||
|
level waittill( "between_round_over" );
|
||||||
|
while ( !level flag_exists( "teleporter_used" ) || !flag( "teleporter_used" ) )
|
||||||
|
{
|
||||||
|
players = get_players();
|
||||||
|
i = 0;
|
||||||
|
while ( i < players.size )
|
||||||
|
{
|
||||||
|
if ( players[ i ] is_player_placeable_mine( "claymore_zm" ) )
|
||||||
|
{
|
||||||
|
players[ i ] giveweapon( "claymore_zm" );
|
||||||
|
players[ i ] set_player_placeable_mine( "claymore_zm" );
|
||||||
|
players[ i ] setactionslot( 4, "weapon", "claymore_zm" );
|
||||||
|
players[ i ] setweaponammoclip( "claymore_zm", 2 );
|
||||||
|
}
|
||||||
|
i++;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
show_claymore_hint( string )
|
||||||
|
{
|
||||||
|
self endon( "death" );
|
||||||
|
self endon( "disconnect" );
|
||||||
|
if ( string == "claymore_purchased" )
|
||||||
|
{
|
||||||
|
text = &"ZOMBIE_CLAYMORE_HOWTO";
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
text = &"ZOMBIE_CLAYMORE_ALREADY_PURCHASED";
|
||||||
|
}
|
||||||
|
show_equipment_hint_text( text );
|
||||||
|
}
|
120
zm_buried_patch/maps/mp/zombies/_zm_weap_tazer_knuckles.gsc
Normal file
120
zm_buried_patch/maps/mp/zombies/_zm_weap_tazer_knuckles.gsc
Normal file
@ -0,0 +1,120 @@
|
|||||||
|
#include maps/mp/zombies/_zm_audio;
|
||||||
|
#include maps/mp/zombies/_zm_spawner;
|
||||||
|
#include maps/mp/zombies/_zm_weapons;
|
||||||
|
#include maps/mp/zombies/_zm_net;
|
||||||
|
#include maps/mp/zombies/_zm_utility;
|
||||||
|
#include maps/mp/_utility;
|
||||||
|
#include common_scripts/utility;
|
||||||
|
|
||||||
|
init()
|
||||||
|
{
|
||||||
|
registerclientfield( "toplayer", "tazer_flourish", 1, 1, "int" );
|
||||||
|
register_melee_weapon_for_level( "tazer_knuckles_zm" );
|
||||||
|
if ( isDefined( level.tazer_cost ) )
|
||||||
|
{
|
||||||
|
cost = level.tazer_cost;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
cost = 6000;
|
||||||
|
}
|
||||||
|
level.use_tazer_impact_fx = 0;
|
||||||
|
maps/mp/zombies/_zm_melee_weapon::init( "tazer_knuckles_zm", "zombie_tazer_flourish", "knife_ballistic_no_melee_zm", "knife_ballistic_no_melee_upgraded_zm", cost, "tazer_upgrade", &"ZOMBIE_WEAPON_TAZER_BUY", "tazerknuckles", ::tazer_flourish_fx );
|
||||||
|
maps/mp/zombies/_zm_weapons::add_retrievable_knife_init_name( "knife_ballistic_no_melee" );
|
||||||
|
maps/mp/zombies/_zm_weapons::add_retrievable_knife_init_name( "knife_ballistic_no_melee_upgraded" );
|
||||||
|
maps/mp/zombies/_zm_spawner::add_cusom_zombie_spawn_logic( ::watch_bodily_functions );
|
||||||
|
level._effect[ "fx_zmb_taser_vomit" ] = loadfx( "maps/zombie/fx_zmb_taser_vomit" );
|
||||||
|
level._effect[ "fx_zmb_taser_flourish" ] = loadfx( "weapon/taser/fx_taser_knuckles_anim_zmb" );
|
||||||
|
if ( level.script != "zm_transit" )
|
||||||
|
{
|
||||||
|
level._effect[ "fx_zmb_tazer_impact" ] = loadfx( "weapon/taser/fx_taser_knuckles_impact_zmb" );
|
||||||
|
level.use_tazer_impact_fx = 1;
|
||||||
|
}
|
||||||
|
level.tazer_flourish_delay = 0,5;
|
||||||
|
}
|
||||||
|
|
||||||
|
watch_bodily_functions()
|
||||||
|
{
|
||||||
|
if ( isDefined( self.isscreecher ) || self.isscreecher && isDefined( self.is_avogadro ) && self.is_avogadro )
|
||||||
|
{
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
while ( isDefined( self ) && isalive( self ) )
|
||||||
|
{
|
||||||
|
self waittill( "damage", amount, attacker, direction_vec, point, type );
|
||||||
|
if ( !isDefined( self ) )
|
||||||
|
{
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
if ( !isDefined( attacker ) || !isplayer( attacker ) )
|
||||||
|
{
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
while ( type != "MOD_MELEE" )
|
||||||
|
{
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
if ( !attacker hasweapon( "tazer_knuckles_zm" ) || isDefined( self.hasriotshieldequipped ) && self.hasriotshieldequipped )
|
||||||
|
{
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
ch = randomint( 100 );
|
||||||
|
if ( ch < 4 )
|
||||||
|
{
|
||||||
|
playfxontag( level._effect[ "fx_zmb_taser_vomit" ], self, "j_neck" );
|
||||||
|
}
|
||||||
|
if ( level.use_tazer_impact_fx )
|
||||||
|
{
|
||||||
|
tags = [];
|
||||||
|
tags[ 0 ] = "J_Head";
|
||||||
|
tags[ 1 ] = "J_Neck";
|
||||||
|
playfxontag( level._effect[ "fx_zmb_tazer_impact" ], self, random( tags ) );
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
onplayerconnect()
|
||||||
|
{
|
||||||
|
self thread onplayerspawned();
|
||||||
|
}
|
||||||
|
|
||||||
|
onplayerspawned()
|
||||||
|
{
|
||||||
|
self endon( "disconnect" );
|
||||||
|
for ( ;; )
|
||||||
|
{
|
||||||
|
self waittill( "spawned_player" );
|
||||||
|
self thread watchtazerknucklemelee();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
watchtazerknucklemelee()
|
||||||
|
{
|
||||||
|
self endon( "disconnect" );
|
||||||
|
for ( ;; )
|
||||||
|
{
|
||||||
|
self waittill( "weapon_melee", weapon );
|
||||||
|
if ( weapon == "tazer_knuckles_zm" )
|
||||||
|
{
|
||||||
|
self tazerknuckle_melee();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
tazerknuckle_melee()
|
||||||
|
{
|
||||||
|
}
|
||||||
|
|
||||||
|
tazer_flourish_fx()
|
||||||
|
{
|
||||||
|
self waittill( "weapon_change", newweapon );
|
||||||
|
if ( newweapon == "zombie_tazer_flourish" )
|
||||||
|
{
|
||||||
|
self endon( "weapon_change" );
|
||||||
|
wait level.tazer_flourish_delay;
|
||||||
|
self thread maps/mp/zombies/_zm_audio::playerexert( "hitmed" );
|
||||||
|
self setclientfieldtoplayer( "tazer_flourish", 1 );
|
||||||
|
wait_network_frame();
|
||||||
|
self setclientfieldtoplayer( "tazer_flourish", 0 );
|
||||||
|
}
|
||||||
|
}
|
2329
zm_buried_patch/maps/mp/zombies/_zm_weap_time_bomb.gsc
Normal file
2329
zm_buried_patch/maps/mp/zombies/_zm_weap_time_bomb.gsc
Normal file
File diff suppressed because it is too large
Load Diff
338
zm_buried_patch/maps/mp/zombies/_zm_weapon_locker.gsc
Normal file
338
zm_buried_patch/maps/mp/zombies/_zm_weapon_locker.gsc
Normal file
@ -0,0 +1,338 @@
|
|||||||
|
#include maps/mp/zombies/_zm_audio;
|
||||||
|
#include maps/mp/zombies/_zm_unitrigger;
|
||||||
|
#include maps/mp/zombies/_zm_stats;
|
||||||
|
#include maps/mp/zombies/_zm_magicbox;
|
||||||
|
#include maps/mp/zombies/_zm_utility;
|
||||||
|
#include maps/mp/_utility;
|
||||||
|
#include common_scripts/utility;
|
||||||
|
|
||||||
|
main()
|
||||||
|
{
|
||||||
|
if ( !isDefined( level.weapon_locker_map ) )
|
||||||
|
{
|
||||||
|
level.weapon_locker_map = level.script;
|
||||||
|
}
|
||||||
|
level.weapon_locker_online = sessionmodeisonlinegame();
|
||||||
|
weapon_lockers = getstructarray( "weapons_locker", "targetname" );
|
||||||
|
array_thread( weapon_lockers, ::triggerweaponslockerwatch );
|
||||||
|
}
|
||||||
|
|
||||||
|
wl_has_stored_weapondata()
|
||||||
|
{
|
||||||
|
if ( level.weapon_locker_online )
|
||||||
|
{
|
||||||
|
return self has_stored_weapondata( level.weapon_locker_map );
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
return isDefined( self.stored_weapon_data );
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
wl_get_stored_weapondata()
|
||||||
|
{
|
||||||
|
if ( level.weapon_locker_online )
|
||||||
|
{
|
||||||
|
return self get_stored_weapondata( level.weapon_locker_map );
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
return self.stored_weapon_data;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
wl_clear_stored_weapondata()
|
||||||
|
{
|
||||||
|
if ( level.weapon_locker_online )
|
||||||
|
{
|
||||||
|
self clear_stored_weapondata( level.weapon_locker_map );
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
self.stored_weapon_data = undefined;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
wl_set_stored_weapondata( weapondata )
|
||||||
|
{
|
||||||
|
if ( level.weapon_locker_online )
|
||||||
|
{
|
||||||
|
self set_stored_weapondata( weapondata, level.weapon_locker_map );
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
self.stored_weapon_data = weapondata;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
triggerweaponslockerwatch()
|
||||||
|
{
|
||||||
|
unitrigger_stub = spawnstruct();
|
||||||
|
unitrigger_stub.origin = self.origin;
|
||||||
|
if ( isDefined( self.script_angles ) )
|
||||||
|
{
|
||||||
|
unitrigger_stub.angles = self.script_angles;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
unitrigger_stub.angles = self.angles;
|
||||||
|
}
|
||||||
|
unitrigger_stub.script_angles = unitrigger_stub.angles;
|
||||||
|
if ( isDefined( self.script_length ) )
|
||||||
|
{
|
||||||
|
unitrigger_stub.script_length = self.script_length;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
unitrigger_stub.script_length = 16;
|
||||||
|
}
|
||||||
|
if ( isDefined( self.script_width ) )
|
||||||
|
{
|
||||||
|
unitrigger_stub.script_width = self.script_width;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
unitrigger_stub.script_width = 32;
|
||||||
|
}
|
||||||
|
if ( isDefined( self.script_height ) )
|
||||||
|
{
|
||||||
|
unitrigger_stub.script_height = self.script_height;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
unitrigger_stub.script_height = 64;
|
||||||
|
}
|
||||||
|
unitrigger_stub.origin -= anglesToRight( unitrigger_stub.angles ) * ( unitrigger_stub.script_length / 2 );
|
||||||
|
unitrigger_stub.targetname = "weapon_locker";
|
||||||
|
unitrigger_stub.cursor_hint = "HINT_NOICON";
|
||||||
|
unitrigger_stub.script_unitrigger_type = "unitrigger_box_use";
|
||||||
|
unitrigger_stub.clientfieldname = "weapon_locker";
|
||||||
|
maps/mp/zombies/_zm_unitrigger::unitrigger_force_per_player_triggers( unitrigger_stub, 1 );
|
||||||
|
unitrigger_stub.prompt_and_visibility_func = ::triggerweaponslockerthinkupdateprompt;
|
||||||
|
maps/mp/zombies/_zm_unitrigger::register_static_unitrigger( unitrigger_stub, ::triggerweaponslockerthink );
|
||||||
|
}
|
||||||
|
|
||||||
|
triggerweaponslockerisvalidweapon( weaponname )
|
||||||
|
{
|
||||||
|
weaponname = get_base_weapon_name( weaponname, 1 );
|
||||||
|
if ( !is_weapon_included( weaponname ) )
|
||||||
|
{
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
if ( is_offhand_weapon( weaponname ) || is_limited_weapon( weaponname ) )
|
||||||
|
{
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
return 1;
|
||||||
|
}
|
||||||
|
|
||||||
|
triggerweaponslockerisvalidweaponpromptupdate( player, weaponname )
|
||||||
|
{
|
||||||
|
retrievingweapon = player wl_has_stored_weapondata();
|
||||||
|
if ( !retrievingweapon )
|
||||||
|
{
|
||||||
|
weaponname = player get_nonalternate_weapon( weaponname );
|
||||||
|
if ( !triggerweaponslockerisvalidweapon( weaponname ) )
|
||||||
|
{
|
||||||
|
self sethintstring( &"ZOMBIE_WEAPON_LOCKER_DENY" );
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
self sethintstring( &"ZOMBIE_WEAPON_LOCKER_STORE" );
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
weapondata = player wl_get_stored_weapondata();
|
||||||
|
if ( isDefined( level.remap_weapon_locker_weapons ) )
|
||||||
|
{
|
||||||
|
weapondata = remap_weapon( weapondata, level.remap_weapon_locker_weapons );
|
||||||
|
}
|
||||||
|
weapontogive = weapondata[ "name" ];
|
||||||
|
primaries = player getweaponslistprimaries();
|
||||||
|
maxweapons = get_player_weapon_limit( player );
|
||||||
|
weaponname = player get_nonalternate_weapon( weaponname );
|
||||||
|
if ( isDefined( primaries ) || primaries.size >= maxweapons && weapontogive == weaponname )
|
||||||
|
{
|
||||||
|
if ( !triggerweaponslockerisvalidweapon( weaponname ) )
|
||||||
|
{
|
||||||
|
self sethintstring( &"ZOMBIE_WEAPON_LOCKER_DENY" );
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
self sethintstring( &"ZOMBIE_WEAPON_LOCKER_GRAB" );
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
triggerweaponslockerthinkupdateprompt( player )
|
||||||
|
{
|
||||||
|
self triggerweaponslockerisvalidweaponpromptupdate( player, player getcurrentweapon() );
|
||||||
|
return 1;
|
||||||
|
}
|
||||||
|
|
||||||
|
triggerweaponslockerthink()
|
||||||
|
{
|
||||||
|
self.parent_player thread triggerweaponslockerweaponchangethink( self );
|
||||||
|
while ( 1 )
|
||||||
|
{
|
||||||
|
self waittill( "trigger", player );
|
||||||
|
retrievingweapon = player wl_has_stored_weapondata();
|
||||||
|
if ( !retrievingweapon )
|
||||||
|
{
|
||||||
|
curweapon = player getcurrentweapon();
|
||||||
|
curweapon = player maps/mp/zombies/_zm_weapons::switch_from_alt_weapon( curweapon );
|
||||||
|
while ( !triggerweaponslockerisvalidweapon( curweapon ) )
|
||||||
|
{
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
weapondata = player maps/mp/zombies/_zm_weapons::get_player_weapondata( player );
|
||||||
|
player wl_set_stored_weapondata( weapondata );
|
||||||
|
/#
|
||||||
|
assert( curweapon == weapondata[ "name" ], "weapon data does not match" );
|
||||||
|
#/
|
||||||
|
player takeweapon( curweapon );
|
||||||
|
primaries = player getweaponslistprimaries();
|
||||||
|
if ( isDefined( primaries[ 0 ] ) )
|
||||||
|
{
|
||||||
|
player switchtoweapon( primaries[ 0 ] );
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
player maps/mp/zombies/_zm_weapons::give_fallback_weapon();
|
||||||
|
}
|
||||||
|
self triggerweaponslockerisvalidweaponpromptupdate( player, player getcurrentweapon() );
|
||||||
|
player playsoundtoplayer( "evt_fridge_locker_close", player );
|
||||||
|
player thread maps/mp/zombies/_zm_audio::create_and_play_dialog( "general", "weapon_storage" );
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
curweapon = player getcurrentweapon();
|
||||||
|
primaries = player getweaponslistprimaries();
|
||||||
|
weapondata = player wl_get_stored_weapondata();
|
||||||
|
if ( isDefined( level.remap_weapon_locker_weapons ) )
|
||||||
|
{
|
||||||
|
weapondata = remap_weapon( weapondata, level.remap_weapon_locker_weapons );
|
||||||
|
}
|
||||||
|
weapontogive = weapondata[ "name" ];
|
||||||
|
while ( !triggerweaponslockerisvalidweapon( weapontogive ) )
|
||||||
|
{
|
||||||
|
player playlocalsound( level.zmb_laugh_alias );
|
||||||
|
player wl_clear_stored_weapondata();
|
||||||
|
self triggerweaponslockerisvalidweaponpromptupdate( player, player getcurrentweapon() );
|
||||||
|
}
|
||||||
|
curweap_base = maps/mp/zombies/_zm_weapons::get_base_weapon_name( curweapon, 1 );
|
||||||
|
weap_base = maps/mp/zombies/_zm_weapons::get_base_weapon_name( weapontogive, 1 );
|
||||||
|
while ( player has_weapon_or_upgrade( weap_base ) && weap_base != curweap_base )
|
||||||
|
{
|
||||||
|
self sethintstring( &"ZOMBIE_WEAPON_LOCKER_DENY" );
|
||||||
|
wait 3;
|
||||||
|
self triggerweaponslockerisvalidweaponpromptupdate( player, player getcurrentweapon() );
|
||||||
|
}
|
||||||
|
maxweapons = get_player_weapon_limit( player );
|
||||||
|
if ( isDefined( primaries ) || primaries.size >= maxweapons && weapontogive == curweapon )
|
||||||
|
{
|
||||||
|
curweapon = player maps/mp/zombies/_zm_weapons::switch_from_alt_weapon( curweapon );
|
||||||
|
while ( !triggerweaponslockerisvalidweapon( curweapon ) )
|
||||||
|
{
|
||||||
|
self sethintstring( &"ZOMBIE_WEAPON_LOCKER_DENY" );
|
||||||
|
wait 3;
|
||||||
|
self triggerweaponslockerisvalidweaponpromptupdate( player, player getcurrentweapon() );
|
||||||
|
}
|
||||||
|
curweapondata = player maps/mp/zombies/_zm_weapons::get_player_weapondata( player );
|
||||||
|
player takeweapon( curweapondata[ "name" ] );
|
||||||
|
player maps/mp/zombies/_zm_weapons::weapondata_give( weapondata );
|
||||||
|
player wl_clear_stored_weapondata();
|
||||||
|
player wl_set_stored_weapondata( curweapondata );
|
||||||
|
player switchtoweapon( weapondata[ "name" ] );
|
||||||
|
self triggerweaponslockerisvalidweaponpromptupdate( player, player getcurrentweapon() );
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
player thread maps/mp/zombies/_zm_audio::create_and_play_dialog( "general", "wall_withdrawl" );
|
||||||
|
player wl_clear_stored_weapondata();
|
||||||
|
player maps/mp/zombies/_zm_weapons::weapondata_give( weapondata );
|
||||||
|
player switchtoweapon( weapondata[ "name" ] );
|
||||||
|
self triggerweaponslockerisvalidweaponpromptupdate( player, player getcurrentweapon() );
|
||||||
|
}
|
||||||
|
level notify( "weapon_locker_grab" );
|
||||||
|
player playsoundtoplayer( "evt_fridge_locker_open", player );
|
||||||
|
}
|
||||||
|
wait 0,5;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
triggerweaponslockerweaponchangethink( trigger )
|
||||||
|
{
|
||||||
|
self endon( "disconnect" );
|
||||||
|
self endon( "death" );
|
||||||
|
trigger endon( "kill_trigger" );
|
||||||
|
while ( 1 )
|
||||||
|
{
|
||||||
|
self waittill( "weapon_change", newweapon );
|
||||||
|
trigger triggerweaponslockerisvalidweaponpromptupdate( self, newweapon );
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
add_weapon_locker_mapping( fromweapon, toweapon )
|
||||||
|
{
|
||||||
|
if ( !isDefined( level.remap_weapon_locker_weapons ) )
|
||||||
|
{
|
||||||
|
level.remap_weapon_locker_weapons = [];
|
||||||
|
}
|
||||||
|
level.remap_weapon_locker_weapons[ fromweapon ] = toweapon;
|
||||||
|
}
|
||||||
|
|
||||||
|
remap_weapon( weapondata, maptable )
|
||||||
|
{
|
||||||
|
name = get_base_name( weapondata[ "name" ] );
|
||||||
|
att = get_attachment_name( weapondata[ "name" ] );
|
||||||
|
if ( isDefined( maptable[ name ] ) )
|
||||||
|
{
|
||||||
|
weapondata[ "name" ] = maptable[ name ];
|
||||||
|
name = weapondata[ "name" ];
|
||||||
|
if ( is_weapon_upgraded( name ) )
|
||||||
|
{
|
||||||
|
if ( isDefined( att ) && weapon_supports_attachments( name ) )
|
||||||
|
{
|
||||||
|
base = get_base_weapon_name( name, 1 );
|
||||||
|
if ( !weapon_supports_this_attachment( base, att ) )
|
||||||
|
{
|
||||||
|
att = random_attachment( base );
|
||||||
|
}
|
||||||
|
weapondata[ "name" ] = weapondata[ "name" ] + "+" + att;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
if ( weapon_supports_default_attachment( name ) )
|
||||||
|
{
|
||||||
|
att = default_attachment( name );
|
||||||
|
weapondata[ "name" ] = weapondata[ "name" ] + "+" + att;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
return weapondata;
|
||||||
|
}
|
||||||
|
name = weapondata[ "name" ];
|
||||||
|
dw_name = weapondualwieldweaponname( name );
|
||||||
|
alt_name = weaponaltweaponname( name );
|
||||||
|
if ( name != "none" )
|
||||||
|
{
|
||||||
|
weapondata[ "clip" ] = int( min( weapondata[ "clip" ], weaponclipsize( name ) ) );
|
||||||
|
weapondata[ "stock" ] = int( min( weapondata[ "stock" ], weaponmaxammo( name ) ) );
|
||||||
|
}
|
||||||
|
if ( dw_name != "none" )
|
||||||
|
{
|
||||||
|
weapondata[ "lh_clip" ] = int( min( weapondata[ "lh_clip" ], weaponclipsize( dw_name ) ) );
|
||||||
|
}
|
||||||
|
if ( alt_name != "none" )
|
||||||
|
{
|
||||||
|
weapondata[ "alt_clip" ] = int( min( weapondata[ "alt_clip" ], weaponclipsize( alt_name ) ) );
|
||||||
|
weapondata[ "alt_stock" ] = int( min( weapondata[ "alt_stock" ], weaponmaxammo( alt_name ) ) );
|
||||||
|
}
|
||||||
|
weapondata[ "dw_name" ] = dw_name;
|
||||||
|
weapondata[ "alt_name" ] = alt_name;
|
||||||
|
return weapondata;
|
||||||
|
}
|
@ -17,7 +17,75 @@ zm_buried_patch/maps/mp/zombies/_zm_weap_slowgun.gsc
|
|||||||
### The following scripts are not tested yet, uploaded to setup a baseline:
|
### The following scripts are not tested yet, uploaded to setup a baseline:
|
||||||
```
|
```
|
||||||
```
|
```
|
||||||
|
### The following scripts have been checked, but they have not been tested yet
|
||||||
|
```
|
||||||
|
|
||||||
|
```
|
||||||
|
### The following scripts are not checked yet, uploaded to setup a baseline:
|
||||||
|
```
|
||||||
|
zm_buried_patch/maps/mp/zm_buried.gsc
|
||||||
|
zm_buried_patch/maps/mp/zm_buried_achievement.gsc
|
||||||
|
zm_buried_patch/maps/mp/zm_buried_amb.gsc
|
||||||
|
zm_buried_patch/maps/mp/zm_buried_buildables.gsc
|
||||||
|
zm_buried_patch/maps/mp/zm_buried_classic.gsc
|
||||||
|
zm_buried_patch/maps/mp/zm_buried_distance_tracking.gsc
|
||||||
|
zm_buried_patch/maps/mp/zm_buried_ee.gsc
|
||||||
|
zm_buried_patch/maps/mp/zm_buried_ffotd.gsc
|
||||||
|
zm_buried_patch/maps/mp/zm_buried_fountain.gsc
|
||||||
|
zm_buried_patch/maps/mp/zm_buried_fx.gsc
|
||||||
|
zm_buried_patch/maps/mp/zm_buried_gamemodes.gsc
|
||||||
|
zm_buried_patch/maps/mp/zm_buried_grief_street.gsc
|
||||||
|
zm_buried_patch/maps/mp/zm_buried_jail.gsc
|
||||||
|
zm_buried_patch/maps/mp/zm_buried_maze.gsc
|
||||||
|
zm_buried_patch/maps/mp/zm_buried_power.gsc
|
||||||
|
zm_buried_patch/maps/mp/zm_buried_sq.gsc
|
||||||
|
zm_buried_patch/maps/mp/zm_buried_sq_bt.gsc
|
||||||
|
zm_buried_patch/maps/mp/zm_buried_sq_ctw.gsc
|
||||||
|
zm_buried_patch/maps/mp/zm_buried_sq_ftl.gsc
|
||||||
|
zm_buried_patch/maps/mp/zm_buried_sq_gl.gsc
|
||||||
|
zm_buried_patch/maps/mp/zm_buried_sq_ip.gsc
|
||||||
|
zm_buried_patch/maps/mp/zm_buried_sq_ll.gsc
|
||||||
|
zm_buried_patch/maps/mp/zm_buried_sq_mta.gsc
|
||||||
|
zm_buried_patch/maps/mp/zm_buried_sq_ows.gsc
|
||||||
|
zm_buried_patch/maps/mp/zm_buried_sq_tpo.gsc
|
||||||
|
zm_buried_patch/maps/mp/zm_buried_sq_ts.gsc
|
||||||
|
zm_buried_patch/maps/mp/zm_buried_standard.gsc
|
||||||
|
zm_buried_patch/maps/mp/zm_buried_turned_street.gsc
|
||||||
|
|
||||||
|
zm_buried_patch/maps/mp/gametypes_zm/zcleansed.gsc
|
||||||
|
zm_buried_patch/maps/mp/gametypes_zm/zgrief.gsc
|
||||||
|
zm_buried_patch/maps/mp/gametypes_zm/zmeat.gsc
|
||||||
|
zm_buried_patch/maps/mp/gametypes_zm/zstandard.gsc
|
||||||
|
|
||||||
|
zm_buried_patch/maps/mp/teams/_teamset_cdc.gsc
|
||||||
|
|
||||||
|
zm_buried_patch/maps/mp/zombies/_zm_ai_ghost.gsc
|
||||||
|
zm_buried_patch/maps/mp/zombies/_zm_ai_ghost_ffotd.gsc
|
||||||
|
zm_buried_patch/maps/mp/zombies/_zm_ai_sloth.gsc
|
||||||
|
zm_buried_patch/maps/mp/zombies/_zm_ai_sloth_buildables.gsc
|
||||||
|
zm_buried_patch/maps/mp/zombies/_zm_ai_sloth_crawler.gsc
|
||||||
|
zm_buried_patch/maps/mp/zombies/_zm_ai_sloth_ffotd.gsc
|
||||||
|
zm_buried_patch/maps/mp/zombies/_zm_ai_sloth_magicbox.gsc
|
||||||
|
zm_buried_patch/maps/mp/zombies/_zm_ai_sloth_utility.gsc
|
||||||
|
zm_buried_patch/maps/mp/zombies/_zm_banking.gsc
|
||||||
|
zm_buried_patch/maps/mp/zombies/_zm_buildables_pooled.gsc
|
||||||
|
zm_buried_patch/maps/mp/zombies/_zm_equip_headchopper.gsc
|
||||||
|
zm_buried_patch/maps/mp/zombies/_zm_equip_springpad.gsc
|
||||||
|
zm_buried_patch/maps/mp/zombies/_zm_equip_subwoofer.gsc
|
||||||
|
zm_buried_patch/maps/mp/zombies/_zm_game_module_cleansed.gsc
|
||||||
|
zm_buried_patch/maps/mp/zombies/_zm_game_module_grief.gsc
|
||||||
|
zm_buried_patch/maps/mp/zombies/_zm_game_module_meat.gsc
|
||||||
|
zm_buried_patch/maps/mp/zombies/_zm_game_module_meat_utility.gsc
|
||||||
|
zm_buried_patch/maps/mp/zombies/_zm_game_module_turned.gsc
|
||||||
|
zm_buried_patch/maps/mp/zombies/_zm_game_module_utility.gsc
|
||||||
|
zm_buried_patch/maps/mp/zombies/_zm_melee_weapon.gsc
|
||||||
|
zm_buried_patch/maps/mp/zombies/_zm_perk_divetonuke.gsc
|
||||||
|
zm_buried_patch/maps/mp/zombies/_zm_perk_vulture.gsc
|
||||||
|
zm_buried_patch/maps/mp/zombies/_zm_weap_ballistic_knife.gsc
|
||||||
|
zm_buried_patch/maps/mp/zombies/_zm_weap_tazer_knuckles.gsc
|
||||||
|
zm_buried_patch/maps/mp/zombies/_zm_weap_tomb_bomb.gsc
|
||||||
|
zm_buried_patch/maps/mp/zombies/_zm_weapon_locker.gsc
|
||||||
|
```
|
||||||
### notes:
|
### notes:
|
||||||
```
|
```
|
||||||
```
|
```
|
||||||
|
Loading…
x
Reference in New Issue
Block a user