OSDN Git Service

[Refactor] #40399 Separated floor-object.c/h from object2.c/h
authorHourier <hourier@users.sourceforge.jp>
Mon, 1 Jun 2020 11:27:28 +0000 (20:27 +0900)
committerHourier <hourier@users.sourceforge.jp>
Mon, 1 Jun 2020 11:32:43 +0000 (20:32 +0900)
20 files changed:
Hengband/Hengband/Hengband.vcxproj
Hengband/Hengband/Hengband.vcxproj.filters
src/Makefile.am
src/dungeon/dungeon-file.c
src/dungeon/dungeon-file.h
src/dungeon/quest.c
src/dungeon/quest.h
src/floor/floor-object.c [new file with mode: 0644]
src/floor/floor-object.h [new file with mode: 0644]
src/floor/floor.c
src/floor/floor.h
src/monster/monster1.c
src/object/chest.c
src/object/chest.h
src/object/object2.c
src/object/object2.h
src/spell/spells-object.c
src/spell/spells-object.h
src/wizard/wizard-special-process.c
src/wizard/wizard-special-process.h

index 1cd0b88..531f163 100644 (file)
     <ClCompile Include="..\..\src\combat\slaying.c" />\r
     <ClCompile Include="..\..\src\combat\blood-sucking-processor.c" />\r
     <ClCompile Include="..\..\src\combat\vorpal-weapon.c" />\r
+    <ClCompile Include="..\..\src\floor\floor-object.c" />\r
     <ClCompile Include="..\..\src\inventory\inventory-damage.c" />\r
     <ClCompile Include="..\..\src\io\pref-file-expressor.c" />\r
     <ClCompile Include="..\..\src\market\arena.c" />\r
     <ClInclude Include="..\..\src\combat\player-attack.h" />\r
     <ClInclude Include="..\..\src\combat\slaying.h" />\r
     <ClInclude Include="..\..\src\combat\vorpal-weapon.h" />\r
+    <ClInclude Include="..\..\src\floor\floor-object.h" />\r
     <ClInclude Include="..\..\src\inventory\inventory-damage.h" />\r
     <ClInclude Include="..\..\src\io\pref-file-expressor.h" />\r
     <ClInclude Include="..\..\src\market\arena.h" />\r
index 58c6f78..5bec651 100644 (file)
     <ClCompile Include="..\..\src\knowledge\object-group-table.c">
       <Filter>knowledge</Filter>
     </ClCompile>
+    <ClCompile Include="..\..\src\floor\floor-object.c">
+      <Filter>floor</Filter>
+    </ClCompile>
   </ItemGroup>
   <ItemGroup>
     <ClInclude Include="..\..\src\cmd\cmd-basic.h">
     <ClInclude Include="..\..\src\knowledge\object-group-table.h">
       <Filter>knowledge</Filter>
     </ClInclude>
+    <ClInclude Include="..\..\src\floor\floor-object.h">
+      <Filter>floor</Filter>
+    </ClInclude>
   </ItemGroup>
   <ItemGroup>
     <None Include="..\..\src\wall.bmp" />
index 591169e..b57c479 100644 (file)
@@ -153,13 +153,16 @@ hengband_SOURCES = \
        effect/effect-player-switcher.c effect/effect-player-switcher.h \
        effect/effect-characteristics.h \
        \
-       floor/floor.c floor/floor.h floor/floor-events.c floor/floor-events.h \
+       floor/floor.c floor/floor.h \
+       floor/floor-events.c floor/floor-events.h \
        floor/floor-generate.c floor/floor-generate.h \
-       floor/floor-save.h floor/floor-save.c floor/floor-town.h floor/floor-town.c \
-       floor/floor-streams.c floor/floor-streams.h \
+       floor/floor-object.c floor/floor-object.h \
+       floor/geometry.c floor/geometry.h \
        floor/pattern-walk.c floor/pattern-walk.h \
+       floor/floor-save.h floor/floor-save.c \
+       floor/floor-streams.c floor/floor-streams.h \
+       floor/floor-town.h floor/floor-town.c \
        floor/wild.h floor/wild.c \
-       floor/geometry.c floor/geometry.h \
        \
        grid/feature.c grid/feature.h \
        grid/grid.c grid/grid.h grid/trap.c grid/trap.h \
index 10c9b0b..fbb417c 100644 (file)
  * </pre>
  */
 
-#include "system/angband.h"
-#include "util/util.h"
-#include "system/system-variables.h"
-
-#include "io/tokenizer.h"
-#include "io/files-util.h"
 #include "dungeon/dungeon-file.h"
