Prev: 24342 Up: Map Next: 24463
24353: Obey Command
Used by the routine at GameLoop.
Turns the verb and noun into a movement or a scripted action. PUSH, PULL, ROLL or MOVE with CURTAINS is rewritten to noun 43. WET, COOL, DAMP or SOAK is refused, except with the robe, the door or the running water.
Curtains are a special noun for the pushing verbs.
ObeyCommand 24353 CP 27 Verb 27 (PUSH, PULL, ROLL or MOVE) continues.
24355 JR NZ,ObeyCommand_Move
24357 LD A,(23424) Noun 133 (CURTAINS) continues.
24360 CP 133
24362 JR NZ,ObeyCommand_Move
24364 LD A,43 That pair becomes noun 43.
24366 LD (23424),A
A movement that matches an exit changes the room and skips the scripts.
ObeyCommand_Move 24369 CALL TakeExit Call TakeExit.
24372 LD A,(23418) Write the match into RoomChanged.
24375 LD (23445),A
24378 OR A Jump to GameLoop_Act if an exit was taken.
24379 JR NZ,GameLoop_Act
Run the ordinary command scripts.
24381 CALL RunScripts Call RunScripts.
24384 LD A,(23417) Jump to ObeyCommand_Wet when no script line matched.
24387 OR A
24388 JR Z,ObeyCommand_Wet
This entry point is used by the routine at GameLoop.
A script asked for the location to be reconsidered several times.
ObeyCommand_Repeat 24390 LD A,(23950) Jump to GameLoop_Act once the repeat count has run out.
24393 OR A
24394 JR Z,GameLoop_Act
24396 XOR A Write 0 to RoomChanged.
24397 LD (23445),A
Run the high-priority scripts.
24400 CALL RunPriorityScripts Call RunPriorityScripts.
24403 LD A,(23445) Jump to ObeyCommand_Redraw if the room did not change.
24406 OR A
24407 JR Z,ObeyCommand_Redraw
24409 CALL DescribeLocation Call DescribeLocation when those scripts moved the player.
Count down one repeat after the redraw.
ObeyCommand_Redraw 24412 CALL DrawRoomOnce Call DrawRoomOnce.
24415 LD HL,23950 Point HL at RepeatCounter.
24418 DEC (HL) Count down one repeat.
24419 JR ObeyCommand_Repeat Jump to ObeyCommand_Repeat.
WET, COOL, DAMP or SOAK only works on the robe, the door or the running water.
ObeyCommand_Wet 24421 LD A,(23423) Only verb 28 (WET, COOL, DAMP or SOAK) continues.
24424 CP 28
24426 JR NZ,RefuseCommand
24428 LD A,(23424) The robe, noun 184, is allowed.
24431 CP 184
24433 JR Z,RefuseCommand
24435 CP 222 The running water, noun 222, is allowed.
24437 JR Z,RefuseCommand
24439 CP 209 The door, noun 209, is allowed.
24441 JR Z,RefuseCommand
24443 LD HL,24463 Point HL at AbsorbWater.
24446 LD B,27 27 characters.
Print the refusal one character at a time.
ObeyCommand_Water 24448 LD A,(HL) Fetch this character.
24449 CALL PlotCharacter Call PlotCharacter.
24452 INC HL Advance to the next character.
24453 DJNZ ObeyCommand_Water Jump to ObeyCommand_Water until the sentence is done.
24455 LD A,13 Print ENTER.
24457 CALL PlotCharacter
24460 JP GameLoop_Act Jump to GameLoop_Act.
Prev: 24342 Up: Map Next: 24463