}
else if ((which == 2) && p_ptr->inside_arena)
{
- if (!p_ptr->exit_bldg && m_cnt > 0)
+ if (!p_ptr->exit_bldg && current_floor_ptr->m_cnt > 0)
{
prt(_("ゲートは閉まっている。モンスターがあなたを待っている!", "The gates are closed. The monster awaits!"), 0, 0);
}
C_MAKE(who, current_floor_ptr->max_m_idx, MONSTER_IDX);
/* Process the monsters (backwards) */
- for (pet_ctr = m_max - 1; pet_ctr >= 1; pet_ctr--)
+ for (pet_ctr = current_floor_ptr->m_max - 1; pet_ctr >= 1; pet_ctr--)
{
if (is_pet(¤t_floor_ptr->m_list[pet_ctr]) && (p_ptr->riding != pet_ctr))
who[max_pet++] = pet_ctr;
monster_race *r_ptr;
msg_print(_("奇妙な場所が頭の中に浮かんだ...", "Some strange places show up in your mind. And you see ..."));
/* Process the monsters (backwards) */
- for (i = m_max - 1; i >= 1; i--)
+ for (i = current_floor_ptr->m_max - 1; i >= 1; i--)
{
/* Access the monster */
m_ptr = ¤t_floor_ptr->m_list[i];
total_friends = 0;
- for (m_idx = m_max - 1; m_idx >= 1; m_idx--)
+ for (m_idx = current_floor_ptr->m_max - 1; m_idx >= 1; m_idx--)
{
monster_type *m_ptr;
monster_race *r_ptr;
C_MAKE(who, current_floor_ptr->max_m_idx, MONSTER_IDX);
/* Process the monsters (backwards) */
- for (pet_ctr = m_max - 1; pet_ctr >= 1; pet_ctr--)
+ for (pet_ctr = current_floor_ptr->m_max - 1; pet_ctr >= 1; pet_ctr--)
{
if (is_pet(¤t_floor_ptr->m_list[pet_ctr]))
who[max_pet++] = pet_ctr;
case PET_DISMISS: /* Dismiss pets */
{
/* Check pets (backwards) */
- for (pet_ctr = m_max - 1; pet_ctr >= 1; pet_ctr--)
+ for (pet_ctr = current_floor_ptr->m_max - 1; pet_ctr >= 1; pet_ctr--)
{
/* Player has pet */
if (is_pet(¤t_floor_ptr->m_list[pet_ctr])) break;
if (p_ptr->pet_extra_flags & PF_PICKUP_ITEMS)
{
p_ptr->pet_extra_flags &= ~(PF_PICKUP_ITEMS);
- for (pet_ctr = m_max - 1; pet_ctr >= 1; pet_ctr--)
+ for (pet_ctr = current_floor_ptr->m_max - 1; pet_ctr >= 1; pet_ctr--)
{
/* Access the monster */
m_ptr = ¤t_floor_ptr->m_list[pet_ctr];
}
/* Process the monsters (backwards) */
- for (i = m_max - 1; i >= 1; i--)
+ for (i = current_floor_ptr->m_max - 1; i >= 1; i--)
{
/* Access the monster */
m_ptr = ¤t_floor_ptr->m_list[i];
/* Regenerate everyone */
- for (i = 1; i < m_max; i++)
+ for (i = 1; i < current_floor_ptr->m_max; i++)
{
/* Check the i'th monster */
monster_type *m_ptr = ¤t_floor_ptr->m_list[i];
int danger_amount = 0;
MONSTER_IDX monster;
- for (monster = 0; monster < m_max; monster++)
+ for (monster = 0; monster < current_floor_ptr->m_max; monster++)
{
monster_type *m_ptr = ¤t_floor_ptr->m_list[monster];
monster_race *r_ptr = &r_info[m_ptr->r_idx];
if (p_ptr->inside_battle)
{
- for(m_idx = 1; m_idx < m_max; m_idx++)
+ for(m_idx = 1; m_idx < current_floor_ptr->m_max; m_idx++)
{
monster_type *m_ptr = ¤t_floor_ptr->m_list[m_idx];
shimmer_monsters = FALSE;
/* Shimmer multi-hued monsters */
- for (m_idx = 1; m_idx < m_max; m_idx++)
+ for (m_idx = 1; m_idx < current_floor_ptr->m_max; m_idx++)
{
monster_type *m_ptr;
monster_race *r_ptr;
repair_monsters = FALSE;
/* Rotate detection flags */
- for (m_idx = 1; m_idx < m_max; m_idx++)
+ for (m_idx = 1; m_idx < current_floor_ptr->m_max; m_idx++)
{
monster_type *m_ptr;
m_ptr = ¤t_floor_ptr->m_list[m_idx];
while (TRUE)
{
/* Hack -- Compact the monster list occasionally */
- if ((m_cnt + 32 > current_floor_ptr->max_m_idx) && !p_ptr->inside_battle) compact_monsters(64);
+ if ((current_floor_ptr->m_cnt + 32 > current_floor_ptr->max_m_idx) && !p_ptr->inside_battle) compact_monsters(64);
/* Hack -- Compress the monster list occasionally */
- if ((m_cnt + 32 < m_max) && !p_ptr->inside_battle) compact_monsters(0);
+ if ((current_floor_ptr->m_cnt + 32 < current_floor_ptr->m_max) && !p_ptr->inside_battle) compact_monsters(0);
/* Hack -- Compact the object list occasionally */
if (p_ptr->riding == -1)
{
p_ptr->riding = 0;
- for (i = m_max; i > 0; i--)
+ for (i = current_floor_ptr->m_max; i > 0; i--)
{
if (player_bold(current_floor_ptr->m_list[i].fy, current_floor_ptr->m_list[i].fx))
{
extern bool shimmer_objects;
extern bool repair_monsters;
extern bool repair_objects;
-extern MONSTER_IDX m_max;
-extern MONSTER_IDX m_cnt;
extern MONSTER_IDX hack_m_idx;
extern MONSTER_IDX hack_m_idx_ii;
extern int total_friends;
bool pet_settings = FALSE;
GAME_TEXT pet_name[MAX_NLEN];
- for (i = m_max - 1; i >= 1; i--)
+ for (i = current_floor_ptr->m_max - 1; i >= 1; i--)
{
monster_type *m_ptr = ¤t_floor_ptr->m_list[i];
if (!current_floor_ptr->dun_level) return 0;
/* Examine each monster */
- for (i = 1; i < m_max; i++)
+ for (i = 1; i < current_floor_ptr->m_max; i++)
{
monster_type *m_ptr = ¤t_floor_ptr->m_list[i];
monster_race *r_ptr;
monster_race *r_ptr;
/* Loop through monsters, adding newly lit squares to changes list */
- for (i = 1; i < m_max; i++)
+ for (i = 1; i < current_floor_ptr->m_max; i++)
{
m_ptr = ¤t_floor_ptr->m_list[i];
r_ptr = &r_info[m_ptr->r_idx];
place_monster_aux(0, p_ptr->y + 8 + (i/2)*4, p_ptr->x - 2 + (i%2)*4, battle_mon[i], (PM_NO_KAGE | PM_NO_PET));
set_friendly(¤t_floor_ptr->m_list[current_floor_ptr->grid_array[p_ptr->y+8+(i/2)*4][p_ptr->x-2+(i%2)*4].m_idx]);
}
- for(i = 1; i < m_max; i++)
+ for(i = 1; i < current_floor_ptr->m_max; i++)
{
monster_type *m_ptr = ¤t_floor_ptr->m_list[i];
/* Very simplified version of wipe_m_list() */
for (i = 1; i < max_r_idx; i++)
r_info[i].cur_num = 0;
- (void)C_WIPE(current_floor_ptr->m_list, m_max, monster_type);
- m_max = 1;
- m_cnt = 0;
+ (void)C_WIPE(current_floor_ptr->m_list, current_floor_ptr->m_max, monster_type);
+ current_floor_ptr->m_max = 1;
+ current_floor_ptr->m_cnt = 0;
for (i = 0; i < MAX_MTIMED; i++) current_floor_ptr->mproc_max[i] = 0;
/* Pre-calc cur_num of pets in party_mon[] */
okay = FALSE;
}
/* Prevent monster over-flow */
- else if (m_max >= current_floor_ptr->max_m_idx)
+ else if (current_floor_ptr->m_max >= current_floor_ptr->max_m_idx)
{
why = _("モンスターが多すぎる", "too many monsters");
okay = FALSE;
*/
if (!p_ptr->wild_mode && !p_ptr->inside_arena && !p_ptr->inside_battle)
{
- for (i = m_max - 1, num = 1; (i >= 1 && num < MAX_PARTY_MON); i--)
+ for (i = current_floor_ptr->m_max - 1, num = 1; (i >= 1 && num < MAX_PARTY_MON); i--)
{
monster_type *m_ptr = ¤t_floor_ptr->m_list[i];
if (record_named_pet)
{
- for (i = m_max - 1; i >=1; i--)
+ for (i = current_floor_ptr->m_max - 1; i >=1; i--)
{
monster_type *m_ptr = ¤t_floor_ptr->m_list[i];
GAME_TEXT m_name[MAX_NLEN];
/* Pet of other pet may disappear. */
- for (i = m_max - 1; i >=1; i--)
+ for (i = current_floor_ptr->m_max - 1; i >=1; i--)
{
monster_type *m_ptr = ¤t_floor_ptr->m_list[i];
int i;
/* Maintain unique monsters */
- for (i = 1; i < m_max; i++)
+ for (i = 1; i < current_floor_ptr->m_max; i++)
{
monster_race *r_ptr;
monster_type *m_ptr = ¤t_floor_ptr->m_list[i];
}
/* Maintain quest monsters */
- for (i = 1; i < m_max; i++)
+ for (i = 1; i < current_floor_ptr->m_max; i++)
{
monster_race *r_ptr;
monster_type *m_ptr = ¤t_floor_ptr->m_list[i];
absence_ticks = (current_world_ptr->game_turn - tmp_last_visit) / TURNS_PER_TICK;
/* Maintain monsters */
- for (i = 1; i < m_max; i++)
+ for (i = 1; i < current_floor_ptr->m_max; i++)
{
monster_race *r_ptr;
monster_type *m_ptr = ¤t_floor_ptr->m_list[i];
monster_type *m_list; /*!< The array of dungeon monsters [current_floor_ptr->max_m_idx] */
MONSTER_IDX max_m_idx; /*!< Maximum number of monsters in the level */
+ MONSTER_IDX m_max; /* Number of allocated monsters */
+ MONSTER_IDX m_cnt; /* Number of live monsters */
s16b *mproc_list[MAX_MTIMED]; /*!< The array to process dungeon monsters[max_m_idx] */
s16b mproc_max[MAX_MTIMED]; /*!< Number of monsters to be processed */
{
if (p_ptr->inside_battle)
{
- start = randint1(m_max-1)+m_max;
+ start = randint1(current_floor_ptr->m_max-1)+current_floor_ptr->m_max;
if(randint0(2)) plus = -1;
}
- else start = m_max + 1;
+ else start = current_floor_ptr->m_max + 1;
/* Scan thru all monsters */
- for (i = start; ((i < start + m_max) && (i > start - m_max)); i+=plus)
+ for (i = start; ((i < start + current_floor_ptr->m_max) && (i > start - current_floor_ptr->m_max)); i+=plus)
{
- MONSTER_IDX dummy = (i % m_max);
+ MONSTER_IDX dummy = (i % current_floor_ptr->m_max);
if (!dummy) continue;
/* Process the monsters (backwards) */
- for (i = m_max - 1; i >= 1; i--)
+ for (i = current_floor_ptr->m_max - 1; i >= 1; i--)
{
/* Access the monster */
m_ptr = ¤t_floor_ptr->m_list[i];
for (cmi = 0; cmi < MAX_MTIMED; cmi++) current_floor_ptr->mproc_max[cmi] = 0;
/* Process the monsters (backwards) */
- for (i = m_max - 1; i >= 1; i--)
+ for (i = current_floor_ptr->m_max - 1; i >= 1; i--)
{
/* Access the monster */
m_ptr = ¤t_floor_ptr->m_list[i];
(void)WIPE(m_ptr, monster_type);
/* Count monsters */
- m_cnt--;
+ current_floor_ptr->m_cnt--;
lite_spot(y, x);
if (r_ptr->flags7 & (RF7_LITE_MASK | RF7_DARK_MASK))
/* Hack -- Update parent index */
if (is_pet(m_ptr))
{
- for (i = 1; i < m_max; i++)
+ for (i = 1; i < current_floor_ptr->m_max; i++)
{
monster_type *m2_ptr = ¤t_floor_ptr->m_list[i];
cur_dis = 5 * (20 - cnt);
/* Check all the monsters */
- for (i = 1; i < m_max; i++)
+ for (i = 1; i < current_floor_ptr->m_max; i++)
{
monster_type *m_ptr = ¤t_floor_ptr->m_list[i];
/* Excise dead monsters (backwards!) */
- for (i = m_max - 1; i >= 1; i--)
+ for (i = current_floor_ptr->m_max - 1; i >= 1; i--)
{
/* Get the i'th monster */
monster_type *m_ptr = ¤t_floor_ptr->m_list[i];
if (m_ptr->r_idx) continue;
/* Move last monster into open hole */
- compact_monsters_aux(m_max - 1, i);
+ compact_monsters_aux(current_floor_ptr->m_max - 1, i);
- /* Compress "m_max" */
- m_max--;
+ /* Compress "current_floor_ptr->m_max" */
+ current_floor_ptr->m_max--;
}
}
}
/* Delete all the monsters */
- for (i = m_max - 1; i >= 1; i--)
+ for (i = current_floor_ptr->m_max - 1; i >= 1; i--)
{
monster_type *m_ptr = ¤t_floor_ptr->m_list[i];
if (!monster_is_valid(m_ptr)) continue;
/* Hack -- Wipe the racial counter of all monster races */
for (i = 1; i < max_r_idx; i++) r_info[i].cur_num = 0;
- /* Reset "m_max" */
- m_max = 1;
+ /* Reset "current_floor_ptr->m_max" */
+ current_floor_ptr->m_max = 1;
- /* Reset "m_cnt" */
- m_cnt = 0;
+ /* Reset "current_floor_ptr->m_cnt" */
+ current_floor_ptr->m_cnt = 0;
/* Reset "current_floor_ptr->mproc_max[]" */
for (i = 0; i < MAX_MTIMED; i++) current_floor_ptr->mproc_max[i] = 0;
MONSTER_IDX i;
/* Normal allocation */
- if (m_max < current_floor_ptr->max_m_idx)
+ if (current_floor_ptr->m_max < current_floor_ptr->max_m_idx)
{
/* Access the next hole */
- i = m_max;
+ i = current_floor_ptr->m_max;
/* Expand the array */
- m_max++;
+ current_floor_ptr->m_max++;
/* Count monsters */
- m_cnt++;
+ current_floor_ptr->m_cnt++;
/* Return the index */
return (i);
}
/* Recycle dead monsters */
- for (i = 1; i < m_max; i++)
+ for (i = 1; i < current_floor_ptr->m_max; i++)
{
monster_type *m_ptr;
if (m_ptr->r_idx) continue;
/* Count monsters */
- m_cnt++;
+ current_floor_ptr->m_cnt++;
/* Use this monster */
return (i);
MONSTER_IDX i;
/* Update each (live) monster */
- for (i = 1; i < m_max; i++)
+ for (i = 1; i < current_floor_ptr->m_max; i++)
{
monster_type *m_ptr = ¤t_floor_ptr->m_list[i];
if (!monster_is_valid(m_ptr)) continue;
if (p_ptr->inside_battle)
{
- start = randint1(m_max-1) + m_max;
+ start = randint1(current_floor_ptr->m_max-1) + current_floor_ptr->m_max;
if (randint0(2)) plus = -1;
}
- else start = m_max + 1;
+ else start = current_floor_ptr->m_max + 1;
/* Scan thru all monsters */
- for (i = start; ((i < start + m_max) && (i > start - m_max)); i += plus)
+ for (i = start; ((i < start + current_floor_ptr->m_max) && (i > start - current_floor_ptr->m_max)); i += plus)
{
- MONSTER_IDX dummy = (i % m_max);
+ MONSTER_IDX dummy = (i % current_floor_ptr->m_max);
if (!dummy) continue;
target_idx = dummy;
if (!r_info[MON_BANOR].cur_num || !r_info[MON_LUPART].cur_num)
return -1;
- for (k = 1; k < m_max; k++)
+ for (k = 1; k < current_floor_ptr->m_max; k++)
{
if (current_floor_ptr->m_list[k].r_idx == MON_BANOR || current_floor_ptr->m_list[k].r_idx == MON_LUPART)
{
p_ptr->align = 0;
int i, j, neutral[2];
- for (m_idx = m_max - 1; m_idx >= 1; m_idx--)
+ for (m_idx = current_floor_ptr->m_max - 1; m_idx >= 1; m_idx--)
{
monster_type *m_ptr;
monster_race *r_ptr;
/*** Dump the monsters ***/
/* Total monsters */
- wr_u16b(m_max);
+ wr_u16b(current_floor_ptr->m_max);
/* Dump the monsters */
- for (i = 1; i < m_max; i++)
+ for (i = 1; i < current_floor_ptr->m_max; i++)
{
monster_type *m_ptr = ¤t_floor_ptr->m_list[i];
}
if (!count)
{
- for (i = m_max - 1; i > 0; i--)
+ for (i = current_floor_ptr->m_max - 1; i > 0; i--)
{
m_ptr = ¤t_floor_ptr->m_list[i];
if (!monster_is_valid(m_ptr)) continue;
if (d_info[p_ptr->dungeon_idx].flags1 & DF1_DARKNESS) range /= 3;
- for (i = 1; i < m_max; i++)
+ for (i = 1; i < current_floor_ptr->m_max; i++)
{
monster_type *m_ptr = ¤t_floor_ptr->m_list[i];
monster_race *r_ptr = &r_info[m_ptr->r_idx];
if (d_info[p_ptr->dungeon_idx].flags1 & DF1_DARKNESS) range /= 3;
- for (i = 1; i < m_max; i++)
+ for (i = 1; i < current_floor_ptr->m_max; i++)
{
monster_type *m_ptr = ¤t_floor_ptr->m_list[i];
monster_race *r_ptr = &r_info[m_ptr->r_idx];
if (d_info[p_ptr->dungeon_idx].flags1 & DF1_DARKNESS) range /= 3;
- for (i = 1; i < m_max; i++)
+ for (i = 1; i < current_floor_ptr->m_max; i++)
{
monster_type *m_ptr = ¤t_floor_ptr->m_list[i];
monster_race *r_ptr = &r_info[m_ptr->r_idx];
if (d_info[p_ptr->dungeon_idx].flags1 & DF1_DARKNESS) range /= 3;
- for (i = 1; i < m_max; i++)
+ for (i = 1; i < current_floor_ptr->m_max; i++)
{
monster_type *m_ptr = ¤t_floor_ptr->m_list[i];
if (!monster_is_valid(m_ptr)) continue;
if (d_info[p_ptr->dungeon_idx].flags1 & DF1_DARKNESS) range /= 3;
- for (i = 1; i < m_max; i++)
+ for (i = 1; i < current_floor_ptr->m_max; i++)
{
monster_type *m_ptr = ¤t_floor_ptr->m_list[i];
monster_race *r_ptr = &r_info[m_ptr->r_idx];
if (d_info[p_ptr->dungeon_idx].flags1 & DF1_DARKNESS) range /= 3;
- for (i = 1; i < m_max; i++)
+ for (i = 1; i < current_floor_ptr->m_max; i++)
{
monster_type *m_ptr = ¤t_floor_ptr->m_list[i];
monster_race *r_ptr = &r_info[m_ptr->r_idx];
if (d_info[p_ptr->dungeon_idx].flags1 & DF1_DARKNESS) range /= 3;
- for (i = 1; i < m_max; i++)
+ for (i = 1; i < current_floor_ptr->m_max; i++)
{
monster_type *m_ptr = ¤t_floor_ptr->m_list[i];
monster_race *r_ptr = &r_info[m_ptr->r_idx];
bool obvious = FALSE;
/* Mark all (nearby) monsters */
- for (i = 1; i < m_max; i++)
+ for (i = 1; i < current_floor_ptr->m_max; i++)
{
monster_type *m_ptr = ¤t_floor_ptr->m_list[i];
if (!monster_is_valid(m_ptr)) continue;
}
/* Affect all marked monsters */
- for (i = 1; i < m_max; i++)
+ for (i = 1; i < current_floor_ptr->m_max; i++)
{
monster_type *m_ptr = ¤t_floor_ptr->m_list[i];
bool speed = FALSE;
/* Aggravate everyone nearby */
- for (i = 1; i < m_max; i++)
+ for (i = 1; i < current_floor_ptr->m_max; i++)
{
monster_type *m_ptr = ¤t_floor_ptr->m_list[i];
if (!monster_is_valid(m_ptr)) continue;
while (!get_com(_("どの種類(文字)のモンスターを抹殺しますか: ", "Choose a monster race (by symbol) to genocide: "), &typ, FALSE)) ;
/* Delete the monsters of that "type" */
- for (i = 1; i < m_max; i++)
+ for (i = 1; i < current_floor_ptr->m_max; i++)
{
monster_type *m_ptr = ¤t_floor_ptr->m_list[i];
monster_race *r_ptr = &r_info[m_ptr->r_idx];
}
/* Delete the (nearby) monsters */
- for (i = 1; i < m_max; i++)
+ for (i = 1; i < current_floor_ptr->m_max; i++)
{
monster_type *m_ptr = ¤t_floor_ptr->m_list[i];
if (!monster_is_valid(m_ptr)) continue;
}
/* Delete the (nearby) monsters */
- for (i = 1; i < m_max; i++)
+ for (i = 1; i < current_floor_ptr->m_max; i++)
{
monster_type *m_ptr = ¤t_floor_ptr->m_list[i];
monster_race *r_ptr = &r_info[m_ptr->r_idx];
Term->scr->cv = 1;
/* Probe all (nearby) monsters */
- for (i = 1; i < m_max; i++)
+ for (i = 1; i < current_floor_ptr->m_max; i++)
{
monster_type *m_ptr = ¤t_floor_ptr->m_list[i];
monster_race *r_ptr = &r_info[m_ptr->r_idx];
MONSTER_IDX i;
bool okay = TRUE;
- for (i = 1; i < m_max; i++)
+ for (i = 1; i < current_floor_ptr->m_max; i++)
{
monster_type *m_ptr = ¤t_floor_ptr->m_list[i];
if (!m_ptr->r_idx || !is_pet(m_ptr)) continue;
if (!get_check(_("本当に全ペットを爆破しますか?", "You will blast all pets. Are you sure? ")))
return;
}
- for (i = 1; i < m_max; i++)
+ for (i = 1; i < current_floor_ptr->m_max; i++)
{
HIT_POINT dam;
monster_type *m_ptr = ¤t_floor_ptr->m_list[i];
bool is_loading_now; /*!< ロード直後にcalc_bonus()時の徳変化、及びsanity_blast()による異常を抑止する */
bool hack_mutation;
-
-MONSTER_IDX m_max = 1; /* Number of allocated monsters */
-MONSTER_IDX m_cnt = 0; /* Number of live monsters */
-
MONSTER_IDX hack_m_idx = 0; /* Hack -- see "process_monsters()" */
MONSTER_IDX hack_m_idx_ii = 0;
return TRUE;
}
- for (i = 1; i < m_max; i++)
+ for (i = 1; i < current_floor_ptr->m_max; i++)
{
monster_type *m_ptr = ¤t_floor_ptr->m_list[i];
MONSTER_IDX i;
/* Genocide everyone nearby */
- for (i = 1; i < m_max; i++)
+ for (i = 1; i < current_floor_ptr->m_max; i++)
{
monster_type *m_ptr = ¤t_floor_ptr->m_list[i];
if (!monster_is_valid(m_ptr)) continue;
MONSTER_IDX i;
/* Genocide everyone */
- for (i = 1; i < m_max; i++)
+ for (i = 1; i < current_floor_ptr->m_max; i++)
{
monster_type *m_ptr = ¤t_floor_ptr->m_list[i];
if (!monster_is_valid(m_ptr)) continue;