OSDN Git Service

[Refactor] #37353 obj_kind.c を object-hook.c に統合。 / Integrate obj_kind.c to object...
[hengband/hengband.git] / src / effects.c
index 5d41b9e..1107e77 100644 (file)
  */
 
 #include "angband.h"
+#include "mutation.h"
+#include "quest.h"
+#include "avatar.h"
+#include "player-status.h"
+#include "spells-status.h"
+#include "realm-hex.h"
+#include "object-hook.h"
 
 /*!
  * @brief プレイヤーの継続行動を設定する。
@@ -71,7 +78,7 @@ void set_action(ACTION_IDX typ)
                        case ACTION_HAYAGAKE:
                        {
                                msg_print(_("足が重くなった。", "You are no longer walking extremely fast."));
-                               p_ptr->energy_use = 100;
+                               take_turn(p_ptr, 100);;
                                break;
                        }
                        case ACTION_SPELL:
@@ -116,11 +123,7 @@ void set_action(ACTION_IDX typ)
                        break;
                }
        }
-
-       /* Recalculate bonuses */
        p_ptr->update |= (PU_BONUS);
-
-       /* Redraw the state */
        p_ptr->redraw |= (PR_STATE);
 }
 
@@ -173,7 +176,6 @@ void reset_tim_flags(void)
        p_ptr->dustrobe = 0;
        p_ptr->action = ACTION_NONE;
 
-
        p_ptr->oppose_acid = 0;     /* Timed -- oppose acid */
        p_ptr->oppose_elec = 0;     /* Timed -- oppose lightning */
        p_ptr->oppose_fire = 0;     /* Timed -- oppose heat */
@@ -190,7 +192,7 @@ void reset_tim_flags(void)
        p_ptr->special_defense = 0L;
 
        while(p_ptr->energy_need < 0) p_ptr->energy_need += ENERGY_NEED();
-       world_player = FALSE;
+       p_ptr->timewalk = FALSE;
 
        if (prace_is_(RACE_DEMON) && (p_ptr->lev > 44)) p_ptr->oppose_fire = 1;
        if ((p_ptr->pclass == CLASS_NINJA) && (p_ptr->lev > 44)) p_ptr->oppose_pois = 1;
@@ -266,24 +268,15 @@ void dispel_player(void)
 
        if (music_singing_any() || hex_spelling_any())
        {
-               cptr str = (music_singing_any()) ? _("歌", "singing") : _("呪文", "spelling");
+               concptr str = (music_singing_any()) ? _("歌", "singing") : _("呪文", "spelling");
                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;
 
-               /* Recalculate bonuses */
-               p_ptr->update |= (PU_BONUS | PU_HP);
-
-               /* Redraw map */
+               p_ptr->action = ACTION_NONE;
+               p_ptr->update |= (PU_BONUS | PU_HP | PU_MONSTERS);
                p_ptr->redraw |= (PR_MAP | PR_STATUS | PR_STATE);
-
-               /* Update monsters */
-               p_ptr->update |= (PU_MONSTERS);
-
-               /* Window stuff */
                p_ptr->window |= (PW_OVERHEAD | PW_DUNGEON);
-
                p_ptr->energy_need += ENERGY_NEED();
        }
 }
@@ -299,8 +292,6 @@ void dispel_player(void)
 bool set_mimic(TIME_EFFECT v, IDX p, bool do_dec)
 {
        bool notice = FALSE;
-
-       /* Hack -- Force good values */
        v = (v > 10000) ? 10000 : (v < 0) ? 0 : v;
 
        if (p_ptr->is_dead) return FALSE;
@@ -337,21 +328,14 @@ bool set_mimic(TIME_EFFECT v, IDX p, bool do_dec)
        p_ptr->tim_mimic = v;
 
        /* Nothing to notice */
-       if (!notice)
-               return (FALSE);
+       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);
-
-       /* Recalculate bonuses */
        p_ptr->update |= (PU_BONUS | PU_HP);
 
        handle_stuff();
-
-       /* Result */
        return (TRUE);
 }
 
@@ -368,8 +352,6 @@ bool set_mimic(TIME_EFFECT v, IDX p, bool do_dec)
 bool set_blind(TIME_EFFECT v)
 {
        bool notice = FALSE;
-
-       /* Hack -- Force good values */
        v = (v > 10000) ? 10000 : (v < 0) ? 0 : v;
 
        if (p_ptr->is_dead) return FALSE;
@@ -413,29 +395,17 @@ bool set_blind(TIME_EFFECT v)
 
        /* Use the value */
        p_ptr->blind = v;
-
-       /* Redraw status bar */
        p_ptr->redraw |= (PR_STATUS);
 
        /* 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);
-
-       /* Redraw map */
        p_ptr->redraw |= (PR_MAP);
-
-       /* Window stuff */
        p_ptr->window |= (PW_OVERHEAD | PW_DUNGEON);
-
-       /* Handle stuff */
        handle_stuff();
-
-       /* Result */
        return (TRUE);
 }
 
@@ -448,8 +418,6 @@ bool set_blind(TIME_EFFECT v)
 bool set_confused(TIME_EFFECT v)
 {
        bool notice = FALSE;
-
-       /* Hack -- Force good values */
        v = (v > 10000) ? 10000 : (v < 0) ? 0 : v;
 
        if (p_ptr->is_dead) return FALSE;
@@ -513,20 +481,13 @@ bool set_confused(TIME_EFFECT v)
 
        /* Use the value */
        p_ptr->confused = v;
-
-       /* Redraw status bar */
        p_ptr->redraw |= (PR_STATUS);
 
        /* Nothing to notice */
        if (!notice) return (FALSE);
 
-       /* Disturb */
-       if (disturb_state) disturb(0, 0);
-
-       /* Handle stuff */
+       if (disturb_state) disturb(FALSE, FALSE);
        handle_stuff();
-
-       /* Result */
        return (TRUE);
 }
 
@@ -539,8 +500,6 @@ bool set_confused(TIME_EFFECT v)
 bool set_poisoned(TIME_EFFECT v)
 {
        bool notice = FALSE;
-
-       /* Hack -- Force good values */
        v = (v > 10000) ? 10000 : (v < 0) ? 0 : v;
 
        if (p_ptr->is_dead) return FALSE;
@@ -567,20 +526,13 @@ bool set_poisoned(TIME_EFFECT v)
 
        /* Use the value */
        p_ptr->poisoned = v;
-
-       /* Redraw status bar */
        p_ptr->redraw |= (PR_STATUS);
 
        /* Nothing to notice */
        if (!notice) return (FALSE);
 
-       /* Disturb */
-       if (disturb_state) disturb(0, 0);
-
-       /* Handle stuff */
+       if (disturb_state) disturb(FALSE, FALSE);
        handle_stuff();
-
-       /* Result */
        return (TRUE);
 }
 
@@ -593,8 +545,6 @@ bool set_poisoned(TIME_EFFECT v)
 bool set_afraid(TIME_EFFECT v)
 {
        bool notice = FALSE;
-
-       /* Hack -- Force good values */
        v = (v > 10000) ? 10000 : (v < 0) ? 0 : v;
 
        if (p_ptr->is_dead) return FALSE;
@@ -635,20 +585,13 @@ bool set_afraid(TIME_EFFECT v)
 
        /* Use the value */
        p_ptr->afraid = v;
-
-       /* Redraw status bar */
        p_ptr->redraw |= (PR_STATUS);
 
        /* Nothing to notice */
        if (!notice) return (FALSE);
 
-       /* Disturb */
-       if (disturb_state) disturb(0, 0);
-
-       /* Handle stuff */
+       if (disturb_state) disturb(FALSE, FALSE);
        handle_stuff();
-
-       /* Result */
        return (TRUE);
 }
 
@@ -660,8 +603,6 @@ bool set_afraid(TIME_EFFECT v)
 bool set_paralyzed(TIME_EFFECT v)
 {
        bool notice = FALSE;
-
-       /* Hack -- Force good values */
        v = (v > 10000) ? 10000 : (v < 0) ? 0 : v;
 
        if (p_ptr->is_dead) return FALSE;
@@ -695,23 +636,14 @@ bool set_paralyzed(TIME_EFFECT v)
 
        /* Use the value */
        p_ptr->paralyzed = v;
-
-       /* Redraw status bar */
        p_ptr->redraw |= (PR_STATUS);
 
        /* Nothing to notice */
        if (!notice) return (FALSE);
 
-       /* Disturb */
-       if (disturb_state) disturb(0, 0);
-
-       /* Redraw the state */
+       if (disturb_state) disturb(FALSE, FALSE);
        p_ptr->redraw |= (PR_STATE);
-
-       /* Handle stuff */
        handle_stuff();
-
-       /* Result */
        return (TRUE);
 }
 
