OSDN Git Service

[Refactor] #38997 is_known_trap() とis_hidden_door()にplayer_type * 引数を追加 / Added playe...
[hengband/hengband.git] / src / floor-save.c
index 4311e58..90fa7ef 100644 (file)
@@ -56,7 +56,7 @@ static monster_type party_mon[MAX_PARTY_MON]; /*!< フロア移動に保存す
 FLOOR_IDX max_floor_id;
 
 /*
- * Sign for current process used in temporal files.
+ * Sign for current process used in temporary files.
  * Actually it is the start time of current process.
  */
 u32b saved_floor_file_sign;
@@ -65,7 +65,7 @@ u32b saved_floor_file_sign;
  * @brief 保存フロア配列を初期化する / Initialize saved_floors array. 
  * @param creature_ptr プレーヤーへの参照ポインタ
  * @param force テンポラリファイルが残っていた場合も警告なしで強制的に削除するフラグ
- * @details Make sure that old temporal files are not remaining as gurbages.
+ * @details Make sure that old temporary files are not remaining as gurbages.
  * @return なし
  */
 void init_saved_floors(player_type *creature_ptr, bool force)
@@ -103,11 +103,11 @@ void init_saved_floors(player_type *creature_ptr, bool force)
                {
                        if (!force)
                        {
-                               msg_print(_("エラー:古いテンポラリ・ファイルが残っています。", "Error: There are old temporal files."));
+                               msg_print(_("エラー:古いテンポラリ・ファイルが残っています。", "Error: There are old temporary files."));
                                msg_print(_("変愚蛮怒を二重に起動していないか確認してください。", "Make sure you are not running two game processes simultaneously."));
-                               msg_print(_("過去に変愚蛮怒がクラッシュした場合は一時ファイルを", "If the temporal files are garbages of old crashed process, "));
+                               msg_print(_("過去に変愚蛮怒がクラッシュした場合は一時ファイルを", "If the temporary files are garbages of old crashed process, "));
                                msg_print(_("強制的に削除して実行を続けられます。", "you can delete it safely."));
-                               if (!get_check(_("強制的に削除してもよろしいですか?", "Do you delete old temporal files? ")))
+                               if (!get_check(_("強制的に削除してもよろしいですか?", "Do you delete old temporary files? ")))
                                        quit(_("実行中止", "Aborted."));
                                force = TRUE;
                        }
@@ -121,7 +121,7 @@ void init_saved_floors(player_type *creature_ptr, bool force)
                /* Grab permissions */
                safe_setuid_grab();
 
-               /* Simply kill the temporal file */ 
+               /* Simply kill the temporary file */ 
                (void)fd_kill(floor_savefile);
 
                /* Drop permissions */
@@ -136,7 +136,7 @@ void init_saved_floors(player_type *creature_ptr, bool force)
        /* vist_mark is from 1 */
        latest_visit_mark = 1;
 
-       /* A sign to mark temporal files */
+       /* A sign to mark temporary files */
        saved_floor_file_sign = (u32b)time(NULL);
 
        /* No next floor yet */
@@ -154,7 +154,7 @@ void init_saved_floors(player_type *creature_ptr, bool force)
 }
 
 /*!
- * @brief 保存フロア用テンポラリファイルを削除する / Kill temporal files
+ * @brief 保存フロア用テンポラリファイルを削除する / Kill temporary files
  * @details Should be called just before the game quit.
  * @param creature_ptr プレーヤーへの参照ポインタ
  * @return なし
@@ -175,7 +175,7 @@ void clear_saved_floor_files(player_type *creature_ptr)
        {
                saved_floor_type *sf_ptr = &saved_floors[i];
 
-               /* No temporal file */
+               /* No temporary file */
                if (!sf_ptr->floor_id) continue;
                if (sf_ptr->floor_id == creature_ptr->floor_id) continue;
 
@@ -185,7 +185,7 @@ void clear_saved_floor_files(player_type *creature_ptr)
                /* Grab permissions */
                safe_setuid_grab();
 
-               /* Simply kill the temporal file */ 
+               /* Simply kill the temporary file */ 
                (void)fd_kill(floor_savefile);
 
                /* Drop permissions */
