-+-+-+-+-+-+-+-+ START OF PART 27 -+-+-+-+-+-+-+-+ X count,indx : integer; X infile`09: text; X flagstr`09: usernam_type; X BEGIN X `7Bread creatures from external file`7D X open (infile,BOSS_MON,readonly); X reset(infile); X readln(infile,max_creatures); X for count := 1 to max_creatures do X with c_list`5Bcount`5D do X Begin X`09 readln(infile,name); X for indx := 1 to 3 do X begin X`09 `09readln(infile,flagstr); X case indx of X 1 : cmove := gethex(flagstr); X 2 : spells := gethex(flagstr); X 3 : cdefense := gethex(flagstr); X end; X end; X readln(infile,sleep,mexp,aaf,ac,speed); X`09 readln(infile,reprod,size,tt,intel,speaks); X readln(infile,cchar); X readln(infile,hd); X readln(infile,damage); X readln(infile,level); X End; X close(infile); X END; X X`7B Read in the master object list. It's about time someone did this. -RLG` V7D X`5Bpsect(datafiles$code)`5D procedure read_objects; X var X`09count : integer; X`09infile : text; X`09flagstr : usernam_type; X`09dummy : vtype; X Begin X `7B Read objects from external file `7D X open (infile,BOSS_OBJ,readonly); X reset(infile); X readln(infile,max_objects); X for count := 1 to max_objects do X begin X object_ident`5Bcount`5D := false; `7Bset all objects to be not ide Vntified`7D X with object_list`5Bcount`5D do X begin X`09 readln(infile,dummy); `09 X readln(infile,name); X`09 readln(infile,flagstr); X`09 flags := gethex(flagstr); `7Bconvert flag string to hex value`7D X`09 readln(infile,tval,subval,cost,weight,number,level); X`09 readln(infile,p1,tohit,todam,ac,toac); X`09 readln(infile,damage); X`09 readln(infile,tchar); X end; X`09end; X close(infile); X END; X X`5Bpsect(datafiles$code)`5D procedure read_inventory_list; `7BThe obvious se Vquel. -RLG`7D X var X`09count : integer; X`09infile : text; X`09flagstr : usernam_type; X`09dummy : vtype; X Begin X `7B Read store inventory objects from external file `7D X open (infile,BOSS_INV,readonly); X reset(infile); X readln(infile,inven_init_max); X for count := 1 to inven_init_max do X begin X with inventory_init`5Bcount`5D do X begin X`09 readln(infile,dummy); `09 X readln(infile,name); X`09 readln(infile,flagstr); X`09 flags := gethex(flagstr); `7Bconvert flag string to hex value`7D X`09 readln(infile,tval,subval,cost,weight,number,level); X`09 readln(infile,p1,tohit,todam,ac,toac); X`09 readln(infile,damage); X`09 readln(infile,tchar); X end; X`09end; X close(infile); X END; X X`7B Initialize, restore, and get the ball rolling. `7D X`5Bpsect(datafiles$code)`5D procedure read_data; XBegin X read_creatures; X read_objects; X read_inventory_list; XEnd; X X X X`7BLoads skill data from file into skill_list array. -RLG`7D X`7BSeems like a better way to handle the skill lists. `7D X`7BBut geez did this take a lot of work to implement!!! `7D X`7BI was warned..`20 X X`7B I should have listened to what my mother used to say. `7D X`7B What did she say? `7D X`7B I don't know. I wasn't listening. `7D X X`5Bpsect(datafiles$code)`5D procedure get_skill_data(number : byteint); X VAR X pos : byteint; X dummy : vtype; X infile : text; X`09 X BEGIN X open (infile,SKILLS,readonly); X reset(infile); X X repeat X repeat X readln(infile,dummy); X`09until( substr(dummy,1,2) = '**'); X`09readln(infile,pos); X until(pos = number); X X for pos := 1 to max_skills do X begin X with skill_list`5Bpos`5D do X begin X`09 readln(infile,sname); `09 X`09 readln(infile,slevel,smana,sexp,sfail); X`09 learned := false; X end; X`09end; X close(infile); X END; X $ CALL UNPACK [.INC]DATAFILES.INC;1 1627763589 $ create 'f' X`7B Handles the gravestone and the top fifty routines, and X also the 100-day time limit routine. `7D X`5Bpsect(death$code)`5D procedure upon_death; X Xvar X`09points : integer; X `20 X`20 X`7B Prints the gravestone of the character `7D X procedure print_tomb; X var X str1,str2,str3,str4,str5,str6,str7,str8 : vtype; X dstr : array `5B0..19`5D of vtype; X fnam : vtype; X`09command : char; X f1 : text; X i1 : integer; X deathdate : packed array `5B1..11`5D of char; X flag : boolean; X BEGIN X date(deathdate); X str1 := fill_str(py.misc.name,31); X str2 := fill_str(py.misc.title,31); X str3 := fill_str(py.misc.tclass,31); X writev(str4,'Level : ',py.misc.lev:1); X str4 := fill_str(str4,31); X writev(str5,py.misc.exp:1,' Exp'); X str5 := fill_str(str5,31); X writev(str6,py.misc.au:1,' Dollars'); X str6 := fill_str(str6,31); X str7 := 'Died near ' + townlist`5Btown_num`5D.town_name; X str7 := fill_str(str7,31); X str8 := fill_str(died_from,31); Xdstr`5B00`5D := ' '; Xdstr`5B01`5D := ' _______________________'; Xdstr`5B02`5D := ' / \ ___'; Xdstr`5B03`5D := ' / \ ___ / \ _ V__'; Xdstr`5B04`5D := ' / RIP \ \ `7C `7C V / \'; Xdstr`5B05`5D := ' / \ `7C _`7C___`7C_ V `7C `7C'; Xdstr`5B06`5D := ' /'+str1+ '\_`7C_ _ V`7C___`7C_'; Xdstr`5B07`5D := ' `7C the `7C ___'; Xdstr`5B08`5D := ' `7C '+str2+ ' `7C / \'; Xdstr`5B09`5D := ' `7C `7C `7C `7C V'; Xdstr`5B10`5D := ' `7C '+str3+ ' `7C _`7C___`7C V_ ____'; Xdstr`5B11`5D := ' `7C '+str4+ ' `7C / V \'; Xdstr`5B12`5D := ' `7C '+str5+ ' `7C ` V7C `7C'; Xdstr`5B13`5D := ' `7C '+str6+ ' `7C ` V7C `7C'; Xdstr`5B14`5D := ' `7C '+str7+ ' `7C _` V7C____`7C_'; Xdstr`5B15`5D := ' `7C killed by `7C'; Xdstr`5B16`5D := ' `7C '+str8+ ' `7C'; Xdstr`5B17`5D := ' `7C '+deathdate+' `7C'; Xdstr`5B18`5D := ' *`7C * * * * * * `7C *'; Xdstr`5B19`5D := '________)/\\_)_/___(\/___(//_\)/_\//__\\(/_`7C_)_______'; X clear(1,1); X for i1 := 0 to 19 do X dprint(dstr`5Bi1`5D,i1+1); X flush; X if (get_com('Print to file? (Y/N)',command)) then X case command of X 'y','Y': BEGIN X prt('Enter Filename:',1,1); X flag := false; X repeat X if (get_string(fnam,1,17,60)) then X BEGIN X if (length(fnam) = 0) then fnam:='BOSSCHR.DIE' V; X open (f1,file_name:=fnam,error:=continue); X if (status(f1) <> 0) then X prt('Error creating> ' + fnam,2,1) X else X BEGIN X flag := true; X rewrite(f1,error:=continue); X for i1 := 0 to 19 do X writeln(f1,dstr`5Bi1`5D,error:=continue) V; X END; X close(f1,error:=continue); X END X else X flag := true; X until(flag) X END; X otherwise X END; X flush; X if (get_com('Print character sheet to file? (Y/N)',command)) then X case command of X 'y','Y' : character_print; X otherwise; X end; X END; X`20 X`20 X`20 X`7B Enters a players name on the top forty list `7D X procedure top_fifty(pts : integer); X var X list `09`09`09 : array `5B1..50`5D of vtype; X blank`09`09`09 : packed array `5B1..13`5D of char; X i1,i2,i4,n1,mwk5,trys : integer; X o1,o2,o3,o4`09`09 : vtype; X f1`09`09`09 : text; X flag,file_flag`09`09 : boolean; X`09command`09`09`09 : char; X BEGIN X if (wizard) then exit; X clear(1,1); X for i1 := 1 to 50 do X list`5Bi1`5D := ''; X n1 := 1; X priv_switch(1); X trys := 0; X file_flag := false; X repeat X open (f1,file_name:=boss_top, X organization:=sequential,history:=old, X sharing:=none,error:=continue); X if (status(f1) = 2) then X BEGIN X trys := trys + 1; X if (trys > 5) then X file_flag := true X else X sleep(2); X END X else X file_flag := true; X until(file_flag); X if ((status(f1) <> 0) and (status(f1) <> 2)) then X open (f1,file_name:=boss_top, X organization:=sequential,history:=new, X sharing:=none,error:=continue); X if (status(f1) <> 0) then X BEGIN X writeln('Error in opening ',boss_top); X writeln('Please contact local BOSS Wizard.'); X exit; X END; X reset(f1); X while ((not eof(f1)) and (n1 <= 50)) do X BEGIN X readln(f1,list`5Bn1`5D,error:=continue); X n1 := n1 + 1; X END; X n1 := n1 - 1; `20 X i1 := 1; X flag := false; X while ((i1 <= n1) and (not flag)) do X BEGIN X readv(list`5Bi1`5D,blank,i4); X if (i4 < pts) then X flag := true X else X i1 := i1 + 1; X END; X if ((flag) or (n1 = 0) or (n1 < 50)) then X BEGIN X for i2 := 49 downto i1 do X list`5Bi2+1`5D := list`5Bi2`5D; X o1 := username; X`09 o2 := pad(py.misc.name,' ',24); X`09 o3 := pad(py.misc.race,' ',12); X`09 o4 := pad(py.misc.tclass,' ',11);`09 `20 X writev(list`5Bi1`5D,pad(o1,' ',13),pts:7,' ',o2,' ', X`09`09 py.misc.lev:2,' ',o3,' ',o4); X if (n1 < 50) then X n1 := n1 + 1; X flag := false; X END; X rewrite(f1); X for i1 := 1 to n1 do X writeln(f1,list`5Bi1`5D); X close(f1); `20 X priv_switch(0); X`09writeln; X`09writeln; X`09writeln; X prt('Username Points Character Level Quality V Class',3,1); X for i1 := 1 to n1 do X BEGIN X writeln(list`5Bi1`5D); X if ((i1 mod 20) = 0) then X begin X`09 msg_flag := true; X`09`09 msg_print(''); X clear(4,1); X end; X mwk5:=i1 X END; X mwk5:=mwk5+2; X writeln; X put_qio X END; X`20 X`20 X`7B Change the player into a King! `7D X procedure kingly; X BEGIN X`7B Change the character attributes.`7D X dun_level := 0; X died_from := 'Ripe Old Age'; X with py.misc do X BEGIN X`09 if (lev <= max_player_level) then X lev := lev + max_player_level; X max_exp := 1000000*total_winner_num + randint(1000); X exp := max_exp X END; X`7B Let the player know that he did good.`7D X clear(1,1); X dprint(' #',2); X dprint(' #####',3); X dprint(' #',4); X dprint(' ,,, $$$ ,,,',5); X dprint(' ,,=$ "$$$$$" $=,,',6); X dprint(' ,$$ $$$ $$,',7); X dprint(' *> <*> <*',8); X dprint(' $$ $$$ $$',9); X dprint(' "$$ $$$ $$"',10);`20 X dprint(' "$$ $$$ $$"',11); X dprint(' *#########*#########*',12); X dprint(' *#########*#########*',13); X dprint(' Veni, Vidi, Vici!',16); X dprint(' You have slain the BOSS!',17); X dprint(' And saved the world!',18); X flush; X pause(24); X END; X`20 X`20 X`7B What happens upon dying...`7D X BEGIN X with py.misc do X begin X points := trunc(max_exp/expfact) + X 100*(max_lev + townlist`5Btown_num`5D.lev_plus) - principal; X if (total_winner_num > 0) then X begin `20 X`09 kingly; X lev := lev + max_player_level; X points := points + 1000000*total_winner_num + 1000*(100-day); X exp := max_exp X end X end; X print_tomb; X top_fifty(points); X exit; X END; X X`5Bpsect(death$code)`5D procedure time_out; X `20 XBEGIN X clear(1,1); X prt('Midnight, the bewitching hour. It has been 100 days since you',1,3); X prt('started your quest. You have been busy, and so has the Boss.',2,3); X prt('Sadly for you and the world you were supposed to save, the Boss',3,3) V; X prt('has amassed enough power to take over the world. He has seized',4,3) V; X prt('control of all major world governments and the world economy.',5,3); X prt('A simple pack of chewing gum now costs over 400 dollars, and',6,3); X prt('there is only one brand on the market. All over the world,',7,3); X prt('people cry out in vain for freedom and brand name choices.',8,3); +-+-+-+-+-+-+-+- END OF PART 27 +-+-+-+-+-+-+-+-