-#include "room/rooms-vault.h"
+#include "cmd-item/cmd-activate.h"
+#include "cmd/cmd-building.h"
+#include "combat/monster-attack-effect.h"
+#include "combat/monster-attack-types.h"
+#include "dungeon/dungeon.h"
+#include "dungeon/quest.h"
+#include "floor/floor-object.h"
+#include "floor/floor-town.h"
+#include "floor/floor.h"
+#include "floor/wild.h"
 #include "grid/feature.h"
 #include "grid/grid.h"
-#include "dungeon/quest.h"
-#include "monster/monster.h"
+#include "grid/trap.h"
 #include "io/files-util.h"
-#include "player/player-skill.h"
-#include "player/player-race.h"
-#include "dungeon/dungeon.h"
-#include "floor/floor.h"
-#include "cmd/cmd-building.h"
-#include "world/world.h"
-#include "room/rooms-vault.h"
-#include "object/item-apply-magic.h"
-#include "object/object-kind.h"
-#include "object/object-ego.h"
+#include "io/tokenizer.h"
+#include "main/init.h"
 #include "monster/monster-race.h"
-#include "floor/floor-town.h"
-#include "realm/realm.h"
-
-#include "grid/trap.h"
+#include "monster/monster.h"
 #include "object/artifact.h"
+#include "object/item-apply-magic.h"
+#include "object/object-ego.h"
+#include "object/object-kind.h"
+#include "object/object2.h"
 #include "object/sv-scroll-types.h"
-#include "cmd-item/cmd-activate.h"
+#include "object/tr-types.h"
+#include "player/player-class.h"
+#include "player/player-race.h"
+#include "player/player-skill.h"
+#include "realm/realm.h"
+#include "room/rooms-vault.h"
+#include "system/system-variables.h"
 #include "term/gameterm.h"
-#include "floor/wild.h"
+#include "util/util.h"
 #include "view/display-main-window.h"
-#include "player/player-class.h"
-#include "combat/monster-attack-effect.h"
-#include "combat/monster-attack-types.h"
-
-#include "main/init.h"
-#include "object/tr-types.h"
-#include "object/object2.h"
+#include "world/world.h"
 
 dungeon_grid letter[255];
 
index 39edac0..ef42db8 100644 (file)
@@ -1,5 +1,7 @@
 #pragma once
 
+#include "system/angband.h"
+
 typedef struct dungeon_grid dungeon_grid;
 
 struct dungeon_grid
@@ -39,9 +41,9 @@ struct dungeon_grid
 #define PARSE_ERROR_UNDEFINED_TERRAIN_TAG   10
 #define PARSE_ERROR_MAX                     11
 
+extern dungeon_grid letter[255];
 extern concptr err_str[PARSE_ERROR_MAX];
-extern errr process_dungeon_file(player_type *player_ptr, concptr name, int ymin, int xmin, int ymax, int xmax);
-extern errr init_v_info(void);
-extern errr init_buildings(void);
 
-extern dungeon_grid letter[255];
+errr process_dungeon_file(player_type *player_ptr, concptr name, int ymin, int xmin, int ymax, int xmax);
+errr init_v_info(void);
+errr init_buildings(void);
index ac9652b..3d405ba 100644 (file)
@@ -1,27 +1,26 @@
-#include "system/angband.h"
-#include "util/util.h"
-#include "main/music-definitions-table.h"
-
-#include "system/system-variables.h"
+#include "dungeon/quest.h"
+#include "cmd-io/cmd-dump.h"
 #include "dungeon/dungeon.h"
-#include "floor/floor.h"
-#include "floor/floor-save.h"
 #include "floor/floor-events.h"
+#include "floor/floor-object.h"
+#include "floor/floor-save.h"
+#include "floor/floor.h"
+#include "grid/feature.h"
 #include "grid/grid.h"
-#include "dungeon/quest.h"
+#include "io/write-diary.h"
+#include "locale/english.h"
+#include "main/music-definitions-table.h"
 #include "monster/monster-race-hook.h"
 #include "monster/monster.h"
-#include "player/player-status.h"
-#include "player/player-personalities-table.h"
 #include "object/artifact.h"
 #include "object/item-apply-magic.h"
 #include "object/object2.h"
-#include "grid/feature.h"
-#include "world/world.h"
-#include "io/write-diary.h"
-#include "cmd-io/cmd-dump.h"
-#include "locale/english.h"
+#include "player/player-personalities-table.h"
+#include "player/player-status.h"
+#include "system/system-variables.h"
+#include "util/util.h"
 #include "view/display-main-window.h"
