OSDN Git Service

[Refactor] #37353 コメント整理 / Refactor comments.
[hengband/hengband.git] / src / effects.c
index 5bdf13d..0a0de2c 100644 (file)
@@ -281,7 +281,6 @@ void dispel_player(void)
                /* Update monsters */
                p_ptr->update |= (PU_MONSTERS);
 
-               /* Window stuff */
                p_ptr->window |= (PW_OVERHEAD | PW_DUNGEON);
 
                p_ptr->energy_need += ENERGY_NEED();
@@ -340,8 +339,7 @@ bool set_mimic(TIME_EFFECT v, IDX p, bool do_dec)
        if (!notice)
                return (FALSE);
 
-       /* Disturb */
-       if (disturb_state) disturb(0, 1);
+       if (disturb_state) disturb(FALSE, TRUE);
 
        /* Redraw title */
        p_ptr->redraw |= (PR_BASIC | PR_STATUS);
@@ -350,8 +348,6 @@ bool set_mimic(TIME_EFFECT v, IDX p, bool do_dec)
        p_ptr->update |= (PU_BONUS | PU_HP);
 
        handle_stuff();
-
-       /* Result */
        return (TRUE);
 }
 
@@ -420,8 +416,7 @@ bool set_blind(TIME_EFFECT v)
        /* Nothing to notice */
        if (!notice) return (FALSE);
 
-       /* Disturb */
-       if (disturb_state) disturb(0, 0);
+       if (disturb_state) disturb(FALSE, FALSE);
 
        /* Fully update the visuals */
        p_ptr->update |= (PU_UN_VIEW | PU_UN_LITE | PU_VIEW | PU_LITE | PU_MONSTERS | PU_MON_LITE);
@@ -429,13 +424,10 @@ bool set_blind(TIME_EFFECT v)
        /* Redraw map */
        p_ptr->redraw |= (PR_MAP);
 
-       /* Window stuff */
        p_ptr->window |= (PW_OVERHEAD | PW_DUNGEON);
 
        /* Handle stuff */
        handle_stuff();
-
-       /* Result */
        return (TRUE);
 }
 
@@ -520,13 +512,10 @@ bool set_confused(TIME_EFFECT v)
        /* Nothing to notice */
        if (!notice) return (FALSE);
 
-       /* Disturb */
-       if (disturb_state) disturb(0, 0);
+       if (disturb_state) disturb(FALSE, FALSE);
 
        /* Handle stuff */
        handle_stuff();
-
-       /* Result */
        return (TRUE);
 }
 
@@ -574,13 +563,10 @@ bool set_poisoned(TIME_EFFECT v)
        /* Nothing to notice */
        if (!notice) return (FALSE);
 
-       /* Disturb */
-       if (disturb_state) disturb(0, 0);
+       if (disturb_state) disturb(FALSE, FALSE);
 
        /* Handle stuff */
        handle_stuff();
-
-       /* Result */
        return (TRUE);
 }
 
@@ -642,13 +628,10 @@ bool set_afraid(TIME_EFFECT v)
        /* Nothing to notice */
        if (!notice) return (FALSE);
 
-       /* Disturb */
-       if (disturb_state) disturb(0, 0);
+       if (disturb_state) disturb(FALSE, FALSE);
 
        /* Handle stuff */
        handle_stuff();
-
-       /* Result */
        return (TRUE);
 }
 
@@ -702,16 +685,13 @@ bool set_paralyzed(TIME_EFFECT v)
        /* Nothing to notice */
        if (!notice) return (FALSE);
 
-       /* Disturb */
-       if (disturb_state) disturb(0, 0);
+       if (disturb_state) disturb(FALSE, FALSE);
 
        /* Redraw the state */
        p_ptr->redraw |= (PR_STATE);
 
        /* Handle stuff */
        handle_stuff();
-
-       /* Result */
        return (TRUE);
 }
 
@@ -766,8 +746,7 @@ bool set_image(TIME_EFFECT v)
        /* Nothing to notice */
        if (!notice) return (FALSE);
 
-       /* Disturb */
-       if (disturb_state) disturb(0, 1);
+       if (disturb_state) disturb(FALSE, TRUE);
 
        /* Redraw map */
        p_ptr->redraw |= (PR_MAP);
@@ -778,13 +757,10 @@ bool set_image(TIME_EFFECT v)
        /* Update monsters */
        p_ptr->update |= (PU_MONSTERS);
 
-       /* Window stuff */
        p_ptr->window |= (PW_OVERHEAD | PW_DUNGEON);
 
        /* Handle stuff */
        handle_stuff();
-
-       /* Result */
        return (TRUE);
 }
 
@@ -835,16 +811,13 @@ bool set_fast(TIME_EFFECT v, bool do_dec)
        /* Nothing to notice */
        if (!notice) return (FALSE);
 
