• R/O
  • HTTP
  • SSH
  • HTTPS

hengband: Commit

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


Commit MetaInfo

Revision88e794b6b13d016be298826acc6ef69545ddfeb7 (tree)
Time2019-02-16 19:46:29
AuthorDeskull <deskull@user...>
CommiterDeskull

Log Message

[Refactor] #37353 stop_singing() の引数整理。 / Refactor arguments of stop_singing().

Change Summary

Incremental Difference

--- a/src/cmd-activate.c
+++ b/src/cmd-activate.c
@@ -452,7 +452,7 @@ void do_cmd_activate_aux(INVENTORY_IDX item)
452452 /* Special items */
453453 else if (o_ptr->tval == TV_WHISTLE)
454454 {
455- if (music_singing_any()) stop_singing();
455+ if (music_singing_any()) stop_singing(p_ptr);
456456 if (hex_spelling_any()) stop_hex_spell_all();
457457
458458 {
@@ -692,7 +692,7 @@ static bool activate_dragon_breath(object_type *o_ptr)
692692 if (n == 0) return FALSE;
693693
694694 /* Stop speaking */
695- if (music_singing_any()) stop_singing();
695+ if (music_singing_any()) stop_singing(p_ptr);
696696 if (hex_spelling_any()) stop_hex_spell_all();
697697
698698 t = randint0(n);
@@ -1144,7 +1144,7 @@ bool activate_artifact(object_type *o_ptr)
11441144
11451145 case ACT_SCARE_AREA:
11461146 {
1147- if (music_singing_any()) stop_singing();
1147+ if (music_singing_any()) stop_singing(p_ptr);
11481148 if (hex_spelling_any()) stop_hex_spell_all();
11491149 msg_print(_("あなたは力強い突風を吹き鳴らした。周囲の敵が震え上っている!",
11501150 "You wind a mighty blast; your enemies tremble!"));
--- a/src/cmd-eat.c
+++ b/src/cmd-eat.c
@@ -24,7 +24,7 @@ void do_cmd_eat_food_aux(INVENTORY_IDX item)
2424 int ident, lev;
2525 object_type *o_ptr;
2626
27- if (music_singing_any()) stop_singing();
27+ if (music_singing_any()) stop_singing(p_ptr);
2828 if (hex_spelling_any()) stop_hex_spell_all();
2929
3030 /* Get the item (in the pack) */
--- a/src/cmd-quaff.c
+++ b/src/cmd-quaff.c
@@ -38,7 +38,7 @@ void do_cmd_quaff_potion_aux(INVENTORY_IDX item)
3838 return;
3939 }
4040
41- if (music_singing_any()) stop_singing();
41+ if (music_singing_any()) stop_singing(p_ptr);
4242 if (hex_spelling_any())
4343 {
4444 if (!hex_spelling(HEX_INHAIL)) stop_hex_spell_all();
--- a/src/cmd-read.c
+++ b/src/cmd-read.c
@@ -58,7 +58,7 @@ void do_cmd_read_scroll_aux(INVENTORY_IDX item, bool known)
5858 return;
5959 }
6060
61- if (music_singing_any()) stop_singing();
61+ if (music_singing_any()) stop_singing(p_ptr);
6262
6363 /* Hex */
6464 if (hex_spelling_any() && ((p_ptr->lev < 35) || hex_spell_fully())) stop_hex_spell_all();
--- a/src/cmd2.c
+++ b/src/cmd2.c
@@ -2168,7 +2168,7 @@ void do_cmd_rest(void)
21682168
21692169 if ((p_ptr->pclass == CLASS_BARD) && (SINGING_SONG_EFFECT(p_ptr) || INTERUPTING_SONG_EFFECT(p_ptr)))
21702170 {
2171- stop_singing();
2171+ stop_singing(p_ptr);
21722172 }
21732173
21742174 /* Hex */
--- a/src/dungeon.c
+++ b/src/dungeon.c
@@ -1178,7 +1178,7 @@ static void check_music(void)
11781178
11791179 if (p_ptr->anti_magic)
11801180 {
1181- stop_singing();
1181+ stop_singing(p_ptr);
11821182 return;
11831183 }
11841184
@@ -1193,7 +1193,7 @@ static void check_music(void)
11931193
11941194 if (s64b_cmp(p_ptr->csp, p_ptr->csp_frac, need_mana, need_mana_frac) < 0)
11951195 {
1196- stop_singing();
1196+ stop_singing(p_ptr);
11971197 return;
11981198 }
11991199 else
@@ -2508,7 +2508,7 @@ static void process_world_aux_mutation(void)
25082508 msg_print(_("胃が痙攣し、食事を失った!", "Your stomach roils, and you lose your lunch!"));
25092509 msg_print(NULL);
25102510 set_food(PY_FOOD_WEAK);
2511- if (music_singing_any()) stop_singing();
2511+ if (music_singing_any()) stop_singing(p_ptr);
25122512 if (hex_spelling_any()) stop_hex_spell_all();
25132513 }
25142514
--- a/src/effects.c
+++ b/src/effects.c
@@ -92,7 +92,7 @@ void set_action(ACTION_IDX typ)
9292 p_ptr->action = typ;
9393
9494 /* If we are requested other action, stop singing */
95- if (prev_typ == ACTION_SING) stop_singing();
95+ if (prev_typ == ACTION_SING) stop_singing(p_ptr);
9696 if (prev_typ == ACTION_SPELL) stop_hex_spell();
9797
9898 switch (p_ptr->action)
--- a/src/racial.c
+++ b/src/racial.c
@@ -529,7 +529,7 @@ static bool cmd_racial_power_aux(s32b command)
529529 /* Singing is already stopped */
530530 if (!SINGING_SONG_EFFECT(p_ptr) && !INTERUPTING_SONG_EFFECT(p_ptr)) return FALSE;
531531
532- stop_singing();
532+ stop_singing(p_ptr);
533533 p_ptr->energy_use = 10;
534534 break;
535535 }
--- a/src/realm-song.c
+++ b/src/realm-song.c
@@ -51,7 +51,7 @@ concptr do_music_spell(SPELL_IDX spell, BIT_FLAGS mode)
5151 if (desc) return _("視界内の全てのモンスターを減速させる。抵抗されると無効。", "Attempts to slow all monsters in sight.");
5252
5353 /* Stop singing before start another */
54- if (cast || fail) stop_singing();
54+ if (cast || fail) stop_singing(p_ptr);
5555
5656 if (cast)
5757 {
@@ -76,7 +76,7 @@ concptr do_music_spell(SPELL_IDX spell, BIT_FLAGS mode)
7676 if (desc) return _("命中率とACのボーナスを得る。", "Gives bonus to hit and AC for a few turns.");
7777
7878 /* Stop singing before start another */
79- if (cast || fail) stop_singing();
79+ if (cast || fail) stop_singing(p_ptr);
8080
8181 if (cast)
8282 {
@@ -99,7 +99,7 @@ concptr do_music_spell(SPELL_IDX spell, BIT_FLAGS mode)
9999 if (desc) return _("轟音のボルトを放つ。", "Fires a bolt of sound.");
100100
101101 /* Stop singing before start another */
102- if (cast || fail) stop_singing();
102+ if (cast || fail) stop_singing(p_ptr);
103103
104104 {
105105 DICE_NUMBER dice = 4 + (plev - 1) / 5;
@@ -121,7 +121,7 @@ concptr do_music_spell(SPELL_IDX spell, BIT_FLAGS mode)
121121 if (desc) return _("視界内の全てのモンスターを朦朧させる。抵抗されると無効。", "Attempts to stun all monsters in sight.");
122122
123123 /* Stop singing before start another */
124- if (cast || fail) stop_singing();
124+ if (cast || fail) stop_singing(p_ptr);
125125
126126 if (cast)
127127 {
@@ -148,7 +148,7 @@ concptr do_music_spell(SPELL_IDX spell, BIT_FLAGS mode)
148148 if (desc) return _("体力を少し回復させる。", "Heals HP a little.");
149149
150150 /* Stop singing before start another */
151- if (cast || fail) stop_singing();
151+ if (cast || fail) stop_singing(p_ptr);
152152
153153 if (cast)
154154 {
@@ -175,7 +175,7 @@ concptr do_music_spell(SPELL_IDX spell, BIT_FLAGS mode)
175175 if (desc) return _("光源が照らしている範囲か部屋全体を永久に明るくする。", "Lights up nearby area and the inside of a room permanently.");
176176
177177 /* Stop singing before start another */
178- if (cast || fail) stop_singing();
178+ if (cast || fail) stop_singing(p_ptr);
179179
180180 {
181181 DICE_NUMBER dice = 2;
@@ -197,7 +197,7 @@ concptr do_music_spell(SPELL_IDX spell, BIT_FLAGS mode)
197197 if (desc) return _("視界内の全てのモンスターを恐怖させる。抵抗されると無効。", "Attempts to scare all monsters in sight.");
198198
199199 /* Stop singing before start another */
200- if (cast || fail) stop_singing();
200+ if (cast || fail) stop_singing(p_ptr);
201201
202202 if (cast)
203203 {
@@ -223,7 +223,7 @@ concptr do_music_spell(SPELL_IDX spell, BIT_FLAGS mode)
223223 if (desc) return _("ヒーロー気分になる。", "Removes fear, and gives bonus to hit and 10 more HP for a while.");
224224
225225 /* Stop singing before start another */
226- if (cast || fail) stop_singing();
226+ if (cast || fail) stop_singing(p_ptr);
227227
228228 if (cast)
229229 {
@@ -256,7 +256,7 @@ concptr do_music_spell(SPELL_IDX spell, BIT_FLAGS mode)
256256 "Detects traps, doors and stairs in your vicinity. And detects all monsters at level 15, treasures and items at level 20. Maps nearby area at level 25. Lights and know the whole level at level 40. These effects occurs by turns while this song continues.");
257257
258258 /* Stop singing before start another */
259- if (cast || fail) stop_singing();
259+ if (cast || fail) stop_singing(p_ptr);
260260
261261 if (cast)
262262 {
@@ -316,7 +316,7 @@ concptr do_music_spell(SPELL_IDX spell, BIT_FLAGS mode)
316316 if (desc) return _("視界内の全てのモンスターに対して精神攻撃を行う。", "Damages all monsters in sight with PSI damages.");
317317
318318 /* Stop singing before start another */
319- if (cast || fail) stop_singing();
319+ if (cast || fail) stop_singing(p_ptr);
320320
321321 if (cast)
322322 {
@@ -343,7 +343,7 @@ concptr do_music_spell(SPELL_IDX spell, BIT_FLAGS mode)
343343 if (desc) return _("自分のいるマスと隣りのマスに落ちているアイテムを鑑定する。", "Identifies all items which are in the adjacent squares.");
344344
345345 /* Stop singing before start another */
346- if (cast || fail) stop_singing();
346+ if (cast || fail) stop_singing(p_ptr);
347347
348348 if (cast)
349349 {
@@ -373,7 +373,7 @@ concptr do_music_spell(SPELL_IDX spell, BIT_FLAGS mode)
373373 if (desc) return _("隠密行動能力を上昇させる。", "Gives improved stealth.");
374374
375375 /* Stop singing before start another */
376- if (cast || fail) stop_singing();
376+ if (cast || fail) stop_singing(p_ptr);
377377
378378 if (cast)
379379 {
@@ -396,7 +396,7 @@ concptr do_music_spell(SPELL_IDX spell, BIT_FLAGS mode)
396396 if (desc) return _("視界内の全てのモンスターを混乱させる。抵抗されると無効。", "Attempts to confuse all monsters in sight.");
397397
398398 /* Stop singing before start another */
399- if (cast || fail) stop_singing();
399+ if (cast || fail) stop_singing(p_ptr);
400400
401401 if (cast)
402402 {
@@ -422,7 +422,7 @@ concptr do_music_spell(SPELL_IDX spell, BIT_FLAGS mode)
422422 if (desc) return _("視界内の全てのモンスターに対して轟音攻撃を行う。", "Damages all monsters in sight with booming sound.");
423423
424424 /* Stop singing before start another */
425- if (cast || fail) stop_singing();
425+ if (cast || fail) stop_singing(p_ptr);
426426
427427 if (cast)
428428 {
@@ -450,7 +450,7 @@ concptr do_music_spell(SPELL_IDX spell, BIT_FLAGS mode)
450450
451451 {
452452 /* Stop singing before start another */
453- if (cast || fail) stop_singing();
453+ if (cast || fail) stop_singing(p_ptr);
454454
455455 if (cast)
456456 {
@@ -465,7 +465,7 @@ concptr do_music_spell(SPELL_IDX spell, BIT_FLAGS mode)
465465 if (desc) return _("視界内の全てのモンスターを魅了する。抵抗されると無効。", "Attempts to charm all monsters in sight.");
466466
467467 /* Stop singing before start another */
468- if (cast || fail) stop_singing();
468+ if (cast || fail) stop_singing(p_ptr);
469469
470470 if (cast)
471471 {
@@ -492,7 +492,7 @@ concptr do_music_spell(SPELL_IDX spell, BIT_FLAGS mode)
492492 if (desc) return _("壁を掘り進む。自分の足元のアイテムは蒸発する。", "Makes you be able to burrow into walls. Objects under your feet evaporate.");
493493
494494 /* Stop singing before start another */
495- if (cast || fail) stop_singing();
495+ if (cast || fail) stop_singing(p_ptr);
496496
497497 if (cast)
498498 {
@@ -519,7 +519,7 @@ concptr do_music_spell(SPELL_IDX spell, BIT_FLAGS mode)
519519 "Gives resistance to fire, cold, electricity, acid and poison. These resistances can be added to which from equipment for more powerful resistances.");
520520
521521 /* Stop singing before start another */
522- if (cast || fail) stop_singing();
522+ if (cast || fail) stop_singing(p_ptr);
523523
524524 if (cast)
525525 {
@@ -562,7 +562,7 @@ concptr do_music_spell(SPELL_IDX spell, BIT_FLAGS mode)
562562 if (desc) return _("加速する。", "Hastes you.");
563563
564564 /* Stop singing before start another */
565- if (cast || fail) stop_singing();
565+ if (cast || fail) stop_singing(p_ptr);
566566
567567 if (cast)
568568 {
@@ -591,7 +591,7 @@ concptr do_music_spell(SPELL_IDX spell, BIT_FLAGS mode)
591591 if (info) return info_radius(rad);
592592
593593 /* Stop singing before start another */
594- if (cast || fail) stop_singing();
594+ if (cast || fail) stop_singing(p_ptr);
595595
596596 if (cast)
597597 {
@@ -607,7 +607,7 @@ concptr do_music_spell(SPELL_IDX spell, BIT_FLAGS mode)
607607 "Damages all monsters in sight. Hurts evil monsters greatly.");
608608
609609 /* Stop singing before start another */
610- if (cast || fail) stop_singing();
610+ if (cast || fail) stop_singing(p_ptr);
611611
612612 if (cast)
613613 {
@@ -634,7 +634,7 @@ concptr do_music_spell(SPELL_IDX spell, BIT_FLAGS mode)
634634 if (desc) return _("視界内の全てのモンスターを減速させ、眠らせようとする。抵抗されると無効。", "Attempts to slow and sleep all monsters in sight.");
635635
636636 /* Stop singing before start another */
637- if (cast || fail) stop_singing();
637+ if (cast || fail) stop_singing(p_ptr);
638638
639639 if (cast)
640640 {
@@ -667,7 +667,7 @@ concptr do_music_spell(SPELL_IDX spell, BIT_FLAGS mode)
667667 if (info) return info_damage(dice, sides, 0);
668668
669669 /* Stop singing before start another */
670- if (cast || fail) stop_singing();
670+ if (cast || fail) stop_singing(p_ptr);
671671
672672 if (cast)
673673 {
@@ -689,7 +689,7 @@ concptr do_music_spell(SPELL_IDX spell, BIT_FLAGS mode)
689689 if (info) return info_delay(base, sides);
690690
691691 /* Stop singing before start another */
692- if (cast || fail) stop_singing();
692+ if (cast || fail) stop_singing(p_ptr);
693693
694694 if (cast)
695695 {
@@ -705,7 +705,7 @@ concptr do_music_spell(SPELL_IDX spell, BIT_FLAGS mode)
705705 "Shakes dungeon structure, and results in random swapping of floors and walls.");
706706
707707 /* Stop singing before start another */
708- if (cast || fail) stop_singing();
708+ if (cast || fail) stop_singing(p_ptr);
709709
710710 if (cast)
711711 {
@@ -732,7 +732,7 @@ concptr do_music_spell(SPELL_IDX spell, BIT_FLAGS mode)
732732 if (desc) return _("視界内の全てのモンスターを麻痺させようとする。抵抗されると無効。", "Attempts to freeze all monsters in sight.");
733733
734734 /* Stop singing before start another */
735- if (cast || fail) stop_singing();
735+ if (cast || fail) stop_singing(p_ptr);
736736
737737 if (cast)
738738 {
@@ -760,7 +760,7 @@ concptr do_music_spell(SPELL_IDX spell, BIT_FLAGS mode)
760760
761761 {
762762 /* Stop singing before start another */
763- if (cast || fail) stop_singing();
763+ if (cast || fail) stop_singing(p_ptr);
764764
765765 if (cast)
766766 {
@@ -776,7 +776,7 @@ concptr do_music_spell(SPELL_IDX spell, BIT_FLAGS mode)
776776 "Hastes you. Gives heroism. Damages all monsters in sight.");
777777
778778 /* Stop singing before start another */
779- if (cast || fail) stop_singing();
779+ if (cast || fail) stop_singing(p_ptr);
780780
781781 if (cast)
782782 {
@@ -823,7 +823,7 @@ concptr do_music_spell(SPELL_IDX spell, BIT_FLAGS mode)
823823 if (desc) return _("強力な回復の歌で、負傷と朦朧状態も全快する。", "Powerful healing song. Also heals cut and stun completely.");
824824
825825 /* Stop singing before start another */
826- if (cast || fail) stop_singing();
826+ if (cast || fail) stop_singing(p_ptr);
827827
828828 if (cast)
829829 {
@@ -853,7 +853,7 @@ concptr do_music_spell(SPELL_IDX spell, BIT_FLAGS mode)
853853
854854 {
855855 /* Stop singing before start another */
856- if (cast || fail) stop_singing();
856+ if (cast || fail) stop_singing(p_ptr);
857857
858858 if (cast)
859859 {
@@ -877,7 +877,7 @@ concptr do_music_spell(SPELL_IDX spell, BIT_FLAGS mode)
877877 if (info) return info_damage(dice, sides, 0);
878878
879879 /* Stop singing before start another */
880- if (cast || fail) stop_singing();
880+ if (cast || fail) stop_singing(p_ptr);
881881
882882 if (cast)
883883 {
@@ -894,7 +894,7 @@ concptr do_music_spell(SPELL_IDX spell, BIT_FLAGS mode)
894894 "Generates barrier which completely protect you from almost all damages. Takes a few your turns when the barrier breaks.");
895895
896896 /* Stop singing before start another */
897- if (cast || fail) stop_singing();
897+ if (cast || fail) stop_singing(p_ptr);
898898
899899 if (cast)
900900 {
--- a/src/spells-status.c
+++ b/src/spells-status.c
@@ -140,31 +140,31 @@ bool fear_monster(DIRECTION dir, PLAYER_LEVEL plev)
140140 * @brief 歌の停止を処理する / Stop singing if the player is a Bard
141141 * @return なし
142142 */
143-void stop_singing(void)
143+void stop_singing(player_type *creature_ptr)
144144 {
145- if (p_ptr->pclass != CLASS_BARD) return;
145+ if (creature_ptr->pclass != CLASS_BARD) return;
146146
147147 /* Are there interupted song? */
148- if (INTERUPTING_SONG_EFFECT(p_ptr))
148+ if (INTERUPTING_SONG_EFFECT(creature_ptr))
149149 {
150150 /* Forget interupted song */
151- INTERUPTING_SONG_EFFECT(p_ptr) = MUSIC_NONE;
151+ INTERUPTING_SONG_EFFECT(creature_ptr) = MUSIC_NONE;
152152 return;
153153 }
154154
155155 /* The player is singing? */
156- if (!SINGING_SONG_EFFECT(p_ptr)) return;
156+ if (!SINGING_SONG_EFFECT(creature_ptr)) return;
157157
158158 /* Hack -- if called from set_action(), avoid recursive loop */
159- if (p_ptr->action == ACTION_SING) set_action(ACTION_NONE);
159+ if (creature_ptr->action == ACTION_SING) set_action(ACTION_NONE);
160160
161161 /* Message text of each song or etc. */
162- do_spell(REALM_MUSIC, SINGING_SONG_ID(p_ptr), SPELL_STOP);
162+ do_spell(REALM_MUSIC, SINGING_SONG_ID(creature_ptr), SPELL_STOP);
163163
164- SINGING_SONG_EFFECT(p_ptr) = MUSIC_NONE;
165- SINGING_SONG_ID(p_ptr) = 0;
166- p_ptr->update |= (PU_BONUS);
167- p_ptr->redraw |= (PR_STATUS);
164+ SINGING_SONG_EFFECT(creature_ptr) = MUSIC_NONE;
165+ SINGING_SONG_ID(creature_ptr) = 0;
166+ creature_ptr->update |= (PU_BONUS);
167+ creature_ptr->redraw |= (PR_STATUS);
168168 }
169169
170170 bool time_walk(player_type *creature_ptr)
--- a/src/spells-status.h
+++ b/src/spells-status.h
@@ -10,7 +10,7 @@ extern bool stun_monster(DIRECTION dir, PLAYER_LEVEL plev);
1010 extern bool fear_monster(DIRECTION dir, PLAYER_LEVEL plev);
1111 extern bool poly_monster(DIRECTION dir, int power);
1212 extern bool clone_monster(DIRECTION dir);
13-extern void stop_singing(void);
13+extern void stop_singing(player_type *creature_ptr);
1414 extern bool time_walk(player_type *creature_ptr);
1515 extern void roll_hitdice(player_type *creature_ptr, SPOP_FLAGS options);
1616 extern bool_hack life_stream(bool_hack message, bool_hack virtue_change);
--- a/src/spells2.c
+++ b/src/spells2.c
@@ -4596,7 +4596,7 @@ void cast_shuffle(void)
45964596 */
45974597 void stop_mouth(void)
45984598 {
4599- if (music_singing_any()) stop_singing();
4599+ if (music_singing_any()) stop_singing(p_ptr);
46004600 if (hex_spelling_any()) stop_hex_spell_all();
46014601 }
46024602
Show on old repository browser