-+-+-+-+-+-+-+-+ START OF PART 34 -+-+-+-+-+-+-+-+ X writev(tmp_str,part1:2,'/',part2:1); X end X else X writev(tmp_str,stat:2); X if (length(tmp_str) < 6) then tmp_str := pad(tmp_str,' ',6); X out_val := tmp_str; X end; X`20 X`20 X`7B Print character stat in given row, column `7D X`5Bpsect(misc5$code)`5D procedure prt_stat ( X stat_name : vtype; X stat : byteint; X row,column : integer X ); X var X out_val1 : stat_type; X out_val2 : vtype; X begin X cnv_stat(stat,out_val1); X out_val2 := stat_name + out_val1; X put_buffer(out_val2,row,column); X end; X `20 X`20 X`7B Print character info in given row, column `7D X`5Bpsect(misc5$code)`5D procedure prt_field(info : vtype; row,column : integ Ver); X var X out_val1,out_val2 : vtype; X begin X put_buffer(pad(info,' ',14),row,column); X end; X`20 X`20 X`7B Print number with header at given row, column `7D X`5Bpsect(misc5$code)`5D procedure prt_num ( X header : vtype; X num,row,column : integer X ); X var X out_val : vtype; X begin X writev(out_val,header,num:1,' '); X put_buffer(out_val,row,column);`20 X`09end; X`20 X`20 X`7B Adjustment for wisdom `7D X`5Bpsect(misc2$code)`5D function wis_adj : integer; X begin X if (py.stat.cwis > 117) then X wis_adj := 7 X else if (py.stat.cwis > 107) then X wis_adj := 6 X else if (py.stat.cwis > 87) then X wis_adj := 5 X else if (py.stat.cwis > 67) then X wis_adj := 4 X else if (py.stat.cwis > 17) then X wis_adj := 3 X else if (py.stat.cwis > 14) then X wis_adj := 2 X else if (py.stat.cwis > 7) then X wis_adj := 1 X else X wis_adj := 0; X end; X`20 X`20 X`7B adjustment for intellegence `7D X`5Bpsect(misc2$code)`5D function int_adj : integer; X begin X if (py.stat.cint > 117) then X int_adj := 7 X else if (py.stat.cint > 107) then X int_adj := 6 X else if (py.stat.cint > 87) then X int_adj := 5 X else if (py.stat.cint > 67) then X int_adj := 4 X else if (py.stat.cint > 17) then X int_adj := 3 X else if (py.stat.cint > 14) then X int_adj := 2 X else if (py.stat.cint > 7) then X int_adj := 1 X else X int_adj := 0; X end; X`20 X`20 X`7B Adjustment for charisma X Percent decrease or increase in price of goods `7D X`5Bpsect(misc2$code)`5D function chr_adj : real; X begin X if (py.stat.cchr > 117) then X chr_adj := -0.10 X else if (py.stat.cchr > 107) then X chr_adj := -0.08 X else if (py.stat.cchr > 87) then X chr_adj := -0.06 X else if (py.stat.cchr > 67) then X chr_adj := -0.04 X else if (py.stat.cchr > 18) then X chr_adj := -0.02 X else X case py.stat.cchr of X 18 : chr_adj := 0.00; X 17 : chr_adj := 0.01; X 16 : chr_adj := 0.02; X 15 : chr_adj := 0.03; X 14 : chr_adj := 0.04; X 13 : chr_adj := 0.06; X 12 : chr_adj := 0.08; X 11 : chr_adj := 0.10; X 10 : chr_adj := 0.12; X 9 : chr_adj := 0.14; X 8 : chr_adj := 0.16; X 7 : chr_adj := 0.18; X 6 : chr_adj := 0.20; X 5 : chr_adj := 0.22; X 4 : chr_adj := 0.24; X 3 : chr_adj := 0.25; X otherwise chr_adj := 0.00; `7B Error trap `7D X end; X end; X`20 X`20 X`7B Returns a character's adjustment to hit points `7D X`5Bpsect(misc2$code)`5D function con_adj : integer; X begin X with py.stat do X if (ccon = 3) then con_adj := -4 X else if (ccon = 4) then con_adj := -3 X else if (ccon = 5) then con_adj := -2 X else if (ccon = 6) then con_adj := -1 X else if (ccon < 17) then con_adj := 0 X else if (ccon = 17) then con_adj := 1 X else if (ccon < 94) then con_adj := 2 X else if (ccon < 117) then con_adj := 3 X else con_adj := 4 X end; X`20 X`20 X`7B Calculates hit points for each level that is gained. `7D X`5Bpsect(misc2$code)`5D function get_hitdie : integer; X var X i1 : integer; X begin X get_hitdie := randint(py.misc.hitdie) + con_adj; X end; X`20 X`20 X`7B Prints title of character `7D X`5Bpsect(misc5$code)`5D procedure prt_title; X begin X prt_field(py.misc.title,5,stat_column); X end; X`20 X`20 X`7B Prints strength `7D X`5Bpsect(misc5$code)`5D procedure prt_strength; X begin X prt_stat('',py.stat.cstr,7,stat_column+6); X end; X`20 X`20 X`7B Prints intelligence `7D X`5Bpsect(misc5$code)`5D procedure prt_intelligence; X begin X prt_stat('',py.stat.cint,8,stat_column+6); X end; X`20 X`20 X`7B Prints wisdom `7D X`5Bpsect(misc5$code)`5D procedure prt_wisdom; X begin X prt_stat('',py.stat.cwis,9,stat_column+6); X end; X`20 X`20 X`7B Prints dexterity `7D X`5Bpsect(misc5$code)`5D procedure prt_dexterity; X begin X prt_stat('',py.stat.cdex,10,stat_column+6); X end; X`20 X`20 X`7B Prints constitution `7D X`5Bpsect(misc5$code)`5D procedure prt_constitution; X begin X prt_stat('',py.stat.ccon,11,stat_column+6); X end; X`20 X`20 X`7B Prints charisma `7D X`5Bpsect(misc5$code)`5D procedure prt_charisma; X begin X prt_stat('',py.stat.cchr,12,stat_column+6); X end; X`20 X`20 X`20 X`7B Prints level `7D X`5Bpsect(misc5$code)`5D procedure prt_level; X begin `20 X prt_num( '',py.misc.lev,14,stat_column+6); X end; X`20 X`20 X`7B Prints players current (a real number...) and max mana points `7D X`5Bpsect(misc1$code)`5D procedure prt_mana; Xvar mwkdiv : real; Xbegin X mwkdiv:=py.misc.cmana/10; X if (mwkdiv < 1) then X indx:=2 X else X if (mwkdiv < 10) then X indx:=3 X else X indx:=4; X prt_num( '',trunc(py.misc.cmana),18,stat_column+6); X prt_num( '/',py.misc.mana,18,stat_column+5+indx); Xend; X`20 X `20 X`7B Prints Max hit points `7D X`5Bpsect(misc5$code)`5D procedure prt_mhp; X begin X prt_num( '',py.misc.mhp,17,stat_column+6); X end; X`20 X`20 X`7B Prints players current hit points (a real number...) `7D X`5Bpsect(misc1$code)`5D procedure prt_chp; X begin X prt_num( '',trunc(py.misc.chp),16,stat_column+6); X end; X`20 X`20 X`7B prints current AC `7D X`5Bpsect(misc5$code)`5D procedure prt_pac; X begin X prt_num( '',py.misc.dis_ac,19,stat_column+6); X end; X`20 X`20 X`7B Prints current gold `7D X`5Bpsect(misc5$code)`5D procedure prt_gold; X begin X prt_num( '',py.misc.au,20,stat_column+6); X end; `20 X `20 X`7B Prints current weight `7D X`5Bpsect(misc5$code)`5D procedure prt_cur_weight; X begin X prt_num( '',inven_weight,21,stat_column+6); X end; `20 X`20 X`7B Prints weight capacity `7D X`5Bpsect(misc5$code)`5D procedure prt_max_weight; X begin X max_weight:=weight_limit; X prt_num( '',max_weight,22,stat_column+6); X end; X`20 X`7B Prints depth in stat area `7D X`5Bpsect(misc5$code)`5D procedure prt_depth; X var X depths : vtype; X depth : integer; X begin X depth := dun_level*50; X if (depth = 0) then X depths := 'Town level' X else X writev(depths,'Depth: ',depth:1,' (feet)'); X prt(depths,24,61); X end; X`20 X`20 X`7B Prints status of hunger `7D X`5Bpsect(misc5$code)`5D procedure prt_hunger; X begin X if (uand(%X'000002',py.flags.status) <> 0) then X put_buffer('Weak ',24,1) X else if (uand(%X'000001',py.flags.status) <> 0) then X put_buffer('Hungry ',24,1) X else X put_buffer(' ',24,1); X end; X`20 X`20 X`7B Prints Blind status `7D X`5Bpsect(misc5$code)`5D procedure prt_blind; X begin X if (uand(%X'000004',py.flags.status) <> 0) then X put_buffer('Blind ',24,9) X else X put_buffer(' ',24,9); X end; X`20 X`20 X`7B Prints Confusion status `7D X`5Bpsect(misc5$code)`5D procedure prt_confused; X begin X if (uand(%X'000008',py.flags.status) <> 0) then X put_buffer('Confused ',24,16) X else X put_buffer(' ',24,16); X end; X`20 X`20 X`7B Prints Fear status `7D X`5Bpsect(misc5$code)`5D procedure prt_afraid; X begin X if (uand(%X'000010',py.flags.status) <> 0) then X put_buffer('Afraid ',24,26) X else X put_buffer(' ',24,26); X end; X `20 X`20 X`7B Prints Poisoned status `7D X`5Bpsect(misc5$code)`5D procedure prt_poisoned; X begin X if (uand(%X'000020',py.flags.status) <> 0) then X put_buffer('Poisoned ',24,34) X else X put_buffer(' ',24,34); X end; X`20 X`20 X`7B Prints Searching status `7D X`5Bpsect(misc5$code)`5D procedure prt_search; X begin X if (uand(%X'000100',py.flags.status) <> 0) then X put_buffer('Searching ',24,44) X else X put_buffer(' ',24,44); X end; X`20 X`20 X`7B Prints Resting status `7D X`5Bpsect(misc5$code)`5D procedure prt_rest; X begin X if (uand(%X'000200',py.flags.status) <> 0) then X put_buffer('Resting ',24,44) X else X put_buffer(' ',24,44); X end; X`20 X`20 X`7B Prints winner status on display `7D X`5Bpsect(misc5$code)`5D procedure prt_winner; X begin X put_buffer('*Winner*',23,1); X end; X`20 X`20 X`20 X`20 X`20 X`7B Increases a stat by one randomized level `7D X`5Bpsect(misc2$code)`5D function in_statp(stat : byteint) : byteint; X begin X if (stat < 18) then X stat := stat + 1 X else if (stat < 88) then X stat := stat + randint(25) X else if (stat < 108) then X stat := stat + randint(10) X else X stat := stat + 1; X if (stat > 118) then X stat := 118; X in_statp := stat; X end; X`20 X`20 X`7B Decreases a stat by one randomized level `7D X`5Bpsect(misc2$code)`5D function de_statp(stat : byteint) : byteint; X begin X if (stat < 19) then X stat := stat - 1 X else if (stat < 109) then X begin X stat := stat - randint(10) - 5; X if (stat < 18) then stat := 18; X end X else X stat := stat - randint(3); X if (stat < 3) then stat := 3; X de_statp := stat; X end; X`20 X`20 X`7B Increases a stat by one true level `7D X`5Bpsect(misc2$code)`5D function in_statt(stat : byteint) : byteint; X begin X if (stat < 18) then X stat := stat + 1 X else X begin X stat := stat + 10; X if (stat > 118) then X stat := 118; X end; X in_statt := stat; X end; X`20 X`20 X`7B Decreases a stat by true level `7D X`5Bpsect(misc2$code)`5D function de_statt(stat : byteint) : byteint; X begin X if (stat > 27) then X stat := stat - 10 X else if (stat > 18) then X stat := 18 X else X begin X stat := stat - 1; X if (stat < 3) then stat := 3; X end; X de_statt := stat; X end; X`20 X`20 X`7B Returns a character's adjustment to hit. `7D X`5Bpsect(misc2$code)`5D function tohit_adj : integer; X var X total : integer; X begin X with py.stat do X begin X if (cdex < 4) then total := -3 X else if (cdex < 6) then total := -2 X else if (cdex < 8) then total := -1 X else if (cdex < 16) then total := 0 X else if (cdex < 17) then total := 1 X else if (cdex < 18) then total := 2 X else if (cdex < 69) then total := 3 X else if (cdex < 118) then total := 4 X else total := 5; X if (cstr < 4) then total := total - 3 X else if (cstr < 5) then total := total - 2 X else if (cstr < 7) then total := total - 1 X else if (cstr < 18) then total := total + 0 X else if (cstr < 94) then total := total + 1 X else if (cstr < 109) then total := total + 2 X else if (cstr < 117) then total := total + 3 X else total := total + 4; X end; X tohit_adj := total; X end; X`20 X`20 X`7B Returns a character's adjustment to armor class `7D X`5Bpsect(misc2$code)`5D function toac_adj : integer; X begin X with py.stat do X if (cdex < 4) then toac_adj := -4 X else if (cdex = 4) then toac_adj := -3 X else if (cdex = 5) then toac_adj := -2 X else if (cdex = 6) then toac_adj := -1 X else if (cdex < 15) then toac_adj := 0 X else if (cdex < 18) then toac_adj := 1 X else if (cdex < 59) then toac_adj := 2 X else if (cdex < 94) then toac_adj := 3 X else if (cdex < 117) then toac_adj := 4 X else toac_adj := 5 X end; X`20 X`20 X`7B Returns a character's adjustment to disarm `7D X`5Bpsect(misc2$code)`5D function todis_adj : integer; X begin X with py.stat do X if (cdex = 3) then todis_adj := -8 X else if (cdex = 4) then todis_adj := -6 X else if (cdex = 5) then todis_adj := -4 X else if (cdex = 6) then todis_adj := -2 X else if (cdex = 7) then todis_adj := -1 X else if (cdex < 13) then todis_adj := 0 X else if (cdex < 16) then todis_adj := 1 X else if (cdex < 18) then todis_adj := 2 X else if (cdex < 59) then todis_adj := 4 X else if (cdex < 94) then todis_adj := 5 X else if (cdex < 117) then todis_adj := 6 X else todis_adj := 8 X end; X`20 X`20 X`7B Returns a character's adjustment to damage `7D +-+-+-+-+-+-+-+- END OF PART 34 +-+-+-+-+-+-+-+-