OSDN Git Service

#37284 ウィザードモードの'T'コマンドによりdungeon_turn/turnの変更を可能にした。 / Implement to change value...
authorDeskull <desull@users.sourceforge.jp>
Thu, 15 Jun 2017 14:41:18 +0000 (23:41 +0900)
committerDeskull <desull@users.sourceforge.jp>
Thu, 15 Jun 2017 14:41:18 +0000 (23:41 +0900)
src/defines.h
src/wizard2.c

index 2074124..e4f7f3c 100644 (file)
@@ -53,7 +53,7 @@
 #define FAKE_VER_MAJOR 12 /*!< ゲームのバージョン番号定義(メジャー番号 + 10) */
 #define FAKE_VER_MINOR 2 /*!< ゲームのバージョン番号定義(マイナー番号) */
 #define FAKE_VER_PATCH 0 /*!< ゲームのバージョン番号定義(パッチ番号) */
-#define FAKE_VER_EXTRA 1 /*!< ゲームのバージョン番号定義(エクストラ番号) */
+#define FAKE_VER_EXTRA 2 /*!< ゲームのバージョン番号定義(エクストラ番号) */
 
 /*!
  * @brief セーブファイル上のバージョン定義(メジャー番号) / "Savefile Version Number" for Hengband 1.1.1 and later
@@ -71,7 +71,7 @@
 #define H_VER_MAJOR 2 /*!< セーブファイル上のバージョン定義(メジャー番号) */
 #define H_VER_MINOR 2 /*!< セーブファイル上のバージョン定義(マイナー番号) */
 #define H_VER_PATCH 0 /*!< セーブファイル上のバージョン定義(パッチ番号) */
-#define H_VER_EXTRA 1 /*!< セーブファイル上のバージョン定義(エクストラ番号) */
+#define H_VER_EXTRA 2 /*!< セーブファイル上のバージョン定義(エクストラ番号) */
 
 #define ANGBAND_2_8_1 /*!< Angband 2.8.1以降から有効な処理分岐を定義 */
 #define ZANGBAND /*!< Zangband 以降から有効な処理分岐を定義 */
index de18894..6447a81 100644 (file)
@@ -111,6 +111,36 @@ static bool wiz_dimension_door(void)
 
 
 /*!
+ * @brief プレイ日数を変更する / Set gametime.
+ * @return 実際に変更を行ったらTRUEを返す
+ */
+static bool set_gametime(void)
+{
+       int tmp_int = 0;
+       char ppp[80], tmp_val[40];
+
+       /* Prompt */
+       sprintf(ppp, "Dungeon Turn (0-%d): ", dungeon_turn_limit);
+
+       /* Default */
+       sprintf(tmp_val, "%d", dungeon_turn);
+
+       /* Query */
+       if (!get_string(ppp, tmp_val, 10)) return (FALSE);
+
+       /* Extract */
+       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 なし
  */
@@ -1908,10 +1938,9 @@ extern void do_cmd_debug(void);
  */
 void do_cmd_debug(void)
 {
-       int     x, y, i;
+       int     x, y;
        char    cmd;
 
-
        /* Get a "debug command" */
        get_com("Debug Command: ", &cmd, FALSE);
 
@@ -2129,6 +2158,12 @@ void do_cmd_debug(void)
                teleport_player(100, 0L);
                break;
 
+       /* Game Time Setting */
+       case 'T':
+               set_gametime();
+               break;
+
+
        /* Very Good Objects */
        case 'v':
                if (command_arg <= 0) command_arg = 1;