Prev: 49868 Up: Map Next: 49975
49926: Start Transformation
Used by the routine at HandlePlayerLegs.
Starts the transformation of the player from human to wulf, or the other way round, when it is time to change (at the start of each day and each night). Nothing happens unless the change is due, and the player has been in the room for a while and is not jumping. Once the change starts the routine does not return to its caller, but to the one before, which skips the rest of the update of the player. The legs of the player are changed into the sparkles of HandleTransformation and the top half is hidden.
Input
IX Address of the legs of the player
Return unless the change is due and the player is ready.
StartTransformation 49926 LD A,(23473) Fetch the flag that says the player has to transform from TransformFlag.
49929 AND A Test it.
49930 RET Z Return if the player does not have to transform.
49931 LD A,(IX+12) Fetch the counter and flags of the player.
49934 AND %11110000 Keep the counter that runs when the player enters the room.
49936 RET NZ Return if the player has only just entered the room.
49937 BIT 3,(IX+12) Test whether the player is jumping.
49941 RET NZ Return if so.
Hide the top half and start the sparkle transformation.
49942 INC SP Drop the return address from the stack.
49943 INC SP
49944 LD A,(IX+0) Fetch the graphic number of the player.
49947 LD (23473),A Keep it, as the flag that the player is transforming at TransformFlag.
49950 LD (IX+16),8 Set the number of steps of the transformation to 8.
49954 PUSH IX Stash IX on the stack.
49956 LD DE,32 Set DE to the size of an object.
49959 ADD IX,DE Point IX at the top half of the player.
49961 LD (IX+0),1 Change the graphic of the top half to one that is not shown.
49965 CALL SetWipeAndDrawFlags Flag the top half to be wiped and drawn.
49968 POP IX Restore IX from the stack.
49970 CALL SetPixelAdjustments_Bricks11 Set the pixel adjustments of a transforming player.
49973 JR HandleTransformation_Flicker Jump to HandleTransformation_Flicker.
Prev: 49868 Up: Map Next: 49975