-+-+-+-+-+-+-+-+ START OF PART 57 -+-+-+-+-+-+-+-+ X end X end; X`20 X`20 X`7B Prints the following information on the screen. `7D X`5Bpsect(create$code)`5D procedure put_stats; X begin X with py do X begin X prt('Cur',2,62); X prt('Max',2,71); X prt_stat('STR : ',stat.cstr,3,56); X prt_stat('`7C ',stat.str,3,69); X prt_stat('INT : ',stat.cint,4,56); X prt_stat('`7C ',stat.int,4,69); X prt_stat('WIS : ',stat.cwis,5,56); X prt_stat('`7C ',stat.wis,5,69); X prt_stat('DEX : ',stat.cdex,6,56); X prt_stat('`7C ',stat.dex,6,69); X prt_stat('CON : ',stat.ccon,7,56); X prt_stat('`7C ',stat.con,7,69); X prt_stat('CHR : ',stat.cchr,8,56); X prt_stat('`7C ',stat.chr,8,69); X prt_num('+ To Hit : ',misc.dis_th,10,4); X prt_num('+ To Dam : ',misc.dis_td,11,4); X prt_num('+ To AC : ',misc.dis_tac,12,4); X prt_num('Total AC : ',misc.dis_ac,13,4); X end X end; X`20 X`20 X`7B Returns a rating of x depending on y `7D X`5Bpsect(create$code)`5D function likert(x,y,i1 : integer) : btype; X begin X case i1 of X`09 1:`09case trunc(x/y) of X`09 `09 -1,0,1 : likert := 'VERY BAD'; X`09 2,3 : likert := 'Bad'; X`09 4 : likert := 'Poor'; X`09`09`09 5,6 : likert := 'Average'; X`09`09`09 7 : likert := 'Good'; X`09`09 8 : likert := 'Very Good'; X`09`09`09 9 : likert := 'Superb'; X`09`09 otherwise likert := 'EXCELLENT'; X`09 end;`20 X`09 2:`09case trunc(x/y) of X`09`09 -1,0,1 : likert := 'Repugnant'; X`09`09 2 : likert := 'Mediocre'; X`09 3 : likert := 'Sub-Par'; X`09`09`094,5 : likert := 'Average'; X`09`09`09 6 : likert := 'Notable'; X`09`09`09 7 : likert := 'Honorable'; X 8 : likert := 'Remarkable'; X 9 : likert := 'Exemplary'; X otherwise likert := 'PERFECTION'; X`09 end;`20 X`09 3:`09case trunc(x/y) of X`09 -1,0,1 : likert := 'Bogus'; X`09`09 2 : likert := 'Awful'; X`09 3 : likert := 'Cool Minus'; X`09`09`094,5 : likert := 'Dude'; X`09`09`09 6 : likert := 'Cool'; X 7 : likert := 'Mass Cool'; X 8,9 : likert := 'Awesome'; X otherwise likert := 'EXCELLENT'; X`09 end;`20 X`09 4:`09case trunc(x/y) of X`09 -1,0,1 : likert := 'very bad'; X`09`09 2 : likert := 'bad'; X`09 3 : likert := 'not bad'; X`09`09 4,5,6 : likert := 'okay'; X 7,8,9 : likert := 'good'; X otherwise likert := 'very good'; X`09 end;`20 X`09 5:`09case trunc(x/y) of X`09 -1,0,1 : likert := ' :6 '; X`09`09 2 : likert := ' :0 '; X`09 3 : likert := ' :( '; X`09`09`094,5 : likert := ' :`7D '; X`09`09`09 6 : likert := ' :) '; X 7 : likert := ' :`5D '; X 8,9 : likert := ' :> '; X otherwise likert := ' :D '; X`09 end;`20 X end; X end; X`20 X`20 X`7B Prints age, height, weight, and SC `7D X`5Bpsect(create$code)`5D procedure put_misc1; X begin X with py do X begin X prt_num('Age : ',misc.age,4,27); X prt_num('Height/Weight: ',misc.ht ,5,27); X prt_num('/',misc.wt ,5,44); X prt_num('Social Class : ',misc.sc ,6,27); X end; X end; X`20 X`20 X`7B Prints the following information on the screen. `7D X`5Bpsect(create$code)`5D procedure put_misc2; X `20 X var X out_val : ctype; X X begin X with py.misc do X begin X prt_num('Level : ',lev,10,27); X prt_num('Cash : ',au,11,27); X prt_num('Savings Account: ',act_bal,12,27); X prt_num('Bank Loan : ',principal,13,27); X`09 `20 X prt_num('Experience : ',exp,10,54); X prt_num('Needed Exp : ',trunc(player_exp`5Blev`5D*expfact),11,54); X`09 writev(out_val,'Hit Points : ',trunc(chp):1,'/',mhp:1); X prt(out_val,12,54); X`09 writev(out_val,'Resources : ',trunc(cmana):1,'/',mana:1); X prt(out_val,13,54); X end X end; X`20 X`20 X`7B It's about time someone added this code! The skill system is a complete X mess and it's needed to be fixed since I got a hold of the code. -RLG`7D X X`5Bpsect(misc2$code)`5D function xbth : integer; X begin X with py.misc do X xbth := lesser(200, bth + lev*bth_lev_adj + ptohit*bth_plus_adj); X end; X X`5Bpsect(misc2$code)`5D function xbthb : integer; X begin X with py.misc do X xbthb := lesser(200, bthb + lev*bth_lev_adj + ptohit*bth_plus_adj); X end; X X`5Bpsect(misc2$code)`5D function xperc : integer; X begin X with py.misc do X xperc := lesser(200, perc + (lev div 2) + int_adj); X end; X X`5Bpsect(misc2$code)`5D function xsrh : integer; X begin X with py.misc do X xsrh := lesser(100, srh + (lev div 2) + int_adj); X end; X X`5Bpsect(misc2$code)`5D function xstl : integer; X begin X with py.misc do X xstl := lesser(10, stl + (py.misc.lev div 8)); X end; X X`5Bpsect(misc2$code)`5D function xdis : integer; X begin X with py.misc do X xdis := lesser(100, disarm + (lev div 2) + 2*todis_adj); X end; X X`5Bpsect(misc2$code)`5D function xsave : integer; X begin X with py.misc do X xsave := lesser(100, save + (lev div 2) + wis_adj); X end; X X`5Bpsect(misc2$code)`5D function xdev : integer; X begin X with py.misc do X xdev := lesser(100, wierd + (lev div 2) + int_adj); X end; X X`5Bpsect(misc2$code)`5D function xinfra : vtype; X var X out_val : vtype; X begin X with py.flags do X if (see_infra = 0) then X xinfra := 'None' X else if (see_infra = 1) then X`09 xinfra := '1 Meter' X else X begin X writev(out_val,py.flags.see_infra:1,' Meters'); X`09 xinfra := out_val; X`09 end; X end; X X X`7B Prints ratings on certain abilities `7D X`5Bpsect(create$code)`5D procedure put_misc3; X var`20 X i1 : integer; X begin X`09clear(16,1); X`09i1 := randint(5); `7Brandom variation for likert tables`7D X prt('(Miscellaneous Abilities)',16,24); X put_buffer('Melee Fights: '+likert(xbth,20,i1) ,17, 2); X put_buffer('Guns/Grenade: '+likert(xbthb,20,i1) ,18, 2); X put_buffer('Saving Throw: '+likert(xsave,10,i1) ,19, 2); X put_buffer('Stealth : '+likert(xstl, 1,i1) ,17,27); X put_buffer('Disarming : '+likert(xdis,10,i1) ,18,27); X put_buffer('Weird Device: '+likert(xdev,10,i1) ,19,27); X put_buffer('Perception : '+likert(xperc,10,i1) ,17,52); X put_buffer('Searching : '+likert(xsrh,10,i1) ,18,52); X put_buffer('Infra-Vision: '+xinfra, 19,52); X end; X`20 X `7B Used to display the character on the screen. `7D X`5Bpsect(create$code)`5D procedure display_char; X var X dummy : char; X begin X put_character; X put_misc1; X put_stats; X put_misc2; X put_misc3; X end; X`20 X `7B Gets a name for the character `7D X`5Bpsect(create$code)`5D procedure get_name; X begin X prt('Enter your player''s name `5Bpress when finished`5D',22 V,3); X get_string(py.misc.name,3,11,24); X clear(21,1); X end; X`20 X`7B Changes the name of the character `7D X`5Bpsect(create$code)`5D procedure change_name; X var X c : char; X flag : boolean; X begin X flag := false; X display_char; X repeat X prt('hange character name. to continue.',22,3); X inkey(c); X case ord(c) of X 99 : get_name; X 0,3,25,26,27 : flag := true; X otherwise; X end; X until (flag); X end; X`20 X`20 X`5Bpsect(misc4$code)`5D procedure display_kill_list; X X VAR X`09i1,i2,total`09: integer; X`09tmp`09`09: array `5B1..52`5D of integer; X`09c_chr`09`09: dtype; X`09out_val`09`09: vtype; X BEGIN X clear(1,1); X total := 0; X for i1 := 1 to 52 do X tmp`5Bi1`5D := 0; X for i1 := 1 to max_creatures do X begin X`09 i2 := index(alpha_set,c_list`5Bi1`5D.cchar); X`09 tmp`5Bi2`5D := tmp`5Bi2`5D + kill_list`5Bi1`5D; X`09 total := total + kill_list`5Bi1`5D; X`09end; X prt( X 'Total creatures killed for each on-screen character representation:',1,5 V); X for i2 := 1 to 13 do X prt_num(chr(i2+96)+' : ',tmp`5Bi2`5D,i2+2,13);`20 X for i2 := 14 to 26 do X prt_num(chr(i2+96)+' : ',tmp`5Bi2`5D,i2+2-13,28);`20 X for i2 := 1 to 13 do X prt_num(chr(i2+64)+' : ',tmp`5Bi2+26`5D,i2+2,43);`20 X for i2 := 14 to 26 do X prt_num(chr(i2+64)+' : ',tmp`5Bi2+26`5D,i2+2-13,58);`20 X prt_num('Total Creatures Killed : ',total,17,24); X if (total <= 21) then X out_val := '(you must be a pacifist.)' X else if (total <= 100) then X out_val := '(a good beginning.)' X else if (total <= 400) then X out_val := '(you sure fight a lot.)' X else if (total <= 800) then X out_val := '(KILL! KILL! KILL!)' X else if (total <= 1600) then X out_val := '(the rest are waiting for you.)' X else out_val := '(the Boss is gonna get you.)'; X prt(out_val,18,24); X pause(24); X draw_cave; X END; X X X`7B Destroy an item in the inventory `7D X`5Bpsect(misc4$code)`5D procedure inven_destroy(item_val : integer); X var X i2 : integer; X begin X temporary_slot := inventory`5Bitem_val`5D; X with inventory`5Bitem_val`5D do X begin X if ((number > 1) and (subval < 512)) then X begin X number := number - 1; X inven_weight := inven_weight - weight; X temporary_slot.number := 1; X end X else X begin X inven_weight := inven_weight - weight*number; X for i2 := item_val to inven_ctr-1 do X inventory`5Bi2`5D := inventory`5Bi2+1`5D; X inventory`5Binven_ctr`5D := blank_treasure; X inven_ctr := inven_ctr - 1; X end; X end X end; X`20 X`20 X`7B Drops an item from inventory to given location `7D X`5Bpsect(misc4$code)`5D procedure inven_drop(item_val,y,x : integer); X var X i1 : integer; X begin X with cave`5By,x`5D do X begin X if (tptr > 0) then pusht(tptr); X inven_destroy(item_val); X popt(i1); X t_list`5Bi1`5D := temporary_slot; X tptr := i1; X end; X end; X`20 X`20 X`7B Destroys a type of item on a given percent chance `7D X`5Bpsect(misc4$code)`5D function inven_damage( X typ : obj_set; X perc : integer X ) : integer; X var X i1,i2 : integer; X begin X i2 := 0; X for i1 := 1 to inven_ctr do X with inventory`5Bi1`5D do X if (tval in typ) then X if (randint(100) < perc) then X begin X inven_destroy(i1); X i2 := i2 + 1; X end; X inven_damage := i2; X end; X`20 X`20 X`7B Check inventory for too much weight `7D X`5Bpsect(misc4$code)`5D function inven_check_weight : boolean; X var X item_wgt : integer; X begin X inven_check_weight := false; X max_weight := weight_limit; X with temporary_slot do X item_wgt := number*weight; X`7B Now, check to see if player can carry object `7D X if ((inven_weight + item_wgt) <= max_weight) then X inven_check_weight := true; `7B Can carry weight `7D X end; X`20 X`20 X`7B Check to see if he will be carrying too many objects `7D X`5Bpsect(misc4$code)`5D function inven_check_num : boolean; X var X item_num,i1 : integer; X flag : boolean; X begin X inven_check_num := false; X if (inven_ctr < inven_max) then X inven_check_num := true X else if (temporary_slot.subval > 255) then X for i1 := 1 to inven_ctr do X with inventory`5Bi1`5D do X if (tval = temporary_slot.tval) then X if (subval = temporary_slot.subval) then X inven_check_num := true; X end; X`20 X`20 X`7B Add the item in TEMPORARY_SLOT to players inventory. Return the X item position for a description if needed... `7D X`5Bpsect(misc4$code)`5D procedure inven_carry(var item_val : integer); X var X item_num,wgt,typ,subt : integer; X flag : boolean; X`20 X`7B Insert TEMPORARY_SLOT at given location `7D X procedure insert(pos,wgt : integer); X var X i1 : integer; X begin X for i1 := inven_ctr downto pos do X inventory`5Bi1+1`5D := inventory`5Bi1`5D; X inventory`5Bpos`5D := temporary_slot; X inven_ctr := inven_ctr + 1; X inven_weight := inven_weight + wgt; X end; X`20 X`7B INVEN_CARRY routine `7D X begin X`7B Now, check to see if player can carry object `7D X item_val := 0; X flag := false; X with temporary_slot do X begin X item_num := number; X typ := tval; X subt := subval; X wgt := number*weight; X end; X repeat X item_val := item_val + 1; X with inventory`5Bitem_val`5D do X if (typ = tval) then X begin X if (subt = subval) then `7B Adds to other item `7D X if (subt > 255) then X begin X number := number + item_num; X inven_weight := inven_weight + wgt; X flag := true; X end; X end +-+-+-+-+-+-+-+- END OF PART 57 +-+-+-+-+-+-+-+-