Prev: B923 Up: Map Next: B965
B92C: Handle Repel Spell
Handles the spell that chases Wulf in the cauldron room and repels him. It moves towards the player, and it moves slowly if the player is near an arch. In the cauldron room it vanishes when the graphic number of the legs of the player is not in the range 10 to 4F.
Input
IX Address of the spell object
HandleRepelSpell B92C CALL SetPixelAdjustments_Sparkle Set the pixel adjustments of a sparkle.
B92F LD A,(IX+$08) Fetch the room that the spell is in.
B932 CP $88 Jump to HandleRepelSpell_Fast if the spell is in the cauldron room.
B934 JR Z,HandleRepelSpell_Fast
B936 LD A,($5C0F) Fetch the flags of the player.
B939 BIT 0,A Jump to HandleRepelSpell_Fast if the player is not.
B93B JR Z,HandleRepelSpell_Fast
B93D LD BC,$0101 Set the speeds in X and Y to 01.
B940 JR HandleRepelSpell_Move Jump to HandleRepelSpell_Move.
HandleRepelSpell_Fast B942 LD BC,$0404 Set the speeds in X and Y to 04.
HandleRepelSpell_Move B945 CALL SetSpeedTowardsPlayer Set the speeds of the spell to take it towards the player.
B948 CALL ApplyGravityAndMove Apply gravity to the spell and move it.
B94B CALL NextSpriteNumber Change to the next graphic of the spell.
B94E LD A,(IX+$08) Fetch the room that the spell is in.
B951 CP $88 Jump to HandleRepelSpell_Update if the spell is not in the cauldron room.
B953 JR NZ,HandleRepelSpell_Update
B955 LD A,($5C08) Fetch the graphic number of the legs of the player from ObjectsTable.
B958 SUB $10 Take off 10.
B95A CP $40 Jump to HandleRepelSpell_Update if the graphic number of the player is in the range.
B95C JR C,HandleRepelSpell_Update
This entry point is used by the routines at HandleCauldronBubbles, HandleVanishingObjectSparkles and HandleObjectAtCentreOfRoom.
Remove the object, by changing it to a graphic that is not shown.
HandleRepelSpell_Vanish B95E LD (IX+$00),$01 Change the graphic of the object to 01.
HandleRepelSpell_Update B962 JP DrawMovingObject Update the object.
Prev: B923 Up: Map Next: B965