• R/O
  • HTTP
  • SSH
  • HTTPS

hengband: Commit

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


Commit MetaInfo

Revisionbf84d527c3dbe1f05d541992eb182e175b185530 (tree)
Time2019-06-23 14:57:44
Authordeskull <deskull@user...>
Commiterdeskull

Log Message

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

Change Summary

Incremental Difference

--- a/src/core.c
+++ b/src/core.c
@@ -1893,7 +1893,7 @@ static void process_world_aux_timeout(void)
18931893 /* Timed sh_holy */
18941894 if (p_ptr->tim_sh_holy)
18951895 {
1896- (void)set_tim_sh_holy(p_ptr->tim_sh_holy - 1, TRUE);
1896+ (void)set_tim_sh_holy(p_ptr, p_ptr->tim_sh_holy - 1, TRUE);
18971897 }
18981898
18991899 /* Timed eyeeye */
--- a/src/player-effects.c
+++ b/src/player-effects.c
@@ -317,7 +317,7 @@ void dispel_player(void)
317317 (void)set_tim_levitation(p_ptr, 0, TRUE);
318318 (void)set_tim_sh_touki(p_ptr, 0, TRUE);
319319 (void)set_tim_sh_fire(p_ptr, 0, TRUE);
320- (void)set_tim_sh_holy(0, TRUE);
320+ (void)set_tim_sh_holy(p_ptr, 0, TRUE);
321321 (void)set_tim_eyeeye(0, TRUE);
322322 (void)set_magicdef(p_ptr, 0, TRUE);
323323 (void)set_resist_magic(0, TRUE);
@@ -1887,21 +1887,21 @@ bool set_tim_sh_fire(player_type *creature_ptr, TIME_EFFECT v, bool do_dec)
18871887 * @param do_dec 現在の継続時間より長い値のみ上書きする
18881888 * @return ステータスに影響を及ぼす変化があった場合TRUEを返す。
18891889 */
1890-bool set_tim_sh_holy(TIME_EFFECT v, bool do_dec)
1890+bool set_tim_sh_holy(player_type *creature_ptr, TIME_EFFECT v, bool do_dec)
18911891 {
18921892 bool notice = FALSE;
18931893 v = (v > 10000) ? 10000 : (v < 0) ? 0 : v;
18941894
1895- if (p_ptr->is_dead) return FALSE;
1895+ if (creature_ptr->is_dead) return FALSE;
18961896
18971897 /* Open */
18981898 if (v)
18991899 {
1900- if (p_ptr->tim_sh_holy && !do_dec)
1900+ if (creature_ptr->tim_sh_holy && !do_dec)
19011901 {
1902- if (p_ptr->tim_sh_holy > v) return FALSE;
1902+ if (creature_ptr->tim_sh_holy > v) return FALSE;
19031903 }
1904- else if (!p_ptr->tim_sh_holy)
1904+ else if (!creature_ptr->tim_sh_holy)
19051905 {
19061906 msg_print(_("体が聖なるオーラで覆われた。", "You have enveloped by holy aura!"));
19071907 notice = TRUE;
@@ -1911,7 +1911,7 @@ bool set_tim_sh_holy(TIME_EFFECT v, bool do_dec)
19111911 /* Shut */
19121912 else
19131913 {
1914- if (p_ptr->tim_sh_holy)
1914+ if (creature_ptr->tim_sh_holy)
19151915 {
19161916 msg_print(_("聖なるオーラが消えた。", "Holy aura disappeared."));
19171917 notice = TRUE;
@@ -1919,14 +1919,14 @@ bool set_tim_sh_holy(TIME_EFFECT v, bool do_dec)
19191919 }
19201920
19211921 /* Use the value */
1922- p_ptr->tim_sh_holy = v;
1923- p_ptr->redraw |= (PR_STATUS);
1922+ creature_ptr->tim_sh_holy = v;
1923+ creature_ptr->redraw |= (PR_STATUS);
19241924
19251925 /* Nothing to notice */
19261926 if (!notice) return (FALSE);
19271927
19281928 if (disturb_state) disturb(FALSE, FALSE);
1929- p_ptr->update |= (PU_BONUS);
1929+ creature_ptr->update |= (PU_BONUS);
19301930 handle_stuff();
19311931 return (TRUE);
19321932 }
--- a/src/player-effects.h
+++ b/src/player-effects.h
@@ -39,7 +39,7 @@ extern bool set_lightspeed(player_type *creature_ptr, TIME_EFFECT v, bool do_dec
3939 extern bool set_tim_levitation(player_type *creature_ptr, TIME_EFFECT v, bool do_dec);
4040 extern bool set_tim_sh_touki(player_type *creature_ptr, TIME_EFFECT v, bool do_dec);
4141 extern bool set_tim_sh_fire(player_type *creature_ptr, TIME_EFFECT v, bool do_dec);
42-extern bool set_tim_sh_holy(TIME_EFFECT v, bool do_dec);
42+extern bool set_tim_sh_holy(player_type *creature_ptr, TIME_EFFECT v, bool do_dec);
4343 extern bool set_tim_eyeeye(TIME_EFFECT v, bool do_dec);
4444 extern bool set_resist_magic(TIME_EFFECT v, bool do_dec);
4545 extern bool set_tim_reflect(TIME_EFFECT v, bool do_dec);
--- a/src/realm-crusade.c
+++ b/src/realm-crusade.c
@@ -318,7 +318,7 @@ concptr do_crusade_spell(SPELL_IDX spell, BIT_FLAGS mode)
318318
319319 if (cast)
320320 {
321- set_tim_sh_holy(randint1(base) + base, FALSE);
321+ set_tim_sh_holy(p_ptr, randint1(base) + base, FALSE);
322322 }
323323 }
324324 break;
Show on old repository browser