From 9efac12d9e016cccc4916006c6b64775f5bb5fb1 Mon Sep 17 00:00:00 2001 From: Hourier Date: Wed, 22 Apr 2020 00:05:34 +0900 Subject: [PATCH] =?utf8?q?[Refactor]=20#40236=20=E3=82=A2=E3=83=B3?= =?utf8?q?=E3=83=87=E3=83=83=E3=83=89=E7=A8=AE=E6=97=8F=E3=81=A7=E5=AE=BF?= =?utf8?q?=E5=B1=8B=E3=81=AB=E6=B3=8A=E3=81=BE=E3=81=A3=E3=81=9F=E5=A0=B4?= =?utf8?q?=E5=90=88=E3=81=AE=E3=83=A1=E3=83=83=E3=82=BB=E3=83=BC=E3=82=B8?= =?utf8?q?=E3=82=92=E6=8B=A1=E5=BC=B5=E3=81=97=E3=81=9F=20(=E6=97=A5?= =?utf8?q?=E6=9C=AC=E8=AA=9E=E3=81=AE=E3=81=BF)?= MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit --- src/cmd/cmd-inn.c | 28 +++++++++++++++++++--------- 1 file changed, 19 insertions(+), 9 deletions(-) diff --git a/src/cmd/cmd-inn.c b/src/cmd/cmd-inn.c index 64ddc2294..46f67f6b3 100644 --- a/src/cmd/cmd-inn.c +++ b/src/cmd/cmd-inn.c @@ -42,6 +42,16 @@ static bool is_healthy_stay(player_type *customer_ptr) } +static bool is_player_undead(player_type *customer_ptr) +{ + bool is_player_undead = PRACE_IS_(customer_ptr, RACE_SKELETON) || + PRACE_IS_(customer_ptr, RACE_ZOMBIE) || + PRACE_IS_(customer_ptr, RACE_VAMPIRE) || + PRACE_IS_(customer_ptr, RACE_SPECTRE); + return is_player_undead; +} + + /*! * @brief 宿屋に泊まったことを日記に残す * @param customer_ptr プレーヤーへの参照ポインタ @@ -50,18 +60,14 @@ static bool is_healthy_stay(player_type *customer_ptr) */ static void write_diary_stay_inn(player_type *customer_ptr, int prev_hour) { - bool is_player_undead = PRACE_IS_(customer_ptr, RACE_SKELETON) || - PRACE_IS_(customer_ptr, RACE_ZOMBIE) || - PRACE_IS_(customer_ptr, RACE_VAMPIRE) || - PRACE_IS_(customer_ptr, RACE_SPECTRE); if ((prev_hour >= 6) && (prev_hour < 18)) { - concptr stay_message_jp = is_player_undead ? "宿屋に泊まった" : "日が暮れるまで宿屋で過ごした"; + concptr stay_message_jp = is_player_undead(customer_ptr) ? "宿屋に泊まった。" : "日が暮れるまで宿屋で過ごした。"; exe_write_diary(customer_ptr, DIARY_DESCRIPTION, 0, _(stay_message_jp, "stayed during the day at the inn.")); return; } - concptr stay_message_jp = is_player_undead ? "夜が明けるまで宿屋で過ごした" : "宿屋に泊まった"; + concptr stay_message_jp = is_player_undead(customer_ptr) ? "夜が明けるまで宿屋で過ごした。" : "宿屋に泊まった。"; exe_write_diary(customer_ptr, DIARY_DESCRIPTION, 0, _(stay_message_jp, "stayed overnight at the inn.")); } @@ -156,13 +162,17 @@ static void display_stay_result(player_type *customer_ptr, int prev_hour) { if ((prev_hour >= 6) && (prev_hour < 18)) { - msg_print(_("あなたはリフレッシュして目覚め、夕方を迎えた。", "You awake refreshed for the evening.")); - exe_write_diary(customer_ptr, DIARY_DESCRIPTION, 0, _("夕方を迎えた。", "awoke refreshed.")); + char refresh_message_jp[50]; + sprintf(refresh_message_jp, "%s%s%s", "あなたはリフレッシュして目覚め、", is_player_undead(customer_ptr) ? "夜" : "夕方", "を迎えた。"); + msg_print(_(refresh_message_jp, "You awake refreshed for the evening.")); + concptr awake_message_jp = is_player_undead(customer_ptr) ? "すがすがしい夜を迎えた。" : "夕方を迎えた。"; + exe_write_diary(customer_ptr, DIARY_DESCRIPTION, 0, _(awake_message_jp, "awoke refreshed.")); return; } msg_print(_("あなたはリフレッシュして目覚め、新たな日を迎えた。", "You awake refreshed for the new day.")); - exe_write_diary(customer_ptr, DIARY_DESCRIPTION, 0, _("すがすがしい朝を迎えた。", "awoke refreshed.")); + concptr awake_message_jp = is_player_undead(customer_ptr) ? "すがすがしい朝を迎えた。" : "朝を迎えた。"; + exe_write_diary(customer_ptr, DIARY_DESCRIPTION, 0, _(awake_message_jp, "awoke refreshed.")); } -- 2.11.0