Prev: 9CE9 Up: Map Next: 9D10
9CF2: Process Character Action Parameter
Stores the room picture, and counts down while the object is not in the character's room. When the character holds it, stores a fresh delay once the counter has run out.
Input
HL Pointer to counter/state variable
C Room display parameter
DE (preserved on stack)
ProcessCharacterActionParameter 9CF2 LD A,C Call CheckObjectInCharacterLocation to check object in character location.
9CF3 LD ($A034),A
9CF6 CALL CheckObjectInCharacterLocation
9CF9 JR Z,ProcessCharacterActionParameter_Next Jump ahead to ProcessCharacterActionParameter_Next when this character holds the object.
9CFB DEC (HL) Jump to ProcessCharacterActionParameter_0 if the count does not become negative.
9CFC JP P,ProcessCharacterActionParameter_0
9CFF INC (HL) Count one more in the pointer.
ProcessCharacterActionParameter_0 9D00 POP DE Restore DE from the stack.
9D01 RET Return.
When the counter has run out, stores this character's attribute plus thirty.
ProcessCharacterActionParameter_Next 9D02 LD A,(HL) Jump back to ProcessCharacterActionParameter_0 while this byte is not zero.
9D03 AND A
9D04 JR NZ,ProcessCharacterActionParameter_0
9D06 LD A,$0F Case, then call GetRandomNumber to take a random number.
9D08 CALL GetRandomNumber
9D0B ADD A,$1E Advance the result by 1E.
9D0D LD (HL),A Store the result at the pointer.
9D0E XOR A Clear A.
9D0F RET Return.
Prev: 9CE9 Up: Map Next: 9D10