-+-+-+-+-+-+-+-+ START OF PART 26 -+-+-+-+-+-+-+-+ X`09`09`09 hp_player(1000,'cheating'); X`09`09`09 remove_curse; X`09`09`09 cure_me(blind); cure_me(hoarse); cure_me(afraid); X`09`09`09 cure_me(poisoned); cure_me(confused); X`09`09`09 for tstat := sr to ca do X`09`09`09 restore_stat(tstat,''); X`09`09`09 if (slow > 1) then X`09`09`09 slow := 1; X`09`09`09 if (image > 1) then X`09`09`09 image := 1; X`09`09`09 end; 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 if (get_string(tmp_str,1,31,10)) then X`09`09`09 begin 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`09 dun_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`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;`09`09`09`09`7B`5EH = wizhelp `7D X`09`099 : begin`09`09`09`09`09`7B`5EI = identify`7D X`09`09`09 msg_print('Poof! Your items are all identifed!!!'); X`09`09`09 trash_ptr := inventory_list; X`09`09`09 while (trash_ptr <> nil) do X`09`09`09 begin X`09`09`09`09identify(trash_ptr`5E.data); X`09`09`09`09known2(trash_ptr`5E.data.name); X`09`09`09`09trash_ptr := trash_ptr`5E.next; X`09`09`09 end; X`09`09`09end; X`09`0912 : wizard_light;`09`09`09`09`7B`5EL = wizlight`7D X`09`0914 : print_monsters;`09`09`09`09`7B`5EN = mon map `7D X`09`0920 : teleport(100);`09`09`09`09`7B`5ET = teleport`7D X`09`0922 : restore_char('',false,false);`09`09`7B`5EV = restore `7D X`09`09otherwise if (wizard2) then X`09 case com_val of X`09`095 : change_character;`09`09`09`7B`5EE = wizchar `7D X`09`096 : mass_genocide;`09`09`09`09`7B`5EF = genocide`7D X`09`097 : begin`09`09`09`09`09`7B`5EG = treasure`7D X`09`09`09 alloc_object(floor_set,5,25); X`09`09`09 prt_map; X`09`09`09end; X`09`0910 : begin `7B`5EJ = gain exp`7D X`09`09`09 if py.misc.exp = 0 X then X py.misc.exp := 1 X else X py.misc.exp := py.misc.exp * 2; 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 if (cave`5By,x`5D.fval in water_set) then X`09`09`09 summon_water_monster(y,x,true) X`09`09`09 else X`09`09`09 summon_land_monster(y,x,true); X`09`09`09 creatures(false); X`09`09`09end; X`09`0915 : begin`09`09`09`09`09`7B`5EO = summon `7D X`09`09`09 monster_summon_by_name(char_row,char_col,'',false,true); X`09`09`09 creatures(false); X`09`09`09end; X`09`0921 :`09summon_item(char_row,char_col,'','',0,false); X`09`09`09`09`09`09`09`09`7B`5EU = summon `7D X`09`0923 : wizard_create; `7B`5EW = create `7D X`09`0924 :`09edit_score_file;`09`09`09`7B`5EX = ed score`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`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; X XEnd. $ CALL UNPACK DUNGEON.PAS;1 259042938 $ create 'f' X`09`7B Eat some food...`09`09`09`09`09-RAK-`09`7D X`5Bpsect(misc2$code)`5D procedure eat; X var X`09`09i1`09`09`09`09: unsigned; X`09`09i3,i4,i5`09`09`09: integer; X`09`09i2,item_ptr`09`09`09: treas_ptr; X`09`09out_val`09`09`09`09: vtype; X`09`09redraw,ident`09`09`09: boolean; X`09`09tstat`09`09`09`09: stat_set; X`09`09dam_pts`09`09`09`09: integer; X begin X`09reset_flag := true; X`09if (inven_ctr > 0) then X`09 begin X`09 if (find_range(`5Bfood,junk_food`5D,false,i2,i3)) then X`09 begin X`09`09redraw := false; X`09`09if (get_item(item_ptr,'Eat what?',redraw,i3,trash_char,false)) then X`09`09 with item_ptr`5E.data do X`09`09 begin X`09`09 dam_pts := 0; 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 i4 := bit_pos(i1); X`09`7B Foods`09`09`09`09`09`09`09`7D X`09case (i4) of X`09 1 :`09with py.flags do X`09`09 begin X`09`09 poisoned := poisoned + randint(10) + level; X`09`09 ident := true; X`09`09 end; X`09 2 :`09with py.flags do X`09`09 begin X`09`09 blind := blind + randint(250) + 10*level + 100; X`09`09 draw_cave; X`09`09 msg_print('A veil of darkness surrounds you.'); X`09`09 ident := true; X`09`09 end; X`09 3 :`09with py.flags do X`09`09 begin X`09`09 afraid := afraid + randint(10) + level; X`09`09 msg_print('You feel terrified!'); X`09`09 ident := true; X`09`09 end; X`09 4 :`09with py.flags do X`09`09 begin X`09`09 confused := confused + randint(10) + level; X`09`09 msg_print('You feel drugged.'); X`09`09 end; X`09 5 :`09with py.flags do X`09`09 image := image + randint(200) + 25*level + 200; X`09 6 :`09ident := cure_me(py.flags.poisoned); X`09 7 :`09ident := cure_me(py.flags.blind); X`09 8 :`09with py.flags do X`09`09 if (afraid > 1) then X`09`09 begin X`09`09 afraid := 1; X`09`09 ident := true; X`09`09 end; X`09 9 :`09ident := cure_me(py.flags.confused); X `09 10 :`09ident := lose_stat(sr,'X','X'); X`09 11 :`09ident := lose_stat(cn,'X','X'); X`09 12 :`09ident := lose_stat(iq,'X','X'); X`09 13 :`09ident := lose_stat(ws,'X','X'); X`09 14 :`09ident := lose_stat(dx,'X','X'); X`09 15 :`09ident := lose_stat(ca,'X','X'); X`09 16 : ident := restore_stat(sr,'You feel your strength returning.'); X`09 17 : ident := restore_stat(cn,'X'); X`09 18 : ident := restore_stat(iq,'Your head spins for a moment.'); X`09 19 : ident := restore_stat(ws,'X'); X`09 20 : ident := restore_stat(dx,'You feel more agile.'); X`09 21 : ident := restore_stat(ca,'X'); X`09 22 :`09dam_pts := dam_pts + randint(3); X`09 23 :`09dam_pts := dam_pts + randint(6); X`09 24 :`09dam_pts := dam_pts + randint(12); X`09 25 :`09dam_pts := dam_pts + damroll('2d12'); X`09 26 :`09dam_pts := dam_pts + damroll('4d12'); X`09 27 : dam_pts := dam_pts - randint(4); X`09 28 : dam_pts := dam_pts - randint(8); X`09 29 : ident := cure_me(py.flags.hoarse); X`7B fill player to full, then adds food value `7D X`09 30 :`09begin X`09`09 py.flags.food := player_food_full; X`09`09 msg_print('Yum!'); X`09`09end; X`09 31 : begin X`09`09 i5 := bit_pos(flags2); X case (i5) of`20 X`7Bcrunchy`7D 1 : case randint(4) of`20 X 1 : msg_print('*munch* *munch*'); X 2 : msg_print('*crunch* *crunch*'); X`09`09`09 3 : msg_print('*munch* *crunch*'); X`09`09`09 4 : msg_print('*crunch* *munch*'); X`09`09`09otherwise; X `09`09 end; `7Bcase 1`7D X`7Bliquid`7D 2 : begin X`09`09 case randint(3) of X`09`09`09 1 : msg_print('*guzzle* *guzzle*'); X`09`09`09 2 : msg_print('*glug* *glug* *glug*'); X`09`09`09 3 : msg_print('*slurp*'); X`09`09 otherwise; X`09`09`09 end; `7Bcase`7D X `09`09`09 if (randint(3) = 1) then X`09`09 `09 begin X`09`09`09 msg_print('*Burp*'); X`09`09`09 msg_print('(''scuse me....)'); X`09`09`09 end; `7BBelch`7D X end; `7Bcase 2`7D X otherwise; X`09`09 end; `7Bcase`7D X`09 end; `7Bcase 31`7D X`09 otherwise; X`09 if (dam_pts <> 0) then X`09 ident := hp_player(dam_pts,'poisonous food.'); X`09end; X`09`7B End of food actions...`09`09`09`09`7D X`09`09`09end; X`09`09 if (ident) then X`09`09`09identify(item_ptr`5E.data); X`09`09 if (flags <> 0) then X`09`09`09with py.misc do X`09`09`09 if (level > 0) then X`09`09`09 begin X`09`09`09 exp := exp + round(level/lev); X`09`09`09 prt_experience; X`09`09`09 end; X`09`09 add_food(p1); X`09`09 py.flags.status := uand(%X'FFFFFFFC',py.flags.status); X`09`09 prt_hunger; X`09`09 desc_remain(item_ptr); X`09`09 inven_destroy(item_ptr); X`09`09 prt_weight; X`09`09 end X`09`09else X`09`09 if (redraw) then draw_cave; X`09 end X`09 else X`09 msg_print('You are not carrying any food.'); X`09 end X`09else X`09 msg_print('But you are not carrying anything.'); X end; $ CALL UNPACK EAT.INC;1 1467632511 $ create 'f' X`5BInherit('Moria.Env')`5D Module Files; X X`5Bexternal(lib$get_foreign)`5D procedure get_foreign( X`09%descr msg_str`09`09: string; X`09%descr prompt`09`09: string := %immed 0; X`09%ref len`09`09: integer := %immed 0); X`09external; X X`5Bexternal(cli$dcl_parse)`5D function dcl_parse(%descr line : string; X`09`09`09`09`09 %ref table : integer := %immed 0; X`09`09`09`09`09 %immed ooga : integer := %immed 0; X`09`09`09`09`09 %immed oogi : integer := %immed 0; X`09`09`09`09`09 %immed oogu : integer := %immed 0 X`09`09`09`09`09 ) : boolean; external; X X`5Bexternal(cli$present)`5D function present(%descr name : string) : boolean V; X`09external; X X`5Bexternal(cli$get_value)`5D function get_value(%descr name : string; X`09`09`09`09`09 %descr ret_buf : string X`09`09`09`09`09 ) : boolean; X`09external; X X`09`7B Attempt to open the intro file`09`09`09-RAK-`09`7D X`5Bglobal,psect(setup$code)`5D procedure intro(var finam : vtype); X var X`09xpos,i1,loc : integer; X`09dummy : char; X`09day_test,in_line : vtype; X`09file1 : text; X`09file2 : file of key_type; X`09exit_flag : boolean; X`09moriadef`09`09`09: `5Bexternal`5D integer; X`09line`09`09`09`09: string; X`09want_restore`09`09`09: boolean; X`09restore_name`09`09`09: string; X`09want_wizard`09`09`09: boolean; X`09wiz_pass`09`09`09: string; X`09out_val`09`09`09`09: string; X X procedure qualifier_help; X`09begin X`09 writeln('Invalid Moria option! Valid qualifiers are:'); X`09 writev(out_val,' /difficulty=X (Where X is a difficulty from 1 t Vo 5, default of 3)'); X`09 writeln(out_val); X`09 writev(out_val,' /score`5B=max_score`5D (List high scores;', X`09`09`09 ' default is ',max_high_scores:1,')'); X`09 writeln(out_val); X`09 writeln(' /trap=`5Bkeep`5D (Put all incoming messages on ', X`09`09 'the message line)'); X`09 writeln(' /notrap (Default; let messages appear ', X`09`09 'normally)'); X`09 writeln(' /top`5B=max_score`5D (Top scores to display when ', X`09`09 'charcter dies; default is 20)'); X`09 writeln(' /hear (Warn about hearing things in water)'); X`09 check_pswd('doublespeak',true); X`09 if (wizard2) then X`09 begin X`09 writeln(' /wizard`5B=password`5D (Enter wizard mode ', X`09`09 'password; default is -booboo-)'); X`09 writeln(' /restore`5B=filename`5D (Restore character in master fil Ve)'); X`09 writeln(' /undead`5B=filename`5D (Change the dead flag in save fi Vle)'); X`09 end; X`09end; X X begin X`09exit_flag := false; X`09clear(1,1); X`09`7B Attempt to read hours.dat. If it does not exist, `7D X`09`7B then create a standard one. `7D X`09priv_switch(1); X`09open(file1,file_name:=MORIA_HOU, X`09`09history:=readonly,sharing:=readonly,error:=continue); X`09if (status(file1) = 0) then X`09 begin X`09 reset(file1); X`09 repeat X`09 readln(file1,in_line,error:=continue); X`09 if (length(in_line) > 3) then X`09`09begin X`09`09 day_test := substr(in_line,1,4); X`09`09 if (day_test = 'SUN:') then days`5B1`5D := in_line X`09`09 else if (day_test = 'MON:') then days`5B2`5D := in_line X`09`09 else if (day_test = 'TUE:') then days`5B3`5D := in_line X`09`09 else if (day_test = 'WED:') then days`5B4`5D := in_line X`09`09 else if (day_test = 'THU:') then days`5B5`5D := in_line X`09`09 else if (day_test = 'FRI:') then days`5B6`5D := in_line X`09`09 else if (day_test = 'SAT:') then days`5B7`5D := in_line; X`09`09end; X`09 until(eof(file1)); X`09 close(file1,error:=continue); X`09 priv_switch(0); X`09 end X`09else `7B Create a standard hours file `7D X`09 begin X`09 priv_switch(0); X`09 open(file1,file_name:=MORIA_HOU, X`09`09organization:=sequential,history:=new, X`09`09sharing:=readwrite,error:=continue); X`09 if (status(file1) = 0) then X`09 begin X`09`09rewrite(file1,error:=continue); X`09`09writeln(file1,' Moria operating hours are:'); X`09`09writeln(file1,' `7C AM `7C PM `7C'); X`09`09writeln(file1,' 1 111 111'); X`09`09writeln(file1,' 2123456789012123456789012'); X`09`09for i1 := 1 to 7 do X`09`09 writeln(file1,days`5Bi1`5D); X`09`09writeln(file1,' (X=Open; .=Closed)'); X`09`09close(file1,error:=continue); X`09`09writeln('Created ',MORIA_HOU); X`09`09exit_flag := true; X`09 end X`09 else X`09 begin X`09`09writeln('Error in creating ',MORIA_HOU); X`09`09exit; X`09 end; X`09 end; X X`09`7B Check the hours, if closed then require password`09`7D X`09`7B For lack of someplace better to put it, the /SCORE X`09 qualifier goes here...`09`09`09-KRC-`09`7D X`09`7B Hmm, this seems to be becoming a definite trend here: X`09`09here comes the /RESTORE qualifier`09-KRC`09`7D X`09`7B All qualifiers converted to a .cld file, and several X`09 new qualifiers addedd`09`09`09`09-DMF-`09`7D X`09if (not(exit_flag)) then X`09 begin X`09 line := ''; X`09 get_foreign(line); X`09 if not(dcl_parse('moria '+line,moriadef)) then X`09 begin X`09`09qualifier_help; X`09`09exit; +-+-+-+-+-+-+-+- END OF PART 26 +-+-+-+-+-+-+-+-