OSDN Git Service

Fix warning of Doxygen comment to files.c.
[hengband/hengband.git] / src / monster2.c
index 6070226..dc3a414 100644 (file)
@@ -2867,6 +2867,9 @@ void choose_new_monster(int m_idx, bool born, int r_idx)
        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;
+       
+       /* reset dealt_damage */
+       m_ptr->dealt_damage = 0;
 }
 
 
@@ -3245,6 +3248,10 @@ msg_print("
        if (m_ptr->r_idx == MON_WOUNDED_BEAR)
                m_ptr->hp = m_ptr->maxhp / 2;
        else m_ptr->hp = m_ptr->maxhp;
+       
+       
+       /* dealt damage is 0 at initial*/
+       m_ptr->dealt_damage = 0;
 
 
        /* Extract the monster base speed */
@@ -3653,7 +3660,7 @@ static bool place_monster_okay(int r_idx)
  */
 bool place_monster_aux(int who, int y, int x, int r_idx, u32b mode)
 {
-       int             i;
+       int             i, j, n;
        monster_race    *r_ptr = &r_info[r_idx];
 
        if (!(mode & PM_NO_KAGE) && one_in_(333))
@@ -3662,12 +3669,24 @@ bool place_monster_aux(int who, int y, int x, int r_idx, u32b mode)
        /* Place one monster, or fail */
        if (!place_monster_one(who, y, x, r_idx, mode)) return (FALSE);
 
-
        /* Require the "group" flag */
        if (!(mode & PM_ALLOW_GROUP)) return (TRUE);
 
        place_monster_m_idx = hack_m_idx_ii;
 
+       /* Reinforcement */
+       for(i = 0; i < 6; i++)
+       {
+               if(!r_ptr->reinforce_id[i]) break;
+               n = damroll(r_ptr->reinforce_dd[i], r_ptr->reinforce_ds[i]);
+               for(j = 0; j < n; j++)
+               {
+                       int nx, ny, z, d = 7;
+                       scatter(&ny, &nx, y, x, d, 0);
+                       (void)place_monster_one(place_monster_m_idx, ny, nx, r_ptr->reinforce_id[i], mode);
+               }
+       }
+
        /* Friends for certain monsters */
        if (r_ptr->flags1 & (RF1_FRIENDS))
        {
@@ -3675,7 +3694,6 @@ bool place_monster_aux(int who, int y, int x, int r_idx, u32b mode)
                (void)place_monster_group(who, y, x, r_idx, mode);
        }
 
-
        /* Escorts for certain monsters */
        if (r_ptr->flags1 & (RF1_ESCORT))
        {
@@ -3819,10 +3837,10 @@ bool alloc_guardian(bool def_val)
        {
                int oy;
                int ox;
-               int try = 4000;
+               int try_count = 4000;
 
                /* Find a good position */
-               while (try)
+               while (try_count)
                {
                        /* Get a random spot */
                        oy = randint1(cur_hgt - 4) + 2;
@@ -3835,8 +3853,8 @@ bool alloc_guardian(bool def_val)
                                if (place_monster_aux(0, oy, ox, guardian, (PM_ALLOW_GROUP | PM_NO_KAGE | PM_NO_PET))) return TRUE;
                        }
 
-                       /* One less try */
-                       try--;
+                       /* One less try count */
+                       try_count--;
                }
 
                return FALSE;