• R/O
  • HTTP
  • SSH
  • HTTPS

hengband: Commit

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


Commit MetaInfo

Revisione7c82e743ca3857938b12bf31ed2bf8fc0efb2dc (tree)
Time2019-06-22 10:47:41
Authordeskull <deskull@user...>
Commiterdeskull

Log Message

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

Change Summary

Incremental Difference

--- a/src/cmd-eat.c
+++ b/src/cmd-eat.c
@@ -118,7 +118,7 @@ void exe_eat_food(INVENTORY_IDX item)
118118 {
119119 if (!p_ptr->resist_chaos)
120120 {
121- if (set_image(p_ptr->image + randint0(250) + 250))
121+ if (set_image(p_ptr, p_ptr->image + randint0(250) + 250))
122122 {
123123 ident = TRUE;
124124 }
--- a/src/cmd-quaff.c
+++ b/src/cmd-quaff.c
@@ -475,7 +475,7 @@ void exe_quaff_potion(INVENTORY_IDX item)
475475 break;
476476
477477 case SV_POTION_NEO_TSUYOSHI:
478- (void)set_image(0);
478+ (void)set_image(p_ptr, 0);
479479 (void)set_tsuyoshi(p_ptr->tsuyoshi + randint1(100) + 100, FALSE);
480480 ident = TRUE;
481481 break;
@@ -487,7 +487,7 @@ void exe_quaff_potion(INVENTORY_IDX item)
487487 (void)set_tsuyoshi(0, TRUE);
488488 if (!p_ptr->resist_chaos)
489489 {
490- (void)set_image(50 + randint1(50));
490+ (void)set_image(p_ptr, 50 + randint1(50));
491491 }
492492 ident = TRUE;
493493 break;
--- a/src/core.c
+++ b/src/core.c
@@ -706,7 +706,7 @@ static bool pattern_effect(void)
706706 switch (pattern_type)
707707 {
708708 case PATTERN_TILE_END:
709- (void)set_image(0);
709+ (void)set_image(p_ptr, 0);
710710 (void)restore_all_status();
711711 (void)restore_level();
712712 (void)cure_critical_wounds(1000);
@@ -1816,7 +1816,7 @@ static void process_world_aux_timeout(void)
18161816 /* Hack -- Hallucinating */
18171817 if (p_ptr->image)
18181818 {
1819- (void)set_image(p_ptr->image - dec_count);
1819+ (void)set_image(p_ptr, p_ptr->image - dec_count);
18201820 }
18211821
18221822 /* Blindness */
@@ -2216,7 +2216,7 @@ static void process_world_aux_mutation(void)
22162216 if (one_in_(3))
22172217 {
22182218 msg_print(_("き~れいなちょおちょらとんれいる~", "Thishcischs GooDSChtuff!"));
2219- (void)set_image(p_ptr->image + randint0(150) + 150);
2219+ (void)set_image(p_ptr, p_ptr->image + randint0(150) + 150);
22202220 }
22212221 }
22222222 }
@@ -2228,7 +2228,7 @@ static void process_world_aux_mutation(void)
22282228 {
22292229 disturb(FALSE, TRUE);
22302230 p_ptr->redraw |= PR_EXTRA;
2231- (void)set_image(p_ptr->image + randint0(50) + 20);
2231+ (void)set_image(p_ptr, p_ptr->image + randint0(50) + 20);
22322232 }
22332233 }
22342234
--- a/src/mind.c
+++ b/src/mind.c
@@ -1910,7 +1910,7 @@ void do_cmd_mind(void)
19101910 else if (b < 15)
19111911 {
19121912 msg_print(_("奇妙な光景が目の前で踊っている...", "Weird visions seem to dance before your eyes..."));
1913- set_image(p_ptr->image + 5 + randint1(10));
1913+ set_image(p_ptr, p_ptr->image + 5 + randint1(10));
19141914 }
19151915 else if (b < 45)
19161916 {
@@ -1944,7 +1944,7 @@ void do_cmd_mind(void)
19441944 else if (b < 96)
19451945 {
19461946 msg_print(_("まわりのものがキラキラ輝いている!", "Your brain is addled!"));
1947- set_image(p_ptr->image + 5 + randint1(10));
1947+ set_image(p_ptr, p_ptr->image + 5 + randint1(10));
19481948 }
19491949 else
19501950 {
--- a/src/player-effects.c
+++ b/src/player-effects.c
@@ -725,27 +725,26 @@ bool set_paralyzed(player_type *creature_ptr, TIME_EFFECT v)
725725 * @return ステータスに影響を及ぼす変化があった場合TRUEを返す。
726726 * @details Note that we must redraw the map when hallucination changes.
727727 */
728-bool set_image(TIME_EFFECT v)
728+bool set_image(player_type *creature_ptr, TIME_EFFECT v)
729729 {
730730 bool notice = FALSE;
731731 v = (v > 10000) ? 10000 : (v < 0) ? 0 : v;
732732
733- if (p_ptr->is_dead) return FALSE;
734- if (p_ptr->pseikaku == SEIKAKU_CHARGEMAN) v = 0;
735-
733+ if (creature_ptr->is_dead) return FALSE;
734+ if (creature_ptr->pseikaku == SEIKAKU_CHARGEMAN) v = 0;
736735
737736 /* Open */
738737 if (v)
739738 {
740739 set_tsuyoshi(0, TRUE);
741- if (!p_ptr->image)
740+ if (!creature_ptr->image)
742741 {
743742 msg_print(_("ワーオ!何もかも虹色に見える!", "Oh, wow! Everything looks so cosmic now!"));
744743
745744 /* Sniper */
746- if (p_ptr->concent) reset_concentration(TRUE);
745+ if (creature_ptr->concent) reset_concentration(TRUE);
747746
748- p_ptr->counter = FALSE;
747+ creature_ptr->counter = FALSE;
749748 notice = TRUE;
750749 }
751750 }
@@ -753,7 +752,7 @@ bool set_image(TIME_EFFECT v)
753752 /* Shut */
754753 else
755754 {
756- if (p_ptr->image)
755+ if (creature_ptr->image)
757756 {
758757 msg_print(_("やっとはっきりと物が見えるようになった。", "You can see clearly again."));
759758 notice = TRUE;
@@ -761,17 +760,17 @@ bool set_image(TIME_EFFECT v)
761760 }
762761
763762 /* Use the value */
764- p_ptr->image = v;
765- p_ptr->redraw |= (PR_STATUS);
763+ creature_ptr->image = v;
764+ creature_ptr->redraw |= (PR_STATUS);
766765
767766 /* Nothing to notice */
768767 if (!notice) return (FALSE);
769768
770769 if (disturb_state) disturb(FALSE, TRUE);
771770
772- p_ptr->redraw |= (PR_MAP | PR_HEALTH | PR_UHEALTH);
773- p_ptr->update |= (PU_MONSTERS);
774- p_ptr->window |= (PW_OVERHEAD | PW_DUNGEON);
771+ creature_ptr->redraw |= (PR_MAP | PR_HEALTH | PR_UHEALTH);
772+ creature_ptr->update |= (PU_MONSTERS);
773+ creature_ptr->window |= (PW_OVERHEAD | PW_DUNGEON);
775774 handle_stuff();
776775 return (TRUE);
777776 }
--- a/src/player-effects.h
+++ b/src/player-effects.h
@@ -20,7 +20,7 @@ extern bool set_confused(player_type *creature_ptr, TIME_EFFECT v);
2020 extern bool set_poisoned(player_type *creature_ptr, TIME_EFFECT v);
2121 extern bool set_afraid(player_type *creature_ptr, TIME_EFFECT v);
2222 extern bool set_paralyzed(player_type *creature_ptr, TIME_EFFECT v);
23-extern bool set_image(TIME_EFFECT v);
23+extern bool set_image(player_type *creature_ptr, TIME_EFFECT v);
2424 extern bool set_fast(TIME_EFFECT v, bool do_dec);
2525 extern bool set_slow(TIME_EFFECT v, bool do_dec);
2626 extern bool set_shield(TIME_EFFECT v, bool do_dec);
--- a/src/player-status.c
+++ b/src/player-status.c
@@ -5455,7 +5455,7 @@ void sanity_blast(monster_type *m_ptr, bool necro)
54555455 }
54565456 if (!p_ptr->resist_chaos)
54575457 {
5458- (void)set_image(p_ptr->image + randint0(250) + 150);
5458+ (void)set_image(p_ptr, p_ptr->image + randint0(250) + 150);
54595459 }
54605460 break;
54615461 case 17:
--- a/src/spells-status.c
+++ b/src/spells-status.c
@@ -280,7 +280,7 @@ bool_hack life_stream(bool_hack message, bool_hack virtue_change)
280280 (void)set_poisoned(p_ptr, 0);
281281 (void)set_blind(p_ptr, 0);
282282 (void)set_confused(p_ptr, 0);
283- (void)set_image(0);
283+ (void)set_image(p_ptr, 0);
284284 (void)set_stun(0);
285285 (void)set_cut(0);
286286 (void)restore_all_status();
@@ -352,7 +352,7 @@ bool_hack true_healing(HIT_POINT pow)
352352 if (set_poisoned(p_ptr, 0)) ident = TRUE;
353353 if (set_stun(0)) ident = TRUE;
354354 if (set_cut(0)) ident = TRUE;
355- if (set_image(0)) ident = TRUE;
355+ if (set_image(p_ptr, 0)) ident = TRUE;
356356 return ident;
357357 }
358358
--- a/src/spells1.c
+++ b/src/spells1.c
@@ -4338,7 +4338,7 @@ static bool project_p(MONSTER_IDX who, concptr who_name, int r, POSITION y, POSI
43384338 }
43394339 if (!p_ptr->resist_chaos)
43404340 {
4341- (void)set_image(p_ptr->image + randint1(10));
4341+ (void)set_image(p_ptr, p_ptr->image + randint1(10));
43424342 if (one_in_(3))
43434343 {
43444344 msg_print(_("あなたの身体はカオスの力で捻じ曲げられた!", "Your body is twisted by chaos!"));
@@ -4881,7 +4881,7 @@ static bool project_p(MONSTER_IDX who, concptr who_name, int r, POSITION y, POSI
48814881
48824882 if (!p_ptr->resist_chaos && one_in_(3))
48834883 {
4884- (void)set_image(p_ptr->image + randint0(250) + 150);
4884+ (void)set_image(p_ptr, p_ptr->image + randint0(250) + 150);
48854885 }
48864886
48874887 p_ptr->csp -= 50;
@@ -4945,7 +4945,7 @@ static bool project_p(MONSTER_IDX who, concptr who_name, int r, POSITION y, POSI
49454945
49464946 if (!p_ptr->resist_chaos)
49474947 {
4948- (void)set_image(p_ptr->image + randint0(250) + 150);
4948+ (void)set_image(p_ptr, p_ptr->image + randint0(250) + 150);
49494949 }
49504950 }
49514951 }
--- a/src/spells3.c
+++ b/src/spells3.c
@@ -3444,7 +3444,7 @@ bool booze(player_type *creature_ptr)
34443444 {
34453445 if (one_in_(2))
34463446 {
3447- if (set_image(creature_ptr->image + randint0(150) + 150))
3447+ if (set_image(p_ptr, creature_ptr->image + randint0(150) + 150))
34483448 {
34493449 ident = TRUE;
34503450 }
Show on old repository browser