-+-+-+-+-+-+-+-+ START OF PART 45 -+-+-+-+-+-+-+-+ X`09if ((py.flags.paralysis < 1) and `7B Accept a command? `7D X`09 (py.flags.rest < 1) and X`09 (not(death))) then X`09`7B Accept a command and execute it `7D X`09 repeat X`09 print_stat := 0; X`09 reset_flag := false; X`09`09`7B Random teleportation `7D X`09 if (py.flags.teleport) then X`09 if (randint(100) = 1) then X`09`09begin X`09`09 find_flag := false; X`09`09 teleport(40); X`09`09end; X`09 if (not (find_flag)) then X`09 begin X`09`09print('',char_row,char_col); X`09`09save_msg_flag := msg_flag; X`09`09inkey(command); X`09`09if (save_msg_flag) then erase_line(msg_line,msg_line); X`09`09com_val := ord(command); X`09 end; X`09`7B Commands are executed in following case statement `7D X`09 case com_val of X X`09`090,3,25 :begin`09`09`09`09`09`7B`5EY = exit `7D X`09`09`09 flush; X`09`09`09 if (get_com('Enter ''Q'' to quit',command)) then X`09`09`09 case command of X`09`09`09 'q','Q': begin X`09`09`09`09`09 if (total_winner) then X`09`09`09`09`09 begin X`09`09`09`09`09 moria_flag := true; X`09`09`09`09`09 death := true; X`09`09`09`09`09 end X`09`09`09`09`09 else X`09`09`09`09`09 begin X`09`09`09`09`09 clear(1,1); X`09`09`09`09`09 exit; X`09`09`09`09`09 end; X`09`09`09`09`09end; X`09`09`09 otherwise ; X`09`09`09 end; X`09`09`09 reset_flag := true; X`09`09`09end; X`09`0913 : begin `7B`5EM = repeat `7D X`09`09`09 msg_print(old_msg); X`09`09`09 reset_flag := true; X`09`09`09end; X`09`0916 : if (wizard1) then `7B`5EP = password`7D X`09`09`09 begin X`09`09`09 msg_print('Wizard mode off.'); X`09`09`09 wizard1 := false; X`09`09`09 wizard2 := false; X`09`09`09 reset_flag := true; X`09`09`09 no_controly; X`09`09`09 end X`09`09`09else X`09`09`09 begin X`09`09`09 if (check_pswd) then X`09`09`09 begin X`09`09`09`09msg_print('Wizard mode on.'); X`09`09`09`09controly; X`09`09`09 end; X`09`09`09 reset_flag := true; X`09`09`09 end; X`09`0918 : begin `7B`5ER = redraw `7D X`09`09`09 draw_cave; X`09`09`09 reset_flag := true; X`09`09`09end; X`09`0926 : begin `7B`5EZ = save `7D X`09`09`09 if (total_winner) then X`09`09`09 begin X`09msg_print('You are a Total Winner, your character must be retired...'); X`09msg_print('Use -Y to when you are ready to quit.'); X`09`09`09 end X`09`09`09 else X`09`09`09 begin X`09`09`09 if (search_flag) then search_off; X`09`09`09 save_char; X`09`09`09 end; X`09`09`09end; X`09`0936 : begin `7B$ = Shell `7D X`09`09`09 clear(1,1); X`09writeln('`5BEntering DCL shell, type "EOJ" to resume your game`5D'); X`09`09`09 writeln; X`09`09`09 controly; X`09`09`09 shell_out; X`09`09`09 no_controly; X`09`09`09 clear(1,1); X`09`09`09 draw_cave; X`09`09`09 reset_flag := true; X`09`09`09end; X`09`0946 : begin `7B. = find `7D X`09`09`09 y := char_row; X`09`09`09 x := char_col; X`09`09`09 if (get_dir('Which direction?',dir_val, X`09`09`09`09`09`09`09com_val,y,x)) then X`09`09`09 begin X`09`09`09 find_flag := true; X`09`09`09 move_char(dir_val); X`09`09`09 end X`09`09`09end; X`09`0947 : begin `7B/ = identify `7D X`09`09`09 ident_char; X`09`09`09 reset_flag := true; X`09`09`09end; X`09`0949 : move_char(com_val - 48); `7B Move dir 1 `7D X`09`0950 : move_char(com_val - 48); `7B Move dir 2 `7D X`09`0951 : move_char(com_val - 48); `7B Move dir 3 `7D X`09`0952 : move_char(com_val - 48); `7B Move dir 4 `7D X`09`0953 : begin `7B Rest one turn `7D X`09`09`09 move_char(com_val - 48); X`09`09`09 sleep(0); `7B Sleep 1/10 a second`7D X`09`09`09 flush; X`09`09`09end; X`09`0954 : move_char(com_val - 48); `7B Move dir 6 `7D X`09`0955 : move_char(com_val - 48); `7B Move dir 7 `7D X`09`0956 : move_char(com_val - 48); `7B Move dir 8 `7D X`09`0957 : move_char(com_val - 48); `7B Move dir 9 `7D X`09`0960 : go_up; `7B< = go up `7D X`09`0962 : go_down; `7B> = go down `7D X`09`0963 : begin `7B? = help `7D X`09`09`09 help; X`09`09`09 reset_flag := true; `7B Free move `7D X`09`09`09end; X`09`7B 65 : begin `7B Debug feature for weight X`09`09`09 tmp1 := 0; X`09`09`09 for i1 := 1 to inven_max-1 do X`09`09`09 with inventory`5Bi1`5D do X`09`09`09 tmp1 := tmp1 + weight*number; X`09`09`09 writev(out_val,inven_weight:1,' `7C ',tmp1:1); X`09`09`09 msg_print(out_val); X`09`09`09end; `7D X`09`0966 : bash; `7BB = bash `7D X`09`0967 : begin `7BC = character`7D X`09`09`09 if (get_com('Print to file? (Y/N)',command)) then X`09`09`09 case command of X`09`09`09 'y','Y': file_character; X`09`09`09 'n','N': begin X`09`09`09`09`09 change_name; X`09`09`09`09`09 draw_cave; X`09`09`09`09`09end; X`09`09`09 otherwise ; X`09`09`09 end; X`09`09`09 reset_flag := true; `7B Free move `7D X`09`09`09end; X`09`0968 : disarm_trap; `7BD = disarm `7D X`09`0969 : eat; `7BE = eat `7D X`09`0970 : refill_lamp; `7BF = refill `7D X`09`0976 : begin `7BL = location `7D X`09`09`09 reset_flag := true; `7B Free move `7D X`09`09`09 if ((py.flags.blind > 0) or (no_light)) then X`09`09`09 msg_print('You can''t see your map.') X`09`09`09 else X`09`09`09 begin X`09`09`09 writev(out_val, X`09`09`09 'Section `5B', X`09`09`09 (trunc((char_row-1)/outpage_height)+1):1,',', X`09`09`09 (trunc((char_col-1)/outpage_width )+1):1, X`09`09`09 '`5D; Location = `5B',char_row:1,',',char_col:1,'`5D'); X`09`09`09 msg_print(out_val); X`09`09`09 end; X`09`09`09end; X`09`0980: begin `7BP = print map`7D X`09`09`09 reset_flag := true; `7B Free move `7D X`09`09`09 if ((py.flags.blind > 0) or (no_light)) then X`09`09`09 msg_print('You can''t see to draw a map.') X`09`09`09 else X`09`09`09 print_map; X`09`09`09end; X`09`0982 : rest; `7BR = rest `7D X`09`0983 : if (search_flag) then `7BS = srh mode `7D X`09`09`09 begin X`09`09`09 search_off; X`09`09`09 reset_flag := true; `7B Free move `7D X`09`09`09 end X`09`09`09else if (py.flags.blind > 0) then X`09`09 msg_print('You are incapable of searching while blind.') X`09`09`09else X`09`09`09 begin X`09`09`09 search_on; X`09`09`09 reset_flag := true; `7B Free move `7D X`09`09`09 end; X`09`0984 : tunnel; `7BT = tunnel `7D X`09`0997 : aim; `7Ba = aim `7D X`09`0998 : examine_book; `7Bb = browse `7D X`09`0999 : closeobject; `7Bc = close `7D X`09`09100: drop; `7Bd = drop `7D X`09`09101: begin `7Be = equipment`7D X`09`09`09 reset_flag := true; `7B Free move `7D X`09`09`09 if (inven_command('e',0,0)) then draw_cave; X`09`09`09end; X`09`09102: throw_object; `7Bf = throw `7D X`09`09104: begin `7Bh = moria hlp`7D X`09`09`09 moria_help(''); X`09`09`09 draw_cave; X`09`09`09 reset_flag := true; `7B Free move `7D X`09`09`09end; X`09`09105: begin `7Bi = inventory`7D X`09`09`09 reset_flag := true; `7B Free move `7D X`09`09`09 if (inven_command('i',0,0)) then draw_cave; X`09`09`09end; X`09`09106: jamdoor; `7Bj = jam `7D X`09`09108: begin `7Bl = look `7D X`09`09`09 look; X`09`09`09 reset_flag := true; `7B Free move `7D X`09`09`09end; X`09`09109: cast; `7Bm = magick `7D X`09`09111: openobject; `7Bo = open `7D X`09`09112: pray; `7Bp = pray `7D X`09`09113: quaff; `7Bq = quaff `7D X`09`09114: read; `7Br = read `7D X`09`09115: if (py.flags.blind > 0) then `7Bs = search `7D X`09`09 msg_print('You are incapable of searching while blind.') X`09`09`09else X`09`09`09 search(char_row,char_col,py.misc.srh); X`09`09116: begin `7Bt = unwear `7D X`09`09`09 reset_flag := true; X`09`09`09 if (inven_command('t',0,0)) then draw_cave; X`09`09`09end; X`09`09117: use; `7Bu = use staff`7D X`09`09118: game_version; `7Bv = version `7D X`09`09119: begin `7Bw = wear `7D X`09`09`09 reset_flag := true; X`09`09`09 if (inven_command('w',0,0)) then draw_cave; X`09`09`09end; X`09`09120: begin `7Bx = exchange `7D X`09`09`09 reset_flag := true; X`09`09`09 if (inven_command('x',0,0)) then draw_cave; X`09`09`09end; X`09`09otherwise if (wizard1) then X`09`09 begin X`09`09 reset_flag := true; `7B Wizard commands are free moves`7D X`09 case com_val of X`09`091 : begin `7B`5EA = Cure all`7D X`09`09`09 remove_curse; X`09`09`09 cure_blindness; X`09`09`09 cure_confusion; X`09`09`09 cure_poison; X`09`09`09 remove_fear; X`09`09`09 with py.stat do X`09`09`09 begin X`09`09`09 cstr := str; X`09`09`09 cint := int; X`09`09`09 cwis := wis; X`09`09`09 cdex := dex; X`09`09`09 ccon := con; X`09`09`09 cchr := chr; X`09`09`09 end; X`09`09`09 with py.flags do X`09`09`09 begin X`09`09`09 if (slow > 1) then X`09`09`09`09slow := 1; X`09`09`09 if (image > 1) then X`09`09`09`09image := 1; X`09`09`09 end; X`09`09`09end; X`09`092 : print_objects; `7B`5EB = objects `7D X`09`094 : begin `7B`5ED = up/down `7D X`09`09`09 prt('Go to which level (0 -1200) ? ',1,1); X`09`09`09 get_string(tmp_str,1,31,10); X`09`09`09 i1 := -1; X`09`09`09 readv(tmp_str,i1,error:=continue); X`09`09`09 if (i1 > -1) then X`09`09`09 begin X`09`09`09 dun_level := i1; X`09`09`09 if (dun_level > 1200) then X`09`09`09`09dun_level := 1200; X`09`09`09 moria_flag := true; X`09`09`09 end X`09`09`09 else X`09`09`09 erase_line(msg_line,msg_line); X`09`09`09end; X`09`098 : wizard_help; `7B`5EH = wizhelp `7D X`09`099 : ident_spell; `7B`5EI = identify`7D X`09`0914 : print_monsters; `7B`5EN = mon map `7D X`09`0912 : wizard_light; `7B`5EL = wizlight`7D X`09`0920 : teleport(100); `7B`5ET = teleport`7D X`09`0922 : restore_char; `7B`5EV = restore `7D X`09`09otherwise if (wizard2) then X`09 case com_val of X`09`095 : change_character; `7B`5EE = wizchar `7D X`09`096 : mass_genocide; `7B`5EF = genocide`7D X`09`097 : alloc_object(floor_set,5,10); `7B`5EG = treasure`7D X`09`0910 : begin `7B`5EJ = gain exp`7D X`09`09`09 py.misc.exp := 2*py.misc.exp; X`09`09`09 prt_experience; X`09`09`09end; X`09`0911 : begin `7B`5EK = summon `7D X`09`09`09 y := char_row; X`09`09`09 x := char_col; X`09`09`09 summon_monster(y,x,true); X`09`09`09 creatures(false); X`09`09`09end; X`09`0923 : wizard_create; `7B`5EW = create `7D X`09`09otherwise prt('Type ''?'' for help...',1,1); X`09 end X`09`09else X`09`09 prt('Type ''?'' for help...',1,1); X`09 end; X`09`09 end X`09`09`09 else X`09`09`09`09begin X`09`09`09`09 prt('Type ''?'' for help...',1,1); X`09`09`09`09 reset_flag := true; X`09`09`09`09end; X X X X`09 end; X`09`7B End of commands `7D X`09 until (not(reset_flag) or (moria_flag)); X`09`7B Teleport? `7D X`09if (teleport_flag) then teleport(100); X`09`7B Move the creatures `7D X`09if (not moria_flag) then creatures(true); X`09`7B Exit when moria_flag is set `7D X until (moria_flag); X if (search_flag) then search_off; `7B Fixed "SLOW" bug; 06-11-86 RAK V `7D X end; $ CALL UNPACK [.SOURCE.INCLUDE]MORIA.INC;1 943038745 $ create 'f' X`09`7B Potions for the quaffing`09`09`09`09-RAK-`09`7D X`5Bpsect(misc2$code)`5D procedure quaff; X var X`09`09i1`09`09`09`09: unsigned; X`09`09i2,i3,i4,i5,item_val`09`09: integer; X`09`09out_val`09`09`09`09: vtype; X`09`09redraw,ident`09`09`09: boolean; X begin X`09reset_flag := true; X`09if (inven_ctr > 0) then X`09 begin X`09 if (find_range(`5B75,76`5D,i2,i3)) then X`09 begin X`09`09redraw := false; X`09`09if (get_item(item_val,'Quaff which potion?',redraw,i2,i3)) then X`09`09 with inventory`5Bitem_val`5D do X`09`09 begin X`09`09 if (redraw) then draw_cave; X`09`09 reset_flag := false; X`09`09 i1 := flags; X`09`09 ident := false; X`09`09 while (i1 > 0) do X`09`09`09begin X`09`09`09 i2 := bit_pos(i1); X`09`09`09 if (tval = 76) then i2 := i2 + 31; X`09`7B Potions`09`09`09`09`09`09`7D X`09case (i2) of X`09 1 :`09with py.stat do X`09`09 begin X`09`09 cstr := in_statp(cstr); X`09`09 if (cstr > str) then X`09`09 str := cstr; X`09`09 msg_print('Wow! What bulging muscles!'); X`09`09 prt_strength; X`09`09 ident := true; X`09`09 end; X`09 2 :`09ident := lose_str; X`09 3 :`09with py.stat do X`09`09 begin X`09`09 cstr := str; X`09`09 msg_print('You feel warm all over.'); X`09`09 prt_strength; X`09`09 ident := true; X`09`09 end; X`09 4 :`09with py.stat do +-+-+-+-+-+-+-+- END OF PART 45 +-+-+-+-+-+-+-+-