Prev: 42765 Up: Map Next: 42851
42807: 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 (71) then the effect timer is reset instead, which removes any effect. A low tone is played.
Input
IX Actor record of the orchid
TestOrchidTouched 42807 LD A,(IX+0) Fetch the sprite ID of the orchid.
42810 CPL Flip the bits, so that a fully grown orchid gives zero.
42811 AND %00000111 Keep only bits 0-2.
42813 RET NZ Return if the orchid is not fully grown.
42814 LD BC,3855 Set the reach used to test whether the player is touching the orchid in BC to 3855.
42817 CALL TestPlayerTouchingActor Test whether the player is touching the orchid.
42820 RET NC Return if the player is not touching the orchid.
42821 LD A,192 Set the orchid effect timer in OrchidEffectTimer to 192.
42823 LD (38576),A
42826 XOR A Clear A.
42827 LD (IX+6),A Clear the low byte of the timer of the orchid.
42830 LD (IX+7),A Clear the high byte of the timer of the orchid.
42833 LD A,(IX+5) Fetch the colour of the orchid.
42836 LD (38663),A Set the colour of the player to the colour of the orchid.
42839 CP 71 Jump to PlayLowTone to play the low tone if the orchid is not white.
42841 JP NZ,PlayLowTone
42844 XOR A Clear the orchid effect timer in OrchidEffectTimer, as a white orchid has no effect.
42845 LD (38576),A
42848 JP PlayLowTone Jump to PlayLowTone to play the low tone.
Prev: 42765 Up: Map Next: 42851