OSDN Git Service

[Refactor] #37353 externs.h から util.h への宣言移動。
[hengband/hengband.git] / src / spells3.c
index 4fecbdf..e382dfc 100644 (file)
  */
 
 #include "angband.h"
+#include "util.h"
+
 #include "floor.h"
+#include "object-boost.h"
+#include "object-flavor.h"
 #include "object-hook.h"
 #include "melee.h"
+#include "player-move.h"
 #include "player-status.h"
-#include "projection.h"
 #include "spells-summon.h"
 #include "quest.h"
 #include "artifact.h"
 #include "avatar.h"
+#include "spells.h"
 #include "spells-floor.h"
+#include "grid.h"
+#include "monster-process.h"
+#include "monster-status.h"
+#include "monster-spell.h"
+#include "cmd-spell.h"
+#include "snipe.h"
+#include "floor-save.h"
+#include "files.h"
+#include "player-effects.h"
+#include "view-mainwindow.h"
+#include "mind.h"
 
 
 /*! テレポート先探索の試行数 / Maximum number of tries for teleporting */
@@ -48,9 +64,7 @@ bool teleport_away(MONSTER_IDX m_idx, POSITION dis, BIT_FLAGS mode)
        bool look = TRUE;
 
        monster_type *m_ptr = &current_floor_ptr->m_list[m_idx];
-
-       /* Paranoia */
-       if (!m_ptr->r_idx) return (FALSE);
+       if (!monster_is_valid(m_ptr)) return (FALSE);
 
        oy = m_ptr->fy;
        ox = m_ptr->fx;
@@ -155,8 +169,6 @@ void teleport_monster_to(MONSTER_IDX m_idx, POSITION ty, POSITION tx, int power,
        POSITION dis = 2;
        bool look = TRUE;
        monster_type *m_ptr = &current_floor_ptr->m_list[m_idx];
-
-       /* Paranoia */
        if(!m_ptr->r_idx) return;
 
        /* "Skill" test */
@@ -730,7 +742,6 @@ void teleport_level(MONSTER_IDX m_idx)
        {
                monster_type *m_ptr = &current_floor_ptr->m_list[m_idx];
 
-               /* Check for quest completion */
                check_quest_completion(m_ptr);
 
                if (record_named_pet && is_pet(m_ptr) && m_ptr->nickname)
@@ -952,11 +963,7 @@ bool reset_recall(void)
        {
                /* Extract request */
                dummy = atoi(tmp_val);
-
-               /* Paranoia */
                if (dummy < 1) dummy = 1;
-
-               /* Paranoia */
                if (dummy > max_dlv[select_dungeon]) dummy = max_dlv[select_dungeon];
                if (dummy < d_info[select_dungeon].mindepth) dummy = d_info[select_dungeon].mindepth;
 
@@ -1263,7 +1270,6 @@ static bool vanish_dungeon(void)
                        /* Awake monster */
                        if (g_ptr->m_idx && MON_CSLEEP(m_ptr))
                        {
-                               /* Reset sleep counter */
                                (void)set_monster_csleep(g_ptr->m_idx, 0);
 
                                /* Notice the "waking up" */
@@ -2416,8 +2422,6 @@ bool recharge(int power)
 
                /* All staffs, unstacked wands. */
                else recharge_strength = (100 + power - lev - (8 * o_ptr->pval)) / 15;
-
-               /* Paranoia */
                if (recharge_strength < 0) recharge_strength = 0;
 
                /* Back-fire */
@@ -2652,9 +2656,9 @@ void display_spell_list(void)
            (p_ptr->pclass == CLASS_MIRROR_MASTER) ||
            (p_ptr->pclass == CLASS_FORCETRAINER))
        {
-               int             minfail = 0;
+               PERCENTAGE minfail = 0;
                PLAYER_LEVEL plev = p_ptr->lev;
-               int             chance = 0;
+               PERCENTAGE chance = 0;
                mind_type       spell;
                char            comment[80];
                char            psi_desc[80];
@@ -3487,8 +3491,6 @@ bool eat_magic(int power)
        {
                /* All staffs, wands. */
                recharge_strength = (100 + power - lev) / 15;
-
-               /* Paranoia */
                if (recharge_strength < 0) recharge_strength = 0;
 
                /* Back-fire */