Prev: 63659 Up: Map Next: 63766
63716: Action: Unlock
Unlock a door with the key.
Action_Unlock 63716 CALL Parser_ValidateDirectObject Call Parser_ValidateDirectObject.
63719 RET C Return if the direct object is malformed.
Was the player trying to unlock ... the chest?
63720 LD HL,59694 Call Parser_AdvanceToSeparator with 59694.
63723 CALL Parser_AdvanceToSeparator
63726 JR NZ,Unlock_YouCant Jump to Unlock_YouCant if the token isn't for the chest.
63728 LD A,11 Jump to Unlock_CheckKey if ValidateItemPresent reports that "A chest" is in the current room.
63730 CALL ValidateItemPresent
63733 JR Z,Unlock_CheckKey
Print "It is already unlocked.".
63735 LD HL,58223 HL=Messaging_ItIsAlreadyUnlocked.
63738 JP PrintResponse Jump to PrintResponse.
Does the player hold the key?
Unlock_CheckKey 63741 LD A,16 Jump to Unlock_Chest if "A key" is held.
63743 CALL IsObjectCarried
63746 JR Z,Unlock_Chest
Print "You're not carrying a key.".
63748 LD HL,58247 HL=Messaging_YoureNotCarryingAKey.
63751 JP PrintResponse Jump to PrintResponse.
Change the chest state!
Unlock_Chest 63754 LD BC,2828 Call TransformItem to transform "A chest" into "A closed chest".
63757 CALL TransformItem
63760 JP Response_OK_GameLoop Jump to Response_OK_GameLoop.
Nothing else is valid.
Unlock_YouCant 63763 JP Response_YouCant_GameLoop Jump to Response_YouCant_GameLoop.
View the equivalent code in;
Prev: 63659 Up: Map Next: 63766