Prev: EC3A Up: Map Next: ECC0
EC6C: Take: Gold Key
Used by the routine at Take_Key.
Take the gold key and open the golden gates.
Take_GoldKey EC6C LD A,$47 Call ValidateItemPresent with item 47: "A gold key.".
EC6E CALL ValidateItemPresent
EC71 JP NZ,Response_ItIsntHere Jump to Response_ItIsntHere if "A gold key." is not present.
EC74 LD A,$47 Call Take_IsPlayerHoldingItem with item 47: "A gold key.".
EC76 CALL Take_IsPlayerHoldingItem
EC79 CALL TakeItem Call TakeItem.
This action changes the map:
EC7C LD A,$16 Write 16 to open northbound access to The Hall of Wisdom from The King's Stairway.
EC7E LD ($E89A),A
EC81 LD A,$1E Write 1E to open southbound access to The King's Stairway from The Hall of Wisdom.
EC83 LD ($E86B),A
EC86 LD A,$2D Write 2D to open northbound access to The Ice Cavern from The Sand Cavern.
EC88 LD ($E924),A
EC8B LD A,$35 Write 35 to open southbound access to The Sand Cavern from The Ice Cavern.
EC8D LD ($E8F5),A
EC90 LD BC,$1716 Call TransformItem to transform "The gates are closed." into "The gates are open.".
EC93 CALL TransformItem
EC96 LD BC,$1A19 Call TransformItem to transform "The gates are closed." into "The gates are open.".
EC99 CALL TransformItem
EC9C LD BC,$1D1C Call TransformItem to transform "The gates are closed." into "The gates are open.".
EC9F CALL TransformItem
ECA2 LD BC,$201F Call TransformItem to transform "The gates are closed." into "The gates are open.".
ECA5 CALL TransformItem
ECA8 LD HL,$AE76 Return if bit 4 of *Flags_RoomChange is set, which relates to taking the gold key.
ECAB BIT 4,(HL)
ECAD RET NZ
ECAE SET 4,(HL) Set bit 4 of *Flags_RoomChange to signify that the gold key has been taken.
ECB0 LD A,$02 Call AddToScore with 02.
ECB2 CALL AddToScore
ECB5 LD A,($AECD) Return if *CurrentRoom is not room 23: " The Hall of Infinity".
ECB8 CP $23
ECBA RET NZ
ECBB XOR A Write 00 to close the eastbound exit from The Hall of Infinity.
ECBC LD ($E8BA),A
ECBF RET Return.
Prev: EC3A Up: Map Next: ECC0