OSDN Git Service

[Refactor] #37353 PROJECT_* 定義を新規ファイル projection.h へ移動。 / Move PROJECT_* definition...
[hengband/hengband.git] / src / effects.c
index 7920613..56cb408 100644 (file)
@@ -116,11 +116,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 +169,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 */
@@ -266,20 +261,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);
 
+               p_ptr->action = ACTION_NONE;
+               p_ptr->update |= (PU_BONUS | PU_HP | PU_MONSTERS);
                p_ptr->redraw |= (PR_MAP | PR_STATUS | PR_STATE);
-               p_ptr->update |= (PU_MONSTERS);
-
                p_ptr->window |= (PW_OVERHEAD | PW_DUNGEON);
-
                p_ptr->energy_need += ENERGY_NEED();
        }
 }
@@ -340,8 +330,6 @@ bool set_mimic(TIME_EFFECT v, IDX p, bool do_dec)
 
        /* Redraw title */
        p_ptr->redraw |= (PR_BASIC | PR_STATUS);
-
-       /* Recalculate bonuses */
        p_ptr->update |= (PU_BONUS | PU_HP);
 
        handle_stuff();
@@ -674,8 +662,6 @@ bool set_paralyzed(TIME_EFFECT v)
        if (!notice) return (FALSE);
 
        if (disturb_state) disturb(FALSE, FALSE);
-
-       /* Redraw the state */
        p_ptr->redraw |= (PR_STATE);
        handle_stuff();
        return (TRUE);
@@ -695,6 +681,7 @@ bool set_image(TIME_EFFECT v)
        v = (v > 10000) ? 10000 : (v < 0) ? 0 : v;
 
        if (p_ptr->is_dead) return FALSE;
+       if (p_ptr->pseikaku == SEIKAKU_CHARGEMAN) v = 0;
 
 
        /* Open */
@@ -793,8 +780,6 @@ bool set_fast(TIME_EFFECT v, bool do_dec)
        if (!notice) return (FALSE);
 
        if (disturb_state) disturb(FALSE, FALSE);
-
-       /* Recalculate bonuses */
        p_ptr->update |= (PU_BONUS);
        handle_stuff();
        return (TRUE);
@@ -850,8 +835,6 @@ bool set_lightspeed(TIME_EFFECT v, bool do_dec)
        if (!notice) return (FALSE);
 
        if (disturb_state) disturb(FALSE, FALSE);
-
-       /* Recalculate bonuses */
        p_ptr->update |= (PU_BONUS);
        handle_stuff();
        return (TRUE);
@@ -903,8 +886,6 @@ bool set_slow(TIME_EFFECT v, bool do_dec)
        if (!notice) return (FALSE);
 
        if (disturb_state) disturb(FALSE, FALSE);
-
-       /* Recalculate bonuses */
        p_ptr->update |= (PU_BONUS);
        handle_stuff();
        return (TRUE);
@@ -960,8 +941,6 @@ bool set_shield(TIME_EFFECT v, bool do_dec)
        if (!notice) return (FALSE);
 
        if (disturb_state) disturb(FALSE, FALSE);
-
-       /* Recalculate bonuses */
        p_ptr->update |= (PU_BONUS);
        handle_stuff();
        return (TRUE);
@@ -1017,8 +996,6 @@ bool set_tsubureru(TIME_EFFECT v, bool do_dec)
        if (!notice) return (FALSE);
 
        if (disturb_state) disturb(FALSE, FALSE);
-
-       /* Recalculate bonuses */
        p_ptr->update |= (PU_BONUS);
        handle_stuff();
        return (TRUE);
@@ -1074,8 +1051,6 @@ bool set_magicdef(TIME_EFFECT v, bool do_dec)
        if (!notice) return (FALSE);
 
        if (disturb_state) disturb(FALSE, FALSE);
-
-       /* Recalculate bonuses */
        p_ptr->update |= (PU_BONUS);
        handle_stuff();
        return (TRUE);
