else return newfeat;
}
+
+/*!
+ * @brief 特殊な部屋向けに各種アイテムを配置する / Create up to "num" objects near the given coordinates
+ * @param y 配置したい中心マスのY座標
+ * @param x 配置したい中心マスのX座標
+ * @param num 配置したい数
+ * @return なし
+ * @details
+ * Only really called by some of the "vault" routines.
+ */
+void vault_objects(floor_type *floor_ptr, POSITION y, POSITION x, int num)
+{
+ int dummy = 0;
+ int i = 0, j = y, k = x;
+
+ grid_type *g_ptr;
+
+
+ /* Attempt to place 'num' objects */
+ for (; num > 0; --num)
+ {
+ /* Try up to 11 spots looking for empty space */
+ for (i = 0; i < 11; ++i)
+ {
+ /* Pick a random location */
+ while (dummy < SAFE_MAX_ATTEMPTS)
+ {
+ j = rand_spread(y, 2);
+ k = rand_spread(x, 3);
+ dummy++;
+ if (!in_bounds(floor_ptr, j, k)) continue;
+ break;
+ }
+
+ if (dummy >= SAFE_MAX_ATTEMPTS && cheat_room)
+ {
+ msg_print(_("警告!地下室のアイテムを配置できません!", "Warning! Could not place vault object!"));
+ }
+
+ /* Require "clean" floor space */
+ g_ptr = &floor_ptr->grid_array[j][k];
+ if (!is_floor_grid(g_ptr) || g_ptr->o_idx) continue;
+
+ if (randint0(100) < 75)
+ {
+ place_object(j, k, 0L);
+ }
+ else
+ {
+ place_gold(j, k);
+ }
+
+ /* Placement accomplished */
+ break;
+ }
+ }
+}
+
extern void try_door(floor_type *floor_ptr, POSITION y, POSITION x);
extern FEAT_IDX conv_dungeon_feat(floor_type *floor_ptr, FEAT_IDX newfeat);
+extern void vault_objects(floor_type *floor_ptr, POSITION y, POSITION x, int num);
+
}
/*!
- * @brief 特殊な部屋向けに各種アイテムを配置する / Create up to "num" objects near the given coordinates
- * @param y 配置したい中心マスのY座標
- * @param x 配置したい中心マスのX座標
- * @param num 配置したい数
- * @return なし
- * @details
- * Only really called by some of the "vault" routines.
- */
-void vault_objects(POSITION y, POSITION x, int num)
-{
- int dummy = 0;
- int i = 0, j = y, k = x;
-
- grid_type *g_ptr;
-
-
- /* Attempt to place 'num' objects */
- for (; num > 0; --num)
- {
- /* Try up to 11 spots looking for empty space */
- for (i = 0; i < 11; ++i)
- {
- /* Pick a random location */
- while (dummy < SAFE_MAX_ATTEMPTS)
- {
- j = rand_spread(y, 2);
- k = rand_spread(x, 3);
- dummy++;
- if (!in_bounds(p_ptr->current_floor_ptr, j, k)) continue;
- break;
- }
-
- if (dummy >= SAFE_MAX_ATTEMPTS && cheat_room)
- {
- msg_print(_("警告!地下室のアイテムを配置できません!", "Warning! Could not place vault object!"));
- }
-
- /* Require "clean" floor space */
- g_ptr = &p_ptr->current_floor_ptr->grid_array[j][k];
- if (!is_floor_grid(g_ptr) || g_ptr->o_idx) continue;
-
- if (randint0(100) < 75)
- {
- place_object(j, k, 0L);
- }
- else
- {
- place_gold(j, k);
- }
-
- /* Placement accomplished */
- break;
- }
- }
-}
-
-
-/*!
* @brief 特殊な部屋向けに各種アイテムを配置する(メインルーチン) / Place some traps with a given displacement of given location
* @param y トラップを配置したいマスの中心Y座標
* @param x トラップを配置したいマスの中心X座標
#define MAX_DOOR_TYPES 3
-extern void vault_objects(POSITION y, POSITION x, int num);
extern void vault_traps(POSITION y, POSITION x, POSITION yd, POSITION xd, int num);
extern void set_floor(POSITION x, POSITION y);
vault_traps(yval, xval + 3, 2, 8, randint1(3));
/* Mazes should have some treasure too. */
- vault_objects(yval, xval, 3);
+ vault_objects(floor_ptr, yval, xval, 3);
break;
}
}
/* Treasure, centered at the center of the cross */
- vault_objects(yval, xval, 2 + randint1(2));
+ vault_objects(floor_ptr, yval, xval, 2 + randint1(2));
/* Gotta have some monsters. */
vault_monsters(floor_ptr, yval + 1, xval - 4, randint1(4));