@@ -724,11 +656,10 @@ bool set_paralyzed(TIME_EFFECT v)
 bool set_image(TIME_EFFECT v)
 {
        bool notice = FALSE;
-
-       /* Hack -- Force good values */
        v = (v > 10000) ? 10000 : (v < 0) ? 0 : v;
 
        if (p_ptr->is_dead) return FALSE;
+       if (p_ptr->pseikaku == SEIKAKU_CHARGEMAN) v = 0;
 
 
        /* Open */
@@ -759,32 +690,17 @@ bool set_image(TIME_EFFECT v)
 
        /* Use the value */
        p_ptr->image = v;
-
-       /* Redraw status bar */
        p_ptr->redraw |= (PR_STATUS);
 
        /* Nothing to notice */
        if (!notice) return (FALSE);
 
-       /* Disturb */
-       if (disturb_state) disturb(0, 1);
-
-       /* Redraw map */
-       p_ptr->redraw |= (PR_MAP);
-
-       /* Update the health bar */
-       p_ptr->redraw |= (PR_HEALTH | PR_UHEALTH);
+       if (disturb_state) disturb(FALSE, TRUE);
 
-       /* Update monsters */
+       p_ptr->redraw |= (PR_MAP | PR_HEALTH | PR_UHEALTH);
        p_ptr->update |= (PU_MONSTERS);
-
-       /* Window stuff */
        p_ptr->window |= (PW_OVERHEAD | PW_DUNGEON);
-
-       /* Handle stuff */
        handle_stuff();
-
-       /* Result */
        return (TRUE);
 }
 
@@ -797,8 +713,6 @@ bool set_image(TIME_EFFECT v)
 bool set_fast(TIME_EFFECT v, bool do_dec)
 {
        bool notice = FALSE;
-
-       /* Hack -- Force good values */
        v = (v > 10000) ? 10000 : (v < 0) ? 0 : v;
 
        if (p_ptr->is_dead) return FALSE;
@@ -835,16 +749,9 @@ bool set_fast(TIME_EFFECT v, bool do_dec)
        /* Nothing to notice */
        if (!notice) return (FALSE);
 
-       /* Disturb */
-       if (disturb_state) disturb(0, 0);
-
-       /* Recalculate bonuses */
+       if (disturb_state) disturb(FALSE, FALSE);
        p_ptr->update |= (PU_BONUS);
-
-       /* Handle stuff */
        handle_stuff();
-
-       /* Result */
        return (TRUE);
 }
 
@@ -857,8 +764,6 @@ bool set_fast(TIME_EFFECT v, bool do_dec)
 bool set_lightspeed(TIME_EFFECT v, bool do_dec)
 {
        bool notice = FALSE;
-
-       /* Hack -- Force good values */
        v = (v > 10000) ? 10000 : (v < 0) ? 0 : v;
 
        if (p_ptr->is_dead) return FALSE;
@@ -897,16 +802,9 @@ bool set_lightspeed(TIME_EFFECT v, bool do_dec)
        /* Nothing to notice */
        if (!notice) return (FALSE);
 
-       /* Disturb */
-       if (disturb_state) disturb(0, 0);
-
-       /* Recalculate bonuses */
+       if (disturb_state) disturb(FALSE, FALSE);
        p_ptr->update |= (PU_BONUS);
-
-       /* Handle stuff */
        handle_stuff();
-
-       /* Result */
        return (TRUE);
 }
 
@@ -919,8 +817,6 @@ bool set_lightspeed(TIME_EFFECT v, bool do_dec)
 bool set_slow(TIME_EFFECT v, bool do_dec)
 {
        bool notice = FALSE;
-
-       /* Hack -- Force good values */
        v = (v > 10000) ? 10000 : (v < 0) ? 0 : v;
 
        if (p_ptr->is_dead) return FALSE;
@@ -955,16 +851,9 @@ bool set_slow(TIME_EFFECT v, bool do_dec)
        /* Nothing to notice */
        if (!notice) return (FALSE);
 
-       /* Disturb */
-       if (disturb_state) disturb(0, 0);
-
-       /* Recalculate bonuses */
+       if (disturb_state) disturb(FALSE, FALSE);
        p_ptr->update |= (PU_BONUS);
-
-       /* Handle stuff */
        handle_stuff();
-
-       /* Result */
        return (TRUE);
 }
 
@@ -978,8 +867,6 @@ bool set_slow(TIME_EFFECT v, bool do_dec)
 bool set_shield(TIME_EFFECT v, bool do_dec)
 {
        bool notice = FALSE;
-
-       /* Hack -- Force good values */
        v = (v > 10000) ? 10000 : (v < 0) ? 0 : v;
 
        if (p_ptr->is_dead) return FALSE;
@@ -1010,23 +897,14 @@ bool set_shield(TIME_EFFECT v, bool do_dec)
 
        /* Use the value */
        p_ptr->shield = v;
-
-       /* Redraw status bar */
        p_ptr->redraw |= (PR_STATUS);
 
        /* Nothing to notice */
        if (!notice) return (FALSE);
 
-       /* Disturb */
-       if (disturb_state) disturb(0, 0);
-
-       /* Recalculate bonuses */
+       if (disturb_state) disturb(FALSE, FALSE);
        p_ptr->update |= (PU_BONUS);
-
-       /* Handle stuff */
        handle_stuff();
-
-       /* Result */
        return (TRUE);
 }
 
@@ -1040,8 +918,6 @@ bool set_shield(TIME_EFFECT v, bool do_dec)
 bool set_tsubureru(TIME_EFFECT v, bool do_dec)
 {
        bool notice = FALSE;
-
-       /* Hack -- Force good values */
        v = (v > 10000) ? 10000 : (v < 0) ? 0 : v;
 
        if (p_ptr->is_dead) return FALSE;
@@ -1072,23 +948,14 @@ bool set_tsubureru(TIME_EFFECT v, bool do_dec)
 
        /* Use the value */
        p_ptr->tsubureru = v;
-
-       /* Redraw status bar */
        p_ptr->redraw |= (PR_STATUS);
 
        /* Nothing to notice */
        if (!notice) return (FALSE);
 
-       /* Disturb */
-       if (disturb_state) disturb(0, 0);
-
-       /* Recalculate bonuses */
+       if (disturb_state) disturb(FALSE, FALSE);
        p_ptr->update |= (PU_BONUS);
-
-       /* Handle stuff */
        handle_stuff();
-
-       /* Result */
        return (TRUE);
 }
 
@@ -1102,8 +969,6 @@ bool set_tsubureru(TIME_EFFECT v, bool do_dec)
 bool set_magicdef(TIME_EFFECT v, bool do_dec)
 {
        bool notice = FALSE;
-
-       /* Hack -- Force good values */
        v = (v > 10000) ? 10000 : (v < 0) ? 0 : v;
 
        if (p_ptr->is_dead) return FALSE;
@@ -1134,23 +999,14 @@ bool set_magicdef(TIME_EFFECT v, bool do_dec)
 
        /* Use the value */
        p_ptr->magicdef = v;
-
-       /* Redraw status bar */
        p_ptr->redraw |= (PR_STATUS);
 
        /* Nothing to notice */
        if (!notice) return (FALSE);
 
-       /* Disturb */
-       if (disturb_state) disturb(0, 0);
-
-       /* Recalculate bonuses */
+       if (disturb_state) disturb(FALSE, FALSE);
        p_ptr->update |= (PU_BONUS);
-
-       /* Handle stuff */
        handle_stuff();
-
-       /* Result */
        return (TRUE);
 }
 
@@ -1163,8 +1019,6 @@ bool set_magicdef(TIME_EFFECT v, bool do_dec)
 bool set_blessed(TIME_EFFECT v, bool do_dec)
 {
        bool notice = FALSE;
-
-       /* Hack -- Force good values */
        v = (v > 10000) ? 10000 : (v < 0) ? 0 : v;
 
        if (p_ptr->is_dead) return FALSE;
@@ -1195,23 +1049,14 @@ bool set_blessed(TIME_EFFECT v, bool do_dec)
 
        /* Use the value */
        p_ptr->blessed = v;
-
-       /* Redraw status bar */
        p_ptr->redraw |= (PR_STATUS);
 
        /* Nothing to notice */
        if (!notice) return (FALSE);
 
-       /* Disturb */
-       if (disturb_state) disturb(0, 0);
-
-       /* Recalculate bonuses */
+       if (disturb_state) disturb(FALSE, FALSE);
        p_ptr->update |= (PU_BONUS);
-
-       /* Handle stuff */
        handle_stuff();
-
-       /* Result */
        return (TRUE);
 }
 
