Prev: 37997 Up: Map Next: 38102
38029: Action: Unlock
Used by the routine at ActionBurn.
Unlocks the current object. An object that is not locked, or is open, is refused; otherwise 38024 is set up to RES bit 0 and the key is tested at Action_Lock_TestTheKey.
Action_Unlock 38029 LD IX,(46856) Read *46856.
38033 BIT 0,(IX+7) Take zero, and jump to Message_NameFromThisRecord if the object is not locked.
38037 LD A,0
38039 JP Z,Message_NameFromThisRecord
38042 CALL Action_ReadTheObjectLockFlag_0 Call Action_ReadTheObjectLockFlag_0 to test whether the object is open.
38045 JP NZ,Message_NameFromThisRecord Jump to Message_NameFromThisRecord if the object is open.
38048 LD A,134 Use 134, the RES 0 operation.
38050 JR Action_Lock_TestTheKey Jump back to Action_Lock_TestTheKey to plant it and unlock the object.
Refuse the verb when the object is not carried.
Reached through the action lists of 1 - "Heavy Rock Door", 5 - "Round Green Door", 8 - "Red Door", 10 - "Goblins Back Door", 11 - "Mountains Side Door", 12 - "Large Trap Door", 13 - "Magic Door" and 17 - "Goblins Door" for action 44, dispatched by TriggerAction.
38052 CALL Action_RefuseIfNotCarried Call Action_RefuseIfNotCarried to refuse the verb when the object is not carried.
38055 LD A,(46825) Read *46825.
38058 CALL ExitsFindTheExitThroughAnObject_0 Call ExitsFindTheExitThroughAnObject_0 to find the exit through the object in A.
38061 CP 255 Jump to ResponseThatWillNotWork if no exit runs through this object.
38063 JP Z,ResponseThatWillNotWork
38066 LD IY,(46858) Read *46858.
38070 BIT 5,(IY+7) Take 5, and jump to Message_NameFromTheOtherRecord if the object is not open.
38074 LD A,5
38076 JP Z,Message_NameFromTheOtherRecord
If the message is held back, the locked object is not named.
38079 CALL ConditionSuppressTheMessage Call ConditionSuppressTheMessage. If the message is held back, the locked object is not named.
38082 LD B,(IX+2) Read this exit's destination.
38085 LD IX,(46856) Read *46856.
38089 LD (IX+1),255 Mark where this object is as unset.
38093 LD (IX+16),B Update the object's location.
38096 LD A,(46824) Read *CurrentObject.
38099 JP Object_MoveContents_0 Jump to Object_MoveContents_0 to move what is inside the current object to this exit's destination.
Prev: 37997 Up: Map Next: 38102