#include "angband.h"
-#include "generate.h"
+#include "util.h"
+#include "rooms-vault.h"
+
+#include "floor-generate.h"
#include "grid.h"
#include "rooms.h"
#include "store.h"
#include "trap.h"
#include "monster.h"
#include "feature.h"
+#include "floor.h"
+#include "dungeon.h"
+#include "geometry.h"
+#include "wild.h"
+
+/*
+ * The vault generation arrays
+ */
+vault_type *v_info;
+char *v_name;
+char *v_text;
+
+/*
+ * Maximum number of vaults in v_info.txt
+ */
+VAULT_IDX max_v_idx;
/*
* This function creates a random vault that looks like a collection of bubbles.
* Note: If two centers are on the same point then this algorithm will create a
* blank bubble filled with walls. - This is prevented from happening.
*/
-static void build_bubble_vault(POSITION x0, POSITION y0, POSITION xsize, POSITION ysize)
+static void build_bubble_vault(floor_type *floor_ptr, POSITION x0, POSITION y0, POSITION xsize, POSITION ysize)
{
#define BUBBLENUM 10 /* number of bubbles */
int side_x = x0 - xhsize + i;
place_outer_noperm_bold(y0 - yhsize + 0, side_x);
- current_floor_ptr->grid_array[y0 - yhsize + 0][side_x].info |= (CAVE_ROOM | CAVE_ICKY);
+ floor_ptr->grid_array[y0 - yhsize + 0][side_x].info |= (CAVE_ROOM | CAVE_ICKY);
place_outer_noperm_bold(y0 - yhsize + ysize - 1, side_x);
- current_floor_ptr->grid_array[y0 - yhsize + ysize - 1][side_x].info |= (CAVE_ROOM | CAVE_ICKY);
+ floor_ptr->grid_array[y0 - yhsize + ysize - 1][side_x].info |= (CAVE_ROOM | CAVE_ICKY);
}
/* Left and right boundaries */
int side_y = y0 - yhsize + i;
place_outer_noperm_bold(side_y, x0 - xhsize + 0);
- current_floor_ptr->grid_array[side_y][x0 - xhsize + 0].info |= (CAVE_ROOM | CAVE_ICKY);
+ floor_ptr->grid_array[side_y][x0 - xhsize + 0].info |= (CAVE_ROOM | CAVE_ICKY);
place_outer_noperm_bold(side_y, x0 - xhsize + xsize - 1);
- current_floor_ptr->grid_array[side_y][x0 - xhsize + xsize - 1].info |= (CAVE_ROOM | CAVE_ICKY);
+ floor_ptr->grid_array[side_y][x0 - xhsize + xsize - 1].info |= (CAVE_ROOM | CAVE_ICKY);
}
/* Fill in middle with bubbles */
else
{
/* middle of a bubble */
- place_floor_bold(y0 - yhsize + y, x0 - xhsize + x);
+ place_floor_bold(floor_ptr, y0 - yhsize + y, x0 - xhsize + x);
}
/* clean up rest of flags */
- current_floor_ptr->grid_array[y0 - yhsize + y][x0 - xhsize + x].info |= (CAVE_ROOM | CAVE_ICKY);
+ floor_ptr->grid_array[y0 - yhsize + y][x0 - xhsize + x].info |= (CAVE_ROOM | CAVE_ICKY);
}
}
{
x = randint1(xsize - 3) - xhsize + x0 + 1;
y = randint1(ysize - 3) - yhsize + y0 + 1;
- add_door(x, y);
+ add_door(floor_ptr, x, y);
}
/* Fill with monsters and treasure, low difficulty */
- fill_treasure(x0 - xhsize + 1, x0 - xhsize + xsize - 2, y0 - yhsize + 1, y0 - yhsize + ysize - 2, randint1(5));
+ fill_treasure(floor_ptr, x0 - xhsize + 1, x0 - xhsize + xsize - 2, y0 - yhsize + 1, y0 - yhsize + ysize - 2, randint1(5));
}
/* Create a random vault that looks like a collection of overlapping rooms */
-static void build_room_vault(POSITION x0, POSITION y0, POSITION xsize, POSITION ysize)
+static void build_room_vault(floor_type *floor_ptr, POSITION x0, POSITION y0, POSITION xsize, POSITION ysize)
{
POSITION x1, x2, y1, y2, xhsize, yhsize;
int i;
POSITION y = y0 - yhsize + y1;
place_extra_bold(y, x);
- current_floor_ptr->grid_array[y][x].info &= (~CAVE_ICKY);
+ floor_ptr->grid_array[y][x].info &= (~CAVE_ICKY);
}
}
x2 = randint1(xhsize) * 2 + x0 - xhsize;
y1 = randint1(yhsize) * 2 + y0 - yhsize;
y2 = randint1(yhsize) * 2 + y0 - yhsize;
- build_room(x1, x2, y1, y2);
+ build_room(floor_ptr, x1, x2, y1, y2);
}
/* Add some random doors */
{
x1 = randint1(xsize - 3) - xhsize + x0 + 1;
y1 = randint1(ysize - 3) - yhsize + y0 + 1;
- add_door(x1, y1);
+ add_door(floor_ptr, x1, y1);
}
/* Fill with monsters and treasure, high difficulty */
- fill_treasure(x0 - xhsize + 1, x0 - xhsize + xsize - 2, y0 - yhsize + 1, y0 - yhsize + ysize - 2, randint1(5) + 5);
+ fill_treasure(floor_ptr, x0 - xhsize + 1, x0 - xhsize + xsize - 2, y0 - yhsize + 1, y0 - yhsize + ysize - 2, randint1(5) + 5);
}
-/* Create a random vault out of a fractal current_floor_ptr->grid_array */
+/* Create a random vault out of a fractal p_ptr->current_floor_ptr->grid_array */
static void build_cave_vault(POSITION x0, POSITION y0, POSITION xsiz, POSITION ysiz)
{
int grd, roug, cutoff;
randint1(xsize / 4) + randint1(ysize / 4);
/* make it */
- generate_hmap(y0, x0, xsize, ysize, grd, roug, cutoff);
+ generate_hmap(p_ptr->current_floor_ptr, y0, x0, xsize, ysize, grd, roug, cutoff);
/* Convert to normal format+ clean up */
- done = generate_fracave(y0, x0, xsize, ysize, cutoff, light, room);
+ done = generate_fracave(p_ptr->current_floor_ptr, y0, x0, xsize, ysize, cutoff, light, room);
}
/* Set icky flag because is a vault */
{
for (y = 0; y <= ysize; y++)
{
- current_floor_ptr->grid_array[y0 - yhsize + y][x0 - xhsize + x].info |= CAVE_ICKY;
+ p_ptr->current_floor_ptr->grid_array[y0 - yhsize + y][x0 - xhsize + x].info |= CAVE_ICKY;
}
}
/* Fill with monsters and treasure, low difficulty */
- fill_treasure(x0 - xhsize + 1, x0 - xhsize + xsize - 1, y0 - yhsize + 1, y0 - yhsize + ysize - 1, randint1(5));
+ fill_treasure(p_ptr->current_floor_ptr, x0 - xhsize + 1, x0 - xhsize + xsize - 1, y0 - yhsize + 1, y0 - yhsize + ysize - 1, randint1(5));
}
* @param transno 変換ID
* @return なし
*/
-static void build_vault(POSITION yval, POSITION xval, POSITION ymax, POSITION xmax, concptr data,
+static void build_vault(floor_type *floor_ptr, POSITION yval, POSITION xval, POSITION ymax, POSITION xmax, concptr data,
POSITION xoffset, POSITION yoffset, int transno)
{
POSITION dx, dy, x, y, i, j;
/* Flip / rotate */
coord_trans(&i, &j, xoffset, yoffset, transno);
- /* Extract the location */
if (transno % 2 == 0)
{
/* no swap of x/y */
/* Hack -- skip "non-grids" */
if (*t == ' ') continue;
- g_ptr = ¤t_floor_ptr->grid_array[y][x];
+ g_ptr = &floor_ptr->grid_array[y][x];
/* Lay down a floor */
place_floor_grid(g_ptr);
}
else
{
- place_trap(y, x);
+ place_trap(floor_ptr, y, x);
}
break;
/* Secret doors */
case '+':
- place_secret_door(y, x, DOOR_DEFAULT);
+ place_secret_door(floor_ptr, y, x, DOOR_DEFAULT);
break;
/* Secret glass doors */
case '-':
- place_secret_door(y, x, DOOR_GLASS_DOOR);
+ place_secret_door(floor_ptr, y, x, DOOR_GLASS_DOOR);
if (is_closed_door(g_ptr->feat)) g_ptr->mimic = feat_glass_wall;
break;
/* Curtains */
case '\'':
- place_secret_door(y, x, DOOR_CURTAIN);
+ place_secret_door(floor_ptr, y, x, DOOR_CURTAIN);
break;
/* Trap */
case '^':
- place_trap(y, x);
+ place_trap(floor_ptr, y, x);
break;
/* Black market in a dungeon */
case 'S':
- set_cave_feat(y, x, feat_black_market);
+ set_cave_feat(floor_ptr, y, x, feat_black_market);
store_init(NO_TOWN, STORE_BLACK);
break;
/* The Pattern */
case 'p':
- set_cave_feat(y, x, feat_pattern_start);
+ set_cave_feat(floor_ptr, y, x, feat_pattern_start);
break;
case 'a':
- set_cave_feat(y, x, feat_pattern_1);
+ set_cave_feat(floor_ptr, y, x, feat_pattern_1);
break;
case 'b':
- set_cave_feat(y, x, feat_pattern_2);
+ set_cave_feat(floor_ptr, y, x, feat_pattern_2);
break;
case 'c':
- set_cave_feat(y, x, feat_pattern_3);
+ set_cave_feat(floor_ptr, y, x, feat_pattern_3);
break;
case 'd':
- set_cave_feat(y, x, feat_pattern_4);
+ set_cave_feat(floor_ptr, y, x, feat_pattern_4);
break;
case 'P':
- set_cave_feat(y, x, feat_pattern_end);
+ set_cave_feat(floor_ptr, y, x, feat_pattern_end);
break;
case 'B':
- set_cave_feat(y, x, feat_pattern_exit);
+ set_cave_feat(floor_ptr, y, x, feat_pattern_exit);
break;
case 'A':
/* Reward for Pattern walk */
- object_level = current_floor_ptr->base_level + 12;
+ floor_ptr->object_level = floor_ptr->base_level + 12;
place_object(y, x, AM_GOOD | AM_GREAT);
- object_level = current_floor_ptr->base_level;
+ floor_ptr->object_level = floor_ptr->base_level;
break;
case '~':
- set_cave_feat(y, x, feat_shallow_water);
+ set_cave_feat(floor_ptr, y, x, feat_shallow_water);
break;
case '=':
- set_cave_feat(y, x, feat_deep_water);
+ set_cave_feat(floor_ptr, y, x, feat_deep_water);
break;
case 'v':
- set_cave_feat(y, x, feat_shallow_lava);
+ set_cave_feat(floor_ptr, y, x, feat_shallow_lava);
break;
case 'w':
- set_cave_feat(y, x, feat_deep_lava);
+ set_cave_feat(floor_ptr, y, x, feat_deep_lava);
break;
case 'f':
- set_cave_feat(y, x, feat_shallow_acid_puddle);
+ set_cave_feat(floor_ptr, y, x, feat_shallow_acid_puddle);
break;
case 'F':
- set_cave_feat(y, x, feat_deep_acid_puddle);
+ set_cave_feat(floor_ptr, y, x, feat_deep_acid_puddle);
break;
case 'g':
- set_cave_feat(y, x, feat_shallow_poisonous_puddle);
+ set_cave_feat(floor_ptr, y, x, feat_shallow_poisonous_puddle);
break;
case 'G':
- set_cave_feat(y, x, feat_deep_poisonous_puddle);
+ set_cave_feat(floor_ptr, y, x, feat_deep_poisonous_puddle);
break;
case 'h':
- set_cave_feat(y, x, feat_cold_zone);
+ set_cave_feat(floor_ptr, y, x, feat_cold_zone);
break;
case 'H':
- set_cave_feat(y, x, feat_heavy_cold_zone);
+ set_cave_feat(floor_ptr, y, x, feat_heavy_cold_zone);
break;
case 'i':
- set_cave_feat(y, x, feat_electrical_zone);
+ set_cave_feat(floor_ptr, y, x, feat_electrical_zone);
break;
case 'I':
- set_cave_feat(y, x, feat_heavy_electrical_zone);
+ set_cave_feat(floor_ptr, y, x, feat_heavy_electrical_zone);
break;
}
/* Flip / rotate */
coord_trans(&i, &j, xoffset, yoffset, transno);
- /* Extract the location */
if (transno % 2 == 0)
{
/* no swap of x/y */
/* Analyze the symbol */
switch (*t)
{
- /* Monster */
- case '&':
- {
- monster_level = current_floor_ptr->base_level + 5;
- place_monster(y, x, (PM_ALLOW_SLEEP | PM_ALLOW_GROUP));
- monster_level = current_floor_ptr->base_level;
- break;
- }
-
- /* Meaner monster */
- case '@':
- {
- monster_level = current_floor_ptr->base_level + 11;
- place_monster(y, x, (PM_ALLOW_SLEEP | PM_ALLOW_GROUP));
- monster_level = current_floor_ptr->base_level;
- break;
- }
+ case '&':
+ {
+ floor_ptr->monster_level = floor_ptr->base_level + 5;
+ place_monster(y, x, (PM_ALLOW_SLEEP | PM_ALLOW_GROUP));
+ floor_ptr->monster_level = floor_ptr->base_level;
+ break;
+ }
- /* Meaner monster, plus treasure */
- case '9':
- {
- monster_level = current_floor_ptr->base_level + 9;
- place_monster(y, x, PM_ALLOW_SLEEP);
- monster_level = current_floor_ptr->base_level;
- object_level = current_floor_ptr->base_level + 7;
- place_object(y, x, AM_GOOD);
- object_level = current_floor_ptr->base_level;
- break;
- }
+ /* Meaner monster */
+ case '@':
+ {
+ floor_ptr->monster_level = floor_ptr->base_level + 11;
+ place_monster(y, x, (PM_ALLOW_SLEEP | PM_ALLOW_GROUP));
+ floor_ptr->monster_level = floor_ptr->base_level;
+ break;
+ }
- /* Nasty monster and treasure */
- case '8':
- {
- monster_level = current_floor_ptr->base_level + 40;
- place_monster(y, x, PM_ALLOW_SLEEP);
- monster_level = current_floor_ptr->base_level;
- object_level = current_floor_ptr->base_level + 20;
- place_object(y, x, AM_GOOD | AM_GREAT);
- object_level = current_floor_ptr->base_level;
- break;
- }
+ /* Meaner monster, plus treasure */
+ case '9':
+ {
+ floor_ptr->monster_level = floor_ptr->base_level + 9;
+ place_monster(y, x, PM_ALLOW_SLEEP);
+ floor_ptr->monster_level = floor_ptr->base_level;
+ floor_ptr->object_level = floor_ptr->base_level + 7;
+ place_object(y, x, AM_GOOD);
+ floor_ptr->object_level = floor_ptr->base_level;
+ break;
+ }
- /* Monster and/or object */
- case ',':
- {
- if (randint0(100) < 50)
+ /* Nasty monster and treasure */
+ case '8':
{
- monster_level = current_floor_ptr->base_level + 3;
- place_monster(y, x, (PM_ALLOW_SLEEP | PM_ALLOW_GROUP));
- monster_level = current_floor_ptr->base_level;
+ floor_ptr->monster_level = floor_ptr->base_level + 40;
+ place_monster(y, x, PM_ALLOW_SLEEP);
+ floor_ptr->monster_level = floor_ptr->base_level;
+ floor_ptr->object_level = floor_ptr->base_level + 20;
+ place_object(y, x, AM_GOOD | AM_GREAT);
+ floor_ptr->object_level = floor_ptr->base_level;
+ break;
}
- if (randint0(100) < 50)
+
+ /* Monster and/or object */
+ case ',':
{
- object_level = current_floor_ptr->base_level + 7;
- place_object(y, x, 0L);
- object_level = current_floor_ptr->base_level;
+ if (randint0(100) < 50)
+ {
+ floor_ptr->monster_level = floor_ptr->base_level + 3;
+ place_monster(y, x, (PM_ALLOW_SLEEP | PM_ALLOW_GROUP));
+ floor_ptr->monster_level = floor_ptr->base_level;
+ }
+ if (randint0(100) < 50)
+ {
+ floor_ptr->object_level = floor_ptr->base_level + 7;
+ place_object(y, x, 0L);
+ floor_ptr->object_level = floor_ptr->base_level;
+ }
+ break;
}
- break;
- }
}
}
* @brief タイプ7の部屋…v_info.txtより小型vaultを生成する / Type 7 -- simple vaults (see "v_info.txt")
* @return なし
*/
-bool build_type7(void)
+bool build_type7(floor_type *floor_ptr)
{
vault_type *v_ptr = NULL;
int dummy;
y = v_ptr->hgt;
/* Some huge vault cannot be ratated to fit in the dungeon */
- if (x + 2 > cur_hgt - 2)
+ if (x + 2 > floor_ptr->height - 2)
{
/* Forbid 90 or 270 degree ratation */
transno &= ~1;
msg_format_wizard(CHEAT_DUNGEON, _("小型Vault(%s)を生成しました。", "Lesser vault (%s)."), v_name + v_ptr->name);
/* Hack -- Build the vault */
- build_vault(yval, xval, v_ptr->hgt, v_ptr->wid,
+ build_vault(floor_ptr, yval, xval, v_ptr->hgt, v_ptr->wid,
v_text + v_ptr->text, xoffset, yoffset, transno);
return TRUE;
* @brief タイプ8の部屋…v_info.txtより大型vaultを生成する / Type 8 -- greater vaults (see "v_info.txt")
* @return なし
*/
-bool build_type8(void)
+bool build_type8(floor_type *floor_ptr)
{
vault_type *v_ptr;
int dummy;
y = v_ptr->hgt;
/* Some huge vault cannot be ratated to fit in the dungeon */
- if (x + 2 > cur_hgt - 2)
+ if (x + 2 > floor_ptr->height - 2)
{
/* Forbid 90 or 270 degree ratation */
transno &= ~1;
msg_format_wizard(CHEAT_DUNGEON, _("大型固定Vault(%s)を生成しました。", "Greater vault (%s)."), v_name + v_ptr->name);
/* Hack -- Build the vault */
- build_vault(yval, xval, v_ptr->hgt, v_ptr->wid,
+ build_vault(floor_ptr, yval, xval, v_ptr->hgt, v_ptr->wid,
v_text + v_ptr->text, xoffset, yoffset, transno);
return TRUE;
* This is made by two concentric "crypts" with perpendicular
* walls creating the cross-hairs.
*/
-static void build_target_vault(POSITION x0, POSITION y0, POSITION xsize, POSITION ysize)
+static void build_target_vault(floor_type *floor_ptr, POSITION x0, POSITION y0, POSITION xsize, POSITION ysize)
{
POSITION rad, x, y;
for (y = y0 - rad; y <= y0 + rad; y++)
{
/* clear room flag */
- current_floor_ptr->grid_array[y][x].info &= ~(CAVE_ROOM);
+ floor_ptr->grid_array[y][x].info &= ~(CAVE_ROOM);
/* Vault - so is "icky" */
- current_floor_ptr->grid_array[y][x].info |= CAVE_ICKY;
+ floor_ptr->grid_array[y][x].info |= CAVE_ICKY;
if (dist2(y0, x0, y, x, h1, h2, h3, h4) <= rad - 1)
{
/* inside- so is floor */
- place_floor_bold(y, x);
+ place_floor_bold(floor_ptr, y, x);
}
else
{
if (dist2(y0, x0, y, x, h1, h2, h3, h4) == rad / 2)
{
/* Make an internal wall */
- place_inner_bold(y, x);
+ place_inner_bold(floor_ptr, y, x);
}
}
}
/* Add perpendicular walls */
for (x = x0 - rad; x <= x0 + rad; x++)
{
- place_inner_bold(y0, x);
+ place_inner_bold(floor_ptr, y0, x);
}
for (y = y0 - rad; y <= y0 + rad; y++)
{
- place_inner_bold(y, x0);
+ place_inner_bold(floor_ptr, y, x0);
}
/* Make inner vault */
for (y = y0 - 1; y <= y0 + 1; y++)
{
- place_inner_bold(y, x0 - 1);
- place_inner_bold(y, x0 + 1);
+ place_inner_bold(floor_ptr, y, x0 - 1);
+ place_inner_bold(floor_ptr, y, x0 + 1);
}
for (x = x0 - 1; x <= x0 + 1; x++)
{
- place_inner_bold(y0 - 1, x);
- place_inner_bold(y0 + 1, x);
+ place_inner_bold(floor_ptr, y0 - 1, x);
+ place_inner_bold(floor_ptr, y0 + 1, x);
}
- place_floor_bold(y0, x0);
+ place_floor_bold(floor_ptr, y0, x0);
/* Add doors to vault */
x = (rad - 2) / 4 + 1;
y = rad / 2 + x;
- add_door(x0 + x, y0);
- add_door(x0 + y, y0);
- add_door(x0 - x, y0);
- add_door(x0 - y, y0);
- add_door(x0, y0 + x);
- add_door(x0, y0 + y);
- add_door(x0, y0 - x);
- add_door(x0, y0 - y);
+ add_door(floor_ptr, x0 + x, y0);
+ add_door(floor_ptr, x0 + y, y0);
+ add_door(floor_ptr, x0 - x, y0);
+ add_door(floor_ptr, x0 - y, y0);
+ add_door(floor_ptr, x0, y0 + x);
+ add_door(floor_ptr, x0, y0 + y);
+ add_door(floor_ptr, x0, y0 - x);
+ add_door(floor_ptr, x0, y0 - y);
/* Fill with stuff - medium difficulty */
- fill_treasure(x0 - rad, x0 + rad, y0 - rad, y0 + rad, randint1(3) + 3);
+ fill_treasure(floor_ptr, x0 - rad, x0 + rad, y0 - rad, y0 + rad, randint1(3) + 3);
}
*
* Miniture rooms are then scattered across the vault.
*/
-static void build_elemental_vault(POSITION x0, POSITION y0, POSITION xsiz, POSITION ysiz)
+static void build_elemental_vault(floor_type *floor_ptr, POSITION x0, POSITION y0, POSITION xsiz, POSITION ysiz)
{
int grd, roug;
int c1, c2, c3;
xsize = xhsize * 2;
ysize = yhsize * 2;
- if (current_floor_ptr->dun_level < 25)
+ if (floor_ptr->dun_level < 25)
{
/* Earth vault (Rubble) */
type = LAKE_T_EARTH_VAULT;
}
- else if (current_floor_ptr->dun_level < 50)
+ else if (floor_ptr->dun_level < 50)
{
/* Air vault (Trees) */
type = LAKE_T_AIR_VAULT;
}
- else if (current_floor_ptr->dun_level < 75)
+ else if (floor_ptr->dun_level < 75)
{
/* Water vault (shallow water) */
type = LAKE_T_WATER_VAULT;
c2 = (c1 + c3) / 2;
/* make it */
- generate_hmap(y0, x0, xsize, ysize, grd, roug, c3);
+ generate_hmap(floor_ptr, y0, x0, xsize, ysize, grd, roug, c3);
/* Convert to normal format+ clean up */
- done = generate_lake(y0, x0, xsize, ysize, c1, c2, c3, type);
+ done = generate_lake(floor_ptr, y0, x0, xsize, ysize, c1, c2, c3, type);
}
/* Set icky flag because is a vault */
{
for (y = 0; y <= ysize; y++)
{
- current_floor_ptr->grid_array[y0 - yhsize + y][x0 - xhsize + x].info |= CAVE_ICKY;
+ floor_ptr->grid_array[y0 - yhsize + y][x0 - xhsize + x].info |= CAVE_ICKY;
}
}
/* make a few rooms in the vault */
for (i = 1; i <= (xsize * ysize) / 50; i++)
{
- build_small_room(x0 + randint0(xsize - 4) - xsize / 2 + 2,
+ build_small_room(floor_ptr, x0 + randint0(xsize - 4) - xsize / 2 + 2,
y0 + randint0(ysize - 4) - ysize / 2 + 2);
}
/* Fill with monsters and treasure, low difficulty */
- fill_treasure(x0 - xhsize + 1, x0 - xhsize + xsize - 1,
+ fill_treasure(floor_ptr, x0 - xhsize + 1, x0 - xhsize + xsize - 1,
y0 - yhsize + 1, y0 - yhsize + ysize - 1, randint1(5));
}
#endif /* ALLOW_CAVERNS_AND_LAKES */
* The vault has two entrances on opposite sides to guarantee
* a way to get in even if the vault abuts a side of the dungeon.
*/
-static void build_mini_c_vault(POSITION x0, POSITION y0, POSITION xsize, POSITION ysize)
+static void build_mini_c_vault(floor_type *floor_ptr, POSITION x0, POSITION y0, POSITION xsize, POSITION ysize)
{
POSITION dy, dx;
POSITION y1, x1, y2, x2, y, x, total;
/* generate the room */
for (x = x1 - 2; x <= x2 + 2; x++)
{
- if (!in_bounds(y1 - 2, x)) break;
+ if (!in_bounds(floor_ptr, y1 - 2, x)) break;
- current_floor_ptr->grid_array[y1 - 2][x].info |= (CAVE_ROOM | CAVE_ICKY);
+ floor_ptr->grid_array[y1 - 2][x].info |= (CAVE_ROOM | CAVE_ICKY);
place_outer_noperm_bold(y1 - 2, x);
}
for (x = x1 - 2; x <= x2 + 2; x++)
{
- if (!in_bounds(y2 + 2, x)) break;
+ if (!in_bounds(floor_ptr, y2 + 2, x)) break;
- current_floor_ptr->grid_array[y2 + 2][x].info |= (CAVE_ROOM | CAVE_ICKY);
+ floor_ptr->grid_array[y2 + 2][x].info |= (CAVE_ROOM | CAVE_ICKY);
place_outer_noperm_bold(y2 + 2, x);
}
for (y = y1 - 2; y <= y2 + 2; y++)
{
- if (!in_bounds(y, x1 - 2)) break;
+ if (!in_bounds(floor_ptr, y, x1 - 2)) break;
- current_floor_ptr->grid_array[y][x1 - 2].info |= (CAVE_ROOM | CAVE_ICKY);
+ floor_ptr->grid_array[y][x1 - 2].info |= (CAVE_ROOM | CAVE_ICKY);
place_outer_noperm_bold(y, x1 - 2);
}
for (y = y1 - 2; y <= y2 + 2; y++)
{
- if (!in_bounds(y, x2 + 2)) break;
+ if (!in_bounds(floor_ptr, y, x2 + 2)) break;
- current_floor_ptr->grid_array[y][x2 + 2].info |= (CAVE_ROOM | CAVE_ICKY);
+ floor_ptr->grid_array[y][x2 + 2].info |= (CAVE_ROOM | CAVE_ICKY);
place_outer_noperm_bold(y, x2 + 2);
}
{
for (x = x1 - 1; x <= x2 + 1; x++)
{
- grid_type *g_ptr = ¤t_floor_ptr->grid_array[y][x];
+ grid_type *g_ptr = &floor_ptr->grid_array[y][x];
g_ptr->info |= (CAVE_ROOM | CAVE_ICKY);
{
total = x - x1 + y - y1;
/* If total is odd- and is a floor then make a wall */
- if ((total % 2 == 1) && is_floor_bold(y, x))
+ if ((total % 2 == 1) && is_floor_bold(floor_ptr, y, x))
{
- place_inner_bold(y, x);
+ place_inner_bold(floor_ptr, y, x);
}
}
}
{
/* left and right */
y = randint1(dy) + dy / 2;
- place_inner_bold(y1 + y, x1 - 1);
- place_inner_bold(y1 + y, x2 + 1);
+ place_inner_bold(floor_ptr, y1 + y, x1 - 1);
+ place_inner_bold(floor_ptr, y1 + y, x2 + 1);
}
else
{
/* top and bottom */
x = randint1(dx) + dx / 2;
- place_inner_bold(y1 - 1, x1 + x);
- place_inner_bold(y2 + 1, x1 + x);
+ place_inner_bold(floor_ptr, y1 - 1, x1 + x);
+ place_inner_bold(floor_ptr, y2 + 1, x1 + x);
}
/* Fill with monsters and treasure, highest difficulty */
- fill_treasure(x1, x2, y1, y2, 10);
+ fill_treasure(floor_ptr, x1, x2, y1, y2, 10);
C_KILL(visited, num_vertices, int);
}
*
*This makes a vault that looks like a castle/ city in the dungeon.
*/
-static void build_castle_vault(POSITION x0, POSITION y0, POSITION xsize, POSITION ysize)
+static void build_castle_vault(floor_type *floor_ptr, POSITION x0, POSITION y0, POSITION xsize, POSITION ysize)
{
POSITION dy, dx;
POSITION y1, x1, y2, x2;
{
for (x = x1 - 1; x <= x2 + 1; x++)
{
- current_floor_ptr->grid_array[y][x].info |= (CAVE_ROOM | CAVE_ICKY);
+ floor_ptr->grid_array[y][x].info |= (CAVE_ROOM | CAVE_ICKY);
/* Make everything a floor */
- place_floor_bold(y, x);
+ place_floor_bold(floor_ptr, y, x);
}
}
/* Make the castle */
- build_recursive_room(x1, y1, x2, y2, randint1(5));
+ build_recursive_room(floor_ptr, x1, y1, x2, y2, randint1(5));
/* Fill with monsters and treasure, low difficulty */
- fill_treasure(x1, x2, y1, y2, randint1(3));
+ fill_treasure(floor_ptr, x1, x2, y1, y2, randint1(3));
}
* @brief タイプ10の部屋…ランダム生成vault / Type 10 -- Random vaults
* @return なし
*/
-bool build_type10(void)
+bool build_type10(floor_type *floor_ptr)
{
POSITION y0, x0, xsize, ysize, vtype;
do
{
vtype = randint1(15);
- } while ((d_info[p_ptr->dungeon_idx].flags1 & DF1_NO_CAVE) &&
+ } while ((d_info[floor_ptr->dungeon_idx].flags1 & DF1_NO_CAVE) &&
((vtype == 1) || (vtype == 3) || (vtype == 8) || (vtype == 9) || (vtype == 11)));
#else /* ALLOW_CAVERNS_AND_LAKES */
do
{
vtype = randint1(7);
- } while ((d_info[p_ptr->dungeon_idx].flags1 & DF1_NO_CAVE) &&
+ } while ((d_info[floor_ptr->dungeon_idx].flags1 & DF1_NO_CAVE) &&
((vtype == 1) || (vtype == 3)));
#endif /* ALLOW_CAVERNS_AND_LAKES */
switch (vtype)
{
/* Build an appropriate room */
- case 1: case 9: build_bubble_vault(x0, y0, xsize, ysize); break;
- case 2: case 10: build_room_vault(x0, y0, xsize, ysize); break;
+ case 1: case 9: build_bubble_vault(floor_ptr, x0, y0, xsize, ysize); break;
+ case 2: case 10: build_room_vault(floor_ptr, x0, y0, xsize, ysize); break;
case 3: case 11: build_cave_vault(x0, y0, xsize, ysize); break;
case 4: case 12: build_maze_vault(x0, y0, xsize, ysize, TRUE); break;
- case 5: case 13: build_mini_c_vault(x0, y0, xsize, ysize); break;
- case 6: case 14: build_castle_vault(x0, y0, xsize, ysize); break;
- case 7: case 15: build_target_vault(x0, y0, xsize, ysize); break;
+ case 5: case 13: build_mini_c_vault(floor_ptr, x0, y0, xsize, ysize); break;
+ case 6: case 14: build_castle_vault(floor_ptr, x0, y0, xsize, ysize); break;
+ case 7: case 15: build_target_vault(floor_ptr, x0, y0, xsize, ysize); break;
#ifdef ALLOW_CAVERNS_AND_LAKES
- case 8: build_elemental_vault(x0, y0, xsize, ysize); break;
+ case 8: build_elemental_vault(floor_ptr, x0, y0, xsize, ysize); break;
#endif /* ALLOW_CAVERNS_AND_LAKES */
/* I know how to add a few more... give me some time. */
-
- /* Paranoia */
default: return FALSE;
}
* @brief タイプ17の部屋…v_info.txtより固定特殊部屋を生成する / Type 17 -- fixed special room (see "v_info.txt")
* @return なし
*/
-bool build_type17(void)
+bool build_type17(floor_type *floor_ptr)
{
vault_type *v_ptr = NULL;
int dummy;
y = v_ptr->hgt;
/* Some huge vault cannot be ratated to fit in the dungeon */
- if (x + 2 > cur_hgt - 2)
+ if (x + 2 > floor_ptr->height - 2)
{
/* Forbid 90 or 270 degree ratation */
transno &= ~1;
msg_format_wizard(CHEAT_DUNGEON, _("特殊固定部屋(%s)を生成しました。", "Special Fix room (%s)."), v_name + v_ptr->name);
/* Hack -- Build the vault */
- build_vault(yval, xval, v_ptr->hgt, v_ptr->wid,
+ build_vault(floor_ptr, yval, xval, v_ptr->hgt, v_ptr->wid,
v_text + v_ptr->text, xoffset, yoffset, transno);
return TRUE;