OSDN Git Service

[Refactor] #38993 floor_type 構造体作成。 / Create floor_type structure.
[hengbandforosx/hengbandosx.git] / src / wizard2.c
index 50602f8..c4bad84 100644 (file)
 #include "spells-object.h"
 #include "spells-summon.h"
 #include "spells-status.h"
+#include "spells-world.h"
+#include "spells-floor.h"
+
+#include "object-hook.h"
 
 #ifdef ALLOW_WIZARD
 
@@ -38,30 +42,6 @@ static bool wiz_dimension_door(void)
        return (TRUE);
 }
 
-
-/*!
- * @brief プレイ日数を変更する / Set gametime.
- * @return 実際に変更を行ったらTRUEを返す
- */
-static bool set_gametime(void)
-{
-       int tmp_int = 0;
-       char ppp[80], tmp_val[40];
-
-       sprintf(ppp, "Dungeon Turn (0-%ld): ", (long)dungeon_turn_limit);
-       sprintf(tmp_val, "%ld", (long)dungeon_turn);
-       if (!get_string(ppp, tmp_val, 10)) return (FALSE);
-       tmp_int = atoi(tmp_val);
-
-       /* Verify */
-       if (tmp_int >= dungeon_turn_limit) tmp_int = dungeon_turn_limit - 1;
-       else if (tmp_int < 0) tmp_int = 0;
-       dungeon_turn = turn = tmp_int;
-       return (TRUE);
-
-}
-
-
 /*!
  * @brief 指定されたIDの固定アーティファクトを生成する / Create the artifact of the specified number
  * @return なし
@@ -86,17 +66,6 @@ static void wiz_create_named_art(void)
        msg_print("Allocated.");
 }
 
-
-/*!
- * @brief ウィザードモード用モンスター調査 / Hack -- quick debugging hook
- * @return なし
- */
-static void do_cmd_wiz_hack_ben(void)
-{
-       msg_print("Oops.");
-       (void)probing();
-}
-
 /*!
  * @brief ウィザードモード用モンスターの群れ生成 / Summon a horde of monsters
  * @return なし
@@ -1356,7 +1325,7 @@ static void do_cmd_wiz_jump(void)
                sprintf(ppp, "Jump which dungeon : ");
 
                /* Default */
-               sprintf(tmp_val, "%d", dungeon_type);
+               sprintf(tmp_val, "%d", p_ptr->dungeon_idx);
 
                /* Ask for a level */
                if (!get_string(ppp, tmp_val, 2)) return;
@@ -1377,12 +1346,12 @@ static void do_cmd_wiz_jump(void)
                /* Extract request */
                command_arg = (COMMAND_ARG)atoi(tmp_val);
 
-               dungeon_type = tmp_dungeon_type;
+               p_ptr->dungeon_idx = tmp_dungeon_type;
        }
 
        /* Paranoia */
-       if (command_arg < d_info[dungeon_type].mindepth) command_arg = 0;
-       if (command_arg > d_info[dungeon_type].maxdepth) command_arg = (COMMAND_ARG)d_info[dungeon_type].maxdepth;
+       if (command_arg < d_info[p_ptr->dungeon_idx].mindepth) command_arg = 0;
+       if (command_arg > d_info[p_ptr->dungeon_idx].maxdepth) command_arg = (COMMAND_ARG)d_info[p_ptr->dungeon_idx].maxdepth;
 
        /* Accept request */
        msg_format("You jump to dungeon level %d.", command_arg);
@@ -1394,7 +1363,7 @@ static void do_cmd_wiz_jump(void)
 
        prepare_change_floor_mode(CFM_RAND_PLACE);
 
-       if (!dun_level) dungeon_type = 0;
+       if (!dun_level) p_ptr->dungeon_idx = 0;
        p_ptr->inside_arena = FALSE;
        p_ptr->wild_mode = FALSE;
 
@@ -1573,7 +1542,7 @@ static void do_cmd_wiz_create_feature(void)
 {
        static int   prev_feat = 0;
        static int   prev_mimic = 0;
-       cave_type    *c_ptr;
+       grid_type    *g_ptr;
        feature_type *f_ptr;
        char         tmp_val[160];
        IDX          tmp_feat, tmp_mimic;
@@ -1581,7 +1550,7 @@ static void do_cmd_wiz_create_feature(void)
 
        if (!tgt_pt(&x, &y)) return;
 
-       c_ptr = &cave[y][x];
+       g_ptr = &current_floor->grid_array[y][x];
 
        /* Default */
        sprintf(tmp_val, "%d", prev_feat);
@@ -1606,15 +1575,15 @@ static void do_cmd_wiz_create_feature(void)
        else if (tmp_mimic >= max_f_idx) tmp_mimic = max_f_idx - 1;
 
        cave_set_feat(y, x, tmp_feat);
-       c_ptr->mimic = (s16b)tmp_mimic;
+       g_ptr->mimic = (s16b)tmp_mimic;
 
-       f_ptr = &f_info[get_feat_mimic(c_ptr)];
+       f_ptr = &f_info[get_feat_mimic(g_ptr)];
 
        if (have_flag(f_ptr->flags, FF_GLYPH) ||
            have_flag(f_ptr->flags, FF_MINOR_GLYPH))
-               c_ptr->info |= (CAVE_OBJECT);
+               g_ptr->info |= (CAVE_OBJECT);
        else if (have_flag(f_ptr->flags, FF_MIRROR))
-               c_ptr->info |= (CAVE_GLOW | CAVE_OBJECT);
+               g_ptr->info |= (CAVE_GLOW | CAVE_OBJECT);
 
        note_spot(y, x);
        lite_spot(y, x);
@@ -1831,7 +1800,7 @@ void do_cmd_debug(void)
 
        /* Hitpoint rerating */
        case 'h':
-               roll_hitdice(SPOP_DISPLAY_MES | SPOP_DEBUG);
+               roll_hitdice(p_ptr, SPOP_DISPLAY_MES | SPOP_DEBUG);
                break;
 
        case 'H':
@@ -1948,7 +1917,7 @@ void do_cmd_debug(void)
                {
                        for (x = 0; x < cur_wid; x++)
                        {
-                               cave[y][x].info |= (CAVE_GLOW | CAVE_MARK);
+                               current_floor->grid_array[y][x].info |= (CAVE_GLOW | CAVE_MARK);
                        }
                }
                wiz_lite(FALSE);
@@ -2005,7 +1974,7 @@ void do_cmd_debug(void)
 
        /* Hack -- whatever I desire */
        case '_':
-               do_cmd_wiz_hack_ben();
+               probing();
                break;
 
        /* For temporary test. */
@@ -2097,8 +2066,8 @@ void cheat_death(player_type *creature_ptr)
        creature_ptr->inside_battle = FALSE;
        leaving_quest = 0;
        creature_ptr->inside_quest = 0;
-       if (dungeon_type) creature_ptr->recall_dungeon = dungeon_type;
-       dungeon_type = 0;
+       if (p_ptr->dungeon_idx) creature_ptr->recall_dungeon = p_ptr->dungeon_idx;
+       p_ptr->dungeon_idx = 0;
        if (lite_town || vanilla_town)
        {
                creature_ptr->wilderness_y = 1;