-+-+-+-+-+-+-+-+ START OF PART 73 -+-+-+-+-+-+-+-+ X`09`09 readv(tmp_str,i1,error:=continue); X`09`09 if (i1 < 0) then good_val := false; X`09`09 until(good_val); X`09`09 if (i1 > py.misc.au) then X`09`09 begin X`09`09 msg_print('You''re already in debt, don''t try to pay with mone Vy you don''t have.'); X`09`09 msg_print(''); X`09`09 end X`09`09 else if (i1 = 0) then X`09`09 begin X `09`09 msg_print('Ok, more interest for me then.'); X`09`09 msg_print(''); X`09`09 end X`09`09 else X`09`09 begin X`09`09 if (i1 > principal) then`20 X`09`09 msg_print('Hey! Thanks for the tip!'); X`09`09 principal := principal - i1; X`09`09 if (principal < 0) then principal := 0; X`09`09 if (principal = 0) then payment_count := 0; X`09`09 py.misc.au := py.misc.au - i1; X`09`09 exit_flag := true; X`09`09 payoff := true; X`09`09 end; X end; `7Bmain begin`7D X X`09 otherwise prt('Invalid Command.',1,1);`09 X`09 end; X`09end X else X begin X exit_flag := true; X`09 exit_bank := true; X`09end; X until(exit_flag); X until(exit_bank); X if (py.misc.au < 0) then py.misc.au := 0; X if (not payoff and (principal > 0)) then payment_count := payment_count+ V1; X msg_print(''); X draw_cave; XEND; X X X`7B Entering the clinic -jeb`7D X`5Bpsect(store$code)`5D procedure enter_clinic; Xvar X oa,ob : integer; X command : char; X exit_flag : boolean; XBEGIN X exit_flag := false; X clear(1,1); X oa := py.flags.diseased * 10 * py.misc.lev; X ob := py.misc.au - randint(100); X if (ob < 10000) then ob := 10000; X prt(' Riot Shield medical clinic. (Dr. Mac ''the knife'' Jones)',3, V1); X prt('Options:',5,6); prt('Cost:',5,66); X prt('a) Cure disease',6,3); prt_num('',oa,6,66); X`7B prt('b) New Body',7,3); prt_num('',ob,7,66);`7D X store_prt_gold; X `20 X repeat X get_com('',command); X case ord(command) of X 97: begin X`09 if (py.misc.au < oa) then X`09 begin X`09 py.flags.diseased := py.flags.diseased X`09 - ((py.misc.au div 10) div py.misc.lev); X`09 py.misc.au := 0; X`09 msg_print('You feel a bit better.'); X`09 pause(24); X `09 end X`09 else X`09 begin X`09 py.flags.diseased := 0; X`09 py.misc.au := py.misc.au - oa; X`09 msg_print('You are Healed! Be more careful next time.'); X`09 pause(24); X`09 end; X`09 if (py.flags.diseased < 0) then py.flags.diseased := 0; X`09 if (py.misc.au < 0) then py.misc.au := 0; X`09 exit_flag := true; X `09end; X otherwise X begin X prt('We don''t do _that_ here',1,1); X exit_flag := true; X end; X end; `7Bcase end`7D X until (exit_flag); X draw_cave; XEND; X X X`7B Newsstand/lotto store --jeb`7D X`5Bpsect(store$code)`5D procedure newsinc; X X BEGIN X moria_help('NEWS'); X draw_cave; X END; X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X $ CALL UNPACK [.INC]STORE2.INC;1 1063855428 $ create 'f' X`7B Throw a magic spell `7D`20 X`5Bpsect(misc2$code)`5D procedure use_tech_skills; X var X i1,i2,item_val,dir : integer; X choice,chance : integer; X dumy,y_dumy,x_dumy : integer; X redraw : boolean; X BEGIN X reset_flag := true; X if (py.flags.blind > 0) then X msg_print('You can''t see to read your tech manual!') X else if (no_light) then X msg_print('You have no light to read by.') X else if (py.flags.confused > 0) then X msg_print('You are too confused...') X else if (py.misc.pskill in `5B1,2,7`5D) then X if (inven_ctr > 0) then X BEGIN X if (find_range(`5B90`5D,i1,i2)) then X BEGIN X redraw := false; X if (get_item(item_val,'Use which tech manual?', X redraw,i1,i2)) then X BEGIN X if (use_skill('Do which skill?',item_val, X choice,chance,redraw)) then X with skill_list`5Bchoice`5D do X BEGIN X reset_flag := false; X if (randint(100) < chance) then X msg_print('You failed to perform the skill!') X else X BEGIN X y_dumy := char_row; X x_dumy := char_col; X`7B Spells. `7D X CASE choice of X 1 : if (get_dir('Which direction?',dir,dumy,y_dumy,x_dumy)) then X fire_bolt(0,dir,char_row,char_col, X damroll('2d6')+1,'Energy Bolt'); X 2 : detect_monsters; X 3 : teleport(10); X 4 : light_area(char_row,char_col); X 5 : hp_player(damroll('4d4'),'a magic spell.'); X 6 : BEGIN X detect_sdoor; X detect_trap; X END; X 7 : if (get_dir('Which direction?',dir,dumy,y_dumy,x_dumy)) then X`09`09 fire_ball(2,dir,char_row,char_col,9,2,false,'Poison Gas'); X 8 : if (get_dir('Which direction?',dir,dumy,y_dumy,x_dumy)) then X confuse_monster(dir,char_row,char_col); X 9 : if (get_dir('Which direction?',dir,dumy,y_dumy,x_dumy)) then X fire_bolt(1,dir,char_row,char_col, X damroll('3d8')+1,'Electric Shock'); X 10 : td_destroy; X 11 : if (get_dir('Which direction?',dir,dumy,y_dumy,x_dumy)) then X sleep_monster(dir,char_row,char_col); X 12 : cure_poison; X 13 : teleport(py.misc.lev*5); X 14 : remove_curse; X 15 : if (get_dir('Which direction?',dir,dumy,y_dumy,x_dumy)) then X fire_bolt(4,dir,char_row,char_col, X Damroll('4d8')+1,'Killer Snowball'); X 16 : if (get_dir('Which direction?',dir,dumy,y_dumy,x_dumy)) then X wall_to_mud(dir,char_row,char_col); X 17 : ident_spell; X 18 : recharge(20); X 19 : sleep_monsters2_3(char_row,char_col,1); X 20 : if (get_dir('Which direction?',dir,dumy,y_dumy,x_dumy)) then X poly_monster(dir,char_row,char_col); X 21 : create_food; X 22 : sleep_monsters2_3(char_row,char_col,20); X 23 : if (get_dir('Which direction?',dir,dumy,y_dumy,x_dumy)) then X fire_bolt(5,dir,char_row,char_col, X damroll('6d8')+1,'Flame-Thrower'); X 24 : if (get_dir('Which direction?',dir,dumy,y_dumy,x_dumy)) then X speed_monster(dir,char_row,char_col,-1); X`09 25 : py.flags.ring_blast := 10; `7BRing of Frost`7D X 26 : if (get_dir('Which direction?',dir,dumy,y_dumy,x_dumy)) then X fire_ball(4,dir,char_row,char_col, X`09 `09`09`09damroll('6d6')+1,2,false,'Frost Ball'); X 27 : recharge(50); X 28 : if (get_dir('Which direction?',dir,dumy,y_dumy,x_dumy)) then X teleport_monster(dir,char_row,char_col); X 29 : with py.flags do X fast := fast + randint(20) + py.misc.lev; X`09 30 : py.flags.ring_blast := 9; `7BRing of Fire`7D X 31 : if (get_dir('Which direction?',dir,dumy,y_dumy,x_dumy)) then X fire_ball(5,dir,char_row,char_col, X`09 `09`09`09damroll('7d7')+1,2,false,'Fire Ball'); X 32 : destroy_area(char_row,char_col); X 33 : genocide; X otherwise ; X END; X `7B END of spells.`7D X if (not(reset_flag)) then X with py.misc do X BEGIN X exp := exp + sexp; X prt_experience; X sexp := 0; X END X END; X with py.misc do X if (not(reset_flag)) then X BEGIN X if (smana > cmana) then X BEGIN X msg_print('You faint from the effort!' V); X py.flags.paralysis := X randint(5*trunc(smana-cmana)); X cmana := 0; X if (randint(3) = 1) then X BEGIN X msg_print('You have damaged your health!') V; X py.stat.ccon := de_statp(py.stat.ccon); X prt_constitution; X END; X END X else X cmana := cmana - smana; X prt_mana; X END; X`09`09`09 if (randint(10)=1) then`20 X`09`09`09 reset_flag := true; X END X END X else X if (redraw) then draw_cave; X END X else X msg_print('But you are not carrying any tech manuals!'); X END X else X msg_print('But you are not carrying any tech manuals!') X else X msg_print('Invalid Command.'); X END; X `20 $ CALL UNPACK [.INC]TECH.INC;1 22107844 $ create 'f' X`5Bpsect(moria$code)`5D procedure termdef; X type X term_type = packed array `5B1..3`5D of char; X dvi_type = record X item_len, X item_code : wordint; X buff_add, X len_add : `5Einteger; X end_item : integer X end; X var X dvi_buff : dvi_type; X i1 : integer; X tmp_str : varying`5B10`5D of char; X tmp, X escape : char; X`20 X `5Bexternal(SYS$GETDVI)`5D function get_dvi ( X efn, X chan : integer := %immed 0; X %stdescr terminal : term_type; X %ref itmlst : dvi_type; X isob, X astadr, X astprm, X undefined : integer := %immed 0 X ) : integer; X external; X`20 X begin X escape := chr(27); X with dvi_buff do X begin X item_len := 4; X item_code := 6; X new(buff_add); X new(len_add); X end_item := 0 X end; X get_dvi(terminal:='TT:',itmlst:=dvi_buff); X `7B Add new terminals in this case statement. The case number is `7 VD X `7B returned by SYS$GETVI. Terminals are either row then col, or `7 VD X `7B col then row. `7 VD X `7B ROW_FIRST should be true if the row is given first. `7 VD X `7B CURSOR_ERL is the sequence for erase-to-end-of-line. `7 VD X `7B CURSOR_ERP is the sequence for erase-to-end-of-page. `7 VD X `7B CURLEN_R is the length of the ROW portion of cursor address `7 VD X `7B CURLEN_C is the length of the COL portion of cursor address `7 VD X `7B CURLEN_L is CURLEN_R + CURLEN_C `7 VD X `7B CURSOR_R is the ROW cursor portion characters `7 VD X `7B CURSOR_C is the COL cursor portion characters `7 VD X case dvi_buff.buff_add`5E of X 17 : `7B ADM-3A (/FT2) `7D X begin X row_first := true; `7B Sequence is row,col `7D X cursor_erl := chr(24); X cursor_erp := chr(23); X curlen_r := 3; X curlen_c := 1; X cursor_l := 4; X for i1 := 1 to 24 do X begin X tmp := chr(i1+31); `7B Row char V`7D X cursor_r`5Bi1`5D := escape + '=' + tmp `7B Row V part`7D X end; X for i1 := 1 to 80 do X begin X tmp := chr(i1+31); `7B Col char V`7D X cursor_c`5Bi1`5D := tmp `7B Col V part`7D X end X end; X 18 : `7B ADDS100 (/FT3) `7D X begin X row_first := true; `7B Sequence is row,col `7D X cursor_erl := escape + 'K'; X cursor_erp := escape + 'k'; X curlen_r := 3; X curlen_c := 1; X cursor_l := 4; X for i1 := 1 to 24 do X begin X tmp := chr(i1+31); `7B Row char V`7D X cursor_r`5Bi1`5D := escape + 'Y' + tmp `7B Row V part`7D X end; X for i1 := 1 to 80 do X begin X tmp := chr(i1+31); `7B Col char V`7D X cursor_c`5Bi1`5D := tmp `7B Col V part`7D X end X end; X 19 : `7B IBM3101 (/FT4) `7D X begin X row_first := true; `7B Sequence is row,col `7D X cursor_erl := escape + 'I'; +-+-+-+-+-+-+-+- END OF PART 73 +-+-+-+-+-+-+-+-