@@ -243,7 +243,7 @@ static void kill_saved_floor(player_type *creature_ptr, saved_floor_type *sf_ptr
                /* Kill current floor */
                creature_ptr->floor_id = 0;
 
-               /* Current floor doesn't have temporal file */
+               /* Current floor doesn't have temporary file */
        }
        else 
        {
@@ -253,7 +253,7 @@ static void kill_saved_floor(player_type *creature_ptr, saved_floor_type *sf_ptr
                /* Grab permissions */
                safe_setuid_grab();
 
-               /* Simply kill the temporal file */ 
+               /* Simply kill the temporary file */ 
                (void)fd_kill(floor_savefile);
 
                /* Drop permissions */
@@ -373,7 +373,7 @@ static void build_dead_end(player_type *creature_ptr)
                for (x = 0; x < MAX_WID; x++)
                {
                        /* Create "solid" perma-wall */
-                       place_solid_perm_bold(creature_ptr->current_floor_ptr, y, x);
+                       place_bold(creature_ptr, y, x, solid_perm);
                }
        }
 
@@ -382,7 +382,7 @@ static void build_dead_end(player_type *creature_ptr)
        creature_ptr->x = creature_ptr->current_floor_ptr->width / 2;
 
        /* Give one square */
-       place_floor_bold(creature_ptr->current_floor_ptr, creature_ptr->y, creature_ptr->x);
+       place_bold(creature_ptr, creature_ptr->y, creature_ptr->x, floor);
 
        wipe_generate_random_floor_flags(creature_ptr->current_floor_ptr);
 }
@@ -411,7 +411,7 @@ static void preserve_pet(player_type *master_ptr)
                if (m_ptr->parent_m_idx)
                {
                        master_ptr->riding = 0;
-                       master_ptr->pet_extra_flags &= ~(PF_RYOUTE);
+                       master_ptr->pet_extra_flags &= ~(PF_TWO_HANDS);
                        master_ptr->riding_ryoute = master_ptr->old_riding_ryoute = FALSE;
                }
                else
@@ -420,7 +420,7 @@ static void preserve_pet(player_type *master_ptr)
                        (void)COPY(&party_mon[0], m_ptr, monster_type);
 
                        /* Delete from this floor */
-                       delete_monster_idx(master_ptr->riding);
+                       delete_monster_idx(master_ptr, master_ptr->riding);
                }
        }
 
@@ -457,8 +457,8 @@ static void preserve_pet(player_type *master_ptr)
                                 * when you or the pet can see the other.
                                 */
                                if (m_ptr->nickname && 
-                                   ((player_has_los_bold(master_ptr, m_ptr->fy, m_ptr->fx) && projectable(master_ptr->current_floor_ptr, master_ptr->y, master_ptr->x, m_ptr->fy, m_ptr->fx)) ||
-                                    (los(master_ptr->current_floor_ptr, m_ptr->fy, m_ptr->fx, master_ptr->y, master_ptr->x) && projectable(master_ptr->current_floor_ptr, m_ptr->fy, m_ptr->fx, master_ptr->y, master_ptr->x))))
+                                   ((player_has_los_bold(master_ptr, m_ptr->fy, m_ptr->fx) && projectable(master_ptr, master_ptr->y, master_ptr->x, m_ptr->fy, m_ptr->fx)) ||
+                                    (los(master_ptr, m_ptr->fy, m_ptr->fx, master_ptr->y, master_ptr->x) && projectable(master_ptr, m_ptr->fy, m_ptr->fx, master_ptr->y, master_ptr->x))))
                                {
                                        if (dis > 3) continue;
                                }
@@ -473,7 +473,7 @@ static void preserve_pet(player_type *master_ptr)
                        num++;
 
                        /* Delete from this floor */
-                       delete_monster_idx(i);
+                       delete_monster_idx(master_ptr, i);
                }
        }
 
@@ -489,8 +489,8 @@ static void preserve_pet(player_type *master_ptr)
                        if (!m_ptr->nickname) continue;
                        if (master_ptr->riding == i) continue;
 
-                       monster_desc(m_name, m_ptr, MD_ASSUME_VISIBLE | MD_INDEF_VISIBLE);
-                       exe_write_diary(master_ptr, NIKKI_NAMED_PET, RECORD_NAMED_PET_MOVED, m_name);
+                       monster_desc(master_ptr, m_name, m_ptr, MD_ASSUME_VISIBLE | MD_INDEF_VISIBLE);
+                       exe_write_diary(master_ptr, DIARY_NAMED_PET, RECORD_NAMED_PET_MOVED, m_name);
                }
        }
 
