OSDN Git Service

RF3_NONLIVINGの参照をmonster_living()でまとめられる部分をまとめた. こ
authornothere <nothere@0568b783-4c39-0410-ac80-bf13821ea2a2>
Mon, 23 Jun 2003 11:52:31 +0000 (11:52 +0000)
committernothere <nothere@0568b783-4c39-0410-ac80-bf13821ea2a2>
Mon, 23 Jun 2003 11:52:31 +0000 (11:52 +0000)
れに関連し, 以下の修正を含む.
* 魔獣使いがモンスターをモンスター・ボールで捕らえやすい条件がおかし
  く, 無生物/アンデッド/デーモンのみ捕らえやすかったバグを修正.
* 死の光線をモンスターに当てた時の判定にデーモンであることを追加.

src/cmd1.c
src/hissatsu.c
src/monster2.c
src/spells1.c

index 140bdf3..754d37e 100644 (file)
@@ -605,7 +605,7 @@ s16b tot_dam_aux(object_type *o_ptr, int tdam, monster_type *m_ptr, int mode, bo
                                        if (mult < 25) mult = 25;
                                }
                        }
-                       if ((mode == HISSATSU_ZANMA) && (r_ptr->flags3 & (RF3_DEMON | RF3_UNDEAD | RF3_NONLIVING)) && (r_ptr->flags3 & RF3_EVIL))
+                       if ((mode == HISSATSU_ZANMA) && !monster_living(r_ptr) && (r_ptr->flags3 & RF3_EVIL))
                        {
                                if (mult < 15) mult = 25;
                                else if (mult < 50) mult = MIN(50, mult+20);
@@ -624,7 +624,7 @@ s16b tot_dam_aux(object_type *o_ptr, int tdam, monster_type *m_ptr, int mode, bo
                                if (mult == 10) mult = 40;
                                else if (mult < 60) mult = MIN(60, mult+30);
                        }
-                       if ((mode == HISSATSU_SEKIRYUKA) && p_ptr->cut && !(r_ptr->flags3 & (RF3_DEMON | RF3_UNDEAD | RF3_NONLIVING)))
+                       if ((mode == HISSATSU_SEKIRYUKA) && p_ptr->cut && monster_living(r_ptr))
                        {
                                int tmp = MIN(100, MAX(10, p_ptr->cut / 10));
                                if (mult < tmp) mult = tmp;
@@ -2530,13 +2530,13 @@ default:        msg_format("%s
                        drain_result += p_ptr->to_d[hand];
 
                        if ((mode == HISSATSU_SUTEMI) || (mode == HISSATSU_3DAN)) k *= 2;
-                       if ((mode == HISSATSU_SEKIRYUKA) && (r_ptr->flags3 & (RF3_UNDEAD | RF3_DEMON | RF3_NONLIVING))) k = 0;
+                       if ((mode == HISSATSU_SEKIRYUKA) && !monster_living(r_ptr)) k = 0;
                        if ((mode == HISSATSU_SEKIRYUKA) && !p_ptr->cut) k /= 2;
 
                        /* No negative damage */
                        if (k < 0) k = 0;
 
-                       if ((mode == HISSATSU_ZANMA) && !((r_ptr->flags3 & (RF3_DEMON | RF3_UNDEAD | RF3_NONLIVING)) && (r_ptr->flags3 & RF3_EVIL)))
+                       if ((mode == HISSATSU_ZANMA) && !(!monster_living(r_ptr) && (r_ptr->flags3 & RF3_EVIL)))
                        {
                                k = 0;
                        }
index 48eea3e..76ddb6d 100644 (file)
@@ -805,11 +805,11 @@ static bool cast_hissatsu_spell(int spell)
                        /* Hack -- attack monsters */
                        if (c_ptr->m_idx && (m_ptr->ml || cave_floor_bold(y, x)))
                        {
-                               if (r_info[m_list[c_ptr->m_idx].r_idx].flags3 & (RF3_DEMON | RF3_UNDEAD | RF3_NONLIVING))
+                               if (!monster_living(&r_info[m_ptr->r_idx]))
                                {
                                        char m_name[80];
 
-                                       monster_desc(m_name, &m_list[c_ptr->m_idx], 0);
+                                       monster_desc(m_name, m_ptr, 0);
 #ifdef JP
                                        msg_format("%s¤Ë¤Ï¸ú²Ì¤¬¤Ê¤¤¡ª", m_name);
 #else
index f43494d..ed3b189 100644 (file)
@@ -798,14 +798,13 @@ static bool summon_specific_aux(int r_idx)
 
                case SUMMON_HI_DRAGON_LIVING:
                {
-                       okay = ((r_ptr->d_char == 'D') &&
-                              !(r_ptr->flags3 & (RF3_DEMON | RF3_UNDEAD | RF3_NONLIVING)));
+                       okay = ((r_ptr->d_char == 'D') && monster_living(r_ptr));
                        break;
                }
 
                case SUMMON_LIVING:
                {
-                       okay = (!(r_ptr->flags3 & (RF3_DEMON | RF3_UNDEAD | RF3_NONLIVING)));
+                       okay = monster_living(r_ptr);
                        break;
                }
 
@@ -859,7 +858,7 @@ static bool summon_specific_aux(int r_idx)
 
                        for (i = 0; i < 4; i++)
                                if (r_ptr->blow[i].method == RBM_EXPLODE) okay = TRUE;
-                       okay = (okay && (!(r_ptr->flags3 & (RF3_DEMON | RF3_UNDEAD | RF3_NONLIVING))));
+                       okay = (okay && monster_living(r_ptr));
                        break;
                }
 
@@ -2497,9 +2496,7 @@ void update_mon(int m_idx, bool full)
 
                        /* Magical sensing */
                        if ((p_ptr->esp_nonliving) && 
-                           (r_ptr->flags3 & (RF3_NONLIVING)) &&
-                           !(r_ptr->flags3 & (RF3_DEMON)) &&
-                           !(r_ptr->flags3 & (RF3_UNDEAD)))
+                           ((r_ptr->flags3 & (RF3_DEMON | RF3_UNDEAD | RF3_NONLIVING)) == RF3_NONLIVING))
                        {
                                flag = TRUE;
                                r_ptr->r_flags3 |= (RF3_NONLIVING);
index 3faa25c..9f157fd 100644 (file)
@@ -3335,14 +3335,11 @@ note = "
                        }
                        if (!monster_living(r_ptr))
                        {
-                               if (r_ptr->flags3 & RF3_UNDEAD)
-                               {
-                                       if (seen) r_ptr->r_flags3 |= (RF3_UNDEAD);
-                               }
-
-                               if (r_ptr->flags3 & (RF3_DEMON))
+                               if (seen)
                                {
-                                       if (seen) r_ptr->r_flags3 |= (RF3_DEMON);
+                                       if (r_ptr->flags3 & RF3_DEMON) r_ptr->r_flags3 |= (RF3_DEMON);
+                                       if (r_ptr->flags3 & RF3_UNDEAD) r_ptr->r_flags3 |= (RF3_UNDEAD);
+                                       if (r_ptr->flags3 & RF3_NONLIVING) r_ptr->r_flags3 |= (RF3_NONLIVING);
                                }
 
 #ifdef JP
@@ -3375,11 +3372,13 @@ note = "
                                if (seen) r_ptr->r_flagsr |= (RFR_RES_ALL);
                                break;
                        }
-                       if (r_ptr->flags3 & (RF3_UNDEAD | RF3_NONLIVING))
+                       if (!monster_living(r_ptr))
                        {
-                               if (r_ptr->flags3 & RF3_UNDEAD)
+                               if (seen)
                                {
-                                       if (seen) r_ptr->r_flags3 |= (RF3_UNDEAD);
+                                       if (r_ptr->flags3 & RF3_DEMON) r_ptr->r_flags3 |= (RF3_DEMON);
+                                       if (r_ptr->flags3 & RF3_UNDEAD) r_ptr->r_flags3 |= (RF3_UNDEAD);
+                                       if (r_ptr->flags3 & RF3_NONLIVING) r_ptr->r_flags3 |= (RF3_NONLIVING);
                                }
 
 #ifdef JP
@@ -4187,7 +4186,7 @@ msg_format("%s
                        /* Attempt a saving throw */
                        if ((r_ptr->flags1 & (RF1_QUESTOR)) ||
                            (m_ptr->mflag2 & MFLAG2_NOPET) ||
-                                (r_ptr->flags3 & (RF3_DEMON | RF3_UNDEAD | RF3_NONLIVING)) ||
+                                !monster_living(r_ptr) ||
                                 ((r_ptr->level+10) > randint1(dam)))
                        {
                                /* Resist */
@@ -5366,11 +5365,11 @@ msg_format("%s
                        }
 
                        if (is_pet(m_ptr)) nokori_hp = m_ptr->maxhp*4L;
-                       else if ((p_ptr->pclass == CLASS_BEASTMASTER) && (r_ptr->flags3 & (RF3_DEMON | RF3_UNDEAD | RF3_NONLIVING)))
+                       else if ((p_ptr->pclass == CLASS_BEASTMASTER) && monster_living(r_ptr))
                                nokori_hp = m_ptr->maxhp * 3 / 10;
                        else
                                nokori_hp = m_ptr->maxhp * 3 / 20;
-                       
+
                        if (m_ptr->hp >= nokori_hp)
                        {
 #ifdef JP