OSDN Git Service

[Refactor] #38997 get_obj_num() にplayer_type *引数を追加と、それに伴うfloor_type *からplayer_type...
authorHourier <hourier@users.sourceforge.jp>
Fri, 10 Jan 2020 13:05:30 +0000 (22:05 +0900)
committerHourier <hourier@users.sourceforge.jp>
Fri, 10 Jan 2020 13:05:30 +0000 (22:05 +0900)
36 files changed:
src/chest.c
src/cmd/cmd-basic.c
src/combat/shoot.c
src/core.c
src/dungeon-file.c
src/floor-generate.c
src/floor-streams.c
src/floor-streams.h
src/floor.c
src/floor.h
src/grid.c
src/grid.h
src/monster-process.c
src/monster1.c
src/object.h
src/object2.c
src/player-move.c
src/quest.c
src/realm-hissatsu.c
src/rooms-normal.c
src/rooms-normal.h
src/rooms-special.c
src/rooms-special.h
src/rooms-vault.c
src/rooms-vault.h
src/rooms.c
src/rooms.h
src/spells-object.c
src/spells1.c
src/spells2.c
src/spells3.c
src/store.c
src/store.h
src/trap.c
src/trap.h
src/wizard2.c

index 0a80e13..3acb0b1 100644 (file)
@@ -85,7 +85,7 @@ void chest_death(player_type *owner_ptr, bool scatter, POSITION y, POSITION x, O
                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. */
index dc2d786..091ebc7 100644 (file)
@@ -743,7 +743,7 @@ static bool exe_open(player_type *creature_ptr, POSITION y, POSITION x)
 
        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;
        }
@@ -772,7 +772,7 @@ static bool exe_open(player_type *creature_ptr, POSITION y, POSITION x)
        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);
 
@@ -913,7 +913,7 @@ static bool exe_close(player_type *creature_ptr, POSITION y, POSITION x)
        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)
@@ -1105,7 +1105,7 @@ static bool exe_tunnel(player_type *creature_ptr, POSITION y, POSITION x)
                        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
@@ -1134,7 +1134,7 @@ static bool exe_tunnel(player_type *creature_ptr, POSITION y, POSITION x)
                        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);
@@ -1314,7 +1314,7 @@ bool easy_open_door(player_type *creature_ptr, POSITION y, POSITION x)
                        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);
 
@@ -1337,7 +1337,7 @@ bool easy_open_door(player_type *creature_ptr, POSITION y, POSITION x)
        else
        {
                /* Open the door */
-               cave_alter_feat(y, x, FF_OPEN);
+               cave_alter_feat(creature_ptr, y, x, FF_OPEN);
 
                sound(SOUND_OPENDOOR);
        }
@@ -1482,7 +1482,7 @@ bool exe_disarm(player_type *creature_ptr, POSITION y, POSITION x, DIRECTION dir
                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);