+#include "world/world.h"
 
 quest_type *quest; /*!< Quest info */
 QUEST_IDX max_q_idx; /*!< Maximum number of quests */
index 8c13e88..a60ae4f 100644 (file)
@@ -1,5 +1,7 @@
 #pragma once
 
+#include "system/angband.h"
+
 /*
  * Quest constants
  */
diff --git a/src/floor/floor-object.c b/src/floor/floor-object.c
new file mode 100644 (file)
index 0000000..6c7c1f0
--- /dev/null
@@ -0,0 +1,137 @@
+/*!
+ * @brief フロア生成時にアイテムを配置する
+ * @date 2020/06/01
+ * @author Hourier
+ */
+
+#include "floor/floor-object.h"
+#include "floor/floor.h"
+#include "object/artifact.h"
+#include "object/item-apply-magic.h"
+#include "object/object-flavor.h"
+#include "object/object-kind-hook.h"
+#include "object/object-kind.h"
+#include "object/object2.h"
+#include "object/special-object-flags.h"
+
+#define MAX_GOLD 18 /* Number of "gold" entries */
+
+/*!
+ * @brief オブジェクト生成テーブルに生成制約を加える /
+ * Apply a "object restriction function" to the "object allocation table"
+ * @return 常に0を返す。
+ * @details 生成の制約はグローバルのget_obj_num_hook関数ポインタで加える
+ */
+static errr get_obj_num_prep(void)
+{
+    alloc_entry *table = alloc_kind_table;
+    for (OBJECT_IDX i = 0; i < alloc_kind_size; i++) {
+        if (!get_obj_num_hook || (*get_obj_num_hook)(table[i].index)) {
+            table[i].prob2 = table[i].prob1;
+        } else {
+            table[i].prob2 = 0;
+        }
+    }
+
+    return 0;
+}
+
+/*!
+ * @brief デバッグ時にアイテム生成情報をメッセージに出力する / Cheat -- describe a created object for the user
+ * @param owner_ptr プレーヤーへの参照ポインタ
+ * @param o_ptr デバッグ出力するオブジェクトの構造体参照ポインタ
+ * @return なし
+ */
+static void object_mention(player_type *owner_ptr, object_type *o_ptr)
+{
+    object_aware(owner_ptr, o_ptr);
+    object_known(o_ptr);
+
+    o_ptr->ident |= (IDENT_FULL_KNOWN);
+    GAME_TEXT o_name[MAX_NLEN];
+    object_desc(owner_ptr, o_name, o_ptr, 0);
+    msg_format_wizard(CHEAT_OBJECT, _("%sを生成しました。", "%s was generated."), o_name);
+}
+
+/*!
+ * @brief 生成階に応じたベースアイテムの生成を行う。
+ * Attempt to make an object (normal or good/great)
+ * @param owner_ptr プレーヤーへの参照ポインタ
+ * @param j_ptr 生成結果を収めたいオブジェクト構造体の参照ポインタ
+ * @param mode オプションフラグ
+ * @return 生成に成功したらTRUEを返す。
+ * @details
+ * This routine plays nasty games to generate the "special artifacts".\n
+ * This routine uses "floor_ptr->object_level" for the "generation level".\n
+ * We assume that the given object has been "wiped".\n
+ */
+bool make_object(player_type *owner_ptr, object_type *j_ptr, BIT_FLAGS mode)
+{
+    floor_type *floor_ptr = owner_ptr->current_floor_ptr;
+    PERCENTAGE prob = ((mode & AM_GOOD) ? 10 : 1000);
+    DEPTH base = ((mode & AM_GOOD) ? (floor_ptr->object_level + 10) : floor_ptr->object_level);
+    if (!one_in_(prob) || !make_artifact_special(owner_ptr, j_ptr)) {
+        KIND_OBJECT_IDX k_idx;
+        if ((mode & AM_GOOD) && !get_obj_num_hook) {
+            get_obj_num_hook = kind_is_good;
+        }
+
+        if (get_obj_num_hook)
+            get_obj_num_prep();
+
+        k_idx = get_obj_num(owner_ptr, base, mode);
+        if (get_obj_num_hook) {
+            get_obj_num_hook = NULL;
+            get_obj_num_prep();
+        }
+
+        if (!k_idx)
+            return FALSE;
+
+        object_prep(j_ptr, k_idx);
+    }
+
+    apply_magic(owner_ptr, j_ptr, floor_ptr->object_level, mode);
+    switch (j_ptr->tval) {
+    case TV_SPIKE:
+    case TV_SHOT:
+    case TV_ARROW:
+    case TV_BOLT: {
+        if (!j_ptr->name1)
+            j_ptr->number = (byte)damroll(6, 7);
+    }
+    }
+
+    if (cheat_peek)
+        object_mention(owner_ptr, j_ptr);
+
+    return TRUE;
+}
+
+/*!
+ * @brief 生成階に応じた財宝オブジェクトの生成を行う。
+ * Make a treasure object
+ * @param floor_ptr 現在フロアへの参照ポインタ
+ * @param j_ptr 生成結果を収めたいオブジェクト構造体の参照ポインタ
+ * @return 生成に成功したらTRUEを返す。
+ * @details
+ * The location must be a legal, clean, floor grid.
+ */
+bool make_gold(floor_type *floor_ptr, object_type *j_ptr)
+{
+    int i = ((randint1(floor_ptr->object_level + 2) + 2) / 2) - 1;
+    if (one_in_(GREAT_OBJ)) {
+        i += randint1(floor_ptr->object_level + 1);
+    }
+
+    if (coin_type)
+        i = coin_type;
+    if (i >= MAX_GOLD)
+        i = MAX_GOLD - 1;
+    object_prep(j_ptr, OBJ_GOLD_LIST + i);
+
+    s32b base = k_info[OBJ_GOLD_LIST + i].cost;
+    j_ptr->pval = (base + (8L * randint1(base)) + randint1(8));
+
+    return TRUE;
+}
diff --git a/src/floor/floor-object.h b/src/floor/floor-object.h
new file mode 100644 (file)
index 0000000..0590b7f
--- /dev/null
@@ -0,0 +1,6 @@
+#pragma once
+
+#include "system/angband.h"
+
+bool make_object(player_type *owner_ptr, object_type *j_ptr, BIT_FLAGS mode);
+bool make_gold(floor_type *floor_ptr, object_type *j_ptr);
index d072639..61308ff 100644 (file)
@@ -1,22 +1,21 @@
-#include "system/angband.h"
-#include "floor/floor.h"
-#include "floor/floor-save.h"
-#include "floor/floor-generate.h"
-#include "grid/grid.h"
+#include "floor/floor.h"
 #include "dungeon/dungeon.h"
