OSDN Git Service

モンスターの最大HPに関する修正.
authornothere <nothere@0568b783-4c39-0410-ac80-bf13821ea2a2>
Sun, 4 Jul 2004 03:35:07 +0000 (03:35 +0000)
committernothere <nothere@0568b783-4c39-0410-ac80-bf13821ea2a2>
Sun, 4 Jul 2004 03:35:07 +0000 (03:35 +0000)
* 吸血攻撃でモンスターの最大HPが1未満になるバグを修正.
* 0d*, *d0というHPダイスを認めないようにした. これらはデータ読み込み
  時にそれぞれ1d*, *d1に修正されるようにした.
* HPダイスの面数が1の場合はモンスターの思い出にもFORCE_MAXHPと同様の
  表示をするように修正.
* 悪夢モードでのモンスターの思い出には最大HPも2倍にして表示するように
  修正. ただし自動生成スポイラーでは標準の値を表示する.
* 最大HPにダメージを受けたカメレオンがHPの低いモンスターに変化すると
  最大HPが0になる場合があり, 0除算の原因となるバグを修正.
* 悪夢モードでのカメレオンの変化時に最大HPが2倍にならないバグを修正.

src/cmd1.c
src/init1.c
src/monster1.c
src/monster2.c

index 2e98edf..f16b037 100644 (file)
@@ -2726,6 +2726,7 @@ static void py_attack_aux(int y, int x, bool *fear, bool *mdeath, s16b hand, int
                                }
                                m_ptr->maxhp -= (k+7)/8;
                                if (m_ptr->hp > m_ptr->maxhp) m_ptr->hp = m_ptr->maxhp;
+                               if (m_ptr->maxhp < 1) m_ptr->maxhp = 1;
                                weak = TRUE;
                        }
                        can_drain = FALSE;
index f59682d..2b9e04e 100644 (file)
@@ -2718,8 +2718,8 @@ errr parse_r_info(char *buf, header *head)
 
                /* Save the values */
                r_ptr->speed = spd;
-               r_ptr->hdice = hp1;
-               r_ptr->hside = hp2;
+               r_ptr->hdice = MAX(hp1, 1);
+               r_ptr->hside = MAX(hp2, 1);
                r_ptr->aaf = aaf;
                r_ptr->ac = ac;
                r_ptr->sleep = slp;
index c8a5e90..86e8d94 100644 (file)
@@ -1674,15 +1674,15 @@ if (flags6 & (RF6_S_UNIQUE))        {vp[vn] = "
                            wd_he[msex], r_ptr->ac));
 
                /* Maximized hitpoints */
-               if (flags1 & RF1_FORCE_MAXHP)
+               if ((flags1 & RF1_FORCE_MAXHP) || (r_ptr->hside == 1))
                {
+                       u32b hp = r_ptr->hdice * (ironman_nightmare ? 2 : 1) * r_ptr->hside;
 #ifdef JP
                        hooked_roff(format(" %d ¤ÎÂÎÎϤ¬¤¢¤ë¡£",
 #else
                        hooked_roff(format(" and a life rating of %d.  ",
 #endif
-
-                                   r_ptr->hdice * r_ptr->hside));
+                                   (s16b)MIN(30000, hp)));
                }
 
                /* Variable hitpoints */
@@ -1693,8 +1693,7 @@ if (flags6 & (RF6_S_UNIQUE))        {vp[vn] = "
 #else
                        hooked_roff(format(" and a life rating of %dd%d.  ",
 #endif
-
-                                   r_ptr->hdice, r_ptr->hside));
+                                   r_ptr->hdice * (ironman_nightmare ? 2 : 1), r_ptr->hside));
                }
        }
 
index ad952e8..f33e84d 100644 (file)
@@ -2858,7 +2858,16 @@ void choose_new_monster(int m_idx, bool born, int r_idx)
        {
                m_ptr->max_maxhp = damroll(r_ptr->hdice, r_ptr->hside);
        }
+
+       /* Monsters have double hitpoints in Nightmare mode */
+       if (ironman_nightmare)
+       {
+               u32b hp = m_ptr->max_maxhp * 2L;
+               m_ptr->max_maxhp = (s16b)MIN(30000, hp);
+       }
+
        m_ptr->maxhp = (long)(m_ptr->maxhp * m_ptr->max_maxhp) / oldmaxhp;
+       if (m_ptr->maxhp < 1) m_ptr->maxhp = 1;
        m_ptr->hp = (long)(m_ptr->hp * m_ptr->max_maxhp) / oldmaxhp;
 }