@@ -1225,8 +1070,6 @@ bool set_blessed(TIME_EFFECT v, bool do_dec)
 bool set_hero(TIME_EFFECT v, bool do_dec)
 {
        bool notice = FALSE;
-
-       /* Hack -- Force good values */
        v = (v > 10000) ? 10000 : (v < 0) ? 0 : v;
 
        if (p_ptr->is_dead) return FALSE;
@@ -1257,26 +1100,17 @@ bool set_hero(TIME_EFFECT v, bool do_dec)
 
        /* Use the value */
        p_ptr->hero = v;
-
-       /* Redraw status bar */
        p_ptr->redraw |= (PR_STATUS);
 
        /* Nothing to notice */
        if (!notice) return (FALSE);
 
-       /* Disturb */
-       if (disturb_state) disturb(0, 0);
-
-       /* Recalculate bonuses */
+       if (disturb_state) disturb(FALSE, FALSE);
        p_ptr->update |= (PU_BONUS);
 
        /* Recalculate hitpoints */
        p_ptr->update |= (PU_HP);
-
-       /* Handle stuff */
        handle_stuff();
-
-       /* Result */
        return (TRUE);
 }
 
@@ -1289,8 +1123,6 @@ bool set_hero(TIME_EFFECT v, bool do_dec)
 bool set_shero(TIME_EFFECT v, bool do_dec)
 {
        bool notice = FALSE;
-
-       /* Hack -- Force good values */
        v = (v > 10000) ? 10000 : (v < 0) ? 0 : v;
 
        if (p_ptr->is_dead) return FALSE;
@@ -1322,26 +1154,17 @@ bool set_shero(TIME_EFFECT v, bool do_dec)
 
        /* Use the value */
        p_ptr->shero = v;
-
-       /* Redraw status bar */
        p_ptr->redraw |= (PR_STATUS);
 
        /* Nothing to notice */
        if (!notice) return (FALSE);
 
-       /* Disturb */
-       if (disturb_state) disturb(0, 0);
-
-       /* Recalculate bonuses */
+       if (disturb_state) disturb(FALSE, FALSE);
        p_ptr->update |= (PU_BONUS);
 
        /* Recalculate hitpoints */
        p_ptr->update |= (PU_HP);
-
-       /* Handle stuff */
        handle_stuff();
-
-       /* Result */
        return (TRUE);
 }
 
@@ -1354,8 +1177,6 @@ bool set_shero(TIME_EFFECT v, bool do_dec)
 bool set_protevil(TIME_EFFECT v, bool do_dec)
 {
        bool notice = FALSE;
-
-       /* Hack -- Force good values */
        v = (v > 10000) ? 10000 : (v < 0) ? 0 : v;
 
        if (p_ptr->is_dead) return FALSE;
@@ -1386,20 +1207,13 @@ bool set_protevil(TIME_EFFECT v, bool do_dec)
 
        /* Use the value */
        p_ptr->protevil = v;
-
-       /* Redraw status bar */
        p_ptr->redraw |= (PR_STATUS);
 
        /* Nothing to notice */
        if (!notice) return (FALSE);
 
-       /* Disturb */
-       if (disturb_state) disturb(0, 0);
-
-       /* Handle stuff */
+       if (disturb_state) disturb(FALSE, FALSE);
        handle_stuff();
-
-       /* Result */
        return (TRUE);
 }
 
@@ -1412,8 +1226,6 @@ bool set_protevil(TIME_EFFECT v, bool do_dec)
 bool set_wraith_form(TIME_EFFECT v, bool do_dec)
 {
        bool notice = FALSE;
-
-       /* Hack -- Force good values */
        v = (v > 10000) ? 10000 : (v < 0) ? 0 : v;
 
        if (p_ptr->is_dead) return FALSE;
@@ -1434,13 +1246,9 @@ bool set_wraith_form(TIME_EFFECT v, bool do_dec)
                        chg_virtue(V_SACRIFICE, -2);
                        chg_virtue(V_VALOUR, -5);
 
-                       /* Redraw map */
                        p_ptr->redraw |= (PR_MAP);
-
-                       /* Update monsters */
                        p_ptr->update |= (PU_MONSTERS);
 
-                       /* Window stuff */
                        p_ptr->window |= (PW_OVERHEAD | PW_DUNGEON);
                }
        }
@@ -1453,36 +1261,23 @@ bool set_wraith_form(TIME_EFFECT v, bool do_dec)
                        msg_print(_("不透明になった感じがする。", "You feel opaque."));
                        notice = TRUE;
 
-                       /* Redraw map */
                        p_ptr->redraw |= (PR_MAP);
-
-                       /* Update monsters */
                        p_ptr->update |= (PU_MONSTERS);
 
-                       /* Window stuff */
                        p_ptr->window |= (PW_OVERHEAD | PW_DUNGEON);
                }
        }
 
        /* Use the value */
        p_ptr->wraith_form = v;
-
-       /* Redraw status bar */
        p_ptr->redraw |= (PR_STATUS);
 
        /* Nothing to notice */
        if (!notice) return (FALSE);
 
-       /* Disturb */
-       if (disturb_state) disturb(0, 0);
-
-       /* Recalculate bonuses */
+       if (disturb_state) disturb(FALSE, FALSE);
        p_ptr->update |= (PU_BONUS);
-
-       /* Handle stuff */
        handle_stuff();
-
-       /* Result */
        return (TRUE);
 
 }
@@ -1496,8 +1291,6 @@ bool set_wraith_form(TIME_EFFECT v, bool do_dec)
 bool set_invuln(TIME_EFFECT v, bool do_dec)
 {
        bool notice = FALSE;
-
-       /* Hack -- Force good values */
        v = (v > 10000) ? 10000 : (v < 0) ? 0 : v;
 
        if (p_ptr->is_dead) return FALSE;
@@ -1519,13 +1312,9 @@ bool set_invuln(TIME_EFFECT v, bool do_dec)
                        chg_virtue(V_SACRIFICE, -3);
                        chg_virtue(V_VALOUR, -5);
 
-                       /* Redraw map */
                        p_ptr->redraw |= (PR_MAP);
-
-                       /* Update monsters */
                        p_ptr->update |= (PU_MONSTERS);
 
-                       /* Window stuff */
                        p_ptr->window |= (PW_OVERHEAD | PW_DUNGEON);
                }
        }
@@ -1538,13 +1327,9 @@ bool set_invuln(TIME_EFFECT v, bool do_dec)
                        msg_print(_("無敵ではなくなった。", "The invulnerability wears off."));
                        notice = TRUE;
 
-                       /* Redraw map */
                        p_ptr->redraw |= (PR_MAP);
-
-                       /* Update monsters */
                        p_ptr->update |= (PU_MONSTERS);
 
-                       /* Window stuff */
                        p_ptr->window |= (PW_OVERHEAD | PW_DUNGEON);
 
                        p_ptr->energy_need += ENERGY_NEED();
@@ -1553,23 +1338,14 @@ bool set_invuln(TIME_EFFECT v, bool do_dec)
 
        /* Use the value */
        p_ptr->invuln = v;
-
-       /* Redraw status bar */
        p_ptr->redraw |= (PR_STATUS);
 
        /* Nothing to notice */
        if (!notice) return (FALSE);
 
-       /* Disturb */
-       if (disturb_state) disturb(0, 0);
-
-       /* Recalculate bonuses */
+       if (disturb_state) disturb(FALSE, FALSE);
        p_ptr->update |= (PU_BONUS);
-
-       /* Handle stuff */
        handle_stuff();
-
-       /* Result */
        return (TRUE);
 }
 
