Prev: 9C0F Up: Map Next: 9DE0
9C59: Lightning spell
lightning_spell 9C59 LD A,(computer_player_flag)
9C5C OR A
9C5D JP NZ,lightning_spell_10
lightning_spell_0 9C60 CALL routine41
9C63 CALL $02BF
9C66 CP $53
9C68 JR Z,lightning_spell_1
9C6A CP $4B
9C6C JR NZ,lightning_spell_0
9C6E LD HL,sound_effect_18
9C71 CALL play_sound_effect_in_HL
9C74 EI
9C75 RET
lightning_spell_1 9C76 LD HL,(object_table_entry_pointer)
9C79 LD A,(HL)
9C7A OR A
9C7B JR Z,lightning_spell_0
9C7D EX DE,HL
9C7E LD HL,(D_ADD)
9C81 XOR A
9C82 SBC HL,DE
9C84 JR Z,lightning_spell_0
9C86 CALL routine10
9C89 JP P,lightning_spell_2
9C8C CALL clear_bottom_row
9C8F LD BC,$1600
9C92 LD A,$45
9C94 LD ($5C8F),A
9C97 LD A,$35
9C99 CALL MPRINT
9C9C CALL wait_no_key_seed
9C9F CALL wait_key_seed
9CA2 JR lightning_spell_0
lightning_spell_2 9CA4 CALL routine14
9CA7 JR NZ,lightning_spell_0
lightning_spell_3 9CA9 LD A,$05
9CAB LD (unknown48),A
9CAE LD HL,sound_effect_13
9CB1 LD (sound_effect_pointer),HL
9CB4 LD A,(CURSP)
9CB7 CP $2B
9CB9 JP M,lightning_spell_4
9CBC LD HL,sound_effect_04
9CBF LD (sound_effect_pointer),HL
9CC2 LD A,$06
9CC4 LD (unknown48),A
lightning_spell_4 9CC7 CALL play_sound_effect_pointer
9CCA CALL routine28
9CCD CALL routine50
9CD0 LD HL,S10
9CD3 LD (sound_effect_pointer),HL
9CD6 CALL play_sound_effect_pointer
9CD9 LD HL,(object_table_entry_pointer)
9CDC LD (temp_entry_pointer),HL
9CDF CALL address_to_coordinate
9CE2 LD (LC_POS),HL
9CE5 LD A,$47
9CE7 LD ($5C8F),A
9CEA LD HL,WOOP_D
9CED LD B,$09
9CEF LD DE,$0020
lightning_spell_5 9CF2 PUSH BC
9CF3 PUSH HL
9CF4 PUSH DE
9CF5 LD (C_DATA),HL
9CF8 CALL P_CHAR
9CFB CALL sound_effect_playback
9CFE POP DE
9CFF POP HL
9D00 POP BC
9D01 ADD HL,DE
9D02 DJNZ lightning_spell_5
9D04 CALL routine50
9D07 LD HL,(object_table_entry_pointer)
9D0A LD A,(HL)
9D0B CP $23
9D0D JR Z,lightning_spell_8
9D0F CP $28
9D11 JR Z,lightning_spell_8
9D13 CP $27
9D15 JR Z,lightning_spell_8
9D17 CP $26
9D19 JR Z,lightning_spell_8
9D1B LD D,A
9D1C LD E,$10
9D1E CALL GETCHR
9D21 LD (STRENG),A
9D24 LD A,(HL)
9D25 CP $29
9D27 JP M,lightning_spell_6
9D2A SUB $29
9D2C LD HL,unknown_table_3
9D2F LD D,$00
9D31 LD E,A
9D32 ADD HL,DE
9D33 LD A,(HL)
9D34 AND $C0
9D36 OR A
9D37 JR Z,lightning_spell_6
9D39 RLCA
9D3A RLCA
9D3B INC A
9D3C LD HL,STRENG
9D3F ADD A,(HL)
9D40 LD (HL),A
lightning_spell_6 9D41 CALL get_random
9D44 LD HL,STRENG
9D47 ADD A,(HL)
9D48 LD (HL),A
9D49 CALL get_random
9D4C ADD A,$03
9D4E LD E,A
9D4F LD A,(CURSP)
9D52 CP $2B
9D54 JP M,lightning_spell_7
9D57 LD A,E
9D58 ADD A,$03
9D5A LD E,A
lightning_spell_7 9D5B LD A,E
9D5C LD HL,STRENG
9D5F CP (HL)
9D60 JP M,lightning_spell_8
9D63 CALL disbelieve_spell_4
9D66 LD HL,(object_table_entry_pointer)
9D69 LD A,(HL)
9D6A CP $29
9D6C JP P,lightning_spell_9
9D6F LD (HL),$01
9D71 LD DE,$0281
9D74 ADD HL,DE
9D75 LD A,(HL)
9D76 OR A
9D77 JR Z,lightning_spell_8
9D79 LD (HL),$00
9D7B LD HL,(object_table_entry_pointer)
9D7E LD (HL),A
lightning_spell_8 9D7F CALL routine50
9D82 RET
lightning_spell_9 9D83 CALL WIZKIL
9D86 CALL routine50
9D89 RET
lightning_spell_10 9D8A LD HL,(D_ADD)
9D8D LD (X_ADD),HL
9D90 LD (TEMADD),HL
9D93 CALL FIREON
9D96 CALL lightning_spell_13
9D99 CP $FF
9D9B JR NZ,lightning_spell_11
9D9D LD A,$00
9D9F LD (unknown10),A
9DA2 RET
lightning_spell_11 9DA3 CALL display_wizard_spell_range
9DA6 CALL lightning_spell_3
9DA9 RET
lightning_spell_12 9DAA LD HL,(BUFPNT)
9DAD INC HL
9DAE INC HL
9DAF LD (BUFPNT),HL
lightning_spell_13 9DB2 LD HL,(BUFPNT)
9DB5 LD A,(HL)
9DB6 CP $FF
9DB8 RET Z
9DB9 LD HL,map_object_table
9DBC LD D,$00
9DBE LD E,A
9DBF ADD HL,DE
9DC0 LD (object_table_entry_pointer),HL
9DC3 LD A,(HL)
9DC4 CP $25
9DC6 JR Z,lightning_spell_14
9DC8 CP $29
9DCA JP P,lightning_spell_14
9DCD CP $23
9DCF JP P,lightning_spell_12
lightning_spell_14 9DD2 CALL routine10
9DD5 JP M,lightning_spell_12
9DD8 CALL routine14
9DDB JP NZ,lightning_spell_12
9DDE XOR A
9DDF RET
Prev: 9C0F Up: Map Next: 9DE0