-#include "room/rooms.h"
 #include "dungeon/quest.h"
+#include "effect/effect-characteristics.h"
+#include "effect/spells-effect-util.h"
+#include "floor/floor-generate.h"
+#include "floor/floor-object.h"
+#include "grid/grid.h"
+#include "grid/trap.h"
+#include "object/artifact.h"
 #include "object/object-hook.h"
-#include "world/world.h"
-#include "player/player-effects.h"
+#include "object/object-kind.h"
 #include "object/object1.h"
 #include "object/object2.h"
-#include "object/artifact.h"
-#include "object/object-kind.h"
 #include "object/special-object-flags.h"
-#include "grid/trap.h"
-#include "effect/spells-effect-util.h"
-#include "effect/effect-characteristics.h"
+#include "player/player-effects.h"
+#include "room/rooms.h"
+#include "world/world.h"
 
 /*
  * The array of floor [MAX_WID][MAX_HGT].
index 43337db..6b190b7 100644 (file)
@@ -1,5 +1,6 @@
 #pragma once
 
+#include "system/angband.h"
 #include "grid/feature.h"
 #include "grid/grid.h"
 #include "object/object1.h"
index 1d6f756..50ea653 100644 (file)
@@ -14,7 +14,6 @@
 #include "util/util.h"
 #include "main/music-definitions-table.h"
 #include "term/gameterm.h"
-
 #include "io/write-diary.h"
 #include "cmd-io/cmd-dump.h"
 #include "cmd/cmd-building.h"
@@ -31,6 +30,7 @@
 #include "object/artifact.h"
 #include "object/item-apply-magic.h"
 #include "player/avatar.h"
+#include "floor/floor-object.h"
 #include "floor/wild.h"
 #include "dungeon/dungeon.h"
 #include "world/world.h"
index e5678a2..826e1f3 100644 (file)
@@ -1,21 +1,21 @@
-#include "system/angband.h"
-#include "object/chest.h"
-#include "util/util.h"
-#include "main/sound-definitions-table.h"
-#include "spell/spells-type.h"
-#include "spell/spells-summon.h"
+#include "object/chest.h"
+#include "floor/floor-object.h"
 #include "floor/floor.h"
+#include "grid/grid.h"
 #include "grid/trap.h"
-#include "player/player-status.h"
-#include "player/player-damage.h"
+#include "main/sound-definitions-table.h"
+#include "object/item-apply-magic.h"
+#include "object/object2.h"
+#include "object/sv-other-types.h"
 #include "player/player-class.h"
+#include "player/player-damage.h"
 #include "player/player-effects.h"
-#include "grid/grid.h"
+#include "player/player-status.h"
+#include "spell/spells-summon.h"
+#include "spell/spells-type.h"
 #include "spell/spells2.h"
 #include "spell/spells3.h"
-#include "object/item-apply-magic.h"
-#include "object/object2.h"
-#include "object/sv-other-types.h"
+#include "util/util.h"
 
 /*!< この値以降の小項目IDを持った箱は大型の箱としてドロップ数を増やす / Special "sval" limit -- first "large" chest */
 #define SV_CHEST_MIN_LARGE 4