@@ -1582,8 +1358,6 @@ bool set_invuln(TIME_EFFECT v, bool do_dec)
 bool set_tim_esp(TIME_EFFECT v, bool do_dec)
 {
        bool notice = FALSE;
-
-       /* Hack -- Force good values */
        v = (v > 10000) ? 10000 : (v < 0) ? 0 : v;
 
        if (p_ptr->is_dead) return FALSE;
@@ -1614,26 +1388,15 @@ bool set_tim_esp(TIME_EFFECT v, bool do_dec)
 
        /* Use the value */
        p_ptr->tim_esp = v;
-
-       /* Redraw status bar */
        p_ptr->redraw |= (PR_STATUS);
 
        /* Nothing to notice */
        if (!notice) return (FALSE);
 
-       /* Disturb */
-       if (disturb_state) disturb(0, 0);
-
-       /* Recalculate bonuses */
+       if (disturb_state) disturb(FALSE, FALSE);
        p_ptr->update |= (PU_BONUS);
-
-       /* Update the monsters */
        p_ptr->update |= (PU_MONSTERS);
-
-       /* Handle stuff */
        handle_stuff();
-
-       /* Result */
        return (TRUE);
 }
 
@@ -1646,8 +1409,6 @@ bool set_tim_esp(TIME_EFFECT v, bool do_dec)
 bool set_tim_invis(TIME_EFFECT v, bool do_dec)
 {
        bool notice = FALSE;
-
-       /* Hack -- Force good values */
        v = (v > 10000) ? 10000 : (v < 0) ? 0 : v;
 
        if (p_ptr->is_dead) return FALSE;
@@ -1678,26 +1439,17 @@ bool set_tim_invis(TIME_EFFECT v, bool do_dec)
 
        /* Use the value */
        p_ptr->tim_invis = v;
-
-       /* Redraw status bar */
        p_ptr->redraw |= (PR_STATUS);
 
        /* Nothing to notice */
        if (!notice) return (FALSE);
 
-       /* Disturb */
-       if (disturb_state) disturb(0, 0);
-
-       /* Recalculate bonuses */
+       if (disturb_state) disturb(FALSE, FALSE);
        p_ptr->update |= (PU_BONUS);
 
        /* Update the monsters */
        p_ptr->update |= (PU_MONSTERS);
-
-       /* Handle stuff */
        handle_stuff();
-
-       /* Result */
        return (TRUE);
 }
 
@@ -1710,8 +1462,6 @@ bool set_tim_invis(TIME_EFFECT v, bool do_dec)
 bool set_tim_infra(TIME_EFFECT v, bool do_dec)
 {
        bool notice = FALSE;
-
-       /* Hack -- Force good values */
        v = (v > 10000) ? 10000 : (v < 0) ? 0 : v;
 
        if (p_ptr->is_dead) return FALSE;
@@ -1742,26 +1492,17 @@ bool set_tim_infra(TIME_EFFECT v, bool do_dec)
 
        /* Use the value */
        p_ptr->tim_infra = v;
-
-       /* Redraw status bar */
        p_ptr->redraw |= (PR_STATUS);
 
        /* Nothing to notice */
        if (!notice) return (FALSE);
 
-       /* Disturb */
-       if (disturb_state) disturb(0, 0);
-
-       /* Recalculate bonuses */
+       if (disturb_state) disturb(FALSE, FALSE);
        p_ptr->update |= (PU_BONUS);
 
        /* Update the monsters */
        p_ptr->update |= (PU_MONSTERS);
-
-       /* Handle stuff */
        handle_stuff();
-
-       /* Result */
        return (TRUE);
 }
 
@@ -1774,8 +1515,6 @@ bool set_tim_infra(TIME_EFFECT v, bool do_dec)
 bool set_tim_regen(TIME_EFFECT v, bool do_dec)
 {
        bool notice = FALSE;
-
-       /* Hack -- Force good values */
        v = (v > 10000) ? 10000 : (v < 0) ? 0 : v;
 
        if (p_ptr->is_dead) return FALSE;
@@ -1806,23 +1545,14 @@ bool set_tim_regen(TIME_EFFECT v, bool do_dec)
 
        /* Use the value */
        p_ptr->tim_regen = v;
-
-       /* Redraw status bar */
        p_ptr->redraw |= (PR_STATUS);
 
        /* Nothing to notice */
        if (!notice) return (FALSE);
 
-       /* Disturb */
-       if (disturb_state) disturb(0, 0);
-
-       /* Recalculate bonuses */
+       if (disturb_state) disturb(FALSE, FALSE);
        p_ptr->update |= (PU_BONUS);
-
-       /* Handle stuff */
        handle_stuff();
-
-       /* Result */
        return (TRUE);
 }
 
@@ -1835,8 +1565,6 @@ bool set_tim_regen(TIME_EFFECT v, bool do_dec)
 bool set_tim_stealth(TIME_EFFECT v, bool do_dec)
 {
        bool notice = FALSE;
-
-       /* Hack -- Force good values */
        v = (v > 10000) ? 10000 : (v < 0) ? 0 : v;
 
        if (p_ptr->is_dead) return FALSE;
@@ -1867,23 +1595,14 @@ bool set_tim_stealth(TIME_EFFECT v, bool do_dec)
 
        /* Use the value */
        p_ptr->tim_stealth = v;
-
-       /* Redraw status bar */
        p_ptr->redraw |= (PR_STATUS);
 
        /* Nothing to notice */
        if (!notice) return (FALSE);
 
-       /* Disturb */
-       if (disturb_state) disturb(0, 0);
-
-       /* Recalculate bonuses */
+       if (disturb_state) disturb(FALSE, FALSE);
        p_ptr->update |= (PU_BONUS);
-
-       /* Handle stuff */
        handle_stuff();
-
-       /* Result */
        return (TRUE);
 }
 