@@ -508,11 +508,11 @@ static void preserve_pet(player_type *master_ptr)
                        if (is_seen(m_ptr))
                        {
                                GAME_TEXT m_name[MAX_NLEN];
-                               monster_desc(m_name, m_ptr, 0);
+                               monster_desc(master_ptr, m_name, m_ptr, 0);
                                msg_format(_("%sは消え去った!", "%^s disappears!"), m_name);
                        }
 
-                       delete_monster_idx(i);
+                       delete_monster_idx(master_ptr, i);
                }
        }
 }
@@ -562,7 +562,7 @@ static void place_pet(player_type *master_ptr)
 
                if (i == 0)
                {
-                       m_idx = m_pop();
+                       m_idx = m_pop(master_ptr);
                        master_ptr->riding = m_idx;
                        if (m_idx)
                        {
@@ -579,12 +579,12 @@ static void place_pet(player_type *master_ptr)
                        {
                                for (j = 1000; j > 0; j--)
                                {
-                                       scatter(&cy, &cx, master_ptr->y, master_ptr->x, d, 0);
+                                       scatter(master_ptr, &cy, &cx, master_ptr->y, master_ptr->x, d, 0);
                                        if (monster_can_enter(cy, cx, &r_info[party_mon[i].r_idx], 0)) break;
                                }
                                if (j) break;
                        }
-                       m_idx = (d == 6) ? 0 : m_pop();
+                       m_idx = (d == 6) ? 0 : m_pop(master_ptr);
                }
 
                if (m_idx)
@@ -617,7 +617,7 @@ static void place_pet(player_type *master_ptr)
                                repair_monsters = TRUE;
                        }
                        update_monster(master_ptr, m_idx, TRUE);
-                       lite_spot(cy, cx);
+                       lite_spot(master_ptr, cy, cx);
 
                        /* Pre-calculated in precalc_cur_num_of_pet() */
                        /* r_ptr->cur_num++; */
@@ -632,12 +632,12 @@ static void place_pet(player_type *master_ptr)
                        monster_race *r_ptr = real_r_ptr(m_ptr);
                        GAME_TEXT m_name[MAX_NLEN];
 
-                       monster_desc(m_name, m_ptr, 0);
+                       monster_desc(master_ptr, m_name, m_ptr, 0);
                        msg_format(_("%sとはぐれてしまった。", "You have lost sight of %s."), m_name);
                        if (record_named_pet && m_ptr->nickname)
                        {
-                               monster_desc(m_name, m_ptr, MD_INDEF_VISIBLE);
-                               exe_write_diary(master_ptr, NIKKI_NAMED_PET, RECORD_NAMED_PET_LOST_SIGHT, m_name);
+                               monster_desc(master_ptr, m_name, m_ptr, MD_INDEF_VISIBLE);
+                               exe_write_diary(master_ptr, DIARY_NAMED_PET, RECORD_NAMED_PET_LOST_SIGHT, m_name);
                        }
 
                        /* Pre-calculated in precalc_cur_num_of_pet(), but need to decrease */
@@ -896,7 +896,7 @@ void leave_floor(player_type *creature_ptr)
            (creature_ptr->change_floor_mode & CFM_SAVE_FLOORS) &&
            !(creature_ptr->change_floor_mode & CFM_NO_RETURN))
        {
-           /* Get temporal floor_id */
+           /* Get temporary floor_id */
                tmp_floor_idx = get_new_floor_id(creature_ptr);
        }
 
@@ -933,7 +933,7 @@ void leave_floor(player_type *creature_ptr)
                    (r_ptr->flags7 & RF7_NAZGUL)) continue;
 
                /* Delete non-unique quest monsters */
-               delete_monster_idx(i);
+               delete_monster_idx(creature_ptr, i);
        }
 
        /* Check if there is a same item */
@@ -1084,7 +1084,7 @@ void leave_floor(player_type *creature_ptr)
                clear_mon_lite(creature_ptr->current_floor_ptr);
 
                /* Save current floor */