index 7677063..469fd01 100644 (file)
@@ -1,4 +1,6 @@
-
-extern void chest_death(player_type *owner_ptr, bool scatter, POSITION y, POSITION x, OBJECT_IDX o_idx);
-extern void chest_trap(player_type *target_ptr, POSITION y, POSITION x, OBJECT_IDX o_idx);
+#pragma once
 
+#include "system/angband.h"
+
+void chest_death(player_type *owner_ptr, bool scatter, POSITION y, POSITION x, OBJECT_IDX o_idx);
+void chest_trap(player_type *target_ptr, POSITION y, POSITION x, OBJECT_IDX o_idx);
index a1488f6..70a8cb8 100644 (file)
@@ -30,7 +30,6 @@
 #include "object/object-flavor.h"
 #include "object/object-hook.h"
 #include "object/object-curse.h"
-#include "object/object-kind-hook.h"
 #include "object/object-mark-types.h"
 #include "object/artifact.h"
 #include "object/special-object-flags.h"
@@ -55,8 +54,6 @@
 #include "view/display-main-window.h"
 #include "object/trc-types.h"
 
-#define MAX_GOLD 18 /* Number of "gold" entries */
-
 /*
   * todo この説明長すぎ。何とかしたい
   * Determine if an item can "absorb" a second item
@@ -267,31 +264,6 @@ OBJECT_IDX o_pop(floor_type *floor_ptr)
 
 
 /*!
- * @brief オブジェクト生成テーブルに生成制約を加える /
- * Apply a "object restriction function" to the "object allocation table"
- * @return 常に0を返す。
- * @details 生成の制約はグローバルのget_obj_num_hook関数ポインタで加える
- */
-static errr get_obj_num_prep(void)
-{
-       alloc_entry *table = alloc_kind_table;
-       for (OBJECT_IDX i = 0; i < alloc_kind_size; i++)
-       {
-               if (!get_obj_num_hook || (*get_obj_num_hook)(table[i].index))
-               {
-                       table[i].prob2 = table[i].prob1;
-               }
-               else
-               {
-                       table[i].prob2 = 0;
-               }
-       }
-
-       return 0;
-}
-
-
-/*!
  * @brief オブジェクト生成テーブルからアイテムを取得する /
  * Choose an object kind that seems "appropriate" to the given level
  * @param owner_ptr プレーヤーへの参照ポインタ
@@ -1319,24 +1291,6 @@ void object_prep(object_type *o_ptr, KIND_OBJECT_IDX k_idx)
 
 
 /*!
- * @brief デバッグ時にアイテム生成情報をメッセージに出力する / Cheat -- describe a created object for the user
- * @param owner_ptr プレーヤーへの参照ポインタ
- * @param o_ptr デバッグ出力するオブジェクトの構造体参照ポインタ
- * @return なし
- */
-static void object_mention(player_type *owner_ptr, object_type *o_ptr)
-{
-       object_aware(owner_ptr, o_ptr);
-       object_known(o_ptr);
-
-       o_ptr->ident |= (IDENT_FULL_KNOWN);
-       GAME_TEXT o_name[MAX_NLEN];
-       object_desc(owner_ptr, o_name, o_ptr, 0);
-       msg_format_wizard(CHEAT_OBJECT, _("%sを生成しました。", "%s was generated."), o_name);
-}
-
-
-/*!
  *
  * @brief アイテムのエゴをレア度の重みに合わせてランダムに選択する
  * Choose random ego type
@@ -3329,92 +3283,6 @@ void apply_magic(player_type *owner_ptr, object_type *o_ptr, DEPTH lev, BIT_FLAG
 
 
 /*!
- * @brief 生成階に応じたベースアイテムの生成を行う。
- * Attempt to make an object (normal or good/great)
- * @param owner_ptr プレーヤーへの参照ポインタ
- * @param j_ptr 生成結果を収めたいオブジェクト構造体の参照ポインタ
- * @param mode オプションフラグ
- * @return 生成に成功したらTRUEを返す。
- * @details
- * This routine plays nasty games to generate the "special artifacts".\n
- * This routine uses "floor_ptr->object_level" for the "generation level".\n
- * We assume that the given object has been "wiped".\n
- */
-bool make_object(player_type *owner_ptr, object_type *j_ptr, BIT_FLAGS mode)
-{
-       floor_type *floor_ptr = owner_ptr->current_floor_ptr;
-       PERCENTAGE prob = ((mode & AM_GOOD) ? 10 : 1000);
-       DEPTH base = ((mode & AM_GOOD) ? (floor_ptr->object_level + 10) : floor_ptr->object_level);
-       if (!one_in_(prob) || !make_artifact_special(owner_ptr, j_ptr))
-       {
-               KIND_OBJECT_IDX k_idx;
-               if ((mode & AM_GOOD) && !get_obj_num_hook)
-               {
-                       get_obj_num_hook = kind_is_good;
-               }
-
-               if (get_obj_num_hook) get_obj_num_prep();
-
-               k_idx = get_obj_num(owner_ptr, base, mode);
-               if (get_obj_num_hook)
-               {
-                       get_obj_num_hook = NULL;
-                       get_obj_num_prep();
-               }
-
-               if (!k_idx) return FALSE;
-
-               object_prep(j_ptr, k_idx);
-       }
-
-       apply_magic(owner_ptr, j_ptr, floor_ptr->object_level, mode);
-       switch (j_ptr->tval)
-       {
-       case TV_SPIKE:
-       case TV_SHOT:
-       case TV_ARROW:
-       case TV_BOLT:
-       {
-               if (!j_ptr->name1)
-                       j_ptr->number = (byte)damroll(6, 7);
-       }
-       }
-
-       if (cheat_peek) object_mention(owner_ptr, j_ptr);
-
-       return TRUE;
-}
-
-
-/*!
- * @brief 生成階に応じた財宝オブジェクトの生成を行う。
- * Make a treasure object
- * @param floor_ptr 現在フロアへの参照ポインタ
- * @param j_ptr 生成結果を収めたいオブジェクト構造体の参照ポインタ
- * @return 生成に成功したらTRUEを返す。
- * @details
- * The location must be a legal, clean, floor grid.
- */
-bool make_gold(floor_type *floor_ptr, object_type *j_ptr)
-{
-       int i = ((randint1(floor_ptr->object_level + 2) + 2) / 2) - 1;
-       if (one_in_(GREAT_OBJ))
-       {
-               i += randint1(floor_ptr->object_level + 1);
-       }
-
-       if (coin_type) i = coin_type;
-       if (i >= MAX_GOLD) i = MAX_GOLD - 1;
-       object_prep(j_ptr, OBJ_GOLD_LIST + i);
-
-       s32b base = k_info[OBJ_GOLD_LIST + i].cost;
-       j_ptr->pval = (base + (8L * randint1(base)) + randint1(8));
-
-       return TRUE;
-}
-
-
-/*!
  * @brief 生成済のオブジェクトをフロアの所定の位置に落とす。
  * Let an object fall to the ground at or near a location.
  * @param owner_ptr プレーヤーへの参照ポインタ
index dfa1544..5f3a18d 100644 (file)
@@ -34,8 +34,6 @@ void object_prep(object_type *o_ptr, KIND_OBJECT_IDX k_idx);
 
 void apply_magic(player_type *owner_type, object_type *o_ptr, DEPTH lev, BIT_FLAGS mode);
 
-bool make_object(player_type *owner_ptr, object_type *j_ptr, BIT_FLAGS mode);
-bool make_gold(floor_type *floor_ptr, object_type *j_ptr);
 OBJECT_IDX drop_near(player_type *owner_type, object_type *o_ptr, PERCENTAGE chance, POSITION y, POSITION x);
 void vary_item(player_type *owner_ptr, INVENTORY_IDX item, ITEM_NUMBER num);
 void inven_item_charges(player_type *owner_ptr, INVENTORY_IDX item);
index 58cc670..df1b434 100644 (file)
@@ -1,39 +1,38 @@
-#include "system/angband.h"
-#include "util/util.h"
-
+#include "spell/spells-object.h"
+#include "autopick/autopick.h"
 #include "cmd/cmd-basic.h"
-#include "object/artifact.h"
+#include "floor/floor-object.h"
 #include "floor/floor.h"
 #include "grid/grid.h"
-#include "spell/spells3.h"
-#include "spell/spells-object.h"
+#include "inventory/player-inventory.h"
+#include "io/targeting.h"
+#include "object/artifact.h"
 #include "object/item-apply-magic.h"
 #include "object/item-feeling.h"
 #include "object/item-use-flags.h"
-#include "object/object2.h"
 #include "object/object-boost.h"
-#include "object/object-hook.h"
-#include "object/object-flavor.h"
 #include "object/object-ego.h"
+#include "object/object-flavor.h"
+#include "object/object-hook.h"
+#include "object/object-kind.h"
+#include "object/object2.h"
 #include "object/special-object-flags.h"
 #include "object/sv-lite-types.h"
+#include "object/sv-other-types.h"
 #include "object/sv-protector-types.h"
 #include "object/sv-scroll-types.h"
+#include "object/sv-staff-types.h"
 #include "object/sv-weapon-types.h"
-#include "player/player-damage.h"
-#include "player/player-status.h"
+#include "object/tr-types.h"
+#include "object/trc-types.h"
 #include "player/avatar.h"
-#include "player/player-effects.h"
 #include "player/player-class.h"
-#include "inventory/player-inventory.h"
-#include "object/object-kind.h"
-#include "autopick/autopick.h"
-#include "io/targeting.h"
+#include "player/player-damage.h"
+#include "player/player-effects.h"
+#include "player/player-status.h"
+#include "spell/spells3.h"
+#include "util/util.h"
 #include "view/display-main-window.h"
-#include "object/sv-other-types.h"
-#include "object/sv-staff-types.h"
-#include "object/tr-types.h"
-#include "object/trc-types.h"
 
 typedef struct
 {
index 972697f..f9461ed 100644 (file)
@@ -1,19 +1,21 @@
 #pragma once
 
-extern bool create_ammo(player_type *creature_ptr);
-extern bool import_magic_device(player_type *creature_ptr);
-extern void amusement(player_type *creature_ptr, POSITION y1, POSITION x1, int num, bool known);
-extern void acquirement(player_type *caster_ptr, POSITION y1, POSITION x1, int num, bool great, bool special, bool known);
-extern void acquire_chaos_weapon(player_type *creature_ptr);
-extern bool curse_armor(player_type *owner_ptr);
-extern bool curse_weapon_object(player_type *creature_ptr, bool force, object_type *o_ptr);
-extern bool rustproof(player_type *caster_ptr);
-extern void brand_bolts(player_type *caster_ptr);
-extern bool perilous_secrets(player_type *user_ptr);
-extern void get_bloody_moon_flags(object_type *o_ptr);
-extern void phlogiston(player_type *caster_ptr);
-extern bool bless_weapon(player_type *caster_ptr);
-extern bool pulish_shield(player_type *caster_ptr);
+#include "system/angband.h"
+
+bool create_ammo(player_type *creature_ptr);
+bool import_magic_device(player_type *creature_ptr);
+void amusement(player_type *creature_ptr, POSITION y1, POSITION x1, int num, bool known);
+void acquirement(player_type *caster_ptr, POSITION y1, POSITION x1, int num, bool great, bool special, bool known);
+void acquire_chaos_weapon(player_type *creature_ptr);
+bool curse_armor(player_type *owner_ptr);
+bool curse_weapon_object(player_type *creature_ptr, bool force, object_type *o_ptr);
+bool rustproof(player_type *caster_ptr);
+void brand_bolts(player_type *caster_ptr);
+bool perilous_secrets(player_type *user_ptr);
+void get_bloody_moon_flags(object_type *o_ptr);
+void phlogiston(player_type *caster_ptr);
+bool bless_weapon(player_type *caster_ptr);
+bool pulish_shield(player_type *caster_ptr);
 
 /*
  * Bit flags for the "enchant()" function
@@ -22,6 +24,6 @@ extern bool pulish_shield(player_type *caster_ptr);
 #define ENCH_TODAM      0x02 /*!< 装備強化処理: ダメージ強化 / Enchant to damage */
 #define ENCH_TOAC       0x04 /*!< 装備強化処理: AC強化 / Enchant to AC */
 #define ENCH_FORCE      0x08 /*!< 装備強化処理: 無条件に成功させる / Force enchantment */
