From: Deskull Date: Fri, 28 Sep 2018 11:47:14 +0000 (+0900) Subject: [Refactor] #37353 ratial_stop_mouth()とmutation_stop_mouthをstop_mouth()にまとめる。 X-Git-Tag: vmacos2.2.1-7a~1368 X-Git-Url: http://git.osdn.net/view?a=commitdiff_plain;h=f028aed3d6bb2084e95641800b4616478531337c;p=hengbandforosx%2Fhengbandosx.git [Refactor] #37353 ratial_stop_mouth()とmutation_stop_mouthをstop_mouth()にまとめる。 Integrate ratial_stop_mouth() and mutation_stop_mouth to stop_mouth(). --- diff --git a/src/externs.h b/src/externs.h index 40eab3a75..62dccc274 100644 --- a/src/externs.h +++ b/src/externs.h @@ -1180,6 +1180,7 @@ extern bool_hack cure_critical_wounds(HIT_POINT pow); extern bool_hack true_healing(HIT_POINT pow); extern bool_hack restore_mana(bool_hack magic_eater); extern bool restore_all_status(void); +extern void stop_mouth(void); /* spells3.c */ extern bool teleport_away(MONSTER_IDX m_idx, int dis, BIT_FLAGS mode); diff --git a/src/mutation.c b/src/mutation.c index d1619535b..d65127da0 100644 --- a/src/mutation.c +++ b/src/mutation.c @@ -2083,16 +2083,6 @@ int calc_mutant_regenerate_mod(void) return (regen); } -/*! - * @brief 突然変異レイシャル上で口を使うよりを行った際に歌や呪術を停止する / - * @return なし - */ -static void mutation_stop_mouth(void) -{ - if (music_singing_any()) stop_singing(); - if (hex_spelling_any()) stop_hex_spell_all(); -} - /*! * @brief 突然変異のレイシャル効果実装 @@ -2109,7 +2099,7 @@ bool mutation_power_aux(u32b power) { case MUT1_SPIT_ACID: if (!get_aim_dir(&dir)) return FALSE; - mutation_stop_mouth(); + stop_mouth(); msg_print(_("酸を吐きかけた...", "You spit acid...")); fire_ball(GF_ACID, dir, lvl, 1 + (lvl / 30)); @@ -2117,7 +2107,7 @@ bool mutation_power_aux(u32b power) case MUT1_BR_FIRE: if (!get_aim_dir(&dir)) return FALSE; - mutation_stop_mouth(); + stop_mouth(); msg_print(_("あなたは火炎のブレスを吐いた...", "You breathe fire...")); fire_breath(GF_FIRE, dir, lvl * 2, 1 + (lvl / 20)); @@ -2167,7 +2157,7 @@ bool mutation_power_aux(u32b power) x = p_ptr->x + ddx[dir]; c_ptr = &cave[y][x]; - mutation_stop_mouth(); + stop_mouth(); if (!(c_ptr->m_idx)) { @@ -2204,12 +2194,12 @@ bool mutation_power_aux(u32b power) break; case MUT1_SMELL_MET: - mutation_stop_mouth(); + stop_mouth(); (void)detect_treasure(DETECT_RAD_DEFAULT); break; case MUT1_SMELL_MON: - mutation_stop_mouth(); + stop_mouth(); (void)detect_monsters_normal(DETECT_RAD_DEFAULT); break; @@ -2230,7 +2220,7 @@ bool mutation_power_aux(u32b power) f_ptr = &f_info[c_ptr->feat]; mimic_f_ptr = &f_info[get_feat_mimic(c_ptr)]; - mutation_stop_mouth(); + stop_mouth(); if (!have_flag(mimic_f_ptr->flags, FF_HURT_ROCK)) { @@ -2294,7 +2284,7 @@ bool mutation_power_aux(u32b power) break; case MUT1_SHRIEK: - mutation_stop_mouth(); + stop_mouth(); (void)fire_ball(GF_SOUND, 0, 2 * lvl, 8); (void)aggravate_monsters(0); break; @@ -2389,15 +2379,8 @@ bool mutation_power_aux(u32b power) break; case MUT1_STERILITY: - /* Fake a population explosion. */ -#ifdef JP - msg_print("突然頭が痛くなった!"); - take_hit(DAMAGE_LOSELIFE, randint1(17) + 17, "禁欲を強いた疲労", -1); -#else - msg_print("You suddenly have a headache!"); - take_hit(DAMAGE_LOSELIFE, randint1(17) + 17, "the strain of forcing abstinence", -1); -#endif - + msg_print(_("突然頭が痛くなった!", "You suddenly have a headache!")); + take_hit(DAMAGE_LOSELIFE, randint1(17) + 17, _("禁欲を強いた疲労", "the strain of forcing abstinence"), -1); num_repro += MAX_REPRO; break; @@ -2418,7 +2401,6 @@ bool mutation_power_aux(u32b power) else { msg_print(_("その方向にはモンスターはいません。", "You don't see any monster in this direction")); - msg_print(NULL); } } @@ -2484,7 +2466,6 @@ bool mutation_power_aux(u32b power) else { msg_print(_("祈りは効果がなかった!", "Your invocation is ineffectual!")); - if (one_in_(13)) m_ptr->mflag2 |= MFLAG2_NOGENO; } } diff --git a/src/racial.c b/src/racial.c index cd6ab9f73..88b211c7c 100644 --- a/src/racial.c +++ b/src/racial.c @@ -738,15 +738,6 @@ static int racial_aux(power_desc_type *pd_ptr) return -1; } -/*! - * @brief レイシャル・パワー発動時に口を使う継続的な詠唱処理を中断する - * @return なし - */ -void ratial_stop_mouth(void) -{ - if (music_singing_any()) stop_singing(); - if (hex_spelling_any()) stop_hex_spell_all(); -} /*! * @brief レイシャル・パワー発動処理 @@ -1216,7 +1207,7 @@ static bool cmd_racial_power_aux(s32b command) { int type = (one_in_(2) ? GF_NETHER : GF_FIRE); if (!get_aim_dir(&dir)) return FALSE; - ratial_stop_mouth(); + stop_mouth(); #ifdef JP msg_format("あなたは%sのブレスを吐いた。",((type == GF_NETHER) ? "地獄" : "火炎")); #else @@ -1243,7 +1234,7 @@ static bool cmd_racial_power_aux(s32b command) x = p_ptr->x + ddx[dir]; c_ptr = &cave[y][x]; - ratial_stop_mouth(); + stop_mouth(); if (!c_ptr->m_idx) { @@ -1364,14 +1355,14 @@ static bool cmd_racial_power_aux(s32b command) case RACE_YEEK: if (!get_aim_dir(&dir)) return FALSE; - ratial_stop_mouth(); + stop_mouth(); msg_print(_("身の毛もよだつ叫び声を上げた!", "You make a horrible scream!")); (void)fear_monster(dir, plev); break; case RACE_KLACKON: if (!get_aim_dir(&dir)) return FALSE; - ratial_stop_mouth(); + stop_mouth(); msg_print(_("酸を吐いた。", "You spit acid.")); if (plev < 25) fire_bolt(GF_ACID, dir, plev); else fire_ball(GF_ACID, dir, plev, 2); @@ -1528,7 +1519,7 @@ static bool cmd_racial_power_aux(s32b command) } } - ratial_stop_mouth(); + stop_mouth(); msg_format(_("あなたは%sのブレスを吐いた。", "You breathe %s."), Type_desc); fire_breath(Type, dir, plev * 2, (plev / 15) + 1); @@ -1582,7 +1573,7 @@ static bool cmd_racial_power_aux(s32b command) x = p_ptr->x + ddx[dir]; c_ptr = &cave[y][x]; - ratial_stop_mouth(); + stop_mouth(); if (!c_ptr->m_idx) { @@ -1615,7 +1606,7 @@ static bool cmd_racial_power_aux(s32b command) case RACE_SPECTRE: if (!get_aim_dir(&dir)) return FALSE; - ratial_stop_mouth(); + stop_mouth(); msg_print(_("あなたはおどろおどろしい叫び声をあげた!", "You emit an eldritch howl!")); (void)fear_monster(dir, plev); break; @@ -1630,7 +1621,7 @@ static bool cmd_racial_power_aux(s32b command) { int type = (one_in_(2) ? GF_NETHER : GF_FIRE); if (!get_aim_dir(&dir)) return FALSE; - ratial_stop_mouth(); + stop_mouth(); #ifdef JP msg_format("あなたは%sのブレスを吐いた。",((type == GF_NETHER) ? "地獄" : "火炎")); #else diff --git a/src/spells2.c b/src/spells2.c index 0a7ceece3..ce46b5ee3 100644 --- a/src/spells2.c +++ b/src/spells2.c @@ -5114,3 +5114,12 @@ bool restore_all_status(void) return ident; } +/*! + * @brief 口を使う継続的な処理を中断する + * @return なし + */ +void stop_mouth(void) +{ + if (music_singing_any()) stop_singing(); + if (hex_spelling_any()) stop_hex_spell_all(); +}