OSDN Git Service

[Refactor] #40480 Reshaped monst_spell_monst()
authorHourier <hourier@users.sourceforge.jp>
Wed, 22 Jul 2020 12:19:30 +0000 (21:19 +0900)
committerHourier <hourier@users.sourceforge.jp>
Wed, 22 Jul 2020 12:19:30 +0000 (21:19 +0900)
src/melee/melee-spell.c

index 30d6adb..b4ac5f0 100644 (file)
@@ -137,17 +137,13 @@ bool monst_spell_monst(player_type *target_ptr, MONSTER_IDX m_idx)
     ms_ptr->x = ms_ptr->t_ptr->fx;
     reset_target(ms_ptr->m_ptr);
     ms_ptr->f6 &= ~(RF6_WORLD | RF6_TRAPS | RF6_FORGET);
-    if (ms_ptr->f4 & RF4_BR_LITE) {
-        if (!los(target_ptr, ms_ptr->m_ptr->fy, ms_ptr->m_ptr->fx, ms_ptr->t_ptr->fy, ms_ptr->t_ptr->fx))
-            ms_ptr->f4 &= ~(RF4_BR_LITE);
-    }
+    if (((ms_ptr->f4 & RF4_BR_LITE) != 0) && !los(target_ptr, ms_ptr->m_ptr->fy, ms_ptr->m_ptr->fx, ms_ptr->t_ptr->fy, ms_ptr->t_ptr->fx))
+        ms_ptr->f4 &= ~(RF4_BR_LITE);
 
-    if (ms_ptr->f6 & RF6_SPECIAL) {
-        if ((ms_ptr->m_ptr->r_idx != MON_ROLENTO) && (ms_ptr->r_ptr->d_char != 'B'))
-            ms_ptr->f6 &= ~(RF6_SPECIAL);
-    }
+    if (((ms_ptr->f6 & RF6_SPECIAL) != 0) && (ms_ptr->m_ptr->r_idx != MON_ROLENTO) && (ms_ptr->r_ptr->d_char != 'B'))
+        ms_ptr->f6 &= ~(RF6_SPECIAL);
 
-    if (ms_ptr->f6 & RF6_DARKNESS) {
+    if ((ms_ptr->f6 & RF6_DARKNESS) != 0) {
         bool vs_ninja = (target_ptr->pclass == CLASS_NINJA) && !is_hostile(ms_ptr->t_ptr);
         bool can_use_lite_area = vs_ninja && !(ms_ptr->r_ptr->flags3 & (RF3_UNDEAD | RF3_HURT_LITE)) && !(ms_ptr->r_ptr->flags7 & RF7_DARK_MASK);
         if (!(ms_ptr->r_ptr->flags2 & RF2_STUPID)) {