Prev: 9030 Up: Map Next: 9065
9034: TALK TO, and SAY TO
Decides how many of the sentences just said the character will take on as orders (ASSIGN_ORDERS): none if it is not a character; exactly one if it is Gollum waiting for his riddle's answer (RIDDLE_ASKED); otherwise a random number up to byte 6 of its CHARACTERS slot -- and if that comes out 0, "... says " no "". A character whose byte 6 is 0 never takes an order and does not say so.
DO_TALK 9034 CALL FOR_REAL The test ends here
9037 LD A,(TARGET) Not a character: no orders
903A CALL FIND_CHARACTER
903D CP $FF
903F LD A,$00
9041 JR Z,DO_TALK_0
9043 LD A,(RIDDLE_ASKED) Gollum waiting for an answer: one
9046 CP $00
9048 JR NZ,DO_TALK_0
904A LD A,(IY+$06) Never takes orders: none
904D CP $00
904F JR Z,DO_TALK_0
9051 CALL RANDOM_POSITIVE Otherwise a random number up to its limit
9054 CP $00
9056 JR Z,DO_TALK_1
DO_TALK_0 9058 CALL ASSIGN_ORDERS Give it that many
905B RET
DO_TALK_1 905C LD HL,MSG_SAY_S_NO None: "... says " no "", and none
905F CALL RUN_MESSAGE_HL
9062 SUB A
9063 JR DO_TALK_0
Prev: 9030 Up: Map Next: 9065