Prev: 8FB1 Up: Map Next: 9010
8FCD: Action: Take
Parse the named object and take it when the rules allow.
ActionTake 8FCD LD HL,$8B58 Jump to HandlerPickUpObject_Step1 when the command matches the phrase at 8B58.
8FD0 CALL Parser_AdvanceToSeparator
8FD3 JR Z,HandlerPickUpObject_Step1
8FD5 CALL Parser_ValidateDirectObject Return if the command does not name an object. Jump to HandlerPickUpObject_Step1 when exactly one noun was named.
8FD8 RET C
8FD9 CP $01
8FDB JR Z,HandlerPickUpObject_Step1
8FDD LD HL,$6445 Print "Please rephrase that." and start a new line.
8FE0 JR HandlerPickUpObject_Loop2
This entry point is used by the routine at HandlerPickUpObject.
ActionTake_Step1 8FE2 CALL IsObjectCarried Call IsObjectCarried to test whether the object is carried.
8FE5 JR NZ,ActionTake_Step4 The named object is not being carried yet.
8FE7 POP HL Drop the return address; the failure message replaces it.
8FE8 LD HL,$7A1F Print You're already carrying on the same line.
8FEB CALL PrintString
ActionTake_Step2 8FEE LD HL,$9010 The objects called "them" are listed at Table_PluralObjects.
8FF1 LD A,E See whether this object is spoken of as "them".
8FF2 LD BC,$0004
8FF5 CPIR Search the list of objects that are called "them".
8FF7 JR Z,ActionTake_Step3 A plural object uses the wording for "them".
8FF9 LD HL,$7A38 Print "it." and start a new line.
8FFC JR HandlerPickUpObject_Loop2
ActionTake_Step3 8FFE LD HL,$7A3C Print "them." and start a new line.
9001 JR HandlerPickUpObject_Loop2
ActionTake_Step4 9003 LD A,($622C) Fetch how many objects are being carried.
9006 CP $05 Five objects is the most the player can carry.
9008 LD B,E
9009 RET NZ Return so the object can be taken when five are not already carried.
900A POP HL Drop the return address; the player is already fully laden.
900B LD HL,$7802 Print "You can't carry any more." and start a new line.
900E JR HandlerPickUpObject_Loop2
Prev: 8FB1 Up: Map Next: 9010