OSDN Git Service

[Refactor] #37353 コメント整理 / Refactor comments.
[hengband/hengband.git] / src / effects.c
index f8ccca0..0a0de2c 100644 (file)
@@ -12,7 +12,6 @@
  * 2013 Deskull rearranged comment for Doxygen.\n
  */
 
-
 #include "angband.h"
 
 /*!
@@ -21,7 +20,7 @@
  * #ACTION_NONE / #ACTION_SEARCH / #ACTION_REST / #ACTION_LEARN / #ACTION_FISH / #ACTION_KAMAE / #ACTION_KATA / #ACTION_SING / #ACTION_HAYAGAKE / #ACTION_SPELL から選択。
  * @return なし
  */
-void set_action(int typ)
+void set_action(ACTION_IDX typ)
 {
        int prev_typ = p_ptr->action;
 
@@ -206,8 +205,8 @@ void reset_tim_flags(void)
 
        if (p_ptr->pclass == CLASS_BARD)
        {
-               p_ptr->magic_num1[0] = 0;
-               p_ptr->magic_num2[0] = 0;
+               SINGING_SONG_EFFECT(p_ptr) = 0;
+               SINGING_SONG_ID(p_ptr) = 0;
        }
 }
 
@@ -268,8 +267,8 @@ void dispel_player(void)
        if (music_singing_any() || hex_spelling_any())
        {
                cptr str = (music_singing_any()) ? _("歌", "singing") : _("呪文", "spelling");
-               p_ptr->magic_num1[1] = p_ptr->magic_num1[0];
-               p_ptr->magic_num1[0] = 0;
+               INTERUPTING_SONG_EFFECT(p_ptr) = SINGING_SONG_EFFECT(p_ptr);
+               SINGING_SONG_EFFECT(p_ptr) = MUSIC_NONE;
                msg_format(_("%sが途切れた。", "Your %s is interrupted."), str);
                p_ptr->action = ACTION_NONE;
 
@@ -282,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();
@@ -297,7 +295,7 @@ void dispel_player(void)
  * @param do_dec 現在の継続時間より長い値のみ上書きする
  * @return ステータスに影響を及ぼす変化があった場合TRUEを返す。
  */
-bool set_mimic(int v, int p, bool do_dec)
+bool set_mimic(TIME_EFFECT v, IDX p, bool do_dec)
 {
        bool notice = FALSE;
 
@@ -316,7 +314,7 @@ bool set_mimic(int v, int p, bool do_dec)
                else if ((!p_ptr->tim_mimic) || (p_ptr->mimic_form != p))
                {
                        msg_print(_("自分の体が変わってゆくのを感じた。", "You feel that your body changes."));
-                       p_ptr->mimic_form=p;
+                       p_ptr->mimic_form = p;
                        notice = TRUE;
                }
        }
@@ -341,8 +339,7 @@ bool set_mimic(int v, int 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);
@@ -351,8 +348,6 @@ bool set_mimic(int v, int p, bool do_dec)
        p_ptr->update |= (PU_BONUS | PU_HP);
 
        handle_stuff();
-
-       /* Result */
        return (TRUE);
 }
 
@@ -366,7 +361,7 @@ bool set_mimic(int v, int p, bool do_dec)
  * Note that blindness is currently the only thing which can affect\n
  * "player_can_see_bold()".\n
  */
-bool set_blind(int v)
+bool set_blind(TIME_EFFECT v)
 {
        bool notice = FALSE;
 
@@ -421,8 +416,7 @@ bool set_blind(int 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);
@@ -430,13 +424,10 @@ bool set_blind(int v)
        /* Redraw map */
        p_ptr->redraw |= (PR_MAP);
 
-       /* Window stuff */
        p_ptr->window |= (PW_OVERHEAD | PW_DUNGEON);
 
        /* Handle stuff */
        handle_stuff();
-
-       /* Result */
        return (TRUE);
 }
 
@@ -446,7 +437,7 @@ bool set_blind(int v)
  * @param v 継続時間
  * @return ステータスに影響を及ぼす変化があった場合TRUEを返す。
  */
-bool set_confused(int v)
+bool set_confused(TIME_EFFECT v)
 {
        bool notice = FALSE;
 
@@ -521,13 +512,10 @@ bool set_confused(int 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);
 }
 
@@ -537,7 +525,7 @@ bool set_confused(int v)
  * @param v 継続時間
  * @return ステータスに影響を及ぼす変化があった場合TRUEを返す。
  */
-bool set_poisoned(int v)
+bool set_poisoned(TIME_EFFECT v)
 {
        bool notice = FALSE;
 
@@ -575,13 +563,10 @@ bool set_poisoned(int 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);
 }
 