-extern bool enchant(player_type *caster_ptr, object_type *o_ptr, int n, int eflag);
-extern bool enchant_spell(player_type *caster_ptr, HIT_PROB num_hit, HIT_POINT num_dam, ARMOUR_CLASS num_ac);
-extern void brand_weapon(player_type *caster_ptr, int brand_type);
+bool enchant(player_type *caster_ptr, object_type *o_ptr, int n, int eflag);
+bool enchant_spell(player_type *caster_ptr, HIT_PROB num_hit, HIT_POINT num_dam, ARMOUR_CLASS num_ac);
+void brand_weapon(player_type *caster_ptr, int brand_type);
index e2d77a8..228212b 100644 (file)
  * 2014 Deskull rearranged comment for Doxygen.<br>
  */
 
-#include "system/angband.h"
 #include "wizard/wizard-special-process.h"
-#include "wizard/wizard-spoiler.h"
-#include "system/angband-version.h"
-#include "core/stuff-handler.h"
-#include "term/gameterm.h"
-
-#include "dungeon/dungeon.h"
-#include "io/write-diary.h"
-#include "cmd/cmd-draw.h"
+#include "birth/inventory-initializer.h"
 #include "cmd-io/cmd-dump.h"
 #include "cmd-io/cmd-help.h"
 #include "cmd-io/cmd-save.h"
