case ALLOC_TYP_GOLD:
{
- place_gold(y, x);
+ place_gold(floor_ptr, y, x);
break;
}
}
else
{
- place_gold(j, k);
+ place_gold(floor_ptr, j, k);
}
/* Placement accomplished */
}
}
+
+
+/*!
+ * @brief フロアの指定位置に生成階に応じた財宝オブジェクトの生成を行う。
+ * Places a treasure (Gold or Gems) at given location
+ * @param y 配置したいフロアのY座標
+ * @param x 配置したいフロアのX座標
+ * @return 生成に成功したらTRUEを返す。
+ * @details
+ * The location must be a legal, clean, floor grid.
+ */
+void place_gold(floor_type *floor_ptr, POSITION y, POSITION x)
+{
+ OBJECT_IDX o_idx;
+
+ /* Acquire grid */
+ grid_type *g_ptr = &floor_ptr->grid_array[y][x];
+
+ object_type forge;
+ object_type *q_ptr;
+
+
+ /* Paranoia -- check bounds */
+ if (!in_bounds(floor_ptr, y, x)) return;
+
+ /* Require floor space */
+ if (!cave_drop_bold(floor_ptr, y, x)) return;
+
+ /* Avoid stacking on other objects */
+ if (g_ptr->o_idx) return;
+
+ q_ptr = &forge;
+ object_wipe(q_ptr);
+
+ /* Make some gold */
+ if (!make_gold(q_ptr)) return;
+
+ o_idx = o_pop();
+
+ /* Success */
+ if (o_idx)
+ {
+ object_type *o_ptr;
+ o_ptr = &floor_ptr->o_list[o_idx];
+ object_copy(o_ptr, q_ptr);
+
+ /* Save location */
+ o_ptr->iy = y;
+ o_ptr->ix = x;
+
+ /* Build a stack */
+ o_ptr->next_o_idx = g_ptr->o_idx;
+
+ g_ptr->o_idx = o_idx;
+ note_spot(y, x);
+ lite_spot(y, x);
+ }
+}
extern void set_floor(floor_type *floor_ptr, POSITION x, POSITION y);
extern void place_object(floor_type *floor_ptr, POSITION y, POSITION x, BIT_FLAGS mode);
-
+extern void place_gold(floor_type *floor_ptr, POSITION y, POSITION x);
if (have_flag(old_f_ptr->flags, FF_HAS_GOLD) && !have_flag(f_ptr->flags, FF_HAS_GOLD))
{
/* Place some gold */
- place_gold(y, x);
+ place_gold(p_ptr->current_floor_ptr, y, x);
found = TRUE;
}
extern bool make_object(object_type *j_ptr, BIT_FLAGS mode);
extern bool make_gold(object_type *j_ptr);
-extern void place_gold(POSITION y, POSITION x);
extern OBJECT_IDX drop_near(object_type *o_ptr, PERCENTAGE chance, POSITION y, POSITION x);
extern void vary_item(INVENTORY_IDX item, ITEM_NUMBER num);
extern void inven_item_charges(INVENTORY_IDX item);
/*!
- * @brief フロアの指定位置に生成階に応じた財宝オブジェクトの生成を行う。
- * Places a treasure (Gold or Gems) at given location
- * @param y 配置したいフロアのY座標
- * @param x 配置したいフロアのX座標
- * @return 生成に成功したらTRUEを返す。
- * @details
- * The location must be a legal, clean, floor grid.
- */
-void place_gold(POSITION y, POSITION x)
-{
- OBJECT_IDX o_idx;
-
- /* Acquire grid */
- grid_type *g_ptr = &p_ptr->current_floor_ptr->grid_array[y][x];
-
- object_type forge;
- object_type *q_ptr;
-
-
- /* Paranoia -- check bounds */
- if (!in_bounds(p_ptr->current_floor_ptr, y, x)) return;
-
- /* Require floor space */
- if (!cave_drop_bold(p_ptr->current_floor_ptr, y, x)) return;
-
- /* Avoid stacking on other objects */
- if (g_ptr->o_idx) return;
-
- q_ptr = &forge;
- object_wipe(q_ptr);
-
- /* Make some gold */
- if (!make_gold(q_ptr)) return;
-
- o_idx = o_pop();
-
- /* Success */
- if (o_idx)
- {
- object_type *o_ptr;
- o_ptr = &p_ptr->current_floor_ptr->o_list[o_idx];
- object_copy(o_ptr, q_ptr);
-
- /* Save location */
- o_ptr->iy = y;
- o_ptr->ix = x;
-
- /* Build a stack */
- o_ptr->next_o_idx = g_ptr->o_idx;
-
- g_ptr->o_idx = o_idx;
- note_spot(y, x);
- lite_spot(y, x);
- }
-}
-
-
-/*!
* @brief 生成済のオブジェクトをフロアの所定の位置に落とす。
* Let an object fall to the ground at or near a location.
* @param j_ptr 落としたいオブジェクト構造体の参照ポインタ