Prev: 42160 Up: Map Next: 42438
42385: Parser: Validate Item
Used by the routine at Parser_ProcessItem.
Input
BC The position in the user input token of the object
Output
F The carry flag is set when the item isn't present
Parser_ValidateItem 42385 INC BC Adjust the counter for the sum.
42386 LD A,(48073) Calculate the index (*Count_Objects_2-C) and store the result in E.
42389 SUB C
42390 LD E,A
42391 PUSH DE Stash DE on the stack.
42392 LD IX,46606 Call GetTableEntry with Table_ItemGrouping.
42396 CALL GetTableEntry
42399 POP DE Restore DE from the stack.
42400 JR ValidateItem Jump to ValidateItem.
ValidateItem_Loop 42402 INC HL Increment HL by one.
ValidateItem 42403 LD A,(HL) Jump to Response_ItemNotHere if *HL is equal to 255.
42404 CP 255
42406 JR Z,Response_ItemNotHere
42408 CALL ValidateItemPresent Call ValidateItemPresent.
42411 JR NZ,ValidateItem_Loop Jump to ValidateItem_Loop if the item wasn't found.
42413 RET Return.
The item being referenced isn't in the room or in the players inventory.
Print "I can't see ".
Response_ItemNotHere 42414 LD HL,14 HL=Messaging_ICantSee.
42417 CALL PrintCompressedString Call PrintCompressedString.
Print the object name.
42420 LD IX,44849 Call GetTableEntry with Table_ObjectNounPhrases.
42424 CALL GetTableEntry
42427 CALL PrintCompressedString Call PrintCompressedString.
Print " here.".
42430 LD HL,15 HL=Messaging_Here.
42433 CALL PrintCompressedStringAndNewline Call PrintCompressedStringAndNewline.
42436 SCF Set the carry flag.
42437 RET Return.
View the equivalent code in;
Prev: 42160 Up: Map Next: 42438