-       /* Disturb */
-       if (disturb_state) disturb(0, 0);
+       if (disturb_state) disturb(FALSE, FALSE);
 
        /* Recalculate bonuses */
        p_ptr->update |= (PU_BONUS);
 
        /* Handle stuff */
        handle_stuff();
-
-       /* Result */
        return (TRUE);
 }
 
@@ -897,16 +870,13 @@ bool set_lightspeed(TIME_EFFECT v, bool do_dec)
        /* Nothing to notice */
        if (!notice) return (FALSE);
 
-       /* Disturb */
-       if (disturb_state) disturb(0, 0);
+       if (disturb_state) disturb(FALSE, FALSE);
 
        /* Recalculate bonuses */
        p_ptr->update |= (PU_BONUS);
 
        /* Handle stuff */
        handle_stuff();
-
-       /* Result */
        return (TRUE);
 }
 
@@ -955,16 +925,13 @@ bool set_slow(TIME_EFFECT v, bool do_dec)
        /* Nothing to notice */
        if (!notice) return (FALSE);
 
-       /* Disturb */
-       if (disturb_state) disturb(0, 0);
+       if (disturb_state) disturb(FALSE, FALSE);
 
        /* Recalculate bonuses */
        p_ptr->update |= (PU_BONUS);
 
        /* Handle stuff */
        handle_stuff();
-
-       /* Result */
        return (TRUE);
 }
 
@@ -1017,16 +984,13 @@ bool set_shield(TIME_EFFECT v, bool do_dec)
        /* Nothing to notice */
        if (!notice) return (FALSE);
 
-       /* Disturb */
-       if (disturb_state) disturb(0, 0);
+       if (disturb_state) disturb(FALSE, FALSE);
 
        /* Recalculate bonuses */
        p_ptr->update |= (PU_BONUS);
 
        /* Handle stuff */
        handle_stuff();
-
-       /* Result */
        return (TRUE);
 }
 
@@ -1079,16 +1043,13 @@ bool set_tsubureru(TIME_EFFECT v, bool do_dec)
        /* Nothing to notice */
        if (!notice) return (FALSE);
 
-       /* Disturb */
-       if (disturb_state) disturb(0, 0);
+       if (disturb_state) disturb(FALSE, FALSE);
 
        /* Recalculate bonuses */
        p_ptr->update |= (PU_BONUS);
 
        /* Handle stuff */
        handle_stuff();
-
-       /* Result */
        return (TRUE);
 }
 
@@ -1141,16 +1102,13 @@ bool set_magicdef(TIME_EFFECT v, bool do_dec)
        /* Nothing to notice */
        if (!notice) return (FALSE);
 
-       /* Disturb */
-       if (disturb_state) disturb(0, 0);
+       if (disturb_state) disturb(FALSE, FALSE);
 
        /* Recalculate bonuses */
        p_ptr->update |= (PU_BONUS);
 
        /* Handle stuff */
        handle_stuff();
-
-       /* Result */
        return (TRUE);
 }
 
@@ -1202,16 +1160,13 @@ bool set_blessed(TIME_EFFECT v, bool do_dec)
        /* Nothing to notice */
        if (!notice) return (FALSE);
 
-       /* Disturb */
-       if (disturb_state) disturb(0, 0);
+       if (disturb_state) disturb(FALSE, FALSE);
 
        /* Recalculate bonuses */
        p_ptr->update |= (PU_BONUS);
 
        /* Handle stuff */
        handle_stuff();
-
-       /* Result */
        return (TRUE);
 }
 
@@ -1264,8 +1219,7 @@ bool set_hero(TIME_EFFECT v, bool do_dec)
        /* Nothing to notice */
        if (!notice) return (FALSE);
 
-       /* Disturb */
-       if (disturb_state) disturb(0, 0);
+       if (disturb_state) disturb(FALSE, FALSE);
 
        /* Recalculate bonuses */
        p_ptr->update |= (PU_BONUS);
@@ -1275,15 +1229,13 @@ bool set_hero(TIME_EFFECT v, bool do_dec)
 
        /* Handle stuff */
        handle_stuff();
-
-       /* Result */
        return (TRUE);
 }
 
 /*!
  * @brief 狂戦士化の継続時間をセットする / Set "p_ptr->shero", notice observable changes
- * @param v 継続時間
- * @param do_dec 現在の継続時間より長い値のみ上書きする
+ * @param v 継続時間/ 0ならば無条件にリセット
+ * @param do_dec FALSEの場合現在の継続時間より長い値のみ上書きする
  * @return ステータスに影響を及ぼす変化があった場合TRUEを返す。
  */
 bool set_shero(TIME_EFFECT v, bool do_dec)
