OSDN Git Service

Fix warning of Doxygen comment to files.c.
[hengband/hengband.git] / src / monster2.c
index 3f4483c..dc3a414 100644 (file)
@@ -3660,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))
@@ -3669,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))
        {
@@ -3682,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))
        {
@@ -3826,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;
@@ -3842,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;