Prev: AA5F Up: Map Next: AA8A
AA6E: Action: Pick Up Item
Moves the item operand into the inventory and prints the taken message.
Input
F The zero flag is set when the conditions hold
IX Pointer to the script entry
When the condition failed, skip this action.
Handler_PickUpItem AA6E JP NZ,RunScript_SkipAction_TwoBytes Jump to RunScript_SkipAction_TwoBytes if the condition failed.
Move the item operand into the inventory (room 01).
AA71 LD A,(IX+$01) Fetch the item ID (the operand) from *IX+01 into A.
AA74 CALL RunScript_ResolveMatchedItem Call RunScript_ResolveMatchedItem to substitute the matched item ID from ScriptMatchedItem when the operand is FF.
AA77 LD B,A Copy the item ID into B.
AA78 LD C,$01 Set the destination room to the inventory (01).
AA7A CALL Handler_UpdateItemLocation Call Handler_UpdateItemLocation to update that item's location.
The player has gained an item, so raise the inventory count.
AA7D LD HL,$A0D2 Increment the inventory count at Count_InventoryItems by one.
AA80 INC (HL)
Print "O.K.".
AA81 LD HL,$001A HL=Messaging_OK.
AA84 CALL PrintCompressedStringAndNewline Call PrintCompressedStringAndNewline to print that compressed string and a newline.
AA87 JP RunScript_SkipAction_TwoBytes Jump to RunScript_SkipAction_TwoBytes.
View the equivalent code in;
Prev: AA5F Up: Map Next: AA8A