Prev: C679 Up: Map Next: C6D4
C67A: routine52
Used by the routines at EN_AN, FIREON and routine68.
routine52 C67A LD HL,(object_table_entry_pointer)
C67D LD A,(HL)
C67E OR A
C67F JR Z,routine52_0
C681 LD DE,$0141
C684 ADD HL,DE
C685 LD A,(HL)
C686 CP $04
C688 JR Z,routine52_0
C68A LD HL,(object_table_entry_pointer)
C68D LD DE,$01E1
C690 ADD HL,DE
C691 LD A,(HL)
C692 AND $07
C694 LD HL,(current_player)
C697 CP L
C698 JR Z,routine52_0
C69A LD HL,(object_table_entry_pointer)
C69D LD A,(HL)
C69E LD E,A
C69F DEC E
C6A0 DEC E
C6A1 LD D,$00
C6A3 LD HL,THRTAB
C6A6 ADD HL,DE
C6A7 LD A,(HL)
C6A8 LD (unknown82),A
C6AB LD HL,(object_table_entry_pointer)
C6AE CALL routine53
C6B1 LD (unknown75),HL
C6B4 LD HL,(D_ADD)
C6B7 CALL routine53
C6BA LD (unknown76),HL
C6BD CALL calculate_distance
C6C0 LD A,(total_distance)
C6C3 LD E,A
C6C4 LD A,(unknown82)
C6C7 ADD A,$04
C6C9 LD HL,unknown64
C6CC ADD A,(HL)
C6CD SUB E
C6CE JP M,routine52_0
C6D1 RET
routine52_0 C6D2 XOR A
C6D3 RET
Prev: C679 Up: Map Next: C6D4