@@ -1903,7 +1622,7 @@ bool set_superstealth(bool set)
        {
                if (!(p_ptr->special_defense & NINJA_S_STEALTH))
                {
-                       if (cave[p_ptr->y][p_ptr->x].info & CAVE_MNLT)
+                       if (grid_array[p_ptr->y][p_ptr->x].info & CAVE_MNLT)
                        {
                                msg_print(_("敵の目から薄い影の中に覆い隠された。", "You are mantled in weak shadow from ordinary eyes."));
                                p_ptr->monlite = p_ptr->old_monlite = TRUE;
@@ -1936,14 +1655,9 @@ bool set_superstealth(bool set)
 
        /* Nothing to notice */
        if (!notice) return (FALSE);
-
-       /* Redraw status bar */
        p_ptr->redraw |= (PR_STATUS);
 
-       /* Disturb */
-       if (disturb_state) disturb(0, 0);
-
-       /* Result */
+       if (disturb_state) disturb(FALSE, FALSE);
        return (TRUE);
 }
 
@@ -1956,8 +1670,6 @@ bool set_superstealth(bool set)
 bool set_tim_levitation(TIME_EFFECT v, bool do_dec)
 {
        bool notice = FALSE;
-
-       /* Hack -- Force good values */
        v = (v > 10000) ? 10000 : (v < 0) ? 0 : v;
 
        if (p_ptr->is_dead) return FALSE;
@@ -1988,23 +1700,14 @@ bool set_tim_levitation(TIME_EFFECT v, bool do_dec)
 
        /* Use the value */
        p_ptr->tim_levitation = v;
-
-       /* Redraw status bar */
        p_ptr->redraw |= (PR_STATUS);
 
        /* Nothing to notice */
        if (!notice) return (FALSE);
 
-       /* Disturb */
-       if (disturb_state) disturb(0, 0);
-
-       /* Recalculate bonuses */
+       if (disturb_state) disturb(FALSE, FALSE);
        p_ptr->update |= (PU_BONUS);
-
-       /* Handle stuff */
        handle_stuff();
-
-       /* Result */
        return (TRUE);
 }
 
@@ -2017,8 +1720,6 @@ bool set_tim_levitation(TIME_EFFECT v, bool do_dec)
 bool set_tim_sh_touki(TIME_EFFECT v, bool do_dec)
 {
        bool notice = FALSE;
-
-       /* Hack -- Force good values */
        v = (v > 10000) ? 10000 : (v < 0) ? 0 : v;
 
        if (p_ptr->is_dead) return FALSE;
@@ -2049,20 +1750,13 @@ bool set_tim_sh_touki(TIME_EFFECT v, bool do_dec)
 
        /* Use the value */
        p_ptr->tim_sh_touki = v;
-
-       /* Redraw status bar */
        p_ptr->redraw |= (PR_STATUS);
 
        /* Nothing to notice */
        if (!notice) return (FALSE);
 
-       /* Disturb */
-       if (disturb_state) disturb(0, 0);
-
-       /* Handle stuff */
+       if (disturb_state) disturb(FALSE, FALSE);
        handle_stuff();
-
-       /* Result */
        return (TRUE);
 }
 
@@ -2075,8 +1769,6 @@ bool set_tim_sh_touki(TIME_EFFECT v, bool do_dec)
 bool set_tim_sh_fire(TIME_EFFECT v, bool do_dec)
 {
        bool notice = FALSE;
-
-       /* Hack -- Force good values */
        v = (v > 10000) ? 10000 : (v < 0) ? 0 : v;
 
        if (p_ptr->is_dead) return FALSE;
@@ -2107,23 +1799,14 @@ bool set_tim_sh_fire(TIME_EFFECT v, bool do_dec)
 
        /* Use the value */
        p_ptr->tim_sh_fire = v;
-
-       /* Redraw status bar */
        p_ptr->redraw |= (PR_STATUS);
 
        /* Nothing to notice */
        if (!notice) return (FALSE);
 
-       /* Disturb */
-       if (disturb_state) disturb(0, 0);
-
-       /* Recalculate bonuses */
+       if (disturb_state) disturb(FALSE, FALSE);
        p_ptr->update |= (PU_BONUS);
-
-       /* Handle stuff */
        handle_stuff();
-
-       /* Result */
        return (TRUE);
 }
 
@@ -2136,8 +1819,6 @@ bool set_tim_sh_fire(TIME_EFFECT v, bool do_dec)
 bool set_tim_sh_holy(TIME_EFFECT v, bool do_dec)
 {
        bool notice = FALSE;
-
-       /* Hack -- Force good values */
        v = (v > 10000) ? 10000 : (v < 0) ? 0 : v;
 
        if (p_ptr->is_dead) return FALSE;
@@ -2168,23 +1849,14 @@ bool set_tim_sh_holy(TIME_EFFECT v, bool do_dec)
 
        /* Use the value */
        p_ptr->tim_sh_holy = v;
-
-       /* Redraw status bar */
        p_ptr->redraw |= (PR_STATUS);
 
        /* Nothing to notice */
        if (!notice) return (FALSE);
 
-       /* Disturb */
-       if (disturb_state) disturb(0, 0);
-
-       /* Recalculate bonuses */
+       if (disturb_state) disturb(FALSE, FALSE);
        p_ptr->update |= (PU_BONUS);
-
-       /* Handle stuff */
        handle_stuff();
-
-       /* Result */
        return (TRUE);
 }
 
@@ -2197,8 +1869,6 @@ bool set_tim_sh_holy(TIME_EFFECT v, bool do_dec)
 bool set_tim_eyeeye(TIME_EFFECT v, bool do_dec)
 {
        bool notice = FALSE;
-
-       /* Hack -- Force good values */
        v = (v > 10000) ? 10000 : (v < 0) ? 0 : v;
 
        if (p_ptr->is_dead) return FALSE;
@@ -2229,23 +1899,14 @@ bool set_tim_eyeeye(TIME_EFFECT v, bool do_dec)
 
        /* Use the value */
        p_ptr->tim_eyeeye = v;
-
-       /* Redraw status bar */
        p_ptr->redraw |= (PR_STATUS);
 
        /* Nothing to notice */
        if (!notice) return (FALSE);
 
-       /* Disturb */
-       if (disturb_state) disturb(0, 0);
-
-       /* Recalculate bonuses */
+       if (disturb_state) disturb(FALSE, FALSE);
        p_ptr->update |= (PU_BONUS);
-
-       /* Handle stuff */
        handle_stuff();
-
-       /* Result */
        return (TRUE);
 }
 
@@ -2259,8 +1920,6 @@ bool set_tim_eyeeye(TIME_EFFECT v, bool do_dec)
 bool set_resist_magic(TIME_EFFECT v, bool do_dec)
 {
        bool notice = FALSE;
-
-       /* Hack -- Force good values */
        v = (v > 10000) ? 10000 : (v < 0) ? 0 : v;
 
        if (p_ptr->is_dead) return FALSE;
@@ -2291,23 +1950,14 @@ bool set_resist_magic(TIME_EFFECT v, bool do_dec)
 
        /* Use the value */
        p_ptr->resist_magic = v;
-
-       /* Redraw status bar */
        p_ptr->redraw |= (PR_STATUS);
 
        /* Nothing to notice */
        if (!notice) return (FALSE);
 
-       /* Disturb */
-       if (disturb_state) disturb(0, 0);
-
-       /* Recalculate bonuses */
+       if (disturb_state) disturb(FALSE, FALSE);
        p_ptr->update |= (PU_BONUS);
-
-       /* Handle stuff */
        handle_stuff();
-
-       /* Result */
        return (TRUE);
 }
 
@@ -2320,8 +1970,6 @@ bool set_resist_magic(TIME_EFFECT v, bool do_dec)
 bool set_tim_reflect(TIME_EFFECT v, bool do_dec)
 {
        bool notice = FALSE;
-
-       /* Hack -- Force good values */
        v = (v > 10000) ? 10000 : (v < 0) ? 0 : v;
 
        if (p_ptr->is_dead) return FALSE;
@@ -2352,23 +2000,14 @@ bool set_tim_reflect(TIME_EFFECT v, bool do_dec)
 
        /* Use the value */
        p_ptr->tim_reflect = v;
-
-       /* Redraw status bar */
        p_ptr->redraw |= (PR_STATUS);
 
        /* Nothing to notice */
        if (!notice) return (FALSE);
 
-       /* Disturb */
-       if (disturb_state) disturb(0, 0);
-
-       /* Recalculate bonuses */
+       if (disturb_state) disturb(FALSE, FALSE);
        p_ptr->update |= (PU_BONUS);
-
-       /* Handle stuff */
        handle_stuff();
-
-       /* Result */
        return (TRUE);
 }
 
@@ -2379,8 +2018,6 @@ bool set_tim_reflect(TIME_EFFECT v, bool do_dec)
 bool set_multishadow(TIME_EFFECT v, bool do_dec)
 {
        bool notice = FALSE;
-
-       /* Hack -- Force good values */
        v = (v > 10000) ? 10000 : (v < 0) ? 0 : v;
 
        if (p_ptr->is_dead) return FALSE;
@@ -2411,23 +2048,14 @@ bool set_multishadow(TIME_EFFECT v, bool do_dec)
 
        /* Use the value */
        p_ptr->multishadow = v;
-
-       /* Redraw status bar */
        p_ptr->redraw |= (PR_STATUS);
 
        /* Nothing to notice */
        if (!notice) return (FALSE);
 
-       /* Disturb */
-       if (disturb_state) disturb(0, 0);
-
-       /* Recalculate bonuses */
+       if (disturb_state) disturb(FALSE, FALSE);
        p_ptr->update |= (PU_BONUS);
-
-       /* Handle stuff */
        handle_stuff();
-
-       /* Result */
        return (TRUE);
 }
 
@@ -2440,8 +2068,6 @@ bool set_multishadow(TIME_EFFECT v, bool do_dec)
 bool set_dustrobe(TIME_EFFECT v, bool do_dec)
 {
        bool notice = FALSE;
-
-       /* Hack -- Force good values */
        v = (v > 10000) ? 10000 : (v < 0) ? 0 : v;
 
        if (p_ptr->is_dead) return FALSE;
@@ -2472,23 +2098,14 @@ bool set_dustrobe(TIME_EFFECT v, bool do_dec)
 
        /* Use the value */
        p_ptr->dustrobe = v;
-
-       /* Redraw status bar */
        p_ptr->redraw |= (PR_STATUS);
 
        /* Nothing to notice */
        if (!notice) return (FALSE);
 
-       /* Disturb */
-       if (disturb_state) disturb(0, 0);
-
-       /* Recalculate bonuses */
+       if (disturb_state) disturb(FALSE, FALSE);
        p_ptr->update |= (PU_BONUS);
-
-       /* Handle stuff */
        handle_stuff();
-
-       /* Result */
        return (TRUE);
 }
 
@@ -2501,8 +2118,6 @@ bool set_dustrobe(TIME_EFFECT v, bool do_dec)
 bool set_kabenuke(TIME_EFFECT v, bool do_dec)
 {
        bool notice = FALSE;
-
-       /* Hack -- Force good values */
        v = (v > 10000) ? 10000 : (v < 0) ? 0 : v;
 
        if (p_ptr->is_dead) return FALSE;
@@ -2533,23 +2148,14 @@ bool set_kabenuke(TIME_EFFECT v, bool do_dec)
 
        /* Use the value */
        p_ptr->kabenuke = v;
-
-       /* Redraw status bar */
        p_ptr->redraw |= (PR_STATUS);
 
        /* Nothing to notice */
        if (!notice) return (FALSE);
 
-       /* Disturb */
-       if (disturb_state) disturb(0, 0);
-
-       /* Recalculate bonuses */
+       if (disturb_state) disturb(FALSE, FALSE);
        p_ptr->update |= (PU_BONUS);
-
-       /* Handle stuff */
        handle_stuff();
-
-       /* Result */
        return (TRUE);
 }
 
@@ -2562,8 +2168,6 @@ bool set_kabenuke(TIME_EFFECT v, bool do_dec)
 bool set_tsuyoshi(TIME_EFFECT v, bool do_dec)
 {
        bool notice = FALSE;
-
-       /* Hack -- Force good values */
        v = (v > 10000) ? 10000 : (v < 0) ? 0 : v;
 
        if (p_ptr->is_dead) return FALSE;
@@ -2600,26 +2204,17 @@ bool set_tsuyoshi(TIME_EFFECT v, bool do_dec)
 
        /* Use the value */
        p_ptr->tsuyoshi = v;
-
-       /* Redraw status bar */
        p_ptr->redraw |= (PR_STATUS);
 
        /* Nothing to notice */
        if (!notice) return (FALSE);
 
-       /* Disturb */
-       if (disturb_state) disturb(0, 0);
-
-       /* Recalculate bonuses */
+       if (disturb_state) disturb(FALSE, FALSE);
        p_ptr->update |= (PU_BONUS);
 
        /* Recalculate hitpoints */
        p_ptr->update |= (PU_HP);
-
-       /* Handle stuff */
        handle_stuff();
-
-       /* Result */
        return (TRUE);
 }
 
@@ -2631,7 +2226,6 @@ bool set_tsuyoshi(TIME_EFFECT v, bool do_dec)
  */
 bool set_ele_attack(u32b attack_type, TIME_EFFECT v)
 {
-       /* Hack -- Force good values */
        v = (v > 10000) ? 10000 : (v < 0) ? 0 : v;
 
        /* Clear all elemental attacks (only one is allowed at a time). */
@@ -2669,7 +2263,6 @@ bool set_ele_attack(u32b attack_type, TIME_EFFECT v)
                /* Set duration. */
                p_ptr->ele_attack = v;
 
-               /* Message. */
 #ifdef JP
                msg_format("%sで攻撃できるようになった!",
                             ((attack_type == ATTACK_ACID) ? "酸" :
@@ -2689,15 +2282,10 @@ bool set_ele_attack(u32b attack_type, TIME_EFFECT v)
 #endif
        }
 
-       /* Disturb */
-       if (disturb_state) disturb(0, 0);
-
-       /* Redraw status bar */
+       if (disturb_state) disturb(FALSE, FALSE);
        p_ptr->redraw |= (PR_STATUS);
 
        p_ptr->update |= (PU_BONUS);
-
-       /* Handle stuff */
        handle_stuff();
 
        return (TRUE);
@@ -2711,7 +2299,6 @@ bool set_ele_attack(u32b attack_type, TIME_EFFECT v)
  */
 bool set_ele_immune(u32b immune_type, TIME_EFFECT v)
 {
-       /* Hack -- Force good values */
        v = (v > 10000) ? 10000 : (v < 0) ? 0 : v;
 
        /* Clear all elemental attacks (only one is allowed at a time). */
@@ -2749,35 +2336,18 @@ bool set_ele_immune(u32b immune_type, TIME_EFFECT v)
                /* Set duration. */
                p_ptr->ele_immune = v;
 
-               /* Message. */
-#ifdef JP
-               msg_format("%sの攻撃を受けつけなくなった!",
-                            ((immune_type == DEFENSE_ACID) ? "酸" :
-                             ((immune_type == DEFENSE_ELEC) ? "電撃" :
-                              ((immune_type == DEFENSE_FIRE) ? "火炎" : 
-                               ((immune_type == DEFENSE_COLD) ? "冷気" : 
-                                ((immune_type == DEFENSE_POIS) ? "毒" : 
-                                       "(なし)"))))));
-#else
-               msg_format("For a while, You are immune to %s",
-                            ((immune_type == DEFENSE_ACID) ? "acid!" :
-                             ((immune_type == DEFENSE_ELEC) ? "electricity!" :
-                              ((immune_type == DEFENSE_FIRE) ? "fire!" : 
-                               ((immune_type == DEFENSE_COLD) ? "cold!" : 
-                                ((immune_type == DEFENSE_POIS) ? "poison!" : 
-                                       "do nothing special."))))));
-#endif
+               msg_format(_("%sの攻撃を受けつけなくなった!", "For a while, You are immune to %s"),
+                            ((immune_type == DEFENSE_ACID) ? _("酸", "acid!") :
+                             ((immune_type == DEFENSE_ELEC) ? _("電撃", "electricity!") :
+                              ((immune_type == DEFENSE_FIRE) ? _("火炎", "fire!") : 
+                               ((immune_type == DEFENSE_COLD) ? _("冷気", "cold!") : 
+                                ((immune_type == DEFENSE_POIS) ? _("毒", "poison!") : 
+                                       _("(なし)", "do nothing special.")))))));
        }
 
-       /* Disturb */
-       if (disturb_state) disturb(0, 0);
-
-       /* Redraw status bar */
+       if (disturb_state) disturb(FALSE, FALSE);
        p_ptr->redraw |= (PR_STATUS);
-
        p_ptr->update |= (PU_BONUS);
-
-       /* Handle stuff */
        handle_stuff();
 
        return (TRUE);
@@ -2792,8 +2362,6 @@ bool set_ele_immune(u32b immune_type, TIME_EFFECT v)
 bool set_oppose_acid(TIME_EFFECT v, bool do_dec)
 {
        bool notice = FALSE;
-
-       /* Hack -- Force good values */
        v = (v > 10000) ? 10000 : (v < 0) ? 0 : v;
 
        if (p_ptr->is_dead) return FALSE;
@@ -2827,17 +2395,10 @@ bool set_oppose_acid(TIME_EFFECT v, bool do_dec)
 
        /* Nothing to notice */
        if (!notice) return (FALSE);
-
-       /* Redraw status bar */
        p_ptr->redraw |= (PR_STATUS);
 
-       /* Disturb */
-       if (disturb_state) disturb(0, 0);
-
-       /* Handle stuff */
+       if (disturb_state) disturb(FALSE, FALSE);
        handle_stuff();
-
-       /* Result */
        return (TRUE);
 }
 
@@ -2850,8 +2411,6 @@ bool set_oppose_acid(TIME_EFFECT v, bool do_dec)
 bool set_oppose_elec(TIME_EFFECT v, bool do_dec)
 {
        bool notice = FALSE;
-
-       /* Hack -- Force good values */
        v = (v > 10000) ? 10000 : (v < 0) ? 0 : v;
 
        if (p_ptr->is_dead) return FALSE;
@@ -2885,17 +2444,10 @@ bool set_oppose_elec(TIME_EFFECT v, bool do_dec)
 
        /* Nothing to notice */
        if (!notice) return (FALSE);
-
-       /* Redraw status bar */
        p_ptr->redraw |= (PR_STATUS);
 
-       /* Disturb */
-       if (disturb_state) disturb(0, 0);
-
-       /* Handle stuff */
+       if (disturb_state) disturb(FALSE, FALSE);
        handle_stuff();
-
-       /* Result */
        return (TRUE);
 }
 
@@ -2908,8 +2460,6 @@ bool set_oppose_elec(TIME_EFFECT v, bool do_dec)
 bool set_oppose_fire(TIME_EFFECT v, bool do_dec)
 {
        bool notice = FALSE;
-
-       /* Hack -- Force good values */
        v = (v > 10000) ? 10000 : (v < 0) ? 0 : v;
 
        if (p_ptr->is_dead) return FALSE;
@@ -2944,17 +2494,10 @@ bool set_oppose_fire(TIME_EFFECT v, bool do_dec)
 
        /* Nothing to notice */
        if (!notice) return (FALSE);
-
-       /* Redraw status bar */
        p_ptr->redraw |= (PR_STATUS);
 
-       /* Disturb */
-       if (disturb_state) disturb(0, 0);
-
-       /* Handle stuff */
+       if (disturb_state) disturb(FALSE, FALSE);
        handle_stuff();
-
-       /* Result */
        return (TRUE);
 }
 
@@ -2967,8 +2510,6 @@ bool set_oppose_fire(TIME_EFFECT v, bool do_dec)
 bool set_oppose_cold(TIME_EFFECT v, bool do_dec)
 {
        bool notice = FALSE;
-
-       /* Hack -- Force good values */
        v = (v > 10000) ? 10000 : (v < 0) ? 0 : v;
 
        if (p_ptr->is_dead) return FALSE;
@@ -3002,17 +2543,10 @@ bool set_oppose_cold(TIME_EFFECT v, bool do_dec)
 
        /* Nothing to notice */
        if (!notice) return (FALSE);
-
-       /* Redraw status bar */
        p_ptr->redraw |= (PR_STATUS);
 
-       /* Disturb */
-       if (disturb_state) disturb(0, 0);
-
-       /* Handle stuff */
+       if (disturb_state) disturb(FALSE, FALSE);
        handle_stuff();
-
-       /* Result */
        return (TRUE);
 }
 
@@ -3025,8 +2559,6 @@ bool set_oppose_cold(TIME_EFFECT v, bool do_dec)
 bool set_oppose_pois(TIME_EFFECT v, bool do_dec)
 {
        bool notice = FALSE;
-
-       /* Hack -- Force good values */
        v = (v > 10000) ? 10000 : (v < 0) ? 0 : v;
 
        if ((p_ptr->pclass == CLASS_NINJA) && (p_ptr->lev > 44)) v = 1;
@@ -3061,17 +2593,10 @@ bool set_oppose_pois(TIME_EFFECT v, bool do_dec)
 
        /* Nothing to notice */
        if (!notice) return (FALSE);
-
-       /* Redraw status bar */
        p_ptr->redraw |= (PR_STATUS);
 
-       /* Disturb */
-       if (disturb_state) disturb(0, 0);
-
-       /* Handle stuff */
+       if (disturb_state) disturb(FALSE, FALSE);
        handle_stuff();
-
-       /* Result */
        return (TRUE);
 }
 
@@ -3086,13 +2611,9 @@ bool set_stun(TIME_EFFECT v)
 {
        int old_aux, new_aux;
        bool notice = FALSE;
-
-
-       /* Hack -- Force good values */
        v = (v > 10000) ? 10000 : (v < 0) ? 0 : v;
 
        if (p_ptr->is_dead) return FALSE;
-
        if (prace_is_(RACE_GOLEM) || ((p_ptr->pclass == CLASS_BERSERKER) && (p_ptr->lev > 34))) v = 0;
 
        /* Knocked out */
@@ -3194,7 +2715,6 @@ bool set_stun(TIME_EFFECT v)
                /* Hex */
                if (hex_spelling_any()) stop_hex_spell_all();
 
-               /* Notice */
                notice = TRUE;
        }
 
@@ -3205,14 +2725,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,19 +2741,12 @@ bool set_stun(TIME_EFFECT v)
        /* No change */
        if (!notice) return (FALSE);
 
-       /* Disturb */
-       if (disturb_state) disturb(0, 0);
-
-       /* Recalculate bonuses */
+       if (disturb_state) disturb(FALSE, FALSE);
        p_ptr->update |= (PU_BONUS);
 
        /* Redraw the "stun" */
        p_ptr->redraw |= (PR_STUN);
-
-       /* Handle stuff */
        handle_stuff();
-
-       /* Result */
        return (TRUE);
 }
 
@@ -3250,8 +2762,6 @@ bool set_cut(TIME_EFFECT v)
 {
        int old_aux, new_aux;
        bool notice = FALSE;
-
-       /* Hack -- Force good values */
        v = (v > 10000) ? 10000 : (v < 0) ? 0 : v;
 
        if (p_ptr->is_dead) return FALSE;
@@ -3387,7 +2897,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 +2919,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,19 +2932,12 @@ bool set_cut(TIME_EFFECT v)
        /* No change */
        if (!notice) return (FALSE);
 
-       /* Disturb */
-       if (disturb_state) disturb(0, 0);
-
-       /* Recalculate bonuses */
+       if (disturb_state) disturb(FALSE, FALSE);
        p_ptr->update |= (PU_BONUS);
 
        /* Redraw the "cut" */
        p_ptr->redraw |= (PR_CUT);
-
-       /* Handle stuff */
        handle_stuff();
-
-       /* Result */
        return (TRUE);
 }
 
@@ -3452,7 +2953,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
@@ -3471,8 +2972,6 @@ bool set_food(TIME_EFFECT v)
        int old_aux, new_aux;
 
        bool notice = FALSE;
-
-       /* Hack -- Force good values */
        v = (v > 20000) ? 20000 : (v < 0) ? 0 : v;
 
        /* Fainting / Starving */
@@ -3625,19 +3124,12 @@ bool set_food(TIME_EFFECT v)
        /* Nothing to notice */
        if (!notice) return (FALSE);
 
-       /* Disturb */
-       if (disturb_state) disturb(0, 0);
-
-       /* Recalculate bonuses */
+       if (disturb_state) disturb(FALSE, FALSE);
        p_ptr->update |= (PU_BONUS);
 
        /* Redraw hunger */
        p_ptr->redraw |= (PR_HUNGER);
-
-       /* Handle stuff */
        handle_stuff();
-
-       /* Result */
        return (TRUE);
 }
 
@@ -3696,8 +3188,6 @@ bool inc_stat(int stat)
                {
                        p_ptr->stat_max[stat] = value;
                }
-
-               /* Recalculate bonuses */
                p_ptr->update |= (PU_BONUS);
 
                /* Success */
@@ -3829,14 +3319,10 @@ bool dec_stat(int stat, int amount, int permanent)
                p_ptr->stat_cur[stat] = cur;
                p_ptr->stat_max[stat] = max;
 
-               /* Redisplay the stats later */
                p_ptr->redraw |= (PR_STATS);
-
-               /* Recalculate bonuses */
                p_ptr->update |= (PU_BONUS);
        }
 
-       /* Done */
        return (res);
 }
 
