OSDN Git Service

[Refactor] #2243 ロケットをbreath関数から切り離す
authorSlimebreath6078 <slimebreath6078@yahoo.co.jp>
Sun, 20 Feb 2022 15:40:44 +0000 (00:40 +0900)
committerSlimebreath6078 <slimebreath6078@yahoo.co.jp>
Mon, 21 Feb 2022 14:54:08 +0000 (23:54 +0900)
src/mspell/mspell-checker.cpp
src/mspell/mspell-checker.h
src/mspell/mspell-particularity.cpp

index a2450c4..a6e598a 100644 (file)
@@ -266,9 +266,6 @@ ProjectResult breath(PlayerType *player_ptr, POSITION y, POSITION x, MONSTER_IDX
         rad = 0 - rad;
 
     switch (typ) {
-    case AttributeType::ROCKET:
-        flg |= PROJECT_STOP;
-        break;
     case AttributeType::DRAIN_MANA:
     case AttributeType::MIND_BLAST:
     case AttributeType::BRAIN_SMASH:
@@ -286,6 +283,16 @@ ProjectResult breath(PlayerType *player_ptr, POSITION y, POSITION x, MONSTER_IDX
     return project(player_ptr, m_idx, rad, y, x, dam_hp, typ, flg);
 }
 
+ProjectResult rocket(PlayerType *player_ptr, POSITION y, POSITION x, MONSTER_IDX m_idx, AttributeType typ, int dam_hp, POSITION rad, int target_type)
+{
+    BIT_FLAGS flg = PROJECT_GRID | PROJECT_ITEM | PROJECT_KILL | PROJECT_STOP;
+    if (target_type == MONSTER_TO_PLAYER) {
+        flg |= PROJECT_PLAYER;
+    }
+
+    return project(player_ptr, m_idx, rad, y, x, dam_hp, typ, flg);
+}
+
 /*!
  * @brief ID値が非魔術的な特殊技能かどうかを返す /
  * Return TRUE if a spell is inate spell.
index 361e29d..7b14432 100644 (file)
@@ -16,3 +16,4 @@ ProjectResult beam(PlayerType *player_ptr, MONSTER_IDX m_idx, POSITION y, POSITI
 ProjectResult bolt(PlayerType *player_ptr, MONSTER_IDX m_idx, POSITION y, POSITION x, AttributeType typ, int dam_hp, int target_type);
 ProjectResult breath(
     PlayerType *player_ptr, POSITION y, POSITION x, MONSTER_IDX m_idx, AttributeType typ, int dam_hp, POSITION rad, bool breath, int target_type);
+ProjectResult rocket(PlayerType *player_ptr, POSITION y, POSITION x, MONSTER_IDX m_idx, AttributeType typ, int dam_hp, POSITION rad, int target_type);
index 4dc5cdc..c8ec4eb 100644 (file)
@@ -39,7 +39,7 @@ MonsterSpellResult spell_RF4_ROCKET(PlayerType *player_ptr, POSITION y, POSITION
     monspell_message(player_ptr, m_idx, t_idx, msg, target_type);
 
     const auto dam = monspell_damage(player_ptr, MonsterAbilityType::ROCKET, m_idx, DAM_ROLL);
-    const auto proj_res = breath(player_ptr, y, x, m_idx, AttributeType::ROCKET, dam, 2, false, target_type);
+    const auto proj_res = rocket(player_ptr, y, x, m_idx, AttributeType::ROCKET, dam, 2, target_type);
     if (target_type == MONSTER_TO_PLAYER)
         update_smart_learn(player_ptr, m_idx, DRS_SHARD);