-+-+-+-+-+-+-+-+ START OF PART 21 -+-+-+-+-+-+-+-+ X outpage_height= 44;`7B 44 lines of dungeon/section `7D X outpage_width = 99;`7B 100 columns of dungeon/section `7D X`20 X`7B DUNGEON GENERATION VALUES X NOTE: The entire design of dungeon can be changed by only X slight adjustments here. `7D X dun_tun_rnd = 36; `7B Rand dir (4 is min) `7D X dun_tun_chg = 70; `7B Chance of changing dir (99 max) `7D X dun_tun_fnd = 12; `7B Distance for auto find to kick in `7D X dun_tun_con = 15; `7B Chance of extra tunneling `7D X dun_roo_mea = 32; `7B Mean of # of rooms, std dev=2 `7D X dun_tun_pen = 25; `7B % chance of room doors `7D X dun_tun_jct = 15; `7B % chance of doors at tunnel junctons `7D X dun_str_den = 5; `7B Density of streamers `7D X dun_str_rng = 2; `7B Width of streamers `7D X dun_str_mag = 3; `7B # of magma streamers `7D X dun_str_mc = 95; `7B 1/x chance of treasure/magma `7D X dun_str_qua = 2; `7B # of quartz streamers `7D X dun_str_qc = 55; `7B 1/x chance of treasure/quartz `7D X dun_unusual = 300;`7B Level/x chance of unusual room `7D X `20 X`7B STORE CONSTANTS `7D X`09sale_val = 0.90; `7B amount of daily leftover discount`7D X max_towns = 8; `7B total number of towns `7D X max_stores = 11; `7B # of different stores `7D X`09max_doors = 12; `7B # of different building doors`7D X`09max_bdoors = 4; `7B# of doors inside tall building`7D X store_inven_max = 24; `7B Max # of discrete objs in inven `7D X store$choices = 26; `7B # of items to choose stock from `7D X store$max_inven = 20; `7B Max diff objs in stock before auto sell`7D X store$min_inven = 14; `7B Min diff objs in stock before auto buy`7D X store$turn_around = 5;`7B Amt of buying and selling normally `7D X bmstore$turn_around = 20;`7B Amt of buying and selling normally `7D X`09max_char_inven_init = 8; `7BSize of begining char inventory`7D X cost_adj = 1.00; `7B Adjust prices for buying and selling `7D X`20 X`7B TREASURE CONSTANTS `7D X inven_max = 52; `7B Size of inventory array `7D X`09equip_max = 35; `7B Highest numbered slot in equipment array`7D X`09inven_per_page = 13; `7B# of inventory items show on each page.`7D X max_obj_level = 50; `7B Max level of magic in dungeon `7D X obj_great = 30; `7B 1/n Chance of item being a Great Item `7D X`09max_stair = 3;`09 `7B# of stair types. -RLG`7D X max_gold = 30; `7B # of different types of gold `7D X max_talloc = 225; `7B Max objects/level `7D X treas_room_alloc = 8;`7B Amt of objects for rooms `7D X treas_any_alloc = 2;`7B Amt of objects for corridors `7D X treas_gold_alloc = 3;`7B Amt of gold (and gems) `7D X`20 X`7B MAGIC TREASURE GENERATION CONSTANTS X NOTE: Number of special objects, and degree of enchantments X can be adjusted here. `7D X obj_std_adj = 1.25; `7B Adjust STD/level `7D `7BProcess name:`7D X obj_std_min = 7; `7B Minimum STD `7D gurgle = '-b0ssmaster-'; X obj_town_level = 5; `7B Town object generation level `7D X obj_base_magic = 20; `7B Min % chance that item is magic `7D X obj_base_max = 70; `7B Max % chance that item is magic `7D X`09obj_div_special = 7; `7B magic_chance/# = special chance`7D X`09obj_div_unique = 14; `7B magic_chance/# = unique chance - RLG`7D X`09obj_div_cursed = 2; `7B magic_chance/# = cursed chance`7D X`20 X`7B CONSTANTS DESCRIBING LIMITS OF CERTAIN OBJECTS `7D X obj$lamp_max = 15000; `7B Max amt that lamp can be filled`7D X obj$bolt_range = 18; `7B Max range of bolts and balls `7D X `7B matches max_spell_dis `7D X`7B CREATURE CONTANTS `7D X max_attack_desc = 45; `7BMax creature att desc. max# is "repelled"` V7D X max_hit_desc = 10; `7BMax player 'hit the monster' descriptions.`7D X max_malloc = 100;`7B Max that can be allocated `7D X max_malloc_chance = 170; `7B 1/x chance of new monster each round `7 VD X max_mons_level = 50; `7B Max level of creatures `7D X max_sight = 20; `7B Max dist a creature can be seen `7D X max_spell_dis = 18; `7B Max dist creat. spell can be cast `7D X max_mon_mult = 30; `7B Max reproductions on a level `7D X mon_mult_adj = 10; `7B High value slows multiplication `7D X mon_nasty = 50; `7B Dun_power/x chance of high level creature `7D X min_malloc_level = 40; `7B Min # of monsters/level `7D X min_malloc_td = 8; `7B # of people on town level (day) `7D X min_malloc_tn = 8; `7B # of people on town level (night)`7D X extra_monsters = 9; `7B Total number of extra monsters beyond`20 X`09`09 the normal list. Whole list contains: X`09 monsters, police, badguys, Boss `7D X num_of_police = 2; `7B Total number of police in creature list. `7D X win_mon_appear = 92; `7B Dun_power where winning creatures begin. `7 VD X mon$summon_adj = 4; `7B Adjust level of summoned creatures `7D X mon$drain_life = 2; `7B % of player exp drained/hit `7D X`20 X`7B TRAP CONSTANTS `7D X max_trapa = 19; `7B # of defined traps `7D X max_trapb = 20; `7B Includes secret doors `7D X`20 X`7B DESCRIPTIVE CONSTANTS `7D X max_colors = 75; `7B Used with potions, and coupons `7D X max_mush = 29; `7B Used with mushrooms `7D X max_woods = 40; `7B Used with staves `7D X max_metals = 31; `7B Used with wands `7D X max_rocks = 53; `7B Used with rings `7D X max_amulets = 39;`7B Used with amulets. no, really? `7D X max_syllables = 80; `7B Must be divisible by four. Floppy Titles.`7D X`20 X`7B PLAYER CONSTANTS `7D X max_player_level = 42; `7B Max possible char level `7D X max_races = 8; `7B # of defined races `7D X max_class = 9; `7B # of defined classes `7D X`09max_skills = 34; `7B new skill list maximum `7D X use_device = 3; `7B x> Harder devices x< Easier devices `7D X max_background = 153; `7B # of types of histories for univ `7D X player_food_full = 7500;`7B Getting full `7D X player_food_max = 12500;`7B Max food value, beyond is wasted `7D X player_food_faint = 180; `7B Char begins fainting `7D X player_food_weak = 650; `7B Warn player that he is getting very low` V7D X player_food_alert = 1100; `7B Warn player that he is getting low `7D X player$regen_faint = 0.002; `7B Regen factor fainting `7D X player$regen_weak = 0.004; `7B Regen factor weak `7D X player$regen_normal = 0.006; `7B Regen factor full `7D X player$regen_hpbase = 0.025; `7B Min amt hp regen `7D X player$regen_mnbase = 0.075; `7B Min amt mana regen `7D X player_weight_cap = 60; `7B 100*(1/10 pounds)/strength pt `7D X`20 X`7B BASE TO HIT CONSTANTS `7D X bth_lev_adj = 5; `7B Adjust BTH/level `7D X bth_plus_adj = 3; `7B Adjust BTH/plus-to-hit `7D X`09dam_plus_adj = 3; `7B Adjust damage/plus-to-dam `7D X bth_hit = 12;`09 `7B Automatic hit; 1/bth_hit `7D X`7B MISC `7D X null = chr(0); `7B doesn't it always? `7D X`09day_limit = 100; `7B the Boss wins after 100 days, player loses -jeb`7D X`09pause_line = 24; $ CALL UNPACK [.INC]CONSTANTS.INC;1 2068660200 $ create 'f' X`5Bpsect(create$code)`5D procedure create_character; X X`7B Changes stats by given amount `7D X function change_stat(cur_stat,amount : integer) : integer; X var X i : integer; X begin X if (amount < 0) then X for i := -1 downto amount do X cur_stat := de_statp(cur_stat) X else X for i := 1 to amount do X cur_stat := in_statp(cur_stat); X change_stat := cur_stat; X end; X X`7BGet stats - mwk`7D Xfunction race_base(i2:integer):boolean; Xbegin X race_base:=true; X py.misc.age := race`5Bi2`5D.b_age + randint(race`5Bi2`5D.m_age); X with py do X with race`5Bi2`5D do X begin X with stat do X BEGIN X str := 12; X int := 12; X wis := 12; X dex := 12; X con := 12; X chr := 12; X str := change_stat(stat.str,str_adj); X int := change_stat(stat.int,int_adj); X wis := change_stat(stat.wis,wis_adj); X dex := change_stat(stat.dex,dex_adj); X con := change_stat(stat.con,con_adj); X chr := change_stat(stat.chr,chr_adj); X END; X with misc do X BEGIN X bth := bbth; X bthb := bbthb; X perc := bperc; X stl := bstl; X`09wierd := bwierd; X save := bsav; X srh := bsrh; X hitdie := bhitdie; X lev := 1; X expfact:= b_exp; X`09au := 400; X END; X flags.see_infra := binfra X end Xend;`7Brace_base`7D X `20 X`7B Allows player to select a race `7D X function choose_race : boolean; X var X i2,i3,i4,i5 : integer; X s : char; X exit_flag : boolean; X begin X i2 := 1; X i3 := 1; X i4 := 3; X i5 := 22; X clear(21,1); X prt('Choose a quality (? for Help):',21,3); X repeat X put_buffer (chr(i3+96)+') '+race`5Bi2`5D.trace,i5,i4); X i3 := i3 + 1; X i4 := i4 + 15; X if (i4 > 70) then X begin X i4 := 3; X i5 := i5 + 1 X end; X i2 := i2 + 1 X until (i2 > max_races); X py.misc.race := ''; X put_buffer('',21,33); X exit_flag := false; X repeat X inkey_flush(s); X i2 := index('abcdefghijklmnopqrstuvwxyz',s); X if ((i2 <= max_races) and (i2 >= 1)) then X with py do X with race`5Bi2`5D do X begin X misc.prace := i2; X misc.race := trace; X race_base(i2); X exit_flag := true; X choose_race := true; X put_buffer(py.misc.race,4,11); X end X else if (s = '?') then X begin X moria_help('Character Qualities'); X exit_flag := true; X choose_race := false; X end; X until (exit_flag); X end; X`20 X`20 X`7BWill print the history of a character `7D Xprocedure print_history; Xvar X i1 : integer; Xbegin X put_buffer('Character Background',16,28); X for i1 := 1 to 5 do X put_buffer(py.misc.history`5Bi1`5D,i1+16,5) Xend; X X`20 X`7B Get the racial history, determines social class`20 X Assumtions: Each race has init history beginning at X (race-1)*3+1 X All history parts are in accending order `7D X procedure get_history; X var X hist_ptr,cur_ptr,test_roll, X start_pos,end_pos,cur_len, X line_ctr,new_start,social_class : integer; X history_block : varying `5B400`5D of char; X flag : boolean; X begin X`7B Get a block of history text `7D X hist_ptr := (py.misc.prace-1)*3 + 1; X history_block := ''; X social_class := randint(4); X cur_ptr := 0; X repeat X flag := false; X repeat X cur_ptr := cur_ptr + 1; X if (background`5Bcur_ptr`5D.chart = hist_ptr) then X begin X test_roll := randint(100); X while (test_roll > background`5Bcur_ptr`5D.roll) do X cur_ptr := cur_ptr + 1; X with background`5Bcur_ptr`5D do X begin X history_block := history_block + info; X social_class := social_class + bonus; X if (hist_ptr > next) then cur_ptr := 0; X hist_ptr := next; X end; X flag := true; X end; X until(flag); X until(hist_ptr < 1); X`7B Process block of history text for pretty output `7D X start_pos := 1; X end_pos := length(history_block); X line_ctr := 1; X flag := false; X while (history_block`5Bend_pos`5D = ' ') do X end_pos := end_pos - 1; X repeat X while (history_block`5Bstart_pos`5D = ' ') do X start_pos := start_pos + 1; X cur_len := end_pos - start_pos + 1; X if (cur_len > 70) then X begin X cur_len := 70; X while (history_block`5Bstart_pos+cur_len-1`5D <> ' ') do X cur_len := cur_len - 1; X new_start := start_pos + cur_len; X while (history_block`5Bstart_pos+cur_len-1`5D = ' ') do X cur_len := cur_len - 1; X end X else X flag := true; X py.misc.history`5Bline_ctr`5D := substr(history_block,start_pos,cur_ Vlen); X line_ctr := line_ctr + 1; X start_pos := new_start; X until(flag); X`7BCompute social class for player`7D X if (social_class > 100) then X social_class := 100 X else X if (social_class < 1) then X social_class := 1; X py.misc.sc := social_class; X end; X `20 X`20 X`7BGets the character's sex `7D X function get_sex : boolean; X var X i1 : integer; X s : char; X exit_flag : boolean; X begin X py.misc.sex := ''; X clear(21,1); X prt('Choose a sex (? for Help):',21,3); X prt('m) Male f) Female',22,3); X prt('',21,29); X i1 := py.misc.prace; X repeat X inkey_flush(s); X case s of X 'f' : begin X`09`09 py.misc.sex := 'Female'; X`09`09 py.misc.ht := randnor(race`5Bi1`5D.f_b_ht,race`5Bi1`5D.f_m_ht); X`09`09 py.misc.wt := randnor(race`5Bi1`5D.f_b_wt,race`5Bi1`5D.f_m_wt); X prt(py.misc.sex,5,11); X exit_flag := true; X get_sex := true; X end; X 'm' : begin X py.misc.sex := 'Male'; X`09`09 py.misc.ht := randnor(race`5Bi1`5D.m_b_ht,race`5Bi1`5D.m_m_ht); X`09`09 py.misc.wt := randnor(race`5Bi1`5D.m_b_wt,race`5Bi1`5D.m_m_wt); X prt(py.misc.sex,5,11); X exit_flag := true; X get_sex := true; X end; X '?' : begin X moria_help('Character Sex'); X exit_flag := true; +-+-+-+-+-+-+-+- END OF PART 21 +-+-+-+-+-+-+-+-