@@ -3851,13 +3337,8 @@ bool res_stat(int stat)
        /* Restore if needed */
        if (p_ptr->stat_cur[stat] != p_ptr->stat_max[stat])
        {
-               /* Restore */
                p_ptr->stat_cur[stat] = p_ptr->stat_max[stat];
-
-               /* Recalculate bonuses */
                p_ptr->update |= (PU_BONUS);
-
-               /* Redisplay the stats later */
                p_ptr->redraw |= (PR_STATS);
 
                /* Success */
@@ -3898,10 +3379,8 @@ bool hp_player(int num)
                        p_ptr->chp_frac = 0;
                }
 
-               /* Redraw */
                p_ptr->redraw |= (PR_HP);
 
-               /* Window stuff */
                p_ptr->window |= (PW_PLAYER);
 
                /* Heal 0-4 */
@@ -3928,7 +3407,6 @@ bool hp_player(int num)
                        msg_print(_("ひじょうに気分が良くなった。", "You feel very good."));
                }
 
-               /* Notice */
                return (TRUE);
        }
 
@@ -3940,7 +3418,7 @@ bool hp_player(int num)
 /*
  * Array of stat "descriptions"
  */
-static cptr desc_stat_pos[] =
+static concptr desc_stat_pos[] =
 {
        _("強く", "strong"),
        _("知的に", "smart"),
@@ -3954,7 +3432,7 @@ static cptr desc_stat_pos[] =
 /*
  * Array of stat "descriptions"
  */
-static cptr desc_stat_neg[] =
+static concptr desc_stat_neg[] =
 {
        _("弱く", "weak"),
        _("無知に", "stupid"),
@@ -3986,7 +3464,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]);
 
