OSDN Git Service

#37287 #37353 (2.2.0.89) 型の置換を継続中。 / Ongoing type replacement.
[hengband/hengband.git] / src / generate.c
index 71539c9..4c60d4b 100644 (file)
 #include "rooms.h"
 #include "streams.h"
 
-int dun_tun_rnd;
+int dun_tun_rnd; 
 int dun_tun_chg;
 int dun_tun_con;
 int dun_tun_pen;
@@ -166,7 +166,7 @@ static bool alloc_stairs_aux(int y, int x, int walls)
  * @param walls 最低減隣接させたい外壁の数
  * @return 規定数通りに生成に成功したらTRUEを返す。
  */
-static bool alloc_stairs(int feat, int num, int walls)
+static bool alloc_stairs(IDX feat, int num, int walls)
 {
        int i;
        int shaft_num = 0;
@@ -331,15 +331,7 @@ static void alloc_object(int set, int typ, int num)
 
                if (dummy >= SAFE_MAX_ATTEMPTS)
                {
-                       if (cheat_room)
-                       {
-#ifdef JP
-msg_print("警告!アイテムを配置できません!");
-#else
-                               msg_print("Warning! Could not place object!");
-#endif
-
-                       }
+                       msg_print_wizard(CHEAT_DUNGEON, _("アイテムの配置に失敗しました。", "Failed to place object."));
                        return;
                }
 
@@ -525,7 +517,7 @@ bool place_quest_monsters(void)
 
                        for (k = 0; k < SAFE_MAX_ATTEMPTS; k++)
                        {
-                               int x, y;
+                               int x = 0, y = 0;
                                int l;
 
                                /* Find an empty grid */
@@ -542,7 +534,7 @@ bool place_quest_monsters(void)
 
                                        if (!have_flag(f_ptr->flags, FF_MOVE) && !have_flag(f_ptr->flags, FF_CAN_FLY)) continue;
                                        if (!monster_can_enter(y, x, r_ptr, 0)) continue;
-                                       if (distance(y, x, py, px) < 10) continue;
+                                       if (distance(y, x, p_ptr->y, p_ptr->x) < 10) continue;
                                        if (c_ptr->info & CAVE_ICKY) continue;
                                        else break;
                                }
@@ -666,13 +658,7 @@ static void gen_caverns_and_lakes(void)
 
                if (dun->laketype)
                {
-                       if (cheat_room)
-#ifdef JP
-                               msg_print("湖を生成。");
-#else
-                               msg_print("Lake on the level.");
-#endif
-
+                       msg_print_wizard(CHEAT_DUNGEON, _("湖を生成します。", "Lake on the level."));
                        build_lake(dun->laketype);
                }
        }
@@ -685,13 +671,7 @@ static void gen_caverns_and_lakes(void)
 
                /* make a large fractal cave in the middle of the dungeon */
 
-               if (cheat_room)
-#ifdef JP
-                       msg_print("洞窟を生成。");
-#else
-                       msg_print("Cavern on level.");
-#endif
-
+               msg_print_wizard(CHEAT_DUNGEON, _("洞窟を生成。", "Cavern on level."));
                build_cavern();
        }
 #endif /* ALLOW_CAVERNS_AND_LAKES */
@@ -753,13 +733,7 @@ static bool cave_gen(void)
        if (ironman_empty_levels || ((d_info[dungeon_type].flags1 & DF1_ARENA) && (empty_levels && one_in_(EMPTY_LEVEL))))
        {
                dun->empty_level = TRUE;
-
-               if (cheat_room)
-#ifdef JP
-                       msg_print("アリーナレベル");
-#else
-                       msg_print("Arena level.");
-#endif
+               msg_print_wizard(CHEAT_DUNGEON, _("アリーナレベルを生成。", "Arena level."));
        }
 
        if (dun->empty_level)
