OSDN Git Service

[Refactor] #37353 未使用構造体 dun_type 削除。 / Delete dun_type, unused structure.
[hengband/hengband.git] / src / mspells1.c
index a978e46..9c9f565 100644 (file)
@@ -40,6 +40,9 @@
 
 #include "angband.h"
 #include "object-curse.h"
+#include "projection.h"
+#include "quest.h"
+#include "realm-hex.h"
 
 
 /*!
@@ -1342,11 +1345,11 @@ bool make_attack_spell(MONSTER_IDX m_idx)
        SPELL_IDX thrown_spell = 0;
        DEPTH rlev;
        PERCENTAGE failrate;
-       byte            spell[96], num = 0;
+       byte spell[96], num = 0;
        BIT_FLAGS f4, f5, f6;
        monster_type *m_ptr = &m_list[m_idx];
        monster_race *r_ptr = &r_info[m_ptr->r_idx];
-       GAME_TEXT m_name[80];
+       GAME_TEXT m_name[MAX_NLEN];
 #ifndef JP
        char m_poss[80];
 #endif
@@ -1354,7 +1357,6 @@ bool make_attack_spell(MONSTER_IDX m_idx)
        bool            do_spell = DO_SPELL_NONE;
        int             dam = 0;
 
-       /* Target location */
        POSITION x = p_ptr->x;
        POSITION y = p_ptr->y;
 
@@ -1369,7 +1371,7 @@ bool make_attack_spell(MONSTER_IDX m_idx)
        /* Check "projectable" */
        bool direct;
 
-       bool in_no_magic_dungeon = (d_info[dungeon_type].flags1 & DF1_NO_MAGIC) && dun_level
+       bool in_no_magic_dungeon = (d_info[p_ptr->dungeon_idx].flags1 & DF1_NO_MAGIC) && dun_level
                && (!p_ptr->inside_quest || is_fixed_quest_idx(p_ptr->inside_quest));
 
        bool can_use_lite_area = FALSE;
@@ -1508,7 +1510,6 @@ bool make_attack_spell(MONSTER_IDX m_idx)
 
        reset_target(m_ptr);
 
-       /* Extract the monster level */
        rlev = ((r_ptr->level >= 1) ? r_ptr->level : 1);
 
        /* Forbid inate attacks sometimes */
@@ -1528,7 +1529,7 @@ bool make_attack_spell(MONSTER_IDX m_idx)
 
                if (!(r_ptr->flags2 & RF2_STUPID))
                {
-                       if (d_info[dungeon_type].flags1 & DF1_DARKNESS) f6 &= ~(RF6_DARKNESS);
+                       if (d_info[p_ptr->dungeon_idx].flags1 & DF1_DARKNESS) f6 &= ~(RF6_DARKNESS);
                        else if ((p_ptr->pclass == CLASS_NINJA) && !can_use_lite_area) f6 &= ~(RF6_DARKNESS);
                }
        }