OSDN Git Service

#37449 (2.2.0.79) メッセージにターン数を表示する、cheat_turn オプションを実装。 / Implement cheat_turn option...
authorDeskull <desull@users.sourceforge.jp>
Sat, 2 Sep 2017 04:30:48 +0000 (13:30 +0900)
committerDeskull <desull@users.sourceforge.jp>
Sat, 2 Sep 2017 04:30:48 +0000 (13:30 +0900)
src/birth.c
src/cmd4.c
src/defines.h
src/externs.h
src/load.c
src/save.c
src/util.c
src/variable.c

index 155990d..1c4905a 100644 (file)
@@ -3363,6 +3363,8 @@ static void player_wipe_without_name(void)
        cheat_know = FALSE;
        cheat_live = FALSE;
        cheat_save = FALSE;
+       cheat_diary_output = FALSE;
+       cheat_turn = FALSE;
 
        /* Assume no winning game */
        p_ptr->total_winner = FALSE;
index 40da75a..eb8707c 100644 (file)
@@ -1387,7 +1387,7 @@ void do_cmd_messages(int num_now)
 /*!
  * チートオプションの最大数 / Number of cheating options
  */
-#define CHEAT_MAX 8
+#define CHEAT_MAX 9
 
 /*!
  * チーとオプションの定義テーブル / Cheating options
@@ -1424,6 +1424,10 @@ static option_type cheat_info[CHEAT_MAX] =
 
        { &cheat_diary_output,  FALSE,  255,    0x80, 0x00,
                "cheat_diary_output",   _("ウィザードログを日記に出力する", "Output wizard log to diary.")
+       },
+
+       { &cheat_turn,  FALSE,  255,    0x81, 0x00,
+               "cheat_turn",   _("ゲームメッセージにターン表示を行う", "Put turn to game message.")
        }
 
 
index 6bec0b7..4a1a66c 100644 (file)
  *   "(FAKE_VER_MAJOR-10).(FAKE_VER_MINOR).(FAKE_VER_PATCH)".
  * </pre>
  */
-#define FAKE_VERSION   0
+#define FAKE_VERSION 0
 
 #define FAKE_VER_MAJOR 12 /*!< ゲームのバージョン番号定義(メジャー番号 + 10) */
 #define FAKE_VER_MINOR 2 /*!< ゲームのバージョン番号定義(マイナー番号) */
 #define FAKE_VER_PATCH 0 /*!< ゲームのバージョン番号定義(パッチ番号) */
-#define FAKE_VER_EXTRA 78 /*!< ゲームのバージョン番号定義(エクストラ番号) */
+#define FAKE_VER_EXTRA 79 /*!< ゲームのバージョン番号定義(エクストラ番号) */
 
 
  /*!
index fe44c36..85a24f4 100644 (file)
@@ -382,6 +382,7 @@ extern bool cheat_know;
 extern bool cheat_live;
 extern bool cheat_save;
 extern bool cheat_diary_output;
+extern bool cheat_turn;
 
 extern char record_o_name[MAX_NLEN];
 extern s32b record_turn;
index 8e213ef..0a6ee90 100644 (file)
@@ -1437,6 +1437,7 @@ static void rd_options(void)
        cheat_live = (c & 0x2000) ? TRUE : FALSE;
        cheat_save = (c & 0x4000) ? TRUE : FALSE;
        cheat_diary_output = (c & 0x8000) ? TRUE : FALSE;
+       cheat_turn = (c & 0x0080) ? TRUE : FALSE;
 
        rd_byte((byte *)&autosave_l);
        rd_byte((byte *)&autosave_t);
index 6220870..e1987de 100644 (file)
@@ -476,6 +476,8 @@ static void wr_options(void)
 
        if (p_ptr->wizard) c |= 0x0002;
 
+       if (cheat_turn) c |= 0x0080;
+
        if (cheat_peek) c |= 0x0100;
        if (cheat_hear) c |= 0x0200;
        if (cheat_room) c |= 0x0400;
index c789df5..9cd138d 100644 (file)
@@ -2833,6 +2833,19 @@ void msg_print(cptr msg)
 
        if (world_monster) return;
 
+       /* No message */
+       if (!msg) return;
+
+       /* Copy it */
+       if(!cheat_turn)
+       {
+               strcpy(buf, msg);
+       }
+       else
+       {
+               sprintf(buf,("T:%d - %s"), turn, msg);
+       }
+
        /* Hack -- Reset */
        if (!msg_flag) {
                /* Clear the line */
@@ -2841,10 +2854,13 @@ void msg_print(cptr msg)
        }
 
        /* Message Length */
-       n = (msg ? strlen(msg) : 0);
+       n = (buf ? strlen(buf) : 0);
+
+       /* Paranoia */
+       if (n > 1000) return;
 
        /* Hack -- flush when requested or needed */
-       if (p && (!msg || ((p + n) > 72)))
+       if (p && (!buf || ((p + n) > 72)))
        {
                /* Flush */
                msg_flush(p);
@@ -2856,19 +2872,8 @@ void msg_print(cptr msg)
                p = 0;
        }
 
-       /* No message */
-       if (!msg) return;
-
-       /* Paranoia */
-       if (n > 1000) return;
-
-
        /* Memorize the message */
-       if (character_generated) message_add(msg);
-
-
-       /* Copy it */
-       strcpy(buf, msg);
+       if (character_generated) message_add(buf);
 
        /* Analyze the buffer */
        t = buf;
index 19e6fa4..544e5d4 100644 (file)
@@ -356,6 +356,7 @@ bool cheat_know;    /* Know complete monster info */
 bool cheat_live;       /* Allow player to avoid death */
 bool cheat_save;       /* Ask for saving death */
 bool cheat_diary_output; /* Detailed info to diary */
+bool cheat_turn;       /* Peek turn */
 
 
 /* Special options */