@@ -1130,8 +1105,6 @@ bool set_blessed(TIME_EFFECT v, bool do_dec)
        if (!notice) return (FALSE);
 
        if (disturb_state) disturb(FALSE, FALSE);
-
-       /* Recalculate bonuses */
        p_ptr->update |= (PU_BONUS);
        handle_stuff();
        return (TRUE);
@@ -1187,8 +1160,6 @@ bool set_hero(TIME_EFFECT v, bool do_dec)
        if (!notice) return (FALSE);
 
        if (disturb_state) disturb(FALSE, FALSE);
-
-       /* Recalculate bonuses */
        p_ptr->update |= (PU_BONUS);
 
        /* Recalculate hitpoints */
@@ -1247,8 +1218,6 @@ bool set_shero(TIME_EFFECT v, bool do_dec)
        if (!notice) return (FALSE);
 
        if (disturb_state) disturb(FALSE, FALSE);
-
-       /* Recalculate bonuses */
        p_ptr->update |= (PU_BONUS);
 
        /* Recalculate hitpoints */
@@ -1373,8 +1342,6 @@ bool set_wraith_form(TIME_EFFECT v, bool do_dec)
        if (!notice) return (FALSE);
 
        if (disturb_state) disturb(FALSE, FALSE);
-
-       /* Recalculate bonuses */
        p_ptr->update |= (PU_BONUS);
        handle_stuff();
        return (TRUE);
@@ -1447,8 +1414,6 @@ bool set_invuln(TIME_EFFECT v, bool do_dec)
        if (!notice) return (FALSE);
 
        if (disturb_state) disturb(FALSE, FALSE);
-
-       /* Recalculate bonuses */
        p_ptr->update |= (PU_BONUS);
        handle_stuff();
        return (TRUE);
@@ -1503,8 +1468,6 @@ bool set_tim_esp(TIME_EFFECT v, bool do_dec)
        if (!notice) return (FALSE);
 
        if (disturb_state) disturb(FALSE, FALSE);
-
-       /* Recalculate bonuses */
        p_ptr->update |= (PU_BONUS);
        p_ptr->update |= (PU_MONSTERS);
        handle_stuff();
@@ -1560,8 +1523,6 @@ bool set_tim_invis(TIME_EFFECT v, bool do_dec)
        if (!notice) return (FALSE);
 
        if (disturb_state) disturb(FALSE, FALSE);
-
-       /* Recalculate bonuses */
        p_ptr->update |= (PU_BONUS);
 
        /* Update the monsters */
@@ -1619,8 +1580,6 @@ bool set_tim_infra(TIME_EFFECT v, bool do_dec)
        if (!notice) return (FALSE);
 
        if (disturb_state) disturb(FALSE, FALSE);
-
-       /* Recalculate bonuses */
        p_ptr->update |= (PU_BONUS);
 
        /* Update the monsters */
@@ -1678,8 +1637,6 @@ bool set_tim_regen(TIME_EFFECT v, bool do_dec)
        if (!notice) return (FALSE);
 
        if (disturb_state) disturb(FALSE, FALSE);
-
-       /* Recalculate bonuses */
        p_ptr->update |= (PU_BONUS);
        handle_stuff();
        return (TRUE);
@@ -1734,8 +1691,6 @@ bool set_tim_stealth(TIME_EFFECT v, bool do_dec)
        if (!notice) return (FALSE);
 
        if (disturb_state) disturb(FALSE, FALSE);
-
-       /* Recalculate bonuses */
        p_ptr->update |= (PU_BONUS);
        handle_stuff();
        return (TRUE);
@@ -1847,8 +1802,6 @@ bool set_tim_levitation(TIME_EFFECT v, bool do_dec)
        if (!notice) return (FALSE);
 
        if (disturb_state) disturb(FALSE, FALSE);
-
-       /* Recalculate bonuses */
        p_ptr->update |= (PU_BONUS);
        handle_stuff();
        return (TRUE);