@@ -842,7 +816,7 @@ static bool cave_gen(void)
                /* Hack -- Add some rivers */
                if (one_in_(3) && (randint1(dun_level) > 5))
                {
-                       int feat1 = 0, feat2 = 0;
+                       IDX feat1 = 0, feat2 = 0;
 
                        /* Choose water or lava */
                        if ((randint1(MAX_DEPTH * 2) - 1 > dun_level) && (d_info[dungeon_type].flags1 & DF1_WATER_RIVER))
@@ -1049,15 +1023,9 @@ static bool cave_gen(void)
                i += 1;
 
                if (i > small_tester) i = small_tester;
-               else if (cheat_hear)
-               {
-#ifdef JP
-msg_format("モンスター数基本値を %d から %d に減らします", small_tester, i);
-#else
-                       msg_format("Reduced monsters base from %d to %d", small_tester, i);
-#endif
+               else msg_format_wizard(CHEAT_DUNGEON,
+                       _("モンスター数基本値を %d から %d に減らします", "Reduced monsters base from %d to %d"), small_tester, i);
 
-               }
        }
 
        i += randint1(8);
@@ -1205,7 +1173,7 @@ static void arena_gen(void)
 
        build_arena();
 
-       if(!place_monster_aux(0, py + 5, px, arena_info[p_ptr->arena_number].r_idx, (PM_NO_KAGE | PM_NO_PET)))
+       if(!place_monster_aux(0, p_ptr->y + 5, p_ptr->x, arena_info[p_ptr->arena_number].r_idx, (PM_NO_KAGE | PM_NO_PET)))
        {
                p_ptr->exit_bldg = TRUE;
                p_ptr->arena_number++;
@@ -1287,7 +1255,8 @@ static void build_battle(void)
  */
 static void battle_gen(void)
 {
-       int y, x, i;
+       int y, x;
+       MONSTER_IDX i;
        int qy = 0;
        int qx = 0;
 
@@ -1316,11 +1285,11 @@ static void battle_gen(void)
 
        build_battle();
 
-       for(i=0;i<4;i++)
+       for(i = 0; i < 4; i++)
        {
-               place_monster_aux(0, py + 8 + (i/2)*4, px - 2 + (i%2)*4, battle_mon[i],
+               place_monster_aux(0, p_ptr->y + 8 + (i/2)*4, p_ptr->x - 2 + (i%2)*4, battle_mon[i],
                                  (PM_NO_KAGE | PM_NO_PET));
-               set_friendly(&m_list[cave[py+8+(i/2)*4][px-2+(i%2)*4].m_idx]);
+               set_friendly(&m_list[cave[p_ptr->y+8+(i/2)*4][p_ptr->x-2+(i%2)*4].m_idx]);
        }
        for(i = 1; i < m_max; i++)
        {
@@ -1384,13 +1353,6 @@ static bool level_gen(cptr *why)
            (d_info[dungeon_type].flags1 & DF1_SMALLEST)) &&
            !(d_info[dungeon_type].flags1 & DF1_BIG))
        {
-               if (cheat_room)
-#ifdef JP
-                       msg_print("小さなフロア");
-#else
-                       msg_print("A 'small' dungeon level.");
-#endif
-
                if (d_info[dungeon_type].flags1 & DF1_SMALLEST)
                {
                        level_height = 1;
@@ -1419,8 +1381,9 @@ static bool level_gen(cptr *why)
                panel_row_min = cur_hgt;
                panel_col_min = cur_wid;
 
-               if (cheat_room)
-                 msg_format("X:%d, Y:%d.", cur_wid, cur_hgt);
+               msg_format_wizard(CHEAT_DUNGEON,
+                       _("小さなフロア: X:%d, Y:%d", "A 'small' dungeon level: X:%d, Y:%d."),
+                       cur_wid, cur_hgt);
        }
        else
        {
@@ -1535,7 +1498,7 @@ void clear_cave(void)
        }
 
        /* Mega-Hack -- no player yet */
-       px = py = 0;
+       p_ptr->x = p_ptr->y = 0;
 
        /* Set the base level */
        base_level = dun_level;