From d0c5f087f71d711003b997aaa5524ac31c590abb Mon Sep 17 00:00:00 2001 From: Deskull Date: Sat, 2 Sep 2017 13:30:48 +0900 Subject: [PATCH] =?utf8?q?#37449=20(2.2.0.79)=20=E3=83=A1=E3=83=83?= =?utf8?q?=E3=82=BB=E3=83=BC=E3=82=B8=E3=81=AB=E3=82=BF=E3=83=BC=E3=83=B3?= =?utf8?q?=E6=95=B0=E3=82=92=E8=A1=A8=E7=A4=BA=E3=81=99=E3=82=8B=E3=80=81c?= =?utf8?q?heat=5Fturn=20=E3=82=AA=E3=83=97=E3=82=B7=E3=83=A7=E3=83=B3?= =?utf8?q?=E3=82=92=E5=AE=9F=E8=A3=85=E3=80=82=20/=20Implement=20cheat=5Ft?= =?utf8?q?urn=20option=20that=20print=20turn=20number=20always.?= MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit --- src/birth.c | 2 ++ src/cmd4.c | 6 +++++- src/defines.h | 4 ++-- src/externs.h | 1 + src/load.c | 1 + src/save.c | 2 ++ src/util.c | 33 +++++++++++++++++++-------------- src/variable.c | 1 + 8 files changed, 33 insertions(+), 17 deletions(-) diff --git a/src/birth.c b/src/birth.c index 155990dc3..1c4905a91 100644 --- a/src/birth.c +++ b/src/birth.c @@ -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; diff --git a/src/cmd4.c b/src/cmd4.c index 40da75acf..eb8707c43 100644 --- a/src/cmd4.c +++ b/src/cmd4.c @@ -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.") } diff --git a/src/defines.h b/src/defines.h index 6bec0b7af..4a1a66c12 100644 --- a/src/defines.h +++ b/src/defines.h @@ -48,12 +48,12 @@ * "(FAKE_VER_MAJOR-10).(FAKE_VER_MINOR).(FAKE_VER_PATCH)". * */ -#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 /*!< ゲームのバージョン番号定義(エクストラ番号) */ /*! diff --git a/src/externs.h b/src/externs.h index fe44c3609..85a24f416 100644 --- a/src/externs.h +++ b/src/externs.h @@ -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; diff --git a/src/load.c b/src/load.c index 8e213eff9..0a6ee908d 100644 --- a/src/load.c +++ b/src/load.c @@ -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); diff --git a/src/save.c b/src/save.c index 622087098..e1987de2d 100644 --- a/src/save.c +++ b/src/save.c @@ -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; diff --git a/src/util.c b/src/util.c index c789df535..9cd138de0 100644 --- a/src/util.c +++ b/src/util.c @@ -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; diff --git a/src/variable.c b/src/variable.c index 19e6fa4e4..544e5d406 100644 --- a/src/variable.c +++ b/src/variable.c @@ -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 */ -- 2.11.0