@@ -1665,13 +1665,13 @@ static bool do_cmd_bash_aux(player_type *creature_ptr, POSITION y, POSITION x, D
                /* 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 */
@@ -1987,7 +1987,7 @@ void do_cmd_spike(player_type *creature_ptr)
 
                /* 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);
        }
index 59b613d..5413e9d 100644 (file)
@@ -533,7 +533,7 @@ void exe_fire(player_type *shooter_ptr, INVENTORY_IDX item, object_type *j_ptr,
                                        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;
index 12c9a96..748cacc 100644 (file)
@@ -3721,7 +3721,7 @@ static void process_command(player_type *creature_ptr)
                /* Enter store */
                case SPECIAL_KEY_STORE:
                {
-                       do_cmd_store();
+                       do_cmd_store(creature_ptr);
                        break;
                }
 
index 3da00f0..f27f575 100644 (file)
@@ -4024,7 +4024,7 @@ static errr process_dungeon_file_aux(player_type *player_ptr, char *buf, int ymi
                                 */
                                if (randint0(100) < 75)
                                {
-                                       place_object(floor_ptr, *y, *x, 0L);
+                                       place_object(player_ptr, *y, *x, 0L);
                                }
                                else
                                {
@@ -4039,11 +4039,11 @@ static errr process_dungeon_file_aux(player_type *player_ptr, char *buf, int ymi
 
                                /* 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;
                        }
index becf12d..19a6563 100644 (file)
@@ -304,7 +304,7 @@ static bool alloc_stairs(floor_type *floor_ptr, FEAT_IDX feat, int num, int wall
  * @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;
@@ -312,6 +312,7 @@ static void alloc_object(floor_type *floor_ptr, int set, EFFECT_ID typ, int num)
        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 */
@@ -380,7 +381,7 @@ static void alloc_object(floor_type *floor_ptr, int set, EFFECT_ID typ, int num)
 
                        case ALLOC_TYP_OBJECT:
                        {
-                               place_object(floor_ptr, y, x, 0L);
+                               place_object(owner_ptr, y, x, 0L);
                                break;
                        }
                }
@@ -674,7 +675,7 @@ static bool cave_gen(player_type *player_ptr)
        /* 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;
@@ -691,7 +692,7 @@ static bool cave_gen(player_type *player_ptr)
                /*
                 * 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 */
@@ -888,7 +889,7 @@ static bool cave_gen(player_type *player_ptr)
                        /* 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);
                        }
                }
 
@@ -897,7 +898,7 @@ static bool cave_gen(player_type *player_ptr)
                        /* 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);
                        }
                }
        }
@@ -953,10 +954,10 @@ static bool cave_gen(player_type *player_ptr)
        }
 
        /* 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)
@@ -966,11 +967,11 @@ static bool cave_gen(player_type *player_ptr)
        }
 
        /* 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;
index bb1ec1f..adeb09c 100644 (file)
@@ -226,6 +226,7 @@ void add_river(floor_type *floor_ptr, FEAT_IDX feat1, FEAT_IDX feat2)
 /*!
  * @brief ダンジョンの壁部にストリーマー(地質の変化)を与える /
  * Places "streamers" of rock through dungeon
+ * @param player_ptr プレーヤーへの参照ポインタ
  * @param feat ストリーマー地形ID
  * @param chance 生成密度
  * @return なし
@@ -237,7 +238,7 @@ void add_river(floor_type *floor_ptr, FEAT_IDX feat1, FEAT_IDX feat2)
  * 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;
@@ -252,6 +253,7 @@ void build_streamer(floor_type *floor_ptr, FEAT_IDX feat, int chance)
        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);
 
@@ -343,14 +345,14 @@ void build_streamer(floor_type *floor_ptr, FEAT_IDX feat, int chance)
                                /* 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);
                                }
                        }
                }
index 07aaaf5..053fcc8 100644 (file)
@@ -15,6 +15,6 @@
 /* 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);
index 78c5fe2..db2389b 100644 (file)
@@ -1169,6 +1169,7 @@ FEAT_IDX conv_dungeon_feat(floor_type *floor_ptr, FEAT_IDX newfeat)
 
 /*!
  * @brief 特殊な部屋向けに各種アイテムを配置する / Create up to "num" objects near the given coordinates
+ * @param player_ptr プレーヤーへの参照ポインタ
  * @param y 配置したい中心マスのY座標
  * @param x 配置したい中心マスのX座標
  * @param num 配置したい数
@@ -1176,13 +1177,13 @@ FEAT_IDX conv_dungeon_feat(floor_type *floor_ptr, FEAT_IDX newfeat)
  * @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)
@@ -1211,7 +1212,7 @@ void vault_objects(floor_type *floor_ptr, POSITION y, POSITION x, int num)
 
                        if (randint0(100) < 75)
                        {
-                               place_object(floor_ptr, j, k, 0L);
+                               place_object(player_ptr, j, k, 0L);
                        }
                        else
                        {
@@ -1597,6 +1598,7 @@ void set_floor(floor_type *floor_ptr, POSITION x, POSITION y)
 /*!
  * @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 オプションフラグ
@@ -1606,9 +1608,9 @@ void set_floor(floor_type *floor_ptr, POSITION x, POSITION y)
  * 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];
@@ -1616,7 +1618,6 @@ void place_object(floor_type *floor_ptr, POSITION y, POSITION x, BIT_FLAGS mode)
        object_type forge;
        object_type *q_ptr;
 
-
        /* Paranoia -- check bounds */
        if (!in_bounds(floor_ptr, y, x)) return;
 
@@ -1630,9 +1631,9 @@ void place_object(floor_type *floor_ptr, POSITION y, POSITION x, BIT_FLAGS mode)
        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)
index 0150adf..347e0df 100644 (file)
@@ -399,7 +399,7 @@ extern bool get_is_floor(floor_type *floor_ptr, POSITION x, POSITION y);
 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
@@ -423,7 +423,7 @@ extern void vault_objects(floor_type *floor_ptr, POSITION y, POSITION x, int num
 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);
index 02426c8..04b2e93 100644 (file)
@@ -978,10 +978,11 @@ FEAT_IDX feat_state(FEAT_IDX feat, int action)
  * 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);
@@ -990,7 +991,7 @@ void cave_alter_feat(POSITION y, POSITION x, int 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))
        {
@@ -1002,19 +1003,19 @@ void cave_alter_feat(POSITION y, POSITION x, int action)
                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!"));
                }
