mirror of
https://github.com/JezuzLizard/BO2-Reimagined.git
synced 2025-06-07 21:59:49 -05:00
Optimize move perk machine code
Directly change the structs instead of removing and adding the machines
This commit is contained in:
parent
8da5e2df27
commit
71c2f09994
@ -69,9 +69,6 @@ main()
|
|||||||
deleteslothbarricades();
|
deleteslothbarricades();
|
||||||
|
|
||||||
disable_tunnels();
|
disable_tunnels();
|
||||||
move_quickrevive_machine();
|
|
||||||
move_speedcola_machine();
|
|
||||||
move_staminup_machine();
|
|
||||||
|
|
||||||
powerswitchstate( 1 );
|
powerswitchstate( 1 );
|
||||||
level.enemy_location_override_func = ::enemy_location_override;
|
level.enemy_location_override_func = ::enemy_location_override;
|
||||||
@ -309,286 +306,4 @@ disable_tunnels()
|
|||||||
spawn_point.locked = 1;
|
spawn_point.locked = 1;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
move_quickrevive_machine()
|
|
||||||
{
|
|
||||||
if (level.scr_zm_map_start_location != "street")
|
|
||||||
{
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
perk_struct = undefined;
|
|
||||||
perk_location_struct = undefined;
|
|
||||||
structs = getstructarray("zm_perk_machine", "targetname");
|
|
||||||
foreach (struct in structs)
|
|
||||||
{
|
|
||||||
if (IsDefined(struct.script_noteworthy) && IsDefined(struct.script_string))
|
|
||||||
{
|
|
||||||
if (struct.script_noteworthy == "specialty_quickrevive" && IsSubStr(struct.script_string, "zgrief"))
|
|
||||||
{
|
|
||||||
perk_struct = struct;
|
|
||||||
}
|
|
||||||
else if (struct.script_noteworthy == "specialty_fastreload" && IsSubStr(struct.script_string, "zgrief"))
|
|
||||||
{
|
|
||||||
perk_location_struct = struct;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
if(!IsDefined(perk_struct) || !IsDefined(perk_location_struct))
|
|
||||||
{
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
// delete old machine
|
|
||||||
vending_triggers = getentarray( "zombie_vending", "targetname" );
|
|
||||||
for (i = 0; i < vending_trigger.size; i++)
|
|
||||||
{
|
|
||||||
trig = vending_triggers[i];
|
|
||||||
if (IsDefined(trig.script_noteworthy) && trig.script_noteworthy == "specialty_quickrevive")
|
|
||||||
{
|
|
||||||
trig.clip delete();
|
|
||||||
trig.machine delete();
|
|
||||||
trig.bump delete();
|
|
||||||
trig delete();
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
// spawn new machine
|
|
||||||
perk_location_struct.origin += (0, -32, 0); // fix for location being off
|
|
||||||
use_trigger = spawn( "trigger_radius_use", perk_location_struct.origin + vectorScale( ( 0, 0, 1 ), 30 ), 0, 40, 70 );
|
|
||||||
use_trigger.targetname = "zombie_vending";
|
|
||||||
use_trigger.script_noteworthy = perk_struct.script_noteworthy;
|
|
||||||
use_trigger triggerignoreteam();
|
|
||||||
perk_machine = spawn( "script_model", perk_location_struct.origin );
|
|
||||||
perk_machine.angles = perk_location_struct.angles;
|
|
||||||
perk_machine setmodel( perk_struct.model );
|
|
||||||
bump_trigger = spawn( "trigger_radius", perk_location_struct.origin + AnglesToRight(perk_location_struct.angles) * 32, 0, 35, 32 );
|
|
||||||
bump_trigger.script_activated = 1;
|
|
||||||
bump_trigger.script_sound = "zmb_perks_bump_bottle";
|
|
||||||
bump_trigger.targetname = "audio_bump_trigger";
|
|
||||||
bump_trigger thread maps/mp/zombies/_zm_perks::thread_bump_trigger();
|
|
||||||
collision = spawn( "script_model", perk_location_struct.origin, 1 );
|
|
||||||
collision.angles = perk_location_struct.angles;
|
|
||||||
collision setmodel( "zm_collision_perks1" );
|
|
||||||
collision.script_noteworthy = "clip";
|
|
||||||
collision disconnectpaths();
|
|
||||||
use_trigger.clip = collision;
|
|
||||||
use_trigger.machine = perk_machine;
|
|
||||||
use_trigger.bump = bump_trigger;
|
|
||||||
if ( isDefined( perk_struct.blocker_model ) )
|
|
||||||
{
|
|
||||||
use_trigger.blocker_model = perk_struct.blocker_model;
|
|
||||||
}
|
|
||||||
if ( isDefined( perk_struct.script_int ) )
|
|
||||||
{
|
|
||||||
perk_machine.script_int = perk_struct.script_int;
|
|
||||||
}
|
|
||||||
if ( isDefined( perk_struct.turn_on_notify ) )
|
|
||||||
{
|
|
||||||
perk_machine.turn_on_notify = perk_struct.turn_on_notify;
|
|
||||||
}
|
|
||||||
|
|
||||||
use_trigger.script_sound = "mus_perks_revive_jingle";
|
|
||||||
use_trigger.script_string = "revive_perk";
|
|
||||||
use_trigger.script_label = "mus_perks_revive_sting";
|
|
||||||
use_trigger.target = "vending_revive";
|
|
||||||
perk_machine.script_string = "revive_perk";
|
|
||||||
perk_machine.targetname = "vending_revive";
|
|
||||||
bump_trigger.script_string = "revive_perk";
|
|
||||||
|
|
||||||
level thread maps/mp/zombies/_zm_perks::turn_revive_on();
|
|
||||||
use_trigger thread maps/mp/zombies/_zm_perks::vending_trigger_think();
|
|
||||||
use_trigger thread maps/mp/zombies/_zm_perks::electric_perks_dialog();
|
|
||||||
|
|
||||||
powered_on = maps/mp/zombies/_zm_perks::get_perk_machine_start_state( use_trigger.script_noteworthy );
|
|
||||||
maps/mp/zombies/_zm_power::add_powered_item( maps/mp/zombies/_zm_power::perk_power_on, maps/mp/zombies/_zm_power::perk_power_off, maps/mp/zombies/_zm_power::perk_range, maps/mp/zombies/_zm_power::cost_low_if_local, 0, powered_on, use_trigger );
|
|
||||||
}
|
|
||||||
|
|
||||||
move_speedcola_machine()
|
|
||||||
{
|
|
||||||
if (level.scr_zm_map_start_location != "street")
|
|
||||||
{
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
perk_struct = undefined;
|
|
||||||
structs = getstructarray("zm_perk_machine", "targetname");
|
|
||||||
foreach (struct in structs)
|
|
||||||
{
|
|
||||||
if (IsDefined(struct.script_noteworthy) && IsDefined(struct.script_string))
|
|
||||||
{
|
|
||||||
if (struct.script_noteworthy == "specialty_fastreload" && IsSubStr(struct.script_string, "zclassic"))
|
|
||||||
{
|
|
||||||
perk_struct = struct;
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
if(!IsDefined(perk_struct))
|
|
||||||
{
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
// delete old machine
|
|
||||||
vending_triggers = getentarray( "zombie_vending", "targetname" );
|
|
||||||
for (i = 0; i < vending_trigger.size; i++)
|
|
||||||
{
|
|
||||||
trig = vending_triggers[i];
|
|
||||||
if (IsDefined(trig.script_noteworthy) && trig.script_noteworthy == "specialty_fastreload")
|
|
||||||
{
|
|
||||||
trig.clip delete();
|
|
||||||
trig.machine delete();
|
|
||||||
trig.bump delete();
|
|
||||||
trig delete();
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
// spawn new machine
|
|
||||||
use_trigger = spawn( "trigger_radius_use", perk_struct.origin + vectorScale( ( 0, 0, 1 ), 30 ), 0, 40, 70 );
|
|
||||||
use_trigger.targetname = "zombie_vending";
|
|
||||||
use_trigger.script_noteworthy = perk_struct.script_noteworthy;
|
|
||||||
use_trigger triggerignoreteam();
|
|
||||||
perk_machine = spawn( "script_model", perk_struct.origin );
|
|
||||||
perk_machine.angles = perk_struct.angles;
|
|
||||||
perk_machine setmodel( perk_struct.model );
|
|
||||||
bump_trigger = spawn( "trigger_radius", perk_struct.origin + AnglesToRight(perk_struct.angles) * 32, 0, 35, 32 );
|
|
||||||
bump_trigger.script_activated = 1;
|
|
||||||
bump_trigger.script_sound = "zmb_perks_bump_bottle";
|
|
||||||
bump_trigger.targetname = "audio_bump_trigger";
|
|
||||||
bump_trigger thread maps/mp/zombies/_zm_perks::thread_bump_trigger();
|
|
||||||
collision = spawn( "script_model", perk_struct.origin, 1 );
|
|
||||||
collision.angles = perk_struct.angles;
|
|
||||||
collision setmodel( "zm_collision_perks1" );
|
|
||||||
collision.script_noteworthy = "clip";
|
|
||||||
collision disconnectpaths();
|
|
||||||
use_trigger.clip = collision;
|
|
||||||
use_trigger.machine = perk_machine;
|
|
||||||
use_trigger.bump = bump_trigger;
|
|
||||||
if ( isDefined( perk_struct.blocker_model ) )
|
|
||||||
{
|
|
||||||
use_trigger.blocker_model = perk_struct.blocker_model;
|
|
||||||
}
|
|
||||||
if ( isDefined( perk_struct.script_int ) )
|
|
||||||
{
|
|
||||||
perk_machine.script_int = perk_struct.script_int;
|
|
||||||
}
|
|
||||||
if ( isDefined( perk_struct.turn_on_notify ) )
|
|
||||||
{
|
|
||||||
perk_machine.turn_on_notify = perk_struct.turn_on_notify;
|
|
||||||
}
|
|
||||||
|
|
||||||
use_trigger.script_sound = "mus_perks_speed_jingle";
|
|
||||||
use_trigger.script_string = "speedcola_perk";
|
|
||||||
use_trigger.script_label = "mus_perks_speed_sting";
|
|
||||||
use_trigger.target = "vending_sleight";
|
|
||||||
perk_machine.script_string = "speedcola_perk";
|
|
||||||
perk_machine.targetname = "vending_sleight";
|
|
||||||
bump_trigger.script_string = "speedcola_perk";
|
|
||||||
|
|
||||||
level thread maps/mp/zombies/_zm_perks::turn_sleight_on();
|
|
||||||
use_trigger thread maps/mp/zombies/_zm_perks::vending_trigger_think();
|
|
||||||
use_trigger thread maps/mp/zombies/_zm_perks::electric_perks_dialog();
|
|
||||||
|
|
||||||
powered_on = maps/mp/zombies/_zm_perks::get_perk_machine_start_state( use_trigger.script_noteworthy );
|
|
||||||
maps/mp/zombies/_zm_power::add_powered_item( maps/mp/zombies/_zm_power::perk_power_on, maps/mp/zombies/_zm_power::perk_power_off, maps/mp/zombies/_zm_power::perk_range, maps/mp/zombies/_zm_power::cost_low_if_local, 0, powered_on, use_trigger );
|
|
||||||
}
|
|
||||||
|
|
||||||
move_staminup_machine()
|
|
||||||
{
|
|
||||||
if (level.scr_zm_map_start_location != "street")
|
|
||||||
{
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
perk_struct = undefined;
|
|
||||||
perk_location_struct = undefined;
|
|
||||||
structs = getstructarray("zm_perk_machine", "targetname");
|
|
||||||
foreach (struct in structs)
|
|
||||||
{
|
|
||||||
if (IsDefined(struct.script_noteworthy) && IsDefined(struct.script_string))
|
|
||||||
{
|
|
||||||
if (struct.script_noteworthy == "specialty_longersprint" && IsSubStr(struct.script_string, "zgrief"))
|
|
||||||
{
|
|
||||||
perk_struct = struct;
|
|
||||||
}
|
|
||||||
else if (struct.script_noteworthy == "specialty_quickrevive" && IsSubStr(struct.script_string, "zgrief"))
|
|
||||||
{
|
|
||||||
perk_location_struct = struct;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
if(!IsDefined(perk_struct) || !IsDefined(perk_location_struct))
|
|
||||||
{
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
// delete old machine
|
|
||||||
vending_triggers = getentarray( "zombie_vending", "targetname" );
|
|
||||||
for (i = 0; i < vending_trigger.size; i++)
|
|
||||||
{
|
|
||||||
trig = vending_triggers[i];
|
|
||||||
if (IsDefined(trig.script_noteworthy) && trig.script_noteworthy == "specialty_longersprint")
|
|
||||||
{
|
|
||||||
trig.clip delete();
|
|
||||||
trig.machine delete();
|
|
||||||
trig.bump delete();
|
|
||||||
trig delete();
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
// spawn new machine
|
|
||||||
use_trigger = spawn( "trigger_radius_use", perk_location_struct.origin + vectorScale( ( 0, 0, 1 ), 30 ), 0, 40, 70 );
|
|
||||||
use_trigger.targetname = "zombie_vending";
|
|
||||||
use_trigger.script_noteworthy = perk_struct.script_noteworthy;
|
|
||||||
use_trigger triggerignoreteam();
|
|
||||||
perk_machine = spawn( "script_model", perk_location_struct.origin );
|
|
||||||
perk_machine.angles = perk_location_struct.angles;
|
|
||||||
perk_machine setmodel( perk_struct.model );
|
|
||||||
bump_trigger = spawn( "trigger_radius", perk_location_struct.origin + AnglesToRight(perk_location_struct.angles) * 32, 0, 35, 32 );
|
|
||||||
bump_trigger.script_activated = 1;
|
|
||||||
bump_trigger.script_sound = "zmb_perks_bump_bottle";
|
|
||||||
bump_trigger.targetname = "audio_bump_trigger";
|
|
||||||
bump_trigger thread maps/mp/zombies/_zm_perks::thread_bump_trigger();
|
|
||||||
collision = spawn( "script_model", perk_location_struct.origin, 1 );
|
|
||||||
collision.angles = perk_location_struct.angles;
|
|
||||||
collision setmodel( "zm_collision_perks1" );
|
|
||||||
collision.script_noteworthy = "clip";
|
|
||||||
collision disconnectpaths();
|
|
||||||
use_trigger.clip = collision;
|
|
||||||
use_trigger.machine = perk_machine;
|
|
||||||
use_trigger.bump = bump_trigger;
|
|
||||||
if ( isDefined( perk_struct.blocker_model ) )
|
|
||||||
{
|
|
||||||
use_trigger.blocker_model = perk_struct.blocker_model;
|
|
||||||
}
|
|
||||||
if ( isDefined( perk_struct.script_int ) )
|
|
||||||
{
|
|
||||||
perk_machine.script_int = perk_struct.script_int;
|
|
||||||
}
|
|
||||||
if ( isDefined( perk_struct.turn_on_notify ) )
|
|
||||||
{
|
|
||||||
perk_machine.turn_on_notify = perk_struct.turn_on_notify;
|
|
||||||
}
|
|
||||||
|
|
||||||
use_trigger.script_sound = "mus_perks_stamin_jingle";
|
|
||||||
use_trigger.script_string = "marathon_perk";
|
|
||||||
use_trigger.script_label = "mus_perks_stamin_sting";
|
|
||||||
use_trigger.target = "vending_marathon";
|
|
||||||
perk_machine.script_string = "marathon_perk";
|
|
||||||
perk_machine.targetname = "vending_marathon";
|
|
||||||
bump_trigger.script_string = "marathon_perk";
|
|
||||||
|
|
||||||
level thread maps/mp/zombies/_zm_perks::turn_marathon_on();
|
|
||||||
use_trigger thread maps/mp/zombies/_zm_perks::vending_trigger_think();
|
|
||||||
use_trigger thread maps/mp/zombies/_zm_perks::electric_perks_dialog();
|
|
||||||
|
|
||||||
powered_on = maps/mp/zombies/_zm_perks::get_perk_machine_start_state( use_trigger.script_noteworthy );
|
|
||||||
maps/mp/zombies/_zm_power::add_powered_item( maps/mp/zombies/_zm_power::perk_power_on, maps/mp/zombies/_zm_power::perk_power_off, maps/mp/zombies/_zm_power::perk_range, maps/mp/zombies/_zm_power::cost_low_if_local, 0, powered_on, use_trigger );
|
|
||||||
}
|
}
|
@ -42,6 +42,7 @@ main()
|
|||||||
replaceFunc(maps/mp/zombies/_zm_perks::perk_pause, scripts/zm/replaced/_zm_perks::perk_pause);
|
replaceFunc(maps/mp/zombies/_zm_perks::perk_pause, scripts/zm/replaced/_zm_perks::perk_pause);
|
||||||
replaceFunc(maps/mp/zombies/_zm_perks::destroy_weapon_in_blackout, scripts/zm/replaced/_zm_perks::destroy_weapon_in_blackout);
|
replaceFunc(maps/mp/zombies/_zm_perks::destroy_weapon_in_blackout, scripts/zm/replaced/_zm_perks::destroy_weapon_in_blackout);
|
||||||
replaceFunc(maps/mp/zombies/_zm_perks::give_perk, scripts/zm/replaced/_zm_perks::give_perk);
|
replaceFunc(maps/mp/zombies/_zm_perks::give_perk, scripts/zm/replaced/_zm_perks::give_perk);
|
||||||
|
replaceFunc(maps/mp/zombies/_zm_perks::initialize_custom_perk_arrays, scripts/zm/replaced/_zm_perks::initialize_custom_perk_arrays);
|
||||||
replaceFunc(maps/mp/zombies/_zm_power::standard_powered_items, scripts/zm/replaced/_zm_power::standard_powered_items);
|
replaceFunc(maps/mp/zombies/_zm_power::standard_powered_items, scripts/zm/replaced/_zm_power::standard_powered_items);
|
||||||
replaceFunc(maps/mp/zombies/_zm_powerups::full_ammo_powerup, scripts/zm/replaced/_zm_powerups::full_ammo_powerup);
|
replaceFunc(maps/mp/zombies/_zm_powerups::full_ammo_powerup, scripts/zm/replaced/_zm_powerups::full_ammo_powerup);
|
||||||
replaceFunc(maps/mp/zombies/_zm_powerups::nuke_powerup, scripts/zm/replaced/_zm_powerups::nuke_powerup);
|
replaceFunc(maps/mp/zombies/_zm_powerups::nuke_powerup, scripts/zm/replaced/_zm_powerups::nuke_powerup);
|
||||||
|
@ -114,4 +114,115 @@ give_perk( perk, bought )
|
|||||||
self.perks_active[ self.perks_active.size ] = perk;
|
self.perks_active[ self.perks_active.size ] = perk;
|
||||||
self notify( "perk_acquired" );
|
self notify( "perk_acquired" );
|
||||||
self thread perk_think( perk );
|
self thread perk_think( perk );
|
||||||
|
}
|
||||||
|
|
||||||
|
// modifying this function because it is right before perk_machine_spawn_init and has a lot less code
|
||||||
|
initialize_custom_perk_arrays()
|
||||||
|
{
|
||||||
|
if(!isDefined(level._custom_perks))
|
||||||
|
{
|
||||||
|
level._custom_perks = [];
|
||||||
|
}
|
||||||
|
|
||||||
|
struct = spawnStruct();
|
||||||
|
struct.script_noteworthy = "specialty_longersprint";
|
||||||
|
struct.scr_zm_ui_gametype = "zstandard";
|
||||||
|
struct.scr_zm_map_start_location = "town";
|
||||||
|
struct.origin_offset = (-4, 0, 0);
|
||||||
|
move_perk_machine("zm_transit", "town", "specialty_quickrevive", struct);
|
||||||
|
|
||||||
|
struct = spawnStruct();
|
||||||
|
struct.script_noteworthy = "specialty_longersprint";
|
||||||
|
struct.scr_zm_ui_gametype = "zclassic";
|
||||||
|
struct.scr_zm_map_start_location = "transit";
|
||||||
|
move_perk_machine("zm_transit", "town", "specialty_longersprint", struct);
|
||||||
|
|
||||||
|
struct = spawnStruct();
|
||||||
|
struct.origin = (1852, -825, -56);
|
||||||
|
struct.angles = (0, 180, 0);
|
||||||
|
struct.script_string = "zgrief";
|
||||||
|
move_perk_machine("zm_transit", "town", "specialty_scavenger", struct);
|
||||||
|
|
||||||
|
struct = spawnStruct();
|
||||||
|
struct.script_noteworthy = "specialty_quickrevive";
|
||||||
|
struct.scr_zm_ui_gametype = "zgrief";
|
||||||
|
struct.scr_zm_map_start_location = "street";
|
||||||
|
move_perk_machine("zm_buried", "street", "specialty_longersprint", struct);
|
||||||
|
|
||||||
|
struct = spawnStruct();
|
||||||
|
struct.script_noteworthy = "specialty_fastreload";
|
||||||
|
struct.scr_zm_ui_gametype = "zgrief";
|
||||||
|
struct.scr_zm_map_start_location = "street";
|
||||||
|
struct.origin_offset = (0, -32, 0);
|
||||||
|
move_perk_machine("zm_buried", "street", "specialty_quickrevive", struct);
|
||||||
|
|
||||||
|
struct = spawnStruct();
|
||||||
|
struct.script_noteworthy = "specialty_fastreload";
|
||||||
|
struct.scr_zm_ui_gametype = "zclassic";
|
||||||
|
struct.scr_zm_map_start_location = "processing";
|
||||||
|
move_perk_machine("zm_buried", "street", "specialty_fastreload", struct);
|
||||||
|
}
|
||||||
|
|
||||||
|
move_perk_machine(map, location, perk, move_struct)
|
||||||
|
{
|
||||||
|
if(!(level.script == map && level.scr_zm_map_start_location == location))
|
||||||
|
{
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
perk_struct = undefined;
|
||||||
|
structs = getStructArray("zm_perk_machine", "targetname");
|
||||||
|
|
||||||
|
foreach(struct in structs)
|
||||||
|
{
|
||||||
|
if(isDefined(struct.script_noteworthy) && struct.script_noteworthy == perk)
|
||||||
|
{
|
||||||
|
if(isDefined(struct.script_string) && isSubStr(struct.script_string, "perks_" + location))
|
||||||
|
{
|
||||||
|
perk_struct = struct;
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if(!isDefined(perk_struct))
|
||||||
|
{
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
if(isDefined(move_struct.script_string))
|
||||||
|
{
|
||||||
|
gametypes = strTok(move_struct.script_string, " ");
|
||||||
|
foreach(gametype in gametypes)
|
||||||
|
{
|
||||||
|
perk_struct.script_string += " " + gametype + "_perks_" + location;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if(isDefined(move_struct.origin))
|
||||||
|
{
|
||||||
|
perk_struct.origin = move_struct.origin;
|
||||||
|
perk_struct.angles = move_struct.angles;
|
||||||
|
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
foreach(struct in structs)
|
||||||
|
{
|
||||||
|
if(isDefined(struct.script_noteworthy) && struct.script_noteworthy == move_struct.script_noteworthy)
|
||||||
|
{
|
||||||
|
if(isDefined(struct.script_string) && isSubStr(struct.script_string, move_struct.scr_zm_ui_gametype + "_perks_" + move_struct.scr_zm_map_start_location))
|
||||||
|
{
|
||||||
|
perk_struct.origin = struct.origin;
|
||||||
|
perk_struct.angles = struct.angles;
|
||||||
|
|
||||||
|
if(isDefined(move_struct.origin_offset))
|
||||||
|
{
|
||||||
|
perk_struct.origin += move_struct.origin_offset;
|
||||||
|
}
|
||||||
|
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
@ -32,10 +32,6 @@ init()
|
|||||||
|
|
||||||
screecher_spawner_changes();
|
screecher_spawner_changes();
|
||||||
|
|
||||||
town_move_quickrevive_machine();
|
|
||||||
town_move_staminup_machine();
|
|
||||||
town_move_tombstone_machine();
|
|
||||||
|
|
||||||
path_exploit_fixes();
|
path_exploit_fixes();
|
||||||
|
|
||||||
level thread power_local_electric_doors_globally();
|
level thread power_local_electric_doors_globally();
|
||||||
@ -133,287 +129,6 @@ b23r_hint_string_fix()
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
town_move_quickrevive_machine()
|
|
||||||
{
|
|
||||||
if (!(!is_classic() && level.scr_zm_map_start_location == "town"))
|
|
||||||
{
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
perk_struct = undefined;
|
|
||||||
perk_location_struct = undefined;
|
|
||||||
structs = getstructarray("zm_perk_machine", "targetname");
|
|
||||||
foreach (struct in structs)
|
|
||||||
{
|
|
||||||
if (IsDefined(struct.script_noteworthy) && IsDefined(struct.script_string))
|
|
||||||
{
|
|
||||||
if (struct.script_noteworthy == "specialty_quickrevive" && IsSubStr(struct.script_string, "zstandard"))
|
|
||||||
{
|
|
||||||
perk_struct = struct;
|
|
||||||
}
|
|
||||||
else if (struct.script_noteworthy == "specialty_longersprint" && IsSubStr(struct.script_string, "zstandard"))
|
|
||||||
{
|
|
||||||
perk_location_struct = struct;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
if(!IsDefined(perk_struct) || !IsDefined(perk_location_struct))
|
|
||||||
{
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
// delete old machine
|
|
||||||
vending_triggers = getentarray( "zombie_vending", "targetname" );
|
|
||||||
for (i = 0; i < vending_trigger.size; i++)
|
|
||||||
{
|
|
||||||
trig = vending_triggers[i];
|
|
||||||
if (IsDefined(trig.script_noteworthy) && trig.script_noteworthy == "specialty_quickrevive")
|
|
||||||
{
|
|
||||||
trig.clip delete();
|
|
||||||
trig.machine delete();
|
|
||||||
trig.bump delete();
|
|
||||||
trig delete();
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
// spawn new machine
|
|
||||||
perk_location_struct.origin += anglesToRight(perk_location_struct.angles) * 4;
|
|
||||||
use_trigger = spawn( "trigger_radius_use", perk_location_struct.origin + vectorScale( ( 0, 0, 1 ), 30 ), 0, 40, 70 );
|
|
||||||
use_trigger.targetname = "zombie_vending";
|
|
||||||
use_trigger.script_noteworthy = perk_struct.script_noteworthy;
|
|
||||||
use_trigger triggerignoreteam();
|
|
||||||
perk_machine = spawn( "script_model", perk_location_struct.origin );
|
|
||||||
perk_machine.angles = perk_location_struct.angles;
|
|
||||||
perk_machine setmodel( perk_struct.model );
|
|
||||||
bump_trigger = spawn( "trigger_radius", perk_location_struct.origin + AnglesToRight(perk_location_struct.angles) * 32, 0, 35, 32 );
|
|
||||||
bump_trigger.script_activated = 1;
|
|
||||||
bump_trigger.script_sound = "zmb_perks_bump_bottle";
|
|
||||||
bump_trigger.targetname = "audio_bump_trigger";
|
|
||||||
bump_trigger thread maps/mp/zombies/_zm_perks::thread_bump_trigger();
|
|
||||||
collision = spawn( "script_model", perk_location_struct.origin, 1 );
|
|
||||||
collision.angles = perk_location_struct.angles;
|
|
||||||
collision setmodel( "zm_collision_perks1" );
|
|
||||||
collision.script_noteworthy = "clip";
|
|
||||||
collision disconnectpaths();
|
|
||||||
use_trigger.clip = collision;
|
|
||||||
use_trigger.machine = perk_machine;
|
|
||||||
use_trigger.bump = bump_trigger;
|
|
||||||
if ( isDefined( perk_struct.blocker_model ) )
|
|
||||||
{
|
|
||||||
use_trigger.blocker_model = perk_struct.blocker_model;
|
|
||||||
}
|
|
||||||
if ( isDefined( perk_struct.script_int ) )
|
|
||||||
{
|
|
||||||
perk_machine.script_int = perk_struct.script_int;
|
|
||||||
}
|
|
||||||
if ( isDefined( perk_struct.turn_on_notify ) )
|
|
||||||
{
|
|
||||||
perk_machine.turn_on_notify = perk_struct.turn_on_notify;
|
|
||||||
}
|
|
||||||
|
|
||||||
use_trigger.script_sound = "mus_perks_revive_jingle";
|
|
||||||
use_trigger.script_string = "revive_perk";
|
|
||||||
use_trigger.script_label = "mus_perks_revive_sting";
|
|
||||||
use_trigger.target = "vending_revive";
|
|
||||||
perk_machine.script_string = "revive_perk";
|
|
||||||
perk_machine.targetname = "vending_revive";
|
|
||||||
bump_trigger.script_string = "revive_perk";
|
|
||||||
|
|
||||||
level thread maps/mp/zombies/_zm_perks::turn_revive_on();
|
|
||||||
use_trigger thread maps/mp/zombies/_zm_perks::vending_trigger_think();
|
|
||||||
use_trigger thread maps/mp/zombies/_zm_perks::electric_perks_dialog();
|
|
||||||
|
|
||||||
powered_on = maps/mp/zombies/_zm_perks::get_perk_machine_start_state( use_trigger.script_noteworthy );
|
|
||||||
maps/mp/zombies/_zm_power::add_powered_item( maps/mp/zombies/_zm_power::perk_power_on, maps/mp/zombies/_zm_power::perk_power_off, maps/mp/zombies/_zm_power::perk_range, maps/mp/zombies/_zm_power::cost_low_if_local, 0, powered_on, use_trigger );
|
|
||||||
}
|
|
||||||
|
|
||||||
town_move_staminup_machine()
|
|
||||||
{
|
|
||||||
if (!(!is_classic() && level.scr_zm_map_start_location == "town"))
|
|
||||||
{
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
perk_struct = undefined;
|
|
||||||
structs = getstructarray("zm_perk_machine", "targetname");
|
|
||||||
foreach (struct in structs)
|
|
||||||
{
|
|
||||||
if (IsDefined(struct.script_noteworthy) && IsDefined(struct.script_string))
|
|
||||||
{
|
|
||||||
if (struct.script_noteworthy == "specialty_longersprint" && IsSubStr(struct.script_string, "zclassic"))
|
|
||||||
{
|
|
||||||
perk_struct = struct;
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
if(!IsDefined(perk_struct))
|
|
||||||
{
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
// delete old machine
|
|
||||||
vending_triggers = getentarray( "zombie_vending", "targetname" );
|
|
||||||
for (i = 0; i < vending_trigger.size; i++)
|
|
||||||
{
|
|
||||||
trig = vending_triggers[i];
|
|
||||||
if (IsDefined(trig.script_noteworthy) && trig.script_noteworthy == "specialty_longersprint")
|
|
||||||
{
|
|
||||||
trig.clip delete();
|
|
||||||
trig.machine delete();
|
|
||||||
trig.bump delete();
|
|
||||||
trig delete();
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
// spawn new machine
|
|
||||||
use_trigger = spawn( "trigger_radius_use", perk_struct.origin + vectorScale( ( 0, 0, 1 ), 30 ), 0, 40, 70 );
|
|
||||||
use_trigger.targetname = "zombie_vending";
|
|
||||||
use_trigger.script_noteworthy = perk_struct.script_noteworthy;
|
|
||||||
use_trigger triggerignoreteam();
|
|
||||||
perk_machine = spawn( "script_model", perk_struct.origin );
|
|
||||||
perk_machine.angles = perk_struct.angles;
|
|
||||||
perk_machine setmodel( perk_struct.model );
|
|
||||||
bump_trigger = spawn( "trigger_radius", perk_struct.origin + AnglesToRight(perk_struct.angles) * 32, 0, 35, 32 );
|
|
||||||
bump_trigger.script_activated = 1;
|
|
||||||
bump_trigger.script_sound = "zmb_perks_bump_bottle";
|
|
||||||
bump_trigger.targetname = "audio_bump_trigger";
|
|
||||||
bump_trigger thread maps/mp/zombies/_zm_perks::thread_bump_trigger();
|
|
||||||
collision = spawn( "script_model", perk_struct.origin, 1 );
|
|
||||||
collision.angles = perk_struct.angles;
|
|
||||||
collision setmodel( "zm_collision_perks1" );
|
|
||||||
collision.script_noteworthy = "clip";
|
|
||||||
collision disconnectpaths();
|
|
||||||
use_trigger.clip = collision;
|
|
||||||
use_trigger.machine = perk_machine;
|
|
||||||
use_trigger.bump = bump_trigger;
|
|
||||||
if ( isDefined( perk_struct.blocker_model ) )
|
|
||||||
{
|
|
||||||
use_trigger.blocker_model = perk_struct.blocker_model;
|
|
||||||
}
|
|
||||||
if ( isDefined( perk_struct.script_int ) )
|
|
||||||
{
|
|
||||||
perk_machine.script_int = perk_struct.script_int;
|
|
||||||
}
|
|
||||||
if ( isDefined( perk_struct.turn_on_notify ) )
|
|
||||||
{
|
|
||||||
perk_machine.turn_on_notify = perk_struct.turn_on_notify;
|
|
||||||
}
|
|
||||||
use_trigger.script_sound = "mus_perks_stamin_jingle";
|
|
||||||
use_trigger.script_string = "marathon_perk";
|
|
||||||
use_trigger.script_label = "mus_perks_stamin_sting";
|
|
||||||
use_trigger.target = "vending_marathon";
|
|
||||||
perk_machine.script_string = "marathon_perk";
|
|
||||||
perk_machine.targetname = "vending_marathon";
|
|
||||||
bump_trigger.script_string = "marathon_perk";
|
|
||||||
|
|
||||||
level thread maps/mp/zombies/_zm_perks::turn_marathon_on();
|
|
||||||
use_trigger thread maps/mp/zombies/_zm_perks::vending_trigger_think();
|
|
||||||
use_trigger thread maps/mp/zombies/_zm_perks::electric_perks_dialog();
|
|
||||||
|
|
||||||
powered_on = maps/mp/zombies/_zm_perks::get_perk_machine_start_state( use_trigger.script_noteworthy );
|
|
||||||
maps/mp/zombies/_zm_power::add_powered_item( maps/mp/zombies/_zm_power::perk_power_on, maps/mp/zombies/_zm_power::perk_power_off, maps/mp/zombies/_zm_power::perk_range, maps/mp/zombies/_zm_power::cost_low_if_local, 0, powered_on, use_trigger );
|
|
||||||
}
|
|
||||||
|
|
||||||
town_move_tombstone_machine()
|
|
||||||
{
|
|
||||||
if (!(!is_classic() && level.scr_zm_map_start_location == "town"))
|
|
||||||
{
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
perk_struct = undefined;
|
|
||||||
structs = getstructarray("zm_perk_machine", "targetname");
|
|
||||||
foreach (struct in structs)
|
|
||||||
{
|
|
||||||
if (IsDefined(struct.script_noteworthy) && IsDefined(struct.script_string))
|
|
||||||
{
|
|
||||||
if (struct.script_noteworthy == "specialty_scavenger" && IsSubStr(struct.script_string, "zstandard"))
|
|
||||||
{
|
|
||||||
perk_struct = struct;
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
if(!IsDefined(perk_struct))
|
|
||||||
{
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
// delete old machine (only on Survival)
|
|
||||||
if(level.scr_zm_ui_gametype == "zstandard")
|
|
||||||
{
|
|
||||||
vending_triggers = getentarray( "zombie_vending", "targetname" );
|
|
||||||
for (i = 0; i < vending_trigger.size; i++)
|
|
||||||
{
|
|
||||||
trig = vending_triggers[i];
|
|
||||||
if (IsDefined(trig.script_noteworthy) && trig.script_noteworthy == "specialty_scavenger")
|
|
||||||
{
|
|
||||||
trig.clip delete();
|
|
||||||
trig.machine delete();
|
|
||||||
trig.bump delete();
|
|
||||||
trig delete();
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
// spawn new machine
|
|
||||||
origin = (1852, -825, -56);
|
|
||||||
angles = (0, 180, 0);
|
|
||||||
use_trigger = spawn( "trigger_radius_use", origin + vectorScale( ( 0, 0, 1 ), 30 ), 0, 40, 70 );
|
|
||||||
use_trigger.targetname = "zombie_vending";
|
|
||||||
use_trigger.script_noteworthy = perk_struct.script_noteworthy;
|
|
||||||
use_trigger triggerignoreteam();
|
|
||||||
perk_machine = spawn( "script_model", origin );
|
|
||||||
perk_machine.angles = angles;
|
|
||||||
perk_machine setmodel( perk_struct.model );
|
|
||||||
bump_trigger = spawn( "trigger_radius", origin + AnglesToRight(angles) * 32, 0, 35, 32 );
|
|
||||||
bump_trigger.script_activated = 1;
|
|
||||||
bump_trigger.script_sound = "zmb_perks_bump_bottle";
|
|
||||||
bump_trigger.targetname = "audio_bump_trigger";
|
|
||||||
bump_trigger thread maps/mp/zombies/_zm_perks::thread_bump_trigger();
|
|
||||||
collision = spawn( "script_model", origin, 1 );
|
|
||||||
collision.angles = angles;
|
|
||||||
collision setmodel( "zm_collision_perks1" );
|
|
||||||
collision.script_noteworthy = "clip";
|
|
||||||
collision disconnectpaths();
|
|
||||||
use_trigger.clip = collision;
|
|
||||||
use_trigger.machine = perk_machine;
|
|
||||||
use_trigger.bump = bump_trigger;
|
|
||||||
if ( isDefined( perk_struct.blocker_model ) )
|
|
||||||
{
|
|
||||||
use_trigger.blocker_model = perk_struct.blocker_model;
|
|
||||||
}
|
|
||||||
if ( isDefined( perk_struct.script_int ) )
|
|
||||||
{
|
|
||||||
perk_machine.script_int = perk_struct.script_int;
|
|
||||||
}
|
|
||||||
if ( isDefined( perk_struct.turn_on_notify ) )
|
|
||||||
{
|
|
||||||
perk_machine.turn_on_notify = perk_struct.turn_on_notify;
|
|
||||||
}
|
|
||||||
use_trigger.script_sound = "mus_perks_tombstone_jingle";
|
|
||||||
use_trigger.script_string = "tombstone_perk";
|
|
||||||
use_trigger.script_label = "mus_perks_tombstone_sting";
|
|
||||||
use_trigger.target = "vending_tombstone";
|
|
||||||
perk_machine.script_string = "tombstone_perk";
|
|
||||||
perk_machine.targetname = "vending_tombstone";
|
|
||||||
bump_trigger.script_string = "tombstone_perk";
|
|
||||||
|
|
||||||
level thread maps/mp/zombies/_zm_perks::turn_tombstone_on();
|
|
||||||
use_trigger thread maps/mp/zombies/_zm_perks::vending_trigger_think();
|
|
||||||
use_trigger thread maps/mp/zombies/_zm_perks::electric_perks_dialog();
|
|
||||||
|
|
||||||
powered_on = maps/mp/zombies/_zm_perks::get_perk_machine_start_state( use_trigger.script_noteworthy );
|
|
||||||
maps/mp/zombies/_zm_power::add_powered_item( maps/mp/zombies/_zm_power::perk_power_on, maps/mp/zombies/_zm_power::perk_power_off, maps/mp/zombies/_zm_power::perk_range, maps/mp/zombies/_zm_power::cost_low_if_local, 0, powered_on, use_trigger );
|
|
||||||
}
|
|
||||||
|
|
||||||
grenade_safe_to_bounce( player, weapname )
|
grenade_safe_to_bounce( player, weapname )
|
||||||
{
|
{
|
||||||
if ( !is_offhand_weapon( weapname ) )
|
if ( !is_offhand_weapon( weapname ) )
|
||||||
|
Loading…
x
Reference in New Issue
Block a user