OSDN Git Service

[Refactor] #40414 Separated racial-draconian.c/h from spells2.c/h
authorHourier <hourier@users.sourceforge.jp>
Thu, 4 Jun 2020 12:34:59 +0000 (21:34 +0900)
committerHourier <hourier@users.sourceforge.jp>
Thu, 4 Jun 2020 12:34:59 +0000 (21:34 +0900)
Hengband/Hengband/Hengband.vcxproj
Hengband/Hengband/Hengband.vcxproj.filters
src/Makefile.am
src/mind/racial-draconian.c [new file with mode: 0644]
src/mind/racial-draconian.h [new file with mode: 0644]
src/mind/racial.c
src/spell/spells2.c
src/spell/spells2.h

index 041b7b6..04767fc 100644 (file)
     <ClCompile Include="..\..\src\market\building-recharger.c" />\r
     <ClCompile Include="..\..\src\market\building-service.c" />\r
     <ClCompile Include="..\..\src\mind\racial-cavalry.c" />\r
+    <ClCompile Include="..\..\src\mind\racial-draconian.c" />\r
     <ClCompile Include="..\..\src\mind\racial-force-trainer.c" />\r
     <ClCompile Include="..\..\src\mind\racial-mirror-master.c" />\r
     <ClCompile Include="..\..\src\mind\monk-attack.c" />\r
     <ClInclude Include="..\..\src\market\building-recharger.h" />\r
     <ClInclude Include="..\..\src\market\building-service.h" />\r
     <ClInclude Include="..\..\src\mind\racial-cavalry.h" />\r
+    <ClInclude Include="..\..\src\mind\racial-draconian.h" />\r
     <ClInclude Include="..\..\src\mind\racial-force-trainer.h" />\r
     <ClInclude Include="..\..\src\mind\racial-mirror-master.h" />\r
     <ClInclude Include="..\..\src\mind\monk-attack.h" />\r
index 8dc5bcb..ed93b5b 100644 (file)
     <ClCompile Include="..\..\src\spell\spells-lite.c">
       <Filter>spell</Filter>
     </ClCompile>
+    <ClCompile Include="..\..\src\mind\racial-draconian.c">
+      <Filter>mind</Filter>
+    </ClCompile>
   </ItemGroup>
   <ItemGroup>
     <ClInclude Include="..\..\src\cmd\cmd-basic.h">
     <ClInclude Include="..\..\src\spell\spells-lite.h">
       <Filter>spell</Filter>
     </ClInclude>
+    <ClInclude Include="..\..\src\mind\racial-draconian.h">
+      <Filter>mind</Filter>
+    </ClInclude>
   </ItemGroup>
   <ItemGroup>
     <None Include="..\..\src\wall.bmp" />
index d8dd231..561804e 100644 (file)
@@ -247,6 +247,7 @@ hengband_SOURCES = \
        mind/monk-attack.c mind/monk-attack.h \
        mind/racial.c mind/racial.h \
        mind/racial-cavalry.c mind/racial-cavalry.h \
+       mind/racial-draconian.c mind/racial-draconian.h \
        mind/racial-force-trainer.c mind/racial-force-trainer.h \
        mind/racial-mirror-master.c mind/racial-mirror-master.h \
        mind/racial-ninja.c mind/racial-ninja.h \
