OSDN Git Service

[Refactor] #38852 p_ptr->notice を p_ptr->update へ統合。 / Integrate p_ptr->notice to...
[hengband/hengband.git] / src / effects.c
index 5f391f3..4fcec76 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 */
@@ -270,18 +265,11 @@ void dispel_player(void)
                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);
-
-               /* Update monsters */
-               p_ptr->update |= (PU_MONSTERS);
-
                p_ptr->window |= (PW_OVERHEAD | PW_DUNGEON);
-
                p_ptr->energy_need += ENERGY_NEED();
        }
 }
@@ -342,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();
@@ -676,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);
@@ -740,8 +724,6 @@ bool set_image(TIME_EFFECT v)
 
        /* Update the health bar */
        p_ptr->redraw |= (PR_HEALTH | PR_UHEALTH);
-
-       /* Update monsters */
        p_ptr->update |= (PU_MONSTERS);
 
        p_ptr->window |= (PW_OVERHEAD | PW_DUNGEON);
@@ -797,8 +779,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);
@@ -854,8 +834,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);
@@ -907,8 +885,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);
@@ -964,8 +940,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);
@@ -1021,8 +995,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);
@@ -1078,8 +1050,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);
@@ -1134,8 +1104,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);
@@ -1191,8 +1159,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 */
@@ -1251,8 +1217,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 */
@@ -1346,8 +1310,6 @@ bool set_wraith_form(TIME_EFFECT v, bool do_dec)
                        chg_virtue(V_VALOUR, -5);
 
                        p_ptr->redraw |= (PR_MAP);
-
-                       /* Update monsters */
                        p_ptr->update |= (PU_MONSTERS);
 
                        p_ptr->window |= (PW_OVERHEAD | PW_DUNGEON);
@@ -1363,8 +1325,6 @@ bool set_wraith_form(TIME_EFFECT v, bool do_dec)
                        notice = TRUE;
 
                        p_ptr->redraw |= (PR_MAP);
-
-                       /* Update monsters */
                        p_ptr->update |= (PU_MONSTERS);
 
                        p_ptr->window |= (PW_OVERHEAD | PW_DUNGEON);
@@ -1381,8 +1341,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);
@@ -1422,8 +1380,6 @@ bool set_invuln(TIME_EFFECT v, bool do_dec)
                        chg_virtue(V_VALOUR, -5);
 
                        p_ptr->redraw |= (PR_MAP);
-
-                       /* Update monsters */
                        p_ptr->update |= (PU_MONSTERS);
 
                        p_ptr->window |= (PW_OVERHEAD | PW_DUNGEON);
@@ -1439,8 +1395,6 @@ bool set_invuln(TIME_EFFECT v, bool do_dec)
                        notice = TRUE;
 
                        p_ptr->redraw |= (PR_MAP);
-
-                       /* Update monsters */
                        p_ptr->update |= (PU_MONSTERS);
 
                        p_ptr->window |= (PW_OVERHEAD | PW_DUNGEON);
@@ -1459,8 +1413,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);
@@ -1515,8 +1467,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();
@@ -1572,8 +1522,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 */
@@ -1631,8 +1579,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 */
@@ -1690,8 +1636,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);
@@ -1746,8 +1690,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);
@@ -1859,8 +1801,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);
@@ -1968,8 +1908,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);
@@ -2024,8 +1962,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);
@@ -2080,8 +2016,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);
@@ -2137,8 +2071,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);
@@ -2193,8 +2125,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);
@@ -2247,8 +2177,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);
@@ -2303,8 +2231,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);
@@ -2359,8 +2285,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);
@@ -2421,8 +2345,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 */
@@ -2998,8 +2920,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" */
@@ -3193,8 +3113,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" */
@@ -3389,8 +3307,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 */
@@ -3454,8 +3370,6 @@ bool inc_stat(int stat)
                {
                        p_ptr->stat_max[stat] = value;
                }
-
-               /* Recalculate bonuses */
                p_ptr->update |= (PU_BONUS);
 
                /* Success */
@@ -3589,8 +3503,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);
        }
 
@@ -3610,8 +3522,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 */
@@ -3880,12 +3790,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);
 
@@ -4696,8 +4604,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);
@@ -4746,8 +4652,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);
@@ -4796,8 +4700,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);