OSDN Git Service

[Refactor] #38997 IS_HERO() に player_type * 引数を追加. / Add player_type * argument to...
authordeskull <deskull@users.sourceforge.jp>
Thu, 2 Jan 2020 11:11:41 +0000 (20:11 +0900)
committerdeskull <deskull@users.sourceforge.jp>
Thu, 2 Jan 2020 11:11:41 +0000 (20:11 +0900)
src/files.c
src/mind.c
src/player-effects.c
src/player-status.c
src/player-status.h
src/selfinfo.c
src/view-mainwindow.c

index e6d9f47..342de91 100644 (file)
@@ -2717,7 +2717,7 @@ static void tim_player_flags(player_type *creature_ptr, BIT_FLAGS flgs[TR_FLAG_S
        for (i = 0; i < TR_FLAG_SIZE; i++)
                flgs[i] = 0L;
 
-       if (IS_HERO() || creature_ptr->shero)
+       if (IS_HERO(creature_ptr) || creature_ptr->shero)
                add_flag(flgs, TR_RES_FEAR);
        if (creature_ptr->tim_invis)
                add_flag(flgs, TR_SEE_INVIS);
index b7af164..2f7b65b 100644 (file)
@@ -1135,7 +1135,7 @@ static bool cast_mindcrafter_spell(player_type *caster_ptr, int spell)
                 * Only heal when Adrenalin Channeling is not active. We check
                 * that by checking if the player isn't fast and 'heroed' atm.
                 */
-               if (!IS_FAST(caster_ptr) || !IS_HERO())
+               if (!IS_FAST(caster_ptr) || !IS_HERO(caster_ptr))
                {
                        hp_player(caster_ptr, plev);
                }
index f6ac642..2853f1c 100644 (file)
@@ -1119,7 +1119,7 @@ bool set_hero(player_type *creature_ptr, TIME_EFFECT v, bool do_dec)
                {
                        if (creature_ptr->hero > v) return FALSE;
                }
-               else if (!IS_HERO())
+               else if (!IS_HERO(creature_ptr))
                {
                        msg_print(_("ヒーローになった気がする!", "You feel like a hero!"));
                        notice = TRUE;
index 650d07a..8ce01f2 100644 (file)
@@ -2871,7 +2871,7 @@ void calc_bonuses(player_type *creature_ptr)
        }
 
        /* Temporary "Hero" */
-       if (IS_HERO())
+       if (IS_HERO(creature_ptr))
        {
                creature_ptr->to_h[0] += 12;
                creature_ptr->to_h[1] += 12;
@@ -2969,7 +2969,7 @@ void calc_bonuses(player_type *creature_ptr)
        }
 
        /* Hack -- Hero/Shero -> Res fear */
-       if (IS_HERO() || creature_ptr->shero)
+       if (IS_HERO(creature_ptr) || creature_ptr->shero)
        {
                creature_ptr->resist_fear = TRUE;
        }
@@ -4056,7 +4056,7 @@ static void calc_hitpoints(player_type *creature_ptr)
        if (mhp < creature_ptr->lev + 1) mhp = creature_ptr->lev + 1;
 
        /* Factor in the hero / superhero settings */
-       if (IS_HERO()) mhp += 10;
+       if (IS_HERO(creature_ptr)) mhp += 10;
        if (creature_ptr->shero && (creature_ptr->pclass != CLASS_BERSERKER)) mhp += 30;
        if (creature_ptr->tsuyoshi) mhp += 50;
 
index 87738d2..27db78d 100644 (file)
@@ -799,7 +799,7 @@ extern const s32b player_exp_a[PY_MAX_LEVEL];
 /* Temporary flags macro */
 #define IS_FAST(C) (C->fast || music_singing(C, MUSIC_SPEED) || music_singing(C, MUSIC_SHERO))
 #define IS_INVULN(C) (C->invuln || music_singing(C, MUSIC_INVULN))
-#define IS_HERO() (p_ptr->hero || music_singing(p_ptr, MUSIC_HERO) || music_singing(p_ptr, MUSIC_SHERO))
+#define IS_HERO(C) (C->hero || music_singing(C, MUSIC_HERO) || music_singing(C, MUSIC_SHERO))
 #define IS_BLESSED() (p_ptr->blessed || music_singing(p_ptr, MUSIC_BLESS) || hex_spelling(HEX_BLESS))
 #define IS_OPPOSE_ACID() (p_ptr->oppose_acid || music_singing(p_ptr, MUSIC_RESIST) || (p_ptr->special_defense & KATA_MUSOU))
 #define IS_OPPOSE_ELEC() (p_ptr->oppose_elec || music_singing(p_ptr, MUSIC_RESIST) || (p_ptr->special_defense & KATA_MUSOU))
index a8ffb98..0d7bec2 100644 (file)
@@ -1024,7 +1024,7 @@ void self_knowledge(player_type *creature_ptr)
        {
                info[i++] = _("あなたは高潔さを感じている。", "You feel rightous.");
        }
-       if (IS_HERO())
+       if (IS_HERO(creature_ptr))
        {
                info[i++] = _("あなたはヒーロー気分だ。", "You feel heroic.");
        }
index 1a8a18b..6da7da0 100644 (file)
@@ -567,7 +567,7 @@ static void prt_status(player_type *creature_ptr)
        if (creature_ptr->tim_reflect) ADD_FLG(BAR_REFLECTION);
 
        /* Heroism */
-       if (IS_HERO()) ADD_FLG(BAR_HEROISM);
+       if (IS_HERO(creature_ptr)) ADD_FLG(BAR_HEROISM);
 
        /* Super Heroism / berserk */
        if (creature_ptr->shero) ADD_FLG(BAR_BERSERK);