diff --git a/src/mind/racial-draconian.c b/src/mind/racial-draconian.c
new file mode 100644 (file)
index 0000000..0c6ecba
--- /dev/null
@@ -0,0 +1,121 @@
+#include "mind/racial-draconian.h"
+#include "io/targeting.h"
+#include "spell/spells-launcher.h"
+#include "spell/spells-type.h"
+
+bool draconian_breath(player_type *creature_ptr)
+{
+    int Type = (one_in_(3) ? GF_COLD : GF_FIRE);
+    concptr Type_desc = ((Type == GF_COLD) ? _("冷気", "cold") : _("炎", "fire"));
+    DIRECTION dir;
+    if (!get_aim_dir(creature_ptr, &dir))
+        return FALSE;
+
+    if (randint1(100) < creature_ptr->lev) {
+        switch (creature_ptr->pclass) {
+        case CLASS_WARRIOR:
+        case CLASS_BERSERKER:
+        case CLASS_RANGER:
+        case CLASS_TOURIST:
+        case CLASS_IMITATOR:
+        case CLASS_ARCHER:
+        case CLASS_SMITH:
+            if (one_in_(3)) {
+                Type = GF_MISSILE;
+                Type_desc = _("エレメント", "the elements");
+            } else {
+                Type = GF_SHARDS;
+                Type_desc = _("破片", "shards");
+            }
+
+            break;
+        case CLASS_MAGE:
+        case CLASS_WARRIOR_MAGE:
+        case CLASS_HIGH_MAGE:
+        case CLASS_SORCERER:
+        case CLASS_MAGIC_EATER:
+        case CLASS_RED_MAGE:
+        case CLASS_BLUE_MAGE:
+        case CLASS_MIRROR_MASTER:
+            if (one_in_(3)) {
+                Type = GF_MANA;
+                Type_desc = _("魔力", "mana");
+            } else {
+                Type = GF_DISENCHANT;
+                Type_desc = _("劣化", "disenchantment");
+            }
+
+            break;
+        case CLASS_CHAOS_WARRIOR:
+            if (!one_in_(3)) {
+                Type = GF_CONFUSION;
+                Type_desc = _("混乱", "confusion");
+            } else {
+                Type = GF_CHAOS;
+                Type_desc = _("カオス", "chaos");
+            }
+
+            break;
+        case CLASS_MONK:
+        case CLASS_SAMURAI:
+        case CLASS_FORCETRAINER:
+            if (!one_in_(3)) {
+                Type = GF_CONFUSION;
+                Type_desc = _("混乱", "confusion");
+            } else {
+                Type = GF_SOUND;
+                Type_desc = _("轟音", "sound");
+            }
+
+            break;
+        case CLASS_MINDCRAFTER:
+            if (!one_in_(3)) {
+                Type = GF_CONFUSION;
+                Type_desc = _("混乱", "confusion");
+            } else {
+                Type = GF_PSI;
+                Type_desc = _("精神エネルギー", "mental energy");
+            }
+
+            break;
+        case CLASS_PRIEST:
+        case CLASS_PALADIN:
+            if (one_in_(3)) {
+                Type = GF_HELL_FIRE;
+                Type_desc = _("地獄の劫火", "hellfire");
+            } else {
+                Type = GF_HOLY_FIRE;
+                Type_desc = _("聖なる炎", "holy fire");
+            }
+
+            break;
+        case CLASS_ROGUE:
+        case CLASS_NINJA:
+            if (one_in_(3)) {
+                Type = GF_DARK;
+                Type_desc = _("暗黒", "darkness");
+            } else {
+                Type = GF_POIS;
+                Type_desc = _("毒", "poison");
+            }
+
+            break;
+        case CLASS_BARD:
+            if (!one_in_(3)) {
+                Type = GF_SOUND;
+                Type_desc = _("轟音", "sound");
+            } else {
+                Type = GF_CONFUSION;
+                Type_desc = _("混乱", "confusion");
+            }
+
+            break;
+        }
+    }
+
+    stop_mouth(creature_ptr);
+    msg_format(_("あなたは%sのブレスを吐いた。", "You breathe %s."), Type_desc);
+
+    fire_breath(creature_ptr, Type, dir, creature_ptr->lev * 2, (creature_ptr->lev / 15) + 1);
+    return TRUE;
+}
diff --git a/src/mind/racial-draconian.h b/src/mind/racial-draconian.h
new file mode 100644 (file)
index 0000000..2822082
--- /dev/null
@@ -0,0 +1,5 @@
+#pragma once
+
+#include "system/angband.h"
+
+bool draconian_breath(player_type *creature_ptr);
index 66ea339..26893c2 100644 (file)
@@ -21,6 +21,7 @@
 #include "effect/spells-effect-util.h"
 #include "io/targeting.h"
 #include "mind/racial-cavalry.h"
+#include "mind/racial-draconian.h"
 #include "mind/racial-mirror-master.h"
 #include "mind/racial-samurai.h"
 #include "mutation/mutation.h"
index 50b2070..fafb746 100644 (file)
@@ -1857,149 +1857,6 @@ bool psychometry(player_type *caster_ptr)
 }
 
 