@@ -591,7 +576,7 @@ bool set_poisoned(int v)
  * @param v 継続時間
  * @return ステータスに影響を及ぼす変化があった場合TRUEを返す。
  */
-bool set_afraid(int v)
+bool set_afraid(TIME_EFFECT v)
 {
        bool notice = FALSE;
 
@@ -643,13 +628,10 @@ bool set_afraid(int 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);
 }
 
@@ -658,7 +640,7 @@ bool set_afraid(int v)
  * @param v 継続時間
  * @return ステータスに影響を及ぼす変化があった場合TRUEを返す。
  */
-bool set_paralyzed(int v)
+bool set_paralyzed(TIME_EFFECT v)
 {
        bool notice = FALSE;
 
@@ -703,16 +685,13 @@ bool set_paralyzed(int 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);
 }
 
@@ -722,7 +701,7 @@ bool set_paralyzed(int v)
  * @return ステータスに影響を及ぼす変化があった場合TRUEを返す。
  * @details Note that we must redraw the map when hallucination changes.
  */
-bool set_image(int v)
+bool set_image(TIME_EFFECT v)
 {
        bool notice = FALSE;
 
@@ -767,8 +746,7 @@ bool set_image(int 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);
@@ -779,13 +757,10 @@ bool set_image(int v)
        /* Update monsters */
        p_ptr->update |= (PU_MONSTERS);
 
-       /* Window stuff */
        p_ptr->window |= (PW_OVERHEAD | PW_DUNGEON);
 
        /* Handle stuff */
        handle_stuff();
-
-       /* Result */
        return (TRUE);
 }
 
@@ -795,7 +770,7 @@ bool set_image(int v)
  * @param do_dec 現在の継続時間より長い値のみ上書きする
  * @return ステータスに影響を及ぼす変化があった場合TRUEを返す。
  */
-bool set_fast(int v, bool do_dec)
+bool set_fast(TIME_EFFECT v, bool do_dec)
 {
        bool notice = FALSE;
 
@@ -836,16 +811,13 @@ bool set_fast(int 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);
 }
 
@@ -855,7 +827,7 @@ bool set_fast(int v, bool do_dec)
  * @param do_dec 現在の継続時間より長い値のみ上書きする
  * @return ステータスに影響を及ぼす変化があった場合TRUEを返す。
  */
-bool set_lightspeed(int v, bool do_dec)
+bool set_lightspeed(TIME_EFFECT v, bool do_dec)
 {
        bool notice = FALSE;
 
@@ -898,16 +870,13 @@ bool set_lightspeed(int 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);
 }
 
@@ -917,7 +886,7 @@ bool set_lightspeed(int v, bool do_dec)
  * @param do_dec 現在の継続時間より長い値のみ上書きする
  * @return ステータスに影響を及ぼす変化があった場合TRUEを返す。
  */
-bool set_slow(int v, bool do_dec)
+bool set_slow(TIME_EFFECT v, bool do_dec)
 {
        bool notice = FALSE;
 
@@ -956,16 +925,13 @@ bool set_slow(int 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);
 }
 
@@ -976,7 +942,7 @@ bool set_slow(int v, bool do_dec)
  * @param do_dec 現在の継続時間より長い値のみ上書きする
  * @return ステータスに影響を及ぼす変化があった場合TRUEを返す。
  */
-bool set_shield(int v, bool do_dec)
+bool set_shield(TIME_EFFECT v, bool do_dec)
 {
        bool notice = FALSE;
 
@@ -1018,16 +984,13 @@ bool set_shield(int 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);
 }
 
@@ -1038,7 +1001,7 @@ bool set_shield(int v, bool do_dec)
  * @param do_dec 現在の継続時間より長い値のみ上書きする
  * @return ステータスに影響を及ぼす変化があった場合TRUEを返す。
  */
-bool set_tsubureru(int v, bool do_dec)
+bool set_tsubureru(TIME_EFFECT v, bool do_dec)
 {
        bool notice = FALSE;
 
@@ -1080,16 +1043,13 @@ bool set_tsubureru(int 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);
 }
 
@@ -1100,7 +1060,7 @@ bool set_tsubureru(int v, bool do_dec)
  * @param do_dec 現在の継続時間より長い値のみ上書きする
  * @return ステータスに影響を及ぼす変化があった場合TRUEを返す。
  */
-bool set_magicdef(int v, bool do_dec)
+bool set_magicdef(TIME_EFFECT v, bool do_dec)
 {
        bool notice = FALSE;
 
@@ -1142,16 +1102,13 @@ bool set_magicdef(int 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);
 }
 
@@ -1161,7 +1118,7 @@ bool set_magicdef(int v, bool do_dec)
  * @param do_dec 現在の継続時間より長い値のみ上書きする
  * @return ステータスに影響を及ぼす変化があった場合TRUEを返す。
  */
