Prev: 62961 Up: Map Next: 63259
63116: Action: Close
Close the named door, gate or chest.
Action_Close 63116 CALL Parser_ValidateDirectObject Call Parser_ValidateDirectObject.
63119 RET C Return if the direct object is malformed.
Was the player trying to close ... the door?
63120 LD HL,59626 Call Parser_AdvanceToSeparator with 59626.
63123 CALL Parser_AdvanceToSeparator
63126 JP NZ,Validate_Close_Chest Jump to Validate_Close_Chest if the token isn't for the door.
63129 LD HL,59287 Call Parser_SkipToken with 59287.
63132 CALL Parser_SkipToken
63135 BIT 0,A Jump to Close_CheckRoom if the named door is open.
63137 JR NZ,Close_CheckRoom
Print "It's already closed.".
63139 LD HL,57733 HL=Messaging_ItsAlreadyClosed.
63142 JP PrintResponse Jump to PrintResponse.
Which door is the player closing?
Close_CheckRoom 63145 LD A,(47771) Jump to Close_Farmhouse if *CurrentRoom is room 2: " Inside the Farmhouse".
63148 CP 2
63150 JR Z,Close_Farmhouse
63152 CP 3 Jump to Close_CheckWoodmansHut if *CurrentRoom isn't room 3: " At a large Farmhouse".
63154 JR NZ,Close_CheckWoodmansHut
Change the farmhouse door states!
Close_Farmhouse 63156 LD BC,13622 Call TransformItem to transform "An open door" into "A closed door".
63159 CALL TransformItem
63162 LD BC,14136 Call TransformItem to transform "An open door" into "A closed door".
63165 CALL TransformItem
This action changes the map:
63168 XOR A Write 0 to *Exit_FarmhouseSouth to close off southbound access to At a large Farmhouse from Inside the Farmhouse.
63169 LD (59713),A
63172 JP Response_OK_GameLoop Jump to Response_OK_GameLoop.
Is the player at the Woodman's Hut?
Close_CheckWoodmansHut 63175 CP 15 Jump to Close_WoodmansHut if *CurrentRoom is room 15: " At the Woodman's Hut".
63177 JR Z,Close_WoodmansHut
63179 CP 16 Jump to Close_CheckWitchsHovel if *CurrentRoom isn't room 16: " Inside the Woodman's Hut".
63181 JR NZ,Close_CheckWitchsHovel
Change the Woodman's Hut door states!
Close_WoodmansHut 63183 LD BC,14650 Call TransformItem to transform "An open door" into "A closed door".
63186 CALL TransformItem
63189 LD BC,15164 Call TransformItem to transform "An open door" into "A closed door".
63192 CALL TransformItem
This action changes the map:
63195 XOR A Write 0 to *Exit_WoodmansHutEast to close off eastbound access to At the Woodman's Hut from Inside the Woodman's Hut.
63196 LD (59798),A
63199 JP Response_OK_GameLoop Jump to Response_OK_GameLoop.
Is the player at the Witch's Hovel?
Close_CheckWitchsHovel 63202 CP 60 Jump to Close_WitchsHovel if *CurrentRoom is room 60: " At the Witch's Hovel".
63204 JR Z,Close_WitchsHovel
63206 CP 61 Jump to Validate_Close_Chest if *CurrentRoom isn't room 61: " Inside the Witch's Hovel".
63208 JR NZ,Validate_Close_Chest
Change the Witch's Hovel door states!
Close_WitchsHovel 63210 LD BC,15678 Call TransformItem to transform "An open door" into "A closed door".
63213 CALL TransformItem
63216 LD BC,16192 Call TransformItem to transform "An open door" into "A closed door".
63219 CALL TransformItem
This action changes the map:
63222 XOR A Write 0 to *Exit_WitchsHovelEast to close off eastbound access to At the Witch's Hovel from Inside the Witch's Hovel.
63223 LD (60068),A
63226 JP Response_OK_GameLoop Jump to Response_OK_GameLoop.
Was the player trying to close ... the chest?
Validate_Close_Chest 63229 LD HL,59412 Call Parser_AdvanceToSeparator with 59412.
63232 CALL Parser_AdvanceToSeparator
63235 JR NZ,Close_YouCant Jump to Close_YouCant if the token isn't for the chest.
63237 LD A,11 Jump to Response_ItsAlreadyClosed if ValidateItemPresent reports that "A chest" is in the current room.
63239 CALL ValidateItemPresent
63242 JP Z,Response_ItsAlreadyClosed
63245 LD A,12 Jump to Response_ItsAlreadyClosed if ValidateItemPresent reports that "A closed chest" is in the current room.
63247 CALL ValidateItemPresent
63250 JP Z,Response_ItsAlreadyClosed
63253 JP Response_IDontSeeThePoint Jump to Response_IDontSeeThePoint.
Nothing else is valid.
Close_YouCant 63256 JP Response_YouCant_GameLoop Jump to Response_YouCant_GameLoop.
Prev: 62961 Up: Map Next: 63259