Prev: FAB8 Up: Map Next: FAF9
FAC8: Action: Dig
Carry out the "Dig" command.
Action_Dig FAC8 CALL ParserValidateNoDirectObject Call ParserValidateNoDirectObject.
FACB RET C Return if the direct object is malformed.
Does the player have the shovel ("A shovel.")?
FACC LD A,$60 Jump to Response_YouHaveNothingToDigWith if IsObjectInInventory reports that "A shovel." is not held.
FACE CALL IsObjectInInventory
FAD1 JP NZ,Response_YouHaveNothingToDigWith
FAD4 LD A,($AECD) A=*CurrentRoom.
Is the player in room 3C: " The Sandy Beach"?
FAD7 CP $3C Jump to Response_YouFindNothing if *CurrentRoom is not room 3C: " The Sandy Beach".
FAD9 JP NZ,Response_YouFindNothing
Has this spot on the beach already been dug?
FADC LD HL,$AE77 Jump to Response_YouFindNothing if bit 0 of *Flag_BeachDug is set.
FADF BIT 0,(HL)
FAE1 JP NZ,Response_YouFindNothing
FAE4 SET 0,(HL) Set bit 0 of *Flag_BeachDug.
FAE6 LD A,$72 Call HandlerUpdateItemEventForTheCurrentRoom with item 72: "An emerald.".
FAE8 CALL HandlerUpdateItemEventForTheCurrentRoom
FAEB LD A,$03 Call AddToScore with 03.
FAED CALL AddToScore
FAF0 CALL Response_OK_GameLoop Call Response_OK_GameLoop.
Print "You uncover an emerald!".
FAF3 LD HL,$DE88 HL=Messaging_YouUncoverAnEmerald.
FAF6 JP PrintResponse Jump to PrintResponse.
Prev: FAB8 Up: Map Next: FAF9