-bool set_blessed(int v, bool do_dec)
+bool set_blessed(TIME_EFFECT v, bool do_dec)
 {
        bool notice = FALSE;
 
@@ -1203,16 +1160,13 @@ bool set_blessed(int 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);
 }
 
@@ -1223,7 +1177,7 @@ bool set_blessed(int v, bool do_dec)
  * @param do_dec 現在の継続時間より長い値のみ上書きする
  * @return ステータスに影響を及ぼす変化があった場合TRUEを返す。
  */
-bool set_hero(int v, bool do_dec)
+bool set_hero(TIME_EFFECT v, bool do_dec)
 {
        bool notice = FALSE;
 
@@ -1265,8 +1219,7 @@ bool set_hero(int 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);
@@ -1276,18 +1229,16 @@ bool set_hero(int 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(int v, bool do_dec)
+bool set_shero(TIME_EFFECT v, bool do_dec)
 {
        bool notice = FALSE;
 
@@ -1330,8 +1281,7 @@ bool set_shero(int 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);
@@ -1341,8 +1291,6 @@ bool set_shero(int v, bool do_dec)
 
        /* Handle stuff */
        handle_stuff();
-
-       /* Result */
        return (TRUE);
 }
 
@@ -1352,7 +1300,7 @@ bool set_shero(int v, bool do_dec)
  * @param do_dec 現在の継続時間より長い値のみ上書きする
  * @return ステータスに影響を及ぼす変化があった場合TRUEを返す。
  */
-bool set_protevil(int v, bool do_dec)
+bool set_protevil(TIME_EFFECT v, bool do_dec)
 {
        bool notice = FALSE;
 
@@ -1394,13 +1342,10 @@ bool set_protevil(int 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);
 }
 
@@ -1410,7 +1355,7 @@ bool set_protevil(int v, bool do_dec)
  * @param do_dec 現在の継続時間より長い値のみ上書きする
  * @return ステータスに影響を及ぼす変化があった場合TRUEを返す。
  */
-bool set_wraith_form(int v, bool do_dec)
+bool set_wraith_form(TIME_EFFECT v, bool do_dec)
 {
        bool notice = FALSE;
 
@@ -1441,7 +1386,6 @@ bool set_wraith_form(int v, bool do_dec)
                        /* Update monsters */
                        p_ptr->update |= (PU_MONSTERS);
 
-                       /* Window stuff */
                        p_ptr->window |= (PW_OVERHEAD | PW_DUNGEON);
                }
        }
@@ -1460,7 +1404,6 @@ bool set_wraith_form(int v, bool do_dec)
                        /* Update monsters */
                        p_ptr->update |= (PU_MONSTERS);
 
-                       /* Window stuff */
                        p_ptr->window |= (PW_OVERHEAD | PW_DUNGEON);
                }
        }
@@ -1474,16 +1417,13 @@ bool set_wraith_form(int 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);
 
 }
@@ -1494,7 +1434,7 @@ bool set_wraith_form(int v, bool do_dec)
  * @param do_dec 現在の継続時間より長い値のみ上書きする
  * @return ステータスに影響を及ぼす変化があった場合TRUEを返す。
  */
-bool set_invuln(int v, bool do_dec)
+bool set_invuln(TIME_EFFECT v, bool do_dec)
 {
        bool notice = FALSE;
 
@@ -1526,7 +1466,6 @@ bool set_invuln(int v, bool do_dec)
                        /* Update monsters */
                        p_ptr->update |= (PU_MONSTERS);
 
-                       /* Window stuff */
                        p_ptr->window |= (PW_OVERHEAD | PW_DUNGEON);
                }
        }
@@ -1545,7 +1484,6 @@ bool set_invuln(int 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();
@@ -1561,16 +1499,13 @@ bool set_invuln(int 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);
 }
 
@@ -1580,7 +1515,7 @@ bool set_invuln(int v, bool do_dec)
  * @param do_dec 現在の継続時間より長い値のみ上書きする
  * @return ステータスに影響を及ぼす変化があった場合TRUEを返す。
  */
-bool set_tim_esp(int v, bool do_dec)
+bool set_tim_esp(TIME_EFFECT v, bool do_dec)
 {
        bool notice = FALSE;
 
@@ -1622,8 +1557,7 @@ bool set_tim_esp(int 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);
@@ -1633,8 +1567,6 @@ bool set_tim_esp(int v, bool do_dec)
 
        /* Handle stuff */
        handle_stuff();
-
-       /* Result */
        return (TRUE);
 }
 
@@ -1644,7 +1576,7 @@ bool set_tim_esp(int v, bool do_dec)
  * @param do_dec 現在の継続時間より長い値のみ上書きする
  * @return ステータスに影響を及ぼす変化があった場合TRUEを返す。
  */
