変愚蛮怒のメインリポジトリです
Revision | e7c82e743ca3857938b12bf31ed2bf8fc0efb2dc (tree) |
---|---|
Time | 2019-06-22 10:47:41 |
Author | deskull <deskull@user...> |
Commiter | deskull |
[Refactor] #38997 set_image() に player_type * 引数を追加.
@@ -118,7 +118,7 @@ void exe_eat_food(INVENTORY_IDX item) | ||
118 | 118 | { |
119 | 119 | if (!p_ptr->resist_chaos) |
120 | 120 | { |
121 | - if (set_image(p_ptr->image + randint0(250) + 250)) | |
121 | + if (set_image(p_ptr, p_ptr->image + randint0(250) + 250)) | |
122 | 122 | { |
123 | 123 | ident = TRUE; |
124 | 124 | } |
@@ -475,7 +475,7 @@ void exe_quaff_potion(INVENTORY_IDX item) | ||
475 | 475 | break; |
476 | 476 | |
477 | 477 | case SV_POTION_NEO_TSUYOSHI: |
478 | - (void)set_image(0); | |
478 | + (void)set_image(p_ptr, 0); | |
479 | 479 | (void)set_tsuyoshi(p_ptr->tsuyoshi + randint1(100) + 100, FALSE); |
480 | 480 | ident = TRUE; |
481 | 481 | break; |
@@ -487,7 +487,7 @@ void exe_quaff_potion(INVENTORY_IDX item) | ||
487 | 487 | (void)set_tsuyoshi(0, TRUE); |
488 | 488 | if (!p_ptr->resist_chaos) |
489 | 489 | { |
490 | - (void)set_image(50 + randint1(50)); | |
490 | + (void)set_image(p_ptr, 50 + randint1(50)); | |
491 | 491 | } |
492 | 492 | ident = TRUE; |
493 | 493 | break; |
@@ -706,7 +706,7 @@ static bool pattern_effect(void) | ||
706 | 706 | switch (pattern_type) |
707 | 707 | { |
708 | 708 | case PATTERN_TILE_END: |
709 | - (void)set_image(0); | |
709 | + (void)set_image(p_ptr, 0); | |
710 | 710 | (void)restore_all_status(); |
711 | 711 | (void)restore_level(); |
712 | 712 | (void)cure_critical_wounds(1000); |
@@ -1816,7 +1816,7 @@ static void process_world_aux_timeout(void) | ||
1816 | 1816 | /* Hack -- Hallucinating */ |
1817 | 1817 | if (p_ptr->image) |
1818 | 1818 | { |
1819 | - (void)set_image(p_ptr->image - dec_count); | |
1819 | + (void)set_image(p_ptr, p_ptr->image - dec_count); | |
1820 | 1820 | } |
1821 | 1821 | |
1822 | 1822 | /* Blindness */ |
@@ -2216,7 +2216,7 @@ static void process_world_aux_mutation(void) | ||
2216 | 2216 | if (one_in_(3)) |
2217 | 2217 | { |
2218 | 2218 | 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); | |
2220 | 2220 | } |
2221 | 2221 | } |
2222 | 2222 | } |
@@ -2228,7 +2228,7 @@ static void process_world_aux_mutation(void) | ||
2228 | 2228 | { |
2229 | 2229 | disturb(FALSE, TRUE); |
2230 | 2230 | 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); | |
2232 | 2232 | } |
2233 | 2233 | } |
2234 | 2234 |
@@ -1910,7 +1910,7 @@ void do_cmd_mind(void) | ||
1910 | 1910 | else if (b < 15) |
1911 | 1911 | { |
1912 | 1912 | 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)); | |
1914 | 1914 | } |
1915 | 1915 | else if (b < 45) |
1916 | 1916 | { |
@@ -1944,7 +1944,7 @@ void do_cmd_mind(void) | ||
1944 | 1944 | else if (b < 96) |
1945 | 1945 | { |
1946 | 1946 | 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)); | |
1948 | 1948 | } |
1949 | 1949 | else |
1950 | 1950 | { |
@@ -725,27 +725,26 @@ bool set_paralyzed(player_type *creature_ptr, TIME_EFFECT v) | ||
725 | 725 | * @return ステータスに影響を及ぼす変化があった場合TRUEを返す。 |
726 | 726 | * @details Note that we must redraw the map when hallucination changes. |
727 | 727 | */ |
728 | -bool set_image(TIME_EFFECT v) | |
728 | +bool set_image(player_type *creature_ptr, TIME_EFFECT v) | |
729 | 729 | { |
730 | 730 | bool notice = FALSE; |
731 | 731 | v = (v > 10000) ? 10000 : (v < 0) ? 0 : v; |
732 | 732 | |
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; | |
736 | 735 | |
737 | 736 | /* Open */ |
738 | 737 | if (v) |
739 | 738 | { |
740 | 739 | set_tsuyoshi(0, TRUE); |
741 | - if (!p_ptr->image) | |
740 | + if (!creature_ptr->image) | |
742 | 741 | { |
743 | 742 | msg_print(_("ワーオ!何もかも虹色に見える!", "Oh, wow! Everything looks so cosmic now!")); |
744 | 743 | |
745 | 744 | /* Sniper */ |
746 | - if (p_ptr->concent) reset_concentration(TRUE); | |
745 | + if (creature_ptr->concent) reset_concentration(TRUE); | |
747 | 746 | |
748 | - p_ptr->counter = FALSE; | |
747 | + creature_ptr->counter = FALSE; | |
749 | 748 | notice = TRUE; |
750 | 749 | } |
751 | 750 | } |
@@ -753,7 +752,7 @@ bool set_image(TIME_EFFECT v) | ||
753 | 752 | /* Shut */ |
754 | 753 | else |
755 | 754 | { |
756 | - if (p_ptr->image) | |
755 | + if (creature_ptr->image) | |
757 | 756 | { |
758 | 757 | msg_print(_("やっとはっきりと物が見えるようになった。", "You can see clearly again.")); |
759 | 758 | notice = TRUE; |
@@ -761,17 +760,17 @@ bool set_image(TIME_EFFECT v) | ||
761 | 760 | } |
762 | 761 | |
763 | 762 | /* 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); | |
766 | 765 | |
767 | 766 | /* Nothing to notice */ |
768 | 767 | if (!notice) return (FALSE); |
769 | 768 | |
770 | 769 | if (disturb_state) disturb(FALSE, TRUE); |
771 | 770 | |
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); | |
775 | 774 | handle_stuff(); |
776 | 775 | return (TRUE); |
777 | 776 | } |
@@ -20,7 +20,7 @@ extern bool set_confused(player_type *creature_ptr, TIME_EFFECT v); | ||
20 | 20 | extern bool set_poisoned(player_type *creature_ptr, TIME_EFFECT v); |
21 | 21 | extern bool set_afraid(player_type *creature_ptr, TIME_EFFECT v); |
22 | 22 | 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); | |
24 | 24 | extern bool set_fast(TIME_EFFECT v, bool do_dec); |
25 | 25 | extern bool set_slow(TIME_EFFECT v, bool do_dec); |
26 | 26 | extern bool set_shield(TIME_EFFECT v, bool do_dec); |
@@ -5455,7 +5455,7 @@ void sanity_blast(monster_type *m_ptr, bool necro) | ||
5455 | 5455 | } |
5456 | 5456 | if (!p_ptr->resist_chaos) |
5457 | 5457 | { |
5458 | - (void)set_image(p_ptr->image + randint0(250) + 150); | |
5458 | + (void)set_image(p_ptr, p_ptr->image + randint0(250) + 150); | |
5459 | 5459 | } |
5460 | 5460 | break; |
5461 | 5461 | case 17: |
@@ -280,7 +280,7 @@ bool_hack life_stream(bool_hack message, bool_hack virtue_change) | ||
280 | 280 | (void)set_poisoned(p_ptr, 0); |
281 | 281 | (void)set_blind(p_ptr, 0); |
282 | 282 | (void)set_confused(p_ptr, 0); |
283 | - (void)set_image(0); | |
283 | + (void)set_image(p_ptr, 0); | |
284 | 284 | (void)set_stun(0); |
285 | 285 | (void)set_cut(0); |
286 | 286 | (void)restore_all_status(); |
@@ -352,7 +352,7 @@ bool_hack true_healing(HIT_POINT pow) | ||
352 | 352 | if (set_poisoned(p_ptr, 0)) ident = TRUE; |
353 | 353 | if (set_stun(0)) ident = TRUE; |
354 | 354 | if (set_cut(0)) ident = TRUE; |
355 | - if (set_image(0)) ident = TRUE; | |
355 | + if (set_image(p_ptr, 0)) ident = TRUE; | |
356 | 356 | return ident; |
357 | 357 | } |
358 | 358 |
@@ -4338,7 +4338,7 @@ static bool project_p(MONSTER_IDX who, concptr who_name, int r, POSITION y, POSI | ||
4338 | 4338 | } |
4339 | 4339 | if (!p_ptr->resist_chaos) |
4340 | 4340 | { |
4341 | - (void)set_image(p_ptr->image + randint1(10)); | |
4341 | + (void)set_image(p_ptr, p_ptr->image + randint1(10)); | |
4342 | 4342 | if (one_in_(3)) |
4343 | 4343 | { |
4344 | 4344 | 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 | ||
4881 | 4881 | |
4882 | 4882 | if (!p_ptr->resist_chaos && one_in_(3)) |
4883 | 4883 | { |
4884 | - (void)set_image(p_ptr->image + randint0(250) + 150); | |
4884 | + (void)set_image(p_ptr, p_ptr->image + randint0(250) + 150); | |
4885 | 4885 | } |
4886 | 4886 | |
4887 | 4887 | p_ptr->csp -= 50; |
@@ -4945,7 +4945,7 @@ static bool project_p(MONSTER_IDX who, concptr who_name, int r, POSITION y, POSI | ||
4945 | 4945 | |
4946 | 4946 | if (!p_ptr->resist_chaos) |
4947 | 4947 | { |
4948 | - (void)set_image(p_ptr->image + randint0(250) + 150); | |
4948 | + (void)set_image(p_ptr, p_ptr->image + randint0(250) + 150); | |
4949 | 4949 | } |
4950 | 4950 | } |
4951 | 4951 | } |
@@ -3444,7 +3444,7 @@ bool booze(player_type *creature_ptr) | ||
3444 | 3444 | { |
3445 | 3445 | if (one_in_(2)) |
3446 | 3446 | { |
3447 | - if (set_image(creature_ptr->image + randint0(150) + 150)) | |
3447 | + if (set_image(p_ptr, creature_ptr->image + randint0(150) + 150)) | |
3448 | 3448 | { |
3449 | 3449 | ident = TRUE; |
3450 | 3450 | } |