Prev: 53026 Up: Map Next: 53150
53096: Run Collectable Object
The handler of the object types 112 to 119, which are the four objects that are the aim of the quest, and the same four once they have been collected. An object is collected by the helper, RunHelper, which sets bit 0 of the handler flags at 22.
When that has happened, the player is given an extra life, and the object changes to the type that is 4 higher, in the object store as well. When all four have been collected, CheckObjectsCollected reveals the pentagram.
Input
IX Object record
Return unless the helper has collected the object.
RunCollectableObject 53096 CALL SetSpriteOffset_Minus16_Minus8 Call SetSpriteOffset_Minus16_Minus8 to set the offsets of the sprite.
53099 CALL ApplyGravityAndMove_Move Call ApplyGravityAndMove_Move to move the object, without gravity.
53102 BIT 0,(IX+22) Return if the object has not been collected.
53106 RET Z
Give a life and change the object to the collected type.
53107 LD A,(42828) Add one to the count of objects collected.
53110 INC A
53111 LD (42828),A
53114 LD A,(42785) Add one to the number of lives.
53117 INC A
53118 LD (42785),A
53121 PUSH IX Save IX.
53123 CALL DrawLives Call DrawLives to draw the lives.
53126 POP IX Get IX back.
53128 RES 0,(IX+22) Clear the flag for the object having been collected.
53132 LD A,(IX+0) Set the new type, which is 4 more than the old, in C.
53135 ADD A,4
53137 LD C,A
53138 LD A,(IX+0) Fetch the old type of the object.
53141 CALL ChangeObjectType Call ChangeObjectType to change the type of the object, and that of its entry in the object store.
53144 CALL CheckObjectsCollected Call CheckObjectsCollected to find out if all of the objects have been collected.
53147 JP SetWipeAndDrawFlags Jump to SetWipeAndDrawFlags to flag the object as moved.
Prev: 53026 Up: Map Next: 53150