-bool set_tim_invis(int v, bool do_dec)
+bool set_tim_invis(TIME_EFFECT v, bool do_dec)
 {
        bool notice = FALSE;
 
@@ -1686,8 +1618,7 @@ bool set_tim_invis(int 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);
@@ -1697,8 +1628,6 @@ bool set_tim_invis(int v, bool do_dec)
 
        /* Handle stuff */
        handle_stuff();
-
-       /* Result */
        return (TRUE);
 }
 
@@ -1708,7 +1637,7 @@ bool set_tim_invis(int v, bool do_dec)
  * @param do_dec 現在の継続時間より長い値のみ上書きする
  * @return ステータスに影響を及ぼす変化があった場合TRUEを返す。
  */
-bool set_tim_infra(int v, bool do_dec)
+bool set_tim_infra(TIME_EFFECT v, bool do_dec)
 {
        bool notice = FALSE;
 
@@ -1750,8 +1679,7 @@ bool set_tim_infra(int 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);
@@ -1761,8 +1689,6 @@ bool set_tim_infra(int v, bool do_dec)
 
        /* Handle stuff */
        handle_stuff();
-
-       /* Result */
        return (TRUE);
 }
 
@@ -1772,7 +1698,7 @@ bool set_tim_infra(int v, bool do_dec)
  * @param do_dec 現在の継続時間より長い値のみ上書きする
  * @return ステータスに影響を及ぼす変化があった場合TRUEを返す。
  */
-bool set_tim_regen(int v, bool do_dec)
+bool set_tim_regen(TIME_EFFECT v, bool do_dec)
 {
        bool notice = FALSE;
 
@@ -1814,16 +1740,13 @@ bool set_tim_regen(int 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);
 }
 
@@ -1833,7 +1756,7 @@ bool set_tim_regen(int v, bool do_dec)
  * @param do_dec 現在の継続時間より長い値のみ上書きする
  * @return ステータスに影響を及ぼす変化があった場合TRUEを返す。
  */
-bool set_tim_stealth(int v, bool do_dec)
+bool set_tim_stealth(TIME_EFFECT v, bool do_dec)
 {
        bool notice = FALSE;
 
@@ -1875,16 +1798,13 @@ bool set_tim_stealth(int 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);
 }
 
@@ -1941,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);
 }
 
@@ -1954,7 +1871,7 @@ bool set_superstealth(bool set)
  * @param do_dec 現在の継続時間より長い値のみ上書きする
  * @return ステータスに影響を及ぼす変化があった場合TRUEを返す。
  */
-bool set_tim_levitation(int v, bool do_dec)
+bool set_tim_levitation(TIME_EFFECT v, bool do_dec)
 {
        bool notice = FALSE;
 
@@ -1996,16 +1913,13 @@ bool set_tim_levitation(int 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);
 }
 
@@ -2015,7 +1929,7 @@ bool set_tim_levitation(int v, bool do_dec)
  * @param do_dec 現在の継続時間より長い値のみ上書きする
  * @return ステータスに影響を及ぼす変化があった場合TRUEを返す。
  */
-bool set_tim_sh_touki(int v, bool do_dec)
+bool set_tim_sh_touki(TIME_EFFECT v, bool do_dec)
 {
        bool notice = FALSE;
 
@@ -2057,13 +1971,10 @@ bool set_tim_sh_touki(int 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);
 }
 
@@ -2073,7 +1984,7 @@ bool set_tim_sh_touki(int v, bool do_dec)
  * @param do_dec 現在の継続時間より長い値のみ上書きする
  * @return ステータスに影響を及ぼす変化があった場合TRUEを返す。
  */
-bool set_tim_sh_fire(int v, bool do_dec)
+bool set_tim_sh_fire(TIME_EFFECT v, bool do_dec)
 {
        bool notice = FALSE;
 
@@ -2115,16 +2026,13 @@ bool set_tim_sh_fire(int 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);
 }
 
@@ -2134,7 +2042,7 @@ bool set_tim_sh_fire(int v, bool do_dec)
  * @param do_dec 現在の継続時間より長い値のみ上書きする
  * @return ステータスに影響を及ぼす変化があった場合TRUEを返す。
  */
-bool set_tim_sh_holy(int v, bool do_dec)
+bool set_tim_sh_holy(TIME_EFFECT v, bool do_dec)
 {
        bool notice = FALSE;
 
@@ -2176,16 +2084,13 @@ bool set_tim_sh_holy(int 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);
 }
 
@@ -2195,7 +2100,7 @@ bool set_tim_sh_holy(int v, bool do_dec)
  * @param do_dec 現在の継続時間より長い値のみ上書きする
  * @return ステータスに影響を及ぼす変化があった場合TRUEを返す。
  */
