-+-+-+-+-+-+-+-+ START OF PART 25 -+-+-+-+-+-+-+-+ X`09 and xval=(x-1)*16+8 for 4 stores in the row. `7D X`09x_adjst := 6 - (num_in_row - 3)*3; X y_height := yval - randint(3); X y_depth := yval + randint(4); X x_left := xval + 1 - randint(x_adjst); X x_right := xval + 1 + randint(x_adjst); X for i1 := y_height to y_depth do X for i2 := x_left to x_right do X BEGIN X cave`5Bi1,i2`5D.fval := boundry_wall.ftval; X cave`5Bi1,i2`5D.fopen := boundry_wall.ftopen; X END; X CASE randint(4) of `7B determines which wall and where to put the do Vor `7D X 1 : BEGIN X i1 := randint(y_depth-y_height) + y_height - 1; X i2 := x_left; X END; X 2 : BEGIN X i1 := randint(y_depth-y_height) + y_height - 1; X i2 := x_right; X END; X 3 : BEGIN X i1 := y_depth; X i2 := randint(x_right-x_left) + x_left - 1; X END; X 4 : BEGIN X i1 := y_height; X i2 := randint(x_right-x_left) + x_left - 1; X END; X END; X with cave`5Bi1,i2`5D do X BEGIN X fval := corr_floor3.ftval; X fopen := corr_floor3.ftopen; X popt(cur_pos); X tptr := cur_pos; X t_list`5Bcur_pos`5D := store_door`5Bstore_num`5D; X END; X END; X`20 X`20 X`7B Town logic flow for generation of new town `7D X procedure town_gen; X type X room_type = array `5B1..2,1..4`5D of boolean; X var X y,x,i1,i2,i3,i4,i5 : integer; X rooms : array `5B1..8`5D of integer; X`20 X BEGIN X seed := town_seed; X for i1 := 1 to 8 do rooms`5Bi1`5D := i1; X i4 := 6; X for i1 := 1 to 2 do X for i2 := 1 to 3 do X BEGIN X i3 := randint(i4); X`09 build_store(rooms`5Bi3`5D,i1,i2,5-i1); X`09 `7B the "5-i1" is how many stores will appear in that row `7D X for i5 := i3 to i4-1 do rooms`5Bi5`5D := rooms`5Bi5+1`5D; X i4 := i4 - 1; X END;`20 X`09 build_store(rooms`5B7`5D,1,4,4); X fill_cave(dopen_floor); X place_boundry; X if (odd(turn mod 5000)) then X BEGIN `7B Night `7D X for i1 := 1 to cur_height do X for i2 := 1 to cur_width do X if (cave`5Bi1,i2`5D.fval <> dopen_floor.ftval) then X cave`5Bi1,i2`5D.pl := true; X place_stairs(2,1,0); X seed := get_seed; X alloc_monster(`5B1,2`5D,min_malloc_tn,3,true); X store_maint; X END X else X BEGIN `7B Day `7D X for i1 := 1 to cur_height do X for i2 := 1 to cur_width do X cave`5Bi1,i2`5D.pl := true; X place_stairs(2,1,0); X seed := get_seed; X alloc_monster(`5B1,2`5D,min_malloc_td,3,true); X store_maint; X END; X END; X`20 X`20 X BEGIN X panel_row_min := 0; X panel_row_max := 0; X panel_col_min := 0; X panel_col_max := 0; X char_row := -1; X char_col := -1; X`20 X tlink; X mlink; X blank_cave; X`20 X if (dun_level = 0) then X BEGIN X cur_height := screen_height; X cur_width := screen_width; X max_panel_rows := trunc(cur_height/screen_height)*2 - 2; X max_panel_cols := trunc(cur_width /screen_width )*2 - 2; X panel_row := max_panel_rows; X panel_col := max_panel_cols; X town_gen; X END X else X BEGIN X cur_height := max_height; X cur_width := max_width; X max_panel_rows := trunc(cur_height/screen_height)*2 - 2; X max_panel_cols := trunc(cur_width /screen_width )*2 - 2; X panel_row := max_panel_rows; X panel_col := max_panel_cols; X cave_gen; X END; X END; X `20 $ CALL UNPACK [.SOURCE.INCLUDE]GENERATE.INC;1 1249545807 $ create 'f' X`5Bpsect(misc2$code)`5D procedure ident_char; X var X command : char; X begin X if (get_com('Enter character to be identified :',command)) then X case command of X ' ' : prt(' - An open pit.',1,1); X '!' : prt('! - A potion.',1,1); X '"' : prt('" - An amulet, periapt, or necklace.',1,1); X '#' : prt('# - A stone wall.',1,1); X '$' : prt('$ - Treasure.',1,1); X `7B'%' : prt('% - Not used.',1,1);`7D X '&' : prt('& - Treasure chest.',1,1); X '''': prt(''' - An open door.',1,1); X '(' : prt('( - Soft armor.',1,1); X ')' : prt(') - A shield.',1,1); X '*' : prt('* - Gems.',1,1);`20 X '+' : prt('+ - A closed door.',1,1); X ',' : prt(', - Food.',1,1); X '-' : prt('- - A wand',1,1); X '.' : prt('. - Floor.',1,1); X '/' : prt('/ - A pole weapon.',1,1); X `7B'0' : prt('0 - Not used.',1,1);`7D X '1' : prt('1 - Entrance to General Store.',1,1); X '2' : prt('2 - Entrance to Armory.',1,1); X '3' : prt('3 - Entrance to Weaponsmith.',1,1); X '4' : prt('4 - Entrance to Temple.',1,1); X '5' : prt('5 - Entrance to Alchemy shop.',1,1); X '6' : prt('6 - Entrance to Magic-Users store.',1,1); X '7' : prt('7 - Entrance to Black Market.',1,1); X `7B'8' : prt('8 - Not used.',1,1);`7D X `7B'9' : prt('9 - Not used.',1,1);`7D X ':' : prt(': - Rubble.',1,1); X ';' : prt('; - A loose rock.',1,1); X '<' : prt('< - An up staircase.',1,1); X '=' : prt('= - A ring.',1,1); X '>' : prt('> - A down staircase.',1,1); X '?' : prt('? - A scroll.',1,1); X '@' : prt(py.misc.name,1,1); X 'A' : prt('A - Ant Lion.',1,1); X 'B' : prt('B - Beetle.',1,1); X 'C' : prt('C - Gelatanious Cube.',1,1); X 'D' : prt('D - The Balrog (a Demon).',1,1); X 'E' : prt('E - Elemental.',1,1); X 'F' : prt('F - Mind Flayer or Fly.',1,1); X 'G' : prt('G - Ghost.',1,1); X 'H' : prt('H - Hell Hound or Hell Horse.',1,1); X 'I' : prt('I - Invisible Stalker.',1,1); X 'J' : prt('J - Jelly.',1,1); X `7B'K' : prt('K - Not used.',1,1);`7D X 'L' : prt('L - Lamia or Lich.',1,1); X 'M' : prt('M - Manticore, Minotaur, or Mummy.',1,1); X `7B'N' : prt('N - Not used.',1,1);`7D X 'O' : prt('O - Ooze.',1,1); X 'P' : prt('P - Giant humanoid.',1,1); X `7B'Q' : prt('Q - Not used.',1,1);`7D X 'R' : prt('R - Roper or Reptile.',1,1); X 'S' : prt('S - Giant Scorpion.',1,1); X 'T' : prt('T - Troll.',1,1); X 'U' : prt('U - Umber Hulk.',1,1); X 'V' : prt('V - Vampire.',1,1); X 'W' : prt('W - Wight or Wraith.',1,1); X 'X' : prt('X - Xorn.',1,1); X 'Y' : prt('Y - Yeth Hound.',1,1); X `7B'Z' : prt('Z - Not used.',1,1);`7D X '`5B' : prt('`5B - Hard armor.',1,1); X '\' : prt('\ - A hafted weapon.',1,1); X '`5D' : prt('`5D - Misc. armor.',1,1); X '`5E' : prt('`5E - A trap.',1,1); X '_' : prt('_ - A staff.',1,1); X `7B'`60' : prt('`60 - Not used.',1,1);`7D X 'a' : prt('a - Ant.',1,1); X 'b' : prt('b - Bat or Cockatrice.',1,1); X 'c' : prt('c - Centipede.',1,1); X 'd' : prt('d - Dragon.',1,1); X 'e' : prt('e - Floating Eye.',1,1); X 'f' : prt('f - Frog',1,1); X 'g' : prt('g - Gargoyle or Golem.',1,1); X 'h' : prt('h - Harpy.',1,1); X 'i' : prt('i - Icky Thing.',1,1); X 'j' : prt('j - Jackal.',1,1); X 'k' : prt('k - Kobold.',1,1); X 'l' : prt('l - Lice.',1,1); X 'm' : prt('m - Mold or Mushroom.',1,1); X 'n' : prt('n - Naga.',1,1); X 'o' : prt('o - Orc, Ogre, or Hobgoblin.',1,1); X 'p' : prt('p - Person (Humanoid).',1,1); X 'q' : prt('q - Quasit.',1,1); X 'r' : prt('r - Rodent.',1,1); X 's' : prt('s - Skeleton.',1,1); X 't' : prt('t - Tick.',1,1); X `7B'u' : prt('u - Not used.',1,1);`7D X 'v' : prt('v - Vargouille.',1,1); X 'w' : prt('w - Worm(s).',1,1); X `7B'x' : prt('x - Not used.',1,1);`7D X 'y' : prt('y - Yeek.',1,1); X 'z' : prt('z - Zombie.',1,1); X '`7B' : prt('`7B - Arrow, bolt, or bullet.',1,1); X '`7C' : prt('`7C - A sword or dagger.',1,1); X '`7D' : prt('`7D - Bow, crossbow, or sling.',1,1); X '`7E' : prt('`7E - Miscellaneous item.',1,1); X otherwise prt('Not Used.',1,1); X end X end; X`20 X`20 X `7B Help for available commands `7 VD X`5Bpsect(misc2$code)`5D procedure help; X begin X clear(1,1); Xprt('B Bash (object/creature)`7C q Quaff a potion.',1,1); Xprt('C Display character. `7C r Read a scroll.',2,1); Xprt('D Disarm a trap/chest. `7C s Search for hidden doors.',3 V,1); Xprt('E Eat some food. `7C t Take off an item.',4,1); Xprt('F Fill lamp with oil. `7C u Use a staff.',5,1); Xprt('L Current location. `7C v Version and credits.',6,1); Xprt('P Print map. `7C w Wear/Wield an item.',7,1); Xprt('R Rest for a period. `7C x Exchange weapon.',8,1); Xprt('S Search Mode. `7C / Identify a character.',9,1) V; Xprt('T Tunnel. `7C ? Display this panel.',10,1); Xprt('a Aim and fire a wand. `7C \ Retreive info on a creature V.', X 11,1); Xprt('b Browse a book. `7C',12,1); Xprt('c Close a door. `7C `5EM Repeat the last message.' V,13,1); Xprt('d Drop an item. `7C `5ER Redraw the screen.',14,1) V; Xprt('e Equipment list. `7C `5EY Quit the game.',15,1); Xprt('f Fire/Throw an item. `7C `5EZ Save character and quit.' V,16,1); Xprt('h Help on key commands. `7C',17,1); Xprt('i Inventory list. `7C < Go up an up-staircase.',18,1); Xprt('j Jam a door with spike.`7C > Go down a down-staircase.',19,1); Xprt('l Look given direction. `7C . Move in direction.',20,1); Xprt('m Cast a magic spell. `7C Movement: 7 8 9',21,1); Xprt('o Open a door/chest. `7C 4 6 5 = Rest',22,1) V; Xprt('p Read a prayer. `7C 1 2 3',23,1); X pause(24); X draw_cave; X end; X`20 X X`7BDisplays the list of all the monsters -NBT`7D X`5Bpsect(misc2$code)`5D procedure do_all_mons; X XBegin X Clear(1,1); Xprt(' Note: A "*" in front of the symbol denotes that more than one',3,1); Xprt(' type of creature uses that symbol.',4,1); Xprt('*$ Coins *a Ant *b Bat, Cockatri Vce',6,1); Xprt('*c Centipede(s) *d Dragon *e Eye ',7,1); Xprt('*f Frog *g Gargoyle, Golem *h Harpy',8,1); Xprt('*i Icky thing j Jackal k Kobold',9,1); Xprt('*l Louse *m Mold, Mushroom *n Naga',10,1); Xprt('*o Orc, Ogre, Hobgoblin *p Humanoid q Quasit',11,1) V; Xprt('*r Rodent *s Skeleton *t Tick',12,1); Xprt(' v Vargouille *w Worm(s) *y Yeek',13,1); Xprt('*z Zombie *`7C Evil Sword *A Ant Lion',1 V4,1); Xprt('*B Beetle C Gelatainous Cube D The Balrog',1 V5,1); Xprt('*E Elemental *F Fly, Mind Flayer *G Ghost',16,1); Xprt('*H Hell Hound, Hell Horse I Invisible Stalker *J Jelly',17,1); Xprt('*L Lich, Lamia *M Manticore, Mummy, Minotaur',18,1); Xprt('*O Ooze *P Giant Humanoid *R Roper, Reptil Ve',19,1); Xprt('*S Giant Scorpion *T Troll U Umber Hulk',2 V0,1); Xprt('*V Vampire *W Wight or Wraith X Xorn',21,1); Xprt(' Y Yeth Hound',22,1); X End; X X`7BDisplays a particular monster's "character sheet" -NBT`7D X`5Bpsect(misc2$code)`5D procedure do_mon_out (moncode : integer); X XVar nbt_out_val, attstr, attx : vtype; X cur_line, xpos, atype, adesc,i : integer; X damstr : dtype; X XBEGIN X clear (1,1); X with c_list`5Bmoncode`5D do X BEGIN X prt (name,1,1); X prt ('Screen Code:',1,60); X prt (cchar,1,72); X prt_num ('Speed =',speed,2,3); X prt_num ('Level =',level,2,13); X prt_num ('Exp =',mexp,2,24); X prt_num ('AC =',ac,2,36); X prt_num ('Eye-sight =',aaf,2,44); X nbt_out_val := 'HD = ' + hd; X prt (nbt_out_val,2,58); X cur_line := 5; X if (uand(%X'80000000',cmove) <> 0) then X begin X cur_line := 7; X prt ('This creature is a ***Win Creature***',3,20); X end; X if (uand(%X'00080000',cmove) <> 0) then X begin X prt('Creature eats/kills other creatures.',((cur_line + 1) div 2), X (41 - 40*(cur_line mod 2))); X cur_line := cur_line + 1; X end; X if (uand(%X'0001',cdefense) <> 0) then X begin X prt('Creature is a dragon.',((cur_line + 1) div 2), X (41 - 40*(cur_line mod 2))); X cur_line := cur_line + 1; X end; X if (uand(%X'0002',cdefense) <> 0) then X begin X prt('Creature is a monster.',((cur_line + 1) div 2), X (41 - 40*(cur_line mod 2))); X cur_line := cur_line + 1; X end; X if (uand(%X'0004',cdefense) <> 0) then X begin X prt('Creature is evil.',((cur_line + 1) div 2),(41 - 40*(cur_line m Vod 2))); X cur_line := cur_line + 1; X end; X if (uand(%X'0008',cdefense) <> 0) then X begin X prt('Creature is undead.',((cur_line + 1) div 2),(41 - 40*(cur_line V mod 2))); X cur_line := cur_line + 1; X end; X if (uand(%X'0010',cdefense) <> 0) then X begin +-+-+-+-+-+-+-+- END OF PART 25 +-+-+-+-+-+-+-+-