1
0
mirror of https://github.com/JezuzLizard/BO2-Reimagined.git synced 2025-07-04 10:59:25 -05:00

Mystery Box: only see obtainable weapons

Die Rise: fix upside down Mystery Box weapon angle
Origins: rotate Mystery Box weapon model angle 180 degrees
This commit is contained in:
Jbleezy
2023-04-08 03:17:50 -07:00
parent a3b87ca7b0
commit 70b2def1d6
2 changed files with 112 additions and 46 deletions

View File

@ -272,7 +272,8 @@
* Lethal grenade hint string no longer displays "ammo" after purchasing * Lethal grenade hint string no longer displays "ammo" after purchasing
## Mystery Box ## Mystery Box
* Players will get every weapon they can before getting duplicates * Players get every weapon they can before getting duplicates
* Players only see weapons rising up that they can currently obtain
* Decreased weapon pickup time from 12 seconds to 9 seconds * Decreased weapon pickup time from 12 seconds to 9 seconds
* Moves to new location instantly * Moves to new location instantly
* Special sound no longer plays when obtaining the Ray Gun * Special sound no longer plays when obtaining the Ray Gun
@ -548,6 +549,7 @@
* Moved weapon locker to the downstairs fridge * Moved weapon locker to the downstairs fridge
* Zombies no longer spawn in the Upper Blue Highrise zone when in the Trample Steam zone * Zombies no longer spawn in the Upper Blue Highrise zone when in the Trample Steam zone
* Zombies no longer spawn in the zone next to the AN94 when in the AN94 zone while the debris is closed * Zombies no longer spawn in the zone next to the AN94 when in the AN94 zone while the debris is closed
* Fixed weapon model angle on upside down Mystery Box
* Quest: elevator symbols can be activated without players on every symbol * Quest: elevator symbols can be activated without players on every symbol
* Quest: elevator symbols stay active after activating once * Quest: elevator symbols stay active after activating once
* Quest: floor symbols can be activated in any order * Quest: floor symbols can be activated in any order
@ -655,6 +657,7 @@
* Teleporters: placing gramophone activates The Crazy Place teleporters * Teleporters: placing gramophone activates The Crazy Place teleporters
* Teleporters: players face away from the teleporters when returning from The Crazy Place * Teleporters: players face away from the teleporters when returning from The Crazy Place
* Teleporters: players can teleport while prone * Teleporters: players can teleport while prone
* Mystery Box: rotated weapon model angle 180 degrees
* Mystery Box: uses the same trade weapon hint string as other maps * Mystery Box: uses the same trade weapon hint string as other maps
* Der Wunderfizz: increased cost from 1500 to 2500 * Der Wunderfizz: increased cost from 1500 to 2500
* Der Wunderfizz: all perks have an equal chance of being obtained * Der Wunderfizz: all perks have an equal chance of being obtained

View File

