Prev: 43096 Up: Map Next: 43236
43186: Test Wulf Pounce
Used by the routine at HandlerWulf.
Makes the Wulf pounce (sprite IDs 88 and 92) when it is moving left, is in the same room as the player, is to the right of the player and the player is attacking to the right (sprite IDs 40 to 47). TestWulfPounceRight does the same for a Wulf moving right.
Input
IX Actor record of the Wulf
TestWulfPounce 43186 LD A,(38659) Fetch the room of the player from 38659.
43189 CP (IX+1) Return if the Wulf is in a different room to the player.
43192 RET NZ
43193 LD A,(IX+2) Fetch the pounce timer of the Wulf.
43196 AND %11110000 Keep only bits 4-7.
43198 RET NZ Return if the Wulf is pouncing already.
43199 LD A,(IX+6) Fetch the X velocity of the Wulf.
43202 AND A Jump to TestWulfPounceRight if the Wulf is moving right.
43203 JP P,TestWulfPounceRight
43206 LD A,(38661) Fetch the X position of the player from 38661.
43209 CP (IX+3) Return if the player is not to the left of the Wulf.
43212 RET NC
43213 LD A,(38658) Fetch the sprite ID of the player from ImmortalData.
43216 SUB 40 Subtract 40.
43218 CP 8 Return if the player is not attacking to the right.
43220 RET NC
This entry point is used by the routine at TestWulfPounceRight.
Start the pounce.
TestWulfPounce_Start 43221 LD A,(IX+0) Fetch the sprite ID of the Wulf.
43224 AND %11111100 Keep only bits 2-7.
43226 OR %00001000 Set bit 3, giving a sprite ID of 88 or 92.
43228 LD (IX+0),A Set the new sprite ID of the Wulf.
43231 LD (IX+2),15 Set the pounce timer of the Wulf to 15.
43235 RET Return.
Prev: 43096 Up: Map Next: 43236