@@ -1329,8 +1281,7 @@ bool set_shero(TIME_EFFECT v, bool do_dec)
        /* Nothing to notice */
        if (!notice) return (FALSE);
 
-       /* Disturb */
-       if (disturb_state) disturb(0, 0);
+       if (disturb_state) disturb(FALSE, FALSE);
 
        /* Recalculate bonuses */
        p_ptr->update |= (PU_BONUS);
@@ -1340,8 +1291,6 @@ bool set_shero(TIME_EFFECT v, bool do_dec)
 
        /* Handle stuff */
        handle_stuff();
-
-       /* Result */
        return (TRUE);
 }
 
@@ -1393,13 +1342,10 @@ bool set_protevil(TIME_EFFECT v, bool do_dec)
        /* Nothing to notice */
        if (!notice) return (FALSE);
 
-       /* Disturb */
-       if (disturb_state) disturb(0, 0);
+       if (disturb_state) disturb(FALSE, FALSE);
 
        /* Handle stuff */
        handle_stuff();
-
-       /* Result */
        return (TRUE);
 }
 
@@ -1440,7 +1386,6 @@ bool set_wraith_form(TIME_EFFECT v, bool do_dec)
                        /* Update monsters */
                        p_ptr->update |= (PU_MONSTERS);
 
-                       /* Window stuff */
                        p_ptr->window |= (PW_OVERHEAD | PW_DUNGEON);
                }
        }
@@ -1459,7 +1404,6 @@ bool set_wraith_form(TIME_EFFECT v, bool do_dec)
                        /* Update monsters */
                        p_ptr->update |= (PU_MONSTERS);
 
-                       /* Window stuff */
                        p_ptr->window |= (PW_OVERHEAD | PW_DUNGEON);
                }
        }
@@ -1473,16 +1417,13 @@ bool set_wraith_form(TIME_EFFECT v, bool do_dec)
        /* Nothing to notice */
        if (!notice) return (FALSE);
 
-       /* Disturb */
-       if (disturb_state) disturb(0, 0);
+       if (disturb_state) disturb(FALSE, FALSE);
 
        /* Recalculate bonuses */
        p_ptr->update |= (PU_BONUS);
 
        /* Handle stuff */
        handle_stuff();
-
-       /* Result */
        return (TRUE);
 
 }
@@ -1525,7 +1466,6 @@ bool set_invuln(TIME_EFFECT v, bool do_dec)
                        /* Update monsters */
                        p_ptr->update |= (PU_MONSTERS);
 
-                       /* Window stuff */
                        p_ptr->window |= (PW_OVERHEAD | PW_DUNGEON);
                }
        }
@@ -1544,7 +1484,6 @@ bool set_invuln(TIME_EFFECT v, bool do_dec)
                        /* Update monsters */
                        p_ptr->update |= (PU_MONSTERS);
 
-                       /* Window stuff */
                        p_ptr->window |= (PW_OVERHEAD | PW_DUNGEON);
 
                        p_ptr->energy_need += ENERGY_NEED();
@@ -1560,16 +1499,13 @@ bool set_invuln(TIME_EFFECT v, bool do_dec)
        /* Nothing to notice */
        if (!notice) return (FALSE);
 
-       /* Disturb */
-       if (disturb_state) disturb(0, 0);
+       if (disturb_state) disturb(FALSE, FALSE);
 
        /* Recalculate bonuses */
        p_ptr->update |= (PU_BONUS);
 
        /* Handle stuff */
        handle_stuff();
-
-       /* Result */
        return (TRUE);
 }
 
@@ -1621,8 +1557,7 @@ bool set_tim_esp(TIME_EFFECT v, bool do_dec)
        /* Nothing to notice */
        if (!notice) return (FALSE);
 
-       /* Disturb */
-       if (disturb_state) disturb(0, 0);
+       if (disturb_state) disturb(FALSE, FALSE);
 
        /* Recalculate bonuses */
        p_ptr->update |= (PU_BONUS);
@@ -1632,8 +1567,6 @@ bool set_tim_esp(TIME_EFFECT v, bool do_dec)
 
        /* Handle stuff */
        handle_stuff();
-
-       /* Result */
        return (TRUE);
 }
 
@@ -1685,8 +1618,7 @@ bool set_tim_invis(TIME_EFFECT v, bool do_dec)
        /* Nothing to notice */
        if (!notice) return (FALSE);
 
-       /* Disturb */
-       if (disturb_state) disturb(0, 0);
+       if (disturb_state) disturb(FALSE, FALSE);
 
        /* Recalculate bonuses */
        p_ptr->update |= (PU_BONUS);
@@ -1696,8 +1628,6 @@ bool set_tim_invis(TIME_EFFECT v, bool do_dec)
 
        /* Handle stuff */
        handle_stuff();
