Prev: A858 Up: Map Next: A8E4
A8B2: Test Wulf Pounce
Used by the routine at HandlerWulf.
Makes the Wulf pounce (sprite IDs 58 and 5C) 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 28 to 2F). TestWulfPounceRight does the same for a Wulf moving right.
Input
IX Actor record of the Wulf
TestWulfPounce A8B2 LD A,($9703) Fetch the room of the player from 9703.
A8B5 CP (IX+$01) Return if the Wulf is in a different room to the player.
A8B8 RET NZ
A8B9 LD A,(IX+$02) Fetch the pounce timer of the Wulf.
A8BC AND %11110000 Keep only bits 4-7.
A8BE RET NZ Return if the Wulf is pouncing already.
A8BF LD A,(IX+$06) Fetch the X velocity of the Wulf.
A8C2 AND A Jump to TestWulfPounceRight if the Wulf is moving right.
A8C3 JP P,TestWulfPounceRight
A8C6 LD A,($9705) Fetch the X position of the player from 9705.
A8C9 CP (IX+$03) Return if the player is not to the left of the Wulf.
A8CC RET NC
A8CD LD A,($9702) Fetch the sprite ID of the player from ImmortalData.
A8D0 SUB $28 Subtract 28.
A8D2 CP $08 Return if the player is not attacking to the right.
A8D4 RET NC
This entry point is used by the routine at TestWulfPounceRight.
Start the pounce.
TestWulfPounce_Start A8D5 LD A,(IX+$00) Fetch the sprite ID of the Wulf.
A8D8 AND %11111100 Keep only bits 2-7.
A8DA OR %00001000 Set bit 3, giving a sprite ID of 58 or 5C.
A8DC LD (IX+$00),A Set the new sprite ID of the Wulf.
A8DF LD (IX+$02),$0F Set the pounce timer of the Wulf to 0F.
A8E3 RET Return.
Prev: A858 Up: Map Next: A8E4