Prev: 34655 Up: Map Next: 34726
34695: Handle Pop
The handler for the pop (sprite IDs 108 to 111) that is left when a creature is hit. The counter at offset 14 which was started at 16 by PopCreature, is counted down and the bottom two bits choose the frame of the animation. The pop is removed when the counter reaches zero.
Input
IX The pop entity
HandlerPop 34695 CALL StoreEntity Call StoreEntity to save the position of the pop.
34698 LD A,(60049) Fetch the room of the player from PlayerRoom.
34701 CP (IX+1) Jump to CountDownCreature if the pop is not in the same room as the player.
34704 JP NZ,CountDownCreature
34707 DEC (IX+14) Decrease the counter at offset 14 by one.
34710 JP Z,HandlerWeapon_Expire Jump to HandlerWeapon_Expire if it has reached zero, to remove the pop.
34713 LD A,(IX+14) Fetch the counter.
34716 AND %00000011 Keep only bits 0-1.
34718 ADD A,108 Add 108 to get the sprite ID of the pop.
34720 LD (IX+0),A Update the sprite ID of the pop.
34723 JP HandlerCharacter_Display Jump to HandlerCharacter_Display to display the pop.
Prev: 34655 Up: Map Next: 34726