-
-       /* Result */
        return (TRUE);
 }
 
@@ -1749,8 +1679,7 @@ bool set_tim_infra(TIME_EFFECT v, bool do_dec)
        /* Nothing to notice */
        if (!notice) return (FALSE);
 
-       /* Disturb */
-       if (disturb_state) disturb(0, 0);
+       if (disturb_state) disturb(FALSE, FALSE);
 
        /* Recalculate bonuses */
        p_ptr->update |= (PU_BONUS);
@@ -1760,8 +1689,6 @@ bool set_tim_infra(TIME_EFFECT v, bool do_dec)
 
        /* Handle stuff */
        handle_stuff();
-
-       /* Result */
        return (TRUE);
 }
 
@@ -1813,16 +1740,13 @@ bool set_tim_regen(TIME_EFFECT v, bool do_dec)
        /* Nothing to notice */
        if (!notice) return (FALSE);
 
-       /* Disturb */
-       if (disturb_state) disturb(0, 0);
+       if (disturb_state) disturb(FALSE, FALSE);
 
        /* Recalculate bonuses */
        p_ptr->update |= (PU_BONUS);
 
        /* Handle stuff */
        handle_stuff();
-
-       /* Result */
        return (TRUE);
 }
 
@@ -1874,16 +1798,13 @@ bool set_tim_stealth(TIME_EFFECT v, bool do_dec)
        /* Nothing to notice */
        if (!notice) return (FALSE);
 
-       /* Disturb */
-       if (disturb_state) disturb(0, 0);
+       if (disturb_state) disturb(FALSE, FALSE);
 
        /* Recalculate bonuses */
        p_ptr->update |= (PU_BONUS);
 
        /* Handle stuff */
        handle_stuff();
-
-       /* Result */
        return (TRUE);
 }
 
@@ -1940,10 +1861,7 @@ bool set_superstealth(bool set)
        /* Redraw status bar */
        p_ptr->redraw |= (PR_STATUS);
 
-       /* Disturb */
-       if (disturb_state) disturb(0, 0);
-
-       /* Result */
+       if (disturb_state) disturb(FALSE, FALSE);
        return (TRUE);
 }
 
@@ -1995,16 +1913,13 @@ bool set_tim_levitation(TIME_EFFECT v, bool do_dec)
        /* Nothing to notice */
        if (!notice) return (FALSE);
 
-       /* Disturb */
-       if (disturb_state) disturb(0, 0);
+       if (disturb_state) disturb(FALSE, FALSE);
 
        /* Recalculate bonuses */
        p_ptr->update |= (PU_BONUS);
 
        /* Handle stuff */
        handle_stuff();
-
-       /* Result */
        return (TRUE);
 }
 
@@ -2056,13 +1971,10 @@ bool set_tim_sh_touki(TIME_EFFECT v, bool do_dec)
        /* Nothing to notice */
        if (!notice) return (FALSE);
 
-       /* Disturb */
-       if (disturb_state) disturb(0, 0);
+       if (disturb_state) disturb(FALSE, FALSE);
 
        /* Handle stuff */
        handle_stuff();
-
-       /* Result */
        return (TRUE);
 }
 
@@ -2114,16 +2026,13 @@ bool set_tim_sh_fire(TIME_EFFECT v, bool do_dec)
        /* Nothing to notice */
        if (!notice) return (FALSE);
 
-       /* Disturb */
-       if (disturb_state) disturb(0, 0);
+       if (disturb_state) disturb(FALSE, FALSE);
 
        /* Recalculate bonuses */
        p_ptr->update |= (PU_BONUS);
 
        /* Handle stuff */
        handle_stuff();
-
-       /* Result */
        return (TRUE);
 }
 
@@ -2175,16 +2084,13 @@ bool set_tim_sh_holy(TIME_EFFECT v, bool do_dec)
        /* Nothing to notice */
        if (!notice) return (FALSE);
 
-       /* Disturb */
-       if (disturb_state) disturb(0, 0);
+       if (disturb_state) disturb(FALSE, FALSE);
 
        /* Recalculate bonuses */
        p_ptr->update |= (PU_BONUS);
 
        /* Handle stuff */
        handle_stuff();
-
-       /* Result */
        return (TRUE);
 }
 
@@ -2236,16 +2142,13 @@ bool set_tim_eyeeye(TIME_EFFECT v, bool do_dec)
        /* Nothing to notice */
        if (!notice) return (FALSE);
 
-       /* Disturb */
-       if (disturb_state) disturb(0, 0);
+       if (disturb_state) disturb(FALSE, FALSE);
 
        /* Recalculate bonuses */
        p_ptr->update |= (PU_BONUS);
 
        /* Handle stuff */
        handle_stuff();
