Prev: 9385 Up: Map Next: 95B8
94A7: Display information about the selected spell.
Used by the routine at select_spell.
display_spell_info 94A7 CALL CHAN_C Calculate the casting chance of the current spell.
94AA LD A,(CURSP) If CURSP is $01 (Disbelieve) or greater than or equal to $22 jump to not_creature.
94AD CP $01
94AF JR Z,not_creature
94B1 CP $22
94B3 JP P,not_creature
94B6 LD HL,$E0BE Write current spell number to last entry in map_object_table and set object_table_entry_pointer. This position is off the right of the play area.
94B9 LD (HL),A
94BA LD (object_table_entry_pointer),HL
94BD LD DE,$0281 Set corresponding entry in fifth_map_table to zero ???
94C0 ADD HL,DE
94C1 LD (HL),$00
94C3 LD HL,object_info_flags Set bit 0 of object_info_flags to signal that display_object_info should display casting chance. Also sets bit 1 but this will get changed again.
94C6 LD (HL),$03
94C8 LD A,(casting_chance) Copy casting_chance to temp_casting_chance.
94CB LD (temp_casting_chance),A
94CE CALL display_object_info Display information about the object.
94D1 LD HL,object_info_flags Clear object_info_flags.
94D4 LD (HL),$00
94D6 LD HL,(object_table_entry_pointer) Set temporary object table entry back to $00.
94D9 LD (HL),$00
94DB LD HL,map_object_table Set object_table_entry_pointer to first entry in map_object_table and return.
94DE LD (object_table_entry_pointer),HL
94E1 RET
not_creature 94E2 CALL CLS Clear the screen and play sound_effect_23.
94E5 LD HL,sound_effect_23
94E8 CALL play_sound_effect_in_HL
94EB LD A,$69 Set ATTR-T to $69 (bright blue on cyan) and draw border.
94ED LD ($5C8F),A
94F0 CALL ZRDR_P
94F3 LD A,$46 Set ATTR-T to $46 (bright yellow on black) and print name of spell at coordinates (8,5).
94F5 LD ($5C8F),A
94F8 LD HL,(current_spell_pointer)
94FB LD A,(HL)
94FC LD BC,$0508
94FF CALL MPRINT
9502 LD A,(spell_chaos_law) If spell is neutral jump to done_ch_law.
9505 OR A
9506 JR Z,done_ch_law
9508 JP P,lawful_spell If spell is lawful jump to lawful_spell.
950B LD A,$43 Set ATTR-T to $43 (bright magenta on black) and print chaos_string at coordinates (8,7).
950D LD ($5C8F),A
9510 LD A,$46
9512 LD BC,$0708
9515 CALL MPRINT
9518 LD A,(spell_chaos_law) Convert spell_chaos_law to positive value and print as a digit.
951B NEG
951D ADD A,$30
951F CALL DH_P
9522 LD A,$29 Print ')' character and jump to done_ch_law.
9524 CALL DH_P
9527 JR done_ch_law
lawful_spell 9529 LD A,$45 Set ATTR-T to $45 (bright cyan on black) and print law_string at coordinates (8,7).
952B LD ($5C8F),A
952E LD A,$47
9530 LD BC,$0708
9533 CALL MPRINT
9536 LD A,(spell_chaos_law) Print spell_chaos_law as a digit, followed by a ')' character.
9539 ADD A,$30
953B CALL DH_P
953E LD A,$29
9540 CALL DH_P
done_ch_law 9543 LD A,$44 Set ATTR-T to $44 (bright green on black) and print casting_chance_string at coordinates (8,11).
9545 LD ($5C8F),A
9548 LD A,$4F
954A LD BC,$0B08
954D CALL MPRINT
9550 LD A,$46 Set ATTR-T to $46 (bright yellow on black).
9552 LD ($5C8F),A
9555 LD A,(casting_chance) If casting_chance equals 9 (100% chance) print ten_string.
9558 INC A
9559 CP $0A
955B JR NZ,not_certain
955D LD A,$50
955F CALL MPRINT
9562 JR percentage
not_certain 9564 ADD A,$30 Else print casting_chance as a digit.
9566 CALL DH_P
percentage 9569 LD A,$30 Print "0%".
956B CALL DH_P
956E LD A,$25
9570 CALL DH_P
9573 LD A,$44 Set ATTR-T to $44 (bright green on black) and print range_string at coordinates (8,15).
9575 LD ($5C8F),A
9578 LD A,$4A
957A LD BC,$0F08
957D CALL MPRINT
9580 LD A,$46 Set ATTR-T to $46 (bright yellow on black).
9582 LD ($5C8F),A
9585 LD IX,(current_spell_pointer) Load the range attribute of the current spell into A and divide by 2.
9589 LD A,(IX+$02)
958C SRL A
958E CP $0A If less than 10 print value as a digit and jump to done_range.
9590 JP P,max_range
9593 ADD A,$30
9595 CALL DH_P
9598 JR done_range
max_range 959A LD A,$32 Else print "20". This is for spells which can be cast anywhere on the game board.
959C CALL DH_P
959F LD A,$30
95A1 CALL DH_P
done_range 95A4 LD A,$4D Set ATTR-T to $4D (bright cyan on blue) and print press_any_key_string at coordinates (0,22).
95A6 LD ($5C8F),A
95A9 LD A,$3D
95AB LD BC,$1600
95AE CALL MPRINT
95B1 CALL wait_no_key_seed Wait for a keypress and return.
95B4 CALL wait_key_seed
95B7 RET
Prev: 9385 Up: Map Next: 95B8