Prev: 26770 Up: Map Next: 26848
26788: Parser: Resolve Phrase
Used by the routine at GameLoop.
Walk this noun's object list from Pointer_ObjectNounPhrases and call IsObjectInCurrentRoom for each object. Return if one is in the current room or the inventory. Otherwise print "I can't see ", the noun name from Pointer_ObjectList and " here.", then set the carry flag.
Input
BC Count left by the caller's object-list search
Output
F Carry flag set when the object is not here
Parser_ResolvePhrase 26788 INC BC Adjust the search count for the index sum.
26789 LD A,(25288) Fetch how many nouns the game knows.
26792 SUB C Turn that count into this noun's index and end marker (254).
26793 LD B,A
26794 LD E,A
26795 LD A,254
26797 LD HL,(25298) Point at the noun-phrase table (*Pointer_ObjectNounPhrases).
26800 INC B Count the phrase terminator as one more step.
26801 JR Parser_ResolvePhrase_Step1 Jump to Parser_ResolvePhrase_Step1 to skip phrases before this noun.
Parser_ResolvePhrase_Loop1 26803 INC HL Skip a byte inside the phrase just passed.
Parser_ResolvePhrase_Loop2 26804 INC HL Keep skipping while this byte is the marker being sought.
26805 CP (HL)
26806 JR Z,Parser_ResolvePhrase_Loop1
Parser_ResolvePhrase_Step1 26808 DJNZ Parser_ResolvePhrase_Loop2 Repeat for each phrase before this noun.
26810 JR Parser_ResolvePhrase_Step2 Jump to Parser_ResolvePhrase_Step2 to test the first object.
Parser_ResolvePhrase_Loop3 26812 INC HL Step to the next object in the phrase.
Parser_ResolvePhrase_Step2 26813 LD A,(HL) Read the object this phrase refers to.
26814 CALL IsObjectInCurrentRoom Call IsObjectInCurrentRoom.
26817 RET Z Return when that object is here or being carried.
26818 INC HL Step to the next byte of the phrase.
26819 LD A,(HL) Read the marker that follows the object.
26820 CP 254 Jump back to Parser_ResolvePhrase_Loop3 when another object follows (254).
26822 JR Z,Parser_ResolvePhrase_Loop3
None of this noun's objects is in the room or the inventory.
Print "I can't see ".
26824 LD HL,25464 Print "I can't see ".
26827 CALL PrintString
Print the noun name.
26830 LD IX,(25300) Point IX at the noun table (*Pointer_ObjectList).
26834 CALL GetTableEntry Call GetTableEntry.
26837 CALL PrintString Call PrintString to print the name.
Print " here.".
26840 LD HL,25477 Print " here.".
26843 CALL PrintStringAndANewline
26846 SCF Set the carry flag to reject the command.
26847 RET Return.
Prev: 26770 Up: Map Next: 26848