• R/O
  • HTTP
  • SSH
  • HTTPS

hengband: Commit

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


Commit MetaInfo

Revisionb6b3c6260c000c65f0452418561b9e8df23b73fd (tree)
Time2019-06-22 11:44:06
Authordeskull <deskull@user...>
Commiterdeskull

Log Message

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

Change Summary

Incremental Difference

--- a/src/core.c
+++ b/src/core.c
@@ -2031,7 +2031,7 @@ static void process_world_aux_timeout(void)
20312031 /* Magicdef */
20322032 if (p_ptr->magicdef)
20332033 {
2034- (void)set_magicdef(p_ptr->magicdef - 1, TRUE);
2034+ (void)set_magicdef(p_ptr, p_ptr->magicdef - 1, TRUE);
20352035 }
20362036
20372037 /* Tsuyoshi */
--- a/src/player-effects.c
+++ b/src/player-effects.c
@@ -319,7 +319,7 @@ void dispel_player(void)
319319 (void)set_tim_sh_fire(0, TRUE);
320320 (void)set_tim_sh_holy(0, TRUE);
321321 (void)set_tim_eyeeye(0, TRUE);
322- (void)set_magicdef(0, TRUE);
322+ (void)set_magicdef(p_ptr, 0, TRUE);
323323 (void)set_resist_magic(0, TRUE);
324324 (void)set_oppose_acid(0, TRUE);
325325 (void)set_oppose_elec(0, TRUE);
@@ -1037,21 +1037,21 @@ bool set_tsubureru(player_type *creature_ptr, TIME_EFFECT v, bool do_dec)
10371037 * @param do_dec 現在の継続時間より長い値のみ上書きする
10381038 * @return ステータスに影響を及ぼす変化があった場合TRUEを返す。
10391039 */
1040-bool set_magicdef(TIME_EFFECT v, bool do_dec)
1040+bool set_magicdef(player_type *creature_ptr, TIME_EFFECT v, bool do_dec)
10411041 {
10421042 bool notice = FALSE;
10431043 v = (v > 10000) ? 10000 : (v < 0) ? 0 : v;
10441044
1045- if (p_ptr->is_dead) return FALSE;
1045+ if (creature_ptr->is_dead) return FALSE;
10461046
10471047 /* Open */
10481048 if (v)
10491049 {
1050- if (p_ptr->magicdef && !do_dec)
1050+ if (creature_ptr->magicdef && !do_dec)
10511051 {
1052- if (p_ptr->magicdef > v) return FALSE;
1052+ if (creature_ptr->magicdef > v) return FALSE;
10531053 }
1054- else if (!p_ptr->magicdef)
1054+ else if (!creature_ptr->magicdef)
10551055 {
10561056 msg_print(_("魔法の防御力が増したような気がする。", "You feel more resistant to magic."));
10571057 notice = TRUE;
@@ -1061,7 +1061,7 @@ bool set_magicdef(TIME_EFFECT v, bool do_dec)
10611061 /* Shut */
10621062 else
10631063 {
1064- if (p_ptr->magicdef)
1064+ if (creature_ptr->magicdef)
10651065 {
10661066 msg_print(_("魔法の防御力が元に戻った。", "You feel less resistant to magic."));
10671067 notice = TRUE;
@@ -1069,14 +1069,14 @@ bool set_magicdef(TIME_EFFECT v, bool do_dec)
10691069 }
10701070
10711071 /* Use the value */
1072- p_ptr->magicdef = v;
1073- p_ptr->redraw |= (PR_STATUS);
1072+ creature_ptr->magicdef = v;
1073+ creature_ptr->redraw |= (PR_STATUS);
10741074
10751075 /* Nothing to notice */
10761076 if (!notice) return (FALSE);
10771077
10781078 if (disturb_state) disturb(FALSE, FALSE);
1079- p_ptr->update |= (PU_BONUS);
1079+ creature_ptr->update |= (PU_BONUS);
10801080 handle_stuff();
10811081 return (TRUE);
10821082 }
--- a/src/player-effects.h
+++ b/src/player-effects.h
@@ -25,7 +25,7 @@ extern bool set_fast(player_type *creature_ptr, TIME_EFFECT v, bool do_dec);
2525 extern bool set_slow(player_type *creature_ptr, TIME_EFFECT v, bool do_dec);
2626 extern bool set_shield(player_type *creature_ptr, TIME_EFFECT v, bool do_dec);
2727 extern bool set_tsubureru(player_type *creature_ptr, TIME_EFFECT v, bool do_dec);
28-extern bool set_magicdef(TIME_EFFECT v, bool do_dec);
28+extern bool set_magicdef(player_type *creature_ptr, TIME_EFFECT v, bool do_dec);
2929 extern bool set_blessed(TIME_EFFECT v, bool do_dec);
3030 extern bool set_hero(TIME_EFFECT v, bool do_dec);
3131 extern bool set_shero(TIME_EFFECT v, bool do_dec);
--- a/src/realm-craft.c
+++ b/src/realm-craft.c
@@ -406,7 +406,7 @@ concptr do_craft_spell(SPELL_IDX spell, BIT_FLAGS mode)
406406
407407 if (cast)
408408 {
409- set_magicdef(randint1(base) + base, FALSE);
409+ set_magicdef(p_ptr, randint1(base) + base, FALSE);
410410 }
411411 }
412412 break;
Show on old repository browser