Prev: 49579 Up: Map Next: 49714
49649: Handle Object Dropped In Cauldron
Handles the graphic numbers 104 to 110, which are the special objects once the player has dropped them above the cauldron. The object moves towards the centre of the room in X and Y at a speed of one. While it does so it is kept at a height of about 152: it is lifted if it is below that, and it hangs there if it is not. Once it is at the centre of the room, it falls into the cauldron.
Input
IX Address of the object
Move the object towards the centre of the room.
HandleObjectDroppedInCauldron 49649 CALL SetPixelAdjustments_Sparkle Set the pixel adjustments of a sparkle.
49652 LD A,(IX+1) Fetch the X coordinate of the object.
49655 SUB 128 Subtract the X coordinate of the centre of the room.
49657 JR Z,HandleObjectDroppedInCauldron_SetX Jump to HandleObjectDroppedInCauldron_SetX if the object is at the centre of the room.
49659 LD A,1 Set the speed to 1.
49661 JP M,HandleObjectDroppedInCauldron_SetX Jump to HandleObjectDroppedInCauldron_SetX if the object is on the west side of the centre.
49664 NEG Make the speed negative.
HandleObjectDroppedInCauldron_SetX 49666 LD (IX+9),A Set the speed in X, towards the centre of the room.
49669 LD A,(IX+2) Fetch the Y coordinate of the object.
49672 SUB 128 Subtract the Y coordinate of the centre of the room.
49674 JR Z,HandleObjectDroppedInCauldron_SetY Jump to HandleObjectDroppedInCauldron_SetY if the object is at the centre of the room.
49676 LD A,1 Set the speed to 1.
49678 JP M,HandleObjectDroppedInCauldron_SetY Jump to HandleObjectDroppedInCauldron_SetY if the object is on the south side of the centre.
49681 NEG Make the speed negative.
HandleObjectDroppedInCauldron_SetY 49683 LD (IX+10),A Set the speed in Y, towards the centre of the room.
49686 LD A,(IX+1) Fetch the X coordinate of the object.
49689 CP 128 Jump to HandleObjectDroppedInCauldron_Lift if the object is not at the centre of the room in X.
49691 JR NZ,HandleObjectDroppedInCauldron_Lift
49693 XOR (IX+2) Combine the X coordinate of the object with the Y coordinate.
49696 JR Z,HandleObjectAtCentreOfRoom Jump to HandleObjectAtCentreOfRoom if the object is at the centre of the room in Y too.
HandleObjectDroppedInCauldron_Lift 49698 LD A,(IX+3) Fetch the Z coordinate of the object.
49701 CP 152 Compare it with 152.
49703 LD A,1 Set the speed in Z to 1.
49705 JR NC,HandleObjectDroppedInCauldron_SetZ Jump to HandleObjectDroppedInCauldron_SetZ if the object is as high as that.
49707 INC A Set the speed in Z to 2.
HandleObjectDroppedInCauldron_SetZ 49708 LD (IX+11),A Set the speed in Z.
This entry point is used by the routine at HandleObjectAtCentreOfRoom.
HandleObjectDroppedInCauldron_Move 49711 CALL ApplyGravityAndMove Apply gravity to the object and move it.
Prev: 49579 Up: Map Next: 49714