-bool set_tim_eyeeye(int v, bool do_dec)
+bool set_tim_eyeeye(TIME_EFFECT v, bool do_dec)
 {
        bool notice = FALSE;
 
@@ -2237,16 +2142,13 @@ bool set_tim_eyeeye(int 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);
 }
 
@@ -2257,7 +2159,7 @@ bool set_tim_eyeeye(int v, bool do_dec)
  * @param do_dec 現在の継続時間より長い値のみ上書きする
  * @return ステータスに影響を及ぼす変化があった場合TRUEを返す。
  */
-bool set_resist_magic(int v, bool do_dec)
+bool set_resist_magic(TIME_EFFECT v, bool do_dec)
 {
        bool notice = FALSE;
 
@@ -2299,16 +2201,13 @@ bool set_resist_magic(int 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);
 }
 
@@ -2318,7 +2217,7 @@ bool set_resist_magic(int v, bool do_dec)
  * @param do_dec 現在の継続時間より長い値のみ上書きする
  * @return ステータスに影響を及ぼす変化があった場合TRUEを返す。
  */
-bool set_tim_reflect(int v, bool do_dec)
+bool set_tim_reflect(TIME_EFFECT v, bool do_dec)
 {
        bool notice = FALSE;
 
@@ -2360,16 +2259,13 @@ bool set_tim_reflect(int 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);
 }
 
@@ -2377,7 +2273,7 @@ bool set_tim_reflect(int v, bool do_dec)
 /*
  * Set "p_ptr->multishadow", notice observable changes
  */
-bool set_multishadow(int v, bool do_dec)
+bool set_multishadow(TIME_EFFECT v, bool do_dec)
 {
        bool notice = FALSE;
 
@@ -2419,16 +2315,13 @@ bool set_multishadow(int 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);
 }
 
@@ -2438,7 +2331,7 @@ bool set_multishadow(int v, bool do_dec)
  * @param do_dec 現在の継続時間より長い値のみ上書きする
  * @return ステータスに影響を及ぼす変化があった場合TRUEを返す。
  */
-bool set_dustrobe(int v, bool do_dec)
+bool set_dustrobe(TIME_EFFECT v, bool do_dec)
 {
        bool notice = FALSE;
 
@@ -2480,16 +2373,13 @@ bool set_dustrobe(int 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);
 }
 
@@ -2499,7 +2389,7 @@ bool set_dustrobe(int v, bool do_dec)
  * @param do_dec 現在の継続時間より長い値のみ上書きする
  * @return ステータスに影響を及ぼす変化があった場合TRUEを返す。
  */
-bool set_kabenuke(int v, bool do_dec)
+bool set_kabenuke(TIME_EFFECT v, bool do_dec)
 {
        bool notice = FALSE;
 
@@ -2541,16 +2431,13 @@ bool set_kabenuke(int 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);
 }
 
@@ -2560,7 +2447,7 @@ bool set_kabenuke(int v, bool do_dec)
  * @param do_dec 現在の継続時間より長い値のみ上書きする
  * @return ステータスに影響を及ぼす変化があった場合TRUEを返す。
  */
-bool set_tsuyoshi(int v, bool do_dec)
+bool set_tsuyoshi(TIME_EFFECT v, bool do_dec)
 {
        bool notice = FALSE;
 
@@ -2608,8 +2495,7 @@ bool set_tsuyoshi(int 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);
@@ -2619,8 +2505,6 @@ bool set_tsuyoshi(int v, bool do_dec)
 
        /* Handle stuff */
        handle_stuff();
-
-       /* Result */
        return (TRUE);
 }
 
@@ -2630,7 +2514,7 @@ bool set_tsuyoshi(int v, bool do_dec)
  * @param v 継続時間
  * @return ステータスに影響を及ぼす変化があった場合TRUEを返す。
  */
-bool set_ele_attack(u32b attack_type, int v)
+bool set_ele_attack(u32b attack_type, TIME_EFFECT v)
 {
        /* Hack -- Force good values */
        v = (v > 10000) ? 10000 : (v < 0) ? 0 : v;
@@ -2690,8 +2574,7 @@ bool set_ele_attack(u32b attack_type, int v)
 #endif
        }
 
-       /* Disturb */
-       if (disturb_state) disturb(0, 0);
+       if (disturb_state) disturb(FALSE, FALSE);
 
        /* Redraw status bar */
        p_ptr->redraw |= (PR_STATUS);
@@ -2710,7 +2593,7 @@ bool set_ele_attack(u32b attack_type, int v)
  * @param v 継続時間
  * @return ステータスに影響を及ぼす変化があった場合TRUEを返す。
  */
