From b20fc033e409e4931d7bc939e9cee32231c18e3b Mon Sep 17 00:00:00 2001 From: MrMiguel211 <60329473+MrMiguel211@users.noreply.github.com> Date: Sun, 21 Jul 2024 15:29:58 -0700 Subject: [PATCH 1/7] Fix Shorelines lighthouse cutscene skip not working if entered save station (#65) --- generated/json_data/skippable_cutscenes.jsonc | 43 +++++++++++++++---- 1 file changed, 35 insertions(+), 8 deletions(-) diff --git a/generated/json_data/skippable_cutscenes.jsonc b/generated/json_data/skippable_cutscenes.jsonc index f8079e08..94f88347 100644 --- a/generated/json_data/skippable_cutscenes.jsonc +++ b/generated/json_data/skippable_cutscenes.jsonc @@ -13972,7 +13972,7 @@ }, { "senderId": 131593, // [Relay] Relay One Shot Out - "targetId": 231092, // [SpecialFunction] Wall Unlock Cinematic Skip + "targetId": 131219, // [SpecialFunction] Wall Unlock Cinematic Skip "state": "ZERO", "message": "INCREMENT" }, @@ -13990,7 +13990,7 @@ }, { "senderId": 131088, // [Relay] One Shot End - "targetId": 231092, // [SpecialFunction] Wall Unlock Cinematic Skip + "targetId": 131219, // [SpecialFunction] Wall Unlock Cinematic Skip "state": "ZERO", "message": "DECREMENT" }, @@ -14001,31 +14001,31 @@ "message": "SET_TO_ZERO" }, { - "senderId": 231092, // [SpecialFunction] Wall Unlock Cinematic Skip + "senderId": 131219, // [SpecialFunction] Wall Unlock Cinematic Skip "targetId": 131088, // [Relay] One Shot End "state": "ZERO", "message": "SET_TO_ZERO" }, { - "senderId": 231092, // [SpecialFunction] Wall Unlock Cinematic Skip + "senderId": 131219, // [SpecialFunction] Wall Unlock Cinematic Skip "targetId": 131347, // [Platform] Platform_Blockage "state": "ZERO", "message": "NEXT" }, { - "senderId": 231092, // [SpecialFunction] Wall Unlock Cinematic Skip + "senderId": 131219, // [SpecialFunction] Wall Unlock Cinematic Skip "targetId": 131587, // [Timer] Timer - open spiderball hole "state": "ZERO", "message": "STOP" }, { - "senderId": 231092, // [SpecialFunction] Wall Unlock Cinematic Skip + "senderId": 131219, // [SpecialFunction] Wall Unlock Cinematic Skip "targetId": 131572, // [Camera] Cinematic Camera "state": "ZERO", "message": "DEACTIVATE" }, { - "senderId": 231092, // [SpecialFunction] Wall Unlock Cinematic Skip + "senderId": 131219, // [SpecialFunction] Wall Unlock Cinematic Skip "targetId": 131571, // [PlayerActor] PlayerActor-scan_cine_forward "state": "ZERO", "message": "DEACTIVATE" @@ -14051,7 +14051,7 @@ "layer": 4 }, { - "id": 231092, // [SpecialFunction] Wall Unlock Cinematic Skip + "id": 131219, // [SpecialFunction] Wall Unlock Cinematic Skip "type": "CinematicSkip" } ] @@ -16241,6 +16241,33 @@ } ] }, + "Save Station B": { + "addConnections": [ + { + "senderId": 262147, // [SpecialFunction] Player Exits Room + "targetId": 262262, // [SpecialFunction] SpecialFunction Cinematic Skip Load + "state": "EXITED", + "message": "DECREMENT" + }, + { + "senderId": 262147, // [SpecialFunction] Player Exits Room + "targetId": 262263, // [SpecialFunction] SpecialFunction Cinematic Skip Save + "state": "EXITED", + "message": "DECREMENT" + } + ], + "specialFunctions": [ + { + "id": 262147, // [SpecialFunction] Player Exits Room + "type": "PlayerInAreaRelay", + "position": [ + -70.700981, + -212.262238, + 0.032295 + ] + } + ] + }, "Transport to Magmoor Caverns South": { "deleteIds": [ 1900622 // [Timer] Timer - Delay End Of Cinematic From d35f77bf659db302c7fa325b2ce0e4e677a8911f Mon Sep 17 00:00:00 2001 From: JeffGainsNGames Date: Sun, 21 Jul 2024 18:38:06 -0400 Subject: [PATCH 2/7] Update Toaster's Champion names (#70) Co-authored-by: toasterparty --- src/custom_assets.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/custom_assets.rs b/src/custom_assets.rs index 51e5164a..89b777f8 100644 --- a/src/custom_assets.rs +++ b/src/custom_assets.rs @@ -705,7 +705,7 @@ pub fn custom_assets<'r>( vec![ "Toaster's Champions: Awp82, DiggleWrath, Yeti2000, freak532486, AlphaRage, Csabi,\0".to_string(), "\0".to_string(), - "BajaBlood, hammergoboom, Firemetroid, Lokir, MeriKatt, Cosmonawt, Haldadrin, RXM, Schwartz, Samuel, Miguel, chliu\0".to_string(), + "BajaBlood, hammergoboom, Firemetroid, Lokir, MeriKatt, Cosmonawt, Haldadrin, RXM, Schwartz, Samuel, Miguel, chliu, JeffGainsNGames\0".to_string(), ], 1, 0, From fa583b74b79b9e40245eba50926deba4fbcfe8da Mon Sep 17 00:00:00 2001 From: MrMiguel211 <60329473+MrMiguel211@users.noreply.github.com> Date: Sun, 21 Jul 2024 16:08:53 -0700 Subject: [PATCH 3/7] Minor cosmetic fixes (#74) - Fixed black bars not showing up in Elite Research bottom platform activation cutscene - Fixed black bars in Chozo Ice Temple statue cutscenes sometimes disappearing prematurely - Fixed screen fade ins from Arrival cutscenes in `Transport to Chozo Ruins East` and `Transport to Tallon Overworld South` not showing up when skipped Co-authored-by: toasterparty --- generated/json_data/qol.jsonc | 2 + generated/json_data/skippable_cutscenes.jsonc | 91 ++++++++----------- 2 files changed, 39 insertions(+), 54 deletions(-) diff --git a/generated/json_data/qol.jsonc b/generated/json_data/qol.jsonc index 5f1b4f53..345e3171 100644 --- a/generated/json_data/qol.jsonc +++ b/generated/json_data/qol.jsonc @@ -5899,12 +5899,14 @@ { "id": 524657, // [CameraFilterKeyframe] Camera Filter Keyframe WideScreen "color": [0, 0, 0, 1], + "filterIndex": 1, "filterType": "Multiply", "filterShape": "CinemaBars" }, { "id": 524816, // [CameraFilterKeyframe] Camera Filter Keyframe "color": [0, 0, 0, 1], + "filterIndex": 1, "filterType": "Multiply", "filterShape": "CinemaBars" } diff --git a/generated/json_data/skippable_cutscenes.jsonc b/generated/json_data/skippable_cutscenes.jsonc index 94f88347..222c7dff 100644 --- a/generated/json_data/skippable_cutscenes.jsonc +++ b/generated/json_data/skippable_cutscenes.jsonc @@ -10914,12 +10914,6 @@ "state": "INACTIVE", "message": "DECREMENT" }, - { - "senderId": 666666, // [Camera] Cinematic Camera Hold - "targetId": 42069, // [CameraFilterKeyframe] Camera Filter Keyframe Hold Black - "state": "INACTIVE", - "message": "DECREMENT" - }, { "senderId": 4128769, // [Dock] Dock "targetId": 666555, // [Timer] Load Timer @@ -11716,13 +11710,13 @@ }, { "senderId": 524805, // [Camera] Cinematic Camera - "targetId": 524657, // [CameraFilterKeyframe] Camera Filter Keyframe WideScreen + "targetId": 524816, // [CameraFilterKeyframe] Camera Filter Keyframe "state": "ACTIVE", "message": "INCREMENT" }, { "senderId": 524805, // [Camera] Cinematic Camera - "targetId": 524657, // [CameraFilterKeyframe] Camera Filter Keyframe WideScreen + "targetId": 524816, // [CameraFilterKeyframe] Camera Filter Keyframe "state": "INACTIVE", "message": "DECREMENT" }, @@ -11760,7 +11754,7 @@ }, { "senderId": 524290, // [Relay] Bomb Slot Cinematic Start - "targetId": 524293, // [SpecialFunction] SpecialFunction Cinematic Skip + "targetId": 524293, // [SpecialFunction] Bomb Slot Cinematic Skip "state": "ZERO", "message": "INCREMENT" }, @@ -11796,42 +11790,42 @@ }, { "senderId": 524292, // [Relay] Bomb Slot Cinematic End - "targetId": 524293, // [SpecialFunction] SpecialFunction Cinematic Skip + "targetId": 524293, // [SpecialFunction] Bomb Slot Cinematic Skip "state": "ZERO", "message": "DECREMENT" }, { - "senderId": 524293, // [SpecialFunction] SpecialFunction Cinematic Skip + "senderId": 524293, // [SpecialFunction] Bomb Slot Cinematic Skip "targetId": 524292, // [Relay] Bomb Slot Cinematic End "state": "ZERO", "message": "SET_TO_ZERO" }, { - "senderId": 524293, // [SpecialFunction] SpecialFunction Cinematic Skip + "senderId": 524293, // [SpecialFunction] Bomb Slot Cinematic Skip "targetId": 524650, // [Camera] Cinematic Camera "state": "ZERO", "message": "DEACTIVATE" }, { - "senderId": 524293, // [SpecialFunction] SpecialFunction Cinematic Skip + "senderId": 524293, // [SpecialFunction] Bomb Slot Cinematic Skip "targetId": 524656, // [Timer] Timer - Delay Grate Opening "state": "ZERO", "message": "STOP_AND_RESET" }, { - "senderId": 524293, // [SpecialFunction] SpecialFunction Cinematic Skip + "senderId": 524293, // [SpecialFunction] Bomb Slot Cinematic Skip "targetId": 524551, // [Platform] Platform - Upper Grate "state": "ZERO", "message": "DEACTIVATE" }, { - "senderId": 524293, // [SpecialFunction] SpecialFunction Cinematic Skip + "senderId": 524293, // [SpecialFunction] Bomb Slot Cinematic Skip "targetId": 524567, // [Platform] Platform - Upper Grate Final Position "state": "ZERO", "message": "ACTIVATE" }, { - "senderId": 524293, // [SpecialFunction] SpecialFunction Cinematic Skip + "senderId": 524293, // [SpecialFunction] Bomb Slot Cinematic Skip "targetId": 524726, // [MemoryRelay] Memory Relay - open gate "state": "ZERO", "message": "ACTIVATE" @@ -11844,13 +11838,13 @@ }, { "senderId": 524294, // [Relay] Wallbreak Cinema Start - "targetId": 524296, // [SpecialFunction] SpecialFunction Cinematic Skip + "targetId": 524296, // [SpecialFunction] Wall Destruction Cinematic Skip "state": "ZERO", "message": "INCREMENT" }, { "senderId": 524294, // [Relay] Wallbreak Cinema Start - "targetId": 524657, // [CameraFilterKeyframe] Camera Filter Keyframe WideScreen + "targetId": 524816, // [CameraFilterKeyframe] Camera Filter Keyframe "state": "ZERO", "message": "INCREMENT" }, @@ -11928,66 +11922,66 @@ }, { "senderId": 524295, // [Relay] Wallbreak Cinema End - "targetId": 524657, // [CameraFilterKeyframe] Camera Filter Keyframe WideScreen + "targetId": 524816, // [CameraFilterKeyframe] Camera Filter Keyframe "state": "ZERO", "message": "DECREMENT" }, { "senderId": 524295, // [Relay] Wallbreak Cinema End - "targetId": 524296, // [SpecialFunction] SpecialFunction Cinematic Skip + "targetId": 524296, // [SpecialFunction] Wall Destruction Cinematic Skip "state": "ZERO", "message": "DECREMENT" }, { - "senderId": 524296, // [SpecialFunction] SpecialFunction Cinematic Skip + "senderId": 524296, // [SpecialFunction] Wall Destruction Cinematic Skip "targetId": 524295, // [Relay] Wallbreak Cinema End "state": "ZERO", "message": "SET_TO_ZERO" }, { - "senderId": 524296, // [SpecialFunction] SpecialFunction Cinematic Skip + "senderId": 524296, // [SpecialFunction] Wall Destruction Cinematic Skip "targetId": 524790, // [Platform] Platform_arms_up "state": "ZERO", "message": "DEACTIVATE" }, { - "senderId": 524296, // [SpecialFunction] SpecialFunction Cinematic Skip + "senderId": 524296, // [SpecialFunction] Wall Destruction Cinematic Skip "targetId": 524801, // [Timer] Timer_pause for drop "state": "ZERO", "message": "STOP_AND_RESET" }, { - "senderId": 524296, // [SpecialFunction] SpecialFunction Cinematic Skip + "senderId": 524296, // [SpecialFunction] Wall Destruction Cinematic Skip "targetId": 524787, // [Actor] Actor_arms_anim "state": "ZERO", "message": "DEACTIVATE" }, { - "senderId": 524296, // [SpecialFunction] SpecialFunction Cinematic Skip + "senderId": 524296, // [SpecialFunction] Wall Destruction Cinematic Skip "targetId": 524805, // [Camera] Cinematic Camera "state": "ZERO", "message": "DEACTIVATE" }, { - "senderId": 524296, // [SpecialFunction] SpecialFunction Cinematic Skip + "senderId": 524296, // [SpecialFunction] Wall Destruction Cinematic Skip "targetId": 524803, // [Timer] Timer_dooropen_pause "state": "ZERO", "message": "STOP_AND_RESET" }, { - "senderId": 524296, // [SpecialFunction] SpecialFunction Cinematic Skip + "senderId": 524296, // [SpecialFunction] Wall Destruction Cinematic Skip "targetId": 524789, // [Platform] Platform_arms_down "state": "ZERO", "message": "ACTIVATE" }, { - "senderId": 524296, // [SpecialFunction] SpecialFunction Cinematic Skip + "senderId": 524296, // [SpecialFunction] Wall Destruction Cinematic Skip "targetId": 524876, // [SpecialFunction] SpecialFunction PlayerFollowLocator "state": "ZERO", "message": "DEACTIVATE" }, { - "senderId": 524296, // [SpecialFunction] SpecialFunction Cinematic Skip + "senderId": 524296, // [SpecialFunction] Wall Destruction Cinematic Skip "targetId": 524297, // [Relay] Destroy Wall Cutscene Skip "state": "ZERO", "message": "SET_TO_ZERO" @@ -12012,7 +12006,7 @@ }, { "senderId": 524298, // [Relay] Decrement Ice Cinematic Start - "targetId": 524300, // [SpecialFunction] SpecialFunction Cinematic Skip + "targetId": 524300, // [SpecialFunction] Ice Melting Cinematic Skip "state": "ZERO", "message": "INCREMENT" }, @@ -12024,7 +12018,7 @@ }, { "senderId": 524299, // [Relay] Decrement Ice Cinematic End - "targetId": 524300, // [SpecialFunction] SpecialFunction Cinematic Skip + "targetId": 524300, // [SpecialFunction] Ice Melting Cinematic Skip "state": "ZERO", "message": "DECREMENT" }, @@ -12035,52 +12029,46 @@ "message": "SET_TO_ZERO" }, { - "senderId": 524300, // [SpecialFunction] SpecialFunction Cinematic Skip + "senderId": 524300, // [SpecialFunction] Ice Melting Cinematic Skip "targetId": 524299, // [Relay] Decrement Ice Cinematic End "state": "ZERO", "message": "SET_TO_ZERO" }, { - "senderId": 524300, // [SpecialFunction] SpecialFunction Cinematic Skip + "senderId": 524300, // [SpecialFunction] Ice Melting Cinematic Skip "targetId": 524902, // [Camera] Cinematic Camera "state": "ZERO", "message": "DEACTIVATE" }, { - "senderId": 524300, // [SpecialFunction] SpecialFunction Cinematic Skip + "senderId": 524300, // [SpecialFunction] Ice Melting Cinematic Skip "targetId": 524797, // [Timer] Timer_start hand trigger "state": "ZERO", "message": "STOP_AND_RESET" }, { - "senderId": 524300, // [SpecialFunction] SpecialFunction Cinematic Skip + "senderId": 524300, // [SpecialFunction] Ice Melting Cinematic Skip "targetId": 524798, // [Trigger] Trigger_ballstart "state": "ZERO", "message": "ACTIVATE" }, { - "senderId": 524300, // [SpecialFunction] SpecialFunction Cinematic Skip + "senderId": 524300, // [SpecialFunction] Ice Melting Cinematic Skip "targetId": 524804, // [Timer] Timer_allice_deactivate "state": "ZERO", "message": "RESET_AND_START" }, { - "senderId": 524300, // [SpecialFunction] SpecialFunction Cinematic Skip + "senderId": 524300, // [SpecialFunction] Ice Melting Cinematic Skip "targetId": 524901, // [Effect] Effect-Bluelight "state": "ZERO", "message": "ACTIVATE" }, { - "senderId": 524300, // [SpecialFunction] SpecialFunction Cinematic Skip + "senderId": 524300, // [SpecialFunction] Ice Melting Cinematic Skip "targetId": 524900, // [Sound] Sound-Glowsound "state": "ZERO", "message": "PLAY" - }, - { - "senderId": 524300, // [SpecialFunction] SpecialFunction Cinematic Skip - "targetId": 524299, // [Relay] Decrement Ice Cinematic End - "state": "ZERO", - "message": "SET_TO_ZERO" } ], "relays": [ @@ -12109,15 +12097,15 @@ ], "specialFunctions": [ { - "id": 524293, // [SpecialFunction] SpecialFunction Cinematic Skip + "id": 524293, // [SpecialFunction] Bomb Slot Cinematic Skip "type": "CinematicSkip" }, { - "id": 524296, // [SpecialFunction] SpecialFunction Cinematic Skip + "id": 524296, // [SpecialFunction] Wall Destruction Cinematic Skip "type": "CinematicSkip" }, { - "id": 524300, // [SpecialFunction] SpecialFunction Cinematic Skip + "id": 524300, // [SpecialFunction] Ice Melting Cinematic Skip "type": "CinematicSkip" } ] @@ -19341,12 +19329,6 @@ "state": "ZERO", "message": "DEACTIVATE" }, - { - "senderId": 1441796, // [SpecialFunction] Arrival Cinematic Skip - "targetId": 1441878, // [CameraFilterKeyframe] cinema bars - "state": "ZERO", - "message": "DECREMENT" - }, { "senderId": 1441796, // [SpecialFunction] Arrival Cinematic Skip "targetId": 1441913, // [SpecialFunction] SpecialFunction - Display Billboard @@ -19448,6 +19430,7 @@ "id": 42069, // [CameraFilterKeyframe] Camera Filter Keyframe Hold Black "filterType": "Multiply", "filterShape": "Fullscreen", + "fadeOutTime": 0.5, "filterIndex": 2 } ] @@ -23176,7 +23159,7 @@ { "senderId": 852694, // [Relay] Relay One Shot Out "targetId": 852702, // [CameraFilterKeyframe] Camera Filter Keyframe Widescreen - "state": "ACTIVE", + "state": "ZERO", "message": "INCREMENT" }, { From b667b7ca7c03663f9ab7230e29f0fcbe6a13d815 Mon Sep 17 00:00:00 2001 From: MrMiguel211 <60329473+MrMiguel211@users.noreply.github.com> Date: Sun, 21 Jul 2024 16:30:14 -0700 Subject: [PATCH 4/7] Fix Ruined Courtyard Thermal Conduit patch oversight (#71) Co-authored-by: toasterparty --- src/patches.rs | 52 +++++++++++++++++++------------------------------- 1 file changed, 20 insertions(+), 32 deletions(-) diff --git a/src/patches.rs b/src/patches.rs index df7e4da6..ff007732 100644 --- a/src/patches.rs +++ b/src/patches.rs @@ -8017,51 +8017,39 @@ fn patch_ruined_courtyard_thermal_conduits( area: &mut mlvl_wrapper::MlvlArea, version: Version, ) -> Result<(), String> { - let scly = area.mrea().scly_section_mut(); - let layer = &mut scly.layers.as_mut_vec()[0]; - let thermal_conduit_damageable_trigger_obj_id = 0xF01C8; - let thermal_conduit_actor_obj_id = 0xF01C7; - let debris_generator_obj_id = 0xF01DD; - let thermal_conduit_cover_actor_obj_id = 0xF01D9; - - layer - .objects - .as_mut_vec() + let layer = area + .mrea() + .scly_section_mut() + .layers .iter_mut() - .find(|obj| obj.instance_id == thermal_conduit_damageable_trigger_obj_id) - .and_then(|obj| obj.property_data.as_damageable_trigger_mut()) - .unwrap() - .active = 1; + .next() + .unwrap(); if version == Version::NtscU0_02 { - layer - .objects - .as_mut_vec() + + let objects = layer.objects.as_mut_vec(); + // Thermal Conduit Actor + objects .iter_mut() - .find(|obj| obj.instance_id == thermal_conduit_actor_obj_id) + .find(|obj: &&mut structs::SclyObject| obj.instance_id & 0x00FFFFFF == 0xF01C7) .and_then(|obj| obj.property_data.as_actor_mut()) .unwrap() .active = 1; + + // Damageable Trigger Activation Relay + objects + .iter_mut() + .find(|obj| obj.instance_id & 0x00FFFFFF == 0xF0312) + .and_then(|obj| obj.property_data.as_relay_mut()) + .unwrap() + .active = 1; + } else if version == Version::NtscJ || version == Version::Pal || version == Version::NtscUTrilogy || version == Version::NtscJTrilogy || version == Version::PalTrilogy { - layer - .objects - .as_mut_vec() - .iter_mut() - .find(|obj| obj.instance_id == debris_generator_obj_id) - .unwrap() - .connections - .as_mut_vec() - .push(structs::Connection { - state: structs::ConnectionState::ZERO, - message: structs::ConnectionMsg::DEACTIVATE, - target_object_id: thermal_conduit_cover_actor_obj_id, - }); - let flags = &mut area.layer_flags.flags; *flags |= 1 << 6; // Turn on "Thermal Target" } From 498f43461dec01f1d19c205a16a894ee69767868 Mon Sep 17 00:00:00 2001 From: toasterparty Date: Mon, 22 Jul 2024 14:14:38 -0700 Subject: [PATCH 5/7] Fix central dynamo blast shield crash --- src/patch_config.rs | 2 + src/patches.rs | 126 +++++++++++++++++++++++++++++++++++++++----- 2 files changed, 115 insertions(+), 13 deletions(-) diff --git a/src/patch_config.rs b/src/patch_config.rs index eb79abef..7ac32c41 100644 --- a/src/patch_config.rs +++ b/src/patch_config.rs @@ -1369,7 +1369,9 @@ pub struct PatchConfig { pub comment: String, pub main_menu_message: String, + #[serde(skip_serializing)] // skipped for competitive integrity reasons pub credits_string: Option, + pub results_string: Option, pub artifact_hints: Option>, // e.g. "Strength":"This item can be found in Ruined Fountain" pub required_artifact_count: Option, diff --git a/src/patches.rs b/src/patches.rs index ff007732..f1856548 100644 --- a/src/patches.rs +++ b/src/patches.rs @@ -8026,7 +8026,6 @@ fn patch_ruined_courtyard_thermal_conduits( .unwrap(); if version == Version::NtscU0_02 { - let objects = layer.objects.as_mut_vec(); // Thermal Conduit Actor objects @@ -8035,7 +8034,7 @@ fn patch_ruined_courtyard_thermal_conduits( .and_then(|obj| obj.property_data.as_actor_mut()) .unwrap() .active = 1; - + // Damageable Trigger Activation Relay objects .iter_mut() @@ -8043,7 +8042,6 @@ fn patch_ruined_courtyard_thermal_conduits( .and_then(|obj| obj.property_data.as_relay_mut()) .unwrap() .active = 1; - } else if version == Version::NtscJ || version == Version::Pal || version == Version::NtscUTrilogy @@ -8669,11 +8667,7 @@ fn patch_remove_cutscenes( Ok(()) } -/** - * Patch is actually for QAA - * - */ -fn patch_fix_central_dynamo_crash( +fn patch_purge_debris_extended( _ps: &mut PatcherState, area: &mut mlvl_wrapper::MlvlArea, ) -> Result<(), String> { @@ -8682,12 +8676,102 @@ fn patch_fix_central_dynamo_crash( layer .objects .as_mut_vec() - .retain(|obj| ![0x45].contains(&obj.property_data.object_type())); + .retain(|obj| !obj.property_data.is_debris_extended()); } Ok(()) } +/** + * Patch is actually for QAA + * + */ +fn patch_fix_central_dynamo_crash( + _ps: &mut PatcherState, + area: &mut mlvl_wrapper::MlvlArea, +) -> Result<(), String> { + let timer_id = area.new_object_id_from_layer_id(0); + + let scly = area.mrea().scly_section_mut(); + let objects = scly.layers.as_mut_vec()[0].objects.as_mut_vec(); + + // Decouple door-unlocking from maze disabling + let obj = objects + .iter_mut() + .find(|obj| obj.instance_id == 0x001B03FA) // Deactivate Maze Relay + .unwrap(); + obj.connections + .as_mut_vec() + .retain(|conn| conn.target_object_id != 0x001B065E); // Activate Rooms Relay + + // Always close the maze entrance when disabling the maze walls + obj.connections.as_mut_vec().push(structs::Connection { + state: structs::ConnectionState::ZERO, + message: structs::ConnectionMsg::ACTIVATE, + target_object_id: 0x001B02F2, // Maze Entrance Door + }); + + // Disallow the deactivation of the maze until it's actually enabled + objects.push(structs::SclyObject { + instance_id: timer_id, + property_data: structs::Timer { + name: b"my timer\0".as_cstr(), + start_time: 0.04, // but only after a couple of frames because of the memory relay + max_random_add: 0.0, + looping: 0, + start_immediately: 1, + active: 1, + } + .into(), + connections: vec![structs::Connection { + target_object_id: 0x001B03FA, // Deactivate Maze Relay + state: structs::ConnectionState::ZERO, + message: structs::ConnectionMsg::DEACTIVATE, + }] + .into(), + }); + + // Have the pickup unlock the doors instead of maze deactivation + let obj = objects + .iter_mut() + .find(|obj| obj.instance_id == 0x001B04B1) // Pickup + .unwrap(); + obj.connections.as_mut_vec().push(structs::Connection { + state: structs::ConnectionState::ARRIVED, + message: structs::ConnectionMsg::SET_TO_ZERO, + target_object_id: 0x001B065E, // Activate Rooms Relay + }); + + // Re-allow deactivation of the maze once it's actually activated + let obj = objects + .iter_mut() + .find(|obj| obj.instance_id == 0x001B0305) // Pop Foot Relay + .unwrap(); + obj.connections.as_mut_vec().push(structs::Connection { + state: structs::ConnectionState::ZERO, + message: structs::ConnectionMsg::ACTIVATE, + target_object_id: 0x001B03FA, // Deactivate Maze Relay + }); + + // Whenever the door to QAA is interacted with, attempt to disable the maze + let obj = objects + .iter_mut() + .find(|obj| obj.instance_id == 0x001B0474) // Door to QAA + .unwrap(); + obj.connections.as_mut_vec().push(structs::Connection { + state: structs::ConnectionState::OPEN, + message: structs::ConnectionMsg::SET_TO_ZERO, + target_object_id: 0x001B03FA, // Deactivate Maze Relay + }); + obj.connections.as_mut_vec().push(structs::Connection { + state: structs::ConnectionState::CLOSED, + message: structs::ConnectionMsg::SET_TO_ZERO, + target_object_id: 0x001B03FA, // Deactivate Maze Relay + }); + + Ok(()) +} + fn patch_main_quarry_door_lock_pal( _ps: &mut PatcherState, area: &mut mlvl_wrapper::MlvlArea, @@ -13882,12 +13966,20 @@ fn patch_qol_game_breaking( ) { // Crashes patcher.add_scly_patch( - resource_info!("00j_mines_connect.MREA").into(), + resource_info!("07_mines_electric.MREA").into(), patch_fix_central_dynamo_crash, ); patcher.add_scly_patch( - resource_info!("05_under_intro_zoo.MREA").into(), // stop crashing from too much stuff in biohazard containment + our patches - patch_fix_central_dynamo_crash, + resource_info!("07_mines_electric.MREA").into(), + patch_purge_debris_extended, + ); + patcher.add_scly_patch( + resource_info!("00j_mines_connect.MREA").into(), + patch_purge_debris_extended, + ); + patcher.add_scly_patch( + resource_info!("05_under_intro_zoo.MREA").into(), + patch_purge_debris_extended, ); patcher.add_scly_patch( resource_info!("00p_mines_connect.MREA").into(), @@ -16870,7 +16962,15 @@ fn build_and_run_patches<'r>( // Some doors have their object IDs changed in non NTSC-U versions // NTSC-K is based on NTSC-U and shouldn't be part of those changes - if [Version::Pal, Version::NtscJ, Version::NtscJTrilogy, Version::NtscUTrilogy, Version::PalTrilogy].contains(&config.version) { + if [ + Version::Pal, + Version::NtscJ, + Version::NtscJTrilogy, + Version::NtscUTrilogy, + Version::PalTrilogy, + ] + .contains(&config.version) + { // Tallon Overworld - Temple Security Station if mrea_id == 0xBDB1FCAC && local_dl.door_location.unwrap().instance_id == 0x00070055 From fcb30c71cd3e847dc86bd356f7867c3383f89252 Mon Sep 17 00:00:00 2001 From: toasterparty Date: Mon, 22 Jul 2024 14:33:15 -0700 Subject: [PATCH 6/7] Fix deck beta security hall blast shield crash --- src/patches.rs | 100 +++++++++++++++++++++++++++++++++++++++++++++++-- 1 file changed, 96 insertions(+), 4 deletions(-) diff --git a/src/patches.rs b/src/patches.rs index f1856548..9ab28697 100644 --- a/src/patches.rs +++ b/src/patches.rs @@ -8682,10 +8682,98 @@ fn patch_purge_debris_extended( Ok(()) } -/** - * Patch is actually for QAA - * - */ +fn patch_fix_deck_beta_security_hall_crash( + _ps: &mut PatcherState, + area: &mut mlvl_wrapper::MlvlArea, +) -> Result<(), String> { + let trigger1_id = area.new_object_id_from_layer_id(0); + let trigger2_id = area.new_object_id_from_layer_id(0); + + let scly = area.mrea().scly_section_mut(); + let objects = scly.layers.as_mut_vec()[0].objects.as_mut_vec(); + + // Insert our own load triggers + objects.extend_from_slice( + &[ + structs::SclyObject { + instance_id: trigger1_id, + property_data: structs::Trigger { + name: b"Trigger\0".as_cstr(), + position: [-86.4, 265.1, -67.6].into(), + scale: [10.0, 5.0, 10.0].into(), + damage_info: structs::scly_structs::DamageInfo { + weapon_type: 0, + damage: 0.0, + radius: 0.0, + knockback_power: 0.0, + }, + force: [0.0, 0.0, 0.0].into(), + flags: 1, + active: 1, + deactivate_on_enter: 0, + deactivate_on_exit: 0, + } + .into(), + connections: vec![ + structs::Connection { + state: structs::ConnectionState::ENTERED, + message: structs::ConnectionMsg::SET_TO_ZERO, + target_object_id: 0x001F0001, + }, + structs::Connection { + state: structs::ConnectionState::ENTERED, + message: structs::ConnectionMsg::SET_TO_MAX, + target_object_id: 0x001F0002, + }, + ] + .into(), + }, + structs::SclyObject { + instance_id: trigger2_id, + property_data: structs::Trigger { + name: b"Trigger\0".as_cstr(), + position: [-94.5, 272.3, -68.6].into(), + scale: [5.0, 10.0, 10.0].into(), + damage_info: structs::scly_structs::DamageInfo { + weapon_type: 0, + damage: 0.0, + radius: 0.0, + knockback_power: 0.0, + }, + force: [0.0, 0.0, 0.0].into(), + flags: 1, + active: 1, + deactivate_on_enter: 0, + deactivate_on_exit: 0, + } + .into(), + connections: vec![ + structs::Connection { + state: structs::ConnectionState::ENTERED, + message: structs::ConnectionMsg::SET_TO_ZERO, + target_object_id: 0x001F0002, + }, + structs::Connection { + state: structs::ConnectionState::ENTERED, + message: structs::ConnectionMsg::SET_TO_MAX, + target_object_id: 0x001F0001, + }, + ] + .into(), + }, + ] + ); + + // Disable auto-loading of adjacent rooms + for obj in objects { + if let Some(dock) = obj.property_data.as_dock_mut() { + dock.load_connected = 0; + } + } + + Ok(()) +} + fn patch_fix_central_dynamo_crash( _ps: &mut PatcherState, area: &mut mlvl_wrapper::MlvlArea, @@ -13977,6 +14065,10 @@ fn patch_qol_game_breaking( resource_info!("00j_mines_connect.MREA").into(), patch_purge_debris_extended, ); + patcher.add_scly_patch( + resource_info!("00d_under_intro_hall.MREA").into(), + patch_fix_deck_beta_security_hall_crash, + ); patcher.add_scly_patch( resource_info!("05_under_intro_zoo.MREA").into(), patch_purge_debris_extended, From 6032bb849113b2dfe6438785ccb0079b14b9327e Mon Sep 17 00:00:00 2001 From: toasterparty Date: Mon, 22 Jul 2024 17:17:23 -0700 Subject: [PATCH 7/7] Fix Major cutscene skip export error --- src/patches.rs | 191 +++++++++++++++++++++++++------------------------ 1 file changed, 96 insertions(+), 95 deletions(-) diff --git a/src/patches.rs b/src/patches.rs index 9ab28697..0c8e2b4c 100644 --- a/src/patches.rs +++ b/src/patches.rs @@ -8693,76 +8693,74 @@ fn patch_fix_deck_beta_security_hall_crash( let objects = scly.layers.as_mut_vec()[0].objects.as_mut_vec(); // Insert our own load triggers - objects.extend_from_slice( - &[ - structs::SclyObject { - instance_id: trigger1_id, - property_data: structs::Trigger { - name: b"Trigger\0".as_cstr(), - position: [-86.4, 265.1, -67.6].into(), - scale: [10.0, 5.0, 10.0].into(), - damage_info: structs::scly_structs::DamageInfo { - weapon_type: 0, - damage: 0.0, - radius: 0.0, - knockback_power: 0.0, - }, - force: [0.0, 0.0, 0.0].into(), - flags: 1, - active: 1, - deactivate_on_enter: 0, - deactivate_on_exit: 0, - } - .into(), - connections: vec![ - structs::Connection { - state: structs::ConnectionState::ENTERED, - message: structs::ConnectionMsg::SET_TO_ZERO, - target_object_id: 0x001F0001, - }, - structs::Connection { - state: structs::ConnectionState::ENTERED, - message: structs::ConnectionMsg::SET_TO_MAX, - target_object_id: 0x001F0002, - }, - ] - .into(), - }, - structs::SclyObject { - instance_id: trigger2_id, - property_data: structs::Trigger { - name: b"Trigger\0".as_cstr(), - position: [-94.5, 272.3, -68.6].into(), - scale: [5.0, 10.0, 10.0].into(), - damage_info: structs::scly_structs::DamageInfo { - weapon_type: 0, - damage: 0.0, - radius: 0.0, - knockback_power: 0.0, - }, - force: [0.0, 0.0, 0.0].into(), - flags: 1, - active: 1, - deactivate_on_enter: 0, - deactivate_on_exit: 0, - } - .into(), - connections: vec![ - structs::Connection { - state: structs::ConnectionState::ENTERED, - message: structs::ConnectionMsg::SET_TO_ZERO, - target_object_id: 0x001F0002, - }, - structs::Connection { - state: structs::ConnectionState::ENTERED, - message: structs::ConnectionMsg::SET_TO_MAX, - target_object_id: 0x001F0001, - }, - ] - .into(), - }, - ] - ); + objects.extend_from_slice(&[ + structs::SclyObject { + instance_id: trigger1_id, + property_data: structs::Trigger { + name: b"Trigger\0".as_cstr(), + position: [-86.4, 265.1, -67.6].into(), + scale: [10.0, 5.0, 10.0].into(), + damage_info: structs::scly_structs::DamageInfo { + weapon_type: 0, + damage: 0.0, + radius: 0.0, + knockback_power: 0.0, + }, + force: [0.0, 0.0, 0.0].into(), + flags: 1, + active: 1, + deactivate_on_enter: 0, + deactivate_on_exit: 0, + } + .into(), + connections: vec![ + structs::Connection { + state: structs::ConnectionState::ENTERED, + message: structs::ConnectionMsg::SET_TO_ZERO, + target_object_id: 0x001F0001, + }, + structs::Connection { + state: structs::ConnectionState::ENTERED, + message: structs::ConnectionMsg::SET_TO_MAX, + target_object_id: 0x001F0002, + }, + ] + .into(), + }, + structs::SclyObject { + instance_id: trigger2_id, + property_data: structs::Trigger { + name: b"Trigger\0".as_cstr(), + position: [-94.5, 272.3, -68.6].into(), + scale: [5.0, 10.0, 10.0].into(), + damage_info: structs::scly_structs::DamageInfo { + weapon_type: 0, + damage: 0.0, + radius: 0.0, + knockback_power: 0.0, + }, + force: [0.0, 0.0, 0.0].into(), + flags: 1, + active: 1, + deactivate_on_enter: 0, + deactivate_on_exit: 0, + } + .into(), + connections: vec![ + structs::Connection { + state: structs::ConnectionState::ENTERED, + message: structs::ConnectionMsg::SET_TO_ZERO, + target_object_id: 0x001F0002, + }, + structs::Connection { + state: structs::ConnectionState::ENTERED, + message: structs::ConnectionMsg::SET_TO_MAX, + target_object_id: 0x001F0001, + }, + ] + .into(), + }, + ]); // Disable auto-loading of adjacent rooms for obj in objects { @@ -16213,15 +16211,6 @@ fn build_and_run_patches<'r>( ); } - if config.qol_cutscenes == CutsceneMode::Major - && is_elevator(room_info.room_id.to_u32()) - { - patcher.add_scly_patch( - (pak_name.as_bytes(), room_info.room_id.to_u32()), - move |ps, area| patch_remove_cutscenes(ps, area, vec![], vec![], true), - ); - } - let map_default_state = { let mut map_default_state = config.map_default_state; if let Some(level) = level_data.get(world.to_json_key()) { @@ -17364,22 +17353,6 @@ fn build_and_run_patches<'r>( ); let skip_frigate = skip_frigate && starting_room.mlvl != World::FrigateOrpheon.mlvl(); - match config.qol_cutscenes { - CutsceneMode::Original => {} - CutsceneMode::Skippable => {} - CutsceneMode::SkippableCompetitive => {} - CutsceneMode::Competitive => { - patch_qol_competitive_cutscenes(&mut patcher, config.version, skip_frigate); - } - CutsceneMode::Minor => { - patch_qol_minor_cutscenes(&mut patcher, config.version); - } - CutsceneMode::Major => { - patch_qol_minor_cutscenes(&mut patcher, config.version); - patch_qol_major_cutscenes(&mut patcher, config.shuffle_pickup_position); - } - } - let mut smoother_teleports = false; for (_, level) in level_data.iter() { if smoother_teleports { @@ -18580,6 +18553,34 @@ fn build_and_run_patches<'r>( ); } + /* Run these last for legacy support reasons */ + match config.qol_cutscenes { + CutsceneMode::Original => {} + CutsceneMode::Skippable => {} + CutsceneMode::SkippableCompetitive => {} + CutsceneMode::Competitive => { + patch_qol_competitive_cutscenes(&mut patcher, config.version, skip_frigate); + } + CutsceneMode::Minor => { + patch_qol_minor_cutscenes(&mut patcher, config.version); + } + CutsceneMode::Major => { + patch_qol_minor_cutscenes(&mut patcher, config.version); + patch_qol_major_cutscenes(&mut patcher, config.shuffle_pickup_position); + + for (pak_name, rooms) in pickup_meta::ROOM_INFO.iter() { + for room_info in rooms.iter() { + if is_elevator(room_info.room_id.to_u32()) { + patcher.add_scly_patch( + (pak_name.as_bytes(), room_info.room_id.to_u32()), + move |ps, area| patch_remove_cutscenes(ps, area, vec![], vec![], true), + ); + } + } + } + } + } + patcher.run(gc_disc)?; Ok(())