![]() |
Routines |
| Prev: A420 | Up: Map | Next: A462 |
|
This makes a character disappear when it gets into bed and updates the room definition to show them sleeping.
Used by the routine at character_event.
|
||||||||||
| character_sleeps | A444 | PUSH AF | Save the route index | |||||||
| A445 | SUB $07 | Route indices 7..12 map to beds array indices 0..5 | ||||||||
| A447 | ADD A,A | Turn index into an offset | ||||||||
| A448 | EX DE,HL | Move the route pointer into DE for the common part later | ||||||||
|
Poke object.
|
||||||||||
| A449 | LD C,A | Fetch the bed object pointer from beds array | ||||||||
| A44A | LD B,$00 | |||||||||
| A44C | LD HL,$6B79 | |||||||||
| A44F | ADD HL,BC | |||||||||
| A450 | LD C,(HL) | |||||||||
| A451 | INC HL | |||||||||
| A452 | LD B,(HL) | |||||||||
| A453 | LD A,$17 | Write interiorobject_OCCUPIED_BED to the bed object | ||||||||
| A455 | LD (BC),A | |||||||||
| A456 | POP AF | Restore the route index | ||||||||
| A457 | CP $0A | Is the route index greater than or equal to routeindex_10_PRISONER_SLEEPS_1? | ||||||||
| A459 | JP NC,character_sleeps_0 | Jump if so | ||||||||
| A45C | LD C,$03 | Otherwise room is room_3_HUT2RIGHT | ||||||||
| A45E | JR character_sit_sleep_common | |||||||||
| character_sleeps_0 | A460 | LD C,$05 | Room is room_5_HUT3RIGHT | |||||||
|
FALL THROUGH into character_sit_sleep_common.
|
||||||||||
| Prev: A420 | Up: Map | Next: A462 |