From: Deskull Date: Sat, 2 Feb 2019 07:39:00 +0000 (+0900) Subject: [Refactor] #37353 acquirement() を spell-object.c に移動。 / Move acquirement() to spells... X-Git-Url: http://git.osdn.net/view?p=hengband%2Fhengband.git;a=commitdiff_plain;h=5c358dbd6bc03df284132ac0703c820dbde97a19 [Refactor] #37353 acquirement() を spell-object.c に移動。 / Move acquirement() to spells-object.c. --- diff --git a/src/externs.h b/src/externs.h index 0d2aebf29..fbe4f2a4a 100644 --- a/src/externs.h +++ b/src/externs.h @@ -821,7 +821,6 @@ extern void place_object(POSITION y, POSITION x, 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 acquirement(POSITION y1, POSITION x1, int num, bool great, bool special, bool known); extern void inven_item_charges(INVENTORY_IDX item); extern void inven_item_describe(INVENTORY_IDX item); extern void inven_item_increase(INVENTORY_IDX item, ITEM_NUMBER num); diff --git a/src/object2.c b/src/object2.c index 1489bab8b..c499a7576 100644 --- a/src/object2.c +++ b/src/object2.c @@ -5376,46 +5376,6 @@ OBJECT_IDX drop_near(object_type *j_ptr, PERCENTAGE chance, POSITION y, POSITION return (o_idx); } - -/*! - * @brief 獲得ドロップを行う。 - * Scatter some "great" objects near the player - * @param y1 配置したいフロアのY座標 - * @param x1 配置したいフロアのX座標 - * @param num 獲得の処理回数 - * @param great TRUEならば必ず高級品以上を落とす - * @param special TRUEならば必ず特別品を落とす - * @param known TRUEならばオブジェクトが必ず*鑑定*済になる - * @return なし - */ -void acquirement(POSITION y1, POSITION x1, int num, bool great, bool special, bool known) -{ - object_type *i_ptr; - object_type object_type_body; - BIT_FLAGS mode = AM_GOOD | (great || special ? AM_GREAT : 0L) | (special ? AM_SPECIAL : 0L) ; - - /* Acquirement */ - while (num--) - { - i_ptr = &object_type_body; - object_wipe(i_ptr); - - /* Make a good (or great) object (if possible) */ - if (!make_object(i_ptr, mode)) continue; - - if (known) - { - object_aware(i_ptr); - object_known(i_ptr); - } - - /* Drop the object */ - (void)drop_near(i_ptr, -1, y1, x1); - } -} - - - /*! * @brief 魔道具の使用回数の残量を示すメッセージを表示する / * Describe the charges on an item in the inventory. diff --git a/src/patron.c b/src/patron.c index 2a9f15a20..a804b033e 100644 --- a/src/patron.c +++ b/src/patron.c @@ -5,11 +5,13 @@ #include "object-curse.h" #include "monsterrace-hook.h" #include "objectkind-hook.h" -#include "spells-summon.h" #include "mutation.h" #include "artifact.h" #include "player-status.h" +#include "spells-summon.h" +#include "spells-object.h" + #ifdef JP /*! * @brief カオスパトロン名テーブル diff --git a/src/spells-object.c b/src/spells-object.c index 8c88f30d9..cf5b1e7f7 100644 --- a/src/spells-object.c +++ b/src/spells-object.c @@ -427,3 +427,42 @@ void amusement(POSITION y1, POSITION x1, int num, bool known) num--; } } + + + +/*! + * @brief 獲得ドロップを行う。 + * Scatter some "great" objects near the player + * @param y1 配置したいフロアのY座標 + * @param x1 配置したいフロアのX座標 + * @param num 獲得の処理回数 + * @param great TRUEならば必ず高級品以上を落とす + * @param special TRUEならば必ず特別品を落とす + * @param known TRUEならばオブジェクトが必ず*鑑定*済になる + * @return なし + */ +void acquirement(POSITION y1, POSITION x1, int num, bool great, bool special, bool known) +{ + object_type *i_ptr; + object_type object_type_body; + BIT_FLAGS mode = AM_GOOD | (great || special ? AM_GREAT : 0L) | (special ? AM_SPECIAL : 0L); + + /* Acquirement */ + while (num--) + { + i_ptr = &object_type_body; + object_wipe(i_ptr); + + /* Make a good (or great) object (if possible) */ + if (!make_object(i_ptr, mode)) continue; + + if (known) + { + object_aware(i_ptr); + object_known(i_ptr); + } + + /* Drop the object */ + (void)drop_near(i_ptr, -1, y1, x1); + } +} diff --git a/src/spells-object.h b/src/spells-object.h index 462d80eaf..f3f9f3571 100644 --- a/src/spells-object.h +++ b/src/spells-object.h @@ -3,3 +3,4 @@ extern bool create_ammo(void); extern bool import_magic_device(void); extern void amusement(POSITION y1, POSITION x1, int num, bool known); +extern void acquirement(POSITION y1, POSITION x1, int num, bool great, bool special, bool known); diff --git a/src/wizard2.c b/src/wizard2.c index b5f989e7e..a24a40a4a 100644 --- a/src/wizard2.c +++ b/src/wizard2.c @@ -13,13 +13,14 @@ #include "angband.h" #include "floor.h" #include "selfinfo.h" -#include "spells-summon.h" #include "patron.h" #include "mutation.h" #include "quest.h" #include "artifact.h" #include "player-status.h" +#include "spells-object.h" +#include "spells-summon.h" /*! * @brief プレイヤーのヒットダイスを振り直す / Roll the hitdie -- aux of do_cmd_rerate()