Prev: 84C0 Up: Map Next: 85F6
84F7: Subversion spell.
subversion_spell 84F7 LD A,(computer_player_flag) Jump to subversion_computer if player is not human.
84FA OR A
84FB JR NZ,subversion_computer
84FD CALL clear_bottom_row Clear bottom row of screen.
8500 LD A,$03 Set P-FLAGS to 3 (OVER mode).
8502 LD ($5C91),A
subversion_spell_0 8505 CALL routine41 Call routine41 ???
8508 CALL $02BF Call KEYBOARD routine in Spectrum ROM.
850B CP $53 If keypress is 'S' jump to subversion_pressed_s.
850D JR Z,subversion_pressed_s
850F CP $4B Else if keypress is not 'K' loop back to 8508.
8511 JR NZ,subversion_spell_0
subversion_pressed_k 8513 LD HL,sound_effect_18 Play sound_effect_18.
8516 CALL play_sound_effect_in_HL
8519 EI Enable interrupts and return.
851A RET
subversion_pressed_s 851B CALL subversion_spell_1
851E JR NZ,subversion_spell_0
8520 LD HL,(object_table_entry_pointer)
8523 LD A,(HL)
8524 CP $22
8526 JP P,subversion_spell_0
8529 OR A
852A JR Z,subversion_spell_0
852C CALL routine10
852F JP M,subversion_spell_0
8532 CALL routine14
8535 JR NZ,subversion_spell_0
8537 CALL SUB_DO
853A RET
subversion_computer 853B LD HL,(D_ADD)
853E LD (TEMADD),HL
8541 CALL EN_AN
8544 LD HL,(TEMADD)
8547 LD (D_ADD),HL
854A LD HL,INBUF
854D LD (BUFPNT),HL
8550 LD A,(SRTCNT)
8553 INC A
8554 CALL SORT
BART_L 8557 CALL GETPLA
855A CP $FF
855C JR NZ,OK_SUB
855E LD A,$00
8560 LD (unknown10),A
8563 CALL PAUSER
8566 RET
OK_SUB 8567 LD HL,map_object_table
856A LD D,$00
856C LD E,A
856D ADD HL,DE
856E LD (object_table_entry_pointer),HL
8571 CALL subversion_spell_1
8574 JR NZ,BART_L
8576 LD HL,(object_table_entry_pointer)
8579 LD A,(HL)
857A CP $22
857C JP P,BART_L
857F OR A
8580 JR Z,BART_L
8582 CALL routine10
8585 JP M,BART_L
8588 CALL routine14
858B JR NZ,BART_L
858D LD HL,(object_table_entry_pointer)
8590 LD DE,$01E1
8593 ADD HL,DE
8594 BIT 5,(HL)
8596 JR NZ,BART_L
8598 CALL SUB_DO
859B RET
SUB_DO 859C LD A,(computer_player_flag)
859F OR A
85A0 JR Z,BALSUP
85A2 CALL display_wizard_spell_range
BALSUP 85A5 CALL routine20
85A8 LD HL,(object_table_entry_pointer)
85AB LD DE,$01E1
85AE ADD HL,DE
85AF BIT 4,(HL)
85B1 JR NZ,TOFAIL
85B3 LD HL,(object_table_entry_pointer)
85B6 LD D,(HL)
85B7 LD E,$13
85B9 CALL GETCHR
85BC INC A
85BD LD (STRENG),A
85C0 CALL RANDY
85C3 LD HL,STRENG
85C6 CP (HL)
85C7 JP M,YESSUB
TOFAIL 85CA LD A,$00
85CC LD (spell_success_flag),A
85CF CALL routine11
85D2 RET
YESSUB 85D3 LD HL,(object_table_entry_pointer)
85D6 LD DE,$01E1
85D9 ADD HL,DE
85DA LD A,(HL)
85DB AND $F8
85DD LD E,A
85DE LD A,(current_player)
85E1 ADD A,E
85E2 LD (HL),A
85E3 LD A,$01
85E5 LD (spell_success_flag),A
85E8 CALL routine11
85EB RET
subversion_spell_1 85EC LD HL,(object_table_entry_pointer)
85EF LD DE,$0281
85F2 ADD HL,DE
85F3 LD A,(HL)
85F4 OR A
85F5 RET
Prev: 84C0 Up: Map Next: 85F6