• R/O
  • HTTP
  • SSH
  • HTTPS

hengband: Commit

変愚蛮怒のメインリポジトリです


Commit MetaInfo

Revision5c358dbd6bc03df284132ac0703c820dbde97a19 (tree)
Time2019-02-02 16:39:00
AuthorDeskull <deskull@user...>
CommiterDeskull

Log Message

[Refactor] #37353 acquirement() を spell-object.c に移動。 / Move acquirement() to spells-object.c.

Change Summary

Incremental Difference

--- a/src/externs.h
+++ b/src/externs.h
@@ -821,7 +821,6 @@ extern void place_object(POSITION y, POSITION x, BIT_FLAGS mode);
821821 extern bool make_gold(object_type *j_ptr);
822822 extern void place_gold(POSITION y, POSITION x);
823823 extern OBJECT_IDX drop_near(object_type *o_ptr, PERCENTAGE chance, POSITION y, POSITION x);
824-extern void acquirement(POSITION y1, POSITION x1, int num, bool great, bool special, bool known);
825824 extern void inven_item_charges(INVENTORY_IDX item);
826825 extern void inven_item_describe(INVENTORY_IDX item);
827826 extern void inven_item_increase(INVENTORY_IDX item, ITEM_NUMBER num);
--- 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
53765376 return (o_idx);
53775377 }
53785378
5379-
5380-/*!
5381- * @brief 獲得ドロップを行う。
5382- * Scatter some "great" objects near the player
5383- * @param y1 配置したいフロアのY座標
5384- * @param x1 配置したいフロアのX座標
5385- * @param num 獲得の処理回数
5386- * @param great TRUEならば必ず高級品以上を落とす
5387- * @param special TRUEならば必ず特別品を落とす
5388- * @param known TRUEならばオブジェクトが必ず*鑑定*済になる
5389- * @return なし
5390- */
5391-void acquirement(POSITION y1, POSITION x1, int num, bool great, bool special, bool known)
5392-{
5393- object_type *i_ptr;
5394- object_type object_type_body;
5395- BIT_FLAGS mode = AM_GOOD | (great || special ? AM_GREAT : 0L) | (special ? AM_SPECIAL : 0L) ;
5396-
5397- /* Acquirement */
5398- while (num--)
5399- {
5400- i_ptr = &object_type_body;
5401- object_wipe(i_ptr);
5402-
5403- /* Make a good (or great) object (if possible) */
5404- if (!make_object(i_ptr, mode)) continue;
5405-
5406- if (known)
5407- {
5408- object_aware(i_ptr);
5409- object_known(i_ptr);
5410- }
5411-
5412- /* Drop the object */
5413- (void)drop_near(i_ptr, -1, y1, x1);
5414- }
5415-}
5416-
5417-
5418-
54195379 /*!
54205380 * @brief 魔道具の使用回数の残量を示すメッセージを表示する /
54215381 * Describe the charges on an item in the inventory.
--- a/src/patron.c
+++ b/src/patron.c
@@ -5,11 +5,13 @@
55 #include "object-curse.h"
66 #include "monsterrace-hook.h"
77 #include "objectkind-hook.h"
8-#include "spells-summon.h"
98 #include "mutation.h"
109 #include "artifact.h"
1110 #include "player-status.h"
1211
12+#include "spells-summon.h"
13+#include "spells-object.h"
14+
1315 #ifdef JP
1416 /*!
1517 * @brief カオスパトロン名テーブル
--- a/src/spells-object.c
+++ b/src/spells-object.c
@@ -427,3 +427,42 @@ void amusement(POSITION y1, POSITION x1, int num, bool known)
427427 num--;
428428 }
429429 }
430+
431+
432+
433+/*!
434+ * @brief 獲得ドロップを行う。
435+ * Scatter some "great" objects near the player
436+ * @param y1 配置したいフロアのY座標
437+ * @param x1 配置したいフロアのX座標
438+ * @param num 獲得の処理回数
439+ * @param great TRUEならば必ず高級品以上を落とす
440+ * @param special TRUEならば必ず特別品を落とす
441+ * @param known TRUEならばオブジェクトが必ず*鑑定*済になる
442+ * @return なし
443+ */
444+void acquirement(POSITION y1, POSITION x1, int num, bool great, bool special, bool known)
445+{
446+ object_type *i_ptr;
447+ object_type object_type_body;
448+ BIT_FLAGS mode = AM_GOOD | (great || special ? AM_GREAT : 0L) | (special ? AM_SPECIAL : 0L);
449+
450+ /* Acquirement */
451+ while (num--)
452+ {
453+ i_ptr = &object_type_body;
454+ object_wipe(i_ptr);
455+
456+ /* Make a good (or great) object (if possible) */
457+ if (!make_object(i_ptr, mode)) continue;
458+
459+ if (known)
460+ {
461+ object_aware(i_ptr);
462+ object_known(i_ptr);
463+ }
464+
465+ /* Drop the object */
466+ (void)drop_near(i_ptr, -1, y1, x1);
467+ }
468+}
--- a/src/spells-object.h
+++ b/src/spells-object.h
@@ -3,3 +3,4 @@
33 extern bool create_ammo(void);
44 extern bool import_magic_device(void);
55 extern void amusement(POSITION y1, POSITION x1, int num, bool known);
6+extern void acquirement(POSITION y1, POSITION x1, int num, bool great, bool special, bool known);
--- a/src/wizard2.c
+++ b/src/wizard2.c
@@ -13,13 +13,14 @@
1313 #include "angband.h"
1414 #include "floor.h"
1515 #include "selfinfo.h"
16-#include "spells-summon.h"
1716 #include "patron.h"
1817 #include "mutation.h"
1918 #include "quest.h"
2019 #include "artifact.h"
2120 #include "player-status.h"
2221
22+#include "spells-object.h"
23+#include "spells-summon.h"
2324
2425 /*!
2526 * @brief プレイヤーのヒットダイスを振り直す / Roll the hitdie -- aux of do_cmd_rerate()
Show on old repository browser