• R/O
  • HTTP
  • SSH
  • HTTPS

hengband: Commit

変愚蛮怒のメインリポジトリです


Commit MetaInfo

Revision15305fda267785de078348e8f12565fa74ecfc24 (tree)
Time2019-06-24 22:49:06
Authordeskull <deskull@user...>
Commiterdeskull

Log Message

[Refactor] #38997 set_resist_magic() に player_type * 引数を追加.

Change Summary

Incremental Difference

--- a/src/core.c
+++ b/src/core.c
@@ -1905,7 +1905,7 @@ static void process_world_aux_timeout(void)
19051905 /* Timed resist-magic */
19061906 if (p_ptr->resist_magic)
19071907 {
1908- (void)set_resist_magic(p_ptr->resist_magic - 1, TRUE);
1908+ (void)set_resist_magic(p_ptr, p_ptr->resist_magic - 1, TRUE);
19091909 }
19101910
19111911 /* Timed regeneration */
--- a/src/mind.c
+++ b/src/mind.c
@@ -1217,7 +1217,7 @@ static bool cast_force_spell(int spell)
12171217 fire_beam(GF_MISSILE, dir, damroll(5 + ((plev - 1) / 5) + boost / 10, 5));
12181218 break;
12191219 case 4:
1220- set_resist_magic(randint1(20) + 20 + boost / 5, FALSE);
1220+ set_resist_magic(p_ptr, randint1(20) + 20 + boost / 5, FALSE);
12211221 break;
12221222 case 5:
12231223 msg_print(_("気を練った。", "You improved the Force."));
@@ -1405,7 +1405,7 @@ static bool cast_mirror_spell(int spell)
14051405 t = 20 + randint1(20);
14061406 set_shield(p_ptr, t, FALSE);
14071407 if (plev > 31)set_tim_reflect(t, FALSE);
1408- if (plev > 39)set_resist_magic(t, FALSE);
1408+ if (plev > 39)set_resist_magic(p_ptr, t, FALSE);
14091409 break;
14101410 /* super ray */
14111411 case 13:
--- a/src/player-effects.c
+++ b/src/player-effects.c
@@ -320,7 +320,7 @@ void dispel_player(void)
320320 (void)set_tim_sh_holy(p_ptr, 0, TRUE);
321321 (void)set_tim_eyeeye(p_ptr, 0, TRUE);
322322 (void)set_magicdef(p_ptr, 0, TRUE);
323- (void)set_resist_magic(0, TRUE);
323+ (void)set_resist_magic(p_ptr, 0, TRUE);
324324 (void)set_oppose_acid(0, TRUE);
325325 (void)set_oppose_elec(0, TRUE);
326326 (void)set_oppose_fire(0, TRUE);
@@ -1988,21 +1988,21 @@ bool set_tim_eyeeye(player_type *creature_ptr, TIME_EFFECT v, bool do_dec)
19881988 * @param do_dec 現在の継続時間より長い値のみ上書きする
19891989 * @return ステータスに影響を及ぼす変化があった場合TRUEを返す。
19901990 */
1991-bool set_resist_magic(TIME_EFFECT v, bool do_dec)
1991+bool set_resist_magic(player_type *creature_ptr, TIME_EFFECT v, bool do_dec)
19921992 {
19931993 bool notice = FALSE;
19941994 v = (v > 10000) ? 10000 : (v < 0) ? 0 : v;
19951995
1996- if (p_ptr->is_dead) return FALSE;
1996+ if (creature_ptr->is_dead) return FALSE;
19971997
19981998 /* Open */
19991999 if (v)
20002000 {
2001- if (p_ptr->resist_magic && !do_dec)
2001+ if (creature_ptr->resist_magic && !do_dec)
20022002 {
2003- if (p_ptr->resist_magic > v) return FALSE;
2003+ if (creature_ptr->resist_magic > v) return FALSE;
20042004 }
2005- else if (!p_ptr->resist_magic)
2005+ else if (!creature_ptr->resist_magic)
20062006 {
20072007 msg_print(_("魔法への耐性がついた。", "You have been protected from magic!"));
20082008 notice = TRUE;
@@ -2012,7 +2012,7 @@ bool set_resist_magic(TIME_EFFECT v, bool do_dec)
20122012 /* Shut */
20132013 else
20142014 {
2015- if (p_ptr->resist_magic)
2015+ if (creature_ptr->resist_magic)
20162016 {
20172017 msg_print(_("魔法に弱くなった。", "You are no longer protected from magic."));
20182018 notice = TRUE;
@@ -2020,14 +2020,14 @@ bool set_resist_magic(TIME_EFFECT v, bool do_dec)
20202020 }
20212021
20222022 /* Use the value */
2023- p_ptr->resist_magic = v;
2024- p_ptr->redraw |= (PR_STATUS);
2023+ creature_ptr->resist_magic = v;
2024+ creature_ptr->redraw |= (PR_STATUS);
20252025
20262026 /* Nothing to notice */
20272027 if (!notice) return (FALSE);
20282028
20292029 if (disturb_state) disturb(FALSE, FALSE);
2030- p_ptr->update |= (PU_BONUS);
2030+ creature_ptr->update |= (PU_BONUS);
20312031 handle_stuff();
20322032 return (TRUE);
20332033 }
--- a/src/player-effects.h
+++ b/src/player-effects.h
@@ -41,7 +41,7 @@ extern bool set_tim_sh_touki(player_type *creature_ptr, TIME_EFFECT v, bool do_d
4141 extern bool set_tim_sh_fire(player_type *creature_ptr, TIME_EFFECT v, bool do_dec);
4242 extern bool set_tim_sh_holy(player_type *creature_ptr, TIME_EFFECT v, bool do_dec);
4343 extern bool set_tim_eyeeye(player_type *creature_ptr, TIME_EFFECT v, bool do_dec);
44-extern bool set_resist_magic(TIME_EFFECT v, bool do_dec);
44+extern bool set_resist_magic(player_type *creature_ptr, TIME_EFFECT v, bool do_dec);
4545 extern bool set_tim_reflect(TIME_EFFECT v, bool do_dec);
4646 extern bool set_multishadow(TIME_EFFECT v, bool do_dec);
4747 extern bool set_dustrobe(TIME_EFFECT v, bool do_dec);
Show on old repository browser