Prev: 47395 Up: Map Next: 47461
47404: 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 16 to 79.
Input
IX Address of the spell object
HandleRepelSpell 47404 CALL SetPixelAdjustments_Sparkle Set the pixel adjustments of a sparkle.
47407 LD A,(IX+8) Fetch the room that the spell is in.
47410 CP 136 Jump to HandleRepelSpell_Fast if the spell is in the cauldron room.
47412 JR Z,HandleRepelSpell_Fast
47414 LD A,(23567) Fetch the flags of the player.
47417 BIT 0,A Jump to HandleRepelSpell_Fast if the player is not.
47419 JR Z,HandleRepelSpell_Fast
47421 LD BC,257 Set the speeds in X and Y to 1.
47424 JR HandleRepelSpell_Move Jump to HandleRepelSpell_Move.
HandleRepelSpell_Fast 47426 LD BC,1028 Set the speeds in X and Y to 4.
HandleRepelSpell_Move 47429 CALL SetSpeedTowardsPlayer Set the speeds of the spell to take it towards the player.
47432 CALL ApplyGravityAndMove Apply gravity to the spell and move it.
47435 CALL NextSpriteNumber Change to the next graphic of the spell.
47438 LD A,(IX+8) Fetch the room that the spell is in.
47441 CP 136 Jump to HandleRepelSpell_Update if the spell is not in the cauldron room.
47443 JR NZ,HandleRepelSpell_Update
47445 LD A,(23560) Fetch the graphic number of the legs of the player from ObjectsTable.
47448 SUB 16 Take off 16.
47450 CP 64 Jump to HandleRepelSpell_Update if the graphic number of the player is in the range.
47452 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 47454 LD (IX+0),1 Change the graphic of the object to 1.
HandleRepelSpell_Update 47458 JP DrawMovingObject Update the object.
Prev: 47395 Up: Map Next: 47461