-bool set_ele_immune(u32b immune_type, int v)
+bool set_ele_immune(u32b immune_type, TIME_EFFECT v)
 {
        /* Hack -- Force good values */
        v = (v > 10000) ? 10000 : (v < 0) ? 0 : v;
@@ -2770,8 +2653,7 @@ bool set_ele_immune(u32b immune_type, int v)
 #endif
        }
 
-       /* Disturb */
-       if (disturb_state) disturb(0, 0);
+       if (disturb_state) disturb(FALSE, FALSE);
 
        /* Redraw status bar */
        p_ptr->redraw |= (PR_STATUS);
@@ -2790,7 +2672,7 @@ bool set_ele_immune(u32b immune_type, int v)
  * @param do_dec 現在の継続時間より長い値のみ上書きする
  * @return ステータスに影響を及ぼす変化があった場合TRUEを返す。
  */
-bool set_oppose_acid(int v, bool do_dec)
+bool set_oppose_acid(TIME_EFFECT v, bool do_dec)
 {
        bool notice = FALSE;
 
@@ -2832,13 +2714,10 @@ bool set_oppose_acid(int 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);
 }
 
@@ -2848,7 +2727,7 @@ bool set_oppose_acid(int v, bool do_dec)
  * @param do_dec 現在の継続時間より長い値のみ上書きする
  * @return ステータスに影響を及ぼす変化があった場合TRUEを返す。
  */
-bool set_oppose_elec(int v, bool do_dec)
+bool set_oppose_elec(TIME_EFFECT v, bool do_dec)
 {
        bool notice = FALSE;
 
@@ -2890,13 +2769,10 @@ bool set_oppose_elec(int 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);
 }
 
@@ -2906,7 +2782,7 @@ bool set_oppose_elec(int v, bool do_dec)
  * @param do_dec 現在の継続時間より長い値のみ上書きする
  * @return ステータスに影響を及ぼす変化があった場合TRUEを返す。
  */
-bool set_oppose_fire(int v, bool do_dec)
+bool set_oppose_fire(TIME_EFFECT v, bool do_dec)
 {
        bool notice = FALSE;
 
@@ -2949,13 +2825,10 @@ bool set_oppose_fire(int 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);
 }
 
@@ -2965,7 +2838,7 @@ bool set_oppose_fire(int v, bool do_dec)
  * @param do_dec 現在の継続時間より長い値のみ上書きする
  * @return ステータスに影響を及ぼす変化があった場合TRUEを返す。
  */
-bool set_oppose_cold(int v, bool do_dec)
+bool set_oppose_cold(TIME_EFFECT v, bool do_dec)
 {
        bool notice = FALSE;
 
@@ -3007,13 +2880,10 @@ bool set_oppose_cold(int 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);
 }
 
@@ -3023,7 +2893,7 @@ bool set_oppose_cold(int v, bool do_dec)
  * @param do_dec 現在の継続時間より長い値のみ上書きする
  * @return ステータスに影響を及ぼす変化があった場合TRUEを返す。
  */
-bool set_oppose_pois(int v, bool do_dec)
+bool set_oppose_pois(TIME_EFFECT v, bool do_dec)
 {
        bool notice = FALSE;
 
@@ -3066,13 +2936,10 @@ bool set_oppose_pois(int 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);
 }
 
@@ -3083,7 +2950,7 @@ bool set_oppose_pois(int v, bool do_dec)
  * @details
  * Note the special code to only notice "range" changes.
  */
-bool set_stun(int v)
+bool set_stun(TIME_EFFECT v)
 {
        int old_aux, new_aux;
        bool notice = FALSE;
@@ -3195,7 +3062,6 @@ bool set_stun(int v)
                /* Hex */
                if (hex_spelling_any()) stop_hex_spell_all();
 
-               /* Notice */
                notice = TRUE;
        }
 
@@ -3206,14 +3072,13 @@ bool set_stun(int 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;
        }
 
@@ -3223,8 +3088,7 @@ bool set_stun(int 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);
@@ -3234,8 +3098,6 @@ bool set_stun(int v)
 
        /* Handle stuff */
        handle_stuff();
-
-       /* Result */
        return (TRUE);
 }
 
@@ -3247,7 +3109,7 @@ bool set_stun(int v)
  * @details
  * Note the special code to only notice "range" changes.
  */
-bool set_cut(int v)
+bool set_cut(TIME_EFFECT v)
 {
        int old_aux, new_aux;
        bool notice = FALSE;
@@ -3388,7 +3250,6 @@ bool set_cut(int v)
                        case 7: msg_print(_("致命的な傷を負ってしまった。", "You have been given a mortal wound.")); break;
                }
 
-               /* Notice */
                notice = TRUE;
 
                if (randint1(1000) < v || one_in_(16))
@@ -3411,11 +3272,10 @@ bool set_cut(int 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;
        }
 
