OSDN Git Service

[Refactor] #37353 後で同名の構造体を作り、feat_*と命名を一致させるため floor_type を feat_ground_type に改名...
[hengband/hengband.git] / src / floor-save.c
index a28e326..9997eff 100644 (file)
  */
 
 #include "angband.h"
+#include "floor.h"
 #include "generate.h"
 #include "grid.h"
+#include "monster.h"
+#include "quest.h"
 
 
-static s16b new_floor_id;       /*!<次のフロアのID / floor_id of the destination */
+static FLOOR_IDX new_floor_id;  /*!<次のフロアのID / floor_id of the destination */
 static u32b change_floor_mode;  /*!<フロア移行処理に関するフラグ / Mode flags for changing floor */
 static u32b latest_visit_mark;  /*!<フロアを渡った回数?(確認中) / Max number of visit_mark */
 
@@ -229,10 +232,10 @@ static void kill_saved_floor(saved_floor_type *sf_ptr)
  * @details
  * If number of saved floors are already MAX_SAVED_FLOORS, kill the oldest one.
  */
-s16b get_new_floor_id(void)
+FLOOR_IDX get_new_floor_id(void)
 {
        saved_floor_type *sf_ptr = NULL;
-       s16b i;
+       FLOOR_IDX i;
 
        /* Look for empty space */
        for (i = 0; i < MAX_SAVED_FLOORS; i++)
@@ -868,7 +871,6 @@ void leave_floor(void)
            p_ptr->floor_id = get_new_floor_id();
        }
 
-
        /* Search the quest monster index */
        for (i = 0; i < max_q_idx; i++)
        {
@@ -1138,7 +1140,7 @@ void change_floor(void)
                                                if (change_floor_mode & (CFM_DOWN | CFM_UP))
                                                {
                                                        /* Reset to floor */
-                                                       c_ptr->feat = floor_type[randint0(100)];
+                                                       c_ptr->feat = feat_ground_type[randint0(100)];
                                                }
 
                                                c_ptr->special = 0;
@@ -1184,11 +1186,11 @@ void change_floor(void)
                /* Maintain monsters and artifacts */
                if (loaded)
                {
-                       IDX i;
-                       s32b tmp_last_visit = sf_ptr->last_visit;
-                       s32b absence_ticks;
+                       MONSTER_IDX i;
+                       GAME_TURN tmp_last_visit = sf_ptr->last_visit;
+                       GAME_TURN absence_ticks;
                        int alloc_chance = d_info[dungeon_type].max_m_alloc_chance;
-                       int alloc_times;
+                       GAME_TURN alloc_times;
 
                        while (tmp_last_visit > turn) tmp_last_visit -= TURNS_PER_TICK * TOWN_DAWN;
                        absence_ticks = (turn - tmp_last_visit) / TURNS_PER_TICK;
@@ -1339,8 +1341,7 @@ void change_floor(void)
                }
 
                /* You see stairs blocked */
-               else if ((change_floor_mode & CFM_NO_RETURN) &&
-                        (change_floor_mode & (CFM_DOWN | CFM_UP)))
+               else if ((change_floor_mode & CFM_NO_RETURN) && (change_floor_mode & (CFM_DOWN | CFM_UP)))
                {
                        if (!p_ptr->blind)
                        {
@@ -1407,7 +1408,7 @@ void stair_creation(void)
 
        bool up = TRUE;
        bool down = TRUE;
-       s16b dest_floor_id = 0;
+       FLOOR_IDX dest_floor_id = 0;
 
 
        /* Forbid up staircases on Ironman mode */
@@ -1482,7 +1483,7 @@ void stair_creation(void)
 
                                /* Remove old stairs */
                                c_ptr->special = 0;
-                               cave_set_feat(y, x, floor_type[randint0(100)]);
+                               cave_set_feat(y, x, feat_ground_type[randint0(100)]);
                        }
                }
        }