-+-+-+-+-+-+-+-+ START OF PART 33 -+-+-+-+-+-+-+-+ X`09 13 : chr_adj := 0.06; X`09 12 : chr_adj := 0.08; X`09 11 : chr_adj := 0.10; X`09 10 : chr_adj := 0.12; X`09 9 : chr_adj := 0.14; X`09 8 : chr_adj := 0.16; X`09 7 : chr_adj := 0.18; X`09 6 : chr_adj := 0.20; X`09 5 : chr_adj := 0.22; X`09 4 : chr_adj := 0.24; X`09 3 : chr_adj := 0.25; X`09 otherwise chr_adj := 0.00; `7B Error trap `7D X`09end; X end; X X X`09`7B Returns a character's adjustment to hit points -JWT- `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 X X`09`7B Calculates hit points for each level that is gained.`09-RAK-`09`7D X`5Bpsect(misc2$code)`5D function get_hitdie : integer; X var X`09i1 : integer; X begin X get_hitdie := randint(py.misc.hitdie) + con_adj; X end; X X X`09`7B Prints title of character`09`09`09`09-RAK-`09`7D X`5Bpsect(misc5$code)`5D procedure prt_title; X begin X prt_field(py.misc.title,5,stat_column); X end; X X X`09`7B Prints strength`09`09`09`09`09-RAK-`09`7D X`5Bpsect(misc5$code)`5D procedure prt_strength; X begin X prt_stat('',py.stat.cstr,7,stat_column+6); X end; X X X`09`7B Prints intelligence`09`09`09`09`09-RAK-`09`7D X`5Bpsect(misc5$code)`5D procedure prt_intelligence; X begin X prt_stat('',py.stat.cint,8,stat_column+6); X end; X X X`09`7B Prints wisdom `09`09`09`09`09-RAK-`09`7D X`5Bpsect(misc5$code)`5D procedure prt_wisdom; X begin X prt_stat('',py.stat.cwis,9,stat_column+6); X end; X X X`09`7B Prints dexterity`09`09`09`09`09-RAK-`09`7D X`5Bpsect(misc5$code)`5D procedure prt_dexterity; X begin X prt_stat('',py.stat.cdex,10,stat_column+6); X end; X X X`09`7B Prints constitution`09`09`09`09`09-RAK-`09`7D X`5Bpsect(misc5$code)`5D procedure prt_constitution; X begin X prt_stat('',py.stat.ccon,11,stat_column+6); X end; X X X`09`7B Prints charisma`09`09`09`09`09-RAK-`09`7D X`5Bpsect(misc5$code)`5D procedure prt_charisma; X begin X prt_stat('',py.stat.cchr,12,stat_column+6); X end; X X X X`09`7B Prints level`09`09`09`09`09`09-RAK-`09`7D X`5Bpsect(misc5$code)`5D procedure prt_level; X begin X prt_num( '',py.misc.lev,14,stat_column+6); X end; X X X`09`7B Prints players current mana points (a real number...) -RAK-`09`7D X`5Bpsect(misc1$code)`5D procedure prt_cmana; X begin X prt_num( '',trunc(py.misc.cmana),16,stat_column+6); X end; X X X`09`7B Prints Max hit points `09`09`09`09-RAK-`09`7D X`5Bpsect(misc5$code)`5D procedure prt_mhp; X begin X prt_num( '',py.misc.mhp,17,stat_column+6); X end; X X X`09`7B Prints players current hit points (a real number...)`09-RAK-`09`7D X`5Bpsect(misc1$code)`5D procedure prt_chp; X begin X prt_num( '',trunc(py.misc.chp),18,stat_column+6); X end; X X X`09`7B prints current AC`09`09`09`09`09-RAK-`09`7D X`5Bpsect(misc5$code)`5D procedure prt_pac; X begin X prt_num( '',py.misc.dis_ac,20,stat_column+6); X end; X X X`09`7B Prints current gold`09`09`09`09`09-RAK-`09`7D X`5Bpsect(misc5$code)`5D procedure prt_gold; X begin X prt_num( '',py.misc.au,21,stat_column+6); X end; X X X`09`7B Prints depth in stat area`09`09`09`09-RAK-`09`7D X`5Bpsect(misc5$code)`5D procedure prt_depth; X var X`09`09depths : vtype; X`09`09depth : integer; X begin X`09depth := dun_level*50; X`09if (depth = 0) then X`09 depths := 'Town level' X`09else X`09 writev(depths,'Depth: ',depth:1,' (feet)'); X`09prt(depths,24,61); X end; X X X`09`7B Prints status of hunger`09`09`09`09-RAK-`09`7D X`5Bpsect(misc5$code)`5D procedure prt_hunger; X begin X if (uand(%X'000002',py.flags.status) <> 0) then X`09put_buffer('Weak ',24,1) X else if (uand(%X'000001',py.flags.status) <> 0) then X`09put_buffer('Hungry ',24,1) X else X`09put_buffer(' ',24,1); X end; X X X`09`7B Prints Blind status`09`09`09`09`09-RAK-`09`7D X`5Bpsect(misc5$code)`5D procedure prt_blind; X begin X if (uand(%X'000004',py.flags.status) <> 0) then X`09put_buffer('Blind ',24,9) X else X`09put_buffer(' ',24,9); X end; X X X`09`7B Prints Confusion status`09`09`09`09-RAK-`09`7D X`5Bpsect(misc5$code)`5D procedure prt_confused; X begin X if (uand(%X'000008',py.flags.status) <> 0) then X`09put_buffer('Confused ',24,16) X else X`09put_buffer(' ',24,16); X end; X X X`09`7B Prints Fear status`09`09`09`09`09-RAK-`09`7D X`5Bpsect(misc5$code)`5D procedure prt_afraid; X begin X if (uand(%X'000010',py.flags.status) <> 0) then X`09put_buffer('Afraid ',24,26) X else X`09put_buffer(' ',24,26); X end; X X X`09`7B Prints Poisoned status`09`09`09`09-RAK-`09`7D X`5Bpsect(misc5$code)`5D procedure prt_poisoned; X begin X if (uand(%X'000020',py.flags.status) <> 0) then X`09put_buffer('Poisoned ',24,34) X else X`09put_buffer(' ',24,34); X end; X X X`09`7B Prints Searching status`09`09`09`09-RAK-`09`7D X`5Bpsect(misc5$code)`5D procedure prt_search; X begin X if (uand(%X'000100',py.flags.status) <> 0) then X`09put_buffer('Searching ',24,44) X else X`09put_buffer(' ',24,44); X end; X X X`09`7B Prints Resting status `09`09`09`09-RAK-`09`7D X`5Bpsect(misc5$code)`5D procedure prt_rest; X begin X if (uand(%X'000200',py.flags.status) <> 0) then X`09put_buffer('Resting ',24,44) X else X`09put_buffer(' ',24,44); X end; X X X`09`7B Prints winner status on display`09`09`09-RAK-`09`7D X`5Bpsect(misc5$code)`5D procedure prt_winner; X begin X put_buffer('*Winner*',23,1); X end; X X X X X X`09`7B Increases a stat by one randomized level`09`09-RAK-`09`7D X`5Bpsect(misc2$code)`5D function in_statp(stat : byteint) : byteint; X begin X if (stat < 18) then X`09stat := stat + 1 X else if (stat < 88) then X`09stat := stat + randint(25) X else if (stat < 108) then X`09stat := stat + randint(10) X else X`09stat := stat + 1; X if (stat > 118) then X`09stat := 118; X in_statp := stat; X end; X X X`09`7B Decreases a stat by one randomized level`09`09-RAK-`09`7D X`5Bpsect(misc2$code)`5D function de_statp(stat : byteint) : byteint; X begin X if (stat < 19) then X`09stat := stat - 1 X else if (stat < 109) then X`09begin X`09 stat := stat - randint(10) - 5; X`09 if (stat < 18) then stat := 18; X`09end X else X`09stat := stat - randint(3); X if (stat < 3) then stat := 3; X de_statp := stat; X end; X X X`09`7B Increases a stat by one true level`09`09`09-RAK-`09`7D X`5Bpsect(misc2$code)`5D function in_statt(stat : byteint) : byteint; X begin X if (stat < 18) then X`09stat := stat + 1 X else X`09begin X`09 stat := stat + 10; X`09 if (stat > 118) then X`09 stat := 118; X`09end; X in_statt := stat; X end; X X X`09`7B Decreases a stat by true level`09`09`09-RAK-`09`7D X`5Bpsect(misc2$code)`5D function de_statt(stat : byteint) : byteint; X begin X if (stat > 27) then X`09stat := stat - 10 X else if (stat > 18) then X`09stat := 18 X else X`09begin X`09 stat := stat - 1; X`09 if (stat < 3) then stat := 3; X`09end; X de_statt := stat; X end; X X X`09`7B Returns a character's adjustment to hit. -JWT- `7D X`5Bpsect(misc2$code)`5D function tohit_adj : integer; X var X`09total : integer; X begin X with py.stat do X begin X`09if (cdex < 4) then total := -3 X`09else if (cdex < 6) then total := -2 X`09else if (cdex < 8) then total := -1 X`09else if (cdex < 16) then total := 0 X`09else if (cdex < 17) then total := 1 X`09else if (cdex < 18) then total := 2 X`09else if (cdex < 69) then total := 3 X`09else if (cdex < 118) then total := 4 X`09else total := 5; X`09if (cstr < 4) then total := total - 3 X`09else if (cstr < 5) then total := total - 2 X`09else if (cstr < 7) then total := total - 1 X`09else if (cstr < 18) then total := total + 0 X`09else if (cstr < 94) then total := total + 1 X`09else if (cstr < 109) then total := total + 2 X`09else if (cstr < 117) then total := total + 3 X`09else total := total + 4; X end; X tohit_adj := total; X end; X X X`09`7B Returns a character's adjustment to armor class -JWT- `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 X X`09`7B Returns a character's adjustment to disarm -RAK- `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 X X`09`7B Returns a character's adjustment to damage -JWT- `7D X`5Bpsect(misc2$code)`5D function todam_adj : integer; X begin X with py.stat do X if (cstr < 4) then todam_adj := -2 X else if (cstr < 5) then todam_adj := -1 X else if (cstr < 16) then todam_adj := 0 X else if (cstr < 17) then todam_adj := 1 X else if (cstr < 18) then todam_adj := 2 X else if (cstr < 94) then todam_adj := 3 X else if (cstr < 109) then todam_adj := 4 X else if (cstr < 117) then todam_adj := 5 X else todam_adj := 6; X end; X X X`09`7B Pre-declaration of PRT_EXPERIENCE`09`09`09-RAK-`09`7D X`5Bpsect(misc5$code)`5D procedure prt_experience; X`09forward; X X X`09`7B Prints character-screen info`09`09`09`09-RAK-`09`7D X`5Bpsect(misc5$code)`5D procedure prt_stat_block; X begin X prt_field(py.misc.race, 3,stat_column); X prt_field(py.misc.tclass, 4,stat_column); X prt_field(py.misc.title, 5,stat_column); X prt_stat('STR : ',py.stat.cstr, 7,stat_column); X prt_stat('INT : ',py.stat.cint, 8,stat_column); X prt_stat('WIS : ',py.stat.cwis, 9,stat_column); X prt_stat('DEX : ',py.stat.cdex, 10,stat_column); X prt_stat('CON : ',py.stat.ccon, 11,stat_column); X prt_stat('CHR : ',py.stat.cchr, 12,stat_column); X prt_num( 'LEV : ',py.misc.lev, 14,stat_column); X prt_num( 'EXP : ',py.misc.exp, 15,stat_column); X prt_num( 'MANA: ',trunc(py.misc.cmana),16,stat_column); X prt_num( 'MHP : ',py.misc.mhp, 17,stat_column); X prt_num( 'CHP : ',trunc(py.misc.chp), 18,stat_column); X prt_num( 'AC : ',py.misc.dis_ac, 20,stat_column); X prt_num( 'GOLD: ',py.misc.au, 21,stat_column); X if (total_winner) then prt_winner; X if (uand(%X'000003',py.flags.status) <> 0) then X`09prt_hunger; X if (uand(%X'000004',py.flags.status) <> 0) then X`09prt_blind; X if (uand(%X'000008',py.flags.status) <> 0) then X`09prt_confused; X if (uand(%X'000010',py.flags.status) <> 0) then X`09prt_afraid; X if (uand(%X'000020',py.flags.status) <> 0) then X`09prt_poisoned; X if (uand(%X'000100',py.flags.status) <> 0) then X`09prt_search; X if (uand(%X'000200',py.flags.status) <> 0) then X`09prt_rest; X end; X X X`09`7B Draws entire screen`09`09`09`09`09-RAK-`09`7D X`5Bpsect(misc5$code)`5D procedure draw_cave; X begin X clear(1,1); X prt_stat_block; X prt_map; X prt_depth; X end; X X X`09`7B Prints the following information on the screen.`09-JWT-`09`7D X`5Bpsect(create$code)`5D procedure put_character; X begin X clear(1,1); X with py.misc do X`09begin X`09 prt('Name : ' + name,3,3); X`09 prt('Race : ' + race,4,3); X`09 prt('Sex : ' + sex,5,3); X`09 prt('Class : ' + tclass,6,3) X`09end X end; X X X`09`7B Prints the following information on the screen.`09-JWT-`09`7D X`5Bpsect(create$code)`5D procedure put_stats; X begin X with py do X`09begin X`09 prt_stat('STR : ',stat.cstr,3,65); X`09 prt_stat('INT : ',stat.cint,4,65); X`09 prt_stat('WIS : ',stat.cwis,5,65); X`09 prt_stat('DEX : ',stat.cdex,6,65); X`09 prt_stat('CON : ',stat.ccon,7,65); X`09 prt_stat('CHR : ',stat.cchr,8,65); X`09 prt_num('+ To Hit : ',misc.dis_th,10,4); X`09 prt_num('+ To Damage: ',misc.dis_td,11,4); X`09 prt_num('+ To AC : ',misc.dis_tac,12,4); X`09 prt_num(' Total AC : ',misc.dis_ac,13,4); X`09end X end; X X X`09`7B Returns a rating of x depending on y`09`09`09-JWT-`09`7D X`5Bpsect(create$code)`5D function likert(x,y : integer) : btype; X begin X`09case trunc(x/y) of X`09 -3,-2,-1 : likert := 'Very Bad'; X`09 0,1 : likert := 'Bad'; X`09 2 : likert := 'Poor'; X`09 3,4 : likert := 'Fair'; X`09 5 : likert := 'Good'; X`09 6 : likert := 'Very Good'; X`09 7,8 : likert := 'Superb'; X`09 otherwise likert := 'Excellent'; X`09end X end; X X +-+-+-+-+-+-+-+- END OF PART 33 +-+-+-+-+-+-+-+-