- for(d = 1; d < 6; d++)
- {
- for(j = 1000; j > 0; j--)
- {
- scatter(&cy, &cx, py, px, d, 0);
- if ((cave_floor_bold(cy, cx) || (cave[cy][cx].feat == FEAT_TREES)) && !cave[cy][cx].m_idx && !((cy == py) && (cx == px))) break;
- }
- if (j) break;
- }
- if (d == 6 || p_ptr->inside_arena || p_ptr->inside_battle)
- m_idx = 0;
- else
- m_idx = m_pop();
- }
-
- if (m_idx)
- {
- monster_type *m_ptr = &m_list[m_idx];
- monster_race *r_ptr = &r_info[m_ptr->r_idx];
-
- cave[cy][cx].m_idx = m_idx;
- m_ptr->r_idx = party_mon[i].r_idx;
- m_ptr->fy = cy;
- m_ptr->fx = cx;
- m_ptr->cdis = party_mon[i].cdis;
- m_ptr->mflag = party_mon[i].mflag;
- m_ptr->mflag2 = party_mon[i].mflag2;
- m_ptr->ml = TRUE;
- m_ptr->hp = party_mon[i].hp;
- m_ptr->maxhp = party_mon[i].maxhp;
- m_ptr->max_maxhp = party_mon[i].max_maxhp;
- m_ptr->mspeed = party_mon[i].mspeed;
- m_ptr->fast = party_mon[i].fast;
- m_ptr->slow = party_mon[i].slow;
- m_ptr->stunned = party_mon[i].stunned;
- m_ptr->confused = party_mon[i].confused;
- m_ptr->monfear = party_mon[i].monfear;
- m_ptr->invulner = party_mon[i].invulner;
- m_ptr->smart = party_mon[i].smart;
- m_ptr->csleep = 0;
- m_ptr->nickname = party_mon[i].nickname;
- m_ptr->energy = party_mon[i].energy;
- m_ptr->exp = party_mon[i].exp;
- set_pet(m_ptr);
-
- if ((r_ptr->flags1 & RF1_FORCE_SLEEP) && !ironman_nightmare)
- {
- /* Monster is still being nice */
- m_ptr->mflag |= (MFLAG_NICE);
-
- /* Must repair monsters */
- repair_monsters = TRUE;
- }
-
- /* Update the monster */
- update_mon(m_idx, TRUE);
- lite_spot(cy, cx);
-
- r_ptr->cur_num++;
-
- /* Hack -- Count the number of "reproducers" */
- if (r_ptr->flags2 & RF2_MULTIPLY) num_repro++;
-
- /* Hack -- Notice new multi-hued monsters */
- if (r_ptr->flags1 & RF1_ATTR_MULTI) shimmer_monsters = TRUE;
- }
- else