OSDN Git Service

[Refactor] #40399 Moved floor_item_charges() from object2.c/h tofloor-object.c/h
authorHourier <hourier@users.sourceforge.jp>
Tue, 2 Jun 2020 12:22:59 +0000 (21:22 +0900)
committerHourier <hourier@users.sourceforge.jp>
Tue, 2 Jun 2020 13:23:23 +0000 (22:23 +0900)
21 files changed:
src/cmd-action/cmd-attack.c
src/cmd-item/cmd-eat.c
src/cmd-item/cmd-usestaff.c
src/cmd-item/cmd-zapwand.c
src/combat/shoot.c
src/dungeon/quest.c
src/effect/effect-item.c
src/effect/effect-monster.c
src/floor/floor-object.c
src/floor/floor-object.h
src/inventory/inventory-damage.c
src/inventory/pack-overflow.c
src/monster/monster-object.c
src/monster/monster2.c
src/object/artifact.c
src/object/chest.c
src/object/object2.c
src/object/object2.h
src/player/player-status.c
src/realm/realm-nature.c
src/spell/spells-status.c

index 707387d..16375b4 100644 (file)
@@ -14,7 +14,6 @@
 #include "monster/monster-status.h"
 #include "object/artifact.h"
 #include "object/item-use-flags.h"
-#include "object/object2.h"
 #include "player/avatar.h"
 #include "player/player-damage.h"
 #include "player/player-effects.h"
index c6b12ec..74ba189 100644 (file)
@@ -5,6 +5,7 @@
  */
 
 #include "cmd-item/cmd-eat.h"
+#include "floor/floor-object.h"
 #include "floor/floor.h"
 #include "inventory/inventory-object.h"
 #include "inventory/player-inventory.h"
index 3bc9449..1ca3b9f 100644 (file)
@@ -1,5 +1,6 @@
 #include "cmd-item/cmd-usestaff.h"
 #include "cmd/cmd-basic.h"
+#include "floor/floor-object.h"
 #include "floor/floor.h"
 #include "inventory/inventory-object.h"
 #include "inventory/player-inventory.h"
@@ -9,7 +10,6 @@
 #include "object/object-generator.h"
 #include "object/object-hook.h"
 #include "object/object-kind.h"
-#include "object/object2.h"
 #include "object/special-object-flags.h"
 #include "object/sv-staff-types.h"
 #include "player/avatar.h"
index 42baf37..54f22a8 100644 (file)
@@ -1,5 +1,6 @@
 #include "cmd-item/cmd-zapwand.h"
 #include "cmd/cmd-basic.h"
+#include "floor/floor-object.h"
 #include "floor/floor.h"
 #include "inventory/player-inventory.h"
 #include "io/targeting.h"
@@ -8,7 +9,6 @@
 #include "object/object-appraiser.h"
 #include "object/object-hook.h"
 #include "object/object-kind.h"
-#include "object/object2.h"
 #include "object/special-object-flags.h"
 #include "object/sv-wand-types.h"
 #include "player/avatar.h"
index cc6bd55..dab684f 100644 (file)
@@ -3,6 +3,7 @@
 #include "core/stuff-handler.h"
 #include "effect/effect-characteristics.h"
 #include "effect/spells-effect-util.h"
+#include "floor/floor-object.h"
 #include "grid/grid.h"
 #include "inventory/inventory-object.h"
 #include "io/targeting.h"
@@ -17,7 +18,6 @@
 #include "object/object-hook.h"
 #include "object/object-kind.h"
 #include "object/object-mark-types.h"
-#include "object/object2.h"
 #include "object/sv-bow-types.h"
 #include "object/tr-types.h"
 #include "player/avatar.h"
index 8576950..a04be45 100644 (file)
@@ -15,7 +15,6 @@
 #include "object/artifact.h"
 #include "object/item-apply-magic.h"
 #include "object/object-generator.h"
-#include "object/object2.h"
 #include "player/player-personalities-table.h"
 #include "player/player-status.h"
 #include "system/system-variables.h"
index 178bd6d..d048dc9 100644 (file)
@@ -6,7 +6,6 @@
 #include "object/object-flavor.h"
 #include "object/object-hook.h"
 #include "object/object-mark-types.h"
