• R/O
  • HTTP
  • SSH
  • HTTPS

hengband: Commit

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


Commit MetaInfo

Revision196a7531227496bd05ebaae228474417037a7a0f (tree)
Time2019-06-21 23:27:57
Authordeskull <deskull@user...>
Commiterdeskull

Log Message

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

Change Summary

Incremental Difference

--- a/src/core.c
+++ b/src/core.c
@@ -1810,7 +1810,7 @@ static void process_world_aux_timeout(void)
18101810 /* Mimic */
18111811 if (p_ptr->tim_mimic)
18121812 {
1813- (void)set_mimic(p_ptr->tim_mimic - 1, p_ptr->mimic_form, TRUE);
1813+ (void)set_mimic(p_ptr, p_ptr->tim_mimic - 1, p_ptr->mimic_form, TRUE);
18141814 }
18151815
18161816 /* Hack -- Hallucinating */
--- a/src/player-effects.c
+++ b/src/player-effects.c
@@ -327,7 +327,7 @@ void dispel_player(void)
327327 (void)set_oppose_cold(0, TRUE);
328328 (void)set_oppose_pois(0, TRUE);
329329 (void)set_ultimate_res(0, TRUE);
330- (void)set_mimic(0, 0, TRUE);
330+ (void)set_mimic(p_ptr, 0, 0, TRUE);
331331 (void)set_ele_attack(0, 0);
332332 (void)set_ele_immune(0, 0);
333333
@@ -361,24 +361,24 @@ void dispel_player(void)
361361 * @param do_dec 現在の継続時間より長い値のみ上書きする
362362 * @return ステータスに影響を及ぼす変化があった場合TRUEを返す。
363363 */
364-bool set_mimic(TIME_EFFECT v, IDX p, bool do_dec)
364+bool set_mimic(player_type *creature_ptr, TIME_EFFECT v, IDX p, bool do_dec)
365365 {
366366 bool notice = FALSE;
367367 v = (v > 10000) ? 10000 : (v < 0) ? 0 : v;
368368
369- if (p_ptr->is_dead) return FALSE;
369+ if (creature_ptr->is_dead) return FALSE;
370370
371371 /* Open */
372372 if (v)
373373 {
374- if (p_ptr->tim_mimic && (p_ptr->mimic_form == p) && !do_dec)
374+ if (creature_ptr->tim_mimic && (creature_ptr->mimic_form == p) && !do_dec)
375375 {
376- if (p_ptr->tim_mimic > v) return FALSE;
376+ if (creature_ptr->tim_mimic > v) return FALSE;
377377 }
378- else if ((!p_ptr->tim_mimic) || (p_ptr->mimic_form != p))
378+ else if ((!creature_ptr->tim_mimic) || (creature_ptr->mimic_form != p))
379379 {
380380 msg_print(_("自分の体が変わってゆくのを感じた。", "You feel that your body changes."));
381- p_ptr->mimic_form = p;
381+ creature_ptr->mimic_form = p;
382382 notice = TRUE;
383383 }
384384 }
@@ -386,26 +386,26 @@ bool set_mimic(TIME_EFFECT v, IDX p, bool do_dec)
386386 /* Shut */
387387 else
388388 {
389- if (p_ptr->tim_mimic)
389+ if (creature_ptr->tim_mimic)
390390 {
391391 msg_print(_("変身が解けた。", "You are no longer transformed."));
392- if (p_ptr->mimic_form == MIMIC_DEMON) set_oppose_fire(0, TRUE);
393- p_ptr->mimic_form=0;
392+ if (creature_ptr->mimic_form == MIMIC_DEMON) set_oppose_fire(0, TRUE);
393+ creature_ptr->mimic_form=0;
394394 notice = TRUE;
395395 p = 0;
396396 }
397397 }
398398
399399 /* Use the value */
400- p_ptr->tim_mimic = v;
400+ creature_ptr->tim_mimic = v;
401401
402402 /* Nothing to notice */
403403 if (!notice) return (FALSE);
404404
405405 if (disturb_state) disturb(FALSE, TRUE);
406406
407- p_ptr->redraw |= (PR_BASIC | PR_STATUS);
408- p_ptr->update |= (PU_BONUS | PU_HP);
407+ creature_ptr->redraw |= (PR_BASIC | PR_STATUS);
408+ creature_ptr->update |= (PU_BONUS | PU_HP);
409409
410410 handle_stuff();
411411 return (TRUE);
--- a/src/player-effects.h
+++ b/src/player-effects.h
@@ -14,7 +14,7 @@ struct kamae
1414 extern void set_action(ACTION_IDX typ);
1515 extern void reset_tim_flags(void);
1616 extern void dispel_player(void);
17-extern bool set_mimic(TIME_EFFECT v, IDX p, bool do_dec);
17+extern bool set_mimic(player_type *creature_ptr, TIME_EFFECT v, IDX p, bool do_dec);
1818 extern bool set_blind(TIME_EFFECT v);
1919 extern bool set_confused(TIME_EFFECT v);
2020 extern bool set_poisoned(TIME_EFFECT v);
--- a/src/realm-daemon.c
+++ b/src/realm-daemon.c
@@ -402,7 +402,7 @@ concptr do_daemon_spell(SPELL_IDX spell, BIT_FLAGS mode)
402402
403403 if (cast)
404404 {
405- set_mimic(base + randint1(base), MIMIC_DEMON, FALSE);
405+ set_mimic(p_ptr, base + randint1(base), MIMIC_DEMON, FALSE);
406406 }
407407 }
408408 break;
@@ -586,7 +586,7 @@ concptr do_daemon_spell(SPELL_IDX spell, BIT_FLAGS mode)
586586
587587 if (cast)
588588 {
589- set_mimic(base + randint1(base), MIMIC_DEMON_LORD, FALSE);
589+ set_mimic(p_ptr, base + randint1(base), MIMIC_DEMON_LORD, FALSE);
590590 }
591591 }
592592 break;
--- a/src/realm-death.c
+++ b/src/realm-death.c
@@ -562,7 +562,7 @@ concptr do_death_spell(SPELL_IDX spell, BIT_FLAGS mode)
562562
563563 if (cast)
564564 {
565- set_mimic(base + randint1(base), MIMIC_VAMPIRE, FALSE);
565+ set_mimic(p_ptr, base + randint1(base), MIMIC_VAMPIRE, FALSE);
566566 }
567567 }
568568 break;
Show on old repository browser