@@ -1026,7 +1027,7 @@ void cave_alter_feat(POSITION y, POSITION x, int action)
 
                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);
                }
        }
index e98244e..6f61a36 100644 (file)
@@ -392,7 +392,7 @@ extern void note_spot(POSITION y, POSITION x);
 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);
index 86b64e2..ebd7705 100644 (file)
@@ -1857,7 +1857,7 @@ void process_monster(player_type *target_ptr, MONSTER_IDX m_idx)
                                        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;
@@ -1898,7 +1898,7 @@ void process_monster(player_type *target_ptr, MONSTER_IDX m_idx)
                                /* 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. */
                                        {
@@ -1913,7 +1913,7 @@ void process_monster(player_type *target_ptr, MONSTER_IDX m_idx)
                                /* 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];
@@ -2109,7 +2109,7 @@ void process_monster(player_type *target_ptr, MONSTER_IDX m_idx)
                                        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. */
                        {
index 3400596..ba6b0f6 100644 (file)
@@ -2730,7 +2730,7 @@ void monster_death(MONSTER_IDX m_idx, bool drop_item)
                                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;
@@ -2890,7 +2890,7 @@ void monster_death(MONSTER_IDX m_idx, bool drop_item)
                                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;
@@ -2905,7 +2905,7 @@ void monster_death(MONSTER_IDX m_idx, bool drop_item)
                                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;
@@ -2920,7 +2920,7 @@ void monster_death(MONSTER_IDX m_idx, bool drop_item)
                                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;
@@ -2935,7 +2935,7 @@ void monster_death(MONSTER_IDX m_idx, bool drop_item)
                                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;
@@ -2950,7 +2950,7 @@ void monster_death(MONSTER_IDX m_idx, bool drop_item)
                                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;
@@ -3065,9 +3065,10 @@ void monster_death(MONSTER_IDX m_idx, bool drop_item)
                }
                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);
        }
 
index 49d7ae0..70dd295 100644 (file)
@@ -438,7 +438,7 @@ extern void delete_object_idx(floor_type *floor_ptr, OBJECT_IDX o_idx);
 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);
@@ -486,7 +486,7 @@ extern void apply_magic(object_type *o_ptr, DEPTH lev, BIT_FLAGS mode);
 
 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);
index c6d276e..3001ca5 100644 (file)
@@ -362,7 +362,7 @@ static errr get_obj_num_prep(void)
  * 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;
@@ -373,7 +373,7 @@ OBJECT_IDX get_obj_num(DEPTH level, BIT_FLAGS mode)
        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))
@@ -4056,7 +4056,7 @@ void apply_magic(object_type *o_ptr, DEPTH lev, BIT_FLAGS mode)
 /*!
  * @brief 生成階に応じたベースアイテムの生成を行う。
  * Attempt to make an object (normal or good/great)
- * @param floor_ptr 生成階への参照ポインタ
+ * @param owner_ptr プレーヤーへの参照ポインタ
  * @param j_ptr 生成結果を収めたいオブジェクト構造体の参照ポインタ
  * @param mode オプションフラグ
  * @return 生成に成功したらTRUEを返す。
@@ -4065,17 +4065,15 @@ void apply_magic(object_type *o_ptr, DEPTH lev, BIT_FLAGS mode)
  * 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 */
@@ -4094,7 +4092,7 @@ bool make_object(object_type *j_ptr, BIT_FLAGS mode)
                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)
