From da2dc175fc0bb7394ea9b783dead1972f4148b74 Mon Sep 17 00:00:00 2001 From: Jbleezy Date: Thu, 28 Mar 2024 01:20:10 -0700 Subject: [PATCH] Die Rise: add Mystery Box at Blue Highrise area and Orange Highrise area --- README.md | 4 +- maps/mp/zm_highrise.d3dbsp | 72 +++++++++++++++++++ scripts/zm/_zm_reimagined.gsc | 55 +++++++++++--- scripts/zm/replaced/_zm_magicbox.gsc | 15 ++-- scripts/zm/replaced/zm_highrise.gsc | 16 +++++ .../zm/zm_highrise/zm_highrise_reimagined.gsc | 1 + 6 files changed, 142 insertions(+), 21 deletions(-) diff --git a/README.md b/README.md index 58c36685..671853d9 100644 --- a/README.md +++ b/README.md @@ -945,7 +945,9 @@ ### Die Rise * Added M27 to the Mystery Box * Added Fire Sale powerup -* Moved Mystery Box in Green Rooftop Behind Restaurant zone to Green Rooftop Restaurant zone +* Added Mystery Box at Blue Highrise area +* Added Mystery Box at Orange Highrise area +* Moved Mystery Box at Green Rooftop area from Green Rooftop Behind Restaurant zone to Green Rooftop Restaurant zone * Removed key * Elevators and escape pod can be called without key * Added purchase cost to call elevators and escape pod diff --git a/maps/mp/zm_highrise.d3dbsp b/maps/mp/zm_highrise.d3dbsp index 6130b01d..1caa2b15 100644 --- a/maps/mp/zm_highrise.d3dbsp +++ b/maps/mp/zm_highrise.d3dbsp @@ -25475,6 +25475,78 @@ "guid" "E50C8A7B" } { +"origin" "2406 -210 1309" +"angles" "0 150 0" +"targetname" "treasure_chest_use" +"zombie_cost" "950" +"classname" "script_struct" +"script_noteworthy" "blue_level4_chest" +"guid" "871F4145" +} +{ +"origin" "2406 -210 1309" +"script_noteworthy" "blue_level4_chest_zbarrier" +"type" "zmcore_MagicBox" +"angles" "0 150 0" +"barrieranimtime" "0" +"showalternatemodel" "0" +"showupgradedmodel" "0" +"zbarriernumboards" "5" +"zbarrierboardmodel1" "p6_anim_zm_magic_box_fake" +"zbarriertearanim1" "o_zombie_magic_box_fake_idle_twitch_b" +"zbarrierboardanim1" "o_zombie_magic_box_fake_idle_twitch_a" +"zbarrierboardmodel2" "p6_anim_zm_magic_box" +"zbarriertearanim2" "o_zombie_magic_box_arrive" +"zbarrierboardanim2" "o_zombie_magic_box_leave" +"zbarrierboardmodel3" "p6_anim_zm_magic_box" +"zbarriertearanim3" "o_zombie_magic_box_open" +"zbarrierboardanim3" "o_zombie_magic_box_close" +"zbarrierboardmodel4" "tag_origin" +"zbarriertearanim4" "o_zombie_magic_box_weapon_rise" +"zbarrierboardanim4" "o_zombie_magic_box_teddy_rise" +"zbarrierboardmodel5" "tag_origin" +"zbarriertearanim5" "o_zombie_magic_box_weapon_dual_rise" +"zbarrierboardanim5" "o_zombie_magic_box_teddy_rise" +"classname" "zbarrier_zmcore_MagicBox" +"guid" "879DA4D5" +} +{ +"origin" "2793 1867 1413" +"angles" "-12 0 180" +"targetname" "treasure_chest_use" +"zombie_cost" "950" +"classname" "script_struct" +"script_noteworthy" "orange_level3_chest" +"guid" "871F4146" +} +{ +"origin" "2793 1867 1542" +"script_noteworthy" "orange_level3_chest_zbarrier" +"type" "zmcore_MagicBox" +"angles" "-12 0 180" +"barrieranimtime" "0" +"showalternatemodel" "0" +"showupgradedmodel" "0" +"zbarriernumboards" "5" +"zbarrierboardmodel1" "p6_anim_zm_magic_box_fake" +"zbarriertearanim1" "o_zombie_magic_box_fake_idle_twitch_b" +"zbarrierboardanim1" "o_zombie_magic_box_fake_idle_twitch_a" +"zbarrierboardmodel2" "p6_anim_zm_magic_box" +"zbarriertearanim2" "o_zombie_magic_box_arrive" +"zbarrierboardanim2" "o_zombie_magic_box_leave" +"zbarrierboardmodel3" "p6_anim_zm_magic_box" +"zbarriertearanim3" "o_zombie_magic_box_open" +"zbarrierboardanim3" "o_zombie_magic_box_close" +"zbarrierboardmodel4" "tag_origin" +"zbarriertearanim4" "o_zombie_magic_box_weapon_rise" +"zbarrierboardanim4" "o_zombie_magic_box_teddy_rise" +"zbarrierboardmodel5" "tag_origin" +"zbarriertearanim5" "o_zombie_magic_box_weapon_dual_rise" +"zbarrierboardanim5" "o_zombie_magic_box_teddy_rise" +"classname" "zbarrier_zmcore_MagicBox" +"guid" "879DA4D6" +} +{ "fxanim_wait" ".25" "fxanim_scene_1" "wirespark_med_lrg" "classname" "script_model" diff --git a/scripts/zm/_zm_reimagined.gsc b/scripts/zm/_zm_reimagined.gsc index 26465ece..acf85a29 100644 --- a/scripts/zm/_zm_reimagined.gsc +++ b/scripts/zm/_zm_reimagined.gsc @@ -222,6 +222,14 @@ spawn_mystery_box_blocks_and_collision() { chests_to_spawn_ents[chests_to_spawn_ents.size] = chest; } + else if (chest.script_noteworthy == "blue_level4_chest") + { + chests_to_spawn_ents[chests_to_spawn_ents.size] = chest; + } + else if (chest.script_noteworthy == "orange_level3_chest") + { + chests_to_spawn_ents[chests_to_spawn_ents.size] = chest; + } } } @@ -237,20 +245,26 @@ spawn_mystery_box_blocks_and_collision() // spawn cinder blocks for (i = 0; i < 8; i++) { - block = spawn("script_model", chest.origin); - block.angles = chest.angles + (0, 90, 0); + block = spawn("script_model", chest.zbarrier.origin); + block.angles = chest.zbarrier.angles + (0, 90, 0); - block.origin += anglesToRight(chest.angles) * -5; - block.origin += anglesToForward(chest.angles) * (37.5 + (i % 4 * -25)); + // fix upside down box angles + if (abs(chest.zbarrier.angles[2]) >= 90) + { + block.angles = (0, block.angles[1], block.angles[2] + block.angles[0]); + } + + block.origin += anglesToRight(chest.zbarrier.angles) * -5; + block.origin += anglesToForward(chest.zbarrier.angles) * (37.5 + (i % 4 * -25)); if (i >= 4) { + block.origin += anglesToUp(chest.zbarrier.angles) * -12; block.angles += (0, 0, 90); - block.origin += anglesToUp(chest.angles) * -12; } else { - block.origin += anglesToUp(chest.angles) * -4; + block.origin += anglesToUp(chest.zbarrier.angles) * -4; } if (i % 4 == 0) @@ -270,17 +284,38 @@ spawn_mystery_box_blocks_and_collision() block.angles += (0, 22.5, 0); } + // fix upside down box angles + if (abs(chest.zbarrier.angles[2]) >= 90) + { + if (i % 4 == 0) + { + block.angles += (-8, 0, 4); + } + else if (i % 4 == 1) + { + block.angles += (5, 0, 1); + } + else if (i % 4 == 2) + { + block.angles += (-1, 0, 0); + } + else if (i % 4 == 3) + { + block.angles += (5, 0, 1); + } + } + block setModel("p_glo_cinder_block"); } // spawn collision for (i = 0; i < 3; i++) { - collision = spawn("script_model", chest.origin, 1); - collision.angles = chest.angles; + collision = spawn("script_model", chest.zbarrier.origin, 1); + collision.angles = chest.zbarrier.angles; - collision.origin += anglesToForward(chest.angles) * (32 + (i * -32)); - collision.origin += anglesToUp(chest.angles) * 64; + collision.origin += anglesToForward(chest.zbarrier.angles) * (32 + (i * -32)); + collision.origin += anglesToUp(chest.zbarrier.angles) * 64; collision setModel("collision_clip_32x32x128"); collision disconnectPaths(); diff --git a/scripts/zm/replaced/_zm_magicbox.gsc b/scripts/zm/replaced/_zm_magicbox.gsc index 0d3603ae..b2fefebf 100644 --- a/scripts/zm/replaced/_zm_magicbox.gsc +++ b/scripts/zm/replaced/_zm_magicbox.gsc @@ -414,7 +414,7 @@ treasure_chest_weapon_spawn(chest, player, respin) start_origin = self.origin; end_origin = self.origin + v_float; - angles = self.angles + (0, 180, 0); + angles = (self.angles + (0, 180, 0)) * (-1, 1, -1); if (level.script == "zm_tomb") { @@ -423,12 +423,6 @@ treasure_chest_weapon_spawn(chest, player, respin) 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]); - } - dw_offset = (anglesToForward(angles) * -3) + (anglesToRight(angles) * -3) + (anglesToUp(angles) * -3); self.weapon_model = spawn("script_model", start_origin); @@ -534,17 +528,18 @@ treasure_chest_weapon_spawn(chest, player, respin) { self.weapon_string = undefined; + joker_origin = self.weapon_model.origin; joker_angles = angles - vectorscale((0, 1, 0), 90.0); - if (angles[2] < 0) + if (abs(angles[2]) >= 90) { joker_angles = angles + vectorscale((0, 1, 0), 90.0); + joker_angles = (joker_angles[2] + 180, joker_angles[1], joker_angles[0] + 180) * (-1, 1, 1); } // 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 = spawn("script_model", joker_origin); self.weapon_model.angles = joker_angles; self.weapon_model setmodel(level.chest_joker_model); self.weapon_model_dw hide(); diff --git a/scripts/zm/replaced/zm_highrise.gsc b/scripts/zm/replaced/zm_highrise.gsc index 173cfb6c..0ac2c8fa 100644 --- a/scripts/zm/replaced/zm_highrise.gsc +++ b/scripts/zm/replaced/zm_highrise.gsc @@ -85,4 +85,20 @@ zclassic_preinit() level thread maps\mp\zombies\_zm_banking::main(); deposit_spot thread maps\mp\zombies\_zm_banking::bank_deposit_unitrigger(); withdraw_spot thread maps\mp\zombies\_zm_banking::bank_withdraw_unitrigger(); +} + +is_magic_box_in_inverted_building() +{ + b_is_in_inverted_building = 0; + a_boxes_in_inverted_building = array("start_chest", "orange_level3_chest"); + str_location = level.chests[level.chest_index].script_noteworthy; + assert(isdefined(str_location), "is_magic_box_in_inverted_building() can't find magic box location"); + + for (i = 0; i < a_boxes_in_inverted_building.size; i++) + { + if (a_boxes_in_inverted_building[i] == str_location) + b_is_in_inverted_building = 1; + } + + return b_is_in_inverted_building; } \ No newline at end of file diff --git a/scripts/zm/zm_highrise/zm_highrise_reimagined.gsc b/scripts/zm/zm_highrise/zm_highrise_reimagined.gsc index 17bfcbc1..8089ffb3 100644 --- a/scripts/zm/zm_highrise/zm_highrise_reimagined.gsc +++ b/scripts/zm/zm_highrise/zm_highrise_reimagined.gsc @@ -5,6 +5,7 @@ main() { replaceFunc(maps\mp\zm_highrise_sq::navcomputer_waitfor_navcard, scripts\zm\reimagined\_zm_sq::navcomputer_waitfor_navcard); + replaceFunc(maps\mp\zm_highrise::is_magic_box_in_inverted_building, scripts\zm\replaced\zm_highrise::is_magic_box_in_inverted_building); replaceFunc(maps\mp\zm_highrise_sq::init, scripts\zm\replaced\zm_highrise_sq::init); replaceFunc(maps\mp\zm_highrise_sq::sq_is_weapon_sniper, scripts\zm\replaced\zm_highrise_sq::sq_is_weapon_sniper); replaceFunc(maps\mp\zm_highrise_sq_atd::init, scripts\zm\replaced\zm_highrise_sq_atd::init);