-               if (!save_floor(sf_ptr, 0))
+               if (!save_floor(creature_ptr, sf_ptr, 0))
                {
                        /* Save failed -- No return */
                        prepare_change_floor_mode(creature_ptr, CFM_NO_RETURN);
@@ -1102,7 +1102,7 @@ void leave_floor(player_type *creature_ptr)
  * @return なし
  * @details
  * If the floor is an old saved floor, it will be\n
- * restored from the temporal file.  If the floor is new one, new floor\n
+ * restored from the temporary file.  If the floor is new one, new floor\n
  * will be generated.\n
  */
 void change_floor(player_type *creature_ptr)
@@ -1235,12 +1235,12 @@ void change_floor(player_type *creature_ptr)
                                        m_ptr->hp = m_ptr->maxhp = m_ptr->max_maxhp;
 
                                        /* Remove timed status (except MTIMED_CSLEEP) */
-                                       (void)set_monster_fast(i, 0);
-                                       (void)set_monster_slow(i, 0);
-                                       (void)set_monster_stunned(i, 0);
-                                       (void)set_monster_confused(i, 0);
-                                       (void)set_monster_monfear(i, 0);
-                                       (void)set_monster_invulner(i, 0, FALSE);
+                                       (void)set_monster_fast(creature_ptr, i, 0);
+                                       (void)set_monster_slow(creature_ptr, i, 0);
+                                       (void)set_monster_stunned(creature_ptr, i, 0);
+                                       (void)set_monster_confused(creature_ptr, i, 0);
+                                       (void)set_monster_monfear(creature_ptr, i, 0);
+                                       (void)set_monster_invulner(creature_ptr, i, 0, FALSE);
                                }
 
                                /* Extract real monster race */
@@ -1254,7 +1254,7 @@ void change_floor(player_type *creature_ptr)
                                if (r_ptr->floor_id != new_floor_id)
                                {
                                        /* Disapper from here */
-                                       delete_monster_idx(i);
+                                       delete_monster_idx(creature_ptr, i);
                                }
                        }
 
@@ -1272,7 +1272,7 @@ void change_floor(player_type *creature_ptr)
                                if (a_info[o_ptr->name1].floor_id != new_floor_id)
                                {
                                        /* Disappear from here */
-                                       delete_object_idx(i);
+                                       delete_object_idx(creature_ptr, i);
                                }
                                else
                                {
@@ -1281,7 +1281,7 @@ void change_floor(player_type *creature_ptr)
                                }
                        }
 
-                       (void)place_quest_monsters(creature_ptr->current_floor_ptr, creature_ptr);
+                       (void)place_quest_monsters(creature_ptr);
 
                        /* Place some random monsters */
                        alloc_times = absence_ticks / alloc_chance;
@@ -1292,7 +1292,7 @@ void change_floor(player_type *creature_ptr)
                        for (i = 0; i < alloc_times; i++)
                        {
                                /* Make a (group of) new monster */
-                               (void)alloc_monster(0, 0);
+                               (void)alloc_monster(creature_ptr, 0, 0);
                        }
 
                }
@@ -1302,7 +1302,7 @@ void change_floor(player_type *creature_ptr)
                {
                        if (sf_ptr->last_visit)
                        {
-                               /* Temporal file is broken? */
+                               /* Temporary file is broken? */
                                msg_print(_("階段は行き止まりだった。", "The staircases come to a dead end..."));
 
                                /* Create simple dead end */
@@ -1338,15 +1338,15 @@ void change_floor(player_type *creature_ptr)
                                /*** Create connected stairs ***/
 
                                /* No stairs down from Quest */
-                               if ((creature_ptr->change_floor_mode & CFM_UP) && !quest_number(creature_ptr->current_floor_ptr->dun_level))
+                               if ((creature_ptr->change_floor_mode & CFM_UP) && !quest_number(creature_ptr, creature_ptr->current_floor_ptr->dun_level))
                                {
-                                       g_ptr->feat = (creature_ptr->change_floor_mode & CFM_SHAFT) ? feat_state(feat_down_stair, FF_SHAFT) : feat_down_stair;
+                                       g_ptr->feat = (creature_ptr->change_floor_mode & CFM_SHAFT) ? feat_state(creature_ptr, feat_down_stair, FF_SHAFT) : feat_down_stair;
                                }
 
                                /* No stairs up when ironman_downward */
                                else if ((creature_ptr->change_floor_mode & CFM_DOWN) && !ironman_downward)
                                {
-                                       g_ptr->feat = (creature_ptr->change_floor_mode & CFM_SHAFT) ? feat_state(feat_up_stair, FF_SHAFT) : feat_up_stair;
+                                       g_ptr->feat = (creature_ptr->change_floor_mode & CFM_SHAFT) ? feat_state(creature_ptr, feat_up_stair, FF_SHAFT) : feat_up_stair;
                                }
 
                                /* Paranoia -- Clear mimic */