@@ -1956,8 +1909,6 @@ bool set_tim_sh_fire(TIME_EFFECT v, bool do_dec)
        if (!notice) return (FALSE);
 
        if (disturb_state) disturb(FALSE, FALSE);
-
-       /* Recalculate bonuses */
        p_ptr->update |= (PU_BONUS);
        handle_stuff();
        return (TRUE);
@@ -2012,8 +1963,6 @@ bool set_tim_sh_holy(TIME_EFFECT v, bool do_dec)
        if (!notice) return (FALSE);
 
        if (disturb_state) disturb(FALSE, FALSE);
-
-       /* Recalculate bonuses */
        p_ptr->update |= (PU_BONUS);
        handle_stuff();
        return (TRUE);
@@ -2068,8 +2017,6 @@ bool set_tim_eyeeye(TIME_EFFECT v, bool do_dec)
        if (!notice) return (FALSE);
 
        if (disturb_state) disturb(FALSE, FALSE);
-
-       /* Recalculate bonuses */
        p_ptr->update |= (PU_BONUS);
        handle_stuff();
        return (TRUE);
@@ -2125,8 +2072,6 @@ bool set_resist_magic(TIME_EFFECT v, bool do_dec)
        if (!notice) return (FALSE);
 
        if (disturb_state) disturb(FALSE, FALSE);
-
-       /* Recalculate bonuses */
        p_ptr->update |= (PU_BONUS);
        handle_stuff();
        return (TRUE);
@@ -2181,8 +2126,6 @@ bool set_tim_reflect(TIME_EFFECT v, bool do_dec)
        if (!notice) return (FALSE);
 
        if (disturb_state) disturb(FALSE, FALSE);
-
-       /* Recalculate bonuses */
        p_ptr->update |= (PU_BONUS);
        handle_stuff();
        return (TRUE);
@@ -2235,8 +2178,6 @@ bool set_multishadow(TIME_EFFECT v, bool do_dec)
        if (!notice) return (FALSE);
 
        if (disturb_state) disturb(FALSE, FALSE);
-
-       /* Recalculate bonuses */
        p_ptr->update |= (PU_BONUS);
        handle_stuff();
        return (TRUE);
@@ -2291,8 +2232,6 @@ bool set_dustrobe(TIME_EFFECT v, bool do_dec)
        if (!notice) return (FALSE);
 
        if (disturb_state) disturb(FALSE, FALSE);
-
-       /* Recalculate bonuses */
        p_ptr->update |= (PU_BONUS);
        handle_stuff();
        return (TRUE);
@@ -2347,8 +2286,6 @@ bool set_kabenuke(TIME_EFFECT v, bool do_dec)
        if (!notice) return (FALSE);
 
        if (disturb_state) disturb(FALSE, FALSE);
-
-       /* Recalculate bonuses */
        p_ptr->update |= (PU_BONUS);
        handle_stuff();
        return (TRUE);
@@ -2409,8 +2346,6 @@ bool set_tsuyoshi(TIME_EFFECT v, bool do_dec)
        if (!notice) return (FALSE);
 
        if (disturb_state) disturb(FALSE, FALSE);
-
-       /* Recalculate bonuses */
        p_ptr->update |= (PU_BONUS);
 
        /* Recalculate hitpoints */
@@ -2986,8 +2921,6 @@ bool set_stun(TIME_EFFECT v)
        if (!notice) return (FALSE);
 
        if (disturb_state) disturb(FALSE, FALSE);
-
-       /* Recalculate bonuses */
        p_ptr->update |= (PU_BONUS);
 
        /* Redraw the "stun" */
@@ -3181,8 +3114,6 @@ bool set_cut(TIME_EFFECT v)
        if (!notice) return (FALSE);
 
        if (disturb_state) disturb(FALSE, FALSE);
-
-       /* Recalculate bonuses */
        p_ptr->update |= (PU_BONUS);
 
        /* Redraw the "cut" */
