Archipelago/worlds/lufia2ac
el-u b7111eeccc
lufia2ac: fix disappearing Ancient key (#2537)
Since the coop update, the Ancient key (which is always the reward for defeating the boss) would disappear when leaving the cave, making it impossible to open the locked door behind the Ancient Cave entrance counter. While this is basically cosmetic and has no adverse effects on the multiworld (as the door does not lead to any multiworld locations and is only accessible after defeating the final boss anyway), players may still want to enter this room as part of a ritual to celebrate their victory.

Why does this happen? The game keeps track of two different inventories, one for outside and another one for the cave dive. When entering or leaving the cave, important things such as blue chest items and Iris treasures are automatically copied to the other inventory. However, it turns out that the Ancient key doesn't participate in this mechanism. Instead, the script that runs when exiting the cave checks whether event flag 0xC3 is set, and if it is on, it calls a script action that adds the key item to the outside inventory. (Whether or not the player actually had the key item in their in-cave inventory is not checked at all; only the flag matters.)

In the unmodified game, that flag is set by the cutscene script that awards the key. It actually sets two event flags, 0xC3 and 0xD1. The latter is used by the game when trying to display the boss in the cafe basement and is used by AP as the indicator that the boss goal was completed. With the coop update, the event script method that created the key was intercepted and modified to send out a location check instead. That location always has the Ancient key as a fixed item placement; the benefit of handling it as a remote item is that in this way the key essentially serves as a signal that transmits the information of the boss' defeat to all clients cooping on the slot. When receiving the key, however, the custom ASM did only set flag 0xD1. As part of the bugfix, it is now changed to set flag 0xC3 as well.

But that alone is still not enough to make it work. The subroutine that is called by the game to create the key when exiting the cave with flag 0xC3 is the same subroutine that gets called in the cutscene that originally tried to award the key. But that's the one that has been rewritten to send the location check instead. So instead of creating the key when leaving the cave, it would just send the same location check again, effectively doing nothing. Therefore, the other part of the bugfix is to only intercept this subroutine if the player is currently on the Ancient Cave Final Floor (where the cutscene takes place), thus making it possible to recreate the key item when exiting.
2023-12-04 00:06:52 +01:00
..
basepatch lufia2ac: fix disappearing Ancient key (#2537) 2023-12-04 00:06:52 +01:00
docs lufia2ac: prevent "door stairs" and "rare stairs" (#2341) 2023-10-23 22:20:27 +02:00
test lufia2ac: coop support + update AP version number to 0.4.2 (#1868) 2023-06-29 08:06:58 -05:00
Client.py lufia2ac: fix client behavior at max blue chests combined with party member or capsule monster shuffle (#2478) 2023-11-24 01:59:41 +01:00
Enemies.py lufia2ac: new features, bug fixes, and more (#1549) 2023-03-20 17:04:57 +01:00
Items.py lufia2ac: add shops to the cave (#2103) 2023-10-21 23:27:30 +02:00
Locations.py lufia2ac: fix client behavior at max blue chests combined with party member or capsule monster shuffle (#2478) 2023-11-24 01:59:41 +01:00
Options.py Core: Introduce new Option class NamedRange (#2330) 2023-11-24 17:10:52 -06:00
Rom.py Core: deprecate Utils.get_options and remove Utils.get_default_options (#2352) 2023-10-28 19:32:12 +02:00
Utils.py lufia2ac: add shops to the cave (#2103) 2023-10-21 23:27:30 +02:00
__init__.py lufia2ac: fix client behavior at max blue chests combined with party member or capsule monster shuffle (#2478) 2023-11-24 01:59:41 +01:00