OSDN Git Service

[Refactor] monster_spell_type と RF_ABILITY を統合する
[hengbandforosx/hengbandosx.git] / src / mspell / mspell-ball.cpp
index 228265a..feed861 100644 (file)
@@ -2,13 +2,13 @@
 #include "effect/effect-processor.h"
 #include "main/sound-of-music.h"
 #include "mind/drs-types.h"
+#include "monster-race/race-ability-flags.h"
 #include "monster-race/race-indice-types.h"
 #include "monster/monster-info.h"
 #include "monster/monster-status.h"
 #include "monster/monster-update.h"
 #include "mspell/mspell-checker.h"
 #include "mspell/mspell-damage-calculator.h"
-#include "mspell/mspell-type.h"
 #include "mspell/mspell-util.h"
 #include "mspell/mspell.h"
 #include "spell/spell-types.h"
@@ -31,7 +31,7 @@ MonsterSpellResult spell_RF4_BA_NUKE(player_type *target_ptr, POSITION y, POSITI
     monspell_message(target_ptr, m_idx, t_idx, _("%^sが何かをつぶやいた。", "%^s mumbles."), _("%^sが放射能球を放った。", "%^s casts a ball of radiation."),
         _("%^sが%sに放射能球を放った。", "%^s casts a ball of radiation at %s."), TARGET_TYPE);
 
-    const auto dam = monspell_damage(target_ptr, (MS_BALL_NUKE), m_idx, DAM_ROLL);
+    const auto dam = monspell_damage(target_ptr, RF_ABILITY::BA_NUKE, m_idx, DAM_ROLL);
     const auto proj_res = breath(target_ptr, y, x, m_idx, GF_NUKE, dam, 2, FALSE, TARGET_TYPE);
     if (TARGET_TYPE == MONSTER_TO_PLAYER)
         update_smart_learn(target_ptr, m_idx, DRS_POIS);
@@ -58,7 +58,7 @@ MonsterSpellResult spell_RF4_BA_CHAO(player_type *target_ptr, POSITION y, POSITI
     monspell_message(target_ptr, m_idx, t_idx, _("%^sが恐ろしげにつぶやいた。", "%^s mumbles frighteningly."),
         _("%^sが純ログルスを放った。", "%^s invokes a raw Logrus."), _("%^sが%sに純ログルスを放った。", "%^s invokes raw Logrus upon %s."), TARGET_TYPE);
 
-    const auto dam = monspell_damage(target_ptr, (MS_BALL_CHAOS), m_idx, DAM_ROLL);
+    const auto dam = monspell_damage(target_ptr, RF_ABILITY::BA_CHAO, m_idx, DAM_ROLL);
     const auto proj_res = breath(target_ptr, y, x, m_idx, GF_CHAOS, dam, 4, FALSE, TARGET_TYPE);
     if (TARGET_TYPE == MONSTER_TO_PLAYER)
         update_smart_learn(target_ptr, m_idx, DRS_CHAOS);
@@ -87,7 +87,7 @@ MonsterSpellResult spell_RF5_BA_ACID(player_type *target_ptr, POSITION y, POSITI
         _("%^sが%sに向かってアシッド・ボールの呪文を唱えた。", "%^s casts an acid ball at %s."), TARGET_TYPE);
 
     const auto rad = monster_is_powerful(target_ptr->current_floor_ptr, m_idx) ? 4 : 2;
-    const auto dam = monspell_damage(target_ptr, (MS_BALL_ACID), m_idx, DAM_ROLL);
+    const auto dam = monspell_damage(target_ptr, RF_ABILITY::BA_ACID, m_idx, DAM_ROLL);
     const auto proj_res = breath(target_ptr, y, x, m_idx, GF_ACID, dam, rad, FALSE, TARGET_TYPE);
     if (TARGET_TYPE == MONSTER_TO_PLAYER)
         update_smart_learn(target_ptr, m_idx, DRS_ACID);
@@ -116,7 +116,7 @@ MonsterSpellResult spell_RF5_BA_ELEC(player_type *target_ptr, POSITION y, POSITI
         _("%^sが%sに向かってサンダー・ボールの呪文を唱えた。", "%^s casts a lightning ball at %s."), TARGET_TYPE);
 
     const auto rad = monster_is_powerful(target_ptr->current_floor_ptr, m_idx) ? 4 : 2;
-    const auto dam = monspell_damage(target_ptr, (MS_BALL_ELEC), m_idx, DAM_ROLL);
+    const auto dam = monspell_damage(target_ptr, RF_ABILITY::BA_ELEC, m_idx, DAM_ROLL);
     const auto proj_res = breath(target_ptr, y, x, m_idx, GF_ELEC, dam, rad, FALSE, TARGET_TYPE);
     if (TARGET_TYPE == MONSTER_TO_PLAYER)
         update_smart_learn(target_ptr, m_idx, DRS_ELEC);
@@ -152,7 +152,7 @@ MonsterSpellResult spell_RF5_BA_FIRE(player_type *target_ptr, POSITION y, POSITI
     }
 
     const auto rad = monster_is_powerful(target_ptr->current_floor_ptr, m_idx) ? 4 : 2;
-    const auto dam = monspell_damage(target_ptr, (MS_BALL_FIRE), m_idx, DAM_ROLL);
+    const auto dam = monspell_damage(target_ptr, RF_ABILITY::BA_FIRE, m_idx, DAM_ROLL);
     const auto proj_res = breath(target_ptr, y, x, m_idx, GF_FIRE, dam, rad, FALSE, TARGET_TYPE);
     if (TARGET_TYPE == MONSTER_TO_PLAYER)
         update_smart_learn(target_ptr, m_idx, DRS_FIRE);
@@ -181,7 +181,7 @@ MonsterSpellResult spell_RF5_BA_COLD(player_type *target_ptr, POSITION y, POSITI
         _("%^sが%sに向かってアイス・ボールの呪文を唱えた。", "%^s casts a frost ball at %s."), TARGET_TYPE);
 
     const auto rad = monster_is_powerful(target_ptr->current_floor_ptr, m_idx) ? 4 : 2;
-    const auto dam = monspell_damage(target_ptr, (MS_BALL_COLD), m_idx, DAM_ROLL);
+    const auto dam = monspell_damage(target_ptr, RF_ABILITY::BA_COLD, m_idx, DAM_ROLL);
     const auto proj_res = breath(target_ptr, y, x, m_idx, GF_COLD, dam, rad, FALSE, TARGET_TYPE);
     if (TARGET_TYPE == MONSTER_TO_PLAYER)
         update_smart_learn(target_ptr, m_idx, DRS_COLD);
@@ -208,7 +208,7 @@ MonsterSpellResult spell_RF5_BA_POIS(player_type *target_ptr, POSITION y, POSITI
     monspell_message(target_ptr, m_idx, t_idx, _("%^sが何かをつぶやいた。", "%^s mumbles."), _("%^sが悪臭雲の呪文を唱えた。", "%^s casts a stinking cloud."),
         _("%^sが%sに向かって悪臭雲の呪文を唱えた。", "%^s casts a stinking cloud at %s."), TARGET_TYPE);
 
-    const auto dam = monspell_damage(target_ptr, (MS_BALL_POIS), m_idx, DAM_ROLL);
+    const auto dam = monspell_damage(target_ptr, RF_ABILITY::BA_POIS, m_idx, DAM_ROLL);
     const auto proj_res = breath(target_ptr, y, x, m_idx, GF_POIS, dam, 2, FALSE, TARGET_TYPE);
     if (TARGET_TYPE == MONSTER_TO_PLAYER)
         update_smart_learn(target_ptr, m_idx, DRS_POIS);
@@ -235,7 +235,7 @@ MonsterSpellResult spell_RF5_BA_NETH(player_type *target_ptr, POSITION y, POSITI
     monspell_message(target_ptr, m_idx, t_idx, _("%^sが何かをつぶやいた。", "%^s mumbles."), _("%^sが地獄球の呪文を唱えた。", "%^s casts a nether ball."),
         _("%^sが%sに向かって地獄球の呪文を唱えた。", "%^s casts a nether ball at %s."), TARGET_TYPE);
 
-    const auto dam = monspell_damage(target_ptr, (MS_BALL_NETHER), m_idx, DAM_ROLL);
+    const auto dam = monspell_damage(target_ptr, RF_ABILITY::BA_NETH, m_idx, DAM_ROLL);
     const auto proj_res = breath(target_ptr, y, x, m_idx, GF_NETHER, dam, 2, FALSE, TARGET_TYPE);
     if (TARGET_TYPE == MONSTER_TO_PLAYER)
         update_smart_learn(target_ptr, m_idx, DRS_NETH);
@@ -275,7 +275,7 @@ MonsterSpellResult spell_RF5_BA_WATE(player_type *target_ptr, POSITION y, POSITI
         msg_format(_("%^sは渦巻に飲み込まれた。", "%^s is engulfed in a whirlpool."), t_name);
     }
 
-    const auto dam = monspell_damage(target_ptr, (MS_BALL_WATER), m_idx, DAM_ROLL);
+    const auto dam = monspell_damage(target_ptr, RF_ABILITY::BA_WATE, m_idx, DAM_ROLL);
     const auto proj_res = breath(target_ptr, y, x, m_idx, GF_WATER, dam, 4, FALSE, TARGET_TYPE);
 
     auto res = MonsterSpellResult::make_valid(dam);
@@ -301,7 +301,7 @@ MonsterSpellResult spell_RF5_BA_MANA(player_type *target_ptr, POSITION y, POSITI
         _("%^sが魔力の嵐の呪文を念じた。", "%^s invokes a mana storm."), _("%^sが%sに対して魔力の嵐の呪文を念じた。", "%^s invokes a mana storm upon %s."),
         TARGET_TYPE);
 
-    const auto dam = monspell_damage(target_ptr, (MS_BALL_MANA), m_idx, DAM_ROLL);
+    const auto dam = monspell_damage(target_ptr, RF_ABILITY::BA_MANA, m_idx, DAM_ROLL);
     const auto proj_res = breath(target_ptr, y, x, m_idx, GF_MANA, dam, 4, FALSE, TARGET_TYPE);
 
     auto res = MonsterSpellResult::make_valid(dam);
@@ -327,7 +327,7 @@ MonsterSpellResult spell_RF5_BA_DARK(player_type *target_ptr, POSITION y, POSITI
         _("%^sが暗黒の嵐の呪文を念じた。", "%^s invokes a darkness storm."),
         _("%^sが%sに対して暗黒の嵐の呪文を念じた。", "%^s invokes a darkness storm upon %s."), TARGET_TYPE);
 
-    const auto dam = monspell_damage(target_ptr, (MS_BALL_DARK), m_idx, DAM_ROLL);
+    const auto dam = monspell_damage(target_ptr, RF_ABILITY::BA_DARK, m_idx, DAM_ROLL);
     const auto proj_res = breath(target_ptr, y, x, m_idx, GF_DARK, dam, 4, FALSE, TARGET_TYPE);
     if (TARGET_TYPE == MONSTER_TO_PLAYER)
         update_smart_learn(target_ptr, m_idx, DRS_DARK);
@@ -355,7 +355,7 @@ MonsterSpellResult spell_RF5_BA_LITE(player_type *target_ptr, POSITION y, POSITI
         _("%^sがスターバーストの呪文を念じた。", "%^s invokes a starburst."),
         _("%^sが%sに対してスターバーストの呪文を念じた。", "%^s invokes a starburst upon %s."), TARGET_TYPE);
 
-    const auto dam = monspell_damage(target_ptr, (MS_STARBURST), m_idx, DAM_ROLL);
+    const auto dam = monspell_damage(target_ptr, RF_ABILITY::BA_LITE, m_idx, DAM_ROLL);
     const auto proj_res = breath(target_ptr, y, x, m_idx, GF_LITE, dam, 4, FALSE, TARGET_TYPE);
     if (TARGET_TYPE == MONSTER_TO_PLAYER)
         update_smart_learn(target_ptr, m_idx, DRS_LITE);