• R/O
  • HTTP
  • SSH
  • HTTPS

hengband: Commit

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


Commit MetaInfo

Revisionefcc8bc74d33bd6b032d6e20c0a3685453da9c54 (tree)
Time2019-06-21 23:48:03
Authordeskull <deskull@user...>
Commiterdeskull

Log Message

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

Change Summary

Incremental Difference

--- a/src/cmd-activate.c
+++ b/src/cmd-activate.c
@@ -1034,7 +1034,7 @@ bool activate_artifact(object_type *o_ptr)
10341034 msg_print(_("あなたはエレメントのブレスを吐いた。", "You breathe the elements."));
10351035 fire_breath(GF_MISSILE, dir, 300, 4);
10361036 msg_print(_("鎧が様々な色に輝いた...", "Your armor glows many colours..."));
1037- (void)set_afraid(0);
1037+ (void)set_afraid(p_ptr, 0);
10381038 (void)set_hero(randint1(50) + 50, FALSE);
10391039 (void)hp_player(p_ptr, 10);
10401040 (void)set_blessed(randint1(50) + 50, FALSE);
@@ -1245,7 +1245,7 @@ bool activate_artifact(object_type *o_ptr)
12451245
12461246 case ACT_CURE_LW:
12471247 {
1248- (void)set_afraid(0);
1248+ (void)set_afraid(p_ptr, 0);
12491249 (void)hp_player(p_ptr, 30);
12501250 break;
12511251 }
@@ -1260,7 +1260,7 @@ bool activate_artifact(object_type *o_ptr)
12601260 case ACT_CURE_POISON:
12611261 {
12621262 msg_print(_("深青色に輝いている...", "It glows deep blue..."));
1263- (void)set_afraid(0);
1263+ (void)set_afraid(p_ptr, 0);
12641264 (void)set_poisoned(p_ptr, 0);
12651265 break;
12661266 }
@@ -1662,7 +1662,7 @@ bool activate_artifact(object_type *o_ptr)
16621662 case ACT_SHIKOFUMI:
16631663 {
16641664 msg_print(_("力強く四股を踏んだ。", "You stamp. (as if you are in a ring.)"));
1665- (void)set_afraid(0);
1665+ (void)set_afraid(p_ptr, 0);
16661666 (void)set_hero(randint1(20) + 20, FALSE);
16671667 dispel_evil(p_ptr->lev * 3);
16681668 break;
@@ -1684,7 +1684,7 @@ bool activate_artifact(object_type *o_ptr)
16841684 case ACT_ULTIMATE_RESIST:
16851685 {
16861686 TIME_EFFECT v = randint1(25) + 25;
1687- (void)set_afraid(0);
1687+ (void)set_afraid(p_ptr, 0);
16881688 (void)set_hero(v, FALSE);
16891689 (void)hp_player(p_ptr, 10);
16901690 (void)set_blessed(v, FALSE);
--- a/src/cmd-eat.c
+++ b/src/cmd-eat.c
@@ -94,7 +94,7 @@ void exe_eat_food(INVENTORY_IDX item)
9494 {
9595 if (!p_ptr->resist_fear)
9696 {
97- if (set_afraid(p_ptr->afraid + randint0(10) + 10))
97+ if (set_afraid(p_ptr, p_ptr->afraid + randint0(10) + 10))
9898 {
9999 ident = TRUE;
100100 }
@@ -200,7 +200,7 @@ void exe_eat_food(INVENTORY_IDX item)
200200
201201 case SV_FOOD_CURE_PARANOIA:
202202 {
203- if (set_afraid(0)) ident = TRUE;
203+ if (set_afraid(p_ptr, 0)) ident = TRUE;
204204 break;
205205 }
206206
--- a/src/cmd-quaff.c
+++ b/src/cmd-quaff.c
@@ -276,7 +276,7 @@ void exe_quaff_potion(INVENTORY_IDX item)
276276 break;
277277
278278 case SV_POTION_BOLDNESS:
279- if (set_afraid(0)) ident = TRUE;
279+ if (set_afraid(p_ptr, 0)) ident = TRUE;
280280 break;
281281
282282 case SV_POTION_SPEED:
--- a/src/core.c
+++ b/src/core.c
@@ -1965,7 +1965,7 @@ static void process_world_aux_timeout(void)
19651965 /* Afraid */
19661966 if (p_ptr->afraid)
19671967 {
1968- (void)set_afraid(p_ptr->afraid - dec_count);
1968+ (void)set_afraid(p_ptr, p_ptr->afraid - dec_count);
19691969 }
19701970
19711971 /* Fast */
@@ -2161,7 +2161,7 @@ static void process_world_aux_mutation(void)
21612161 msg_print(_("ウガァァア!", "RAAAAGHH!"));
21622162 msg_print(_("激怒の発作に襲われた!", "You feel a fit of rage coming over you!"));
21632163 (void)set_shero(10 + randint1(p_ptr->lev), FALSE);
2164- (void)set_afraid(0);
2164+ (void)set_afraid(p_ptr, 0);
21652165 }
21662166
21672167 if ((p_ptr->muta2 & MUT2_COWARDICE) && (randint1(3000) == 13))
@@ -2170,7 +2170,7 @@ static void process_world_aux_mutation(void)
21702170 {
21712171 disturb(FALSE, TRUE);
21722172 msg_print(_("とても暗い... とても恐い!", "It's so dark... so scary!"));
2173- set_afraid(p_ptr->afraid + 13 + randint1(26));
2173+ set_afraid(p_ptr, p_ptr->afraid + 13 + randint1(26));
21742174 }
21752175 }
21762176
@@ -2765,7 +2765,7 @@ static void process_world_aux_curse(void)
27652765 {
27662766 disturb(FALSE, TRUE);
27672767 msg_print(_("とても暗い... とても恐い!", "It's so dark... so scary!"));
2768- set_afraid(p_ptr->afraid + 13 + randint1(26));
2768+ set_afraid(p_ptr, p_ptr->afraid + 13 + randint1(26));
27692769 }
27702770 }
27712771 /* Teleport player */
--- a/src/melee1.c
+++ b/src/melee1.c
@@ -3241,7 +3241,7 @@ bool make_attack_normal(MONSTER_IDX m_idx)
32413241 }
32423242 else
32433243 {
3244- if (set_afraid(p_ptr->afraid + 3 + randint1(rlev)))
3244+ if (set_afraid(p_ptr, p_ptr->afraid + 3 + randint1(rlev)))
32453245 {
32463246 obvious = TRUE;
32473247 }
--- a/src/mind.c
+++ b/src/mind.c
@@ -1131,7 +1131,7 @@ static bool cast_mindcrafter_spell(int spell)
11311131 break;
11321132 case 9:
11331133 /* Adrenaline */
1134- set_afraid(0);
1134+ set_afraid(p_ptr, 0);
11351135 set_stun(0);
11361136
11371137 /*
--- a/src/mspells4.c
+++ b/src/mspells4.c
@@ -1455,7 +1455,7 @@ void spell_RF5_SCARE(MONSTER_IDX m_idx, MONSTER_IDX t_idx, int TARGET_TYPE)
14551455
14561456 if (!resist && !saving_throw)
14571457 {
1458- (void)set_afraid(p_ptr->afraid + randint0(4) + 4);
1458+ (void)set_afraid(p_ptr, p_ptr->afraid + randint0(4) + 4);
14591459 }
14601460 learn_spell(MS_SCARE);
14611461 update_smart_learn(m_idx, DRS_FEAR);
--- a/src/player-effects.c
+++ b/src/player-effects.c
@@ -614,33 +614,33 @@ bool set_poisoned(player_type *creature_ptr, TIME_EFFECT v)
614614 * @param v 継続時間
615615 * @return ステータスに影響を及ぼす変化があった場合TRUEを返す。
616616 */
617-bool set_afraid(TIME_EFFECT v)
617+bool set_afraid(player_type *creature_ptr, TIME_EFFECT v)
618618 {
619619 bool notice = FALSE;
620620 v = (v > 10000) ? 10000 : (v < 0) ? 0 : v;
621621
622- if (p_ptr->is_dead) return FALSE;
622+ if (creature_ptr->is_dead) return FALSE;
623623
624624 /* Open */
625625 if (v)
626626 {
627- if (!p_ptr->afraid)
627+ if (!creature_ptr->afraid)
628628 {
629629 msg_print(_("何もかも恐くなってきた!", "You are terrified!"));
630630
631- if (p_ptr->special_defense & KATA_MASK)
631+ if (creature_ptr->special_defense & KATA_MASK)
632632 {
633633 msg_print(_("型が崩れた。", "Your posture gets loose."));
634- p_ptr->special_defense &= ~(KATA_MASK);
635- p_ptr->update |= (PU_BONUS);
636- p_ptr->update |= (PU_MONSTERS);
637- p_ptr->redraw |= (PR_STATE);
638- p_ptr->redraw |= (PR_STATUS);
639- p_ptr->action = ACTION_NONE;
634+ creature_ptr->special_defense &= ~(KATA_MASK);
635+ creature_ptr->update |= (PU_BONUS);
636+ creature_ptr->update |= (PU_MONSTERS);
637+ creature_ptr->redraw |= (PR_STATE);
638+ creature_ptr->redraw |= (PR_STATUS);
639+ creature_ptr->action = ACTION_NONE;
640640 }
641641
642642 notice = TRUE;
643- p_ptr->counter = FALSE;
643+ creature_ptr->counter = FALSE;
644644 chg_virtue(V_VALOUR, -1);
645645 }
646646 }
@@ -648,7 +648,7 @@ bool set_afraid(TIME_EFFECT v)
648648 /* Shut */
649649 else
650650 {
651- if (p_ptr->afraid)
651+ if (creature_ptr->afraid)
652652 {
653653 msg_print(_("やっと恐怖を振り払った。", "You feel bolder now."));
654654 notice = TRUE;
@@ -656,8 +656,8 @@ bool set_afraid(TIME_EFFECT v)
656656 }
657657
658658 /* Use the value */
659- p_ptr->afraid = v;
660- p_ptr->redraw |= (PR_STATUS);
659+ creature_ptr->afraid = v;
660+ creature_ptr->redraw |= (PR_STATUS);
661661
662662 /* Nothing to notice */
663663 if (!notice) return (FALSE);
--- a/src/player-effects.h
+++ b/src/player-effects.h
@@ -18,7 +18,7 @@ extern bool set_mimic(player_type *creature_ptr, TIME_EFFECT v, IDX p, bool do_d
1818 extern bool set_blind(player_type *creature_ptr, TIME_EFFECT v);
1919 extern bool set_confused(player_type *creature_ptr, TIME_EFFECT v);
2020 extern bool set_poisoned(player_type *creature_ptr, TIME_EFFECT v);
21-extern bool set_afraid(TIME_EFFECT v);
21+extern bool set_afraid(player_type *creature_ptr, TIME_EFFECT v);
2222 extern bool set_paralyzed(TIME_EFFECT v);
2323 extern bool set_image(TIME_EFFECT v);
2424 extern bool set_fast(TIME_EFFECT v, bool do_dec);
--- a/src/racial.c
+++ b/src/racial.c
@@ -665,7 +665,7 @@ static bool cmd_racial_power_aux(s32b command)
665665
666666 case RACE_HALF_ORC:
667667 msg_print(_("勇気を出した。", "You play tough."));
668- (void)set_afraid(0);
668+ (void)set_afraid(p_ptr, 0);
669669 break;
670670
671671 case RACE_HALF_TROLL:
--- a/src/realm-crusade.c
+++ b/src/realm-crusade.c
@@ -65,7 +65,7 @@ concptr do_crusade_spell(SPELL_IDX spell, BIT_FLAGS mode)
6565 if (name) return _("恐怖除去", "Remove Fear");
6666 if (desc) return _("恐怖を取り除く。", "Removes fear.");
6767 {
68- if (cast) set_afraid(0);
68+ if (cast) set_afraid(p_ptr, 0);
6969 }
7070 break;
7171
@@ -267,7 +267,7 @@ concptr do_crusade_spell(SPELL_IDX spell, BIT_FLAGS mode)
267267 {
268268 dispel_evil(randint1(dam_sides));
269269 hp_player(p_ptr, heal);
270- set_afraid(0);
270+ set_afraid(p_ptr, 0);
271271 set_poisoned(p_ptr, 0);
272272 set_stun(0);
273273 set_cut(0);
@@ -569,7 +569,7 @@ concptr do_crusade_spell(SPELL_IDX spell, BIT_FLAGS mode)
569569 set_blessed(randint1(base) + base, FALSE);
570570 set_fast(randint1(sp_sides) + sp_base, FALSE);
571571 set_protevil(randint1(base) + base, FALSE);
572- set_afraid(0);
572+ set_afraid(p_ptr, 0);
573573 }
574574 }
575575 break;
--- a/src/realm-daemon.c
+++ b/src/realm-daemon.c
@@ -346,7 +346,7 @@ concptr do_daemon_spell(SPELL_IDX spell, BIT_FLAGS mode)
346346 set_oppose_fire(dur, FALSE);
347347 set_oppose_cold(dur, FALSE);
348348 set_tim_sh_fire(dur, FALSE);
349- set_afraid(0);
349+ set_afraid(p_ptr, 0);
350350 break;
351351 }
352352 }
--- a/src/realm-song.c
+++ b/src/realm-song.c
@@ -238,7 +238,7 @@ concptr do_music_spell(SPELL_IDX spell, BIT_FLAGS mode)
238238 msg_print(_("激しい戦いの歌を歌った...", "You start singing a song of intense fighting..."));
239239
240240 (void)hp_player(p_ptr, 10);
241- (void)set_afraid(0);
241+ (void)set_afraid(p_ptr, 0);
242242
243243 /* Recalculate hitpoints */
244244 p_ptr->update |= (PU_HP);
@@ -790,7 +790,7 @@ concptr do_music_spell(SPELL_IDX spell, BIT_FLAGS mode)
790790 {
791791 msg_print(_("英雄の歌を口ずさんだ...", "You chant a powerful, heroic call to arms..."));
792792 (void)hp_player(p_ptr, 10);
793- (void)set_afraid(0);
793+ (void)set_afraid(p_ptr, 0);
794794
795795 /* Recalculate hitpoints */
796796 p_ptr->update |= (PU_HP);
--- a/src/spells-status.c
+++ b/src/spells-status.c
@@ -294,7 +294,7 @@ bool_hack life_stream(bool_hack message, bool_hack virtue_change)
294294 bool_hack heroism(int base)
295295 {
296296 bool_hack ident = FALSE;
297- if (set_afraid(0)) ident = TRUE;
297+ if (set_afraid(p_ptr, 0)) ident = TRUE;
298298 if (set_hero(p_ptr->hero + randint1(base) + base, FALSE)) ident = TRUE;
299299 if (hp_player(p_ptr, 10)) ident = TRUE;
300300 return ident;
@@ -303,7 +303,7 @@ bool_hack heroism(int base)
303303 bool_hack berserk(int base)
304304 {
305305 bool_hack ident = FALSE;
306- if (set_afraid(0)) ident = TRUE;
306+ if (set_afraid(p_ptr, 0)) ident = TRUE;
307307 if (set_shero(p_ptr->shero + randint1(base) + base, FALSE)) ident = TRUE;
308308 if (hp_player(p_ptr, 30)) ident = TRUE;
309309 return ident;
@@ -460,7 +460,7 @@ bool cosmic_cast_off(player_type *creature_ptr, object_type *o_ptr)
460460 msg_print(_("「燃え上がれ俺の小宇宙!」", "You say, 'Burn up my cosmo!"));
461461 t = 20 + randint1(20);
462462 (void)set_blind(p_ptr, creature_ptr->blind + t);
463- (void)set_afraid(0);
463+ (void)set_afraid(p_ptr, 0);
464464 (void)set_tim_esp(creature_ptr->tim_esp + t, FALSE);
465465 (void)set_tim_regen(creature_ptr->tim_regen + t, FALSE);
466466 (void)set_hero(creature_ptr->hero + t, FALSE);
--- a/src/spells1.c
+++ b/src/spells1.c
@@ -1754,7 +1754,7 @@ static bool project_m(MONSTER_IDX who, POSITION r, POSITION y, POSITION x, HIT_P
17541754 if (r_ptr->flags3 & RF3_NO_FEAR)
17551755 note = _("には効果がなかった。", " is unaffected.");
17561756 else
1757- set_afraid(p_ptr->afraid + 3 + randint1(dam));
1757+ set_afraid(p_ptr, p_ptr->afraid + 3 + randint1(dam));
17581758 break;
17591759 }
17601760 default:
@@ -1949,7 +1949,7 @@ static bool project_m(MONSTER_IDX who, POSITION r, POSITION y, POSITION x, HIT_P
19491949 if (r_ptr->flags3 & RF3_NO_FEAR)
19501950 note = _("には効果がなかった。", " is unaffected.");
19511951 else
1952- set_afraid(p_ptr->afraid + dam);
1952+ set_afraid(p_ptr, p_ptr->afraid + dam);
19531953 }
19541954 }
19551955 }
--- a/src/spells2.c
+++ b/src/spells2.c
@@ -916,7 +916,7 @@ bool cleansing_nova(player_type *creature_ptr, bool magic, bool powerful)
916916 int k = 3 * creature_ptr->lev;
917917 if (set_protevil((magic ? 0 : creature_ptr->protevil) + randint1(25) + k, FALSE)) ident = TRUE;
918918 if (set_poisoned(p_ptr, 0)) ident = TRUE;
919- if (set_afraid(0)) ident = TRUE;
919+ if (set_afraid(p_ptr, 0)) ident = TRUE;
920920 if (hp_player(p_ptr, 50)) ident = TRUE;
921921 if (set_stun(0)) ident = TRUE;
922922 if (set_cut(0)) ident = TRUE;
@@ -3556,7 +3556,7 @@ void cast_invoke_spirits(DIRECTION dir)
35563556 {
35573557 msg_print(_("名状し難い邪悪な存在があなたの心を通り過ぎて行った...", "An unnamable evil brushes against your mind..."));
35583558
3559- set_afraid(p_ptr->afraid + randint1(4) + 4);
3559+ set_afraid(p_ptr, p_ptr->afraid + randint1(4) + 4);
35603560 }
35613561 else if (die < 26)
35623562 {
Show on old repository browser