@@ -4114,7 +4112,7 @@ bool make_object(object_type *j_ptr, BIT_FLAGS mode)
        }
 
        /* 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)
@@ -4131,8 +4129,7 @@ bool make_object(object_type *j_ptr, BIT_FLAGS mode)
 
        if (cheat_peek) object_mention(j_ptr);
 
-       /* Success */
-       return (TRUE);
+       return TRUE;
 }
 
 
index ed8f22f..cfa4f9f 100644 (file)
 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;
@@ -220,11 +223,12 @@ static void discover_hidden_things(POSITION y, POSITION x)
                {
                        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 なし
@@ -247,7 +251,7 @@ void search(player_type *creature_ptr)
                /* 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]);
                }
        }
 }
@@ -776,7 +780,7 @@ bool move_player_effect(player_type *creature_ptr, POSITION ny, POSITION nx, BIT
                        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 */
@@ -1267,7 +1271,7 @@ void move_player(player_type *creature_ptr, DIRECTION dir, bool do_pickup, bool
 
                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);
index 8c55819..6363917 100644 (file)
@@ -316,7 +316,7 @@ void check_quest_completion(player_type *player_ptr, monster_type *m_ptr)
                        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);
                }
        }
index 69ee1ad..aa5321f 100644 (file)
@@ -377,7 +377,7 @@ concptr do_hissatsu_spell(player_type *caster_ptr, SPELL_IDX spell, BIT_FLAGS mo
                        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;
index 0e409ca..f0dab6e 100644 (file)
@@ -317,6 +317,7 @@ bool build_type2(floor_type *floor_ptr)
 
 /*!
 * @brief タイプ3の部屋…十字型の部屋を生成する / Type 3 -- Cross shaped rooms
+* @param player_ptr プレーヤーへの参照ポインタ
 * @return なし
 * @details
 * Builds a room at a row, column coordinate\n
@@ -328,7 +329,7 @@ bool build_type2(floor_type *floor_ptr)
 * 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;
@@ -337,8 +338,8 @@ bool build_type3(floor_type *floor_ptr)
        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;
 
 
@@ -494,7 +495,7 @@ bool build_type3(floor_type *floor_ptr)
                }
 
                /* 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);
@@ -576,6 +577,7 @@ bool build_type3(floor_type *floor_ptr)
 
 /*!
 * @brief タイプ4の部屋…固定サイズの二重構造部屋を生成する / Type 4 -- Large room with inner features
+* @param player_ptr プレーヤーへの参照ポインタ
 * @return なし
 * @details
 * Possible sub-types:\n
@@ -585,15 +587,15 @@ bool build_type3(floor_type *floor_ptr)
 *      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 */
@@ -716,7 +718,7 @@ bool build_type4(floor_type *floor_ptr)
                        /* Object (80%) */
                        if (randint0(100) < 80)
                        {
-                               place_object(floor_ptr, yval, xval, 0L);
+                               place_object(player_ptr, yval, xval, 0L);
                        }
 
                        /* Stairs (20%) */
@@ -803,8 +805,8 @@ bool build_type4(floor_type *floor_ptr)
                                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;
@@ -844,7 +846,7 @@ bool build_type4(floor_type *floor_ptr)
                        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;
                }
@@ -887,7 +889,7 @@ bool build_type4(floor_type *floor_ptr)
                        }
 
                        /* 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));
@@ -952,6 +954,7 @@ bool build_type11(floor_type *floor_ptr)
 
 /*!
 * @brief タイプ12の部屋…ドーム型部屋の生成 / Type 12 -- Build crypt room.
+* @param player_ptr プレーヤーへの参照ポインタ
 * @return なし
 * @details
 * For every grid in the possible square, check the (fake) distance.\n
@@ -959,7 +962,7 @@ bool build_type11(floor_type *floor_ptr)
 *\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;
@@ -973,6 +976,7 @@ bool build_type12(floor_type *floor_ptr)
        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);
@@ -1034,7 +1038,7 @@ bool build_type12(floor_type *floor_ptr)
                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);
index 57e9d8f..624ea9a 100644 (file)
@@ -1,6 +1,6 @@
 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);
index 30fbccf..f052ede 100644 (file)
 
 /*!
 * @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;
@@ -29,6 +30,7 @@ bool build_type15(floor_type *floor_ptr)
        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 */