-#include "util/util.h"
-#include "birth/inventory-initializer.h"
-#include "player/selfinfo.h"
-#include "player/patron.h"
-#include "mutation/mutation.h"
+#include "cmd/cmd-draw.h"
+#include "core/stuff-handler.h"
+#include "dungeon/dungeon-file.h"
+#include "dungeon/dungeon.h"
 #include "dungeon/quest.h"
+#include "floor/floor-object.h"
+#include "floor/floor-save.h"
+#include "floor/floor.h"
+#include "grid/grid.h"
+#include "inventory/player-inventory.h"
+#include "io/files-util.h"
+#include "io/targeting.h"
+#include "io/write-diary.h"
+#include "market/arena.h"
+#include "monster/monster-status.h"
+#include "mspell/monster-spell.h"
+#include "mutation/mutation.h"
 #include "object/artifact.h"
-#include "player/player-status.h"
+#include "object/item-apply-magic.h"
+#include "object/item-use-flags.h"
+#include "object/object-flavor.h"
+#include "object/object-hook.h"
+#include "object/object-kind.h"
+#include "object/object2.h"
+#include "object/trc-types.h"
+#include "player/patron.h"
+#include "player/player-class.h"
 #include "player/player-effects.h"
+#include "player/player-races-table.h"
 #include "player/player-skill.h"