@@ -3377,8 +3308,6 @@ bool set_food(TIME_EFFECT v)
        if (!notice) return (FALSE);
 
        if (disturb_state) disturb(FALSE, FALSE);
-
-       /* Recalculate bonuses */
        p_ptr->update |= (PU_BONUS);
 
        /* Redraw hunger */
@@ -3442,8 +3371,6 @@ bool inc_stat(int stat)
                {
                        p_ptr->stat_max[stat] = value;
                }
-
-               /* Recalculate bonuses */
                p_ptr->update |= (PU_BONUS);
 
                /* Success */
@@ -3577,8 +3504,6 @@ bool dec_stat(int stat, int amount, int permanent)
 
                /* Redisplay the stats later */
                p_ptr->redraw |= (PR_STATS);
-
-               /* Recalculate bonuses */
                p_ptr->update |= (PU_BONUS);
        }
 
@@ -3598,8 +3523,6 @@ bool res_stat(int stat)
        {
                /* Restore */
                p_ptr->stat_cur[stat] = p_ptr->stat_max[stat];
-
-               /* Recalculate bonuses */
                p_ptr->update |= (PU_BONUS);
 
                /* Redisplay the stats later */
@@ -3682,7 +3605,7 @@ bool hp_player(int num)
 /*
  * Array of stat "descriptions"
  */
-static cptr desc_stat_pos[] =
+static concptr desc_stat_pos[] =
 {
        _("強く", "strong"),
        _("知的に", "smart"),
@@ -3696,7 +3619,7 @@ static cptr desc_stat_pos[] =
 /*
  * Array of stat "descriptions"
  */
-static cptr desc_stat_neg[] =
+static concptr desc_stat_neg[] =
 {
        _("弱く", "weak"),
        _("無知に", "stupid"),
@@ -3868,12 +3791,10 @@ bool lose_all_info(void)
                /* Hack -- Clear the "felt" flag */
                o_ptr->ident &= ~(IDENT_SENSE);
        }
-
-       /* Recalculate bonuses */
        p_ptr->update |= (PU_BONUS);
 
        /* Combine / Reorder the pack (later) */
-       p_ptr->notice |= (PN_COMBINE | PN_REORDER);
+       p_ptr->update |= (PU_COMBINE | PU_REORDER);
 
        p_ptr->window |= (PW_INVEN | PW_EQUIP | PW_PLAYER);
 
@@ -3913,9 +3834,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
@@ -4016,7 +3937,7 @@ void do_poly_self(void)
                        /* Harmful deformity */
                        power -= 15;
 
-                       while (tmp < 6)
+                       while (tmp < A_MAX)
                        {
                                if (one_in_(2))
                                {
@@ -4067,7 +3988,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++;
@@ -4120,7 +4041,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;
 
@@ -4243,7 +4164,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);
@@ -4371,7 +4292,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();
@@ -4684,8 +4605,6 @@ bool set_ultimate_res(TIME_EFFECT v, bool do_dec)
        if (!notice) return (FALSE);
 
        if (disturb_state) disturb(FALSE, FALSE);
-
-       /* Recalculate bonuses */
        p_ptr->update |= (PU_BONUS);
        handle_stuff();
        return (TRUE);
@@ -4734,8 +4653,6 @@ bool set_tim_res_nether(TIME_EFFECT v, bool do_dec)
        if (!notice) return (FALSE);
 
        if (disturb_state) disturb(FALSE, FALSE);
-
-       /* Recalculate bonuses */
        p_ptr->update |= (PU_BONUS);
        handle_stuff();
        return (TRUE);
@@ -4784,8 +4701,6 @@ bool set_tim_res_time(TIME_EFFECT v, bool do_dec)
        if (!notice) return (FALSE);
 
        if (disturb_state) disturb(FALSE, FALSE);
-
-       /* Recalculate bonuses */
        p_ptr->update |= (PU_BONUS);
        handle_stuff();
        return (TRUE);