• R/O
  • HTTP
  • SSH
  • HTTPS

hengband: Commit

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


Commit MetaInfo

Revisionf862cfddbb5eeeb3d56c550b9500960367763fb0 (tree)
Time2019-06-23 14:23:49
Authordeskull <deskull@user...>
Commiterdeskull

Log Message

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

Change Summary

Incremental Difference

--- a/src/cmd-quaff.c
+++ b/src/cmd-quaff.c
@@ -261,7 +261,7 @@ void exe_quaff_potion(INVENTORY_IDX item)
261261 break;
262262
263263 case SV_POTION_DETECT_INVIS:
264- if (set_tim_invis(p_ptr->tim_invis + 12 + randint1(12), FALSE))
264+ if (set_tim_invis(p_ptr, p_ptr->tim_invis + 12 + randint1(12), FALSE))
265265 {
266266 ident = TRUE;
267267 }
--- a/src/core.c
+++ b/src/core.c
@@ -1828,7 +1828,7 @@ static void process_world_aux_timeout(void)
18281828 /* Times see-invisible */
18291829 if (p_ptr->tim_invis)
18301830 {
1831- (void)set_tim_invis(p_ptr->tim_invis - 1, TRUE);
1831+ (void)set_tim_invis(p_ptr, p_ptr->tim_invis - 1, TRUE);
18321832 }
18331833
18341834 if (p_ptr->suppress_multi_reward)
--- a/src/player-effects.c
+++ b/src/player-effects.c
@@ -309,7 +309,7 @@ void dispel_player(void)
309309 (void)set_multishadow(0,TRUE);
310310 (void)set_dustrobe(0,TRUE);
311311
312- (void)set_tim_invis(0, TRUE);
312+ (void)set_tim_invis(p_ptr, 0, TRUE);
313313 (void)set_tim_infra(0, TRUE);
314314 (void)set_tim_esp(0, TRUE);
315315 (void)set_tim_regen(0, TRUE);
@@ -1477,21 +1477,21 @@ bool set_tim_esp(TIME_EFFECT v, bool do_dec)
14771477 * @param do_dec 現在の継続時間より長い値のみ上書きする
14781478 * @return ステータスに影響を及ぼす変化があった場合TRUEを返す。
14791479 */
1480-bool set_tim_invis(TIME_EFFECT v, bool do_dec)
1480+bool set_tim_invis(player_type *creature_ptr, TIME_EFFECT v, bool do_dec)
14811481 {
14821482 bool notice = FALSE;
14831483 v = (v > 10000) ? 10000 : (v < 0) ? 0 : v;
14841484
1485- if (p_ptr->is_dead) return FALSE;
1485+ if (creature_ptr->is_dead) return FALSE;
14861486
14871487 /* Open */
14881488 if (v)
14891489 {
1490- if (p_ptr->tim_invis && !do_dec)
1490+ if (creature_ptr->tim_invis && !do_dec)
14911491 {
1492- if (p_ptr->tim_invis > v) return FALSE;
1492+ if (creature_ptr->tim_invis > v) return FALSE;
14931493 }
1494- else if (!p_ptr->tim_invis)
1494+ else if (!creature_ptr->tim_invis)
14951495 {
14961496 msg_print(_("目が非常に敏感になった気がする!", "Your eyes feel very sensitive!"));
14971497 notice = TRUE;
@@ -1501,7 +1501,7 @@ bool set_tim_invis(TIME_EFFECT v, bool do_dec)
15011501 /* Shut */
15021502 else
15031503 {
1504- if (p_ptr->tim_invis)
1504+ if (creature_ptr->tim_invis)
15051505 {
15061506 msg_print(_("目の敏感さがなくなったようだ。", "Your eyes feel less sensitive."));
15071507 notice = TRUE;
@@ -1509,17 +1509,17 @@ bool set_tim_invis(TIME_EFFECT v, bool do_dec)
15091509 }
15101510
15111511 /* Use the value */
1512- p_ptr->tim_invis = v;
1513- p_ptr->redraw |= (PR_STATUS);
1512+ creature_ptr->tim_invis = v;
1513+ creature_ptr->redraw |= (PR_STATUS);
15141514
15151515 /* Nothing to notice */
15161516 if (!notice) return (FALSE);
15171517
15181518 if (disturb_state) disturb(FALSE, FALSE);
1519- p_ptr->update |= (PU_BONUS);
1519+ creature_ptr->update |= (PU_BONUS);
15201520
15211521 /* Update the monsters */
1522- p_ptr->update |= (PU_MONSTERS);
1522+ creature_ptr->update |= (PU_MONSTERS);
15231523 handle_stuff();
15241524 return (TRUE);
15251525 }
--- a/src/player-effects.h
+++ b/src/player-effects.h
@@ -31,7 +31,7 @@ extern bool set_hero(player_type *creature_ptr, TIME_EFFECT v, bool do_dec);
3131 extern bool set_shero(player_type *creature_ptr, TIME_EFFECT v, bool do_dec);
3232 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);
34-extern bool set_tim_invis(TIME_EFFECT v, bool do_dec);
34+extern bool set_tim_invis(player_type *creature_ptr, TIME_EFFECT v, bool do_dec);
3535 extern bool set_tim_infra(TIME_EFFECT v, bool do_dec);
3636 extern bool set_tim_regen(TIME_EFFECT v, bool do_dec);
3737 extern bool set_tim_stealth(TIME_EFFECT v, bool do_dec);
--- a/src/realm-arcane.c
+++ b/src/realm-arcane.c
@@ -419,7 +419,7 @@ concptr do_arcane_spell(SPELL_IDX spell, BIT_FLAGS mode)
419419
420420 if (cast)
421421 {
422- set_tim_invis(randint1(base) + base, FALSE);
422+ set_tim_invis(p_ptr, randint1(base) + base, FALSE);
423423 }
424424 }
425425 break;
--- a/src/realm-craft.c
+++ b/src/realm-craft.c
@@ -169,7 +169,7 @@ concptr do_craft_spell(SPELL_IDX spell, BIT_FLAGS mode)
169169
170170 if (cast)
171171 {
172- set_tim_invis(randint1(base) + base, FALSE);
172+ set_tim_invis(p_ptr, randint1(base) + base, FALSE);
173173 }
174174 }
175175 break;
--- a/src/realm-crusade.c
+++ b/src/realm-crusade.c
@@ -214,7 +214,7 @@ concptr do_crusade_spell(SPELL_IDX spell, BIT_FLAGS mode)
214214
215215 if (cast)
216216 {
217- set_tim_invis(randint1(base) + base, FALSE);
217+ set_tim_invis(p_ptr, randint1(base) + base, FALSE);
218218 }
219219 }
220220 break;
Show on old repository browser