OSDN Git Service

[Refactor] struct player_type を class PlayerType に置換。
[hengbandforosx/hengbandosx.git] / src / spell / spells-staff-only.cpp
index b1d5fe6..a9b8aa5 100644 (file)
@@ -4,7 +4,7 @@
 #include "hpmp/hp-mp-processor.h"
 #include "player/player-damage.h"
 #include "spell-kind/spells-sight.h"
-#include "spell/spell-types.h"
+#include "effect/attribute-types.h"
 #include "status/bad-status-setter.h"
 #include "status/body-improvement.h"
 #include "system/player-type-definition.h"
  * @magic 魔法の効果である場合TRUE (杖と同じ効果の呪文はあったか? 要調査)
  * @powerful 効果が増強される時TRUE (TRUEになるタイミングはあるか? 要調査)
  */
-bool cleansing_nova(player_type *player_ptr, bool magic, bool powerful)
+bool cleansing_nova(PlayerType *player_ptr, bool magic, bool powerful)
 {
     bool ident = false;
-    if (dispel_evil(player_ptr, powerful ? 225 : 150))
+    if (dispel_evil(player_ptr, powerful ? 225 : 150)) {
         ident = true;
+    }
 
     int k = 3 * player_ptr->lev;
-    if (set_protevil(player_ptr, (magic ? 0 : player_ptr->protevil) + randint1(25) + k, false))
+    if (set_protevil(player_ptr, (magic ? 0 : player_ptr->protevil) + randint1(25) + k, false)) {
         ident = true;
+    }
 
     BadStatusSetter bss(player_ptr);
-    if (bss.poison(0))
+    if (bss.poison(0)) {
         ident = true;
+    }
 
-    if (bss.afraidness(0))
+    if (bss.afraidness(0)) {
         ident = true;
+    }
 
-    if (hp_player(player_ptr, 50))
+    if (hp_player(player_ptr, 50)) {
         ident = true;
+    }
 
-    if (bss.stun(0))
+    if (bss.stun(0)) {
         ident = true;
+    }
 
-    if (set_cut(player_ptr, 0))
+    if (bss.cut(0)) {
         ident = true;
+    }
 
     return ident;
 }
@@ -50,18 +57,18 @@ bool cleansing_nova(player_type *player_ptr, bool magic, bool powerful)
  * @param player_ptr プレイヤーへの参照ポインタ
  * @powerful 効果が増強される時TRUE (TRUEになるタイミングはあるか? 要調査)
  */
-bool unleash_mana_storm(player_type *player_ptr, bool powerful)
+bool unleash_mana_storm(PlayerType *player_ptr, bool powerful)
 {
     msg_print(_("強力な魔力が敵を引き裂いた!", "Mighty magics rend your enemies!"));
-    project(player_ptr, 0, (powerful ? 7 : 5), player_ptr->y, player_ptr->x, (randint1(200) + (powerful ? 500 : 300)) * 2, GF_MANA,
+    project(player_ptr, 0, (powerful ? 7 : 5), player_ptr->y, player_ptr->x, (randint1(200) + (powerful ? 500 : 300)) * 2, AttributeType::MANA,
         PROJECT_KILL | PROJECT_ITEM | PROJECT_GRID);
 
-    bool is_special_class = player_ptr->pclass != CLASS_MAGE;
-    is_special_class &= player_ptr->pclass != CLASS_HIGH_MAGE;
-    is_special_class &= player_ptr->pclass != CLASS_SORCERER;
-    is_special_class &= player_ptr->pclass != CLASS_MAGIC_EATER;
-    is_special_class &= player_ptr->pclass != CLASS_BLUE_MAGE;
-    is_special_class &= player_ptr->pclass != CLASS_ELEMENTALIST;
+    bool is_special_class = player_ptr->pclass != PlayerClassType::MAGE;
+    is_special_class &= player_ptr->pclass != PlayerClassType::HIGH_MAGE;
+    is_special_class &= player_ptr->pclass != PlayerClassType::SORCERER;
+    is_special_class &= player_ptr->pclass != PlayerClassType::MAGIC_EATER;
+    is_special_class &= player_ptr->pclass != PlayerClassType::BLUE_MAGE;
+    is_special_class &= player_ptr->pclass != PlayerClassType::ELEMENTALIST;
     if (is_special_class)
         (void)take_hit(player_ptr, DAMAGE_NOESCAPE, 50, _("コントロールし難い強力な魔力の解放", "unleashing magics too mighty to control"));