OSDN Git Service

[Refactor] #37353 型の置換。 / Type replacement. (BASE_STATUS / A_MAX)
[hengband/hengband.git] / src / effects.c
index 4fcec76..03a1c7d 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"
 
 /*!
  * @brief プレイヤーの継続行動を設定する。
@@ -261,7 +267,7 @@ 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);
@@ -285,8 +291,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;
@@ -323,12 +327,10 @@ 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);
 
        if (disturb_state) disturb(FALSE, TRUE);
 
-       /* Redraw title */
        p_ptr->redraw |= (PR_BASIC | PR_STATUS);
        p_ptr->update |= (PU_BONUS | PU_HP);
 
@@ -349,8 +351,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;
@@ -394,20 +394,15 @@ 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);
-
        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);
-
        p_ptr->redraw |= (PR_MAP);
-
        p_ptr->window |= (PW_OVERHEAD | PW_DUNGEON);
        handle_stuff();
        return (TRUE);
@@ -422,8 +417,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;
@@ -487,8 +480,6 @@ bool set_confused(TIME_EFFECT v)
 
        /* Use the value */
        p_ptr->confused = v;
-
-       /* Redraw status bar */
        p_ptr->redraw |= (PR_STATUS);
 
        /* Nothing to notice */
@@ -508,8 +499,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;
@@ -536,8 +525,6 @@ bool set_poisoned(TIME_EFFECT v)
 
        /* Use the value */
        p_ptr->poisoned = v;
-
-       /* Redraw status bar */
        p_ptr->redraw |= (PR_STATUS);
 
        /* Nothing to notice */
@@ -557,8 +544,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;
@@ -599,8 +584,6 @@ bool set_afraid(TIME_EFFECT v)
 
        /* Use the value */
        p_ptr->afraid = v;
-
-       /* Redraw status bar */
        p_ptr->redraw |= (PR_STATUS);
 
        /* Nothing to notice */
@@ -619,8 +602,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;
@@ -654,8 +635,6 @@ bool set_paralyzed(TIME_EFFECT v)
 
        /* Use the value */
        p_ptr->paralyzed = v;
-
-       /* Redraw status bar */
        p_ptr->redraw |= (PR_STATUS);
 
        /* Nothing to notice */
@@ -676,11 +655,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 */
@@ -711,8 +689,6 @@ bool set_image(TIME_EFFECT v)
 
        /* Use the value */
        p_ptr->image = v;
-
-       /* Redraw status bar */
        p_ptr->redraw |= (PR_STATUS);
 
        /* Nothing to notice */
@@ -720,12 +696,8 @@ bool set_image(TIME_EFFECT v)
 
        if (disturb_state) disturb(FALSE, TRUE);
 
-       p_ptr->redraw |= (PR_MAP);
-
-       /* Update the health bar */
-       p_ptr->redraw |= (PR_HEALTH | PR_UHEALTH);
+       p_ptr->redraw |= (PR_MAP | PR_HEALTH | PR_UHEALTH);
        p_ptr->update |= (PU_MONSTERS);
-
        p_ptr->window |= (PW_OVERHEAD | PW_DUNGEON);
        handle_stuff();
        return (TRUE);
@@ -740,8 +712,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;
@@ -793,8 +763,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;
@@ -848,8 +816,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;
@@ -900,8 +866,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;
@@ -932,8 +896,6 @@ 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 */
@@ -955,8 +917,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;
@@ -987,8 +947,6 @@ 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 */
@@ -1010,8 +968,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;
@@ -1042,8 +998,6 @@ 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 */
@@ -1064,8 +1018,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;
@@ -1096,8 +1048,6 @@ 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 */
@@ -1119,8 +1069,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;
@@ -1151,8 +1099,6 @@ 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 */
@@ -1176,8 +1122,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;
@@ -1209,8 +1153,6 @@ 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 */
@@ -1234,8 +1176,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;
@@ -1266,8 +1206,6 @@ 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 */
@@ -1287,8 +1225,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;
@@ -1333,8 +1269,6 @@ bool set_wraith_form(TIME_EFFECT v, bool do_dec)
 
        /* Use the value */
        p_ptr->wraith_form = v;
-
-       /* Redraw status bar */
        p_ptr->redraw |= (PR_STATUS);
 
        /* Nothing to notice */
@@ -1356,8 +1290,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;
@@ -1405,8 +1337,6 @@ 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 */
@@ -1427,8 +1357,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;
@@ -1459,8 +1387,6 @@ 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 */
@@ -1482,8 +1408,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;
@@ -1514,8 +1438,6 @@ 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 */
@@ -1539,8 +1461,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;
@@ -1571,8 +1491,6 @@ 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 */
@@ -1596,8 +1514,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;
@@ -1628,8 +1544,6 @@ 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 */
@@ -1650,8 +1564,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;
@@ -1682,8 +1594,6 @@ 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 */
@@ -1744,8 +1654,6 @@ bool set_superstealth(bool set)
 
        /* Nothing to notice */
        if (!notice) return (FALSE);
-
-       /* Redraw status bar */
        p_ptr->redraw |= (PR_STATUS);
 
        if (disturb_state) disturb(FALSE, FALSE);
