OSDN Git Service

[Refactor] ブレスのルールを「radが負の値である」ことからフラグ式に変更
authorSlimebreath6078 <slimebreath6078@yahoo.co.jp>
Tue, 22 Feb 2022 09:34:38 +0000 (18:34 +0900)
committerSlimebreath6078 <slimebreath6078@yahoo.co.jp>
Tue, 22 Feb 2022 09:34:38 +0000 (18:34 +0900)
src/effect/effect-processor.cpp
src/mspell/mspell-checker.cpp

index 7f51392..dae682f 100644 (file)
@@ -148,8 +148,7 @@ ProjectResult project(PlayerType *player_ptr, const MONSTER_IDX who, POSITION ra
         }
     }
 
-    if (rad < 0) {
-        rad = 0 - rad;
+    if (flag & (PROJECT_BREATH)) {
         breath = true;
         if (flag & PROJECT_HIDE)
             old_hide = true;
index 216f77a..b6183ba 100644 (file)
@@ -258,7 +258,7 @@ ProjectResult breath(PlayerType *player_ptr, POSITION y, POSITION x, MONSTER_IDX
 {
     auto *m_ptr = &player_ptr->current_floor_ptr->m_list[m_idx];
     auto *r_ptr = &r_info[m_ptr->r_idx];
-    BIT_FLAGS flg = PROJECT_GRID | PROJECT_ITEM | PROJECT_KILL;
+    BIT_FLAGS flg = PROJECT_GRID | PROJECT_ITEM | PROJECT_KILL | PROJECT_BREATH;
     if (target_type == MONSTER_TO_PLAYER) {
         flg |= PROJECT_PLAYER;
     }
@@ -266,8 +266,6 @@ ProjectResult breath(PlayerType *player_ptr, POSITION y, POSITION x, MONSTER_IDX
     if (rad < 1)
         rad = (r_ptr->flags2 & (RF2_POWERFUL)) ? 3 : 2;
 
-    rad = 0 - rad;
-
     return project(player_ptr, m_idx, rad, y, x, dam_hp, typ, flg);
 }