Prev: F440 Up: Map Next: F489
F458: Process: Wear Amulet
Input
E The item ID currently being acted on
The player was trying to wear the amulet, but is it either in the room or in the players inventory?
Process_WearAmulet F458 LD HL,$E3A6 Call CheckItemGroupPresent with Data_ItemGroup_Amulet.
F45B CALL CheckItemGroupPresent
The amulet is present but is the player already wearing it?
F45E CALL IsPlayerCarryingItem Call IsPlayerCarryingItem.
F461 LD A,E Jump to Response_YouAreAlreadyWearingIt if the item found in the group is not equal to item 4B: "An amulet" (so the found item is 4C: "An amulet (worn)").
F462 CP $4B
F464 JP NZ,Response_YouAreAlreadyWearingIt
Change the amulet state!
F467 LD BC,$4B4C Call TransformItem to transform item 4B ("An amulet") into item 4C ("An amulet (worn)").
F46A CALL TransformItem
F46D LD BC,$292A Call TransformItem to transform item 29 ("A multitude of shadow-like demons") into item 2A ("The vale is strangely silent").
F470 CALL TransformItem
Uncover an exit from The Vale Of Whispers.
F473 LD A,$18 Write 18 to *E7D5 to open up southbound access to Bleak Moorland from The Vale Of Whispers.
F475 LD ($E7D5),A
Is the player in room 20: The Vale Of Whispers?
F478 LD A,($A7C3) Jump to Response_OK_Duplicate if *CurrentRoom is not equal to room 20: The Vale Of Whispers.
F47B CP $20
F47D JP NZ,Response_OK_Duplicate
The player is in room 20: The Vale Of Whispers.
Print "O.K.".
F480 CALL Response_OK_Duplicate Call Response_OK_Duplicate.
Print "The vale is strangely silent.".
F483 LD HL,$B50E HL=Messaging_ValeIsStrangelySilent.
F486 JP $ED6D Jump to ED6D.
Prev: F440 Up: Map Next: F489