-+-+-+-+-+-+-+-+ START OF PART 34 -+-+-+-+-+-+-+-+
X`09`09 'R' : prt('R - Reptile.',1,1);
X`09`09 'S' : prt('S - Giant Scorpion/Sandgorgon.',1,1);
X`09`09 'T' : prt('T - Troll.',1,1);
X`09`09 'U' : prt('U - Umber Hulk.',1,1);
X`09`09 'V' : prt('V - Vampire.',1,1);
X`09`09 'W' : prt('W - Wight or Wraith.',1,1);
X`09`09 'X' : prt('X - Xorn.',1,1);
X`09`09 'Y' : prt('Y - Yeti.',1,1);
X`09`09 'Z' : prt('Z - Nazgul',1,1);
X`09`09 '`5B' : prt('`5B - Hard armor.',1,1);
X`09`09 '\' : prt('\ - A hafted weapon.',1,1);
X`09`09 '`5D' : prt('`5D - Misc. armor.',1,1);
X`09`09 '`5E' : prt('`5E - A trap.',1,1);
X`09`09 '_' : prt('_ - A staff.',1,1);
X`09`09 '`60' : prt('`60 - Water.',1,1);
X`09`09 'a' : prt('a - Amphibian.',1,1);
X`09`09 'b' : prt('b - Giant Bat.',1,1);
X`09`09 'c' : prt('c - Insect.',1,1);
X`09`09 'd' : prt('d - Dragon.',1,1);
X`09`09 'e' : prt('e - Floating Eye.',1,1);
X`09`09 'f' : prt('f - Fish.',1,1);
X`09`09 'g' : prt('g - Golem.',1,1);
X`09`09 'h' : prt('h - Harpy.',1,1);
X`09`09 'i' : prt('i - Icky Thing.',1,1);
X`09`09 'j' : prt('j - Canine.',1,1);
X`09`09 'k' : prt('k - Kobold.',1,1);
X`09`09 'l' : prt('l - Giant Lice.',1,1);
X`09`09 'm' : prt('m - Mold.',1,1);
X`09`09 'n' : prt('n - Naga.',1,1);
X`09`09 'o' : prt('o - Orc or Ogre.',1,1);
X`09`09 'p' : prt('p - Person (Humanoid).',1,1);
X`09`09 'q' : prt('q - Quasit.',1,1);
X`09`09 'r' : prt('r - Rodent.',1,1);
X`09`09 's' : prt('s - Skeleton.',1,1);
X`09`09 't' : prt('t - Giant tick.',1,1);
X`09`09 'v' : prt('v - Swirling Vapor.',1,1);
X`09`09 'w' : prt('w - Worm(s).',1,1);
X`09`09 'x' : prt('x - Spider.',1,1);
X`09`09 'y' : prt('y - Yeek.',1,1);
X`09`09 'z' : prt('z - Zombie.',1,1);
X`09`09 '`7B' : prt('`7B - Arrow, bolt, or bullet.',1,1);
X`09`09 '`7C' : prt('`7C - A sword or dagger.',1,1);
X`09`09 '`7D' : prt('`7D - Bow, crossbow, or sling.',1,1);
X`09`09 '`7E' : prt('`7E - Miscellaneous item.',1,1);
X`09`09 otherwise prt('Not Used.',1,1);
X`09`09 end;
X`09end
X end;
X
X
X`09`7B Help for available commands`09`09`09`09`09`7D
X`5Bglobal,psect(misc2$code)`5D procedure help;
X label
X`09bye,bye2,page2;
X var
X`09command`09: char;
X begin
X inkey_delay(command,0);
X if (command <> null) then goto bye2;
X clear(1,1);
Xprt('A Age of character. `7C h Hurl an item.',1,1);
Xprt('B
Bash (object/creature)`7C i Inventory list.',2,1);
Xprt('C Display character. `7C j Jam a door with spike.',3,1)
V;
Xinkey_delay(command,0); if (command <> null) then goto page2;
Xprt('D Disarm a trap/chest. `7C l Look given direction.',4,1);
Xprt('E Eat some food. `7C m Cast a magic spell.',5,1);
Xprt('F Fill lamp with oil. `7C m Use a music book.',6,1);
Xinkey_delay(command,0); if (command <> null) then goto page2;
Xprt('G Game time and date `7C o Open a door/chest.',7,1);
Xprt('H Help `7C p Read a prayer.',8,1);
Xprt('I Inven of one item type`7C p Play an instrument.',9,1);
Xinkey_delay(command,0); if (command <> null) then goto page2;
Xprt('L Current location. `7C q Quaff a potion.',10,1);
Xprt('M Money. `7C r Read a scroll.',11,1);
Xprt('P Print map. `7C s Search for hidden doors.',12
V,1);
Xinkey_delay(command,0); if (command <> null) then goto page2;
Xprt('R Rest for a period. `7C t Take off an item.',13,1);
Xprt('S Search Mode. `7C u Use a staff.',14,1);
Xprt('T Tunnel. `7C v Version and credits.',15,1);
Xinkey_delay(command,0); if (command <> null) then goto page2;
Xprt('U Use miscellaneous item`7C w Wear/Wield an item.',16,1);
Xprt('W Current time and date `7C x Exchange weapon.',17,1);
Xprt('a Aim and fire a wand. `7C c Clean inventory.',18,1);
Xinkey_delay(command,0); if (command <> null) then goto page2;
Xprt('b Browse a book. `7C $ Shell out of game.',19,1);
Xprt('c Close a door. `7C + Experience for levels.',20,1
V);
Xprt('d Drop an item. `7C . Move in direction.',21,1);
Xinkey_delay(command,0); if (command <> null) then goto page2;
Xprt('e Equipment list. `7C / Identify a character.',22,1)
V;
Xprt('f Fire Projectile. `7C',23,1);
X
X pause(24);
Xpage2: clear(1,1);
Xinkey_delay(command,0); if (command <> null) then goto bye;
Xprt('< Go up an up-staircase.`7C > Go down a down-staircase.',1
V,1);
Xprt('? Display this panel. `7C `5EM Repeat the last message.',
V2,1);
Xprt('`5D Armor list. `7C `5ER Redraw the screen.',3,1)
V;
Xinkey_delay(command,0); if (command <> null) then goto bye;
Xprt('`7C Weapon list. `7C `5EY Quit the game.',4,1);
Xprt(' `5EZ Save character and quit.',5,
V1);
Xprt('Movement:',7,1);
Xinkey_delay(command,0); if (command <> null) then goto bye;
Xprt(' 7 8 9',8,1);
Xprt(' 4 6 5 = Rest',9,1);
Xprt(' 1 2 3',10,1);
Xinkey_delay(command,0); if (command <> null) then goto bye;
Xprt('Directory of Shops:',12,1);
Xprt(' A Alchemy Shop M Magic Shop',13,1);
Xprt(' B Bank P Trading Post',14,1);
Xinkey_delay(command,0); if (command <> null) then goto bye;
Xprt(' C Casino Q Questor''s Home',15,1);
Xprt(' D All-Nite Deli R Armory',16,1);
Xprt(' G General Store T Temple',17,1);
Xinkey_delay(command,0); if (command <> null) then goto bye;
Xprt(' I Inn U Music Shop',18,1);
Xprt(' J Gem Shop W Weapon Smith',19,1);
Xprt(' L Library X Money Exchange',20,1);
Xprt(' + Unknown',21,1);
X pause(24);
Xbye: draw_cave;
Xbye2:
X end;
X
X
X
X`09`7B Help for available wizard commands`09`09`09`09`7D
X`5Bglobal,psect(wizard$code)`5D procedure wizard_help;
X begin
X clear(1,1);
X prt('`5EA - Remove Curse and Cure all maladies.',1,1);
X prt('`5EB - Print random objects sample.',2,1);
X prt('`5ED - Down/Up n levels.',3,1);
X prt('`5EE - *Change character.',4,1);
X prt('`5EF - *Delete monsters.',5,1);`20
X prt('`5EG - *Allocate treasures.',6,1);
X prt('`5EH - Wizard Help.',7,1);
X prt('`5EI - Identify.',8,1);
X prt('`5EJ - *Gain experience.',9,1);
X prt('`5EK - *Summon monster.',10,1);
X prt('`5EL - Wizard light.',11,1);
X prt('`5EN - Print monster dictionary.',12,1);
X prt('`5EO - *Summon monster by its name.',13,1);
X prt('`5EP - Wizard password on/off.',14,1);
X prt(' s - *Statistics on item (in inventory screen).',15,1);
X prt('`5ET - Teleport player.',16,1);
X prt('`5EU - *Roll up an item.',17,1);
X prt('`5EV - Restore lost character.',18,1);
X prt('`5EW - *Create any object *CAN CAUSE FATAL ERROR*',19,1);
X prt('`5EX - *Edit high score file',20,1);
X pause(24);
X draw_cave;
X end;
X
X`7B Since MASLIB does not take well to spawned processes, the utility
X routine LBR$OUTPUT_HELP was used as a replacement. -WWB `7D
X
X`5Bglobal,psect(misc2$code)`5D procedure moria_help(help_level : vtype);
X
X begin
X help_level := help_level+' IMORIA';
X lbr$output_help(%immed lib$put_output,,help_level,
X %stdescr 'mas$library:`5Bhelp`5D:moriahlp',%ref hlp$m_prompt,
X %immed lib$get_input);
X end;
X
XEnd.
$ CALL UNPACK HELP.PAS;1 1276914859
$ create 'f'
Xvar
X`09horse`09`09`09: h_name;
X`09hstat,dist,area,lane`09: h_stat;
X`09fastest,final_fastest : h_stat;
X`09bets,true_bets`09`09: h_stat;
X`09order,final_order`09: h_stat;
X`09times`09`09`09: array `5B0..21`5D of h_stat;
X`09true_sum_bets,sum_bets`09: integer;
X`09horse_bet,num_horse,count : integer;
X`09horse_bet_type`09`09: char;
X`09exit_flag`09`09: boolean;
X`09odds,true_odds`09`09: statr;
X
X
X`20
Xprocedure display_commands;
Xbegin
X display_gold;
X prt('You may:',20,1);
X prt(' p) place a bet v) view the program.',21,2);
X prt(' s) skip a race. `5ER) Redraw the screen.',22,2);
X prt('`5EZ) Exit horseracing.',23,2);
Xend;
X`20
X`20
Xprocedure display_track3;
Xbegin
Xclear(1,1);
Xput_buffer('-- -- -- -- -- -- -- -- -- -- -- -- -- -- __ __',3,1);
Xput_buffer('-_',4,51); put_buffer('-_',5,55); put_buffer('-_',6,58);
Xput_buffer('-_',7,61); put_buffer('-_',8,63); put_buffer('-_',9,65);
Xput_buffer('-_',10,67); put_buffer('-_',11,69); put_buffer('_',12,71);
Xput_buffer('_',13,72); put_buffer('_',14,73); put_buffer('_',15,74);
Xput_buffer('_',16,75); put_buffer('-- -- -- -- -- -- -- -- -- -- __ ',16,1)
V;
Xput_buffer('-_',17,35); put_buffer('-_',18,38); put_buffer('-_',19,41);
Xput_buffer('-_',20,43); put_buffer('_',21,45); put_buffer('_',22,46);
Xput_buffer('_',23,46); put_buffer('_',17,76); put_buffer('_',18,77);
Xput_buffer('_',19,77); put_buffer('_',20,77); put_buffer('_',21,77);
Xput_buffer('_',22,77); put_buffer('_',23,77);
Xput_qio;
Xend;
X`20
X`20
Xprocedure display_track2;
Xbegin
Xclear(1,1);
Xput_buffer('_',2,46); put_buffer('_',3,46); put_buffer('_',4,45);
Xput_buffer('_-',5,43); put_buffer('_-',6,41); put_buffer('_-',7,38);
Xput_buffer('__',8,34); put_buffer('_',2,77); put_buffer('_',3,77);
Xput_buffer('_',4,77); put_buffer('_',5,77); put_buffer('_',6,77);
Xput_buffer('_',7,77); put_buffer('_',8,77); put_buffer('_',9,77);
Xput_buffer('__ __ __ __ __ __ __ __ __ __ --',9,1);
Xput_buffer('_',10,76); put_buffer('_',11,75); put_buffer('_',12,73);
Xput_buffer('_',13,71); put_buffer('_-',14,69); put_buffer('_-',15,67);
Xput_buffer('_-',16,65); put_buffer('_-',17,63); put_buffer('_-',18,60);
Xput_buffer('_-',19,57); put_buffer('_-',20,53); put_buffer('_-',21,49);
Xput_buffer('__ __ __ __ __ __ __ __ __ __ __ __ __ -- -- --',22,1);
Xput_qio;
Xend;
X`20
X`20
Xprocedure display_track4;
Xbegin
Xclear(1,1);
Xput_buffer('__ __ -- -- -- -- -- -- -- -- -- -- -- -- -- -- --',3,29);
Xput_buffer('_-',4,25); put_buffer('_-',5,22); put_buffer('_-',6,19);
Xput_buffer('_-',7,17); put_buffer('_-',8,15); put_buffer('_-',9,13);
Xput_buffer('_-',10,11); put_buffer('_-',11,9); put_buffer('_',12,8);
Xput_buffer('_',13,7); put_buffer('_',14,6); put_buffer('_',15,5);
Xput_buffer('_',16,4); put_buffer('__ -- -- -- -- -- -- -- -- -- --',16,46)
V;
Xput_buffer('_-',17,43); put_buffer('_-',18,40); put_buffer('_-',19,37);
Xput_buffer('_-',20,35); put_buffer('_',21,34); put_buffer('_',22,33);
Xput_buffer('_',23,33); put_buffer('_',17,3); put_buffer('_',18,2);
Xput_buffer('_',19,2); put_buffer('_',20,2); put_buffer('_',21,2);
Xput_buffer('_',22,2); put_buffer('_',23,2);
Xput_qio;
Xend;
X`20
Xprocedure display_track5;
Xbegin
Xclear(1,1);
Xput_buffer('_',2,3); put_buffer('_',3,3); put_buffer('_',4,3);
Xput_buffer('_',5,3); put_buffer('_',6,3); put_buffer('_',7,3);
Xput_buffer('_',8,3); put_buffer('_',2,32); put_buffer('_',3,32);
Xput_buffer('_',4,33); put_buffer('-_',5,34); put_buffer('-_',6,36);
Xput_buffer('-_',7,39); put_buffer('__',8,43); put_buffer('_',9,4);
Xput_buffer('-- __ __ __ __ __ __ __ __ __ __',9,46);
Xput_buffer('_',10,5); put_buffer('_',11,6); put_buffer('_',12,7);
Xput_buffer('_',13,8); put_buffer('-_',14,9); put_buffer('-_',15,11);
Xput_buffer('-_',16,13); put_buffer('-_',17,15); put_buffer('-_',18,18);
Xput_buffer('-_',19,21); put_buffer('-_',20,25); put_buffer('-_',21,29);
Xput_buffer('-- -- __ __ __ __ __ __ __ __ __ __ __ __ __',22,34);
Xput_qio;
Xend;
X`20
Xprocedure display_track1;
Xbegin
Xclear(1,1);
Xput_buffer('__ __ __ __ __ __ __ __ __ __ __ __ __ __ __ __ __ __ __',2,1);
Xput_buffer('__ __ __ __ __ __ __',2,58);
Xput_buffer('__ __ __ __ __ __ __ __ __ __ __ __ __ __ __ __ __ __ __',16,1);
Xput_buffer('__ __ __ __ __ __ __',16,58);
Xput_qio;
Xend;
X`20
X`20
Xprocedure get_horse_stats;
X var
X i1,i2`09`09: integer;
X horse_not_chosen `09: array`5B1..max_horse_names`5D of boolean;
Xbegin
X num_horse := 5 + randint(4);
X for i1 := 1 to max_horse_names do
X horse_not_chosen`5Bi1`5D := true;
X for i1 := 1 to num_horse do
X begin
X repeat
X`09i2 := randint(max_horse_names);
X until (horse_not_chosen`5Bi2`5D);
X horse`5Bi1`5D := horsename`5Bi2`5D;
X hstat`5Bi1`5D := 2*horsestat`5Bi2`5D-randint(2);
X horse_not_chosen`5Bi2`5D := false;
X end;
X i2 := randint(250) + randint(250);
X sum_bets := 0;
X for i1 := 1 to num_horse do
X begin
X bets`5Bi1`5D:= (hstat`5Bi1`5D-20)**4 div i2;
X sum_bets := sum_bets + bets`5Bi1`5D;
X end;
X for i1 := 1 to num_horse do
X odds`5Bi1`5D := 0.95*sum_bets/bets`5Bi1`5D - 1.0;
X i1 := randint(num_horse);
X hstat`5Bi1`5D := hstat`5Bi1`5D + randint(2);
X i1 := randint(num_horse);
X hstat`5Bi1`5D := hstat`5Bi1`5D + randint(2);
X i1 := randint(num_horse);
X hstat`5Bi1`5D := hstat`5Bi1`5D - randint(5);
X true_sum_bets := 0;
X for i1 := 1 to num_horse do
X begin
X true_bets`5Bi1`5D := (hstat`5Bi1`5D-20)**4 div i2;
X true_sum_bets := true_sum_bets + true_bets`5Bi1`5D;
X end;
X for i1 := 1 to num_horse do
X true_odds`5Bi1`5D := 0.95*true_sum_bets/true_bets`5Bi1`5D - 1.0;
Xend;
X`20
X`20
Xfunction move(amount : real):integer;
Xbegin
X move := 0;
X if (amount/10) >= 1 then move := 1;
X if (amount/100) >= 1 then move := 2;
X if (amount/1000) >= 1 then move := 3;
Xend;
X`20
X`20
X(* list horses + odds for the next race *)
Xprocedure list_horses;
X var
X i1 : integer;
X command : char;
Xbegin
X clear(2,1);
X for i1 := 1 to num_horse do
X begin
X`09prt('odds',3,36);
X`09writev(out_val,i1:2,'. ',horse`5Bi1`5D);
X`09prt(out_val,4+i1,3);
X`09if (odds`5Bi1`5D < 0.2) then odds`5Bi1`5D := 0.2;
X`09if (odds`5Bi1`5D >= 4.75) then writev(out_val,trunc(odds`5Bi1`5D+0.5):3)
X`09else if (odds`5Bi1`5D < 0.90) then writev(out_val,trunc(5*odds`5Bi1`5D+0.
V5):1,'/5')
X`09else if (trunc(odds`5Bi1`5D*2+0.5) mod 2 = 0) then
X`09 writev(out_val,trunc(odds`5Bi1`5D+0.25):3)
X`09else writev(out_val,trunc(odds`5Bi1`5D*2+0.5):1,'/2');
X prt(out_val,4+i1,37);
X end;
X if bet = 0 then begin
X prt('`5Bhit any key to continue`5D',23,24);
+-+-+-+-+-+-+-+- END OF PART 34 +-+-+-+-+-+-+-+-