@@ -119,7 +121,7 @@ bool build_type15(floor_type *floor_ptr)
 
                /* 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;
@@ -171,7 +173,7 @@ bool build_type15(floor_type *floor_ptr)
                }
 
                /* 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;
@@ -221,16 +223,16 @@ bool build_type15(floor_type *floor_ptr)
                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++)
index baa254a..8baaf0f 100644 (file)
@@ -1,2 +1,2 @@
-extern bool build_type15(floor_type *floor_ptr);
+extern bool build_type15(player_type *player_ptr);
 
index 80c4564..81c26a7 100644 (file)
@@ -37,7 +37,7 @@ VAULT_IDX max_v_idx;
 * 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 */
 
@@ -82,8 +82,8 @@ static void build_bubble_vault(floor_type *floor_ptr, POSITION x0, POSITION y0,
                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;
@@ -165,11 +165,11 @@ static void build_bubble_vault(floor_type *floor_ptr, POSITION x0, POSITION y0,
        }
 
        /* 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;
@@ -181,6 +181,7 @@ static void build_room_vault(floor_type *floor_ptr, POSITION x0, POSITION y0, PO
        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;
@@ -213,12 +214,12 @@ static void build_room_vault(floor_type *floor_ptr, POSITION x0, POSITION y0, PO
        }
 
        /* 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;
@@ -235,6 +236,7 @@ static void build_cave_vault(floor_type *floor_ptr, POSITION x0, POSITION y0, PO
        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 */
@@ -264,11 +266,10 @@ static void build_cave_vault(floor_type *floor_ptr, POSITION x0, POSITION y0, PO
        }
 
        /* 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座標参照ポインタ
@@ -314,6 +315,7 @@ static void coord_trans(POSITION *x, POSITION *y, POSITION xoffset, POSITION yof
 
 /*!
 * @brief Vaultをフロアに配置する / Hack -- fill in "vault" rooms
+* @param player_ptr プレーヤーへの参照ポインタ
 * @param yval 生成基準Y座標
 * @param xval 生成基準X座標
 * @param ymax VaultのYサイズ
@@ -324,7 +326,7 @@ static void coord_trans(POSITION *x, POSITION *y, POSITION xoffset, POSITION yof
 * @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;
@@ -332,6 +334,7 @@ static void build_vault(floor_type *floor_ptr, POSITION yval, POSITION xval, POS
        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++)
@@ -403,7 +406,7 @@ static void build_vault(floor_type *floor_ptr, POSITION yval, POSITION xval, POS
                        case '*':
                                if (randint0(100) < 75)
                                {
-                                       place_object(floor_ptr, y, x, 0L);
+                                       place_object(player_ptr, y, x, 0L);
                                }
                                else
                                {
@@ -413,7 +416,7 @@ static void build_vault(floor_type *floor_ptr, POSITION yval, POSITION xval, POS
 
                                /* Treasure */
                        case '[':
-                               place_object(floor_ptr, y, x, 0L);
+                               place_object(player_ptr, y, x, 0L);
                                break;
 
                                /* Tree */
@@ -480,7 +483,7 @@ static void build_vault(floor_type *floor_ptr, POSITION yval, POSITION xval, POS
                        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;
 
@@ -592,7 +595,7 @@ static void build_vault(floor_type *floor_ptr, POSITION yval, POSITION xval, POS
                                        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;
                                }
@@ -604,7 +607,7 @@ static void build_vault(floor_type *floor_ptr, POSITION yval, POSITION xval, POS
                                        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;
                                }
@@ -621,24 +624,22 @@ static void build_vault(floor_type *floor_ptr, POSITION yval, POSITION xval, POS
                                        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;
@@ -672,6 +673,7 @@ bool build_type7(floor_type *floor_ptr)
        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 */
@@ -708,17 +710,18 @@ bool build_type7(floor_type *floor_ptr)
        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;
@@ -752,6 +755,7 @@ bool build_type8(floor_type *floor_ptr)
        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 */
@@ -794,7 +798,7 @@ bool build_type8(floor_type *floor_ptr)
        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;
@@ -806,7 +810,7 @@ bool build_type8(floor_type *floor_ptr)
 * 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;
 
@@ -830,6 +834,7 @@ static void build_target_vault(floor_type *floor_ptr, POSITION x0, POSITION y0,
        }
 
        /* 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++)
@@ -917,7 +922,7 @@ static void build_target_vault(floor_type *floor_ptr, POSITION x0, POSITION y0,
        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);
 }
 
 
@@ -929,7 +934,7 @@ static void build_target_vault(floor_type *floor_ptr, POSITION x0, POSITION y0,
 *
 * 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;
@@ -946,6 +951,7 @@ static void build_elemental_vault(floor_type *floor_ptr, POSITION x0, POSITION y
        xsize = xhsize * 2;
        ysize = yhsize * 2;
 
+       floor_type *floor_ptr = player_ptr->current_floor_ptr;
        if (floor_ptr->dun_level < 25)
        {
                /* Earth vault  (Rubble) */
@@ -1009,7 +1015,7 @@ static void build_elemental_vault(floor_type *floor_ptr, POSITION x0, POSITION y
        }
 
        /* 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 */
@@ -1022,7 +1028,7 @@ static void build_elemental_vault(floor_type *floor_ptr, POSITION x0, POSITION y
 * 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;
@@ -1042,6 +1048,7 @@ static void build_mini_c_vault(floor_type *floor_ptr, POSITION x0, POSITION y0,
 
 
        /* 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;
@@ -1134,7 +1141,7 @@ static void build_mini_c_vault(floor_type *floor_ptr, POSITION x0, POSITION y0,
        }
 
        /* 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);
 }
@@ -1145,7 +1152,7 @@ static void build_mini_c_vault(floor_type *floor_ptr, POSITION x0, POSITION y0,
 *
 *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;
@@ -1163,6 +1170,7 @@ static void build_castle_vault(floor_type *floor_ptr, POSITION x0, POSITION y0,
        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++)
@@ -1177,16 +1185,16 @@ static void build_castle_vault(floor_type *floor_ptr, POSITION x0, POSITION y0,
        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;
 
@@ -1195,6 +1203,7 @@ bool build_type10(floor_type *floor_ptr)
        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 */
@@ -1215,15 +1224,15 @@ bool build_type10(floor_type *floor_ptr)
        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;
@@ -1237,7 +1246,7 @@ bool build_type10(floor_type *floor_ptr)
 * @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;
@@ -1271,6 +1280,7 @@ bool build_type17(floor_type *floor_ptr)
        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 */
@@ -1307,9 +1317,8 @@ bool build_type17(floor_type *floor_ptr)
        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;
 }
-
index 0c9fc16..2d91ac2 100644 (file)
@@ -23,8 +23,7 @@ extern char *v_text;
 
 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);
index 72efe11..1f3be33 100644 (file)
@@ -1380,7 +1380,7 @@ void build_lake(floor_type *floor_ptr, int type)
 /*
  * 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;
@@ -1392,6 +1392,7 @@ void fill_treasure(floor_type *floor_ptr, POSITION x1, POSITION x2, POSITION y1,
        /* 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++)
@@ -1415,7 +1416,7 @@ void fill_treasure(floor_type *floor_ptr, POSITION x1, POSITION x2, POSITION y1,
                                        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)
@@ -1425,7 +1426,7 @@ void fill_treasure(floor_type *floor_ptr, POSITION x1, POSITION x2, POSITION y1,
                                        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)
@@ -1450,7 +1451,7 @@ void fill_treasure(floor_type *floor_ptr, POSITION x1, POSITION x2, POSITION y1,
                                        /* Object or trap */
                                        if (randint0(100) < 25)
                                        {
-                                               place_object(floor_ptr, y, x, 0L);
+                                               place_object(player_ptr, y, x, 0L);
                                        }
                                        else
                                        {
@@ -1477,7 +1478,7 @@ void fill_treasure(floor_type *floor_ptr, POSITION x1, POSITION x2, POSITION y1,
                                        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;
                                        }
                                }
@@ -1501,7 +1502,7 @@ void fill_treasure(floor_type *floor_ptr, POSITION x1, POSITION x2, POSITION y1,
                                        }
                                        else if (randint0(100) < 50)
                                        {
-                                               place_object(floor_ptr, y, x, 0L);
+                                               place_object(player_ptr, y, x, 0L);
                                        }
                                }
 
@@ -1511,7 +1512,6 @@ void fill_treasure(floor_type *floor_ptr, POSITION x1, POSITION x2, POSITION y1,
 }
 
 
-
 /*
  * Overlay a rectangular room given its bounds
  * This routine is used by build_room_vault
@@ -1689,7 +1689,7 @@ void r_visit(floor_type *floor_ptr, POSITION y1, POSITION x1, POSITION y2, POSIT
 }
 
 
-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;
@@ -1700,6 +1700,7 @@ void build_maze_vault(floor_type *floor_ptr, POSITION x0, POSITION y0, POSITION
        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 */
@@ -1747,7 +1748,7 @@ void build_maze_vault(floor_type *floor_ptr, POSITION x0, POSITION y0, POSITION
        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);
 }
@@ -2076,33 +2077,34 @@ void generate_fill_perm_bold(floor_type *floor_ptr, POSITION y1, POSITION x1, PO
 
 /*!
  * @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;
 }
@@ -2116,10 +2118,12 @@ static bool room_build(floor_type *floor_ptr, EFFECT_ID typ)
 
 /*!
  * @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;
@@ -2289,7 +2293,7 @@ bool generate_rooms(floor_type *floor_ptr)
                        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++;
index dfe1706..172da0a 100644 (file)
@@ -88,8 +88,8 @@ typedef struct
 
 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);
@@ -98,7 +98,7 @@ extern void generate_room_floor(floor_type *floor_ptr, POSITION y1, POSITION x1,
 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);
index fd5c7c9..57b3868 100644 (file)
@@ -170,7 +170,7 @@ bool create_ammo(player_type *creature_ptr)
                        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);
                }
@@ -441,7 +441,7 @@ void acquirement(player_type *caster_ptr, POSITION y1, POSITION x1, int num, boo
                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)
                {
index 9855bf7..81e32f4 100644 (file)
@@ -373,7 +373,7 @@ if (have_flag(f_ptr->flags, FF_TREE))
                        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)
@@ -393,7 +393,7 @@ if (have_flag(f_ptr->flags, FF_TREE))
                                }
 
                                /* Destroy the trap */
-                               cave_alter_feat(y, x, FF_DISARM);
+                               cave_alter_feat(caster_ptr, y, x, FF_DISARM);
                        }
 
                        /* Locked doors are unlocked */
@@ -402,7 +402,7 @@ if (have_flag(f_ptr->flags, FF_TREE))
                                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))
