-+-+-+-+-+-+-+-+ START OF PART 16 -+-+-+-+-+-+-+-+ X`09`09 end; X`09`09 for i1 := 1 to 80 do X`09`09 begin X`09`09 tmp := chr(i1+31);`09`09`09`7B Col char`7D X`09`09 cursor_c`5Bi1`5D := tmp;`09`09`09`7B Col part`7D X`09`09 end; X`09`09end; X`0964 :`09`7B VT52 (/VT52)`09`09`09`09`7D X`09`09begin X`09`09 row_first := true;`09`7B Sequence is row,col`09`7D X`09`09 cursor_erl := escape + 'K'; X`09`09 cursor_erp := escape + 'J'; X`09`09 curlen_r := 3; X`09`09 curlen_c := 1; X`09`09 cursor_l := 4; X`09`09 for i1 := 1 to 24 do X`09`09 begin X`09`09 tmp := chr(i1+31);`09`09`09`7B Row char`7D X`09`09 cursor_r`5Bi1`5D := escape + 'Y' + tmp;`09`7B Row part`7D X`09`09 end; X`09`09 for i1 := 1 to 80 do X`09`09 begin X`09`09 tmp := chr(i1+31);`09`09`09`7B Col char`7D X`09`09 cursor_c`5Bi1`5D := tmp;`09`09`09`7B Col part`7D X`09`09 end; X`09`09end; X`0996 : `7B VT100 and ANSI X3.64 standard`09(/VT100)`7D X`09`09`7B Note that the row and column strings must always`09`7D X`09`09`7B of the same length`09`09`09`09`09`7D X`09`09begin X`09`09 row_first := true;`09`7B Sequence is row,col`09`7D X`09`09 if eightbit then X`09`09`09begin X`09`09`09 cursor_erl := csi + 'K'; X`09`09 `09 cursor_erp := csi + 'J'; X`09`09 `09 curlen_r := 3; X`09`09 `09 curlen_c := 4; X`09`09 `09 cursor_l := 7; X`09`09`09end else X`09`09`09begin X`09`09`09 cursor_erl := escape + '`5BK'; X`09`09`09 cursor_erp := escape + '`5BJ'; X`09`09`09 curlen_r := 4; X`09`09`09 curlen_c := 4; X`09`09`09 cursor_l := 8; X`09`09`09end; X`09`09 for i1 := 1 to 24 do X`09`09 begin X`09`09 writev(tmp_str,'00',i1:1);`09`09`7B Row chars`7D X`09`09 tmp_str := substr(tmp_str,length(tmp_str)-1,2); X`09`09 if eightbit then X`09`09`09 cursor_r`5Bi1`5D := csi + tmp_str`09`09`7B Row part `7D X`09`09 else X`09`09 cursor_r`5Bi1`5D := escape + '`5B' + tmp_str; `7B Row part ` V7D 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);`09`09`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';`09`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(' VT200`09 Set Terminal/Device=VT2xx'); 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 170454628 $ create 'f' Xconst X`09`7BNote to the Wizard: `09`09`09`09`09`09`7D X`09`7B`09Tweaking these constants can *GREATLY* change the game.`09`7D X`09`7B`09Two years of constant tuning have generated these`09`7D X`09`7B`09values. Minor adjustments are encouraged, but you`09`7D X`09`7B`09be very careful not to unbalance the game. Moria was`09`7D X`09`7B`09meant to be challenging, not a give away. Many`09`09`7D X`09`7B`09adjustments can cause the game to act strangely, or even`7D X`09`7B`09cause errors.`09`09`09`09`09`09`7D X X`09`7B Current version number of Moria`09`09`09`09`7D X`09cur_version = 4.43; X`09save_file_version = 4.4; X`09`7B QIOW constants, see $IODEF in STARLET.MLB`09`09`09`7D X`09IO$_WRITEVBLK = %B'0000000000110000';`09`7B 48D, 0030H`09`7D X`09IO$_TTYREADALL= %B'0000000000111010';`09`7B 58D, 003AH`09`7D X`09IO$_SETMODE = %B'0000000000100011';`09`7B 35D, 0023H`09`7D X`09IO$_SENSEMODE = %B'0000000000100111';`09`7B 39D, 0027H`09`7D X`09IO$M_NOECHO = %B'0000000001000000';`09`7B 64D, 0040H`09`7D X`09IO$M_NOWAIT = %B'0000000010000000';`09`7B 128D, 0080H`09`7D X`09IO$M_PURGE = %B'0000100000000000';`09`7B2048D, 0800H`09`7D X`09TT2$M_XON = %B'0000000000100000';`09`7B 32D, 0020H`09`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`09`7D X`09`7B hibernating the process a small amount of time before perform-`7D X`09`7B ing a QIOW read operation.`09`09`09`09-RAK-`09`7D X`09IO$MOR_IOPAUSE= 5;`09`7B x/100 seconds of sleep before inkey`09`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`09`7D X`09`7B`09changed. If changed, characters produced from other`09`7D X`09`7B`09versions will fail to restore.`09`09`09`09`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;`09`7B Multiple of 11; >= 22`09`7D X`09max_width = 198;`09`7B Multiple of 33; >= 66`09`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;`09`7B 44 lines of dungeon per section`09`7D X`09outpage_width = 99;`09`7B 100 columns of dungeon per section`09`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`09`7D X`09`7B`09slight adjustments here.`09`09`09`09`7D X`09dun_tun_rnd`09= 36;`09`7B Random direction (4 is min) `09`09`7D X`09dun_tun_chg`09= 70;`09`7B Chance of changing direction (99 max)`09`7D X`09dun_tun_fnd`09= 12;`09`7B Distance for auto find to kick in`09`7D X`09dun_tun_con`09= 15;`09`7B Chance of extra tunneling`09`09`7D X`09dun_roo_mea`09= 32;`09`7B Mean of # of rooms, standard dev=2`09`7D X`09dun_tun_pen`09= 25;`09`7B % chance of room doors`09`09`7D X`09dun_tun_jct`09= 15;`09`7B % chance of doors at tunnel junctons`09`7D X`09dun_str_den`09= 5;`09`7B Density of streamers`09`09`09`7D X`09dun_str_rng`09= 2;`09`7B Width of streamers`09`09`09`7D X`09dun_str_mag`09= 3;`09`7B Number of magma streamers`09`09`7D X`09dun_str_mc`09= 95;`09`7B 1/x chance of treasure per magma`09`7D X`09dun_str_qua`09= 2;`09`7B Number of quartz streamers`09`09`7D X`09dun_str_qc`09= 55;`09`7B 1/x chance of treasure per quartz`09`7D X`09dun_unusual = 300;`09`7B Level/x chance of unusual room`09`7D X X`09`7B Store constants`09`09`09`09`09`09`7D X`09max_owners`09= 18;`09`7B Number of owners to choose from`09`7D X`09max_stores`09= 6;`09`7B Number of different stores`09`09`7D X`09store_inven_max`09= 24;`09`7B Max number of discrete objs in inven`09`7D X`09store$choices = 26;`09`7B Number of items to choice stock from`09`7D X`09store$max_inven`09= 20;`09`7B Max diff objs in stock before auto sell`7D X`09store$min_inven`09= 14;`09`7B Min diff objs in stock before auto buy`7D X`09store$turn_around= 3;`09`7B Amount of buying and selling normally`09`7D X`09inven_init_max`09= 105;`09`7B Size of store init array`09`09`7D X`09cost_adj`09= 1.00;`09`7B Adjust prices for buying and selling`09`7D X X`09`7B Treasure constants`09`09`09`09`09`09`7D X`09inven_max = 35;`09`7B Size of inventory array(Do not change)`7D X`09max_obj_level = 40;`09`7B Maximum level of magic in dungeon`09`7D X`09obj_great = 18;`09`7B 1/n Chance of item being a Great Item`09`7D X`09max_objects = 332;`09`7B Number of objects for universe`09`7D X`09max_gold = 18;`09`7B Number of different types of gold`09`7D X`09max_talloc = 225;`09`7B Max objects per level`09`09`09`7D X`09treas_room_alloc = 7;`09`7B Amount of objects for rooms`09`09`7D X`09treas_any_alloc = 2;`09`7B Amount of objects for corridors`09`7D X`09treas_gold_alloc = 2;`09`7B Amount of gold (and gems) `09`09`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`09`7D X`09`7B`09can be adjusted here.`09`09`09`09`09`7D X`09obj_std_adj`09= 1.25;`09`7B Adjust STD per level`09`09`09`7D`20 X`09obj_std_min`09= 7;`09`7B Minimum STD`09`09`09`09`7D X`09obj_town_level`09= 5;`09`7B Town object generation level`09`09`7D X`09obj_base_magic`09= 20;`09`7B Base amount of magic`09`09`09`7D X`09obj_base_max`09= 70;`09`7B Max amount of magic`09`09`09`7D X`09obj_div_special`09= 7;`09`7B magic_chance/# = special magic`09`7D X`09obj_div_cursed`09= 1.3;`09`7B magic_chance/# = cursed items`09`09`7D X X`09`7B Constants describing limits of certain objects`09`09`7D X`09obj$lamp_max`09=15000;`09`7B Maximum amount that lamp can be filled`7D X X`09`7B Creature contants`09`09`09`09`09`09`7D X`09max_creatures = 275;`09`7B Number of creatures defined for univ`09`7D X`09max_malloc = 100 + 1;`7B Max that can be allocated`09`09`7D X`09max_malloc_chance= 180;`09`7B 1/x chance of new monster each round`09`7D X`09max_mons_level`09 = 40;`09`7B Maximum level of creatures`09`09`7D X`09max_sight`09 = 20;`09`7B Maximum dis a creature can be seen`09`7D X`09max_spell_dis`09 = 16;`09`7B Maximum dis creat. spell can be cast`09`7D X`09max_mon_mult`09 = 75;`09`7B Maximum reproductions on a level`09`7D X`09mon_mult_adj = 7;`09`7B High value slows multiplication`09`7D X`09mon_nasty`09 = 50;`09`7B Dun_level/x chance of high level creat`7D X`09min_malloc_level = 12;`09`7B Minimum number of monsters/level`09`7D X`09min_malloc_td = 4;`09`7B Number of people on town level (day)`09`7D X`09min_malloc_tn = 8;`09`7B Number of people on town level (night)`7D X`09win_mon_tot`09 = 1;`09`7B Total number of "win" creatures`09`7D X`09win_mon_appear = 50;`09`7B Level where winning creatures begin`09`7D X X`09`7B Trap constants`09`09`09`09`09`09`7D X`09max_trapa`09 = 18;`09`7B Number of defined traps`09`09`7D X`09max_trapb`09 = 19;`09`7B Includes secret doors`09`09`09`7D X X`09`7B Descriptive constants`09`09`09`09`09`09`7D X`09max_colors = 67;`09`7B Used with potions`09`7D X`09max_mush = 29;`09`7B Used with mushrooms`09`7D X`09max_woods = 41;`09`7B Used with staffs`09`7D X`09max_metals = 31;`09`7B Used with wands`09`7D X`09max_rocks = 52;`09`7B Used with rings`09`7D X`09max_amulets = 39;`09`7B Used with amulets`09`7D X`09max_syllables = 153;`09`7B Used with scrolls`09`7D X X`09`7B Player constants`09`09`09`09`09`09`7D X`09max_player_level = 40;`09`7B Maximum possible character level`09`7D X`09max_races = 8;`09`7B Number of defined races`09`09`7D X`09max_class = 6;`09`7B Number of defined classes`09`09`7D X`09use_device`09 = 5;`09`7B x> Harder devices x< Easier devices`09`7D X`09max_background = 128;`09`7B Number of types of histories for univ `7D X`09player_food_full = 7500;`7B Getting full`09`09`09`09`7D X`09player_food_max =12500;`7B Maximum food value, beyond is wasted`09`7D X`09player_food_faint= 200;`09`7B Character begins fainting`09`09`7D X`09player_food_weak = 750;`09`7B Warn player that he is getting very low`7D X`09player_food_alert= 1500;`7B Warn player that he is getting low`09`7D X`09player$regen_faint = 0.002;`09`7B Regen factor when fainting`09`7D X`09player$regen_weak = 0.004;`09`7B Regen factor when weak`09`7D X`09player$regen_normal = 0.006;`09`7B Regen factor when full`09`7D X`09player$regen_hpbase = 0.025;`09`7B Min amount hp regen`09`09`7D X`09player$regen_mnbase = 0.075;`09`7B Min amount mana regen`09`09`7D X`09player_weight_cap= 130;`09`7B 100*(1/10 pounds) per strength point`09`7D X`09player_exit_pause= 5;`09`7B Pause time before player can re-roll`09`7D X X`09`7B Base to hit constants`09`09`09`09`09`09`7D X`09bth_lev_adj`09= 3;`09`7B Adjust BTH per level`09`09`09`7D X`09bth_plus_adj`09= 3;`09`7B Adjust BTH per plus-to-hit`09`09`7D X`09bth_hit`09`09= 12;`09`7B Automatic hit; 1/bth_hit`09`09`7D X X`09`7B Misc`09`09`09`09`09`09`09`09`7D X`09null`09`09= chr(0); $ CALL UNPACK [.SOURCE.INCLUDE]CONSTANTS.INC;1 1813539503 $ create 'f' X`5Bpsect(create$code)`5D procedure create_character; 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; +-+-+-+-+-+-+-+- END OF PART 16 +-+-+-+-+-+-+-+-