![]() |
Routines |
| Prev: C3FA | Up: Map | Next: C463 |
|
Used by the routines at Handler_InjuryCheck and Action_Blow.
Move the player to the given room and retarget any scenic events that watched the old room.
|
||||
| MovePlayerToRoom | C42F | LD C,A | Read the current room and the scenic list. Jump to MovePlayerToRoom_Next to continue. | |
| C430 | LD A,($BB00) | |||
| C433 | LD B,A | |||
| C434 | LD A,($BA9B) | |||
| C437 | LD HL,$BA48 | |||
| C43A | JR MovePlayerToRoom_Next | |||
| MovePlayerToRoom_Loop | C43C | INC HL | Step to the next scenic entry. | |
| MovePlayerToRoom_Next | C43D | CP (HL) | Jump to MovePlayerToRoom_ScenicNext unless this scenic entry watched the old room. | |
| C43E | JR NZ,MovePlayerToRoom_ScenicNext | |||
| C440 | LD (HL),C | Retarget this scenic entry to the new room. | ||
| MovePlayerToRoom_ScenicNext | C441 | DJNZ MovePlayerToRoom_Loop | Repeat from MovePlayerToRoom_Loop for the remaining scenic entries. | |
| C443 | LD A,C | Remember the new room. Return when no event bits are set. | ||
| C444 | LD ($BA9B),A | |||
| C447 | LD A,($BA3F) | |||
| C44A | AND A | |||
| C44B | JR Z,MovePlayerToRoom_Return | |||
| C44D | LD B,$08 | Take the eight event bits and the objects they summon. | ||
| C44F | LD HL,$BA40 | |||
| C452 | LD C,A | |||
| C453 | JR MovePlayerToRoom_EventBit | |||
| MovePlayerToRoom_EventAdvance | C455 | INC HL | Step to the next event object. | |
| MovePlayerToRoom_EventBit | C456 | SRL C | Skip this object when its event bit is clear. | |
| C458 | JR NC,MovePlayerToRoom_EventNext | |||
| C45A | LD A,(HL) | Call Handler_UpdateItemForTheCurrentRoom to move that event's object into this room. | ||
| C45B | EXX | |||
| C45C | CALL Handler_UpdateItemForTheCurrentRoom | |||
| C45F | EXX | Switch back to the event scan. | ||
| MovePlayerToRoom_EventNext | C460 | DJNZ MovePlayerToRoom_EventAdvance | Repeat from MovePlayerToRoom_EventAdvance for the remaining event bits. | |
| MovePlayerToRoom_Return | C462 | RET | Return. | |
|
View the equivalent code in;
|
||||
| Prev: C3FA | Up: Map | Next: C463 |