@@ -3425,8 +3285,7 @@ bool set_cut(int 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);
@@ -3436,8 +3295,6 @@ bool set_cut(int v)
 
        /* Handle stuff */
        handle_stuff();
-
-       /* Result */
        return (TRUE);
 }
 
@@ -3453,7 +3310,7 @@ bool set_cut(int 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
@@ -3467,7 +3324,7 @@ bool set_cut(int v)
  * game turns, or 500/(100/5) = 25 player turns (if nothing else is
  * affecting the player speed).\n
  */
-bool set_food(int v)
+bool set_food(TIME_EFFECT v)
 {
        int old_aux, new_aux;
 
@@ -3626,8 +3483,7 @@ bool set_food(int 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);
@@ -3637,8 +3493,6 @@ bool set_food(int v)
 
        /* Handle stuff */
        handle_stuff();
-
-       /* Result */
        return (TRUE);
 }
 
@@ -3652,7 +3506,7 @@ bool set_food(int v)
  */
 bool inc_stat(int stat)
 {
-       int value, gain;
+       BASE_STATUS value, gain;
 
        /* Then augment the current/max stat */
        value = p_ptr->stat_cur[stat];
@@ -3728,7 +3582,9 @@ bool inc_stat(int stat)
  */
 bool dec_stat(int stat, int amount, int permanent)
 {
-       int cur, max, loss, same, res = FALSE;
+       BASE_STATUS cur, max;
+       int loss, same;
+       bool res = FALSE;
 
 
        /* Acquire current value */
@@ -3835,7 +3691,6 @@ bool dec_stat(int stat, int amount, int permanent)
                p_ptr->update |= (PU_BONUS);
        }
 
-       /* Done */
        return (res);
 }
 
@@ -3875,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;
        }
@@ -3897,7 +3755,6 @@ bool hp_player(int num)
                /* Redraw */
                p_ptr->redraw |= (PR_HP);
 
-               /* Window stuff */
                p_ptr->window |= (PW_PLAYER);
 
                /* Heal 0-4 */
@@ -3924,7 +3781,6 @@ bool hp_player(int num)
                        msg_print(_("ひじょうに気分が良くなった。", "You feel very good."));
                }
 
-               /* Notice */
                return (TRUE);
        }
 
@@ -3938,12 +3794,12 @@ bool hp_player(int num)
  */
 static cptr desc_stat_pos[] =
 {
-_("強く", "strong"),
-_("知的に", "smart"),
-_("賢く", "wise"),
-_("器用に", "dextrous"),
-_("健康に", "healthy"),
-_("美しく", "cute")
+       _("強く", "strong"),
+       _("知的に", "smart"),
+       _("賢く", "wise"),
+       _("器用に", "dextrous"),
+       _("健康に", "healthy"),
+       _("美しく", "cute")
 };
 
 
@@ -3952,22 +3808,12 @@ _("美しく", "cute")
  */
 static cptr desc_stat_neg[] =
 {
-#ifdef JP
-"弱く",
-"無知に",
-"愚かに",
-"不器用に",
-"不健康に",
-"醜く"
-#else
-       "weak",
-       "stupid",
-       "naive",
-       "clumsy",
-       "sickly",
-       "ugly"
-#endif
-
+       _("弱く", "weak"),
+       _("無知に", "stupid"),
+       _("愚かに", "naive"),
+       _("不器用に", "clumsy"),
+       _("不健康に", "sickly"),
+       _("醜く", "ugly")
 };
 
 
@@ -3992,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]);
 
@@ -4003,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 */
@@ -4023,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);
        }
 
@@ -4061,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);
        }
 
@@ -4091,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 */
@@ -4108,7 +3945,6 @@ bool restore_level(void)
        return (FALSE);
 }
 
-
 /*
  * Forget everything
  */
@@ -4149,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 */
@@ -4188,7 +4023,7 @@ void do_poly_wounds(void)
 /*
  * Change player race
  */