-#include "player/player-class.h"
-#include "inventory/player-inventory.h"
-
-#include "spell/spells-util.h"
+#include "player/player-status.h"
+#include "player/selfinfo.h"
+#include "spell/spells-detection.h"
+#include "spell/spells-floor.h"
 #include "spell/spells-object.h"
-#include "spell/spells-summon.h"
 #include "spell/spells-status.h"
+#include "spell/spells-summon.h"
+#include "spell/spells-util.h"
 #include "spell/spells-world.h"
-#include "spell/spells-floor.h"
-
-#include "object/item-apply-magic.h"
-#include "object/object2.h"
-#include "object/object-flavor.h"
-#include "object/object-hook.h"
-#include "monster/monster-status.h"
-
-#include "floor/floor.h"
-#include "floor/floor-save.h"
-#include "grid/grid.h"
-#include "dungeon/dungeon-file.h"
-#include "io/files-util.h"
-#include "mspell/monster-spell.h"
-#include "market/arena.h"
-#include "object/object-kind.h"
-#include "io/targeting.h"
-#include "view/display-main-window.h"
-#include "world/world.h"
 #include "spell/spells2.h"
 #include "spell/spells3.h"
-#include "spell/spells-detection.h"
-#include "player/player-races-table.h"
-#include "object/item-use-flags.h"
-#include "object/trc-types.h"
+#include "system/angband-version.h"
+#include "term/gameterm.h"
+#include "util/util.h"
+#include "view/display-main-window.h"
+#include "wizard/wizard-spoiler.h"
+#include "world/world.h"
 
 #define NUM_O_SET 8
 #define NUM_O_BIT 32
index 381343d..d2ee2f2 100644 (file)
@@ -1,3 +1,5 @@
 #pragma once
 
+#include "system/angband.h"
+
 void do_cmd_debug(player_type* creature_ptr);