else
{
/* Make a good object */
- if (!make_object(q_ptr, mode)) continue;
+ if (!make_object(owner_ptr, q_ptr, mode)) continue;
}
/* If chest scatters its contents, pick any floor square. */
if (!f_ptr->power)
{
- cave_alter_feat(y, x, FF_OPEN);
+ cave_alter_feat(creature_ptr, y, x, FF_OPEN);
sound(SOUND_OPENDOOR);
return more;
}
msg_print(_("鍵をはずした。", "You have picked the lock."));
/* Open the door */
- cave_alter_feat(y, x, FF_OPEN);
+ cave_alter_feat(creature_ptr, y, x, FF_OPEN);
sound(SOUND_OPENDOOR);
else
{
/* Close the door */
- cave_alter_feat(y, x, FF_CLOSE);
+ cave_alter_feat(creature_ptr, y, x, FF_CLOSE);
/* Broken door */
if (old_feat == g_ptr->feat)
msg_format(_("%sをくずした。", "You have removed the %s."), name);
/* Remove the feature */
- cave_alter_feat(y, x, FF_TUNNEL);
+ cave_alter_feat(creature_ptr, y, x, FF_TUNNEL);
creature_ptr->update |= (PU_FLOW);
}
else
if (have_flag(f_ptr->flags, FF_GLASS)) sound(SOUND_GLASS);
/* Remove the feature */
- cave_alter_feat(y, x, FF_TUNNEL);
+ cave_alter_feat(creature_ptr, y, x, FF_TUNNEL);
chg_virtue(creature_ptr, V_DILIGENCE, 1);
chg_virtue(creature_ptr, V_NATURE, -1);
msg_print(_("鍵をはずした。", "You have picked the lock."));
/* Open the door */
- cave_alter_feat(y, x, FF_OPEN);
+ cave_alter_feat(creature_ptr, y, x, FF_OPEN);
sound(SOUND_OPENDOOR);
else
{
/* Open the door */
- cave_alter_feat(y, x, FF_OPEN);
+ cave_alter_feat(creature_ptr, y, x, FF_OPEN);
sound(SOUND_OPENDOOR);
}
gain_exp(creature_ptr, power);
/* Remove the trap */
- cave_alter_feat(y, x, FF_DISARM);
+ cave_alter_feat(creature_ptr, y, x, FF_DISARM);
/* Move the player onto the trap */
move_player(creature_ptr, dir, easy_disarm, FALSE);
/* Break down the door */
if ((randint0(100) < 50) || (feat_state(g_ptr->feat, FF_OPEN) == g_ptr->feat) || have_flag(f_ptr->flags, FF_GLASS))
{
- cave_alter_feat(y, x, FF_BASH);
+ cave_alter_feat(creature_ptr, y, x, FF_BASH);
}
/* Open the door */
else
{
- cave_alter_feat(y, x, FF_OPEN);
+ cave_alter_feat(creature_ptr, y, x, FF_OPEN);
}
/* Hack -- Fall through the door */
/* Successful jamming */
msg_format(_("%sにくさびを打ち込んだ。", "You jam the %s with a spike."), f_name + f_info[feat].name);
- cave_alter_feat(y, x, FF_SPIKE);
+ cave_alter_feat(creature_ptr, y, x, FF_SPIKE);
vary_item(item, -1);
}
shooter_ptr->update |= (PU_VIEW | PU_LITE | PU_FLOW | PU_MON_LITE);
/* Destroy the wall */
- cave_alter_feat(ny, nx, FF_HURT_ROCK);
+ cave_alter_feat(shooter_ptr, ny, nx, FF_HURT_ROCK);
hit_body = TRUE;
break;
/* Enter store */
case SPECIAL_KEY_STORE:
{
- do_cmd_store();
+ do_cmd_store(creature_ptr);
break;
}
*/
if (randint0(100) < 75)
{
- place_object(floor_ptr, *y, *x, 0L);
+ place_object(player_ptr, *y, *x, 0L);
}
else
{
/* Create an out of deep object */
if (randint0(100) < 75)
- place_object(floor_ptr, *y, *x, 0L);
+ place_object(player_ptr, *y, *x, 0L);
else if (randint0(100) < 80)
- place_object(floor_ptr, *y, *x, AM_GOOD);
+ place_object(player_ptr, *y, *x, AM_GOOD);
else
- place_object(floor_ptr, *y, *x, AM_GOOD | AM_GREAT);
+ place_object(player_ptr, *y, *x, AM_GOOD | AM_GREAT);
floor_ptr->object_level = floor_ptr->base_level;
}
* @param num 配置したい数
* @return 規定数通りに生成に成功したらTRUEを返す。
*/
-static void alloc_object(floor_type *floor_ptr, int set, EFFECT_ID typ, int num)
+static void alloc_object(player_type *owner_ptr, int set, EFFECT_ID typ, int num)
{
POSITION y = 0, x = 0;
int k;
grid_type *g_ptr;
/* A small level has few objects. */
+ floor_type *floor_ptr = owner_ptr->current_floor_ptr;
num = num * floor_ptr->height * floor_ptr->width / (MAX_HGT*MAX_WID) +1;
/* Place some objects */
case ALLOC_TYP_OBJECT:
{
- place_object(floor_ptr, y, x, 0L);
+ place_object(owner_ptr, y, x, 0L);
break;
}
}
/* Build maze */
if (dungeon_ptr->flags1 & DF1_MAZE)
{
- build_maze_vault(floor_ptr, floor_ptr->width/2-1, floor_ptr->height/2-1, floor_ptr->width-4, floor_ptr->height-4, FALSE);
+ build_maze_vault(player_ptr, floor_ptr->width/2-1, floor_ptr->height/2-1, floor_ptr->width-4, floor_ptr->height-4, FALSE);
/* Place 3 or 4 down stairs near some walls */
if (!alloc_stairs(floor_ptr, feat_down_stair, rand_range(2, 3), 3)) return FALSE;
/*
* Build each type of room in turn until we cannot build any more.
*/
- if (!generate_rooms(floor_ptr)) return FALSE;
+ if (!generate_rooms(player_ptr)) return FALSE;
/* Make a hole in the dungeon roof sometimes at level 1 */
/* Hack -- Add some quartz streamers */
for (i = 0; i < DUN_STR_QUA; i++)
{
- build_streamer(floor_ptr, dungeon_ptr->stream2, DUN_STR_QC);
+ build_streamer(player_ptr, dungeon_ptr->stream2, DUN_STR_QC);
}
}
/* Hack -- Add some magma streamers */
for (i = 0; i < DUN_STR_MAG; i++)
{
- build_streamer(floor_ptr, dungeon_ptr->stream1, DUN_STR_MC);
+ build_streamer(player_ptr, dungeon_ptr->stream1, DUN_STR_MC);
}
}
}
}
/* Place some traps in the dungeon */
- alloc_object(floor_ptr, ALLOC_SET_BOTH, ALLOC_TYP_TRAP, randint1(k));
+ alloc_object(player_ptr, ALLOC_SET_BOTH, ALLOC_TYP_TRAP, randint1(k));
/* Put some rubble in corridors (except NO_CAVE dungeon (Castle)) */
- if (!(dungeon_ptr->flags1 & DF1_NO_CAVE)) alloc_object(floor_ptr, ALLOC_SET_CORR, ALLOC_TYP_RUBBLE, randint1(k));
+ if (!(dungeon_ptr->flags1 & DF1_NO_CAVE)) alloc_object(player_ptr, ALLOC_SET_CORR, ALLOC_TYP_RUBBLE, randint1(k));
/* Mega Hack -- No object at first level of deeper dungeon */
if (p_ptr->enter_dungeon && floor_ptr->dun_level > 1)
}
/* Put some objects in rooms */
- alloc_object(floor_ptr, ALLOC_SET_ROOM, ALLOC_TYP_OBJECT, randnor(DUN_AMT_ROOM, 3));
+ alloc_object(player_ptr, ALLOC_SET_ROOM, ALLOC_TYP_OBJECT, randnor(DUN_AMT_ROOM, 3));
/* Put some objects/gold in the dungeon */
- alloc_object(floor_ptr, ALLOC_SET_BOTH, ALLOC_TYP_OBJECT, randnor(DUN_AMT_ITEM, 3));
- alloc_object(floor_ptr, ALLOC_SET_BOTH, ALLOC_TYP_GOLD, randnor(DUN_AMT_GOLD, 3));
+ alloc_object(player_ptr, ALLOC_SET_BOTH, ALLOC_TYP_OBJECT, randnor(DUN_AMT_ITEM, 3));
+ alloc_object(player_ptr, ALLOC_SET_BOTH, ALLOC_TYP_GOLD, randnor(DUN_AMT_GOLD, 3));
/* Set back to default */
floor_ptr->object_level = floor_ptr->base_level;
/*!
* @brief ダンジョンの壁部にストリーマー(地質の変化)を与える /
* Places "streamers" of rock through dungeon
+ * @param player_ptr プレーヤーへの参照ポインタ
* @param feat ストリーマー地形ID
* @param chance 生成密度
* @return なし
* hidden gold types are currently unused.
* </pre>
*/
-void build_streamer(floor_type *floor_ptr, FEAT_IDX feat, int chance)
+void build_streamer(player_type *player_ptr, FEAT_IDX feat, int chance)
{
int i;
POSITION y, x, tx, ty;
bool streamer_may_have_gold = have_flag(streamer_ptr->flags, FF_MAY_HAVE_GOLD);
/* Hack -- Choose starting point */
+ floor_type *floor_ptr = player_ptr->current_floor_ptr;
y = rand_spread(floor_ptr->height / 2, floor_ptr->height / 6);
x = rand_spread(floor_ptr->width / 2, floor_ptr->width / 6);
/* Hack -- Add some known treasure */
if (one_in_(chance))
{
- cave_alter_feat(ty, tx, FF_MAY_HAVE_GOLD);
+ cave_alter_feat(player_ptr, ty, tx, FF_MAY_HAVE_GOLD);
}
/* Hack -- Add some hidden treasure */
else if (one_in_(chance / 4))
{
- cave_alter_feat(ty, tx, FF_MAY_HAVE_GOLD);
- cave_alter_feat(ty, tx, FF_ENSECRET);
+ cave_alter_feat(player_ptr, ty, tx, FF_MAY_HAVE_GOLD);
+ cave_alter_feat(player_ptr, ty, tx, FF_ENSECRET);
}
}
}
/* Externs */
extern void add_river(floor_type *floor_ptr, FEAT_IDX feat1, FEAT_IDX feat2);
-extern void build_streamer(floor_type *floor_ptr, FEAT_IDX feat, int chance);
+extern void build_streamer(player_type *player_ptr, FEAT_IDX feat, int chance);
extern void place_trees(floor_type *floor_ptr, POSITION x, POSITION y);
extern void destroy_level(player_type *player_ptr);
/*!
* @brief 特殊な部屋向けに各種アイテムを配置する / Create up to "num" objects near the given coordinates
+ * @param player_ptr プレーヤーへの参照ポインタ
* @param y 配置したい中心マスのY座標
* @param x 配置したい中心マスのX座標
* @param num 配置したい数
* @details
* Only really called by some of the "vault" routines.
*/
-void vault_objects(floor_type *floor_ptr, POSITION y, POSITION x, int num)
+void vault_objects(player_type *player_ptr, POSITION y, POSITION x, int num)
{
int dummy = 0;
int i = 0, j = y, k = x;
grid_type *g_ptr;
-
+ floor_type *floor_ptr = player_ptr->current_floor_ptr;
/* Attempt to place 'num' objects */
for (; num > 0; --num)
if (randint0(100) < 75)
{
- place_object(floor_ptr, j, k, 0L);
+ place_object(player_ptr, j, k, 0L);
}
else
{
/*!
* @brief フロアの指定位置に生成階に応じたベースアイテムの生成を行う。
* Attempt to place an object (normal or good/great) at the given location.
+ * @param owner_ptr プレーヤーへの参照ポインタ
* @param y 配置したいフロアのY座標
* @param x 配置したいフロアのX座標
* @param mode オプションフラグ
* This routine uses "object_level" for the "generation level".\n
* This routine requires a clean floor grid destination.\n
*/
-void place_object(floor_type *floor_ptr, POSITION y, POSITION x, BIT_FLAGS mode)
+void place_object(player_type *owner_ptr, POSITION y, POSITION x, BIT_FLAGS mode)
{
- OBJECT_IDX o_idx;
+ floor_type *floor_ptr = owner_ptr->current_floor_ptr;
/* Acquire grid */
grid_type *g_ptr = &floor_ptr->grid_array[y][x];
object_type forge;
object_type *q_ptr;
-
/* Paranoia -- check bounds */
if (!in_bounds(floor_ptr, y, x)) return;
object_wipe(q_ptr);
/* Make an object (if possible) */
- if (!make_object(q_ptr, mode)) return;
+ if (!make_object(owner_ptr, q_ptr, mode)) return;
- o_idx = o_pop(floor_ptr);
+ OBJECT_IDX o_idx = o_pop(floor_ptr);
/* Success */
if (o_idx)
extern void try_door(floor_type *floor_ptr, POSITION y, POSITION x);
extern FEAT_IDX conv_dungeon_feat(floor_type *floor_ptr, FEAT_IDX newfeat);
-extern void vault_objects(floor_type *floor_ptr, POSITION y, POSITION x, int num);
+extern void vault_objects(player_type *player_ptr, POSITION y, POSITION x, int num);
/*
* project()関数に用いられる、遠隔攻撃特性ビットフラグ / Bit flags for the "project()" function
extern sint project_path(floor_type *floor_ptr, u16b *gp, POSITION range, POSITION y1, POSITION x1, POSITION y2, POSITION x2, BIT_FLAGS flg);
extern void set_floor(floor_type *floor_ptr, POSITION x, POSITION y);
-extern void place_object(floor_type *floor_ptr, POSITION y, POSITION x, BIT_FLAGS mode);
+extern void place_object(player_type *owner_ptr, POSITION y, POSITION x, BIT_FLAGS mode);
extern void place_gold(floor_type *floor_ptr, POSITION y, POSITION x);
extern void delete_monster(floor_type *floor_ptr, POSITION y, POSITION x);
extern void compact_objects(floor_type *floor_ptr, int size);
* Takes a location and action and changes the feature at that
* location through applying the given action.
*/
-void cave_alter_feat(POSITION y, POSITION x, int action)
+void cave_alter_feat(player_type *player_ptr, POSITION y, POSITION x, int action)
{
/* Set old feature */
- FEAT_IDX oldfeat = p_ptr->current_floor_ptr->grid_array[y][x].feat;
+ floor_type *floor_ptr = player_ptr->current_floor_ptr;
+ FEAT_IDX oldfeat = floor_ptr->grid_array[y][x].feat;
/* Get the new feat */
FEAT_IDX newfeat = feat_state(oldfeat, action);
if (newfeat == oldfeat) return;
/* Set the new feature */
- cave_set_feat(p_ptr->current_floor_ptr, y, x, newfeat);
+ cave_set_feat(floor_ptr, y, x, newfeat);
if (!(feature_action_flags[action] & FAF_NO_DROP))
{
if (have_flag(old_f_ptr->flags, FF_HAS_GOLD) && !have_flag(f_ptr->flags, FF_HAS_GOLD))
{
/* Place some gold */
- place_gold(p_ptr->current_floor_ptr, y, x);
+ place_gold(floor_ptr, y, x);
found = TRUE;
}
/* Handle item */
- 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)))
+ if (have_flag(old_f_ptr->flags, FF_HAS_ITEM) && !have_flag(f_ptr->flags, FF_HAS_ITEM) && (randint0(100) < (15 - floor_ptr->dun_level / 2)))
{
/* Place object */
- place_object(p_ptr->current_floor_ptr, y, x, 0L);
+ place_object(player_ptr, y, x, 0L);
found = TRUE;
}
- if (found && current_world_ptr->character_dungeon && player_can_see_bold(p_ptr, y, x))
+ if (found && current_world_ptr->character_dungeon && player_can_see_bold(player_ptr, y, x))
{
msg_print(_("何かを発見した!", "You have found something!"));
}
if (have_flag(old_f_ptr->flags, FF_GLASS) && current_world_ptr->character_dungeon)
{
- project(p_ptr, PROJECT_WHO_GLASS_SHARDS, 1, y, x, MIN(p_ptr->current_floor_ptr->dun_level, 100) / 4, GF_SHARDS,
+ project(player_ptr, PROJECT_WHO_GLASS_SHARDS, 1, y, x, MIN(floor_ptr->dun_level, 100) / 4, GF_SHARDS,
(PROJECT_GRID | PROJECT_ITEM | PROJECT_KILL | PROJECT_HIDE | PROJECT_JUMP | PROJECT_NO_HANGEKI), -1);
}
}
extern void lite_spot(POSITION y, POSITION x);
extern void update_flow(player_type *subject_ptr);
extern FEAT_IDX feat_state(FEAT_IDX feat, int action);
-extern void cave_alter_feat(POSITION y, POSITION x, int action);
+extern void cave_alter_feat(player_type *player_ptr, POSITION y, POSITION x, int action);
extern void remove_mirror(player_type *caster_ptr, POSITION y, POSITION x);
extern bool is_open(FEAT_IDX feat);
extern bool check_local_illumination(player_type *creature_ptr, POSITION y, POSITION x);
if (randint0(m_ptr->hp / 10) > f_ptr->power)
{
/* Unlock the door */
- cave_alter_feat(ny, nx, FF_DISARM);
+ cave_alter_feat(target_ptr, ny, nx, FF_DISARM);
/* Do not bash the door */
may_bash = FALSE;
/* Break down the door */
if (did_bash_door && ((randint0(100) < 50) || (feat_state(g_ptr->feat, FF_OPEN) == g_ptr->feat) || have_flag(f_ptr->flags, FF_GLASS)))
{
- cave_alter_feat(ny, nx, FF_BASH);
+ cave_alter_feat(target_ptr, ny, nx, FF_BASH);
if (!monster_is_valid(m_ptr)) /* Killed by shards of glass, etc. */
{
/* Open the door */
else
{
- cave_alter_feat(ny, nx, FF_OPEN);
+ cave_alter_feat(target_ptr, ny, nx, FF_OPEN);
}
f_ptr = &f_info[g_ptr->feat];
msg_print(_("ギシギシいう音が聞こえる。", "There is a grinding sound."));
}
- cave_alter_feat(ny, nx, FF_HURT_DISI);
+ cave_alter_feat(target_ptr, ny, nx, FF_HURT_DISI);
if (!monster_is_valid(m_ptr)) /* Killed by shards of glass, etc. */
{
get_obj_num_hook = kind_is_book;
/* Make a book */
- make_object(q_ptr, mo_mode);
+ make_object(p_ptr, q_ptr, mo_mode);
(void)drop_near(p_ptr, q_ptr, -1, y, x);
}
break;
get_obj_num_hook = kind_is_cloak;
/* Make a cloak */
- make_object(q_ptr, mo_mode);
+ make_object(p_ptr, q_ptr, mo_mode);
(void)drop_near(p_ptr, q_ptr, -1, y, x);
}
break;
get_obj_num_hook = kind_is_polearm;
/* Make a poleweapon */
- make_object(q_ptr, mo_mode);
+ make_object(p_ptr, q_ptr, mo_mode);
(void)drop_near(p_ptr, q_ptr, -1, y, x);
}
break;
get_obj_num_hook = kind_is_armor;
/* Make a hard armor */
- make_object(q_ptr, mo_mode);
+ make_object(p_ptr, q_ptr, mo_mode);
(void)drop_near(p_ptr, q_ptr, -1, y, x);
}
break;
get_obj_num_hook = kind_is_hafted;
/* Make a hafted weapon */
- make_object(q_ptr, mo_mode);
+ make_object(p_ptr, q_ptr, mo_mode);
(void)drop_near(p_ptr, q_ptr, -1, y, x);
}
break;
get_obj_num_hook = kind_is_sword;
/* Make a sword */
- make_object(q_ptr, mo_mode);
+ make_object(p_ptr, q_ptr, mo_mode);
(void)drop_near(p_ptr, q_ptr, -1, y, x);
}
break;
}
else
{
- if (!make_object(q_ptr, mo_mode)) continue;
+ if (!make_object(p_ptr, q_ptr, mo_mode)) continue;
dump_item++;
}
+
(void)drop_near(p_ptr, q_ptr, -1, y, x);
}
extern void delete_object(floor_type *floor_ptr, POSITION y, POSITION x);
extern OBJECT_IDX o_pop(floor_type *floor_ptr);
-extern OBJECT_IDX get_obj_num(DEPTH level, BIT_FLAGS mode);
+extern OBJECT_IDX get_obj_num(player_type *o_ptr, DEPTH level, BIT_FLAGS mode);
extern void object_known(object_type *o_ptr);
extern void object_aware(object_type *o_ptr);
extern void object_tried(object_type *o_ptr);
extern OBJECT_SUBTYPE_VALUE coin_type;
-extern bool make_object(object_type *j_ptr, BIT_FLAGS mode);
+extern bool make_object(player_type *owner_ptr, object_type *j_ptr, BIT_FLAGS mode);
extern bool make_gold(object_type *j_ptr);
extern OBJECT_IDX drop_near(player_type *owner_type, object_type *o_ptr, PERCENTAGE chance, POSITION y, POSITION x);
extern void vary_item(INVENTORY_IDX item, ITEM_NUMBER num);
* Note that if no objects are "appropriate", then this function will\n
* fail, and return zero, but this should *almost* never happen.\n
*/
-OBJECT_IDX get_obj_num(DEPTH level, BIT_FLAGS mode)
+OBJECT_IDX get_obj_num(player_type *owner_ptr, DEPTH level, BIT_FLAGS mode)
{
int i, j, p;
KIND_OBJECT_IDX k_idx;
if (level > MAX_DEPTH - 1) level = MAX_DEPTH - 1;
/* Boost level */
- if ((level > 0) && !(d_info[p_ptr->dungeon_idx].flags1 & DF1_BEGINNER))
+ if ((level > 0) && !(d_info[owner_ptr->dungeon_idx].flags1 & DF1_BEGINNER))
{
/* Occasional "boost" */
if (one_in_(GREAT_OBJ))
/*!
* @brief 生成階に応じたベースアイテムの生成を行う。
* Attempt to make an object (normal or good/great)
- * @param floor_ptr 生成階への参照ポインタ
+ * @param owner_ptr プレーヤーへの参照ポインタ
* @param j_ptr 生成結果を収めたいオブジェクト構造体の参照ポインタ
* @param mode オプションフラグ
* @return 生成に成功したらTRUEを返す。
* This routine uses "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)
+bool make_object(player_type *owner_ptr, object_type *j_ptr, BIT_FLAGS mode)
{
- PERCENTAGE prob;
- DEPTH base;
-
+ floor_type *floor_ptr = owner_ptr->current_floor_ptr;
/* Chance of "special object" */
- prob = ((mode & AM_GOOD) ? 10 : 1000);
+ PERCENTAGE prob = ((mode & AM_GOOD) ? 10 : 1000);
/* Base level for the object */
- base = ((mode & AM_GOOD) ? (p_ptr->current_floor_ptr->object_level + 10) : p_ptr->current_floor_ptr->object_level);
+ DEPTH base = ((mode & AM_GOOD) ? (floor_ptr->object_level + 10) : floor_ptr->object_level);
/* Generate a special object, or a normal object */
if (get_obj_num_hook) get_obj_num_prep();
/* Pick a random object */
- k_idx = get_obj_num(base, mode);
+ k_idx = get_obj_num(owner_ptr, base, mode);
/* Restricted objects */
if (get_obj_num_hook)
}
/* Apply magic (allow artifacts) */
- apply_magic(j_ptr, p_ptr->current_floor_ptr->object_level, mode);
+ apply_magic(j_ptr, floor_ptr->object_level, mode);
/* Hack -- generate multiple spikes/missiles */
switch (j_ptr->tval)
if (cheat_peek) object_mention(j_ptr);
- /* Success */
- return (TRUE);
+ return TRUE;
}
travel_type travel;
#endif
+
/*!
* @brief 地形やその上のアイテムの隠された要素を全て明かす /
* Search for hidden things
+ * @param creature_ptr プレーヤーへの参照ポインタ
* @param y 対象となるマスのY座標
* @param x 対象となるマスのX座標
* @return なし
*/
-static void discover_hidden_things(POSITION y, POSITION x)
+static void discover_hidden_things(player_type *creature_ptr, POSITION y, POSITION x)
{
OBJECT_IDX this_o_idx, next_o_idx = 0;
grid_type *g_ptr;
- g_ptr = &p_ptr->current_floor_ptr->grid_array[y][x];
+ floor_type *floor_ptr = creature_ptr->current_floor_ptr;
+ g_ptr = &floor_ptr->grid_array[y][x];
/* Invisible trap */
if (g_ptr->mimic && is_trap(g_ptr->feat))
{
- disclose_grid(p_ptr->current_floor_ptr, y, x);
+ disclose_grid(creature_ptr, y, x);
msg_print(_("トラップを発見した。", "You have found a trap."));
- disturb(p_ptr, FALSE, TRUE);
+ disturb(creature_ptr, FALSE, TRUE);
}
/* Secret door */
if (is_hidden_door(g_ptr))
{
msg_print(_("隠しドアを発見した。", "You have found a secret door."));
- disclose_grid(p_ptr->current_floor_ptr, y, x);
- disturb(p_ptr, FALSE, FALSE);
+ disclose_grid(creature_ptr, y, x);
+ disturb(creature_ptr, FALSE, FALSE);
}
/* 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 = &p_ptr->current_floor_ptr->o_list[this_o_idx];
+ o_ptr = &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;
{
msg_print(_("箱に仕掛けられたトラップを発見した!", "You have discovered a trap on the chest!"));
object_known(o_ptr);
- disturb(p_ptr, FALSE, FALSE);
+ disturb(creature_ptr, FALSE, FALSE);
}
}
}
+
/*!
* @brief プレイヤーの探索処理判定
* @return なし
/* Sometimes, notice things */
if (randint0(100) < chance)
{
- discover_hidden_things(creature_ptr->y + ddy_ddd[i], creature_ptr->x + ddx_ddd[i]);
+ discover_hidden_things(creature_ptr, creature_ptr->y + ddy_ddd[i], creature_ptr->x + ddx_ddd[i]);
}
}
}
msg_print(_("トラップだ!", "You found a trap!"));
/* Pick a trap */
- disclose_grid(creature_ptr->current_floor_ptr, creature_ptr->y, creature_ptr->x);
+ disclose_grid(creature_ptr, creature_ptr->y, creature_ptr->x);
}
/* Hit the trap */
if (p_can_kill_walls)
{
- cave_alter_feat(y, x, FF_HURT_DISI);
+ cave_alter_feat(creature_ptr, y, x, FF_HURT_DISI);
/* Update some things -- similar to GF_KILL_WALL */
creature_ptr->update |= (PU_FLOW);
object_wipe(o_ptr);
/* Make a great object */
- make_object(o_ptr, AM_GOOD | AM_GREAT);
+ make_object(player_ptr, o_ptr, AM_GOOD | AM_GREAT);
(void)drop_near(player_ptr, o_ptr, -1, y, x);
}
}
if (!cave_have_flag_bold(caster_ptr->current_floor_ptr, y, x, FF_HURT_ROCK)) break;
/* Destroy the feature */
- cave_alter_feat(y, x, FF_HURT_ROCK);
+ cave_alter_feat(caster_ptr, y, x, FF_HURT_ROCK);
caster_ptr->update |= (PU_FLOW);
}
break;
/*!
* @brief タイプ3の部屋…十字型の部屋を生成する / Type 3 -- Cross shaped rooms
+* @param player_ptr プレーヤーへの参照ポインタ
* @return なし
* @details
* Builds a room at a row, column coordinate\n
* the code below will work (with "bounds checking") for 5x5, or even\n
* for unsymetric values like 4x3 or 5x3 or 3x4 or 3x5, or even larger.\n
*/
-bool build_type3(floor_type *floor_ptr)
+bool build_type3(player_type *player_ptr)
{
POSITION y, x, dy, dx, wy, wx;
POSITION y1a, x1a, y2a, x2a;
bool light;
grid_type *g_ptr;
-
/* Find and reserve some space in the dungeon. Get center of room. */
+ floor_type *floor_ptr = player_ptr->current_floor_ptr;
if (!find_space(floor_ptr, &yval, &xval, 11, 25)) return FALSE;
}
/* Place a treasure in the vault */
- place_object(floor_ptr, yval, xval, 0L);
+ place_object(player_ptr, yval, xval, 0L);
/* Let's guard the treasure well */
vault_monsters(floor_ptr, yval, xval, randint0(2) + 3);
/*!
* @brief タイプ4の部屋…固定サイズの二重構造部屋を生成する / Type 4 -- Large room with inner features
+* @param player_ptr プレーヤーへの参照ポインタ
* @return なし
* @details
* Possible sub-types:\n
* 4 - Inner room has a maze\n
* 5 - A set of four inner rooms\n
*/
-bool build_type4(floor_type *floor_ptr)
+bool build_type4(player_type *player_ptr)
{
POSITION y, x, y1, x1;
POSITION y2, x2, tmp, yval, xval;
bool light;
grid_type *g_ptr;
-
/* Find and reserve some space in the dungeon. Get center of room. */
+ floor_type *floor_ptr = player_ptr->current_floor_ptr;
if (!find_space(floor_ptr, &yval, &xval, 11, 25)) return FALSE;
/* Choose lite or dark */
/* Object (80%) */
if (randint0(100) < 80)
{
- place_object(floor_ptr, yval, xval, 0L);
+ place_object(player_ptr, yval, xval, 0L);
}
/* Stairs (20%) */
vault_monsters(floor_ptr, yval, xval + 2, randint1(2));
/* Objects */
- if (one_in_(3)) place_object(floor_ptr, yval, xval - 2, 0L);
- if (one_in_(3)) place_object(floor_ptr, yval, xval + 2, 0L);
+ if (one_in_(3)) place_object(player_ptr, yval, xval - 2, 0L);
+ if (one_in_(3)) place_object(player_ptr, yval, xval + 2, 0L);
}
break;
vault_traps(floor_ptr, yval, xval + 3, 2, 8, randint1(3));
/* Mazes should have some treasure too. */
- vault_objects(floor_ptr, yval, xval, 3);
+ vault_objects(player_ptr, yval, xval, 3);
break;
}
}
/* Treasure, centered at the center of the cross */
- vault_objects(floor_ptr, yval, xval, 2 + randint1(2));
+ vault_objects(player_ptr, yval, xval, 2 + randint1(2));
/* Gotta have some monsters. */
vault_monsters(floor_ptr, yval + 1, xval - 4, randint1(4));
/*!
* @brief タイプ12の部屋…ドーム型部屋の生成 / Type 12 -- Build crypt room.
+* @param player_ptr プレーヤーへの参照ポインタ
* @return なし
* @details
* For every grid in the possible square, check the (fake) distance.\n
*\n
* When done fill from the inside to find the walls,\n
*/
-bool build_type12(floor_type *floor_ptr)
+bool build_type12(player_type *player_ptr)
{
POSITION rad, x, y, x0, y0;
int light = FALSE;
h4 = randint1(32) - 16;
/* Occasional light */
+ floor_type *floor_ptr = player_ptr->current_floor_ptr;
if ((randint1(floor_ptr->dun_level) <= 5) && !(d_info[floor_ptr->dungeon_idx].flags1 & DF1_DARKNESS)) light = TRUE;
rad = randint1(9);
build_small_room(floor_ptr, x0, y0);
/* Place a treasure in the vault */
- place_object(floor_ptr, y0, x0, 0L);
+ place_object(player_ptr, y0, x0, 0L);
/* Let's guard the treasure well */
vault_monsters(floor_ptr, y0, x0, randint0(2) + 3);
extern bool build_type1(floor_type *floor_ptr);
extern bool build_type2(floor_type *floor_ptr);
-extern bool build_type3(floor_type *floor_ptr);
-extern bool build_type4(floor_type *floor_ptr);
+extern bool build_type3(player_type *player_ptr);
+extern bool build_type4(player_type *player_ptr);
extern bool build_type11(floor_type *floor_ptr);
-extern bool build_type12(floor_type *floor_ptr);
+extern bool build_type12(player_type *player_ptr);
/*!
* @brief タイプ15の部屋…ガラス部屋の生成 / Type 15 -- glass rooms
+* @param player_ptr プレーヤーへの参照ポインタ
* @return なし
*/
-bool build_type15(floor_type *floor_ptr)
+bool build_type15(player_type *player_ptr)
{
POSITION y, x, y2, x2, yval, xval;
POSITION y1, x1, xsize, ysize;
ysize = rand_range(9, 13);
/* Find and reserve some space in the dungeon. Get center of room. */
+ floor_type *floor_ptr = player_ptr->current_floor_ptr;
if (!find_space(floor_ptr, &yval, &xval, ysize + 2, xsize + 2)) return FALSE;
/* Choose lite or dark */
/* Place a potion */
get_obj_num_hook = kind_is_potion;
- place_object(floor_ptr, yval, xval, AM_NO_FIXED_ART);
+ place_object(player_ptr, yval, xval, AM_NO_FIXED_ART);
floor_ptr->grid_array[yval][xval].info |= (CAVE_ICKY);
}
break;
}
/* Place an object */
- place_object(floor_ptr, yval, xval, AM_NO_FIXED_ART);
+ place_object(player_ptr, yval, xval, AM_NO_FIXED_ART);
floor_ptr->grid_array[yval][xval].info |= (CAVE_ICKY);
}
break;
if (one_in_(2))
{
get_obj_num_hook = kind_is_potion;
- place_object(floor_ptr, yval, xval - 1, AM_NO_FIXED_ART);
+ place_object(player_ptr, yval, xval - 1, AM_NO_FIXED_ART);
get_obj_num_hook = kind_is_potion;
- place_object(floor_ptr, yval, xval + 1, AM_NO_FIXED_ART);
+ place_object(player_ptr, yval, xval + 1, AM_NO_FIXED_ART);
}
else
{
get_obj_num_hook = kind_is_potion;
- place_object(floor_ptr, yval - 1, xval, AM_NO_FIXED_ART);
+ place_object(player_ptr, yval - 1, xval, AM_NO_FIXED_ART);
get_obj_num_hook = kind_is_potion;
- place_object(floor_ptr, yval + 1, xval, AM_NO_FIXED_ART);
+ place_object(player_ptr, yval + 1, xval, AM_NO_FIXED_ART);
}
for (y = yval - 2; y <= yval + 2; y++)
-extern bool build_type15(floor_type *floor_ptr);
+extern bool build_type15(player_type *player_ptr);
* Note: If two centers are on the same point then this algorithm will create a
* blank bubble filled with walls. - This is prevented from happening.
*/
-static void build_bubble_vault(floor_type *floor_ptr, POSITION x0, POSITION y0, POSITION xsize, POSITION ysize)
+static void build_bubble_vault(player_type *player_ptr, POSITION x0, POSITION y0, POSITION xsize, POSITION ysize)
{
#define BUBBLENUM 10 /* number of bubbles */
center[i].y = y;
}
-
/* Top and bottom boundaries */
+ floor_type *floor_ptr = player_ptr->current_floor_ptr;
for (i = 0; i < xsize; i++)
{
int side_x = x0 - xhsize + i;
}
/* Fill with monsters and treasure, low difficulty */
- fill_treasure(floor_ptr, x0 - xhsize + 1, x0 - xhsize + xsize - 2, y0 - yhsize + 1, y0 - yhsize + ysize - 2, randint1(5));
+ fill_treasure(player_ptr, x0 - xhsize + 1, x0 - xhsize + xsize - 2, y0 - yhsize + 1, y0 - yhsize + ysize - 2, randint1(5));
}
/* Create a random vault that looks like a collection of overlapping rooms */
-static void build_room_vault(floor_type *floor_ptr, POSITION x0, POSITION y0, POSITION xsize, POSITION ysize)
+static void build_room_vault(player_type *player_ptr, POSITION x0, POSITION y0, POSITION xsize, POSITION ysize)
{
POSITION x1, x2, y1, y2, xhsize, yhsize;
int i;
msg_print_wizard(CHEAT_DUNGEON, _("部屋型ランダムVaultを生成しました。", "Room Vault."));
/* fill area so don't get problems with arena levels */
+ floor_type *floor_ptr = player_ptr->current_floor_ptr;
for (x1 = 0; x1 < xsize; x1++)
{
POSITION x = x0 - xhsize + x1;
}
/* Fill with monsters and treasure, high difficulty */
- fill_treasure(floor_ptr, x0 - xhsize + 1, x0 - xhsize + xsize - 2, y0 - yhsize + 1, y0 - yhsize + ysize - 2, randint1(5) + 5);
+ fill_treasure(player_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 grid */
-static void build_cave_vault(floor_type *floor_ptr, POSITION x0, POSITION y0, POSITION xsiz, POSITION ysiz)
+static void build_cave_vault(player_type *player_ptr, POSITION x0, POSITION y0, POSITION xsiz, POSITION ysiz)
{
int grd, roug, cutoff;
bool done, light, room;
light = done = FALSE;
room = TRUE;
+ floor_type *floor_ptr = player_ptr->current_floor_ptr;
while (!done)
{
/* testing values for these parameters feel free to adjust */
}
/* Fill with monsters and treasure, low difficulty */
- fill_treasure(floor_ptr, x0 - xhsize + 1, x0 - xhsize + xsize - 1, y0 - yhsize + 1, y0 - yhsize + ysize - 1, randint1(5));
+ fill_treasure(player_ptr, x0 - xhsize + 1, x0 - xhsize + xsize - 1, y0 - yhsize + 1, y0 - yhsize + ysize - 1, randint1(5));
}
-
/*!
* @brief Vault地形を回転、上下左右反転するための座標変換を返す / coordinate translation code
* @param x 変換したい点のX座標参照ポインタ
/*!
* @brief Vaultをフロアに配置する / Hack -- fill in "vault" rooms
+* @param player_ptr プレーヤーへの参照ポインタ
* @param yval 生成基準Y座標
* @param xval 生成基準X座標
* @param ymax VaultのYサイズ
* @param transno 変換ID
* @return なし
*/
-static void build_vault(floor_type *floor_ptr, POSITION yval, POSITION xval, POSITION ymax, POSITION xmax, concptr data,
+static void build_vault(player_type *player_ptr, POSITION yval, POSITION xval, POSITION ymax, POSITION xmax, concptr data,
POSITION xoffset, POSITION yoffset, int transno)
{
POSITION dx, dy, x, y, i, j;
grid_type *g_ptr;
/* Place dungeon features and objects */
+ floor_type *floor_ptr = player_ptr->current_floor_ptr;
for (t = data, dy = 0; dy < ymax; dy++)
{
for (dx = 0; dx < xmax; dx++, t++)
case '*':
if (randint0(100) < 75)
{
- place_object(floor_ptr, y, x, 0L);
+ place_object(player_ptr, y, x, 0L);
}
else
{
/* Treasure */
case '[':
- place_object(floor_ptr, y, x, 0L);
+ place_object(player_ptr, y, x, 0L);
break;
/* Tree */
case 'A':
/* Reward for Pattern walk */
floor_ptr->object_level = floor_ptr->base_level + 12;
- place_object(floor_ptr, y, x, AM_GOOD | AM_GREAT);
+ place_object(player_ptr, y, x, AM_GOOD | AM_GREAT);
floor_ptr->object_level = floor_ptr->base_level;
break;
place_monster(y, x, PM_ALLOW_SLEEP);
floor_ptr->monster_level = floor_ptr->base_level;
floor_ptr->object_level = floor_ptr->base_level + 7;
- place_object(floor_ptr, y, x, AM_GOOD);
+ place_object(player_ptr, y, x, AM_GOOD);
floor_ptr->object_level = floor_ptr->base_level;
break;
}
place_monster(y, x, PM_ALLOW_SLEEP);
floor_ptr->monster_level = floor_ptr->base_level;
floor_ptr->object_level = floor_ptr->base_level + 20;
- place_object(floor_ptr, y, x, AM_GOOD | AM_GREAT);
+ place_object(player_ptr, y, x, AM_GOOD | AM_GREAT);
floor_ptr->object_level = floor_ptr->base_level;
break;
}
if (randint0(100) < 50)
{
floor_ptr->object_level = floor_ptr->base_level + 7;
- place_object(floor_ptr, y, x, 0L);
+ place_object(player_ptr, y, x, 0L);
floor_ptr->object_level = floor_ptr->base_level;
}
break;
}
-
}
}
}
}
-
/*!
* @brief タイプ7の部屋…v_info.txtより小型vaultを生成する / Type 7 -- simple vaults (see "v_info.txt")
* @return なし
*/
-bool build_type7(floor_type *floor_ptr)
+bool build_type7(player_type *player_ptr)
{
vault_type *v_ptr = NULL;
int dummy;
y = v_ptr->hgt;
/* Some huge vault cannot be ratated to fit in the dungeon */
+ floor_type *floor_ptr = player_ptr->current_floor_ptr;
if (x + 2 > floor_ptr->height - 2)
{
/* Forbid 90 or 270 degree ratation */
msg_format_wizard(CHEAT_DUNGEON, _("小型Vault(%s)を生成しました。", "Lesser vault (%s)."), v_name + v_ptr->name);
/* Hack -- Build the vault */
- build_vault(floor_ptr, yval, xval, v_ptr->hgt, v_ptr->wid,
+ build_vault(player_ptr, yval, xval, v_ptr->hgt, v_ptr->wid,
v_text + v_ptr->text, xoffset, yoffset, transno);
return TRUE;
}
+
/*!
* @brief タイプ8の部屋…v_info.txtより大型vaultを生成する / Type 8 -- greater vaults (see "v_info.txt")
* @return なし
*/
-bool build_type8(floor_type *floor_ptr)
+bool build_type8(player_type *player_ptr)
{
vault_type *v_ptr;
int dummy;
y = v_ptr->hgt;
/* Some huge vault cannot be ratated to fit in the dungeon */
+ floor_type *floor_ptr = player_ptr->current_floor_ptr;
if (x + 2 > floor_ptr->height - 2)
{
/* Forbid 90 or 270 degree ratation */
msg_format_wizard(CHEAT_DUNGEON, _("大型固定Vault(%s)を生成しました。", "Greater vault (%s)."), v_name + v_ptr->name);
/* Hack -- Build the vault */
- build_vault(floor_ptr, yval, xval, v_ptr->hgt, v_ptr->wid,
+ build_vault(player_ptr, yval, xval, v_ptr->hgt, v_ptr->wid,
v_text + v_ptr->text, xoffset, yoffset, transno);
return TRUE;
* This is made by two concentric "crypts" with perpendicular
* walls creating the cross-hairs.
*/
-static void build_target_vault(floor_type *floor_ptr, POSITION x0, POSITION y0, POSITION xsize, POSITION ysize)
+static void build_target_vault(player_type *player_ptr, POSITION x0, POSITION y0, POSITION xsize, POSITION ysize)
{
POSITION rad, x, y;
}
/* Make floor */
+ floor_type *floor_ptr = player_ptr->current_floor_ptr;
for (x = x0 - rad; x <= x0 + rad; x++)
{
for (y = y0 - rad; y <= y0 + rad; y++)
add_door(floor_ptr, x0, y0 - y);
/* Fill with stuff - medium difficulty */
- fill_treasure(floor_ptr, x0 - rad, x0 + rad, y0 - rad, y0 + rad, randint1(3) + 3);
+ fill_treasure(player_ptr, x0 - rad, x0 + rad, y0 - rad, y0 + rad, randint1(3) + 3);
}
*
* Miniture rooms are then scattered across the vault.
*/
-static void build_elemental_vault(floor_type *floor_ptr, POSITION x0, POSITION y0, POSITION xsiz, POSITION ysiz)
+static void build_elemental_vault(player_type *player_ptr, POSITION x0, POSITION y0, POSITION xsiz, POSITION ysiz)
{
int grd, roug;
int c1, c2, c3;
xsize = xhsize * 2;
ysize = yhsize * 2;
+ floor_type *floor_ptr = player_ptr->current_floor_ptr;
if (floor_ptr->dun_level < 25)
{
/* Earth vault (Rubble) */
}
/* Fill with monsters and treasure, low difficulty */
- fill_treasure(floor_ptr, x0 - xhsize + 1, x0 - xhsize + xsize - 1,
+ fill_treasure(player_ptr, x0 - xhsize + 1, x0 - xhsize + xsize - 1,
y0 - yhsize + 1, y0 - yhsize + ysize - 1, randint1(5));
}
#endif /* ALLOW_CAVERNS_AND_LAKES */
* The vault has two entrances on opposite sides to guarantee
* a way to get in even if the vault abuts a side of the dungeon.
*/
-static void build_mini_c_vault(floor_type *floor_ptr, POSITION x0, POSITION y0, POSITION xsize, POSITION ysize)
+static void build_mini_c_vault(player_type *player_ptr, POSITION x0, POSITION y0, POSITION xsize, POSITION ysize)
{
POSITION dy, dx;
POSITION y1, x1, y2, x2, y, x, total;
/* generate the room */
+ floor_type *floor_ptr = player_ptr->current_floor_ptr;
for (x = x1 - 2; x <= x2 + 2; x++)
{
if (!in_bounds(floor_ptr, y1 - 2, x)) break;
}
/* Fill with monsters and treasure, highest difficulty */
- fill_treasure(floor_ptr, x1, x2, y1, y2, 10);
+ fill_treasure(player_ptr, x1, x2, y1, y2, 10);
C_KILL(visited, num_vertices, int);
}
*
*This makes a vault that looks like a castle/ city in the dungeon.
*/
-static void build_castle_vault(floor_type *floor_ptr, POSITION x0, POSITION y0, POSITION xsize, POSITION ysize)
+static void build_castle_vault(player_type *player_ptr, POSITION x0, POSITION y0, POSITION xsize, POSITION ysize)
{
POSITION dy, dx;
POSITION y1, x1, y2, x2;
msg_print_wizard(CHEAT_DUNGEON, _("城型ランダムVaultを生成しました。", "Castle Vault"));
/* generate the room */
+ floor_type *floor_ptr = player_ptr->current_floor_ptr;
for (y = y1 - 1; y <= y2 + 1; y++)
{
for (x = x1 - 1; x <= x2 + 1; x++)
build_recursive_room(floor_ptr, x1, y1, x2, y2, randint1(5));
/* Fill with monsters and treasure, low difficulty */
- fill_treasure(floor_ptr, x1, x2, y1, y2, randint1(3));
+ fill_treasure(player_ptr, x1, x2, y1, y2, randint1(3));
}
-
/*!
* @brief タイプ10の部屋…ランダム生成vault / Type 10 -- Random vaults
+* @param player_ptr プレーヤーへの参照ポインタ
* @return なし
*/
-bool build_type10(floor_type *floor_ptr)
+bool build_type10(player_type *player_ptr)
{
POSITION y0, x0, xsize, ysize, vtype;
ysize = randint1(11) + 11;
/* Find and reserve some space in the dungeon. Get center of room. */
+ floor_type *floor_ptr = player_ptr->current_floor_ptr;
if (!find_space(floor_ptr, &y0, &x0, ysize + 1, xsize + 1)) return FALSE;
/* Select type of vault */
switch (vtype)
{
/* Build an appropriate room */
- case 1: case 9: build_bubble_vault(floor_ptr, x0, y0, xsize, ysize); break;
- case 2: case 10: build_room_vault(floor_ptr, x0, y0, xsize, ysize); break;
- case 3: case 11: build_cave_vault(floor_ptr, x0, y0, xsize, ysize); break;
- case 4: case 12: build_maze_vault(floor_ptr, x0, y0, xsize, ysize, TRUE); break;
- case 5: case 13: build_mini_c_vault(floor_ptr, x0, y0, xsize, ysize); break;
- case 6: case 14: build_castle_vault(floor_ptr, x0, y0, xsize, ysize); break;
- case 7: case 15: build_target_vault(floor_ptr, x0, y0, xsize, ysize); break;
+ case 1: case 9: build_bubble_vault(player_ptr, x0, y0, xsize, ysize); break;
+ case 2: case 10: build_room_vault(player_ptr, x0, y0, xsize, ysize); break;
+ case 3: case 11: build_cave_vault(player_ptr, x0, y0, xsize, ysize); break;
+ case 4: case 12: build_maze_vault(player_ptr, x0, y0, xsize, ysize, TRUE); break;
+ case 5: case 13: build_mini_c_vault(player_ptr, x0, y0, xsize, ysize); break;
+ case 6: case 14: build_castle_vault(player_ptr, x0, y0, xsize, ysize); break;
+ case 7: case 15: build_target_vault(player_ptr, x0, y0, xsize, ysize); break;
#ifdef ALLOW_CAVERNS_AND_LAKES
- case 8: build_elemental_vault(floor_ptr, x0, y0, xsize, ysize); break;
+ case 8: build_elemental_vault(player_ptr, x0, y0, xsize, ysize); break;
#endif /* ALLOW_CAVERNS_AND_LAKES */
/* I know how to add a few more... give me some time. */
default: return FALSE;
* @brief タイプ17の部屋…v_info.txtより固定特殊部屋を生成する / Type 17 -- fixed special room (see "v_info.txt")
* @return なし
*/
-bool build_type17(floor_type *floor_ptr)
+bool build_type17(player_type *player_ptr)
{
vault_type *v_ptr = NULL;
int dummy;
y = v_ptr->hgt;
/* Some huge vault cannot be ratated to fit in the dungeon */
+ floor_type *floor_ptr = player_ptr->current_floor_ptr;
if (x + 2 > floor_ptr->height - 2)
{
/* Forbid 90 or 270 degree ratation */
msg_format_wizard(CHEAT_DUNGEON, _("特殊固定部屋(%s)を生成しました。", "Special Fix room (%s)."), v_name + v_ptr->name);
/* Hack -- Build the vault */
- build_vault(floor_ptr, yval, xval, v_ptr->hgt, v_ptr->wid,
+ build_vault(player_ptr, yval, xval, v_ptr->hgt, v_ptr->wid,
v_text + v_ptr->text, xoffset, yoffset, transno);
return TRUE;
}
-
extern VAULT_IDX max_v_idx;
-extern bool build_type7(floor_type *floor_ptr);
-extern bool build_type8(floor_type *floor_ptr);
-extern bool build_type10(floor_type *floor_ptr);
-extern bool build_type17(floor_type *floor_ptr);
-
+extern bool build_type7(player_type *player_ptr);
+extern bool build_type8(player_type *player_ptr);
+extern bool build_type10(player_type *player_ptr);
+extern bool build_type17(player_type *player_ptr);
/*
* Routine that fills the empty areas of a room with treasure and monsters.
*/
-void fill_treasure(floor_type *floor_ptr, POSITION x1, POSITION x2, POSITION y1, POSITION y2, int difficulty)
+void fill_treasure(player_type *player_ptr, POSITION x1, POSITION x2, POSITION y1, POSITION y2, int difficulty)
{
POSITION x, y, cx, cy, size;
s32b value;
/* Rough measure of size of vault= sum of lengths of sides */
size = abs(x2 - x1) + abs(y2 - y1);
+ floor_type *floor_ptr = player_ptr->current_floor_ptr;
for (x = x1; x <= x2; x++)
{
for (y = y1; y <= y2; y++)
place_monster(y, x, (PM_ALLOW_SLEEP | PM_ALLOW_GROUP));
floor_ptr->monster_level = floor_ptr->base_level;
floor_ptr->object_level = floor_ptr->base_level + 20;
- place_object(floor_ptr, y, x, AM_GOOD);
+ place_object(player_ptr, y, x, AM_GOOD);
floor_ptr->object_level = floor_ptr->base_level;
}
else if (value < 5)
place_monster(y, x, (PM_ALLOW_SLEEP | PM_ALLOW_GROUP));
floor_ptr->monster_level = floor_ptr->base_level;
floor_ptr->object_level = floor_ptr->base_level + 10;
- place_object(floor_ptr, y, x, AM_GOOD);
+ place_object(player_ptr, y, x, AM_GOOD);
floor_ptr->object_level = floor_ptr->base_level;
}
else if (value < 10)
/* Object or trap */
if (randint0(100) < 25)
{
- place_object(floor_ptr, y, x, 0L);
+ place_object(player_ptr, y, x, 0L);
}
else
{
if (randint0(100) < 50)
{
floor_ptr->object_level = floor_ptr->base_level + 7;
- place_object(floor_ptr, y, x, 0L);
+ place_object(player_ptr, y, x, 0L);
floor_ptr->object_level = floor_ptr->base_level;
}
}
}
else if (randint0(100) < 50)
{
- place_object(floor_ptr, y, x, 0L);
+ place_object(player_ptr, y, x, 0L);
}
}
}
-
/*
* Overlay a rectangular room given its bounds
* This routine is used by build_room_vault
}
-void build_maze_vault(floor_type *floor_ptr, POSITION x0, POSITION y0, POSITION xsize, POSITION ysize, bool is_vault)
+void build_maze_vault(player_type *player_ptr, POSITION x0, POSITION y0, POSITION xsize, POSITION ysize, bool is_vault)
{
POSITION y, x, dy, dx;
POSITION y1, x1, y2, x2;
msg_print_wizard(CHEAT_DUNGEON, _("迷路ランダムVaultを生成しました。", "Maze Vault."));
/* Choose lite or dark */
+ floor_type *floor_ptr = player_ptr->current_floor_ptr;
light = ((floor_ptr->dun_level <= randint1(25)) && is_vault && !(d_info[floor_ptr->dungeon_idx].flags1 & DF1_DARKNESS));
/* Pick a random room size - randomized by calling routine */
r_visit(floor_ptr, y1, x1, y2, x2, randint0(num_vertices), 0, visited);
/* Fill with monsters and treasure, low difficulty */
- if (is_vault) fill_treasure(floor_ptr, x1, x2, y1, y2, randint1(5));
+ if (is_vault) fill_treasure(player_ptr, x1, x2, y1, y2, randint1(5));
C_KILL(visited, num_vertices, int);
}
/*!
* @brief 与えられた部屋型IDに応じて部屋の生成処理分岐を行い結果を返す / Attempt to build a room of the given type at the given block
+ * @param player_ptr プレーヤーへの参照ポインタ
* @param type 部屋型ID
* @note that we restrict the number of "crowded" rooms to reduce the chance of overflowing the monster list during level creation.
- * @return é\83¨å±\8bã\81®ç²¾è£½に成功した場合 TRUE を返す。
+ * @return é\83¨å±\8bã\81®ç\94\9fæ\88\90に成功した場合 TRUE を返す。
*/
-static bool room_build(floor_type *floor_ptr, EFFECT_ID typ)
+static bool room_build(player_type *player_ptr, EFFECT_ID typ)
{
- /* Build a room */
+ floor_type *floor_ptr = player_ptr->current_floor_ptr;
switch (typ)
{
/* Build an appropriate room */
case ROOM_T_NORMAL: return build_type1(floor_ptr);
case ROOM_T_OVERLAP: return build_type2(floor_ptr);
- case ROOM_T_CROSS: return build_type3(floor_ptr);
- case ROOM_T_INNER_FEAT: return build_type4(floor_ptr);
+ case ROOM_T_CROSS: return build_type3(player_ptr);
+ case ROOM_T_INNER_FEAT: return build_type4(player_ptr);
case ROOM_T_NEST: return build_type5(floor_ptr);
case ROOM_T_PIT: return build_type6(floor_ptr);
- case ROOM_T_LESSER_VAULT: return build_type7(floor_ptr);
- case ROOM_T_GREATER_VAULT: return build_type8(floor_ptr);
+ case ROOM_T_LESSER_VAULT: return build_type7(player_ptr);
+ case ROOM_T_GREATER_VAULT: return build_type8(player_ptr);
case ROOM_T_FRACAVE: return build_type9(floor_ptr);
- case ROOM_T_RANDOM_VAULT: return build_type10(floor_ptr);
+ case ROOM_T_RANDOM_VAULT: return build_type10(player_ptr);
case ROOM_T_OVAL: return build_type11(floor_ptr);
- case ROOM_T_CRYPT: return build_type12(floor_ptr);
+ case ROOM_T_CRYPT: return build_type12(player_ptr);
case ROOM_T_TRAP_PIT: return build_type13(floor_ptr);
case ROOM_T_TRAP: return build_type14(floor_ptr);
- case ROOM_T_GLASS: return build_type15(floor_ptr);
+ case ROOM_T_GLASS: return build_type15(player_ptr);
case ROOM_T_ARCADE: return build_type16(floor_ptr);
- case ROOM_T_FIXED: return build_type17(floor_ptr);
+ case ROOM_T_FIXED: return build_type17(player_ptr);
}
return FALSE;
}
/*!
* @brief 部屋生成処理のメインルーチン(Sangbandを経由してOangbandからの実装を引用) / Generate rooms in dungeon. Build bigger rooms at first. [from SAngband (originally from OAngband)]
+ * @param player_ptr プレーヤーへの参照ポインタ
* @return 部屋生成に成功した場合 TRUE を返す。
*/
-bool generate_rooms(floor_type *floor_ptr)
+bool generate_rooms(player_type *player_ptr)
{
+ floor_type *floor_ptr = player_ptr->current_floor_ptr;
int i;
bool remain;
int crowded = 0;
room_num[room_type]--;
/* Build the room. */
- if (room_build(floor_ptr, room_type))
+ if (room_build(player_ptr, room_type))
{
/* Increase the room built count. */
rooms_built++;
door_type feat_door[MAX_DOOR_TYPES];
-extern bool generate_rooms(floor_type *floor_ptr);
-extern void build_maze_vault(floor_type *floor_ptr, POSITION x0, POSITION y0, POSITION xsize, POSITION ysize, bool is_vault);
+extern bool generate_rooms(player_type *player_ptr);
+extern void build_maze_vault(player_type *player_ptr, POSITION x0, POSITION y0, POSITION xsize, POSITION ysize, bool is_vault);
extern bool find_space(floor_type *floor_ptr, POSITION *y, POSITION *x, POSITION height, POSITION width);
extern void build_small_room(floor_type *floor_ptr, POSITION x0, POSITION y0);
extern void add_outer_wall(floor_type *floor_ptr, POSITION x, POSITION y, int light, POSITION x1, POSITION y1, POSITION x2, POSITION y2);
extern void generate_fill_perm_bold(floor_type *floor_ptr, POSITION y1, POSITION x1, POSITION y2, POSITION x2);
extern void generate_hmap(floor_type *floor_ptr, POSITION y0, POSITION x0, POSITION xsiz, POSITION ysiz, int grd, int roug, int cutoff);
extern bool generate_fracave(floor_type *floor_ptr, POSITION y0, POSITION x0, POSITION xsize, POSITION ysize, int cutoff, bool light, bool room);
-extern void fill_treasure(floor_type *floor_ptr, POSITION x1, POSITION x2, POSITION y1, POSITION y2, int difficulty);
+extern void fill_treasure(player_type *player_ptr, POSITION x1, POSITION x2, POSITION y1, POSITION y2, int difficulty);
extern bool generate_lake(floor_type *floor_ptr, POSITION y0, POSITION x0, POSITION xsize, POSITION ysize, int c1, int c2, int c3, int type);
extern void build_recursive_room(floor_type *floor_ptr, POSITION x1, POSITION y1, POSITION x2, POSITION y2, int power);
extern void build_room(floor_type *floor_ptr, POSITION x1, POSITION x2, POSITION y1, POSITION y2);
if (slot >= 0) autopick_alter_item(slot, FALSE);
/* Destroy the wall */
- cave_alter_feat(y, x, FF_HURT_ROCK);
+ cave_alter_feat(creature_ptr, y, x, FF_HURT_ROCK);
creature_ptr->update |= (PU_FLOW);
}
object_wipe(i_ptr);
/* Make a good (or great) object (if possible) */
- if (!make_object(i_ptr, mode)) continue;
+ if (!make_object(caster_ptr, i_ptr, mode)) continue;
if (known)
{
if (is_hidden_door(g_ptr))
{
/* Pick a door */
- disclose_grid(caster_ptr->current_floor_ptr, y, x);
+ disclose_grid(caster_ptr, y, x);
/* Check line of sight */
if (known)
}
/* Destroy the trap */
- cave_alter_feat(y, x, FF_DISARM);
+ cave_alter_feat(caster_ptr, y, x, FF_DISARM);
}
/* Locked doors are unlocked */
FEAT_IDX old_feat = g_ptr->feat;
/* Unlock the door */
- cave_alter_feat(y, x, FF_DISARM);
+ cave_alter_feat(caster_ptr, y, x, FF_DISARM);
/* Check line of sound */
if (known && (old_feat != g_ptr->feat))
}
/* Destroy the feature */
- cave_alter_feat(y, x, FF_TUNNEL);
+ cave_alter_feat(caster_ptr, y, x, FF_TUNNEL);
}
/* Remove "unsafe" flag if player is not blind */
s16b old_mimic = g_ptr->mimic;
feature_type *mimic_f_ptr = &f_info[get_feat_mimic(g_ptr)];
- cave_alter_feat(y, x, FF_SPIKE);
+ cave_alter_feat(caster_ptr, y, x, FF_SPIKE);
g_ptr->mimic = old_mimic;
note_spot(y, x);
}
/* Destroy the wall */
- cave_alter_feat(y, x, FF_HURT_ROCK);
+ cave_alter_feat(caster_ptr, y, x, FF_HURT_ROCK);
caster_ptr->update |= (PU_FLOW);
}
}
/* Destroy the wall */
- cave_alter_feat(y, x, FF_HURT_ROCK);
+ cave_alter_feat(caster_ptr, y, x, FF_HURT_ROCK);
caster_ptr->update |= (PU_FLOW);
}
}
/* Destroy the wall */
- cave_alter_feat(y, x, FF_HURT_ROCK);
+ cave_alter_feat(caster_ptr, y, x, FF_HURT_ROCK);
caster_ptr->update |= (PU_FLOW);
}
/* But not protect monsters and other objects */
if (have_flag(f_ptr->flags, FF_HURT_DISI) && !have_flag(f_ptr->flags, FF_PERMANENT))
{
- cave_alter_feat(y, x, FF_HURT_DISI);
+ cave_alter_feat(caster_ptr, y, x, FF_HURT_DISI);
/* Update some things -- similar to GF_KILL_WALL */
caster_ptr->update |= (PU_FLOW);
if (cave_have_flag_grid(g_ptr, flag))
{
- disclose_grid(caster_ptr->current_floor_ptr, y, x);
+ disclose_grid(caster_ptr, y, x);
g_ptr->info |= (CAVE_MARK);
lite_spot(y, x);
detect = TRUE;
}
/* Process all walls, doors and patterns */
- if (have_flag(f_ptr->flags, FF_HURT_DISI)) cave_alter_feat(y, x, FF_HURT_DISI);
+ if (have_flag(f_ptr->flags, FF_HURT_DISI)) cave_alter_feat(caster_ptr, y, x, FF_HURT_DISI);
}
}
(void)set_food(caster_ptr, caster_ptr->food + 10000);
}
- cave_alter_feat(y, x, FF_HURT_ROCK);
+ cave_alter_feat(caster_ptr, y, x, FF_HURT_ROCK);
(void)move_player_effect(caster_ptr, y, x, MPE_DONT_PICKUP);
return TRUE;
}
/*!
* @brief 店舗の品揃え変化のためにアイテムを追加する /
* Creates a random item and gives it to a store
+ * @param player_ptr プレーヤーへの参照ポインタ
* @return なし
* @details
* <pre>
* Should we check for "permission" to have the given item?
* </pre>
*/
-static void store_create(void)
+static void store_create(player_type *player_ptr)
{
OBJECT_IDX i;
int tries;
level = 25 + randint0(25);
/* Random item (usually of given level) */
- i = get_obj_num(level, 0x00000000);
+ i = get_obj_num(player_ptr, level, 0x00000000);
/* Handle failure */
if (!i) continue;
/*!
* @brief 店からの購入処理のメインルーチン /
* Buy an item from a store -RAK-
+ * @param player_ptr プレーヤーへの参照ポインタ
* @return なし
*/
-static void store_purchase(void)
+static void store_purchase(player_type *player_ptr)
{
int i, choice;
COMMAND_CODE item, item_new;
if (price == (best * j_ptr->number)) o_ptr->ident |= (IDENT_FIXED);
/* Player can afford it */
- if (p_ptr->au >= price)
+ if (player_ptr->au >= price)
{
/* Say "okay" */
say_comment_1();
if (cur_store_num == STORE_BLACK) /* The black market is illegal! */
- chg_virtue(p_ptr, V_JUSTICE, -1);
+ chg_virtue(player_ptr, V_JUSTICE, -1);
if((o_ptr->tval == TV_BOTTLE) && (cur_store_num != STORE_HOME))
- chg_virtue(p_ptr, V_NATURE, -1);
+ chg_virtue(player_ptr, V_NATURE, -1);
/* Make a sound */
sound(SOUND_BUY);
decrease_insults();
/* Spend the money */
- p_ptr->au -= price;
+ player_ptr->au -= price;
/* Update the display */
store_prt_gold();
strcpy(record_o_name, o_name);
record_turn = current_world_ptr->game_turn;
- if (record_buy) exe_write_diary(p_ptr, NIKKI_BUY, 0, o_name);
+ if (record_buy) exe_write_diary(player_ptr, NIKKI_BUY, 0, o_name);
object_desc(o_name, o_ptr, OD_NAME_ONLY);
if(record_rand_art && o_ptr->art_name)
- exe_write_diary(p_ptr, NIKKI_ART, 0, o_name);
+ exe_write_diary(player_ptr, NIKKI_ART, 0, o_name);
/* Erase the inscription */
j_ptr->inscription = 0;
j_ptr->feeling = FEEL_NONE;
j_ptr->ident &= ~(IDENT_STORE);
/* Give it to the player */
- item_new = inven_carry(p_ptr, j_ptr);
+ item_new = inven_carry(player_ptr, j_ptr);
/* Describe the final result */
- object_desc(o_name, &p_ptr->inventory_list[item_new], 0);
+ object_desc(o_name, &player_ptr->inventory_list[item_new], 0);
msg_format(_("%s(%c)を手に入れた。", "You have %s (%c)."), o_name, index_to_label(item_new));
/* Auto-inscription */
for (i = 0; i < 10; i++)
{
/* Maintain the store */
- store_maint(p_ptr->town_num, cur_store_num);
+ store_maint(player_ptr, player_ptr->town_num, cur_store_num);
}
/* Start over */
distribute_charges(o_ptr, j_ptr, amt);
/* Give it to the player */
- item_new = inven_carry(p_ptr, j_ptr);
+ item_new = inven_carry(player_ptr, j_ptr);
/* Describe just the result */
- object_desc(o_name, &p_ptr->inventory_list[item_new], 0);
+ object_desc(o_name, &player_ptr->inventory_list[item_new], 0);
msg_format(_("%s(%c)を取った。", "You have %s (%c)."), o_name, index_to_label(item_new));
handle_stuff();
else if (store_top >= st_ptr->stock_num) store_top -= store_bottom;
display_inventory();
- chg_virtue(p_ptr, V_SACRIFICE, 1);
+ chg_virtue(player_ptr, V_SACRIFICE, 1);
}
}
-
- /* Not kicked out */
- return;
}
/* Get (purchase) */
case 'g':
{
- store_purchase();
+ store_purchase(client_ptr);
break;
}
/*!
* @brief 店舗処理全体のメインルーチン /
* Enter a store, and interact with it. *
+ * @param player_ptr プレーヤーへの参照ポインタ
* @return なし
* @note
* <pre>
* (cast magic) into "g" (get), and "s" (search) into "d" (drop).
* </pre>
*/
-void do_cmd_store(void)
+void do_cmd_store(player_type *player_ptr)
{
int which;
int maintain_num;
bool need_redraw_store_inv; /* To redraw missiles damage and prices in store */
TERM_LEN w, h;
- if(p_ptr->wild_mode) return;
+ if(player_ptr->wild_mode) return;
Term_get_size(&w, &h);
/* Calculate stocks per 1 page */
store_bottom = MIN_STOCK + xtra_stock;
/* Access the player grid */
- g_ptr = &p_ptr->current_floor_ptr->grid_array[p_ptr->y][p_ptr->x];
+ g_ptr = &player_ptr->current_floor_ptr->grid_array[player_ptr->y][player_ptr->x];
/* Verify a store */
if (!cave_have_flag_grid(g_ptr, FF_STORE))
/* Extract the store code */
which = f_info[g_ptr->feat].subtype;
- old_town_num = p_ptr->town_num;
- if ((which == STORE_HOME) || (which == STORE_MUSEUM)) p_ptr->town_num = 1;
- if (p_ptr->current_floor_ptr->dun_level) p_ptr->town_num = NO_TOWN;
- inner_town_num = p_ptr->town_num;
+ old_town_num = player_ptr->town_num;
+ if ((which == STORE_HOME) || (which == STORE_MUSEUM)) player_ptr->town_num = 1;
+ if (player_ptr->current_floor_ptr->dun_level) player_ptr->town_num = NO_TOWN;
+ inner_town_num = player_ptr->town_num;
/* Hack -- Check the "locked doors" */
- if ((town_info[p_ptr->town_num].store[which].store_open >= current_world_ptr->game_turn) ||
+ if ((town_info[player_ptr->town_num].store[which].store_open >= current_world_ptr->game_turn) ||
(ironman_shops))
{
msg_print(_("ドアに鍵がかかっている。", "The doors are locked."));
- p_ptr->town_num = old_town_num;
+ player_ptr->town_num = old_town_num;
return;
}
/* Calculate the number of store maintainances since the last visit */
- maintain_num = (current_world_ptr->game_turn - town_info[p_ptr->town_num].store[which].last_visit) / (TURNS_PER_TICK * STORE_TICKS);
+ maintain_num = (current_world_ptr->game_turn - town_info[player_ptr->town_num].store[which].last_visit) / (TURNS_PER_TICK * STORE_TICKS);
/* Maintain the store max. 10 times */
if (maintain_num > 10) maintain_num = 10;
{
/* Maintain the store */
for (i = 0; i < maintain_num; i++)
- store_maint(p_ptr->town_num, which);
+ store_maint(player_ptr, player_ptr->town_num, which);
/* Save the visit */
- town_info[p_ptr->town_num].store[which].last_visit = current_world_ptr->game_turn;
+ town_info[player_ptr->town_num].store[which].last_visit = current_world_ptr->game_turn;
}
- forget_lite(p_ptr->current_floor_ptr);
- forget_view(p_ptr->current_floor_ptr);
+ forget_lite(player_ptr->current_floor_ptr);
+ forget_view(player_ptr->current_floor_ptr);
/* Hack -- Character is in "icky" mode */
current_world_ptr->character_icky = TRUE;
cur_store_feat = g_ptr->feat;
/* Save the store and owner pointers */
- st_ptr = &town_info[p_ptr->town_num].store[cur_store_num];
+ st_ptr = &town_info[player_ptr->town_num].store[cur_store_num];
ot_ptr = &owners[cur_store_num][st_ptr->owner];
/* Start at the beginning */
request_command(TRUE);
/* Process the command */
- store_process_command(p_ptr);
+ store_process_command(player_ptr);
/*
* Hack -- To redraw missiles damage and prices in store
* If player's charisma changes, or if player changes a bow, PU_BONUS is set
*/
- need_redraw_store_inv = (p_ptr->update & PU_BONUS) ? TRUE : FALSE;
+ need_redraw_store_inv = (player_ptr->update & PU_BONUS) ? TRUE : FALSE;
/* Hack -- Character is still in "icky" mode */
current_world_ptr->character_icky = TRUE;
handle_stuff();
/* Pack Overflow */
- if (p_ptr->inventory_list[INVEN_PACK].k_idx)
+ if (player_ptr->inventory_list[INVEN_PACK].k_idx)
{
INVENTORY_IDX item = INVEN_PACK;
- object_type *o_ptr = &p_ptr->inventory_list[item];
+ object_type *o_ptr = &player_ptr->inventory_list[item];
/* Hack -- Flee from the store */
if (cur_store_num != STORE_HOME)
if (st_ptr->store_open >= current_world_ptr->game_turn) leave_store = TRUE;
}
- select_floor_music(p_ptr);
+ select_floor_music(player_ptr);
- p_ptr->town_num = old_town_num;
+ player_ptr->town_num = old_town_num;
- take_turn(p_ptr, 100);
+ take_turn(player_ptr, 100);
/* Hack -- Character is no longer in "icky" mode */
current_world_ptr->character_icky = FALSE;
Term_clear();
/* Update everything */
- p_ptr->update |= (PU_VIEW | PU_LITE | PU_MON_LITE);
- p_ptr->update |= (PU_MONSTERS);
+ player_ptr->update |= (PU_VIEW | PU_LITE | PU_MON_LITE);
+ player_ptr->update |= (PU_MONSTERS);
/* Redraw entire screen */
- p_ptr->redraw |= (PR_BASIC | PR_EXTRA | PR_EQUIPPY);
- p_ptr->redraw |= (PR_MAP);
- p_ptr->window |= (PW_OVERHEAD | PW_DUNGEON);
+ player_ptr->redraw |= (PR_BASIC | PR_EXTRA | PR_EQUIPPY);
+ player_ptr->redraw |= (PR_MAP);
+ player_ptr->window |= (PW_OVERHEAD | PW_DUNGEON);
}
/*!
* @brief 店の品揃えを変化させる /
* Maintain the inventory at the stores.
+ * @param player_ptr プレーヤーへの参照ポインタ
* @param town_num 町のID
* @param store_num 店舗種類のID
* @return なし
*/
-void store_maint(int town_num, int store_num)
+void store_maint(player_type *player_ptr, int town_num, int store_num)
{
INVENTORY_IDX j;
}
}
-
/* Choose the number of slots to keep */
j = st_ptr->stock_num;
if (j >= st_ptr->stock_size) j = st_ptr->stock_size - 1;
/* Acquire some new items */
- while (st_ptr->stock_num < j) store_create();
+ while (st_ptr->stock_num < j) store_create(player_ptr);
}
/* store.c */
extern bool combine_and_reorder_home(int store_num);
-extern void do_cmd_store(void);
+extern void do_cmd_store(player_type *player_ptr);
extern void store_shuffle(int which);
-extern void store_maint(int town_num, int store_num);
+extern void store_maint(player_type *player_ptr, int town_num, int store_num);
extern void store_init(int town_num, int store_num);
extern void move_to_black_market(object_type * o_ptr);
extern const owner_type owners[MAX_STORES][MAX_OWNERS];
extern byte store_table[MAX_STORES][STORE_CHOICES][2];
-
-
-
return feat;
}
+
/*!
* @brief マスに存在する隠しトラップを公開する /
* Disclose an invisible trap
+* @param player
* @param y 秘匿したいマスのY座標
* @param x 秘匿したいマスのX座標
* @return なし
*/
-void disclose_grid(floor_type *floor_ptr, POSITION y, POSITION x)
+void disclose_grid(player_type *trapped_ptr, POSITION y, POSITION x)
{
- grid_type *g_ptr = &floor_ptr->grid_array[y][x];
+ grid_type *g_ptr = &trapped_ptr->current_floor_ptr->grid_array[y][x];
if (cave_have_flag_grid(g_ptr, FF_SECRET))
{
/* No longer hidden */
- cave_alter_feat(y, x, FF_SECRET);
+ cave_alter_feat(trapped_ptr, y, x, FF_SECRET);
}
else if (g_ptr->mimic)
{
}
}
+
/*!
* @brief マスをトラップを配置する /
* The location must be a legal, naked, floor grid.
disturb(trapped_ptr, FALSE, TRUE);
- cave_alter_feat(y, x, FF_HIT_TRAP);
+ cave_alter_feat(trapped_ptr, y, x, FF_HIT_TRAP);
/* Analyze */
switch (trap_feat_type)
if (break_trap && is_trap(g_ptr->feat))
{
- cave_alter_feat(y, x, FF_DISARM);
+ cave_alter_feat(trapped_ptr, y, x, FF_DISARM);
msg_print(_("トラップを粉砕した。", "You destroyed the trap."));
}
}
extern void init_normal_traps(void);
extern FEAT_IDX choose_random_trap(floor_type *floor_ptr);
-extern void disclose_grid(floor_type *floor_ptr, POSITION y, POSITION x);
+extern void disclose_grid(player_type *trapped_ptr, POSITION y, POSITION x);
extern void place_trap(floor_type *floor_ptr, POSITION y, POSITION x);
extern void hit_trap(player_type *trapped_ptr, bool break_trap);
object_wipe(q_ptr);
/* Create an object */
- make_object(q_ptr, mode);
+ make_object(caster_ptr, q_ptr, mode);
/* Mega-Hack -- allow multiple artifacts */