ARTIFACT_IDX i;
/* No artifacts in the town */
- if (!current_floor_ptr->dun_level) return (FALSE);
+ if (!p_ptr->current_floor_ptr->dun_level) return (FALSE);
/* Paranoia -- no "plural" artifacts */
if (o_ptr->number != 1) return (FALSE);
if (a_ptr->sval != o_ptr->sval) continue;
/* XXX XXX Enforce minimum "depth" (loosely) */
- if (a_ptr->level > current_floor_ptr->dun_level)
+ if (a_ptr->level > p_ptr->current_floor_ptr->dun_level)
{
/* Acquire the "out-of-depth factor" */
- int d = (a_ptr->level - current_floor_ptr->dun_level) * 2;
+ int d = (a_ptr->level - p_ptr->current_floor_ptr->dun_level) * 2;
/* Roll for out-of-depth creation */
if (!one_in_(d)) continue;
KIND_OBJECT_IDX k_idx = 0;
/*! @note 地上ではキャンセルする / No artifacts in the town */
- if (!current_floor_ptr->dun_level) return (FALSE);
+ if (!p_ptr->current_floor_ptr->dun_level) return (FALSE);
/*! @note get_obj_num_hookによる指定がある場合は生成をキャンセルする / Themed object */
if (get_obj_num_hook) return (FALSE);
/*! @note アーティファクト生成階が現在に対して足りない場合は高確率で1/(不足階層*2)を満たさないと生成リストに加えられない /
* XXX XXX Enforce minimum "depth" (loosely) */
- if (a_ptr->level > current_floor_ptr->object_level)
+ if (a_ptr->level > p_ptr->current_floor_ptr->object_level)
{
/* @note / Acquire the "out-of-depth factor". Roll for out-of-depth creation. */
- int d = (a_ptr->level - current_floor_ptr->object_level) * 2;
+ int d = (a_ptr->level - p_ptr->current_floor_ptr->object_level) * 2;
if (!one_in_(d)) continue;
}
/*! @note INSTA_ART型固定アーティファクトのベースアイテムもチェック対象とする。ベースアイテムの生成階層が足りない場合1/(不足階層*5) を満たさないと除外される。 /
* Find the base object. XXX XXX Enforce minimum "object" level (loosely). Acquire the "out-of-depth factor". Roll for out-of-depth creation. */
k_idx = lookup_kind(a_ptr->tval, a_ptr->sval);
- if (k_info[k_idx].level > current_floor_ptr->object_level)
+ if (k_info[k_idx].level > p_ptr->current_floor_ptr->object_level)
{
- int d = (k_info[k_idx].level - current_floor_ptr->object_level) * 5;
+ int d = (k_info[k_idx].level - p_ptr->current_floor_ptr->object_level) * 5;
if (!one_in_(d)) continue;
}
{
object_type *o_ptr;
- o_ptr = REF_ITEM(p_ptr, current_floor_ptr, item);
+ o_ptr = REF_ITEM(p_ptr, p_ptr->current_floor_ptr, item);
if (o_ptr->k_idx && (o_ptr->marked & OM_AUTODESTROY))
{
autopick_delayed_alter_aux(item);
/* Scan the pile of objects */
- item = current_floor_ptr->grid_array[p_ptr->y][p_ptr->x].o_idx;
+ item = p_ptr->current_floor_ptr->grid_array[p_ptr->y][p_ptr->x].o_idx;
while (item)
{
- OBJECT_IDX next = current_floor_ptr->o_list[item].next_o_idx;
+ OBJECT_IDX next = p_ptr->current_floor_ptr->o_list[item].next_o_idx;
autopick_delayed_alter_aux(-item);
item = next;
}
object_type *o_ptr;
int idx;
- o_ptr = REF_ITEM(p_ptr, current_floor_ptr, item);
+ o_ptr = REF_ITEM(p_ptr, p_ptr->current_floor_ptr, item);
/* Get the index in the auto-pick/destroy list */
idx = is_autopick(o_ptr);
for (this_o_idx = g_ptr->o_idx; this_o_idx; this_o_idx = next_o_idx)
{
int idx;
- object_type *o_ptr = ¤t_floor_ptr->o_list[this_o_idx];
+ object_type *o_ptr = &p_ptr->current_floor_ptr->o_list[this_o_idx];
next_o_idx = o_ptr->next_o_idx;
idx = is_autopick(o_ptr);
/*
* Wipe monsters in old dungeon
- * This wipe destroys value of current_floor_ptr->m_list[].cur_num .
+ * This wipe destroys value of p_ptr->current_floor_ptr->m_list[].cur_num .
*/
wipe_m_list();
/* Prepare to make a prize */
object_prep(&forge, lookup_kind(prize_list[num-1].tval, prize_list[num-1].sval));
- apply_magic(&forge, current_floor_ptr->object_level, AM_NO_FIXED_ART);
+ apply_magic(&forge, p_ptr->current_floor_ptr->object_level, AM_NO_FIXED_ART);
object_aware(&forge);
object_known(&forge);
clear_bldg(4, 18);
/* Current quest of the building */
- q_index = current_floor_ptr->grid_array[p_ptr->y][p_ptr->x].special;
+ q_index = p_ptr->current_floor_ptr->grid_array[p_ptr->y][p_ptr->x].special;
/* Is there a quest available at the building? */
if (!q_index)
return;
}
- which = f_info[current_floor_ptr->grid_array[p_ptr->y][p_ptr->x].feat].subtype;
+ which = f_info[p_ptr->current_floor_ptr->grid_array[p_ptr->y][p_ptr->x].feat].subtype;
bldg = &building[which];
}
else if ((which == 2) && p_ptr->inside_arena)
{
- if (!p_ptr->exit_bldg && current_floor_ptr->m_cnt > 0)
+ if (!p_ptr->exit_bldg && p_ptr->current_floor_ptr->m_cnt > 0)
{
prt(_("ゲートは閉まっている。モンスターがあなたを待っている!", "The gates are closed. The monster awaits!"), 0, 0);
}
p_ptr->oldpx = p_ptr->x;
}
- forget_lite(current_floor_ptr);
+ forget_lite(p_ptr->current_floor_ptr);
forget_view();
/* Hack -- Increase "icky" depth */
object_type forge;
object_type *q_ptr;
- object_type *o_ptr = ¤t_floor_ptr->o_list[o_idx];
+ object_type *o_ptr = &p_ptr->current_floor_ptr->o_list[o_idx];
/* Small chests often hold "gold" */
number = 5;
small = FALSE;
mode |= AM_GREAT;
- current_floor_ptr->object_level = o_ptr->xtra3;
+ p_ptr->current_floor_ptr->object_level = o_ptr->xtra3;
}
else
{
/* Determine the "value" of the items */
- current_floor_ptr->object_level = ABS(o_ptr->pval) + 10;
+ p_ptr->current_floor_ptr->object_level = ABS(o_ptr->pval) + 10;
}
/* Zero pval means empty chest */
}
/* Reset the object level */
- current_floor_ptr->object_level = current_floor_ptr->base_level;
+ p_ptr->current_floor_ptr->object_level = p_ptr->current_floor_ptr->base_level;
/* Empty */
o_ptr->pval = 0;
{
int i, trap;
- object_type *o_ptr = ¤t_floor_ptr->o_list[o_idx];
+ object_type *o_ptr = &p_ptr->current_floor_ptr->o_list[o_idx];
int mon_level = o_ptr->xtra3;
msg_print(_("突如吹き出した煙に包み込まれた!", "You are enveloped in a cloud of smoke!"));
for (i = 0; i < num; i++)
{
- if (randint1(100)<current_floor_ptr->dun_level)
+ if (randint1(100)<p_ptr->current_floor_ptr->dun_level)
activate_hi_summon(p_ptr->y, p_ptr->x, FALSE);
else
(void)summon_specific(0, y, x, mon_level, 0, (PM_ALLOW_GROUP | PM_ALLOW_UNIQUE | PM_NO_PET));
#include "player-race.h"
#include "player-class.h"
#include "view-mainwindow.h"
+#include "world.h"
/*!
* @brief 装備耐性に準じたブレス効果の選択テーブル /
object_type *o_ptr;
bool success;
- o_ptr = REF_ITEM(user_ptr, current_floor_ptr, item);
+ o_ptr = REF_ITEM(user_ptr, p_ptr->current_floor_ptr, item);
take_turn(user_ptr, 100);
lev = k_info[o_ptr->k_idx].level;
u16b dummy_why;
/* Allocate the "who" array */
- C_MAKE(who, current_floor_ptr->max_m_idx, MONSTER_IDX);
+ C_MAKE(who, current_world_ptr->max_m_idx, MONSTER_IDX);
/* Process the monsters (backwards) */
- for (pet_ctr = current_floor_ptr->m_max - 1; pet_ctr >= 1; pet_ctr--)
+ for (pet_ctr = p_ptr->current_floor_ptr->m_max - 1; pet_ctr >= 1; pet_ctr--)
{
- if (is_pet(¤t_floor_ptr->m_list[pet_ctr]) && (user_ptr->riding != pet_ctr))
+ if (is_pet(&p_ptr->current_floor_ptr->m_list[pet_ctr]) && (user_ptr->riding != pet_ctr))
who[max_pet++] = pet_ctr;
}
}
/* Free the "who" array */
- C_KILL(who, current_floor_ptr->max_m_idx, MONSTER_IDX);
+ C_KILL(who, current_world_ptr->max_m_idx, MONSTER_IDX);
}
o_ptr->timeout = 100 + randint1(100);
return;
{
if (place_monster_aux(0, user_ptr->y + ddy[dir], user_ptr->x + ddx[dir], o_ptr->pval, (PM_FORCE_PET | PM_NO_KAGE)))
{
- if (o_ptr->xtra3) current_floor_ptr->m_list[hack_m_idx_ii].mspeed = o_ptr->xtra3;
- if (o_ptr->xtra5) current_floor_ptr->m_list[hack_m_idx_ii].max_maxhp = o_ptr->xtra5;
- if (o_ptr->xtra4) current_floor_ptr->m_list[hack_m_idx_ii].hp = o_ptr->xtra4;
- current_floor_ptr->m_list[hack_m_idx_ii].maxhp = current_floor_ptr->m_list[hack_m_idx_ii].max_maxhp;
+ if (o_ptr->xtra3) p_ptr->current_floor_ptr->m_list[hack_m_idx_ii].mspeed = o_ptr->xtra3;
+ if (o_ptr->xtra5) p_ptr->current_floor_ptr->m_list[hack_m_idx_ii].max_maxhp = o_ptr->xtra5;
+ if (o_ptr->xtra4) p_ptr->current_floor_ptr->m_list[hack_m_idx_ii].hp = o_ptr->xtra4;
+ p_ptr->current_floor_ptr->m_list[hack_m_idx_ii].maxhp = p_ptr->current_floor_ptr->m_list[hack_m_idx_ii].max_maxhp;
if (o_ptr->inscription)
{
char buf[80];
s--;
#endif
*s = '\0';
- current_floor_ptr->m_list[hack_m_idx_ii].nickname = quark_add(buf);
+ p_ptr->current_floor_ptr->m_list[hack_m_idx_ii].nickname = quark_add(buf);
t = quark_str(o_ptr->inscription);
s = buf;
while(*t && (*t != '#'))
case ACT_SUMMON_PHANTOM:
{
msg_print(_("幻霊を召喚した。", "You summon a phantasmal servant."));
- (void)summon_specific(-1, user_ptr->y, user_ptr->x, current_floor_ptr->dun_level, SUMMON_PHANTOM, (PM_ALLOW_GROUP | PM_FORCE_PET));
+ (void)summon_specific(-1, user_ptr->y, user_ptr->x, p_ptr->current_floor_ptr->dun_level, SUMMON_PHANTOM, (PM_ALLOW_GROUP | PM_FORCE_PET));
break;
}
case ACT_SUMMON_DAWN:
{
msg_print(_("暁の師団を召喚した。", "You summon the Legion of the Dawn."));
- (void)summon_specific(-1, user_ptr->y, user_ptr->x, current_floor_ptr->dun_level, SUMMON_DAWN, (PM_ALLOW_GROUP | PM_FORCE_PET));
+ (void)summon_specific(-1, user_ptr->y, user_ptr->x, p_ptr->current_floor_ptr->dun_level, SUMMON_DAWN, (PM_ALLOW_GROUP | PM_FORCE_PET));
break;
}
monster_race *r_ptr;
msg_print(_("奇妙な場所が頭の中に浮かんだ...", "Some strange places show up in your mind. And you see ..."));
/* Process the 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--)
{
- m_ptr = ¤t_floor_ptr->m_list[i];
+ m_ptr = &p_ptr->current_floor_ptr->m_list[i];
/* Ignore "dead" monsters */
if (!monster_is_valid(m_ptr)) continue;
*/
bool cmd_limit_cast(player_type *creature_ptr)
{
- if (current_floor_ptr->dun_level && (d_info[creature_ptr->dungeon_idx].flags1 & DF1_NO_MAGIC))
+ if (p_ptr->current_floor_ptr->dun_level && (d_info[creature_ptr->dungeon_idx].flags1 & DF1_NO_MAGIC))
{
msg_print(_("ダンジョンが魔法を吸収した!", "The dungeon absorbs all attempted magic!"));
msg_print(NULL);
bool go_up = FALSE;
/* Player grid */
- grid_type *g_ptr = ¤t_floor_ptr->grid_array[creature_ptr->y][creature_ptr->x];
+ grid_type *g_ptr = &p_ptr->current_floor_ptr->grid_array[creature_ptr->y][creature_ptr->x];
feature_type *f_ptr = &f_info[g_ptr->feat];
int up_num = 0;
/* Leaving a quest */
if (!creature_ptr->inside_quest)
{
- current_floor_ptr->dun_level = 0;
+ p_ptr->current_floor_ptr->dun_level = 0;
}
creature_ptr->leaving = TRUE;
return;
}
- if (!current_floor_ptr->dun_level)
+ if (!p_ptr->current_floor_ptr->dun_level)
{
go_up = TRUE;
}
leave_quest_check();
creature_ptr->inside_quest = g_ptr->special;
- current_floor_ptr->dun_level = 0;
+ p_ptr->current_floor_ptr->dun_level = 0;
up_num = 0;
}
}
/* Get out from current dungeon */
- if (current_floor_ptr->dun_level - up_num < d_info[creature_ptr->dungeon_idx].mindepth)
- up_num = current_floor_ptr->dun_level;
+ if (p_ptr->current_floor_ptr->dun_level - up_num < d_info[creature_ptr->dungeon_idx].mindepth)
+ up_num = p_ptr->current_floor_ptr->dun_level;
}
if (record_stair) exe_write_diary(creature_ptr, NIKKI_STAIR, 0-up_num, _("階段を上った", "climbed up the stairs to"));
/* Success */
if ((creature_ptr->pseikaku == SEIKAKU_COMBAT) || (creature_ptr->inventory_list[INVEN_BOW].name1 == ART_CRIMSON))
msg_print(_("なんだこの階段は!", "What's this STAIRWAY!"));
- else if (up_num == current_floor_ptr->dun_level)
+ else if (up_num == p_ptr->current_floor_ptr->dun_level)
msg_print(_("地上に戻った。", "You go back to the surface."));
else
msg_print(_("階段を上って新たなる迷宮へと足を踏み入れた。", "You enter a maze of up staircases."));
void do_cmd_go_down(player_type *creature_ptr)
{
/* Player grid */
- grid_type *g_ptr = ¤t_floor_ptr->grid_array[creature_ptr->y][creature_ptr->x];
+ grid_type *g_ptr = &p_ptr->current_floor_ptr->grid_array[creature_ptr->y][creature_ptr->x];
feature_type *f_ptr = &f_info[g_ptr->feat];
bool fall_trap = FALSE;
/* Leaving a quest */
if (!creature_ptr->inside_quest)
{
- current_floor_ptr->dun_level = 0;
+ p_ptr->current_floor_ptr->dun_level = 0;
}
creature_ptr->leaving = TRUE;
creature_ptr->oldpx = 0;
{
DUNGEON_IDX target_dungeon = 0;
- if (!current_floor_ptr->dun_level)
+ if (!p_ptr->current_floor_ptr->dun_level)
{
target_dungeon = have_flag(f_ptr->flags, FF_ENTRANCE) ? g_ptr->special : DUNGEON_ANGBAND;
if (have_flag(f_ptr->flags, FF_SHAFT)) down_num += 2;
else down_num += 1;
- if (!current_floor_ptr->dun_level)
+ if (!p_ptr->current_floor_ptr->dun_level)
{
/* Enter the dungeon just now */
creature_ptr->enter_dungeon = TRUE;
*/
static OBJECT_IDX chest_check(POSITION y, POSITION x, bool trapped)
{
- grid_type *g_ptr = ¤t_floor_ptr->grid_array[y][x];
+ grid_type *g_ptr = &p_ptr->current_floor_ptr->grid_array[y][x];
OBJECT_IDX this_o_idx, next_o_idx = 0;
/* Scan all objects in the grid */
{
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;
/* Skip unknown chests XXX XXX */
int i, j;
bool flag = TRUE;
bool more = FALSE;
- object_type *o_ptr = ¤t_floor_ptr->o_list[o_idx];
+ object_type *o_ptr = &p_ptr->current_floor_ptr->o_list[o_idx];
take_turn(creature_ptr, 100);
yy = creature_ptr->y + ddy_ddd[d];
xx = creature_ptr->x + ddx_ddd[d];
- /* Get the current_floor_ptr->grid_array */
- g_ptr = ¤t_floor_ptr->grid_array[yy][xx];
+ /* Get the p_ptr->current_floor_ptr->grid_array */
+ g_ptr = &p_ptr->current_floor_ptr->grid_array[yy][xx];
/* Must have knowledge */
if (!(g_ptr->info & (CAVE_MARK))) continue;
if ((o_idx = chest_check(yy, xx, FALSE)) == 0) continue;
/* Grab the object */
- o_ptr = ¤t_floor_ptr->o_list[o_idx];
+ o_ptr = &p_ptr->current_floor_ptr->o_list[o_idx];
/* Already open */
if (o_ptr->pval == 0) continue;
int i, j;
/* Get requested grid */
- grid_type *g_ptr = ¤t_floor_ptr->grid_array[y][x];
+ grid_type *g_ptr = &p_ptr->current_floor_ptr->grid_array[y][x];
feature_type *f_ptr = &f_info[g_ptr->feat];
bool more = FALSE;
x = creature_ptr->x + ddx[dir];
/* Get requested grid */
- g_ptr = ¤t_floor_ptr->grid_array[y][x];
+ g_ptr = &p_ptr->current_floor_ptr->grid_array[y][x];
/* Feature code (applying "mimic" field) */
feat = get_feat_mimic(g_ptr);
*/
static bool exe_close(player_type *creature_ptr, POSITION y, POSITION x)
{
- grid_type *g_ptr = ¤t_floor_ptr->grid_array[y][x];
+ grid_type *g_ptr = &p_ptr->current_floor_ptr->grid_array[y][x];
FEAT_IDX old_feat = g_ptr->feat;
bool more = FALSE;
y = creature_ptr->y + ddy[dir];
x = creature_ptr->x + ddx[dir];
- g_ptr = ¤t_floor_ptr->grid_array[y][x];
+ g_ptr = &p_ptr->current_floor_ptr->grid_array[y][x];
/* Feature code (applying "mimic" field) */
feat = get_feat_mimic(g_ptr);
*/
static bool do_cmd_tunnel_test(POSITION y, POSITION x)
{
- grid_type *g_ptr = ¤t_floor_ptr->grid_array[y][x];
+ grid_type *g_ptr = &p_ptr->current_floor_ptr->grid_array[y][x];
/* Must have knowledge */
if (!(g_ptr->info & CAVE_MARK))
take_turn(creature_ptr, 100);
- g_ptr = ¤t_floor_ptr->grid_array[y][x];
+ g_ptr = &p_ptr->current_floor_ptr->grid_array[y][x];
f_ptr = &f_info[g_ptr->feat];
power = f_ptr->power;
y = creature_ptr->y + ddy[dir];
x = creature_ptr->x + ddx[dir];
- g_ptr = ¤t_floor_ptr->grid_array[y][x];
+ g_ptr = &p_ptr->current_floor_ptr->grid_array[y][x];
/* Feature code (applying "mimic" field) */
feat = get_feat_mimic(g_ptr);
{
int i, j;
- grid_type *g_ptr = ¤t_floor_ptr->grid_array[y][x];
+ grid_type *g_ptr = &p_ptr->current_floor_ptr->grid_array[y][x];
feature_type *f_ptr = &f_info[g_ptr->feat];
/* Must be a closed door */
{
int i, j;
bool more = FALSE;
- object_type *o_ptr = ¤t_floor_ptr->o_list[o_idx];
+ object_type *o_ptr = &p_ptr->current_floor_ptr->o_list[o_idx];
take_turn(creature_ptr, 100);
bool exe_disarm(player_type *creature_ptr, POSITION y, POSITION x, DIRECTION dir)
{
- grid_type *g_ptr = ¤t_floor_ptr->grid_array[y][x];
+ grid_type *g_ptr = &p_ptr->current_floor_ptr->grid_array[y][x];
/* Get feature */
feature_type *f_ptr = &f_info[g_ptr->feat];
y = creature_ptr->y + ddy[dir];
x = creature_ptr->x + ddx[dir];
- g_ptr = ¤t_floor_ptr->grid_array[y][x];
+ g_ptr = &p_ptr->current_floor_ptr->grid_array[y][x];
/* Feature code (applying "mimic" field) */
feat = get_feat_mimic(g_ptr);
*/
static bool do_cmd_bash_aux(player_type *creature_ptr, POSITION y, POSITION x, DIRECTION dir)
{
- grid_type *g_ptr = ¤t_floor_ptr->grid_array[y][x];
+ grid_type *g_ptr = &p_ptr->current_floor_ptr->grid_array[y][x];
/* Get feature */
feature_type *f_ptr = &f_info[g_ptr->feat];
y = creature_ptr->y + ddy[dir];
x = creature_ptr->x + ddx[dir];
- g_ptr = ¤t_floor_ptr->grid_array[y][x];
+ g_ptr = &p_ptr->current_floor_ptr->grid_array[y][x];
/* Feature code (applying "mimic" field) */
feat = get_feat_mimic(g_ptr);
y = creature_ptr->y + ddy[dir];
x = creature_ptr->x + ddx[dir];
- g_ptr = ¤t_floor_ptr->grid_array[y][x];
+ g_ptr = &p_ptr->current_floor_ptr->grid_array[y][x];
/* Feature code (applying "mimic" field) */
feat = get_feat_mimic(g_ptr);
y = creature_ptr->y + ddy[dir];
x = creature_ptr->x + ddx[dir];
- g_ptr = ¤t_floor_ptr->grid_array[y][x];
+ g_ptr = &p_ptr->current_floor_ptr->grid_array[y][x];
/* Feature code (applying "mimic" field) */
feat = get_feat_mimic(g_ptr);
if (!cave_have_flag_bold(ny[cur_dis], nx[cur_dis], FF_PROJECT))
{
hit_wall = TRUE;
- if ((q_ptr->tval == TV_FIGURINE) || object_is_potion(q_ptr) || !current_floor_ptr->grid_array[ny[cur_dis]][nx[cur_dis]].m_idx) break;
+ if ((q_ptr->tval == TV_FIGURINE) || object_is_potion(q_ptr) || !p_ptr->current_floor_ptr->grid_array[ny[cur_dis]][nx[cur_dis]].m_idx) break;
}
/* The player can see the (on screen) missile */
cur_dis++;
/* Monster here, Try to hit it */
- if (current_floor_ptr->grid_array[y][x].m_idx)
+ if (p_ptr->current_floor_ptr->grid_array[y][x].m_idx)
{
- grid_type *g_ptr = ¤t_floor_ptr->grid_array[y][x];
- monster_type *m_ptr = ¤t_floor_ptr->m_list[g_ptr->m_idx];
+ grid_type *g_ptr = &p_ptr->current_floor_ptr->grid_array[y][x];
+ monster_type *m_ptr = &p_ptr->current_floor_ptr->m_list[g_ptr->m_idx];
GAME_TEXT m_name[MAX_NLEN];
monster_name(g_ptr->m_idx, m_name);
if (potion_smash_effect(0, y, x, q_ptr->k_idx))
{
- monster_type *m_ptr = ¤t_floor_ptr->m_list[current_floor_ptr->grid_array[y][x].m_idx];
- if (current_floor_ptr->grid_array[y][x].m_idx && is_friendly(m_ptr) && !MON_INVULNER(m_ptr))
+ monster_type *m_ptr = &p_ptr->current_floor_ptr->m_list[p_ptr->current_floor_ptr->grid_array[y][x].m_idx];
+ if (p_ptr->current_floor_ptr->grid_array[y][x].m_idx && is_friendly(m_ptr) && !MON_INVULNER(m_ptr))
{
GAME_TEXT m_name[MAX_NLEN];
monster_desc(m_name, m_ptr, 0);
msg_format(_("%sは怒った!", "%^s gets angry!"), m_name);
- set_hostile(¤t_floor_ptr->m_list[current_floor_ptr->grid_array[y][x].m_idx]);
+ set_hostile(&p_ptr->current_floor_ptr->m_list[p_ptr->current_floor_ptr->grid_array[y][x].m_idx]);
}
}
do_drop = FALSE;
return (-1);
}
- q_idx = quest_number(current_floor_ptr->dun_level);
+ q_idx = quest_number(p_ptr->current_floor_ptr->dun_level);
if (write_level)
{
if (creature_ptr->inside_arena)
note_level = _("アリーナ:", "Arane:");
- else if (!current_floor_ptr->dun_level)
+ else if (!p_ptr->current_floor_ptr->dun_level)
note_level = _("地上:", "Surface:");
else if (q_idx && (is_fixed_quest_idx(q_idx)
&& !((q_idx == QUEST_OBERON) || (q_idx == QUEST_SERPENT))))
else
{
#ifdef JP
- sprintf(note_level_buf, "%d階(%s):", (int)current_floor_ptr->dun_level, d_name+d_info[creature_ptr->dungeon_idx].name);
+ sprintf(note_level_buf, "%d階(%s):", (int)p_ptr->current_floor_ptr->dun_level, d_name+d_info[creature_ptr->dungeon_idx].name);
#else
- sprintf(note_level_buf, "%s L%d:", d_name+d_info[creature_ptr->dungeon_idx].name, (int)current_floor_ptr->dun_level);
+ sprintf(note_level_buf, "%s L%d:", d_name+d_info[creature_ptr->dungeon_idx].name, (int)p_ptr->current_floor_ptr->dun_level);
#endif
note_level = note_level_buf;
}
}
else
{
- if (!(current_floor_ptr->dun_level+num)) to = _("地上", "the surface");
- else to = format(_("%d階", "level %d"), current_floor_ptr->dun_level+num);
+ if (!(p_ptr->current_floor_ptr->dun_level+num)) to = _("地上", "the surface");
+ else to = format(_("%d階", "level %d"), p_ptr->current_floor_ptr->dun_level+num);
}
fprintf(fff, _(" %2d:%02d %20s %sへ%s。\n", " %2d:%02d %20s %s %s.\n"), hour, min, note_level, _(to, note), _(note, to));
break;
case NIKKI_WIZ_TELE:
{
concptr to;
- if (!current_floor_ptr->dun_level)
+ if (!p_ptr->current_floor_ptr->dun_level)
to = _("地上", "the surface");
else
- to = format(_("%d階(%s)", "level %d of %s"), current_floor_ptr->dun_level, d_name+d_info[creature_ptr->dungeon_idx].name);
+ to = format(_("%d階(%s)", "level %d of %s"), p_ptr->current_floor_ptr->dun_level, d_name+d_info[creature_ptr->dungeon_idx].name);
fprintf(fff, _(" %2d:%02d %20s %sへとウィザード・テレポートで移動した。\n",
" %2d:%02d %20s wizard-teleport to %s.\n"), hour, min, note_level, to);
case NIKKI_PAT_TELE:
{
concptr to;
- if (!current_floor_ptr->dun_level)
+ if (!p_ptr->current_floor_ptr->dun_level)
to = _("地上", "the surface");
else
- to = format(_("%d階(%s)", "level %d of %s"), current_floor_ptr->dun_level, d_name+d_info[creature_ptr->dungeon_idx].name);
+ to = format(_("%d階(%s)", "level %d of %s"), p_ptr->current_floor_ptr->dun_level, d_name+d_info[creature_ptr->dungeon_idx].name);
fprintf(fff, _(" %2d:%02d %20s %sへとパターンの力で移動した。\n",
" %2d:%02d %20s used Pattern to teleport to %s.\n"), hour, min, note_level, to);
if (creature_ptr->wild_mode) return;
/* No useful feeling in quests */
- if (creature_ptr->inside_quest && !random_quest_number(current_floor_ptr->dun_level))
+ if (creature_ptr->inside_quest && !random_quest_number(p_ptr->current_floor_ptr->dun_level))
{
msg_print(_("典型的なクエストのダンジョンのようだ。", "Looks like a typical quest level."));
return;
}
/* No useful feeling in town */
- else if (creature_ptr->town_num && !current_floor_ptr->dun_level)
+ else if (creature_ptr->town_num && !p_ptr->current_floor_ptr->dun_level)
{
if (!strcmp(town_info[creature_ptr->town_num].name, _("荒野", "wilderness")))
{
}
/* No useful feeling in the wilderness */
- else if (!current_floor_ptr->dun_level)
+ else if (!p_ptr->current_floor_ptr->dun_level)
{
msg_print(_("典型的な荒野のようだ。", "Looks like a typical wilderness."));
return;
}
/* Check the dungeon */
- for (y = 0; y < current_floor_ptr->height; y++)
+ for (y = 0; y < p_ptr->current_floor_ptr->height; y++)
{
- for (x = 0; x < current_floor_ptr->width; x++)
+ for (x = 0; x < p_ptr->current_floor_ptr->width; x++)
{
- grid_type *g_ptr = ¤t_floor_ptr->grid_array[y][x];
+ grid_type *g_ptr = &p_ptr->current_floor_ptr->grid_array[y][x];
OBJECT_IDX this_o_idx, next_o_idx = 0;
for (this_o_idx = g_ptr->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;
/* Ignore non-artifacts */
}
/* Process the 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--)
{
- m_ptr = ¤t_floor_ptr->m_list[i];
+ m_ptr = &p_ptr->current_floor_ptr->m_list[i];
/* Ignore "dead" monsters */
if (!monster_is_valid(m_ptr)) continue;
if (music_singing_any(creature_ptr)) stop_singing(creature_ptr);
if (hex_spelling_any(creature_ptr)) stop_hex_spell_all();
- o_ptr = REF_ITEM(creature_ptr, current_floor_ptr, item);
+ o_ptr = REF_ITEM(creature_ptr, p_ptr->current_floor_ptr, item);
sound(SOUND_EAT);
MONSTER_IDX m_idx;
if (!target_set(TARGET_KILL)) return FALSE;
- m_idx = current_floor_ptr->grid_array[target_row][target_col].m_idx;
+ m_idx = p_ptr->current_floor_ptr->grid_array[target_row][target_col].m_idx;
if (!m_idx) break;
if (!player_has_los_bold(target_row, target_col)) break;
if (!projectable(caster_ptr->y, caster_ptr->x, target_row, target_col)) break;
GAME_TEXT m_name[MAX_NLEN];
if (!target_set(TARGET_KILL)) return FALSE;
- if (!current_floor_ptr->grid_array[target_row][target_col].m_idx) break;
+ if (!p_ptr->current_floor_ptr->grid_array[target_row][target_col].m_idx) break;
if (!player_has_los_bold(target_row, target_col)) break;
if (!projectable(caster_ptr->y, caster_ptr->x, target_row, target_col)) break;
- m_ptr = ¤t_floor_ptr->m_list[current_floor_ptr->grid_array[target_row][target_col].m_idx];
+ m_ptr = &p_ptr->current_floor_ptr->m_list[p_ptr->current_floor_ptr->grid_array[target_row][target_col].m_idx];
r_ptr = &r_info[m_ptr->r_idx];
monster_desc(m_name, m_ptr, 0);
if (r_ptr->flagsr & RFR_RES_TELE)
}
msg_format(_("%sを引き戻した。", "You command %s to return."), m_name);
- teleport_monster_to(current_floor_ptr->grid_array[target_row][target_col].m_idx, caster_ptr->y, caster_ptr->x, 100, TELEPORT_PASSIVE);
+ teleport_monster_to(p_ptr->current_floor_ptr->grid_array[target_row][target_col].m_idx, caster_ptr->y, caster_ptr->x, 100, TELEPORT_PASSIVE);
break;
}
case MS_TELE_AWAY:
case MS_S_CYBER:
{
int k;
- int max_cyber = (current_floor_ptr->dun_level / 50) + randint1(3);
+ int max_cyber = (p_ptr->current_floor_ptr->dun_level / 50) + randint1(3);
if (!target_set(TARGET_KILL)) return FALSE;
msg_print(_("サイバーデーモンを召喚した!", "You summon Cyberdemons!"));
if (max_cyber > 4) max_cyber = 4;
total_friends = 0;
- for (m_idx = current_floor_ptr->m_max - 1; m_idx >= 1; m_idx--)
+ for (m_idx = p_ptr->current_floor_ptr->m_max - 1; m_idx >= 1; m_idx--)
{
monster_type *m_ptr;
monster_race *r_ptr;
- m_ptr = ¤t_floor_ptr->m_list[m_idx];
+ m_ptr = &p_ptr->current_floor_ptr->m_list[m_idx];
if (!monster_is_valid(m_ptr)) continue;
r_ptr = &r_info[m_ptr->r_idx];
Term->scr->cv = 1;
/* Allocate the "who" array */
- C_MAKE(who, current_floor_ptr->max_m_idx, MONSTER_IDX);
+ C_MAKE(who, current_world_ptr->max_m_idx, MONSTER_IDX);
/* Process the monsters (backwards) */
- for (pet_ctr = current_floor_ptr->m_max - 1; pet_ctr >= 1; pet_ctr--)
+ for (pet_ctr = p_ptr->current_floor_ptr->m_max - 1; pet_ctr >= 1; pet_ctr--)
{
- if (is_pet(¤t_floor_ptr->m_list[pet_ctr]))
+ if (is_pet(&p_ptr->current_floor_ptr->m_list[pet_ctr]))
who[max_pet++] = pet_ctr;
}
bool kakunin;
pet_ctr = who[i];
- m_ptr = ¤t_floor_ptr->m_list[pet_ctr];
+ m_ptr = &p_ptr->current_floor_ptr->m_list[pet_ctr];
delete_this = FALSE;
kakunin = ((pet_ctr == creature_ptr->riding) || (m_ptr->nickname));
Term->scr->cv = cv;
Term_fresh();
- C_KILL(who, current_floor_ptr->max_m_idx, MONSTER_IDX);
+ C_KILL(who, current_world_ptr->max_m_idx, MONSTER_IDX);
#ifdef JP
msg_format("%d 体のペットを放しました。", Dismissed);
if (!get_direction(&dir, FALSE, FALSE)) return FALSE;
y = creature_ptr->y + ddy[dir];
x = creature_ptr->x + ddx[dir];
- g_ptr = ¤t_floor_ptr->grid_array[y][x];
+ g_ptr = &p_ptr->current_floor_ptr->grid_array[y][x];
if (creature_ptr->special_defense & KATA_MUSOU) set_action(creature_ptr, ACTION_NONE);
{
if (cmd_limit_confused(creature_ptr)) return FALSE;
- m_ptr = ¤t_floor_ptr->m_list[g_ptr->m_idx];
+ m_ptr = &p_ptr->current_floor_ptr->m_list[g_ptr->m_idx];
if (!g_ptr->m_idx || !m_ptr->ml)
{
}
target_pet = old_target_pet;
- if (current_floor_ptr->grid_array[target_row][target_col].m_idx)
+ if (p_ptr->current_floor_ptr->grid_array[target_row][target_col].m_idx)
{
- m_ptr = ¤t_floor_ptr->m_list[current_floor_ptr->grid_array[target_row][target_col].m_idx];
+ m_ptr = &p_ptr->current_floor_ptr->m_list[p_ptr->current_floor_ptr->grid_array[target_row][target_col].m_idx];
if (!is_pet(m_ptr))
{
#ifdef JP
sprintf(target_buf, "ペットのターゲットを指定 (現在:%s)",
- (creature_ptr->pet_t_m_idx ? (creature_ptr->image ? "何か奇妙な物" : (r_name + r_info[current_floor_ptr->m_list[creature_ptr->pet_t_m_idx].ap_r_idx].name)) : "指定なし"));
+ (creature_ptr->pet_t_m_idx ? (creature_ptr->image ? "何か奇妙な物" : (r_name + r_info[p_ptr->current_floor_ptr->m_list[creature_ptr->pet_t_m_idx].ap_r_idx].name)) : "指定なし"));
#else
sprintf(target_buf, "specify a target of pet (now:%s)",
- (creature_ptr->pet_t_m_idx ? (creature_ptr->image ? "something strange" : (r_name + r_info[current_floor_ptr->m_list[creature_ptr->pet_t_m_idx].ap_r_idx].name)) : "nothing"));
+ (creature_ptr->pet_t_m_idx ? (creature_ptr->image ? "something strange" : (r_name + r_info[p_ptr->current_floor_ptr->m_list[creature_ptr->pet_t_m_idx].ap_r_idx].name)) : "nothing"));
#endif
power_desc[num] = target_buf;
powers[num++] = PET_TARGET;
case PET_DISMISS: /* Dismiss pets */
{
/* Check pets (backwards) */
- for (pet_ctr = current_floor_ptr->m_max - 1; pet_ctr >= 1; pet_ctr--)
+ for (pet_ctr = p_ptr->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 (is_pet(&p_ptr->current_floor_ptr->m_list[pet_ctr])) break;
}
if (!pet_ctr)
if (!target_set(TARGET_KILL)) creature_ptr->pet_t_m_idx = 0;
else
{
- grid_type *g_ptr = ¤t_floor_ptr->grid_array[target_row][target_col];
- if (g_ptr->m_idx && (current_floor_ptr->m_list[g_ptr->m_idx].ml))
+ grid_type *g_ptr = &p_ptr->current_floor_ptr->grid_array[target_row][target_col];
+ if (g_ptr->m_idx && (p_ptr->current_floor_ptr->m_list[g_ptr->m_idx].ml))
{
- creature_ptr->pet_t_m_idx = current_floor_ptr->grid_array[target_row][target_col].m_idx;
+ creature_ptr->pet_t_m_idx = p_ptr->current_floor_ptr->grid_array[target_row][target_col].m_idx;
creature_ptr->pet_follow_distance = PET_DESTROY_DIST;
}
else creature_ptr->pet_t_m_idx = 0;
if (creature_ptr->pet_extra_flags & PF_PICKUP_ITEMS)
{
creature_ptr->pet_extra_flags &= ~(PF_PICKUP_ITEMS);
- for (pet_ctr = current_floor_ptr->m_max - 1; pet_ctr >= 1; pet_ctr--)
+ for (pet_ctr = p_ptr->current_floor_ptr->m_max - 1; pet_ctr >= 1; pet_ctr--)
{
- m_ptr = ¤t_floor_ptr->m_list[pet_ctr];
+ m_ptr = &p_ptr->current_floor_ptr->m_list[pet_ctr];
if (is_pet(m_ptr))
{
POSITION y, x, oy, ox, sy = 0, sx = 0;
int sn = 0;
GAME_TEXT m_name[MAX_NLEN];
- monster_type *m_ptr = ¤t_floor_ptr->m_list[creature_ptr->riding];
+ monster_type *m_ptr = &p_ptr->current_floor_ptr->m_list[creature_ptr->riding];
monster_race *r_ptr = &r_info[m_ptr->r_idx];
bool fall_dam = FALSE;
y = creature_ptr->y + ddy_ddd[i];
x = creature_ptr->x + ddx_ddd[i];
- g_ptr = ¤t_floor_ptr->grid_array[y][x];
+ g_ptr = &p_ptr->current_floor_ptr->grid_array[y][x];
if (g_ptr->m_idx) continue;
if (!hex_spelling(HEX_INHAIL)) stop_hex_spell_all();
}
- o_ptr = REF_ITEM(creature_ptr, current_floor_ptr, item);
+ o_ptr = REF_ITEM(creature_ptr, p_ptr->current_floor_ptr, item);
q_ptr = &forge;
object_copy(q_ptr, o_ptr);
int k, used_up, ident, lev;
object_type *o_ptr;
- o_ptr = REF_ITEM(creature_ptr, current_floor_ptr, item);
+ o_ptr = REF_ITEM(creature_ptr, p_ptr->current_floor_ptr, item);
take_turn(creature_ptr, 100);
if (cmd_limit_time_walk(creature_ptr)) return;
{
for (k = 0; k < randint1(3); k++)
{
- if (summon_specific(0, creature_ptr->y, creature_ptr->x, current_floor_ptr->dun_level, 0, (PM_ALLOW_GROUP | PM_ALLOW_UNIQUE | PM_NO_PET)))
+ if (summon_specific(0, creature_ptr->y, creature_ptr->x, p_ptr->current_floor_ptr->dun_level, 0, (PM_ALLOW_GROUP | PM_ALLOW_UNIQUE | PM_NO_PET)))
{
ident = TRUE;
}
{
for (k = 0; k < randint1(3); k++)
{
- if (summon_specific(0, creature_ptr->y, creature_ptr->x, current_floor_ptr->dun_level, SUMMON_UNDEAD, (PM_ALLOW_GROUP | PM_ALLOW_UNIQUE | PM_NO_PET)))
+ if (summon_specific(0, creature_ptr->y, creature_ptr->x, p_ptr->current_floor_ptr->dun_level, SUMMON_UNDEAD, (PM_ALLOW_GROUP | PM_ALLOW_UNIQUE | PM_NO_PET)))
{
ident = TRUE;
}
case SV_SCROLL_SUMMON_PET:
{
- if (summon_specific(-1, creature_ptr->y, creature_ptr->x, current_floor_ptr->dun_level, 0, (PM_ALLOW_GROUP | PM_FORCE_PET)))
+ if (summon_specific(-1, creature_ptr->y, creature_ptr->x, p_ptr->current_floor_ptr->dun_level, 0, (PM_ALLOW_GROUP | PM_FORCE_PET)))
{
ident = TRUE;
}
exp_gain += 60;
else if (cur_exp < SPELL_EXP_SKILLED)
{
- if ((current_floor_ptr->dun_level > 4) && ((current_floor_ptr->dun_level + 10) > caster_ptr->lev))
+ if ((p_ptr->current_floor_ptr->dun_level > 4) && ((p_ptr->current_floor_ptr->dun_level + 10) > caster_ptr->lev))
exp_gain = 8;
}
else if (cur_exp < SPELL_EXP_EXPERT)
{
- if (((current_floor_ptr->dun_level + 5) > caster_ptr->lev) && ((current_floor_ptr->dun_level + 5) > s_ptr->slevel))
+ if (((p_ptr->current_floor_ptr->dun_level + 5) > caster_ptr->lev) && ((p_ptr->current_floor_ptr->dun_level + 5) > s_ptr->slevel))
exp_gain = 2;
}
else if ((cur_exp < SPELL_EXP_MASTER) && !increment)
{
- if (((current_floor_ptr->dun_level + 5) > caster_ptr->lev) && (current_floor_ptr->dun_level > s_ptr->slevel))
+ if (((p_ptr->current_floor_ptr->dun_level + 5) > caster_ptr->lev) && (p_ptr->current_floor_ptr->dun_level > s_ptr->slevel))
exp_gain = 1;
}
caster_ptr->spell_exp[(increment ? 32 : 0) + spell] += exp_gain;
const int times = randint1(powerful ? 8 : 4);
for (k = 0; k < times; k++)
{
- if (summon_specific(0, creature_ptr->y, creature_ptr->x, current_floor_ptr->dun_level, 0, (PM_ALLOW_GROUP | PM_ALLOW_UNIQUE | PM_NO_PET)))
+ if (summon_specific(0, creature_ptr->y, creature_ptr->x, p_ptr->current_floor_ptr->dun_level, 0, (PM_ALLOW_GROUP | PM_ALLOW_UNIQUE | PM_NO_PET)))
{
ident = TRUE;
}
/* Hack -- let staffs of identify get aborted */
bool use_charge = TRUE;
- o_ptr = REF_ITEM(creature_ptr, current_floor_ptr, item);
+ o_ptr = REF_ITEM(creature_ptr, p_ptr->current_floor_ptr, item);
/* Mega-Hack -- refuse to use a pile from the ground */
if ((item < 0) && (o_ptr->number > 1))
object_kind *k_ptr;
- o_ptr = REF_ITEM(creature_ptr, current_floor_ptr, item);
+ o_ptr = REF_ITEM(creature_ptr, p_ptr->current_floor_ptr, item);
/* Mega-Hack -- refuse to zap a pile from the ground */
if ((item < 0) && (o_ptr->number > 1))
object_type *o_ptr;
bool old_target_pet = target_pet;
- o_ptr = REF_ITEM(creature_ptr, current_floor_ptr, item);
+ o_ptr = REF_ITEM(creature_ptr, p_ptr->current_floor_ptr, item);
/* Mega-Hack -- refuse to aim a pile from the ground */
if ((item < 0) && (o_ptr->number > 1))
HIT_POINT k;
int bonus, chance;
WEIGHT n_weight = 0;
- 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];
int num = 0, bonus, chance, vir;
HIT_POINT k;
- 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 = ¤t_floor_ptr->m_list[g_ptr->m_idx];
+ monster_type *m_ptr = &p_ptr->current_floor_ptr->m_list[g_ptr->m_idx];
monster_race *r_ptr = &r_info[m_ptr->r_idx];
/* Access the weapon */
}
/* Hack -- Get new monster */
- m_ptr = ¤t_floor_ptr->m_list[g_ptr->m_idx];
+ m_ptr = &p_ptr->current_floor_ptr->m_list[g_ptr->m_idx];
/* Oops, we need a different name... */
monster_desc(m_name, m_ptr, 0);
}
else if (o_ptr->name1 == ART_G_HAMMER)
{
- monster_type *target_ptr = ¤t_floor_ptr->m_list[g_ptr->m_idx];
+ monster_type *target_ptr = &p_ptr->current_floor_ptr->m_list[g_ptr->m_idx];
if (target_ptr->hold_o_idx)
{
- object_type *q_ptr = ¤t_floor_ptr->o_list[target_ptr->hold_o_idx];
+ object_type *q_ptr = &p_ptr->current_floor_ptr->o_list[target_ptr->hold_o_idx];
GAME_TEXT o_name[MAX_NLEN];
object_desc(o_name, q_ptr, OD_NAME_ONLY);
if (do_quake)
{
earthquake(attacker_ptr->y, attacker_ptr->x, 10, 0);
- if (!current_floor_ptr->grid_array[y][x].m_idx) *mdeath = TRUE;
+ if (!p_ptr->current_floor_ptr->grid_array[y][x].m_idx) *mdeath = TRUE;
}
}
bool mdeath = FALSE;
bool stormbringer = FALSE;
- grid_type *g_ptr = ¤t_floor_ptr->grid_array[y][x];
- monster_type *m_ptr = ¤t_floor_ptr->m_list[g_ptr->m_idx];
+ grid_type *g_ptr = &p_ptr->current_floor_ptr->grid_array[y][x];
+ monster_type *m_ptr = &p_ptr->current_floor_ptr->m_list[g_ptr->m_idx];
monster_race *r_ptr = &r_info[m_ptr->r_idx];
GAME_TEXT m_name[MAX_NLEN];
if (cur < max)
{
- DEPTH ridinglevel = r_info[current_floor_ptr->m_list[attacker_ptr->riding].r_idx].level;
+ DEPTH ridinglevel = r_info[p_ptr->current_floor_ptr->m_list[attacker_ptr->riding].r_idx].level;
DEPTH targetlevel = r_ptr->level;
int inc = 0;
*/
bool make_attack_normal(player_type *target_ptr, 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];
monster_race *r_ptr = &r_info[m_ptr->r_idx];
int ap_cnt;
if (o_idx)
{
object_type *j_ptr;
- j_ptr = ¤t_floor_ptr->o_list[o_idx];
+ j_ptr = &p_ptr->current_floor_ptr->o_list[o_idx];
object_copy(j_ptr, o_ptr);
/* Modify number */
r_ptr->r_flagsr |= (r_ptr->flagsr & RFR_EFF_RES_SHAR_MASK);
}
- if (is_mirror_grid(¤t_floor_ptr->grid_array[target_ptr->y][target_ptr->x]))
+ if (is_mirror_grid(&p_ptr->current_floor_ptr->grid_array[target_ptr->y][target_ptr->x]))
{
teleport_player(10, 0L);
}
if (target_ptr->riding && damage)
{
char m_steed_name[MAX_NLEN];
- monster_desc(m_steed_name, ¤t_floor_ptr->m_list[target_ptr->riding], 0);
+ monster_desc(m_steed_name, &p_ptr->current_floor_ptr->m_list[target_ptr->riding], 0);
if (rakuba(target_ptr, (damage > 200) ? 200 : damage, FALSE))
{
msg_format(_("%^sから落ちてしまった!", "You have fallen from %s."), m_steed_name);
*/
bool monst_attack_monst(MONSTER_IDX m_idx, MONSTER_IDX t_idx)
{
- monster_type *m_ptr = ¤t_floor_ptr->m_list[m_idx];
- monster_type *t_ptr = ¤t_floor_ptr->m_list[t_idx];
+ monster_type *m_ptr = &p_ptr->current_floor_ptr->m_list[m_idx];
+ monster_type *t_ptr = &p_ptr->current_floor_ptr->m_list[t_idx];
monster_race *r_ptr = &r_info[m_ptr->r_idx];
monster_race *tr_ptr = &r_info[t_ptr->r_idx];
if (!see_either && known)
{
- current_floor_ptr->monster_noise = TRUE;
+ p_ptr->current_floor_ptr->monster_noise = TRUE;
}
if (p_ptr->riding && (m_idx == p_ptr->riding)) disturb(p_ptr, TRUE, TRUE);
}
else if (known)
{
- current_floor_ptr->monster_noise = TRUE;
+ p_ptr->current_floor_ptr->monster_noise = TRUE;
}
}
else
}
else if (known)
{
- current_floor_ptr->monster_noise = TRUE;
+ p_ptr->current_floor_ptr->monster_noise = TRUE;
}
teleport_away(m_idx, MAX_SIGHT * 2 + 5, 0L);
*/
void mon_take_hit_mon(MONSTER_IDX m_idx, HIT_POINT dam, bool *dead, bool *fear, concptr note, MONSTER_IDX who)
{
- 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[160];
bool seen = is_seen(m_ptr);
/* Unseen death by normal attack */
if (!seen)
{
- current_floor_ptr->monster_noise = TRUE;
+ p_ptr->current_floor_ptr->monster_noise = TRUE;
}
/* Death by special attack */
else if (note)
if ((dam > 0) && !is_pet(m_ptr) && !is_friendly(m_ptr) && (who != m_idx))
{
- if (is_pet(¤t_floor_ptr->m_list[who]) && !player_bold(m_ptr->target_y, m_ptr->target_x))
+ if (is_pet(&p_ptr->current_floor_ptr->m_list[who]) && !player_bold(m_ptr->target_y, m_ptr->target_x))
{
- set_target(m_ptr, current_floor_ptr->m_list[who].fy, current_floor_ptr->m_list[who].fx);
+ set_target(m_ptr, p_ptr->current_floor_ptr->m_list[who].fy, p_ptr->current_floor_ptr->m_list[who].fx);
}
}
}
else
{
- o_ptr = ¤t_floor_ptr->o_list[0 - item];
+ o_ptr = &p_ptr->current_floor_ptr->o_list[0 - item];
}
/* Sniper - Cannot shot a single arrow twice */
/* Shatter Arrow */
if (snipe_type == SP_KILL_WALL)
{
- g_ptr = ¤t_floor_ptr->grid_array[ny][nx];
+ g_ptr = &p_ptr->current_floor_ptr->grid_array[ny][nx];
if (cave_have_flag_grid(g_ptr, FF_HURT_ROCK) && !g_ptr->m_idx)
{
}
/* Stopped by walls/doors */
- if (!cave_have_flag_bold(ny, nx, FF_PROJECT) && !current_floor_ptr->grid_array[ny][nx].m_idx) break;
+ if (!cave_have_flag_bold(ny, nx, FF_PROJECT) && !p_ptr->current_floor_ptr->grid_array[ny][nx].m_idx) break;
/* Advance the distance */
cur_dis++;
/* Sniper */
if (snipe_type == SP_LITE)
{
- current_floor_ptr->grid_array[ny][nx].info |= (CAVE_GLOW);
+ p_ptr->current_floor_ptr->grid_array[ny][nx].info |= (CAVE_GLOW);
note_spot(ny, nx);
lite_spot(ny, nx);
}
/* Sniper */
if (snipe_type == SP_EVILNESS)
{
- current_floor_ptr->grid_array[ny][nx].info &= ~(CAVE_GLOW | CAVE_MARK);
+ p_ptr->current_floor_ptr->grid_array[ny][nx].info &= ~(CAVE_GLOW | CAVE_MARK);
note_spot(ny, nx);
lite_spot(ny, nx);
}
y = ny;
/* Monster here, Try to hit it */
- if (current_floor_ptr->grid_array[y][x].m_idx)
+ if (p_ptr->current_floor_ptr->grid_array[y][x].m_idx)
{
- grid_type *c_mon_ptr = ¤t_floor_ptr->grid_array[y][x];
+ grid_type *c_mon_ptr = &p_ptr->current_floor_ptr->grid_array[y][x];
- monster_type *m_ptr = ¤t_floor_ptr->m_list[c_mon_ptr->m_idx];
+ monster_type *m_ptr = &p_ptr->current_floor_ptr->m_list[c_mon_ptr->m_idx];
monster_race *r_ptr = &r_info[m_ptr->r_idx];
/* Check the visibility */
if (shooter_ptr->riding)
{
if ((shooter_ptr->skill_exp[GINOU_RIDING] < s_info[shooter_ptr->pclass].s_max[GINOU_RIDING])
- && ((shooter_ptr->skill_exp[GINOU_RIDING] - (RIDING_EXP_BEGINNER * 2)) / 200 < r_info[current_floor_ptr->m_list[shooter_ptr->riding].r_idx].level)
+ && ((shooter_ptr->skill_exp[GINOU_RIDING] - (RIDING_EXP_BEGINNER * 2)) / 200 < r_info[p_ptr->current_floor_ptr->m_list[shooter_ptr->riding].r_idx].level)
&& one_in_(2))
{
shooter_ptr->skill_exp[GINOU_RIDING] += 1;
/* Sniper */
if (snipe_type == SP_HOLYNESS)
{
- current_floor_ptr->grid_array[ny][nx].info |= (CAVE_GLOW);
+ p_ptr->current_floor_ptr->grid_array[ny][nx].info |= (CAVE_GLOW);
note_spot(ny, nx);
lite_spot(ny, nx);
}
if (!in_bounds2(ny, nx)) break;
/* Stopped by walls/doors */
- if (!player_can_enter(current_floor_ptr->grid_array[ny][nx].feat, 0)) break;
+ if (!player_can_enter(p_ptr->current_floor_ptr->grid_array[ny][nx].feat, 0)) break;
/* Stopped by monsters */
if (!cave_empty_bold(ny, nx)) break;
- current_floor_ptr->grid_array[ny][nx].m_idx = m_idx;
- current_floor_ptr->grid_array[oy][ox].m_idx = 0;
+ p_ptr->current_floor_ptr->grid_array[ny][nx].m_idx = m_idx;
+ p_ptr->current_floor_ptr->grid_array[oy][ox].m_idx = 0;
m_ptr->fx = nx;
m_ptr->fy = ny;
if (stick_to)
{
- MONSTER_IDX m_idx = current_floor_ptr->grid_array[y][x].m_idx;
- monster_type *m_ptr = ¤t_floor_ptr->m_list[m_idx];
+ MONSTER_IDX m_idx = p_ptr->current_floor_ptr->grid_array[y][x].m_idx;
+ monster_type *m_ptr = &p_ptr->current_floor_ptr->m_list[m_idx];
OBJECT_IDX o_idx = o_pop();
if (!o_idx)
return;
}
- o_ptr = ¤t_floor_ptr->o_list[o_idx];
+ o_ptr = &p_ptr->current_floor_ptr->o_list[o_idx];
object_copy(o_ptr, q_ptr);
/* Forget mark */
/* Only downward in ironman mode */
if (ironman_downward)
- min_level = current_floor_ptr->dun_level;
+ min_level = p_ptr->current_floor_ptr->dun_level;
/* Maximum level */
if (p_ptr->dungeon_idx == DUNGEON_ANGBAND)
{
- if (current_floor_ptr->dun_level > 100)
+ if (p_ptr->current_floor_ptr->dun_level > 100)
max_level = MAX_DEPTH - 1;
- else if (current_floor_ptr->dun_level == 100)
+ else if (p_ptr->current_floor_ptr->dun_level == 100)
max_level = 100;
}
else
sprintf(ppp, _("テレポート先:(%d-%d)", "Teleport to level (%d-%d): "), (int)min_level, (int)max_level);
/* Default */
- sprintf(tmp_val, "%d", (int)current_floor_ptr->dun_level);
+ sprintf(tmp_val, "%d", (int)p_ptr->current_floor_ptr->dun_level);
/* Ask for a level */
if (!get_string(ppp, tmp_val, 10)) return;
if (autosave_l) do_cmd_save_game(TRUE);
/* Change level */
- current_floor_ptr->dun_level = command_arg;
+ p_ptr->current_floor_ptr->dun_level = command_arg;
leave_quest_check();
wreck_the_pattern(creature_ptr);
}
- pattern_type = f_info[current_floor_ptr->grid_array[creature_ptr->y][creature_ptr->x].feat].subtype;
+ pattern_type = f_info[p_ptr->current_floor_ptr->grid_array[creature_ptr->y][creature_ptr->x].feat].subtype;
switch (pattern_type)
{
/* Regenerate everyone */
- for (i = 1; i < current_floor_ptr->m_max; i++)
+ for (i = 1; i < p_ptr->current_floor_ptr->m_max; i++)
{
/* Check 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];
monster_race *r_ptr = &r_info[m_ptr->r_idx];
if (!monster_is_valid(m_ptr)) continue;
if (creature_ptr->spell_exp[spell] < SPELL_EXP_BEGINNER)
creature_ptr->spell_exp[spell] += 5;
else if(creature_ptr->spell_exp[spell] < SPELL_EXP_SKILLED)
- { if (one_in_(2) && (current_floor_ptr->dun_level > 4) && ((current_floor_ptr->dun_level + 10) > creature_ptr->lev)) creature_ptr->spell_exp[spell] += 1; }
+ { if (one_in_(2) && (p_ptr->current_floor_ptr->dun_level > 4) && ((p_ptr->current_floor_ptr->dun_level + 10) > creature_ptr->lev)) creature_ptr->spell_exp[spell] += 1; }
else if(creature_ptr->spell_exp[spell] < SPELL_EXP_EXPERT)
- { if (one_in_(5) && ((current_floor_ptr->dun_level + 5) > creature_ptr->lev) && ((current_floor_ptr->dun_level + 5) > s_ptr->slevel)) creature_ptr->spell_exp[spell] += 1; }
+ { if (one_in_(5) && ((p_ptr->current_floor_ptr->dun_level + 5) > creature_ptr->lev) && ((p_ptr->current_floor_ptr->dun_level + 5) > s_ptr->slevel)) creature_ptr->spell_exp[spell] += 1; }
else if(creature_ptr->spell_exp[spell] < SPELL_EXP_MASTER)
- { if (one_in_(5) && ((current_floor_ptr->dun_level + 5) > creature_ptr->lev) && (current_floor_ptr->dun_level > s_ptr->slevel)) creature_ptr->spell_exp[spell] += 1; }
+ { if (one_in_(5) && ((p_ptr->current_floor_ptr->dun_level + 5) > creature_ptr->lev) && (p_ptr->current_floor_ptr->dun_level > s_ptr->slevel)) creature_ptr->spell_exp[spell] += 1; }
/* Do any effects of continual song */
exe_spell(creature_ptr, REALM_MUSIC, spell, SPELL_CONT);
*/
static void process_world_aux_hp_and_sp(player_type *creature_ptr)
{
- feature_type *f_ptr = &f_info[current_floor_ptr->grid_array[creature_ptr->y][creature_ptr->x].feat];
+ feature_type *f_ptr = &f_info[p_ptr->current_floor_ptr->grid_array[creature_ptr->y][creature_ptr->x].feat];
bool cave_no_regen = FALSE;
int upkeep_factor = 0;
/* (Vampires) Take damage from sunlight */
if (PRACE_IS_(creature_ptr, RACE_VAMPIRE) || (creature_ptr->mimic_form == MIMIC_VAMPIRE))
{
- if (!current_floor_ptr->dun_level && !creature_ptr->resist_lite && !IS_INVULN() && is_daytime())
+ if (!p_ptr->current_floor_ptr->dun_level && !creature_ptr->resist_lite && !IS_INVULN() && is_daytime())
{
- if ((current_floor_ptr->grid_array[creature_ptr->y][creature_ptr->x].info & (CAVE_GLOW | CAVE_MNDK)) == CAVE_GLOW)
+ if ((p_ptr->current_floor_ptr->grid_array[creature_ptr->y][creature_ptr->x].info & (CAVE_GLOW | CAVE_MNDK)) == CAVE_GLOW)
{
msg_print(_("日光があなたのアンデッドの肉体を焼き焦がした!", "The sun's rays scorch your undead flesh!"));
take_hit(creature_ptr, DAMAGE_NOESCAPE, 1, _("日光", "sunlight"), -1);
{
msg_print(_("熱で火傷した!", "The heat burns you!"));
take_hit(creature_ptr, DAMAGE_NOESCAPE, damage, format(_("%sの上に浮遊したダメージ", "flying over %s"),
- f_name + f_info[get_feat_mimic(¤t_floor_ptr->grid_array[creature_ptr->y][creature_ptr->x])].name), -1);
+ f_name + f_info[get_feat_mimic(&p_ptr->current_floor_ptr->grid_array[creature_ptr->y][creature_ptr->x])].name), -1);
}
else
{
- concptr name = f_name + f_info[get_feat_mimic(¤t_floor_ptr->grid_array[creature_ptr->y][creature_ptr->x])].name;
+ concptr name = f_name + f_info[get_feat_mimic(&p_ptr->current_floor_ptr->grid_array[creature_ptr->y][creature_ptr->x])].name;
msg_format(_("%sで火傷した!", "The %s burns you!"), name);
take_hit(creature_ptr, DAMAGE_NOESCAPE, damage, name, -1);
}
{
msg_print(_("冷気に覆われた!", "The cold engulfs you!"));
take_hit(creature_ptr, DAMAGE_NOESCAPE, damage, format(_("%sの上に浮遊したダメージ", "flying over %s"),
- f_name + f_info[get_feat_mimic(¤t_floor_ptr->grid_array[creature_ptr->y][creature_ptr->x])].name), -1);
+ f_name + f_info[get_feat_mimic(&p_ptr->current_floor_ptr->grid_array[creature_ptr->y][creature_ptr->x])].name), -1);
}
else
{
- concptr name = f_name + f_info[get_feat_mimic(¤t_floor_ptr->grid_array[creature_ptr->y][creature_ptr->x])].name;
+ concptr name = f_name + f_info[get_feat_mimic(&p_ptr->current_floor_ptr->grid_array[creature_ptr->y][creature_ptr->x])].name;
msg_format(_("%sに凍えた!", "The %s frostbites you!"), name);
take_hit(creature_ptr, DAMAGE_NOESCAPE, damage, name, -1);
}
{
msg_print(_("電撃を受けた!", "The electric shocks you!"));
take_hit(creature_ptr, DAMAGE_NOESCAPE, damage, format(_("%sの上に浮遊したダメージ", "flying over %s"),
- f_name + f_info[get_feat_mimic(¤t_floor_ptr->grid_array[creature_ptr->y][creature_ptr->x])].name), -1);
+ f_name + f_info[get_feat_mimic(&p_ptr->current_floor_ptr->grid_array[creature_ptr->y][creature_ptr->x])].name), -1);
}
else
{
- concptr name = f_name + f_info[get_feat_mimic(¤t_floor_ptr->grid_array[creature_ptr->y][creature_ptr->x])].name;
+ concptr name = f_name + f_info[get_feat_mimic(&p_ptr->current_floor_ptr->grid_array[creature_ptr->y][creature_ptr->x])].name;
msg_format(_("%sに感電した!", "The %s shocks you!"), name);
take_hit(creature_ptr, DAMAGE_NOESCAPE, damage, name, -1);
}
{
msg_print(_("酸が飛び散った!", "The acid melt you!"));
take_hit(creature_ptr, DAMAGE_NOESCAPE, damage, format(_("%sの上に浮遊したダメージ", "flying over %s"),
- f_name + f_info[get_feat_mimic(¤t_floor_ptr->grid_array[creature_ptr->y][creature_ptr->x])].name), -1);
+ f_name + f_info[get_feat_mimic(&p_ptr->current_floor_ptr->grid_array[creature_ptr->y][creature_ptr->x])].name), -1);
}
else
{
- concptr name = f_name + f_info[get_feat_mimic(¤t_floor_ptr->grid_array[creature_ptr->y][creature_ptr->x])].name;
+ concptr name = f_name + f_info[get_feat_mimic(&p_ptr->current_floor_ptr->grid_array[creature_ptr->y][creature_ptr->x])].name;
msg_format(_("%sに溶かされた!", "The %s melts you!"), name);
take_hit(creature_ptr, DAMAGE_NOESCAPE, damage, name, -1);
}
{
msg_print(_("毒気を吸い込んだ!", "The gas poisons you!"));
take_hit(creature_ptr, DAMAGE_NOESCAPE, damage, format(_("%sの上に浮遊したダメージ", "flying over %s"),
- f_name + f_info[get_feat_mimic(¤t_floor_ptr->grid_array[creature_ptr->y][creature_ptr->x])].name), -1);
+ f_name + f_info[get_feat_mimic(&p_ptr->current_floor_ptr->grid_array[creature_ptr->y][creature_ptr->x])].name), -1);
if (creature_ptr->resist_pois) (void)set_poisoned(creature_ptr, creature_ptr->poisoned + 1);
}
else
{
- concptr name = f_name + f_info[get_feat_mimic(¤t_floor_ptr->grid_array[creature_ptr->y][creature_ptr->x])].name;
+ concptr name = f_name + f_info[get_feat_mimic(&p_ptr->current_floor_ptr->grid_array[creature_ptr->y][creature_ptr->x])].name;
msg_format(_("%sに毒された!", "The %s poisons you!"), name);
take_hit(creature_ptr, DAMAGE_NOESCAPE, damage, name, -1);
if (creature_ptr->resist_pois) (void)set_poisoned(creature_ptr, creature_ptr->poisoned + 3);
if (creature_ptr->riding)
{
HIT_POINT damage;
- if ((r_info[current_floor_ptr->m_list[creature_ptr->riding].r_idx].flags2 & RF2_AURA_FIRE) && !creature_ptr->immune_fire)
+ if ((r_info[p_ptr->current_floor_ptr->m_list[creature_ptr->riding].r_idx].flags2 & RF2_AURA_FIRE) && !creature_ptr->immune_fire)
{
- damage = r_info[current_floor_ptr->m_list[creature_ptr->riding].r_idx].level / 2;
+ damage = r_info[p_ptr->current_floor_ptr->m_list[creature_ptr->riding].r_idx].level / 2;
if (PRACE_IS_(creature_ptr, RACE_ENT)) damage += damage / 3;
if (creature_ptr->resist_fire) damage = damage / 3;
if (IS_OPPOSE_FIRE()) damage = damage / 3;
msg_print(_("熱い!", "It's hot!"));
take_hit(creature_ptr, DAMAGE_NOESCAPE, damage, _("炎のオーラ", "Fire aura"), -1);
}
- if ((r_info[current_floor_ptr->m_list[creature_ptr->riding].r_idx].flags2 & RF2_AURA_ELEC) && !creature_ptr->immune_elec)
+ if ((r_info[p_ptr->current_floor_ptr->m_list[creature_ptr->riding].r_idx].flags2 & RF2_AURA_ELEC) && !creature_ptr->immune_elec)
{
- damage = r_info[current_floor_ptr->m_list[creature_ptr->riding].r_idx].level / 2;
+ damage = r_info[p_ptr->current_floor_ptr->m_list[creature_ptr->riding].r_idx].level / 2;
if (PRACE_IS_(creature_ptr, RACE_ANDROID)) damage += damage / 3;
if (creature_ptr->resist_elec) damage = damage / 3;
if (IS_OPPOSE_ELEC()) damage = damage / 3;
msg_print(_("痛い!", "It hurts!"));
take_hit(creature_ptr, DAMAGE_NOESCAPE, damage, _("電気のオーラ", "Elec aura"), -1);
}
- if ((r_info[current_floor_ptr->m_list[creature_ptr->riding].r_idx].flags3 & RF3_AURA_COLD) && !creature_ptr->immune_cold)
+ if ((r_info[p_ptr->current_floor_ptr->m_list[creature_ptr->riding].r_idx].flags3 & RF3_AURA_COLD) && !creature_ptr->immune_cold)
{
- damage = r_info[current_floor_ptr->m_list[creature_ptr->riding].r_idx].level / 2;
+ damage = r_info[p_ptr->current_floor_ptr->m_list[creature_ptr->riding].r_idx].level / 2;
if (creature_ptr->resist_cold) damage = damage / 3;
if (IS_OPPOSE_COLD()) damage = damage / 3;
msg_print(_("冷たい!", "It's cold!"));
if (pet) mode |= PM_FORCE_PET;
else mode |= (PM_ALLOW_UNIQUE | PM_NO_PET);
- if (summon_specific((pet ? -1 : 0), creature_ptr->y, creature_ptr->x, current_floor_ptr->dun_level, SUMMON_DEMON, mode))
+ if (summon_specific((pet ? -1 : 0), creature_ptr->y, creature_ptr->x, p_ptr->current_floor_ptr->dun_level, SUMMON_DEMON, mode))
{
msg_print(_("あなたはデーモンを引き寄せた!", "You have attracted a demon!"));
disturb(creature_ptr, FALSE, TRUE);
msg_print(_("突然ほとんど孤独になった気がする。", "You suddenly feel almost lonely."));
banish_monsters(100);
- if (!current_floor_ptr->dun_level && creature_ptr->town_num)
+ if (!p_ptr->current_floor_ptr->dun_level && creature_ptr->town_num)
{
int n;
msg_print(NULL);
/* Absorb light from the current possition */
- if ((current_floor_ptr->grid_array[creature_ptr->y][creature_ptr->x].info & (CAVE_GLOW | CAVE_MNDK)) == CAVE_GLOW)
+ if ((p_ptr->current_floor_ptr->grid_array[creature_ptr->y][creature_ptr->x].info & (CAVE_GLOW | CAVE_MNDK)) == CAVE_GLOW)
{
hp_player(creature_ptr, 10);
}
if (pet) mode |= PM_FORCE_PET;
else mode |= (PM_ALLOW_UNIQUE | PM_NO_PET);
- if (summon_specific((pet ? -1 : 0), creature_ptr->y, creature_ptr->x, current_floor_ptr->dun_level, SUMMON_ANIMAL, mode))
+ if (summon_specific((pet ? -1 : 0), creature_ptr->y, creature_ptr->x, p_ptr->current_floor_ptr->dun_level, SUMMON_ANIMAL, mode))
{
msg_print(_("動物を引き寄せた!", "You have attracted an animal!"));
disturb(creature_ptr, FALSE, TRUE);
if (pet) mode |= PM_FORCE_PET;
else mode |= (PM_ALLOW_UNIQUE | PM_NO_PET);
- if (summon_specific((pet ? -1 : 0), creature_ptr->y, creature_ptr->x, current_floor_ptr->dun_level, SUMMON_DRAGON, mode))
+ if (summon_specific((pet ? -1 : 0), creature_ptr->y, creature_ptr->x, p_ptr->current_floor_ptr->dun_level, SUMMON_DRAGON, mode))
{
msg_print(_("ドラゴンを引き寄せた!", "You have attracted a dragon!"));
disturb(creature_ptr, FALSE, TRUE);
int danger_amount = 0;
MONSTER_IDX monster;
- for (monster = 0; monster < current_floor_ptr->m_max; monster++)
+ for (monster = 0; monster < p_ptr->current_floor_ptr->m_max; monster++)
{
- monster_type *m_ptr = ¤t_floor_ptr->m_list[monster];
+ monster_type *m_ptr = &p_ptr->current_floor_ptr->m_list[monster];
monster_race *r_ptr = &r_info[m_ptr->r_idx];
if (!monster_is_valid(m_ptr)) continue;
/* Call animal */
if ((creature_ptr->cursed & TRC_CALL_ANIMAL) && one_in_(2500))
{
- if (summon_specific(0, creature_ptr->y, creature_ptr->x, current_floor_ptr->dun_level, SUMMON_ANIMAL, (PM_ALLOW_GROUP | PM_ALLOW_UNIQUE | PM_NO_PET)))
+ if (summon_specific(0, creature_ptr->y, creature_ptr->x, p_ptr->current_floor_ptr->dun_level, SUMMON_ANIMAL, (PM_ALLOW_GROUP | PM_ALLOW_UNIQUE | PM_NO_PET)))
{
GAME_TEXT o_name[MAX_NLEN];
/* Call demon */
if ((creature_ptr->cursed & TRC_CALL_DEMON) && one_in_(1111))
{
- if (summon_specific(0, creature_ptr->y, creature_ptr->x, current_floor_ptr->dun_level, SUMMON_DEMON, (PM_ALLOW_GROUP | PM_ALLOW_UNIQUE | PM_NO_PET)))
+ if (summon_specific(0, creature_ptr->y, creature_ptr->x, p_ptr->current_floor_ptr->dun_level, SUMMON_DEMON, (PM_ALLOW_GROUP | PM_ALLOW_UNIQUE | PM_NO_PET)))
{
GAME_TEXT o_name[MAX_NLEN];
/* Call dragon */
if ((creature_ptr->cursed & TRC_CALL_DRAGON) && one_in_(800))
{
- if (summon_specific(0, creature_ptr->y, creature_ptr->x, current_floor_ptr->dun_level, SUMMON_DRAGON,
+ if (summon_specific(0, creature_ptr->y, creature_ptr->x, p_ptr->current_floor_ptr->dun_level, SUMMON_DRAGON,
(PM_ALLOW_GROUP | PM_ALLOW_UNIQUE | PM_NO_PET)))
{
GAME_TEXT o_name[MAX_NLEN];
/* Call undead */
if ((creature_ptr->cursed & TRC_CALL_UNDEAD) && one_in_(1111))
{
- if (summon_specific(0, creature_ptr->y, creature_ptr->x, current_floor_ptr->dun_level, SUMMON_UNDEAD,
+ if (summon_specific(0, creature_ptr->y, creature_ptr->x, p_ptr->current_floor_ptr->dun_level, SUMMON_UNDEAD,
(PM_ALLOW_GROUP | PM_ALLOW_UNIQUE | PM_NO_PET)))
{
GAME_TEXT o_name[MAX_NLEN];
}
/* Process objects on floor */
- for (i = 1; i < current_floor_ptr->o_max; i++)
+ for (i = 1; i < p_ptr->current_floor_ptr->o_max; i++)
{
- object_type *o_ptr = ¤t_floor_ptr->o_list[i];
+ object_type *o_ptr = &p_ptr->current_floor_ptr->o_list[i];
if (!OBJECT_IS_VALID(o_ptr)) continue;
disturb(creature_ptr, FALSE, TRUE);
/* Determine the level */
- if (current_floor_ptr->dun_level || creature_ptr->inside_quest || creature_ptr->enter_dungeon)
+ if (p_ptr->current_floor_ptr->dun_level || creature_ptr->inside_quest || creature_ptr->enter_dungeon)
{
msg_print(_("上に引っ張りあげられる感じがする!", "You feel yourself yanked upwards!"));
if (creature_ptr->dungeon_idx) creature_ptr->recall_dungeon = creature_ptr->dungeon_idx;
if (record_stair)
- exe_write_diary(creature_ptr, NIKKI_RECALL, current_floor_ptr->dun_level, NULL);
+ exe_write_diary(creature_ptr, NIKKI_RECALL, p_ptr->current_floor_ptr->dun_level, NULL);
- current_floor_ptr->dun_level = 0;
+ p_ptr->current_floor_ptr->dun_level = 0;
creature_ptr->dungeon_idx = 0;
leave_quest_check();
creature_ptr->dungeon_idx = creature_ptr->recall_dungeon;
if (record_stair)
- exe_write_diary(creature_ptr, NIKKI_RECALL, current_floor_ptr->dun_level, NULL);
+ exe_write_diary(creature_ptr, NIKKI_RECALL, p_ptr->current_floor_ptr->dun_level, NULL);
/* New depth */
- current_floor_ptr->dun_level = max_dlv[creature_ptr->dungeon_idx];
- if (current_floor_ptr->dun_level < 1) current_floor_ptr->dun_level = 1;
+ p_ptr->current_floor_ptr->dun_level = max_dlv[creature_ptr->dungeon_idx];
+ if (p_ptr->current_floor_ptr->dun_level < 1) p_ptr->current_floor_ptr->dun_level = 1;
/* Nightmare mode makes recall more dangerous */
if (ironman_nightmare && !randint0(666) && (creature_ptr->dungeon_idx == DUNGEON_ANGBAND))
{
- if (current_floor_ptr->dun_level < 50)
+ if (p_ptr->current_floor_ptr->dun_level < 50)
{
- current_floor_ptr->dun_level *= 2;
+ p_ptr->current_floor_ptr->dun_level *= 2;
}
- else if (current_floor_ptr->dun_level < 99)
+ else if (p_ptr->current_floor_ptr->dun_level < 99)
{
- current_floor_ptr->dun_level = (current_floor_ptr->dun_level + 99) / 2;
+ p_ptr->current_floor_ptr->dun_level = (p_ptr->current_floor_ptr->dun_level + 99) / 2;
}
- else if (current_floor_ptr->dun_level > 100)
+ else if (p_ptr->current_floor_ptr->dun_level > 100)
{
- current_floor_ptr->dun_level = d_info[creature_ptr->dungeon_idx].maxdepth - 1;
+ p_ptr->current_floor_ptr->dun_level = d_info[creature_ptr->dungeon_idx].maxdepth - 1;
}
}
if ((q_ptr->type == QUEST_TYPE_RANDOM) &&
(q_ptr->status == QUEST_STATUS_TAKEN) &&
- (q_ptr->level < current_floor_ptr->dun_level))
+ (q_ptr->level < p_ptr->current_floor_ptr->dun_level))
{
q_ptr->status = QUEST_STATUS_FAILED;
q_ptr->complev = (byte)creature_ptr->lev;
disturb(creature_ptr, FALSE, TRUE);
/* Determine the level */
- if (!quest_number(current_floor_ptr->dun_level) && current_floor_ptr->dun_level)
+ if (!quest_number(p_ptr->current_floor_ptr->dun_level) && p_ptr->current_floor_ptr->dun_level)
{
msg_print(_("世界が変わった!", "The world changes!"));
extract_day_hour_min(&day, &hour, &min);
/* Update dungeon feeling, and announce it if changed */
- update_dungeon_feeling(p_ptr, current_floor_ptr);
+ update_dungeon_feeling(p_ptr, p_ptr->current_floor_ptr);
/* 帰還無しモード時のレベルテレポバグ対策 / Fix for level teleport bugs on ironman_downward.*/
if (ironman_downward && (p_ptr->dungeon_idx != DUNGEON_ANGBAND && p_ptr->dungeon_idx != 0))
{
- current_floor_ptr->dun_level = 0;
+ p_ptr->current_floor_ptr->dun_level = 0;
p_ptr->dungeon_idx = 0;
prepare_change_floor_mode(CFM_FIRST_FLOOR | CFM_RAND_PLACE);
p_ptr->inside_arena = FALSE;
int number_mon = 0;
/* Count all hostile monsters */
- for (i2 = 0; i2 < current_floor_ptr->width; ++i2)
- for (j2 = 0; j2 < current_floor_ptr->height; j2++)
+ for (i2 = 0; i2 < p_ptr->current_floor_ptr->width; ++i2)
+ for (j2 = 0; j2 < p_ptr->current_floor_ptr->height; j2++)
{
- grid_type *g_ptr = ¤t_floor_ptr->grid_array[j2][i2];
+ grid_type *g_ptr = &p_ptr->current_floor_ptr->grid_array[j2][i2];
if ((g_ptr->m_idx > 0) && (g_ptr->m_idx != p_ptr->riding))
{
GAME_TEXT m_name[MAX_NLEN];
monster_type *wm_ptr;
- wm_ptr = ¤t_floor_ptr->m_list[win_m_idx];
+ wm_ptr = &p_ptr->current_floor_ptr->m_list[win_m_idx];
monster_desc(m_name, wm_ptr, 0);
msg_format(_("%sが勝利した!", "%s is winner!"), m_name);
p_ptr->energy_need = 0;
update_gambling_monsters();
}
- else if (current_world_ptr->game_turn - current_floor_ptr->generated_turn == 150 * TURNS_PER_TICK)
+ else if (current_world_ptr->game_turn - p_ptr->current_floor_ptr->generated_turn == 150 * TURNS_PER_TICK)
{
msg_print(_("申し分けありませんが、この勝負は引き分けとさせていただきます。", "This battle have ended in a draw."));
p_ptr->au += kakekin;
do_cmd_save_game(TRUE);
}
- if (current_floor_ptr->monster_noise && !ignore_unview)
+ if (p_ptr->current_floor_ptr->monster_noise && !ignore_unview)
{
msg_print(_("何かが聞こえた。", "You hear noise."));
}
/*** Handle the wilderness/town (sunshine) ***/
/* While in town/wilderness */
- if (!current_floor_ptr->dun_level && !p_ptr->inside_quest && !p_ptr->phase_out && !p_ptr->inside_arena)
+ if (!p_ptr->current_floor_ptr->dun_level && !p_ptr->inside_quest && !p_ptr->phase_out && !p_ptr->inside_arena)
{
/* Hack -- Daybreak/Nighfall in town */
if (!(current_world_ptr->game_turn % ((TURNS_PER_TICK * TOWN_DAWN) / 2)))
/* Check for dawn */
dawn = (!(current_world_ptr->game_turn % (TURNS_PER_TICK * TOWN_DAWN)));
- if (dawn) day_break(current_floor_ptr);
- else night_falls(current_floor_ptr);
+ if (dawn) day_break(p_ptr->current_floor_ptr);
+ else night_falls(p_ptr->current_floor_ptr);
}
}
/* While in the dungeon (vanilla_town or lite_town mode only) */
- else if ((vanilla_town || (lite_town && !p_ptr->inside_quest && !p_ptr->phase_out && !p_ptr->inside_arena)) && current_floor_ptr->dun_level)
+ else if ((vanilla_town || (lite_town && !p_ptr->inside_quest && !p_ptr->phase_out && !p_ptr->inside_arena)) && p_ptr->current_floor_ptr->dun_level)
{
/*** Shuffle the Storekeepers ***/
/* Hack -- Process the counters of monsters if needed */
for (i = 0; i < MAX_MTIMED; i++)
{
- if (current_floor_ptr->mproc_max[i] > 0) process_monsters_mtimed(i);
+ if (p_ptr->current_floor_ptr->mproc_max[i] > 0) process_monsters_mtimed(i);
}
}
/* Go up staircase */
case '<':
{
- if (!creature_ptr->wild_mode && !current_floor_ptr->dun_level && !creature_ptr->inside_arena && !creature_ptr->inside_quest)
+ if (!creature_ptr->wild_mode && !p_ptr->current_floor_ptr->dun_level && !creature_ptr->inside_arena && !creature_ptr->inside_quest)
{
if (vanilla_town) break;
{
msg_print(_("呪文を唱えられない!", "You cannot cast spells!"));
}
- else if (current_floor_ptr->dun_level && (d_info[creature_ptr->dungeon_idx].flags1 & DF1_NO_MAGIC) && (creature_ptr->pclass != CLASS_BERSERKER) && (creature_ptr->pclass != CLASS_SMITH))
+ else if (p_ptr->current_floor_ptr->dun_level && (d_info[creature_ptr->dungeon_idx].flags1 & DF1_NO_MAGIC) && (creature_ptr->pclass != CLASS_BERSERKER) && (creature_ptr->pclass != CLASS_SMITH))
{
msg_print(_("ダンジョンが魔法を吸収した!", "The dungeon absorbs all attempted magic!"));
msg_print(NULL);
MONRACE_IDX r_idx;
bool success = FALSE;
get_mon_num_prep(monster_is_fishing_target, NULL);
- r_idx = get_mon_num(current_floor_ptr->dun_level ? current_floor_ptr->dun_level : wilderness[p_ptr->wilderness_y][p_ptr->wilderness_x].level);
+ r_idx = get_mon_num(p_ptr->current_floor_ptr->dun_level ? p_ptr->current_floor_ptr->dun_level : wilderness[p_ptr->wilderness_y][p_ptr->wilderness_x].level);
msg_print(NULL);
if (r_idx && one_in_(2))
{
if (place_monster_aux(0, y, x, r_idx, PM_NO_KAGE))
{
GAME_TEXT m_name[MAX_NLEN];
- monster_desc(m_name, ¤t_floor_ptr->m_list[current_floor_ptr->grid_array[y][x].m_idx], 0);
+ monster_desc(m_name, &p_ptr->current_floor_ptr->m_list[p_ptr->current_floor_ptr->grid_array[y][x].m_idx], 0);
msg_format(_("%sが釣れた!", "You have a good catch!"), m_name);
success = TRUE;
}
if (p_ptr->phase_out)
{
- for(m_idx = 1; m_idx < current_floor_ptr->m_max; m_idx++)
+ for(m_idx = 1; m_idx < p_ptr->current_floor_ptr->m_max; 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];
if (!monster_is_valid(m_ptr)) continue;
if (p_ptr->riding && !p_ptr->confused && !p_ptr->blind)
{
- monster_type *m_ptr = ¤t_floor_ptr->m_list[p_ptr->riding];
+ monster_type *m_ptr = &p_ptr->current_floor_ptr->m_list[p_ptr->riding];
monster_race *r_ptr = &r_info[m_ptr->r_idx];
if (MON_CSLEEP(m_ptr))
if (p_ptr->image) p_ptr->redraw |= (PR_MAP);
/* Shimmer multi-hued monsters */
- for (m_idx = 1; m_idx < current_floor_ptr->m_max; m_idx++)
+ for (m_idx = 1; m_idx < p_ptr->current_floor_ptr->m_max; m_idx++)
{
monster_type *m_ptr;
monster_race *r_ptr;
- m_ptr = ¤t_floor_ptr->m_list[m_idx];
+ m_ptr = &p_ptr->current_floor_ptr->m_list[m_idx];
if (!monster_is_valid(m_ptr)) continue;
/* Skip unseen monsters */
repair_monsters = FALSE;
/* Rotate detection flags */
- for (m_idx = 1; m_idx < current_floor_ptr->m_max; m_idx++)
+ for (m_idx = 1; m_idx < p_ptr->current_floor_ptr->m_max; m_idx++)
{
monster_type *m_ptr;
- m_ptr = ¤t_floor_ptr->m_list[m_idx];
+ m_ptr = &p_ptr->current_floor_ptr->m_list[m_idx];
if (!monster_is_valid(m_ptr)) continue;
/* Nice monsters get mean */
int quest_num = 0;
/* Set the base level */
- current_floor_ptr->base_level = current_floor_ptr->dun_level;
+ p_ptr->current_floor_ptr->base_level = p_ptr->current_floor_ptr->dun_level;
/* Reset various flags */
current_world_ptr->is_loading_now = FALSE;
disturb(p_ptr, TRUE, TRUE);
/* Get index of current quest (if any) */
- quest_num = quest_number(current_floor_ptr->dun_level);
+ quest_num = quest_number(p_ptr->current_floor_ptr->dun_level);
/* Inside a quest? */
if (quest_num)
/* Track maximum dungeon level (if not in quest -KMW-) */
- if ((max_dlv[p_ptr->dungeon_idx] < current_floor_ptr->dun_level) && !p_ptr->inside_quest)
+ if ((max_dlv[p_ptr->dungeon_idx] < p_ptr->current_floor_ptr->dun_level) && !p_ptr->inside_quest)
{
- max_dlv[p_ptr->dungeon_idx] = current_floor_ptr->dun_level;
- if (record_maxdepth) exe_write_diary(p_ptr, NIKKI_MAXDEAPTH, current_floor_ptr->dun_level, NULL);
+ max_dlv[p_ptr->dungeon_idx] = p_ptr->current_floor_ptr->dun_level;
+ if (record_maxdepth) exe_write_diary(p_ptr, NIKKI_MAXDEAPTH, p_ptr->current_floor_ptr->dun_level, NULL);
}
(void)calculate_upkeep(p_ptr);
/* Print quest message if appropriate */
if (!p_ptr->inside_quest && (p_ptr->dungeon_idx == DUNGEON_ANGBAND))
{
- quest_discovery(random_quest_number(current_floor_ptr->dun_level));
- p_ptr->inside_quest = random_quest_number(current_floor_ptr->dun_level);
+ quest_discovery(random_quest_number(p_ptr->current_floor_ptr->dun_level));
+ p_ptr->inside_quest = random_quest_number(p_ptr->current_floor_ptr->dun_level);
}
- if ((current_floor_ptr->dun_level == d_info[p_ptr->dungeon_idx].maxdepth) && d_info[p_ptr->dungeon_idx].final_guardian)
+ if ((p_ptr->current_floor_ptr->dun_level == d_info[p_ptr->dungeon_idx].maxdepth) && d_info[p_ptr->dungeon_idx].final_guardian)
{
if (r_info[d_info[p_ptr->dungeon_idx].final_guardian].max_num)
#ifdef JP
/*** Process this dungeon level ***/
/* Reset the monster generation level */
- current_floor_ptr->monster_level = current_floor_ptr->base_level;
+ p_ptr->current_floor_ptr->monster_level = p_ptr->current_floor_ptr->base_level;
/* Reset the object generation level */
- current_floor_ptr->object_level = current_floor_ptr->base_level;
+ p_ptr->current_floor_ptr->object_level = p_ptr->current_floor_ptr->base_level;
current_world_ptr->is_loading_now = TRUE;
if (p_ptr->energy_need > 0 && !p_ptr->phase_out &&
- (current_floor_ptr->dun_level || p_ptr->leaving_dungeon || p_ptr->inside_arena))
+ (p_ptr->current_floor_ptr->dun_level || p_ptr->leaving_dungeon || p_ptr->inside_arena))
p_ptr->energy_need = 0;
/* Not leaving dungeon */
while (TRUE)
{
/* Hack -- Compact the monster list occasionally */
- if ((current_floor_ptr->m_cnt + 32 > current_floor_ptr->max_m_idx) && !p_ptr->phase_out) compact_monsters(64);
+ if ((p_ptr->current_floor_ptr->m_cnt + 32 > current_world_ptr->max_m_idx) && !p_ptr->phase_out) compact_monsters(64);
/* Hack -- Compress the monster list occasionally */
- if ((current_floor_ptr->m_cnt + 32 < current_floor_ptr->m_max) && !p_ptr->phase_out) compact_monsters(0);
+ if ((p_ptr->current_floor_ptr->m_cnt + 32 < p_ptr->current_floor_ptr->m_max) && !p_ptr->phase_out) compact_monsters(0);
/* Hack -- Compact the object list occasionally */
- if (current_floor_ptr->o_cnt + 32 > current_floor_ptr->max_o_idx) compact_objects(64);
+ if (p_ptr->current_floor_ptr->o_cnt + 32 > current_world_ptr->max_o_idx) compact_objects(64);
/* Hack -- Compress the object list occasionally */
- if (current_floor_ptr->o_cnt + 32 < current_floor_ptr->o_max) compact_objects(0);
+ if (p_ptr->current_floor_ptr->o_cnt + 32 < p_ptr->current_floor_ptr->o_max) compact_objects(0);
/* Process the player */
process_player();
current_world_ptr->character_dungeon = FALSE;
/* Start in town */
- current_floor_ptr->dun_level = 0;
+ p_ptr->current_floor_ptr->dun_level = 0;
p_ptr->inside_quest = 0;
p_ptr->inside_arena = FALSE;
p_ptr->phase_out = FALSE;
if (p_ptr->riding == -1)
{
p_ptr->riding = 0;
- for (i = current_floor_ptr->m_max; i > 0; i--)
+ for (i = p_ptr->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))
+ if (player_bold(p_ptr->current_floor_ptr->m_list[i].fy, p_ptr->current_floor_ptr->m_list[i].fx))
{
p_ptr->riding = i;
break;
record_o_name[0] = '\0';
/* Reset map panel */
- panel_row_min = current_floor_ptr->height;
- panel_col_min = current_floor_ptr->width;
+ panel_row_min = p_ptr->current_floor_ptr->height;
+ panel_col_min = p_ptr->current_floor_ptr->width;
/* Sexy gal gets bonus to maximum weapon skill of whip */
if (p_ptr->pseikaku == SEIKAKU_SEXY)
}
/* Initialize the town-buildings if necessary */
- if (!current_floor_ptr->dun_level && !p_ptr->inside_quest)
+ if (!p_ptr->current_floor_ptr->dun_level && !p_ptr->inside_quest)
{
process_dungeon_file("w_info.txt", 0, 0, current_world_ptr->max_wild_y, current_world_ptr->max_wild_x);
init_flags = INIT_ONLY_BUILDINGS;
monster_race *r_ptr = &r_info[pet_r_idx];
place_monster_aux(0, p_ptr->y, p_ptr->x - 1, pet_r_idx,
(PM_FORCE_PET | PM_NO_KAGE));
- m_ptr = ¤t_floor_ptr->m_list[hack_m_idx_ii];
+ m_ptr = &p_ptr->current_floor_ptr->m_list[hack_m_idx_ii];
m_ptr->mspeed = r_ptr->speed;
m_ptr->maxhp = r_ptr->hdice*(r_ptr->hside+1)/2;
m_ptr->max_maxhp = m_ptr->maxhp;
/* Cancel the health bar */
health_track(0);
- forget_lite(current_floor_ptr);
+ forget_lite(p_ptr->current_floor_ptr);
forget_view();
- clear_mon_lite(current_floor_ptr);
+ clear_mon_lite(p_ptr->current_floor_ptr);
/* Handle "quit and save" */
if (!p_ptr->playing && !p_ptr->is_dead) break;
- /* Erase the old current_floor_ptr->grid_array */
+ /* Erase the old p_ptr->current_floor_ptr->grid_array */
wipe_o_list();
if (!p_ptr->is_dead) wipe_m_list();
if (current_world_ptr->game_turn > rollback_turns) current_world_ptr->game_turn -= rollback_turns;
else current_world_ptr->game_turn = 1;
- if (current_floor_ptr->generated_turn > rollback_turns) current_floor_ptr->generated_turn -= rollback_turns;
- else current_floor_ptr->generated_turn = 1;
+ if (p_ptr->current_floor_ptr->generated_turn > rollback_turns) p_ptr->current_floor_ptr->generated_turn -= rollback_turns;
+ else p_ptr->current_floor_ptr->generated_turn = 1;
if (current_world_ptr->arena_start_turn > rollback_turns) current_world_ptr->arena_start_turn -= rollback_turns;
else current_world_ptr->arena_start_turn = 1;
if (p_ptr->feeling_turn > rollback_turns) p_ptr->feeling_turn -= rollback_turns;
*/
static void drop_here(object_type *j_ptr, POSITION y, POSITION x)
{
- grid_type *g_ptr = ¤t_floor_ptr->grid_array[y][x];
+ grid_type *g_ptr = &p_ptr->current_floor_ptr->grid_array[y][x];
object_type *o_ptr;
OBJECT_IDX o_idx = o_pop();
/* Access new object */
- o_ptr = ¤t_floor_ptr->o_list[o_idx];
+ o_ptr = &p_ptr->current_floor_ptr->o_list[o_idx];
/* Structure copy */
object_copy(o_ptr, j_ptr);
return parse_line_feature(buf);
}
- /* Process "D:<dungeon>" -- info for the current_floor_ptr->grid_array grids */
+ /* Process "D:<dungeon>" -- info for the p_ptr->current_floor_ptr->grid_array grids */
else if (buf[0] == 'D')
{
object_type object_type_body;
for (*x = xmin, i = 0; ((*x < xmax) && (i < len)); (*x)++, s++, i++)
{
- grid_type *g_ptr = ¤t_floor_ptr->grid_array[*y][*x];
+ grid_type *g_ptr = &p_ptr->current_floor_ptr->grid_array[*y][*x];
int idx = s[0];
/* Create a monster */
if (random & RANDOM_MONSTER)
{
- current_floor_ptr->monster_level = current_floor_ptr->base_level + monster_index;
+ p_ptr->current_floor_ptr->monster_level = p_ptr->current_floor_ptr->base_level + monster_index;
place_monster(*y, *x, (PM_ALLOW_SLEEP | PM_ALLOW_GROUP));
- current_floor_ptr->monster_level = current_floor_ptr->base_level;
+ p_ptr->current_floor_ptr->monster_level = p_ptr->current_floor_ptr->base_level;
}
else if (monster_index)
{
if (clone)
{
/* clone */
- current_floor_ptr->m_list[hack_m_idx_ii].smart |= SM_CLONED;
+ p_ptr->current_floor_ptr->m_list[hack_m_idx_ii].smart |= SM_CLONED;
/* Make alive again for real unique monster */
r_info[monster_index].cur_num = old_cur_num;
/* Object (and possible trap) */
if ((random & RANDOM_OBJECT) && (random & RANDOM_TRAP))
{
- current_floor_ptr->object_level = current_floor_ptr->base_level + object_index;
+ p_ptr->current_floor_ptr->object_level = p_ptr->current_floor_ptr->base_level + object_index;
/*
* Random trap and random treasure defined
place_trap(*y, *x);
}
- current_floor_ptr->object_level = current_floor_ptr->base_level;
+ p_ptr->current_floor_ptr->object_level = p_ptr->current_floor_ptr->base_level;
}
else if (random & RANDOM_OBJECT)
{
- current_floor_ptr->object_level = current_floor_ptr->base_level + object_index;
+ p_ptr->current_floor_ptr->object_level = p_ptr->current_floor_ptr->base_level + object_index;
/* Create an out of deep object */
if (randint0(100) < 75)
else
place_object(*y, *x, AM_GOOD | AM_GREAT);
- current_floor_ptr->object_level = current_floor_ptr->base_level;
+ p_ptr->current_floor_ptr->object_level = p_ptr->current_floor_ptr->base_level;
}
/* Random trap */
else if (random & RANDOM_TRAP)
}
/* Apply magic (no messages, no artifacts) */
- apply_magic(o_ptr, current_floor_ptr->base_level, AM_NO_FIXED_ART | AM_GOOD);
+ apply_magic(o_ptr, p_ptr->current_floor_ptr->base_level, AM_NO_FIXED_ART | AM_GOOD);
drop_here(o_ptr, *y, *x);
}
/* Hack - Set the dungeon size */
panels_y = (*y / SCREEN_HGT);
if (*y % SCREEN_HGT) panels_y++;
- current_floor_ptr->height = panels_y * SCREEN_HGT;
+ p_ptr->current_floor_ptr->height = panels_y * SCREEN_HGT;
panels_x = (*x / SCREEN_WID);
if (*x % SCREEN_WID) panels_x++;
- current_floor_ptr->width = panels_x * SCREEN_WID;
+ p_ptr->current_floor_ptr->width = panels_x * SCREEN_WID;
/* Assume illegal panel */
- panel_row_min = current_floor_ptr->height;
- panel_col_min = current_floor_ptr->width;
+ panel_row_min = p_ptr->current_floor_ptr->height;
+ panel_col_min = p_ptr->current_floor_ptr->width;
/* Place player in a quest level */
if (p_ptr->inside_quest)
/* Maximum o_idx */
else if (zz[0][0] == 'O')
{
- current_floor_ptr->max_o_idx = (OBJECT_IDX)atoi(zz[1]);
+ current_world_ptr->max_o_idx = (OBJECT_IDX)atoi(zz[1]);
}
/* Maximum m_idx */
else if (zz[0][0] == 'M')
{
- current_floor_ptr->max_m_idx = (MONSTER_IDX)atoi(zz[1]);
+ current_world_ptr->max_m_idx = (MONSTER_IDX)atoi(zz[1]);
}
/* Wilderness size */
}
else
{
- if (MON_FAST(¤t_floor_ptr->m_list[creature_ptr->riding])) tmp_speed += 10;
- if (MON_SLOW(¤t_floor_ptr->m_list[creature_ptr->riding])) tmp_speed -= 10;
+ if (MON_FAST(&p_ptr->current_floor_ptr->m_list[creature_ptr->riding])) tmp_speed += 10;
+ if (MON_SLOW(&p_ptr->current_floor_ptr->m_list[creature_ptr->riding])) tmp_speed -= 10;
}
if (tmp_speed)
sprintf(statmsg, "...You %s after the winning.", streq(creature_ptr->died_from, "Seppuku") ? "did Seppuku" : "retired from the adventure");
#endif
}
- else if (!current_floor_ptr->dun_level)
+ else if (!p_ptr->current_floor_ptr->dun_level)
{
#ifdef JP
sprintf(statmsg, "…あなたは%sで%sに殺された。", map_name(), creature_ptr->died_from);
else
{
#ifdef JP
- sprintf(statmsg, "…あなたは、%sの%d階で%sに殺された。", map_name(), (int)current_floor_ptr->dun_level, creature_ptr->died_from);
+ sprintf(statmsg, "…あなたは、%sの%d階で%sに殺された。", map_name(), (int)p_ptr->current_floor_ptr->dun_level, creature_ptr->died_from);
#else
- sprintf(statmsg, "...You were killed by %s on level %d of %s.", creature_ptr->died_from, current_floor_ptr->dun_level, map_name());
+ sprintf(statmsg, "...You were killed by %s on level %d of %s.", creature_ptr->died_from, p_ptr->current_floor_ptr->dun_level, map_name());
#endif
}
}
else if (current_world_ptr->character_dungeon)
{
- if (!current_floor_ptr->dun_level)
+ if (!p_ptr->current_floor_ptr->dun_level)
{
sprintf(statmsg, _("…あなたは現在、 %s にいる。", "...Now, you are in %s."), map_name());
}
else
{
#ifdef JP
- sprintf(statmsg, "…あなたは現在、 %s の %d 階で探索している。", map_name(), (int)current_floor_ptr->dun_level);
+ sprintf(statmsg, "…あなたは現在、 %s の %d 階で探索している。", map_name(), (int)p_ptr->current_floor_ptr->dun_level);
#else
- sprintf(statmsg, "...Now, you are exploring level %d of %s.", current_floor_ptr->dun_level, map_name());
+ sprintf(statmsg, "...Now, you are exploring level %d of %s.", p_ptr->current_floor_ptr->dun_level, map_name());
#endif
}
}
bool pet_settings = FALSE;
GAME_TEXT pet_name[MAX_NLEN];
- 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;
if (!is_pet(m_ptr)) continue;
if (!(p_ptr->noscore & 0x00FF))
{
/* Ignore people who die in town */
- if (current_floor_ptr->dun_level)
+ if (p_ptr->current_floor_ptr->dun_level)
{
char tmp[128];
/* "Bones" name */
- sprintf(tmp, "bone.%03d", current_floor_ptr->dun_level);
+ sprintf(tmp, "bone.%03d", p_ptr->current_floor_ptr->dun_level);
path_build(str, sizeof(str), ANGBAND_DIR_BONE, tmp);
/* Attempt to open the bones file */
if (!streq(p_ptr->died_from, "ripe") && !streq(p_ptr->died_from, "Seppuku"))
{
- if (current_floor_ptr->dun_level == 0)
+ if (p_ptr->current_floor_ptr->dun_level == 0)
{
concptr field_name = p_ptr->town_num ? "街" : "荒野";
if (streq(p_ptr->died_from, "途中終了"))
{
if (streq(p_ptr->died_from, "途中終了"))
{
- sprintf(tmp, "地下 %d 階で死んだ", (int)current_floor_ptr->dun_level);
+ sprintf(tmp, "地下 %d 階で死んだ", (int)p_ptr->current_floor_ptr->dun_level);
}
else
{
- sprintf(tmp, "に地下 %d 階で殺された", (int)current_floor_ptr->dun_level);
+ sprintf(tmp, "に地下 %d 階で殺された", (int)p_ptr->current_floor_ptr->dun_level);
}
}
center_string(buf, tmp);
put_str(buf, 15 + extra_line, 11);
}
#else
- (void)sprintf(tmp, "Killed on Level %d", current_floor_ptr->dun_level);
+ (void)sprintf(tmp, "Killed on Level %d", p_ptr->current_floor_ptr->dun_level);
center_string(buf, tmp);
put_str(buf, 14, 11);
/* Mark the savefile */
(void)strcpy(p_ptr->died_from, _("強制終了", "Abortion"));
- forget_lite(current_floor_ptr);
+ forget_lite(p_ptr->current_floor_ptr);
forget_view();
- clear_mon_lite(current_floor_ptr);
+ clear_mon_lite(p_ptr->current_floor_ptr);
/* Close stuff */
close_game();
/* Cause of "death" */
(void)strcpy(p_ptr->died_from, _("強制終了中", "Interrupting"));
- forget_lite(current_floor_ptr);
+ forget_lite(p_ptr->current_floor_ptr);
forget_view();
- clear_mon_lite(current_floor_ptr);
+ clear_mon_lite(p_ptr->current_floor_ptr);
/* Stop playing */
p_ptr->playing = FALSE;
if (!current_world_ptr->character_generated || current_world_ptr->character_saved) quit(NULL);
- forget_lite(current_floor_ptr);
+ forget_lite(p_ptr->current_floor_ptr);
forget_view();
- clear_mon_lite(current_floor_ptr);
+ clear_mon_lite(p_ptr->current_floor_ptr);
/* Clear the bottom line */
Term_erase(0, hgt - 1, 255);
/* forget_lite(); Perhaps don't need? */
/* Add it to later visual update */
- cave_redraw_later(¤t_floor_ptr->grid_array[player_ptr->y][player_ptr->x], player_ptr->y, player_ptr->x);
+ cave_redraw_later(&p_ptr->current_floor_ptr->grid_array[player_ptr->y][player_ptr->x], player_ptr->y, player_ptr->x);
}
#endif
/*** Save the old "lite" grids for later ***/
/* Clear them all */
- for (i = 0; i < current_floor_ptr->lite_n; i++)
+ for (i = 0; i < p_ptr->current_floor_ptr->lite_n; i++)
{
- y = current_floor_ptr->lite_y[i];
- x = current_floor_ptr->lite_x[i];
+ y = p_ptr->current_floor_ptr->lite_y[i];
+ x = p_ptr->current_floor_ptr->lite_x[i];
/* Mark the grid as not "lite" */
- current_floor_ptr->grid_array[y][x].info &= ~(CAVE_LITE);
+ p_ptr->current_floor_ptr->grid_array[y][x].info &= ~(CAVE_LITE);
/* Mark the grid as "seen" */
- current_floor_ptr->grid_array[y][x].info |= (CAVE_TEMP);
+ p_ptr->current_floor_ptr->grid_array[y][x].info |= (CAVE_TEMP);
/* Add it to the "seen" set */
tmp_pos.y[tmp_pos.n] = y;
}
/* None left */
- current_floor_ptr->lite_n = 0;
+ p_ptr->current_floor_ptr->lite_n = 0;
/*** Collect the new "lite" grids ***/
/* Maximal south */
max_y = player_ptr->y + p;
- if (max_y > current_floor_ptr->height - 1) max_y = current_floor_ptr->height - 1;
+ if (max_y > p_ptr->current_floor_ptr->height - 1) max_y = p_ptr->current_floor_ptr->height - 1;
/* Maximal west */
min_x = player_ptr->x - p;
/* Maximal east */
max_x = player_ptr->x + p;
- if (max_x > current_floor_ptr->width - 1) max_x = current_floor_ptr->width - 1;
+ if (max_x > p_ptr->current_floor_ptr->width - 1) max_x = p_ptr->current_floor_ptr->width - 1;
/* Scan the maximal box */
for (y = min_y; y <= max_y; y++)
if (d > p) continue;
/* Viewable, nearby, grids get "torch lit" */
- if (current_floor_ptr->grid_array[y][x].info & CAVE_VIEW)
+ if (p_ptr->current_floor_ptr->grid_array[y][x].info & CAVE_VIEW)
{
/* This grid is "torch lit" */
cave_lite_hack(y, x);
/*** Complete the algorithm ***/
/* Draw the new grids */
- for (i = 0; i < current_floor_ptr->lite_n; i++)
+ for (i = 0; i < p_ptr->current_floor_ptr->lite_n; i++)
{
- y = current_floor_ptr->lite_y[i];
- x = current_floor_ptr->lite_x[i];
+ y = p_ptr->current_floor_ptr->lite_y[i];
+ x = p_ptr->current_floor_ptr->lite_x[i];
- g_ptr = ¤t_floor_ptr->grid_array[y][x];
+ g_ptr = &p_ptr->current_floor_ptr->grid_array[y][x];
/* Update fresh grids */
if (g_ptr->info & (CAVE_TEMP)) continue;
y = tmp_pos.y[i];
x = tmp_pos.x[i];
- g_ptr = ¤t_floor_ptr->grid_array[y][x];
+ g_ptr = &p_ptr->current_floor_ptr->grid_array[y][x];
/* No longer in the array */
g_ptr->info &= ~(CAVE_TEMP);
grid_type *g_ptr;
/* None to forget */
- if (!current_floor_ptr->view_n) return;
+ if (!p_ptr->current_floor_ptr->view_n) return;
/* Clear them all */
- for (i = 0; i < current_floor_ptr->view_n; i++)
+ for (i = 0; i < p_ptr->current_floor_ptr->view_n; i++)
{
- POSITION y = current_floor_ptr->view_y[i];
- POSITION x = current_floor_ptr->view_x[i];
- g_ptr = ¤t_floor_ptr->grid_array[y][x];
+ POSITION y = p_ptr->current_floor_ptr->view_y[i];
+ POSITION x = p_ptr->current_floor_ptr->view_x[i];
+ g_ptr = &p_ptr->current_floor_ptr->grid_array[y][x];
/* Forget that the grid is viewable */
g_ptr->info &= ~(CAVE_VIEW);
}
/* None left */
- current_floor_ptr->view_n = 0;
+ p_ptr->current_floor_ptr->view_n = 0;
}
grid_type *g2_c_ptr;
/* Access the grids */
- g1_c_ptr = ¤t_floor_ptr->grid_array[y1][x1];
- g2_c_ptr = ¤t_floor_ptr->grid_array[y2][x2];
+ g1_c_ptr = &p_ptr->current_floor_ptr->grid_array[y1][x1];
+ g2_c_ptr = &p_ptr->current_floor_ptr->grid_array[y2][x2];
/* Check for walls */
/* Totally blocked by "unviewable neighbors" */
if (!v1 && !v2) return (TRUE);
- g_ptr = ¤t_floor_ptr->grid_array[y][x];
+ g_ptr = &p_ptr->current_floor_ptr->grid_array[y][x];
/* Check for walls */
/* We trust this grid is in bounds */
/* if (!in_bounds2(y, x)) return; */
- g_ptr = ¤t_floor_ptr->grid_array[y][x];
+ g_ptr = &p_ptr->current_floor_ptr->grid_array[y][x];
/* Want a unlit square in view of the player */
if ((g_ptr->info & (CAVE_MNLT | CAVE_VIEW)) != CAVE_VIEW) return;
/* We trust this grid is in bounds */
/* if (!in_bounds2(y, x)) return; */
- g_ptr = ¤t_floor_ptr->grid_array[y][x];
+ g_ptr = &p_ptr->current_floor_ptr->grid_array[y][x];
/* Want a unlit and undarkened square in view of the player */
if ((g_ptr->info & (CAVE_LITE | CAVE_MNLT | CAVE_MNDK | CAVE_VIEW)) != CAVE_VIEW) return;
#include "feature.h"
#include "spells.h"
+#include "world.h"
#include "view-mainwindow.h"
int dun_tun_rnd;
* @param y 基準のy座標
* @param x 基準のx座標
* @return 隣接する外壁の数
- * @note Assumes "in_bounds(current_floor_ptr, y, x)"
+ * @note Assumes "in_bounds(p_ptr->current_floor_ptr, y, x)"
* @details We count only granite walls and permanent walls.
*/
static int next_to_walls(POSITION y, POSITION x)
{
int k = 0;
- if (in_bounds(current_floor_ptr, y + 1, x) && is_extra_bold(y + 1, x)) k++;
- if (in_bounds(current_floor_ptr, y - 1, x) && is_extra_bold(y - 1, x)) k++;
- if (in_bounds(current_floor_ptr, y, x + 1) && is_extra_bold(y, x + 1)) k++;
- if (in_bounds(current_floor_ptr, y, x - 1) && is_extra_bold(y, x - 1)) k++;
+ if (in_bounds(p_ptr->current_floor_ptr, y + 1, x) && is_extra_bold(y + 1, x)) k++;
+ if (in_bounds(p_ptr->current_floor_ptr, y - 1, x) && is_extra_bold(y - 1, x)) k++;
+ if (in_bounds(p_ptr->current_floor_ptr, y, x + 1) && is_extra_bold(y, x + 1)) k++;
+ if (in_bounds(p_ptr->current_floor_ptr, y, x - 1) && is_extra_bold(y, x - 1)) k++;
return (k);
}
*/
static bool alloc_stairs_aux(POSITION y, POSITION x, int walls)
{
- grid_type *g_ptr = ¤t_floor_ptr->grid_array[y][x];
+ grid_type *g_ptr = &p_ptr->current_floor_ptr->grid_array[y][x];
/* Require "naked" floor grid */
if (!is_floor_grid(g_ptr)) return FALSE;
if (have_flag(f_ptr->flags, FF_LESS))
{
/* No up stairs in town or in ironman mode */
- if (ironman_downward || !current_floor_ptr->dun_level) return TRUE;
+ if (ironman_downward || !p_ptr->current_floor_ptr->dun_level) return TRUE;
- if (current_floor_ptr->dun_level > d_info[p_ptr->dungeon_idx].mindepth)
+ if (p_ptr->current_floor_ptr->dun_level > d_info[p_ptr->dungeon_idx].mindepth)
shaft_num = (randint1(num+1))/2;
}
else if (have_flag(f_ptr->flags, FF_MORE))
{
- QUEST_IDX q_idx = quest_number(current_floor_ptr->dun_level);
+ QUEST_IDX q_idx = quest_number(p_ptr->current_floor_ptr->dun_level);
/* No downstairs on quest levels */
- if (current_floor_ptr->dun_level > 1 && q_idx)
+ if (p_ptr->current_floor_ptr->dun_level > 1 && q_idx)
{
monster_race *r_ptr = &r_info[quest[q_idx].r_idx];
}
/* No downstairs at the bottom */
- if (current_floor_ptr->dun_level >= d_info[p_ptr->dungeon_idx].maxdepth) return TRUE;
+ if (p_ptr->current_floor_ptr->dun_level >= d_info[p_ptr->dungeon_idx].maxdepth) return TRUE;
- if ((current_floor_ptr->dun_level < d_info[p_ptr->dungeon_idx].maxdepth-1) && !quest_number(current_floor_ptr->dun_level+1))
+ if ((p_ptr->current_floor_ptr->dun_level < d_info[p_ptr->dungeon_idx].maxdepth-1) && !quest_number(p_ptr->current_floor_ptr->dun_level+1))
shaft_num = (randint1(num)+1)/2;
}
else return FALSE;
int candidates = 0;
int pick;
- for (y = 1; y < current_floor_ptr->height - 1; y++)
+ for (y = 1; y < p_ptr->current_floor_ptr->height - 1; y++)
{
- for (x = 1; x < current_floor_ptr->width - 1; x++)
+ for (x = 1; x < p_ptr->current_floor_ptr->width - 1; x++)
{
if (alloc_stairs_aux(y, x, walls))
{
/* Choose a random one */
pick = randint1(candidates);
- for (y = 1; y < current_floor_ptr->height - 1; y++)
+ for (y = 1; y < p_ptr->current_floor_ptr->height - 1; y++)
{
- for (x = 1; x < current_floor_ptr->width - 1; x++)
+ for (x = 1; x < p_ptr->current_floor_ptr->width - 1; x++)
{
if (alloc_stairs_aux(y, x, walls))
{
if (!pick) break;
}
- g_ptr = ¤t_floor_ptr->grid_array[y][x];
+ g_ptr = &p_ptr->current_floor_ptr->grid_array[y][x];
/* Clear possible garbage of hidden trap */
g_ptr->mimic = 0;
if (quest[i].status != QUEST_STATUS_TAKEN ||
(quest[i].type != QUEST_TYPE_KILL_LEVEL &&
quest[i].type != QUEST_TYPE_RANDOM) ||
- quest[i].level != current_floor_ptr->dun_level ||
+ quest[i].level != p_ptr->current_floor_ptr->dun_level ||
p_ptr->dungeon_idx != quest[i].dungeon ||
(quest[i].flags & QUEST_FLAG_PRESET))
{
grid_type *g_ptr;
feature_type *f_ptr;
- 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);
- g_ptr = ¤t_floor_ptr->grid_array[y][x];
+ g_ptr = &p_ptr->current_floor_ptr->grid_array[y][x];
f_ptr = &f_info[g_ptr->feat];
if (!have_flag(f_ptr->flags, FF_MOVE) && !have_flag(f_ptr->flags, FF_CAN_FLY)) continue;
}
/*!
- * @brief フロアに存在する全マスの記憶状態を初期化する / Wipe all unnecessary flags after current_floor_ptr->grid_array generation
+ * @brief フロアに存在する全マスの記憶状態を初期化する / Wipe all unnecessary flags after p_ptr->current_floor_ptr->grid_array generation
* @return なし
*/
void wipe_generate_random_floor_flags(floor_type *floor_ptr)
}
/*!
- * @brief フロアの全情報を初期化する / Clear and empty the current_floor_ptr->grid_array
+ * @brief フロアの全情報を初期化する / Clear and empty the p_ptr->current_floor_ptr->grid_array
* @return なし
*/
void clear_cave(floor_type *floor_ptr)
/* Prevent object over-flow */
- if (floor_ptr->o_max >= floor_ptr->max_o_idx)
+ if (floor_ptr->o_max >= current_world_ptr->max_o_idx)
{
why = _("アイテムが多すぎる", "too many objects");
okay = FALSE;
}
/* Prevent monster over-flow */
- else if (floor_ptr->m_max >= floor_ptr->max_m_idx)
+ else if (floor_ptr->m_max >= current_world_ptr->max_m_idx)
{
why = _("モンスターが多すぎる", "too many monsters");
okay = FALSE;
/* Extremely Important -- do not leave the dungeon */
- while (!in_bounds(current_floor_ptr, tmp_row, tmp_col))
+ while (!in_bounds(p_ptr->current_floor_ptr, tmp_row, tmp_col))
{
/* Acquire the correct direction */
correct_dir(&row_dir, &col_dir, row1, col1, row2, col2);
tmp_col = col1 + col_dir;
}
- g_ptr = ¤t_floor_ptr->grid_array[tmp_row][tmp_col];
+ g_ptr = &p_ptr->current_floor_ptr->grid_array[tmp_row][tmp_col];
/* Avoid "solid" walls */
if (is_solid_grid(g_ptr)) continue;
{
int i, j, dx, dy;
- grid_type *g_ptr = ¤t_floor_ptr->grid_array[*y][*x];
+ grid_type *g_ptr = &p_ptr->current_floor_ptr->grid_array[*y][*x];
- if (!in_bounds(current_floor_ptr, *y, *x)) return TRUE;
+ if (!in_bounds(p_ptr->current_floor_ptr, *y, *x)) return TRUE;
if (is_inner_grid(g_ptr))
{
}
/* Clear mimic type */
- current_floor_ptr->grid_array[*y][*x].mimic = 0;
+ p_ptr->current_floor_ptr->grid_array[*y][*x].mimic = 0;
place_floor_bold(*y, *x);
dy = randint0(3) - 1;
dx = randint0(3) - 1;
- if (!in_bounds(current_floor_ptr, *y + dy, *x + dx))
+ if (!in_bounds(p_ptr->current_floor_ptr, *y + dy, *x + dx))
{
dx = 0;
dy = 0;
y3 = y1 + dy + changey;
/* See if in bounds - if not - do not perturb point */
- if (!in_bounds(current_floor_ptr, y3, x3))
+ if (!in_bounds(p_ptr->current_floor_ptr, y3, x3))
{
x3 = (x1 + x2) / 2;
y3 = (y1 + y2) / 2;
}
/* cache g_ptr */
- g_ptr = ¤t_floor_ptr->grid_array[y3][x3];
+ g_ptr = &p_ptr->current_floor_ptr->grid_array[y3][x3];
if (is_solid_grid(g_ptr))
{
/* move midpoint a bit to avoid problem. */
{
dy = randint0(3) - 1;
dx = randint0(3) - 1;
- if (!in_bounds(current_floor_ptr, y3 + dy, x3 + dx))
+ if (!in_bounds(p_ptr->current_floor_ptr, y3 + dy, x3 + dx))
{
dx = 0;
dy = 0;
}
y3 += dy;
x3 += dx;
- g_ptr = ¤t_floor_ptr->grid_array[y3][x3];
+ g_ptr = &p_ptr->current_floor_ptr->grid_array[y3][x3];
}
if (is_floor_grid(g_ptr))
{
if (build_tunnel2(x1, y1, x3, y3, type, cutoff))
{
- if ((current_floor_ptr->grid_array[y3][x3].info & CAVE_ROOM) || (randint1(100) > 95))
+ if ((p_ptr->current_floor_ptr->grid_array[y3][x3].info & CAVE_ROOM) || (randint1(100) > 95))
{
/* do second half only if works + if have hit a room */
retval = build_tunnel2(x3, y3, x2, y2, type, cutoff);
sf_ptr->visit_mark = latest_visit_mark++;
/* sf_ptr->dun_level may be changed later */
- sf_ptr->dun_level = current_floor_ptr->dun_level;
+ sf_ptr->dun_level = p_ptr->current_floor_ptr->dun_level;
/* Increment number of floor_id */
if (p_ptr->riding)
{
- monster_type *m_ptr = ¤t_floor_ptr->m_list[p_ptr->riding];
+ monster_type *m_ptr = &p_ptr->current_floor_ptr->m_list[p_ptr->riding];
/* Pet of other pet don't follow. */
if (m_ptr->parent_m_idx)
*/
if (!p_ptr->wild_mode && !p_ptr->inside_arena && !p_ptr->phase_out)
{
- for (i = current_floor_ptr->m_max - 1, num = 1; (i >= 1 && num < MAX_PARTY_MON); i--)
+ for (i = p_ptr->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];
+ monster_type *m_ptr = &p_ptr->current_floor_ptr->m_list[i];
if (!monster_is_valid(m_ptr)) continue;
if (!is_pet(m_ptr)) continue;
}
}
- (void)COPY(&party_mon[num], ¤t_floor_ptr->m_list[i], monster_type);
+ (void)COPY(&party_mon[num], &p_ptr->current_floor_ptr->m_list[i], monster_type);
num++;
if (record_named_pet)
{
- 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];
GAME_TEXT m_name[MAX_NLEN];
if (!monster_is_valid(m_ptr)) continue;
/* Pet of other pet may disappear. */
- 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];
/* Are there its parent? */
- if (m_ptr->parent_m_idx && !current_floor_ptr->m_list[m_ptr->parent_m_idx].r_idx)
+ if (m_ptr->parent_m_idx && !p_ptr->current_floor_ptr->m_list[m_ptr->parent_m_idx].r_idx)
{
/* Its parent have gone, it also goes away. */
if (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];
monster_race *r_ptr;
- current_floor_ptr->grid_array[cy][cx].m_idx = m_idx;
+ p_ptr->current_floor_ptr->grid_array[cy][cx].m_idx = m_idx;
m_ptr->r_idx = party_mon[i].r_idx;
/* r_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++;
}
else
int i;
/* Maintain unique monsters */
- for (i = 1; i < current_floor_ptr->m_max; i++)
+ for (i = 1; i < p_ptr->current_floor_ptr->m_max; i++)
{
monster_race *r_ptr;
- 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;
}
/* Maintain artifatcs */
- for (i = 1; i < current_floor_ptr->o_max; i++)
+ for (i = 1; i < p_ptr->current_floor_ptr->o_max; i++)
{
- object_type *o_ptr = ¤t_floor_ptr->o_list[i];
+ object_type *o_ptr = &p_ptr->current_floor_ptr->o_list[i];
if (!OBJECT_IS_VALID(o_ptr)) continue;
POSITION dis = 1;
POSITION oy = p_ptr->y;
POSITION ox = p_ptr->x;
- MONSTER_IDX m_idx = current_floor_ptr->grid_array[oy][ox].m_idx;
+ MONSTER_IDX m_idx = p_ptr->current_floor_ptr->grid_array[oy][ox].m_idx;
/* Nothing to do if no monster */
if (!m_idx) return;
if (tries > 20 * dis * dis) dis++;
/* Ignore illegal locations */
- if (!in_bounds(current_floor_ptr, ny, nx)) continue;
+ if (!in_bounds(p_ptr->current_floor_ptr, ny, nx)) continue;
/* Require "empty" floor space */
if (!cave_empty_bold(ny, nx)) continue;
/* Hack -- no teleport onto glyph of warding */
- if (is_glyph_grid(¤t_floor_ptr->grid_array[ny][nx])) continue;
- if (is_explosive_rune_grid(¤t_floor_ptr->grid_array[ny][nx])) continue;
+ if (is_glyph_grid(&p_ptr->current_floor_ptr->grid_array[ny][nx])) continue;
+ if (is_explosive_rune_grid(&p_ptr->current_floor_ptr->grid_array[ny][nx])) continue;
/* ...nor onto the Pattern */
if (pattern_tile(ny, nx)) continue;
/*** It's a good place ***/
- m_ptr = ¤t_floor_ptr->m_list[m_idx];
+ m_ptr = &p_ptr->current_floor_ptr->m_list[m_idx];
/* Update the old location */
- current_floor_ptr->grid_array[oy][ox].m_idx = 0;
+ p_ptr->current_floor_ptr->grid_array[oy][ox].m_idx = 0;
/* Update the new location */
- current_floor_ptr->grid_array[ny][nx].m_idx = m_idx;
+ p_ptr->current_floor_ptr->grid_array[ny][nx].m_idx = m_idx;
/* Move the monster */
m_ptr->fy = ny;
int i;
/* Search usable stairs */
- for (y = 0; y < current_floor_ptr->height; y++)
+ for (y = 0; y < p_ptr->current_floor_ptr->height; y++)
{
- for (x = 0; x < current_floor_ptr->width; x++)
+ for (x = 0; x < p_ptr->current_floor_ptr->width; x++)
{
- grid_type *g_ptr = ¤t_floor_ptr->grid_array[y][x];
+ grid_type *g_ptr = &p_ptr->current_floor_ptr->grid_array[y][x];
feature_type *f_ptr = &f_info[g_ptr->feat];
bool ok = FALSE;
prepare_change_floor_mode(CFM_RAND_PLACE | CFM_NO_RETURN);
/* Mega Hack -- It's not the stairs you enter. Disable it. */
- if (!feat_uses_special(current_floor_ptr->grid_array[p_ptr->y][p_ptr->x].feat)) current_floor_ptr->grid_array[p_ptr->y][p_ptr->x].special = 0;
+ if (!feat_uses_special(p_ptr->current_floor_ptr->grid_array[p_ptr->y][p_ptr->x].feat)) p_ptr->current_floor_ptr->grid_array[p_ptr->y][p_ptr->x].special = 0;
}
else
{
if ((quest[i].status == QUEST_STATUS_TAKEN) &&
((quest[i].type == QUEST_TYPE_KILL_LEVEL) ||
(quest[i].type == QUEST_TYPE_RANDOM)) &&
- (quest[i].level == current_floor_ptr->dun_level) &&
+ (quest[i].level == p_ptr->current_floor_ptr->dun_level) &&
(creature_ptr->dungeon_idx == quest[i].dungeon) &&
!(quest[i].flags & QUEST_FLAG_PRESET))
{
}
/* Maintain quest monsters */
- for (i = 1; i < current_floor_ptr->m_max; i++)
+ for (i = 1; i < p_ptr->current_floor_ptr->m_max; i++)
{
monster_race *r_ptr;
- 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;
if (floor_mode & CFM_SAVE_FLOORS)
{
/* Extract stair position */
- g_ptr = ¤t_floor_ptr->grid_array[creature_ptr->y][creature_ptr->x];
+ g_ptr = &p_ptr->current_floor_ptr->grid_array[creature_ptr->y][creature_ptr->x];
f_ptr = &f_info[g_ptr->feat];
/* Get back to old saved floor? */
/* Get out from or Enter the dungeon */
if (floor_mode & CFM_DOWN)
{
- if (!current_floor_ptr->dun_level)
+ if (!p_ptr->current_floor_ptr->dun_level)
move_num = d_info[creature_ptr->dungeon_idx].mindepth;
}
else if (floor_mode & CFM_UP)
{
- if (current_floor_ptr->dun_level + move_num < d_info[creature_ptr->dungeon_idx].mindepth)
- move_num = -current_floor_ptr->dun_level;
+ if (p_ptr->current_floor_ptr->dun_level + move_num < d_info[creature_ptr->dungeon_idx].mindepth)
+ move_num = -p_ptr->current_floor_ptr->dun_level;
}
- current_floor_ptr->dun_level += move_num;
+ p_ptr->current_floor_ptr->dun_level += move_num;
}
/* Leaving the dungeon to town */
- if (!current_floor_ptr->dun_level && creature_ptr->dungeon_idx)
+ if (!p_ptr->current_floor_ptr->dun_level && creature_ptr->dungeon_idx)
{
creature_ptr->leaving_dungeon = TRUE;
if (!vanilla_town && !lite_town)
/* Record the last visit current_world_ptr->game_turn of current floor */
sf_ptr->last_visit = current_world_ptr->game_turn;
- forget_lite(current_floor_ptr);
+ forget_lite(p_ptr->current_floor_ptr);
forget_view();
- clear_mon_lite(current_floor_ptr);
+ clear_mon_lite(p_ptr->current_floor_ptr);
/* Save current floor */
if (!save_floor(sf_ptr, 0))
* @return なし
* @details
* If the floor is an old saved floor, it will be\n
- * restored from the temporal file. If the floor is new one, new current_floor_ptr->grid_array\n
+ * restored from the temporal file. If the floor is new one, new p_ptr->current_floor_ptr->grid_array\n
* will be generated.\n
*/
void change_floor(BIT_FLAGS floor_mode)
if (!(floor_mode & CFM_SAVE_FLOORS) &&
!(floor_mode & CFM_FIRST_FLOOR))
{
- /* Create current_floor_ptr->grid_array */
- generate_random_floor(current_floor_ptr);
+ /* Create p_ptr->current_floor_ptr->grid_array */
+ generate_random_floor(p_ptr->current_floor_ptr);
/* Paranoia -- No new saved floor */
new_floor_id = 0;
/* Forbid return stairs */
if (floor_mode & CFM_NO_RETURN)
{
- grid_type *g_ptr = ¤t_floor_ptr->grid_array[p_ptr->y][p_ptr->x];
+ grid_type *g_ptr = &p_ptr->current_floor_ptr->grid_array[p_ptr->y][p_ptr->x];
if (!feat_uses_special(g_ptr->feat))
{
absence_ticks = (current_world_ptr->game_turn - tmp_last_visit) / TURNS_PER_TICK;
/* Maintain monsters */
- for (i = 1; i < current_floor_ptr->m_max; i++)
+ for (i = 1; i < p_ptr->current_floor_ptr->m_max; i++)
{
monster_race *r_ptr;
- 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;
}
/* Maintain artifatcs */
- for (i = 1; i < current_floor_ptr->o_max; i++)
+ for (i = 1; i < p_ptr->current_floor_ptr->o_max; i++)
{
- object_type *o_ptr = ¤t_floor_ptr->o_list[i];
+ object_type *o_ptr = &p_ptr->current_floor_ptr->o_list[i];
if (!OBJECT_IS_VALID(o_ptr)) continue;
msg_print(_("階段は行き止まりだった。", "The staircases come to a dead end..."));
/* Create simple dead end */
- build_dead_end(current_floor_ptr);
+ build_dead_end(p_ptr->current_floor_ptr);
/* Break connection */
if (floor_mode & CFM_UP)
}
else
{
- /* Newly create current_floor_ptr->grid_array */
- generate_random_floor(current_floor_ptr);
+ /* Newly create p_ptr->current_floor_ptr->grid_array */
+ generate_random_floor(p_ptr->current_floor_ptr);
}
/* Record last visit current_world_ptr->game_turn */
sf_ptr->last_visit = current_world_ptr->game_turn;
- /* Set correct current_floor_ptr->dun_level value */
- sf_ptr->dun_level = current_floor_ptr->dun_level;
+ /* Set correct p_ptr->current_floor_ptr->dun_level value */
+ sf_ptr->dun_level = p_ptr->current_floor_ptr->dun_level;
/* Create connected stairs */
if (!(floor_mode & CFM_NO_RETURN))
{
/* Extract stair position */
- grid_type *g_ptr = ¤t_floor_ptr->grid_array[p_ptr->y][p_ptr->x];
+ grid_type *g_ptr = &p_ptr->current_floor_ptr->grid_array[p_ptr->y][p_ptr->x];
/*** Create connected stairs ***/
/* No stairs down from Quest */
- if ((floor_mode & CFM_UP) && !quest_number(current_floor_ptr->dun_level))
+ if ((floor_mode & CFM_UP) && !quest_number(p_ptr->current_floor_ptr->dun_level))
{
g_ptr->feat = (floor_mode & CFM_SHAFT) ? feat_state(feat_down_stair, FF_SHAFT) : feat_down_stair;
}
wiz_lite(p_ptr, (bool)(p_ptr->pclass == CLASS_NINJA));
/* Remember when this level was "created" */
- current_floor_ptr->generated_turn = current_world_ptr->game_turn;
+ p_ptr->current_floor_ptr->generated_turn = current_world_ptr->game_turn;
/* No dungeon feeling yet */
- p_ptr->feeling_turn = current_floor_ptr->generated_turn;
+ p_ptr->feeling_turn = p_ptr->current_floor_ptr->generated_turn;
p_ptr->feeling = 0;
/* Clear all flags */
changey = 0;
}
- if (!in_bounds(current_floor_ptr, y1 + dy + changey, x1 + dx + changex))
+ if (!in_bounds(p_ptr->current_floor_ptr, y1 + dy + changey, x1 + dx + changex))
{
changex = 0;
changey = 0;
{
if (!in_bounds2(ty, tx)) continue;
- g_ptr = ¤t_floor_ptr->grid_array[ty][tx];
+ g_ptr = &p_ptr->current_floor_ptr->grid_array[ty][tx];
if (g_ptr->feat == feat1) continue;
if (g_ptr->feat == feat2) continue;
/* Hack -- Choose starting point */
- y2 = randint1(current_floor_ptr->height / 2 - 2) + current_floor_ptr->height / 2;
- x2 = randint1(current_floor_ptr->width / 2 - 2) + current_floor_ptr->width / 2;
+ y2 = randint1(p_ptr->current_floor_ptr->height / 2 - 2) + p_ptr->current_floor_ptr->height / 2;
+ x2 = randint1(p_ptr->current_floor_ptr->width / 2 - 2) + p_ptr->current_floor_ptr->width / 2;
/* Hack -- Choose ending point somewhere on boundary */
switch(randint1(4))
case 1:
{
/* top boundary */
- x1 = randint1(current_floor_ptr->width-2)+1;
+ x1 = randint1(p_ptr->current_floor_ptr->width-2)+1;
y1 = 1;
break;
}
{
/* left boundary */
x1 = 1;
- y1 = randint1(current_floor_ptr->height-2)+1;
+ y1 = randint1(p_ptr->current_floor_ptr->height-2)+1;
break;
}
case 3:
{
/* right boundary */
- x1 = current_floor_ptr->width-1;
- y1 = randint1(current_floor_ptr->height-2)+1;
+ x1 = p_ptr->current_floor_ptr->width-1;
+ y1 = randint1(p_ptr->current_floor_ptr->height-2)+1;
break;
}
case 4:
{
/* bottom boundary */
- x1 = randint1(current_floor_ptr->width-2)+1;
- y1 = current_floor_ptr->height-1;
+ x1 = randint1(p_ptr->current_floor_ptr->width-2)+1;
+ y1 = p_ptr->current_floor_ptr->height-1;
break;
}
}
bool streamer_may_have_gold = have_flag(streamer_ptr->flags, FF_MAY_HAVE_GOLD);
/* Hack -- Choose starting point */
- y = rand_spread(current_floor_ptr->height / 2, current_floor_ptr->height / 6);
- x = rand_spread(current_floor_ptr->width / 2, current_floor_ptr->width / 6);
+ y = rand_spread(p_ptr->current_floor_ptr->height / 2, p_ptr->current_floor_ptr->height / 6);
+ x = rand_spread(p_ptr->current_floor_ptr->width / 2, p_ptr->current_floor_ptr->width / 6);
/* Choose a random compass direction */
dir = randint0(8);
if (!in_bounds2(ty, tx)) continue;
break;
}
- g_ptr = ¤t_floor_ptr->grid_array[ty][tx];
+ g_ptr = &p_ptr->current_floor_ptr->grid_array[ty][tx];
f_ptr = &f_info[g_ptr->feat];
if (have_flag(f_ptr->flags, FF_MOVE) && (have_flag(f_ptr->flags, FF_WATER) || have_flag(f_ptr->flags, FF_LAVA)))
if (is_closed_door(g_ptr->feat)) continue;
}
- if (g_ptr->m_idx && !(have_flag(streamer_ptr->flags, FF_PLACE) && monster_can_cross_terrain(feat, &r_info[current_floor_ptr->m_list[g_ptr->m_idx].r_idx], 0)))
+ if (g_ptr->m_idx && !(have_flag(streamer_ptr->flags, FF_PLACE) && monster_can_cross_terrain(feat, &r_info[p_ptr->current_floor_ptr->m_list[g_ptr->m_idx].r_idx], 0)))
{
/* Delete the monster (if any) */
delete_monster(ty, tx);
/* Scan all objects in the grid */
for (this_o_idx = g_ptr->o_idx; this_o_idx; this_o_idx = next_o_idx)
{
- object_type *o_ptr = ¤t_floor_ptr->o_list[this_o_idx];
+ object_type *o_ptr = &p_ptr->current_floor_ptr->o_list[this_o_idx];
next_o_idx = o_ptr->next_o_idx;
/* Hack -- Preserve unknown artifacts */
}
/* Quit before leaving the dungeon */
- if (!in_bounds(current_floor_ptr, y, x)) break;
+ if (!in_bounds(p_ptr->current_floor_ptr, y, x)) break;
}
}
{
for (j = y - 3; j < y + 4; j++)
{
- if (!in_bounds(current_floor_ptr, j, i)) continue;
- g_ptr = ¤t_floor_ptr->grid_array[j][i];
+ if (!in_bounds(p_ptr->current_floor_ptr, j, i)) continue;
+ g_ptr = &p_ptr->current_floor_ptr->grid_array[j][i];
if (g_ptr->info & CAVE_ICKY) continue;
if (g_ptr->o_idx) continue;
if ((distance(j, i, y, x) > 1) || (randint1(100) < 25))
{
if (randint1(100) < 75)
- current_floor_ptr->grid_array[j][i].feat = feat_tree;
+ p_ptr->current_floor_ptr->grid_array[j][i].feat = feat_tree;
}
else
{
- current_floor_ptr->grid_array[j][i].feat = feat_rubble;
+ p_ptr->current_floor_ptr->grid_array[j][i].feat = feat_rubble;
}
/* Clear garbage of hidden trap or door */
g_ptr->mimic = 0;
/* Light area since is open above */
- if (!(d_info[p_ptr->dungeon_idx].flags1 & DF1_DARKNESS)) current_floor_ptr->grid_array[j][i].info |= (CAVE_GLOW | CAVE_ROOM);
+ if (!(d_info[p_ptr->dungeon_idx].flags1 & DF1_DARKNESS)) p_ptr->current_floor_ptr->grid_array[j][i].info |= (CAVE_GLOW | CAVE_ROOM);
}
}
}
if (!ironman_downward && one_in_(3))
{
/* up stair */
- current_floor_ptr->grid_array[y][x].feat = feat_up_stair;
+ p_ptr->current_floor_ptr->grid_array[y][x].feat = feat_up_stair;
}
}
for (n = 0; n < randint1(5); n++)
{
/* Pick an epi-center */
- x1 = rand_range(5, current_floor_ptr->width - 1 - 5);
- y1 = rand_range(5, current_floor_ptr->height - 1 - 5);
+ x1 = rand_range(5, p_ptr->current_floor_ptr->width - 1 - 5);
+ y1 = rand_range(5, p_ptr->current_floor_ptr->height - 1 - 5);
(void)destroy_area(y1, x1, 15, TRUE);
}
* Not completely hardcoded, that would overflow memory
*/
floor_type floor_info;
-floor_type *current_floor_ptr = &floor_info;
/*
* The array of saved floors
#define MON_LITE_MAX 1536
/*!
- * @brief 視界処理配列サイズ / Maximum size of the "view" array (see "current_floor_ptr->grid_array.c")
+ * @brief 視界処理配列サイズ / Maximum size of the "view" array (see "p_ptr->current_floor_ptr->grid_array.c")
* @details Note that the "view radius" will NEVER exceed 20, and even if the "view"
* was octagonal, we would never require more than 1520 entries in the array.
*/
#define VIEW_MAX 1536
/*!
- * @brief 再描画処理用配列サイズ / Maximum size of the "redraw" array (see "current_floor_ptr->grid_array.c")
+ * @brief 再描画処理用配列サイズ / Maximum size of the "redraw" array (see "p_ptr->current_floor_ptr->grid_array.c")
* @details We must be large for proper functioning of delayed redrawing.
* We must also be as large as two times of the largest view area.
* Note that maximum view grids are 1149 entries.
grid_type *grid_array[MAX_HGT];
DEPTH dun_level; /*!< 現在の実ダンジョン階層base_levelの参照元となる / Current dungeon level */
DEPTH base_level; /*!< 基本生成レベル、後述のobject_level, monster_levelの参照元となる / Base dungeon level */
- DEPTH object_level; /*!< アイテムの生成レベル、current_floor_ptr->base_levelを起点に一時変更する時に参照 / Current object creation level */
- DEPTH monster_level; /*!< モンスターの生成レベル、current_floor_ptr->base_levelを起点に一時変更する時に参照 / Current monster creation level */
+ DEPTH object_level; /*!< アイテムの生成レベル、p_ptr->current_floor_ptr->base_levelを起点に一時変更する時に参照 / Current object creation level */
+ DEPTH monster_level; /*!< モンスターの生成レベル、p_ptr->current_floor_ptr->base_levelを起点に一時変更する時に参照 / Current monster creation level */
POSITION width; /* Current dungeon width */
POSITION height; /* Current dungeon height */
MONSTER_NUMBER num_repro; /*!< Current reproducer count */
GAME_TURN generated_turn; /* Turn when level began */
- object_type *o_list; /*!< The array of dungeon items [current_floor_ptr->max_o_idx] */
- OBJECT_IDX max_o_idx; /*!< Maximum number of objects in the level */
+ object_type *o_list; /*!< The array of dungeon items [current_world_ptr->max_o_idx] */
OBJECT_IDX o_max; /* Number of allocated objects */
OBJECT_IDX o_cnt; /* Number of live objects */
- 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_type *m_list; /*!< The array of dungeon monsters [current_world_ptr->max_m_idx] */
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 */
- POSITION_IDX lite_n; //!< Array of grids lit by player lite (see "current_floor_ptr->grid_array.c")
+ POSITION_IDX lite_n; //!< Array of grids lit by player lite (see "p_ptr->current_floor_ptr->grid_array.c")
POSITION lite_y[LITE_MAX];
POSITION lite_x[LITE_MAX];
- POSITION_IDX mon_lite_n; //!< Array of grids lit by player lite (see "current_floor_ptr->grid_array.c")
+ POSITION_IDX mon_lite_n; //!< Array of grids lit by player lite (see "p_ptr->current_floor_ptr->grid_array.c")
POSITION mon_lite_y[MON_LITE_MAX];
POSITION mon_lite_x[MON_LITE_MAX];
POSITION view_y[VIEW_MAX];
POSITION view_x[VIEW_MAX];
- POSITION_IDX redraw_n; //!< Array of grids for delayed visual updating (see "current_floor_ptr->grid_array.c")
+ POSITION_IDX redraw_n; //!< Array of grids for delayed visual updating (see "p_ptr->current_floor_ptr->grid_array.c")
POSITION redraw_y[REDRAW_MAX];
POSITION redraw_x[REDRAW_MAX];
} floor_type;
+extern floor_type floor_info;
+
#define DUNGEON_MODE_NONE 0
#define DUNGEON_MODE_AND 1
#define DUNGEON_MODE_NAND 2
* Determines if a map location is on or inside the outer walls
*/
#define in_bounds2(Y,X) \
- (((Y) >= 0) && ((X) >= 0) && ((Y) < current_floor_ptr->height) && ((X) < current_floor_ptr->width))
+ (((Y) >= 0) && ((X) >= 0) && ((Y) < p_ptr->current_floor_ptr->height) && ((X) < p_ptr->current_floor_ptr->width))
/*
* Determines if a map location is on or inside the outer walls
* (unsigned version)
*/
#define in_bounds2u(Y,X) \
- (((Y) < current_floor_ptr->height) && ((X) < current_floor_ptr->width))
+ (((Y) < p_ptr->current_floor_ptr->height) && ((X) < p_ptr->current_floor_ptr->width))
/*
* Grid based version of "player_bold()"
*/
#define player_grid(C) \
- ((C) == ¤t_floor_ptr->grid_array[p_ptr->y][p_ptr->x])
+ ((C) == &p_ptr->current_floor_ptr->grid_array[p_ptr->y][p_ptr->x])
#define cave_have_flag_bold(Y,X,INDEX) \
- (have_flag(f_info[current_floor_ptr->grid_array[(Y)][(X)].feat].flags, (INDEX)))
+ (have_flag(f_info[p_ptr->current_floor_ptr->grid_array[(Y)][(X)].feat].flags, (INDEX)))
#define cave_have_flag_grid(C,INDEX) \
* Determine if a "legal" grid supports "los"
*/
#define cave_los_bold(Y,X) \
- (feat_supports_los(current_floor_ptr->grid_array[(Y)][(X)].feat))
+ (feat_supports_los(p_ptr->current_floor_ptr->grid_array[(Y)][(X)].feat))
#define cave_los_grid(C) \
(feat_supports_los((C)->feat))
*/
#define cave_clean_bold(Y,X) \
(cave_have_flag_bold((Y), (X), FF_FLOOR) && \
- !(current_floor_ptr->grid_array[Y][X].info & CAVE_OBJECT) && \
- (current_floor_ptr->grid_array[Y][X].o_idx == 0))
+ !(p_ptr->current_floor_ptr->grid_array[Y][X].info & CAVE_OBJECT) && \
+ (p_ptr->current_floor_ptr->grid_array[Y][X].o_idx == 0))
/*
*/
#define cave_drop_bold(Y,X) \
(cave_have_flag_bold((Y), (X), FF_DROP) && \
- !(current_floor_ptr->grid_array[Y][X].info & CAVE_OBJECT))
+ !(p_ptr->current_floor_ptr->grid_array[Y][X].info & CAVE_OBJECT))
/*
*/
#define cave_empty_bold(Y,X) \
(cave_have_flag_bold((Y), (X), FF_PLACE) && \
- !(current_floor_ptr->grid_array[Y][X].m_idx) && \
+ !(p_ptr->current_floor_ptr->grid_array[Y][X].m_idx) && \
!player_bold(Y,X))
*/
#define cave_naked_bold(Y,X) \
(cave_clean_bold(Y,X) && \
- !(current_floor_ptr->grid_array[Y][X].m_idx) && \
+ !(p_ptr->current_floor_ptr->grid_array[Y][X].m_idx) && \
!player_bold(Y,X))
* Note the use of comparison to zero to force a "boolean" result
*/
#define player_has_los_bold(Y,X) \
- (((current_floor_ptr->grid_array[Y][X].info & (CAVE_VIEW)) != 0) || p_ptr->phase_out)
+ (((p_ptr->current_floor_ptr->grid_array[Y][X].info & (CAVE_VIEW)) != 0) || p_ptr->phase_out)
/*
(have_flag((F)->flags, FF_WALL) && \
have_flag((F)->flags, FF_PERMANENT))
-extern floor_type *current_floor_ptr;
extern saved_floor_type saved_floors[MAX_SAVED_FLOORS];
/*
/*!
* @brief ベースアイテム生成階層が加算される確率
* @details
-* There is a 1/10 (10%) chance of inflating the requested current_floor_ptr->object_level
+* There is a 1/10 (10%) chance of inflating the requested p_ptr->current_floor_ptr->object_level
* during the creation of an object (see "get_obj_num()" in "object.c").
* Lower values yield better objects more often.
*/
/*!
* @brief 深層モンスターが生成される(NASTY生成)の基本確率(1/x)
* @details
-* There is a 1/25 (4%) chance of inflating the requested current_floor_ptr->monster_level
+* There is a 1/25 (4%) chance of inflating the requested p_ptr->current_floor_ptr->monster_level
* during the creation of a monsters (see "get_mon_num()" in "monster.c").
* Lower values yield harder monsters more often.
*/
* @details
* A monster can only "multiply" (reproduce) if there are fewer than 100
* monsters on the level capable of such spontaneous reproduction. This
-* is a hack which prevents the "current_floor_ptr->m_list[]" array from exploding due to
+* is a hack which prevents the "p_ptr->current_floor_ptr->m_list[]" array from exploding due to
* reproducing monsters. Messy, but necessary.
*/
#define MAX_REPRO 100
if (flg & (PROJECT_STOP))
{
if ((n > 0) &&
- (player_bold(y, x) || current_floor_ptr->grid_array[y][x].m_idx != 0))
+ (player_bold(y, x) || p_ptr->current_floor_ptr->grid_array[y][x].m_idx != 0))
break;
}
- if (!in_bounds(current_floor_ptr, y, x)) break;
+ if (!in_bounds(p_ptr->current_floor_ptr, y, x)) break;
/* Slant */
if (m)
if (flg & (PROJECT_STOP))
{
if ((n > 0) &&
- (player_bold(y, x) || current_floor_ptr->grid_array[y][x].m_idx != 0))
+ (player_bold(y, x) || p_ptr->current_floor_ptr->grid_array[y][x].m_idx != 0))
break;
}
- if (!in_bounds(current_floor_ptr, y, x)) break;
+ if (!in_bounds(p_ptr->current_floor_ptr, y, x)) break;
/* Slant */
if (m)
if (flg & (PROJECT_STOP))
{
if ((n > 0) &&
- (player_bold(y, x) || current_floor_ptr->grid_array[y][x].m_idx != 0))
+ (player_bold(y, x) || p_ptr->current_floor_ptr->grid_array[y][x].m_idx != 0))
break;
}
- if (!in_bounds(current_floor_ptr, y, x)) break;
+ if (!in_bounds(p_ptr->current_floor_ptr, y, x)) break;
/* Advance (Y) */
y += sy;
/* Paranoia -- require "safe" origin */
- /* if (!in_bounds(current_floor_ptr, y1, x1)) return FALSE; */
- /* if (!in_bounds(current_floor_ptr, y2, x2)) return FALSE; */
+ /* if (!in_bounds(p_ptr->current_floor_ptr, y1, x1)) return FALSE; */
+ /* if (!in_bounds(p_ptr->current_floor_ptr, y2, x2)) return FALSE; */
/* Directly South/North */
nx = rand_spread(x, d);
/* Ignore annoying locations */
- if (!in_bounds(current_floor_ptr, ny, nx)) continue;
+ if (!in_bounds(p_ptr->current_floor_ptr, ny, nx)) continue;
/* Ignore "excessively distant" locations */
if ((d > 1) && (distance(y, x, ny, nx) > d)) continue;
/* Blind players see nothing */
if (p_ptr->blind) return FALSE;
- g_ptr = ¤t_floor_ptr->grid_array[y][x];
+ g_ptr = &p_ptr->current_floor_ptr->grid_array[y][x];
/* Note that "torch-lite" yields "illumination" */
if (g_ptr->info & (CAVE_LITE | CAVE_MNLT)) return TRUE;
extern bool no_lite(void);
/*!
- * @brief 視界及び光源の過渡処理配列サイズ / Maximum size of the "temp" array (see "current_floor_ptr->grid_array.c")
+ * @brief 視界及び光源の過渡処理配列サイズ / Maximum size of the "temp" array (see "p_ptr->current_floor_ptr->grid_array.c")
* @details We must be as large as "VIEW_MAX" and "LITE_MAX" for proper functioning
* of "update_view()" and "update_lite()". We must also be as large as the
* largest illuminatable room, but no room is larger than 800 grids. We
while (max_attempts--)
{
/* Pick a legal spot */
- y = (POSITION)rand_range(1, current_floor_ptr->height - 2);
- x = (POSITION)rand_range(1, current_floor_ptr->width - 2);
+ y = (POSITION)rand_range(1, p_ptr->current_floor_ptr->height - 2);
+ x = (POSITION)rand_range(1, p_ptr->current_floor_ptr->width - 2);
- g_ptr = ¤t_floor_ptr->grid_array[y][x];
+ g_ptr = &p_ptr->current_floor_ptr->grid_array[y][x];
/* Must be a "naked" floor grid */
if (g_ptr->m_idx) continue;
- if (current_floor_ptr->dun_level)
+ if (p_ptr->current_floor_ptr->dun_level)
{
f_ptr = &f_info[g_ptr->feat];
if (!have_flag(f_ptr->flags, FF_TELEPORTABLE)) continue;
}
if (!player_can_enter(g_ptr->feat, 0)) continue;
- if (!in_bounds(current_floor_ptr, y, x)) continue;
+ if (!in_bounds(p_ptr->current_floor_ptr, y, x)) continue;
/* Refuse to start on anti-teleport grids */
if (g_ptr->info & (CAVE_ICKY)) continue;
bool up_stairs = TRUE;
bool down_stairs = TRUE;
grid_type *g_ptr;
- g_ptr = ¤t_floor_ptr->grid_array[y][x];
+ g_ptr = &p_ptr->current_floor_ptr->grid_array[y][x];
if (!is_floor_grid(g_ptr) || g_ptr->o_idx) return;
- if (!current_floor_ptr->dun_level) up_stairs = FALSE;
+ if (!p_ptr->current_floor_ptr->dun_level) up_stairs = FALSE;
if (ironman_downward) up_stairs = FALSE;
- if (current_floor_ptr->dun_level >= d_info[p_ptr->dungeon_idx].maxdepth) down_stairs = FALSE;
- if (quest_number(current_floor_ptr->dun_level) && (current_floor_ptr->dun_level > 1)) down_stairs = FALSE;
+ if (p_ptr->current_floor_ptr->dun_level >= d_info[p_ptr->dungeon_idx].maxdepth) down_stairs = FALSE;
+ if (quest_number(p_ptr->current_floor_ptr->dun_level) && (p_ptr->current_floor_ptr->dun_level > 1)) down_stairs = FALSE;
/* We can't place both */
if (down_stairs && up_stairs)
}
/* Place the stairs */
- if (up_stairs) set_cave_feat(current_floor_ptr, y, x, feat_up_stair);
- else if (down_stairs) set_cave_feat(current_floor_ptr, y, x, feat_down_stair);
+ if (up_stairs) set_cave_feat(p_ptr->current_floor_ptr, y, x, feat_up_stair);
+ else if (down_stairs) set_cave_feat(p_ptr->current_floor_ptr, y, x, feat_down_stair);
}
/*!
{
int tmp, type;
FEAT_IDX feat = feat_none;
- grid_type *g_ptr = ¤t_floor_ptr->grid_array[y][x];
+ grid_type *g_ptr = &p_ptr->current_floor_ptr->grid_array[y][x];
/* Initialize mimic info */
g_ptr->mimic = 0;
{
if (feat != feat_none)
{
- set_cave_feat(current_floor_ptr, y, x, feat);
+ set_cave_feat(p_ptr->current_floor_ptr, y, x, feat);
}
else
{
cave_set_feat(y, x, feat);
/* Now it is not floor */
- current_floor_ptr->grid_array[y][x].info &= ~(CAVE_MASK);
+ p_ptr->current_floor_ptr->grid_array[y][x].info &= ~(CAVE_MASK);
}
else
{
}
else
{
- set_cave_feat(current_floor_ptr, y, x, feat_locked_door_random((d_info[p_ptr->dungeon_idx].flags1 & DF1_GLASS_DOOR) ? DOOR_GLASS_DOOR : DOOR_DOOR));
- current_floor_ptr->grid_array[y][x].info &= ~(CAVE_FLOOR);
+ set_cave_feat(p_ptr->current_floor_ptr, y, x, feat_locked_door_random((d_info[p_ptr->dungeon_idx].flags1 & DF1_GLASS_DOOR) ? DOOR_GLASS_DOOR : DOOR_DOOR));
+ p_ptr->current_floor_ptr->grid_array[y][x].info &= ~(CAVE_FLOOR);
delete_monster(y, x);
}
}
}
else
{
- grid_type *g_ptr = ¤t_floor_ptr->grid_array[y][x];
+ grid_type *g_ptr = &p_ptr->current_floor_ptr->grid_array[y][x];
if (type == DOOR_DEFAULT)
{
* @param y1 基準となるマスのY座標
* @param x1 基準となるマスのX座標
* @return 通路の数
-* @note Assumes "in_bounds(current_floor_ptr, y1, x1)"
+* @note Assumes "in_bounds(p_ptr->current_floor_ptr, y1, x1)"
* @details
* XXX XXX This routine currently only counts actual "empty floor"\n
* grids which are not in rooms. We might want to also count stairs,\n
{
y = y1 + ddy_ddd[i];
x = x1 + ddx_ddd[i];
- g_ptr = ¤t_floor_ptr->grid_array[y][x];
+ g_ptr = &p_ptr->current_floor_ptr->grid_array[y][x];
/* Skip non floors */
if (cave_have_flag_grid(g_ptr, FF_WALL)) continue;
* @param y 判定を行いたいマスのY座標
* @param x 判定を行いたいマスのX座標
* @return ドアを設置可能ならばTRUEを返す
-* @note Assumes "in_bounds(current_floor_ptr, y1, x1)"
+* @note Assumes "in_bounds(p_ptr->current_floor_ptr, y1, x1)"
* @details
* \n
-* Assumes "in_bounds(current_floor_ptr, y, x)"\n
+* Assumes "in_bounds(p_ptr->current_floor_ptr, y, x)"\n
*/
static bool possible_doorway(POSITION y, POSITION x)
{
* @return なし
*/
void try_door(POSITION y, POSITION x)
-{ if (!in_bounds(current_floor_ptr, y, x)) return;
+{ if (!in_bounds(p_ptr->current_floor_ptr, y, x)) return;
/* Ignore walls */
if (cave_have_flag_bold(y, x, FF_WALL)) return;
/* Ignore room grids */
- if (current_floor_ptr->grid_array[y][x].info & (CAVE_ROOM)) return;
+ if (p_ptr->current_floor_ptr->grid_array[y][x].info & (CAVE_ROOM)) return;
/* Occasional door (if allowed) */
if ((randint0(100) < dun_tun_jct) && possible_doorway(y, x) && !(d_info[p_ptr->dungeon_idx].flags1 & DF1_NO_DOORS))
j = rand_spread(y, 2);
k = rand_spread(x, 3);
dummy++;
- if (!in_bounds(current_floor_ptr, j, k)) continue;
+ if (!in_bounds(p_ptr->current_floor_ptr, j, k)) continue;
break;
}
}
/* Require "clean" floor space */
- g_ptr = ¤t_floor_ptr->grid_array[j][k];
+ g_ptr = &p_ptr->current_floor_ptr->grid_array[j][k];
if (!is_floor_grid(g_ptr) || g_ptr->o_idx) continue;
if (randint0(100) < 75)
y1 = rand_spread(y, yd);
x1 = rand_spread(x, xd);
dummy++;
- if (!in_bounds(current_floor_ptr, y1, x1)) continue;
+ if (!in_bounds(p_ptr->current_floor_ptr, y1, x1)) continue;
break;
}
}
/* Require "naked" floor grids */
- g_ptr = ¤t_floor_ptr->grid_array[y1][x1];
+ g_ptr = &p_ptr->current_floor_ptr->grid_array[y1][x1];
if (!is_floor_grid(g_ptr) || g_ptr->o_idx || g_ptr->m_idx) continue;
/* Place the trap */
scatter(&y, &x, y1, x1, d, 0);
/* Require "empty" floor grids */
- g_ptr = ¤t_floor_ptr->grid_array[y][x];
+ g_ptr = &p_ptr->current_floor_ptr->grid_array[y][x];
if (!cave_empty_grid(g_ptr)) continue;
/* Place the monster (allow groups) */
- current_floor_ptr->monster_level = current_floor_ptr->base_level + 2;
+ p_ptr->current_floor_ptr->monster_level = p_ptr->current_floor_ptr->base_level + 2;
(void)place_monster(y, x, (PM_ALLOW_SLEEP | PM_ALLOW_GROUP));
- current_floor_ptr->monster_level = current_floor_ptr->base_level;
+ p_ptr->current_floor_ptr->monster_level = p_ptr->current_floor_ptr->base_level;
}
}
}
*/
bool get_is_floor(POSITION x, POSITION y)
{
- if (!in_bounds(current_floor_ptr, y, x))
+ if (!in_bounds(p_ptr->current_floor_ptr, y, x))
{
/* Out of bounds */
return (FALSE);
*/
void set_floor(POSITION x, POSITION y)
{
- if (!in_bounds(current_floor_ptr, y, x))
+ if (!in_bounds(p_ptr->current_floor_ptr, y, x))
{
/* Out of bounds */
return;
}
- if (current_floor_ptr->grid_array[y][x].info & CAVE_ROOM)
+ if (p_ptr->current_floor_ptr->grid_array[y][x].info & CAVE_ROOM)
{
/* A room border don't touch. */
return;
#ifdef COMPLEX_WALL_ILLUMINATION /* COMPLEX_WALL_ILLUMINATION */
/* Check for "complex" illumination */
- if ((feat_supports_los(get_feat_mimic(¤t_floor_ptr->grid_array[yy][xx])) &&
- (current_floor_ptr->grid_array[yy][xx].info & CAVE_GLOW)) ||
- (feat_supports_los(get_feat_mimic(¤t_floor_ptr->grid_array[y][xx])) &&
- (current_floor_ptr->grid_array[y][xx].info & CAVE_GLOW)) ||
- (feat_supports_los(get_feat_mimic(¤t_floor_ptr->grid_array[yy][x])) &&
- (current_floor_ptr->grid_array[yy][x].info & CAVE_GLOW)))
+ if ((feat_supports_los(get_feat_mimic(&p_ptr->current_floor_ptr->grid_array[yy][xx])) &&
+ (p_ptr->current_floor_ptr->grid_array[yy][xx].info & CAVE_GLOW)) ||
+ (feat_supports_los(get_feat_mimic(&p_ptr->current_floor_ptr->grid_array[y][xx])) &&
+ (p_ptr->current_floor_ptr->grid_array[y][xx].info & CAVE_GLOW)) ||
+ (feat_supports_los(get_feat_mimic(&p_ptr->current_floor_ptr->grid_array[yy][x])) &&
+ (p_ptr->current_floor_ptr->grid_array[yy][x].info & CAVE_GLOW)))
{
return TRUE;
}
#else /* COMPLEX_WALL_ILLUMINATION */
/* Check for "simple" illumination */
- return (current_floor_ptr->grid_array[yy][xx].info & CAVE_GLOW) ? TRUE : FALSE;
+ return (p_ptr->current_floor_ptr->grid_array[yy][xx].info & CAVE_GLOW) ? TRUE : FALSE;
#endif /* COMPLEX_WALL_ILLUMINATION */
}
if (player_has_los_bold((Y), (X))) \
{ \
/* Update the monster */ \
- if (current_floor_ptr->grid_array[(Y)][(X)].m_idx) update_monster(current_floor_ptr->grid_array[(Y)][(X)].m_idx, FALSE); \
+ if (p_ptr->current_floor_ptr->grid_array[(Y)][(X)].m_idx) update_monster(p_ptr->current_floor_ptr->grid_array[(Y)][(X)].m_idx, FALSE); \
\
/* Notice and redraw */ \
note_spot((Y), (X)); \
int i;
POSITION yy, xx;
- if (!in_bounds(current_floor_ptr, y, x)) return;
+ if (!in_bounds(p_ptr->current_floor_ptr, y, x)) return;
#ifdef COMPLEX_WALL_ILLUMINATION /* COMPLEX_WALL_ILLUMINATION */
*/
bool cave_valid_bold(POSITION y, POSITION x)
{
- grid_type *g_ptr = ¤t_floor_ptr->grid_array[y][x];
+ grid_type *g_ptr = &p_ptr->current_floor_ptr->grid_array[y][x];
OBJECT_IDX this_o_idx, next_o_idx = 0;
/* Forbid perma-grids */
for (this_o_idx = g_ptr->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;
/* Forbid artifact grids */
*/
void note_spot(POSITION y, POSITION x)
{
- grid_type *g_ptr = ¤t_floor_ptr->grid_array[y][x];
+ grid_type *g_ptr = &p_ptr->current_floor_ptr->grid_array[y][x];
OBJECT_IDX this_o_idx, next_o_idx = 0;
/* Blind players see nothing */
/* Hack -- memorize objects */
for (this_o_idx = g_ptr->o_idx; this_o_idx; this_o_idx = next_o_idx)
{
- object_type *o_ptr = ¤t_floor_ptr->o_list[this_o_idx];
+ object_type *o_ptr = &p_ptr->current_floor_ptr->o_list[this_o_idx];
next_o_idx = o_ptr->next_o_idx;
/* Memorize objects */
grid_type *g_ptr;
/* Update needed grids */
- for (i = 0; i < current_floor_ptr->redraw_n; i++)
+ for (i = 0; i < p_ptr->current_floor_ptr->redraw_n; i++)
{
- y = current_floor_ptr->redraw_y[i];
- x = current_floor_ptr->redraw_x[i];
- g_ptr = ¤t_floor_ptr->grid_array[y][x];
+ y = p_ptr->current_floor_ptr->redraw_y[i];
+ x = p_ptr->current_floor_ptr->redraw_x[i];
+ g_ptr = &p_ptr->current_floor_ptr->grid_array[y][x];
/* Update only needed grids (prevent multiple updating) */
if (!(g_ptr->info & CAVE_REDRAW)) continue;
}
/* None left */
- current_floor_ptr->redraw_n = 0;
+ p_ptr->current_floor_ptr->redraw_n = 0;
}
POSITION x, y;
/* Check the entire dungeon */
- for (y = 0; y < current_floor_ptr->height; y++)
+ for (y = 0; y < p_ptr->current_floor_ptr->height; y++)
{
- for (x = 0; x < current_floor_ptr->width; x++)
+ for (x = 0; x < p_ptr->current_floor_ptr->width; x++)
{
/* Forget the old data */
- current_floor_ptr->grid_array[y][x].dist = 0;
- current_floor_ptr->grid_array[y][x].cost = 0;
- current_floor_ptr->grid_array[y][x].when = 0;
+ p_ptr->current_floor_ptr->grid_array[y][x].dist = 0;
+ p_ptr->current_floor_ptr->grid_array[y][x].cost = 0;
+ p_ptr->current_floor_ptr->grid_array[y][x].when = 0;
}
}
}
if (tmp_pos.n) return;
/* The last way-point is on the map */
- if (p_ptr->running && in_bounds(current_floor_ptr, flow_y, flow_x))
+ if (p_ptr->running && in_bounds(p_ptr->current_floor_ptr, flow_y, flow_x))
{
/* The way point is in sight - do not update. (Speedup) */
- if (current_floor_ptr->grid_array[flow_y][flow_x].info & CAVE_VIEW) return;
+ if (p_ptr->current_floor_ptr->grid_array[flow_y][flow_x].info & CAVE_VIEW) return;
}
/* Erase all of the current flow information */
- for (y = 0; y < current_floor_ptr->height; y++)
+ for (y = 0; y < p_ptr->current_floor_ptr->height; y++)
{
- for (x = 0; x < current_floor_ptr->width; x++)
+ for (x = 0; x < p_ptr->current_floor_ptr->width; x++)
{
- current_floor_ptr->grid_array[y][x].cost = 0;
- current_floor_ptr->grid_array[y][x].dist = 0;
+ p_ptr->current_floor_ptr->grid_array[y][x].cost = 0;
+ p_ptr->current_floor_ptr->grid_array[y][x].dist = 0;
}
}
for (d = 0; d < 8; d++)
{
int old_head = flow_head;
- byte_hack m = current_floor_ptr->grid_array[ty][tx].cost + 1;
- byte_hack n = current_floor_ptr->grid_array[ty][tx].dist + 1;
+ byte_hack m = p_ptr->current_floor_ptr->grid_array[ty][tx].cost + 1;
+ byte_hack n = p_ptr->current_floor_ptr->grid_array[ty][tx].dist + 1;
grid_type *g_ptr;
/* Child location */
/* Ignore player's grid */
if (player_bold(y, x)) continue;
- g_ptr = ¤t_floor_ptr->grid_array[y][x];
+ g_ptr = &p_ptr->current_floor_ptr->grid_array[y][x];
if (is_closed_door(g_ptr->feat)) m += 3;
if (++scent_when == 254)
{
/* Scan the entire dungeon */
- for (y = 0; y < current_floor_ptr->height; y++)
+ for (y = 0; y < p_ptr->current_floor_ptr->height; y++)
{
- for (x = 0; x < current_floor_ptr->width; x++)
+ for (x = 0; x < p_ptr->current_floor_ptr->width; x++)
{
- int w = current_floor_ptr->grid_array[y][x].when;
- current_floor_ptr->grid_array[y][x].when = (w > 128) ? (w - 128) : 0;
+ int w = p_ptr->current_floor_ptr->grid_array[y][x].when;
+ p_ptr->current_floor_ptr->grid_array[y][x].when = (w > 128) ? (w - 128) : 0;
}
}
x = j + p_ptr->x - 2;
/* Check Bounds */
- if (!in_bounds(current_floor_ptr, y, x)) continue;
+ if (!in_bounds(p_ptr->current_floor_ptr, y, x)) continue;
- g_ptr = ¤t_floor_ptr->grid_array[y][x];
+ g_ptr = &p_ptr->current_floor_ptr->grid_array[y][x];
/* Walls, water, and lava cannot hold scent. */
if (!cave_have_flag_grid(g_ptr, FF_MOVE) && !is_closed_door(g_ptr->feat)) continue;
*/
void cave_set_feat(POSITION y, POSITION x, FEAT_IDX feat)
{
- grid_type *g_ptr = ¤t_floor_ptr->grid_array[y][x];
+ grid_type *g_ptr = &p_ptr->current_floor_ptr->grid_array[y][x];
feature_type *f_ptr = &f_info[feat];
bool old_los, old_mirror;
yy = y + ddy_ddd[i];
xx = x + ddx_ddd[i];
if (!in_bounds2(yy, xx)) continue;
- current_floor_ptr->grid_array[yy][xx].info |= CAVE_GLOW;
+ p_ptr->current_floor_ptr->grid_array[yy][xx].info |= CAVE_GLOW;
}
}
yy = y + ddy_ddd[i];
xx = x + ddx_ddd[i];
if (!in_bounds2(yy, xx)) continue;
- cc_ptr = ¤t_floor_ptr->grid_array[yy][xx];
+ cc_ptr = &p_ptr->current_floor_ptr->grid_array[yy][xx];
cc_ptr->info |= CAVE_GLOW;
if (player_has_los_grid(cc_ptr))
if (p_ptr->special_defense & NINJA_S_STEALTH)
{
- if (current_floor_ptr->grid_array[p_ptr->y][p_ptr->x].info & CAVE_GLOW) set_superstealth(p_ptr, FALSE);
+ if (p_ptr->current_floor_ptr->grid_array[p_ptr->y][p_ptr->x].info & CAVE_GLOW) set_superstealth(p_ptr, FALSE);
}
}
}
void cave_alter_feat(POSITION y, POSITION x, int action)
{
/* Set old feature */
- FEAT_IDX oldfeat = current_floor_ptr->grid_array[y][x].feat;
+ FEAT_IDX oldfeat = p_ptr->current_floor_ptr->grid_array[y][x].feat;
/* Get the new feat */
FEAT_IDX newfeat = feat_state(oldfeat, action);
}
/* Handle item */
- if (have_flag(old_f_ptr->flags, FF_HAS_ITEM) && !have_flag(f_ptr->flags, FF_HAS_ITEM) && (randint0(100) < (15 - current_floor_ptr->dun_level / 2)))
+ if (have_flag(old_f_ptr->flags, FF_HAS_ITEM) && !have_flag(f_ptr->flags, FF_HAS_ITEM) && (randint0(100) < (15 - p_ptr->current_floor_ptr->dun_level / 2)))
{
/* Place object */
place_object(y, x, 0L);
if (have_flag(old_f_ptr->flags, FF_GLASS) && current_world_ptr->character_dungeon)
{
- project(PROJECT_WHO_GLASS_SHARDS, 1, y, x, MIN(current_floor_ptr->dun_level, 100) / 4, GF_SHARDS,
+ project(PROJECT_WHO_GLASS_SHARDS, 1, y, x, MIN(p_ptr->current_floor_ptr->dun_level, 100) / 4, GF_SHARDS,
(PROJECT_GRID | PROJECT_ITEM | PROJECT_KILL | PROJECT_HIDE | PROJECT_JUMP | PROJECT_NO_HANGEKI), -1);
}
}
/* Remove a mirror */
void remove_mirror(POSITION y, POSITION x)
{
- grid_type *g_ptr = ¤t_floor_ptr->grid_array[y][x];
+ grid_type *g_ptr = &p_ptr->current_floor_ptr->grid_array[y][x];
/* Remove the mirror */
g_ptr->info &= ~(CAVE_OBJECT);
*/
bool cave_monster_teleportable_bold(MONSTER_IDX m_idx, POSITION y, POSITION x, BIT_FLAGS mode)
{
- monster_type *m_ptr = ¤t_floor_ptr->m_list[m_idx];
- grid_type *g_ptr = ¤t_floor_ptr->grid_array[y][x];
+ monster_type *m_ptr = &p_ptr->current_floor_ptr->m_list[m_idx];
+ grid_type *g_ptr = &p_ptr->current_floor_ptr->grid_array[y][x];
feature_type *f_ptr = &f_info[g_ptr->feat];
/* Require "teleportable" space */
*/
bool cave_player_teleportable_bold(POSITION y, POSITION x, 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];
feature_type *f_ptr = &f_info[g_ptr->feat];
/* Require "teleportable" space */
{
feature_type *f_ptr = &f_info[feature];
- if (p_ptr->riding) return monster_can_cross_terrain(feature, &r_info[current_floor_ptr->m_list[p_ptr->riding].r_idx], mode | CEM_RIDING);
+ if (p_ptr->riding) return monster_can_cross_terrain(feature, &r_info[p_ptr->current_floor_ptr->m_list[p_ptr->riding].r_idx], mode | CEM_RIDING);
if (have_flag(f_ptr->flags, FF_PATTERN))
{
/*
* A single "grid" in a Cave
*
- * Note that several aspects of the code restrict the actual current_floor_ptr->grid_array
+ * Note that several aspects of the code restrict the actual p_ptr->current_floor_ptr->grid_array
* to a max size of 256 by 256. In partcular, locations are often
* saved as bytes, limiting each coordinate to the 0-255 range.
*
* amound of memory, but they all seem rather complicated, and would
* probably add enough code that the savings would be lost. So for
* these reasons, we simply store an index into the "o_list" and
- * "current_floor_ptr->m_list" arrays, using "zero" when no monster/object is present.
+ * "p_ptr->current_floor_ptr->m_list" arrays, using "zero" when no monster/object is present.
*
* Note that "o_idx" is the index of the top object in a stack of
* objects, using the "next_o_idx" field of objects (see below) to
struct grid_type
{
- BIT_FLAGS info; /* Hack -- current_floor_ptr->grid_array flags */
+ BIT_FLAGS info; /* Hack -- p_ptr->current_floor_ptr->grid_array flags */
FEAT_IDX feat; /* Hack -- feature type */
OBJECT_IDX o_idx; /* Object in this grid */
MONSTER_IDX m_idx; /* Monster in this grid */
- /*! 地形の特別な情報を保存する / Special current_floor_ptr->grid_array info
+ /*! 地形の特別な情報を保存する / Special p_ptr->current_floor_ptr->grid_array info
* 具体的な使用一覧はクエスト行き階段の移行先クエストID、
* 各ダンジョン入口の移行先ダンジョンID、
*
/* Macros */
#define set_cave_feat(FL,Y,X,F) ((FL)->grid_array[(Y)][(X)].feat = (F))
-#define add_cave_info(Y,X,I) (current_floor_ptr->grid_array[(Y)][(X)].info |= (I))
+#define add_cave_info(Y,X,I) (p_ptr->current_floor_ptr->grid_array[(Y)][(X)].info |= (I))
/* This should not be used */
-/*#define set_cave_info(Y,X,I) (current_floor_ptr->grid_array[(Y)][(X)].info = (I)) */
+/*#define set_cave_info(Y,X,I) (p_ptr->current_floor_ptr->grid_array[(Y)][(X)].info = (I)) */
/*!
* @brief 指定座標に瓦礫を配置する
* @param Y 指定Y座標
* @param X 指定X座標
*/
-#define place_rubble(Y,X) set_cave_feat(current_floor_ptr,Y,X,feat_rubble)
+#define place_rubble(Y,X) set_cave_feat(p_ptr->current_floor_ptr,Y,X,feat_rubble)
/*!
* @brief 指定座標がFLOOR属性を持ったマスかどうかを返す
* @param X 指定X座標
* @return FLOOR属性を持っているならばTRUE
*/
-#define is_floor_bold(Y,X) (current_floor_ptr->grid_array[Y][X].info & CAVE_FLOOR)
-#define is_extra_bold(Y,X) (current_floor_ptr->grid_array[Y][X].info & CAVE_EXTRA)
+#define is_floor_bold(Y,X) (p_ptr->current_floor_ptr->grid_array[Y][X].info & CAVE_FLOOR)
+#define is_extra_bold(Y,X) (p_ptr->current_floor_ptr->grid_array[Y][X].info & CAVE_EXTRA)
-#define is_inner_bold(Y,X) (current_floor_ptr->grid_array[Y][X].info & CAVE_INNER)
-#define is_outer_bold(Y,X) (current_floor_ptr->grid_array[Y][X].info & CAVE_OUTER)
-#define is_solid_bold(Y,X) (current_floor_ptr->grid_array[Y][X].info & CAVE_SOLID)
+#define is_inner_bold(Y,X) (p_ptr->current_floor_ptr->grid_array[Y][X].info & CAVE_INNER)
+#define is_outer_bold(Y,X) (p_ptr->current_floor_ptr->grid_array[Y][X].info & CAVE_OUTER)
+#define is_solid_bold(Y,X) (p_ptr->current_floor_ptr->grid_array[Y][X].info & CAVE_SOLID)
#define is_floor_grid(C) ((C)->info & CAVE_FLOOR)
#define is_extra_grid(C) ((C)->info & CAVE_EXTRA)
#define place_floor_bold(Y, X) \
{ \
- set_cave_feat(current_floor_ptr, Y,X,feat_ground_type[randint0(100)]); \
- current_floor_ptr->grid_array[Y][X].info &= ~(CAVE_MASK); \
+ set_cave_feat(p_ptr->current_floor_ptr, Y,X,feat_ground_type[randint0(100)]); \
+ p_ptr->current_floor_ptr->grid_array[Y][X].info &= ~(CAVE_MASK); \
add_cave_info(Y,X,CAVE_FLOOR); \
delete_monster(Y, X); \
}
#define place_extra_bold(Y, X) \
{ \
- set_cave_feat(current_floor_ptr, Y,X,feat_wall_type[randint0(100)]); \
- current_floor_ptr->grid_array[Y][X].info &= ~(CAVE_MASK); \
+ set_cave_feat(p_ptr->current_floor_ptr, Y,X,feat_wall_type[randint0(100)]); \
+ p_ptr->current_floor_ptr->grid_array[Y][X].info &= ~(CAVE_MASK); \
add_cave_info(Y,X,CAVE_EXTRA); \
delete_monster(Y, X); \
}
#define place_extra_perm_bold(Y, X) \
{ \
set_cave_feat(floor_ptr, Y,X,feat_permanent); \
- current_floor_ptr->grid_array[Y][X].info &= ~(CAVE_MASK); \
+ p_ptr->current_floor_ptr->grid_array[Y][X].info &= ~(CAVE_MASK); \
add_cave_info(Y,X,CAVE_EXTRA); \
delete_monster(Y, X); \
}
{ \
feature_type *_f_ptr; \
set_cave_feat(floor_ptr, Y,X,feat_wall_type[randint0(100)]); \
- _f_ptr = &f_info[current_floor_ptr->grid_array[Y][X].feat]; \
- if (permanent_wall(_f_ptr)) current_floor_ptr->grid_array[Y][X].feat = feat_state(current_floor_ptr->grid_array[Y][X].feat, FF_UNPERM); \
- current_floor_ptr->grid_array[Y][X].info &= ~(CAVE_MASK); \
+ _f_ptr = &f_info[p_ptr->current_floor_ptr->grid_array[Y][X].feat]; \
+ if (permanent_wall(_f_ptr)) p_ptr->current_floor_ptr->grid_array[Y][X].feat = feat_state(p_ptr->current_floor_ptr->grid_array[Y][X].feat, FF_UNPERM); \
+ p_ptr->current_floor_ptr->grid_array[Y][X].info &= ~(CAVE_MASK); \
add_cave_info(Y,X,CAVE_EXTRA); \
delete_monster(Y, X); \
}
#define place_inner_bold(Y, X) \
{ \
- set_cave_feat(current_floor_ptr, Y,X,feat_wall_inner); \
- current_floor_ptr->grid_array[Y][X].info &= ~(CAVE_MASK); \
+ set_cave_feat(p_ptr->current_floor_ptr, Y,X,feat_wall_inner); \
+ p_ptr->current_floor_ptr->grid_array[Y][X].info &= ~(CAVE_MASK); \
add_cave_info(Y,X,CAVE_INNER); \
delete_monster(Y, X); \
}
#define place_inner_perm_bold(Y, X) \
{ \
- set_cave_feat(current_floor_ptr, Y,X,feat_permanent); \
- current_floor_ptr->grid_array[Y][X].info &= ~(CAVE_MASK); \
+ set_cave_feat(p_ptr->current_floor_ptr, Y,X,feat_permanent); \
+ p_ptr->current_floor_ptr->grid_array[Y][X].info &= ~(CAVE_MASK); \
add_cave_info(Y,X,CAVE_INNER); \
delete_monster(Y, X); \
}
#define place_outer_bold(Y, X) \
{ \
- set_cave_feat(current_floor_ptr, Y,X,feat_wall_outer); \
- current_floor_ptr->grid_array[Y][X].info &= ~(CAVE_MASK); \
+ set_cave_feat(p_ptr->current_floor_ptr, Y,X,feat_wall_outer); \
+ p_ptr->current_floor_ptr->grid_array[Y][X].info &= ~(CAVE_MASK); \
add_cave_info(Y,X,CAVE_OUTER); \
delete_monster(Y, X); \
}
#define place_outer_perm_bold(Y, X) \
{ \
set_cave_feat(floor_ptr, Y,X,feat_permanent); \
- current_floor_ptr->grid_array[Y][X].info &= ~(CAVE_MASK); \
+ p_ptr->current_floor_ptr->grid_array[Y][X].info &= ~(CAVE_MASK); \
add_cave_info(Y,X,CAVE_OUTER); \
delete_monster(Y, X); \
}
#define place_outer_noperm_bold(Y, X) \
{ \
feature_type *_f_ptr = &f_info[feat_wall_outer]; \
- if (permanent_wall(_f_ptr)) set_cave_feat(current_floor_ptr, Y, X, (s16b)feat_state(feat_wall_outer, FF_UNPERM)); \
- else set_cave_feat(current_floor_ptr, Y,X,feat_wall_outer); \
- current_floor_ptr->grid_array[Y][X].info &= ~(CAVE_MASK); \
+ if (permanent_wall(_f_ptr)) set_cave_feat(p_ptr->current_floor_ptr, Y, X, (s16b)feat_state(feat_wall_outer, FF_UNPERM)); \
+ else set_cave_feat(p_ptr->current_floor_ptr, Y,X,feat_wall_outer); \
+ p_ptr->current_floor_ptr->grid_array[Y][X].info &= ~(CAVE_MASK); \
add_cave_info(Y,X,(CAVE_OUTER | CAVE_VAULT)); \
delete_monster(Y, X); \
}
#define place_solid_bold(Y, X) \
{ \
- set_cave_feat(current_floor_ptr, Y,X,feat_wall_solid); \
- current_floor_ptr->grid_array[Y][X].info &= ~(CAVE_MASK); \
+ set_cave_feat(p_ptr->current_floor_ptr, Y,X,feat_wall_solid); \
+ p_ptr->current_floor_ptr->grid_array[Y][X].info &= ~(CAVE_MASK); \
add_cave_info(Y,X,CAVE_SOLID); \
delete_monster(Y, X); \
}
#define place_solid_perm_bold(Y, X) \
{ \
set_cave_feat(floor_ptr, Y,X,feat_permanent); \
- current_floor_ptr->grid_array[Y][X].info &= ~(CAVE_MASK); \
+ p_ptr->current_floor_ptr->grid_array[Y][X].info &= ~(CAVE_MASK); \
add_cave_info(Y,X,CAVE_SOLID); \
delete_monster(Y, X); \
}
#define place_solid_noperm_bold(Y, X) \
{ \
feature_type *_f_ptr = &f_info[feat_wall_solid]; \
- if ((current_floor_ptr->grid_array[Y][X].info & CAVE_VAULT) && permanent_wall(_f_ptr)) \
- set_cave_feat(current_floor_ptr, Y, X, feat_state(feat_wall_solid, FF_UNPERM)); \
- else set_cave_feat(current_floor_ptr, Y,X,feat_wall_solid); \
- current_floor_ptr->grid_array[Y][X].info &= ~(CAVE_MASK); \
+ if ((p_ptr->current_floor_ptr->grid_array[Y][X].info & CAVE_VAULT) && permanent_wall(_f_ptr)) \
+ set_cave_feat(p_ptr->current_floor_ptr, Y, X, feat_state(feat_wall_solid, FF_UNPERM)); \
+ else set_cave_feat(p_ptr->current_floor_ptr, Y,X,feat_wall_solid); \
+ p_ptr->current_floor_ptr->grid_array[Y][X].info &= ~(CAVE_MASK); \
add_cave_info(Y,X,CAVE_SOLID); \
delete_monster(Y, X); \
}
#define CAVE_MNLT 0x0100 /*!< モンスターの光源によって照らされている / Illuminated by monster */
#define CAVE_MNDK 0x8000 /*!< モンスターの暗源によって暗闇になっている / Darken by monster */
- /* Used only while current_floor_ptr->grid_array generation */
+ /* Used only while p_ptr->current_floor_ptr->grid_array generation */
#define CAVE_FLOOR 0x0200 /*!< フロア属性のあるマス */
#define CAVE_EXTRA 0x0400
#define CAVE_INNER 0x0800
#define CAVE_VAULT 0x4000
#define CAVE_MASK (CAVE_FLOOR | CAVE_EXTRA | CAVE_INNER | CAVE_OUTER | CAVE_SOLID | CAVE_VAULT)
-/* Used only after current_floor_ptr->grid_array generation */
+/* Used only after p_ptr->current_floor_ptr->grid_array generation */
#define CAVE_KNOWN 0x0200 /* Directly viewed or map detected flag */
#define CAVE_NOTE 0x0400 /* Flag for delayed visual update (needs note_spot()) */
#define CAVE_REDRAW 0x0800 /* Flag for delayed visual update (needs lite_spot()) */
*/
#define cave_lite_hack(Y,X) \
{\
- if (!(current_floor_ptr->grid_array[Y][X].info & (CAVE_LITE))) \
+ if (!(p_ptr->current_floor_ptr->grid_array[Y][X].info & (CAVE_LITE))) \
{ \
- current_floor_ptr->grid_array[Y][X].info |= (CAVE_LITE); \
- current_floor_ptr->lite_y[current_floor_ptr->lite_n] = (Y); \
- current_floor_ptr->lite_x[current_floor_ptr->lite_n++] = (X); \
+ p_ptr->current_floor_ptr->grid_array[Y][X].info |= (CAVE_LITE); \
+ p_ptr->current_floor_ptr->lite_y[p_ptr->current_floor_ptr->lite_n] = (Y); \
+ p_ptr->current_floor_ptr->lite_x[p_ptr->current_floor_ptr->lite_n++] = (X); \
} \
}
if (!((C)->info & CAVE_REDRAW)) \
{ \
(C)->info |= CAVE_REDRAW; \
- current_floor_ptr->redraw_y[current_floor_ptr->redraw_n] = (Y); \
- current_floor_ptr->redraw_x[current_floor_ptr->redraw_n++] = (X); \
+ p_ptr->current_floor_ptr->redraw_y[p_ptr->current_floor_ptr->redraw_n] = (Y); \
+ p_ptr->current_floor_ptr->redraw_x[p_ptr->current_floor_ptr->redraw_n++] = (X); \
} \
}
{\
if (!((C)->info & (CAVE_VIEW))){\
(C)->info |= (CAVE_VIEW); \
- current_floor_ptr->view_y[current_floor_ptr->view_n] = (Y); \
- current_floor_ptr->view_x[current_floor_ptr->view_n] = (X); \
- current_floor_ptr->view_n++;}\
+ p_ptr->current_floor_ptr->view_y[p_ptr->current_floor_ptr->view_n] = (Y); \
+ p_ptr->current_floor_ptr->view_x[p_ptr->current_floor_ptr->view_n] = (X); \
+ p_ptr->current_floor_ptr->view_n++;}\
}
#include "objectkind.h"
#include "object-ego.h"
#include "rooms-vault.h"
+#include "world.h"
#ifndef MACINTOSH
#ifdef CHECK_MODIFICATION_TIME
{
int i, n;
+ p_ptr->current_floor_ptr = &floor_info; // TODO:本当はこんなところで初期化したくない
+
/*** Prepare the "dungeon" information ***/
/* Allocate and Wipe the object list */
- C_MAKE(current_floor_ptr->o_list, current_floor_ptr->max_o_idx, object_type);
+ C_MAKE(p_ptr->current_floor_ptr->o_list, current_world_ptr->max_o_idx, object_type);
/* Allocate and Wipe the monster list */
- C_MAKE(current_floor_ptr->m_list, current_floor_ptr->max_m_idx, monster_type);
+ C_MAKE(p_ptr->current_floor_ptr->m_list, current_world_ptr->max_m_idx, monster_type);
/* Allocate and Wipe the monster process list */
for (i = 0; i < MAX_MTIMED; i++)
{
- C_MAKE(current_floor_ptr->mproc_list[i], current_floor_ptr->max_m_idx, s16b);
+ C_MAKE(p_ptr->current_floor_ptr->mproc_list[i], current_world_ptr->max_m_idx, s16b);
}
/* Allocate and Wipe the max dungeon level */
C_MAKE(max_dlv, max_d_idx, DEPTH);
- /* Allocate and wipe each line of the current_floor_ptr->grid_array */
+ /* Allocate and wipe each line of the p_ptr->current_floor_ptr->grid_array */
for (i = 0; i < MAX_HGT; i++)
{
- /* Allocate one row of the current_floor_ptr->grid_array */
- C_MAKE(current_floor_ptr->grid_array[i], MAX_WID, grid_type);
+ /* Allocate one row of the p_ptr->current_floor_ptr->grid_array */
+ C_MAKE(p_ptr->current_floor_ptr->grid_array[i], MAX_WID, grid_type);
}
rd_s16b(&tmp16s);
p_ptr->oldpy = (POSITION)tmp16s;
- if (z_older_than(10, 3, 13) && !current_floor_ptr->dun_level && !p_ptr->inside_arena) {p_ptr->oldpy = 33;p_ptr->oldpx = 131;}
+ if (z_older_than(10, 3, 13) && !p_ptr->current_floor_ptr->dun_level && !p_ptr->inside_arena) {p_ptr->oldpy = 33;p_ptr->oldpx = 131;}
/* Was p_ptr->rewards[MAX_BACT] */
rd_s16b(&tmp16s);
current_world_ptr->dungeon_turn_limit = TURNS_PER_TICK * TOWN_DAWN * (MAX_DAYS - 1) + TURNS_PER_TICK * TOWN_DAWN * 3 / 4;
/* Turn when level began */
- rd_s32b(¤t_floor_ptr->generated_turn);
+ rd_s32b(&p_ptr->current_floor_ptr->generated_turn);
if (h_older_than(1, 7, 0, 4))
{
- p_ptr->feeling_turn = current_floor_ptr->generated_turn;
+ p_ptr->feeling_turn = p_ptr->current_floor_ptr->generated_turn;
}
else
{
if (z_older_than(11, 0, 13))
{
- current_floor_ptr->generated_turn /= 2;
+ p_ptr->current_floor_ptr->generated_turn /= 2;
p_ptr->feeling_turn /= 2;
current_world_ptr->game_turn /= 2;
current_world_ptr->dungeon_turn /= 2;
/* Header info */
rd_s16b(&tmp16s);
- current_floor_ptr->dun_level = (DEPTH)tmp16s;
+ p_ptr->current_floor_ptr->dun_level = (DEPTH)tmp16s;
if (z_older_than(10, 3, 8)) p_ptr->dungeon_idx = DUNGEON_ANGBAND;
else
{
}
/* Set the base level for old versions */
- current_floor_ptr->base_level = current_floor_ptr->dun_level;
+ p_ptr->current_floor_ptr->base_level = p_ptr->current_floor_ptr->dun_level;
rd_s16b(&tmp16s);
- current_floor_ptr->base_level = (DEPTH)tmp16s;
+ p_ptr->current_floor_ptr->base_level = (DEPTH)tmp16s;
rd_s16b(&tmp16s);
- current_floor_ptr->num_repro = (MONSTER_NUMBER)tmp16s;
+ p_ptr->current_floor_ptr->num_repro = (MONSTER_NUMBER)tmp16s;
rd_s16b(&tmp16s);
p_ptr->y = (POSITION)tmp16s;
rd_s16b(&tmp16s);
p_ptr->x = (POSITION)tmp16s;
- if (z_older_than(10, 3, 13) && !current_floor_ptr->dun_level && !p_ptr->inside_arena) {p_ptr->y = 33;p_ptr->x = 131;}
+ if (z_older_than(10, 3, 13) && !p_ptr->current_floor_ptr->dun_level && !p_ptr->inside_arena) {p_ptr->y = 33;p_ptr->x = 131;}
rd_s16b(&tmp16s);
- current_floor_ptr->height = (POSITION)tmp16s;
+ p_ptr->current_floor_ptr->height = (POSITION)tmp16s;
rd_s16b(&tmp16s);
- current_floor_ptr->width = (POSITION)tmp16s;
+ p_ptr->current_floor_ptr->width = (POSITION)tmp16s;
rd_s16b(&tmp16s); /* max_panel_rows */
rd_s16b(&tmp16s); /* max_panel_cols */
#endif
/* Maximal size */
- ymax = current_floor_ptr->height;
- xmax = current_floor_ptr->width;
+ ymax = p_ptr->current_floor_ptr->height;
+ xmax = p_ptr->current_floor_ptr->width;
/*** Run length decoding ***/
/* Apply the RLE info */
for (i = count; i > 0; i--)
{
- /* Access the current_floor_ptr->grid_array */
- g_ptr = ¤t_floor_ptr->grid_array[y][x];
+ /* Access the p_ptr->current_floor_ptr->grid_array */
+ g_ptr = &p_ptr->current_floor_ptr->grid_array[y][x];
/* Extract "info" */
g_ptr->info = info;
/* Apply the RLE info */
for (i = count; i > 0; i--)
{
- /* Access the current_floor_ptr->grid_array */
- g_ptr = ¤t_floor_ptr->grid_array[y][x];
+ /* Access the p_ptr->current_floor_ptr->grid_array */
+ g_ptr = &p_ptr->current_floor_ptr->grid_array[y][x];
/* Extract "feat" */
g_ptr->feat = (s16b)tmp8u;
/* Apply the RLE info */
for (i = count; i > 0; i--)
{
- /* Access the current_floor_ptr->grid_array */
- g_ptr = ¤t_floor_ptr->grid_array[y][x];
+ /* Access the p_ptr->current_floor_ptr->grid_array */
+ g_ptr = &p_ptr->current_floor_ptr->grid_array[y][x];
/* Extract "mimic" */
g_ptr->mimic = (s16b)tmp8u;
/* Apply the RLE info */
for (i = count; i > 0; i--)
{
- /* Access the current_floor_ptr->grid_array */
- g_ptr = ¤t_floor_ptr->grid_array[y][x];
+ /* Access the p_ptr->current_floor_ptr->grid_array */
+ g_ptr = &p_ptr->current_floor_ptr->grid_array[y][x];
/* Extract "feat" */
g_ptr->special = tmp16s;
}
}
- /* Convert current_floor_ptr->grid_array data */
+ /* Convert p_ptr->current_floor_ptr->grid_array data */
if (z_older_than(11, 0, 99))
{
for (y = 0; y < ymax; y++) for (x = 0; x < xmax; x++)
{
/* Wipe old unused flags */
- current_floor_ptr->grid_array[y][x].info &= ~(CAVE_MASK);
+ p_ptr->current_floor_ptr->grid_array[y][x].info &= ~(CAVE_MASK);
}
}
{
for (y = 0; y < ymax; y++) for (x = 0; x < xmax; x++)
{
- /* Access the current_floor_ptr->grid_array */
- g_ptr = ¤t_floor_ptr->grid_array[y][x];
+ /* Access the p_ptr->current_floor_ptr->grid_array */
+ g_ptr = &p_ptr->current_floor_ptr->grid_array[y][x];
/* Very old */
if (g_ptr->feat == OLD_FEAT_INVIS)
{
for (y = 0; y < ymax; y++) for (x = 0; x < xmax; x++)
{
- /* Access the current_floor_ptr->grid_array */
- g_ptr = ¤t_floor_ptr->grid_array[y][x];
+ /* Access the p_ptr->current_floor_ptr->grid_array */
+ g_ptr = &p_ptr->current_floor_ptr->grid_array[y][x];
/* Old CAVE_IN_MIRROR flag */
if (g_ptr->info & CAVE_OBJECT)
{
for (y = 0; y < ymax; y++) for (x = 0; x < xmax; x++)
{
- /* Access the current_floor_ptr->grid_array */
- g_ptr = ¤t_floor_ptr->grid_array[y][x];
+ /* Access the p_ptr->current_floor_ptr->grid_array */
+ g_ptr = &p_ptr->current_floor_ptr->grid_array[y][x];
- if ((g_ptr->special == OLD_QUEST_WATER_CAVE) && !current_floor_ptr->dun_level)
+ if ((g_ptr->special == OLD_QUEST_WATER_CAVE) && !p_ptr->current_floor_ptr->dun_level)
{
if (g_ptr->feat == OLD_FEAT_QUEST_ENTER)
{
rd_u16b(&limit);
/* Verify maximum */
- if (limit > current_floor_ptr->max_o_idx)
+ if (limit > current_world_ptr->max_o_idx)
{
note(format(_("アイテムの配列が大きすぎる(%d)!", "Too many (%d) object entries!"), limit));
return (151);
/* Acquire place */
- o_ptr = ¤t_floor_ptr->o_list[o_idx];
+ o_ptr = &p_ptr->current_floor_ptr->o_list[o_idx];
/* Read the item */
rd_item(o_ptr);
if (OBJECT_IS_HELD_MONSTER(o_ptr))
{
monster_type *m_ptr;
- m_ptr = ¤t_floor_ptr->m_list[o_ptr->held_m_idx];
+ m_ptr = &p_ptr->current_floor_ptr->m_list[o_ptr->held_m_idx];
/* Build a stack */
o_ptr->next_o_idx = m_ptr->hold_o_idx;
else
{
/* Access the item location */
- g_ptr = ¤t_floor_ptr->grid_array[o_ptr->iy][o_ptr->ix];
+ g_ptr = &p_ptr->current_floor_ptr->grid_array[o_ptr->iy][o_ptr->ix];
/* Build a stack */
o_ptr->next_o_idx = g_ptr->o_idx;
rd_u16b(&limit);
/* Hack -- verify */
- if (limit > current_floor_ptr->max_m_idx)
+ if (limit > current_world_ptr->max_m_idx)
{
note(format(_("モンスターの配列が大きすぎる(%d)!", "Too many (%d) monster entries!"), limit));
return (161);
return (162);
}
- m_ptr = ¤t_floor_ptr->m_list[m_idx];
+ m_ptr = &p_ptr->current_floor_ptr->m_list[m_idx];
/* Read the monster */
rd_monster(m_ptr);
/* Access grid */
- g_ptr = ¤t_floor_ptr->grid_array[m_ptr->fy][m_ptr->fx];
+ g_ptr = &p_ptr->current_floor_ptr->grid_array[m_ptr->fy][m_ptr->fx];
/* Mark the location */
g_ptr->m_idx = m_idx;
/*** Success ***/
/* The dungeon is ready */
- if (z_older_than(10, 3, 13) && !current_floor_ptr->dun_level && !p_ptr->inside_arena)
+ if (z_older_than(10, 3, 13) && !p_ptr->current_floor_ptr->dun_level && !p_ptr->inside_arena)
current_world_ptr->character_dungeon = FALSE;
else
current_world_ptr->character_dungeon = TRUE;
grid_template_type *templates;
- clear_cave(current_floor_ptr);
+ clear_cave(p_ptr->current_floor_ptr);
/*** Basic info ***/
/*** Not a saved floor ***/
rd_s16b(&tmp16s);
- current_floor_ptr->dun_level = (DEPTH)tmp16s;
- current_floor_ptr->base_level = current_floor_ptr->dun_level;
+ p_ptr->current_floor_ptr->dun_level = (DEPTH)tmp16s;
+ p_ptr->current_floor_ptr->base_level = p_ptr->current_floor_ptr->dun_level;
}
else
{
rd_s16b(&tmp16s);
if (tmp16s != sf_ptr->dun_level) return 171;
- current_floor_ptr->dun_level = sf_ptr->dun_level;
+ p_ptr->current_floor_ptr->dun_level = sf_ptr->dun_level;
rd_s32b(&tmp32s);
if (tmp32s != sf_ptr->last_visit) return 171;
}
rd_s16b(&tmp16s);
- current_floor_ptr->base_level = (DEPTH)tmp16s;
+ p_ptr->current_floor_ptr->base_level = (DEPTH)tmp16s;
rd_s16b(&tmp16s);
- current_floor_ptr->num_repro = (MONSTER_NUMBER)tmp16s;
+ p_ptr->current_floor_ptr->num_repro = (MONSTER_NUMBER)tmp16s;
rd_u16b(&tmp16u);
p_ptr->y = (POSITION)tmp16u;
p_ptr->x = (POSITION)tmp16u;
rd_s16b(&tmp16s);
- current_floor_ptr->height = (POSITION)tmp16s;
+ p_ptr->current_floor_ptr->height = (POSITION)tmp16s;
rd_s16b(&tmp16s);
- current_floor_ptr->width = (POSITION)tmp16s;
+ p_ptr->current_floor_ptr->width = (POSITION)tmp16s;
rd_byte(&p_ptr->feeling);
}
/* Maximal size */
- ymax = current_floor_ptr->height;
- xmax = current_floor_ptr->width;
+ ymax = p_ptr->current_floor_ptr->height;
+ xmax = p_ptr->current_floor_ptr->width;
/*** Run length decoding ***/
/* Apply the RLE info */
for (i = count; i > 0; i--)
{
- /* Access the current_floor_ptr->grid_array */
- grid_type *g_ptr = ¤t_floor_ptr->grid_array[y][x];
+ /* Access the p_ptr->current_floor_ptr->grid_array */
+ grid_type *g_ptr = &p_ptr->current_floor_ptr->grid_array[y][x];
- /* Extract current_floor_ptr->grid_array data */
+ /* Extract p_ptr->current_floor_ptr->grid_array data */
g_ptr->info = templates[id].info;
g_ptr->feat = templates[id].feat;
g_ptr->mimic = templates[id].mimic;
{
for (y = 0; y < ymax; y++) for (x = 0; x < xmax; x++)
{
- /* Access the current_floor_ptr->grid_array */
- grid_type *g_ptr = ¤t_floor_ptr->grid_array[y][x];
+ /* Access the p_ptr->current_floor_ptr->grid_array */
+ grid_type *g_ptr = &p_ptr->current_floor_ptr->grid_array[y][x];
- if ((g_ptr->special == OLD_QUEST_WATER_CAVE) && !current_floor_ptr->dun_level)
+ if ((g_ptr->special == OLD_QUEST_WATER_CAVE) && !p_ptr->current_floor_ptr->dun_level)
{
if (g_ptr->feat == OLD_FEAT_QUEST_ENTER)
{
rd_u16b(&limit);
/* Verify maximum */
- if (limit > current_floor_ptr->max_o_idx) return 151;
+ if (limit > current_world_ptr->max_o_idx) return 151;
/* Read the dungeon items */
if (i != o_idx) return 152;
/* Acquire place */
- o_ptr = ¤t_floor_ptr->o_list[o_idx];
+ o_ptr = &p_ptr->current_floor_ptr->o_list[o_idx];
/* Read the item */
rd_item(o_ptr);
if (OBJECT_IS_HELD_MONSTER(o_ptr))
{
monster_type *m_ptr;
- m_ptr = ¤t_floor_ptr->m_list[o_ptr->held_m_idx];
+ m_ptr = &p_ptr->current_floor_ptr->m_list[o_ptr->held_m_idx];
/* Build a stack */
o_ptr->next_o_idx = m_ptr->hold_o_idx;
else
{
/* Access the item location */
- grid_type *g_ptr = ¤t_floor_ptr->grid_array[o_ptr->iy][o_ptr->ix];
+ grid_type *g_ptr = &p_ptr->current_floor_ptr->grid_array[o_ptr->iy][o_ptr->ix];
/* Build a stack */
o_ptr->next_o_idx = g_ptr->o_idx;
rd_u16b(&limit);
/* Hack -- verify */
- if (limit > current_floor_ptr->max_m_idx) return 161;
+ if (limit > current_world_ptr->max_m_idx) return 161;
/* Read the monsters */
for (i = 1; i < limit; i++)
if (i != m_idx) return 162;
- m_ptr = ¤t_floor_ptr->m_list[m_idx];
+ m_ptr = &p_ptr->current_floor_ptr->m_list[m_idx];
/* Read the monster */
rd_monster(m_ptr);
/* Access grid */
- g_ptr = ¤t_floor_ptr->grid_array[m_ptr->fy][m_ptr->fx];
+ g_ptr = &p_ptr->current_floor_ptr->grid_array[m_ptr->fy][m_ptr->fx];
/* Mark the location */
g_ptr->m_idx = m_idx;
if (p_ptr->dungeon_idx)
{
p_ptr->floor_id = get_new_floor_id();
- get_sf_ptr(p_ptr->floor_id)->dun_level = current_floor_ptr->dun_level;
+ get_sf_ptr(p_ptr->floor_id)->dun_level = p_ptr->current_floor_ptr->dun_level;
}
return err;
if (p_ptr->inside_quest == OLD_QUEST_WATER_CAVE)
{
p_ptr->dungeon_idx = lite_town ? DUNGEON_ANGBAND : DUNGEON_GALGALS;
- current_floor_ptr->dun_level = 1;
+ p_ptr->current_floor_ptr->dun_level = 1;
p_ptr->inside_quest = 0;
}
}
{
min_x = 0;
min_y = 0;
- max_x = current_floor_ptr->width;
- max_y = current_floor_ptr->height;
+ max_x = p_ptr->current_floor_ptr->width;
+ max_y = p_ptr->current_floor_ptr->height;
}
/* Draw the map */
/* Hack -- Forget messages */
msg_flag = FALSE;
- forget_lite(current_floor_ptr);
+ forget_lite(p_ptr->current_floor_ptr);
forget_view();
- clear_mon_lite(current_floor_ptr);
+ clear_mon_lite(p_ptr->current_floor_ptr);
/* Save the game */
#ifdef ZANGBAND
/* Hack -- Forget messages */
msg_flag = FALSE;
- forget_lite(current_floor_ptr);
+ forget_lite(p_ptr->current_floor_ptr);
forget_view();
- clear_mon_lite(current_floor_ptr);
+ clear_mon_lite(p_ptr->current_floor_ptr);
/* Save the game */
#ifdef ZANGBAND
MONSTER_IDX m_idx;
if (!target_set(TARGET_KILL)) return FALSE;
- m_idx = current_floor_ptr->grid_array[target_row][target_col].m_idx;
+ m_idx = p_ptr->current_floor_ptr->grid_array[target_row][target_col].m_idx;
if (!m_idx) break;
if (!player_has_los_bold(target_row, target_col)) break;
if (!projectable(p_ptr->y, p_ptr->x, target_row, target_col)) break;
{
POSITION x, y;
int val = 0;
- for (x = 0; x < current_floor_ptr->width; x++) {
- for (y = 0; y < current_floor_ptr->height; y++) {
- if (is_mirror_grid(¤t_floor_ptr->grid_array[y][x])) val++;
+ for (x = 0; x < p_ptr->current_floor_ptr->width; x++) {
+ for (y = 0; y < p_ptr->current_floor_ptr->height; y++) {
+ if (is_mirror_grid(&p_ptr->current_floor_ptr->grid_array[y][x])) val++;
}
}
return val;
{
/* mirror of seeing */
case 0:
- tmp = is_mirror_grid(¤t_floor_ptr->grid_array[p_ptr->y][p_ptr->x]) ? 4 : 0;
+ tmp = is_mirror_grid(&p_ptr->current_floor_ptr->grid_array[p_ptr->y][p_ptr->x]) ? 4 : 0;
if (plev + tmp > 4)detect_monsters_normal(DETECT_RAD_DEFAULT);
if (plev + tmp > 18)detect_monsters_invis(DETECT_RAD_DEFAULT);
if (plev + tmp > 28)set_tim_esp(p_ptr, (TIME_EFFECT)plev, FALSE);
break;
case 2:
if (!get_aim_dir(&dir)) return FALSE;
- if (plev > 9 && is_mirror_grid(¤t_floor_ptr->grid_array[p_ptr->y][p_ptr->x])) {
+ if (plev > 9 && is_mirror_grid(&p_ptr->current_floor_ptr->grid_array[p_ptr->y][p_ptr->x])) {
fire_beam(GF_LITE, dir, damroll(3 + ((plev - 1) / 5), 4));
}
else {
break;
/* mirror sleeping */
case 9:
- for (x = 0; x < current_floor_ptr->width; x++) {
- for (y = 0; y < current_floor_ptr->height; y++) {
- if (is_mirror_grid(¤t_floor_ptr->grid_array[y][x])) {
+ for (x = 0; x < p_ptr->current_floor_ptr->width; x++) {
+ for (y = 0; y < p_ptr->current_floor_ptr->height; y++) {
+ if (is_mirror_grid(&p_ptr->current_floor_ptr->grid_array[y][x])) {
project(0, 2, y, x, (HIT_POINT)plev, GF_OLD_SLEEP, (PROJECT_GRID | PROJECT_ITEM | PROJECT_KILL | PROJECT_JUMP | PROJECT_NO_HANGEKI), -1);
}
}
break;
/* illusion light */
case 14:
- tmp = is_mirror_grid(¤t_floor_ptr->grid_array[p_ptr->y][p_ptr->x]) ? 4 : 3;
+ tmp = is_mirror_grid(&p_ptr->current_floor_ptr->grid_array[p_ptr->y][p_ptr->x]) ? 4 : 3;
slow_monsters(plev);
stun_monsters(plev*tmp);
confuse_monsters(plev*tmp);
break;
/* mirror shift */
case 15:
- if (!is_mirror_grid(¤t_floor_ptr->grid_array[p_ptr->y][p_ptr->x])) {
+ if (!is_mirror_grid(&p_ptr->current_floor_ptr->grid_array[p_ptr->y][p_ptr->x])) {
msg_print(_("鏡の国の場所がわからない!", "You cannot find out where is the world of mirror!"));
break;
}
y = p_ptr->y + ddy[dir];
x = p_ptr->x + ddx[dir];
- if (!current_floor_ptr->grid_array[y][x].m_idx)
+ if (!p_ptr->current_floor_ptr->grid_array[y][x].m_idx)
{
msg_print(_("その方向にはモンスターはいません。", "There is no monster."));
return FALSE;
py_attack(p_ptr, y, x, 0);
- if (!player_can_enter(current_floor_ptr->grid_array[y][x].feat, 0) || is_trap(current_floor_ptr->grid_array[y][x].feat))
+ if (!player_can_enter(p_ptr->current_floor_ptr->grid_array[y][x].feat, 0) || is_trap(p_ptr->current_floor_ptr->grid_array[y][x].feat))
break;
y += ddy[dir];
x += ddx[dir];
- if (player_can_enter(current_floor_ptr->grid_array[y][x].feat, 0) && !is_trap(current_floor_ptr->grid_array[y][x].feat) && !current_floor_ptr->grid_array[y][x].m_idx)
+ if (player_can_enter(p_ptr->current_floor_ptr->grid_array[y][x].feat, 0) && !is_trap(p_ptr->current_floor_ptr->grid_array[y][x].feat) && !p_ptr->current_floor_ptr->grid_array[y][x].m_idx)
{
msg_print(NULL);
(void)move_player_effect(p_ptr, y, x, MPE_FORGET_FLOW | MPE_HANDLE_STUFF | MPE_DONT_PICKUP);
POSITION ty, tx;
if (!target_set(TARGET_KILL)) return FALSE;
- m_idx = current_floor_ptr->grid_array[target_row][target_col].m_idx;
+ m_idx = p_ptr->current_floor_ptr->grid_array[target_row][target_col].m_idx;
if (!m_idx) break;
if (m_idx == p_ptr->riding) break;
if (!player_has_los_bold(target_row, target_col)) break;
if (!projectable(p_ptr->y, p_ptr->x, target_row, target_col)) break;
- m_ptr = ¤t_floor_ptr->m_list[m_idx];
+ m_ptr = &p_ptr->current_floor_ptr->m_list[m_idx];
monster_desc(m_name, m_ptr, 0);
msg_format(_("%sを引き戻した。", "You pull back %s."), m_name);
path_n = project_path(path_g, MAX_RANGE, target_row, target_col, p_ptr->y, p_ptr->x, 0);
{
POSITION ny = GRID_Y(path_g[i]);
POSITION nx = GRID_X(path_g[i]);
- grid_type *g_ptr = ¤t_floor_ptr->grid_array[ny][nx];
+ grid_type *g_ptr = &p_ptr->current_floor_ptr->grid_array[ny][nx];
- if (in_bounds(current_floor_ptr, ny, nx) && cave_empty_bold(ny, nx) &&
+ if (in_bounds(p_ptr->current_floor_ptr, ny, nx) && cave_empty_bold(ny, nx) &&
!(g_ptr->info & CAVE_OBJECT) &&
!pattern_tile(ny, nx))
{
}
}
/* Update the old location */
- current_floor_ptr->grid_array[target_row][target_col].m_idx = 0;
+ p_ptr->current_floor_ptr->grid_array[target_row][target_col].m_idx = 0;
/* Update the new location */
- current_floor_ptr->grid_array[ty][tx].m_idx = m_idx;
+ p_ptr->current_floor_ptr->grid_array[ty][tx].m_idx = m_idx;
/* Move the monster */
m_ptr->fy = ty;
break;
case MIND_MIRROR_MASTER:
- if( is_mirror_grid(¤t_floor_ptr->grid_array[p_ptr->y][p_ptr->x]) )on_mirror = TRUE;
+ if( is_mirror_grid(&p_ptr->current_floor_ptr->grid_array[p_ptr->y][p_ptr->x]) )on_mirror = TRUE;
cast = cast_mirror_spell(n);
break;
case MIND_NINJUTSU:
int start;
int plus = 1;
- 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];
monster_type *t_ptr;
if (p_ptr->riding_t_m_idx && player_bold(m_ptr->fy, m_ptr->fx))
{
- y = current_floor_ptr->m_list[p_ptr->riding_t_m_idx].fy;
- x = current_floor_ptr->m_list[p_ptr->riding_t_m_idx].fx;
+ y = p_ptr->current_floor_ptr->m_list[p_ptr->riding_t_m_idx].fy;
+ x = p_ptr->current_floor_ptr->m_list[p_ptr->riding_t_m_idx].fx;
}
else if (is_pet(m_ptr) && p_ptr->pet_t_m_idx)
{
- y = current_floor_ptr->m_list[p_ptr->pet_t_m_idx].fy;
- x = current_floor_ptr->m_list[p_ptr->pet_t_m_idx].fx;
+ y = p_ptr->current_floor_ptr->m_list[p_ptr->pet_t_m_idx].fy;
+ x = p_ptr->current_floor_ptr->m_list[p_ptr->pet_t_m_idx].fx;
}
else
{
if (p_ptr->phase_out)
{
- start = randint1(current_floor_ptr->m_max-1)+current_floor_ptr->m_max;
+ start = randint1(p_ptr->current_floor_ptr->m_max-1)+p_ptr->current_floor_ptr->m_max;
if(randint0(2)) plus = -1;
}
- else start = current_floor_ptr->m_max + 1;
+ else start = p_ptr->current_floor_ptr->m_max + 1;
/* Scan thru all monsters */
- for (i = start; ((i < start + current_floor_ptr->m_max) && (i > start - current_floor_ptr->m_max)); i+=plus)
+ for (i = start; ((i < start + p_ptr->current_floor_ptr->m_max) && (i > start - p_ptr->current_floor_ptr->m_max)); i+=plus)
{
- MONSTER_IDX dummy = (i % current_floor_ptr->m_max);
+ MONSTER_IDX dummy = (i % p_ptr->current_floor_ptr->m_max);
if (!dummy) continue;
t_idx = dummy;
- t_ptr = ¤t_floor_ptr->m_list[t_idx];
+ t_ptr = &p_ptr->current_floor_ptr->m_list[t_idx];
/* The monster itself isn't a target */
if (t_ptr == m_ptr) continue;
*/
static bool mon_will_run(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];
#ifdef ALLOW_TERROR
bool can_open_door = FALSE;
int now_cost;
- 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];
/* Monster location */
if (projectable(y1, x1, p_ptr->y, p_ptr->x)) return (FALSE);
/* Set current grid cost */
- now_cost = current_floor_ptr->grid_array[y1][x1].cost;
+ now_cost = p_ptr->current_floor_ptr->grid_array[y1][x1].cost;
if (now_cost == 0) now_cost = 999;
/* Can monster bash or open doors? */
/* Simply move to player */
if (player_bold(y, x)) return (FALSE);
- g_ptr = ¤t_floor_ptr->grid_array[y][x];
+ g_ptr = &p_ptr->current_floor_ptr->grid_array[y][x];
cost = g_ptr->cost;
grid_type *g_ptr;
bool use_scent = FALSE;
- 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];
/* Can monster cast attack spell? */
if (player_has_los_bold(y1, x1) && projectable(p_ptr->y, p_ptr->x, y1, x1)) return (FALSE);
/* Monster grid */
- g_ptr = ¤t_floor_ptr->grid_array[y1][x1];
+ g_ptr = &p_ptr->current_floor_ptr->grid_array[y1][x1];
/* If we can hear noises, advance towards them */
if (g_ptr->cost)
else if (g_ptr->when)
{
/* Too old smell */
- if (current_floor_ptr->grid_array[p_ptr->y][p_ptr->x].when - g_ptr->when > 127) return (FALSE);
+ if (p_ptr->current_floor_ptr->grid_array[p_ptr->y][p_ptr->x].when - g_ptr->when > 127) return (FALSE);
use_scent = TRUE;
best = 0;
/* Ignore locations off of edge */
if (!in_bounds2(y, x)) continue;
- g_ptr = ¤t_floor_ptr->grid_array[y][x];
+ g_ptr = &p_ptr->current_floor_ptr->grid_array[y][x];
/* We're following a scent trail */
if (use_scent)
int score = -1;
int i;
- 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 location */
fy = m_ptr->fy;
if (!in_bounds2(y, x)) continue;
/* Don't move toward player */
- /* if (current_floor_ptr->grid_array[y][x].dist < 3) continue; */ /* Hmm.. Need it? */
+ /* if (p_ptr->current_floor_ptr->grid_array[y][x].dist < 3) continue; */ /* Hmm.. Need it? */
/* Calculate distance of this grid from our destination */
dis = distance(y, x, y1, x1);
/* Score this grid */
- s = 5000 / (dis + 3) - 500 / (current_floor_ptr->grid_array[y][x].dist + 1);
+ s = 5000 / (dis + 3) - 500 / (p_ptr->current_floor_ptr->grid_array[y][x].dist + 1);
/* No negative scores */
if (s < 0) s = 0;
*/
static bool find_safety(MONSTER_IDX m_idx, POSITION *yp, POSITION *xp)
{
- 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 fy = m_ptr->fy;
POSITION fx = m_ptr->fx;
x = fx + dx;
/* Skip illegal locations */
- if (!in_bounds(current_floor_ptr, y, x)) continue;
+ if (!in_bounds(p_ptr->current_floor_ptr, y, x)) continue;
- g_ptr = ¤t_floor_ptr->grid_array[y][x];
+ g_ptr = &p_ptr->current_floor_ptr->grid_array[y][x];
/* Skip locations in a wall */
if (!monster_can_cross_terrain(g_ptr->feat, &r_info[m_ptr->r_idx], (m_idx == p_ptr->riding) ? CEM_RIDING : 0)) continue;
if (g_ptr->dist == 0) continue;
/* Ignore too-distant grids */
- if (g_ptr->dist > current_floor_ptr->grid_array[fy][fx].dist + 2 * d) continue;
+ if (g_ptr->dist > p_ptr->current_floor_ptr->grid_array[fy][fx].dist + 2 * d) continue;
}
/* Check for absence of shot (more or less) */
*/
static bool find_hiding(MONSTER_IDX m_idx, POSITION *yp, POSITION *xp)
{
- 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];
POSITION fy = m_ptr->fy;
x = fx + dx;
/* Skip illegal locations */
- if (!in_bounds(current_floor_ptr, y, x)) continue;
+ if (!in_bounds(p_ptr->current_floor_ptr, y, x)) continue;
/* Skip occupied locations */
if (!monster_can_enter(y, x, r_ptr, 0)) continue;
*/
static bool get_moves(MONSTER_IDX m_idx, DIRECTION *mm)
{
- 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];
POSITION y = 0, ay, x = 0, ax;
int move_val = 0;
bool done = FALSE;
bool will_run = mon_will_run(m_idx);
grid_type *g_ptr;
- bool no_flow = ((m_ptr->mflag2 & MFLAG2_NOFLOW) && (current_floor_ptr->grid_array[m_ptr->fy][m_ptr->fx].cost > 2));
+ bool no_flow = ((m_ptr->mflag2 & MFLAG2_NOFLOW) && (p_ptr->current_floor_ptr->grid_array[m_ptr->fy][m_ptr->fx].cost > 2));
bool can_pass_wall = ((r_ptr->flags2 & RF2_PASS_WALL) && ((m_idx != p_ptr->riding) || p_ptr->pass_wall));
/* Counter attack to an enemy monster */
if (!will_run && m_ptr->target_y)
{
- int t_m_idx = current_floor_ptr->grid_array[m_ptr->target_y][m_ptr->target_x].m_idx;
+ int t_m_idx = p_ptr->current_floor_ptr->grid_array[m_ptr->target_y][m_ptr->target_x].m_idx;
/* The monster must be an enemy, and in LOS */
if (t_m_idx &&
- are_enemies(m_ptr, ¤t_floor_ptr->m_list[t_m_idx]) &&
+ are_enemies(m_ptr, &p_ptr->current_floor_ptr->m_list[t_m_idx]) &&
los(m_ptr->fy, m_ptr->fx, m_ptr->target_y, m_ptr->target_x) &&
projectable(m_ptr->fy, m_ptr->fx, m_ptr->target_y, m_ptr->target_x))
{
if (!done && !will_run && is_hostile(m_ptr) &&
(r_ptr->flags1 & RF1_FRIENDS) &&
((los(m_ptr->fy, m_ptr->fx, p_ptr->y, p_ptr->x) && projectable(m_ptr->fy, m_ptr->fx, p_ptr->y, p_ptr->x)) ||
- (current_floor_ptr->grid_array[m_ptr->fy][m_ptr->fx].dist < MAX_SIGHT / 2)))
+ (p_ptr->current_floor_ptr->grid_array[m_ptr->fy][m_ptr->fx].dist < MAX_SIGHT / 2)))
{
/*
* Animal packs try to get the player out of corridors
if (!in_bounds2(yy, xx)) continue;
- g_ptr = ¤t_floor_ptr->grid_array[yy][xx];
+ g_ptr = &p_ptr->current_floor_ptr->grid_array[yy][xx];
/* Check grid */
if (monster_can_cross_terrain(g_ptr->feat, r_ptr, 0))
room++;
}
}
- if (current_floor_ptr->grid_array[p_ptr->y][p_ptr->x].info & CAVE_ROOM) room -= 2;
+ if (p_ptr->current_floor_ptr->grid_array[p_ptr->y][p_ptr->x].info & CAVE_ROOM) room -= 2;
if (!r_ptr->flags4 && !r_ptr->a_ability_flags1 && !r_ptr->a_ability_flags2) room -= 2;
/* Not in a room and strong player */
}
/* Monster groups try to surround the player */
- if (!done && (current_floor_ptr->grid_array[m_ptr->fy][m_ptr->fx].dist < 3))
+ if (!done && (p_ptr->current_floor_ptr->grid_array[m_ptr->fy][m_ptr->fx].dist < 3))
{
int i;
*/
void process_monster(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];
monster_race *r_ptr = &r_info[m_ptr->r_idx];
monster_race *ap_r_ptr = &r_info[m_ptr->ap_r_idx];
msg_print("地面に落とされた。");
#else
GAME_TEXT m_name[MAX_NLEN];
- monster_desc(m_name, ¤t_floor_ptr->m_list[p_ptr->riding], 0);
+ monster_desc(m_name, &p_ptr->current_floor_ptr->m_list[p_ptr->riding], 0);
msg_format("You have fallen from %s.", m_name);
#endif
}
}
/* Are there its parent? */
- if (m_ptr->parent_m_idx && !current_floor_ptr->m_list[m_ptr->parent_m_idx].r_idx)
+ if (m_ptr->parent_m_idx && !p_ptr->current_floor_ptr->m_list[m_ptr->parent_m_idx].r_idx)
{
/* Its parent have gone, it also goes away. */
ox = m_ptr->fx;
/* Attempt to "multiply" if able and allowed */
- if ((r_ptr->flags2 & RF2_MULTIPLY) && (current_floor_ptr->num_repro < MAX_REPRO))
+ if ((r_ptr->flags2 & RF2_MULTIPLY) && (p_ptr->current_floor_ptr->num_repro < MAX_REPRO))
{
int k;
POSITION y, x;
{
/* Ignore locations off of edge */
if (!in_bounds2(y, x)) continue;
- if (current_floor_ptr->grid_array[y][x].m_idx) k++;
+ if (p_ptr->current_floor_ptr->grid_array[y][x].m_idx) k++;
}
}
if (multiply_monster(m_idx, FALSE, (is_pet(m_ptr) ? PM_FORCE_PET : 0)))
{
/* Take note if visible */
- if (current_floor_ptr->m_list[hack_m_idx_ii].ml && is_original_ap_and_seen(m_ptr))
+ if (p_ptr->current_floor_ptr->m_list[hack_m_idx_ii].ml && is_original_ap_and_seen(m_ptr))
{
r_ptr->r_flags2 |= (RF2_MULTIPLY);
}
{
if (summon_specific(m_idx, m_ptr->fy, m_ptr->fx, rlev, SUMMON_MOLD, (PM_ALLOW_GROUP | p_mode)))
{
- if (current_floor_ptr->m_list[hack_m_idx_ii].ml) count++;
+ if (p_ptr->current_floor_ptr->m_list[hack_m_idx_ii].ml) count++;
}
}
/* Give priority to counter attack? */
if (m_ptr->target_y)
{
- MONSTER_IDX t_m_idx = current_floor_ptr->grid_array[m_ptr->target_y][m_ptr->target_x].m_idx;
+ MONSTER_IDX t_m_idx = p_ptr->current_floor_ptr->grid_array[m_ptr->target_y][m_ptr->target_x].m_idx;
/* The monster must be an enemy, and projectable */
- if (t_m_idx && are_enemies(m_ptr, ¤t_floor_ptr->m_list[t_m_idx]) &&
+ if (t_m_idx && are_enemies(m_ptr, &p_ptr->current_floor_ptr->m_list[t_m_idx]) &&
projectable(m_ptr->fy, m_ptr->fx, m_ptr->target_y, m_ptr->target_x))
{
counterattack = TRUE;
if (!in_bounds2(ny, nx)) continue;
/* Access that grid */
- g_ptr = ¤t_floor_ptr->grid_array[ny][nx];
+ g_ptr = &p_ptr->current_floor_ptr->grid_array[ny][nx];
f_ptr = &f_info[g_ptr->feat];
can_cross = monster_can_cross_terrain(g_ptr->feat, r_ptr, is_riding_mon ? CEM_RIDING : 0);
/* Access that grid's contents */
- y_ptr = ¤t_floor_ptr->m_list[g_ptr->m_idx];
+ y_ptr = &p_ptr->current_floor_ptr->m_list[g_ptr->m_idx];
/* Hack -- player 'in' wall */
if (player_bold(ny, nx))
else if ((r_ptr->flags2 & RF2_MOVE_BODY) && !(r_ptr->flags1 & RF1_NEVER_MOVE) &&
(r_ptr->mexp > z_ptr->mexp) &&
can_cross && (g_ptr->m_idx != p_ptr->riding) &&
- monster_can_cross_terrain(current_floor_ptr->grid_array[m_ptr->fy][m_ptr->fx].feat, z_ptr, 0))
+ monster_can_cross_terrain(p_ptr->current_floor_ptr->grid_array[m_ptr->fy][m_ptr->fx].feat, z_ptr, 0))
{
/* Allow movement */
do_move = TRUE;
if (is_riding_mon)
{
- if (!p_ptr->riding_ryoute && !MON_MONFEAR(¤t_floor_ptr->m_list[p_ptr->riding])) do_move = FALSE;
+ if (!p_ptr->riding_ryoute && !MON_MONFEAR(&p_ptr->current_floor_ptr->m_list[p_ptr->riding])) do_move = FALSE;
}
if (did_kill_wall && do_move)
if (!is_riding_mon)
{
/* Hack -- Update the old location */
- current_floor_ptr->grid_array[oy][ox].m_idx = g_ptr->m_idx;
+ p_ptr->current_floor_ptr->grid_array[oy][ox].m_idx = g_ptr->m_idx;
/* Mega-Hack -- move the old monster, if any */
if (g_ptr->m_idx)
{
BIT_FLAGS flgs[TR_FLAG_SIZE], flg2 = 0L, flg3 = 0L, flgr = 0L;
GAME_TEXT m_name[MAX_NLEN], o_name[MAX_NLEN];
- object_type *o_ptr = ¤t_floor_ptr->o_list[this_o_idx];
+ object_type *o_ptr = &p_ptr->current_floor_ptr->o_list[this_o_idx];
next_o_idx = o_ptr->next_o_idx;
if (do_take)
SPEED speed;
/* Clear monster fighting indicator */
- current_floor_ptr->monster_noise = FALSE;
+ p_ptr->current_floor_ptr->monster_noise = FALSE;
/* Memorize old race */
old_monster_race_idx = p_ptr->monster_race_idx;
/* Process the 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--)
{
- m_ptr = ¤t_floor_ptr->m_list[i];
+ m_ptr = &p_ptr->current_floor_ptr->m_list[i];
r_ptr = &r_info[m_ptr->r_idx];
/* Handle "leaving" */
test = TRUE;
}
-#if 0 /* (current_floor_ptr->grid_array[p_ptr->y][p_ptr->x].when == current_floor_ptr->grid_array[fy][fx].when) is always FALSE... */
+#if 0 /* (p_ptr->current_floor_ptr->grid_array[p_ptr->y][p_ptr->x].when == p_ptr->current_floor_ptr->grid_array[fy][fx].when) is always FALSE... */
/* Hack -- Monsters can "smell" the player from far away */
/* Note that most monsters have "aaf" of "20" or so */
else if (!(m_ptr->mflag2 & MFLAG2_NOFLOW) &&
cave_have_flag_bold(p_ptr->y, p_ptr->x, FF_MOVE) &&
- (current_floor_ptr->grid_array[p_ptr->y][p_ptr->x].when == current_floor_ptr->grid_array[fy][fx].when) &&
- (current_floor_ptr->grid_array[fy][fx].dist < MONSTER_FLOW_DEPTH) &&
- (current_floor_ptr->grid_array[fy][fx].dist < r_ptr->aaf))
+ (p_ptr->current_floor_ptr->grid_array[p_ptr->y][p_ptr->x].when == p_ptr->current_floor_ptr->grid_array[fy][fx].when) &&
+ (p_ptr->current_floor_ptr->grid_array[fy][fx].dist < MONSTER_FLOW_DEPTH) &&
+ (p_ptr->current_floor_ptr->grid_array[fy][fx].dist < r_ptr->aaf))
{
/* We can "smell" the player */
test = TRUE;
*/
bool monster_is_powerful(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];
monster_race *r_ptr = &r_info[m_ptr->r_idx];
bool powerful = r_ptr->flags2 & RF2_POWERFUL ? TRUE : FALSE;
return powerful;
*/
DEPTH monster_level_idx(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];
monster_race *r_ptr = &r_info[m_ptr->r_idx];
DEPTH rlev = ((r_ptr->level >= 1) ? r_ptr->level : 1);
return rlev;
s64b_mul(&div_h, &div_l, 0, r_ptr->hdice * (ironman_nightmare ? 2 : 1) * r_ptr->hside * 2);
/* Special penalty in the wilderness */
- if (!current_floor_ptr->dun_level && (!(r_ptr->flags8 & RF8_WILD_ONLY) || !(r_ptr->flags1 & RF1_UNIQUE)))
+ if (!p_ptr->current_floor_ptr->dun_level && (!(r_ptr->flags8 & RF8_WILD_ONLY) || !(r_ptr->flags1 & RF1_UNIQUE)))
s64b_mul(&div_h, &div_l, 0, 5);
/* Do division first to prevent overflaw */
*/
int get_mproc_idx(MONSTER_IDX m_idx, int mproc_type)
{
- s16b *cur_mproc_list = current_floor_ptr->mproc_list[mproc_type];
+ s16b *cur_mproc_list = p_ptr->current_floor_ptr->mproc_list[mproc_type];
int i;
- for (i = current_floor_ptr->mproc_max[mproc_type] - 1; i >= 0; i--)
+ for (i = p_ptr->current_floor_ptr->mproc_max[mproc_type] - 1; i >= 0; i--)
{
if (cur_mproc_list[i] == m_idx) return i;
}
*/
static void mproc_add(MONSTER_IDX m_idx, int mproc_type)
{
- if (current_floor_ptr->mproc_max[mproc_type] < current_floor_ptr->max_m_idx) current_floor_ptr->mproc_list[mproc_type][current_floor_ptr->mproc_max[mproc_type]++] = (s16b)m_idx;
+ if (p_ptr->current_floor_ptr->mproc_max[mproc_type] < current_world_ptr->max_m_idx) p_ptr->current_floor_ptr->mproc_list[mproc_type][p_ptr->current_floor_ptr->mproc_max[mproc_type]++] = (s16b)m_idx;
}
static void mproc_remove(MONSTER_IDX m_idx, int mproc_type)
{
int mproc_idx = get_mproc_idx(m_idx, mproc_type);
- if (mproc_idx >= 0) current_floor_ptr->mproc_list[mproc_type][mproc_idx] = current_floor_ptr->mproc_list[mproc_type][--current_floor_ptr->mproc_max[mproc_type]];
+ if (mproc_idx >= 0) p_ptr->current_floor_ptr->mproc_list[mproc_type][mproc_idx] = p_ptr->current_floor_ptr->mproc_list[mproc_type][--p_ptr->current_floor_ptr->mproc_max[mproc_type]];
}
MONSTER_IDX i;
int cmi;
- /* Reset "current_floor_ptr->mproc_max[]" */
- for (cmi = 0; cmi < MAX_MTIMED; cmi++) current_floor_ptr->mproc_max[cmi] = 0;
+ /* Reset "p_ptr->current_floor_ptr->mproc_max[]" */
+ for (cmi = 0; cmi < MAX_MTIMED; cmi++) p_ptr->current_floor_ptr->mproc_max[cmi] = 0;
/* Process the 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--)
{
- m_ptr = ¤t_floor_ptr->m_list[i];
+ m_ptr = &p_ptr->current_floor_ptr->m_list[i];
/* Ignore "dead" monsters */
if (!monster_is_valid(m_ptr)) continue;
*/
bool set_monster_csleep(MONSTER_IDX m_idx, int v)
{
- monster_type *m_ptr = ¤t_floor_ptr->m_list[m_idx];
+ monster_type *m_ptr = &p_ptr->current_floor_ptr->m_list[m_idx];
bool notice = FALSE;
v = (v > 10000) ? 10000 : (v < 0) ? 0 : v;
*/
bool set_monster_fast(MONSTER_IDX m_idx, int v)
{
- monster_type *m_ptr = ¤t_floor_ptr->m_list[m_idx];
+ monster_type *m_ptr = &p_ptr->current_floor_ptr->m_list[m_idx];
bool notice = FALSE;
v = (v > 200) ? 200 : (v < 0) ? 0 : v;
*/
bool set_monster_slow(MONSTER_IDX m_idx, int v)
{
- monster_type *m_ptr = ¤t_floor_ptr->m_list[m_idx];
+ monster_type *m_ptr = &p_ptr->current_floor_ptr->m_list[m_idx];
bool notice = FALSE;
v = (v > 200) ? 200 : (v < 0) ? 0 : v;
*/
bool set_monster_stunned(MONSTER_IDX m_idx, int v)
{
- monster_type *m_ptr = ¤t_floor_ptr->m_list[m_idx];
+ monster_type *m_ptr = &p_ptr->current_floor_ptr->m_list[m_idx];
bool notice = FALSE;
v = (v > 200) ? 200 : (v < 0) ? 0 : v;
*/
bool set_monster_confused(MONSTER_IDX m_idx, int v)
{
- monster_type *m_ptr = ¤t_floor_ptr->m_list[m_idx];
+ monster_type *m_ptr = &p_ptr->current_floor_ptr->m_list[m_idx];
bool notice = FALSE;
v = (v > 200) ? 200 : (v < 0) ? 0 : v;
*/
bool set_monster_monfear(MONSTER_IDX m_idx, int v)
{
- monster_type *m_ptr = ¤t_floor_ptr->m_list[m_idx];
+ monster_type *m_ptr = &p_ptr->current_floor_ptr->m_list[m_idx];
bool notice = FALSE;
v = (v > 200) ? 200 : (v < 0) ? 0 : v;
*/
bool set_monster_invulner(MONSTER_IDX m_idx, int v, bool energy_need)
{
- monster_type *m_ptr = ¤t_floor_ptr->m_list[m_idx];
+ monster_type *m_ptr = &p_ptr->current_floor_ptr->m_list[m_idx];
bool notice = FALSE;
v = (v > 200) ? 200 : (v < 0) ? 0 : v;
*/
static void process_monsters_mtimed_aux(MONSTER_IDX m_idx, int mtimed_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];
switch (mtimed_idx)
{
void process_monsters_mtimed(int mtimed_idx)
{
int i;
- s16b *cur_mproc_list = current_floor_ptr->mproc_list[mtimed_idx];
+ s16b *cur_mproc_list = p_ptr->current_floor_ptr->mproc_list[mtimed_idx];
/* Hack -- calculate the "player noise" */
if (mtimed_idx == MTIMED_CSLEEP) csleep_noise = (1L << (30 - p_ptr->skill_stl));
/* Process the monsters (backwards) */
- for (i = current_floor_ptr->mproc_max[mtimed_idx] - 1; i >= 0; i--)
+ for (i = p_ptr->current_floor_ptr->mproc_max[mtimed_idx] - 1; i >= 0; i--)
{
process_monsters_mtimed_aux(cur_mproc_list[i], mtimed_idx);
}
*/
void dispel_monster_status(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];
GAME_TEXT m_name[MAX_NLEN];
monster_desc(m_name, m_ptr, 0);
*/
bool set_monster_timewalk(int num, MONSTER_IDX who, bool vs_player)
{
- monster_type *m_ptr = ¤t_floor_ptr->m_list[hack_m_idx]; /* the world monster */
+ monster_type *m_ptr = &p_ptr->current_floor_ptr->m_list[hack_m_idx]; /* the world monster */
if (current_world_ptr->timewalk_m_idx) return (FALSE);
int new_exp;
if (m_idx <= 0 || s_idx <= 0) return;
- m_ptr = ¤t_floor_ptr->m_list[m_idx];
+ m_ptr = &p_ptr->current_floor_ptr->m_list[m_idx];
if (!monster_is_valid(m_ptr)) return;
new_exp = s_ptr->mexp * s_ptr->level / (r_ptr->level + 2);
if (m_idx == p_ptr->riding) new_exp = (new_exp + 1) / 2;
- if (!current_floor_ptr->dun_level) new_exp /= 5;
+ if (!p_ptr->current_floor_ptr->dun_level) new_exp /= 5;
m_ptr->exp += new_exp;
if (m_ptr->mflag2 & MFLAG2_CHAMELEON) return;
*/
bool mon_take_hit(MONSTER_IDX m_idx, HIT_POINT dam, bool *fear, concptr note)
{
- 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];
monster_type exp_mon;
if (!(d_info[p_ptr->dungeon_idx].flags1 & DF1_BEGINNER))
{
- if (!current_floor_ptr->dun_level && !p_ptr->ambush_flag && !p_ptr->inside_arena)
+ if (!p_ptr->current_floor_ptr->dun_level && !p_ptr->ambush_flag && !p_ptr->inside_arena)
{
chg_virtue(p_ptr, V_VALOUR, -1);
}
- else if (r_ptr->level > current_floor_ptr->dun_level)
+ else if (r_ptr->level > p_ptr->current_floor_ptr->dun_level)
{
- if (randint1(10) <= (r_ptr->level - current_floor_ptr->dun_level))
+ if (randint1(10) <= (r_ptr->level - p_ptr->current_floor_ptr->dun_level))
chg_virtue(p_ptr, V_VALOUR, 1);
}
if (r_ptr->level > 60)
chg_virtue(p_ptr, V_COMPASSION, -1);
}
- if ((r_ptr->flags3 & RF3_GOOD) && ((r_ptr->level) / 10 + (3 * current_floor_ptr->dun_level) >= randint1(100)))
+ if ((r_ptr->flags3 & RF3_GOOD) && ((r_ptr->level) / 10 + (3 * p_ptr->current_floor_ptr->dun_level) >= randint1(100)))
chg_virtue(p_ptr, V_UNLIFE, 1);
if (r_ptr->d_char == 'A')
{
if (r_ptr->flags1 & RF1_UNIQUE)
chg_virtue(p_ptr, V_FAITH, -2);
- else if ((r_ptr->level) / 10 + (3 * current_floor_ptr->dun_level) >= randint1(100))
+ else if ((r_ptr->level) / 10 + (3 * p_ptr->current_floor_ptr->dun_level) >= randint1(100))
{
if (r_ptr->flags3 & RF3_GOOD) chg_virtue(p_ptr, V_FAITH, -1);
else chg_virtue(p_ptr, V_FAITH, 1);
{
if (r_ptr->flags1 & RF1_UNIQUE)
chg_virtue(p_ptr, V_FAITH, 2);
- else if ((r_ptr->level) / 10 + (3 * current_floor_ptr->dun_level) >= randint1(100))
+ else if ((r_ptr->level) / 10 + (3 * p_ptr->current_floor_ptr->dun_level) >= randint1(100))
chg_virtue(p_ptr, V_FAITH, 1);
}
{
chg_virtue(p_ptr, V_HONOUR, 10);
}
- else if ((r_ptr->level) / 10 + (2 * current_floor_ptr->dun_level) >= randint1(100))
+ else if ((r_ptr->level) / 10 + (2 * p_ptr->current_floor_ptr->dun_level) >= randint1(100))
{
chg_virtue(p_ptr, V_HONOUR, 1);
}
{
if (r_ptr->flags1 & RF1_UNIQUE)
chg_virtue(p_ptr, V_JUSTICE, 3);
- else if (1 + ((r_ptr->level) / 10 + (2 * current_floor_ptr->dun_level)) >= randint1(100))
+ else if (1 + ((r_ptr->level) / 10 + (2 * p_ptr->current_floor_ptr->dun_level)) >= randint1(100))
chg_virtue(p_ptr, V_JUSTICE, 1);
}
else if (innocent)
(bool)(((A)->smart & SM_FRIENDLY) ? TRUE : FALSE)
#define is_friendly_idx(MONSTER_IDX) \
- (bool)((MONSTER_IDX) > 0 && is_friendly(¤t_floor_ptr->m_list[(MONSTER_IDX)]))
+ (bool)((MONSTER_IDX) > 0 && is_friendly(&p_ptr->current_floor_ptr->m_list[(MONSTER_IDX)]))
#define is_pet(A) \
(bool)(((A)->smart & SM_PET) ? TRUE : FALSE)
*/
monsterrace_hook_type get_monster_hook(void)
{
- if (!current_floor_ptr->dun_level && !p_ptr->inside_quest)
+ if (!p_ptr->current_floor_ptr->dun_level && !p_ptr->inside_quest)
{
switch (wilderness[p_ptr->wilderness_y][p_ptr->wilderness_x].terrain)
{
*/
monsterrace_hook_type get_monster_hook2(POSITION y, POSITION x)
{
- feature_type *f_ptr = &f_info[current_floor_ptr->grid_array[y][x].feat];
+ feature_type *f_ptr = &f_info[p_ptr->current_floor_ptr->grid_array[y][x].feat];
/* Set the monster list */
*/
bool monster_can_enter(POSITION y, POSITION x, monster_race *r_ptr, BIT_FLAGS16 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];
/* Player or other monster */
if (player_bold(y, x)) return FALSE;
int dump_gold = 0;
int number = 0;
- 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];
bool visible = ((m_ptr->ml && !p_ptr->image) || (r_ptr->flags1 & RF1_UNIQUE));
/* Prepare to make a prize */
object_prep(q_ptr, lookup_kind(arena_info[p_ptr->arena_number].tval, arena_info[p_ptr->arena_number].sval));
- apply_magic(q_ptr, current_floor_ptr->object_level, AM_NO_FIXED_ART);
+ apply_magic(q_ptr, p_ptr->current_floor_ptr->object_level, AM_NO_FIXED_ART);
(void)drop_near(q_ptr, -1, y, x);
}
/* Prepare to make an object */
object_prep(q_ptr, lookup_kind(TV_CORPSE, (corpse ? SV_CORPSE : SV_SKELETON)));
- apply_magic(q_ptr, current_floor_ptr->object_level, AM_NO_FIXED_ART);
+ apply_magic(q_ptr, p_ptr->current_floor_ptr->object_level, AM_NO_FIXED_ART);
q_ptr->pval = m_ptr->r_idx;
(void)drop_near(q_ptr, -1, y, x);
/* Prepare to make a Blade of Chaos */
object_prep(q_ptr, lookup_kind(TV_SWORD, SV_BLADE_OF_CHAOS));
- apply_magic(q_ptr, current_floor_ptr->object_level, AM_NO_FIXED_ART | mo_mode);
+ apply_magic(q_ptr, p_ptr->current_floor_ptr->object_level, AM_NO_FIXED_ART | mo_mode);
(void)drop_near(q_ptr, -1, y, x);
}
break;
case MON_RAAL:
- if (drop_chosen_item && (current_floor_ptr->dun_level > 9))
+ if (drop_chosen_item && (p_ptr->current_floor_ptr->dun_level > 9))
{
q_ptr = &forge;
object_wipe(q_ptr);
/* Activate restriction */
- if ((current_floor_ptr->dun_level > 49) && one_in_(5))
+ if ((p_ptr->current_floor_ptr->dun_level > 49) && one_in_(5))
get_obj_num_hook = kind_is_good_book;
else
get_obj_num_hook = kind_is_book;
do
{
scatter(&wy, &wx, y, x, 20, 0);
- } while (!(in_bounds(current_floor_ptr, wy, wx) && cave_empty_bold2(wy, wx)) && --attempts);
+ } while (!(in_bounds(p_ptr->current_floor_ptr, wy, wx) && cave_empty_bold2(wy, wx)) && --attempts);
if (attempts > 0)
{
/* Prepare to make a Can of Toys */
object_prep(q_ptr, lookup_kind(TV_CHEST, SV_CHEST_KANDUME));
- apply_magic(q_ptr, current_floor_ptr->object_level, AM_NO_FIXED_ART);
+ apply_magic(q_ptr, p_ptr->current_floor_ptr->object_level, AM_NO_FIXED_ART);
(void)drop_near(q_ptr, -1, y, x);
}
break;
switch (r_ptr->d_char)
{
case '(':
- if (current_floor_ptr->dun_level > 0)
+ if (p_ptr->current_floor_ptr->dun_level > 0)
{
q_ptr = &forge;
object_wipe(q_ptr);
break;
case '/':
- if (current_floor_ptr->dun_level > 4)
+ if (p_ptr->current_floor_ptr->dun_level > 4)
{
q_ptr = &forge;
object_wipe(q_ptr);
break;
case '[':
- if (current_floor_ptr->dun_level > 19)
+ if (p_ptr->current_floor_ptr->dun_level > 19)
{
q_ptr = &forge;
object_wipe(q_ptr);
break;
case '\\':
- if (current_floor_ptr->dun_level > 4)
+ if (p_ptr->current_floor_ptr->dun_level > 4)
{
q_ptr = &forge;
object_wipe(q_ptr);
/* Prepare to make a reward */
object_prep(q_ptr, k_idx);
- apply_magic(q_ptr, current_floor_ptr->object_level, AM_NO_FIXED_ART | AM_GOOD);
+ apply_magic(q_ptr, p_ptr->current_floor_ptr->object_level, AM_NO_FIXED_ART | AM_GOOD);
(void)drop_near(q_ptr, -1, y, x);
}
msg_format(_("あなたは%sを制覇した!", "You have conquered %s!"), d_name + d_info[p_ptr->dungeon_idx].name);
coin_type = force_coin;
/* Average dungeon and monster levels */
- current_floor_ptr->object_level = (current_floor_ptr->dun_level + r_ptr->level) / 2;
+ p_ptr->current_floor_ptr->object_level = (p_ptr->current_floor_ptr->dun_level + r_ptr->level) / 2;
/* Drop some objects */
for (j = 0; j < number; j++)
}
/* Reset the object level */
- current_floor_ptr->object_level = current_floor_ptr->base_level;
+ p_ptr->current_floor_ptr->object_level = p_ptr->current_floor_ptr->base_level;
/* Reset "coin" type */
coin_type = 0;
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))
void delete_monster(POSITION y, POSITION x)
{
grid_type *g_ptr;
- if (!in_bounds(current_floor_ptr, y, x)) return;
+ if (!in_bounds(p_ptr->current_floor_ptr, y, x)) return;
/* Check the grid */
- g_ptr = ¤t_floor_ptr->grid_array[y][x];
+ g_ptr = &p_ptr->current_floor_ptr->grid_array[y][x];
/* Delete the monster (if any) */
if (g_ptr->m_idx) delete_monster_idx(g_ptr->m_idx);
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 */
+ /* Update the p_ptr->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->inside_quest || is_fixed_quest_idx(p_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];
*/
void update_monster(MONSTER_IDX m_idx, bool full)
{
- 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];
bool do_disturb = disturb_move;
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);
}
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);
{
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;
}
*/
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(current_floor_ptr, 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;
/* 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;
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)
{
for (ny = y - max_dist; ny <= y + max_dist; ny++)
{
/* Ignore annoying locations */
- if (!in_bounds(current_floor_ptr, 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;
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);
}
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];
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);
- (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(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 (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);
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)
*/
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(current_floor_ptr, 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;
get_mon_num_prep(vault_aux_simple, NULL);
/* Pick a race to clone */
- vault_aux_race = get_mon_num(current_floor_ptr->dun_level + 10);
+ vault_aux_race = get_mon_num(p_ptr->current_floor_ptr->dun_level + 10);
/* Remove the monster restriction */
get_mon_num_prep(NULL, NULL);
get_mon_num_prep(vault_aux_simple, NULL);
/* Pick a race to clone */
- r_idx = get_mon_num(current_floor_ptr->dun_level + 10);
+ r_idx = get_mon_num(p_ptr->current_floor_ptr->dun_level + 10);
/* Remove the monster restriction */
get_mon_num_prep(NULL, NULL);
*/
static void remove_bad_spells(MONSTER_IDX m_idx, u32b *f4p, u32b *f5p, u32b *f6p)
{
- 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];
u32b f4 = (*f4p);
for (x = x1 - 2; x <= x1 + 2; x++)
{
/* Ignore illegal locations */
- if (!in_bounds(current_floor_ptr, y, x)) continue;
+ if (!in_bounds(p_ptr->current_floor_ptr, y, x)) continue;
/* Only check a circular area */
if (distance(y1, x1, y, x)>2) continue;
if (!los(y, x, yy, xx)) continue;
if (!projectable(y, x, yy, xx)) continue;
- g_ptr = ¤t_floor_ptr->grid_array[yy][xx];
+ g_ptr = &p_ptr->current_floor_ptr->grid_array[yy][xx];
/* Scan the pile of objects */
for (this_o_idx = g_ptr->o_idx; this_o_idx; this_o_idx = next_o_idx)
{
- object_type *o_ptr = ¤t_floor_ptr->o_list[this_o_idx];
+ object_type *o_ptr = &p_ptr->current_floor_ptr->o_list[this_o_idx];
next_o_idx = o_ptr->next_o_idx;
/* Known to be worthless? */
y = GRID_Y(grid_g[i]);
x = GRID_X(grid_g[i]);
- if ((current_floor_ptr->grid_array[y][x].m_idx > 0) && !((y == y2) && (x == x2)))
+ if ((p_ptr->current_floor_ptr->grid_array[y][x].m_idx > 0) && !((y == y2) && (x == x2)))
{
- monster_type *m_ptr = ¤t_floor_ptr->m_list[current_floor_ptr->grid_array[y][x].m_idx];
+ monster_type *m_ptr = &p_ptr->current_floor_ptr->m_list[p_ptr->current_floor_ptr->grid_array[y][x].m_idx];
if (is_friend == is_pet(m_ptr))
{
return (FALSE);
*/
void breath(POSITION y, POSITION x, MONSTER_IDX m_idx, EFFECT_ID typ, int dam_hp, POSITION rad, bool breath, int monspell, int target_type)
{
- 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];
bool learnable = spell_learnable(m_idx);
BIT_FLAGS flg = 0x00;
*/
bool dispel_check(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];
monster_race *r_ptr = &r_info[m_ptr->r_idx];
/* Invulnabilty (including the song) */
/* Light speed */
if (p_ptr->lightspeed && (m_ptr->mspeed < 136)) return (TRUE);
- if (p_ptr->riding && (current_floor_ptr->m_list[p_ptr->riding].mspeed < 135))
+ if (p_ptr->riding && (p_ptr->current_floor_ptr->m_list[p_ptr->riding].mspeed < 135))
{
- if (MON_FAST(¤t_floor_ptr->m_list[p_ptr->riding])) return (TRUE);
+ if (MON_FAST(&p_ptr->current_floor_ptr->m_list[p_ptr->riding])) return (TRUE);
}
/* No need to cast dispel spell */
*/
static int choose_attack_spell(MONSTER_IDX m_idx, byte spells[], byte num)
{
- 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];
byte escape[96], escape_num = 0;
grid_type *g_ptr;
/* Access the next grid */
- g_ptr = ¤t_floor_ptr->grid_array[next_y][next_x];
+ g_ptr = &p_ptr->current_floor_ptr->grid_array[next_y][next_x];
/* Skip this feature */
if (!cave_have_flag_grid(g_ptr, f_flag)) continue;
PERCENTAGE failrate;
byte spell[96], num = 0;
BIT_FLAGS f4, f5, f6;
- 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];
#ifndef JP
/* Check "projectable" */
bool direct;
- bool in_no_magic_dungeon = (d_info[p_ptr->dungeon_idx].flags1 & DF1_NO_MAGIC) && current_floor_ptr->dun_level
+ bool in_no_magic_dungeon = (d_info[p_ptr->dungeon_idx].flags1 & DF1_NO_MAGIC) && p_ptr->current_floor_ptr->dun_level
&& (!p_ptr->inside_quest || is_fixed_quest_idx(p_ptr->inside_quest));
bool can_use_lite_area = FALSE;
if (los(m_ptr->fy, m_ptr->fx, y_br_lite, x_br_lite))
{
- feature_type *f_ptr = &f_info[current_floor_ptr->grid_array[y_br_lite][x_br_lite].feat];
+ feature_type *f_ptr = &f_info[p_ptr->current_floor_ptr->grid_array[y_br_lite][x_br_lite].feat];
if (!have_flag(f_ptr->flags, FF_LOS))
{
/* Check path */
if (projectable(m_ptr->fy, m_ptr->fx, y, x))
{
- feature_type *f_ptr = &f_info[current_floor_ptr->grid_array[y][x].feat];
+ feature_type *f_ptr = &f_info[p_ptr->current_floor_ptr->grid_array[y][x].feat];
if (!have_flag(f_ptr->flags, FF_PROJECT))
{
if (y == y2 && x == x2)
hit2 = TRUE;
- else if (is_friend && current_floor_ptr->grid_array[y][x].m_idx > 0 &&
- !are_enemies(m_ptr, ¤t_floor_ptr->m_list[current_floor_ptr->grid_array[y][x].m_idx]))
+ else if (is_friend && p_ptr->current_floor_ptr->grid_array[y][x].m_idx > 0 &&
+ !are_enemies(m_ptr, &p_ptr->current_floor_ptr->m_list[p_ptr->current_floor_ptr->grid_array[y][x].m_idx]))
{
/* Friends don't shoot friends */
return FALSE;
*/
static bool dispel_check_monster(MONSTER_IDX m_idx, MONSTER_IDX t_idx)
{
- monster_type *t_ptr = ¤t_floor_ptr->m_list[t_idx];
+ monster_type *t_ptr = &p_ptr->current_floor_ptr->m_list[t_idx];
if (MON_INVULNER(t_ptr)) return TRUE;
char m_poss[160];
#endif
- 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_type *t_ptr = NULL;
monster_race *r_ptr = &r_info[m_ptr->r_idx];
bool maneable = player_has_los_bold(m_ptr->fy, m_ptr->fx);
bool pet = is_pet(m_ptr);
- bool in_no_magic_dungeon = (d_info[p_ptr->dungeon_idx].flags1 & DF1_NO_MAGIC) && current_floor_ptr->dun_level
+ bool in_no_magic_dungeon = (d_info[p_ptr->dungeon_idx].flags1 & DF1_NO_MAGIC) && p_ptr->current_floor_ptr->dun_level
&& (!p_ptr->inside_quest || is_fixed_quest_idx(p_ptr->inside_quest));
bool can_use_lite_area = FALSE;
if (p_ptr->pet_t_m_idx && pet)
{
target_idx = p_ptr->pet_t_m_idx;
- t_ptr = ¤t_floor_ptr->m_list[target_idx];
+ t_ptr = &p_ptr->current_floor_ptr->m_list[target_idx];
/* Cancel if not projectable (for now) */
if ((m_idx == target_idx) || !projectable(m_ptr->fy, m_ptr->fx, t_ptr->fy, t_ptr->fx))
/* Is there counter attack target? */
if (!target_idx && m_ptr->target_y)
{
- target_idx = current_floor_ptr->grid_array[m_ptr->target_y][m_ptr->target_x].m_idx;
+ target_idx = p_ptr->current_floor_ptr->grid_array[m_ptr->target_y][m_ptr->target_x].m_idx;
if (target_idx)
{
- t_ptr = ¤t_floor_ptr->m_list[target_idx];
+ t_ptr = &p_ptr->current_floor_ptr->m_list[target_idx];
/* Cancel if neither enemy nor a given target */
if ((m_idx == target_idx) ||
if (p_ptr->phase_out)
{
- start = randint1(current_floor_ptr->m_max-1) + current_floor_ptr->m_max;
+ start = randint1(p_ptr->current_floor_ptr->m_max-1) + p_ptr->current_floor_ptr->m_max;
if (randint0(2)) plus = -1;
}
- else start = current_floor_ptr->m_max + 1;
+ else start = p_ptr->current_floor_ptr->m_max + 1;
/* Scan thru all monsters */
- for (i = start; ((i < start + current_floor_ptr->m_max) && (i > start - current_floor_ptr->m_max)); i += plus)
+ for (i = start; ((i < start + p_ptr->current_floor_ptr->m_max) && (i > start - p_ptr->current_floor_ptr->m_max)); i += plus)
{
- MONSTER_IDX dummy = (i % current_floor_ptr->m_max);
+ MONSTER_IDX dummy = (i % p_ptr->current_floor_ptr->m_max);
if (!dummy) continue;
target_idx = dummy;
- t_ptr = ¤t_floor_ptr->m_list[target_idx];
+ t_ptr = &p_ptr->current_floor_ptr->m_list[target_idx];
if (!monster_is_valid(t_ptr)) continue;
MONSTER_IDX m_idx;
if (!target_set(TARGET_KILL)) return FALSE;
- m_idx = current_floor_ptr->grid_array[target_row][target_col].m_idx;
+ m_idx = p_ptr->current_floor_ptr->grid_array[target_row][target_col].m_idx;
if (!m_idx) break;
if (!player_has_los_bold(target_row, target_col)) break;
if (!projectable(p_ptr->y, p_ptr->x, target_row, target_col)) break;
GAME_TEXT m_name[MAX_NLEN];
if (!target_set(TARGET_KILL)) return FALSE;
- if (!current_floor_ptr->grid_array[target_row][target_col].m_idx) break;
+ if (!p_ptr->current_floor_ptr->grid_array[target_row][target_col].m_idx) break;
if (!player_has_los_bold(target_row, target_col)) break;
if (!projectable(p_ptr->y, p_ptr->x, target_row, target_col)) break;
- m_ptr = ¤t_floor_ptr->m_list[current_floor_ptr->grid_array[target_row][target_col].m_idx];
+ m_ptr = &p_ptr->current_floor_ptr->m_list[p_ptr->current_floor_ptr->grid_array[target_row][target_col].m_idx];
r_ptr = &r_info[m_ptr->r_idx];
monster_desc(m_name, m_ptr, 0);
if (r_ptr->flagsr & RFR_RES_TELE)
}
}
msg_format(_("%sを引き戻した。", "You command %s to return."), m_name);
- teleport_monster_to(current_floor_ptr->grid_array[target_row][target_col].m_idx, p_ptr->y, p_ptr->x, 100, TELEPORT_PASSIVE);
+ teleport_monster_to(p_ptr->current_floor_ptr->grid_array[target_row][target_col].m_idx, p_ptr->y, p_ptr->x, 100, TELEPORT_PASSIVE);
break;
}
case MS_TELE_AWAY:
*/
bool monster_near_player(MONSTER_IDX m_idx, MONSTER_IDX t_idx)
{
- monster_type *m_ptr = ¤t_floor_ptr->m_list[m_idx];
- monster_type *t_ptr = ¤t_floor_ptr->m_list[t_idx];
+ monster_type *m_ptr = &p_ptr->current_floor_ptr->m_list[m_idx];
+ monster_type *t_ptr = &p_ptr->current_floor_ptr->m_list[t_idx];
return (m_ptr->cdis <= MAX_SIGHT) || (t_ptr->cdis <= MAX_SIGHT);
}
*/
bool see_monster(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];
return is_seen(m_ptr);
}
*/
bool spell_learnable(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];
/* Extract the "see-able-ness" */
bool seen = (!p_ptr->blind && m_ptr->ml);
BIT_FLAGS monster_u_mode(MONSTER_IDX m_idx)
{
BIT_FLAGS u_mode = 0L;
- monster_type *m_ptr = ¤t_floor_ptr->m_list[m_idx];
+ monster_type *m_ptr = &p_ptr->current_floor_ptr->m_list[m_idx];
bool pet = is_pet(m_ptr);
if (!pet) u_mode |= PM_ALLOW_UNIQUE;
return u_mode;
}
if (mon_to_mon && known && !see_either)
- current_floor_ptr->monster_noise = TRUE;
+ p_ptr->current_floor_ptr->monster_noise = TRUE;
}
/*!
HIT_POINT dam, ms_type, drs_type = 0;
concptr type_s;
bool smart_learn_aux = TRUE;
- monster_type *m_ptr = ¤t_floor_ptr->m_list[m_idx];
+ monster_type *m_ptr = &p_ptr->current_floor_ptr->m_list[m_idx];
bool known = monster_near_player(m_idx, t_idx);
bool see_either = see_monster(m_idx) || see_monster(t_idx);
bool mon_to_mon = (TARGET_TYPE == MONSTER_TO_MONSTER);
}
if (mon_to_mon && known && !see_either)
- current_floor_ptr->monster_noise = TRUE;
+ p_ptr->current_floor_ptr->monster_noise = TRUE;
sound(SOUND_BREATH);
breath(y, x, m_idx, GF_TYPE, dam, 0, TRUE, ms_type, TARGET_TYPE);
HIT_POINT spell_RF5_BA_FIRE(POSITION y, POSITION x, MONSTER_IDX m_idx, MONSTER_IDX t_idx, int TARGET_TYPE)
{
HIT_POINT dam, rad;
- monster_type *m_ptr = ¤t_floor_ptr->m_list[m_idx];
+ monster_type *m_ptr = &p_ptr->current_floor_ptr->m_list[m_idx];
if (m_ptr->r_idx == MON_ROLENTO)
{
*/
HIT_POINT spell_RF5_MIND_BLAST(POSITION y, POSITION x, MONSTER_IDX m_idx, MONSTER_IDX t_idx, int TARGET_TYPE)
{
- monster_type *m_ptr = ¤t_floor_ptr->m_list[m_idx];
+ monster_type *m_ptr = &p_ptr->current_floor_ptr->m_list[m_idx];
bool seen = (!p_ptr->blind && m_ptr->ml);
HIT_POINT dam;
GAME_TEXT m_name[MAX_NLEN], t_name[MAX_NLEN];
*/
HIT_POINT spell_RF5_BRAIN_SMASH(POSITION y, POSITION x, MONSTER_IDX m_idx, MONSTER_IDX t_idx, int TARGET_TYPE)
{
- monster_type *m_ptr = ¤t_floor_ptr->m_list[m_idx];
+ monster_type *m_ptr = &p_ptr->current_floor_ptr->m_list[m_idx];
bool seen = (!p_ptr->blind && m_ptr->ml);
HIT_POINT dam;
GAME_TEXT m_name[MAX_NLEN], t_name[MAX_NLEN];
}
else
{
- current_floor_ptr->monster_noise = TRUE;
+ p_ptr->current_floor_ptr->monster_noise = TRUE;
}
}
breath(y, x, m_idx, GF_TYPE, dam, 0, FALSE, MS_TYPE, TARGET_TYPE);
}
else
{
- current_floor_ptr->monster_noise = TRUE;
+ p_ptr->current_floor_ptr->monster_noise = TRUE;
}
}
*/
void spell_RF5_SCARE(MONSTER_IDX m_idx, MONSTER_IDX t_idx, int TARGET_TYPE)
{
- monster_type *t_ptr = ¤t_floor_ptr->m_list[t_idx];
+ monster_type *t_ptr = &p_ptr->current_floor_ptr->m_list[t_idx];
monster_race *tr_ptr = &r_info[t_ptr->r_idx];
DEPTH rlev = monster_level_idx(m_idx);
bool resist, saving_throw;
*/
void spell_RF5_BLIND(MONSTER_IDX m_idx, MONSTER_IDX t_idx, int TARGET_TYPE)
{
- monster_type *t_ptr = ¤t_floor_ptr->m_list[t_idx];
+ monster_type *t_ptr = &p_ptr->current_floor_ptr->m_list[t_idx];
monster_race *tr_ptr = &r_info[t_ptr->r_idx];
DEPTH rlev = monster_level_idx(m_idx);
bool resist, saving_throw;
*/
void spell_RF5_CONF(MONSTER_IDX m_idx, MONSTER_IDX t_idx, int TARGET_TYPE)
{
- monster_type *t_ptr = ¤t_floor_ptr->m_list[t_idx];
+ monster_type *t_ptr = &p_ptr->current_floor_ptr->m_list[t_idx];
monster_race *tr_ptr = &r_info[t_ptr->r_idx];
DEPTH rlev = monster_level_idx(m_idx);
bool resist, saving_throw;
*/
void spell_RF5_SLOW(MONSTER_IDX m_idx, MONSTER_IDX t_idx, int TARGET_TYPE)
{
- monster_type *t_ptr = ¤t_floor_ptr->m_list[t_idx];
+ monster_type *t_ptr = &p_ptr->current_floor_ptr->m_list[t_idx];
monster_race *tr_ptr = &r_info[t_ptr->r_idx];
DEPTH rlev = monster_level_idx(m_idx);
bool resist, saving_throw;
*/
void spell_RF5_HOLD(MONSTER_IDX m_idx, MONSTER_IDX t_idx, int TARGET_TYPE)
{
- monster_type *t_ptr = ¤t_floor_ptr->m_list[t_idx];
+ monster_type *t_ptr = &p_ptr->current_floor_ptr->m_list[t_idx];
monster_race *tr_ptr = &r_info[t_ptr->r_idx];
DEPTH rlev = monster_level_idx(m_idx);
bool resist, saving_throw;
void spell_RF6_HASTE(MONSTER_IDX m_idx, MONSTER_IDX t_idx, int TARGET_TYPE)
{
bool see_m = see_monster(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];
GAME_TEXT m_name[MAX_NLEN];
monster_name(m_idx, m_name);
*/
void spell_RF6_HEAL(MONSTER_IDX m_idx, MONSTER_IDX t_idx, int TARGET_TYPE)
{
- monster_type *m_ptr = ¤t_floor_ptr->m_list[m_idx];
+ monster_type *m_ptr = &p_ptr->current_floor_ptr->m_list[m_idx];
DEPTH rlev = monster_level_idx(m_idx);
bool seen = (!p_ptr->blind && m_ptr->ml);
GAME_TEXT m_name[MAX_NLEN];
*/
void spell_RF6_INVULNER(MONSTER_IDX m_idx, MONSTER_IDX t_idx, int TARGET_TYPE)
{
- monster_type *m_ptr = ¤t_floor_ptr->m_list[m_idx];
+ monster_type *m_ptr = &p_ptr->current_floor_ptr->m_list[m_idx];
bool seen = (!p_ptr->blind && m_ptr->ml);
monspell_message_base(m_idx, t_idx,
*/
HIT_POINT spell_RF6_WORLD(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];
MONSTER_IDX who = 0;
GAME_TEXT m_name[MAX_NLEN];
monster_name(m_idx, m_name);
*/
HIT_POINT spell_RF6_SPECIAL_BANORLUPART(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];
HIT_POINT dummy_hp, dummy_maxhp;
MONSTER_IDX k;
POSITION dummy_y = m_ptr->fy;
if (p_ptr->inside_arena || p_ptr->phase_out || !summon_possible(m_ptr->fy, m_ptr->fx))
return -1;
- delete_monster_idx(current_floor_ptr->grid_array[m_ptr->fy][m_ptr->fx].m_idx);
+ delete_monster_idx(p_ptr->current_floor_ptr->grid_array[m_ptr->fy][m_ptr->fx].m_idx);
summon_named_creature(0, dummy_y, dummy_x, MON_BANOR, mode);
- current_floor_ptr->m_list[hack_m_idx_ii].hp = dummy_hp;
- current_floor_ptr->m_list[hack_m_idx_ii].maxhp = dummy_maxhp;
+ p_ptr->current_floor_ptr->m_list[hack_m_idx_ii].hp = dummy_hp;
+ p_ptr->current_floor_ptr->m_list[hack_m_idx_ii].maxhp = dummy_maxhp;
summon_named_creature(0, dummy_y, dummy_x, MON_LUPART, mode);
- current_floor_ptr->m_list[hack_m_idx_ii].hp = dummy_hp;
- current_floor_ptr->m_list[hack_m_idx_ii].maxhp = dummy_maxhp;
+ p_ptr->current_floor_ptr->m_list[hack_m_idx_ii].hp = dummy_hp;
+ p_ptr->current_floor_ptr->m_list[hack_m_idx_ii].maxhp = dummy_maxhp;
msg_print(_("『バーノール・ルパート』が分裂した!","Banor=Rupart splits in two person!"));
break;
if (!r_info[MON_BANOR].cur_num || !r_info[MON_LUPART].cur_num)
return -1;
- for (k = 1; k < current_floor_ptr->m_max; k++)
+ for (k = 1; k < p_ptr->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)
+ if (p_ptr->current_floor_ptr->m_list[k].r_idx == MON_BANOR || p_ptr->current_floor_ptr->m_list[k].r_idx == MON_LUPART)
{
- dummy_hp += current_floor_ptr->m_list[k].hp;
- dummy_maxhp += current_floor_ptr->m_list[k].maxhp;
- if (current_floor_ptr->m_list[k].r_idx != m_ptr->r_idx)
+ dummy_hp += p_ptr->current_floor_ptr->m_list[k].hp;
+ dummy_maxhp += p_ptr->current_floor_ptr->m_list[k].maxhp;
+ if (p_ptr->current_floor_ptr->m_list[k].r_idx != m_ptr->r_idx)
{
- dummy_y = current_floor_ptr->m_list[k].fy;
- dummy_x = current_floor_ptr->m_list[k].fx;
+ dummy_y = p_ptr->current_floor_ptr->m_list[k].fy;
+ dummy_x = p_ptr->current_floor_ptr->m_list[k].fx;
}
delete_monster_idx(k);
}
}
summon_named_creature(0, dummy_y, dummy_x, MON_BANORLUPART, mode);
- current_floor_ptr->m_list[hack_m_idx_ii].hp = dummy_hp;
- current_floor_ptr->m_list[hack_m_idx_ii].maxhp = dummy_maxhp;
+ p_ptr->current_floor_ptr->m_list[hack_m_idx_ii].hp = dummy_hp;
+ p_ptr->current_floor_ptr->m_list[hack_m_idx_ii].maxhp = dummy_maxhp;
msg_print(_("『バーノール』と『ルパート』が合体した!", "Banor and Rupart combine into one!"));
break;
HIT_POINT spell_RF6_SPECIAL_B(POSITION y, POSITION x, MONSTER_IDX m_idx, MONSTER_IDX t_idx, int TARGET_TYPE)
{
HIT_POINT dam = -1;
- monster_type *m_ptr = ¤t_floor_ptr->m_list[m_idx];
- monster_type *t_ptr = ¤t_floor_ptr->m_list[t_idx];
+ monster_type *m_ptr = &p_ptr->current_floor_ptr->m_list[m_idx];
+ monster_type *t_ptr = &p_ptr->current_floor_ptr->m_list[t_idx];
monster_race *tr_ptr = &r_info[t_ptr->r_idx];
bool monster_to_player = (TARGET_TYPE == MONSTER_TO_PLAYER);
bool monster_to_monster = (TARGET_TYPE == MONSTER_TO_MONSTER);
}
if(monster_to_player && p_ptr->riding)
- mon_take_hit_mon(p_ptr->riding, dam, &dead, &fear, extract_note_dies(real_r_idx(¤t_floor_ptr->m_list[p_ptr->riding])), m_idx);
+ mon_take_hit_mon(p_ptr->riding, dam, &dead, &fear, extract_note_dies(real_r_idx(&p_ptr->current_floor_ptr->m_list[p_ptr->riding])), m_idx);
if(monster_to_monster)
mon_take_hit_mon(t_idx, dam, &dead, &fear, extract_note_dies(real_r_idx(t_ptr)), m_idx);
*/
HIT_POINT spell_RF6_SPECIAL(POSITION y, POSITION x, MONSTER_IDX m_idx, MONSTER_IDX t_idx, int TARGET_TYPE)
{
- 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(p_ptr, TRUE, TRUE);
*/
void spell_RF6_TELE_TO(MONSTER_IDX m_idx, MONSTER_IDX t_idx, int TARGET_TYPE)
{
- monster_type *m_ptr = ¤t_floor_ptr->m_list[m_idx];
- monster_type *t_ptr = ¤t_floor_ptr->m_list[t_idx];
+ monster_type *m_ptr = &p_ptr->current_floor_ptr->m_list[m_idx];
+ monster_type *t_ptr = &p_ptr->current_floor_ptr->m_list[t_idx];
monster_race *tr_ptr = &r_info[t_ptr->r_idx];
simple_monspell_message(m_idx, t_idx,
*/
void spell_RF6_TELE_AWAY(MONSTER_IDX m_idx, MONSTER_IDX t_idx, int TARGET_TYPE)
{
- monster_type *t_ptr = ¤t_floor_ptr->m_list[t_idx];
+ monster_type *t_ptr = &p_ptr->current_floor_ptr->m_list[t_idx];
monster_race *tr_ptr = &r_info[t_ptr->r_idx];
simple_monspell_message(m_idx, t_idx,
*/
void spell_RF6_TELE_LEVEL(MONSTER_IDX m_idx, MONSTER_IDX t_idx, int TARGET_TYPE)
{
- monster_type *t_ptr = ¤t_floor_ptr->m_list[t_idx];
+ monster_type *t_ptr = &p_ptr->current_floor_ptr->m_list[t_idx];
monster_race *tr_ptr = &r_info[t_ptr->r_idx];
DEPTH rlev = monster_level_idx(m_idx);
bool resist, saving_throw;
*/
void spell_RF6_DARKNESS(POSITION y, POSITION x, MONSTER_IDX m_idx, MONSTER_IDX t_idx, int TARGET_TYPE)
{
- monster_type *m_ptr = ¤t_floor_ptr->m_list[m_idx];
- monster_type *t_ptr = ¤t_floor_ptr->m_list[t_idx];
+ monster_type *m_ptr = &p_ptr->current_floor_ptr->m_list[m_idx];
+ monster_type *t_ptr = &p_ptr->current_floor_ptr->m_list[t_idx];
monster_race *r_ptr = &r_info[m_ptr->r_idx];
bool can_use_lite_area = FALSE;
bool monster_to_monster = TARGET_TYPE == MONSTER_TO_MONSTER;
*/
void spell_RF6_RAISE_DEAD(MONSTER_IDX m_idx, MONSTER_IDX t_idx, int TARGET_TYPE)
{
- monster_type *m_ptr = ¤t_floor_ptr->m_list[m_idx];
+ monster_type *m_ptr = &p_ptr->current_floor_ptr->m_list[m_idx];
monspell_message(m_idx, t_idx,
_("%^sが何かをつぶやいた。", "%^s mumbles."),
bool see_either = see_monster(m_idx) || see_monster(t_idx);
bool mon_to_mon = (TARGET_TYPE == MONSTER_TO_MONSTER);
bool mon_to_player = (TARGET_TYPE == MONSTER_TO_PLAYER);
- 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];
DEPTH rlev = monster_level_idx(m_idx);
int count = 0;
}
if (mon_to_mon && known && !see_either)
- current_floor_ptr->monster_noise = TRUE;
+ p_ptr->current_floor_ptr->monster_noise = TRUE;
}
switch (m_ptr->r_idx)
msg_print(_("多くのものが間近に現れた音がする。", "You hear many things appear nearby."));
if (known && !see_monster(t_idx) && count && mon_to_mon)
- current_floor_ptr->monster_noise = TRUE;
+ p_ptr->current_floor_ptr->monster_noise = TRUE;
}
/*!
void spell_RF6_S_CYBER(POSITION y, POSITION x, MONSTER_IDX m_idx, MONSTER_IDX t_idx, int TARGET_TYPE)
{
int count = 0;
- monster_type *m_ptr = ¤t_floor_ptr->m_list[m_idx];
+ monster_type *m_ptr = &p_ptr->current_floor_ptr->m_list[m_idx];
DEPTH rlev = monster_level_idx(m_idx);
bool mon_to_mon = (TARGET_TYPE == MONSTER_TO_MONSTER);
bool mon_to_player = (TARGET_TYPE == MONSTER_TO_PLAYER);
msg_print(_("重厚な足音が近くで聞こえる。", "You hear heavy steps nearby."));
if (monster_near_player(m_idx, t_idx) && !see_monster(t_idx) && count && mon_to_mon)
- current_floor_ptr->monster_noise = TRUE;
+ p_ptr->current_floor_ptr->monster_noise = TRUE;
}
/*!
msg_print(_("何かが間近に現れた音がする。", "You hear something appear nearby."));
if (monster_near_player(m_idx, t_idx) && !see_monster(t_idx) && count && mon_to_mon)
- current_floor_ptr->monster_noise = TRUE;
+ p_ptr->current_floor_ptr->monster_noise = TRUE;
}
/*!
msg_print(_("多くのものが間近に現れた音がする。", "You hear many things appear nearby."));
if (monster_near_player(m_idx, t_idx) && !see_monster(t_idx) && count && mon_to_mon)
- current_floor_ptr->monster_noise = TRUE;
+ p_ptr->current_floor_ptr->monster_noise = TRUE;
}
/*!
msg_print(_("多くのものが間近に現れた音がする。", "You hear many things appear nearby."));
if (monster_near_player(m_idx, t_idx) && !see_monster(t_idx) && count && mon_to_mon)
- current_floor_ptr->monster_noise = TRUE;
+ p_ptr->current_floor_ptr->monster_noise = TRUE;
}
/*!
msg_print(_("多くのものが間近に現れた音がする。", "You hear many things appear nearby."));
if (monster_near_player(m_idx, t_idx) && !see_monster(t_idx) && count && mon_to_mon)
- current_floor_ptr->monster_noise = TRUE;
+ p_ptr->current_floor_ptr->monster_noise = TRUE;
}
/*!
msg_print(_("多くのものが間近に現れた音がする。", "You hear many things appear nearby."));
if (monster_near_player(m_idx, t_idx) && !see_monster(t_idx) && count && mon_to_mon)
- current_floor_ptr->monster_noise = TRUE;
+ p_ptr->current_floor_ptr->monster_noise = TRUE;
}
/*!
msg_print(_("多くのものが間近に現れた音がする。", "You hear many things appear nearby."));
if (monster_near_player(m_idx, t_idx) && !see_monster(t_idx) && count && mon_to_mon)
- current_floor_ptr->monster_noise = TRUE;
+ p_ptr->current_floor_ptr->monster_noise = TRUE;
}
/*!
{
int count = 0, k;
int num = 1;
- 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];
DEPTH rlev = monster_level_idx(m_idx);
bool mon_to_mon = (TARGET_TYPE == MONSTER_TO_MONSTER);
}
if (monster_near_player(m_idx, t_idx) && !see_monster(t_idx) && count && mon_to_mon)
- current_floor_ptr->monster_noise = TRUE;
+ p_ptr->current_floor_ptr->monster_noise = TRUE;
}
/*!
msg_print(_("何かが間近に現れた音がする。", "You hear something appear nearby."));
if (monster_near_player(m_idx, t_idx) && !see_monster(t_idx) && count && mon_to_mon)
- current_floor_ptr->monster_noise = TRUE;
+ p_ptr->current_floor_ptr->monster_noise = TRUE;
}
/*!
msg_print(_("何かが間近に現れた音がする。", "You hear something appear nearby."));
if (monster_near_player(m_idx, t_idx) && !see_monster(t_idx) && count && mon_to_mon)
- current_floor_ptr->monster_noise = TRUE;
+ p_ptr->current_floor_ptr->monster_noise = TRUE;
}
/*!
msg_print(_("何かが間近に現れた音がする。", "You hear something appear nearby."));
if (monster_near_player(m_idx, t_idx) && !see_monster(t_idx) && count && mon_to_mon)
- current_floor_ptr->monster_noise = TRUE;
+ p_ptr->current_floor_ptr->monster_noise = TRUE;
}
/*!
{
bool mon_to_mon = (TARGET_TYPE == MONSTER_TO_MONSTER);
bool mon_to_player = (TARGET_TYPE == MONSTER_TO_PLAYER);
- monster_type *m_ptr = ¤t_floor_ptr->m_list[m_idx];
+ monster_type *m_ptr = &p_ptr->current_floor_ptr->m_list[m_idx];
DEPTH rlev = monster_level_idx(m_idx);
int k, count = 0;
GAME_TEXT m_name[MAX_NLEN];
}
if (monster_near_player(m_idx, t_idx) && !see_monster(t_idx) && count && mon_to_mon)
- current_floor_ptr->monster_noise = TRUE;
+ p_ptr->current_floor_ptr->monster_noise = TRUE;
}
/*!
}
if (monster_near_player(m_idx, t_idx) && !see_monster(t_idx) && count && mon_to_mon)
- current_floor_ptr->monster_noise = TRUE;
+ p_ptr->current_floor_ptr->monster_noise = TRUE;
}
/*!
}
if (monster_near_player(m_idx, t_idx) && !see_monster(t_idx) && count && mon_to_mon)
- current_floor_ptr->monster_noise = TRUE;
+ p_ptr->current_floor_ptr->monster_noise = TRUE;
}
/*!
void spell_RF6_S_UNIQUE(POSITION y, POSITION x, MONSTER_IDX m_idx, MONSTER_IDX t_idx, int TARGET_TYPE)
{
int count = 0, k;
- monster_type *m_ptr = ¤t_floor_ptr->m_list[m_idx];
+ monster_type *m_ptr = &p_ptr->current_floor_ptr->m_list[m_idx];
DEPTH rlev = monster_level_idx(m_idx);
bool mon_to_mon = (TARGET_TYPE == MONSTER_TO_MONSTER);
bool mon_to_player = (TARGET_TYPE == MONSTER_TO_PLAYER);
}
if (monster_near_player(m_idx, t_idx) && !see_monster(t_idx) && count && mon_to_mon)
- current_floor_ptr->monster_noise = TRUE;
+ p_ptr->current_floor_ptr->monster_noise = TRUE;
}
*/
HIT_POINT monspell_damage(int SPELL_NUM, MONSTER_IDX m_idx, int TYPE)
{
- 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];
int hp;
DEPTH rlev = monster_level_idx(m_idx);
case MUT1_STERILITY:
msg_print(_("突然頭が痛くなった!", "You suddenly have a headache!"));
take_hit(p_ptr, DAMAGE_LOSELIFE, randint1(17) + 17, _("禁欲を強いた疲労", "the strain of forcing abstinence"), -1);
- current_floor_ptr->num_repro += MAX_REPRO;
+ p_ptr->current_floor_ptr->num_repro += MAX_REPRO;
break;
case MUT1_PANIC_HIT:
if (!get_direction(&dir, FALSE, FALSE)) return FALSE;
y = creature_ptr->y + ddy[dir];
x = creature_ptr->x + ddx[dir];
- g_ptr = ¤t_floor_ptr->grid_array[y][x];
+ g_ptr = &p_ptr->current_floor_ptr->grid_array[y][x];
if (!g_ptr->m_idx)
{
break;
}
- m_ptr = ¤t_floor_ptr->m_list[g_ptr->m_idx];
+ m_ptr = &p_ptr->current_floor_ptr->m_list[g_ptr->m_idx];
r_ptr = &r_info[m_ptr->r_idx];
if ((r_ptr->flags3 & RF3_EVIL) &&
if (!get_direction(&dir, FALSE, FALSE)) return FALSE;
y = creature_ptr->y + ddy[dir];
x = creature_ptr->x + ddx[dir];
- g_ptr = ¤t_floor_ptr->grid_array[y][x];
+ g_ptr = &p_ptr->current_floor_ptr->grid_array[y][x];
if (!g_ptr->m_idx)
{
msg_print(_("あなたは何もない場所で手を振った。", "You wave your hands in the air."));
OBJECT_IDX prev_o_idx = 0;
/* Object */
- j_ptr = ¤t_floor_ptr->o_list[o_idx];
+ j_ptr = &p_ptr->current_floor_ptr->o_list[o_idx];
if (OBJECT_IS_HELD_MONSTER(j_ptr))
{
monster_type *m_ptr;
- m_ptr = ¤t_floor_ptr->m_list[j_ptr->held_m_idx];
+ m_ptr = &p_ptr->current_floor_ptr->m_list[j_ptr->held_m_idx];
/* Scan all objects in the grid */
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;
if (this_o_idx == o_idx)
object_type *k_ptr;
/* Previous object */
- k_ptr = ¤t_floor_ptr->o_list[prev_o_idx];
+ k_ptr = &p_ptr->current_floor_ptr->o_list[prev_o_idx];
/* Remove from list */
k_ptr->next_o_idx = next_o_idx;
POSITION y = j_ptr->iy;
POSITION x = j_ptr->ix;
- g_ptr = ¤t_floor_ptr->grid_array[y][x];
+ g_ptr = &p_ptr->current_floor_ptr->grid_array[y][x];
/* Scan all objects in the grid */
for (this_o_idx = g_ptr->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;
if (this_o_idx == o_idx)
object_type *k_ptr;
/* Previous object */
- k_ptr = ¤t_floor_ptr->o_list[prev_o_idx];
+ k_ptr = &p_ptr->current_floor_ptr->o_list[prev_o_idx];
/* Remove from list */
k_ptr->next_o_idx = next_o_idx;
excise_object_idx(o_idx);
/* Object */
- j_ptr = ¤t_floor_ptr->o_list[o_idx];
+ j_ptr = &p_ptr->current_floor_ptr->o_list[o_idx];
/* Dungeon floor */
if (!OBJECT_IS_HELD_MONSTER(j_ptr))
object_wipe(j_ptr);
/* Count objects */
- current_floor_ptr->o_cnt--;
+ p_ptr->current_floor_ptr->o_cnt--;
}
OBJECT_IDX this_o_idx, next_o_idx = 0;
/* Refuse "illegal" locations */
- if (!in_bounds(current_floor_ptr, y, x)) return;
+ if (!in_bounds(p_ptr->current_floor_ptr, y, x)) return;
- g_ptr = ¤t_floor_ptr->grid_array[y][x];
+ g_ptr = &p_ptr->current_floor_ptr->grid_array[y][x];
/* Scan all objects in the grid */
for (this_o_idx = g_ptr->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;
object_wipe(o_ptr);
/* Count objects */
- current_floor_ptr->o_cnt--;
+ p_ptr->current_floor_ptr->o_cnt--;
}
/* Objects are gone */
if (i1 == i2) return;
/* Repair objects */
- for (i = 1; i < current_floor_ptr->o_max; i++)
+ for (i = 1; i < p_ptr->current_floor_ptr->o_max; i++)
{
- o_ptr = ¤t_floor_ptr->o_list[i];
+ o_ptr = &p_ptr->current_floor_ptr->o_list[i];
/* Skip "dead" objects */
if (!o_ptr->k_idx) continue;
o_ptr->next_o_idx = i2;
}
}
- o_ptr = ¤t_floor_ptr->o_list[i1];
+ o_ptr = &p_ptr->current_floor_ptr->o_list[i1];
if (OBJECT_IS_HELD_MONSTER(o_ptr))
{
monster_type *m_ptr;
- m_ptr = ¤t_floor_ptr->m_list[o_ptr->held_m_idx];
+ m_ptr = &p_ptr->current_floor_ptr->m_list[o_ptr->held_m_idx];
/* Repair monster */
if (m_ptr->hold_o_idx == i1)
x = o_ptr->ix;
/* Acquire grid */
- g_ptr = ¤t_floor_ptr->grid_array[y][x];
+ g_ptr = &p_ptr->current_floor_ptr->grid_array[y][x];
/* Repair grid */
if (g_ptr->o_idx == i1)
}
/* Structure copy */
- current_floor_ptr->o_list[i2] = current_floor_ptr->o_list[i1];
+ p_ptr->current_floor_ptr->o_list[i2] = p_ptr->current_floor_ptr->o_list[i1];
/* Wipe the hole */
object_wipe(o_ptr);
cur_dis = 5 * (20 - cnt);
/* Examine the objects */
- for (i = 1; i < current_floor_ptr->o_max; i++)
+ for (i = 1; i < p_ptr->current_floor_ptr->o_max; i++)
{
- o_ptr = ¤t_floor_ptr->o_list[i];
+ o_ptr = &p_ptr->current_floor_ptr->o_list[i];
if (!OBJECT_IS_VALID(o_ptr)) continue;
if (OBJECT_IS_HELD_MONSTER(o_ptr))
{
monster_type *m_ptr;
- m_ptr = ¤t_floor_ptr->m_list[o_ptr->held_m_idx];
+ m_ptr = &p_ptr->current_floor_ptr->m_list[o_ptr->held_m_idx];
y = m_ptr->fy;
x = m_ptr->fx;
/* Excise dead objects (backwards!) */
- for (i = current_floor_ptr->o_max - 1; i >= 1; i--)
+ for (i = p_ptr->current_floor_ptr->o_max - 1; i >= 1; i--)
{
- o_ptr = ¤t_floor_ptr->o_list[i];
+ o_ptr = &p_ptr->current_floor_ptr->o_list[i];
/* Skip real objects */
if (o_ptr->k_idx) continue;
/* Move last object into open hole */
- compact_objects_aux(current_floor_ptr->o_max - 1, i);
+ compact_objects_aux(p_ptr->current_floor_ptr->o_max - 1, i);
- /* Compress "current_floor_ptr->o_max" */
- current_floor_ptr->o_max--;
+ /* Compress "p_ptr->current_floor_ptr->o_max" */
+ p_ptr->current_floor_ptr->o_max--;
}
}
int i;
/* Delete the existing objects */
- for (i = 1; i < current_floor_ptr->o_max; i++)
+ for (i = 1; i < p_ptr->current_floor_ptr->o_max; i++)
{
- object_type *o_ptr = ¤t_floor_ptr->o_list[i];
+ object_type *o_ptr = &p_ptr->current_floor_ptr->o_list[i];
if (!OBJECT_IS_VALID(o_ptr)) continue;
if (OBJECT_IS_HELD_MONSTER(o_ptr))
{
monster_type *m_ptr;
- m_ptr = ¤t_floor_ptr->m_list[o_ptr->held_m_idx];
+ m_ptr = &p_ptr->current_floor_ptr->m_list[o_ptr->held_m_idx];
/* Hack -- see above */
m_ptr->hold_o_idx = 0;
POSITION x = o_ptr->ix;
/* Access grid */
- g_ptr = ¤t_floor_ptr->grid_array[y][x];
+ g_ptr = &p_ptr->current_floor_ptr->grid_array[y][x];
/* Hack -- see above */
g_ptr->o_idx = 0;
object_wipe(o_ptr);
}
- /* Reset "current_floor_ptr->o_max" */
- current_floor_ptr->o_max = 1;
+ /* Reset "p_ptr->current_floor_ptr->o_max" */
+ p_ptr->current_floor_ptr->o_max = 1;
- /* Reset "current_floor_ptr->o_cnt" */
- current_floor_ptr->o_cnt = 0;
+ /* Reset "p_ptr->current_floor_ptr->o_cnt" */
+ p_ptr->current_floor_ptr->o_cnt = 0;
}
OBJECT_IDX i;
/* Initial allocation */
- if (current_floor_ptr->o_max < current_floor_ptr->max_o_idx)
+ if (p_ptr->current_floor_ptr->o_max < current_world_ptr->max_o_idx)
{
/* Get next space */
- i = current_floor_ptr->o_max;
+ i = p_ptr->current_floor_ptr->o_max;
/* Expand object array */
- current_floor_ptr->o_max++;
+ p_ptr->current_floor_ptr->o_max++;
/* Count objects */
- current_floor_ptr->o_cnt++;
+ p_ptr->current_floor_ptr->o_cnt++;
/* Use this object */
return (i);
/* Recycle dead objects */
- for (i = 1; i < current_floor_ptr->o_max; i++)
+ for (i = 1; i < p_ptr->current_floor_ptr->o_max; i++)
{
object_type *o_ptr;
- o_ptr = ¤t_floor_ptr->o_list[i];
+ o_ptr = &p_ptr->current_floor_ptr->o_list[i];
/* Skip live objects */
if (o_ptr->k_idx) continue;
/* Count objects */
- current_floor_ptr->o_cnt++;
+ p_ptr->current_floor_ptr->o_cnt++;
/* Use this object */
return (i);
r_ptr = &r_info[i];
- check = (current_floor_ptr->dun_level < r_ptr->level) ? (r_ptr->level - current_floor_ptr->dun_level) : 0;
+ check = (p_ptr->current_floor_ptr->dun_level < r_ptr->level) ? (r_ptr->level - p_ptr->current_floor_ptr->dun_level) : 0;
/* Ignore dead monsters */
if (!r_ptr->rarity) continue;
/* Pick a random non-unique monster race */
while (1)
{
- i = get_mon_num(current_floor_ptr->dun_level);
+ i = get_mon_num(p_ptr->current_floor_ptr->dun_level);
r_ptr = &r_info[i];
- check = (current_floor_ptr->dun_level < r_ptr->level) ? (r_ptr->level - current_floor_ptr->dun_level) : 0;
+ check = (p_ptr->current_floor_ptr->dun_level < r_ptr->level) ? (r_ptr->level - p_ptr->current_floor_ptr->dun_level) : 0;
/* Ignore dead monsters */
if (!r_ptr->rarity) continue;
o_ptr->pval = randint1(obj_level);
if (o_ptr->sval == SV_CHEST_KANDUME) o_ptr->pval = 6;
- o_ptr->xtra3 = current_floor_ptr->dun_level + 5;
+ o_ptr->xtra3 = p_ptr->current_floor_ptr->dun_level + 5;
/* Never exceed "difficulty" of 55 to 59 */
if (o_ptr->pval > 55) o_ptr->pval = 55 + (byte)randint0(5);
* @return 生成に成功したらTRUEを返す。
* @details
* This routine plays nasty games to generate the "special artifacts".\n
- * This routine uses "current_floor_ptr->object_level" for the "generation level".\n
+ * This routine uses "p_ptr->current_floor_ptr->object_level" for the "generation level".\n
* We assume that the given object has been "wiped".\n
*/
bool make_object(object_type *j_ptr, BIT_FLAGS mode)
prob = ((mode & AM_GOOD) ? 10 : 1000);
/* Base level for the object */
- base = ((mode & AM_GOOD) ? (current_floor_ptr->object_level + 10) : current_floor_ptr->object_level);
+ base = ((mode & AM_GOOD) ? (p_ptr->current_floor_ptr->object_level + 10) : p_ptr->current_floor_ptr->object_level);
/* Generate a special object, or a normal object */
}
/* Apply magic (allow artifacts) */
- apply_magic(j_ptr, current_floor_ptr->object_level, mode);
+ apply_magic(j_ptr, p_ptr->current_floor_ptr->object_level, mode);
/* Hack -- generate multiple spikes/missiles */
switch (j_ptr->tval)
* @return 生成に成功したらTRUEを返す。
* @details
* This routine plays nasty games to generate the "special artifacts".\n
- * This routine uses "current_floor_ptr->object_level" for the "generation level".\n
+ * This routine uses "p_ptr->current_floor_ptr->object_level" for the "generation level".\n
* This routine requires a clean floor grid destination.\n
*/
void place_object(POSITION y, POSITION x, BIT_FLAGS mode)
OBJECT_IDX o_idx;
/* Acquire grid */
- grid_type *g_ptr = ¤t_floor_ptr->grid_array[y][x];
+ grid_type *g_ptr = &p_ptr->current_floor_ptr->grid_array[y][x];
object_type forge;
object_type *q_ptr;
/* Paranoia -- check bounds */
- if (!in_bounds(current_floor_ptr, y, x)) return;
+ if (!in_bounds(p_ptr->current_floor_ptr, y, x)) return;
/* Require floor space */
if (!cave_drop_bold(y, x)) return;
if (o_idx)
{
object_type *o_ptr;
- o_ptr = ¤t_floor_ptr->o_list[o_idx];
+ o_ptr = &p_ptr->current_floor_ptr->o_list[o_idx];
/* Structure Copy */
object_copy(o_ptr, q_ptr);
s32b base;
/* Hack -- Pick a Treasure variety */
- i = ((randint1(current_floor_ptr->object_level + 2) + 2) / 2) - 1;
+ i = ((randint1(p_ptr->current_floor_ptr->object_level + 2) + 2) / 2) - 1;
/* Apply "extra" magic */
if (one_in_(GREAT_OBJ))
{
- i += randint1(current_floor_ptr->object_level + 1);
+ i += randint1(p_ptr->current_floor_ptr->object_level + 1);
}
/* Hack -- Creeping Coins only generate "themselves" */
OBJECT_IDX o_idx;
/* Acquire grid */
- grid_type *g_ptr = ¤t_floor_ptr->grid_array[y][x];
+ grid_type *g_ptr = &p_ptr->current_floor_ptr->grid_array[y][x];
object_type forge;
object_type *q_ptr;
/* Paranoia -- check bounds */
- if (!in_bounds(current_floor_ptr, y, x)) return;
+ if (!in_bounds(p_ptr->current_floor_ptr, y, x)) return;
/* Require floor space */
if (!cave_drop_bold(y, x)) return;
if (o_idx)
{
object_type *o_ptr;
- o_ptr = ¤t_floor_ptr->o_list[o_idx];
+ o_ptr = &p_ptr->current_floor_ptr->o_list[o_idx];
object_copy(o_ptr, q_ptr);
/* Save location */
* @param x 配置したいフロアのX座標
* @return 生成に成功したらオブジェクトのIDを返す。
* @details
- * The initial location is assumed to be "in_bounds(current_floor_ptr, )".\n
+ * The initial location is assumed to be "in_bounds(p_ptr->current_floor_ptr, )".\n
*\n
* This function takes a parameter "chance". This is the percentage\n
* chance that the item will "disappear" instead of drop. If the object\n
ty = y + dy;
tx = x + dx;
- if (!in_bounds(current_floor_ptr, ty, tx)) continue;
+ if (!in_bounds(p_ptr->current_floor_ptr, ty, tx)) continue;
/* Require line of projection */
if (!projectable(y, x, ty, tx)) continue;
/* Obtain grid */
- g_ptr = ¤t_floor_ptr->grid_array[ty][tx];
+ g_ptr = &p_ptr->current_floor_ptr->grid_array[ty][tx];
/* Require floor space */
if (!cave_drop_bold(ty, tx)) continue;
for (this_o_idx = g_ptr->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;
/* Check for possible combination */
ty = rand_spread(by, 1);
tx = rand_spread(bx, 1);
- if (!in_bounds(current_floor_ptr, ty, tx)) continue;
+ if (!in_bounds(p_ptr->current_floor_ptr, ty, tx)) continue;
/* Bounce to that location */
by = ty;
{
int candidates = 0, pick;
- for (ty = 1; ty < current_floor_ptr->height - 1; ty++)
+ for (ty = 1; ty < p_ptr->current_floor_ptr->height - 1; ty++)
{
- for (tx = 1; tx < current_floor_ptr->width - 1; tx++)
+ for (tx = 1; tx < p_ptr->current_floor_ptr->width - 1; tx++)
{
/* A valid space found */
if (cave_drop_bold(ty, tx)) candidates++;
/* Choose a random one */
pick = randint1(candidates);
- for (ty = 1; ty < current_floor_ptr->height - 1; ty++)
+ for (ty = 1; ty < p_ptr->current_floor_ptr->height - 1; ty++)
{
- for (tx = 1; tx < current_floor_ptr->width - 1; tx++)
+ for (tx = 1; tx < p_ptr->current_floor_ptr->width - 1; tx++)
{
if (cave_drop_bold(ty, tx))
{
}
- g_ptr = ¤t_floor_ptr->grid_array[by][bx];
+ g_ptr = &p_ptr->current_floor_ptr->grid_array[by][bx];
/* Scan objects in that grid for combination */
for (this_o_idx = g_ptr->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;
/* Check for combination */
if (!done)
{
/* Structure copy */
- object_copy(¤t_floor_ptr->o_list[o_idx], j_ptr);
+ object_copy(&p_ptr->current_floor_ptr->o_list[o_idx], j_ptr);
/* Access new object */
- j_ptr = ¤t_floor_ptr->o_list[o_idx];
+ j_ptr = &p_ptr->current_floor_ptr->o_list[o_idx];
/* Locate */
j_ptr->iy = by;
*/
void floor_item_charges(INVENTORY_IDX item)
{
- object_type *o_ptr = ¤t_floor_ptr->o_list[item];
+ object_type *o_ptr = &p_ptr->current_floor_ptr->o_list[item];
/* Require staff/wand */
if ((o_ptr->tval != TV_STAFF) && (o_ptr->tval != TV_WAND)) return;
*/
void floor_item_describe(INVENTORY_IDX item)
{
- object_type *o_ptr = ¤t_floor_ptr->o_list[item];
+ object_type *o_ptr = &p_ptr->current_floor_ptr->o_list[item];
GAME_TEXT o_name[MAX_NLEN];
object_desc(o_name, o_ptr, 0);
*/
void floor_item_increase(INVENTORY_IDX item, ITEM_NUMBER num)
{
- object_type *o_ptr = ¤t_floor_ptr->o_list[item];
+ object_type *o_ptr = &p_ptr->current_floor_ptr->o_list[item];
/* Apply */
num += o_ptr->number;
*/
void floor_item_optimize(INVENTORY_IDX item)
{
- object_type *o_ptr = ¤t_floor_ptr->o_list[item];
+ object_type *o_ptr = &p_ptr->current_floor_ptr->o_list[item];
/* Paranoia -- be sure it exists */
if (!o_ptr->k_idx) return;
for (dummy = 0; dummy < randint1(5) + 1; dummy++)
{
- (void)summon_specific(0, creature_ptr->y, creature_ptr->x, current_floor_ptr->dun_level, 0, (PM_ALLOW_GROUP | PM_ALLOW_UNIQUE | PM_NO_PET));
+ (void)summon_specific(0, creature_ptr->y, creature_ptr->x, p_ptr->current_floor_ptr->dun_level, 0, (PM_ALLOW_GROUP | PM_ALLOW_UNIQUE | PM_NO_PET));
}
reward = _("モンスターを召喚された。", "summoning hostile monsters");
break;
msg_format(_("%sは褒美として悪魔の使いをよこした!", "%s rewards you with a demonic servant!"), chaos_patrons[creature_ptr->chaos_patron]);
- if (!summon_specific(-1, creature_ptr->y, creature_ptr->x, current_floor_ptr->dun_level, SUMMON_DEMON, PM_FORCE_PET))
+ if (!summon_specific(-1, creature_ptr->y, creature_ptr->x, p_ptr->current_floor_ptr->dun_level, SUMMON_DEMON, PM_FORCE_PET))
msg_print(_("何も現れなかった...", "Nobody ever turns up..."));
else
reward = _("悪魔がペットになった。", "a demonic servant");
case REW_SER_MONS:
msg_format(_("%sは褒美として使いをよこした!", "%s rewards you with a servant!"), chaos_patrons[creature_ptr->chaos_patron]);
- if (!summon_specific(-1, creature_ptr->y, creature_ptr->x, current_floor_ptr->dun_level, 0, PM_FORCE_PET))
+ if (!summon_specific(-1, creature_ptr->y, creature_ptr->x, p_ptr->current_floor_ptr->dun_level, 0, PM_FORCE_PET))
msg_print(_("何も現れなかった...", "Nobody ever turns up..."));
else
reward = _("モンスターがペットになった。", "a servant");
case REW_SER_UNDE:
msg_format(_("%sは褒美としてアンデッドの使いをよこした。", "%s rewards you with an undead servant!"), chaos_patrons[creature_ptr->chaos_patron]);
- if (!summon_specific(-1, creature_ptr->y, creature_ptr->x, current_floor_ptr->dun_level, SUMMON_UNDEAD, PM_FORCE_PET))
+ if (!summon_specific(-1, creature_ptr->y, creature_ptr->x, p_ptr->current_floor_ptr->dun_level, SUMMON_UNDEAD, PM_FORCE_PET))
msg_print(_("何も現れなかった...", "Nobody ever turns up..."));
else
reward = _("アンデッドがペットになった。", "an undead servant");
}
else
{
- QUEST_IDX q_idx = quest_number(current_floor_ptr->dun_level);
+ QUEST_IDX q_idx = quest_number(p_ptr->current_floor_ptr->dun_level);
bool seppuku = streq(hit_from, "Seppuku");
bool winning_seppuku = creature_ptr->total_winner && seppuku;
if (creature_ptr->inside_arena)
strcpy(buf, _("アリーナ", "in the Arena"));
- else if (!current_floor_ptr->dun_level)
+ else if (!p_ptr->current_floor_ptr->dun_level)
strcpy(buf, _("地上", "on the surface"));
else if (q_idx && (is_fixed_quest_idx(q_idx) &&
!((q_idx == QUEST_OBERON) || (q_idx == QUEST_SERPENT))))
strcpy(buf, _("クエスト", "in a quest"));
else
- sprintf(buf, _("%d階", "level %d"), (int)current_floor_ptr->dun_level);
+ sprintf(buf, _("%d階", "level %d"), (int)p_ptr->current_floor_ptr->dun_level);
sprintf(tmp, _("%sで%sに殺された。", "killed by %s %s."), buf, creature_ptr->died_from);
exe_write_diary(p_ptr, NIKKI_BUNSHOU, 0, tmp);
{
if (!(creature_ptr->special_defense & NINJA_S_STEALTH))
{
- if (current_floor_ptr->grid_array[creature_ptr->y][creature_ptr->x].info & CAVE_MNLT)
+ if (p_ptr->current_floor_ptr->grid_array[creature_ptr->y][creature_ptr->x].info & CAVE_MNLT)
{
msg_print(_("敵の目から薄い影の中に覆い隠された。", "You are mantled in weak shadow from ordinary eyes."));
creature_ptr->monlite = creature_ptr->old_monlite = TRUE;
/* Check every object in the grid */
for (i = 0; i < floor_num && i < 23; i++)
{
- object_type *o_ptr = ¤t_floor_ptr->o_list[floor_list[i]];
+ object_type *o_ptr = &p_ptr->current_floor_ptr->o_list[floor_list[i]];
/* Skip empty inscriptions */
if (!o_ptr->inscription) continue;
/* Check every object in the grid */
for (i = 0; i < floor_num && i < 23; i++)
{
- object_type *o_ptr = ¤t_floor_ptr->o_list[floor_list[i]];
+ object_type *o_ptr = &p_ptr->current_floor_ptr->o_list[floor_list[i]];
/* Skip empty inscriptions */
if (!o_ptr->inscription) continue;
/* Floor */
else
{
- o_ptr = ¤t_floor_ptr->o_list[0 - item];
+ o_ptr = &p_ptr->current_floor_ptr->o_list[0 - item];
}
object_desc(o_name, o_ptr, 0);
/* Floor */
else
{
- o_ptr = ¤t_floor_ptr->o_list[0 - item];
+ o_ptr = &p_ptr->current_floor_ptr->o_list[0 - item];
}
/* No inscription */
/* Special index */
k = 0 - (*cp);
- o_ptr = ¤t_floor_ptr->o_list[k];
+ o_ptr = &p_ptr->current_floor_ptr->o_list[k];
/* Validate the item */
if (item_tester_okay(o_ptr, tval) || (mode & USE_FULL))
if (floor)
{
/* Scan all objects in the grid */
- for (this_o_idx = current_floor_ptr->grid_array[p_ptr->y][p_ptr->x].o_idx; this_o_idx; this_o_idx = next_o_idx)
+ for (this_o_idx = p_ptr->current_floor_ptr->grid_array[p_ptr->y][p_ptr->x].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;
/* Accept the item on the floor if legal */
if (allow_floor)
{
/* Scan all objects in the grid */
- for (this_o_idx = current_floor_ptr->grid_array[p_ptr->y][p_ptr->x].o_idx; this_o_idx; this_o_idx = next_o_idx)
+ for (this_o_idx = p_ptr->current_floor_ptr->grid_array[p_ptr->y][p_ptr->x].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;
/* Validate the item */
if (!get_item(&item, q, s, option, tval)) return NULL;
if (idx) *idx = item;
if (item == INVEN_FORCE) return NULL;
- return REF_ITEM(creature_ptr, current_floor_ptr, item);
+ return REF_ITEM(creature_ptr, p_ptr->current_floor_ptr, item);
}
* @param mode オプションフラグ
* @return 対象のマスに落ちているアイテム数
* @details
- * Return a list of o_list[] indexes of items at the given current_floor_ptr->grid_array
+ * Return a list of o_list[] indexes of items at the given p_ptr->current_floor_ptr->grid_array
* location. Valid flags are:
*
* mode & 0x01 -- Item tester
ITEM_NUMBER num = 0;
/* Sanity */
- if (!in_bounds(current_floor_ptr, y, x)) return 0;
+ if (!in_bounds(p_ptr->current_floor_ptr, y, x)) return 0;
/* Scan all objects in the grid */
- for (this_o_idx = current_floor_ptr->grid_array[y][x].o_idx; this_o_idx; this_o_idx = next_o_idx)
+ for (this_o_idx = p_ptr->current_floor_ptr->grid_array[y][x].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;
/* Item tester */
/* Display the floor objects */
for (k = 0, i = 0; i < floor_num && i < 23; i++)
{
- o_ptr = ¤t_floor_ptr->o_list[floor_list[i]];
+ o_ptr = &p_ptr->current_floor_ptr->o_list[floor_list[i]];
object_desc(o_name, o_ptr, 0);
for (j = 0; j < k; j++)
{
m = floor_list[out_index[j]];
- o_ptr = ¤t_floor_ptr->o_list[m];
+ o_ptr = &p_ptr->current_floor_ptr->o_list[m];
/* Clear the line */
prt("", j + 1, col ? col - 2 : col);
}
/* Validate the item */
- else if (item_tester_okay(¤t_floor_ptr->o_list[0 - (*cp)], tval) || (mode & USE_FULL))
+ else if (item_tester_okay(&p_ptr->current_floor_ptr->o_list[0 - (*cp)], tval) || (mode & USE_FULL))
{
/* Forget restrictions */
tval = 0;
{
int i;
OBJECT_IDX o_idx;
- grid_type *g_ptr = ¤t_floor_ptr->grid_array[p_ptr->y][p_ptr->x];
+ grid_type *g_ptr = &p_ptr->current_floor_ptr->grid_array[p_ptr->y][p_ptr->x];
if (command_wrk != (USE_FLOOR)) break;
o_idx = g_ptr->o_idx;
/* Only rotate a pile of two or more objects. */
- if (!(o_idx && current_floor_ptr->o_list[o_idx].next_o_idx)) break;
+ if (!(o_idx && p_ptr->current_floor_ptr->o_list[o_idx].next_o_idx)) break;
/* Remove the first object from the list. */
excise_object_idx(o_idx);
/* Find end of the list. */
i = g_ptr->o_idx;
- while (current_floor_ptr->o_list[i].next_o_idx)
- i = current_floor_ptr->o_list[i].next_o_idx;
+ while (p_ptr->current_floor_ptr->o_list[i].next_o_idx)
+ i = p_ptr->current_floor_ptr->o_list[i].next_o_idx;
/* Add after the last object. */
- current_floor_ptr->o_list[i].next_o_idx = o_idx;
+ p_ptr->current_floor_ptr->o_list[i].next_o_idx = o_idx;
/* Re-scan floor list */
floor_num = scan_floor(floor_list, p_ptr->y, p_ptr->x, 0x03);
int can_pickup = 0;
/* Scan the pile of objects */
- for (this_o_idx = current_floor_ptr->grid_array[p_ptr->y][p_ptr->x].o_idx; this_o_idx; this_o_idx = next_o_idx)
+ for (this_o_idx = p_ptr->current_floor_ptr->grid_array[p_ptr->y][p_ptr->x].o_idx; this_o_idx; this_o_idx = next_o_idx)
{
/* Access the object */
- o_ptr = ¤t_floor_ptr->o_list[this_o_idx];
+ o_ptr = &p_ptr->current_floor_ptr->o_list[this_o_idx];
object_desc(o_name, o_ptr, 0);
if (floor_num == 1)
{
/* Access the object */
- o_ptr = ¤t_floor_ptr->o_list[floor_o_idx];
+ o_ptr = &p_ptr->current_floor_ptr->o_list[floor_o_idx];
#ifdef ALLOW_EASY_SENSE
if (floor_num == 1)
{
/* Access the object */
- o_ptr = ¤t_floor_ptr->o_list[floor_o_idx];
+ o_ptr = &p_ptr->current_floor_ptr->o_list[floor_o_idx];
#ifdef ALLOW_EASY_SENSE
char out_val[MAX_NLEN + 20];
/* Access the object */
- o_ptr = ¤t_floor_ptr->o_list[floor_o_idx];
+ o_ptr = &p_ptr->current_floor_ptr->o_list[floor_o_idx];
#ifdef ALLOW_EASY_SENSE
}
/* Access the object */
- o_ptr = ¤t_floor_ptr->o_list[floor_o_idx];
+ o_ptr = &p_ptr->current_floor_ptr->o_list[floor_o_idx];
#ifdef ALLOW_EASY_SENSE
{
OBJECT_IDX this_o_idx, next_o_idx = 0;
grid_type *g_ptr;
- g_ptr = ¤t_floor_ptr->grid_array[y][x];
+ g_ptr = &p_ptr->current_floor_ptr->grid_array[y][x];
/* Invisible trap */
if (g_ptr->mimic && is_trap(g_ptr->feat))
for (this_o_idx = g_ptr->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;
if (o_ptr->tval != TV_CHEST) continue;
if (!chest_traps[o_ptr->pval]) continue;
object_type *o_ptr;
- o_ptr = ¤t_floor_ptr->o_list[o_idx];
+ o_ptr = &p_ptr->current_floor_ptr->o_list[o_idx];
#ifdef JP
object_desc(old_name, o_ptr, OD_NAME_ONLY);
*/
void carry(bool pickup)
{
- grid_type *g_ptr = ¤t_floor_ptr->grid_array[p_ptr->y][p_ptr->x];
+ grid_type *g_ptr = &p_ptr->current_floor_ptr->grid_array[p_ptr->y][p_ptr->x];
OBJECT_IDX this_o_idx, next_o_idx = 0;
for (this_o_idx = g_ptr->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];
#ifdef ALLOW_EASY_SENSE /* TNB */
*/
bool pattern_seq(player_type *creature_ptr, POSITION c_y, POSITION c_x, POSITION n_y, POSITION n_x)
{
- feature_type *cur_f_ptr = &f_info[current_floor_ptr->grid_array[c_y][c_x].feat];
- feature_type *new_f_ptr = &f_info[current_floor_ptr->grid_array[n_y][n_x].feat];
+ feature_type *cur_f_ptr = &f_info[p_ptr->current_floor_ptr->grid_array[c_y][c_x].feat];
+ feature_type *new_f_ptr = &f_info[p_ptr->current_floor_ptr->grid_array[n_y][n_x].feat];
bool is_pattern_tile_cur = have_flag(cur_f_ptr->flags, FF_PATTERN);
bool is_pattern_tile_new = have_flag(new_f_ptr->flags, FF_PATTERN);
int pattern_type_cur, pattern_type_new;
{
POSITION oy = creature_ptr->y;
POSITION ox = creature_ptr->x;
- grid_type *g_ptr = ¤t_floor_ptr->grid_array[ny][nx];
- grid_type *oc_ptr = ¤t_floor_ptr->grid_array[oy][ox];
+ grid_type *g_ptr = &p_ptr->current_floor_ptr->grid_array[ny][nx];
+ grid_type *oc_ptr = &p_ptr->current_floor_ptr->grid_array[oy][ox];
feature_type *f_ptr = &f_info[g_ptr->feat];
feature_type *of_ptr = &f_info[oc_ptr->feat];
if (om_idx > 0) /* Monster on old spot (or creature_ptr->riding) */
{
- monster_type *om_ptr = ¤t_floor_ptr->m_list[om_idx];
+ monster_type *om_ptr = &p_ptr->current_floor_ptr->m_list[om_idx];
om_ptr->fy = ny;
om_ptr->fx = nx;
update_monster(om_idx, TRUE);
if (nm_idx > 0) /* Monster on new spot */
{
- monster_type *nm_ptr = ¤t_floor_ptr->m_list[nm_idx];
+ monster_type *nm_ptr = &p_ptr->current_floor_ptr->m_list[nm_idx];
nm_ptr->fy = oy;
nm_ptr->fx = ox;
update_monster(nm_idx, TRUE);
if ((!creature_ptr->blind && !no_lite()) || !is_trap(g_ptr->feat)) g_ptr->info &= ~(CAVE_UNSAFE);
/* For get everything when requested hehe I'm *NASTY* */
- if (current_floor_ptr->dun_level && (d_info[creature_ptr->dungeon_idx].flags1 & DF1_FORGET)) wiz_dark();
+ if (p_ptr->current_floor_ptr->dun_level && (d_info[creature_ptr->dungeon_idx].flags1 & DF1_FORGET)) wiz_dark();
if (mpe_mode & MPE_HANDLE_STUFF) handle_stuff();
if (creature_ptr->pclass == CLASS_NINJA)
leave_quest_check();
creature_ptr->inside_quest = g_ptr->special;
- current_floor_ptr->dun_level = 0;
+ p_ptr->current_floor_ptr->dun_level = 0;
creature_ptr->oldpx = 0;
creature_ptr->oldpy = 0;
POSITION x = creature_ptr->x + ddx[dir];
/* Examine the destination */
- grid_type *g_ptr = ¤t_floor_ptr->grid_array[y][x];
+ grid_type *g_ptr = &p_ptr->current_floor_ptr->grid_array[y][x];
feature_type *f_ptr = &f_info[g_ptr->feat];
monster_type *m_ptr;
- monster_type *riding_m_ptr = ¤t_floor_ptr->m_list[creature_ptr->riding];
+ monster_type *riding_m_ptr = &p_ptr->current_floor_ptr->m_list[creature_ptr->riding];
monster_race *riding_r_ptr = &r_info[creature_ptr->riding ? riding_m_ptr->r_idx : 0];
GAME_TEXT m_name[MAX_NLEN];
bool do_past = FALSE;
/* Exit the area */
- if (!current_floor_ptr->dun_level && !creature_ptr->wild_mode &&
+ if (!p_ptr->current_floor_ptr->dun_level && !creature_ptr->wild_mode &&
((x == 0) || (x == MAX_WID - 1) ||
(y == 0) || (y == MAX_HGT - 1)))
{
{
creature_ptr->wilderness_y--;
creature_ptr->wilderness_x--;
- creature_ptr->oldpy = current_floor_ptr->height - 2;
- creature_ptr->oldpx = current_floor_ptr->width - 2;
+ creature_ptr->oldpy = p_ptr->current_floor_ptr->height - 2;
+ creature_ptr->oldpx = p_ptr->current_floor_ptr->width - 2;
creature_ptr->ambush_flag = FALSE;
}
{
creature_ptr->wilderness_y--;
creature_ptr->wilderness_x++;
- creature_ptr->oldpy = current_floor_ptr->height - 2;
+ creature_ptr->oldpy = p_ptr->current_floor_ptr->height - 2;
creature_ptr->oldpx = 1;
creature_ptr->ambush_flag = FALSE;
}
creature_ptr->wilderness_y++;
creature_ptr->wilderness_x--;
creature_ptr->oldpy = 1;
- creature_ptr->oldpx = current_floor_ptr->width - 2;
+ creature_ptr->oldpx = p_ptr->current_floor_ptr->width - 2;
creature_ptr->ambush_flag = FALSE;
}
else if (y == 0)
{
creature_ptr->wilderness_y--;
- creature_ptr->oldpy = current_floor_ptr->height - 2;
+ creature_ptr->oldpy = p_ptr->current_floor_ptr->height - 2;
creature_ptr->oldpx = x;
creature_ptr->ambush_flag = FALSE;
}
else if (x == 0)
{
creature_ptr->wilderness_x--;
- creature_ptr->oldpx = current_floor_ptr->width - 2;
+ creature_ptr->oldpx = p_ptr->current_floor_ptr->width - 2;
creature_ptr->oldpy = y;
creature_ptr->ambush_flag = FALSE;
}
p_can_enter = FALSE;
}
- m_ptr = ¤t_floor_ptr->m_list[g_ptr->m_idx];
+ m_ptr = &p_ptr->current_floor_ptr->m_list[g_ptr->m_idx];
if (creature_ptr->inventory_list[INVEN_RARM].name1 == ART_STORMBRINGER) stormbringer = TRUE;
if (creature_ptr->inventory_list[INVEN_LARM].name1 == ART_STORMBRINGER) stormbringer = TRUE;
py_attack(p_ptr, y, x, 0);
oktomove = FALSE;
}
- else if (monster_can_cross_terrain(current_floor_ptr->grid_array[creature_ptr->y][creature_ptr->x].feat, r_ptr, 0))
+ else if (monster_can_cross_terrain(p_ptr->current_floor_ptr->grid_array[creature_ptr->y][creature_ptr->x].feat, r_ptr, 0))
{
do_past = TRUE;
}
}
else if (!have_flag(f_ptr->flags, FF_WATER) && (riding_r_ptr->flags7 & RF7_AQUATIC))
{
- msg_format(_("%sから上がれない。", "Can't land."), f_name + f_info[get_feat_mimic(¤t_floor_ptr->grid_array[creature_ptr->y][creature_ptr->x])].name);
+ msg_format(_("%sから上がれない。", "Can't land."), f_name + f_info[get_feat_mimic(&p_ptr->current_floor_ptr->grid_array[creature_ptr->y][creature_ptr->x])].name);
free_turn(creature_ptr);
oktomove = FALSE;
disturb(p_ptr, FALSE, TRUE);
if (!in_bounds2(y, x)) return (FALSE);
/* Access grid */
- g_ptr = ¤t_floor_ptr->grid_array[y][x];
+ g_ptr = &p_ptr->current_floor_ptr->grid_array[y][x];
/* Must be known to the player */
if (g_ptr->info & (CAVE_MARK))
if (!in_bounds2(y, x)) return (TRUE);
/* Memorized grids are always known */
- if (current_floor_ptr->grid_array[y][x].info & (CAVE_MARK)) return (FALSE);
+ if (p_ptr->current_floor_ptr->grid_array[y][x].info & (CAVE_MARK)) return (FALSE);
/* Viewable door/wall grids are known */
if (player_can_see_bold(y, x)) return (FALSE);
/* break run when leaving trap detected region */
if ((disturb_trap_detect || alert_trap_detect)
- && p_ptr->dtrap && !(current_floor_ptr->grid_array[p_ptr->y][p_ptr->x].info & CAVE_IN_DETECT))
+ && p_ptr->dtrap && !(p_ptr->current_floor_ptr->grid_array[p_ptr->y][p_ptr->x].info & CAVE_IN_DETECT))
{
/* No duplicate warning */
p_ptr->dtrap = FALSE;
/* You are just on the edge */
- if (!(current_floor_ptr->grid_array[p_ptr->y][p_ptr->x].info & CAVE_UNSAFE))
+ if (!(p_ptr->current_floor_ptr->grid_array[p_ptr->y][p_ptr->x].info & CAVE_UNSAFE))
{
if (alert_trap_detect)
{
col = p_ptr->x + ddx[new_dir];
/* Access grid */
- g_ptr = ¤t_floor_ptr->grid_array[row][col];
+ g_ptr = &p_ptr->current_floor_ptr->grid_array[row][col];
/* Feature code (applying "mimic" field) */
feat = get_feat_mimic(g_ptr);
/* Visible monsters abort running */
if (g_ptr->m_idx)
{
- monster_type *m_ptr = ¤t_floor_ptr->m_list[g_ptr->m_idx];
+ monster_type *m_ptr = &p_ptr->current_floor_ptr->m_list[g_ptr->m_idx];
/* Visible monster */
if (m_ptr->ml) return (TRUE);
for (this_o_idx = g_ptr->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;
/* Visible object */
/* break run when leaving trap detected region */
if ((disturb_trap_detect || alert_trap_detect)
- && p_ptr->dtrap && !(current_floor_ptr->grid_array[p_ptr->y][p_ptr->x].info & CAVE_IN_DETECT))
+ && p_ptr->dtrap && !(p_ptr->current_floor_ptr->grid_array[p_ptr->y][p_ptr->x].info & CAVE_IN_DETECT))
{
/* No duplicate warning */
p_ptr->dtrap = FALSE;
/* You are just on the edge */
- if (!(current_floor_ptr->grid_array[p_ptr->y][p_ptr->x].info & CAVE_UNSAFE))
+ if (!(p_ptr->current_floor_ptr->grid_array[p_ptr->y][p_ptr->x].info & CAVE_UNSAFE))
{
if (alert_trap_detect)
{
POSITION col = p_ptr->x + ddx[dir];
/* Access grid */
- g_ptr = ¤t_floor_ptr->grid_array[row][col];
+ g_ptr = &p_ptr->current_floor_ptr->grid_array[row][col];
/* Visible monsters abort running */
if (g_ptr->m_idx)
{
- monster_type *m_ptr = ¤t_floor_ptr->m_list[g_ptr->m_idx];
+ monster_type *m_ptr = &p_ptr->current_floor_ptr->m_list[g_ptr->m_idx];
/* Visible monster */
if (m_ptr->ml) return (0);
if (!new_dir) return (0);
/* Access newly move grid */
- g_ptr = ¤t_floor_ptr->grid_array[p_ptr->y+ddy[new_dir]][p_ptr->x+ddx[new_dir]];
+ g_ptr = &p_ptr->current_floor_ptr->grid_array[p_ptr->y+ddy[new_dir]][p_ptr->x+ddx[new_dir]];
/* Close door abort traveling */
if (!easy_open && is_closed_door(g_ptr->feat)) return (0);
{
POSITION x, y;
/* Check the entire dungeon / Forget the old data */
- for (y = 0; y < current_floor_ptr->height; y++)
+ for (y = 0; y < p_ptr->current_floor_ptr->height; y++)
{
- for (x = 0; x < current_floor_ptr->width; x++)
+ for (x = 0; x < p_ptr->current_floor_ptr->width; x++)
{
travel.cost[y][x] = MAX_SHORT;
*/
static int travel_flow_cost(POSITION y, POSITION x)
{
- feature_type *f_ptr = &f_info[current_floor_ptr->grid_array[y][x].feat];
+ feature_type *f_ptr = &f_info[p_ptr->current_floor_ptr->grid_array[y][x].feat];
int cost = 1;
/* Avoid obstacles (ex. trees) */
}
/* Detected traps and doors */
- if (current_floor_ptr->grid_array[y][x].info & (CAVE_MARK))
+ if (p_ptr->current_floor_ptr->grid_array[y][x].info & (CAVE_MARK))
{
if (have_flag(f_ptr->flags, FF_DOOR)) cost += 1;
if (have_flag(f_ptr->flags, FF_TRAP)) cost += 10;
*/
static void travel_flow_aux(POSITION y, POSITION x, int n, bool wall)
{
- grid_type *g_ptr = ¤t_floor_ptr->grid_array[y][x];
+ grid_type *g_ptr = &p_ptr->current_floor_ptr->grid_array[y][x];
feature_type *f_ptr = &f_info[g_ptr->feat];
int old_head = flow_head;
int add_cost = 1;
int cost;
/* Ignore out of bounds */
- if (!in_bounds(current_floor_ptr, y, x)) return;
+ if (!in_bounds(p_ptr->current_floor_ptr, y, x)) return;
/* Ignore unknown grid except in wilderness */
- if (current_floor_ptr->dun_level > 0 && !(g_ptr->info & CAVE_KNOWN)) return;
+ if (p_ptr->current_floor_ptr->dun_level > 0 && !(g_ptr->info & CAVE_KNOWN)) return;
/* Ignore "walls" and "rubble" (include "secret doors") */
if (have_flag(f_ptr->flags, FF_WALL) ||
have_flag(f_ptr->flags, FF_CAN_DIG) ||
- (have_flag(f_ptr->flags, FF_DOOR) && current_floor_ptr->grid_array[y][x].mimic) ||
+ (have_flag(f_ptr->flags, FF_DOOR) && p_ptr->current_floor_ptr->grid_array[y][x].mimic) ||
(!have_flag(f_ptr->flags, FF_MOVE) && have_flag(f_ptr->flags, FF_CAN_FLY) && !p_ptr->levitation))
{
if (!wall || !from_wall) return;
POSITION x, y;
DIRECTION d;
bool wall = FALSE;
- feature_type *f_ptr = &f_info[current_floor_ptr->grid_array[p_ptr->y][p_ptr->x].feat];
+ feature_type *f_ptr = &f_info[p_ptr->current_floor_ptr->grid_array[p_ptr->y][p_ptr->x].feat];
/* Reset the "queue" */
flow_head = flow_tail = 0;
return;
}
- f_ptr = &f_info[current_floor_ptr->grid_array[y][x].feat];
+ f_ptr = &f_info[p_ptr->current_floor_ptr->grid_array[y][x].feat];
- if ((current_floor_ptr->grid_array[y][x].info & CAVE_MARK) &&
+ if ((p_ptr->current_floor_ptr->grid_array[y][x].info & CAVE_MARK) &&
(have_flag(f_ptr->flags, FF_WALL) ||
have_flag(f_ptr->flags, FF_CAN_DIG) ||
- (have_flag(f_ptr->flags, FF_DOOR) && current_floor_ptr->grid_array[y][x].mimic)))
+ (have_flag(f_ptr->flags, FF_DOOR) && p_ptr->current_floor_ptr->grid_array[y][x].mimic)))
{
msg_print(_("そこには行くことができません!", "You cannot travel there!"));
return;
bool old_mighty_throw = creature_ptr->mighty_throw;
/* Current feature under player. */
- feature_type *f_ptr = &f_info[current_floor_ptr->grid_array[creature_ptr->y][creature_ptr->x].feat];
+ feature_type *f_ptr = &f_info[p_ptr->current_floor_ptr->grid_array[creature_ptr->y][creature_ptr->x].feat];
/* Save the old armor class */
ARMOUR_CLASS old_dis_ac = creature_ptr->dis_ac;
}
else
{
- monster_type *riding_m_ptr = ¤t_floor_ptr->m_list[creature_ptr->riding];
+ monster_type *riding_m_ptr = &p_ptr->current_floor_ptr->m_list[creature_ptr->riding];
monster_race *riding_r_ptr = &r_info[riding_m_ptr->r_idx];
SPEED speed = riding_m_ptr->mspeed;
}
else
{
- penalty = r_info[current_floor_ptr->m_list[creature_ptr->riding].r_idx].level - creature_ptr->skill_exp[GINOU_RIDING] / 80;
+ penalty = r_info[p_ptr->current_floor_ptr->m_list[creature_ptr->riding].r_idx].level - creature_ptr->skill_exp[GINOU_RIDING] / 80;
penalty += 30;
if (penalty < 30) penalty = 30;
}
}
else
{
- penalty = r_info[current_floor_ptr->m_list[creature_ptr->riding].r_idx].level - creature_ptr->skill_exp[GINOU_RIDING] / 80;
+ penalty = r_info[p_ptr->current_floor_ptr->m_list[creature_ptr->riding].r_idx].level - creature_ptr->skill_exp[GINOU_RIDING] / 80;
penalty += 30;
if (penalty < 30) penalty = 30;
}
if ((creature_ptr->inventory_list[i].tval == TV_CRAFT_BOOK) && (creature_ptr->inventory_list[i].sval == 2)) have_kabe = TRUE;
}
- for (this_o_idx = current_floor_ptr->grid_array[creature_ptr->y][creature_ptr->x].o_idx; this_o_idx; this_o_idx = next_o_idx)
+ for (this_o_idx = p_ptr->current_floor_ptr->grid_array[creature_ptr->y][creature_ptr->x].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;
#if 0
creature_ptr->align = 0;
int i, j, neutral[2];
- for (m_idx = current_floor_ptr->m_max - 1; m_idx >= 1; m_idx--)
+ for (m_idx = p_ptr->current_floor_ptr->m_max - 1; m_idx >= 1; m_idx--)
{
monster_type *m_ptr;
monster_race *r_ptr;
- m_ptr = ¤t_floor_ptr->m_list[m_idx];
+ m_ptr = &p_ptr->current_floor_ptr->m_list[m_idx];
if (!monster_is_valid(m_ptr)) continue;
r_ptr = &r_info[m_ptr->r_idx];
if (creature_ptr->update & (PU_UN_LITE))
{
creature_ptr->update &= ~(PU_UN_LITE);
- forget_lite(current_floor_ptr);
+ forget_lite(p_ptr->current_floor_ptr);
}
if (creature_ptr->update & (PU_UN_VIEW))
if (creature_ptr->update & (PU_VIEW))
{
creature_ptr->update &= ~(PU_VIEW);
- update_view(creature_ptr, current_floor_ptr);
+ update_view(creature_ptr, p_ptr->current_floor_ptr);
}
if (creature_ptr->update & (PU_LITE))
if (creature_ptr->update & (PU_MON_LITE))
{
creature_ptr->update &= ~(PU_MON_LITE);
- update_mon_lite(current_floor_ptr);
+ update_mon_lite(p_ptr->current_floor_ptr);
}
/*
if (o_ptr->k_idx && check_book_realm(o_ptr->tval, o_ptr->sval)) return FALSE;
}
- for (i = current_floor_ptr->grid_array[creature_ptr->y][creature_ptr->x].o_idx; i; i = o_ptr->next_o_idx)
+ for (i = p_ptr->current_floor_ptr->grid_array[creature_ptr->y][creature_ptr->x].o_idx; i; i = o_ptr->next_o_idx)
{
- o_ptr = ¤t_floor_ptr->o_list[i];
+ o_ptr = &p_ptr->current_floor_ptr->o_list[i];
if (o_ptr->k_idx && (o_ptr->marked & OM_FOUND) && check_book_realm(o_ptr->tval, o_ptr->sval)) return FALSE;
}
bool player_place(player_type *creature_ptr, POSITION y, POSITION x)
{
/* Paranoia XXX XXX */
- if (current_floor_ptr->grid_array[y][x].m_idx != 0) return FALSE;
+ if (p_ptr->current_floor_ptr->grid_array[y][x].m_idx != 0) return FALSE;
/* Save player location */
creature_ptr->y = y;
{
int to_ruin = 0;
POSITION r_y, r_x;
- int pattern_type = f_info[current_floor_ptr->grid_array[creature_ptr->y][creature_ptr->x].feat].subtype;
+ int pattern_type = f_info[p_ptr->current_floor_ptr->grid_array[creature_ptr->y][creature_ptr->x].feat].subtype;
if (pattern_type == PATTERN_TILE_WRECKED)
{
scatter(&r_y, &r_x, creature_ptr->y, creature_ptr->x, 4, 0);
if (pattern_tile(r_y, r_x) &&
- (f_info[current_floor_ptr->grid_array[r_y][r_x].feat].subtype != PATTERN_TILE_WRECKED))
+ (f_info[p_ptr->current_floor_ptr->grid_array[r_y][r_x].feat].subtype != PATTERN_TILE_WRECKED))
{
cave_set_feat(r_y, r_x, feat_pattern_corrupted);
}
/* Hack -- Prevent starvation */
(void)set_food(creature_ptr, PY_FOOD_MAX - 1);
- current_floor_ptr->dun_level = 0;
+ p_ptr->current_floor_ptr->dun_level = 0;
creature_ptr->inside_arena = FALSE;
creature_ptr->phase_out = FALSE;
leaving_quest = 0;
#pragma once
+#include "floor.h"
+
/*
* Most of the "player" information goes here.
*
extern const concptr stat_names_reduced[6];
typedef struct player_type player_type;
+struct floor_type;
struct player_type
{
int player_euid;
int player_egid;
+ floor_type *current_floor_ptr;
POSITION oldpy; /* Previous player location -KMW- */
POSITION oldpx; /* Previous player location -KMW- */
continue;
/* Quest is not on this level */
- if ((q_ptr->level != current_floor_ptr->dun_level) &&
+ if ((q_ptr->level != p_ptr->current_floor_ptr->dun_level) &&
(q_ptr->type != QUEST_TYPE_KILL_ANY_LEVEL))
continue;
{
if (!is_hostile(m_ptr)) break;
- if (count_all_hostile_monsters(current_floor_ptr) == 1)
+ if (count_all_hostile_monsters(p_ptr->current_floor_ptr) == 1)
{
if (q_ptr->flags & QUEST_FLAG_SILENT)
{
{
if (!is_hostile(m_ptr)) break;
- if (count_all_hostile_monsters(current_floor_ptr) == 1)
+ if (count_all_hostile_monsters(p_ptr->current_floor_ptr) == 1)
{
q_ptr->status = QUEST_STATUS_STAGE_COMPLETED;
POSITION ny, nx;
/* Stagger around */
- while (cave_perma_bold(y, x) || current_floor_ptr->grid_array[y][x].o_idx || (current_floor_ptr->grid_array[y][x].info & CAVE_OBJECT))
+ while (cave_perma_bold(y, x) || p_ptr->current_floor_ptr->grid_array[y][x].o_idx || (p_ptr->current_floor_ptr->grid_array[y][x].info & CAVE_OBJECT))
{
/* Pick a location */
scatter(&ny, &nx, y, x, 1, 0);
{
int i;
- for (i = 0; i < (current_floor_ptr->dun_level / 15) + 1; i++)
+ for (i = 0; i < (p_ptr->current_floor_ptr->dun_level / 15) + 1; i++)
{
o_ptr = &forge;
object_wipe(o_ptr);
leave_quest_check();
- if (quest[p_ptr->inside_quest].type != QUEST_TYPE_RANDOM) current_floor_ptr->dun_level = 1;
- p_ptr->inside_quest = current_floor_ptr->grid_array[p_ptr->y][p_ptr->x].special;
+ if (quest[p_ptr->inside_quest].type != QUEST_TYPE_RANDOM) p_ptr->current_floor_ptr->dun_level = 1;
+ p_ptr->inside_quest = p_ptr->current_floor_ptr->grid_array[p_ptr->y][p_ptr->x].special;
p_ptr->leaving = TRUE;
}
if (p_ptr->spell_exp[spell] < SPELL_EXP_BEGINNER)
p_ptr->spell_exp[spell] += 5;
else if(p_ptr->spell_exp[spell] < SPELL_EXP_SKILLED)
- { if (one_in_(2) && (current_floor_ptr->dun_level > 4) && ((current_floor_ptr->dun_level + 10) > p_ptr->lev)) p_ptr->spell_exp[spell] += 1; }
+ { if (one_in_(2) && (p_ptr->current_floor_ptr->dun_level > 4) && ((p_ptr->current_floor_ptr->dun_level + 10) > p_ptr->lev)) p_ptr->spell_exp[spell] += 1; }
else if(p_ptr->spell_exp[spell] < SPELL_EXP_EXPERT)
- { if (one_in_(5) && ((current_floor_ptr->dun_level + 5) > p_ptr->lev) && ((current_floor_ptr->dun_level + 5) > s_ptr->slevel)) p_ptr->spell_exp[spell] += 1; }
+ { if (one_in_(5) && ((p_ptr->current_floor_ptr->dun_level + 5) > p_ptr->lev) && ((p_ptr->current_floor_ptr->dun_level + 5) > s_ptr->slevel)) p_ptr->spell_exp[spell] += 1; }
else if(p_ptr->spell_exp[spell] < SPELL_EXP_MASTER)
- { if (one_in_(5) && ((current_floor_ptr->dun_level + 5) > p_ptr->lev) && (current_floor_ptr->dun_level > s_ptr->slevel)) p_ptr->spell_exp[spell] += 1; }
+ { if (one_in_(5) && ((p_ptr->current_floor_ptr->dun_level + 5) > p_ptr->lev) && (p_ptr->current_floor_ptr->dun_level > s_ptr->slevel)) p_ptr->spell_exp[spell] += 1; }
}
/* Do any effects of continual spells */
*/
bool teleport_barrier(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];
monster_race *r_ptr = &r_info[m_ptr->r_idx];
if (!hex_spelling(HEX_ANTI_TELE)) return FALSE;
*/
bool magic_barrier(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];
monster_race *r_ptr = &r_info[m_ptr->r_idx];
if (!hex_spelling(HEX_ANTI_MAGIC)) return FALSE;
*/
bool multiply_barrier(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];
monster_race *r_ptr = &r_info[m_ptr->r_idx];
if (!hex_spelling(HEX_ANTI_MULTI)) return FALSE;
int dy = y + ddy_ddd[dir];
int dx = x + ddx_ddd[dir];
if (dir == 5) continue;
- if (current_floor_ptr->grid_array[dy][dx].m_idx) flag = TRUE;
+ if (p_ptr->current_floor_ptr->grid_array[dy][dx].m_idx) flag = TRUE;
}
- if (!cave_empty_bold(y, x) || (current_floor_ptr->grid_array[y][x].info & CAVE_ICKY) ||
+ if (!cave_empty_bold(y, x) || (p_ptr->current_floor_ptr->grid_array[y][x].info & CAVE_ICKY) ||
(distance(y, x, caster_ptr->y, caster_ptr->x) > plev + 2))
{
msg_print(_("そこには移動できない。", "Can not teleport to there."));
y = caster_ptr->y + ddy_cdd[cdir];
x = caster_ptr->x + ddx_cdd[cdir];
- if (current_floor_ptr->grid_array[y][x].m_idx)
+ if (p_ptr->current_floor_ptr->grid_array[y][x].m_idx)
py_attack(p_ptr, y, x, 0);
else
msg_print(_("攻撃は空を切った。", "You attack the empty air."));
y = caster_ptr->y + ddy_cdd[(cdir + 7) % 8];
x = caster_ptr->x + ddx_cdd[(cdir + 7) % 8];
- if (current_floor_ptr->grid_array[y][x].m_idx)
+ if (p_ptr->current_floor_ptr->grid_array[y][x].m_idx)
py_attack(p_ptr, y, x, 0);
else
msg_print(_("攻撃は空を切った。", "You attack the empty air."));
y = caster_ptr->y + ddy_cdd[(cdir + 1) % 8];
x = caster_ptr->x + ddx_cdd[(cdir + 1) % 8];
- if (current_floor_ptr->grid_array[y][x].m_idx)
+ if (p_ptr->current_floor_ptr->grid_array[y][x].m_idx)
py_attack(p_ptr, y, x, 0);
else
msg_print(_("攻撃は空を切った。", "You attack the empty air."));
y = caster_ptr->y + ddy[dir];
x = caster_ptr->x + ddx[dir];
- if (current_floor_ptr->grid_array[y][x].m_idx)
+ if (p_ptr->current_floor_ptr->grid_array[y][x].m_idx)
py_attack(p_ptr, y, x, HISSATSU_FIRE);
else
{
y = caster_ptr->y + ddy[dir];
x = caster_ptr->x + ddx[dir];
- if (current_floor_ptr->grid_array[y][x].m_idx)
+ if (p_ptr->current_floor_ptr->grid_array[y][x].m_idx)
py_attack(p_ptr, y, x, HISSATSU_MINEUCHI);
else
{
y = caster_ptr->y + ddy[dir];
x = caster_ptr->x + ddx[dir];
- if (!current_floor_ptr->grid_array[y][x].m_idx)
+ if (!p_ptr->current_floor_ptr->grid_array[y][x].m_idx)
{
msg_print(_("その方向にはモンスターはいません。", "There is no monster."));
return NULL;
py_attack(p_ptr, y, x, 0);
- if (!player_can_enter(current_floor_ptr->grid_array[y][x].feat, 0) || is_trap(current_floor_ptr->grid_array[y][x].feat))
+ if (!player_can_enter(p_ptr->current_floor_ptr->grid_array[y][x].feat, 0) || is_trap(p_ptr->current_floor_ptr->grid_array[y][x].feat))
break;
y += ddy[dir];
x += ddx[dir];
- if (player_can_enter(current_floor_ptr->grid_array[y][x].feat, 0) && !is_trap(current_floor_ptr->grid_array[y][x].feat) && !current_floor_ptr->grid_array[y][x].m_idx)
+ if (player_can_enter(p_ptr->current_floor_ptr->grid_array[y][x].feat, 0) && !is_trap(p_ptr->current_floor_ptr->grid_array[y][x].feat) && !p_ptr->current_floor_ptr->grid_array[y][x].m_idx)
{
msg_print(NULL);
(void)move_player_effect(caster_ptr, y, x, MPE_FORGET_FLOW | MPE_HANDLE_STUFF | MPE_DONT_PICKUP);
y = caster_ptr->y + ddy[dir];
x = caster_ptr->x + ddx[dir];
- if (current_floor_ptr->grid_array[y][x].m_idx)
+ if (p_ptr->current_floor_ptr->grid_array[y][x].m_idx)
py_attack(p_ptr, y, x, HISSATSU_POISON);
else
{
y = caster_ptr->y + ddy[dir];
x = caster_ptr->x + ddx[dir];
- if (current_floor_ptr->grid_array[y][x].m_idx)
+ if (p_ptr->current_floor_ptr->grid_array[y][x].m_idx)
py_attack(p_ptr, y, x, HISSATSU_ZANMA);
else
{
y = caster_ptr->y + ddy[dir];
x = caster_ptr->x + ddx[dir];
- if (current_floor_ptr->grid_array[y][x].m_idx)
+ if (p_ptr->current_floor_ptr->grid_array[y][x].m_idx)
py_attack(p_ptr, y, x, 0);
else
{
{
return "";
}
- if (current_floor_ptr->grid_array[y][x].m_idx)
+ if (p_ptr->current_floor_ptr->grid_array[y][x].m_idx)
{
int i;
POSITION ty = y, tx = x;
POSITION oy = y, ox = x;
- MONSTER_IDX m_idx = current_floor_ptr->grid_array[y][x].m_idx;
- monster_type *m_ptr = ¤t_floor_ptr->m_list[m_idx];
+ MONSTER_IDX m_idx = p_ptr->current_floor_ptr->grid_array[y][x].m_idx;
+ monster_type *m_ptr = &p_ptr->current_floor_ptr->m_list[m_idx];
GAME_TEXT m_name[MAX_NLEN];
monster_desc(m_name, m_ptr, 0);
if ((ty != oy) || (tx != ox))
{
msg_format(_("%sを吹き飛ばした!", "You blow %s away!"), m_name);
- current_floor_ptr->grid_array[oy][ox].m_idx = 0;
- current_floor_ptr->grid_array[ty][tx].m_idx = m_idx;
+ p_ptr->current_floor_ptr->grid_array[oy][ox].m_idx = 0;
+ p_ptr->current_floor_ptr->grid_array[ty][tx].m_idx = m_idx;
m_ptr->fy = ty;
m_ptr->fx = tx;
y = caster_ptr->y + ddy[dir];
x = caster_ptr->x + ddx[dir];
- if (current_floor_ptr->grid_array[y][x].m_idx)
+ if (p_ptr->current_floor_ptr->grid_array[y][x].m_idx)
py_attack(p_ptr, y, x, HISSATSU_HAGAN);
if (!cave_have_flag_bold(y, x, FF_HURT_ROCK)) break;
y = caster_ptr->y + ddy[dir];
x = caster_ptr->x + ddx[dir];
- if (current_floor_ptr->grid_array[y][x].m_idx)
+ if (p_ptr->current_floor_ptr->grid_array[y][x].m_idx)
py_attack(p_ptr, y, x, HISSATSU_COLD);
else
{
y = caster_ptr->y + ddy[dir];
x = caster_ptr->x + ddx[dir];
- if (current_floor_ptr->grid_array[y][x].m_idx)
+ if (p_ptr->current_floor_ptr->grid_array[y][x].m_idx)
py_attack(p_ptr, y, x, HISSATSU_KYUSHO);
else
{
y = caster_ptr->y + ddy[dir];
x = caster_ptr->x + ddx[dir];
- if (current_floor_ptr->grid_array[y][x].m_idx)
+ if (p_ptr->current_floor_ptr->grid_array[y][x].m_idx)
py_attack(p_ptr, y, x, HISSATSU_MAJIN);
else
{
y = caster_ptr->y + ddy[dir];
x = caster_ptr->x + ddx[dir];
- if (current_floor_ptr->grid_array[y][x].m_idx)
+ if (p_ptr->current_floor_ptr->grid_array[y][x].m_idx)
py_attack(p_ptr, y, x, HISSATSU_SUTEMI);
else
{
y = caster_ptr->y + ddy[dir];
x = caster_ptr->x + ddx[dir];
- if (current_floor_ptr->grid_array[y][x].m_idx)
+ if (p_ptr->current_floor_ptr->grid_array[y][x].m_idx)
py_attack(p_ptr, y, x, HISSATSU_ELEC);
else
{
{
y = caster_ptr->y + ddy_ddd[dir];
x = caster_ptr->x + ddx_ddd[dir];
- g_ptr = ¤t_floor_ptr->grid_array[y][x];
- m_ptr = ¤t_floor_ptr->m_list[g_ptr->m_idx];
+ g_ptr = &p_ptr->current_floor_ptr->grid_array[y][x];
+ m_ptr = &p_ptr->current_floor_ptr->m_list[g_ptr->m_idx];
/* Hack -- attack monsters */
if (g_ptr->m_idx && (m_ptr->ml || cave_have_flag_bold(y, x, FF_PROJECT)))
y = caster_ptr->y + ddy[dir];
x = caster_ptr->x + ddx[dir];
- if (current_floor_ptr->grid_array[y][x].m_idx)
+ if (p_ptr->current_floor_ptr->grid_array[y][x].m_idx)
py_attack(p_ptr, y, x, HISSATSU_QUAKE);
else
earthquake(caster_ptr->y, caster_ptr->x, 10, 0);
y = caster_ptr->y + ddy[dir];
x = caster_ptr->x + ddx[dir];
- g_ptr = ¤t_floor_ptr->grid_array[y][x];
+ g_ptr = &p_ptr->current_floor_ptr->grid_array[y][x];
if (g_ptr->m_idx)
py_attack(p_ptr, y, x, HISSATSU_3DAN);
ny = y + ddy[dir];
nx = x + ddx[dir];
m_idx = g_ptr->m_idx;
- m_ptr = ¤t_floor_ptr->m_list[m_idx];
+ m_ptr = &p_ptr->current_floor_ptr->m_list[m_idx];
/* Monster cannot move back? */
if (!monster_can_enter(ny, nx, &r_info[m_ptr->r_idx], 0))
}
g_ptr->m_idx = 0;
- current_floor_ptr->grid_array[ny][nx].m_idx = m_idx;
+ p_ptr->current_floor_ptr->grid_array[ny][nx].m_idx = m_idx;
m_ptr->fy = ny;
m_ptr->fx = nx;
y = caster_ptr->y + ddy[dir];
x = caster_ptr->x + ddx[dir];
- if (current_floor_ptr->grid_array[y][x].m_idx)
+ if (p_ptr->current_floor_ptr->grid_array[y][x].m_idx)
py_attack(p_ptr, y, x, HISSATSU_DRAIN);
else
{
y = caster_ptr->y + ddy[dir];
x = caster_ptr->x + ddx[dir];
- if (current_floor_ptr->grid_array[y][x].m_idx)
+ if (p_ptr->current_floor_ptr->grid_array[y][x].m_idx)
{
py_attack(p_ptr, y, x, 0);
- if (current_floor_ptr->grid_array[y][x].m_idx)
+ if (p_ptr->current_floor_ptr->grid_array[y][x].m_idx)
{
handle_stuff();
py_attack(p_ptr, y, x, 0);
y = caster_ptr->y + ddy[dir];
x = caster_ptr->x + ddx[dir];
- if (current_floor_ptr->grid_array[y][x].m_idx)
+ if (p_ptr->current_floor_ptr->grid_array[y][x].m_idx)
py_attack(p_ptr, y, x, HISSATSU_UNDEAD);
else
{
{
if (cast)
{
- current_floor_ptr->num_repro += MAX_REPRO;
+ p_ptr->current_floor_ptr->num_repro += MAX_REPRO;
}
}
break;
#endif
buf_sprintf(score, "score: %d\n", calc_score(p_ptr));
buf_sprintf(score, "level: %d\n", p_ptr->lev);
- buf_sprintf(score, "depth: %d\n", current_floor_ptr->dun_level);
+ buf_sprintf(score, "depth: %d\n", p_ptr->current_floor_ptr->dun_level);
buf_sprintf(score, "maxlv: %d\n", p_ptr->max_plv);
buf_sprintf(score, "maxdp: %d\n", max_dlv[DUNGEON_ANGBAND]);
buf_sprintf(score, "au: %d\n", p_ptr->au);
* Town logic flow for generation of new town\n
* Originally from Vanilla 3.0.3\n
*\n
-* We start with a fully wiped current_floor_ptr->grid_array of normal floors.\n
+* We start with a fully wiped p_ptr->current_floor_ptr->grid_array of normal floors.\n
*\n
* Note that town_gen_hack() plays games with the R.N.G.\n
*\n
bool prevent_bm = FALSE;
/* Hack -- If already exist black market, prevent building */
- for (y = 0; (y < current_floor_ptr->height) && !prevent_bm; y++)
+ for (y = 0; (y < p_ptr->current_floor_ptr->height) && !prevent_bm; y++)
{
- for (x = 0; x < current_floor_ptr->width; x++)
+ for (x = 0; x < p_ptr->current_floor_ptr->width; x++)
{
- if (current_floor_ptr->grid_array[y][x].feat == FF_STORE)
+ if (p_ptr->current_floor_ptr->grid_array[y][x].feat == FF_STORE)
{
- prevent_bm = (f_info[current_floor_ptr->grid_array[y][x].feat].subtype == STORE_BLACK);
+ prevent_bm = (f_info[p_ptr->current_floor_ptr->grid_array[y][x].feat].subtype == STORE_BLACK);
break;
}
}
#include "dungeon.h"
/*!
-* @brief タイプ9の部屋…フラクタルカーブによる洞窟生成 / Type 9 -- Driver routine to create fractal current_floor_ptr->grid_array system
+* @brief タイプ9の部屋…フラクタルカーブによる洞窟生成 / Type 9 -- Driver routine to create fractal p_ptr->current_floor_ptr->grid_array system
* @return なし
*/
bool build_type9(void)
* Still no space?!
* Try normal room
*/
- return build_type1(current_floor_ptr);
+ return build_type1(p_ptr->current_floor_ptr);
}
}
light = done = FALSE;
room = TRUE;
- if ((current_floor_ptr->dun_level <= randint1(25)) && !(d_info[p_ptr->dungeon_idx].flags1 & DF1_DARKNESS)) light = TRUE;
+ if ((p_ptr->current_floor_ptr->dun_level <= randint1(25)) && !(d_info[p_ptr->dungeon_idx].flags1 & DF1_DARKNESS)) light = TRUE;
while (!done)
{
if (!n_ptr->name) break;
/* Ignore excessive depth */
- if (n_ptr->level > current_floor_ptr->dun_level) continue;
+ if (n_ptr->level > p_ptr->current_floor_ptr->dun_level) continue;
/* Not matched with pit/nest flag */
if (!(allow_flag_mask & (1L << count))) continue;
/* Count this possibility */
- total += n_ptr->chance * MAX_DEPTH / (MIN(current_floor_ptr->dun_level, MAX_DEPTH - 1) - n_ptr->level + 5);
+ total += n_ptr->chance * MAX_DEPTH / (MIN(p_ptr->current_floor_ptr->dun_level, MAX_DEPTH - 1) - n_ptr->level + 5);
}
/* Pick a random type */
if (!n_ptr->name) break;
/* Ignore excessive depth */
- if (n_ptr->level > current_floor_ptr->dun_level) continue;
+ if (n_ptr->level > p_ptr->current_floor_ptr->dun_level) continue;
/* Not matched with pit/nest flag */
if (!(allow_flag_mask & (1L << count))) continue;
/* Count this possibility */
- total += n_ptr->chance * MAX_DEPTH / (MIN(current_floor_ptr->dun_level, MAX_DEPTH - 1) - n_ptr->level + 5);
+ total += n_ptr->chance * MAX_DEPTH / (MIN(p_ptr->current_floor_ptr->dun_level, MAX_DEPTH - 1) - n_ptr->level + 5);
/* Found the type */
if (tmp < total) break;
if (!find_space(&yval, &xval, ysize + 2, xsize + 2)) return FALSE;
/* Choose lite or dark */
- light = ((current_floor_ptr->dun_level <= randint1(25)) && !(d_info[p_ptr->dungeon_idx].flags1 & DF1_DARKNESS));
+ light = ((p_ptr->current_floor_ptr->dun_level <= randint1(25)) && !(d_info[p_ptr->dungeon_idx].flags1 & DF1_DARKNESS));
/* Get corner values */
y1 = yval - ysize / 2;
{
for (x = x1 - 1; x <= x2 + 1; x++)
{
- g_ptr = ¤t_floor_ptr->grid_array[y][x];
+ g_ptr = &p_ptr->current_floor_ptr->grid_array[y][x];
place_floor_grid(g_ptr);
g_ptr->feat = feat_glass_floor;
g_ptr->info |= (CAVE_ROOM);
/* Walls around the room */
for (y = y1 - 1; y <= y2 + 1; y++)
{
- g_ptr = ¤t_floor_ptr->grid_array[y][x1 - 1];
+ g_ptr = &p_ptr->current_floor_ptr->grid_array[y][x1 - 1];
place_outer_grid(g_ptr);
g_ptr->feat = feat_glass_wall;
- g_ptr = ¤t_floor_ptr->grid_array[y][x2 + 1];
+ g_ptr = &p_ptr->current_floor_ptr->grid_array[y][x2 + 1];
place_outer_grid(g_ptr);
g_ptr->feat = feat_glass_wall;
}
for (x = x1 - 1; x <= x2 + 1; x++)
{
- g_ptr = ¤t_floor_ptr->grid_array[y1 - 1][x];
+ g_ptr = &p_ptr->current_floor_ptr->grid_array[y1 - 1][x];
place_outer_grid(g_ptr);
g_ptr->feat = feat_glass_wall;
- g_ptr = ¤t_floor_ptr->grid_array[y2 + 1][x];
+ g_ptr = &p_ptr->current_floor_ptr->grid_array[y2 + 1][x];
place_outer_grid(g_ptr);
g_ptr->feat = feat_glass_wall;
}
/* Place fixed lite berathers */
for (dir1 = 4; dir1 < 8; dir1++)
{
- MONRACE_IDX r_idx = get_mon_num(current_floor_ptr->dun_level);
+ MONRACE_IDX r_idx = get_mon_num(p_ptr->current_floor_ptr->dun_level);
y = yval + 2 * ddy_ddd[dir1];
x = xval + 2 * ddx_ddd[dir1];
/* Walls around the breather */
for (dir2 = 0; dir2 < 8; dir2++)
{
- g_ptr = ¤t_floor_ptr->grid_array[y + ddy_ddd[dir2]][x + ddx_ddd[dir2]];
+ g_ptr = &p_ptr->current_floor_ptr->grid_array[y + ddy_ddd[dir2]][x + ddx_ddd[dir2]];
place_inner_grid(g_ptr);
g_ptr->feat = feat_glass_wall;
}
{
y = yval + 2 * ddy_ddd[dir1];
x = xval + 2 * ddx_ddd[dir1];
- g_ptr = ¤t_floor_ptr->grid_array[y][x];
+ g_ptr = &p_ptr->current_floor_ptr->grid_array[y][x];
place_inner_perm_grid(g_ptr);
g_ptr->feat = feat_permanent_glass_wall;
- current_floor_ptr->grid_array[yval + ddy_ddd[dir1]][xval + ddx_ddd[dir1]].info |= (CAVE_ICKY);
+ p_ptr->current_floor_ptr->grid_array[yval + ddy_ddd[dir1]][xval + ddx_ddd[dir1]].info |= (CAVE_ICKY);
}
/* Glass door */
y = yval + 2 * ddy_ddd[dir1];
x = xval + 2 * ddx_ddd[dir1];
place_secret_door(y, x, DOOR_GLASS_DOOR);
- g_ptr = ¤t_floor_ptr->grid_array[y][x];
+ g_ptr = &p_ptr->current_floor_ptr->grid_array[y][x];
if (is_closed_door(g_ptr->feat)) g_ptr->mimic = feat_glass_wall;
/* Place a potion */
get_obj_num_hook = kind_is_potion;
place_object(yval, xval, AM_NO_FIXED_ART);
- current_floor_ptr->grid_array[yval][xval].info |= (CAVE_ICKY);
+ p_ptr->current_floor_ptr->grid_array[yval][xval].info |= (CAVE_ICKY);
}
break;
DIRECTION dir1;
/* Pillars */
- g_ptr = ¤t_floor_ptr->grid_array[y1 + 1][x1 + 1];
+ g_ptr = &p_ptr->current_floor_ptr->grid_array[y1 + 1][x1 + 1];
place_inner_grid(g_ptr);
g_ptr->feat = feat_glass_wall;
- g_ptr = ¤t_floor_ptr->grid_array[y1 + 1][x2 - 1];
+ g_ptr = &p_ptr->current_floor_ptr->grid_array[y1 + 1][x2 - 1];
place_inner_grid(g_ptr);
g_ptr->feat = feat_glass_wall;
- g_ptr = ¤t_floor_ptr->grid_array[y2 - 1][x1 + 1];
+ g_ptr = &p_ptr->current_floor_ptr->grid_array[y2 - 1][x1 + 1];
place_inner_grid(g_ptr);
g_ptr->feat = feat_glass_wall;
- g_ptr = ¤t_floor_ptr->grid_array[y2 - 1][x2 - 1];
+ g_ptr = &p_ptr->current_floor_ptr->grid_array[y2 - 1][x2 - 1];
place_inner_grid(g_ptr);
g_ptr->feat = feat_glass_wall;
get_mon_num_prep(vault_aux_lite, NULL);
- r_idx = get_mon_num(current_floor_ptr->dun_level);
+ r_idx = get_mon_num(p_ptr->current_floor_ptr->dun_level);
if (r_idx) place_monster_aux(0, yval, xval, r_idx, 0L);
/* Walls around the breather */
for (dir1 = 0; dir1 < 8; dir1++)
{
- g_ptr = ¤t_floor_ptr->grid_array[yval + ddy_ddd[dir1]][xval + ddx_ddd[dir1]];
+ g_ptr = &p_ptr->current_floor_ptr->grid_array[yval + ddy_ddd[dir1]][xval + ddx_ddd[dir1]];
place_inner_grid(g_ptr);
g_ptr->feat = feat_glass_wall;
}
/* Place an object */
place_object(yval, xval, AM_NO_FIXED_ART);
- current_floor_ptr->grid_array[yval][xval].info |= (CAVE_ICKY);
+ p_ptr->current_floor_ptr->grid_array[yval][xval].info |= (CAVE_ICKY);
}
break;
/* Walls around the potion */
for (y = yval - 2; y <= yval + 2; y++)
{
- g_ptr = ¤t_floor_ptr->grid_array[y][xval - 3];
+ g_ptr = &p_ptr->current_floor_ptr->grid_array[y][xval - 3];
place_inner_grid(g_ptr);
g_ptr->feat = feat_glass_wall;
- g_ptr = ¤t_floor_ptr->grid_array[y][xval + 3];
+ g_ptr = &p_ptr->current_floor_ptr->grid_array[y][xval + 3];
place_inner_grid(g_ptr);
g_ptr->feat = feat_glass_wall;
}
for (x = xval - 2; x <= xval + 2; x++)
{
- g_ptr = ¤t_floor_ptr->grid_array[yval - 3][x];
+ g_ptr = &p_ptr->current_floor_ptr->grid_array[yval - 3][x];
place_inner_grid(g_ptr);
g_ptr->feat = feat_glass_wall;
- g_ptr = ¤t_floor_ptr->grid_array[yval + 3][x];
+ g_ptr = &p_ptr->current_floor_ptr->grid_array[yval + 3][x];
place_inner_grid(g_ptr);
g_ptr->feat = feat_glass_wall;
}
for (dir1 = 4; dir1 < 8; dir1++)
{
- g_ptr = ¤t_floor_ptr->grid_array[yval + 2 * ddy_ddd[dir1]][xval + 2 * ddx_ddd[dir1]];
+ g_ptr = &p_ptr->current_floor_ptr->grid_array[yval + 2 * ddy_ddd[dir1]][xval + 2 * ddx_ddd[dir1]];
place_inner_grid(g_ptr);
g_ptr->feat = feat_glass_wall;
}
/* Place shard berathers */
for (dir1 = 4; dir1 < 8; dir1++)
{
- MONRACE_IDX r_idx = get_mon_num(current_floor_ptr->dun_level);
+ MONRACE_IDX r_idx = get_mon_num(p_ptr->current_floor_ptr->dun_level);
y = yval + ddy_ddd[dir1];
x = xval + ddx_ddd[dir1];
for (y = yval - 2; y <= yval + 2; y++)
for (x = xval - 2; x <= xval + 2; x++)
- current_floor_ptr->grid_array[y][x].info |= (CAVE_ICKY);
+ p_ptr->current_floor_ptr->grid_array[y][x].info |= (CAVE_ICKY);
}
break;
if (!find_space(&yval, &xval, ysize + 2, xsize + 2)) return FALSE;
/* Choose lite or dark */
- light = ((current_floor_ptr->dun_level <= randint1(25)) && !(d_info[p_ptr->dungeon_idx].flags1 & DF1_DARKNESS));
+ light = ((p_ptr->current_floor_ptr->dun_level <= randint1(25)) && !(d_info[p_ptr->dungeon_idx].flags1 & DF1_DARKNESS));
/* Get corner values */
{
for (x = x1 - 1; x <= x2 + 1; x++)
{
- g_ptr = ¤t_floor_ptr->grid_array[y][x];
+ g_ptr = &p_ptr->current_floor_ptr->grid_array[y][x];
place_floor_grid(g_ptr);
g_ptr->info |= (CAVE_ROOM);
if (light) g_ptr->info |= (CAVE_GLOW);
/* Walls around the room */
for (y = y1 - 1; y <= y2 + 1; y++)
{
- g_ptr = ¤t_floor_ptr->grid_array[y][x1 - 1];
+ g_ptr = &p_ptr->current_floor_ptr->grid_array[y][x1 - 1];
place_outer_grid(g_ptr);
- g_ptr = ¤t_floor_ptr->grid_array[y][x2 + 1];
+ g_ptr = &p_ptr->current_floor_ptr->grid_array[y][x2 + 1];
place_outer_grid(g_ptr);
}
for (x = x1 - 1; x <= x2 + 1; x++)
{
- g_ptr = ¤t_floor_ptr->grid_array[y1 - 1][x];
+ g_ptr = &p_ptr->current_floor_ptr->grid_array[y1 - 1][x];
place_outer_grid(g_ptr);
- g_ptr = ¤t_floor_ptr->grid_array[y2 + 1][x];
+ g_ptr = &p_ptr->current_floor_ptr->grid_array[y2 + 1][x];
place_outer_grid(g_ptr);
}
- if (current_floor_ptr->dun_level < 30 + randint1(30))
+ if (p_ptr->current_floor_ptr->dun_level < 30 + randint1(30))
trap = feat_trap_piranha;
else
trap = feat_trap_armageddon;
/* Place a special trap */
- g_ptr = ¤t_floor_ptr->grid_array[rand_spread(yval, ysize / 4)][rand_spread(xval, xsize / 4)];
+ g_ptr = &p_ptr->current_floor_ptr->grid_array[rand_spread(yval, ysize / 4)][rand_spread(xval, xsize / 4)];
g_ptr->mimic = g_ptr->feat;
g_ptr->feat = trap;
POSITION y = y0 - yhsize + y1;
place_extra_bold(y, x);
- current_floor_ptr->grid_array[y][x].info &= (~CAVE_ICKY);
+ p_ptr->current_floor_ptr->grid_array[y][x].info &= (~CAVE_ICKY);
}
}
}
/* Fill with monsters and treasure, high difficulty */
- fill_treasure(current_floor_ptr, x0 - xhsize + 1, x0 - xhsize + xsize - 2, y0 - yhsize + 1, y0 - yhsize + ysize - 2, randint1(5) + 5);
+ fill_treasure(p_ptr->current_floor_ptr, x0 - xhsize + 1, x0 - xhsize + xsize - 2, y0 - yhsize + 1, y0 - yhsize + ysize - 2, randint1(5) + 5);
}
-/* Create a random vault out of a fractal current_floor_ptr->grid_array */
+/* Create a random vault out of a fractal p_ptr->current_floor_ptr->grid_array */
static void build_cave_vault(POSITION x0, POSITION y0, POSITION xsiz, POSITION ysiz)
{
int grd, roug, cutoff;
{
for (y = 0; y <= ysize; y++)
{
- current_floor_ptr->grid_array[y0 - yhsize + y][x0 - xhsize + x].info |= CAVE_ICKY;
+ p_ptr->current_floor_ptr->grid_array[y0 - yhsize + y][x0 - xhsize + x].info |= CAVE_ICKY;
}
}
/* Fill with monsters and treasure, low difficulty */
- fill_treasure(current_floor_ptr, x0 - xhsize + 1, x0 - xhsize + xsize - 1, y0 - yhsize + 1, y0 - yhsize + ysize - 1, randint1(5));
+ fill_treasure(p_ptr->current_floor_ptr, x0 - xhsize + 1, x0 - xhsize + xsize - 1, y0 - yhsize + 1, y0 - yhsize + ysize - 1, randint1(5));
}
/* Hack -- skip "non-grids" */
if (*t == ' ') continue;
- g_ptr = ¤t_floor_ptr->grid_array[y][x];
+ g_ptr = &p_ptr->current_floor_ptr->grid_array[y][x];
/* Lay down a floor */
place_floor_grid(g_ptr);
/* Black market in a dungeon */
case 'S':
- set_cave_feat(current_floor_ptr, y, x, feat_black_market);
+ set_cave_feat(p_ptr->current_floor_ptr, y, x, feat_black_market);
store_init(NO_TOWN, STORE_BLACK);
break;
/* The Pattern */
case 'p':
- set_cave_feat(current_floor_ptr, y, x, feat_pattern_start);
+ set_cave_feat(p_ptr->current_floor_ptr, y, x, feat_pattern_start);
break;
case 'a':
- set_cave_feat(current_floor_ptr, y, x, feat_pattern_1);
+ set_cave_feat(p_ptr->current_floor_ptr, y, x, feat_pattern_1);
break;
case 'b':
- set_cave_feat(current_floor_ptr, y, x, feat_pattern_2);
+ set_cave_feat(p_ptr->current_floor_ptr, y, x, feat_pattern_2);
break;
case 'c':
- set_cave_feat(current_floor_ptr, y, x, feat_pattern_3);
+ set_cave_feat(p_ptr->current_floor_ptr, y, x, feat_pattern_3);
break;
case 'd':
- set_cave_feat(current_floor_ptr, y, x, feat_pattern_4);
+ set_cave_feat(p_ptr->current_floor_ptr, y, x, feat_pattern_4);
break;
case 'P':
- set_cave_feat(current_floor_ptr, y, x, feat_pattern_end);
+ set_cave_feat(p_ptr->current_floor_ptr, y, x, feat_pattern_end);
break;
case 'B':
- set_cave_feat(current_floor_ptr, y, x, feat_pattern_exit);
+ set_cave_feat(p_ptr->current_floor_ptr, y, x, feat_pattern_exit);
break;
case 'A':
/* Reward for Pattern walk */
- current_floor_ptr->object_level = current_floor_ptr->base_level + 12;
+ p_ptr->current_floor_ptr->object_level = p_ptr->current_floor_ptr->base_level + 12;
place_object(y, x, AM_GOOD | AM_GREAT);
- current_floor_ptr->object_level = current_floor_ptr->base_level;
+ p_ptr->current_floor_ptr->object_level = p_ptr->current_floor_ptr->base_level;
break;
case '~':
- set_cave_feat(current_floor_ptr, y, x, feat_shallow_water);
+ set_cave_feat(p_ptr->current_floor_ptr, y, x, feat_shallow_water);
break;
case '=':
- set_cave_feat(current_floor_ptr, y, x, feat_deep_water);
+ set_cave_feat(p_ptr->current_floor_ptr, y, x, feat_deep_water);
break;
case 'v':
- set_cave_feat(current_floor_ptr, y, x, feat_shallow_lava);
+ set_cave_feat(p_ptr->current_floor_ptr, y, x, feat_shallow_lava);
break;
case 'w':
- set_cave_feat(current_floor_ptr, y, x, feat_deep_lava);
+ set_cave_feat(p_ptr->current_floor_ptr, y, x, feat_deep_lava);
break;
case 'f':
- set_cave_feat(current_floor_ptr, y, x, feat_shallow_acid_puddle);
+ set_cave_feat(p_ptr->current_floor_ptr, y, x, feat_shallow_acid_puddle);
break;
case 'F':
- set_cave_feat(current_floor_ptr, y, x, feat_deep_acid_puddle);
+ set_cave_feat(p_ptr->current_floor_ptr, y, x, feat_deep_acid_puddle);
break;
case 'g':
- set_cave_feat(current_floor_ptr, y, x, feat_shallow_poisonous_puddle);
+ set_cave_feat(p_ptr->current_floor_ptr, y, x, feat_shallow_poisonous_puddle);
break;
case 'G':
- set_cave_feat(current_floor_ptr, y, x, feat_deep_poisonous_puddle);
+ set_cave_feat(p_ptr->current_floor_ptr, y, x, feat_deep_poisonous_puddle);
break;
case 'h':
- set_cave_feat(current_floor_ptr, y, x, feat_cold_zone);
+ set_cave_feat(p_ptr->current_floor_ptr, y, x, feat_cold_zone);
break;
case 'H':
- set_cave_feat(current_floor_ptr, y, x, feat_heavy_cold_zone);
+ set_cave_feat(p_ptr->current_floor_ptr, y, x, feat_heavy_cold_zone);
break;
case 'i':
- set_cave_feat(current_floor_ptr, y, x, feat_electrical_zone);
+ set_cave_feat(p_ptr->current_floor_ptr, y, x, feat_electrical_zone);
break;
case 'I':
- set_cave_feat(current_floor_ptr, y, x, feat_heavy_electrical_zone);
+ set_cave_feat(p_ptr->current_floor_ptr, y, x, feat_heavy_electrical_zone);
break;
}
{
case '&':
{
- current_floor_ptr->monster_level = current_floor_ptr->base_level + 5;
+ p_ptr->current_floor_ptr->monster_level = p_ptr->current_floor_ptr->base_level + 5;
place_monster(y, x, (PM_ALLOW_SLEEP | PM_ALLOW_GROUP));
- current_floor_ptr->monster_level = current_floor_ptr->base_level;
+ p_ptr->current_floor_ptr->monster_level = p_ptr->current_floor_ptr->base_level;
break;
}
/* Meaner monster */
case '@':
{
- current_floor_ptr->monster_level = current_floor_ptr->base_level + 11;
+ p_ptr->current_floor_ptr->monster_level = p_ptr->current_floor_ptr->base_level + 11;
place_monster(y, x, (PM_ALLOW_SLEEP | PM_ALLOW_GROUP));
- current_floor_ptr->monster_level = current_floor_ptr->base_level;
+ p_ptr->current_floor_ptr->monster_level = p_ptr->current_floor_ptr->base_level;
break;
}
/* Meaner monster, plus treasure */
case '9':
{
- current_floor_ptr->monster_level = current_floor_ptr->base_level + 9;
+ p_ptr->current_floor_ptr->monster_level = p_ptr->current_floor_ptr->base_level + 9;
place_monster(y, x, PM_ALLOW_SLEEP);
- current_floor_ptr->monster_level = current_floor_ptr->base_level;
- current_floor_ptr->object_level = current_floor_ptr->base_level + 7;
+ p_ptr->current_floor_ptr->monster_level = p_ptr->current_floor_ptr->base_level;
+ p_ptr->current_floor_ptr->object_level = p_ptr->current_floor_ptr->base_level + 7;
place_object(y, x, AM_GOOD);
- current_floor_ptr->object_level = current_floor_ptr->base_level;
+ p_ptr->current_floor_ptr->object_level = p_ptr->current_floor_ptr->base_level;
break;
}
/* Nasty monster and treasure */
case '8':
{
- current_floor_ptr->monster_level = current_floor_ptr->base_level + 40;
+ p_ptr->current_floor_ptr->monster_level = p_ptr->current_floor_ptr->base_level + 40;
place_monster(y, x, PM_ALLOW_SLEEP);
- current_floor_ptr->monster_level = current_floor_ptr->base_level;
- current_floor_ptr->object_level = current_floor_ptr->base_level + 20;
+ p_ptr->current_floor_ptr->monster_level = p_ptr->current_floor_ptr->base_level;
+ p_ptr->current_floor_ptr->object_level = p_ptr->current_floor_ptr->base_level + 20;
place_object(y, x, AM_GOOD | AM_GREAT);
- current_floor_ptr->object_level = current_floor_ptr->base_level;
+ p_ptr->current_floor_ptr->object_level = p_ptr->current_floor_ptr->base_level;
break;
}
{
if (randint0(100) < 50)
{
- current_floor_ptr->monster_level = current_floor_ptr->base_level + 3;
+ p_ptr->current_floor_ptr->monster_level = p_ptr->current_floor_ptr->base_level + 3;
place_monster(y, x, (PM_ALLOW_SLEEP | PM_ALLOW_GROUP));
- current_floor_ptr->monster_level = current_floor_ptr->base_level;
+ p_ptr->current_floor_ptr->monster_level = p_ptr->current_floor_ptr->base_level;
}
if (randint0(100) < 50)
{
- current_floor_ptr->object_level = current_floor_ptr->base_level + 7;
+ p_ptr->current_floor_ptr->object_level = p_ptr->current_floor_ptr->base_level + 7;
place_object(y, x, 0L);
- current_floor_ptr->object_level = current_floor_ptr->base_level;
+ p_ptr->current_floor_ptr->object_level = p_ptr->current_floor_ptr->base_level;
}
break;
}
y = v_ptr->hgt;
/* Some huge vault cannot be ratated to fit in the dungeon */
- if (x + 2 > current_floor_ptr->height - 2)
+ if (x + 2 > p_ptr->current_floor_ptr->height - 2)
{
/* Forbid 90 or 270 degree ratation */
transno &= ~1;
y = v_ptr->hgt;
/* Some huge vault cannot be ratated to fit in the dungeon */
- if (x + 2 > current_floor_ptr->height - 2)
+ if (x + 2 > p_ptr->current_floor_ptr->height - 2)
{
/* Forbid 90 or 270 degree ratation */
transno &= ~1;
for (y = y0 - rad; y <= y0 + rad; y++)
{
/* clear room flag */
- current_floor_ptr->grid_array[y][x].info &= ~(CAVE_ROOM);
+ p_ptr->current_floor_ptr->grid_array[y][x].info &= ~(CAVE_ROOM);
/* Vault - so is "icky" */
- current_floor_ptr->grid_array[y][x].info |= CAVE_ICKY;
+ p_ptr->current_floor_ptr->grid_array[y][x].info |= CAVE_ICKY;
if (dist2(y0, x0, y, x, h1, h2, h3, h4) <= rad - 1)
{
add_door(x0, y0 - y);
/* Fill with stuff - medium difficulty */
- fill_treasure(current_floor_ptr, x0 - rad, x0 + rad, y0 - rad, y0 + rad, randint1(3) + 3);
+ fill_treasure(p_ptr->current_floor_ptr, x0 - rad, x0 + rad, y0 - rad, y0 + rad, randint1(3) + 3);
}
xsize = xhsize * 2;
ysize = yhsize * 2;
- if (current_floor_ptr->dun_level < 25)
+ if (p_ptr->current_floor_ptr->dun_level < 25)
{
/* Earth vault (Rubble) */
type = LAKE_T_EARTH_VAULT;
}
- else if (current_floor_ptr->dun_level < 50)
+ else if (p_ptr->current_floor_ptr->dun_level < 50)
{
/* Air vault (Trees) */
type = LAKE_T_AIR_VAULT;
}
- else if (current_floor_ptr->dun_level < 75)
+ else if (p_ptr->current_floor_ptr->dun_level < 75)
{
/* Water vault (shallow water) */
type = LAKE_T_WATER_VAULT;
{
for (y = 0; y <= ysize; y++)
{
- current_floor_ptr->grid_array[y0 - yhsize + y][x0 - xhsize + x].info |= CAVE_ICKY;
+ p_ptr->current_floor_ptr->grid_array[y0 - yhsize + y][x0 - xhsize + x].info |= CAVE_ICKY;
}
}
}
/* Fill with monsters and treasure, low difficulty */
- fill_treasure(current_floor_ptr, x0 - xhsize + 1, x0 - xhsize + xsize - 1,
+ fill_treasure(p_ptr->current_floor_ptr, x0 - xhsize + 1, x0 - xhsize + xsize - 1,
y0 - yhsize + 1, y0 - yhsize + ysize - 1, randint1(5));
}
#endif /* ALLOW_CAVERNS_AND_LAKES */
/* generate the room */
for (x = x1 - 2; x <= x2 + 2; x++)
{
- if (!in_bounds(current_floor_ptr, y1 - 2, x)) break;
+ if (!in_bounds(p_ptr->current_floor_ptr, y1 - 2, x)) break;
- current_floor_ptr->grid_array[y1 - 2][x].info |= (CAVE_ROOM | CAVE_ICKY);
+ p_ptr->current_floor_ptr->grid_array[y1 - 2][x].info |= (CAVE_ROOM | CAVE_ICKY);
place_outer_noperm_bold(y1 - 2, x);
}
for (x = x1 - 2; x <= x2 + 2; x++)
{
- if (!in_bounds(current_floor_ptr, y2 + 2, x)) break;
+ if (!in_bounds(p_ptr->current_floor_ptr, y2 + 2, x)) break;
- current_floor_ptr->grid_array[y2 + 2][x].info |= (CAVE_ROOM | CAVE_ICKY);
+ p_ptr->current_floor_ptr->grid_array[y2 + 2][x].info |= (CAVE_ROOM | CAVE_ICKY);
place_outer_noperm_bold(y2 + 2, x);
}
for (y = y1 - 2; y <= y2 + 2; y++)
{
- if (!in_bounds(current_floor_ptr, y, x1 - 2)) break;
+ if (!in_bounds(p_ptr->current_floor_ptr, y, x1 - 2)) break;
- current_floor_ptr->grid_array[y][x1 - 2].info |= (CAVE_ROOM | CAVE_ICKY);
+ p_ptr->current_floor_ptr->grid_array[y][x1 - 2].info |= (CAVE_ROOM | CAVE_ICKY);
place_outer_noperm_bold(y, x1 - 2);
}
for (y = y1 - 2; y <= y2 + 2; y++)
{
- if (!in_bounds(current_floor_ptr, y, x2 + 2)) break;
+ if (!in_bounds(p_ptr->current_floor_ptr, y, x2 + 2)) break;
- current_floor_ptr->grid_array[y][x2 + 2].info |= (CAVE_ROOM | CAVE_ICKY);
+ p_ptr->current_floor_ptr->grid_array[y][x2 + 2].info |= (CAVE_ROOM | CAVE_ICKY);
place_outer_noperm_bold(y, x2 + 2);
}
{
for (x = x1 - 1; x <= x2 + 1; x++)
{
- grid_type *g_ptr = ¤t_floor_ptr->grid_array[y][x];
+ grid_type *g_ptr = &p_ptr->current_floor_ptr->grid_array[y][x];
g_ptr->info |= (CAVE_ROOM | CAVE_ICKY);
}
/* Fill with monsters and treasure, highest difficulty */
- fill_treasure(current_floor_ptr, x1, x2, y1, y2, 10);
+ fill_treasure(p_ptr->current_floor_ptr, x1, x2, y1, y2, 10);
C_KILL(visited, num_vertices, int);
}
{
for (x = x1 - 1; x <= x2 + 1; x++)
{
- current_floor_ptr->grid_array[y][x].info |= (CAVE_ROOM | CAVE_ICKY);
+ p_ptr->current_floor_ptr->grid_array[y][x].info |= (CAVE_ROOM | CAVE_ICKY);
/* Make everything a floor */
place_floor_bold(y, x);
}
build_recursive_room(x1, y1, x2, y2, randint1(5));
/* Fill with monsters and treasure, low difficulty */
- fill_treasure(current_floor_ptr, x1, x2, y1, y2, randint1(3));
+ fill_treasure(p_ptr->current_floor_ptr, x1, x2, y1, y2, randint1(3));
}
switch (vtype)
{
/* Build an appropriate room */
- case 1: case 9: build_bubble_vault(current_floor_ptr, x0, y0, xsize, ysize); break;
+ case 1: case 9: build_bubble_vault(p_ptr->current_floor_ptr, x0, y0, xsize, ysize); break;
case 2: case 10: build_room_vault(x0, y0, xsize, ysize); break;
case 3: case 11: build_cave_vault(x0, y0, xsize, ysize); break;
case 4: case 12: build_maze_vault(x0, y0, xsize, ysize, TRUE); break;
y = v_ptr->hgt;
/* Some huge vault cannot be ratated to fit in the dungeon */
- if (x + 2 > current_floor_ptr->height - 2)
+ if (x + 2 > p_ptr->current_floor_ptr->height - 2)
{
/* Forbid 90 or 270 degree ratation */
transno &= ~1;
}
/* Clear mimic type */
- current_floor_ptr->grid_array[y0][x0].mimic = 0;
+ p_ptr->current_floor_ptr->grid_array[y0][x0].mimic = 0;
/* Add inner open space */
place_floor_bold(y0, x0);
/*!
* @brief
* 指定範囲に通路が通っていることを確認した上で床で埋める
- * This function tunnels around a room if it will cut off part of a current_floor_ptr->grid_array system.
+ * This function tunnels around a room if it will cut off part of a p_ptr->current_floor_ptr->grid_array system.
* @param x1 範囲の左端
* @param y1 範囲の上端
* @param x2 範囲の右端
static fill_data_type fill_data;
-/* Store routine for the fractal current_floor_ptr->grid_array generator */
+/* Store routine for the fractal p_ptr->current_floor_ptr->grid_array generator */
/* this routine probably should be an inline function or a macro. */
static void store_height(POSITION x, POSITION y, FEAT_IDX val)
{
(val <= fill_data.c1)) val = fill_data.c1 + 1;
/* store the value in height-map format */
- current_floor_ptr->grid_array[y][x].feat = val;
+ p_ptr->current_floor_ptr->grid_array[y][x].feat = val;
return;
}
*
* How fractal caves are made:
*
-* When the map is complete, a cut-off value is used to create a current_floor_ptr->grid_array.
+* When the map is complete, a cut-off value is used to create a p_ptr->current_floor_ptr->grid_array.
* Heights below this value are "floor", and heights above are "wall".
* This also can be used to create lakes, by adding more height levels
* representing shallow and deep water/ lava etc.
* The grd variable affects the width of passages.
* The roug variable affects the roughness of those passages
*
-* The tricky part is making sure the created current_floor_ptr->grid_array is connected. This
+* The tricky part is making sure the created p_ptr->current_floor_ptr->grid_array is connected. This
* is done by 'filling' from the inside and only keeping the 'filled'
* floor. Walls bounding the 'filled' floor are also kept. Everything
* else is converted to the normal _extra_.
/*
- * Note that this uses the current_floor_ptr->grid_array.feat array in a very hackish way
+ * Note that this uses the p_ptr->current_floor_ptr->grid_array.feat array in a very hackish way
* the values are first set to zero, and then each array location
* is used as a "heightmap"
* The heightmap then needs to be converted back into the "feat" format.
* grd=level at which fractal turns on. smaller gives more mazelike caves
* roug=roughness level. 16=normal. higher values make things more convoluted
* small values are good for smooth walls.
- * size=length of the side of the square current_floor_ptr->grid_array system.
+ * size=length of the side of the square p_ptr->current_floor_ptr->grid_array system.
*/
void generate_hmap(POSITION y0, POSITION x0, POSITION xsiz, POSITION ysiz, int grd, int roug, int cutoff)
{
for (j = 0; j <= ysize; j++)
{
/* -1 is a flag for "not done yet" */
- current_floor_ptr->grid_array[(int)(fill_data.ymin + j)][(int)(fill_data.xmin + i)].feat = -1;
- /* Clear icky flag because may be redoing the current_floor_ptr->grid_array */
- current_floor_ptr->grid_array[(int)(fill_data.ymin + j)][(int)(fill_data.xmin + i)].info &= ~(CAVE_ICKY);
+ p_ptr->current_floor_ptr->grid_array[(int)(fill_data.ymin + j)][(int)(fill_data.xmin + i)].feat = -1;
+ /* Clear icky flag because may be redoing the p_ptr->current_floor_ptr->grid_array */
+ p_ptr->current_floor_ptr->grid_array[(int)(fill_data.ymin + j)][(int)(fill_data.xmin + i)].info &= ~(CAVE_ICKY);
}
}
/* Boundaries are walls */
- current_floor_ptr->grid_array[fill_data.ymin][fill_data.xmin].feat = (s16b)maxsize;
- current_floor_ptr->grid_array[fill_data.ymax][fill_data.xmin].feat = (s16b)maxsize;
- current_floor_ptr->grid_array[fill_data.ymin][fill_data.xmax].feat = (s16b)maxsize;
- current_floor_ptr->grid_array[fill_data.ymax][fill_data.xmax].feat = (s16b)maxsize;
+ p_ptr->current_floor_ptr->grid_array[fill_data.ymin][fill_data.xmin].feat = (s16b)maxsize;
+ p_ptr->current_floor_ptr->grid_array[fill_data.ymax][fill_data.xmin].feat = (s16b)maxsize;
+ p_ptr->current_floor_ptr->grid_array[fill_data.ymin][fill_data.xmax].feat = (s16b)maxsize;
+ p_ptr->current_floor_ptr->grid_array[fill_data.ymax][fill_data.xmax].feat = (s16b)maxsize;
/* Set the middle square to be an open area. */
- current_floor_ptr->grid_array[y0][x0].feat = 0;
+ p_ptr->current_floor_ptr->grid_array[y0][x0].feat = 0;
/* Initialize the step sizes */
xstep = xhstep = xsize * 256;
jj = j / 256 + fill_data.ymin;
/* Test square */
- if (current_floor_ptr->grid_array[jj][ii].feat == -1)
+ if (p_ptr->current_floor_ptr->grid_array[jj][ii].feat == -1)
{
if (xhstep2 > grd)
{
{
/* Average of left and right points +random bit */
store_height(ii, jj,
- (current_floor_ptr->grid_array[jj][fill_data.xmin + (i - xhstep) / 256].feat
- + current_floor_ptr->grid_array[jj][fill_data.xmin + (i + xhstep) / 256].feat) / 2
+ (p_ptr->current_floor_ptr->grid_array[jj][fill_data.xmin + (i - xhstep) / 256].feat
+ + p_ptr->current_floor_ptr->grid_array[jj][fill_data.xmin + (i + xhstep) / 256].feat) / 2
+ (randint1(xstep2) - xhstep2) * roug / 16);
}
}
jj = j / 256 + fill_data.ymin;
/* Test square */
- if (current_floor_ptr->grid_array[jj][ii].feat == -1)
+ if (p_ptr->current_floor_ptr->grid_array[jj][ii].feat == -1)
{
if (xhstep2 > grd)
{
{
/* Average of up and down points +random bit */
store_height(ii, jj,
- (current_floor_ptr->grid_array[fill_data.ymin + (j - yhstep) / 256][ii].feat
- + current_floor_ptr->grid_array[fill_data.ymin + (j + yhstep) / 256][ii].feat) / 2
+ (p_ptr->current_floor_ptr->grid_array[fill_data.ymin + (j - yhstep) / 256][ii].feat
+ + p_ptr->current_floor_ptr->grid_array[fill_data.ymin + (j + yhstep) / 256][ii].feat) / 2
+ (randint1(ystep2) - yhstep2) * roug / 16);
}
}
jj = j / 256 + fill_data.ymin;
/* Test square */
- if (current_floor_ptr->grid_array[jj][ii].feat == -1)
+ if (p_ptr->current_floor_ptr->grid_array[jj][ii].feat == -1)
{
if (xhstep2 > grd)
{
* reduce the effect of the square grid on the shape of the fractal
*/
store_height(ii, jj,
- (current_floor_ptr->grid_array[ym][xm].feat + current_floor_ptr->grid_array[yp][xm].feat
- + current_floor_ptr->grid_array[ym][xp].feat + current_floor_ptr->grid_array[yp][xp].feat) / 4
+ (p_ptr->current_floor_ptr->grid_array[ym][xm].feat + p_ptr->current_floor_ptr->grid_array[yp][xm].feat
+ + p_ptr->current_floor_ptr->grid_array[ym][xp].feat + p_ptr->current_floor_ptr->grid_array[yp][xp].feat) / 4
+ (randint1(xstep2) - xhstep2) * (diagsize / 16) / 256 * roug);
}
}
/*
* Quick and nasty fill routine used to find the connected region
- * of floor in the middle of the current_floor_ptr->grid_array
+ * of floor in the middle of the p_ptr->current_floor_ptr->grid_array
*/
static void cave_fill(POSITION y, POSITION x)
{
j = ty + ddy_ddd[d];
i = tx + ddx_ddd[d];
- /* Paranoia Don't leave the current_floor_ptr->grid_array */
- if (!in_bounds(current_floor_ptr, j, i))
+ /* Paranoia Don't leave the p_ptr->current_floor_ptr->grid_array */
+ if (!in_bounds(p_ptr->current_floor_ptr, j, i))
{
/* affect boundary */
- current_floor_ptr->grid_array[j][i].info |= CAVE_ICKY;
+ p_ptr->current_floor_ptr->grid_array[j][i].info |= CAVE_ICKY;
/* return; */
}
&& (j > fill_data.ymin) && (j < fill_data.ymax))
{
/* If not a wall or floor done before */
- if (hack_isnt_wall(current_floor_ptr, j, i,
+ if (hack_isnt_wall(p_ptr->current_floor_ptr, j, i,
fill_data.c1, fill_data.c2, fill_data.c3,
fill_data.feat1, fill_data.feat2, fill_data.feat3,
fill_data.info1, fill_data.info2, fill_data.info3))
}
else
{
- /* keep tally of size of current_floor_ptr->grid_array system */
+ /* keep tally of size of p_ptr->current_floor_ptr->grid_array system */
(fill_data.amount)++;
}
}
else
{
/* affect boundary */
- current_floor_ptr->grid_array[j][i].info |= CAVE_ICKY;
+ p_ptr->current_floor_ptr->grid_array[j][i].info |= CAVE_ICKY;
}
}
}
/*
- * select region connected to center of current_floor_ptr->grid_array system
+ * select region connected to center of p_ptr->current_floor_ptr->grid_array system
* this gets rid of alot of isolated one-sqaures that
* can make teleport traps instadeaths...
*/
for (y = 0; y <= ysize; ++y)
{
place_extra_bold(y0 + y - yhsize, x0 + x - xhsize);
- current_floor_ptr->grid_array[y0 + y - yhsize][x0 + x - xhsize].info &= ~(CAVE_ICKY | CAVE_ROOM);
+ p_ptr->current_floor_ptr->grid_array[y0 + y - yhsize][x0 + x - xhsize].info &= ~(CAVE_ICKY | CAVE_ROOM);
}
}
return FALSE;
for (i = 0; i <= xsize; ++i)
{
/* top boundary */
- if ((current_floor_ptr->grid_array[0 + y0 - yhsize][i + x0 - xhsize].info & CAVE_ICKY) && (room))
+ if ((p_ptr->current_floor_ptr->grid_array[0 + y0 - yhsize][i + x0 - xhsize].info & CAVE_ICKY) && (room))
{
/* Next to a 'filled' region? - set to be room walls */
place_outer_bold(y0 + 0 - yhsize, x0 + i - xhsize);
- if (light) current_floor_ptr->grid_array[y0 + 0 - yhsize][x0 + i - xhsize].info |= (CAVE_GLOW);
- current_floor_ptr->grid_array[y0 + 0 - yhsize][x0 + i - xhsize].info |= (CAVE_ROOM);
+ if (light) p_ptr->current_floor_ptr->grid_array[y0 + 0 - yhsize][x0 + i - xhsize].info |= (CAVE_GLOW);
+ p_ptr->current_floor_ptr->grid_array[y0 + 0 - yhsize][x0 + i - xhsize].info |= (CAVE_ROOM);
place_outer_bold(y0 + 0 - yhsize, x0 + i - xhsize);
}
else
}
/* bottom boundary */
- if ((current_floor_ptr->grid_array[ysize + y0 - yhsize][i + x0 - xhsize].info & CAVE_ICKY) && (room))
+ if ((p_ptr->current_floor_ptr->grid_array[ysize + y0 - yhsize][i + x0 - xhsize].info & CAVE_ICKY) && (room))
{
/* Next to a 'filled' region? - set to be room walls */
place_outer_bold(y0 + ysize - yhsize, x0 + i - xhsize);
- if (light) current_floor_ptr->grid_array[y0 + ysize - yhsize][x0 + i - xhsize].info|=(CAVE_GLOW);
- current_floor_ptr->grid_array[y0 + ysize - yhsize][x0 + i - xhsize].info|=(CAVE_ROOM);
+ if (light) p_ptr->current_floor_ptr->grid_array[y0 + ysize - yhsize][x0 + i - xhsize].info|=(CAVE_GLOW);
+ p_ptr->current_floor_ptr->grid_array[y0 + ysize - yhsize][x0 + i - xhsize].info|=(CAVE_ROOM);
place_outer_bold(y0 + ysize - yhsize, x0 + i - xhsize);
}
else
}
/* clear the icky flag-don't need it any more */
- current_floor_ptr->grid_array[y0 + 0 - yhsize][x0 + i - xhsize].info &= ~(CAVE_ICKY);
- current_floor_ptr->grid_array[y0 + ysize - yhsize][x0 + i - xhsize].info &= ~(CAVE_ICKY);
+ p_ptr->current_floor_ptr->grid_array[y0 + 0 - yhsize][x0 + i - xhsize].info &= ~(CAVE_ICKY);
+ p_ptr->current_floor_ptr->grid_array[y0 + ysize - yhsize][x0 + i - xhsize].info &= ~(CAVE_ICKY);
}
/* Do the left and right boundaries minus the corners (done above) */
for (i = 1; i < ysize; ++i)
{
/* left boundary */
- if ((current_floor_ptr->grid_array[i + y0 - yhsize][0 + x0 - xhsize].info & CAVE_ICKY) && room)
+ if ((p_ptr->current_floor_ptr->grid_array[i + y0 - yhsize][0 + x0 - xhsize].info & CAVE_ICKY) && room)
{
/* room boundary */
place_outer_bold(y0 + i - yhsize, x0 + 0 - xhsize);
- if (light) current_floor_ptr->grid_array[y0 + i - yhsize][x0 + 0 - xhsize].info |= (CAVE_GLOW);
- current_floor_ptr->grid_array[y0 + i - yhsize][x0 + 0 - xhsize].info |= (CAVE_ROOM);
+ if (light) p_ptr->current_floor_ptr->grid_array[y0 + i - yhsize][x0 + 0 - xhsize].info |= (CAVE_GLOW);
+ p_ptr->current_floor_ptr->grid_array[y0 + i - yhsize][x0 + 0 - xhsize].info |= (CAVE_ROOM);
place_outer_bold(y0 + i - yhsize, x0 + 0 - xhsize);
}
else
place_extra_bold(y0 + i - yhsize, x0 + 0 - xhsize);
}
/* right boundary */
- if ((current_floor_ptr->grid_array[i + y0 - yhsize][xsize + x0 - xhsize].info & CAVE_ICKY) && room)
+ if ((p_ptr->current_floor_ptr->grid_array[i + y0 - yhsize][xsize + x0 - xhsize].info & CAVE_ICKY) && room)
{
/* room boundary */
place_outer_bold(y0 + i - yhsize, x0 + xsize - xhsize);
- if (light) current_floor_ptr->grid_array[y0 + i - yhsize][x0 + xsize - xhsize].info |= (CAVE_GLOW);
- current_floor_ptr->grid_array[y0 + i - yhsize][x0 + xsize - xhsize].info |= (CAVE_ROOM);
+ if (light) p_ptr->current_floor_ptr->grid_array[y0 + i - yhsize][x0 + xsize - xhsize].info |= (CAVE_GLOW);
+ p_ptr->current_floor_ptr->grid_array[y0 + i - yhsize][x0 + xsize - xhsize].info |= (CAVE_ROOM);
place_outer_bold(y0 + i - yhsize, x0 + xsize - xhsize);
}
else
}
/* clear icky flag -done with it */
- current_floor_ptr->grid_array[y0 + i - yhsize][x0 + 0 - xhsize].info &= ~(CAVE_ICKY);
- current_floor_ptr->grid_array[y0 + i - yhsize][x0 + xsize - xhsize].info &= ~(CAVE_ICKY);
+ p_ptr->current_floor_ptr->grid_array[y0 + i - yhsize][x0 + 0 - xhsize].info &= ~(CAVE_ICKY);
+ p_ptr->current_floor_ptr->grid_array[y0 + i - yhsize][x0 + xsize - xhsize].info &= ~(CAVE_ICKY);
}
for (y = 1; y < ysize; ++y)
{
if (is_floor_bold(y0 + y - yhsize, x0 + x - xhsize) &&
- (current_floor_ptr->grid_array[y0 + y - yhsize][x0 + x - xhsize].info & CAVE_ICKY))
+ (p_ptr->current_floor_ptr->grid_array[y0 + y - yhsize][x0 + x - xhsize].info & CAVE_ICKY))
{
/* Clear the icky flag in the filled region */
- current_floor_ptr->grid_array[y0 + y - yhsize][x0 + x - xhsize].info &= ~CAVE_ICKY;
+ p_ptr->current_floor_ptr->grid_array[y0 + y - yhsize][x0 + x - xhsize].info &= ~CAVE_ICKY;
/* Set appropriate flags */
- if (light) current_floor_ptr->grid_array[y0 + y - yhsize][x0 + x - xhsize].info |= (CAVE_GLOW);
- if (room) current_floor_ptr->grid_array[y0 + y - yhsize][x0 + x - xhsize].info |= (CAVE_ROOM);
+ if (light) p_ptr->current_floor_ptr->grid_array[y0 + y - yhsize][x0 + x - xhsize].info |= (CAVE_GLOW);
+ if (room) p_ptr->current_floor_ptr->grid_array[y0 + y - yhsize][x0 + x - xhsize].info |= (CAVE_ROOM);
}
else if (is_outer_bold(y0 + y - yhsize, x0 + x - xhsize) &&
- (current_floor_ptr->grid_array[y0 + y - yhsize][x0 + x - xhsize].info & CAVE_ICKY))
+ (p_ptr->current_floor_ptr->grid_array[y0 + y - yhsize][x0 + x - xhsize].info & CAVE_ICKY))
{
/* Walls */
- current_floor_ptr->grid_array[y0 + y - yhsize][x0 + x - xhsize].info &= ~(CAVE_ICKY);
- if (light) current_floor_ptr->grid_array[y0 + y - yhsize][x0 + x - xhsize].info |= (CAVE_GLOW);
+ p_ptr->current_floor_ptr->grid_array[y0 + y - yhsize][x0 + x - xhsize].info &= ~(CAVE_ICKY);
+ if (light) p_ptr->current_floor_ptr->grid_array[y0 + y - yhsize][x0 + x - xhsize].info |= (CAVE_GLOW);
if (room)
{
- current_floor_ptr->grid_array[y0 + y - yhsize][x0 + x - xhsize].info |= (CAVE_ROOM);
+ p_ptr->current_floor_ptr->grid_array[y0 + y - yhsize][x0 + x - xhsize].info |= (CAVE_ROOM);
}
else
{
place_extra_bold(y0 + y - yhsize, x0 + x - xhsize);
- current_floor_ptr->grid_array[y0 + y - yhsize][x0 + x - xhsize].info &= ~(CAVE_ROOM);
+ p_ptr->current_floor_ptr->grid_array[y0 + y - yhsize][x0 + x - xhsize].info &= ~(CAVE_ROOM);
}
}
else
{
/* Clear the unconnected regions */
place_extra_bold(y0 + y - yhsize, x0 + x - xhsize);
- current_floor_ptr->grid_array[y0 + y - yhsize][x0 + x - xhsize].info &= ~(CAVE_ICKY | CAVE_ROOM);
+ p_ptr->current_floor_ptr->grid_array[y0 + y - yhsize][x0 + x - xhsize].info &= ~(CAVE_ICKY | CAVE_ROOM);
}
}
}
#ifdef ALLOW_CAVERNS_AND_LAKES
/*
- * Builds a current_floor_ptr->grid_array system in the center of the dungeon.
+ * Builds a p_ptr->current_floor_ptr->grid_array system in the center of the dungeon.
*/
void build_cavern(void)
{
bool done, light;
light = done = FALSE;
- if ((current_floor_ptr->dun_level <= randint1(50)) && !(d_info[p_ptr->dungeon_idx].flags1 & DF1_DARKNESS)) light = TRUE;
+ if ((p_ptr->current_floor_ptr->dun_level <= randint1(50)) && !(d_info[p_ptr->dungeon_idx].flags1 & DF1_DARKNESS)) light = TRUE;
- /* Make a current_floor_ptr->grid_array the size of the dungeon */
- xsize = current_floor_ptr->width - 1;
- ysize = current_floor_ptr->height - 1;
+ /* Make a p_ptr->current_floor_ptr->grid_array the size of the dungeon */
+ xsize = p_ptr->current_floor_ptr->width - 1;
+ ysize = p_ptr->current_floor_ptr->height - 1;
x0 = xsize / 2;
y0 = ysize / 2;
feat2 = feat_shallow_water;
feat3 = feat_ground_type[randint0(100)];
break;
- case LAKE_T_CAVE: /* Collapsed current_floor_ptr->grid_array */
+ case LAKE_T_CAVE: /* Collapsed p_ptr->current_floor_ptr->grid_array */
feat1 = feat_ground_type[randint0(100)];
feat2 = feat_ground_type[randint0(100)];
feat3 = feat_rubble;
}
/*
- * select region connected to center of current_floor_ptr->grid_array system
+ * select region connected to center of p_ptr->current_floor_ptr->grid_array system
* this gets rid of alot of isolated one-sqaures that
* can make teleport traps instadeaths...
*/
/* number of filled squares */
fill_data.amount = 0;
- /* select region connected to center of current_floor_ptr->grid_array system
+ /* select region connected to center of p_ptr->current_floor_ptr->grid_array system
* this gets rid of alot of isolated one-sqaures that
* can make teleport traps instadeaths... */
cave_fill((byte)y0, (byte)x0);
for (y = 0; y <= ysize; ++y)
{
place_floor_bold(y0 + y - yhsize, x0 + x - xhsize);
- current_floor_ptr->grid_array[y0 + y - yhsize][x0 + x - xhsize].info &= ~(CAVE_ICKY);
+ p_ptr->current_floor_ptr->grid_array[y0 + y - yhsize][x0 + x - xhsize].info &= ~(CAVE_ICKY);
}
}
return FALSE;
place_extra_bold(y0 + ysize - yhsize, x0 + i - xhsize);
/* clear the icky flag-don't need it any more */
- current_floor_ptr->grid_array[y0 + 0 - yhsize][x0 + i - xhsize].info &= ~(CAVE_ICKY);
- current_floor_ptr->grid_array[y0 + ysize - yhsize][x0 + i - xhsize].info &= ~(CAVE_ICKY);
+ p_ptr->current_floor_ptr->grid_array[y0 + 0 - yhsize][x0 + i - xhsize].info &= ~(CAVE_ICKY);
+ p_ptr->current_floor_ptr->grid_array[y0 + ysize - yhsize][x0 + i - xhsize].info &= ~(CAVE_ICKY);
}
/* Do the left and right boundaries minus the corners (done above) */
place_extra_bold(y0 + i - yhsize, x0 + xsize - xhsize);
/* clear icky flag -done with it */
- current_floor_ptr->grid_array[y0 + i - yhsize][x0 + 0 - xhsize].info &= ~(CAVE_ICKY);
- current_floor_ptr->grid_array[y0 + i - yhsize][x0 + xsize - xhsize].info &= ~(CAVE_ICKY);
+ p_ptr->current_floor_ptr->grid_array[y0 + i - yhsize][x0 + 0 - xhsize].info &= ~(CAVE_ICKY);
+ p_ptr->current_floor_ptr->grid_array[y0 + i - yhsize][x0 + xsize - xhsize].info &= ~(CAVE_ICKY);
}
for (y = 1; y < ysize; ++y)
{
/* Fill unconnected regions with granite */
- if ((!(current_floor_ptr->grid_array[y0 + y - yhsize][x0 + x - xhsize].info & CAVE_ICKY)) ||
+ if ((!(p_ptr->current_floor_ptr->grid_array[y0 + y - yhsize][x0 + x - xhsize].info & CAVE_ICKY)) ||
is_outer_bold(y0 + y - yhsize, x0 + x - xhsize))
place_extra_bold(y0 + y - yhsize, x0 + x - xhsize);
/* current_world_ptr->game_turn off icky flag (no longer needed.) */
- current_floor_ptr->grid_array[y0 + y - yhsize][x0 + x - xhsize].info &= ~(CAVE_ICKY | CAVE_ROOM);
+ p_ptr->current_floor_ptr->grid_array[y0 + y - yhsize][x0 + x - xhsize].info &= ~(CAVE_ICKY | CAVE_ROOM);
/* Light lava */
if (cave_have_flag_bold(y0 + y - yhsize, x0 + x - xhsize, FF_LAVA))
{
- if (!(d_info[p_ptr->dungeon_idx].flags1 & DF1_DARKNESS)) current_floor_ptr->grid_array[y0 + y - yhsize][x0 + x - xhsize].info |= CAVE_GLOW;
+ if (!(d_info[p_ptr->dungeon_idx].flags1 & DF1_DARKNESS)) p_ptr->current_floor_ptr->grid_array[y0 + y - yhsize][x0 + x - xhsize].info |= CAVE_GLOW;
}
}
}
/*
- * makes a lake/collapsed current_floor_ptr->grid_array system in the center of the dungeon
+ * makes a lake/collapsed p_ptr->current_floor_ptr->grid_array system in the center of the dungeon
*/
void build_lake(int type)
{
}
/* Make the size of the dungeon */
- xsize = current_floor_ptr->width - 1;
- ysize = current_floor_ptr->height - 1;
+ xsize = p_ptr->current_floor_ptr->width - 1;
+ ysize = p_ptr->current_floor_ptr->height - 1;
x0 = xsize / 2;
y0 = ysize / 2;
for (i = 0; i <= xsize; i++)
{
place_outer_noperm_bold(y1, x1 + i);
- current_floor_ptr->grid_array[y1][x1 + i].info |= (CAVE_ROOM | CAVE_ICKY);
+ p_ptr->current_floor_ptr->grid_array[y1][x1 + i].info |= (CAVE_ROOM | CAVE_ICKY);
place_outer_noperm_bold(y2, x1 + i);
- current_floor_ptr->grid_array[y2][x1 + i].info |= (CAVE_ROOM | CAVE_ICKY);
+ p_ptr->current_floor_ptr->grid_array[y2][x1 + i].info |= (CAVE_ROOM | CAVE_ICKY);
}
/* Left and right boundaries */
for (i = 1; i < ysize; i++)
{
place_outer_noperm_bold(y1 + i, x1);
- current_floor_ptr->grid_array[y1 + i][x1].info|=(CAVE_ROOM | CAVE_ICKY);
+ p_ptr->current_floor_ptr->grid_array[y1 + i][x1].info|=(CAVE_ROOM | CAVE_ICKY);
place_outer_noperm_bold(y1 + i, x2);
- current_floor_ptr->grid_array[y1 + i][x2].info|=(CAVE_ROOM | CAVE_ICKY);
+ p_ptr->current_floor_ptr->grid_array[y1 + i][x2].info|=(CAVE_ROOM | CAVE_ICKY);
}
/* Middle */
{
/* clear the untouched region */
place_floor_bold(y1 + y, x1 + x);
- current_floor_ptr->grid_array[y1 + y][x1 + x].info |= (CAVE_ROOM | CAVE_ICKY);
+ p_ptr->current_floor_ptr->grid_array[y1 + y][x1 + x].info |= (CAVE_ROOM | CAVE_ICKY);
}
else
{
/* make it a room- but don't touch */
- current_floor_ptr->grid_array[y1 + y][x1 + x].info |= (CAVE_ROOM | CAVE_ICKY);
+ p_ptr->current_floor_ptr->grid_array[y1 + y][x1 + x].info |= (CAVE_ROOM | CAVE_ICKY);
}
}
}
msg_print_wizard(CHEAT_DUNGEON, _("迷路ランダムVaultを生成しました。", "Maze Vault."));
/* Choose lite or dark */
- light = ((current_floor_ptr->dun_level <= randint1(25)) && is_vault && !(d_info[p_ptr->dungeon_idx].flags1 & DF1_DARKNESS));
+ light = ((p_ptr->current_floor_ptr->dun_level <= randint1(25)) && is_vault && !(d_info[p_ptr->dungeon_idx].flags1 & DF1_DARKNESS));
/* Pick a random room size - randomized by calling routine */
dy = ysize / 2 - 1;
{
for (x = x1 - 1; x <= x2 + 1; x++)
{
- g_ptr = ¤t_floor_ptr->grid_array[y][x];
+ g_ptr = &p_ptr->current_floor_ptr->grid_array[y][x];
g_ptr->info |= CAVE_ROOM;
if (is_vault) g_ptr->info |= CAVE_ICKY;
if ((x == x1 - 1) || (x == x2 + 1) || (y == y1 - 1) || (y == y2 + 1))
r_visit(y1, x1, y2, x2, randint0(num_vertices), 0, visited);
/* Fill with monsters and treasure, low difficulty */
- if (is_vault) fill_treasure(current_floor_ptr, x1, x2, y1, y2, randint1(5));
+ if (is_vault) fill_treasure(p_ptr->current_floor_ptr, x1, x2, y1, y2, randint1(5));
C_KILL(visited, num_vertices, int);
}
feature_type *f_ptr;
int i, j;
- if (!in_bounds(current_floor_ptr, y, x)) return;
+ if (!in_bounds(p_ptr->current_floor_ptr, y, x)) return;
- g_ptr = ¤t_floor_ptr->grid_array[y][x];
+ g_ptr = &p_ptr->current_floor_ptr->grid_array[y][x];
/* hack- check to see if square has been visited before
* if so, then exit (use room flag to do this) */
for (x = x1; x <= x2; x++)
{
/* Point to grid */
- g_ptr = ¤t_floor_ptr->grid_array[y][x];
+ g_ptr = &p_ptr->current_floor_ptr->grid_array[y][x];
place_floor_grid(g_ptr);
g_ptr->info |= (CAVE_ROOM);
if (light) g_ptr->info |= (CAVE_GLOW);
switch (typ)
{
/* Build an appropriate room */
- case ROOM_T_NORMAL: return build_type1(current_floor_ptr);
- case ROOM_T_OVERLAP: return build_type2(current_floor_ptr);
- case ROOM_T_CROSS: return build_type3(current_floor_ptr);
- case ROOM_T_INNER_FEAT: return build_type4(current_floor_ptr);
- case ROOM_T_NEST: return build_type5(current_floor_ptr);
- case ROOM_T_PIT: return build_type6(current_floor_ptr);
+ case ROOM_T_NORMAL: return build_type1(p_ptr->current_floor_ptr);
+ case ROOM_T_OVERLAP: return build_type2(p_ptr->current_floor_ptr);
+ case ROOM_T_CROSS: return build_type3(p_ptr->current_floor_ptr);
+ case ROOM_T_INNER_FEAT: return build_type4(p_ptr->current_floor_ptr);
+ case ROOM_T_NEST: return build_type5(p_ptr->current_floor_ptr);
+ case ROOM_T_PIT: return build_type6(p_ptr->current_floor_ptr);
case ROOM_T_LESSER_VAULT: return build_type7();
case ROOM_T_GREATER_VAULT: return build_type8();
case ROOM_T_FRACAVE: return build_type9();
case ROOM_T_RANDOM_VAULT: return build_type10();
- case ROOM_T_OVAL: return build_type11(current_floor_ptr);
- case ROOM_T_CRYPT: return build_type12(current_floor_ptr);
- case ROOM_T_TRAP_PIT: return build_type13(current_floor_ptr);
+ case ROOM_T_OVAL: return build_type11(p_ptr->current_floor_ptr);
+ case ROOM_T_CRYPT: return build_type12(p_ptr->current_floor_ptr);
+ case ROOM_T_TRAP_PIT: return build_type13(p_ptr->current_floor_ptr);
case ROOM_T_TRAP: return build_type14();
case ROOM_T_GLASS: return build_type15();
case ROOM_T_ARCADE: return build_type16();
int total_prob;
int prob_list[ROOM_T_MAX];
int rooms_built = 0;
- int area_size = 100 * (current_floor_ptr->height*current_floor_ptr->width) / (MAX_HGT*MAX_WID);
- int level_index = MIN(10, div_round(current_floor_ptr->dun_level, 10));
+ int area_size = 100 * (p_ptr->current_floor_ptr->height*p_ptr->current_floor_ptr->width) / (MAX_HGT*MAX_WID);
+ int level_index = MIN(10, div_round(p_ptr->current_floor_ptr->dun_level, 10));
/* Number of each type of room on this level */
s16b room_num[ROOM_T_MAX];
/* Limit number of rooms */
int dun_rooms = DUN_ROOMS_MAX * area_size / 100;
- /* Assume normal current_floor_ptr->grid_array */
+ /* Assume normal p_ptr->current_floor_ptr->grid_array */
room_info_type *room_info_ptr = room_info_normal;
/*
for (i = 0; i < ROOM_T_MAX; i++)
{
/* No rooms allowed above their minimum depth. */
- if (current_floor_ptr->dun_level < room_info_ptr[i].min_level)
+ if (p_ptr->current_floor_ptr->dun_level < room_info_ptr[i].min_level)
{
prob_list[i] = 0;
}
MOVE_PLIST(ROOM_T_INNER_FEAT, ROOM_T_OVAL);
}
- /*! @details ダンジョンにCAVEフラグがある場合、NORMALの生成枠がFRACAVEに与えられる。/ CAVE dungeon (Orc current_floor_ptr->grid_array etc.) */
+ /*! @details ダンジョンにCAVEフラグがある場合、NORMALの生成枠がFRACAVEに与えられる。/ CAVE dungeon (Orc p_ptr->current_floor_ptr->grid_array etc.) */
else if (d_info[p_ptr->dungeon_idx].flags1 & DF1_CAVE)
{
MOVE_PLIST(ROOM_T_FRACAVE, ROOM_T_NORMAL);
#define ROOM_T_PIT 5 /*!<部屋型ID:モンスターPIT / Monster pit (33x11) */
#define ROOM_T_LESSER_VAULT 6 /*!<部屋型ID:小型VAULT / Lesser vault (33x22) */
#define ROOM_T_GREATER_VAULT 7 /*!<部屋型ID:大型VAULT / Greater vault (66x44) */
-#define ROOM_T_FRACAVE 8 /*!<部屋型ID:フラクタル地形 / Fractal current_floor_ptr->grid_array (42x24) */
+#define ROOM_T_FRACAVE 8 /*!<部屋型ID:フラクタル地形 / Fractal p_ptr->current_floor_ptr->grid_array (42x24) */
#define ROOM_T_RANDOM_VAULT 9 /*!<部屋型ID:ランダムVAULT / Random vault (44x22) */
#define ROOM_T_OVAL 10 /*!<部屋型ID:円形部屋 / Circular rooms (22x22) */
#define ROOM_T_CRYPT 11 /*!<部屋型ID:聖堂 / Crypts (22x22) */
wr_byte(p_ptr->feeling);
/* Turn when level began */
- wr_s32b(current_floor_ptr->generated_turn);
+ wr_s32b(p_ptr->current_floor_ptr->generated_turn);
/* Turn of last "feeling" */
wr_s32b(p_ptr->feeling_turn);
{
/*** Not a saved floor ***/
- wr_s16b((s16b)current_floor_ptr->dun_level);
+ wr_s16b((s16b)p_ptr->current_floor_ptr->dun_level);
}
else
{
wr_s16b(sf_ptr->lower_floor_id);
}
- wr_u16b((u16b)current_floor_ptr->base_level);
- wr_u16b((s16b)current_floor_ptr->num_repro);
+ wr_u16b((u16b)p_ptr->current_floor_ptr->base_level);
+ wr_u16b((s16b)p_ptr->current_floor_ptr->num_repro);
wr_u16b((u16b)p_ptr->y);
wr_u16b((u16b)p_ptr->x);
- wr_u16b((u16b)current_floor_ptr->height);
- wr_u16b((u16b)current_floor_ptr->width);
+ wr_u16b((u16b)p_ptr->current_floor_ptr->height);
+ wr_u16b((u16b)p_ptr->current_floor_ptr->width);
wr_byte(p_ptr->feeling);
C_MAKE(templates, max_num_temp, grid_template_type);
/* Extract template array */
- for (y = 0; y < current_floor_ptr->height; y++)
+ for (y = 0; y < p_ptr->current_floor_ptr->height; y++)
{
- for (x = 0; x < current_floor_ptr->width; x++)
+ for (x = 0; x < p_ptr->current_floor_ptr->width; x++)
{
- grid_type *g_ptr = ¤t_floor_ptr->grid_array[y][x];
+ grid_type *g_ptr = &p_ptr->current_floor_ptr->grid_array[y][x];
for (i = 0; i < num_temp; i++)
{
- /*** "Run-Length-Encoding" of current_floor_ptr->grid_array ***/
+ /*** "Run-Length-Encoding" of p_ptr->current_floor_ptr->grid_array ***/
/* Note that this will induce two wasted bytes */
count = 0;
prev_u16b = 0;
- /* Dump the current_floor_ptr->grid_array */
- for (y = 0; y < current_floor_ptr->height; y++)
+ /* Dump the p_ptr->current_floor_ptr->grid_array */
+ for (y = 0; y < p_ptr->current_floor_ptr->height; y++)
{
- for (x = 0; x < current_floor_ptr->width; x++)
+ for (x = 0; x < p_ptr->current_floor_ptr->width; x++)
{
- grid_type *g_ptr = ¤t_floor_ptr->grid_array[y][x];
+ grid_type *g_ptr = &p_ptr->current_floor_ptr->grid_array[y][x];
for (i = 0; i < num_temp; i++)
{
/*** Dump objects ***/
/* Total objects */
- wr_u16b(current_floor_ptr->o_max);
+ wr_u16b(p_ptr->current_floor_ptr->o_max);
/* Dump the objects */
- for (i = 1; i < current_floor_ptr->o_max; i++)
+ for (i = 1; i < p_ptr->current_floor_ptr->o_max; i++)
{
- object_type *o_ptr = ¤t_floor_ptr->o_list[i];
+ object_type *o_ptr = &p_ptr->current_floor_ptr->o_list[i];
/* Dump it */
wr_item(o_ptr);
/*** Dump the monsters ***/
/* Total monsters */
- wr_u16b(current_floor_ptr->m_max);
+ wr_u16b(p_ptr->current_floor_ptr->m_max);
/* Dump 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];
/* Dump it */
wr_monster(m_ptr);
saved_floor_type *cur_sf_ptr;
int i;
- forget_lite(current_floor_ptr);
+ forget_lite(p_ptr->current_floor_ptr);
forget_view();
- clear_mon_lite(current_floor_ptr);
+ clear_mon_lite(p_ptr->current_floor_ptr);
/* Update lite/view */
p_ptr->update |= (PU_VIEW | PU_LITE | PU_MON_LITE);
/* Save the level and such */
sprintf(the_score.cur_lev, "%3d", MIN((u16b)p_ptr->lev, 999));
- sprintf(the_score.cur_dun, "%3d", (int)current_floor_ptr->dun_level);
+ sprintf(the_score.cur_dun, "%3d", (int)p_ptr->current_floor_ptr->dun_level);
sprintf(the_score.max_lev, "%3d", MIN((u16b)p_ptr->max_plv, 999));
sprintf(the_score.max_dun, "%3d", (int)max_dlv[p_ptr->dungeon_idx]);
/* Save the level and such */
sprintf(the_score.cur_lev, "%3d", MIN((u16b)p_ptr->lev, 999));
- sprintf(the_score.cur_dun, "%3d", (int)current_floor_ptr->dun_level);
+ sprintf(the_score.cur_dun, "%3d", (int)p_ptr->current_floor_ptr->dun_level);
sprintf(the_score.max_lev, "%3d", MIN((u16b)p_ptr->max_plv, 999));
sprintf(the_score.max_dun, "%3d", (int)max_dlv[p_ptr->dungeon_idx]);
bool seppuku = streq(p_ptr->died_from, "Seppuku");
/* Hack -- retire in town */
- current_floor_ptr->dun_level = 0;
+ p_ptr->current_floor_ptr->dun_level = 0;
/* Fake death */
if (!seppuku)
{
POSITION *x = (POSITION*)(u);
POSITION *y = (POSITION*)(v);
- grid_type *ca_ptr = ¤t_floor_ptr->grid_array[y[a]][x[a]];
- grid_type *cb_ptr = ¤t_floor_ptr->grid_array[y[b]][x[b]];
- monster_type *ma_ptr = ¤t_floor_ptr->m_list[ca_ptr->m_idx];
- monster_type *mb_ptr = ¤t_floor_ptr->m_list[cb_ptr->m_idx];
+ grid_type *ca_ptr = &p_ptr->current_floor_ptr->grid_array[y[a]][x[a]];
+ grid_type *cb_ptr = &p_ptr->current_floor_ptr->grid_array[y[b]][x[b]];
+ monster_type *ma_ptr = &p_ptr->current_floor_ptr->m_list[ca_ptr->m_idx];
+ monster_type *mb_ptr = &p_ptr->current_floor_ptr->m_list[cb_ptr->m_idx];
monster_race *ap_ra_ptr, *ap_rb_ptr;
/* The player grid */
}
/* An object get higher priority */
- if (current_floor_ptr->grid_array[y[a]][x[a]].o_idx && !current_floor_ptr->grid_array[y[b]][x[b]].o_idx) return TRUE;
- if (!current_floor_ptr->grid_array[y[a]][x[a]].o_idx && current_floor_ptr->grid_array[y[b]][x[b]].o_idx) return FALSE;
+ if (p_ptr->current_floor_ptr->grid_array[y[a]][x[a]].o_idx && !p_ptr->current_floor_ptr->grid_array[y[b]][x[b]].o_idx) return TRUE;
+ if (!p_ptr->current_floor_ptr->grid_array[y[a]][x[a]].o_idx && p_ptr->current_floor_ptr->grid_array[y[b]][x[b]].o_idx) return FALSE;
/* Priority from the terrain */
if (f_info[ca_ptr->feat].priority > f_info[cb_ptr->feat].priority) return TRUE;
int w1 = who[a];
int w2 = who[b];
- monster_type *m_ptr1 = ¤t_floor_ptr->m_list[w1];
- monster_type *m_ptr2 = ¤t_floor_ptr->m_list[w2];
+ monster_type *m_ptr1 = &p_ptr->current_floor_ptr->m_list[w1];
+ monster_type *m_ptr2 = &p_ptr->current_floor_ptr->m_list[w2];
monster_race *r_ptr1 = &r_info[m_ptr1->r_idx];
monster_race *r_ptr2 = &r_info[m_ptr2->r_idx];
int w1 = who[a];
int w2 = who[b];
- monster_type *m_ptr1 = ¤t_floor_ptr->m_list[w1];
- monster_type *m_ptr2 = ¤t_floor_ptr->m_list[w2];
+ monster_type *m_ptr1 = &p_ptr->current_floor_ptr->m_list[w1];
+ monster_type *m_ptr2 = &p_ptr->current_floor_ptr->m_list[w2];
monster_race *r_ptr1 = &r_info[m_ptr1->r_idx];
monster_race *r_ptr2 = &r_info[m_ptr2->r_idx];
/*!
- * @brief フロア保存時のcurrent_floor_ptr->grid_array情報テンプレートをソートするための比較処理
- * @param u current_floor_ptr->grid_arrayテンプレートの参照ポインタ
+ * @brief フロア保存時のp_ptr->current_floor_ptr->grid_array情報テンプレートをソートするための比較処理
+ * @param u p_ptr->current_floor_ptr->grid_arrayテンプレートの参照ポインタ
* @param v 未使用
* @param a スワップするモンスター種族のID1
* @param b スワップするモンスター種族のID2
/*!
- * @brief フロア保存時のcurrent_floor_ptr->grid_array情報テンプレートをソートするためのスワップ処理 / Sorting hook -- Swap function
- * @param u current_floor_ptr->grid_arrayテンプレートの参照ポインタ
+ * @brief フロア保存時のp_ptr->current_floor_ptr->grid_array情報テンプレートをソートするためのスワップ処理 / Sorting hook -- Swap function
+ * @param u p_ptr->current_floor_ptr->grid_arrayテンプレートの参照ポインタ
* @param v 未使用
* @param a スワップするモンスター種族のID1
* @param b スワップするモンスター種族のID2
feature_type *f_ptr;
/* Memorize objects */
- for (i = 1; i < current_floor_ptr->o_max; i++)
+ for (i = 1; i < p_ptr->current_floor_ptr->o_max; i++)
{
- object_type *o_ptr = ¤t_floor_ptr->o_list[i];
+ object_type *o_ptr = &p_ptr->current_floor_ptr->o_list[i];
if (!OBJECT_IS_VALID(o_ptr)) continue;
if (OBJECT_IS_HELD_MONSTER(o_ptr)) continue;
}
/* Scan all normal grids */
- for (y = 1; y < current_floor_ptr->height - 1; y++)
+ for (y = 1; y < p_ptr->current_floor_ptr->height - 1; y++)
{
/* Scan all normal grids */
- for (x = 1; x < current_floor_ptr->width - 1; x++)
+ for (x = 1; x < p_ptr->current_floor_ptr->width - 1; x++)
{
- grid_type *g_ptr = ¤t_floor_ptr->grid_array[y][x];
+ grid_type *g_ptr = &p_ptr->current_floor_ptr->grid_array[y][x];
/* Memorize terrain of the grid */
g_ptr->info |= (CAVE_KNOWN);
{
POSITION yy = y + ddy_ddd[i];
POSITION xx = x + ddx_ddd[i];
- g_ptr = ¤t_floor_ptr->grid_array[yy][xx];
+ g_ptr = &p_ptr->current_floor_ptr->grid_array[yy][xx];
/* Feature code (applying "mimic" field) */
f_ptr = &f_info[get_feat_mimic(g_ptr)];
if (caster_ptr->special_defense & NINJA_S_STEALTH)
{
- if (current_floor_ptr->grid_array[caster_ptr->y][caster_ptr->x].info & CAVE_GLOW) set_superstealth(caster_ptr, FALSE);
+ if (p_ptr->current_floor_ptr->grid_array[caster_ptr->y][caster_ptr->x].info & CAVE_GLOW) set_superstealth(caster_ptr, FALSE);
}
}
POSITION y, x;
/* Forget every grid */
- for (y = 1; y < current_floor_ptr->height - 1; y++)
+ for (y = 1; y < p_ptr->current_floor_ptr->height - 1; y++)
{
- for (x = 1; x < current_floor_ptr->width - 1; x++)
+ for (x = 1; x < p_ptr->current_floor_ptr->width - 1; x++)
{
- grid_type *g_ptr = ¤t_floor_ptr->grid_array[y][x];
+ grid_type *g_ptr = &p_ptr->current_floor_ptr->grid_array[y][x];
/* Process the grid */
g_ptr->info &= ~(CAVE_MARK | CAVE_IN_DETECT | CAVE_KNOWN);
}
/* Forget every grid on horizontal edge */
- for (x = 0; x < current_floor_ptr->width; x++)
+ for (x = 0; x < p_ptr->current_floor_ptr->width; x++)
{
- current_floor_ptr->grid_array[0][x].info &= ~(CAVE_MARK);
- current_floor_ptr->grid_array[current_floor_ptr->height - 1][x].info &= ~(CAVE_MARK);
+ p_ptr->current_floor_ptr->grid_array[0][x].info &= ~(CAVE_MARK);
+ p_ptr->current_floor_ptr->grid_array[p_ptr->current_floor_ptr->height - 1][x].info &= ~(CAVE_MARK);
}
/* Forget every grid on vertical edge */
- for (y = 1; y < (current_floor_ptr->height - 1); y++)
+ for (y = 1; y < (p_ptr->current_floor_ptr->height - 1); y++)
{
- current_floor_ptr->grid_array[y][0].info &= ~(CAVE_MARK);
- current_floor_ptr->grid_array[y][current_floor_ptr->width - 1].info &= ~(CAVE_MARK);
+ p_ptr->current_floor_ptr->grid_array[y][0].info &= ~(CAVE_MARK);
+ p_ptr->current_floor_ptr->grid_array[y][p_ptr->current_floor_ptr->width - 1].info &= ~(CAVE_MARK);
}
/* Forget all objects */
- for (i = 1; i < current_floor_ptr->o_max; i++)
+ for (i = 1; i < p_ptr->current_floor_ptr->o_max; i++)
{
- object_type *o_ptr = ¤t_floor_ptr->o_list[i];
+ object_type *o_ptr = &p_ptr->current_floor_ptr->o_list[i];
if (!OBJECT_IS_VALID(o_ptr)) continue;
if (OBJECT_IS_HELD_MONSTER(o_ptr)) continue;
}
/* Create a glyph */
- current_floor_ptr->grid_array[p_ptr->y][p_ptr->x].info |= CAVE_OBJECT;
- current_floor_ptr->grid_array[p_ptr->y][p_ptr->x].mimic = feat_glyph;
+ p_ptr->current_floor_ptr->grid_array[p_ptr->y][p_ptr->x].info |= CAVE_OBJECT;
+ p_ptr->current_floor_ptr->grid_array[p_ptr->y][p_ptr->x].mimic = feat_glyph;
note_spot(p_ptr->y, p_ptr->x);
lite_spot(p_ptr->y, p_ptr->x);
}
/* Create a glyph */
- current_floor_ptr->grid_array[p_ptr->y][p_ptr->x].info |= CAVE_OBJECT;
- current_floor_ptr->grid_array[p_ptr->y][p_ptr->x].mimic = feat_explosive_rune;
+ p_ptr->current_floor_ptr->grid_array[p_ptr->y][p_ptr->x].info |= CAVE_OBJECT;
+ p_ptr->current_floor_ptr->grid_array[p_ptr->y][p_ptr->x].mimic = feat_explosive_rune;
note_spot(p_ptr->y, p_ptr->x);
lite_spot(p_ptr->y, p_ptr->x);
}
/* Create a mirror */
- current_floor_ptr->grid_array[p_ptr->y][p_ptr->x].info |= CAVE_OBJECT;
- current_floor_ptr->grid_array[p_ptr->y][p_ptr->x].mimic = feat_mirror;
+ p_ptr->current_floor_ptr->grid_array[p_ptr->y][p_ptr->x].info |= CAVE_OBJECT;
+ p_ptr->current_floor_ptr->grid_array[p_ptr->y][p_ptr->x].mimic = feat_mirror;
/* Turn on the light */
- current_floor_ptr->grid_array[p_ptr->y][p_ptr->x].info |= CAVE_GLOW;
+ p_ptr->current_floor_ptr->grid_array[p_ptr->y][p_ptr->x].info |= CAVE_GLOW;
note_spot(p_ptr->y, p_ptr->x);
lite_spot(p_ptr->y, p_ptr->x);
if (ironman_downward) up = FALSE;
/* Forbid down staircases on quest level */
- if (quest_number(current_floor_ptr->dun_level) || (current_floor_ptr->dun_level >= d_info[p_ptr->dungeon_idx].maxdepth)) down = FALSE;
+ if (quest_number(p_ptr->current_floor_ptr->dun_level) || (p_ptr->current_floor_ptr->dun_level >= d_info[p_ptr->dungeon_idx].maxdepth)) down = FALSE;
/* No effect out of standard dungeon floor */
- if (!current_floor_ptr->dun_level || (!up && !down) ||
+ if (!p_ptr->current_floor_ptr->dun_level || (!up && !down) ||
(p_ptr->inside_quest && is_fixed_quest_idx(p_ptr->inside_quest)) ||
p_ptr->inside_arena || p_ptr->phase_out)
{
{
POSITION x, y;
- for (y = 0; y < current_floor_ptr->height; y++)
+ for (y = 0; y < p_ptr->current_floor_ptr->height; y++)
{
- for (x = 0; x < current_floor_ptr->width; x++)
+ for (x = 0; x < p_ptr->current_floor_ptr->width; x++)
{
- grid_type *g_ptr = ¤t_floor_ptr->grid_array[y][x];
+ grid_type *g_ptr = &p_ptr->current_floor_ptr->grid_array[y][x];
if (!g_ptr->special) continue;
if (feat_uses_special(g_ptr->feat)) continue;
if (up)
{
cave_set_feat(p_ptr->y, p_ptr->x,
- (dest_sf_ptr->last_visit && (dest_sf_ptr->dun_level <= current_floor_ptr->dun_level - 2)) ?
+ (dest_sf_ptr->last_visit && (dest_sf_ptr->dun_level <= p_ptr->current_floor_ptr->dun_level - 2)) ?
feat_state(feat_up_stair, FF_SHAFT) : feat_up_stair);
}
else
{
cave_set_feat(p_ptr->y, p_ptr->x,
- (dest_sf_ptr->last_visit && (dest_sf_ptr->dun_level >= current_floor_ptr->dun_level + 2)) ?
+ (dest_sf_ptr->last_visit && (dest_sf_ptr->dun_level >= p_ptr->current_floor_ptr->dun_level + 2)) ?
feat_state(feat_down_stair, FF_SHAFT) : feat_down_stair);
}
/* Connect this stairs to the destination */
- current_floor_ptr->grid_array[p_ptr->y][p_ptr->x].special = dest_floor_id;
+ p_ptr->current_floor_ptr->grid_array[p_ptr->y][p_ptr->x].special = dest_floor_id;
}
/*
if (d_info[p_ptr->dungeon_idx].flags1 & DF1_DARKNESS) range /= 3;
/* Scan that area */
- for (y = 1; y < current_floor_ptr->height - 1; y++)
+ for (y = 1; y < p_ptr->current_floor_ptr->height - 1; y++)
{
- for (x = 1; x < current_floor_ptr->width - 1; x++)
+ for (x = 1; x < p_ptr->current_floor_ptr->width - 1; x++)
{
if (distance(p_ptr->y, p_ptr->x, y, x) > range) continue;
- g_ptr = ¤t_floor_ptr->grid_array[y][x];
+ g_ptr = &p_ptr->current_floor_ptr->grid_array[y][x];
/* Memorize terrain of the grid */
g_ptr->info |= (CAVE_KNOWN);
/* Memorize known walls */
for (i = 0; i < 8; i++)
{
- g_ptr = ¤t_floor_ptr->grid_array[y + ddy_ddd[i]][x + ddx_ddd[i]];
+ g_ptr = &p_ptr->current_floor_ptr->grid_array[y + ddy_ddd[i]][x + ddx_ddd[i]];
/* Feature code (applying "mimic" field) */
feat = get_feat_mimic(g_ptr);
bool flag = FALSE;
/* Prevent destruction of quest levels and town */
- if ((p_ptr->inside_quest && is_fixed_quest_idx(p_ptr->inside_quest)) || !current_floor_ptr->dun_level)
+ if ((p_ptr->inside_quest && is_fixed_quest_idx(p_ptr->inside_quest)) || !p_ptr->current_floor_ptr->dun_level)
{
return (FALSE);
}
/* Lose monster light */
- if (!in_generate) clear_mon_lite(current_floor_ptr);
+ if (!in_generate) clear_mon_lite(p_ptr->current_floor_ptr);
/* Big area of affect */
for (y = (y1 - r); y <= (y1 + r); y++)
{
for (x = (x1 - r); x <= (x1 + r); x++)
{
- if (!in_bounds(current_floor_ptr, y, x)) continue;
+ if (!in_bounds(p_ptr->current_floor_ptr, y, x)) continue;
/* Extract the distance */
k = distance(y1, x1, y, x);
/* Stay in the circle of death */
if (k > r) continue;
- g_ptr = ¤t_floor_ptr->grid_array[y][x];
+ g_ptr = &p_ptr->current_floor_ptr->grid_array[y][x];
/* Lose room and vault */
g_ptr->info &= ~(CAVE_ROOM | CAVE_ICKY);
if (g_ptr->m_idx)
{
- monster_type *m_ptr = ¤t_floor_ptr->m_list[g_ptr->m_idx];
+ monster_type *m_ptr = &p_ptr->current_floor_ptr->m_list[g_ptr->m_idx];
monster_race *r_ptr = &r_info[m_ptr->r_idx];
if (in_generate) /* In generation */
for (this_o_idx = g_ptr->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;
/* Hack -- Preserve unknown artifacts */
{
for (x = (x1 - r); x <= (x1 + r); x++)
{
- if (!in_bounds(current_floor_ptr, y, x)) continue;
+ if (!in_bounds(p_ptr->current_floor_ptr, y, x)) continue;
/* Extract the distance */
k = distance(y1, x1, y, x);
/* Stay in the circle of death */
if (k > r) continue;
- g_ptr = ¤t_floor_ptr->grid_array[y][x];
+ g_ptr = &p_ptr->current_floor_ptr->grid_array[y][x];
if (is_mirror_grid(g_ptr)) g_ptr->info |= CAVE_GLOW;
else if (!(d_info[p_ptr->dungeon_idx].flags1 & DF1_DARKNESS))
yy = y + ddy_ddd[i];
xx = x + ddx_ddd[i];
if (!in_bounds2(yy, xx)) continue;
- cc_ptr = ¤t_floor_ptr->grid_array[yy][xx];
+ cc_ptr = &p_ptr->current_floor_ptr->grid_array[yy][xx];
if (have_flag(f_info[get_feat_mimic(cc_ptr)].flags, FF_GLOW))
{
g_ptr->info |= CAVE_GLOW;
if (p_ptr->special_defense & NINJA_S_STEALTH)
{
- if (current_floor_ptr->grid_array[p_ptr->y][p_ptr->x].info & CAVE_GLOW) set_superstealth(p_ptr, FALSE);
+ if (p_ptr->current_floor_ptr->grid_array[p_ptr->y][p_ptr->x].info & CAVE_GLOW) set_superstealth(p_ptr, FALSE);
}
}
bool map[32][32];
/* Prevent destruction of quest levels and town */
- if ((p_ptr->inside_quest && is_fixed_quest_idx(p_ptr->inside_quest)) || !current_floor_ptr->dun_level)
+ if ((p_ptr->inside_quest && is_fixed_quest_idx(p_ptr->inside_quest)) || !p_ptr->current_floor_ptr->dun_level)
{
return (FALSE);
}
yy = cy + dy;
xx = cx + dx;
- if (!in_bounds(current_floor_ptr, yy, xx)) continue;
+ if (!in_bounds(p_ptr->current_floor_ptr, yy, xx)) continue;
/* Skip distant grids */
if (distance(cy, cx, yy, xx) > r) continue;
- g_ptr = ¤t_floor_ptr->grid_array[yy][xx];
+ g_ptr = &p_ptr->current_floor_ptr->grid_array[yy][xx];
/* Lose room and vault / Lose light and knowledge */
g_ptr->info &= ~(CAVE_ROOM | CAVE_ICKY | CAVE_UNSAFE);
/* Important -- Skip "quake" grids */
if (map[16 + y - cy][16 + x - cx]) continue;
- if (current_floor_ptr->grid_array[y][x].m_idx) continue;
+ if (p_ptr->current_floor_ptr->grid_array[y][x].m_idx) continue;
/* Count "safe" grids */
sn++;
{
case 1:
{
- msg_print(_("ダンジョンの壁が崩れた!", "The current_floor_ptr->grid_array ceiling collapses!"));
+ msg_print(_("ダンジョンの壁が崩れた!", "The p_ptr->current_floor_ptr->grid_array ceiling collapses!"));
break;
}
case 2:
{
- msg_print(_("ダンジョンの床が不自然にねじ曲がった!", "The current_floor_ptr->grid_array floor twists in an unnatural way!"));
+ msg_print(_("ダンジョンの床が不自然にねじ曲がった!", "The p_ptr->current_floor_ptr->grid_array floor twists in an unnatural way!"));
break;
}
default:
{
- msg_print(_("ダンジョンが揺れた!崩れた岩が頭に降ってきた!", "The current_floor_ptr->grid_array quakes! You are pummeled with debris!"));
+ msg_print(_("ダンジョンが揺れた!崩れた岩が頭に降ってきた!", "The p_ptr->current_floor_ptr->grid_array quakes! You are pummeled with debris!"));
break;
}
}
if (m_idx)
{
GAME_TEXT m_name[MAX_NLEN];
- 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, MD_WRONGDOER_NAME);
killer = format(_("%sの起こした地震", "an earthquake caused by %s"), m_name);
}
/* Skip unaffected grids */
if (!map[16 + yy - cy][16 + xx - cx]) continue;
- g_ptr = ¤t_floor_ptr->grid_array[yy][xx];
+ g_ptr = &p_ptr->current_floor_ptr->grid_array[yy][xx];
if (g_ptr->m_idx == p_ptr->riding) continue;
/* Process monsters */
if (g_ptr->m_idx)
{
- monster_type *m_ptr = ¤t_floor_ptr->m_list[g_ptr->m_idx];
+ monster_type *m_ptr = &p_ptr->current_floor_ptr->m_list[g_ptr->m_idx];
monster_race *r_ptr = &r_info[m_ptr->r_idx];
/* Quest monsters */
if (!cave_empty_bold(y, x)) continue;
/* Hack -- no safety on glyph of warding */
- if (is_glyph_grid(¤t_floor_ptr->grid_array[y][x])) continue;
- if (is_explosive_rune_grid(¤t_floor_ptr->grid_array[y][x])) continue;
+ if (is_glyph_grid(&p_ptr->current_floor_ptr->grid_array[y][x])) continue;
+ if (is_explosive_rune_grid(&p_ptr->current_floor_ptr->grid_array[y][x])) continue;
/* ... nor on the Pattern */
if (pattern_tile(y, x)) continue;
/* Important -- Skip "quake" grids */
if (map[16 + y - cy][16 + x - cx]) continue;
- if (current_floor_ptr->grid_array[y][x].m_idx) continue;
+ if (p_ptr->current_floor_ptr->grid_array[y][x].m_idx) continue;
if (player_bold(y, x)) continue;
/* Count "safe" grids */
if (g_ptr->m_idx)
{
- if (record_named_pet && is_pet(¤t_floor_ptr->m_list[g_ptr->m_idx]) && current_floor_ptr->m_list[g_ptr->m_idx].nickname)
+ if (record_named_pet && is_pet(&p_ptr->current_floor_ptr->m_list[g_ptr->m_idx]) && p_ptr->current_floor_ptr->m_list[g_ptr->m_idx].nickname)
{
char m2_name[MAX_NLEN];
/* Hack -- Escape from the rock */
if (sn)
{
- IDX m_idx_aux = current_floor_ptr->grid_array[yy][xx].m_idx;
+ IDX m_idx_aux = p_ptr->current_floor_ptr->grid_array[yy][xx].m_idx;
/* Update the old location */
- current_floor_ptr->grid_array[yy][xx].m_idx = 0;
+ p_ptr->current_floor_ptr->grid_array[yy][xx].m_idx = 0;
/* Update the new location */
- current_floor_ptr->grid_array[sy][sx].m_idx = m_idx_aux;
+ p_ptr->current_floor_ptr->grid_array[sy][sx].m_idx = m_idx_aux;
/* Move the monster */
m_ptr->fy = sy;
}
/* Lose monster light */
- clear_mon_lite(current_floor_ptr);
+ clear_mon_lite(p_ptr->current_floor_ptr);
/* Examine the quaked region */
for (dy = -r; dy <= r; dy++)
/* Skip unaffected grids */
if (!map[16 + yy - cy][16 + xx - cx]) continue;
- g_ptr = ¤t_floor_ptr->grid_array[yy][xx];
+ g_ptr = &p_ptr->current_floor_ptr->grid_array[yy][xx];
/* Paranoia -- never affect player */
/* if (player_bold(yy, xx)) continue; */
yy = cy + dy;
xx = cx + dx;
- if (!in_bounds(current_floor_ptr, yy, xx)) continue;
+ if (!in_bounds(p_ptr->current_floor_ptr, yy, xx)) continue;
/* Skip distant grids */
if (distance(cy, cx, yy, xx) > r) continue;
- g_ptr = ¤t_floor_ptr->grid_array[yy][xx];
+ g_ptr = &p_ptr->current_floor_ptr->grid_array[yy][xx];
if (is_mirror_grid(g_ptr)) g_ptr->info |= CAVE_GLOW;
else if (!(d_info[p_ptr->dungeon_idx].flags1 & DF1_DARKNESS))
yyy = yy + ddy_ddd[ii];
xxx = xx + ddx_ddd[ii];
if (!in_bounds2(yyy, xxx)) continue;
- cc_ptr = ¤t_floor_ptr->grid_array[yyy][xxx];
+ cc_ptr = &p_ptr->current_floor_ptr->grid_array[yyy][xxx];
if (have_flag(f_info[get_feat_mimic(cc_ptr)].flags, FF_GLOW))
{
g_ptr->info |= CAVE_GLOW;
if (p_ptr->special_defense & NINJA_S_STEALTH)
{
- if (current_floor_ptr->grid_array[p_ptr->y][p_ptr->x].info & CAVE_GLOW) set_superstealth(p_ptr, FALSE);
+ if (p_ptr->current_floor_ptr->grid_array[p_ptr->y][p_ptr->x].info & CAVE_GLOW) set_superstealth(p_ptr, FALSE);
}
/* Success */
if (!get_rep_dir(&dir, FALSE)) return FALSE;
y = creature_ptr->y + ddy[dir];
x = creature_ptr->x + ddx[dir];
- g_ptr = ¤t_floor_ptr->grid_array[y][x];
+ g_ptr = &p_ptr->current_floor_ptr->grid_array[y][x];
if (!have_flag(f_info[get_feat_mimic(g_ptr)].flags, FF_CAN_DIG))
{
}
object_prep(q_ptr, lookup_kind(dummy, dummy2));
- q_ptr->to_h = 3 + randint1(current_floor_ptr->dun_level) % 10;
- q_ptr->to_d = 3 + randint1(current_floor_ptr->dun_level) % 10;
+ q_ptr->to_h = 3 + randint1(p_ptr->current_floor_ptr->dun_level) % 10;
+ q_ptr->to_d = 3 + randint1(p_ptr->current_floor_ptr->dun_level) % 10;
one_resistance(q_ptr);
q_ptr->name2 = EGO_CHAOTIC;
(void)drop_near(q_ptr, -1, creature_ptr->y, creature_ptr->x);
act = _("は鋭さを増した!", "becomes very sharp!");
o_ptr->name2 = EGO_SHARPNESS;
- o_ptr->pval = (PARAMETER_VALUE)m_bonus(5, current_floor_ptr->dun_level) + 1;
+ o_ptr->pval = (PARAMETER_VALUE)m_bonus(5, p_ptr->current_floor_ptr->dun_level) + 1;
if ((o_ptr->sval == SV_HAYABUSA) && (o_ptr->pval > 2))
o_ptr->pval = 2;
{
act = _("は破壊力を増した!", "seems very powerful.");
o_ptr->name2 = EGO_EARTHQUAKES;
- o_ptr->pval = (PARAMETER_VALUE)m_bonus(3, current_floor_ptr->dun_level);
+ o_ptr->pval = (PARAMETER_VALUE)m_bonus(3, p_ptr->current_floor_ptr->dun_level);
}
break;
case 16:
msg_print(_("そこは水辺ではない。", "There is no fishing place."));
return FALSE;
}
- else if (current_floor_ptr->grid_array[y][x].m_idx)
+ else if (p_ptr->current_floor_ptr->grid_array[y][x].m_idx)
{
GAME_TEXT m_name[MAX_NLEN];
- monster_desc(m_name, ¤t_floor_ptr->m_list[current_floor_ptr->grid_array[y][x].m_idx], 0);
+ monster_desc(m_name, &p_ptr->current_floor_ptr->m_list[p_ptr->current_floor_ptr->grid_array[y][x].m_idx], 0);
msg_format(_("%sが邪魔だ!", "%^s is stand in your way."), m_name);
free_turn(creature_ptr);
return FALSE;
inven_item_increase(inv, (0 - o_ptr->number));
inven_item_optimize(inv);
o_idx = drop_near(&forge, 0, creature_ptr->y, creature_ptr->x);
- o_ptr = ¤t_floor_ptr->o_list[o_idx];
+ o_ptr = &p_ptr->current_floor_ptr->o_list[o_idx];
object_desc(o_name, o_ptr, OD_NAME_ONLY);
msg_format(_("%sを脱ぎ捨てた。", "You cast off %s."), o_name);
int summon_cyber(MONSTER_IDX who, POSITION y, POSITION x)
{
int i;
- int max_cyber = (easy_band ? 1 : (current_floor_ptr->dun_level / 50) + randint1(2));
+ int max_cyber = (easy_band ? 1 : (p_ptr->current_floor_ptr->dun_level / 50) + randint1(2));
int count = 0;
BIT_FLAGS mode = PM_ALLOW_GROUP;
/* Summoned by a monster */
if (who > 0)
{
- monster_type *m_ptr = ¤t_floor_ptr->m_list[who];
+ monster_type *m_ptr = &p_ptr->current_floor_ptr->m_list[who];
if (is_pet(m_ptr)) mode |= PM_FORCE_PET;
}
}
if (!count)
{
- for (i = current_floor_ptr->m_max - 1; i > 0; i--)
+ for (i = p_ptr->current_floor_ptr->m_max - 1; i > 0; i--)
{
- m_ptr = ¤t_floor_ptr->m_list[i];
+ m_ptr = &p_ptr->current_floor_ptr->m_list[i];
if (!monster_is_valid(m_ptr)) continue;
if (!((m_ptr->r_idx == MON_SUKE) || (m_ptr->r_idx == MON_KAKU))) continue;
if (!los(m_ptr->fy, m_ptr->fx, p_ptr->y, p_ptr->x)) continue;
/* Is "teleport level" ineffective to this target? */
#define TELE_LEVEL_IS_INEFF(TARGET) \
(p_ptr->inside_arena || p_ptr->phase_out || \
- (p_ptr->inside_quest && !random_quest_number(current_floor_ptr->dun_level)) || \
- (((TARGET) <= 0) && (quest_number(current_floor_ptr->dun_level) || (current_floor_ptr->dun_level >= d_info[p_ptr->dungeon_idx].maxdepth)) && \
- (current_floor_ptr->dun_level >= 1) && ironman_downward))
+ (p_ptr->inside_quest && !random_quest_number(p_ptr->current_floor_ptr->dun_level)) || \
+ (((TARGET) <= 0) && (quest_number(p_ptr->current_floor_ptr->dun_level) || (p_ptr->current_floor_ptr->dun_level >= d_info[p_ptr->dungeon_idx].maxdepth)) && \
+ (p_ptr->current_floor_ptr->dun_level >= 1) && ironman_downward))
POSITION x, y;
int num;
- for (x = 0; x < current_floor_ptr->width; x++)
+ for (x = 0; x < p_ptr->current_floor_ptr->width; x++)
{
- for (y = 0; y < current_floor_ptr->height; y++)
+ for (y = 0; y < p_ptr->current_floor_ptr->height; y++)
{
- if (is_mirror_grid(¤t_floor_ptr->grid_array[y][x])) {
+ if (is_mirror_grid(&p_ptr->current_floor_ptr->grid_array[y][x])) {
mirror_y[mirror_num] = y;
mirror_x[mirror_num] = x;
mirror_num++;
*/
static bool project_f(MONSTER_IDX who, POSITION r, POSITION y, POSITION x, HIT_POINT dam, EFFECT_ID typ)
{
- grid_type *g_ptr = ¤t_floor_ptr->grid_array[y][x];
+ grid_type *g_ptr = &p_ptr->current_floor_ptr->grid_array[y][x];
feature_type *f_ptr = &f_info[g_ptr->feat];
bool obvious = FALSE;
/* Turn off the light. */
if (do_dark)
{
- if (current_floor_ptr->dun_level || !is_daytime())
+ if (p_ptr->current_floor_ptr->dun_level || !is_daytime())
{
for (j = 0; j < 9; j++)
{
if (in_bounds2(by, bx))
{
- grid_type *cc_ptr = ¤t_floor_ptr->grid_array[by][bx];
+ grid_type *cc_ptr = &p_ptr->current_floor_ptr->grid_array[by][bx];
if (have_flag(f_info[get_feat_mimic(cc_ptr)].flags, FF_GLOW))
{
*/
static bool project_o(MONSTER_IDX who, POSITION r, POSITION y, POSITION x, HIT_POINT dam, EFFECT_ID typ)
{
- grid_type *g_ptr = ¤t_floor_ptr->grid_array[y][x];
+ grid_type *g_ptr = &p_ptr->current_floor_ptr->grid_array[y][x];
OBJECT_IDX this_o_idx, next_o_idx = 0;
/* Scan all objects in the grid */
for (this_o_idx = g_ptr->o_idx; this_o_idx; this_o_idx = next_o_idx)
{
- object_type *o_ptr = ¤t_floor_ptr->o_list[this_o_idx];
+ object_type *o_ptr = &p_ptr->current_floor_ptr->o_list[this_o_idx];
bool is_art = FALSE;
bool ignore = FALSE;
int i;
BIT_FLAGS mode = 0L;
- if (!who || is_pet(¤t_floor_ptr->m_list[who]))
+ if (!who || is_pet(&p_ptr->current_floor_ptr->m_list[who]))
mode |= PM_FORCE_PET;
for (i = 0; i < o_ptr->number ; i++)
{
int tmp;
- 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 = ¤t_floor_ptr->m_list[g_ptr->m_idx];
- monster_type *caster_ptr = (who > 0) ? ¤t_floor_ptr->m_list[who] : NULL;
+ monster_type *m_ptr = &p_ptr->current_floor_ptr->m_list[g_ptr->m_idx];
+ monster_type *caster_ptr = (who > 0) ? &p_ptr->current_floor_ptr->m_list[who] : NULL;
monster_race *r_ptr = &r_info[m_ptr->r_idx];
}
/* Hack -- Get new monster */
- m_ptr = ¤t_floor_ptr->m_list[g_ptr->m_idx];
+ m_ptr = &p_ptr->current_floor_ptr->m_list[g_ptr->m_idx];
/* Hack -- Get new race */
r_ptr = &r_info[m_ptr->r_idx];
x = m_ptr->fx;
/* Hack -- get new grid */
- g_ptr = ¤t_floor_ptr->grid_array[y][x];
+ g_ptr = &p_ptr->current_floor_ptr->grid_array[y][x];
}
/* Fear */
}
else
{
- current_floor_ptr->monster_noise = TRUE;
+ p_ptr->current_floor_ptr->monster_noise = TRUE;
}
}
}
else
{
- current_floor_ptr->monster_noise = TRUE;
+ p_ptr->current_floor_ptr->monster_noise = TRUE;
}
/* Hack -- handle sleep */
{
do
{
- t_y = current_floor_ptr->m_list[who].fy - 1 + randint1(3);
- t_x = current_floor_ptr->m_list[who].fx - 1 + randint1(3);
+ t_y = p_ptr->current_floor_ptr->m_list[who].fy - 1 + randint1(3);
+ t_x = p_ptr->current_floor_ptr->m_list[who].fx - 1 + randint1(3);
max_attempts--;
}
while (max_attempts && in_bounds2u(t_y, t_x) && !projectable(p_ptr->y, p_ptr->x, t_y, t_x));
if (max_attempts < 1)
{
- t_y = current_floor_ptr->m_list[who].fy;
- t_x = current_floor_ptr->m_list[who].fx;
+ t_y = p_ptr->current_floor_ptr->m_list[who].fy;
+ t_x = p_ptr->current_floor_ptr->m_list[who].fx;
}
}
else
if (who > 0)
{
- m_ptr = ¤t_floor_ptr->m_list[who];
+ m_ptr = &p_ptr->current_floor_ptr->m_list[who];
rlev = (((&r_info[m_ptr->r_idx])->level >= 1) ? (&r_info[m_ptr->r_idx])->level : 1);
monster_desc(m_name, m_ptr, 0);
if ((ax < 2) && (ay < 2)) return (TRUE);
/* Paranoia -- require "safe" origin */
- /* if (!in_bounds(current_floor_ptr, y1, x1)) return (FALSE); */
+ /* if (!in_bounds(p_ptr->current_floor_ptr, y1, x1)) return (FALSE); */
/* Directly South/North */
if (!dx)
for (x = bx - cdis; x <= bx + cdis; x++)
{
/* Ignore "illegal" locations */
- if (!in_bounds(current_floor_ptr, y, x)) continue;
+ if (!in_bounds(p_ptr->current_floor_ptr, y, x)) continue;
/* Enforce a circular "ripple" */
if (distance(y1, x1, y, x) != bdis) continue;
/* Start at monster */
else if (who > 0)
{
- x1 = current_floor_ptr->m_list[who].fx;
- y1 = current_floor_ptr->m_list[who].fy;
- monster_desc(who_name, ¤t_floor_ptr->m_list[who], MD_WRONGDOER_NAME);
+ x1 = p_ptr->current_floor_ptr->m_list[who].fx;
+ y1 = p_ptr->current_floor_ptr->m_list[who].fy;
+ monster_desc(who_name, &p_ptr->current_floor_ptr->m_list[who], MD_WRONGDOER_NAME);
}
else
}
}
if (project_o(0, 0, y, x, dam, GF_SEEKER))notice = TRUE;
- if (is_mirror_grid(¤t_floor_ptr->grid_array[y][x]))
+ if (is_mirror_grid(&p_ptr->current_floor_ptr->grid_array[y][x]))
{
/* The target of monsterspell becomes tha mirror(broken) */
monster_target_y = y;
x = GRID_X(path_g[j]);
if (project_m(0, 0, y, x, dam, GF_SEEKER, flg, TRUE)) notice = TRUE;
if (!who && (project_m_n == 1) && !jump) {
- if (current_floor_ptr->grid_array[project_m_y][project_m_x].m_idx > 0) {
- monster_type *m_ptr = ¤t_floor_ptr->m_list[current_floor_ptr->grid_array[project_m_y][project_m_x].m_idx];
+ if (p_ptr->current_floor_ptr->grid_array[project_m_y][project_m_x].m_idx > 0) {
+ monster_type *m_ptr = &p_ptr->current_floor_ptr->m_list[p_ptr->current_floor_ptr->grid_array[project_m_y][project_m_x].m_idx];
if (m_ptr->ml)
{
if (!p_ptr->image) monster_race_track(m_ptr->ap_r_idx);
- health_track(current_floor_ptr->grid_array[project_m_y][project_m_x].m_idx);
+ health_track(p_ptr->current_floor_ptr->grid_array[project_m_y][project_m_x].m_idx);
}
}
}
if (project_m(0, 0, py, px, dam, GF_SEEKER, flg, TRUE))
notice = TRUE;
if (!who && (project_m_n == 1) && !jump) {
- if (current_floor_ptr->grid_array[project_m_y][project_m_x].m_idx > 0)
+ if (p_ptr->current_floor_ptr->grid_array[project_m_y][project_m_x].m_idx > 0)
{
- monster_type *m_ptr = ¤t_floor_ptr->m_list[current_floor_ptr->grid_array[project_m_y][project_m_x].m_idx];
+ monster_type *m_ptr = &p_ptr->current_floor_ptr->m_list[p_ptr->current_floor_ptr->grid_array[project_m_y][project_m_x].m_idx];
if (m_ptr->ml)
{
if (!p_ptr->image) monster_race_track(m_ptr->ap_r_idx);
- health_track(current_floor_ptr->grid_array[project_m_y][project_m_x].m_idx);
+ health_track(p_ptr->current_floor_ptr->grid_array[project_m_y][project_m_x].m_idx);
}
}
}
if( second_step )continue;
break;
}
- if( is_mirror_grid(¤t_floor_ptr->grid_array[y][x]) && !second_step )
+ if( is_mirror_grid(&p_ptr->current_floor_ptr->grid_array[y][x]) && !second_step )
{
/* The target of monsterspell becomes tha mirror(broken) */
monster_target_y = y;
px = GRID_X(path_g[i]);
(void)project_m(0, 0, py, px, dam, GF_SUPER_RAY, flg, TRUE);
if(!who && (project_m_n == 1) && !jump){
- if(current_floor_ptr->grid_array[project_m_y][project_m_x].m_idx >0 ){
- monster_type *m_ptr = ¤t_floor_ptr->m_list[current_floor_ptr->grid_array[project_m_y][project_m_x].m_idx];
+ if(p_ptr->current_floor_ptr->grid_array[project_m_y][project_m_x].m_idx >0 ){
+ monster_type *m_ptr = &p_ptr->current_floor_ptr->m_list[p_ptr->current_floor_ptr->grid_array[project_m_y][project_m_x].m_idx];
if (m_ptr->ml)
{
if (!p_ptr->image) monster_race_track(m_ptr->ap_r_idx);
- health_track(current_floor_ptr->grid_array[project_m_y][project_m_x].m_idx);
+ health_track(p_ptr->current_floor_ptr->grid_array[project_m_y][project_m_x].m_idx);
}
}
}
if (flg & PROJECT_KILL)
{
- see_s_msg = (who > 0) ? is_seen(¤t_floor_ptr->m_list[who]) :
+ see_s_msg = (who > 0) ? is_seen(&p_ptr->current_floor_ptr->m_list[who]) :
(!who ? TRUE : (player_can_see_bold(y1, x1) && projectable(p_ptr->y, p_ptr->x, y1, x1)));
}
/* A single bolt may be reflected */
if (grids <= 1)
{
- monster_type *m_ptr = ¤t_floor_ptr->m_list[current_floor_ptr->grid_array[y][x].m_idx];
+ monster_type *m_ptr = &p_ptr->current_floor_ptr->m_list[p_ptr->current_floor_ptr->grid_array[y][x].m_idx];
monster_race *ref_ptr = &r_info[m_ptr->r_idx];
- if ((flg & PROJECT_REFLECTABLE) && current_floor_ptr->grid_array[y][x].m_idx && (ref_ptr->flags2 & RF2_REFLECTING) &&
- ((current_floor_ptr->grid_array[y][x].m_idx != p_ptr->riding) || !(flg & PROJECT_PLAYER)) &&
+ if ((flg & PROJECT_REFLECTABLE) && p_ptr->current_floor_ptr->grid_array[y][x].m_idx && (ref_ptr->flags2 & RF2_REFLECTING) &&
+ ((p_ptr->current_floor_ptr->grid_array[y][x].m_idx != p_ptr->riding) || !(flg & PROJECT_PLAYER)) &&
(!who || dist_hack > 1) && !one_in_(10))
{
POSITION t_y, t_x;
else flg |= PROJECT_PLAYER;
/* The bolt is reflected */
- project(current_floor_ptr->grid_array[y][x].m_idx, 0, t_y, t_x, dam, typ, flg, monspell);
+ project(p_ptr->current_floor_ptr->grid_array[y][x].m_idx, 0, t_y, t_x, dam, typ, flg, monspell);
/* Don't affect the monster any longer */
continue;
y = project_m_y;
/* Track if possible */
- if (current_floor_ptr->grid_array[y][x].m_idx > 0)
+ if (p_ptr->current_floor_ptr->grid_array[y][x].m_idx > 0)
{
- monster_type *m_ptr = ¤t_floor_ptr->m_list[current_floor_ptr->grid_array[y][x].m_idx];
+ monster_type *m_ptr = &p_ptr->current_floor_ptr->m_list[p_ptr->current_floor_ptr->grid_array[y][x].m_idx];
if (m_ptr->ml)
{
if (!p_ptr->image) monster_race_track(m_ptr->ap_r_idx);
- health_track(current_floor_ptr->grid_array[y][x].m_idx);
+ health_track(p_ptr->current_floor_ptr->grid_array[y][x].m_idx);
}
}
}
{
GAME_TEXT m_name[MAX_NLEN];
- monster_desc(m_name, ¤t_floor_ptr->m_list[p_ptr->riding], 0);
+ monster_desc(m_name, &p_ptr->current_floor_ptr->m_list[p_ptr->riding], 0);
if (rakubadam_m > 0)
{
monster_target_y = p_ptr->y;
monster_target_x = p_ptr->x;
- for (x = 0; x < current_floor_ptr->width; x++)
+ for (x = 0; x < p_ptr->current_floor_ptr->width; x++)
{
- for (y = 0; y < current_floor_ptr->height; y++)
+ for (y = 0; y < p_ptr->current_floor_ptr->height; y++)
{
- if (is_mirror_grid(¤t_floor_ptr->grid_array[y][x]) &&
+ if (is_mirror_grid(&p_ptr->current_floor_ptr->grid_array[y][x]) &&
distance(p_ptr->y, p_ptr->x, y, x) <= MAX_RANGE &&
distance(p_ptr->y, p_ptr->x, y, x) != 0 &&
player_has_los_bold(y, x) &&
{
POSITION x, y;
- for (x = 0; x < current_floor_ptr->width; x++)
+ for (x = 0; x < p_ptr->current_floor_ptr->width; x++)
{
- for (y = 0; y < current_floor_ptr->height; y++)
+ for (y = 0; y < p_ptr->current_floor_ptr->height; y++)
{
- if (is_mirror_grid(¤t_floor_ptr->grid_array[y][x]))
+ if (is_mirror_grid(&p_ptr->current_floor_ptr->grid_array[y][x]))
{
if (project_m(0, 0, y, x, dam, GF_GENOCIDE,
(PROJECT_GRID | PROJECT_ITEM | PROJECT_KILL | PROJECT_JUMP), TRUE))
{
- if (!current_floor_ptr->grid_array[y][x].m_idx)
+ if (!p_ptr->current_floor_ptr->grid_array[y][x].m_idx)
{
remove_mirror(y, x);
}
if (d_info[p_ptr->dungeon_idx].flags1 & DF1_DARKNESS) range /= 3;
/* Scan the current panel */
- for (y = 1; y < current_floor_ptr->height - 1; y++)
+ for (y = 1; y < p_ptr->current_floor_ptr->height - 1; y++)
{
- for (x = 1; x <= current_floor_ptr->width - 1; x++)
+ for (x = 1; x <= p_ptr->current_floor_ptr->width - 1; x++)
{
int dist = distance(p_ptr->y, p_ptr->x, y, x);
if (dist > range) continue;
- g_ptr = ¤t_floor_ptr->grid_array[y][x];
+ g_ptr = &p_ptr->current_floor_ptr->grid_array[y][x];
/* Hack -- Safe */
if (flag == FF_TRAP)
if (d_info[p_ptr->dungeon_idx].flags1 & DF1_DARKNESS) range2 /= 3;
/* Scan objects */
- for (i = 1; i < current_floor_ptr->o_max; i++)
+ for (i = 1; i < p_ptr->current_floor_ptr->o_max; i++)
{
- object_type *o_ptr = ¤t_floor_ptr->o_list[i];
+ object_type *o_ptr = &p_ptr->current_floor_ptr->o_list[i];
if (!OBJECT_IS_VALID(o_ptr)) continue;
if (OBJECT_IS_HELD_MONSTER(o_ptr)) continue;
if (d_info[p_ptr->dungeon_idx].flags1 & DF1_DARKNESS) range2 /= 3;
/* Scan objects */
- for (i = 1; i < current_floor_ptr->o_max; i++)
+ for (i = 1; i < p_ptr->current_floor_ptr->o_max; i++)
{
- object_type *o_ptr = ¤t_floor_ptr->o_list[i];
+ object_type *o_ptr = &p_ptr->current_floor_ptr->o_list[i];
if (!OBJECT_IS_VALID(o_ptr)) continue;
if (OBJECT_IS_HELD_MONSTER(o_ptr)) continue;
if (d_info[p_ptr->dungeon_idx].flags1 & DF1_DARKNESS) range /= 3;
/* Scan all objects */
- for (i = 1; i < current_floor_ptr->o_max; i++)
+ for (i = 1; i < p_ptr->current_floor_ptr->o_max; i++)
{
- object_type *o_ptr = ¤t_floor_ptr->o_list[i];
+ object_type *o_ptr = &p_ptr->current_floor_ptr->o_list[i];
if (!OBJECT_IS_VALID(o_ptr)) continue;
if (OBJECT_IS_HELD_MONSTER(o_ptr)) continue;
if (d_info[p_ptr->dungeon_idx].flags1 & DF1_DARKNESS) range /= 3;
- 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];
if (!monster_is_valid(m_ptr)) continue;
if (d_info[p_ptr->dungeon_idx].flags1 & DF1_DARKNESS) range /= 3;
- 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];
if (!monster_is_valid(m_ptr)) continue;
if (d_info[p_ptr->dungeon_idx].flags1 & DF1_DARKNESS) range /= 3;
- 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];
if (!monster_is_valid(m_ptr)) continue;
if (d_info[p_ptr->dungeon_idx].flags1 & DF1_DARKNESS) range /= 3;
- 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;
y = m_ptr->fy;
if (d_info[p_ptr->dungeon_idx].flags1 & DF1_DARKNESS) range /= 3;
- 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];
if (!monster_is_valid(m_ptr)) continue;
if (d_info[p_ptr->dungeon_idx].flags1 & DF1_DARKNESS) range /= 3;
- 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];
if (!monster_is_valid(m_ptr)) continue;
if (d_info[p_ptr->dungeon_idx].flags1 & DF1_DARKNESS) range /= 3;
- 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];
if (!monster_is_valid(m_ptr)) continue;
bool obvious = FALSE;
/* Mark all (nearby) 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];
if (!monster_is_valid(m_ptr)) continue;
y = m_ptr->fy;
}
/* Affect all marked 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];
/* Skip unmarked monsters */
if (!(m_ptr->mflag & (MFLAG_LOS))) continue;
bool speed = FALSE;
/* Aggravate everyone nearby */
- 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;
/* Skip aggravating monster (or player) */
bool genocide_aux(MONSTER_IDX m_idx, int power, bool player_cast, int dam_side, concptr spell_name)
{
int msec = delay_factor * delay_factor * delay_factor;
- 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];
bool resist = FALSE;
if (r_ptr->flags1 & (RF1_UNIQUE | RF1_QUESTOR)) resist = TRUE;
else if (r_ptr->flags7 & RF7_UNIQUE2) resist = TRUE;
else if (m_idx == p_ptr->riding) resist = TRUE;
- else if ((p_ptr->inside_quest && !random_quest_number(current_floor_ptr->dun_level)) || p_ptr->inside_arena || p_ptr->phase_out) resist = TRUE;
+ else if ((p_ptr->inside_quest && !random_quest_number(p_ptr->current_floor_ptr->dun_level)) || p_ptr->inside_arena || p_ptr->phase_out) resist = TRUE;
else if (player_cast && (r_ptr->level > randint0(power))) resist = TRUE;
else if (player_cast && (m_ptr->mflag2 & MFLAG2_NOGENO)) resist = TRUE;
bool result = FALSE;
/* Prevent genocide in quest levels */
- if ((p_ptr->inside_quest && !random_quest_number(current_floor_ptr->dun_level)) || p_ptr->inside_arena || p_ptr->phase_out)
+ if ((p_ptr->inside_quest && !random_quest_number(p_ptr->current_floor_ptr->dun_level)) || p_ptr->inside_arena || p_ptr->phase_out)
{
msg_print(_("何も起きないようだ……", "It seems nothing happen here..."));
return (FALSE);
while (!get_com(_("どの種類(文字)のモンスターを抹殺しますか: ", "Choose a monster race (by symbol) to genocide: "), &typ, FALSE)) ;
/* Delete the monsters of that "type" */
- 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];
if (!monster_is_valid(m_ptr)) continue;
bool result = FALSE;
/* Prevent mass genocide in quest levels */
- if ((p_ptr->inside_quest && !random_quest_number(current_floor_ptr->dun_level)) || p_ptr->inside_arena || p_ptr->phase_out)
+ if ((p_ptr->inside_quest && !random_quest_number(p_ptr->current_floor_ptr->dun_level)) || p_ptr->inside_arena || p_ptr->phase_out)
{
return (FALSE);
}
/* Delete the (nearby) 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];
if (!monster_is_valid(m_ptr)) continue;
/* Skip distant monsters */
bool result = FALSE;
/* Prevent mass genocide in quest levels */
- if ((p_ptr->inside_quest && !random_quest_number(current_floor_ptr->dun_level)) || p_ptr->inside_arena || p_ptr->phase_out)
+ if ((p_ptr->inside_quest && !random_quest_number(p_ptr->current_floor_ptr->dun_level)) || p_ptr->inside_arena || p_ptr->phase_out)
{
return (FALSE);
}
/* Delete the (nearby) 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];
if (!monster_is_valid(m_ptr)) continue;
Term->scr->cv = 1;
/* Probe all (nearby) 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];
if (!monster_is_valid(m_ptr)) continue;
MONSTER_IDX i;
bool okay = TRUE;
- 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 (!m_ptr->r_idx || !is_pet(m_ptr)) continue;
if (m_ptr->nickname) okay = FALSE;
}
if (!get_check(_("本当に全ペットを爆破しますか?", "You will blast all pets. Are you sure? ")))
return;
}
- for (i = 1; i < current_floor_ptr->m_max; i++)
+ for (i = 1; i < p_ptr->current_floor_ptr->m_max; i++)
{
HIT_POINT dam;
- 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;
if (!m_ptr->r_idx || !is_pet(m_ptr)) continue;
POSITION y = tmp_pos.y[i];
POSITION x = tmp_pos.x[i];
- grid_type *g_ptr = ¤t_floor_ptr->grid_array[y][x];
+ grid_type *g_ptr = &p_ptr->current_floor_ptr->grid_array[y][x];
/* No longer in the array */
g_ptr->info &= ~(CAVE_TEMP);
if (g_ptr->m_idx)
{
PERCENTAGE chance = 25;
- monster_type *m_ptr = ¤t_floor_ptr->m_list[g_ptr->m_idx];
+ monster_type *m_ptr = &p_ptr->current_floor_ptr->m_list[g_ptr->m_idx];
monster_race *r_ptr = &r_info[m_ptr->r_idx];
update_monster(g_ptr->m_idx, FALSE);
POSITION x = tmp_pos.x[i];
int j;
- grid_type *g_ptr = ¤t_floor_ptr->grid_array[y][x];
+ grid_type *g_ptr = &p_ptr->current_floor_ptr->grid_array[y][x];
bool do_dark = !is_mirror_grid(g_ptr);
/* No longer in the array */
/* Darken the grid */
if (do_dark)
{
- if (current_floor_ptr->dun_level || !is_daytime())
+ if (p_ptr->current_floor_ptr->dun_level || !is_daytime())
{
for (j = 0; j < 9; j++)
{
if (in_bounds2(by, bx))
{
- grid_type *cc_ptr = ¤t_floor_ptr->grid_array[by][bx];
+ grid_type *cc_ptr = &p_ptr->current_floor_ptr->grid_array[by][bx];
if (have_flag(f_info[get_feat_mimic(cc_ptr)].flags, FF_GLOW))
{
static void cave_temp_room_aux(POSITION y, POSITION x, bool only_room, bool (*pass_bold)(POSITION, POSITION))
{
grid_type *g_ptr;
- g_ptr = ¤t_floor_ptr->grid_array[y][x];
+ g_ptr = &p_ptr->current_floor_ptr->grid_array[y][x];
/* Avoid infinite recursion */
if (g_ptr->info & (CAVE_TEMP)) return;
* properly.
* This leaves only a check for 6 bounding walls!
*/
- if (in_bounds(current_floor_ptr, y, x) && pass_bold(y, x) &&
+ if (in_bounds(p_ptr->current_floor_ptr, y, x) && pass_bold(y, x) &&
(next_to_walls_adj(y, x, pass_bold) == 6) && (next_to_open(y, x, pass_bold) <= 1)) return;
}
if (p_ptr->special_defense & NINJA_S_STEALTH)
{
- if (current_floor_ptr->grid_array[p_ptr->y][p_ptr->x].info & CAVE_GLOW) set_superstealth(p_ptr, FALSE);
+ if (p_ptr->current_floor_ptr->grid_array[p_ptr->y][p_ptr->x].info & CAVE_GLOW) set_superstealth(p_ptr, FALSE);
}
}
tx = p_ptr->x + ddx[dir];
ty = p_ptr->y + ddy[dir];
}
- g_ptr = ¤t_floor_ptr->grid_array[ty][tx];
+ g_ptr = &p_ptr->current_floor_ptr->grid_array[ty][tx];
if (p_ptr->anti_tele)
{
return FALSE;
}
- m_ptr = ¤t_floor_ptr->m_list[g_ptr->m_idx];
+ m_ptr = &p_ptr->current_floor_ptr->m_list[g_ptr->m_idx];
r_ptr = &r_info[m_ptr->r_idx];
(void)set_monster_csleep(g_ptr->m_idx, 0);
(*count) += activate_hi_summon(p_ptr->y, p_ptr->x, FALSE);
if (!one_in_(6)) break;
case 7: case 8: case 9: case 18:
- (*count) += summon_specific(0, p_ptr->y, p_ptr->x, current_floor_ptr->dun_level, 0, (PM_ALLOW_GROUP | PM_ALLOW_UNIQUE | PM_NO_PET));
+ (*count) += summon_specific(0, p_ptr->y, p_ptr->x, p_ptr->current_floor_ptr->dun_level, 0, (PM_ALLOW_GROUP | PM_ALLOW_UNIQUE | PM_NO_PET));
if (!one_in_(6)) break;
case 10: case 11: case 12:
msg_print(_("経験値が体から吸い取られた気がする!", "You feel your experience draining away..."));
/*
* Only summon Cyberdemons deep in the dungeon.
*/
- if ((current_floor_ptr->dun_level > 65) && !stop_ty)
+ if ((p_ptr->current_floor_ptr->dun_level > 65) && !stop_ty)
{
(*count) += summon_cyber(-1, p_ptr->y, p_ptr->x);
stop_ty = TRUE;
if (!pet) mode |= PM_NO_PET;
- summon_lev = (pet ? p_ptr->lev * 2 / 3 + randint1(p_ptr->lev / 2) : current_floor_ptr->dun_level);
+ summon_lev = (pet ? p_ptr->lev * 2 / 3 + randint1(p_ptr->lev / 2) : p_ptr->current_floor_ptr->dun_level);
- for (i = 0; i < (randint1(7) + (current_floor_ptr->dun_level / 40)); i++)
+ for (i = 0; i < (randint1(7) + (p_ptr->current_floor_ptr->dun_level / 40)); i++)
{
- switch (randint1(25) + (current_floor_ptr->dun_level / 20))
+ switch (randint1(25) + (p_ptr->current_floor_ptr->dun_level / 20))
{
case 1: case 2:
count += summon_specific((pet ? -1 : 0), y, x, summon_lev, SUMMON_ANT, mode);
ty = target_row;
}
- if (in_bounds(current_floor_ptr, ty, tx)) tm_idx = current_floor_ptr->grid_array[ty][tx].m_idx;
+ if (in_bounds(p_ptr->current_floor_ptr, ty, tx)) tm_idx = p_ptr->current_floor_ptr->grid_array[ty][tx].m_idx;
path_n = project_path(path_g, project_length, p_ptr->y, p_ptr->x, ty, tx, PROJECT_STOP | PROJECT_KILL);
project_length = 0;
int ny = GRID_Y(path_g[i]);
int nx = GRID_X(path_g[i]);
- if (cave_empty_bold(ny, nx) && player_can_enter(current_floor_ptr->grid_array[ny][nx].feat, 0))
+ if (cave_empty_bold(ny, nx) && player_can_enter(p_ptr->current_floor_ptr->grid_array[ny][nx].feat, 0))
{
ty = ny;
tx = nx;
continue;
}
- if (!current_floor_ptr->grid_array[ny][nx].m_idx)
+ if (!p_ptr->current_floor_ptr->grid_array[ny][nx].m_idx)
{
if (tm_idx)
{
/* Move player before updating the monster */
if (!player_bold(ty, tx)) teleport_player_to(ty, tx, TELEPORT_NONMAGICAL);
- update_monster(current_floor_ptr->grid_array[ny][nx].m_idx, TRUE);
+ update_monster(p_ptr->current_floor_ptr->grid_array[ny][nx].m_idx, TRUE);
/* Found a monster */
- m_ptr = ¤t_floor_ptr->m_list[current_floor_ptr->grid_array[ny][nx].m_idx];
+ m_ptr = &p_ptr->current_floor_ptr->m_list[p_ptr->current_floor_ptr->grid_array[ny][nx].m_idx];
- if (tm_idx != current_floor_ptr->grid_array[ny][nx].m_idx)
+ if (tm_idx != p_ptr->current_floor_ptr->grid_array[ny][nx].m_idx)
{
#ifdef JP
msg_format("%s%sが立ちふさがっている!", tm_idx ? "別の" : "", m_ptr->ml ? "モンスター" : "何か");
{
POSITION x, y;
- for (x = 0; x < current_floor_ptr->width; x++)
+ for (x = 0; x < p_ptr->current_floor_ptr->width; x++)
{
- for (y = 0; y < current_floor_ptr->height; y++)
+ for (y = 0; y < p_ptr->current_floor_ptr->height; y++)
{
- if (is_mirror_grid(¤t_floor_ptr->grid_array[y][x]))
+ if (is_mirror_grid(&p_ptr->current_floor_ptr->grid_array[y][x]))
{
remove_mirror(y, x);
if (explode)
case 35:
while (counter++ < 8)
{
- (void)summon_specific(0, p_ptr->y, p_ptr->x, (current_floor_ptr->dun_level * 3) / 2, type, (PM_ALLOW_GROUP | PM_NO_PET));
+ (void)summon_specific(0, p_ptr->y, p_ptr->x, (p_ptr->current_floor_ptr->dun_level * 3) / 2, type, (PM_ALLOW_GROUP | PM_NO_PET));
}
break;
case 36:
if (d >= 9) continue;
- if (!in_bounds(current_floor_ptr, y, x) || !projectable(p_ptr->y, p_ptr->x, y, x)
+ if (!in_bounds(p_ptr->current_floor_ptr, y, x) || !projectable(p_ptr->y, p_ptr->x, y, x)
|| !cave_have_flag_bold(y, x, FF_PROJECT)) continue;
/* Valid position */
if (!cave_have_flag_bold(ny, nx, FF_PROJECT)) break;
/* Stopped by monsters */
- if ((dir != 5) && current_floor_ptr->grid_array[ny][nx].m_idx != 0) break;
+ if ((dir != 5) && p_ptr->current_floor_ptr->grid_array[ny][nx].m_idx != 0) break;
/* Save the new location */
x = nx;
if (count < 0) continue;
/* Cannot penetrate perm walls */
- if (!in_bounds(current_floor_ptr, y, x) ||
+ if (!in_bounds(p_ptr->current_floor_ptr, y, x) ||
cave_stop_disintegration(y, x) ||
!in_disintegration_range(ty, tx, y, x))
continue;
msg_print(_("なんてこった!あなたの周りの地面から朽ちた人影が立ち上がってきた!",
"Oh no! Mouldering forms rise from the earth around you!"));
- (void)summon_specific(0, p_ptr->y, p_ptr->x, current_floor_ptr->dun_level, SUMMON_UNDEAD, (PM_ALLOW_GROUP | PM_ALLOW_UNIQUE | PM_NO_PET));
+ (void)summon_specific(0, p_ptr->y, p_ptr->x, p_ptr->current_floor_ptr->dun_level, SUMMON_UNDEAD, (PM_ALLOW_GROUP | PM_ALLOW_UNIQUE | PM_NO_PET));
chg_virtue(p_ptr, V_UNLIFE, 1);
}
else if (die < 14)
else if (die < 14)
{
msg_print(_("なんてこった!《悪魔》だ!", "Oh no! It's the Devil!"));
- summon_specific(0, p_ptr->y, p_ptr->x, current_floor_ptr->dun_level, SUMMON_DEMON, (PM_ALLOW_GROUP | PM_ALLOW_UNIQUE | PM_NO_PET));
+ summon_specific(0, p_ptr->y, p_ptr->x, p_ptr->current_floor_ptr->dun_level, SUMMON_DEMON, (PM_ALLOW_GROUP | PM_ALLOW_UNIQUE | PM_NO_PET));
}
else if (die < 18)
{
else if (die < 30)
{
msg_print(_("奇妙なモンスターの絵だ。", "It's the picture of a strange monster."));
- trump_summoning(1, FALSE, p_ptr->y, p_ptr->x, (current_floor_ptr->dun_level * 3 / 2), (32 + randint1(6)), PM_ALLOW_GROUP | PM_ALLOW_UNIQUE);
+ trump_summoning(1, FALSE, p_ptr->y, p_ptr->x, (p_ptr->current_floor_ptr->dun_level * 3 / 2), (32 + randint1(6)), PM_ALLOW_GROUP | PM_ALLOW_UNIQUE);
}
else if (die < 33)
{
else if (die < 82)
{
msg_print(_("友好的なモンスターの絵だ。", "It's the picture of a friendly monster."));
- trump_summoning(1, TRUE, p_ptr->y, p_ptr->x, (current_floor_ptr->dun_level * 3 / 2), SUMMON_MOLD, 0L);
+ trump_summoning(1, TRUE, p_ptr->y, p_ptr->x, (p_ptr->current_floor_ptr->dun_level * 3 / 2), SUMMON_MOLD, 0L);
}
else if (die < 84)
{
msg_print(_("友好的なモンスターの絵だ。", "It's the picture of a friendly monster."));
- trump_summoning(1, TRUE, p_ptr->y, p_ptr->x, (current_floor_ptr->dun_level * 3 / 2), SUMMON_BAT, 0L);
+ trump_summoning(1, TRUE, p_ptr->y, p_ptr->x, (p_ptr->current_floor_ptr->dun_level * 3 / 2), SUMMON_BAT, 0L);
}
else if (die < 86)
{
msg_print(_("友好的なモンスターの絵だ。", "It's the picture of a friendly monster."));
- trump_summoning(1, TRUE, p_ptr->y, p_ptr->x, (current_floor_ptr->dun_level * 3 / 2), SUMMON_VORTEX, 0L);
+ trump_summoning(1, TRUE, p_ptr->y, p_ptr->x, (p_ptr->current_floor_ptr->dun_level * 3 / 2), SUMMON_VORTEX, 0L);
}
else if (die < 88)
{
msg_print(_("友好的なモンスターの絵だ。", "It's the picture of a friendly monster."));
- trump_summoning(1, TRUE, p_ptr->y, p_ptr->x, (current_floor_ptr->dun_level * 3 / 2), SUMMON_COIN_MIMIC, 0L);
+ trump_summoning(1, TRUE, p_ptr->y, p_ptr->x, (p_ptr->current_floor_ptr->dun_level * 3 / 2), SUMMON_COIN_MIMIC, 0L);
}
else if (die < 96)
{
if (!get_direction(&dir, FALSE, FALSE)) return FALSE;
y = p_ptr->y + ddy[dir];
x = p_ptr->x + ddx[dir];
- g_ptr = ¤t_floor_ptr->grid_array[y][x];
+ g_ptr = &p_ptr->current_floor_ptr->grid_array[y][x];
stop_mouth();
if (!get_direction(&dir, FALSE, FALSE)) return FALSE;
y = p_ptr->y + ddy[dir];
x = p_ptr->x + ddx[dir];
- if (current_floor_ptr->grid_array[y][x].m_idx)
+ if (p_ptr->current_floor_ptr->grid_array[y][x].m_idx)
{
py_attack(p_ptr, y, x, 0);
if (randint0(p_ptr->skill_dis) < 7)
}
else
{
- grid_type *g_ptr = ¤t_floor_ptr->grid_array[creature_ptr->y][creature_ptr->x];
+ grid_type *g_ptr = &p_ptr->current_floor_ptr->grid_array[creature_ptr->y][creature_ptr->x];
feature_type *f_ptr = &f_info[g_ptr->feat];
if (!have_flag(f_ptr->flags, FF_PROJECT) ||
if (!get_rep_dir(&dir, FALSE)) return FALSE;
y = creature_ptr->y + ddy[dir];
x = creature_ptr->x + ddx[dir];
- if (current_floor_ptr->grid_array[y][x].m_idx)
+ if (p_ptr->current_floor_ptr->grid_array[y][x].m_idx)
{
if (one_in_(3))
msg_print(_("あーたたたたたたたたたたたたたたたたたたたたたた!!!",
"Oraoraoraoraoraoraoraoraoraoraoraoraoraoraoraoraora!!!!"));
py_attack(p_ptr, y, x, 0);
- if (current_floor_ptr->grid_array[y][x].m_idx)
+ if (p_ptr->current_floor_ptr->grid_array[y][x].m_idx)
{
handle_stuff();
py_attack(p_ptr, y, x, 0);
msg_print(_("今はペットを操ることに集中していないと。", "You need concentration on the pets now."));
return FALSE;
}
- if (is_mirror_grid(¤t_floor_ptr->grid_array[creature_ptr->y][creature_ptr->x]))
+ if (is_mirror_grid(&p_ptr->current_floor_ptr->grid_array[creature_ptr->y][creature_ptr->x]))
{
msg_print(_("少し頭がハッキリした。", "You feel your head clear a little."));
dir = randint0(8);
y = creature_ptr->y + ddy_ddd[dir];
x = creature_ptr->x + ddx_ddd[dir];
- g_ptr = ¤t_floor_ptr->grid_array[y][x];
+ g_ptr = &p_ptr->current_floor_ptr->grid_array[y][x];
/* Hack -- attack monsters */
if (g_ptr->m_idx)
}
if (!do_cmd_riding(creature_ptr, TRUE)) return TRUE;
- m_ptr = ¤t_floor_ptr->m_list[creature_ptr->riding];
+ m_ptr = &p_ptr->current_floor_ptr->m_list[creature_ptr->riding];
r_ptr = &r_info[m_ptr->r_idx];
monster_desc(m_name, m_ptr, 0);
msg_format(_("%sに乗った。", "You ride on %s."), m_name);
bool look = TRUE;
- monster_type *m_ptr = ¤t_floor_ptr->m_list[m_idx];
+ monster_type *m_ptr = &p_ptr->current_floor_ptr->m_list[m_idx];
if (!monster_is_valid(m_ptr)) return (FALSE);
oy = m_ptr->fy;
}
/* Ignore illegal locations */
- if (!in_bounds(current_floor_ptr, ny, nx)) continue;
+ if (!in_bounds(p_ptr->current_floor_ptr, ny, nx)) continue;
if (!cave_monster_teleportable_bold(m_idx, ny, nx, mode)) continue;
/* No teleporting into vaults and such */
if (!(p_ptr->inside_quest || p_ptr->inside_arena))
- if (current_floor_ptr->grid_array[ny][nx].info & CAVE_ICKY) continue;
+ if (p_ptr->current_floor_ptr->grid_array[ny][nx].info & CAVE_ICKY) continue;
/* This grid looks good */
look = FALSE;
sound(SOUND_TPOTHER);
/* Update the old location */
- current_floor_ptr->grid_array[oy][ox].m_idx = 0;
+ p_ptr->current_floor_ptr->grid_array[oy][ox].m_idx = 0;
/* Update the new location */
- current_floor_ptr->grid_array[ny][nx].m_idx = m_idx;
+ p_ptr->current_floor_ptr->grid_array[ny][nx].m_idx = m_idx;
/* Move the monster */
m_ptr->fy = ny;
int attempts = 500;
POSITION dis = 2;
bool look = TRUE;
- monster_type *m_ptr = ¤t_floor_ptr->m_list[m_idx];
+ monster_type *m_ptr = &p_ptr->current_floor_ptr->m_list[m_idx];
if(!m_ptr->r_idx) return;
/* "Skill" test */
}
/* Ignore illegal locations */
- if (!in_bounds(current_floor_ptr, ny, nx)) continue;
+ if (!in_bounds(p_ptr->current_floor_ptr, ny, nx)) continue;
if (!cave_monster_teleportable_bold(m_idx, ny, nx, mode)) continue;
/* No teleporting into vaults and such */
- /* if (current_floor_ptr->grid_array[ny][nx].info & (CAVE_ICKY)) continue; */
+ /* if (p_ptr->current_floor_ptr->grid_array[ny][nx].info & (CAVE_ICKY)) continue; */
/* This grid looks good */
look = FALSE;
sound(SOUND_TPOTHER);
/* Update the old location */
- current_floor_ptr->grid_array[oy][ox].m_idx = 0;
+ p_ptr->current_floor_ptr->grid_array[oy][ox].m_idx = 0;
/* Update the new location */
- current_floor_ptr->grid_array[ny][nx].m_idx = m_idx;
+ p_ptr->current_floor_ptr->grid_array[ny][nx].m_idx = m_idx;
/* Move the monster */
m_ptr->fy = ny;
int min, pick, i;
int left = MAX(1, p_ptr->x - dis);
- int right = MIN(current_floor_ptr->width - 2, p_ptr->x + dis);
+ int right = MIN(p_ptr->current_floor_ptr->width - 2, p_ptr->x + dis);
int top = MAX(1, p_ptr->y - dis);
- int bottom = MIN(current_floor_ptr->height - 2, p_ptr->y + dis);
+ int bottom = MIN(p_ptr->current_floor_ptr->height - 2, p_ptr->y + dis);
if (p_ptr->wild_mode) return FALSE;
{
for (yy = -1; yy < 2; yy++)
{
- MONSTER_IDX tmp_m_idx = current_floor_ptr->grid_array[oy+yy][ox+xx].m_idx;
+ MONSTER_IDX tmp_m_idx = p_ptr->current_floor_ptr->grid_array[oy+yy][ox+xx].m_idx;
/* A monster except your mount may follow */
if (tmp_m_idx && (p_ptr->riding != tmp_m_idx))
{
- monster_type *m_ptr = ¤t_floor_ptr->m_list[tmp_m_idx];
+ monster_type *m_ptr = &p_ptr->current_floor_ptr->m_list[tmp_m_idx];
monster_race *r_ptr = &r_info[m_ptr->r_idx];
/*
{
for (yy = -1; yy < 2; yy++)
{
- MONSTER_IDX tmp_m_idx = current_floor_ptr->grid_array[oy+yy][ox+xx].m_idx;
+ MONSTER_IDX tmp_m_idx = p_ptr->current_floor_ptr->grid_array[oy+yy][ox+xx].m_idx;
/* A monster except your mount or caster may follow */
if (tmp_m_idx && (p_ptr->riding != tmp_m_idx) && (m_idx != tmp_m_idx))
{
- monster_type *m_ptr = ¤t_floor_ptr->m_list[tmp_m_idx];
+ monster_type *m_ptr = &p_ptr->current_floor_ptr->m_list[tmp_m_idx];
monster_race *r_ptr = &r_info[m_ptr->r_idx];
/*
{
y = (POSITION)rand_spread(ny, dis);
x = (POSITION)rand_spread(nx, dis);
- if (in_bounds(current_floor_ptr, y, x)) break;
+ if (in_bounds(p_ptr->current_floor_ptr, y, x)) break;
}
/* Accept any grid when wizard mode */
- if (current_world_ptr->wizard && !(mode & TELEPORT_PASSIVE) && (!current_floor_ptr->grid_array[y][x].m_idx || (current_floor_ptr->grid_array[y][x].m_idx == p_ptr->riding))) break;
+ if (current_world_ptr->wizard && !(mode & TELEPORT_PASSIVE) && (!p_ptr->current_floor_ptr->grid_array[y][x].m_idx || (p_ptr->current_floor_ptr->grid_array[y][x].m_idx == p_ptr->riding))) break;
/* Accept teleportable floor grids */
if (cave_player_teleportable_bold(y, x, mode)) break;
void teleport_away_followable(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 oldfy = m_ptr->fy;
POSITION oldfx = m_ptr->fx;
bool old_ml = m_ptr->ml;
GAME_TEXT m_name[MAX_NLEN];
if (!target_set(TARGET_KILL)) return FALSE;
- target_m_idx = current_floor_ptr->grid_array[target_row][target_col].m_idx;
+ target_m_idx = p_ptr->current_floor_ptr->grid_array[target_row][target_col].m_idx;
if (!target_m_idx) return TRUE;
if (!player_has_los_bold(target_row, target_col)) return TRUE;
if (!projectable(creature_ptr->y, creature_ptr->x, target_row, target_col)) return TRUE;
- m_ptr = ¤t_floor_ptr->m_list[target_m_idx];
+ m_ptr = &p_ptr->current_floor_ptr->m_list[target_m_idx];
r_ptr = &r_info[m_ptr->r_idx];
monster_desc(m_name, m_ptr, 0);
msg_format(_("%^sの足を指さした。", "You gesture at %^s's feet."), m_name);
}
else /* To monster */
{
- monster_type *m_ptr = ¤t_floor_ptr->m_list[m_idx];
+ monster_type *m_ptr = &p_ptr->current_floor_ptr->m_list[m_idx];
/* Get the monster name (or "it") */
monster_desc(m_name, m_ptr, 0);
}
/* Down only */
- if ((ironman_downward && (m_idx <= 0)) || (current_floor_ptr->dun_level <= d_info[p_ptr->dungeon_idx].mindepth))
+ if ((ironman_downward && (m_idx <= 0)) || (p_ptr->current_floor_ptr->dun_level <= d_info[p_ptr->dungeon_idx].mindepth))
{
#ifdef JP
if (see_m) msg_format("%^sは床を突き破って沈んでいく。", m_name);
#endif
if (m_idx <= 0) /* To player */
{
- if (!current_floor_ptr->dun_level)
+ if (!p_ptr->current_floor_ptr->dun_level)
{
p_ptr->dungeon_idx = ironman_downward ? DUNGEON_ANGBAND : p_ptr->recall_dungeon;
p_ptr->oldpy = p_ptr->y;
if (autosave_l) do_cmd_save_game(TRUE);
- if (!current_floor_ptr->dun_level)
+ if (!p_ptr->current_floor_ptr->dun_level)
{
- current_floor_ptr->dun_level = d_info[p_ptr->dungeon_idx].mindepth;
+ p_ptr->current_floor_ptr->dun_level = d_info[p_ptr->dungeon_idx].mindepth;
prepare_change_floor_mode(CFM_RAND_PLACE);
}
else
}
/* Up only */
- else if (quest_number(current_floor_ptr->dun_level) || (current_floor_ptr->dun_level >= d_info[p_ptr->dungeon_idx].maxdepth))
+ else if (quest_number(p_ptr->current_floor_ptr->dun_level) || (p_ptr->current_floor_ptr->dun_level >= d_info[p_ptr->dungeon_idx].maxdepth))
{
#ifdef JP
if (see_m) msg_format("%^sは天井を突き破って宙へ浮いていく。", m_name);
if (m_idx <= 0) /* To player */
{
/* Never reach this code on the surface */
- /* if (!current_floor_ptr->dun_level) p_ptr->dungeon_idx = p_ptr->recall_dungeon; */
+ /* if (!p_ptr->current_floor_ptr->dun_level) p_ptr->dungeon_idx = p_ptr->recall_dungeon; */
if (record_stair) exe_write_diary(p_ptr, NIKKI_TELE_LEV, 1, NULL);
if (autosave_l) do_cmd_save_game(TRUE);
/* Monster level teleportation is simple deleting now */
if (m_idx > 0)
{
- monster_type *m_ptr = ¤t_floor_ptr->m_list[m_idx];
+ monster_type *m_ptr = &p_ptr->current_floor_ptr->m_list[m_idx];
check_quest_completion(m_ptr);
return TRUE;
}
- if (current_floor_ptr->dun_level && (max_dlv[p_ptr->dungeon_idx] > current_floor_ptr->dun_level) && !creature_ptr->inside_quest && !creature_ptr->word_recall)
+ if (p_ptr->current_floor_ptr->dun_level && (max_dlv[p_ptr->dungeon_idx] > p_ptr->current_floor_ptr->dun_level) && !creature_ptr->inside_quest && !creature_ptr->word_recall)
{
if (get_check(_("ここは最深到達階より浅い階です。この階に戻って来ますか? ", "Reset recall depth? ")))
{
- max_dlv[p_ptr->dungeon_idx] = current_floor_ptr->dun_level;
+ max_dlv[p_ptr->dungeon_idx] = p_ptr->current_floor_ptr->dun_level;
if (record_maxdepth)
exe_write_diary(p_ptr, NIKKI_TRUMP, p_ptr->dungeon_idx, _("帰還のときに", "when recall from dungeon"));
}
}
if (!creature_ptr->word_recall)
{
- if (!current_floor_ptr->dun_level)
+ if (!p_ptr->current_floor_ptr->dun_level)
{
DUNGEON_IDX select_dungeon;
select_dungeon = choose_dungeon(_("に帰還", "recall"), 2, 14);
(int)d_info[select_dungeon].mindepth, (int)max_dlv[select_dungeon]);
/* Default */
- sprintf(tmp_val, "%d", (int)MAX(current_floor_ptr->dun_level, 1));
+ sprintf(tmp_val, "%d", (int)MAX(p_ptr->current_floor_ptr->dun_level, 1));
/* Ask for a level */
if (get_string(ppp, tmp_val, 10))
GAME_TEXT m_name[MAX_NLEN];
/* Prevent vasishing of quest levels and town */
- if ((p_ptr->inside_quest && is_fixed_quest_idx(p_ptr->inside_quest)) || !current_floor_ptr->dun_level)
+ if ((p_ptr->inside_quest && is_fixed_quest_idx(p_ptr->inside_quest)) || !p_ptr->current_floor_ptr->dun_level)
{
return FALSE;
}
/* Scan all normal grids */
- for (y = 1; y < current_floor_ptr->height - 1; y++)
+ for (y = 1; y < p_ptr->current_floor_ptr->height - 1; y++)
{
- for (x = 1; x < current_floor_ptr->width - 1; x++)
+ for (x = 1; x < p_ptr->current_floor_ptr->width - 1; x++)
{
- g_ptr = ¤t_floor_ptr->grid_array[y][x];
+ g_ptr = &p_ptr->current_floor_ptr->grid_array[y][x];
/* Seeing true feature code (ignore mimic) */
f_ptr = &f_info[g_ptr->feat];
/* Lose room and vault */
g_ptr->info &= ~(CAVE_ROOM | CAVE_ICKY);
- m_ptr = ¤t_floor_ptr->m_list[g_ptr->m_idx];
+ m_ptr = &p_ptr->current_floor_ptr->m_list[g_ptr->m_idx];
/* Awake monster */
if (g_ptr->m_idx && MON_CSLEEP(m_ptr))
}
/* Special boundary walls -- Top and bottom */
- for (x = 0; x < current_floor_ptr->width; x++)
+ for (x = 0; x < p_ptr->current_floor_ptr->width; x++)
{
- g_ptr = ¤t_floor_ptr->grid_array[0][x];
+ g_ptr = &p_ptr->current_floor_ptr->grid_array[0][x];
f_ptr = &f_info[g_ptr->mimic];
/* Lose room and vault */
if (!have_flag(f_info[g_ptr->mimic].flags, FF_REMEMBER)) g_ptr->info &= ~(CAVE_MARK);
}
- g_ptr = ¤t_floor_ptr->grid_array[current_floor_ptr->height - 1][x];
+ g_ptr = &p_ptr->current_floor_ptr->grid_array[p_ptr->current_floor_ptr->height - 1][x];
f_ptr = &f_info[g_ptr->mimic];
/* Lose room and vault */
}
/* Special boundary walls -- Left and right */
- for (y = 1; y < (current_floor_ptr->height - 1); y++)
+ for (y = 1; y < (p_ptr->current_floor_ptr->height - 1); y++)
{
- g_ptr = ¤t_floor_ptr->grid_array[y][0];
+ g_ptr = &p_ptr->current_floor_ptr->grid_array[y][0];
f_ptr = &f_info[g_ptr->mimic];
/* Lose room and vault */
if (!have_flag(f_info[g_ptr->mimic].flags, FF_REMEMBER)) g_ptr->info &= ~(CAVE_MARK);
}
- g_ptr = ¤t_floor_ptr->grid_array[y][current_floor_ptr->width - 1];
+ g_ptr = &p_ptr->current_floor_ptr->grid_array[y][p_ptr->current_floor_ptr->width - 1];
f_ptr = &f_info[g_ptr->mimic];
/* Lose room and vault */
for (i = 0; i < 9; i++)
{
- g_ptr = ¤t_floor_ptr->grid_array[p_ptr->y + ddy_ddd[i]][p_ptr->x + ddx_ddd[i]];
+ g_ptr = &p_ptr->current_floor_ptr->grid_array[p_ptr->y + ddy_ddd[i]][p_ptr->x + ddx_ddd[i]];
if (!cave_have_flag_grid(g_ptr, FF_PROJECT))
{
}
/* Prevent destruction of quest levels and town */
- else if ((p_ptr->inside_quest && is_fixed_quest_idx(p_ptr->inside_quest)) || !current_floor_ptr->dun_level)
+ else if ((p_ptr->inside_quest && is_fixed_quest_idx(p_ptr->inside_quest)) || !p_ptr->current_floor_ptr->dun_level)
{
msg_print(_("地面が揺れた。", "The ground trembles."));
}
GAME_TEXT o_name[MAX_NLEN];
/* Check to see if an object is already there */
- if (current_floor_ptr->grid_array[p_ptr->y][p_ptr->x].o_idx)
+ if (p_ptr->current_floor_ptr->grid_array[p_ptr->y][p_ptr->x].o_idx)
{
msg_print(_("自分の足の下にある物は取れません。", "You can't fetch when you're already standing on something."));
return;
return;
}
- g_ptr = ¤t_floor_ptr->grid_array[ty][tx];
+ g_ptr = &p_ptr->current_floor_ptr->grid_array[ty][tx];
/* We need an item to fetch */
if (!g_ptr->o_idx)
{
ty += ddy[dir];
tx += ddx[dir];
- g_ptr = ¤t_floor_ptr->grid_array[ty][tx];
+ g_ptr = &p_ptr->current_floor_ptr->grid_array[ty][tx];
if ((distance(p_ptr->y, p_ptr->x, ty, tx) > MAX_RANGE) ||
!cave_have_flag_bold(ty, tx, FF_PROJECT)) return;
while (!g_ptr->o_idx);
}
- o_ptr = ¤t_floor_ptr->o_list[g_ptr->o_idx];
+ o_ptr = &p_ptr->current_floor_ptr->o_list[g_ptr->o_idx];
if (o_ptr->weight > wgt)
{
i = g_ptr->o_idx;
g_ptr->o_idx = o_ptr->next_o_idx;
- current_floor_ptr->grid_array[p_ptr->y][p_ptr->x].o_idx = i; /* 'move' it */
+ p_ptr->current_floor_ptr->grid_array[p_ptr->y][p_ptr->x].o_idx = i; /* 'move' it */
o_ptr->next_o_idx = 0;
o_ptr->iy = p_ptr->y;
chance -= 3 * (adj_mag_stat[p_ptr->stat_ind[mp_ptr->spell_stat]] - 1);
if (p_ptr->riding)
- chance += (MAX(r_info[current_floor_ptr->m_list[p_ptr->riding].r_idx].level - p_ptr->skill_exp[GINOU_RIDING] / 100 - 10, 0));
+ chance += (MAX(r_info[p_ptr->current_floor_ptr->m_list[p_ptr->riding].r_idx].level - p_ptr->skill_exp[GINOU_RIDING] / 100 - 10, 0));
/* Extract mana consumption rate */
need_mana = mod_need_mana(s_ptr->smana, spell, use_realm);
for (i = 0; i < 1000; i++)
{
/* Pick a new race, using a level calculation */
- r = get_mon_num((current_floor_ptr->dun_level + r_ptr->level) / 2 + 5);
+ r = get_mon_num((p_ptr->current_floor_ptr->dun_level + r_ptr->level) / 2 + 5);
/* Handle failure */
if (!r) break;
*/
bool polymorph_monster(POSITION y, POSITION x)
{
- grid_type *g_ptr = ¤t_floor_ptr->grid_array[y][x];
- monster_type *m_ptr = ¤t_floor_ptr->m_list[g_ptr->m_idx];
+ grid_type *g_ptr = &p_ptr->current_floor_ptr->grid_array[y][x];
+ monster_type *m_ptr = &p_ptr->current_floor_ptr->m_list[g_ptr->m_idx];
bool polymorphed = FALSE;
MONRACE_IDX new_r_idx;
MONRACE_IDX old_r_idx = m_ptr->r_idx;
/* Create a new monster (no groups) */
if (place_monster_aux(0, y, x, new_r_idx, mode))
{
- current_floor_ptr->m_list[hack_m_idx_ii].nickname = back_m.nickname;
- current_floor_ptr->m_list[hack_m_idx_ii].parent_m_idx = back_m.parent_m_idx;
- current_floor_ptr->m_list[hack_m_idx_ii].hold_o_idx = back_m.hold_o_idx;
+ p_ptr->current_floor_ptr->m_list[hack_m_idx_ii].nickname = back_m.nickname;
+ p_ptr->current_floor_ptr->m_list[hack_m_idx_ii].parent_m_idx = back_m.parent_m_idx;
+ p_ptr->current_floor_ptr->m_list[hack_m_idx_ii].hold_o_idx = back_m.hold_o_idx;
/* Success */
polymorphed = TRUE;
/* Placing the new monster failed */
if (place_monster_aux(0, y, x, old_r_idx, (mode | PM_NO_KAGE | PM_IGNORE_TERRAIN)))
{
- current_floor_ptr->m_list[hack_m_idx_ii] = back_m;
+ p_ptr->current_floor_ptr->m_list[hack_m_idx_ii] = back_m;
/* Re-initialize monster process */
mproc_init();
{
for (this_o_idx = back_m.hold_o_idx; this_o_idx; this_o_idx = next_o_idx)
{
- object_type *o_ptr = ¤t_floor_ptr->o_list[this_o_idx];
+ object_type *o_ptr = &p_ptr->current_floor_ptr->o_list[this_o_idx];
next_o_idx = o_ptr->next_o_idx;
/* Held by new monster */
{
for (this_o_idx = back_m.hold_o_idx; this_o_idx; this_o_idx = next_o_idx)
{
- next_o_idx = current_floor_ptr->o_list[this_o_idx].next_o_idx;
+ next_o_idx = p_ptr->current_floor_ptr->o_list[this_o_idx].next_o_idx;
delete_object_idx(this_o_idx);
}
}
{
y = p_ptr->y + ddy_ddd[dir];
x = p_ptr->x + ddx_ddd[dir];
- g_ptr = ¤t_floor_ptr->grid_array[y][x];
- m_ptr = ¤t_floor_ptr->m_list[g_ptr->m_idx];
+ g_ptr = &p_ptr->current_floor_ptr->grid_array[y][x];
+ m_ptr = &p_ptr->current_floor_ptr->m_list[g_ptr->m_idx];
/* Hack -- attack monsters */
if (g_ptr->m_idx && (m_ptr->ml || cave_have_flag_bold(y, x, FF_PROJECT)))
if (!get_direction(&dir, FALSE, FALSE)) return FALSE;
y = p_ptr->y + ddy[dir];
x = p_ptr->x + ddx[dir];
- g_ptr = ¤t_floor_ptr->grid_array[y][x];
+ g_ptr = &p_ptr->current_floor_ptr->grid_array[y][x];
f_ptr = &f_info[g_ptr->feat];
mimic_f_ptr = &f_info[get_feat_mimic(g_ptr)];
}
else if (g_ptr->m_idx)
{
- monster_type *m_ptr = ¤t_floor_ptr->m_list[g_ptr->m_idx];
+ monster_type *m_ptr = &p_ptr->current_floor_ptr->m_list[g_ptr->m_idx];
msg_print(_("何かが邪魔しています!", "There's something in the way!"));
if (!m_ptr->ml || !is_pet(m_ptr)) py_attack(p_ptr, y, x, 0);
x = p_ptr->x + ddx[dir];
dam = damroll(8 + ((plev - 5) / 4) + boost / 12, 8);
fire_beam(GF_MISSILE, dir, dam);
- if (current_floor_ptr->grid_array[y][x].m_idx)
+ if (p_ptr->current_floor_ptr->grid_array[y][x].m_idx)
{
int i;
POSITION ty = y, tx = x;
POSITION oy = y, ox = x;
- MONSTER_IDX m_idx = current_floor_ptr->grid_array[y][x].m_idx;
- monster_type *m_ptr = ¤t_floor_ptr->m_list[m_idx];
+ MONSTER_IDX m_idx = p_ptr->current_floor_ptr->grid_array[y][x].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];
if ((ty != oy) || (tx != ox))
{
msg_format(_("%sを吹き飛ばした!", "You blow %s away!"), m_name);
- current_floor_ptr->grid_array[oy][ox].m_idx = 0;
- current_floor_ptr->grid_array[ty][tx].m_idx = m_idx;
+ p_ptr->current_floor_ptr->grid_array[oy][ox].m_idx = 0;
+ p_ptr->current_floor_ptr->grid_array[ty][tx].m_idx = m_idx;
m_ptr->fy = ty;
m_ptr->fx = tx;
void blood_curse_to_enemy(MONSTER_IDX m_idx)
{
- monster_type *m_ptr = ¤t_floor_ptr->m_list[m_idx];
- grid_type *g_ptr = ¤t_floor_ptr->grid_array[m_ptr->fy][m_ptr->fx];
+ monster_type *m_ptr = &p_ptr->current_floor_ptr->m_list[m_idx];
+ grid_type *g_ptr = &p_ptr->current_floor_ptr->grid_array[m_ptr->fy][m_ptr->fx];
BIT_FLAGS curse_flg = (PROJECT_GRID | PROJECT_ITEM | PROJECT_KILL | PROJECT_JUMP);
int count = 0;
do
if (pet) mode |= PM_FORCE_PET;
else mode |= (PM_NO_PET | PM_FORCE_FRIENDLY);
- count += summon_specific((pet ? -1 : 0), p_ptr->y, p_ptr->x, (pet ? p_ptr->lev * 2 / 3 + randint1(p_ptr->lev / 2) : current_floor_ptr->dun_level), 0, mode);
+ count += summon_specific((pet ? -1 : 0), p_ptr->y, p_ptr->x, (pet ? p_ptr->lev * 2 / 3 + randint1(p_ptr->lev / 2) : p_ptr->current_floor_ptr->dun_level), 0, mode);
if (!one_in_(6)) break;
}
case 23: case 24: case 25:
POSITION x, y;
int num = 0;
- if (current_floor_ptr->dun_level)
+ if (p_ptr->current_floor_ptr->dun_level)
{
msg_print(_("この魔法は地上でしか使えない!", "This spell can only be used on the surface!"));
return FALSE;
store_bottom = MIN_STOCK + xtra_stock;
/* Access the player grid */
- g_ptr = ¤t_floor_ptr->grid_array[p_ptr->y][p_ptr->x];
+ g_ptr = &p_ptr->current_floor_ptr->grid_array[p_ptr->y][p_ptr->x];
/* Verify a store */
if (!cave_have_flag_grid(g_ptr, FF_STORE))
old_town_num = p_ptr->town_num;
if ((which == STORE_HOME) || (which == STORE_MUSEUM)) p_ptr->town_num = 1;
- if (current_floor_ptr->dun_level) p_ptr->town_num = NO_TOWN;
+ if (p_ptr->current_floor_ptr->dun_level) p_ptr->town_num = NO_TOWN;
inner_town_num = p_ptr->town_num;
/* Hack -- Check the "locked doors" */
town_info[p_ptr->town_num].store[which].last_visit = current_world_ptr->game_turn;
}
- forget_lite(current_floor_ptr);
+ forget_lite(p_ptr->current_floor_ptr);
forget_view();
/* Hack -- Character is in "icky" mode */
get_screen_size(&wid, &hgt);
- max_prow_min = current_floor_ptr->height - hgt;
- max_pcol_min = current_floor_ptr->width - wid;
+ max_prow_min = p_ptr->current_floor_ptr->height - hgt;
+ max_pcol_min = p_ptr->current_floor_ptr->width - wid;
/* Bounds checking */
if (max_prow_min < 0) max_prow_min = 0;
*/
bool target_able(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];
/* Monster must be alive */
if (!monster_is_valid(m_ptr)) return (FALSE);
/* Accept reasonable targets */
if (target_able(target_who))
{
- monster_type *m_ptr = ¤t_floor_ptr->m_list[target_who];
+ monster_type *m_ptr = &p_ptr->current_floor_ptr->m_list[target_who];
/* Acquire monster location */
target_row = m_ptr->fy;
grid_type *g_ptr;
OBJECT_IDX this_o_idx, next_o_idx = 0;
- if (!(in_bounds(current_floor_ptr, y, x))) return (FALSE);
+ if (!(in_bounds(p_ptr->current_floor_ptr, y, x))) return (FALSE);
/* Player grid is always interesting */
if (player_bold(y, x)) return (TRUE);
if (p_ptr->image) return (FALSE);
- g_ptr = ¤t_floor_ptr->grid_array[y][x];
+ g_ptr = &p_ptr->current_floor_ptr->grid_array[y][x];
/* Visible monsters */
if (g_ptr->m_idx)
{
- monster_type *m_ptr = ¤t_floor_ptr->m_list[g_ptr->m_idx];
+ monster_type *m_ptr = &p_ptr->current_floor_ptr->m_list[g_ptr->m_idx];
/* Visible monsters */
if (m_ptr->ml) return (TRUE);
for (this_o_idx = g_ptr->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;
/* Memorized object */
{
/* Inner range */
min_hgt = MAX((p_ptr->y - MAX_RANGE), 0);
- max_hgt = MIN((p_ptr->y + MAX_RANGE), current_floor_ptr->height - 1);
+ max_hgt = MIN((p_ptr->y + MAX_RANGE), p_ptr->current_floor_ptr->height - 1);
min_wid = MAX((p_ptr->x - MAX_RANGE), 0);
- max_wid = MIN((p_ptr->x + MAX_RANGE), current_floor_ptr->width - 1);
+ max_wid = MIN((p_ptr->x + MAX_RANGE), p_ptr->current_floor_ptr->width - 1);
}
else /* not targetting */
{
/* Require "interesting" contents */
if (!target_set_accept(y, x)) continue;
- g_ptr = ¤t_floor_ptr->grid_array[y][x];
+ g_ptr = &p_ptr->current_floor_ptr->grid_array[y][x];
/* Require target_able monsters for "TARGET_KILL" */
if ((mode & (TARGET_KILL)) && !target_able(g_ptr->m_idx)) continue;
- if ((mode & (TARGET_KILL)) && !target_pet && is_pet(¤t_floor_ptr->m_list[g_ptr->m_idx])) continue;
+ if ((mode & (TARGET_KILL)) && !target_pet && is_pet(&p_ptr->current_floor_ptr->m_list[g_ptr->m_idx])) continue;
/* Save the location */
tmp_pos.x[tmp_pos.n] = x;
*/
static char target_set_aux(POSITION y, POSITION x, BIT_FLAGS mode, concptr info)
{
- grid_type *g_ptr = ¤t_floor_ptr->grid_array[y][x];
+ grid_type *g_ptr = &p_ptr->current_floor_ptr->grid_array[y][x];
OBJECT_IDX this_o_idx, next_o_idx = 0;
concptr s1 = "", s2 = "", s3 = "", x_info = "";
bool boring = TRUE;
/* Actual monsters */
- if (g_ptr->m_idx && current_floor_ptr->m_list[g_ptr->m_idx].ml)
+ if (g_ptr->m_idx && p_ptr->current_floor_ptr->m_list[g_ptr->m_idx].ml)
{
- monster_type *m_ptr = ¤t_floor_ptr->m_list[g_ptr->m_idx];
+ monster_type *m_ptr = &p_ptr->current_floor_ptr->m_list[g_ptr->m_idx];
monster_race *ap_r_ptr = &r_info[m_ptr->ap_r_idx];
GAME_TEXT m_name[MAX_NLEN];
bool recall = FALSE;
GAME_TEXT o_name[MAX_NLEN];
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;
object_desc(o_name, o_ptr, 0);
GAME_TEXT o_name[MAX_NLEN];
object_type *o_ptr;
- o_ptr = ¤t_floor_ptr->o_list[floor_list[0]];
+ o_ptr = &p_ptr->current_floor_ptr->o_list[floor_list[0]];
object_desc(o_name, o_ptr, 0);
o_idx = g_ptr->o_idx;
/* Only rotate a pile of two or more objects. */
- if (!(o_idx && current_floor_ptr->o_list[o_idx].next_o_idx)) continue;
+ if (!(o_idx && p_ptr->current_floor_ptr->o_list[o_idx].next_o_idx)) continue;
/* Remove the first object from the list. */
excise_object_idx(o_idx);
/* Find end of the list. */
i = g_ptr->o_idx;
- while (current_floor_ptr->o_list[i].next_o_idx)
- i = current_floor_ptr->o_list[i].next_o_idx;
+ while (p_ptr->current_floor_ptr->o_list[i].next_o_idx)
+ i = p_ptr->current_floor_ptr->o_list[i].next_o_idx;
/* Add after the last object. */
- current_floor_ptr->o_list[i].next_o_idx = o_idx;
+ p_ptr->current_floor_ptr->o_list[i].next_o_idx = o_idx;
/* Loop and re-display the list */
}
for (this_o_idx = g_ptr->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;
if (o_ptr->marked & OM_FOUND)
if (!(mode & TARGET_LOOK)) prt_path(y, x);
/* Access */
- g_ptr = ¤t_floor_ptr->grid_array[y][x];
+ g_ptr = &p_ptr->current_floor_ptr->grid_array[y][x];
/* Allow target */
if (target_able(g_ptr->m_idx))
}
/* Slide into legality */
- if (x >= current_floor_ptr->width-1) x = current_floor_ptr->width - 2;
+ if (x >= p_ptr->current_floor_ptr->width-1) x = p_ptr->current_floor_ptr->width - 2;
else if (x <= 0) x = 1;
/* Slide into legality */
- if (y >= current_floor_ptr->height-1) y = current_floor_ptr->height- 2;
+ if (y >= p_ptr->current_floor_ptr->height-1) y = p_ptr->current_floor_ptr->height- 2;
else if (y <= 0) y = 1;
}
}
if (!(mode & TARGET_LOOK)) prt_path(y, x);
/* Access */
- g_ptr = ¤t_floor_ptr->grid_array[y][x];
+ g_ptr = &p_ptr->current_floor_ptr->grid_array[y][x];
/* Default prompt */
strcpy(info, _("q止 t決 p自 m近 +次 -前", "q,t,p,m,+,-,<dir>"));
}
/* Slide into legality */
- if (x >= current_floor_ptr->width-1) x = current_floor_ptr->width - 2;
+ if (x >= p_ptr->current_floor_ptr->width-1) x = p_ptr->current_floor_ptr->width - 2;
else if (x <= 0) x = 1;
/* Slide into legality */
- if (y >= current_floor_ptr->height-1) y = current_floor_ptr->height- 2;
+ if (y >= p_ptr->current_floor_ptr->height-1) y = p_ptr->current_floor_ptr->height- 2;
else if (y <= 0) y = 1;
}
}
}
else if (p_ptr->riding && with_steed)
{
- monster_type *m_ptr = ¤t_floor_ptr->m_list[p_ptr->riding];
+ monster_type *m_ptr = &p_ptr->current_floor_ptr->m_list[p_ptr->riding];
monster_race *r_ptr = &r_info[m_ptr->r_idx];
if (MON_CONFUSED(m_ptr))
else
{
GAME_TEXT m_name[MAX_NLEN];
- monster_type *m_ptr = ¤t_floor_ptr->m_list[p_ptr->riding];
+ monster_type *m_ptr = &p_ptr->current_floor_ptr->m_list[p_ptr->riding];
monster_desc(m_name, m_ptr, 0);
if (MON_CONFUSED(m_ptr))
}
else if (p_ptr->riding)
{
- monster_type *m_ptr = ¤t_floor_ptr->m_list[p_ptr->riding];
+ monster_type *m_ptr = &p_ptr->current_floor_ptr->m_list[p_ptr->riding];
monster_race *r_ptr = &r_info[m_ptr->r_idx];
if (MON_CONFUSED(m_ptr))
else
{
GAME_TEXT m_name[MAX_NLEN];
- monster_type *m_ptr = ¤t_floor_ptr->m_list[p_ptr->riding];
+ monster_type *m_ptr = &p_ptr->current_floor_ptr->m_list[p_ptr->riding];
monster_desc(m_name, m_ptr, 0);
if (MON_CONFUSED(m_ptr))
{
grid_type *g_ptr;
- if (!(in_bounds(current_floor_ptr, y, x))) return (FALSE);
+ if (!(in_bounds(p_ptr->current_floor_ptr, y, x))) return (FALSE);
/* Player grid is always interesting */
if ((y == p_ptr->y) && (x == p_ptr->x)) return (TRUE);
if (p_ptr->image) return (FALSE);
- g_ptr = ¤t_floor_ptr->grid_array[y][x];
+ g_ptr = &p_ptr->current_floor_ptr->grid_array[y][x];
/* Interesting memorized features */
if (g_ptr->info & (CAVE_MARK))
if (!expand_list) return;
/* Scan the current panel */
- for (y = 1; y < current_floor_ptr->height; y++)
+ for (y = 1; y < p_ptr->current_floor_ptr->height; y++)
{
- for (x = 1; x < current_floor_ptr->width; x++)
+ for (x = 1; x < p_ptr->current_floor_ptr->width; x++)
{
/* Require "interesting" contents */
if (!tgt_pt_accept(y, x)) continue;
/* Skip stairs which have defferent distance */
for (; n < tmp_pos.n; ++ n)
{
- grid_type *g_ptr = ¤t_floor_ptr->grid_array[tmp_pos.y[n]][tmp_pos.x[n]];
+ grid_type *g_ptr = &p_ptr->current_floor_ptr->grid_array[tmp_pos.y[n]][tmp_pos.x[n]];
if (cave_have_flag_grid(g_ptr, FF_STAIRS) &&
cave_have_flag_grid(g_ptr, ch == '>' ? FF_MORE : FF_LESS))
}
/* Slide into legality */
- if (x >= current_floor_ptr->width-1) x = current_floor_ptr->width - 2;
+ if (x >= p_ptr->current_floor_ptr->width-1) x = p_ptr->current_floor_ptr->width - 2;
else if (x <= 0) x = 1;
/* Slide into legality */
- if (y >= current_floor_ptr->height-1) y = current_floor_ptr->height- 2;
+ if (y >= p_ptr->current_floor_ptr->height-1) y = p_ptr->current_floor_ptr->height- 2;
else if (y <= 0) y = 1;
}
if (!have_flag(f_info[feat].flags, FF_MORE)) break;
/* Hack -- no trap doors on special levels */
- if (p_ptr->inside_arena || quest_number(current_floor_ptr->dun_level)) continue;
+ if (p_ptr->inside_arena || quest_number(p_ptr->current_floor_ptr->dun_level)) continue;
/* Hack -- no trap doors on the deepest level */
- if (current_floor_ptr->dun_level >= d_info[p_ptr->dungeon_idx].maxdepth) continue;
+ if (p_ptr->current_floor_ptr->dun_level >= d_info[p_ptr->dungeon_idx].maxdepth) continue;
break;
}
*/
void disclose_grid(POSITION y, POSITION x)
{
- grid_type *g_ptr = ¤t_floor_ptr->grid_array[y][x];
+ grid_type *g_ptr = &p_ptr->current_floor_ptr->grid_array[y][x];
if (cave_have_flag_grid(g_ptr, FF_SECRET))
{
*/
void place_trap(POSITION y, POSITION x)
{
- grid_type *g_ptr = ¤t_floor_ptr->grid_array[y][x];
+ grid_type *g_ptr = &p_ptr->current_floor_ptr->grid_array[y][x];
/* Paranoia -- verify location */
- if (!in_bounds(current_floor_ptr, y, x)) return;
+ if (!in_bounds(p_ptr->current_floor_ptr, y, x)) return;
/* Require empty, clean, floor grid */
if (!cave_clean_bold(y, x)) return;
{
int i, num, dam;
POSITION x = trapped_ptr->x, y = trapped_ptr->y;
- grid_type *g_ptr = ¤t_floor_ptr->grid_array[y][x];
+ grid_type *g_ptr = &p_ptr->current_floor_ptr->grid_array[y][x];
feature_type *f_ptr = &f_info[g_ptr->feat];
int trap_feat_type = have_flag(f_ptr->flags, FF_TRAP) ? f_ptr->subtype : NOT_TRAP;
concptr name = _("トラップ", "a trap");
num = 2 + randint1(3);
for (i = 0; i < num; i++)
{
- (void)summon_specific(0, y, x, current_floor_ptr->dun_level, 0, (PM_ALLOW_GROUP | PM_ALLOW_UNIQUE | PM_NO_PET));
+ (void)summon_specific(0, y, x, p_ptr->current_floor_ptr->dun_level, 0, (PM_ALLOW_GROUP | PM_ALLOW_UNIQUE | PM_NO_PET));
}
- if (current_floor_ptr->dun_level > randint1(100)) /* No nasty effect for low levels */
+ if (p_ptr->current_floor_ptr->dun_level > randint1(100)) /* No nasty effect for low levels */
{
bool stop_ty = FALSE;
int count = 0;
msg_print(_("突然天界の戦争に巻き込まれた!", "Suddenly, you are surrounded by immotal beings!"));
/* Summon Demons and Angels */
- for (lev = current_floor_ptr->dun_level; lev >= 20; lev -= 1 + lev / 16)
+ for (lev = p_ptr->current_floor_ptr->dun_level; lev >= 20; lev -= 1 + lev / 16)
{
num = levs[MIN(lev / 10, 9)];
for (i = 0; i < num; i++)
POSITION x1 = rand_spread(x, 7);
POSITION y1 = rand_spread(y, 5);
- if (!in_bounds(current_floor_ptr, y1, x1)) continue;
+ if (!in_bounds(p_ptr->current_floor_ptr, y1, x1)) continue;
/* Require line of projection */
if (!projectable(trapped_ptr->y, trapped_ptr->x, y1, x1)) continue;
/* Let them fight each other */
if (evil_idx && good_idx)
{
- monster_type *evil_ptr = ¤t_floor_ptr->m_list[evil_idx];
- monster_type *good_ptr = ¤t_floor_ptr->m_list[good_idx];
+ monster_type *evil_ptr = &p_ptr->current_floor_ptr->m_list[evil_idx];
+ monster_type *good_ptr = &p_ptr->current_floor_ptr->m_list[good_idx];
evil_ptr->target_y = good_ptr->fy;
evil_ptr->target_x = good_ptr->fx;
good_ptr->target_y = evil_ptr->fy;
fire_ball_hide(GF_WATER_FLOW, 0, 1, 10);
/* Summon Piranhas */
- num = 1 + current_floor_ptr->dun_level / 20;
+ num = 1 + p_ptr->current_floor_ptr->dun_level / 20;
for (i = 0; i < num; i++)
{
- (void)summon_specific(0, y, x, current_floor_ptr->dun_level, SUMMON_PIRANHAS, (PM_ALLOW_GROUP | PM_NO_PET));
+ (void)summon_specific(0, y, x, p_ptr->current_floor_ptr->dun_level, SUMMON_PIRANHAS, (PM_ALLOW_GROUP | PM_NO_PET));
}
break;
}
{
if (!play_music(TERM_XTRA_MUSIC_DUNGEON, player_ptr->dungeon_idx)) return;
- if (current_floor_ptr->dun_level < 40)
+ if (p_ptr->current_floor_ptr->dun_level < 40)
{
if (!play_music(TERM_XTRA_MUSIC_BASIC, MUSIC_BASIC_DUN_LOW)) return;
}
- else if (current_floor_ptr->dun_level < 80)
+ else if (p_ptr->current_floor_ptr->dun_level < 80)
{
if (!play_music(TERM_XTRA_MUSIC_BASIC, MUSIC_BASIC_DUN_MED)) return;
}
return;
}
- if(!current_floor_ptr->dun_level)
+ if(!p_ptr->current_floor_ptr->dun_level)
{
if (player_ptr->lev >= 45)
{
if (p_ptr->pclass == special_menu_info[hoge].jouken_naiyou) menu_name = special_menu_info[hoge].name;
break;
case MENU_WILD:
- if (!current_floor_ptr->dun_level && !p_ptr->inside_arena && !p_ptr->inside_quest)
+ if (!p_ptr->current_floor_ptr->dun_level && !p_ptr->inside_arena && !p_ptr->inside_quest)
{
if ((byte)p_ptr->wild_mode == special_menu_info[hoge].jouken_naiyou) menu_name = special_menu_info[hoge].name;
}
return _("アリーナ", "Arena");
else if (p_ptr->phase_out)
return _("闘技場", "Monster Arena");
- else if (!current_floor_ptr->dun_level && p_ptr->town_num)
+ else if (!p_ptr->current_floor_ptr->dun_level && p_ptr->town_num)
return town_info[p_ptr->town_num].name;
else
return d_name+d_info[p_ptr->dungeon_idx].name;
col_depth = wid + COL_DEPTH;
row_depth = hgt + ROW_DEPTH;
- if (!current_floor_ptr->dun_level)
+ if (!p_ptr->current_floor_ptr->dun_level)
{
strcpy(depths, _("地上", "Surf."));
}
}
else
{
- if (depth_in_feet) (void)sprintf(depths, _("%d ft", "%d ft"), (int)current_floor_ptr->dun_level * 50);
- else (void)sprintf(depths, _("%d 階", "Lev %d"), (int)current_floor_ptr->dun_level);
+ if (depth_in_feet) (void)sprintf(depths, _("%d ft", "%d ft"), (int)p_ptr->current_floor_ptr->dun_level * 50);
+ else (void)sprintf(depths, _("%d 階", "Lev %d"), (int)p_ptr->current_floor_ptr->dun_level);
/* Get color of level based on feeling -JSV- */
switch (p_ptr->feeling)
{
if (p_ptr->riding)
{
- monster_type *m_ptr = ¤t_floor_ptr->m_list[p_ptr->riding];
+ monster_type *m_ptr = &p_ptr->current_floor_ptr->m_list[p_ptr->riding];
if (MON_FAST(m_ptr) && !MON_SLOW(m_ptr)) attr = TERM_L_BLUE;
else if (MON_SLOW(m_ptr) && !MON_FAST(m_ptr)) attr = TERM_VIOLET;
else attr = TERM_GREEN;
{
if (p_ptr->riding)
{
- monster_type *m_ptr = ¤t_floor_ptr->m_list[p_ptr->riding];
+ monster_type *m_ptr = &p_ptr->current_floor_ptr->m_list[p_ptr->riding];
if (MON_FAST(m_ptr) && !MON_SLOW(m_ptr)) attr = TERM_L_BLUE;
else if (MON_SLOW(m_ptr) && !MON_FAST(m_ptr)) attr = TERM_VIOLET;
else attr = TERM_RED;
col = COL_INFO;
}
- m_ptr = ¤t_floor_ptr->m_list[health_who];
+ m_ptr = &p_ptr->current_floor_ptr->m_list[health_who];
if (current_world_ptr->wizard && p_ptr->phase_out)
{
Term_putstr(col - 2, row + 2, 12, TERM_WHITE, " / ");
Term_putstr(col - 2, row + 3, 12, TERM_WHITE, " / ");
- if(current_floor_ptr->m_list[1].r_idx)
+ if(p_ptr->current_floor_ptr->m_list[1].r_idx)
{
- Term_putstr(col - 2, row, 2, r_info[current_floor_ptr->m_list[1].r_idx].x_attr, format("%c", r_info[current_floor_ptr->m_list[1].r_idx].x_char));
- Term_putstr(col - 1, row, 5, TERM_WHITE, format("%5d", current_floor_ptr->m_list[1].hp));
- Term_putstr(col + 5, row, 6, TERM_WHITE, format("%5d", current_floor_ptr->m_list[1].max_maxhp));
+ Term_putstr(col - 2, row, 2, r_info[p_ptr->current_floor_ptr->m_list[1].r_idx].x_attr, format("%c", r_info[p_ptr->current_floor_ptr->m_list[1].r_idx].x_char));
+ Term_putstr(col - 1, row, 5, TERM_WHITE, format("%5d", p_ptr->current_floor_ptr->m_list[1].hp));
+ Term_putstr(col + 5, row, 6, TERM_WHITE, format("%5d", p_ptr->current_floor_ptr->m_list[1].max_maxhp));
}
- if(current_floor_ptr->m_list[2].r_idx)
+ if(p_ptr->current_floor_ptr->m_list[2].r_idx)
{
- Term_putstr(col - 2, row + 1, 2, r_info[current_floor_ptr->m_list[2].r_idx].x_attr, format("%c", r_info[current_floor_ptr->m_list[2].r_idx].x_char));
- Term_putstr(col - 1, row + 1, 5, TERM_WHITE, format("%5d", current_floor_ptr->m_list[2].hp));
- Term_putstr(col + 5, row + 1, 6, TERM_WHITE, format("%5d", current_floor_ptr->m_list[2].max_maxhp));
+ Term_putstr(col - 2, row + 1, 2, r_info[p_ptr->current_floor_ptr->m_list[2].r_idx].x_attr, format("%c", r_info[p_ptr->current_floor_ptr->m_list[2].r_idx].x_char));
+ Term_putstr(col - 1, row + 1, 5, TERM_WHITE, format("%5d", p_ptr->current_floor_ptr->m_list[2].hp));
+ Term_putstr(col + 5, row + 1, 6, TERM_WHITE, format("%5d", p_ptr->current_floor_ptr->m_list[2].max_maxhp));
}
- if(current_floor_ptr->m_list[3].r_idx)
+ if(p_ptr->current_floor_ptr->m_list[3].r_idx)
{
- Term_putstr(col - 2, row + 2, 2, r_info[current_floor_ptr->m_list[3].r_idx].x_attr, format("%c", r_info[current_floor_ptr->m_list[3].r_idx].x_char));
- Term_putstr(col - 1, row + 2, 5, TERM_WHITE, format("%5d", current_floor_ptr->m_list[3].hp));
- Term_putstr(col + 5, row + 2, 6, TERM_WHITE, format("%5d", current_floor_ptr->m_list[3].max_maxhp));
+ Term_putstr(col - 2, row + 2, 2, r_info[p_ptr->current_floor_ptr->m_list[3].r_idx].x_attr, format("%c", r_info[p_ptr->current_floor_ptr->m_list[3].r_idx].x_char));
+ Term_putstr(col - 1, row + 2, 5, TERM_WHITE, format("%5d", p_ptr->current_floor_ptr->m_list[3].hp));
+ Term_putstr(col + 5, row + 2, 6, TERM_WHITE, format("%5d", p_ptr->current_floor_ptr->m_list[3].max_maxhp));
}
- if(current_floor_ptr->m_list[4].r_idx)
+ if(p_ptr->current_floor_ptr->m_list[4].r_idx)
{
- Term_putstr(col - 2, row + 3, 2, r_info[current_floor_ptr->m_list[4].r_idx].x_attr, format("%c", r_info[current_floor_ptr->m_list[4].r_idx].x_char));
- Term_putstr(col - 1, row + 3, 5, TERM_WHITE, format("%5d", current_floor_ptr->m_list[4].hp));
- Term_putstr(col + 5, row + 3, 6, TERM_WHITE, format("%5d", current_floor_ptr->m_list[4].max_maxhp));
+ Term_putstr(col - 2, row + 3, 2, r_info[p_ptr->current_floor_ptr->m_list[4].r_idx].x_attr, format("%c", r_info[p_ptr->current_floor_ptr->m_list[4].r_idx].x_char));
+ Term_putstr(col - 1, row + 3, 5, TERM_WHITE, format("%5d", p_ptr->current_floor_ptr->m_list[4].hp));
+ Term_putstr(col + 5, row + 3, 6, TERM_WHITE, format("%5d", p_ptr->current_floor_ptr->m_list[4].max_maxhp));
}
}
else
int i;
for(i=0;i<tmp_pos.n;i++){
- grid_type* g_ptr = ¤t_floor_ptr->grid_array[tmp_pos.y[i]][tmp_pos.x[i]];
- if(!g_ptr->m_idx || !current_floor_ptr->m_list[g_ptr->m_idx].ml)continue;//no mons or cannot look
- m_ptr = ¤t_floor_ptr->m_list[g_ptr->m_idx];
+ grid_type* g_ptr = &p_ptr->current_floor_ptr->grid_array[tmp_pos.y[i]][tmp_pos.x[i]];
+ if(!g_ptr->m_idx || !p_ptr->current_floor_ptr->m_list[g_ptr->m_idx].ml)continue;//no mons or cannot look
+ m_ptr = &p_ptr->current_floor_ptr->m_list[g_ptr->m_idx];
if(is_pet(m_ptr))continue;//pet
if(!m_ptr->r_idx)continue;//dead?
{
panel_col_max = 0;
/* Reset the panels */
- panel_row_min = current_floor_ptr->height;
- panel_col_min = current_floor_ptr->width;
+ panel_row_min = p_ptr->current_floor_ptr->height;
+ panel_col_min = p_ptr->current_floor_ptr->width;
verify_panel();
x = panel_col_min + dx * wid / 2;
/* Verify the row */
- if (y > current_floor_ptr->height - hgt) y = current_floor_ptr->height - hgt;
+ if (y > p_ptr->current_floor_ptr->height - hgt) y = p_ptr->current_floor_ptr->height - hgt;
if (y < 0) y = 0;
/* Verify the col */
- if (x > current_floor_ptr->width - wid) x = current_floor_ptr->width - wid;
+ if (x > p_ptr->current_floor_ptr->width - wid) x = p_ptr->current_floor_ptr->width - wid;
if (x < 0) x = 0;
/* Handle "changes" */
/* Get bounds */
xmin = (0 < panel_col_min) ? panel_col_min : 0;
- xmax = (current_floor_ptr->width - 1 > panel_col_max) ? panel_col_max : current_floor_ptr->width - 1;
+ xmax = (p_ptr->current_floor_ptr->width - 1 > panel_col_max) ? panel_col_max : p_ptr->current_floor_ptr->width - 1;
ymin = (0 < panel_row_min) ? panel_row_min : 0;
- ymax = (current_floor_ptr->height - 1 > panel_row_max) ? panel_row_max : current_floor_ptr->height - 1;
+ ymax = (p_ptr->current_floor_ptr->height - 1 > panel_row_max) ? panel_row_max : p_ptr->current_floor_ptr->height - 1;
/* Bottom section of screen */
for (y = 1; y <= ymin - panel_row_prt; y++)
* not any. If there were, they would have to set "shimmer_objects"\n
* when they were created, and then new "shimmer" code in "dungeon.c"\n
* would have to be created handle the "shimmer" effect, and the code\n
- * in "current_floor_ptr->grid_array.c" would have to be updated to create the shimmer effect.\n
+ * in "p_ptr->current_floor_ptr->grid_array.c" would have to be updated to create the shimmer effect.\n
*\n
* Note the effects of hallucination. Objects always appear as random\n
* "objects", monsters as random "monsters", and normal grids occasionally\n
*/
void map_info(POSITION y, POSITION x, TERM_COLOR *ap, SYMBOL_CODE *cp, TERM_COLOR *tap, SYMBOL_CODE *tcp)
{
- /* Get the current_floor_ptr->grid_array */
- grid_type *g_ptr = ¤t_floor_ptr->grid_array[y][x];
+ /* Get the p_ptr->current_floor_ptr->grid_array */
+ grid_type *g_ptr = &p_ptr->current_floor_ptr->grid_array[y][x];
OBJECT_IDX this_o_idx, next_o_idx = 0;
for (this_o_idx = g_ptr->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;
/* Memorized objects */
/* Handle monsters */
if (g_ptr->m_idx && display_autopick == 0)
{
- monster_type *m_ptr = ¤t_floor_ptr->m_list[g_ptr->m_idx];
+ monster_type *m_ptr = &p_ptr->current_floor_ptr->m_list[g_ptr->m_idx];
/* Visible monster */
if (m_ptr->ml)
wid -= 14;
if (use_bigtile) wid /= 2;
- yrat = (current_floor_ptr->height + hgt - 1) / hgt;
- xrat = (current_floor_ptr->width + wid - 1) / wid;
+ yrat = (p_ptr->current_floor_ptr->height + hgt - 1) / hgt;
+ xrat = (p_ptr->current_floor_ptr->width + wid - 1) / wid;
/* Disable lighting effects */
view_special_lite = FALSE;
}
/* Allocate the maps */
- C_MAKE(bigma, (current_floor_ptr->height + 2), TERM_COLOR *);
- C_MAKE(bigmc, (current_floor_ptr->height + 2), char_ptr);
- C_MAKE(bigmp, (current_floor_ptr->height + 2), byte_ptr);
+ C_MAKE(bigma, (p_ptr->current_floor_ptr->height + 2), TERM_COLOR *);
+ C_MAKE(bigmc, (p_ptr->current_floor_ptr->height + 2), char_ptr);
+ C_MAKE(bigmp, (p_ptr->current_floor_ptr->height + 2), byte_ptr);
/* Allocate and wipe each line map */
- for (y = 0; y < (current_floor_ptr->height + 2); y++)
+ for (y = 0; y < (p_ptr->current_floor_ptr->height + 2); y++)
{
/* Allocate one row each array */
- C_MAKE(bigma[y], (current_floor_ptr->width + 2), TERM_COLOR);
- C_MAKE(bigmc[y], (current_floor_ptr->width + 2), char);
- C_MAKE(bigmp[y], (current_floor_ptr->width + 2), byte);
+ C_MAKE(bigma[y], (p_ptr->current_floor_ptr->width + 2), TERM_COLOR);
+ C_MAKE(bigmc[y], (p_ptr->current_floor_ptr->width + 2), char);
+ C_MAKE(bigmp[y], (p_ptr->current_floor_ptr->width + 2), byte);
- for (x = 0; x < current_floor_ptr->width + 2; ++x)
+ for (x = 0; x < p_ptr->current_floor_ptr->width + 2; ++x)
{
/* Nothing here */
bigma[y][x] = TERM_WHITE;
}
/* Fill in the map */
- for (i = 0; i < current_floor_ptr->width; ++i)
+ for (i = 0; i < p_ptr->current_floor_ptr->width; ++i)
{
- for (j = 0; j < current_floor_ptr->height; ++j)
+ for (j = 0; j < p_ptr->current_floor_ptr->height; ++j)
{
x = i / xrat + 1;
y = j / yrat + 1;
}
}
- for (j = 0; j < current_floor_ptr->height; ++j)
+ for (j = 0; j < p_ptr->current_floor_ptr->height; ++j)
{
- for (i = 0; i < current_floor_ptr->width; ++i)
+ for (i = 0; i < p_ptr->current_floor_ptr->width; ++i)
{
x = i / xrat + 1;
y = j / yrat + 1;
C_KILL(object_autopick_yx, (hgt + 2), object_type **);
/* Free each line map */
- for (y = 0; y < (current_floor_ptr->height + 2); y++)
+ for (y = 0; y < (p_ptr->current_floor_ptr->height + 2); y++)
{
/* Free one row each array */
- C_KILL(bigma[y], (current_floor_ptr->width + 2), TERM_COLOR);
- C_KILL(bigmc[y], (current_floor_ptr->width + 2), SYMBOL_CODE);
- C_KILL(bigmp[y], (current_floor_ptr->width + 2), byte);
+ C_KILL(bigma[y], (p_ptr->current_floor_ptr->width + 2), TERM_COLOR);
+ C_KILL(bigmc[y], (p_ptr->current_floor_ptr->width + 2), SYMBOL_CODE);
+ C_KILL(bigmp[y], (p_ptr->current_floor_ptr->width + 2), byte);
}
/* Free each line map */
- C_KILL(bigma, (current_floor_ptr->height + 2), TERM_COLOR *);
- C_KILL(bigmc, (current_floor_ptr->height + 2), char_ptr);
- C_KILL(bigmp, (current_floor_ptr->height + 2), byte_ptr);
+ C_KILL(bigma, (p_ptr->current_floor_ptr->height + 2), TERM_COLOR *);
+ C_KILL(bigmc, (p_ptr->current_floor_ptr->height + 2), char_ptr);
+ C_KILL(bigmp, (p_ptr->current_floor_ptr->height + 2), byte_ptr);
}
{
POSITION ny = GRID_Y(path_g[i]);
POSITION nx = GRID_X(path_g[i]);
- grid_type *g_ptr = ¤t_floor_ptr->grid_array[ny][nx];
+ grid_type *g_ptr = &p_ptr->current_floor_ptr->grid_array[ny][nx];
if (panel_contains(ny, nx))
{
TERM_COLOR ta = default_color;
char tc = '*';
- if (g_ptr->m_idx && current_floor_ptr->m_list[g_ptr->m_idx].ml)
+ if (g_ptr->m_idx && p_ptr->current_floor_ptr->m_list[g_ptr->m_idx].ml)
{
/* Determine what is there */
map_info(ny, nx, &a, &c, &ta, &tc);
*/
void spell_damcalc_by_spellnum(int spell_num, EFFECT_ID typ, MONSTER_IDX m_idx, int *max)
{
- monster_type *m_ptr = ¤t_floor_ptr->m_list[m_idx];
+ monster_type *m_ptr = &p_ptr->current_floor_ptr->m_list[m_idx];
HIT_POINT dam = monspell_damage((spell_num), m_idx, DAM_MAX);
spell_damcalc(p_ptr, m_ptr, typ, dam, max);
}
monster_type *m_ptr;
monster_race *r_ptr;
- if (!in_bounds(current_floor_ptr, my, mx) || (distance(my, mx, yy, xx) > WARNING_AWARE_RANGE)) continue;
+ if (!in_bounds(p_ptr->current_floor_ptr, my, mx) || (distance(my, mx, yy, xx) > WARNING_AWARE_RANGE)) continue;
- g_ptr = ¤t_floor_ptr->grid_array[my][mx];
+ g_ptr = &p_ptr->current_floor_ptr->grid_array[my][mx];
if (!g_ptr->m_idx) continue;
- m_ptr = ¤t_floor_ptr->m_list[g_ptr->m_idx];
+ m_ptr = &p_ptr->current_floor_ptr->m_list[g_ptr->m_idx];
if (MON_CSLEEP(m_ptr)) continue;
if (!is_hostile(m_ptr)) continue;
}
else old_damage = old_damage / 2;
- g_ptr = ¤t_floor_ptr->grid_array[yy][xx];
+ g_ptr = &p_ptr->current_floor_ptr->grid_array[yy][xx];
if (((!easy_disarm && is_trap(g_ptr->feat))
|| (g_ptr->mimic && is_trap(g_ptr->feat))) && !one_in_(13))
{
if (avg > depth_max) avg = depth_max;
/* Set the new value. */
- current_floor_ptr->grid_array[ymid][xmid].feat = (FEAT_IDX)avg;
+ p_ptr->current_floor_ptr->grid_array[ymid][xmid].feat = (FEAT_IDX)avg;
}
if (avg > depth_max) avg = depth_max;
/* Set the new value. */
- current_floor_ptr->grid_array[ymid][xmid].feat = (FEAT_IDX)avg;
+ p_ptr->current_floor_ptr->grid_array[ymid][xmid].feat = (FEAT_IDX)avg;
}
/* Are we done? */
if (x1 + 1 == x2) return;
- perturb_point_mid(current_floor_ptr->grid_array[y1][x1].feat, current_floor_ptr->grid_array[y2][x1].feat, current_floor_ptr->grid_array[y1][x2].feat,
- current_floor_ptr->grid_array[y2][x2].feat, xmid, ymid, rough, depth_max);
+ perturb_point_mid(p_ptr->current_floor_ptr->grid_array[y1][x1].feat, p_ptr->current_floor_ptr->grid_array[y2][x1].feat, p_ptr->current_floor_ptr->grid_array[y1][x2].feat,
+ p_ptr->current_floor_ptr->grid_array[y2][x2].feat, xmid, ymid, rough, depth_max);
- perturb_point_end(current_floor_ptr->grid_array[y1][x1].feat, current_floor_ptr->grid_array[y1][x2].feat, current_floor_ptr->grid_array[ymid][xmid].feat,
+ perturb_point_end(p_ptr->current_floor_ptr->grid_array[y1][x1].feat, p_ptr->current_floor_ptr->grid_array[y1][x2].feat, p_ptr->current_floor_ptr->grid_array[ymid][xmid].feat,
xmid, y1, rough, depth_max);
- perturb_point_end(current_floor_ptr->grid_array[y1][x2].feat, current_floor_ptr->grid_array[y2][x2].feat, current_floor_ptr->grid_array[ymid][xmid].feat,
+ perturb_point_end(p_ptr->current_floor_ptr->grid_array[y1][x2].feat, p_ptr->current_floor_ptr->grid_array[y2][x2].feat, p_ptr->current_floor_ptr->grid_array[ymid][xmid].feat,
x2, ymid, rough, depth_max);
- perturb_point_end(current_floor_ptr->grid_array[y2][x2].feat, current_floor_ptr->grid_array[y2][x1].feat, current_floor_ptr->grid_array[ymid][xmid].feat,
+ perturb_point_end(p_ptr->current_floor_ptr->grid_array[y2][x2].feat, p_ptr->current_floor_ptr->grid_array[y2][x1].feat, p_ptr->current_floor_ptr->grid_array[ymid][xmid].feat,
xmid, y2, rough, depth_max);
- perturb_point_end(current_floor_ptr->grid_array[y2][x1].feat, current_floor_ptr->grid_array[y1][x1].feat, current_floor_ptr->grid_array[ymid][xmid].feat,
+ perturb_point_end(p_ptr->current_floor_ptr->grid_array[y2][x1].feat, p_ptr->current_floor_ptr->grid_array[y1][x1].feat, p_ptr->current_floor_ptr->grid_array[ymid][xmid].feat,
x1, ymid, rough, depth_max);
{
for (x1 = 0; x1 < MAX_WID; x1++)
{
- current_floor_ptr->grid_array[y1][x1].feat = feat_permanent;
+ p_ptr->current_floor_ptr->grid_array[y1][x1].feat = feat_permanent;
}
}
{
for (x1 = 0; x1 < MAX_WID; x1++)
{
- current_floor_ptr->grid_array[y1][x1].feat = table_size / 2;
+ p_ptr->current_floor_ptr->grid_array[y1][x1].feat = table_size / 2;
}
}
}
* ToDo: calculate the medium height of the adjacent
* terrains for every corner.
*/
- current_floor_ptr->grid_array[1][1].feat = (s16b)randint0(table_size);
- current_floor_ptr->grid_array[MAX_HGT-2][1].feat = (s16b)randint0(table_size);
- current_floor_ptr->grid_array[1][MAX_WID-2].feat = (s16b)randint0(table_size);
- current_floor_ptr->grid_array[MAX_HGT-2][MAX_WID-2].feat = (s16b)randint0(table_size);
+ p_ptr->current_floor_ptr->grid_array[1][1].feat = (s16b)randint0(table_size);
+ p_ptr->current_floor_ptr->grid_array[MAX_HGT-2][1].feat = (s16b)randint0(table_size);
+ p_ptr->current_floor_ptr->grid_array[1][MAX_WID-2].feat = (s16b)randint0(table_size);
+ p_ptr->current_floor_ptr->grid_array[MAX_HGT-2][MAX_WID-2].feat = (s16b)randint0(table_size);
if (!corner)
{
/* Hack -- preserve four corners */
- s16b north_west = current_floor_ptr->grid_array[1][1].feat;
- s16b south_west = current_floor_ptr->grid_array[MAX_HGT - 2][1].feat;
- s16b north_east = current_floor_ptr->grid_array[1][MAX_WID - 2].feat;
- s16b south_east = current_floor_ptr->grid_array[MAX_HGT - 2][MAX_WID - 2].feat;
+ s16b north_west = p_ptr->current_floor_ptr->grid_array[1][1].feat;
+ s16b south_west = p_ptr->current_floor_ptr->grid_array[MAX_HGT - 2][1].feat;
+ s16b north_east = p_ptr->current_floor_ptr->grid_array[1][MAX_WID - 2].feat;
+ s16b south_east = p_ptr->current_floor_ptr->grid_array[MAX_HGT - 2][MAX_WID - 2].feat;
/* x1, y1, x2, y2, num_depths, roughness */
plasma_recursive(1, 1, MAX_WID-2, MAX_HGT-2, table_size-1, roughness);
/* Hack -- copyback four corners */
- current_floor_ptr->grid_array[1][1].feat = north_west;
- current_floor_ptr->grid_array[MAX_HGT - 2][1].feat = south_west;
- current_floor_ptr->grid_array[1][MAX_WID - 2].feat = north_east;
- current_floor_ptr->grid_array[MAX_HGT - 2][MAX_WID - 2].feat = south_east;
+ p_ptr->current_floor_ptr->grid_array[1][1].feat = north_west;
+ p_ptr->current_floor_ptr->grid_array[MAX_HGT - 2][1].feat = south_west;
+ p_ptr->current_floor_ptr->grid_array[1][MAX_WID - 2].feat = north_east;
+ p_ptr->current_floor_ptr->grid_array[MAX_HGT - 2][MAX_WID - 2].feat = south_east;
for (y1 = 1; y1 < MAX_HGT - 1; y1++)
{
for (x1 = 1; x1 < MAX_WID - 1; x1++)
{
- current_floor_ptr->grid_array[y1][x1].feat = terrain_table[terrain][current_floor_ptr->grid_array[y1][x1].feat];
+ p_ptr->current_floor_ptr->grid_array[y1][x1].feat = terrain_table[terrain][p_ptr->current_floor_ptr->grid_array[y1][x1].feat];
}
}
}
else /* Hack -- only four corners */
{
- current_floor_ptr->grid_array[1][1].feat = terrain_table[terrain][current_floor_ptr->grid_array[1][1].feat];
- current_floor_ptr->grid_array[MAX_HGT - 2][1].feat = terrain_table[terrain][current_floor_ptr->grid_array[MAX_HGT - 2][1].feat];
- current_floor_ptr->grid_array[1][MAX_WID - 2].feat = terrain_table[terrain][current_floor_ptr->grid_array[1][MAX_WID - 2].feat];
- current_floor_ptr->grid_array[MAX_HGT - 2][MAX_WID - 2].feat = terrain_table[terrain][current_floor_ptr->grid_array[MAX_HGT - 2][MAX_WID - 2].feat];
+ p_ptr->current_floor_ptr->grid_array[1][1].feat = terrain_table[terrain][p_ptr->current_floor_ptr->grid_array[1][1].feat];
+ p_ptr->current_floor_ptr->grid_array[MAX_HGT - 2][1].feat = terrain_table[terrain][p_ptr->current_floor_ptr->grid_array[MAX_HGT - 2][1].feat];
+ p_ptr->current_floor_ptr->grid_array[1][MAX_WID - 2].feat = terrain_table[terrain][p_ptr->current_floor_ptr->grid_array[1][MAX_WID - 2].feat];
+ p_ptr->current_floor_ptr->grid_array[MAX_HGT - 2][MAX_WID - 2].feat = terrain_table[terrain][p_ptr->current_floor_ptr->grid_array[MAX_HGT - 2][MAX_WID - 2].feat];
}
/* Hack -- Restore the RNG state */
p_ptr->town_num = wilderness[y][x].town;
/* Set the base level */
- current_floor_ptr->base_level = wilderness[y][x].level;
+ p_ptr->current_floor_ptr->base_level = wilderness[y][x].level;
/* Set the dungeon level */
- current_floor_ptr->dun_level = 0;
+ p_ptr->current_floor_ptr->dun_level = 0;
/* Set the monster generation level */
- current_floor_ptr->monster_level = current_floor_ptr->base_level;
+ p_ptr->current_floor_ptr->monster_level = p_ptr->current_floor_ptr->base_level;
/* Set the object generation level */
- current_floor_ptr->object_level = current_floor_ptr->base_level;
+ p_ptr->current_floor_ptr->object_level = p_ptr->current_floor_ptr->base_level;
/* Create the town */
*/
if (wilderness[y][x].road)
{
- current_floor_ptr->grid_array[MAX_HGT/2][MAX_WID/2].feat = feat_floor;
+ p_ptr->current_floor_ptr->grid_array[MAX_HGT/2][MAX_WID/2].feat = feat_floor;
if (wilderness[y-1][x].road)
{
for (y1 = 1; y1 < MAX_HGT/2; y1++)
{
x1 = MAX_WID/2;
- current_floor_ptr->grid_array[y1][x1].feat = feat_floor;
+ p_ptr->current_floor_ptr->grid_array[y1][x1].feat = feat_floor;
}
}
for (y1 = MAX_HGT/2; y1 < MAX_HGT - 1; y1++)
{
x1 = MAX_WID/2;
- current_floor_ptr->grid_array[y1][x1].feat = feat_floor;
+ p_ptr->current_floor_ptr->grid_array[y1][x1].feat = feat_floor;
}
}
for (x1 = MAX_WID/2; x1 < MAX_WID - 1; x1++)
{
y1 = MAX_HGT/2;
- current_floor_ptr->grid_array[y1][x1].feat = feat_floor;
+ p_ptr->current_floor_ptr->grid_array[y1][x1].feat = feat_floor;
}
}
for (x1 = 1; x1 < MAX_WID/2; x1++)
{
y1 = MAX_HGT/2;
- current_floor_ptr->grid_array[y1][x1].feat = feat_floor;
+ p_ptr->current_floor_ptr->grid_array[y1][x1].feat = feat_floor;
}
}
}
/* Hack -- Induce consistant flavors */
Rand_state_set(wilderness[y][x].seed);
- dy = rand_range(6, current_floor_ptr->height - 6);
- dx = rand_range(6, current_floor_ptr->width - 6);
+ dy = rand_range(6, p_ptr->current_floor_ptr->height - 6);
+ dx = rand_range(6, p_ptr->current_floor_ptr->width - 6);
- current_floor_ptr->grid_array[dy][dx].feat = feat_entrance;
- current_floor_ptr->grid_array[dy][dx].special = wilderness[y][x].entrance;
+ p_ptr->current_floor_ptr->grid_array[dy][dx].feat = feat_entrance;
+ p_ptr->current_floor_ptr->grid_array[dy][dx].special = wilderness[y][x].entrance;
/* Hack -- Restore the RNG state */
Rand_state_restore(state_backup);
feature_type *f_ptr;
/* Big town */
- current_floor_ptr->height = MAX_HGT;
- current_floor_ptr->width = MAX_WID;
+ p_ptr->current_floor_ptr->height = MAX_HGT;
+ p_ptr->current_floor_ptr->width = MAX_WID;
/* Assume illegal panel */
- panel_row_min = current_floor_ptr->height;
- panel_col_min = current_floor_ptr->width;
+ panel_row_min = p_ptr->current_floor_ptr->height;
+ panel_col_min = p_ptr->current_floor_ptr->width;
process_dungeon_file("w_info.txt", 0, 0, current_world_ptr->max_wild_y, current_world_ptr->max_wild_x);
x = p_ptr->wilderness_x;
for (i = 1; i < MAX_WID - 1; i++)
{
- border.north[i] = current_floor_ptr->grid_array[MAX_HGT - 2][i].feat;
+ border.north[i] = p_ptr->current_floor_ptr->grid_array[MAX_HGT - 2][i].feat;
}
/* South border */
for (i = 1; i < MAX_WID - 1; i++)
{
- border.south[i] = current_floor_ptr->grid_array[1][i].feat;
+ border.south[i] = p_ptr->current_floor_ptr->grid_array[1][i].feat;
}
/* West border */
for (i = 1; i < MAX_HGT - 1; i++)
{
- border.west[i] = current_floor_ptr->grid_array[i][MAX_WID - 2].feat;
+ border.west[i] = p_ptr->current_floor_ptr->grid_array[i][MAX_WID - 2].feat;
}
/* East border */
for (i = 1; i < MAX_HGT - 1; i++)
{
- border.east[i] = current_floor_ptr->grid_array[i][1].feat;
+ border.east[i] = p_ptr->current_floor_ptr->grid_array[i][1].feat;
}
/* North west corner */
generate_area(y - 1, x - 1, FALSE, TRUE);
- border.north_west = current_floor_ptr->grid_array[MAX_HGT - 2][MAX_WID - 2].feat;
+ border.north_west = p_ptr->current_floor_ptr->grid_array[MAX_HGT - 2][MAX_WID - 2].feat;
/* North east corner */
generate_area(y - 1, x + 1, FALSE, TRUE);
- border.north_east = current_floor_ptr->grid_array[MAX_HGT - 2][1].feat;
+ border.north_east = p_ptr->current_floor_ptr->grid_array[MAX_HGT - 2][1].feat;
/* South west corner */
generate_area(y + 1, x - 1, FALSE, TRUE);
- border.south_west = current_floor_ptr->grid_array[1][MAX_WID - 2].feat;
+ border.south_west = p_ptr->current_floor_ptr->grid_array[1][MAX_WID - 2].feat;
/* South east corner */
generate_area(y + 1, x + 1, FALSE, TRUE);
- border.south_east = current_floor_ptr->grid_array[1][1].feat;
+ border.south_east = p_ptr->current_floor_ptr->grid_array[1][1].feat;
/* Create terrain of the current area */
/* Special boundary walls -- North */
for (i = 0; i < MAX_WID; i++)
{
- current_floor_ptr->grid_array[0][i].feat = feat_permanent;
- current_floor_ptr->grid_array[0][i].mimic = border.north[i];
+ p_ptr->current_floor_ptr->grid_array[0][i].feat = feat_permanent;
+ p_ptr->current_floor_ptr->grid_array[0][i].mimic = border.north[i];
}
/* Special boundary walls -- South */
for (i = 0; i < MAX_WID; i++)
{
- current_floor_ptr->grid_array[MAX_HGT - 1][i].feat = feat_permanent;
- current_floor_ptr->grid_array[MAX_HGT - 1][i].mimic = border.south[i];
+ p_ptr->current_floor_ptr->grid_array[MAX_HGT - 1][i].feat = feat_permanent;
+ p_ptr->current_floor_ptr->grid_array[MAX_HGT - 1][i].mimic = border.south[i];
}
/* Special boundary walls -- West */
for (i = 0; i < MAX_HGT; i++)
{
- current_floor_ptr->grid_array[i][0].feat = feat_permanent;
- current_floor_ptr->grid_array[i][0].mimic = border.west[i];
+ p_ptr->current_floor_ptr->grid_array[i][0].feat = feat_permanent;
+ p_ptr->current_floor_ptr->grid_array[i][0].mimic = border.west[i];
}
/* Special boundary walls -- East */
for (i = 0; i < MAX_HGT; i++)
{
- current_floor_ptr->grid_array[i][MAX_WID - 1].feat = feat_permanent;
- current_floor_ptr->grid_array[i][MAX_WID - 1].mimic = border.east[i];
+ p_ptr->current_floor_ptr->grid_array[i][MAX_WID - 1].feat = feat_permanent;
+ p_ptr->current_floor_ptr->grid_array[i][MAX_WID - 1].mimic = border.east[i];
}
/* North west corner */
- current_floor_ptr->grid_array[0][0].mimic = border.north_west;
+ p_ptr->current_floor_ptr->grid_array[0][0].mimic = border.north_west;
/* North east corner */
- current_floor_ptr->grid_array[0][MAX_WID - 1].mimic = border.north_east;
+ p_ptr->current_floor_ptr->grid_array[0][MAX_WID - 1].mimic = border.north_east;
/* South west corner */
- current_floor_ptr->grid_array[MAX_HGT - 1][0].mimic = border.south_west;
+ p_ptr->current_floor_ptr->grid_array[MAX_HGT - 1][0].mimic = border.south_west;
/* South east corner */
- current_floor_ptr->grid_array[MAX_HGT - 1][MAX_WID - 1].mimic = border.south_east;
+ p_ptr->current_floor_ptr->grid_array[MAX_HGT - 1][MAX_WID - 1].mimic = border.south_east;
/* Light up or darken the area */
- for (y = 0; y < current_floor_ptr->height; y++)
+ for (y = 0; y < p_ptr->current_floor_ptr->height; y++)
{
- for (x = 0; x < current_floor_ptr->width; x++)
+ for (x = 0; x < p_ptr->current_floor_ptr->width; x++)
{
- g_ptr = ¤t_floor_ptr->grid_array[y][x];
+ g_ptr = &p_ptr->current_floor_ptr->grid_array[y][x];
if (is_daytime())
{
if (p_ptr->teleport_town)
{
- for (y = 0; y < current_floor_ptr->height; y++)
+ for (y = 0; y < p_ptr->current_floor_ptr->height; y++)
{
- for (x = 0; x < current_floor_ptr->width; x++)
+ for (x = 0; x < p_ptr->current_floor_ptr->width; x++)
{
- g_ptr = ¤t_floor_ptr->grid_array[y][x];
+ g_ptr = &p_ptr->current_floor_ptr->grid_array[y][x];
/* Seeing true feature code (ignore mimic) */
f_ptr = &f_info[g_ptr->feat];
else if (p_ptr->leaving_dungeon)
{
- for (y = 0; y < current_floor_ptr->height; y++)
+ for (y = 0; y < p_ptr->current_floor_ptr->height; y++)
{
- for (x = 0; x < current_floor_ptr->width; x++)
+ for (x = 0; x < p_ptr->current_floor_ptr->width; x++)
{
- g_ptr = ¤t_floor_ptr->grid_array[y][x];
+ g_ptr = &p_ptr->current_floor_ptr->grid_array[y][x];
if (cave_have_flag_grid(g_ptr, FF_ENTRANCE))
{
for (i = 0; i < MAX_WID; i++)
for (j = 0; j < MAX_HGT; j++)
{
- current_floor_ptr->grid_array[j][i].feat = feat_permanent;
+ p_ptr->current_floor_ptr->grid_array[j][i].feat = feat_permanent;
}
process_dungeon_file("w_info.txt", 0, 0, current_world_ptr->max_wild_y, current_world_ptr->max_wild_x);
{
if (wilderness[j][i].town && (wilderness[j][i].town != NO_TOWN))
{
- current_floor_ptr->grid_array[j][i].feat = (s16b)feat_town;
- current_floor_ptr->grid_array[j][i].special = (s16b)wilderness[j][i].town;
+ p_ptr->current_floor_ptr->grid_array[j][i].feat = (s16b)feat_town;
+ p_ptr->current_floor_ptr->grid_array[j][i].special = (s16b)wilderness[j][i].town;
}
- else if (wilderness[j][i].road) current_floor_ptr->grid_array[j][i].feat = feat_floor;
+ else if (wilderness[j][i].road) p_ptr->current_floor_ptr->grid_array[j][i].feat = feat_floor;
else if (wilderness[j][i].entrance && (p_ptr->total_winner || !(d_info[wilderness[j][i].entrance].flags1 & DF1_WINNER)))
{
- current_floor_ptr->grid_array[j][i].feat = feat_entrance;
- current_floor_ptr->grid_array[j][i].special = (byte)wilderness[j][i].entrance;
+ p_ptr->current_floor_ptr->grid_array[j][i].feat = feat_entrance;
+ p_ptr->current_floor_ptr->grid_array[j][i].special = (byte)wilderness[j][i].entrance;
}
- else current_floor_ptr->grid_array[j][i].feat = conv_terrain2feat[wilderness[j][i].terrain];
+ else p_ptr->current_floor_ptr->grid_array[j][i].feat = conv_terrain2feat[wilderness[j][i].terrain];
- current_floor_ptr->grid_array[j][i].info |= (CAVE_GLOW | CAVE_MARK);
+ p_ptr->current_floor_ptr->grid_array[j][i].info |= (CAVE_GLOW | CAVE_MARK);
}
- current_floor_ptr->height = (s16b) current_world_ptr->max_wild_y;
- current_floor_ptr->width = (s16b) current_world_ptr->max_wild_x;
+ p_ptr->current_floor_ptr->height = (s16b) current_world_ptr->max_wild_y;
+ p_ptr->current_floor_ptr->width = (s16b) current_world_ptr->max_wild_x;
- if (current_floor_ptr->height > MAX_HGT) current_floor_ptr->height = MAX_HGT;
- if (current_floor_ptr->width > MAX_WID) current_floor_ptr->width = MAX_WID;
+ if (p_ptr->current_floor_ptr->height > MAX_HGT) p_ptr->current_floor_ptr->height = MAX_HGT;
+ if (p_ptr->current_floor_ptr->width > MAX_WID) p_ptr->current_floor_ptr->width = MAX_WID;
/* Assume illegal panel */
- panel_row_min = current_floor_ptr->height;
- panel_col_min = current_floor_ptr->width;
+ panel_row_min = p_ptr->current_floor_ptr->height;
+ panel_col_min = p_ptr->current_floor_ptr->width;
p_ptr->x = p_ptr->wilderness_x;
p_ptr->y = p_ptr->wilderness_y;
return TRUE;
}
- 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;
if (is_pet(m_ptr) && i != p_ptr->riding) have_pet = TRUE;
case 'w': case 'W':
{
object_prep(q_ptr, o_ptr->k_idx);
- apply_magic(q_ptr, current_floor_ptr->dun_level, AM_NO_FIXED_ART | AM_GOOD | AM_GREAT | AM_CURSED);
+ apply_magic(q_ptr, p_ptr->current_floor_ptr->dun_level, AM_NO_FIXED_ART | AM_GOOD | AM_GREAT | AM_CURSED);
break;
}
/* Apply bad magic, but first clear object */
case 'c': case 'C':
{
object_prep(q_ptr, o_ptr->k_idx);
- apply_magic(q_ptr, current_floor_ptr->dun_level, AM_NO_FIXED_ART | AM_GOOD | AM_CURSED);
+ apply_magic(q_ptr, p_ptr->current_floor_ptr->dun_level, AM_NO_FIXED_ART | AM_GOOD | AM_CURSED);
break;
}
/* Apply normal magic, but first clear object */
case 'n': case 'N':
{
object_prep(q_ptr, o_ptr->k_idx);
- apply_magic(q_ptr, current_floor_ptr->dun_level, AM_NO_FIXED_ART);
+ apply_magic(q_ptr, p_ptr->current_floor_ptr->dun_level, AM_NO_FIXED_ART);
break;
}
/* Apply good magic, but first clear object */
case 'g': case 'G':
{
object_prep(q_ptr, o_ptr->k_idx);
- apply_magic(q_ptr, current_floor_ptr->dun_level, AM_NO_FIXED_ART | AM_GOOD);
+ apply_magic(q_ptr, p_ptr->current_floor_ptr->dun_level, AM_NO_FIXED_ART | AM_GOOD);
break;
}
/* Apply great magic, but first clear object */
case 'e': case 'E':
{
object_prep(q_ptr, o_ptr->k_idx);
- apply_magic(q_ptr, current_floor_ptr->dun_level, AM_NO_FIXED_ART | AM_GOOD | AM_GREAT);
+ apply_magic(q_ptr, p_ptr->current_floor_ptr->dun_level, AM_NO_FIXED_ART | AM_GOOD | AM_GREAT);
break;
}
/* Apply special magic, but first clear object */
case 's': case 'S':
{
object_prep(q_ptr, o_ptr->k_idx);
- apply_magic(q_ptr, current_floor_ptr->dun_level, AM_GOOD | AM_GREAT | AM_SPECIAL);
+ apply_magic(q_ptr, p_ptr->current_floor_ptr->dun_level, AM_GOOD | AM_GREAT | AM_SPECIAL);
/* Failed to create artifact; make a random one */
if (!object_is_artifact(q_ptr)) become_random_artifact(q_ptr, FALSE);
/* Let us know what we are doing */
msg_format("Creating a lot of %s items. Base level = %d.",
- quality, current_floor_ptr->dun_level);
+ quality, p_ptr->current_floor_ptr->dun_level);
msg_print(NULL);
/* Set counters to zero */
q_ptr = &forge;
object_prep(q_ptr, k_idx);
- apply_magic(q_ptr, current_floor_ptr->dun_level, AM_NO_FIXED_ART);
+ apply_magic(q_ptr, p_ptr->current_floor_ptr->dun_level, AM_NO_FIXED_ART);
/* Drop the object from heaven */
(void)drop_near(q_ptr, -1, p_ptr->y, p_ptr->x);
(int)d_info[tmp_dungeon_type].mindepth, (int)d_info[tmp_dungeon_type].maxdepth);
/* Default */
- sprintf(tmp_val, "%d", (int)current_floor_ptr->dun_level);
+ sprintf(tmp_val, "%d", (int)p_ptr->current_floor_ptr->dun_level);
/* Ask for a level */
if (!get_string(ppp, tmp_val, 10)) return;
if (autosave_l) do_cmd_save_game(TRUE);
/* Change level */
- current_floor_ptr->dun_level = command_arg;
+ p_ptr->current_floor_ptr->dun_level = command_arg;
prepare_change_floor_mode(CFM_RAND_PLACE);
- if (!current_floor_ptr->dun_level) creature_ptr->dungeon_idx = 0;
+ if (!p_ptr->current_floor_ptr->dun_level) creature_ptr->dungeon_idx = 0;
creature_ptr->inside_arena = FALSE;
creature_ptr->wild_mode = FALSE;
int i;
for (i = 0; i < num; i++)
{
- (void)summon_specific(0, p_ptr->y, p_ptr->x, current_floor_ptr->dun_level, 0, (PM_ALLOW_GROUP | PM_ALLOW_UNIQUE));
+ (void)summon_specific(0, p_ptr->y, p_ptr->x, p_ptr->current_floor_ptr->dun_level, 0, (PM_ALLOW_GROUP | PM_ALLOW_UNIQUE));
}
}
MONSTER_IDX i;
/* Genocide everyone nearby */
- 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;
/* Skip the mount */
MONSTER_IDX i;
/* Genocide everyone */
- 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;
/* Skip the mount */
if (!tgt_pt(&x, &y)) return;
- g_ptr = ¤t_floor_ptr->grid_array[y][x];
+ g_ptr = &p_ptr->current_floor_ptr->grid_array[y][x];
/* Default */
sprintf(tmp_val, "%d", prev_feat);
/* Make every dungeon square "known" to test streamers -KMW- */
case 'u':
- for (y = 0; y < current_floor_ptr->height; y++)
+ for (y = 0; y < p_ptr->current_floor_ptr->height; y++)
{
- for (x = 0; x < current_floor_ptr->width; x++)
+ for (x = 0; x < p_ptr->current_floor_ptr->width; x++)
{
- current_floor_ptr->grid_array[y][x].info |= (CAVE_GLOW | CAVE_MARK);
+ p_ptr->current_floor_ptr->grid_array[y][x].info |= (CAVE_GLOW | CAVE_MARK);
}
}
wiz_lite(creature_ptr, FALSE);
bool wizard; /* This world under wizard mode */
+ OBJECT_IDX max_o_idx; /*!< Maximum number of objects in the level */
+ MONSTER_IDX max_m_idx; /*!< Maximum number of monsters in the level */
} world_type;