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;
}
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 */
*/
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))
/* 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))
{
(void)place_monster_group(who, y, x, r_idx, mode);
}
-
/* Escorts for certain monsters */
if (r_ptr->flags1 & (RF1_ESCORT))
{
{
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;
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;