Prev: F5F1 Up: Map Next: F71B
F68C: Action: Close
Close the named door, gate or chest.
Action_Close F68C CALL Parser_ValidateDirectObject Call Parser_ValidateDirectObject.
F68F RET C Return if the direct object is malformed.
Was the player trying to close ... the door?
F690 LD HL,$E8EA Call Parser_AdvanceToSeparator with E8EA.
F693 CALL Parser_AdvanceToSeparator
F696 JP NZ,Validate_Close_Chest Jump to Validate_Close_Chest if the token isn't for the door.
F699 LD HL,$E797 Call Parser_SkipToken with E797.
F69C CALL Parser_SkipToken
F69F BIT 0,A Jump to Close_CheckRoom if the named door is open.
F6A1 JR NZ,Close_CheckRoom
Print "It's already closed.".
F6A3 LD HL,$E185 HL=Messaging_ItsAlreadyClosed.
F6A6 JP PrintResponse Jump to PrintResponse.
Which door is the player closing?
Close_CheckRoom F6A9 LD A,($BA9B) Jump to Close_Farmhouse if *CurrentRoom is room 02: " Inside the Farmhouse".
F6AC CP $02
F6AE JR Z,Close_Farmhouse
F6B0 CP $03 Jump to Close_CheckWoodmansHut if *CurrentRoom isn't room 03: " At a large Farmhouse".
F6B2 JR NZ,Close_CheckWoodmansHut
Change the farmhouse door states!
Close_Farmhouse F6B4 LD BC,$3536 Call TransformItem to transform "An open door" into "A closed door".
F6B7 CALL TransformItem
F6BA LD BC,$3738 Call TransformItem to transform "An open door" into "A closed door".
F6BD CALL TransformItem
This action changes the map:
F6C0 XOR A Write 00 to *Exit_FarmhouseSouth to close off southbound access to At a large Farmhouse from Inside the Farmhouse.
F6C1 LD ($E941),A
F6C4 JP Response_OK_GameLoop Jump to Response_OK_GameLoop.
Is the player at the Woodman's Hut?
Close_CheckWoodmansHut F6C7 CP $0F Jump to Close_WoodmansHut if *CurrentRoom is room 0F: " At the Woodman's Hut".
F6C9 JR Z,Close_WoodmansHut
F6CB CP $10 Jump to Close_CheckWitchsHovel if *CurrentRoom isn't room 10: " Inside the Woodman's Hut".
F6CD JR NZ,Close_CheckWitchsHovel
Change the Woodman's Hut door states!
Close_WoodmansHut F6CF LD BC,$393A Call TransformItem to transform "An open door" into "A closed door".
F6D2 CALL TransformItem
F6D5 LD BC,$3B3C Call TransformItem to transform "An open door" into "A closed door".
F6D8 CALL TransformItem
This action changes the map:
F6DB XOR A Write 00 to *Exit_WoodmansHutEast to close off eastbound access to At the Woodman's Hut from Inside the Woodman's Hut.
F6DC LD ($E996),A
F6DF JP Response_OK_GameLoop Jump to Response_OK_GameLoop.
Is the player at the Witch's Hovel?
Close_CheckWitchsHovel F6E2 CP $3C Jump to Close_WitchsHovel if *CurrentRoom is room 3C: " At the Witch's Hovel".
F6E4 JR Z,Close_WitchsHovel
F6E6 CP $3D Jump to Validate_Close_Chest if *CurrentRoom isn't room 3D: " Inside the Witch's Hovel".
F6E8 JR NZ,Validate_Close_Chest
Change the Witch's Hovel door states!
Close_WitchsHovel F6EA LD BC,$3D3E Call TransformItem to transform "An open door" into "A closed door".
F6ED CALL TransformItem
F6F0 LD BC,$3F40 Call TransformItem to transform "An open door" into "A closed door".
F6F3 CALL TransformItem
This action changes the map:
F6F6 XOR A Write 00 to *Exit_WitchsHovelEast to close off eastbound access to At the Witch's Hovel from Inside the Witch's Hovel.
F6F7 LD ($EAA4),A
F6FA JP Response_OK_GameLoop Jump to Response_OK_GameLoop.
Was the player trying to close ... the chest?
Validate_Close_Chest F6FD LD HL,$E814 Call Parser_AdvanceToSeparator with E814.
F700 CALL Parser_AdvanceToSeparator
F703 JR NZ,Close_YouCant Jump to Close_YouCant if the token isn't for the chest.
F705 LD A,$0B Jump to Response_ItsAlreadyClosed if ValidateItemPresent reports that "A chest" is in the current room.
F707 CALL ValidateItemPresent
F70A JP Z,Response_ItsAlreadyClosed
F70D LD A,$0C Jump to Response_ItsAlreadyClosed if ValidateItemPresent reports that "A closed chest" is in the current room.
F70F CALL ValidateItemPresent
F712 JP Z,Response_ItsAlreadyClosed
F715 JP Response_IDontSeeThePoint Jump to Response_IDontSeeThePoint.
Nothing else is valid.
Close_YouCant F718 JP Response_YouCant_GameLoop Jump to Response_YouCant_GameLoop.
Prev: F5F1 Up: Map Next: F71B