-+-+-+-+-+-+-+-+ START OF PART 35 -+-+-+-+-+-+-+-+ X x_left := xval - randint(11); X x_right := xval + randint(11); 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 := cur_floor.ftval; X cave`5Bi1,i2`5D.fopen := cur_floor.ftopen; X END; X for i1 := (y_height - 1) to (y_depth + 1) do X BEGIN X with cave`5Bi1,x_left-1`5D do X if (fval <> cur_floor.ftval) then X BEGIN X fval := rock_wall1.ftval; X fopen := rock_wall1.ftopen; X END; X with cave`5Bi1,x_right+1`5D do X if (fval <> cur_floor.ftval) then X BEGIN X fval := rock_wall1.ftval; X fopen := rock_wall1.ftopen; X END; X END; X for i1 := x_left to x_right do X BEGIN X with cave`5By_height-1,i1`5D do X if (fval <> cur_floor.ftval) then X BEGIN X fval := rock_wall1.ftval; X fopen := rock_wall1.ftopen; X END; X with cave`5By_depth+1,i1`5D do X if (fval <> cur_floor.ftval) then X BEGIN X fval := rock_wall1.ftval; X fopen := rock_wall1.ftopen; X END; X END; X END; X END; X`20 X`20 X`7B Builds an unusual room at a row,column coordinate X Type 2 unusual rooms all have an inner room: X 1 - Just an inner room with one door X 2 - An inner room within an inner room X 3 - An inner room with pillar(s) X 4 - Inner room has a maze X 5 - A set of four inner rooms `7D X procedure build_type2(yval,xval : integer);`20 X var X y_height,y_depth,x_left,x_right,i1,i2 : integer; X cur_floor`09`09`09 : floor_type; X BEGIN X if (dun_level <= randint(10)) then X cur_floor := lopen_floor `7B Floor with light `7D X else X cur_floor := dopen_floor; `7B Dark floor `7D X y_height := yval - 4; X y_depth := yval + 4; X x_left := xval - 11; X x_right := xval + 11; 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 := cur_floor.ftval; X cave`5Bi1,i2`5D.fopen := cur_floor.ftopen; X END; X for i1 := (y_height - 1) to (y_depth + 1) do X BEGIN X cave`5Bi1,x_left-1`5D.fval := rock_wall1.ftval; X cave`5Bi1,x_left-1`5D.fopen := rock_wall1.ftopen; X cave`5Bi1,x_right+1`5D.fval := rock_wall1.ftval; X cave`5Bi1,x_right+1`5D.fopen := rock_wall1.ftopen; X END; X for i1 := x_left to x_right do X BEGIN X cave`5By_height-1,i1`5D.fval := rock_wall1.ftval; X cave`5By_height-1,i1`5D.fopen := rock_wall1.ftopen; X cave`5By_depth+1,i1`5D.fval := rock_wall1.ftval; X cave`5By_depth+1,i1`5D.fopen := rock_wall1.ftopen; X END; X`7B The inner room `7D X y_height := y_height + 2; X y_depth := y_depth - 2; X x_left := x_left + 2; X x_right := x_right - 2; X for i1 := (y_height - 1) to (y_depth + 1) do X BEGIN X cave`5Bi1,x_left-1`5D.fval := 8; X cave`5Bi1,x_right+1`5D.fval := 8; X END; X for i1 := x_left to x_right do X BEGIN X cave`5By_height-1,i1`5D.fval := 8; X cave`5By_depth+1,i1`5D.fval := 8; X END; X`7B Inner room varitions `7D X CASE randint(5) of X 1 : BEGIN `7B Just an inner room... `7D X CASE randint(4) of `7B Place a door `7D X 1 : place_secret_door(y_height-1,xval); X 2 : place_secret_door(y_depth+1,xval); X 3 : place_secret_door(yval,x_left-1); X 4 : place_secret_door(yval,x_right+1); X END; X vault_monster(yval,xval,1); X END; X 2 : BEGIN `7B Treasure Vault `7D X CASE randint(4) of `7B Place a door `7D X 1 : place_secret_door(y_height-1,xval); X 2 : place_secret_door(y_depth+1,xval); X 3 : place_secret_door(yval,x_left-1); X 4 : place_secret_door(yval,x_right+1); X END; X for i1 := yval-1 to yval+1 do X BEGIN X cave`5Bi1,xval-1`5D.fval := 8; X cave`5Bi1,xval+1`5D.fval := 8; X END; X cave`5Byval-1,xval`5D.fval := 8; X cave`5Byval+1,xval`5D.fval := 8; X CASE randint(4) of `7B Place a door `7D X 1 : place_locked_door(yval-1,xval); X 2 : place_locked_door(yval+1,xval); X 3 : place_locked_door(yval,xval-1); X 4 : place_locked_door(yval,xval+1); X END; X`7B Place an object in the treasure vault `7D X CASE randint(10) of X 1 : place_up_stairs(yval,xval); X 2 : place_down_stairs(yval,xval); X otherwise place_object(yval,xval); X END; X`7B Guard the treasure well `7D X vault_monster(yval,xval,2+randint(3)); X`7B If the monsters don't get 'em.`7D X vault_trap(yval,xval,4,10,2+randint(3)); X END; X 3 : BEGIN `7B Inner pillar(s).`7D X CASE randint(4) of `7B Place a door `7D X 1 : place_secret_door(y_height-1,xval); X 2 : place_secret_door(y_depth+1,xval); X 3 : place_secret_door(yval,x_left-1); X 4 : place_secret_door(yval,x_right+1); X END; X for i1 := yval-1 to yval+1 do X for i2 := xval-1 to xval+1 do X cave`5Bi1,i2`5D.fval := 8; X if (randint(2) = 1) then X BEGIN X CASE randint(2) of X 1 : BEGIN X for i1 := yval-1 to yval+1 do X for i2 := xval-6 to xval-4 do X cave`5Bi1,i2`5D.fval := 8; X for i1 := yval-1 to yval+1 do X for i2 := xval+4 to xval+6 do X cave`5Bi1,i2`5D.fval := 8; X END; X 2 : BEGIN X for i1 := yval-1 to yval+1 do X for i2 := xval-7 to xval-5 do X cave`5Bi1,i2`5D.fval := 8; X for i1 := yval-1 to yval+1 do X for i2 := xval+5 to xval+7 do X cave`5Bi1,i2`5D.fval := 8; X END; X END; X if (randint(3) = 1) then `7B Inner rooms `7D X BEGIN X for i1 := xval-5 to xval+5 do X BEGIN X cave`5Byval-1,i1`5D.fval := 8; X cave`5Byval+1,i1`5D.fval := 8; X END; X CASE randint(2) of X 1 : place_secret_door(yval+1,xval-3); X 2 : place_secret_door(yval-1,xval-3); X END; X CASE randint(2) of X 1 : place_secret_door(yval+1,xval+3); X 2 : place_secret_door(yval-1,xval+3); X END; X if (randint(3) = 1) then place_object(yval,xval-2) V; X if (randint(3) = 1) then place_object(yval,xval+2) V; X vault_monster(yval,xval-2,randint(2)); X vault_monster(yval,xval+2,randint(2)); X END; X END; X END; X 4 : BEGIN `7B Maze inside..`7D X CASE randint(4) of `7B Place a door `7D X 1 : place_secret_door(y_height-1,xval); X 2 : place_secret_door(y_depth+1,xval); X 3 : place_secret_door(yval,x_left-1); X 4 : place_secret_door(yval,x_right+1); X END; X for i1 := y_height to y_depth do X for i2 := x_left to x_right do X if (odd(i2+i1)) then X cave`5Bi1,i2`5D.fval := 8; X`7B Monsters just love mazes.`7D X vault_monster(yval,xval-5,randint(3)); X vault_monster(yval,xval+5,randint(3)); X`7B Traps make them entertaining.`7D X vault_trap(yval,xval-3,2,8,randint(3)); X vault_trap(yval,xval+3,2,8,randint(3)); X`7B Mazes should have some treasure too.. `7D X for i1 := 1 to 6 do X random_object(yval,xval,1); X END; X 5 : BEGIN `7B four small rooms ...`7D X for i1 := y_height to y_depth do X cave`5Bi1,xval`5D.fval:=8; X for i1 := x_left to x_right do X cave`5Byval,i1`5D.fval := 8; X CASE randint(3) of X 1 : BEGIN X i1 := randint(10); X place_secret_door(y_height-1,xval-i1); X place_secret_door(y_height-1,xval+i1); X place_secret_door(y_depth+1,xval-i1); X place_secret_door(y_depth+1,xval+i1); X END; X 2 : BEGIN X i1 := randint(3); X place_secret_door(yval+i1,x_left-1); X place_secret_door(yval-i1,x_left-1); X place_secret_door(yval+i1,x_right+1); X place_secret_door(yval-i1,x_right+1) X END; X 3 : BEGIN `7B make them dig for it ... REB`7D X place_secret_door(yval,xval); X place_secret_door(y_height,xval) X END X END; X`7B Treasure in each one.`7D X random_object(yval,xval,2+randint(2)); X`7B Gotta have some monsters.`7D X vault_monster(yval+2,xval-4,randint(2)); X vault_monster(yval+2,xval+4,randint(2)); X vault_monster(yval-2,xval-4,randint(2)); X vault_monster(yval-2,xval+4,randint(2)); X END; X END; X END; X`20 X`20 X`7B Builds a room at a row,column coordinate X Type 3 unusual rooms are cross shaped `7D X procedure build_type3(yval,xval : integer); X var X y_height,y_depth,x_left,x_right,i0,i1,i2 : integer; X cur_floor : floor_type; X BEGIN X if (dun_level <= randint(10)) then X cur_floor := lopen_floor `7B Floor with light `7D X else X cur_floor := dopen_floor; `7B Dark floor `7D X i0 := 2 + randint(2); X y_height := yval - i0; X y_depth := yval + i0; X x_left := xval - 1; X x_right := xval + 1; 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 := cur_floor.ftval; X cave`5Bi1,i2`5D.fopen := cur_floor.ftopen; X END; X for i1 := (y_height - 1) to (y_depth + 1) do X BEGIN X with cave`5Bi1,x_left-1`5D do X BEGIN X fval := rock_wall1.ftval; X fopen := rock_wall1.ftopen; X END; X with cave`5Bi1,x_right+1`5D do X BEGIN X fval := rock_wall1.ftval; X fopen := rock_wall1.ftopen; X END; X END; X for i1 := x_left to x_right do X BEGIN X with cave`5By_height-1,i1`5D do X BEGIN X fval := rock_wall1.ftval; X fopen := rock_wall1.ftopen; X END; X with cave`5By_depth+1,i1`5D do X BEGIN X fval := rock_wall1.ftval; X fopen := rock_wall1.ftopen; X END; X END; X i0 := 2 + randint(9); X y_height := yval - 1; X y_depth := yval + 1; X x_left := xval - i0; X x_right := xval + i0; 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 := cur_floor.ftval; X cave`5Bi1,i2`5D.fopen := cur_floor.ftopen; X END; X for i1 := (y_height - 1) to (y_depth + 1) do X BEGIN X with cave`5Bi1,x_left-1`5D do X if (fval <> cur_floor.ftval) then X BEGIN X fval := rock_wall1.ftval; X fopen := rock_wall1.ftopen; X END; X with cave`5Bi1,x_right+1`5D do X if (fval <> cur_floor.ftval) then X BEGIN X fval := rock_wall1.ftval; X fopen := rock_wall1.ftopen; X END; X END; X for i1 := x_left to x_right do X BEGIN X with cave`5By_height-1,i1`5D do X if (fval <> cur_floor.ftval) then X BEGIN X fval := rock_wall1.ftval; X fopen := rock_wall1.ftopen; X END; X with cave`5By_depth+1,i1`5D do X if (fval <> cur_floor.ftval) then X BEGIN X fval := rock_wall1.ftval; X fopen := rock_wall1.ftopen; +-+-+-+-+-+-+-+- END OF PART 35 +-+-+-+-+-+-+-+-