@@ -437,7 +437,7 @@ if (have_flag(f_ptr->flags, FF_TREE))
                                }
 
                                /* 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 */
@@ -458,7 +458,7 @@ if (have_flag(f_ptr->flags, FF_TREE))
                                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);
@@ -487,7 +487,7 @@ if (have_flag(f_ptr->flags, FF_TREE))
                                }
 
                                /* 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);
                        }
 
@@ -674,7 +674,7 @@ if (have_flag(f_ptr->flags, FF_TREE))
                                }
 
                                /* 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);
                        }
 
@@ -700,7 +700,7 @@ if (have_flag(f_ptr->flags, FF_TREE))
                                }
 
                                /* 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);
                        }
 
@@ -717,7 +717,7 @@ if (have_flag(f_ptr->flags, FF_TREE))
                        /* 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);
index 0c5b268..7a94f10 100644 (file)
@@ -97,7 +97,7 @@ static bool detect_feat_flag(player_type *caster_ptr, POSITION range, int flag,
 
                        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;
index 7b17fba..3f20767 100644 (file)
@@ -1052,7 +1052,7 @@ bool vanish_dungeon(player_type *caster_ptr)
                        }
 
                        /* 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);
                }
        }
 
@@ -3174,7 +3174,7 @@ bool eat_rock(player_type *caster_ptr)
                (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;
 }
index 705e530..6294140 100644 (file)
@@ -3372,6 +3372,7 @@ static void store_delete(void)
 /*!
  * @brief 店舗の品揃え変化のためにアイテムを追加する /
  * Creates a random item and gives it to a store
+ * @param player_ptr プレーヤーへの参照ポインタ
  * @return なし
  * @details
  * <pre>
@@ -3383,7 +3384,7 @@ static void store_delete(void)
  * 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;
@@ -3405,7 +3406,7 @@ static void store_create(void)
                        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;
@@ -4530,9 +4531,10 @@ static bool sell_haggle(object_type *o_ptr, s32b *price)
 /*!
  * @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;
@@ -4701,15 +4703,15 @@ static void store_purchase(void)
                        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);
@@ -4718,7 +4720,7 @@ static void store_purchase(void)
                                decrease_insults();
 
                                /* Spend the money */
