Prev: 36785 Up: Map Next: 36880
36813: Action: Take
Parse the named object and take it when the rules allow.
ActionTake 36813 LD HL,35672 Jump to HandlerPickUpObject_Step1 when the command matches the phrase at 35672.
36816 CALL Parser_AdvanceToSeparator
36819 JR Z,HandlerPickUpObject_Step1
36821 CALL Parser_ValidateDirectObject Return if the command does not name an object. Jump to HandlerPickUpObject_Step1 when exactly one noun was named.
36824 RET C
36825 CP 1
36827 JR Z,HandlerPickUpObject_Step1
36829 LD HL,25669 Print "Please rephrase that." and start a new line.
36832 JR HandlerPickUpObject_Loop2
This entry point is used by the routine at HandlerPickUpObject.
ActionTake_Step1 36834 CALL IsObjectCarried Call IsObjectCarried to test whether the object is carried.
36837 JR NZ,ActionTake_Step4 The named object is not being carried yet.
36839 POP HL Drop the return address; the failure message replaces it.
36840 LD HL,31263 Print You're already carrying on the same line.
36843 CALL PrintString
ActionTake_Step2 36846 LD HL,36880 The objects called "them" are listed at Table_PluralObjects.
36849 LD A,E See whether this object is spoken of as "them".
36850 LD BC,4
36853 CPIR Search the list of objects that are called "them".
36855 JR Z,ActionTake_Step3 A plural object uses the wording for "them".
36857 LD HL,31288 Print "it." and start a new line.
36860 JR HandlerPickUpObject_Loop2
ActionTake_Step3 36862 LD HL,31292 Print "them." and start a new line.
36865 JR HandlerPickUpObject_Loop2
ActionTake_Step4 36867 LD A,(25132) Fetch how many objects are being carried.
36870 CP 5 Five objects is the most the player can carry.
36872 LD B,E
36873 RET NZ Return so the object can be taken when five are not already carried.
36874 POP HL Drop the return address; the player is already fully laden.
36875 LD HL,30722 Print "You can't carry any more." and start a new line.
36878 JR HandlerPickUpObject_Loop2
Prev: 36785 Up: Map Next: 36880