OSDN Git Service

[Refactor] #39970 Moved world.c/h to world/
[hengband/hengband.git] / src / object2.c
index 74e63b8..9b0c6a6 100644 (file)
 
 #include "angband.h"
 #include "util.h"
-#include "world.h"
-#include "term.h"
+#include "main/sound-definitions-table.h"
+#include "world/world.h"
+#include "gameterm.h"
 
 #include "object.h"
 
-#include "cmd-dump.h"
-#include "cmd-spell.h"
-#include "spells.h"
+#include "io/write-diary.h"
+#include "cmd/cmd-dump.h"
+#include "cmd/cmd-spell.h"
+#include "spell/spells3.h"
 #include "dungeon.h"
 #include "floor.h"
 #include "grid.h"
-#include "objectkind.h"
+#include "object/object-kind.h"
 #include "object-boost.h"
 #include "object-ego.h"
 #include "object-flavor.h"
 #include "object-hook.h"
 #include "object-curse.h"
-#include "objectkind-hook.h"
+#include "object/object-kind-hook.h"
 #include "artifact.h"
 #include "feature.h"
 #include "player-status.h"
@@ -41,7 +43,7 @@
 #include "monster.h"
 #include "monsterrace-hook.h"
 #include "object-ego.h"
-#include "view-mainwindow.h"
+#include "view/display-main-window.h"
 
  /*
   * todo この説明長すぎ。何とかしたい
@@ -1109,6 +1111,7 @@ int object_similar_part(object_type *o_ptr, object_type *j_ptr)
        {
                if (!object_is_known(o_ptr) || !object_is_known(j_ptr)) return 0;
        }
+               /* Fall through */
        case TV_BOLT:
        case TV_ARROW:
        case TV_SHOT:
@@ -1196,7 +1199,7 @@ void object_absorb(object_type *o_ptr, object_type *j_ptr)
                if (o_ptr->ident & IDENT_STORE) o_ptr->ident &= 0xEF;
        }
 
-       if (j_ptr->ident & (IDENT_MENTAL)) o_ptr->ident |= (IDENT_MENTAL);
+       if (OBJECT_IS_FULL_KNOWN(j_ptr)) o_ptr->ident |= (IDENT_FULL_KNOWN);
        if (j_ptr->inscription) o_ptr->inscription = j_ptr->inscription;
        if (j_ptr->feeling) o_ptr->feeling = j_ptr->feeling;
        if (o_ptr->discount < j_ptr->discount) o_ptr->discount = j_ptr->discount;
@@ -1317,7 +1320,7 @@ 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_MENTAL);
+       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);
@@ -1325,7 +1328,7 @@ static void object_mention(player_type *owner_ptr, object_type *o_ptr)
 
 
 /*!
- * 
+ *
  * @brief アイテムのエゴをレア度の重みに合わせてランダムに選択する
  * Choose random ego type
  * @param slot 取得したいエゴの装備部位
@@ -2744,19 +2747,15 @@ static void a_m_aux_3(player_type *owner_ptr, object_type *o_ptr, DEPTH level, i
  * Apply magic to an item known to be "boring"
  * @param owner_ptr プレーヤーへの参照ポインタ
  * @param o_ptr 強化を与えたいオブジェクトの構造体参照ポインタ
- * @param level 生成基準階
  * @param power 生成ランク
  * @return なし
  * @details
  * Hack -- note the special code for various items
  */
-static void a_m_aux_4(player_type *owner_ptr, object_type *o_ptr, DEPTH level, int power)
+static void a_m_aux_4(player_type *owner_ptr, object_type *o_ptr, int power)
 {
        object_kind *k_ptr = &k_info[o_ptr->k_idx];
 
-       /* Unused */
-       (void)level;
-
        floor_type *floor_ptr = owner_ptr->current_floor_ptr;
        switch (o_ptr->tval)
        {
@@ -2902,7 +2901,7 @@ static void a_m_aux_4(player_type *owner_ptr, object_type *o_ptr, DEPTH level, i
                get_mon_num_prep(owner_ptr, item_monster_okay, NULL);
                while (TRUE)
                {
-                       i = get_mon_num(owner_ptr, floor_ptr->dun_level);
+                       i = get_mon_num(owner_ptr, floor_ptr->dun_level, 0);
                        r_ptr = &r_info[i];
                        check = (floor_ptr->dun_level < r_ptr->level) ? (r_ptr->level - floor_ptr->dun_level) : 0;
                        if (!r_ptr->rarity) continue;
@@ -3149,7 +3148,7 @@ void apply_magic(player_type *owner_ptr, object_type *o_ptr, DEPTH lev, BIT_FLAG
        }
        default:
        {
-               a_m_aux_4(owner_ptr, o_ptr, lev, power);
+               a_m_aux_4(owner_ptr, o_ptr, power);
                break;
        }
        }