-void change_race(int new_race, cptr effect_msg)
+void change_race(CHARACTER_IDX new_race, cptr effect_msg)
 {
        cptr title = race_info[new_race].title;
        int  old_race = p_ptr->prace;
@@ -4207,7 +4042,7 @@ void change_race(int 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];
@@ -4260,7 +4095,7 @@ void do_poly_self(void)
        if ((power > randint0(20)) && one_in_(3) && (p_ptr->prace != RACE_ANDROID))
        {
                char effect_msg[80] = "";
-               int new_race;
+               CHARACTER_IDX new_race;
 
                /* Some form of racial polymorph... */
                power -= 10;
@@ -4327,7 +4162,7 @@ void do_poly_self(void)
 
                do
                {
-                       new_race = randint0(MAX_RACES);
+                       new_race = (CHARACTER_IDX)randint0(MAX_RACES);
                }
                while ((new_race == p_ptr->prace) || (new_race == RACE_ANDROID));
 
@@ -4388,19 +4223,19 @@ 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".
  */
 
-int take_hit(int damage_type, int damage, cptr hit_from, int monspell)
+int take_hit(int damage_type, HIT_POINT damage, cptr hit_from, int monspell)
 {
        int old_chp = p_ptr->chp;
 
        char death_message[1024];
-       char tmp[80];
+       char tmp[1024];
 
        int warning = (p_ptr->mhp * hitpoint_warn / 10);
 
@@ -4414,8 +4249,7 @@ int take_hit(int damage_type, int damage, cptr hit_from, int monspell)
 
        if (damage_type != DAMAGE_USELIFE)
        {
-               /* Disturb */
-               disturb(1, 1);
+               disturb(TRUE, TRUE);
                if (auto_more)
                {
                        now_damaged = TRUE;
@@ -4487,7 +4321,6 @@ int take_hit(int damage_type, int 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)
@@ -4506,7 +4339,6 @@ int take_hit(int damage_type, int damage, cptr hit_from, int monspell)
                        if(!save_player()) msg_print("セーブ失敗!");
 #endif
 
-               /* Sound */
                sound(SOUND_DEATH);
 
                chg_virtue(V_SACRIFICE, 10);
@@ -4528,7 +4360,7 @@ int take_hit(int damage_type, int 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;
 
@@ -4577,7 +4409,7 @@ int take_hit(int damage_type, int damage, cptr hit_from, int monspell)
                                         !((q_idx == QUEST_OBERON) || (q_idx == QUEST_SERPENT))))
                                        strcpy(buf,_("クエスト", "in a quest"));
                                else
-                                       sprintf(buf,_("%d階", "level %d"), dun_level);
+                                       sprintf(buf,_("%d階", "level %d"), (int)dun_level);
 
                                sprintf(tmp, _("%sで%sに殺された。", "killed by %s %s."), buf, p_ptr->died_from);
                                do_cmd_write_nikki(NIKKI_BUNSHOU, 0, tmp);
@@ -4729,7 +4561,6 @@ int take_hit(int damage_type, int damage, cptr hit_from, int monspell)
                        now_damaged = TRUE;
                }
 
-               /* Message */
                msg_print(_("*** 警告:低ヒット・ポイント! ***", "*** LOW HITPOINT WARNING! ***"));
                msg_print(NULL);
                flush();
@@ -4789,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);
@@ -4851,15 +4680,15 @@ void calc_android_exp(void)
                        if (level > 65) level = 35 + (level - 65) / 5;
                        else if (level > 35) level = 25 + (level - 35) / 3;
                        else if (level > 15) level = 15 + (level - 15) / 2;
-                       exp = MIN(100000L, value) * level * level / 2;
+                       exp = MIN(100000L, value) / 2 * level * level;
                        if (value > 100000L)
-                               exp += (value - 100000L) * level * level / 8;
+                               exp += (value - 100000L) / 8 * level * level;
                }
                else
                {
                        exp = MIN(100000L, value) * level;
                        if (value > 100000L)
-                               exp += (value - 100000L) * level / 4;
+                               exp += (value - 100000L) / 4  * level;
                }
                if ((((i == INVEN_RARM) || (i == INVEN_LARM)) && (buki_motteruka(i))) || (i == INVEN_BOW)) total_exp += exp / 48;
                else total_exp += exp / 16;
@@ -4922,7 +4751,7 @@ bool drain_exp(s32b drain, s32b slip, int hold_exp_prob)
 }
 
 
-bool set_ultimate_res(int v, bool do_dec)
+bool set_ultimate_res(TIME_EFFECT v, bool do_dec)
 {
        bool notice = FALSE;
 
@@ -4964,20 +4793,17 @@ bool set_ultimate_res(int 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);
 }
 
-bool set_tim_res_nether(int v, bool do_dec)
+bool set_tim_res_nether(TIME_EFFECT v, bool do_dec)
 {
        bool notice = FALSE;
 
@@ -5019,20 +4845,17 @@ bool set_tim_res_nether(int 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);
 }
 
-bool set_tim_res_time(int v, bool do_dec)
+bool set_tim_res_time(TIME_EFFECT v, bool do_dec)
 {
        bool notice = FALSE;
 
@@ -5074,16 +4897,13 @@ bool set_tim_res_time(int 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);
 }
 
@@ -5163,7 +4983,7 @@ bool choose_ele_attack(void)
 /*
  * Choose a elemental immune. -LM-
  */
-bool choose_ele_immune(int immune_turn)
+bool choose_ele_immune(TIME_EFFECT immune_turn)
 {
        char choice;
 
@@ -5203,3 +5023,4 @@ bool choose_ele_immune(int immune_turn)
        screen_load();
        return TRUE;
 }
+