Prev: C2CC Up: Map Next: C337
C306: 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 C306 LD A,($5BB1) Fetch the flag that says the player has to transform from TransformFlag.
C309 AND A Test it.
C30A RET Z Return if the player does not have to transform.
C30B LD A,(IX+$0C) Fetch the counter and flags of the player.
C30E AND %11110000 Keep the counter that runs when the player enters the room.
C310 RET NZ Return if the player has only just entered the room.
C311 BIT 3,(IX+$0C) Test whether the player is jumping.
C315 RET NZ Return if so.
Hide the top half and start the sparkle transformation.
C316 INC SP Drop the return address from the stack.
C317 INC SP
C318 LD A,(IX+$00) Fetch the graphic number of the player.
C31B LD ($5BB1),A Keep it, as the flag that the player is transforming at TransformFlag.
C31E LD (IX+$10),$08 Set the number of steps of the transformation to 08.
C322 PUSH IX Stash IX on the stack.
C324 LD DE,$0020 Set DE to the size of an object.
C327 ADD IX,DE Point IX at the top half of the player.
C329 LD (IX+$00),$01 Change the graphic of the top half to one that is not shown.
C32D CALL SetWipeAndDrawFlags Flag the top half to be wiped and drawn.
C330 POP IX Restore IX from the stack.
C332 CALL SetPixelAdjustments_Bricks11 Set the pixel adjustments of a transforming player.
C335 JR HandleTransformation_Flicker Jump to HandleTransformation_Flicker.
Prev: C2CC Up: Map Next: C337