From 6bd319c74b47e78d73413805dbabbc4b5c0578c7 Mon Sep 17 00:00:00 2001 From: Deskull Date: Wed, 23 Jan 2019 23:08:39 +0900 Subject: [PATCH] =?utf8?q?[Refactor]=20#37353=20=E6=82=AA=E9=AD=94?= =?utf8?q?=E7=B3=BB=E7=A8=AE=E6=97=8F=E3=81=AE=E3=83=AC=E3=82=A4=E3=82=B7?= =?utf8?q?=E3=83=A3=E3=83=AB=E3=83=96=E3=83=AC=E3=82=B9=E3=82=92=20demonic?= =?utf8?q?=5Fbreath()=20=E3=81=AB=E5=88=86=E9=9B=A2=E3=80=82=20/=20Separat?= =?utf8?q?e=20Demon=20races'=20breath=20skill=20to=20demonic=5Fbreath().?= MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit --- src/externs.h | 1 + src/racial.c | 15 ++------------- src/spells2.c | 14 +++++++++++++- 3 files changed, 16 insertions(+), 14 deletions(-) diff --git a/src/externs.h b/src/externs.h index 288a4b7ca..37fc330a3 100644 --- a/src/externs.h +++ b/src/externs.h @@ -996,6 +996,7 @@ extern void hayagake(player_type *creature_ptr); extern bool double_attack(player_type *creature_ptr); extern bool comvert_hp_to_mp(player_type *creature_ptr); extern bool comvert_mp_to_hp(player_type *creature_ptr); +extern bool demonic_breath(player_type *creature_ptr); /* spells3.c */ extern bool teleport_away(MONSTER_IDX m_idx, POSITION dis, BIT_FLAGS mode); diff --git a/src/racial.c b/src/racial.c index 1d4f3d9c2..b8be14b7c 100644 --- a/src/racial.c +++ b/src/racial.c @@ -767,12 +767,7 @@ static bool cmd_racial_power_aux(s32b command) case MIMIC_DEMON: case MIMIC_DEMON_LORD: { - int type = (one_in_(2) ? GF_NETHER : GF_FIRE); - if (!get_aim_dir(&dir)) return FALSE; - stop_mouth(); - msg_format(_("あなたは%sのブレスを吐いた。", "You breathe %s."),((type == GF_NETHER) ? _("地獄", "nether") : _("火炎", "fire"))); - fire_breath(type, dir, plev * 3, (plev / 15) + 1); - break; + return demonic_breath(p_ptr); } case MIMIC_VAMPIRE: vampirism(); @@ -939,13 +934,7 @@ static bool cmd_racial_power_aux(s32b command) break; case RACE_DEMON: - { - int type = (one_in_(2) ? GF_NETHER : GF_FIRE); - if (!get_aim_dir(&dir)) return FALSE; - stop_mouth(); - msg_format(_("あなたは%sのブレスを吐いた。", "You breathe %s."),((type == GF_NETHER) ? _("地獄", "nether") : _("火炎", "fire"))); - fire_breath(type, dir, plev * 3, (plev / 15) + 1); - } + return demonic_breath(p_ptr); break; case RACE_KUTAR: diff --git a/src/spells2.c b/src/spells2.c index 9e2dd0321..0ad2b11a4 100644 --- a/src/spells2.c +++ b/src/spells2.c @@ -5260,4 +5260,16 @@ bool comvert_mp_to_hp(player_type *creature_ptr) /* Redraw mana and hp */ creature_ptr->redraw |= (PR_HP | PR_MANA); return TRUE; -} \ No newline at end of file +} + +bool demonic_breath(player_type *creature_ptr) +{ + DIRECTION dir; + int type = (one_in_(2) ? GF_NETHER : GF_FIRE); + if (!get_aim_dir(&dir)) return FALSE; + stop_mouth(); + msg_format(_("あなたは%sのブレスを吐いた。", "You breathe %s."), ((type == GF_NETHER) ? _("地獄", "nether") : _("火炎", "fire"))); + fire_breath(type, dir, creature_ptr->lev * 3, (creature_ptr->lev / 15) + 1); + return TRUE; +} + -- 2.11.0