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 to take an exit in the direction just typed.
24372 LD A,(23418) A matched exit is remembered as a room change, and the scripts are not run.
24375 LD (23445),A
24378 OR A
24379 JR NZ,GameLoop_Act
24381 CALL RunScripts Call RunScripts to run the ordinary command scripts.
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 Run the high-priority scripts again without keeping the old room-changed flag.
24397 LD (23445),A
24400 CALL RunPriorityScripts
24403 LD A,(23445)
24406 OR A
24407 JR Z,ObeyCommand_Redraw
24409 CALL DescribeLocation Call DescribeLocation when those scripts moved the player.
ObeyCommand_Redraw 24412 CALL DrawRoomOnce Redraw, then count down one repeat.
24415 LD HL,23950
24418 DEC (HL)
24419 JR 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 The sentence at AbsorbWater is 27 characters.
24446 LD B,27
ObeyCommand_Water 24448 LD A,(HL) Print one character of it.
24449 CALL PlotCharacter
24452 INC HL
24453 DJNZ ObeyCommand_Water
24455 LD A,13 Finish that sentence with ENTER and take another turn.
24457 CALL PlotCharacter
24460 JP GameLoop_Act
Prev: 24342 Up: Map Next: 24463