-#include "object/object2.h"
 #include "object/sv-other-types.h"
 #include "object/sv-scroll-types.h"
 #include "object/tr-types.h"
index 023f56c..d5771be 100644 (file)
@@ -13,6 +13,7 @@
 #include "core/stuff-handler.h"
 #include "effect/effect-monster-util.h"
 #include "effect/effect-monster-switcher.h"
+#include "floor/floor-object.h"
 #include "monster/monster-status.h"
 #include "player/avatar.h"
 #include "spell/spells-type.h"
index 71e16ef..f9ec85e 100644 (file)
@@ -5,6 +5,7 @@
  */
 
 #include "floor/floor-object.h"
+#include "main/sound-definitions-table.h"
 #include "object/artifact.h"
 #include "object/item-apply-magic.h"
 #include "object/object-appraiser.h"
@@ -16,6 +17,8 @@
 #include "object/object2.h"
 #include "object/special-object-flags.h"
 #include "view/object-describer.h"
+#include "world/world-object.h"
+#include "world/world.h"
 
 #define MAX_GOLD 18 /* Number of "gold" entries */
 
@@ -298,3 +301,270 @@ void excise_object_idx(floor_type *floor_ptr, OBJECT_IDX o_idx)
         break;
     }
 }
+
+/*!
+ * @brief 生成済のオブジェクトをフロアの所定の位置に落とす。
+ * Let an object fall to the ground at or near a location.
+ * @param owner_ptr プレーヤーへの参照ポインタ
+ * @param j_ptr 落としたいオブジェクト構造体の参照ポインタ
+ * @param chance ドロップの消滅率(%)
+ * @param y 配置したいフロアのY座標
+ * @param x 配置したいフロアのX座標
+ * @return 生成に成功したらオブジェクトのIDを返す。
+ * @details
+ * The initial location is assumed to be "in_bounds(floor_ptr, )".\n
+ *\n
+ * This function takes a parameter "chance".  This is the percentage\n
+ * chance that the item will "disappear" instead of drop.  If the object\n
+ * has been thrown, then this is the chance of disappearance on contact.\n
+ *\n
+ * Hack -- this function uses "chance" to determine if it should produce\n
+ * some form of "description" of the drop event (under the player).\n
+ *\n
+ * We check several locations to see if we can find a location at which\n
+ * the object can combine, stack, or be placed.  Artifacts will try very\n
+ * hard to be placed, including "teleporting" to a useful grid if needed.\n
+ */
+OBJECT_IDX drop_near(player_type *owner_ptr, object_type *j_ptr, PERCENTAGE chance, POSITION y, POSITION x)
+{
+    int i, k, d, s;
+    POSITION dy, dx;
+    POSITION ty, tx = 0;
+    OBJECT_IDX o_idx = 0;
+    OBJECT_IDX this_o_idx, next_o_idx = 0;
+    grid_type *g_ptr;
+    GAME_TEXT o_name[MAX_NLEN];
+    bool flag = FALSE;
+    bool done = FALSE;
+#ifdef JP
+#else
+    bool plural = (j_ptr->number != 1);
+#endif
+    object_desc(owner_ptr, o_name, j_ptr, (OD_OMIT_PREFIX | OD_NAME_ONLY));
+    if (!object_is_artifact(j_ptr) && (randint0(100) < chance)) {
+#ifdef JP
+        msg_format("%sは消えた。", o_name);
+#else
+        msg_format("The %s disappear%s.", o_name, (plural ? "" : "s"));
+#endif
+        if (current_world_ptr->wizard)
+            msg_print(_("(破損)", "(breakage)"));
+
+        return 0;
+    }
+
+    int bs = -1;
+    int bn = 0;
+
+    POSITION by = y;
+    POSITION bx = x;
+    floor_type *floor_ptr = owner_ptr->current_floor_ptr;
+    for (dy = -3; dy <= 3; dy++) {
+        for (dx = -3; dx <= 3; dx++) {
+            bool comb = FALSE;
+            d = (dy * dy) + (dx * dx);
+            if (d > 10)
+                continue;
+
+            ty = y + dy;
+            tx = x + dx;
+            if (!in_bounds(floor_ptr, ty, tx))
+                continue;
+            if (!projectable(owner_ptr, y, x, ty, tx))
+                continue;
+
+            g_ptr = &floor_ptr->grid_array[ty][tx];
+            if (!cave_drop_bold(floor_ptr, ty, tx))
+                continue;
+
+            k = 0;
+            for (this_o_idx = g_ptr->o_idx; this_o_idx; this_o_idx = next_o_idx) {
+                object_type *o_ptr;
+                o_ptr = &floor_ptr->o_list[this_o_idx];
+                next_o_idx = o_ptr->next_o_idx;
+                if (object_similar(o_ptr, j_ptr))
+                    comb = TRUE;
+
+                k++;
+            }
+
+            if (!comb)
+                k++;
+            if (k > 99)
+                continue;
+
+            s = 1000 - (d + k * 5);
+            if (s < bs)
+                continue;
+
+            if (s > bs)
+                bn = 0;
+
+            if ((++bn >= 2) && !one_in_(bn))
+                continue;
+
+            bs = s;
+            by = ty;
+            bx = tx;
+
+            flag = TRUE;
+        }
+    }
+
+    if (!flag && !object_is_artifact(j_ptr)) {
+#ifdef JP
+        msg_format("%sは消えた。", o_name);
+#else
+        msg_format("The %s disappear%s.", o_name, (plural ? "" : "s"));
+#endif
+        if (current_world_ptr->wizard)
+            msg_print(_("(床スペースがない)", "(no floor space)"));
+
+        return 0;
+    }
+
+    for (i = 0; !flag && (i < 1000); i++) {
+        ty = rand_spread(by, 1);
+        tx = rand_spread(bx, 1);
+
+        if (!in_bounds(floor_ptr, ty, tx))
+            continue;
+
+        by = ty;
+        bx = tx;
+
+        if (!cave_drop_bold(floor_ptr, by, bx))
+            continue;
+
+        flag = TRUE;
+    }
+
+    if (!flag) {
+        int candidates = 0, pick;
+        for (ty = 1; ty < floor_ptr->height - 1; ty++) {
+            for (tx = 1; tx < floor_ptr->width - 1; tx++) {
+                if (cave_drop_bold(floor_ptr, ty, tx))
+                    candidates++;
+            }
+        }
+
+        if (!candidates) {
+#ifdef JP
+            msg_format("%sは消えた。", o_name);
+#else
+            msg_format("The %s disappear%s.", o_name, (plural ? "" : "s"));
+#endif
+
+            if (current_world_ptr->wizard)
+                msg_print(_("(床スペースがない)", "(no floor space)"));
+
+            if (preserve_mode) {
+                if (object_is_fixed_artifact(j_ptr) && !object_is_known(j_ptr)) {
+                    a_info[j_ptr->name1].cur_num = 0;
+                }
+            }
+
+            return 0;
+        }
+
+        pick = randint1(candidates);
+        for (ty = 1; ty < floor_ptr->height - 1; ty++) {
+            for (tx = 1; tx < floor_ptr->width - 1; tx++) {
+                if (cave_drop_bold(floor_ptr, ty, tx)) {
+                    pick--;
+                    if (!pick)
+                        break;
+                }
+            }
+
+            if (!pick)
+                break;
+        }
+
+        by = ty;
+        bx = tx;
+    }
+
+    g_ptr = &floor_ptr->grid_array[by][bx];
+    for (this_o_idx = g_ptr->o_idx; this_o_idx; this_o_idx = next_o_idx) {
+        object_type *o_ptr;
+        o_ptr = &floor_ptr->o_list[this_o_idx];
+        next_o_idx = o_ptr->next_o_idx;
+        if (object_similar(o_ptr, j_ptr)) {
+            object_absorb(o_ptr, j_ptr);
+            done = TRUE;
+            break;
+        }
+    }
+
+    if (!done)
+        o_idx = o_pop(floor_ptr);
+
+    if (!done && !o_idx) {
+#ifdef JP
+        msg_format("%sは消えた。", o_name);
+#else
+        msg_format("The %s disappear%s.", o_name, (plural ? "" : "s"));
+#endif
+        if (current_world_ptr->wizard)
+            msg_print(_("(アイテムが多過ぎる)", "(too many objects)"));
+
+        if (object_is_fixed_artifact(j_ptr)) {
+            a_info[j_ptr->name1].cur_num = 0;
+        }
+
+        return 0;
+    }
+
+    if (!done) {
+        object_copy(&floor_ptr->o_list[o_idx], j_ptr);
+        j_ptr = &floor_ptr->o_list[o_idx];
+        j_ptr->iy = by;
+        j_ptr->ix = bx;
+        j_ptr->held_m_idx = 0;
+        j_ptr->next_o_idx = g_ptr->o_idx;
+
+        g_ptr->o_idx = o_idx;
+        done = TRUE;
+    }
+
+    note_spot(owner_ptr, by, bx);
+    lite_spot(owner_ptr, by, bx);
+    sound(SOUND_DROP);
+
+    if (chance && player_bold(owner_ptr, by, bx)) {
+        msg_print(_("何かが足下に転がってきた。", "You feel something roll beneath your feet."));
+    }
+
+    return o_idx;
+}
+
+/*!
+ * @brief 床上の魔道具の残り残量メッセージを表示する /
+ * Describe the charges on an item on the floor.
+ * @param floo_ptr 現在フロアへの参照ポインタ
+ * @param item メッセージの対象にしたいアイテム所持スロット
+ * @return なし
+ */
+void floor_item_charges(floor_type *floor_ptr, INVENTORY_IDX item)
+{
+    object_type *o_ptr = &floor_ptr->o_list[item];
+    if ((o_ptr->tval != TV_STAFF) && (o_ptr->tval != TV_WAND))
+        return;
+    if (!object_is_known(o_ptr))
+        return;
+
+#ifdef JP
+    if (o_ptr->pval <= 0) {
+        msg_print("この床上のアイテムは、もう魔力が残っていない。");
+    } else {
+        msg_format("この床上のアイテムは、あと %d 回分の魔力が残っている。", o_ptr->pval);
+    }
+#else
+    if (o_ptr->pval != 1) {
+        msg_format("There are %d charges remaining.", o_ptr->pval);
+    } else {
+        msg_format("There is %d charge remaining.", o_ptr->pval);
+    }
+#endif
+}
index f887040..3cadd96 100644 (file)
@@ -10,3 +10,5 @@ void floor_item_increase(floor_type *floor_ptr, INVENTORY_IDX item, ITEM_NUMBER
 void floor_item_optimize(player_type *owner_ptr, INVENTORY_IDX item);
 void delete_object_idx(player_type *owner_ptr, OBJECT_IDX o_idx);
 void excise_object_idx(floor_type *floor_ptr, OBJECT_IDX o_idx);
+OBJECT_IDX drop_near(player_type *owner_type, object_type *o_ptr, PERCENTAGE chance, POSITION y, POSITION x);
+void floor_item_charges(floor_type *owner_ptr, INVENTORY_IDX item);
index 9ab7c4d..a1ecf71 100644 (file)
@@ -1,4 +1,5 @@
 #include "inventory/inventory-damage.h"
+#include "floor/floor.h"
 #include "inventory/inventory-object.h"
 #include "mind/racial-mirror-master.h"
 #include "object/artifact.h"
index 8b78d3b..9c45217 100644 (file)
@@ -1,8 +1,8 @@
 #include "system/angband.h"
+#include "floor/floor-object.h"
 #include "inventory/inventory-object.h"
 #include "inventory/pack-overflow.h"
 #include "player/player-move.h"
-#include "object/object2.h"
 #include "object/object-flavor.h"
 #include "core/stuff-handler.h"
 
index 2264a0d..f22c263 100644 (file)
@@ -6,7 +6,6 @@
 
 #include "monster/monster-object.h"
 #include "floor/floor-object.h"
-#include "object/object2.h"
 #include "object/object-flavor.h"
 #include "object/object-hook.h"
 #include "object/object-mark-types.h"
index 9c99dd3..48dbba5 100644 (file)
@@ -21,7 +21,6 @@
 #include "dungeon/dungeon.h"
 #include "effect/effect-characteristics.h"
 #include "floor/floor-object.h"
-#include "object/object2.h"
 #include "object/object-flavor.h"
 #include "object/object-generator.h"
 #include "monster/monster-race-hook.h"
index 34a9cbb..c402532 100644 (file)
@@ -13,6 +13,7 @@
 #include "object/artifact.h"
 #include "cmd-item/cmd-activate.h"
 #include "cmd-item/cmd-smith.h"
+#include "floor/floor-object.h"
 #include "floor/floor.h"
 #include "grid/grid.h"
 #include "io/files-util.h"
index d90fd54..2069865 100644 (file)
@@ -7,7 +7,6 @@
 #include "object/item-apply-magic.h"
 #include "object/object-appraiser.h"
 #include "object/object-generator.h"
-#include "object/object2.h"
 #include "object/sv-other-types.h"
 #include "player/player-class.h"
 #include "player/player-damage.h"
index 730cffa..91967b1 100644 (file)
@@ -2701,281 +2701,6 @@ void apply_magic(player_type *owner_ptr, object_type *o_ptr, DEPTH lev, BIT_FLAG
 
 
 /*!
- * @brief 生成済のオブジェクトをフロアの所定の位置に落とす。
- * Let an object fall to the ground at or near a location.
- * @param owner_ptr プレーヤーへの参照ポインタ
- * @param j_ptr 落としたいオブジェクト構造体の参照ポインタ
- * @param chance ドロップの消滅率(%)
- * @param y 配置したいフロアのY座標
- * @param x 配置したいフロアのX座標
- * @return 生成に成功したらオブジェクトのIDを返す。
- * @details
- * The initial location is assumed to be "in_bounds(floor_ptr, )".\n
- *\n
- * This function takes a parameter "chance".  This is the percentage\n
- * chance that the item will "disappear" instead of drop.  If the object\n
- * has been thrown, then this is the chance of disappearance on contact.\n
- *\n
- * Hack -- this function uses "chance" to determine if it should produce\n
- * some form of "description" of the drop event (under the player).\n
- *\n
- * We check several locations to see if we can find a location at which\n
- * the object can combine, stack, or be placed.  Artifacts will try very\n
- * hard to be placed, including "teleporting" to a useful grid if needed.\n
- */
-OBJECT_IDX drop_near(player_type *owner_ptr, object_type *j_ptr, PERCENTAGE chance, POSITION y, POSITION x)
-{
-       int i, k, d, s;
-       POSITION dy, dx;
-       POSITION ty, tx = 0;
-       OBJECT_IDX o_idx = 0;
-       OBJECT_IDX this_o_idx, next_o_idx = 0;
-       grid_type *g_ptr;
-       GAME_TEXT o_name[MAX_NLEN];
-       bool flag = FALSE;
-       bool done = FALSE;
-#ifdef JP
-#else
-       bool plural = (j_ptr->number != 1);
-#endif
-       object_desc(owner_ptr, o_name, j_ptr, (OD_OMIT_PREFIX | OD_NAME_ONLY));
-       if (!object_is_artifact(j_ptr) && (randint0(100) < chance))
-       {
-#ifdef JP
-               msg_format("%sは消えた。", o_name);
-#else
-               msg_format("The %s disappear%s.", o_name, (plural ? "" : "s"));
-#endif
-               if (current_world_ptr->wizard) msg_print(_("(破損)", "(breakage)"));
-
-               return 0;
-       }
-
-       int bs = -1;
-       int bn = 0;
-
-       POSITION by = y;
-       POSITION bx = x;
-       floor_type *floor_ptr = owner_ptr->current_floor_ptr;
-       for (dy = -3; dy <= 3; dy++)
-       {
-               for (dx = -3; dx <= 3; dx++)
-               {
-                       bool comb = FALSE;
-                       d = (dy * dy) + (dx * dx);
-                       if (d > 10) continue;
-
-                       ty = y + dy;
-                       tx = x + dx;
-                       if (!in_bounds(floor_ptr, ty, tx)) continue;
-                       if (!projectable(owner_ptr, y, x, ty, tx)) continue;
-
-                       g_ptr = &floor_ptr->grid_array[ty][tx];
-                       if (!cave_drop_bold(floor_ptr, ty, tx)) continue;
-
-                       k = 0;
-                       for (this_o_idx = g_ptr->o_idx; this_o_idx; this_o_idx = next_o_idx)
-                       {
-                               object_type *o_ptr;
-                               o_ptr = &floor_ptr->o_list[this_o_idx];
-                               next_o_idx = o_ptr->next_o_idx;
-                               if (object_similar(o_ptr, j_ptr)) comb = TRUE;
-
-                               k++;
-                       }
-
-                       if (!comb) k++;
-                       if (k > 99) continue;
-
-                       s = 1000 - (d + k * 5);
-                       if (s < bs) continue;
-
-                       if (s > bs) bn = 0;
-
-                       if ((++bn >= 2) && !one_in_(bn)) continue;
-
-                       bs = s;
-                       by = ty;
-                       bx = tx;
-
-                       flag = TRUE;
-               }
-       }
-
-       if (!flag && !object_is_artifact(j_ptr))
-       {
-#ifdef JP
-               msg_format("%sは消えた。", o_name);
-#else
-               msg_format("The %s disappear%s.", o_name, (plural ? "" : "s"));
-#endif
-               if (current_world_ptr->wizard) msg_print(_("(床スペースがない)", "(no floor space)"));
-
-               return 0;
-       }
-
-       for (i = 0; !flag && (i < 1000); i++)
-       {
-               ty = rand_spread(by, 1);
-               tx = rand_spread(bx, 1);
-
-               if (!in_bounds(floor_ptr, ty, tx)) continue;
-
-               by = ty;
-               bx = tx;
-
-               if (!cave_drop_bold(floor_ptr, by, bx)) continue;
-
-               flag = TRUE;
-       }
-
-       if (!flag)
-       {
-               int candidates = 0, pick;
-               for (ty = 1; ty < floor_ptr->height - 1; ty++)
-               {
-                       for (tx = 1; tx < floor_ptr->width - 1; tx++)
-                       {
-                               if (cave_drop_bold(floor_ptr, ty, tx)) candidates++;
-                       }
-               }
-
-               if (!candidates)
-               {
-#ifdef JP
-                       msg_format("%sは消えた。", o_name);
-#else
-                       msg_format("The %s disappear%s.", o_name, (plural ? "" : "s"));
-#endif
-
-                       if (current_world_ptr->wizard) msg_print(_("(床スペースがない)", "(no floor space)"));
-
-                       if (preserve_mode)
-                       {
-                               if (object_is_fixed_artifact(j_ptr) && !object_is_known(j_ptr))
-                               {
-                                       a_info[j_ptr->name1].cur_num = 0;
-                               }
-                       }
-
-                       return 0;
-               }
-
-               pick = randint1(candidates);
-               for (ty = 1; ty < floor_ptr->height - 1; ty++)
-               {
-                       for (tx = 1; tx < floor_ptr->width - 1; tx++)
-                       {
-                               if (cave_drop_bold(floor_ptr, ty, tx))
-                               {
-                                       pick--;
-                                       if (!pick) break;
-                               }
-                       }
-
-                       if (!pick) break;
-               }
-
-               by = ty;
-               bx = tx;
-       }
-
-
-       g_ptr = &floor_ptr->grid_array[by][bx];
-       for (this_o_idx = g_ptr->o_idx; this_o_idx; this_o_idx = next_o_idx)
-       {
-               object_type *o_ptr;
-               o_ptr = &floor_ptr->o_list[this_o_idx];
-               next_o_idx = o_ptr->next_o_idx;
-               if (object_similar(o_ptr, j_ptr))
-               {
-                       object_absorb(o_ptr, j_ptr);
-                       done = TRUE;
-                       break;
-               }
-       }
-
-       if (!done) o_idx = o_pop(floor_ptr);
-
-       if (!done && !o_idx)
-       {
-#ifdef JP
-               msg_format("%sは消えた。", o_name);
-#else
-               msg_format("The %s disappear%s.", o_name, (plural ? "" : "s"));
-#endif
-               if (current_world_ptr->wizard) msg_print(_("(アイテムが多過ぎる)", "(too many objects)"));
-
-               if (object_is_fixed_artifact(j_ptr))
-               {
-                       a_info[j_ptr->name1].cur_num = 0;
-               }
-
-               return 0;
-       }
-
-       if (!done)
-       {
-               object_copy(&floor_ptr->o_list[o_idx], j_ptr);
-               j_ptr = &floor_ptr->o_list[o_idx];
-               j_ptr->iy = by;
-               j_ptr->ix = bx;
-               j_ptr->held_m_idx = 0;
-               j_ptr->next_o_idx = g_ptr->o_idx;
-
-               g_ptr->o_idx = o_idx;
-               done = TRUE;
-       }
-
-       note_spot(owner_ptr, by, bx);
-       lite_spot(owner_ptr, by, bx);
-       sound(SOUND_DROP);
-
-       if (chance && player_bold(owner_ptr, by, bx))
-       {
-               msg_print(_("何かが足下に転がってきた。", "You feel something roll beneath your feet."));
-       }
-
-       return o_idx;
-}
-
-
-/*!
- * @brief 床上の魔道具の残り残量メッセージを表示する /
- * Describe the charges on an item on the floor.
- * @param floo_ptr 現在フロアへの参照ポインタ
- * @param item メッセージの対象にしたいアイテム所持スロット
- * @return なし
- */
-void floor_item_charges(floor_type *floor_ptr, INVENTORY_IDX item)
-{
-       object_type *o_ptr = &floor_ptr->o_list[item];
-       if ((o_ptr->tval != TV_STAFF) && (o_ptr->tval != TV_WAND)) return;
-       if (!object_is_known(o_ptr)) return;
-
-#ifdef JP
-       if (o_ptr->pval <= 0)
-       {
-               msg_print("この床上のアイテムは、もう魔力が残っていない。");
-       }
-       else
-       {
-               msg_format("この床上のアイテムは、あと %d 回分の魔力が残っている。", o_ptr->pval);
-       }
-#else
-       if (o_ptr->pval != 1)
-       {
-               msg_format("There are %d charges remaining.", o_ptr->pval);
-       }
-       else
-       {
-               msg_format("There is %d charge remaining.", o_ptr->pval);
-       }
-#endif
-}
-
-
-/*!
  * @brief 床上のアイテムの残り数メッセージを表示する /
  * Describe the charges on an item on the floor.
  * @param floo_ptr 現在フロアへの参照ポインタ
index 6f118bd..56df06e 100644 (file)
@@ -17,7 +17,5 @@ bool object_similar(object_type *o_ptr, object_type *j_ptr);
 void object_absorb(object_type *o_ptr, object_type *j_ptr);
 IDX lookup_kind(tval_type tval, OBJECT_SUBTYPE_VALUE sval);
 void apply_magic(player_type *owner_type, object_type *o_ptr, DEPTH lev, BIT_FLAGS mode);
-OBJECT_IDX drop_near(player_type *owner_type, object_type *o_ptr, PERCENTAGE chance, POSITION y, POSITION x);
-void floor_item_charges(floor_type *owner_ptr, INVENTORY_IDX item);
 bool object_sort_comp(object_type *o_ptr, s32b o_value, object_type *j_ptr);
 void floor_item_describe(player_type *player_ptr, INVENTORY_IDX item); // 暫定、元々object2.c の内部からのみ呼ばれていた.
index 78d5baf..5ea1cd9 100644 (file)
@@ -33,7 +33,6 @@
 #include "object/object-hook.h"
 #include "object/object-mark-types.h"
 #include "object/object1.h"
-#include "object/object2.h"
 #include "object/special-object-flags.h"
 #include "object/sv-lite-types.h"
 #include "object/sv-weapon-types.h"
index 7f41932..a4ec974 100644 (file)
@@ -2,6 +2,7 @@
 #include "cmd-action/cmd-spell.h"
 #include "effect/effect-characteristics.h"
 #include "effect/spells-effect-util.h"
+#include "floor/floor-object.h"
 #include "io/targeting.h"
 #include "object/object-generator.h"
 #include "object/object2.h"
index 02b5fc5..1b395ba 100644 (file)
@@ -9,6 +9,7 @@
 #include "cmd-item/cmd-magiceat.h"
 #include "core/stuff-handler.h"
 #include "effect/effect-characteristics.h"
+#include "floor/floor-object.h"
 #include "inventory/inventory-object.h"
 #include "io/targeting.h"
 #include "mind/racial-force-trainer.h"