-+-+-+-+-+-+-+-+ START OF PART 16 -+-+-+-+-+-+-+-+ X`09`09 tmp_str := substr(tmp_str,length(tmp_str)-1,2); X`09`09 cursor_r`5Bi1`5D := escape + '`5B' + tmp_str; `7B Row part `7D X`09`09 end; X`09`09 for i1 := 1 to 80 do X`09`09 begin X`09`09 writev(tmp_str,'00',i1:1); `7B Col chars`7D X`09`09 tmp_str := substr(tmp_str,length(tmp_str)-1,2); X`09`09 cursor_c`5Bi1`5D := ';' + tmp_str + 'H'; `7B Col part `7D X`09`09 end; X`09`09end; X`09otherwise X`09`09begin X`09`09 writeln('*** ERROR : Terminal not supported ***'); X`09`09 writeln('See TERMDEF.PAS for definning new terminals.'); X`09`09 writeln('*** Terminals supported:'); X`09`09 writeln(' VT52 Set Terminal/VT52'); X`09`09 writeln(' VT100 Set Terminal/VT100'); X`09`09 writeln(' Teleray 10 Set Terminal/FT1'); X`09`09 writeln(' ADM-3A Set Terminal/FT2'); X`09`09 writeln(' ADDS100 Set Terminal/FT3'); X`09`09 writeln(' IBM3101 Set Terminal/FT4'); X`09`09 writeln; X`09`09 exit; X`09`09end; X end; X end; Xend. $ CALL UNPACK [.SOURCE]TERMDEF.PAS;1 391411192 $ create 'f' Xconst X`09`7BNote to the Wizard: `7D X`09`7B Tweaking these constants can *GREATLY* change the game. `7D X`09`7B Two years of constant tuning have generated these `7D X`09`7B values. Minor adjustments are encouraged, but you must `7D X`09`7B be very careful not to unbalance the game. Moria was `7D X`09`7B meant to be challenging, not a give away. Many `7D X`09`7B adjustments can cause the game to act strangely, or even`7D X`09`7B cause errors. `7D X X`09`7B Current version number of Moria`09`09`09`09`7D X`09cur_version = 4.8; X X`09`7B QIOW constants, see $IODEF in STARLET.MLB`09`09`09`7D X`09IO$_WRITEVBLK = %B'0000000000110000'; `7B 48D, 0030H `7D X`09IO$_TTYREADALL= %B'0000000000111010'; `7B 58D, 003AH `7D X`09IO$M_NOECHO = %B'0000000001000000'; `7B 64D, 0040H `7D X`09IO$M_NOWAIT = %B'0000000010000000'; `7B 128D, 0080H `7D X`09IO$M_PURGE = %B'0000100000000000'; `7B2048D, 0800H `7D X`09IO$MOR_OUTPUT = IO$_WRITEVBLK; X`09IO$MOR_INPUT = IO$_TTYREADALL + IO$M_NOECHO; X`09IO$MOR_DELAY = IO$MOR_INPUT + IO$M_NOWAIT; X`09IO$MOR_IPURGE = IO$MOR_DELAY + IO$M_PURGE; X X`09`7B IO bug exists at high baud rates (baud >= 9600). This bug`09`7D X`09`7B is believed to be in the device driver. It can be avoided by `7D X`09`7B hibernating the process a small amount of time before perform-`7D X`09`7B ing a QIOW read operation. -RAK- `7D X`09`7B This constant no longer used after VMS 4.0 `7D X`09IO$MOR_IOPAUSE= 5; `7B x/100 seconds of sleep before inkey `7D X X`09`7B Encryption constants`09`09`09`09`09`09`7D X`09`7B Note: These numbers were pulled from the air, and can be `7D X`09`7B changed. If changed, characters produced from other `7D X`09`7B versions will fail to restore. `7D X`09encrypt_seed1 = 1175191; X`09encrypt_seed2 = 997551771; X X`09`7B Dungeon size parameters`09`09`09`09`09`7D X`09max_height = 66; `7B Multiple of 11; >= 22 `7D X`09max_width = 198; `7B Multiple of 33; >= 66 `7D X`09screen_height = 22; X`09screen_width = 66; X X`09`7B Output dungeon section sizes`09`09`09`09`09`7D X`09outpage_height= 44; `7B 44 lines of dungeon per section `7D X`09outpage_width = 99; `7B 100 columns of dungeon per section `7D X X`09`7B Dungeon generation values`09`09`09`09`09`7D X`09`7B Note: The entire design of dungeon can be changed by only `7D X`09`7B slight adjustments here. `7D X`09dun_tun_rnd = 36; `7B Random direction (4 is min) `7D X`09dun_tun_chg = 70; `7B Chance of changing direction (99 max) `7D X`09dun_tun_fnd = 12; `7B Distance for auto find to kick in `7D X`09dun_tun_con = 15; `7B Chance of extra tunneling `7D X`09dun_roo_mea = 32; `7B Mean of # of rooms, standard dev=2 `7D X`09dun_tun_pen = 25; `7B % chance of room doors `7D X`09dun_tun_jct = 15; `7B % chance of doors at tunnel junctons `7D X`09dun_str_den = 5; `7B Density of streamers `7D X`09dun_str_rng = 2; `7B Width of streamers `7D X`09dun_str_mag = 3; `7B Number of magma streamers `7D X`09dun_str_mc = 95; `7B 1/x chance of treasure per magma `7D X`09dun_str_qua = 2; `7B Number of quartz streamers `7D X`09dun_str_qc = 55; `7B 1/x chance of treasure per quartz `7D X`09dun_unusual = 300; `7B Level/x chance of unusual room `7D X X`09`7B Store constants`09`09`09`09`09`09`7D X`09max_owners = 18; `7B Number of owners to choose from `7D X`09max_stores = 6; `7B Number of different stores `7D X`09store_inven_max = 24; `7B Max number of discrete objs in inven `7D X`09store$choices = 26; `7B Number of items to choice stock from `7D X`09store$max_inven = 20; `7B Max diff objs in stock before auto sell`7D X`09store$min_inven = 14; `7B Min diff objs in stock before auto buy`7D X`09store$turn_around= 3; `7B Amount of buying and selling normally `7D X`09inven_init_max = 105; `7B Size of store init array `7D X`09cost_adj = 1.00; `7B Adjust prices for buying and selling `7D X X`09`7B Treasure constants`09`09`09`09`09`09`7D X`09inven_max = 35; `7B Size of inventory array(Do not change)`7D X`09max_obj_level = 50; `7B Maximum level of magic in dungeon `7D X`09obj_great = 20; `7B 1/n Chance of item being a Great Item `7D X`09max_objects = 344; `7B Number of objects for universe `7D X`09max_gold = 18; `7B Number of different types of gold `7D X`09max_talloc = 225; `7B Max objects per level `7D X`09treas_room_alloc = 7; `7B Amount of objects for rooms `7D X`09treas_any_alloc = 2; `7B Amount of objects for corridors `7D X`09treas_gold_alloc = 2; `7B Amount of gold (and gems) `7D X X`09`7B Magic Treasure Generation constants`09`09`09`09`7D X`09`7B Note: Number of special objects, and degree of enchantments `7D X`09`7B can be adjusted here. `7D X`09obj_std_adj = 1.25; `7B Adjust STD per level `7D X`09obj_std_min = 7; `7B Minimum STD `7D X`09obj_town_level = 7; `7B Town object generation level `7D X`09obj_base_magic = 15; `7B Base amount of magic `7D X`09obj_base_max = 70; `7B Max amount of magic `7D X`09obj_div_special = 6; `7B magic_chance/# = special magic `7D X`09obj_div_cursed = 1.3; `7B magic_chance/# = cursed items `7D X X`09`7B Constants describing limits of certain objects`09`09`7D X`09obj$lamp_max =15000; `7B Maximum amount that lamp can be filled`7D X`09obj$bolt_range = 18; `7B Maximum range of bolts and balls `7D X`09obj$rune_prot = 3000; `7B Rune of protection resistance `7D X X`09`7B Creature contants`09`09`09`09`09`09`7D X`09max_creatures = 279; `7B Number of creatures defined for univ `7D X`09max_malloc = 100 + 1;`7B Max that can be allocated `7D X`09max_malloc_chance= 160; `7B 1/x chance of new monster each round `7D X`09max_mons_level = 40; `7B Maximum level of creatures `7D X`09max_sight = 20; `7B Maximum dis a creature can be seen `7D X`09max_spell_dis = 20; `7B Maximum dis creat. spell can be cast `7D X`09max_mon_mult = 75; `7B Maximum reproductions on a level `7D X`09mon_mult_adj = 7; `7B High value slows multiplication `7D X`09mon_nasty = 50; `7B Dun_level/x chance of high level creat`7D X`09min_malloc_level = 14; `7B Minimum number of monsters/level `7D X`09min_malloc_td = 4; `7B Number of people on town level (day) `7D X`09min_malloc_tn = 8; `7B Number of people on town level (night)`7D X`09win_mon_tot = 2; `7B Total number of "win" creatures `7D X`09win_mon_appear = 50; `7B Level where winning creatures begin `7D X`09mon$summon_adj = 2; `7B Adjust level of summoned creatures `7D X`09mon$drain_life = 2; `7B Percent of player exp drained per hit `7D X X`09`7B Trap constants`09`09`09`09`09`09`7D X`09max_trapa = 18; `7B Number of defined traps `7D X`09max_trapb = 19; `7B Includes secret doors `7D X X`09`7B Descriptive constants `09`09`09`09`09`7D X`09max_colors = 67; `7B Used with potions `7D X`09max_mush = 29; `7B Used with mushrooms `7D X`09max_woods = 41; `7B Used with staffs `7D X`09max_metals = 31; `7B Used with wands `7D X`09max_rocks = 52; `7B Used with rings `7D X`09max_amulets = 39; `7B Used with amulets `7D X`09max_syllables = 153; `7B Used with scrolls `7D X X`09`7B Player constants`09`09`09`09`09`09`7D X`09max_player_level = 40; `7B Maximum possible character level `7D X`09max_races = 8; `7B Number of defined races `7D X`09max_class = 6; `7B Number of defined classes `7D X`09use_device = 3; `7B x> Harder devices x< Easier devices `7D X`09max_background = 128; `7B Number of types of histories for univ `7D X`09player_food_full =10000;`7B Getting full `7D X`09player_food_max =15000;`7B Maximum food value, beyond is wasted `7D X`09player_food_faint= 300;`7B Character begins fainting `7D X`09player_food_weak = 1000;`7B Warn player that he is getting very low`7D X`09player_food_alert= 2000;`7B Warn player that he is getting low `7D X`09player$regen_faint = 0.0005; `7B Regen factor when fainting `7D X`09player$regen_weak = 0.0015; `7B Regen factor when weak `7D X`09player$regen_normal = 0.0030; `7B Regen factor when full `7D X`09player$regen_hpbase = 0.0220; `7B Min amount hp regen `7D X`09player$regen_mnbase = 0.0080; `7B Min amount mana regen `7D X`09player_weight_cap= 130; `7B "#"*(1/10 pounds) per strength point `7D X`09player_exit_pause= 6; `7B Pause time before player can re-roll `7D X X`09`7B Base to hit constants `09`09`09`09`09`7D X`09bth_lev_adj = 3; `7B Adjust BTH per level `7D X`09bth_plus_adj = 3; `7B Adjust BTH per plus-to-hit `7D X`09bth_hit = 12; `7B Automatic hit; 1/bth_hit `7D X X`09`7B Misc`09`09`09`09`09`09`09`09`7D X`09null = chr(0); $ CALL UNPACK [.SOURCE.INCLUDE]CONSTANTS.INC;1 1348909639 $ create 'f' X`5Bpsect(create$code)`5D procedure create_character; X X X`09`7B Generates character's stats`09`09`09`09-JWT-`09`7D X function get_stat : integer; X var X`09i,j : integer; X begin X i := randint(4) + randint(4) + randint(4) + 5; X get_stat := i X end; X X X`09`7B Changes stats by given amount`09`09`09`09-JWT-`09`7D X function change_stat(cur_stat,amount : integer) : integer; X var X`09i : integer; X begin X if (amount < 0) then X`09for i := -1 downto amount do X`09 cur_stat := de_statp(cur_stat) X else X`09for i := 1 to amount do X`09 cur_stat := in_statp(cur_stat); X change_stat := cur_stat; X end; X X X`09`7B Allows player to select a race`09`09`09-JWT-`09`7D X function choose_race : boolean; X var X`09i2,i3,i4,i5`09`09: integer; X`09s`09`09`09: char; X`09exit_flag`09`09: boolean; X begin X i2 := 1; X i3 := 1; X i4 := 3; X i5 := 22; X clear(21,1); X prt('Choose a race (? for Help):',21,3); X repeat X`09put_buffer (chr(i3+96)+') '+race`5Bi2`5D.trace,i5,i4); X`09i3 := i3 + 1; X`09i4 := i4 + 15; X`09if (i4 > 70) then X`09 begin X`09 i4 := 3; X`09 i5 := i5 + 1 X`09 end; X`09i2 := i2 + 1 X until (i2 > max_races); X py.misc.race := ''; X put_buffer('',21,30); X exit_flag := false; X repeat X`09inkey_flush(s); X`09i2 := index('abcdefghijklmnopqrstuvwxyz',s); X`09if ((i2 <= max_races) and (i2 >= 1)) then X`09 with py do X`09 with race`5Bi2`5D do X`09`09begin X`09`09 misc.prace := i2; X`09`09 misc.race := trace; X`09`09 stat.str := get_stat; X`09`09 stat.int := get_stat; X`09`09 stat.wis := get_stat; X`09`09 stat.dex := get_stat; X`09`09 stat.con := get_stat; X`09`09 stat.chr := get_stat; X`09`09 stat.str := change_stat(stat.str,str_adj); X`09`09 stat.int := change_stat(stat.int,int_adj); X`09`09 stat.wis := change_stat(stat.wis,wis_adj); X`09`09 stat.dex := change_stat(stat.dex,dex_adj); X`09`09 stat.con := change_stat(stat.con,con_adj); X`09`09 stat.chr := change_stat(stat.chr,chr_adj); X`09`09 stat.cstr := stat.str; X`09`09 stat.cint := stat.int; X`09`09 stat.cwis := stat.wis; X`09`09 stat.cdex := stat.dex; X`09`09 stat.ccon := stat.con; X`09`09 stat.cchr := stat.chr; X`09`09 misc.srh := srh; X`09`09 misc.bth := bth; X`09`09 misc.bthb := bthb; X`09`09 misc.fos := fos; X`09`09 misc.stl := stl; X`09`09 misc.save := bsav; X`09`09 misc.hitdie := bhitdie; X`09`09 misc.lev := 1; X`09`09 misc.ptodam := todam_adj; X`09`09 misc.ptohit := tohit_adj; X`09`09 misc.ptoac := 0; X`09`09 misc.pac := toac_adj; X`09`09 misc.expfact:= b_exp; X`09`09 flags.see_infra := infra; X`09`09 exit_flag := true; X`09`09 choose_race := true; X`09`09 put_buffer(py.misc.race,4,15); X`09 end X`09else if (s = '?') then X`09 begin X`09 moria_help('Character Races'); X`09 exit_flag := true; X`09 choose_race := false; X`09 end; X until (exit_flag); X end; X X X`09`7B Will print the history of a character`09`09`09-JWT-`09`7D X procedure print_history; X var X`09i1`09`09: integer; X begin X put_buffer('Character Background',14,28); X for i1 := 1 to 5 do X`09put_buffer(py.misc.history`5Bi1`5D,i1+14,5) X end; X X X`09`7B Get the racial history, determines social class`09-RAK-`09`7D X`09`7B Assumtions:`09Each race has init history beginning at `09`7D X`09`7B`09`09(race-1)*3+1`09`09`09`09`09`7D X`09`7B`09`09All history parts are in accending order`09`7D X procedure get_history; X var X`09hist_ptr,cur_ptr,test_roll`09: integer; X`09start_pos,end_pos,cur_len`09: integer; +-+-+-+-+-+-+-+- END OF PART 16 +-+-+-+-+-+-+-+-