Prev: 87C9 Up: Map Next: 8ABF
89E9: Routine at 89E9
Used by the routine at _87c9.
_89e9_Shoot 89E9 LD HL,KeyState_Actions See if the gun has any charge.
89EC LD A,(Gun_Charge)
89EF AND A
89F0 JR NZ,_89e9_Shoot_0
89F2 RES 4,(HL)
_89e9_Shoot_0 89F4 BIT 4,(HL) Check for any shoot action performed.
89F6 RET Z Return if not.
89F7 LD A,$01 See if the power gun is carried.
89F9 CALL Obj_CarriedSearch
89FC JR Z,_89e9_Shoot_1
89FE LD A,$13 See if the hyper gun is being carried.
8A00 CALL Obj_CarriedSearch
8A03 RET NZ Return if neither.
_89e9_Shoot_1 8A04 LD A,($BD15)
8A07 INC A
8A08 LD ($BD15),A
8A0B RRCA
8A0C JP C,_89e9_Shoot_10
8A0F CALL LinkList_MoveLinkFrom
8A12 RET Z
8A13 LD HL,(_bd35_LinkList)
8A16 LD C,L
8A17 LD B,H
8A18 LD E,(HL)
8A19 LD (HL),$00
8A1B INC HL
8A1C LD D,(HL)
8A1D LD (HL),$00
8A1F LD (_bd35_LinkList),DE
8A23 LD HL,_bd35_LinkList
_89e9_Shoot_2 8A26 LD E,(HL)
8A27 INC HL
8A28 LD D,(HL)
8A29 LD A,E
8A2A OR D
8A2B JR Z,_89e9_Shoot_3
8A2D EX DE,HL
8A2E JR _89e9_Shoot_2
_89e9_Shoot_3 8A30 LD (HL),B
8A31 DEC HL
8A32 LD (HL),C
8A33 LD (IX+$02),$05
8A37 LD HL,$9733
8A3A LD (IX+$03),L
8A3D LD (IX+$04),H
8A40 LD (IX+$09),$30
8A44 LD A,(Stage_Compass)
8A47 LD (IX+$0A),A
8A4A LD (IX+$0B),$4D
8A4E LD (IX+$0C),$4C
8A52 LD A,(Hero_LastDir)
8A55 CP $02
8A57 LD A,(Stage_Compass)
8A5A JR NZ,_89e9_Shoot_4
8A5C DEC A
8A5D DEC A
_89e9_Shoot_4 8A5E INC A
8A5F AND $03
8A61 LD (IX+$0D),A
8A64 LD HL,(Position_NS)
8A67 LD DE,(Position_EW)
8A6B LD BC,$FFFE
8A6E AND A
8A6F JR Z,_89e9_Shoot_5
8A71 CP $03
8A73 JR Z,_89e9_Shoot_5
8A75 LD BC,$0002
_89e9_Shoot_5 8A78 BIT 0,A
8A7A JR Z,_89e9_Shoot_6
8A7C EX DE,HL
8A7D ADD HL,BC
8A7E EX DE,HL
8A7F JR _89e9_Shoot_7
_89e9_Shoot_6 8A81 ADD HL,BC
_89e9_Shoot_7 8A82 LD (IX+$05),L
8A85 LD (IX+$06),H
8A88 LD (IX+$07),E
8A8B LD (IX+$08),D
8A8E LD DE,$89E6
8A91 LD A,$13
8A93 CALL Obj_CarriedSearch
8A96 JR NZ,_89e9_Shoot_8
8A98 INC DE
_89e9_Shoot_8 8A99 EX DE,HL
8A9A LD A,(Area_Colour)
8A9D RRCA
8A9E RRCA
8A9F RRCA
8AA0 XOR (HL)
8AA1 AND $07
8AA3 JR NZ,_89e9_Shoot_9
8AA5 INC HL
_89e9_Shoot_9 8AA6 LD A,(Area_Colour)
8AA9 AND $F8
8AAB OR (HL)
8AAC LD (IX+$0E),A
8AAF LD HL,Gun_Charge
8AB2 DEC (HL)
8AB3 LD A,(HL)
8AB4 AND $03
8AB6 CALL Z,Charge_DecreaseOnScreen
_89e9_Shoot_10 8AB9 LD A,$14
8ABB POP HL
8ABC JP $AFFD
Prev: 87C9 Up: Map Next: 8ABF