-
-       /* Result */
        return (TRUE);
 }
 
@@ -2298,16 +2201,13 @@ bool set_resist_magic(TIME_EFFECT v, bool do_dec)
        /* Nothing to notice */
        if (!notice) return (FALSE);
 
-       /* Disturb */
-       if (disturb_state) disturb(0, 0);
+       if (disturb_state) disturb(FALSE, FALSE);
 
        /* Recalculate bonuses */
        p_ptr->update |= (PU_BONUS);
 
        /* Handle stuff */
        handle_stuff();
-
-       /* Result */
        return (TRUE);
 }
 
@@ -2359,16 +2259,13 @@ bool set_tim_reflect(TIME_EFFECT v, bool do_dec)
        /* Nothing to notice */
        if (!notice) return (FALSE);
 
-       /* Disturb */
-       if (disturb_state) disturb(0, 0);
+       if (disturb_state) disturb(FALSE, FALSE);
 
        /* Recalculate bonuses */
        p_ptr->update |= (PU_BONUS);
 
        /* Handle stuff */
        handle_stuff();
-
-       /* Result */
        return (TRUE);
 }
 
@@ -2418,16 +2315,13 @@ bool set_multishadow(TIME_EFFECT v, bool do_dec)
        /* Nothing to notice */
        if (!notice) return (FALSE);
 
-       /* Disturb */
-       if (disturb_state) disturb(0, 0);
+       if (disturb_state) disturb(FALSE, FALSE);
 
        /* Recalculate bonuses */
        p_ptr->update |= (PU_BONUS);
 
        /* Handle stuff */
        handle_stuff();
-
-       /* Result */
        return (TRUE);
 }
 
@@ -2479,16 +2373,13 @@ bool set_dustrobe(TIME_EFFECT v, bool do_dec)
        /* Nothing to notice */
        if (!notice) return (FALSE);
 
-       /* Disturb */
-       if (disturb_state) disturb(0, 0);
+       if (disturb_state) disturb(FALSE, FALSE);
 
        /* Recalculate bonuses */
        p_ptr->update |= (PU_BONUS);
 
        /* Handle stuff */
        handle_stuff();
-
-       /* Result */
        return (TRUE);
 }
 
@@ -2540,16 +2431,13 @@ bool set_kabenuke(TIME_EFFECT v, bool do_dec)
        /* Nothing to notice */
        if (!notice) return (FALSE);
 
-       /* Disturb */
-       if (disturb_state) disturb(0, 0);
+       if (disturb_state) disturb(FALSE, FALSE);
 
        /* Recalculate bonuses */
        p_ptr->update |= (PU_BONUS);
 
        /* Handle stuff */
        handle_stuff();
-
-       /* Result */
        return (TRUE);
 }
 
@@ -2607,8 +2495,7 @@ bool set_tsuyoshi(TIME_EFFECT v, bool do_dec)
        /* Nothing to notice */
        if (!notice) return (FALSE);
 
-       /* Disturb */
-       if (disturb_state) disturb(0, 0);
+       if (disturb_state) disturb(FALSE, FALSE);
 
        /* Recalculate bonuses */
        p_ptr->update |= (PU_BONUS);
@@ -2618,8 +2505,6 @@ bool set_tsuyoshi(TIME_EFFECT v, bool do_dec)
 
        /* Handle stuff */
        handle_stuff();
-
-       /* Result */
        return (TRUE);
 }
 
@@ -2689,8 +2574,7 @@ bool set_ele_attack(u32b attack_type, TIME_EFFECT v)
 #endif
        }
 
-       /* Disturb */
-       if (disturb_state) disturb(0, 0);
+       if (disturb_state) disturb(FALSE, FALSE);
 
        /* Redraw status bar */
        p_ptr->redraw |= (PR_STATUS);
@@ -2769,8 +2653,7 @@ bool set_ele_immune(u32b immune_type, TIME_EFFECT v)
 #endif
        }
 
-       /* Disturb */
-       if (disturb_state) disturb(0, 0);
+       if (disturb_state) disturb(FALSE, FALSE);
 
        /* Redraw status bar */
        p_ptr->redraw |= (PR_STATUS);
@@ -2831,13 +2714,10 @@ bool set_oppose_acid(TIME_EFFECT v, bool do_dec)
        /* Redraw status bar */
        p_ptr->redraw |= (PR_STATUS);
 
-       /* Disturb */
-       if (disturb_state) disturb(0, 0);
+       if (disturb_state) disturb(FALSE, FALSE);
 
        /* Handle stuff */
        handle_stuff();
-
-       /* Result */
        return (TRUE);
 }
 