@@ -3997,7 +3474,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 */
@@ -4017,10 +3493,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);
        }
 
@@ -4055,20 +3529,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);
        }
 
@@ -4085,7 +3555,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 */
@@ -4135,14 +3604,9 @@ bool lose_all_info(void)
                /* Hack -- Clear the "felt" flag */
                o_ptr->ident &= ~(IDENT_SENSE);
        }
-
-       /* Recalculate bonuses */
        p_ptr->update |= (PU_BONUS);
+       p_ptr->update |= (PU_COMBINE | PU_REORDER);
 
-       /* 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 */
@@ -4181,9 +3645,9 @@ void do_poly_wounds(void)
 /*
  * Change player race
  */
-void change_race(CHARACTER_IDX new_race, cptr effect_msg)
+void change_race(CHARACTER_IDX new_race, concptr effect_msg)
 {
-       cptr title = race_info[new_race].title;
+       concptr title = race_info[new_race].title;
        int  old_race = p_ptr->prace;
 
 #ifdef JP
@@ -4224,7 +3688,7 @@ void change_race(CHARACTER_IDX new_race, cptr effect_msg)
        else
                p_ptr->hitdie = rp_ptr->r_mhp + cp_ptr->c_mhp + ap_ptr->a_mhp;
 
-       do_cmd_rerate(FALSE);
+       roll_hitdice(0L);
 
        /* The experience level may be modified */
        check_experience();
@@ -4284,7 +3748,7 @@ void do_poly_self(void)
                        /* Harmful deformity */
                        power -= 15;
 
-                       while (tmp < 6)
+                       while (tmp < A_MAX)
                        {
                                if (one_in_(2))
                                {
@@ -4335,7 +3799,7 @@ void do_poly_self(void)
                power -= 20;
                msg_format(_("%sの構成が変化した!", "Your internal organs are rearranged!"), p_ptr->prace == RACE_ANDROID ? "機械" : "内臓");
 
-               while (tmp < 6)
+               while (tmp < A_MAX)
                {
                        (void)dec_stat(tmp, randint1(6) + 6, one_in_(3));
                        tmp++;
@@ -4354,7 +3818,7 @@ void do_poly_self(void)
                power -= 10;
 
                get_max_stats();
-               do_cmd_rerate(FALSE);
+               roll_hitdice(0L);
        }
 
        while ((power > randint0(15)) && one_in_(3))
@@ -4381,14 +3845,14 @@ 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, HIT_POINT damage, cptr hit_from, int monspell)
+int take_hit(int damage_type, HIT_POINT damage, concptr hit_from, int monspell)
 {
        int old_chp = p_ptr->chp;
 
@@ -4407,8 +3871,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;
@@ -4480,7 +3943,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)
@@ -4513,7 +3975,7 @@ int take_hit(int damage_type, HIT_POINT damage, cptr hit_from, int monspell)
 
                if (p_ptr->inside_arena)
                {
-                       cptr m_name = r_name+r_info[arena_info[p_ptr->arena_number].r_idx].name;
+                       concptr m_name = r_name+r_info[arena_info[p_ptr->arena_number].r_idx].name;
                        msg_format(_("あなたは%sの前に敗れ去った。", "You are beaten by %s."), m_name);
                        msg_print(NULL);
                        if (record_arena) do_cmd_write_nikki(NIKKI_ARENA, -1 - p_ptr->arena_number, m_name);
@@ -4641,7 +4103,7 @@ int take_hit(int damage_type, HIT_POINT damage, cptr hit_from, int monspell)
                                        int h = Term->hgt;
                                        int msg_pos_x[9] = {  5,  7,  9, 12,  14,  17,  19,  21, 23};
                                        int msg_pos_y[9] = {  3,  4,  5,  4,   5,   4,   5,   6,  4};
-                                       cptr str;
+                                       concptr str;
                                        char* str2;
 
                                        Term_clear();
@@ -4721,7 +4183,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();
@@ -4785,8 +4246,6 @@ void calc_android_exp(void)
 
                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);
@@ -4853,7 +4312,7 @@ void calc_android_exp(void)
                        if (value > 100000L)
                                exp += (value - 100000L) / 4  * level;
                }
-               if ((((i == INVEN_RARM) || (i == INVEN_LARM)) && (buki_motteruka(i))) || (i == INVEN_BOW)) total_exp += exp / 48;
+               if ((((i == INVEN_RARM) || (i == INVEN_LARM)) && (has_melee_weapon(i))) || (i == INVEN_BOW)) total_exp += exp / 48;
                else total_exp += exp / 16;
                if (i == INVEN_BODY) total_exp += exp / 32;
        }
