Prev: EF91 Up: Map Next: F429
F395: Treasure Action Function.
Used by the routine at Vecotr_Main.
ActionTreasure F395 LD A,(CamDirection_DFD2)
F398 BIT 0,A
F39A JR Z,ActionTreasure_0
F39C LD HL,(ManData_PosPrimary_dfc3)
F39F LD E,(IX+$05)
F3A2 LD D,(IX+$06)
F3A5 CALL Vector_ABS(hl_minus_de)
F3A8 LD DE,$0022
F3AB AND A
F3AC SBC HL,DE
F3AE JR C,ActionTreasure_1
ActionTreasure_0 F3B0 XOR A Hot spot has come out of range, disable.
F3B1 LD (TripValue),A
F3B4 LD (IX+$0B),A
F3B7 RET
ActionTreasure_1 F3B8 ADD HL,DE
F3B9 LD A,(IX+$0D)
F3BC AND A
F3BD JR NZ,ActionTreasure_5
F3BF LD DE,$0005
F3C2 AND A
F3C3 SBC HL,DE
F3C5 RET NC
F3C6 LD HL,$F34B
F3C9 LD D,$04
ActionTreasure_2 F3CB LD A,(IX+$02)
F3CE CP (HL)
F3CF JR Z,ActionTreasure_3
F3D1 DEC D
F3D2 JR Z,ActionTreasure_0
F3D4 LD BC,$0007
F3D7 ADD HL,BC
F3D8 LD BC,$0064
F3DB LD A,$5E
F3DD CPIR
F3DF JR ActionTreasure_2
ActionTreasure_3 F3E1 INC HL
F3E2 LD (TripObjPtr),HL
ActionTreasure_4 F3E5 LD HL,(ManData_FirstObjectCarried)
F3E8 LD A,L
F3E9 OR H
F3EA RET Z
F3EB INC HL
F3EC INC HL
F3ED LD A,(HL)
F3EE INC HL
F3EF BIT 4,(HL)
F3F1 RET Z
F3F2 LD HL,TripValue
F3F5 LD (HL),A
F3F6 INC HL
F3F7 LD (HL),$00
F3F9 LD (IX+$0D),$01
F3FD RET
ActionTreasure_5 F3FE LD A,(ActionFlags)
F401 BIT 6,A
F403 JR Z,ActionTreasure_6
F405 LD HL,(TripObjPtr)
F408 DEC HL
F409 LD (HL),$00
F40B CALL Vector_DisplayWarning
F40E DEFM "treasure"
F416 LD E,(HL)
F417 JR ActionTreasure_0
ActionTreasure_6 F419 XOR A
F41A LD (TripValue),A
F41D LD (IX+$0D),A
F420 LD DE,$0005
F423 AND A
F424 SBC HL,DE
F426 JR C,ActionTreasure_4
F428 RET
Prev: EF91 Up: Map Next: F429