@@ -2889,13 +2769,10 @@ bool set_oppose_elec(TIME_EFFECT v, bool do_dec)
        /* Redraw status bar */
        p_ptr->redraw |= (PR_STATUS);
 
-       /* Disturb */
-       if (disturb_state) disturb(0, 0);
+       if (disturb_state) disturb(FALSE, FALSE);
 
        /* Handle stuff */
        handle_stuff();
-
-       /* Result */
        return (TRUE);
 }
 
@@ -2948,13 +2825,10 @@ bool set_oppose_fire(TIME_EFFECT v, bool do_dec)
        /* Redraw status bar */
        p_ptr->redraw |= (PR_STATUS);
 
-       /* Disturb */
-       if (disturb_state) disturb(0, 0);
+       if (disturb_state) disturb(FALSE, FALSE);
 
        /* Handle stuff */
        handle_stuff();
-
-       /* Result */
        return (TRUE);
 }
 
@@ -3006,13 +2880,10 @@ bool set_oppose_cold(TIME_EFFECT v, bool do_dec)
        /* Redraw status bar */
        p_ptr->redraw |= (PR_STATUS);
 
-       /* Disturb */
-       if (disturb_state) disturb(0, 0);
+       if (disturb_state) disturb(FALSE, FALSE);
 
        /* Handle stuff */
        handle_stuff();
-
-       /* Result */
        return (TRUE);
 }
 
@@ -3065,13 +2936,10 @@ bool set_oppose_pois(TIME_EFFECT v, bool do_dec)
        /* Redraw status bar */
        p_ptr->redraw |= (PR_STATUS);
 
-       /* Disturb */
-       if (disturb_state) disturb(0, 0);
+       if (disturb_state) disturb(FALSE, FALSE);
 
        /* Handle stuff */
        handle_stuff();
-
-       /* Result */
        return (TRUE);
 }
 
@@ -3194,7 +3062,6 @@ bool set_stun(TIME_EFFECT v)
                /* Hex */
                if (hex_spelling_any()) stop_hex_spell_all();
 
-               /* Notice */
                notice = TRUE;
        }
 
@@ -3205,14 +3072,13 @@ bool set_stun(TIME_EFFECT v)
                switch (new_aux)
                {
                        /* None */
-                 case 0:
+               case 0:
                        msg_print(_("やっと朦朧状態から回復した。", "You are no longer stunned."));
 
-                       if (disturb_state) disturb(0, 0);
+                       if (disturb_state) disturb(FALSE, FALSE);
                        break;
                }
 
-               /* Notice */
                notice = TRUE;
        }
 
@@ -3222,8 +3088,7 @@ bool set_stun(TIME_EFFECT v)
        /* No change */
        if (!notice) return (FALSE);
 
-       /* Disturb */
-       if (disturb_state) disturb(0, 0);
+       if (disturb_state) disturb(FALSE, FALSE);
 
        /* Recalculate bonuses */
        p_ptr->update |= (PU_BONUS);
@@ -3233,8 +3098,6 @@ bool set_stun(TIME_EFFECT v)
 
        /* Handle stuff */
        handle_stuff();
-
-       /* Result */
        return (TRUE);
 }
 
@@ -3387,7 +3250,6 @@ bool set_cut(TIME_EFFECT v)
                        case 7: msg_print(_("致命的な傷を負ってしまった。", "You have been given a mortal wound.")); break;
                }
 
-               /* Notice */
                notice = TRUE;
 
                if (randint1(1000) < v || one_in_(16))
@@ -3410,11 +3272,10 @@ bool set_cut(TIME_EFFECT v)
                        case 0:
                        msg_format(_("やっと%s。", "You are no longer bleeding."), p_ptr->prace == RACE_ANDROID ? "怪我が直った" : "出血が止まった");
 
-                       if (disturb_state) disturb(0, 0);
+                       if (disturb_state) disturb(FALSE, FALSE);
                        break;
                }
 
-               /* Notice */
                notice = TRUE;
        }
 
@@ -3424,8 +3285,7 @@ bool set_cut(TIME_EFFECT v)
        /* No change */
        if (!notice) return (FALSE);
 
-       /* Disturb */
-       if (disturb_state) disturb(0, 0);
+       if (disturb_state) disturb(FALSE, FALSE);
 
        /* Recalculate bonuses */
        p_ptr->update |= (PU_BONUS);
@@ -3435,8 +3295,6 @@ bool set_cut(TIME_EFFECT v)
 
        /* Handle stuff */
        handle_stuff();
-
-       /* Result */
        return (TRUE);
 }
 
@@ -3452,7 +3310,7 @@ bool set_cut(TIME_EFFECT v)
  * 7500 food units, without overflowing the 32767 maximum limit.\n
  *\n
  * Perhaps we should disturb the player with various messages,