-                               p_ptr->au -= price;
+                               player_ptr->au -= price;
 
                                /* Update the display */
                                store_prt_gold();
@@ -4737,10 +4739,10 @@ static void store_purchase(void)
                                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;
@@ -4749,10 +4751,10 @@ static void store_purchase(void)
                                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 */
@@ -4802,7 +4804,7 @@ static void store_purchase(void)
                                        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 */
@@ -4844,10 +4846,10 @@ static void store_purchase(void)
                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();
@@ -4880,12 +4882,9 @@ static void store_purchase(void)
                        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;
 }
 
 
@@ -5404,7 +5403,7 @@ static void store_process_command(player_type *client_ptr)
                /* Get (purchase) */
                case 'g':
                {
-                       store_purchase();
+                       store_purchase(client_ptr);
                        break;
                }
 
@@ -5683,6 +5682,7 @@ static void store_process_command(player_type *client_ptr)
 /*!
  * @brief 店舗処理全体のメインルーチン /
  * Enter a store, and interact with it. *
+ * @param player_ptr プレーヤーへの参照ポインタ
  * @return なし
  * @note
  * <pre>
@@ -5694,7 +5694,7 @@ static void store_process_command(player_type *client_ptr)
  * (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;
@@ -5703,7 +5703,7 @@ void do_cmd_store(void)
        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 */
