mirror of
https://github.com/JezuzLizard/BO2-Reimagined.git
synced 2025-06-10 23:27:57 -05:00
Buried: add buildable took hint string
Buildables: fix took hint string Buildables: fix other triggers being disabled when all buildables were built Optimize buildable code
This commit is contained in:
@ -437,8 +437,8 @@
|
||||
* Fountain portal automatically active
|
||||
* Navcard table automatically crafted
|
||||
* Players can no longer get into the corner next to Juggernog
|
||||
* Buildable table hint strings no longer show buildable icon
|
||||
* Buildable table hint strings update when purchased
|
||||
* Removed buildable table hint icons
|
||||
* Added buildable table hint strings on buildable purchase
|
||||
|
||||
#### Borough
|
||||
* Tunnels disabled
|
||||
|
@ -2707,7 +2707,7 @@ buildbuildables()
|
||||
wait 1;
|
||||
|
||||
updatebuildables();
|
||||
removebuildable( "turbine", 1 );
|
||||
removebuildable( "turbine", "buried" );
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -2805,7 +2805,7 @@ get_equipment_display_name()
|
||||
|
||||
get_equipment_cost()
|
||||
{
|
||||
if (self.equipname == "turbine" && level.script == "zm_transit")
|
||||
if (self.equipname == "turbine")
|
||||
{
|
||||
return 500;
|
||||
}
|
||||
@ -2839,16 +2839,11 @@ updatebuildables()
|
||||
}
|
||||
}
|
||||
|
||||
removebuildable( buildable, after_built )
|
||||
removebuildable( buildable, poolname )
|
||||
{
|
||||
if (!isDefined(after_built))
|
||||
if (isDefined(poolname))
|
||||
{
|
||||
after_built = 0;
|
||||
}
|
||||
|
||||
if (after_built)
|
||||
{
|
||||
foreach (stub in level._unitriggers.trigger_stubs)
|
||||
foreach (stub in level.buildablepools[poolname].stubs)
|
||||
{
|
||||
if(IsDefined(stub.equipname) && stub.equipname == buildable)
|
||||
{
|
||||
|
@ -77,66 +77,81 @@ buildable_place_think()
|
||||
self sethintstring( self.stub.hint_string );
|
||||
}
|
||||
}
|
||||
if ( isDefined( player_built ) )
|
||||
|
||||
if ( self.stub.persistent == 4 )
|
||||
{
|
||||
self [[ self.stub.custom_completion_callback ]]( player_built );
|
||||
return;
|
||||
}
|
||||
|
||||
if ( self.stub.persistent == 0 )
|
||||
{
|
||||
self.stub maps\mp\zombies\_zm_buildables::buildablestub_remove();
|
||||
thread maps\mp\zombies\_zm_unitrigger::unregister_unitrigger( self.stub );
|
||||
return;
|
||||
}
|
||||
|
||||
if ( self.stub.persistent == 3 )
|
||||
{
|
||||
maps\mp\zombies\_zm_buildables::stub_unbuild_buildable( self.stub, 1 );
|
||||
return;
|
||||
}
|
||||
|
||||
if ( self.stub.persistent == 2 )
|
||||
{
|
||||
if ( isDefined( player_built ) )
|
||||
{
|
||||
self scripts\zm\replaced\_zm_buildables_pooled::pooledbuildabletrigger_update_prompt( player_built );
|
||||
}
|
||||
|
||||
if ( !maps\mp\zombies\_zm_weapons::limited_weapon_below_quota( self.stub.weaponname, undefined ) )
|
||||
{
|
||||
self.stub.hint_string = &"ZOMBIE_GO_TO_THE_BOX_LIMITED";
|
||||
self sethintstring( self.stub.hint_string );
|
||||
return;
|
||||
}
|
||||
|
||||
if ( isDefined( self.stub.bought ) && self.stub.bought )
|
||||
{
|
||||
self.stub.hint_string = &"ZOMBIE_GO_TO_THE_BOX";
|
||||
self sethintstring( self.stub.hint_string );
|
||||
return;
|
||||
}
|
||||
|
||||
if ( isDefined( self.stub.model ) )
|
||||
{
|
||||
self.stub.model notsolid();
|
||||
self.stub.model show();
|
||||
}
|
||||
|
||||
while ( self.stub.persistent == 2 )
|
||||
{
|
||||
self waittill( "trigger", player );
|
||||
|
||||
if ( isDefined( player.screecher_weapon ) )
|
||||
{
|
||||
continue;
|
||||
}
|
||||
|
||||
if ( !maps\mp\zombies\_zm_weapons::limited_weapon_below_quota( self.stub.weaponname, undefined ) )
|
||||
{
|
||||
self.stub.hint_string = &"ZOMBIE_GO_TO_THE_BOX_LIMITED";
|
||||
self sethintstring( self.stub.hint_string );
|
||||
return;
|
||||
}
|
||||
|
||||
if ( isDefined( self.stub.built ) && !self.stub.built )
|
||||
{
|
||||
self.stub.hint_string = "";
|
||||
self sethintstring( self.stub.hint_string );
|
||||
return;
|
||||
}
|
||||
|
||||
if ( player != self.parent_player )
|
||||
{
|
||||
continue;
|
||||
}
|
||||
|
||||
if ( !is_player_valid( player ) )
|
||||
{
|
||||
player thread ignore_triggers( 0.5 );
|
||||
@ -152,23 +167,35 @@ buildable_place_think()
|
||||
self play_sound_on_ent( "purchase" );
|
||||
|
||||
self.stub.bought = 1;
|
||||
|
||||
if ( isDefined( self.stub.model ) )
|
||||
{
|
||||
self.stub.model thread maps\mp\zombies\_zm_buildables::model_fly_away();
|
||||
}
|
||||
|
||||
player maps\mp\zombies\_zm_weapons::weapon_give( self.stub.weaponname );
|
||||
|
||||
if ( isDefined( level.zombie_include_buildables[ self.stub.equipname ].onbuyweapon ) )
|
||||
{
|
||||
self [[ level.zombie_include_buildables[ self.stub.equipname ].onbuyweapon ]]( player );
|
||||
}
|
||||
if ( !maps\mp\zombies\_zm_weapons::limited_weapon_below_quota( self.stub.weaponname, undefined ) )
|
||||
{
|
||||
self.stub.hint_string = &"ZOMBIE_GO_TO_THE_BOX_LIMITED";
|
||||
}
|
||||
else
|
||||
{
|
||||
self.stub.hint_string = &"ZOMBIE_GO_TO_THE_BOX";
|
||||
}
|
||||
|
||||
if ( isDefined( level.zombie_buildables[ self.stub.equipname ].bought ) )
|
||||
{
|
||||
self.stub.hint_string = level.zombie_buildables[ self.stub.equipname ].bought;
|
||||
}
|
||||
else
|
||||
{
|
||||
if ( !maps\mp\zombies\_zm_weapons::limited_weapon_below_quota( self.stub.weaponname, undefined ) )
|
||||
{
|
||||
self.stub.hint_string = &"ZOMBIE_GO_TO_THE_BOX_LIMITED";
|
||||
}
|
||||
else
|
||||
{
|
||||
self.stub.hint_string = &"ZOMBIE_GO_TO_THE_BOX";
|
||||
}
|
||||
}
|
||||
|
||||
self sethintstring( self.stub.hint_string );
|
||||
player maps\mp\zombies\_zm_buildables::track_buildables_pickedup( self.stub.weaponname );
|
||||
}
|
||||
@ -180,36 +207,44 @@ buildable_place_think()
|
||||
self.stub.model notsolid();
|
||||
self.stub.model show();
|
||||
}
|
||||
|
||||
while ( self.stub.persistent == 1 )
|
||||
{
|
||||
self waittill( "trigger", player );
|
||||
|
||||
if ( isDefined( player.screecher_weapon ) )
|
||||
{
|
||||
continue;
|
||||
}
|
||||
|
||||
if ( isDefined( self.stub.built ) && !self.stub.built )
|
||||
{
|
||||
self.stub.hint_string = "";
|
||||
self sethintstring( self.stub.hint_string );
|
||||
return;
|
||||
}
|
||||
|
||||
if ( player != self.parent_player )
|
||||
{
|
||||
continue;
|
||||
}
|
||||
|
||||
if ( !is_player_valid( player ) )
|
||||
{
|
||||
player thread ignore_triggers( 0.5 );
|
||||
}
|
||||
|
||||
if ( player has_player_equipment( self.stub.weaponname ) )
|
||||
{
|
||||
continue;
|
||||
}
|
||||
|
||||
if (player.score < self.stub.cost)
|
||||
{
|
||||
self play_sound_on_ent( "no_purchase" );
|
||||
continue;
|
||||
}
|
||||
|
||||
if ( !maps\mp\zombies\_zm_equipment::is_limited_equipment( self.stub.weaponname ) || !maps\mp\zombies\_zm_equipment::limited_equipment_in_use( self.stub.weaponname ) )
|
||||
{
|
||||
player maps\mp\zombies\_zm_score::minus_to_player_score( self.stub.cost );
|
||||
@ -218,14 +253,17 @@ buildable_place_think()
|
||||
player maps\mp\zombies\_zm_equipment::equipment_buy( self.stub.weaponname );
|
||||
player giveweapon( self.stub.weaponname );
|
||||
player setweaponammoclip( self.stub.weaponname, 1 );
|
||||
|
||||
if ( isDefined( level.zombie_include_buildables[ self.stub.equipname ].onbuyweapon ) )
|
||||
{
|
||||
self [[ level.zombie_include_buildables[ self.stub.equipname ].onbuyweapon ]]( player );
|
||||
}
|
||||
|
||||
if ( self.stub.weaponname != "keys_zm" )
|
||||
{
|
||||
player setactionslot( 1, "weapon", self.stub.weaponname );
|
||||
}
|
||||
|
||||
if ( isDefined( level.zombie_buildables[ self.stub.equipname ].bought ) )
|
||||
{
|
||||
self.stub.hint_string = level.zombie_buildables[ self.stub.equipname ].bought;
|
||||
@ -234,6 +272,7 @@ buildable_place_think()
|
||||
{
|
||||
self.stub.hint_string = "";
|
||||
}
|
||||
|
||||
self sethintstring( self.stub.hint_string );
|
||||
player maps\mp\zombies\_zm_buildables::track_buildables_pickedup( self.stub.weaponname );
|
||||
continue;
|
||||
@ -245,172 +284,4 @@ buildable_place_think()
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
bptrigger_think_persistent( player_built )
|
||||
{
|
||||
if ( !isdefined( player_built ) || self [[ self.stub.prompt_and_visibility_func ]]( player_built ) )
|
||||
{
|
||||
if ( isdefined( self.stub.model ) )
|
||||
{
|
||||
self.stub.model notsolid();
|
||||
self.stub.model show();
|
||||
}
|
||||
|
||||
while ( self.stub.persistent == 1 )
|
||||
{
|
||||
self waittill( "trigger", player );
|
||||
|
||||
if ( isdefined( player.screecher_weapon ) )
|
||||
continue;
|
||||
|
||||
if ( !( isdefined( self.stub.built ) && self.stub.built ) )
|
||||
{
|
||||
self.stub.hint_string = "";
|
||||
self sethintstring( self.stub.hint_string );
|
||||
self setcursorhint( "HINT_NOICON" );
|
||||
return;
|
||||
}
|
||||
|
||||
if ( player != self.parent_player )
|
||||
continue;
|
||||
|
||||
if ( !is_player_valid( player ) )
|
||||
{
|
||||
player thread ignore_triggers( 0.5 );
|
||||
continue;
|
||||
}
|
||||
|
||||
if ( player has_player_equipment( self.stub.weaponname ) )
|
||||
continue;
|
||||
|
||||
if (player.score < self.stub.cost)
|
||||
{
|
||||
self play_sound_on_ent( "no_purchase" );
|
||||
continue;
|
||||
}
|
||||
|
||||
if ( isdefined( self.stub.buildablestruct.onbought ) )
|
||||
self [[ self.stub.buildablestruct.onbought ]]( player );
|
||||
else if ( !maps\mp\zombies\_zm_equipment::is_limited_equipment( self.stub.weaponname ) || !maps\mp\zombies\_zm_equipment::limited_equipment_in_use( self.stub.weaponname ) )
|
||||
{
|
||||
player maps\mp\zombies\_zm_score::minus_to_player_score( self.stub.cost );
|
||||
self play_sound_on_ent( "purchase" );
|
||||
|
||||
player maps\mp\zombies\_zm_equipment::equipment_buy( self.stub.weaponname );
|
||||
player giveweapon( self.stub.weaponname );
|
||||
player setweaponammoclip( self.stub.weaponname, 1 );
|
||||
|
||||
if ( isdefined( level.zombie_include_buildables[self.stub.equipname].onbuyweapon ) )
|
||||
self [[ level.zombie_include_buildables[self.stub.equipname].onbuyweapon ]]( player );
|
||||
|
||||
if ( self.stub.weaponname != "keys_zm" )
|
||||
player setactionslot( 1, "weapon", self.stub.weaponname );
|
||||
|
||||
self.stub.cursor_hint = "HINT_NOICON";
|
||||
self.stub.cursor_hint_weapon = undefined;
|
||||
self setcursorhint( self.stub.cursor_hint );
|
||||
|
||||
if ( isdefined( level.zombie_buildables[self.stub.equipname].bought ) )
|
||||
self.stub.hint_string = level.zombie_buildables[self.stub.equipname].bought;
|
||||
else
|
||||
self.stub.hint_string = "";
|
||||
|
||||
self sethintstring( self.stub.hint_string );
|
||||
player track_buildables_pickedup( self.stub.weaponname );
|
||||
}
|
||||
else
|
||||
{
|
||||
self.stub.hint_string = "";
|
||||
self sethintstring( self.stub.hint_string );
|
||||
self.stub.cursor_hint = "HINT_NOICON";
|
||||
self.stub.cursor_hint_weapon = undefined;
|
||||
self setcursorhint( self.stub.cursor_hint );
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
bptrigger_think_one_use_and_fly( player_built )
|
||||
{
|
||||
if ( isdefined( player_built ) )
|
||||
self scripts\zm\replaced\_zm_buildables_pooled::pooledbuildabletrigger_update_prompt( player_built );
|
||||
|
||||
if ( !maps\mp\zombies\_zm_weapons::limited_weapon_below_quota( self.stub.weaponname, undefined ) )
|
||||
{
|
||||
self.stub.hint_string = &"ZOMBIE_GO_TO_THE_BOX_LIMITED";
|
||||
self sethintstring( self.stub.hint_string );
|
||||
return;
|
||||
}
|
||||
|
||||
if ( isdefined( self.stub.bought ) && self.stub.bought )
|
||||
{
|
||||
self.stub.hint_string = &"ZOMBIE_GO_TO_THE_BOX";
|
||||
self sethintstring( self.stub.hint_string );
|
||||
return;
|
||||
}
|
||||
|
||||
if ( isdefined( self.stub.model ) )
|
||||
{
|
||||
self.stub.model notsolid();
|
||||
self.stub.model show();
|
||||
}
|
||||
|
||||
while ( self.stub.persistent == 2 )
|
||||
{
|
||||
self waittill( "trigger", player );
|
||||
|
||||
if ( isdefined( player.screecher_weapon ) )
|
||||
continue;
|
||||
|
||||
if ( !maps\mp\zombies\_zm_weapons::limited_weapon_below_quota( self.stub.weaponname, undefined ) )
|
||||
{
|
||||
self.stub.hint_string = &"ZOMBIE_GO_TO_THE_BOX_LIMITED";
|
||||
self sethintstring( self.stub.hint_string );
|
||||
return;
|
||||
}
|
||||
|
||||
if ( !( isdefined( self.stub.built ) && self.stub.built ) )
|
||||
{
|
||||
self.stub.hint_string = "";
|
||||
self sethintstring( self.stub.hint_string );
|
||||
return;
|
||||
}
|
||||
|
||||
if ( player != self.parent_player )
|
||||
continue;
|
||||
|
||||
if ( !is_player_valid( player ) )
|
||||
{
|
||||
player thread ignore_triggers( 0.5 );
|
||||
continue;
|
||||
}
|
||||
|
||||
if (player.score < self.stub.cost)
|
||||
{
|
||||
self play_sound_on_ent( "no_purchase" );
|
||||
continue;
|
||||
}
|
||||
|
||||
player maps\mp\zombies\_zm_score::minus_to_player_score( self.stub.cost );
|
||||
self play_sound_on_ent( "purchase" );
|
||||
|
||||
self.stub.bought = 1;
|
||||
|
||||
if ( isdefined( self.stub.model ) )
|
||||
self.stub.model thread model_fly_away();
|
||||
|
||||
player maps\mp\zombies\_zm_weapons::weapon_give( self.stub.weaponname );
|
||||
|
||||
if ( isdefined( level.zombie_include_buildables[self.stub.equipname].onbuyweapon ) )
|
||||
self [[ level.zombie_include_buildables[self.stub.equipname].onbuyweapon ]]( player );
|
||||
|
||||
if ( !maps\mp\zombies\_zm_weapons::limited_weapon_below_quota( self.stub.weaponname, undefined ) )
|
||||
self.stub.hint_string = &"ZOMBIE_GO_TO_THE_BOX_LIMITED";
|
||||
else
|
||||
self.stub.hint_string = &"ZOMBIE_GO_TO_THE_BOX";
|
||||
|
||||
self sethintstring( self.stub.hint_string );
|
||||
player track_buildables_pickedup( self.stub.weaponname );
|
||||
}
|
||||
}
|
@ -100,11 +100,6 @@ pooledbuildabletrigger_update_prompt( player )
|
||||
|
||||
self setcursorhint( "HINT_NOICON" );
|
||||
|
||||
if(can_use)
|
||||
{
|
||||
self thread pooledbuildabletrigger_wait_and_update_prompt( player );
|
||||
}
|
||||
|
||||
return can_use;
|
||||
}
|
||||
|
||||
@ -133,8 +128,6 @@ pooledbuildablestub_update_prompt( player, trigger )
|
||||
|
||||
if ( !( isdefined( self.built ) && self.built ) )
|
||||
{
|
||||
trigger thread pooledbuildablestub_build_succeed();
|
||||
|
||||
if (level.buildables_available.size > 1)
|
||||
{
|
||||
if (!is_true(self.open_buildable_checking_input))
|
||||
@ -490,8 +483,6 @@ pooled_buildable_place_think()
|
||||
if ( isdefined( self.stub.built ) && self.stub.built )
|
||||
return scripts\zm\replaced\_zm_buildables::buildable_place_think();
|
||||
|
||||
player_built = undefined;
|
||||
|
||||
while ( !( isdefined( self.stub.built ) && self.stub.built ) )
|
||||
{
|
||||
self waittill( "trigger", player );
|
||||
@ -566,49 +557,27 @@ pooled_buildable_place_think()
|
||||
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 );
|
||||
self.stub.hint_string = self.stub.trigger_hintstring;
|
||||
self pooledbuildabletrigger_update_prompt( player );
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
switch ( self.stub.persistent )
|
||||
{
|
||||
case 1:
|
||||
self scripts\zm\replaced\_zm_buildables::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 scripts\zm\replaced\_zm_buildables::bptrigger_think_one_use_and_fly( player_built );
|
||||
break;
|
||||
case 4:
|
||||
self [[ self.stub.custom_completion_callback ]]( player_built );
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
pooledbuildablestub_build_succeed()
|
||||
{
|
||||
self notify("pooledbuildablestub_build_succeed");
|
||||
self endon("pooledbuildablestub_build_succeed");
|
||||
|
||||
self waittill( "build_succeed" );
|
||||
|
||||
self.stub maps\mp\zombies\_zm_buildables::buildablestub_remove();
|
||||
arrayremovevalue(level.buildables_available, self.stub.equipname);
|
||||
|
||||
if (level.buildables_available.size == 0)
|
||||
{
|
||||
foreach (stub in level.buildable_stubs)
|
||||
{
|
||||
maps\mp\zombies\_zm_unitrigger::unregister_unitrigger(stub);
|
||||
if (isDefined(stub.buildable_pool) && stub.buildable_pool == self.stub.buildable_pool)
|
||||
{
|
||||
maps\mp\zombies\_zm_unitrigger::unregister_unitrigger(stub);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
scripts\zm\replaced\_zm_buildables::buildable_place_think();
|
||||
}
|
||||
|
||||
choose_open_buildable( player )
|
||||
|
@ -50,16 +50,12 @@ init()
|
||||
level.check_for_valid_spawn_near_team_callback = ::zgrief_respawn_override;
|
||||
}
|
||||
|
||||
level.zombie_buildables["turbine"].bought = &"ZOMBIE_BUILD_PIECE_HAVE_ONE";
|
||||
level.zombie_buildables["springpad_zm"].bought = &"ZOMBIE_BUILD_PIECE_HAVE_ONE";
|
||||
level.zombie_buildables["subwoofer_zm"].bought = &"ZOMBIE_BUILD_PIECE_HAVE_ONE";
|
||||
level.zombie_buildables["headchopper_zm"].bought = &"ZOMBIE_BUILD_PIECE_HAVE_ONE";
|
||||
|
||||
turn_power_on();
|
||||
deleteslothbarricades();
|
||||
|
||||
add_jug_collision();
|
||||
|
||||
level thread update_buildable_stubs();
|
||||
level thread enable_fountain_transport();
|
||||
level thread disable_ghost_free_perk_on_damage();
|
||||
}
|
||||
@ -244,6 +240,21 @@ deleteslothbarricades()
|
||||
array_thread( sloth_trigs, ::self_delete );
|
||||
}
|
||||
|
||||
update_buildable_stubs()
|
||||
{
|
||||
flag_wait( "initial_blackscreen_passed" );
|
||||
|
||||
wait 1;
|
||||
|
||||
foreach (stub in level.buildablepools["buried"].stubs)
|
||||
{
|
||||
if (isDefined(level.zombie_buildables[stub.equipname]))
|
||||
{
|
||||
level.zombie_buildables[stub.equipname].bought = "Took " + stub scripts\zm\_zm_reimagined::get_equipment_display_name();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
enable_fountain_transport()
|
||||
{
|
||||
if(!(is_classic() && level.scr_zm_map_start_location == "processing"))
|
||||
|
Reference in New Issue
Block a user