- * especially messages about hunger status changes.  XXX XXX XXX\n
+ * especially messages about hunger status changes.  \n
  *\n
  * Digestion of food is handled in "dungeon.c", in which, normally,
  * the player digests about 20 food units per 100 game turns, more
@@ -3625,8 +3483,7 @@ bool set_food(TIME_EFFECT v)
        /* Nothing to notice */
        if (!notice) return (FALSE);
 
-       /* Disturb */
-       if (disturb_state) disturb(0, 0);
+       if (disturb_state) disturb(FALSE, FALSE);
 
        /* Recalculate bonuses */
        p_ptr->update |= (PU_BONUS);
@@ -3636,8 +3493,6 @@ bool set_food(TIME_EFFECT v)
 
        /* Handle stuff */
        handle_stuff();
-
-       /* Result */
        return (TRUE);
 }
 
@@ -3836,7 +3691,6 @@ bool dec_stat(int stat, int amount, int permanent)
                p_ptr->update |= (PU_BONUS);
        }
 
-       /* Done */
        return (res);
 }
 
@@ -3876,7 +3730,10 @@ bool hp_player(int num)
 {
        int vir;
        vir = virtue_number(V_VITALITY);
-       if (vir)
+
+       if(num <= 0) return (FALSE);
+
+       if(vir)
        {
                num = num * (p_ptr->virtues[vir - 1] + 1250) / 1250;
        }
@@ -3898,7 +3755,6 @@ bool hp_player(int num)
                /* Redraw */
                p_ptr->redraw |= (PR_HP);
 
-               /* Window stuff */
                p_ptr->window |= (PW_PLAYER);
 
                /* Heal 0-4 */
@@ -3925,7 +3781,6 @@ bool hp_player(int num)
                        msg_print(_("ひじょうに気分が良くなった。", "You feel very good."));
                }
 
-               /* Notice */
                return (TRUE);
        }
 
@@ -3983,7 +3838,6 @@ bool do_dec_stat(int stat)
        /* Sustain */
        if (sust && (!ironman_nightmare || randint0(13)))
        {
-               /* Message */
                msg_format(_("%sなった気がしたが、すぐに元に戻った。", "You feel %s for a moment, but the feeling passes."),
                                        desc_stat_neg[stat]);
 
@@ -3994,7 +3848,6 @@ bool do_dec_stat(int stat)
        /* Attempt to reduce the stat */
        if (dec_stat(stat, 10, (ironman_nightmare && !randint0(13))))
        {
-               /* Message */
                msg_format(_("ひどく%sなった気がする。", "You feel very %s."), desc_stat_neg[stat]);
 
                /* Notice effect */
@@ -4014,10 +3867,8 @@ bool do_res_stat(int stat)
        /* Attempt to increase */
        if (res_stat(stat))
        {
-               /* Message */
                msg_format(_("元通りに%sなった気がする。", "You feel less %s."), desc_stat_pos[stat]);
 
-               /* Notice */
                return (TRUE);
        }
 
@@ -4052,20 +3903,16 @@ bool do_inc_stat(int stat)
                else if (stat == A_CON)
                        chg_virtue(V_VITALITY, 1);
 
-               /* Message */
                msg_format(_("ワーオ!とても%sなった!", "Wow!  You feel very %s!"), desc_stat_pos[stat]);
 
-               /* Notice */
                return (TRUE);
        }
 
        /* Restoration worked */
        if (res)
        {
-               /* Message */
                msg_format(_("元通りに%sなった気がする。", "You feel less %s."), desc_stat_pos[stat]);
 
-               /* Notice */
                return (TRUE);
        }
 
@@ -4082,7 +3929,6 @@ bool restore_level(void)
        /* Restore experience */
        if (p_ptr->exp < p_ptr->max_exp)
        {
-               /* Message */
                msg_print(_("経験値が戻ってきた気がする。", "You feel your experience returning."));
 
                /* Restore the experience */
@@ -4099,7 +3945,6 @@ bool restore_level(void)
        return (FALSE);
 }
 
-
 /*
  * Forget everything
  */
@@ -4140,7 +3985,6 @@ bool lose_all_info(void)
        /* Combine / Reorder the pack (later) */
        p_ptr->notice |= (PN_COMBINE | PN_REORDER);
 
-       /* Window stuff */
        p_ptr->window |= (PW_INVEN | PW_EQUIP | PW_PLAYER);
 
        /* Mega-Hack -- Forget the map */
@@ -4198,7 +4042,7 @@ void change_race(CHARACTER_IDX new_race, cptr effect_msg)
        }
        else
        {
-               p_ptr->old_race2 |= 1L << (p_ptr->prace-32);
+               p_ptr->old_race2 |= 1L << (p_ptr->prace - 32);
        }
        p_ptr->prace = new_race;
        rp_ptr = &race_info[p_ptr->prace];