-bool draconian_breath(player_type *creature_ptr)
-{
-       int Type = (one_in_(3) ? GF_COLD : GF_FIRE);
-       concptr Type_desc = ((Type == GF_COLD) ? _("冷気", "cold") : _("炎", "fire"));
-       DIRECTION dir;
-       if (!get_aim_dir(creature_ptr, &dir)) return FALSE;
-
-       if (randint1(100) < creature_ptr->lev)
-       {
-               switch (creature_ptr->pclass)
-               {
-               case CLASS_WARRIOR:
-               case CLASS_BERSERKER:
-               case CLASS_RANGER:
-               case CLASS_TOURIST:
-               case CLASS_IMITATOR:
-               case CLASS_ARCHER:
-               case CLASS_SMITH:
-                       if (one_in_(3))
-                       {
-                               Type = GF_MISSILE;
-                               Type_desc = _("エレメント", "the elements");
-                       }
-                       else
-                       {
-                               Type = GF_SHARDS;
-                               Type_desc = _("破片", "shards");
-                       }
-
-                       break;
-               case CLASS_MAGE:
-               case CLASS_WARRIOR_MAGE:
-               case CLASS_HIGH_MAGE:
-               case CLASS_SORCERER:
-               case CLASS_MAGIC_EATER:
-               case CLASS_RED_MAGE:
-               case CLASS_BLUE_MAGE:
-               case CLASS_MIRROR_MASTER:
-                       if (one_in_(3))
-                       {
-                               Type = GF_MANA;
-                               Type_desc = _("魔力", "mana");
-                       }
-                       else
-                       {
-                               Type = GF_DISENCHANT;
-                               Type_desc = _("劣化", "disenchantment");
-                       }
-
-                       break;
-               case CLASS_CHAOS_WARRIOR:
-                       if (!one_in_(3))
-                       {
-                               Type = GF_CONFUSION;
-                               Type_desc = _("混乱", "confusion");
-                       }
-                       else
-                       {
-                               Type = GF_CHAOS;
-                               Type_desc = _("カオス", "chaos");
-                       }
-
-                       break;
-               case CLASS_MONK:
-               case CLASS_SAMURAI:
-               case CLASS_FORCETRAINER:
-                       if (!one_in_(3))
-                       {
-                               Type = GF_CONFUSION;
-                               Type_desc = _("混乱", "confusion");
-                       }
-                       else
-                       {
-                               Type = GF_SOUND;
-                               Type_desc = _("轟音", "sound");
-                       }
-
-                       break;
-               case CLASS_MINDCRAFTER:
-                       if (!one_in_(3))
-                       {
-                               Type = GF_CONFUSION;
-                               Type_desc = _("混乱", "confusion");
-                       }
-                       else
-                       {
-                               Type = GF_PSI;
-                               Type_desc = _("精神エネルギー", "mental energy");
-                       }
-
-                       break;
-               case CLASS_PRIEST:
-               case CLASS_PALADIN:
-                       if (one_in_(3))
-                       {
-                               Type = GF_HELL_FIRE;
-                               Type_desc = _("地獄の劫火", "hellfire");
-                       }
-                       else
-                       {
-                               Type = GF_HOLY_FIRE;
-                               Type_desc = _("聖なる炎", "holy fire");
-                       }
-
-                       break;
-               case CLASS_ROGUE:
-               case CLASS_NINJA:
-                       if (one_in_(3))
-                       {
-                               Type = GF_DARK;
-                               Type_desc = _("暗黒", "darkness");
-                       }
-                       else
-                       {
-                               Type = GF_POIS;
-                               Type_desc = _("毒", "poison");
-                       }
-
-                       break;
-               case CLASS_BARD:
-                       if (!one_in_(3))
-                       {
-                               Type = GF_SOUND;
-                               Type_desc = _("轟音", "sound");
-                       }
-                       else
-                       {
-                               Type = GF_CONFUSION;
-                               Type_desc = _("混乱", "confusion");
-                       }
-
-                       break;
-               }
-       }
-
-       stop_mouth(creature_ptr);
-       msg_format(_("あなたは%sのブレスを吐いた。", "You breathe %s."), Type_desc);
-
-       fire_breath(creature_ptr, Type, dir, creature_ptr->lev * 2, (creature_ptr->lev / 15) + 1);
-       return TRUE;
-}
-
-
 bool android_inside_weapon(player_type *creature_ptr)
 {
        DIRECTION dir;
index c5e74af..618c588 100644 (file)
@@ -40,7 +40,6 @@ void cast_shuffle(player_type* caster_ptr);
 bool vampirism(player_type* caster_ptr);
 bool hit_and_away(player_type* caster_ptr);
 bool psychometry(player_type* caster_ptr);
-bool draconian_breath(player_type* creature_ptr);
 bool android_inside_weapon(player_type* creature_ptr);
 bool create_ration(player_type* crature_ptr);
 void hayagake(player_type* creature_ptr);