void delete_monster_idx(MONSTER_IDX i)
{
POSITION x, y;
- monster_type *m_ptr = &m_list[i];
+ monster_type *m_ptr = ¤t_floor_ptr->m_list[i];
monster_race *r_ptr = &r_info[m_ptr->r_idx];
OBJECT_IDX this_o_idx, next_o_idx = 0;
real_r_ptr(m_ptr)->cur_num--;
/* Hack -- count the number of "reproducers" */
- if (r_ptr->flags2 & (RF2_MULTIPLY)) num_repro--;
+ if (r_ptr->flags2 & (RF2_MULTIPLY)) current_floor_ptr->num_repro--;
if (MON_CSLEEP(m_ptr)) (void)set_monster_csleep(i, 0);
if (MON_FAST(m_ptr)) (void)set_monster_fast(i, 0);
for (this_o_idx = m_ptr->hold_o_idx; this_o_idx; this_o_idx = next_o_idx)
{
object_type *o_ptr;
- o_ptr = &o_list[this_o_idx];
+ o_ptr = ¤t_floor_ptr->o_list[this_o_idx];
/* Acquire next object */
next_o_idx = o_ptr->next_o_idx;
if (i1 == i2) return;
/* Old monster */
- m_ptr = &m_list[i1];
+ m_ptr = ¤t_floor_ptr->m_list[i1];
y = m_ptr->fy;
x = m_ptr->fx;
for (this_o_idx = m_ptr->hold_o_idx; this_o_idx; this_o_idx = next_o_idx)
{
object_type *o_ptr;
- o_ptr = &o_list[this_o_idx];
+ o_ptr = ¤t_floor_ptr->o_list[this_o_idx];
/* Acquire next object */
next_o_idx = o_ptr->next_o_idx;
{
for (i = 1; i < m_max; i++)
{
- monster_type *m2_ptr = &m_list[i];
+ monster_type *m2_ptr = ¤t_floor_ptr->m_list[i];
if (m2_ptr->parent_m_idx == i1)
m2_ptr->parent_m_idx = i2;
}
/* Structure copy */
- (void)COPY(&m_list[i2], &m_list[i1], monster_type);
+ (void)COPY(¤t_floor_ptr->m_list[i2], ¤t_floor_ptr->m_list[i1], monster_type);
/* Wipe the hole */
- (void)WIPE(&m_list[i1], monster_type);
+ (void)WIPE(¤t_floor_ptr->m_list[i1], monster_type);
for (i = 0; i < MAX_MTIMED; i++)
{
int mproc_idx = get_mproc_idx(i1, i);
- if (mproc_idx >= 0) mproc_list[i][mproc_idx] = i2;
+ if (mproc_idx >= 0) current_floor_ptr->mproc_list[i][mproc_idx] = i2;
}
}
/* Check all the monsters */
for (i = 1; i < m_max; i++)
{
- monster_type *m_ptr = &m_list[i];
+ monster_type *m_ptr = ¤t_floor_ptr->m_list[i];
monster_race *r_ptr = &r_info[m_ptr->r_idx];
for (i = m_max - 1; i >= 1; i--)
{
/* Get the i'th monster */
- monster_type *m_ptr = &m_list[i];
+ monster_type *m_ptr = ¤t_floor_ptr->m_list[i];
/* Skip real monsters */
if (m_ptr->r_idx) continue;
/* Delete all the monsters */
for (i = m_max - 1; i >= 1; i--)
{
- monster_type *m_ptr = &m_list[i];
+ monster_type *m_ptr = ¤t_floor_ptr->m_list[i];
/* Skip dead monsters */
if (!m_ptr->r_idx) continue;
/* Reset "m_cnt" */
m_cnt = 0;
- /* Reset "mproc_max[]" */
- for (i = 0; i < MAX_MTIMED; i++) mproc_max[i] = 0;
+ /* Reset "current_floor_ptr->mproc_max[]" */
+ for (i = 0; i < MAX_MTIMED; i++) current_floor_ptr->mproc_max[i] = 0;
/* Hack -- reset "reproducer" count */
- num_repro = 0;
+ current_floor_ptr->num_repro = 0;
/* Hack -- no more target */
target_who = 0;
MONSTER_IDX i;
/* Normal allocation */
- if (m_max < max_m_idx)
+ if (m_max < current_floor_ptr->max_m_idx)
{
/* Access the next hole */
i = m_max;
monster_type *m_ptr;
/* Acquire monster */
- m_ptr = &m_list[i];
+ m_ptr = ¤t_floor_ptr->m_list[i];
/* Skip live monsters */
if (m_ptr->r_idx) continue;
int pls_kakuritu, pls_level;
int delay = mysqrt(level * 10000L) + 400L;
- pls_kakuritu = MAX(NASTY_MON_MAX, NASTY_MON_BASE - ((dungeon_turn / (TURNS_PER_TICK * 5000L) - delay / 10)));
- pls_level = MIN(NASTY_MON_PLUS_MAX, 3 + dungeon_turn / (TURNS_PER_TICK * 40000L) - delay / 40 + MIN(5, level / 10)) ;
+ pls_kakuritu = MAX(NASTY_MON_MAX, NASTY_MON_BASE - ((current_world_ptr->dungeon_turn / (TURNS_PER_TICK * 5000L) - delay / 10)));
+ pls_level = MIN(NASTY_MON_PLUS_MAX, 3 + current_world_ptr->dungeon_turn / (TURNS_PER_TICK * 40000L) - delay / 40 + MIN(5, level / 10)) ;
if (d_info[p_ptr->dungeon_idx].flags1 & DF1_MAZE)
{
/* Inside monster arena, and it is not your mount */
else if (p_ptr->inside_battle &&
- !(p_ptr->riding && (&m_list[p_ptr->riding] == m_ptr)))
+ !(p_ptr->riding && (¤t_floor_ptr->m_list[p_ptr->riding] == m_ptr)))
{
/* It is a fake unique monster */
(void)sprintf(desc, _("%sもどき", "fake %s"), name);
strcat(desc,buf);
}
- if (p_ptr->riding && (&m_list[p_ptr->riding] == m_ptr))
+ if (p_ptr->riding && (¤t_floor_ptr->m_list[p_ptr->riding] == m_ptr))
{
strcat(desc,_("(乗馬中)", "(riding)"));
}
*/
void lore_treasure(MONSTER_IDX m_idx, ITEM_NUMBER num_item, ITEM_NUMBER num_gold)
{
- monster_type *m_ptr = &m_list[m_idx];
+ monster_type *m_ptr = ¤t_floor_ptr->m_list[m_idx];
monster_race *r_ptr = &r_info[m_ptr->r_idx];
{
if ((p_ptr->stat_use[A_INT] < 4) && (p_ptr->stat_use[A_WIS] < 4))
{
- msg_print(_("あなたは完璧な馬鹿になったような気がした。しかしそれは元々だった。", "You turn into an utter moron!"));
+ msg_print(_("あなたは完璧な馬鹿になったような気がした。しかしそれは元々だった。", "You current_world_ptr->game_turn into an utter moron!"));
}
else
{
- msg_print(_("あなたは完璧な馬鹿になった!", "You turn into an utter moron!"));
+ msg_print(_("あなたは完璧な馬鹿になった!", "You current_world_ptr->game_turn into an utter moron!"));
}
if (p_ptr->muta3 & MUT3_HYPER_INT)
*/
void update_monster(MONSTER_IDX m_idx, bool full)
{
- monster_type *m_ptr = &m_list[m_idx];
+ monster_type *m_ptr = ¤t_floor_ptr->m_list[m_idx];
monster_race *r_ptr = &r_info[m_ptr->r_idx];
/* Update each (live) monster */
for (i = 1; i < m_max; i++)
{
- monster_type *m_ptr = &m_list[i];
+ monster_type *m_ptr = ¤t_floor_ptr->m_list[i];
/* Skip dead monsters */
if (!m_ptr->r_idx) continue;
static bool monster_hook_chameleon_lord(MONRACE_IDX r_idx)
{
monster_race *r_ptr = &r_info[r_idx];
- monster_type *m_ptr = &m_list[chameleon_change_m_idx];
+ monster_type *m_ptr = ¤t_floor_ptr->m_list[chameleon_change_m_idx];
monster_race *old_r_ptr = &r_info[m_ptr->r_idx];
if (!(r_ptr->flags1 & (RF1_UNIQUE))) return FALSE;
/* Born now */
else if (summon_specific_who > 0)
{
- if (monster_has_hostile_align(&m_list[summon_specific_who], 0, 0, r_ptr)) return FALSE;
+ if (monster_has_hostile_align(¤t_floor_ptr->m_list[summon_specific_who], 0, 0, r_ptr)) return FALSE;
}
return TRUE;
static bool monster_hook_chameleon(MONRACE_IDX r_idx)
{
monster_race *r_ptr = &r_info[r_idx];
- monster_type *m_ptr = &m_list[chameleon_change_m_idx];
+ monster_type *m_ptr = ¤t_floor_ptr->m_list[chameleon_change_m_idx];
monster_race *old_r_ptr = &r_info[m_ptr->r_idx];
if (r_ptr->flags1 & (RF1_UNIQUE)) return FALSE;
/* Born now */
else if (summon_specific_who > 0)
{
- if (monster_has_hostile_align(&m_list[summon_specific_who], 0, 0, r_ptr)) return FALSE;
+ if (monster_has_hostile_align(¤t_floor_ptr->m_list[summon_specific_who], 0, 0, r_ptr)) return FALSE;
}
return (*(get_monster_hook()))(r_idx);
void choose_new_monster(MONSTER_IDX m_idx, bool born, MONRACE_IDX r_idx)
{
int oldmaxhp;
- monster_type *m_ptr = &m_list[m_idx];
+ monster_type *m_ptr = ¤t_floor_ptr->m_list[m_idx];
monster_race *r_ptr;
char old_m_name[MAX_NLEN];
bool old_unique = FALSE;
number_mon = 0;
/* Count all quest monsters */
- for (i2 = 0; i2 < cur_wid; ++i2)
- for (j2 = 0; j2 < cur_hgt; j2++)
+ for (i2 = 0; i2 < current_floor_ptr->width; ++i2)
+ for (j2 = 0; j2 < current_floor_ptr->height; j2++)
if (current_floor_ptr->grid_array[j2][i2].m_idx > 0)
- if (m_list[current_floor_ptr->grid_array[j2][i2].m_idx].r_idx == quest[hoge].r_idx)
+ if (current_floor_ptr->m_list[current_floor_ptr->grid_array[j2][i2].m_idx].r_idx == quest[hoge].r_idx)
number_mon++;
if(number_mon + quest[hoge].cur_num >= quest[hoge].max_num)
return FALSE;
/* Get a new monster record */
- m_ptr = &m_list[g_ptr->m_idx];
+ m_ptr = ¤t_floor_ptr->m_list[g_ptr->m_idx];
/* Save the race */
m_ptr->r_idx = r_idx;
m_ptr->mflag2 = 0;
/* Hack -- Appearance transfer */
- if ((mode & PM_MULTIPLY) && (who > 0) && !is_original_ap(&m_list[who]))
+ if ((mode & PM_MULTIPLY) && (who > 0) && !is_original_ap(¤t_floor_ptr->m_list[who]))
{
- m_ptr->ap_r_idx = m_list[who].ap_r_idx;
+ m_ptr->ap_r_idx = current_floor_ptr->m_list[who].ap_r_idx;
/* Hack -- Shadower spawns Shadower */
- if (m_list[who].mflag2 & MFLAG2_KAGE) m_ptr->mflag2 |= MFLAG2_KAGE;
+ if (current_floor_ptr->m_list[who].mflag2 & MFLAG2_KAGE) m_ptr->mflag2 |= MFLAG2_KAGE;
}
/* Sub-alignment of a monster */
if ((who > 0) && !(r_ptr->flags3 & (RF3_EVIL | RF3_GOOD)))
- m_ptr->sub_align = m_list[who].sub_align;
+ m_ptr->sub_align = current_floor_ptr->m_list[who].sub_align;
else
{
m_ptr->sub_align = SUB_ALIGN_NEUTRAL;
/* Your pet summons its pet. */
- if (who > 0 && is_pet(&m_list[who]))
+ if (who > 0 && is_pet(¤t_floor_ptr->m_list[who]))
{
mode |= PM_FORCE_PET;
m_ptr->parent_m_idx = who;
real_r_ptr(m_ptr)->floor_id = p_ptr->floor_id;
/* Hack -- Count the number of "reproducers" */
- if (r_ptr->flags2 & RF2_MULTIPLY) num_repro++;
+ if (r_ptr->flags2 & RF2_MULTIPLY) current_floor_ptr->num_repro++;
/* Hack -- Notice new multi-hued monsters */
{
static bool place_monster_can_escort(MONRACE_IDX r_idx)
{
monster_race *r_ptr = &r_info[place_monster_idx];
- monster_type *m_ptr = &m_list[place_monster_m_idx];
+ monster_type *m_ptr = ¤t_floor_ptr->m_list[place_monster_m_idx];
monster_race *z_ptr = &r_info[r_idx];
get_mon_num_prep(get_monster_hook(), get_monster_hook2(y, x));
/* Pick a monster */
- r_idx = get_mon_num(monster_level);
+ r_idx = get_mon_num(current_floor_ptr->monster_level);
/* Handle failure */
if (!r_idx) return (FALSE);
while (--attempts)
{
/* Pick a monster */
- r_idx = get_mon_num(monster_level);
+ r_idx = get_mon_num(current_floor_ptr->monster_level);
/* Handle failure */
if (!r_idx) return (FALSE);
m_idx = current_floor_ptr->grid_array[y][x].m_idx;
- if (m_list[m_idx].mflag2 & MFLAG2_CHAMELEON) r_ptr = &r_info[m_list[m_idx].r_idx];
+ if (current_floor_ptr->m_list[m_idx].mflag2 & MFLAG2_CHAMELEON) r_ptr = &r_info[current_floor_ptr->m_list[m_idx].r_idx];
for (attempts = randint1(10) + 5; attempts; attempts--)
{
while (try_count)
{
/* Get a random spot */
- oy = randint1(cur_hgt - 4) + 2;
- ox = randint1(cur_wid - 4) + 2;
+ oy = randint1(current_floor_ptr->height - 4) + 2;
+ ox = randint1(current_floor_ptr->width - 4) + 2;
/* Is it a good spot ? */
if (cave_empty_bold2(oy, ox) && monster_can_cross_terrain(current_floor_ptr->grid_array[oy][ox].feat, &r_info[guardian], 0))
* @details
* Place the monster at least "dis" distance from the player.
* Use "slp" to choose the initial "sleep" status
- * Use "monster_level" for the monster level
+ * Use "current_floor_ptr->monster_level" for the monster level
*/
bool alloc_monster(POSITION dis, BIT_FLAGS mode)
{
while (attempts_left--)
{
/* Pick a location */
- y = randint0(cur_hgt);
- x = randint0(cur_wid);
+ y = randint0(current_floor_ptr->height);
+ x = randint0(current_floor_ptr->width);
/* Require empty floor grid (was "naked") */
if (current_floor_ptr->dun_level)
/* Hack -- identify the summoning monster */
if (summon_specific_who > 0)
{
- monster_type *m_ptr = &m_list[summon_specific_who];
+ monster_type *m_ptr = ¤t_floor_ptr->m_list[summon_specific_who];
/* Do not summon enemies */
*/
bool multiply_monster(MONSTER_IDX m_idx, bool clone, BIT_FLAGS mode)
{
- monster_type *m_ptr = &m_list[m_idx];
+ monster_type *m_ptr = ¤t_floor_ptr->m_list[m_idx];
POSITION y, x;
if (!mon_scatter(m_ptr->r_idx, &y, &x, m_ptr->fy, m_ptr->fx, 1))
/* Hack -- Transfer "clone" flag */
if (clone || (m_ptr->smart & SM_CLONED))
{
- m_list[hack_m_idx_ii].smart |= SM_CLONED;
- m_list[hack_m_idx_ii].mflag2 |= MFLAG2_NOPET;
+ current_floor_ptr->m_list[hack_m_idx_ii].smart |= SM_CLONED;
+ current_floor_ptr->m_list[hack_m_idx_ii].mflag2 |= MFLAG2_NOPET;
}
return TRUE;
HIT_POINT tmp;
PERCENTAGE percentage;
- monster_type *m_ptr = &m_list[m_idx];
+ monster_type *m_ptr = ¤t_floor_ptr->m_list[m_idx];
monster_race *r_ptr = &r_info[m_ptr->r_idx];
GAME_TEXT m_name[MAX_NLEN];
*/
void update_smart_learn(MONSTER_IDX m_idx, int what)
{
- monster_type *m_ptr = &m_list[m_idx];
+ monster_type *m_ptr = ¤t_floor_ptr->m_list[m_idx];
monster_race *r_ptr = &r_info[m_ptr->r_idx];
/* Not allowed to learn */
/* Drop objects being carried */
for (this_o_idx = m_ptr->hold_o_idx; this_o_idx; this_o_idx = next_o_idx)
{
- o_ptr = &o_list[this_o_idx];
+ o_ptr = ¤t_floor_ptr->o_list[this_o_idx];
/* Acquire next object */
next_o_idx = o_ptr->next_o_idx;