![]() |
Routines |
| Prev: 55444 | Up: Map | Next: 55734 |
|
Used by the routine at Dispatch_Handlers.
Special actor for room 22.
|
|||||
|
Return unless this is room 22.
|
|||||
| Handler_RoomSixteen | 55556 | LD A,(25762) | Return if *CurrentRoom is not 22. | ||
| 55559 | CP 22 | ||||
| 55561 | RET NZ | ||||
|
Point at the special actor and set the clip window.
|
|||||
| 55562 | LD IX,25677 | Point IX at SpecialActor. | |||
| 55566 | LD BC,1309 | Write 1309 to *ClipWindow_MinimumColumn. | |||
| 55569 | LD (25627),BC | ||||
|
Draw the actor if it is already active.
|
|||||
| 55573 | BIT 7,(IX+0) | Jump to Handler_RoomSixteen_Draw if the actor is already active. | |||
| 55577 | JR Z,Handler_RoomSixteen_Draw | ||||
|
Only spawn when the player is on a trigger row.
|
|||||
| 55579 | LD A,(25765) | Jump to Handler_RoomSixteen_Column if the player row is 7, 20 or 17, otherwise jump to Handler_RoomSixteen_Done. | |||
| 55582 | CP 7 | ||||
| 55584 | JR Z,Handler_RoomSixteen_Column | ||||
| 55586 | CP 20 | ||||
| 55588 | JR Z,Handler_RoomSixteen_Column | ||||
| 55590 | CP 17 | ||||
| 55592 | JP NZ,Handler_RoomSixteen_Done | ||||
|
Only spawn when the player is in the trigger columns.
|
|||||
| Handler_RoomSixteen_Column | 55595 | LD A,(25764) | Jump to Handler_RoomSixteen_Done unless the player column is 15-22. | ||
| 55598 | CP 23 | ||||
| 55600 | JP NC,Handler_RoomSixteen_Done | ||||
| 55603 | CP 15 | ||||
| 55605 | JR C,Handler_RoomSixteen_Done | ||||
|
Spawn on a random roll.
|
|||||
| 55607 | CALL JumpTable_GetRandomNumber | Jump to Handler_RoomSixteen_Done if the random number is 220 or higher. | |||
| 55610 | CP 220 | ||||
| 55612 | JR NC,Handler_RoomSixteen_Done | ||||
|
|
|||||
| 55614 | LD A,230 | Spawn the actor with sprite 230, colour WHITE (BRIGHT) and size 1 by 1. | |||
| 55616 | LD L,71 | ||||
| 55618 | LD DE,257 | ||||
| 55621 | CALL JumpTable_SpawnEntity | ||||
|
Choose left or right movement.
|
|||||
| 55624 | CALL JumpTable_GetRandomNumber | Jump to Handler_RoomSixteen_Right if the random number is 128 or higher. | |||
| 55627 | CP 128 | ||||
| 55629 | JR NC,Handler_RoomSixteen_Right | ||||
| 55631 | LD (IX+0),30 | Start at column 30 and write 251 as the horizontal delta. | |||
| 55635 | LD (IX+10),30 | ||||
| 55639 | LD (IX+8),251 | ||||
| 55643 | JR Handler_RoomSixteen_Sound | Jump to Handler_RoomSixteen_Sound. | |||
|
Start on the left and move right.
|
|||||
| Handler_RoomSixteen_Right | 55645 | LD (IX+0),5 | Start at column 5 and write 5 as the horizontal delta. | ||
| 55649 | LD (IX+10),5 | ||||
| 55653 | LD (IX+8),5 | ||||
|
Sound the actor appearing.
|
|||||
| Handler_RoomSixteen_Sound | 55657 | LD B,255 | Call Play_Noise with mask 255 and 50 iterations. | ||
| 55659 | LD D,50 | ||||
| 55661 | CALL Play_Noise | ||||
|
Choose the actor row.
|
|||||
| 55664 | LD A,(25765) | Jump to Handler_RoomSixteen_RowLow if the player row is 20. | |||
| 55667 | CP 20 | ||||
| 55669 | JR Z,Handler_RoomSixteen_RowLow | ||||
| 55671 | CP 17 | Jump to Handler_RoomSixteen_RowHigh if the player row is 17. | |||
| 55673 | JR Z,Handler_RoomSixteen_RowHigh | ||||
| 55675 | CALL JumpTable_GetRandomNumber | Jump to Handler_RoomSixteen_RowHigh if the random number is 128 or higher. | |||
| 55678 | CP 128 | ||||
| 55680 | JR NC,Handler_RoomSixteen_RowHigh | ||||
| Handler_RoomSixteen_RowLow | 55682 | LD (IX+1),19 | Write row 19 into the actor. | ||
| 55686 | LD (IX+11),19 | ||||
| 55690 | JR Handler_RoomSixteen_Draw | Jump to Handler_RoomSixteen_Draw. | |||
| Handler_RoomSixteen_RowHigh | 55692 | LD (IX+1),16 | Write row 16 into the actor. | ||
| 55696 | LD (IX+11),16 | ||||
|
Store, move, draw and erase the actor.
|
|||||
| Handler_RoomSixteen_Draw | 55700 | CALL JumpTable_AdvanceEntity | Call JumpTable_AdvanceEntity. | ||
| 55703 | CALL JumpTable_StorePosition | Call JumpTable_StorePosition. | |||
| 55706 | CALL JumpTable_MoveEntity | Call JumpTable_MoveEntity. | |||
| 55709 | CALL JumpTable_DrawEntity | Call JumpTable_DrawEntity. | |||
| 55712 | CALL JumpTable_EraseEntity | Call JumpTable_EraseEntity. | |||
|
Hide the actor once it has left the room.
|
|||||
| 55715 | LD A,(IX+0) | Deactivate the actor once column 35 is passed. | |||
| 55718 | CP 35 | ||||
| 55720 | JR C,Handler_RoomSixteen_Done | ||||
| 55722 | LD (IX+0),128 | ||||
|
Restore the clip window.
|
|||||
| Handler_RoomSixteen_Done | 55726 | LD BC,289 | Write 289 to *ClipWindow_MinimumColumn. | ||
| 55729 | LD (25627),BC | ||||
| 55733 | RET | Return. | |||
| Prev: 55444 | Up: Map | Next: 55734 |