OSDN Git Service

[Refactor] struct player_type を class PlayerType に置換。
[hengbandforosx/hengbandosx.git] / src / spell / spells-staff-only.cpp
index 5792630..a9b8aa5 100644 (file)
@@ -1,67 +1,76 @@
 #include "spell/spells-staff-only.h"
-#include "core/hp-mp-processor.h"
 #include "effect/effect-characteristics.h"
 #include "effect/effect-processor.h"
+#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"
 #include "view/display-messages.h"
 
 /*!
  * @brief 聖浄の杖の効果
- * @param creature_ptr プレーヤーへの参照ポインタ
+ * @param player_ptr プレイヤーへの参照ポインタ
  * @magic 魔法の効果である場合TRUE (杖と同じ効果の呪文はあったか? 要調査)
  * @powerful 効果が増強される時TRUE (TRUEになるタイミングはあるか? 要調査)
  */
-bool cleansing_nova(player_type *creature_ptr, bool magic, bool powerful)
+bool cleansing_nova(PlayerType *player_ptr, bool magic, bool powerful)
 {
-    bool ident = FALSE;
-    if (dispel_evil(creature_ptr, powerful ? 225 : 150))
-        ident = TRUE;
+    bool ident = false;
+    if (dispel_evil(player_ptr, powerful ? 225 : 150)) {
+        ident = true;
+    }
 
-    int k = 3 * creature_ptr->lev;
-    if (set_protevil(creature_ptr, (magic ? 0 : creature_ptr->protevil) + randint1(25) + k, FALSE))
-        ident = TRUE;
+    int k = 3 * player_ptr->lev;
+    if (set_protevil(player_ptr, (magic ? 0 : player_ptr->protevil) + randint1(25) + k, false)) {
+        ident = true;
+    }
 
-    if (set_poisoned(creature_ptr, 0))
-        ident = TRUE;
+    BadStatusSetter bss(player_ptr);
+    if (bss.poison(0)) {
+        ident = true;
+    }
 
-    if (set_afraid(creature_ptr, 0))
-        ident = TRUE;
+    if (bss.afraidness(0)) {
+        ident = true;
+    }
 
-    if (hp_player(creature_ptr, 50))
-        ident = TRUE;
+    if (hp_player(player_ptr, 50)) {
+        ident = true;
+    }
 
-    if (set_stun(creature_ptr, 0))
-        ident = TRUE;
+    if (bss.stun(0)) {
+        ident = true;
+    }
 
-    if (set_cut(creature_ptr, 0))
-        ident = TRUE;
+    if (bss.cut(0)) {
+        ident = true;
+    }
 
     return ident;
 }
 
 /*!
  * @brief 魔力の嵐の杖の効果
- * @param creature_ptr プレーヤーへの参照ポインタ
+ * @param player_ptr プレイヤーへの参照ポインタ
  * @powerful 効果が増強される時TRUE (TRUEになるタイミングはあるか? 要調査)
  */
-bool unleash_mana_storm(player_type *creature_ptr, bool powerful)
+bool unleash_mana_storm(PlayerType *player_ptr, bool powerful)
 {
     msg_print(_("強力な魔力が敵を引き裂いた!", "Mighty magics rend your enemies!"));
-    project(creature_ptr, 0, (powerful ? 7 : 5), creature_ptr->y, creature_ptr->x, (randint1(200) + (powerful ? 500 : 300)) * 2, GF_MANA,
-        PROJECT_KILL | PROJECT_ITEM | PROJECT_GRID, -1);
+    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 = creature_ptr->pclass != CLASS_MAGE;
-    is_special_class &= creature_ptr->pclass != CLASS_HIGH_MAGE;
-    is_special_class &= creature_ptr->pclass != CLASS_SORCERER;
-    is_special_class &= creature_ptr->pclass != CLASS_MAGIC_EATER;
-    is_special_class &= creature_ptr->pclass != CLASS_BLUE_MAGE;
-    is_special_class &= creature_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(creature_ptr, DAMAGE_NOESCAPE, 50, _("コントロールし難い強力な魔力の解放", "unleashing magics too mighty to control"), -1);
+        (void)take_hit(player_ptr, DAMAGE_NOESCAPE, 50, _("コントロールし難い強力な魔力の解放", "unleashing magics too mighty to control"));
 
-    return TRUE;
+    return true;
 }