@@ -1761,8 +1669,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;
@@ -1793,8 +1699,6 @@ 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 */
@@ -1815,8 +1719,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;
@@ -1847,8 +1749,6 @@ 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 */
@@ -1868,8 +1768,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;
@@ -1900,8 +1798,6 @@ 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 */
@@ -1922,8 +1818,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;
@@ -1954,8 +1848,6 @@ 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 */
@@ -1976,8 +1868,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;
@@ -2008,8 +1898,6 @@ 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 */
@@ -2031,8 +1919,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;
@@ -2063,8 +1949,6 @@ 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 */
@@ -2085,8 +1969,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;
@@ -2117,8 +1999,6 @@ 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 */
@@ -2137,8 +2017,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;
@@ -2169,8 +2047,6 @@ 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 */
@@ -2191,8 +2067,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;
@@ -2223,8 +2097,6 @@ 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 */
@@ -2245,8 +2117,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;
@@ -2277,8 +2147,6 @@ 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 */
@@ -2299,8 +2167,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;
@@ -2337,8 +2203,6 @@ 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 */
@@ -2361,7 +2225,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). */
@@ -2399,7 +2262,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) ? "酸" :
@@ -2420,8 +2282,6 @@ bool set_ele_attack(u32b attack_type, TIME_EFFECT v)
        }
 
        if (disturb_state) disturb(FALSE, FALSE);
-
-       /* Redraw status bar */
        p_ptr->redraw |= (PR_STATUS);
 
        p_ptr->update |= (PU_BONUS);
@@ -2438,7 +2298,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). */
@@ -2476,31 +2335,17 @@ 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.")))))));
        }
 
        if (disturb_state) disturb(FALSE, FALSE);
-
-       /* Redraw status bar */
        p_ptr->redraw |= (PR_STATUS);
-
        p_ptr->update |= (PU_BONUS);
        handle_stuff();
 
@@ -2516,8 +2361,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;
@@ -2551,8 +2394,6 @@ 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);
 
        if (disturb_state) disturb(FALSE, FALSE);
@@ -2569,8 +2410,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;
@@ -2604,8 +2443,6 @@ 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);
 
        if (disturb_state) disturb(FALSE, FALSE);
@@ -2622,8 +2459,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;
@@ -2658,8 +2493,6 @@ 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);
 
        if (disturb_state) disturb(FALSE, FALSE);
@@ -2676,8 +2509,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;
@@ -2711,8 +2542,6 @@ 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);
 
        if (disturb_state) disturb(FALSE, FALSE);
@@ -2729,8 +2558,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;
@@ -2765,8 +2592,6 @@ 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);
 
        if (disturb_state) disturb(FALSE, FALSE);
@@ -2785,13 +2610,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 */
@@ -2940,8 +2761,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;
@@ -3152,8 +2971,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 */
@@ -3501,7 +3318,6 @@ 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);
                p_ptr->update |= (PU_BONUS);
        }
@@ -3520,11 +3336,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];
                p_ptr->update |= (PU_BONUS);
-
-               /* Redisplay the stats later */
                p_ptr->redraw |= (PR_STATS);
 
                /* Success */
@@ -3604,7 +3417,7 @@ bool hp_player(int num)
 /*
  * Array of stat "descriptions"
  */
-static cptr desc_stat_pos[] =
+static concptr desc_stat_pos[] =
 {
        _("強く", "strong"),
        _("知的に", "smart"),
@@ -3618,7 +3431,7 @@ static cptr desc_stat_pos[] =
 /*
  * Array of stat "descriptions"
  */
-static cptr desc_stat_neg[] =
+static concptr desc_stat_neg[] =
 {
        _("弱く", "weak"),
        _("無知に", "stupid"),
@@ -3791,8 +3604,6 @@ bool lose_all_info(void)
                o_ptr->ident &= ~(IDENT_SENSE);
        }
        p_ptr->update |= (PU_BONUS);
-
-       /* Combine / Reorder the pack (later) */
        p_ptr->update |= (PU_COMBINE | PU_REORDER);
 
        p_ptr->window |= (PW_INVEN | PW_EQUIP | PW_PLAYER);
@@ -3833,9 +3644,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
@@ -3936,7 +3747,7 @@ void do_poly_self(void)
                        /* Harmful deformity */
                        power -= 15;
 
-                       while (tmp < 6)
+                       while (tmp < A_MAX)
                        {
                                if (one_in_(2))
                                {
@@ -3987,7 +3798,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++;
@@ -4040,7 +3851,7 @@ void do_poly_self(void)
  * 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;
 
@@ -4163,7 +3974,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);
@@ -4291,7 +4102,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();
@@ -4500,7 +4311,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;
        }
@@ -4564,8 +4375,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;
@@ -4596,8 +4405,6 @@ 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 */
@@ -4612,8 +4419,6 @@ bool set_ultimate_res(TIME_EFFECT v, bool do_dec)
 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;
@@ -4644,8 +4449,6 @@ 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 */
@@ -4660,8 +4463,6 @@ bool set_tim_res_nether(TIME_EFFECT v, bool do_dec)
 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;
@@ -4692,8 +4493,6 @@ 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 */
@@ -4715,7 +4514,7 @@ 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;