@@ -4379,9 +4223,9 @@ void do_poly_self(void)
 /*
  * Decreases players hit points and sets death flag if necessary
  *
- * XXX XXX XXX Invulnerability needs to be changed into a "shield"
+ * Invulnerability needs to be changed into a "shield"
  *
- * XXX XXX XXX Hack -- this function allows the user to save (or quit)
+ * Hack -- this function allows the user to save (or quit)
  * the game when he dies, since the "You die." message is shown before
  * setting the player to "dead".
  */
@@ -4405,8 +4249,7 @@ int take_hit(int damage_type, HIT_POINT damage, cptr hit_from, int monspell)
 
        if (damage_type != DAMAGE_USELIFE)
        {
-               /* Disturb */
-               disturb(1, 1);
+               disturb(TRUE, TRUE);
                if (auto_more)
                {
                        now_damaged = TRUE;
@@ -4478,7 +4321,6 @@ int take_hit(int damage_type, HIT_POINT damage, cptr hit_from, int monspell)
        /* Display the hitpoints */
        p_ptr->redraw |= (PR_HP);
 
-       /* Window stuff */
        p_ptr->window |= (PW_PLAYER);
 
        if (damage_type != DAMAGE_GENO && p_ptr->chp == 0)
@@ -4497,7 +4339,6 @@ int take_hit(int damage_type, HIT_POINT damage, cptr hit_from, int monspell)
                        if(!save_player()) msg_print("セーブ失敗!");
 #endif
 
-               /* Sound */
                sound(SOUND_DEATH);
 
                chg_virtue(V_SACRIFICE, 10);
@@ -4519,7 +4360,7 @@ int take_hit(int damage_type, HIT_POINT damage, cptr hit_from, int monspell)
                }
                else
                {
-                       int q_idx = quest_number(dun_level);
+                       QUEST_IDX q_idx = quest_number(dun_level);
                        bool seppuku = streq(hit_from, "Seppuku");
                        bool winning_seppuku = p_ptr->total_winner && seppuku;
 
@@ -4720,7 +4561,6 @@ int take_hit(int damage_type, HIT_POINT damage, cptr hit_from, int monspell)
                        now_damaged = TRUE;
                }
 
-               /* Message */
                msg_print(_("*** 警告:低ヒット・ポイント! ***", "*** LOW HITPOINT WARNING! ***"));
                msg_print(NULL);
                flush();
@@ -4780,12 +4620,10 @@ void calc_android_exp(void)
                object_type forge;
                object_type *q_ptr = &forge;
                u32b value, exp;
-               int level = MAX(k_info[o_ptr->k_idx].level - 8, 1);
+               DEPTH level = MAX(k_info[o_ptr->k_idx].level - 8, 1);
 
                if ((i == INVEN_RIGHT) || (i == INVEN_LEFT) || (i == INVEN_NECK) || (i == INVEN_LITE)) continue;
                if (!o_ptr->k_idx) continue;
-
-               /* Wipe the object */
                object_wipe(q_ptr);
 
                object_copy(q_ptr, o_ptr);
@@ -4955,16 +4793,13 @@ bool set_ultimate_res(TIME_EFFECT v, bool do_dec)
        /* Nothing to notice */
        if (!notice) return (FALSE);
 
-       /* Disturb */
-       if (disturb_state) disturb(0, 0);
+       if (disturb_state) disturb(FALSE, FALSE);
 
        /* Recalculate bonuses */
        p_ptr->update |= (PU_BONUS);
 
        /* Handle stuff */
        handle_stuff();
-
-       /* Result */
        return (TRUE);
 }
 
@@ -5010,16 +4845,13 @@ bool set_tim_res_nether(TIME_EFFECT v, bool do_dec)
        /* Nothing to notice */
        if (!notice) return (FALSE);
 
-       /* Disturb */
-       if (disturb_state) disturb(0, 0);
+       if (disturb_state) disturb(FALSE, FALSE);
 
        /* Recalculate bonuses */
        p_ptr->update |= (PU_BONUS);
 
        /* Handle stuff */
        handle_stuff();
-
-       /* Result */
        return (TRUE);
 }
 
@@ -5065,16 +4897,13 @@ bool set_tim_res_time(TIME_EFFECT v, bool do_dec)
        /* Nothing to notice */
        if (!notice) return (FALSE);
 
-       /* Disturb */
-       if (disturb_state) disturb(0, 0);
+       if (disturb_state) disturb(FALSE, FALSE);
 
        /* Recalculate bonuses */
        p_ptr->update |= (PU_BONUS);
 
        /* Handle stuff */
        handle_stuff();
-
-       /* Result */
        return (TRUE);
 }