![]() |
Routines |
| Prev: 52493 | Up: Map | Next: 52592 |
|
The handler of the object types 144 to 148, which are the five stones that have to be put on the pentagram. A stone can be picked up and dropped by the player, and falls like any other object, which is done by RunFallingObject_MoveFallingObject.
In the room of the pentagram (room 82), once it has been revealed by CheckObjectsCollected, a stone moves by itself instead. It is steered along x and y to the place that it has on the pentagram, which is one of the five pairs of positions at StonePlacesOnPentagram, with one for each of the stones, and it is not affected by gravity. When it gets there, it changes into the type that is 8 higher, which is a stone that is alight, and one is added to the count of stones in place. The game is won when the fifth is in place.
|
||||||||
|
Fall under gravity unless the pentagram is revealed.
|
||||||||
| RunPentagramStone | 52502 | CALL SetSpriteOffset_Minus16_Minus8 | Call SetSpriteOffset_Minus16_Minus8 to set the offsets of the sprite. | |||||
| 52505 | LD A,(42871) | Fetch the room that the player is in. | ||||||
| 52508 | CP 82 | Jump to RunFallingObject_MoveFallingObject if it is not room 82, to be moved by gravity. | ||||||
| 52510 | JP NZ,RunFallingObject_MoveFallingObject | |||||||
| 52513 | LD A,(42767) | Fetch the flag for the pentagram having been revealed. | ||||||
| 52516 | AND A | Jump to RunFallingObject_MoveFallingObject if it has not been, to be moved by gravity. | ||||||
| 52517 | JP Z,RunFallingObject_MoveFallingObject | |||||||
|
Steer the stone to its place on the pentagram.
|
||||||||
| 52520 | LD A,(IX+0) | Fetch the type of the stone. | ||||||
| 52523 | AND %00000111 | Keep the type without its highest five bits, which makes the number of the stone. | ||||||
| 52525 | ADD A,A | Double it, to make the offset of its place on the pentagram. | ||||||
| 52526 | LD L,A | Put the offset in HL. | ||||||
| 52527 | LD H,0 | |||||||
| 52529 | LD DE,54626 | Take the table of the places, StonePlacesOnPentagram. | ||||||
| 52532 | ADD HL,DE | Add the offset to the table. | ||||||
| 52533 | LD A,(HL) | Fetch the x position of the place and store it in the record of the stone. | ||||||
| 52534 | LD (IX+21),A | |||||||
| 52537 | INC HL | Move on to the y position. | ||||||
| 52538 | LD A,(HL) | Fetch the y position of the place and store it in the record of the stone. | ||||||
| 52539 | LD (IX+22),A | |||||||
| 52542 | CALL SteerTowardsTarget | Call SteerTowardsTarget to set the speeds along x and y towards the place. | ||||||
| 52545 | CALL ApplyGravityAndMove_Move | Call ApplyGravityAndMove_Move to move the stone, without gravity. | ||||||
| 52548 | LD A,(IX+1) | Fetch the x position of the stone and take off that of the place. | ||||||
| 52551 | SUB (IX+21) | |||||||
| 52554 | LD C,A | Put the result in C. | ||||||
| 52555 | LD A,(IX+2) | Fetch the y position of the stone and take off that of the place. | ||||||
| 52558 | SUB (IX+22) | |||||||
| 52561 | OR C | Combine the differences, and jump to FinishObjectMove if the stone is not there yet. | ||||||
| 52562 | JP NZ,FinishObjectMove | |||||||
|
Light the stone when it is in place.
|
||||||||
| 52565 | LD A,(IX+0) | Set the new type, which is 8 more than the old, in C. | ||||||
| 52568 | ADD A,8 | |||||||
| 52570 | LD C,A | |||||||
| 52571 | LD A,(IX+0) | Fetch the old type of the stone. | ||||||
| 52574 | CALL ChangeObjectType | Call ChangeObjectType to change the type of the stone, and that of its entry in the object store. | ||||||
| 52577 | LD A,(42827) | Add one to the count of stones that are in place. | ||||||
| 52580 | INC A | |||||||
| 52581 | LD (42827),A | |||||||
| 52584 | CP 5 | Jump to ShowVictoryScreen to show the victory screen if there are five. | ||||||
| 52586 | JP NC,ShowVictoryScreen | |||||||
| 52589 | JP FinishObjectMove | Jump to FinishObjectMove to finish. | ||||||
| Prev: 52493 | Up: Map | Next: 52592 |