@@ -5711,7 +5711,7 @@ void do_cmd_store(void)
        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))
@@ -5723,22 +5723,22 @@ void do_cmd_store(void)
        /* 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;
@@ -5747,14 +5747,14 @@ void do_cmd_store(void)
        {
                /* 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;
@@ -5774,7 +5774,7 @@ void do_cmd_store(void)
        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 */
@@ -5846,13 +5846,13 @@ void do_cmd_store(void)
                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;
@@ -5860,11 +5860,11 @@ void do_cmd_store(void)
                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)
@@ -5929,11 +5929,11 @@ void do_cmd_store(void)
                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;
@@ -5951,13 +5951,13 @@ void do_cmd_store(void)
        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);
 }
 
 
@@ -6034,11 +6034,12 @@ void store_shuffle(int which)
 /*!
  * @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;
 
@@ -6075,7 +6076,6 @@ void store_maint(int town_num, int store_num)
                }
        }
 
-
        /* Choose the number of slots to keep */
        j = st_ptr->stock_num;
 
@@ -6111,7 +6111,7 @@ void store_maint(int town_num, int store_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);
 }
 
 
index 4a4b629..2e7fdb2 100644 (file)
@@ -79,15 +79,12 @@ struct store_type
 
 /* 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];
-
-
-
index 24c9385..87e950e 100644 (file)
@@ -169,21 +169,23 @@ FEAT_IDX choose_random_trap(floor_type *floor_ptr)
        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)
        {
@@ -195,6 +197,7 @@ void disclose_grid(floor_type *floor_ptr, POSITION y, POSITION x)
        }
 }
 
+
 /*!
 * @brief マスをトラップを配置する /
 * The location must be a legal, naked, floor grid.
@@ -413,7 +416,7 @@ void hit_trap(player_type *trapped_ptr, bool break_trap)
 
        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)
@@ -667,7 +670,7 @@ void hit_trap(player_type *trapped_ptr, bool break_trap)
 
        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."));
        }
 }
index ad55b12..cc5d17b 100644 (file)
@@ -1,7 +1,7 @@
 
 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);
 
index db4f81d..b905199 100644 (file)
@@ -1059,7 +1059,7 @@ static void wiz_statistics(player_type *caster_ptr, object_type *o_ptr)
                        object_wipe(q_ptr);
 
                        /* Create an object */
-                       make_object(q_ptr, mode);
+                       make_object(caster_ptr, q_ptr, mode);
 
 
                        /* Mega-Hack -- allow multiple artifacts */