@@ -4917,8 +4376,6 @@ bool drain_exp(s32b drain, s32b slip, int hold_exp_prob)
 bool set_ultimate_res(TIME_EFFECT v, bool do_dec)
 {
        bool notice = FALSE;
-
-       /* Hack -- Force good values */
        v = (v > 10000) ? 10000 : (v < 0) ? 0 : v;
 
        if (p_ptr->is_dead) return FALSE;
@@ -4949,31 +4406,20 @@ bool set_ultimate_res(TIME_EFFECT v, bool do_dec)
 
        /* Use the value */
        p_ptr->ult_res = v;
-
-       /* Redraw status bar */
        p_ptr->redraw |= (PR_STATUS);
 
        /* Nothing to notice */
        if (!notice) return (FALSE);
 
-       /* Disturb */
-       if (disturb_state) disturb(0, 0);
-
-       /* Recalculate bonuses */
+       if (disturb_state) disturb(FALSE, FALSE);
        p_ptr->update |= (PU_BONUS);
-
-       /* Handle stuff */
        handle_stuff();
-
-       /* Result */
        return (TRUE);
 }
 
 bool set_tim_res_nether(TIME_EFFECT v, bool do_dec)
 {
        bool notice = FALSE;
-
-       /* Hack -- Force good values */
        v = (v > 10000) ? 10000 : (v < 0) ? 0 : v;
 
        if (p_ptr->is_dead) return FALSE;
@@ -5004,31 +4450,20 @@ bool set_tim_res_nether(TIME_EFFECT v, bool do_dec)
 
        /* Use the value */
        p_ptr->tim_res_nether = v;
-
-       /* Redraw status bar */
        p_ptr->redraw |= (PR_STATUS);
 
        /* Nothing to notice */
        if (!notice) return (FALSE);
 
-       /* Disturb */
-       if (disturb_state) disturb(0, 0);
-
-       /* Recalculate bonuses */
+       if (disturb_state) disturb(FALSE, FALSE);
        p_ptr->update |= (PU_BONUS);
-
-       /* Handle stuff */
        handle_stuff();
-
-       /* Result */
        return (TRUE);
 }
 
 bool set_tim_res_time(TIME_EFFECT v, bool do_dec)
 {
        bool notice = FALSE;
-
-       /* Hack -- Force good values */
        v = (v > 10000) ? 10000 : (v < 0) ? 0 : v;
 
        if (p_ptr->is_dead) return FALSE;
@@ -5059,23 +4494,14 @@ bool set_tim_res_time(TIME_EFFECT v, bool do_dec)
 
        /* Use the value */
        p_ptr->tim_res_time = v;
-
-       /* Redraw status bar */
        p_ptr->redraw |= (PR_STATUS);
 
        /* Nothing to notice */
        if (!notice) return (FALSE);
 
-       /* Disturb */
-       if (disturb_state) disturb(0, 0);
-
-       /* Recalculate bonuses */
+       if (disturb_state) disturb(FALSE, FALSE);
        p_ptr->update |= (PU_BONUS);
-
-       /* Handle stuff */
        handle_stuff();
-
-       /* Result */
        return (TRUE);
 }
 
@@ -5089,13 +4515,11 @@ bool choose_ele_attack(void)
 
        char choice;
 
-       if (!buki_motteruka(INVEN_RARM) && !buki_motteruka(INVEN_LARM))
+       if (!has_melee_weapon(INVEN_RARM) && !has_melee_weapon(INVEN_LARM))
        {
                msg_format(_("武器を持たないと魔法剣は使えない。", "You cannot use temporary branding with no weapon."));
                return FALSE;
        }
-
-       /* Save screen */
        screen_save();
 
        num = (p_ptr->lev - 20) / 5;
@@ -5146,7 +4570,6 @@ bool choose_ele_attack(void)
                screen_load();
                return FALSE;
        }
-       /* Load screen */
        screen_load();
        return TRUE;
 }
@@ -5158,8 +4581,6 @@ bool choose_ele_attack(void)
 bool choose_ele_immune(TIME_EFFECT immune_turn)
 {
        char choice;
-
-       /* Save screen */
        screen_save();
 
        c_prt(TERM_RED,    _("        a) 火炎", "        a) Immune Fire"), 2, 14);
@@ -5191,7 +4612,6 @@ bool choose_ele_immune(TIME_EFFECT immune_turn)
                screen_load();
                return FALSE;
        }
-       /* Load screen */
        screen_load();
        return TRUE;
 }