OSDN Git Service

[Refactor] #37353 悪魔系種族のレイシャルブレスを demonic_breath() に分離。 / Separate Demon races' breat...
authorDeskull <deskull@users.sourceforge.jp>
Wed, 23 Jan 2019 14:08:39 +0000 (23:08 +0900)
committerDeskull <deskull@users.sourceforge.jp>
Wed, 23 Jan 2019 14:08:39 +0000 (23:08 +0900)
src/externs.h
src/racial.c
src/spells2.c

index 288a4b7..37fc330 100644 (file)
@@ -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);
index 1d4f3d9..b8be14b 100644 (file)
@@ -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:
index 9e2dd03..0ad2b11 100644 (file)
@@ -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;
+}
+