@ -76,50 +76,81 @@ treasure_chest_weapon_spawn( chest, player, respin )
self thread clean_up_hacked_box(); self thread clean_up_hacked_box();
assert( isdefined( player ) ); assert( isdefined( player ) );
self.weapon_string = undefined; self.weapon_string = undefined;
modelname = undefined;
rand = undefined; rand = undefined;
number_cycles = 40; number_cycles = 37;
if ( isdefined( chest.zbarrier ) )
{
if ( isdefined( level.custom_magic_box_do_weapon_rise ) )
chest.zbarrier thread [[ level.custom_magic_box_do_weapon_rise ]]();
else
chest.zbarrier thread magic_box_do_weapon_rise();
}
for ( i = 0; i < number_cycles; i++ )
{
if ( i < 20 )
{
wait 0.05;
continue;
}
if ( i < 30 )
{
wait 0.1;
continue;
}
if ( i < 35 )
{
wait 0.2;
continue;
}
if ( i < 38 )
wait 0.3;
}
if ( isdefined( level.custom_magic_box_weapon_wait ) )
[[ level.custom_magic_box_weapon_wait ]]();
if ( isdefined( level.custom_magicbox_float_height ) ) if ( isdefined( level.custom_magicbox_float_height ) )
v_float = anglestoup( self.angles ) * level.custom_magicbox_float_height; v_float = anglestoup( self.angles ) * level.custom_magicbox_float_height;
else else
v_float = anglestoup( self.angles ) * 40; v_float = anglestoup( self.angles ) * 40;
if ( isdefined( level.custom_magic_box_weapon_wait ) )
[[ level.custom_magic_box_weapon_wait ]]();
start_origin = self.origin;
end_origin = self.origin + v_float;
angles = self.angles + (0, 180, 0);
if (level.script == "zm_tomb")
{
v_move = anglestoright( self.angles ) * -20;
start_origin = self.origin + v_float + v_move;
angles = self.angles;
}
// angle is opposite of what it should be on upside down box
if (angles[2] < 0)
{
angles = (angles[0], angles[1], -360 - angles[2] );
}
self.weapon_model = spawn("script_model", start_origin);
self.weapon_model.angles = angles;
self.weapon_model_dw = spawn("script_model", self.weapon_model.origin - ( 3, 3, 3 ));
self.weapon_model_dw.angles = self.weapon_model.angles;
self.weapon_model_dw hide();
self.weapon_model moveto( end_origin, 3, 2, 0.9 );
self.weapon_model_dw moveto( end_origin - ( 3, 3, 3 ), 3, 2, 0.9 );
for ( i = 0; i < number_cycles; i++ )
{
rand = treasure_chest_chooseweightedrandomweapon( player, rand, 0 );
modelname = getweaponmodel( rand );
if ( isdefined( self.weapon_model ) )
{
self.weapon_model useweaponmodel( rand, modelname );
if ( weapondualwieldweaponname( rand ) != "none" )
{
self.weapon_model_dw useweaponmodel( weapondualwieldweaponname( rand ), modelname );
self.weapon_model_dw show();
}
else
{
self.weapon_model_dw hide();
}
}
if ( i < 20 )
{
wait 0.05;
}
else if ( i < 30 )
{
wait 0.1;
}
else if ( i < 35 )
{
wait 0.2;
}
else
{
wait 0.3;
}
}
wait 0.1; wait 0.1;
if ( getdvar( "magic_chest_movable" ) == "1" && !( isdefined( chest._box_opened_by_fire_sale ) && chest._box_opened_by_fire_sale ) && !( isdefined( level.zombie_vars["zombie_powerup_fire_sale_on"] ) && level.zombie_vars["zombie_powerup_fire_sale_on"] && self [[ level._zombiemode_check_firesale_loc_valid_func ]]() ) ) if ( getdvar( "magic_chest_movable" ) == "1" && !( isdefined( chest._box_opened_by_fire_sale ) && chest._box_opened_by_fire_sale ) && !( isdefined( level.zombie_vars["zombie_powerup_fire_sale_on"] ) && level.zombie_vars["zombie_powerup_fire_sale_on"] && self [[ level._zombiemode_check_firesale_loc_valid_func ]]() ) )
@ -175,9 +206,14 @@ treasure_chest_weapon_spawn( chest, player, respin )
if ( chance_of_joker > random ) if ( chance_of_joker > random )
{ {
self.weapon_string = undefined; self.weapon_string = undefined;
self.weapon_model = spawn( "script_model", self.origin + v_float );
self.weapon_model.angles = self.angles + vectorscale( ( 0, 1, 0 ), 90.0 ); // delete and respawn the joker model so that it faces the correct angle right away
origin = self.weapon_model.origin;
self.weapon_model delete();
self.weapon_model = spawn("script_model", origin);
self.weapon_model.angles = angles + vectorscale( ( 0, 1, 0 ), 90.0 );
self.weapon_model setmodel( level.chest_joker_model ); self.weapon_model setmodel( level.chest_joker_model );
self.weapon_model_dw hide();
self.chest_moving = 1; self.chest_moving = 1;
flag_set( "moving_chest_now" ); flag_set( "moving_chest_now" );
@ -191,13 +227,21 @@ treasure_chest_weapon_spawn( chest, player, respin )
if ( isdefined( player.pers_upgrades_awarded["box_weapon"] ) && player.pers_upgrades_awarded["box_weapon"] ) if ( isdefined( player.pers_upgrades_awarded["box_weapon"] ) && player.pers_upgrades_awarded["box_weapon"] )
rand = maps\mp\zombies\_zm_pers_upgrades_functions::pers_treasure_chest_choosespecialweapon( player ); rand = maps\mp\zombies\_zm_pers_upgrades_functions::pers_treasure_chest_choosespecialweapon( player );
else else
rand = treasure_chest_chooseweightedrandomweapon( player ); rand = treasure_chest_chooseweightedrandomweapon( player, rand );
modelname = getweaponmodel( rand );
self.weapon_string = rand; self.weapon_string = rand;
self.weapon_model = spawn_weapon_model( rand, undefined, self.origin + v_float, self.angles + vectorscale( ( 0, 1, 0 ), 180.0 ) ); self.weapon_model useweaponmodel( rand, modelname );
if ( weapon_is_dual_wield( rand ) ) if ( weapondualwieldweaponname( rand ) != "none" )
self.weapon_model_dw = spawn_weapon_model( rand, get_left_hand_weapon_model_name( rand ), self.weapon_model.origin - vectorscale( ( 1, 1, 1 ), 3.0 ), self.weapon_model.angles ); {
self.weapon_model_dw useweaponmodel( weapondualwieldweaponname( rand ), modelname );
self.weapon_model_dw show();
}
else
{
self.weapon_model_dw hide();
}
} }
self notify( "randomization_done" ); self notify( "randomization_done" );
@ -291,7 +335,7 @@ treasure_chest_weapon_spawn( chest, player, respin )
self notify( "box_spin_done" ); self notify( "box_spin_done" );
} }
treasure_chest_chooseweightedrandomweapon( player ) treasure_chest_chooseweightedrandomweapon( player, prev_weapon, add_to_acquired = 1 )
{ {
keys = array_randomize( getarraykeys( level.zombie_weapons ) ); keys = array_randomize( getarraykeys( level.zombie_weapons ) );
@ -311,12 +355,31 @@ treasure_chest_chooseweightedrandomweapon( player )
{ {
if (!isInArray(player.random_weapons_acquired, keys[i])) if (!isInArray(player.random_weapons_acquired, keys[i]))
{ {
if (isDefined(prev_weapon) && prev_weapon == keys[i])
{
continue;
}
if (add_to_acquired)
{
player.random_weapons_acquired[player.random_weapons_acquired.size] = keys[i]; player.random_weapons_acquired[player.random_weapons_acquired.size] = keys[i];
}
return keys[i]; return keys[i];
} }
} }
} }
if (isDefined(prev_weapon))
{
if (add_to_acquired)
{
player.random_weapons_acquired[player.random_weapons_acquired.size] = prev_weapon;
}
return prev_weapon;
}
if (player.random_weapons_acquired.size > 0) if (player.random_weapons_acquired.size > 0)
{ {
player.random_weapons_acquired = []; player.random_weapons_acquired = [];