Prev: F8AB Up: Map Next: F916
F8E4: Action: Unlock
Unlock a door with the key.
Action_Unlock F8E4 CALL Parser_ValidateDirectObject Return if the words after the verb are not valid for this command.
F8E7 RET C
F8E8 LD HL,$E92E Jump to Action_Unlock_YouCant unless the player named the witch.
F8EB CALL Parser_AdvanceToSeparator
F8EE JR NZ,Action_Unlock_YouCant
F8F0 LD A,$0B Jump to Action_Unlock_Next when object 0B (the chest) is here.
F8F2 CALL IsObjectInCurrentRoom
F8F5 JR Z,Action_Unlock_Next
Reply with "It is already unlocked.".
F8F7 LD HL,$E36F Print "It is already unlocked." and return to the game loop.
F8FA JP PrintResponse
Action_Unlock_Next F8FD LD A,$10 Jump to Action_Unlock_Chest when the player is carrying object 10 (the key).
F8FF CALL IsObjectCarried
F902 JR Z,Action_Unlock_Chest
Reply with "You're not carrying a key.".
F904 LD HL,$E387 Print "You're not carrying a key." and return to the game loop.
F907 JP PrintResponse
Action_Unlock_Chest F90A LD BC,$0B0C Replace object 0B (the chest) with object 0C (the closed chest).
F90D CALL TransformItem
F910 JP Response_OK Jump back to Response_OK to confirm.
Action_Unlock_YouCant F913 JP Response_YouCant_GameLoop Tell the player the command is impossible.
View the equivalent code in;
Prev: F8AB Up: Map Next: F916