void delete_monster_idx(MONSTER_IDX i)
{
POSITION x, y;
- monster_type *m_ptr = ¤t_floor_ptr->m_list[i];
+ monster_type *m_ptr = &p_ptr->current_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)) current_floor_ptr->num_repro--;
+ if (r_ptr->flags2 & (RF2_MULTIPLY)) p_ptr->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);
if (p_ptr->riding == i) p_ptr->riding = 0;
/* Monster is gone */
- current_floor_ptr->grid_array[y][x].m_idx = 0;
+ p_ptr->current_floor_ptr->grid_array[y][x].m_idx = 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 = ¤t_floor_ptr->o_list[this_o_idx];
+ o_ptr = &p_ptr->current_floor_ptr->o_list[this_o_idx];
next_o_idx = o_ptr->next_o_idx;
/*
(void)WIPE(m_ptr, monster_type);
/* Count monsters */
- current_floor_ptr->m_cnt--;
+ p_ptr->current_floor_ptr->m_cnt--;
lite_spot(y, x);
if (r_ptr->flags7 & (RF7_LITE_MASK | RF7_DARK_MASK))
/*!
- * @brief 指定位置に存在するモンスターを削除する / Delete the monster, if any, at a given location
- * @param x 削除位置x座標
- * @param y 削除位置y座標
- * @return なし
- */
-void delete_monster(POSITION y, POSITION x)
-{
- grid_type *g_ptr;
- if (!in_bounds(y, x)) return;
-
- /* Check the grid */
- g_ptr = ¤t_floor_ptr->grid_array[y][x];
-
- /* Delete the monster (if any) */
- if (g_ptr->m_idx) delete_monster_idx(g_ptr->m_idx);
-}
-
-
-/*!
* @brief モンスター情報を配列内移動する / Move an object from index i1 to index i2 in the object list
* @param i1 配列移動元添字
* @param i2 配列移動先添字
if (i1 == i2) return;
/* Old monster */
- m_ptr = ¤t_floor_ptr->m_list[i1];
+ m_ptr = &p_ptr->current_floor_ptr->m_list[i1];
y = m_ptr->fy;
x = m_ptr->fx;
/* Cave grid */
- g_ptr = ¤t_floor_ptr->grid_array[y][x];
+ g_ptr = &p_ptr->current_floor_ptr->grid_array[y][x];
- /* Update the current_floor_ptr->grid_array */
g_ptr->m_idx = i2;
/* Repair objects being carried by monster */
for (this_o_idx = m_ptr->hold_o_idx; this_o_idx; this_o_idx = next_o_idx)
{
object_type *o_ptr;
- o_ptr = ¤t_floor_ptr->o_list[this_o_idx];
+ o_ptr = &p_ptr->current_floor_ptr->o_list[this_o_idx];
next_o_idx = o_ptr->next_o_idx;
/* Reset monster pointer */
/* Hack -- Update parent index */
if (is_pet(m_ptr))
{
- for (i = 1; i < current_floor_ptr->m_max; i++)
+ for (i = 1; i < p_ptr->current_floor_ptr->m_max; i++)
{
- monster_type *m2_ptr = ¤t_floor_ptr->m_list[i];
+ monster_type *m2_ptr = &p_ptr->current_floor_ptr->m_list[i];
if (m2_ptr->parent_m_idx == i1)
m2_ptr->parent_m_idx = i2;
}
/* Structure copy */
- (void)COPY(¤t_floor_ptr->m_list[i2], ¤t_floor_ptr->m_list[i1], monster_type);
+ (void)COPY(&p_ptr->current_floor_ptr->m_list[i2], &p_ptr->current_floor_ptr->m_list[i1], monster_type);
/* Wipe the hole */
- (void)WIPE(¤t_floor_ptr->m_list[i1], monster_type);
+ (void)WIPE(&p_ptr->current_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) current_floor_ptr->mproc_list[i][mproc_idx] = i2;
+ if (mproc_idx >= 0) p_ptr->current_floor_ptr->mproc_list[i][mproc_idx] = i2;
}
}
cur_dis = 5 * (20 - cnt);
/* Check all the monsters */
- for (i = 1; i < current_floor_ptr->m_max; i++)
+ for (i = 1; i < p_ptr->current_floor_ptr->m_max; i++)
{
- monster_type *m_ptr = ¤t_floor_ptr->m_list[i];
+ monster_type *m_ptr = &p_ptr->current_floor_ptr->m_list[i];
monster_race *r_ptr = &r_info[m_ptr->r_idx];
/* Excise dead monsters (backwards!) */
- for (i = current_floor_ptr->m_max - 1; i >= 1; i--)
+ for (i = p_ptr->current_floor_ptr->m_max - 1; i >= 1; i--)
{
/* Get the i'th monster */
- monster_type *m_ptr = ¤t_floor_ptr->m_list[i];
+ monster_type *m_ptr = &p_ptr->current_floor_ptr->m_list[i];
/* Skip real monsters */
if (m_ptr->r_idx) continue;
/* Move last monster into open hole */
- compact_monsters_aux(current_floor_ptr->m_max - 1, i);
+ compact_monsters_aux(p_ptr->current_floor_ptr->m_max - 1, i);
- /* Compress "current_floor_ptr->m_max" */
- current_floor_ptr->m_max--;
+ /* Compress "p_ptr->current_floor_ptr->m_max" */
+ p_ptr->current_floor_ptr->m_max--;
}
}
}
/* Delete all the monsters */
- for (i = current_floor_ptr->m_max - 1; i >= 1; i--)
+ for (i = p_ptr->current_floor_ptr->m_max - 1; i >= 1; i--)
{
- monster_type *m_ptr = ¤t_floor_ptr->m_list[i];
+ monster_type *m_ptr = &p_ptr->current_floor_ptr->m_list[i];
if (!monster_is_valid(m_ptr)) continue;
/* Monster is gone */
- current_floor_ptr->grid_array[m_ptr->fy][m_ptr->fx].m_idx = 0;
+ p_ptr->current_floor_ptr->grid_array[m_ptr->fy][m_ptr->fx].m_idx = 0;
(void)WIPE(m_ptr, monster_type);
/* Hack -- Wipe the racial counter of all monster races */
for (i = 1; i < max_r_idx; i++) r_info[i].cur_num = 0;
- /* Reset "current_floor_ptr->m_max" */
- current_floor_ptr->m_max = 1;
+ /* Reset "p_ptr->current_floor_ptr->m_max" */
+ p_ptr->current_floor_ptr->m_max = 1;
- /* Reset "current_floor_ptr->m_cnt" */
- current_floor_ptr->m_cnt = 0;
+ /* Reset "p_ptr->current_floor_ptr->m_cnt" */
+ p_ptr->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;
+ /* Reset "p_ptr->current_floor_ptr->mproc_max[]" */
+ for (i = 0; i < MAX_MTIMED; i++) p_ptr->current_floor_ptr->mproc_max[i] = 0;
/* Hack -- reset "reproducer" count */
- current_floor_ptr->num_repro = 0;
+ p_ptr->current_floor_ptr->num_repro = 0;
/* Hack -- no more target */
target_who = 0;
MONSTER_IDX i;
/* Normal allocation */
- if (current_floor_ptr->m_max < current_floor_ptr->max_m_idx)
+ if (p_ptr->current_floor_ptr->m_max < current_world_ptr->max_m_idx)
{
/* Access the next hole */
- i = current_floor_ptr->m_max;
+ i = p_ptr->current_floor_ptr->m_max;
/* Expand the array */
- current_floor_ptr->m_max++;
+ p_ptr->current_floor_ptr->m_max++;
/* Count monsters */
- current_floor_ptr->m_cnt++;
+ p_ptr->current_floor_ptr->m_cnt++;
/* Return the index */
return (i);
}
/* Recycle dead monsters */
- for (i = 1; i < current_floor_ptr->m_max; i++)
+ for (i = 1; i < p_ptr->current_floor_ptr->m_max; i++)
{
monster_type *m_ptr;
- m_ptr = ¤t_floor_ptr->m_list[i];
+ m_ptr = &p_ptr->current_floor_ptr->m_list[i];
/* Skip live monsters */
if (m_ptr->r_idx) continue;
/* Count monsters */
- current_floor_ptr->m_cnt++;
+ p_ptr->current_floor_ptr->m_cnt++;
/* Use this monster */
return (i);
}
if (d_ptr->flags1 & DF1_BEGINNER)
{
- if (r_ptr->level > current_floor_ptr->dun_level)
+ if (r_ptr->level > p_ptr->current_floor_ptr->dun_level)
return FALSE;
}
/* Depth Monsters never appear out of depth */
if ((r_ptr->flags1 & (RF1_FORCE_DEPTH)) &&
- (r_ptr->level > current_floor_ptr->dun_level))
+ (r_ptr->level > p_ptr->current_floor_ptr->dun_level))
continue;
}
/* Accept this monster */
entry->prob2 = entry->prob1;
- if (current_floor_ptr->dun_level && (!p_ptr->inside_quest || is_fixed_quest_idx(p_ptr->inside_quest)) &&
+ if (p_ptr->current_floor_ptr->dun_level && (!p_ptr->current_floor_ptr->inside_quest || is_fixed_quest_idx(p_ptr->current_floor_ptr->inside_quest)) &&
!restrict_monster_to_dungeon(p_ptr->dungeon_idx, entry->index) && !p_ptr->phase_out)
{
int hoge = entry->prob2 * d_info[p_ptr->dungeon_idx].special_div;
/* Inside monster arena, and it is not your mount */
else if (p_ptr->phase_out &&
- !(p_ptr->riding && (¤t_floor_ptr->m_list[p_ptr->riding] == m_ptr)))
+ !(p_ptr->riding && (&p_ptr->current_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 && (¤t_floor_ptr->m_list[p_ptr->riding] == m_ptr))
+ if (p_ptr->riding && (&p_ptr->current_floor_ptr->m_list[p_ptr->riding] == m_ptr))
{
strcat(desc,_("(乗馬中)", "(riding)"));
}
*/
void monster_name(MONSTER_IDX m_idx, char* m_name)
{
- monster_type *m_ptr = ¤t_floor_ptr->m_list[m_idx];
+ monster_type *m_ptr = &p_ptr->current_floor_ptr->m_list[m_idx];
monster_desc(m_name, m_ptr, 0x00);
}
*/
void lore_treasure(MONSTER_IDX m_idx, ITEM_NUMBER num_item, ITEM_NUMBER num_gold)
{
- monster_type *m_ptr = ¤t_floor_ptr->m_list[m_idx];
+ monster_type *m_ptr = &p_ptr->current_floor_ptr->m_list[m_idx];
monster_race *r_ptr = &r_info[m_ptr->r_idx];
* "disturb_near" (monster which is "easily" viewable moves in some
* way). Note that "moves" includes "appears" and "disappears".
*/
-void update_monster(MONSTER_IDX m_idx, bool full)
+void update_monster(player_type *subject_ptr, MONSTER_IDX m_idx, bool full)
{
- monster_type *m_ptr = ¤t_floor_ptr->m_list[m_idx];
+ monster_type *m_ptr = &subject_ptr->current_floor_ptr->m_list[m_idx];
monster_race *r_ptr = &r_info[m_ptr->r_idx];
bool do_disturb = disturb_move;
bool easy = FALSE;
/* Non-Ninja player in the darkness */
- bool in_darkness = (d_info[p_ptr->dungeon_idx].flags1 & DF1_DARKNESS) && !p_ptr->see_nocto;
+ bool in_darkness = (d_info[subject_ptr->dungeon_idx].flags1 & DF1_DARKNESS) && !subject_ptr->see_nocto;
/* Do disturb? */
if (disturb_high)
{
monster_race *ap_r_ptr = &r_info[m_ptr->ap_r_idx];
- if (ap_r_ptr->r_tkills && ap_r_ptr->level >= p_ptr->lev)
+ if (ap_r_ptr->r_tkills && ap_r_ptr->level >= subject_ptr->lev)
do_disturb = TRUE;
}
if (full)
{
/* Distance components */
- int dy = (p_ptr->y > fy) ? (p_ptr->y - fy) : (fy - p_ptr->y);
- int dx = (p_ptr->x > fx) ? (p_ptr->x - fx) : (fx - p_ptr->x);
+ int dy = (subject_ptr->y > fy) ? (subject_ptr->y - fy) : (fy - subject_ptr->y);
+ int dx = (subject_ptr->x > fx) ? (subject_ptr->x - fx) : (fx - subject_ptr->x);
/* Approximate distance */
d = (dy > dx) ? (dy + (dx>>1)) : (dx + (dy>>1));
{
if (!in_darkness || (d <= MAX_SIGHT / 4))
{
- if (p_ptr->special_defense & KATA_MUSOU)
+ if (subject_ptr->special_defense & KATA_MUSOU)
{
/* Detectable */
flag = TRUE;
- if (is_original_ap(m_ptr) && !p_ptr->image)
+ if (is_original_ap(m_ptr) && !subject_ptr->image)
{
/* Hack -- Memorize mental flags */
if (r_ptr->flags2 & (RF2_SMART)) r_ptr->r_flags2 |= (RF2_SMART);
/* Basic telepathy */
/* Snipers get telepathy when they concentrate deeper */
- else if (p_ptr->telepathy)
+ else if (subject_ptr->telepathy)
{
/* Empty mind, no telepathy */
if (r_ptr->flags2 & (RF2_EMPTY_MIND))
{
/* Memorize flags */
- if (is_original_ap(m_ptr) && !p_ptr->image) r_ptr->r_flags2 |= (RF2_EMPTY_MIND);
+ if (is_original_ap(m_ptr) && !subject_ptr->image) r_ptr->r_flags2 |= (RF2_EMPTY_MIND);
}
/* Weird mind, occasional telepathy */
/* Detectable */
flag = TRUE;
- if (is_original_ap(m_ptr) && !p_ptr->image)
+ if (is_original_ap(m_ptr) && !subject_ptr->image)
{
/* Memorize flags */
r_ptr->r_flags2 |= (RF2_WEIRD_MIND);
/* Detectable */
flag = TRUE;
- if (is_original_ap(m_ptr) && !p_ptr->image)
+ if (is_original_ap(m_ptr) && !subject_ptr->image)
{
/* Hack -- Memorize mental flags */
if (r_ptr->flags2 & (RF2_SMART)) r_ptr->r_flags2 |= (RF2_SMART);
}
}
- if ((p_ptr->esp_animal) && (r_ptr->flags3 & (RF3_ANIMAL)))
+ if ((subject_ptr->esp_animal) && (r_ptr->flags3 & (RF3_ANIMAL)))
{
flag = TRUE;
- if (is_original_ap(m_ptr) && !p_ptr->image) r_ptr->r_flags3 |= (RF3_ANIMAL);
+ if (is_original_ap(m_ptr) && !subject_ptr->image) r_ptr->r_flags3 |= (RF3_ANIMAL);
}
- if ((p_ptr->esp_undead) && (r_ptr->flags3 & (RF3_UNDEAD)))
+ if ((subject_ptr->esp_undead) && (r_ptr->flags3 & (RF3_UNDEAD)))
{
flag = TRUE;
- if (is_original_ap(m_ptr) && !p_ptr->image) r_ptr->r_flags3 |= (RF3_UNDEAD);
+ if (is_original_ap(m_ptr) && !subject_ptr->image) r_ptr->r_flags3 |= (RF3_UNDEAD);
}
- if ((p_ptr->esp_demon) && (r_ptr->flags3 & (RF3_DEMON)))
+ if ((subject_ptr->esp_demon) && (r_ptr->flags3 & (RF3_DEMON)))
{
flag = TRUE;
- if (is_original_ap(m_ptr) && !p_ptr->image) r_ptr->r_flags3 |= (RF3_DEMON);
+ if (is_original_ap(m_ptr) && !subject_ptr->image) r_ptr->r_flags3 |= (RF3_DEMON);
}
- if ((p_ptr->esp_orc) && (r_ptr->flags3 & (RF3_ORC)))
+ if ((subject_ptr->esp_orc) && (r_ptr->flags3 & (RF3_ORC)))
{
flag = TRUE;
- if (is_original_ap(m_ptr) && !p_ptr->image) r_ptr->r_flags3 |= (RF3_ORC);
+ if (is_original_ap(m_ptr) && !subject_ptr->image) r_ptr->r_flags3 |= (RF3_ORC);
}
- if ((p_ptr->esp_troll) && (r_ptr->flags3 & (RF3_TROLL)))
+ if ((subject_ptr->esp_troll) && (r_ptr->flags3 & (RF3_TROLL)))
{
flag = TRUE;
- if (is_original_ap(m_ptr) && !p_ptr->image) r_ptr->r_flags3 |= (RF3_TROLL);
+ if (is_original_ap(m_ptr) && !subject_ptr->image) r_ptr->r_flags3 |= (RF3_TROLL);
}
- if ((p_ptr->esp_giant) && (r_ptr->flags3 & (RF3_GIANT)))
+ if ((subject_ptr->esp_giant) && (r_ptr->flags3 & (RF3_GIANT)))
{
flag = TRUE;
- if (is_original_ap(m_ptr) && !p_ptr->image) r_ptr->r_flags3 |= (RF3_GIANT);
+ if (is_original_ap(m_ptr) && !subject_ptr->image) r_ptr->r_flags3 |= (RF3_GIANT);
}
- if ((p_ptr->esp_dragon) && (r_ptr->flags3 & (RF3_DRAGON)))
+ if ((subject_ptr->esp_dragon) && (r_ptr->flags3 & (RF3_DRAGON)))
{
flag = TRUE;
- if (is_original_ap(m_ptr) && !p_ptr->image) r_ptr->r_flags3 |= (RF3_DRAGON);
+ if (is_original_ap(m_ptr) && !subject_ptr->image) r_ptr->r_flags3 |= (RF3_DRAGON);
}
- if ((p_ptr->esp_human) && (r_ptr->flags2 & (RF2_HUMAN)))
+ if ((subject_ptr->esp_human) && (r_ptr->flags2 & (RF2_HUMAN)))
{
flag = TRUE;
- if (is_original_ap(m_ptr) && !p_ptr->image) r_ptr->r_flags2 |= (RF2_HUMAN);
+ if (is_original_ap(m_ptr) && !subject_ptr->image) r_ptr->r_flags2 |= (RF2_HUMAN);
}
- if ((p_ptr->esp_evil) && (r_ptr->flags3 & (RF3_EVIL)))
+ if ((subject_ptr->esp_evil) && (r_ptr->flags3 & (RF3_EVIL)))
{
flag = TRUE;
- if (is_original_ap(m_ptr) && !p_ptr->image) r_ptr->r_flags3 |= (RF3_EVIL);
+ if (is_original_ap(m_ptr) && !subject_ptr->image) r_ptr->r_flags3 |= (RF3_EVIL);
}
- if ((p_ptr->esp_good) && (r_ptr->flags3 & (RF3_GOOD)))
+ if ((subject_ptr->esp_good) && (r_ptr->flags3 & (RF3_GOOD)))
{
flag = TRUE;
- if (is_original_ap(m_ptr) && !p_ptr->image) r_ptr->r_flags3 |= (RF3_GOOD);
+ if (is_original_ap(m_ptr) && !subject_ptr->image) r_ptr->r_flags3 |= (RF3_GOOD);
}
- if ((p_ptr->esp_nonliving) &&
+ if ((subject_ptr->esp_nonliving) &&
((r_ptr->flags3 & (RF3_DEMON | RF3_UNDEAD | RF3_NONLIVING)) == RF3_NONLIVING))
{
flag = TRUE;
- if (is_original_ap(m_ptr) && !p_ptr->image) r_ptr->r_flags3 |= (RF3_NONLIVING);
+ if (is_original_ap(m_ptr) && !subject_ptr->image) r_ptr->r_flags3 |= (RF3_NONLIVING);
}
- if ((p_ptr->esp_unique) && (r_ptr->flags1 & (RF1_UNIQUE)))
+ if ((subject_ptr->esp_unique) && (r_ptr->flags1 & (RF1_UNIQUE)))
{
flag = TRUE;
- if (is_original_ap(m_ptr) && !p_ptr->image) r_ptr->r_flags1 |= (RF1_UNIQUE);
+ if (is_original_ap(m_ptr) && !subject_ptr->image) r_ptr->r_flags1 |= (RF1_UNIQUE);
}
}
/* Normal line of sight, and not blind */
- if (player_has_los_bold(fy, fx) && !p_ptr->blind)
+ if (player_has_los_bold(subject_ptr, fy, fx) && !subject_ptr->blind)
{
bool do_invisible = FALSE;
bool do_cold_blood = FALSE;
/* Snipers can see targets in darkness when they concentrate deeper */
- if (p_ptr->concent >= CONCENT_RADAR_THRESHOLD)
+ if (subject_ptr->concent >= CONCENT_RADAR_THRESHOLD)
{
/* Easy to see */
easy = flag = TRUE;
}
/* Use "infravision" */
- if (d <= p_ptr->see_infra)
+ if (d <= subject_ptr->see_infra)
{
/* Handle "cold blooded" monsters */
if ((r_ptr->flags2 & (RF2_COLD_BLOOD | RF2_AURA_FIRE)) == RF2_COLD_BLOOD)
}
/* Use "illumination" */
- if (player_can_see_bold(fy, fx))
+ if (player_can_see_bold(subject_ptr, fy, fx))
{
/* Handle "invisible" monsters */
if (r_ptr->flags2 & (RF2_INVISIBLE))
do_invisible = TRUE;
/* See invisible */
- if (p_ptr->see_inv)
+ if (subject_ptr->see_inv)
{
/* Easy to see */
easy = flag = TRUE;
/* Visible */
if (flag)
{
- if (is_original_ap(m_ptr) && !p_ptr->image)
+ if (is_original_ap(m_ptr) && !subject_ptr->image)
{
/* Memorize flags */
if (do_invisible) r_ptr->r_flags2 |= (RF2_INVISIBLE);
lite_spot(fy, fx);
/* Update health bar as needed */
- if (p_ptr->health_who == m_idx) p_ptr->redraw |= (PR_HEALTH);
- if (p_ptr->riding == m_idx) p_ptr->redraw |= (PR_UHEALTH);
+ if (subject_ptr->health_who == m_idx) subject_ptr->redraw |= (PR_HEALTH);
+ if (subject_ptr->riding == m_idx) subject_ptr->redraw |= (PR_UHEALTH);
/* Hack -- Count "fresh" sightings */
- if (!p_ptr->image)
+ if (!subject_ptr->image)
{
if ((m_ptr->ap_r_idx == MON_KAGE) && (r_info[MON_KAGE].r_sights < MAX_SHORT))
r_info[MON_KAGE].r_sights++;
if (r_info[m_ptr->ap_r_idx].flags2 & RF2_ELDRITCH_HORROR)
{
- sanity_blast(p_ptr, m_ptr, FALSE);
+ sanity_blast(subject_ptr, m_ptr, FALSE);
}
/* Disturb on appearance */
- if (disturb_near && (projectable(m_ptr->fy, m_ptr->fx, p_ptr->y, p_ptr->x) && projectable(p_ptr->y, p_ptr->x, m_ptr->fy, m_ptr->fx)))
+ if (disturb_near && (projectable(subject_ptr->current_floor_ptr, m_ptr->fy, m_ptr->fx, subject_ptr->y, subject_ptr->x) && projectable(subject_ptr->current_floor_ptr, subject_ptr->y, subject_ptr->x, m_ptr->fy, m_ptr->fx)))
{
if (disturb_pets || is_hostile(m_ptr))
- disturb(TRUE, TRUE);
+ disturb(subject_ptr, TRUE, TRUE);
}
}
}
lite_spot(fy, fx);
/* Update health bar as needed */
- if (p_ptr->health_who == m_idx) p_ptr->redraw |= (PR_HEALTH);
- if (p_ptr->riding == m_idx) p_ptr->redraw |= (PR_UHEALTH);
+ if (subject_ptr->health_who == m_idx) subject_ptr->redraw |= (PR_HEALTH);
+ if (subject_ptr->riding == m_idx) subject_ptr->redraw |= (PR_UHEALTH);
/* Disturb on disappearance */
if (do_disturb)
{
if (disturb_pets || is_hostile(m_ptr))
- disturb(TRUE, TRUE);
+ disturb(subject_ptr, TRUE, TRUE);
}
}
}
if (do_disturb)
{
if (disturb_pets || is_hostile(m_ptr))
- disturb(TRUE, TRUE);
+ disturb(subject_ptr, TRUE, TRUE);
}
}
}
if (do_disturb)
{
if (disturb_pets || is_hostile(m_ptr))
- disturb(TRUE, TRUE);
+ disturb(subject_ptr, TRUE, TRUE);
}
}
}
MONSTER_IDX i;
/* Update each (live) monster */
- for (i = 1; i < current_floor_ptr->m_max; i++)
+ for (i = 1; i < p_ptr->current_floor_ptr->m_max; i++)
{
- monster_type *m_ptr = ¤t_floor_ptr->m_list[i];
+ monster_type *m_ptr = &p_ptr->current_floor_ptr->m_list[i];
if (!monster_is_valid(m_ptr)) continue;
- update_monster(i, full);
+ update_monster(p_ptr, i, full);
}
}
static bool monster_hook_chameleon_lord(MONRACE_IDX r_idx)
{
monster_race *r_ptr = &r_info[r_idx];
- monster_type *m_ptr = ¤t_floor_ptr->m_list[chameleon_change_m_idx];
+ monster_type *m_ptr = &p_ptr->current_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;
if ((r_ptr->blow[0].method == RBM_EXPLODE) || (r_ptr->blow[1].method == RBM_EXPLODE) || (r_ptr->blow[2].method == RBM_EXPLODE) || (r_ptr->blow[3].method == RBM_EXPLODE))
return FALSE;
- if (!monster_can_cross_terrain(current_floor_ptr->grid_array[m_ptr->fy][m_ptr->fx].feat, r_ptr, 0)) return FALSE;
+ if (!monster_can_cross_terrain(p_ptr->current_floor_ptr->grid_array[m_ptr->fy][m_ptr->fx].feat, r_ptr, 0)) return FALSE;
/* Not born */
if (!(old_r_ptr->flags7 & RF7_CHAMELEON))
/* Born now */
else if (summon_specific_who > 0)
{
- if (monster_has_hostile_align(¤t_floor_ptr->m_list[summon_specific_who], 0, 0, r_ptr)) return FALSE;
+ if (monster_has_hostile_align(&p_ptr->current_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 = ¤t_floor_ptr->m_list[chameleon_change_m_idx];
+ monster_type *m_ptr = &p_ptr->current_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;
if ((r_ptr->blow[0].method == RBM_EXPLODE) || (r_ptr->blow[1].method == RBM_EXPLODE) || (r_ptr->blow[2].method == RBM_EXPLODE) || (r_ptr->blow[3].method == RBM_EXPLODE))
return FALSE;
- if (!monster_can_cross_terrain(current_floor_ptr->grid_array[m_ptr->fy][m_ptr->fx].feat, r_ptr, 0)) return FALSE;
+ if (!monster_can_cross_terrain(p_ptr->current_floor_ptr->grid_array[m_ptr->fy][m_ptr->fx].feat, r_ptr, 0)) return FALSE;
/* Not born */
if (!(old_r_ptr->flags7 & RF7_CHAMELEON))
/* Born now */
else if (summon_specific_who > 0)
{
- if (monster_has_hostile_align(¤t_floor_ptr->m_list[summon_specific_who], 0, 0, r_ptr)) return FALSE;
+ if (monster_has_hostile_align(&p_ptr->current_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 = ¤t_floor_ptr->m_list[m_idx];
+ monster_type *m_ptr = &p_ptr->current_floor_ptr->m_list[m_idx];
monster_race *r_ptr;
char old_m_name[MAX_NLEN];
bool old_unique = FALSE;
if (old_unique)
level = r_info[MON_CHAMELEON_K].level;
- else if (!current_floor_ptr->dun_level)
+ else if (!p_ptr->current_floor_ptr->dun_level)
level = wilderness[p_ptr->wilderness_y][p_ptr->wilderness_x].level;
else
- level = current_floor_ptr->dun_level;
+ level = p_ptr->current_floor_ptr->dun_level;
if (d_info[p_ptr->dungeon_idx].flags1 & DF1_CHAMELEON) level+= 2+randint1(3);
m_ptr->r_idx = r_idx;
m_ptr->ap_r_idx = r_idx;
- update_monster(m_idx, FALSE);
+ update_monster(p_ptr, m_idx, FALSE);
lite_spot(m_ptr->fy, m_ptr->fx);
if ((r_info[old_r_idx].flags7 & (RF7_LITE_MASK | RF7_DARK_MASK)) ||
{
int attempts = 1000;
MONRACE_IDX ap_r_idx;
- DEPTH min = MIN(current_floor_ptr->base_level - 5, 50);
+ DEPTH min = MIN(p_ptr->current_floor_ptr->base_level - 5, 50);
if (p_ptr->pseikaku == SEIKAKU_CHARGEMAN && !(generate_mode & (PM_MULTIPLY | PM_KAGE)))
{
- if (current_floor_ptr->base_level == 0 ||
+ if (p_ptr->current_floor_ptr->base_level == 0 ||
(one_in_(5) && my_strchr("hkoptuyAHOPTUVY", r_info[r_idx].d_char))) return MON_ALIEN_JURAL;
}
while (--attempts)
{
- ap_r_idx = get_mon_num(current_floor_ptr->base_level + 10);
+ ap_r_idx = get_mon_num(p_ptr->current_floor_ptr->base_level + 10);
if (r_info[ap_r_idx].level >= min) return ap_r_idx;
}
SPEED mspeed = r_ptr->speed;
/* Hack -- small racial variety */
- if (!(r_ptr->flags1 & RF1_UNIQUE) && !p_ptr->inside_arena)
+ if (!(r_ptr->flags1 & RF1_UNIQUE) && !p_ptr->current_floor_ptr->inside_arena)
{
/* Allow some small variation per monster */
int i = SPEED_TO_ENERGY(r_ptr->speed) / (one_in_(4) ? 3 : 10);
*/
static bool place_monster_one(MONSTER_IDX who, POSITION y, POSITION x, MONRACE_IDX r_idx, BIT_FLAGS mode)
{
- grid_type *g_ptr = ¤t_floor_ptr->grid_array[y][x];
+ grid_type *g_ptr = &p_ptr->current_floor_ptr->grid_array[y][x];
monster_type *m_ptr;
monster_race *r_ptr = &r_info[r_idx];
concptr name = (r_name + r_ptr->name);
/* DO NOT PLACE A MONSTER IN THE SMALL SCALE WILDERNESS !!! */
if (p_ptr->wild_mode) return FALSE;
- if (!in_bounds(y, x)) return (FALSE);
+ if (!in_bounds(p_ptr->current_floor_ptr, y, x)) return (FALSE);
if (!r_idx) return (FALSE);
if (!r_ptr->name) return (FALSE);
}
/* Depth monsters may NOT be created out of depth, unless in Nightmare mode */
- if ((r_ptr->flags1 & (RF1_FORCE_DEPTH)) && (current_floor_ptr->dun_level < r_ptr->level) &&
+ if ((r_ptr->flags1 & (RF1_FORCE_DEPTH)) && (p_ptr->current_floor_ptr->dun_level < r_ptr->level) &&
(!ironman_nightmare || (r_ptr->flags1 & (RF1_QUESTOR))))
{
/* Cannot create */
}
}
- if (quest_number(current_floor_ptr->dun_level))
+ if (quest_number(p_ptr->current_floor_ptr->dun_level))
{
- int hoge = quest_number(current_floor_ptr->dun_level);
+ int hoge = quest_number(p_ptr->current_floor_ptr->dun_level);
if ((quest[hoge].type == QUEST_TYPE_KILL_LEVEL) || (quest[hoge].type == QUEST_TYPE_RANDOM))
{
if(r_idx == quest[hoge].r_idx)
number_mon = 0;
/* Count all quest monsters */
- 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 (current_floor_ptr->m_list[current_floor_ptr->grid_array[j2][i2].m_idx].r_idx == quest[hoge].r_idx)
+ for (i2 = 0; i2 < p_ptr->current_floor_ptr->width; ++i2)
+ for (j2 = 0; j2 < p_ptr->current_floor_ptr->height; j2++)
+ if (p_ptr->current_floor_ptr->grid_array[j2][i2].m_idx > 0)
+ if (p_ptr->current_floor_ptr->m_list[p_ptr->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 = ¤t_floor_ptr->m_list[g_ptr->m_idx];
+ m_ptr = &p_ptr->current_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(¤t_floor_ptr->m_list[who]))
+ if ((mode & PM_MULTIPLY) && (who > 0) && !is_original_ap(&p_ptr->current_floor_ptr->m_list[who]))
{
- m_ptr->ap_r_idx = current_floor_ptr->m_list[who].ap_r_idx;
+ m_ptr->ap_r_idx = p_ptr->current_floor_ptr->m_list[who].ap_r_idx;
/* Hack -- Shadower spawns Shadower */
- if (current_floor_ptr->m_list[who].mflag2 & MFLAG2_KAGE) m_ptr->mflag2 |= MFLAG2_KAGE;
+ if (p_ptr->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 = current_floor_ptr->m_list[who].sub_align;
+ m_ptr->sub_align = p_ptr->current_floor_ptr->m_list[who].sub_align;
else
{
m_ptr->sub_align = SUB_ALIGN_NEUTRAL;
/* Place the monster at the location */
m_ptr->fy = y;
m_ptr->fx = x;
+ m_ptr->current_floor_ptr = p_ptr->current_floor_ptr;
/* No "timed status" yet */
/* Your pet summons its pet. */
- if (who > 0 && is_pet(¤t_floor_ptr->m_list[who]))
+ if (who > 0 && is_pet(&p_ptr->current_floor_ptr->m_list[who]))
{
mode |= PM_FORCE_PET;
m_ptr->parent_m_idx = who;
p_ptr->update |= (PU_MON_LITE);
else if ((r_ptr->flags7 & RF7_HAS_LD_MASK) && !MON_CSLEEP(m_ptr))
p_ptr->update |= (PU_MON_LITE);
- update_monster(g_ptr->m_idx, TRUE);
+ update_monster(p_ptr, g_ptr->m_idx, TRUE);
/* Count the monsters on the level */
real_r_ptr(m_ptr)->floor_id = p_ptr->floor_id;
/* Hack -- Count the number of "reproducers" */
- if (r_ptr->flags2 & RF2_MULTIPLY) current_floor_ptr->num_repro++;
+ if (r_ptr->flags2 & RF2_MULTIPLY) p_ptr->current_floor_ptr->num_repro++;
if (p_ptr->warning && current_world_ptr->character_dungeon)
{
if (g_ptr->info & CAVE_MARK)
{
msg_print(_("ルーンが爆発した!", "The rune explodes!"));
- project(0, 2, y, x, 2 * (p_ptr->lev + damroll(7, 7)), GF_MANA, (PROJECT_GRID | PROJECT_ITEM | PROJECT_KILL | PROJECT_JUMP | PROJECT_NO_HANGEKI), -1);
+ project(p_ptr, 0, 2, y, x, 2 * (p_ptr->lev + damroll(7, 7)), GF_MANA, (PROJECT_GRID | PROJECT_ITEM | PROJECT_KILL | PROJECT_JUMP | PROJECT_NO_HANGEKI), -1);
}
}
else
for (ny = y - max_dist; ny <= y + max_dist; ny++)
{
/* Ignore annoying locations */
- if (!in_bounds(ny, nx)) continue;
+ if (!in_bounds(p_ptr->current_floor_ptr, ny, nx)) continue;
/* Require "line of projection" */
- if (!projectable(y, x, ny, nx)) continue;
+ if (!projectable(p_ptr->current_floor_ptr, y, x, ny, nx)) continue;
if (r_idx > 0)
{
else
{
/* Walls and Monsters block flow */
- if (!cave_empty_bold2(ny, nx)) continue;
+ if (!cave_empty_bold2(p_ptr->current_floor_ptr, ny, nx)) continue;
/* ... nor on the Pattern */
if (pattern_tile(ny, nx)) continue;
total = randint1(10);
/* Hard monsters, small groups */
- if (r_ptr->level > current_floor_ptr->dun_level)
+ if (r_ptr->level > p_ptr->current_floor_ptr->dun_level)
{
- extra = r_ptr->level - current_floor_ptr->dun_level;
+ extra = r_ptr->level - p_ptr->current_floor_ptr->dun_level;
extra = 0 - randint1(extra);
}
/* Easy monsters, large groups */
- else if (r_ptr->level < current_floor_ptr->dun_level)
+ else if (r_ptr->level < p_ptr->current_floor_ptr->dun_level)
{
- extra = current_floor_ptr->dun_level - r_ptr->level;
+ extra = p_ptr->current_floor_ptr->dun_level - r_ptr->level;
extra = randint1(extra);
}
{
POSITION mx, my;
- scatter(&my, &mx, hy, hx, 4, 0);
+ scatter(p_ptr->current_floor_ptr, &my, &mx, hy, hx, 4, 0);
/* Walls and Monsters block flow */
- if (!cave_empty_bold2(my, mx)) continue;
+ if (!cave_empty_bold2(p_ptr->current_floor_ptr, my, mx)) continue;
/* Attempt to place another monster */
if (place_monster_one(who, my, mx, r_idx, mode))
static bool place_monster_can_escort(MONRACE_IDX r_idx)
{
monster_race *r_ptr = &r_info[place_monster_idx];
- monster_type *m_ptr = ¤t_floor_ptr->m_list[place_monster_m_idx];
+ monster_type *m_ptr = &p_ptr->current_floor_ptr->m_list[place_monster_m_idx];
monster_race *z_ptr = &r_info[r_idx];
for(j = 0; j < n; j++)
{
POSITION nx, ny, d = 7;
- scatter(&ny, &nx, y, x, d, 0);
+ scatter(p_ptr->current_floor_ptr, &ny, &nx, y, x, d, 0);
(void)place_monster_one(place_monster_m_idx, ny, nx, r_ptr->reinforce_id[i], mode);
}
}
MONRACE_IDX z;
/* Pick a location */
- scatter(&ny, &nx, y, x, d, 0);
+ scatter(p_ptr->current_floor_ptr, &ny, &nx, y, x, d, 0);
/* Require empty grids */
- if (!cave_empty_bold2(ny, nx)) continue;
+ if (!cave_empty_bold2(p_ptr->current_floor_ptr, ny, nx)) continue;
get_mon_num_prep(place_monster_can_escort, get_monster_hook2(ny, nx));
/* Pick a random race */
get_mon_num_prep(get_monster_hook(), get_monster_hook2(y, x));
/* Pick a monster */
- r_idx = get_mon_num(current_floor_ptr->monster_level);
+ r_idx = get_mon_num(p_ptr->current_floor_ptr->monster_level);
/* Handle failure */
if (!r_idx) return (FALSE);
while (--attempts)
{
/* Pick a monster */
- r_idx = get_mon_num(current_floor_ptr->monster_level);
+ r_idx = get_mon_num(p_ptr->current_floor_ptr->monster_level);
/* Handle failure */
if (!r_idx) return (FALSE);
if (attempts < 1) return FALSE;
- m_idx = current_floor_ptr->grid_array[y][x].m_idx;
+ m_idx = p_ptr->current_floor_ptr->grid_array[y][x].m_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];
+ if (p_ptr->current_floor_ptr->m_list[m_idx].mflag2 & MFLAG2_CHAMELEON) r_ptr = &r_info[p_ptr->current_floor_ptr->m_list[m_idx].r_idx];
for (attempts = randint1(10) + 5; attempts; attempts--)
{
- scatter(&cy, &cx, y, x, 5, 0);
+ scatter(p_ptr->current_floor_ptr, &cy, &cx, y, x, 5, 0);
- (void)summon_specific(m_idx, cy, cx, current_floor_ptr->dun_level + 5, SUMMON_KIN, PM_ALLOW_GROUP);
+ (void)summon_specific(m_idx, cy, cx, p_ptr->current_floor_ptr->dun_level + 5, SUMMON_KIN, PM_ALLOW_GROUP);
y = cy;
x = cx;
{
MONRACE_IDX guardian = d_info[p_ptr->dungeon_idx].final_guardian;
- if (guardian && (d_info[p_ptr->dungeon_idx].maxdepth == current_floor_ptr->dun_level) && (r_info[guardian].cur_num < r_info[guardian].max_num))
+ if (guardian && (d_info[p_ptr->dungeon_idx].maxdepth == p_ptr->current_floor_ptr->dun_level) && (r_info[guardian].cur_num < r_info[guardian].max_num))
{
POSITION oy;
POSITION ox;
while (try_count)
{
/* Get a random spot */
- oy = randint1(current_floor_ptr->height - 4) + 2;
- ox = randint1(current_floor_ptr->width - 4) + 2;
+ oy = randint1(p_ptr->current_floor_ptr->height - 4) + 2;
+ ox = randint1(p_ptr->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))
+ if (cave_empty_bold2(p_ptr->current_floor_ptr, oy, ox) && monster_can_cross_terrain(p_ptr->current_floor_ptr->grid_array[oy][ox].feat, &r_info[guardian], 0))
{
/* Place the guardian */
if (place_monster_aux(0, oy, ox, guardian, (PM_ALLOW_GROUP | PM_NO_KAGE | PM_NO_PET))) return TRUE;
* @details
* Place the monster at least "dis" distance from the player.
* Use "slp" to choose the initial "sleep" status
- * Use "current_floor_ptr->monster_level" for the monster level
+ * Use "p_ptr->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(current_floor_ptr->height);
- x = randint0(current_floor_ptr->width);
+ y = randint0(p_ptr->current_floor_ptr->height);
+ x = randint0(p_ptr->current_floor_ptr->width);
/* Require empty floor grid (was "naked") */
- if (current_floor_ptr->dun_level)
+ if (p_ptr->current_floor_ptr->dun_level)
{
- if (!cave_empty_bold2(y, x)) continue;
+ if (!cave_empty_bold2(p_ptr->current_floor_ptr, y, x)) continue;
}
else
{
- if (!cave_empty_bold(y, x)) continue;
+ if (!cave_empty_bold(p_ptr->current_floor_ptr, y, x)) continue;
}
/* Accept far away grids */
}
- if (randint1(5000) <= current_floor_ptr->dun_level)
+ if (randint1(5000) <= p_ptr->current_floor_ptr->dun_level)
{
if (alloc_horde(y, x))
{
static bool summon_specific_okay(MONRACE_IDX r_idx)
{
monster_race *r_ptr = &r_info[r_idx];
- monster_type *m_ptr = ¤t_floor_ptr->m_list[summon_specific_who];
+ monster_type *m_ptr = &p_ptr->current_floor_ptr->m_list[summon_specific_who];
/* Hack - Only summon dungeon monsters */
if (!mon_hook_dungeon(r_idx)) return (FALSE);
POSITION x, y;
MONRACE_IDX r_idx;
- if (p_ptr->inside_arena) return (FALSE);
+ if (p_ptr->current_floor_ptr->inside_arena) return (FALSE);
if (!mon_scatter(0, &y, &x, y1, x1, 2)) return FALSE;
get_mon_num_prep(summon_specific_okay, get_monster_hook2(y, x));
/* Pick a monster, using the level calculation */
- r_idx = get_mon_num((current_floor_ptr->dun_level + lev) / 2 + 5);
+ r_idx = get_mon_num((p_ptr->current_floor_ptr->dun_level + lev) / 2 + 5);
/* Handle failure */
if (!r_idx)
/* Prevent illegal monsters */
if (r_idx >= max_r_idx) return FALSE;
- if (p_ptr->inside_arena) return FALSE;
+ if (p_ptr->current_floor_ptr->inside_arena) return FALSE;
if (!mon_scatter(r_idx, &y, &x, oy, ox, 2)) return FALSE;
*/
bool multiply_monster(MONSTER_IDX m_idx, bool clone, BIT_FLAGS mode)
{
- monster_type *m_ptr = ¤t_floor_ptr->m_list[m_idx];
+ monster_type *m_ptr = &p_ptr->current_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))
{
- current_floor_ptr->m_list[hack_m_idx_ii].smart |= SM_CLONED;
- current_floor_ptr->m_list[hack_m_idx_ii].mflag2 |= MFLAG2_NOPET;
+ p_ptr->current_floor_ptr->m_list[hack_m_idx_ii].smart |= SM_CLONED;
+ p_ptr->current_floor_ptr->m_list[hack_m_idx_ii].mflag2 |= MFLAG2_NOPET;
}
return TRUE;
HIT_POINT tmp;
PERCENTAGE percentage;
- monster_type *m_ptr = ¤t_floor_ptr->m_list[m_idx];
+ monster_type *m_ptr = &p_ptr->current_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 = ¤t_floor_ptr->m_list[m_idx];
+ monster_type *m_ptr = &p_ptr->current_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 = ¤t_floor_ptr->o_list[this_o_idx];
+ o_ptr = &p_ptr->current_floor_ptr->o_list[this_o_idx];
next_o_idx = o_ptr->next_o_idx;
q_ptr = &forge;
*/
int get_monster_crowd_number(MONSTER_IDX m_idx)
{
- monster_type *m_ptr = ¤t_floor_ptr->m_list[m_idx];
+ monster_type *m_ptr = &p_ptr->current_floor_ptr->m_list[m_idx];
POSITION my = m_ptr->fy;
POSITION mx = m_ptr->fx;
int i;
int ay = my + ddy_ddd[i];
int ax = mx + ddx_ddd[i];
- if (!in_bounds(ay, ax)) continue;
+ if (!in_bounds(p_ptr->current_floor_ptr, ay, ax)) continue;
/* Count number of monsters */
- if (current_floor_ptr->grid_array[ay][ax].m_idx > 0) count++;
+ if (p_ptr->current_floor_ptr->grid_array[ay][ax].m_idx > 0) count++;
}
return count;
-}
\ No newline at end of file
+}