• R/O
  • HTTP
  • SSH
  • HTTPS

hengband: Commit

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


Commit MetaInfo

Revision02084682a3c124906a1f0faa014580cda16672a7 (tree)
Time2019-06-23 14:32:56
Authordeskull <deskull@user...>
Commiterdeskull

Log Message

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

Change Summary

Incremental Difference

--- a/src/core.c
+++ b/src/core.c
@@ -1911,7 +1911,7 @@ static void process_world_aux_timeout(void)
19111911 /* Timed regeneration */
19121912 if (p_ptr->tim_regen)
19131913 {
1914- (void)set_tim_regen(p_ptr->tim_regen - 1, TRUE);
1914+ (void)set_tim_regen(p_ptr, p_ptr->tim_regen - 1, TRUE);
19151915 }
19161916
19171917 /* Timed resist nether */
--- a/src/player-effects.c
+++ b/src/player-effects.c
@@ -312,7 +312,7 @@ void dispel_player(void)
312312 (void)set_tim_invis(p_ptr, 0, TRUE);
313313 (void)set_tim_infra(p_ptr, 0, TRUE);
314314 (void)set_tim_esp(0, TRUE);
315- (void)set_tim_regen(0, TRUE);
315+ (void)set_tim_regen(p_ptr, 0, TRUE);
316316 (void)set_tim_stealth(0, TRUE);
317317 (void)set_tim_levitation(0, TRUE);
318318 (void)set_tim_sh_touki(0, TRUE);
@@ -1583,21 +1583,21 @@ bool set_tim_infra(player_type *creature_ptr, TIME_EFFECT v, bool do_dec)
15831583 * @param do_dec 現在の継続時間より長い値のみ上書きする
15841584 * @return ステータスに影響を及ぼす変化があった場合TRUEを返す。
15851585 */
1586-bool set_tim_regen(TIME_EFFECT v, bool do_dec)
1586+bool set_tim_regen(player_type *creature_ptr, TIME_EFFECT v, bool do_dec)
15871587 {
15881588 bool notice = FALSE;
15891589 v = (v > 10000) ? 10000 : (v < 0) ? 0 : v;
15901590
1591- if (p_ptr->is_dead) return FALSE;
1591+ if (creature_ptr->is_dead) return FALSE;
15921592
15931593 /* Open */
15941594 if (v)
15951595 {
1596- if (p_ptr->tim_regen && !do_dec)
1596+ if (creature_ptr->tim_regen && !do_dec)
15971597 {
1598- if (p_ptr->tim_regen > v) return FALSE;
1598+ if (creature_ptr->tim_regen > v) return FALSE;
15991599 }
1600- else if (!p_ptr->tim_regen)
1600+ else if (!creature_ptr->tim_regen)
16011601 {
16021602 msg_print(_("回復力が上がった!", "You feel yourself regenerating quickly!"));
16031603 notice = TRUE;
@@ -1607,7 +1607,7 @@ bool set_tim_regen(TIME_EFFECT v, bool do_dec)
16071607 /* Shut */
16081608 else
16091609 {
1610- if (p_ptr->tim_regen)
1610+ if (creature_ptr->tim_regen)
16111611 {
16121612 msg_print(_("素早く回復する感じがなくなった。", "You feel yourself regenerating slowly."));
16131613 notice = TRUE;
@@ -1615,14 +1615,14 @@ bool set_tim_regen(TIME_EFFECT v, bool do_dec)
16151615 }
16161616
16171617 /* Use the value */
1618- p_ptr->tim_regen = v;
1619- p_ptr->redraw |= (PR_STATUS);
1618+ creature_ptr->tim_regen = v;
1619+ creature_ptr->redraw |= (PR_STATUS);
16201620
16211621 /* Nothing to notice */
16221622 if (!notice) return (FALSE);
16231623
16241624 if (disturb_state) disturb(FALSE, FALSE);
1625- p_ptr->update |= (PU_BONUS);
1625+ creature_ptr->update |= (PU_BONUS);
16261626 handle_stuff();
16271627 return (TRUE);
16281628 }
--- a/src/player-effects.h
+++ b/src/player-effects.h
@@ -33,7 +33,7 @@ extern bool set_protevil(player_type *creature_ptr, TIME_EFFECT v, bool do_dec);
3333 extern bool set_invuln(player_type *creature_ptr, TIME_EFFECT v, bool do_dec);
3434 extern bool set_tim_invis(player_type *creature_ptr, TIME_EFFECT v, bool do_dec);
3535 extern bool set_tim_infra(player_type *creature_ptr, TIME_EFFECT v, bool do_dec);
36-extern bool set_tim_regen(TIME_EFFECT v, bool do_dec);
36+extern bool set_tim_regen(player_type *creature_ptr, TIME_EFFECT v, bool do_dec);
3737 extern bool set_tim_stealth(TIME_EFFECT v, bool do_dec);
3838 extern bool set_lightspeed(TIME_EFFECT v, bool do_dec);
3939 extern bool set_tim_levitation(TIME_EFFECT v, bool do_dec);
--- a/src/realm-craft.c
+++ b/src/realm-craft.c
@@ -57,7 +57,7 @@ concptr do_craft_spell(SPELL_IDX spell, BIT_FLAGS mode)
5757
5858 if (cast)
5959 {
60- set_tim_regen(base + randint1(base), FALSE);
60+ set_tim_regen(p_ptr, base + randint1(base), FALSE);
6161 }
6262 }
6363 break;
--- a/src/spells-status.c
+++ b/src/spells-status.c
@@ -462,7 +462,7 @@ bool cosmic_cast_off(player_type *creature_ptr, object_type *o_ptr)
462462 (void)set_blind(p_ptr, creature_ptr->blind + t);
463463 (void)set_afraid(p_ptr, 0);
464464 (void)set_tim_esp(creature_ptr->tim_esp + t, FALSE);
465- (void)set_tim_regen(creature_ptr->tim_regen + t, FALSE);
465+ (void)set_tim_regen(p_ptr, creature_ptr->tim_regen + t, FALSE);
466466 (void)set_hero(p_ptr, creature_ptr->hero + t, FALSE);
467467 (void)set_blessed(p_ptr, creature_ptr->blessed + t, FALSE);
468468 (void)set_fast(p_ptr, creature_ptr->fast + t, FALSE);
Show on old repository browser