From: Hourier Date: Tue, 2 Jun 2020 12:22:59 +0000 (+0900) Subject: [Refactor] #40399 Moved floor_item_charges() from object2.c/h tofloor-object.c/h X-Git-Url: http://git.osdn.net/view?a=commitdiff_plain;h=556e31a46de24b31d2fa59d8a4863135672991f0;p=hengband%2Fhengband.git [Refactor] #40399 Moved floor_item_charges() from object2.c/h tofloor-object.c/h --- diff --git a/src/cmd-action/cmd-attack.c b/src/cmd-action/cmd-attack.c index 707387d1f..16375b42b 100644 --- a/src/cmd-action/cmd-attack.c +++ b/src/cmd-action/cmd-attack.c @@ -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" diff --git a/src/cmd-item/cmd-eat.c b/src/cmd-item/cmd-eat.c index c6b12ecf3..74ba18931 100644 --- a/src/cmd-item/cmd-eat.c +++ b/src/cmd-item/cmd-eat.c @@ -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" diff --git a/src/cmd-item/cmd-usestaff.c b/src/cmd-item/cmd-usestaff.c index 3bc9449df..1ca3b9fa1 100644 --- a/src/cmd-item/cmd-usestaff.c +++ b/src/cmd-item/cmd-usestaff.c @@ -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" diff --git a/src/cmd-item/cmd-zapwand.c b/src/cmd-item/cmd-zapwand.c index 42baf37a6..54f22a8ee 100644 --- a/src/cmd-item/cmd-zapwand.c +++ b/src/cmd-item/cmd-zapwand.c @@ -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" diff --git a/src/combat/shoot.c b/src/combat/shoot.c index cc6bd55b7..dab684f69 100644 --- a/src/combat/shoot.c +++ b/src/combat/shoot.c @@ -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" diff --git a/src/dungeon/quest.c b/src/dungeon/quest.c index 857695066..a04be45d0 100644 --- a/src/dungeon/quest.c +++ b/src/dungeon/quest.c @@ -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" diff --git a/src/effect/effect-item.c b/src/effect/effect-item.c index 178bd6db7..d048dc929 100644 --- a/src/effect/effect-item.c +++ b/src/effect/effect-item.c @@ -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" diff --git a/src/effect/effect-monster.c b/src/effect/effect-monster.c index 023f56ceb..d5771be3e 100644 --- a/src/effect/effect-monster.c +++ b/src/effect/effect-monster.c @@ -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" diff --git a/src/floor/floor-object.c b/src/floor/floor-object.c index 71e16ef64..f9ec85e5d 100644 --- a/src/floor/floor-object.c +++ b/src/floor/floor-object.c @@ -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 +} diff --git a/src/floor/floor-object.h b/src/floor/floor-object.h index f8870405d..3cadd9654 100644 --- a/src/floor/floor-object.h +++ b/src/floor/floor-object.h @@ -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); diff --git a/src/inventory/inventory-damage.c b/src/inventory/inventory-damage.c index 9ab7c4d2f..a1ecf714b 100644 --- a/src/inventory/inventory-damage.c +++ b/src/inventory/inventory-damage.c @@ -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" diff --git a/src/inventory/pack-overflow.c b/src/inventory/pack-overflow.c index 8b78d3b5d..9c4521728 100644 --- a/src/inventory/pack-overflow.c +++ b/src/inventory/pack-overflow.c @@ -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" diff --git a/src/monster/monster-object.c b/src/monster/monster-object.c index 2264a0d3c..f22c2631d 100644 --- a/src/monster/monster-object.c +++ b/src/monster/monster-object.c @@ -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" diff --git a/src/monster/monster2.c b/src/monster/monster2.c index 9c99dd3bc..48dbba577 100644 --- a/src/monster/monster2.c +++ b/src/monster/monster2.c @@ -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" diff --git a/src/object/artifact.c b/src/object/artifact.c index 34a9cbb31..c40253249 100644 --- a/src/object/artifact.c +++ b/src/object/artifact.c @@ -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" diff --git a/src/object/chest.c b/src/object/chest.c index d90fd5498..2069865cb 100644 --- a/src/object/chest.c +++ b/src/object/chest.c @@ -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" diff --git a/src/object/object2.c b/src/object/object2.c index 730cffad3..91967b1a4 100644 --- a/src/object/object2.c +++ b/src/object/object2.c @@ -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 現在フロアへの参照ポインタ diff --git a/src/object/object2.h b/src/object/object2.h index 6f118bd85..56df06e33 100644 --- a/src/object/object2.h +++ b/src/object/object2.h @@ -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 の内部からのみ呼ばれていた. diff --git a/src/player/player-status.c b/src/player/player-status.c index 78d5bafaa..5ea1cd9fc 100644 --- a/src/player/player-status.c +++ b/src/player/player-status.c @@ -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" diff --git a/src/realm/realm-nature.c b/src/realm/realm-nature.c index 7f419320e..a4ec9741a 100644 --- a/src/realm/realm-nature.c +++ b/src/realm/realm-nature.c @@ -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" diff --git a/src/spell/spells-status.c b/src/spell/spells-status.c index 02b5fc5c0..1b395ba57 100644 --- a/src/spell/spells-status.c +++ b/src/spell/spells-status.c @@ -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"