Prev: A70D Up: Map Next: A763
A737: Test Orchid Touched
Used by the routine at HandlerOrchid.
Tests whether the player is touching an orchid which is fully grown. If so then the orchid shrinks away (its timer is zeroed), the effect timer in OrchidEffectTimer is started and the player takes on the colour of the orchid. If the orchid is white (47) then the effect timer is reset instead, which removes any effect. A low tone is played.
Input
IX Actor record of the orchid
TestOrchidTouched A737 LD A,(IX+$00) Fetch the sprite ID of the orchid.
A73A CPL Flip the bits, so that a fully grown orchid gives zero.
A73B AND %00000111 Keep only bits 0-2.
A73D RET NZ Return if the orchid is not fully grown.
A73E LD BC,$0F0F Set the reach used to test whether the player is touching the orchid in BC to 0F0F.
A741 CALL TestPlayerTouchingActor Test whether the player is touching the orchid.
A744 RET NC Return if the player is not touching the orchid.
A745 LD A,$C0 Set the orchid effect timer in OrchidEffectTimer to C0.
A747 LD ($96B0),A
A74A XOR A Clear A.
A74B LD (IX+$06),A Clear the low byte of the timer of the orchid.
A74E LD (IX+$07),A Clear the high byte of the timer of the orchid.
A751 LD A,(IX+$05) Fetch the colour of the orchid.
A754 LD ($9707),A Set the colour of the player to the colour of the orchid.
A757 CP $47 Jump to PlayLowTone to play the low tone if the orchid is not white.
A759 JP NZ,PlayLowTone
A75C XOR A Clear the orchid effect timer in OrchidEffectTimer, as a white orchid has no effect.
A75D LD ($96B0),A
A760 JP PlayLowTone Jump to PlayLowTone to play the low tone.
Prev: A70D Up: Map Next: A763