Prev: 53448 Up: Map Next: 53601
53546: Lose Life
Used by the routine at StartLife.
Puts the player back as it was when it entered the room, and takes a life off. If there are no lives left the game is over. The player is a human if the sun is out, or a wulf if the moon is out.
LoseLife 53546 LD HL,53601 Point HL at the copy of the player, PlayerCopy.
53549 LD DE,23560 Point DE at ObjectsTable.
53552 PUSH DE Point IX at the objects table (using the stack).
53553 POP IX
53555 LD BC,64 Set the length to 64, for the two halves of the player.
53558 LDIR Copy the player back.
53560 XOR A Clear the flag that says the player has to transform, TransformFlag.
53561 LD (23473),A
53564 LD HL,23482 Take a life off Lives.
53567 DEC (HL)
53568 JP M,GameOver Jump to GameOver if there are none left.
53571 LD A,(50253) Fetch the graphic number of the sun/moon from SunMoonObject.
53574 RRCA Move bit 0 into bit 5.
53575 RRCA
53576 RRCA
53577 AND %00100000 Keep it, which is 32 if the moon is out.
53579 LD C,A Stash it in C.
53580 LD A,(IX+16) Fetch the graphic number that the legs of the player will have when it appears.
53583 AND %00011111 Keep the number of the legs of a human.
53585 ADD A,C Add 32 if the moon is out, to make the legs of a wulf.
53586 LD (IX+16),A Store it.
53589 LD A,(IX+48) Fetch the graphic number that the top half of the player will have when it appears.
53592 AND %00001111 Keep the number of the top half without the form.
53594 ADD A,C Add 32 if the moon is out.
53595 ADD A,32 Add 32 to make the top half of a human or of a wulf.
53597 LD (IX+48),A Store it.
53600 RET Return.
Prev: 53448 Up: Map Next: 53601