Prev: 7A35 Up: Map Next: 7B01
7A64: Action Handler for the Olcweed
Used by the routine at Vector_Main.
ActionOlcWeed 7A64 LD A,(CamDirection_DFD2) Olcweeds only appear for N/S facing cameras.
7A67 BIT 0,A
7A69 JR NZ,ActionOlcWeed_0
7A6B LD HL,(ManData_PosSecondary_dfc5) Make sure it is visible.
7A6E LD E,(IX+$07)
7A71 LD D,(IX+$08)
7A74 CALL abs(hl_minus_de)
7A77 LD DE,$0022
7A7A AND A
7A7B SBC HL,DE
7A7D JR C,ActionOlcWeed_1
7A7F RET Z
ActionOlcWeed_0 7A80 LD (IX+$0B),$00 Do nothing.
7A84 RET
Work out animation
ActionOlcWeed_1 7A85 ADD HL,DE Get back position.
7A86 EX DE,HL
7A87 LD HL,($5C78) FRAMES, for a timer.
7A8A LD A,H
7A8B AND $3F
7A8D LD H,A
7A8E LD A,$5F
7A90 LD BC,$2004
7A93 AND A
7A94 SBC HL,BC
7A96 JR NC,ActionOlcWeed_2
7A98 LD A,$64
ActionOlcWeed_2 7A9A EX AF,AF'
7A9B LD A,(IX+$0B) Get bitmap to blit.
7A9E CP $5F
7AA0 JR NZ,ActionOlcWeed_3
7AA2 LD L,E
7AA3 LD H,D
7AA4 LD BC,$0008
7AA7 AND A
7AA8 SBC HL,BC
7AAA JR C,ActionOlcWeed_6
ActionOlcWeed_3 7AAC EX AF,AF'
7AAD BIT 0,(IX+$0D)
7AB1 JR NZ,ActionOlcWeed_4
7AB3 LD (IX+$0B),A
7AB6 JR ActionOlcWeed_6
ActionOlcWeed_4 7AB8 CP (IX+$0B)
7ABB JR Z,ActionOlcWeed_6 If current bitmap index is at the end frame, then do no animating.
7ABD JR C,ActionOlcWeed_5 If current bitmap index is less than the end frame, then the weed is standing up...
7ABF INC (IX+$0B) Move onto next frame. (bending down)
7AC2 JR ActionOlcWeed_6
ActionOlcWeed_5 7AC4 DEC (IX+$0B) Move onto previous frame. (standing up)
Check for death
ActionOlcWeed_6 7AC7 LD A,(DeathMode) If hero is having a 'death' then do nothing.
7ACA AND A
7ACB JR NZ,ActionOlcWeed_7
7ACD LD A,(IX+$0B) If the olc weed is standing up, do nothing.
7AD0 CP $5F
7AD2 JR Z,ActionOlcWeed_7
7AD4 LD HL,$0005 See if player is close enough to be 'stung'.
7AD7 AND A
7AD8 SBC HL,DE
7ADA JR NZ,ActionOlcWeed_7
7ADC LD A,$14 Set hero up for death.
7ADE LD (DeathMode),A
Calculat Y position on screen
ActionOlcWeed_7 7AE1 LD A,(IX+$0B) Calculate Y position based on bitmap.
7AE4 LD B,$10
7AE6 CP $61
7AE8 JR C,ActionOlcWeed_8
7AEA LD B,$18
7AEC CP $63
7AEE JR C,ActionOlcWeed_8
7AF0 LD B,$20
Draw Olc Weed
ActionOlcWeed_8 7AF2 LD (IX+$09),B Store Y position.
7AF5 LD (IX+$0D),$01
7AF9 LD (IX+$0C),$01
7AFD CALL Vector_SpriteBlit
7B00 RET
Prev: 7A35 Up: Map Next: 7B01