From 5b5e5477913eaa73ad1e47bdc0b610c8a32a5c5f Mon Sep 17 00:00:00 2001 From: Pasi Kallinen Date: Thu, 21 Dec 2023 09:41:47 +0200 Subject: [PATCH] Restful sleep gives a warning message --- doc/fixes3-7-0.txt | 1 + src/timeout.c | 12 ++++++++++++ 2 files changed, 13 insertions(+) diff --git a/doc/fixes3-7-0.txt b/doc/fixes3-7-0.txt index d061364e4..06de24736 100644 --- a/doc/fixes3-7-0.txt +++ b/doc/fixes3-7-0.txt @@ -324,6 +324,7 @@ hero poly'd into rust monster could implicitly eat bars when adjacent by can explicitly eat them via 'e' after moving onto their spot monster hiding under an egg that hatched was kept hidden restful sleep regenerates hit points +restful sleep gives a warning message few turns before you fall asleep attacking non-adjacent concealed mimic by applying a polearm would make the hero be stuck to that mimic hero could break a wand ("raising the wand high over your head, you break it diff --git a/src/timeout.c b/src/timeout.c index 1f9bc5326..24966f8f9 100644 --- a/src/timeout.c +++ b/src/timeout.c @@ -7,6 +7,7 @@ static void stoned_dialogue(void); static void vomiting_dialogue(void); +static void sleep_dialogue(void); static void choke_dialogue(void); static void levitation_dialogue(void); static void slime_dialogue(void); @@ -258,6 +259,15 @@ vomiting_dialogue(void) exercise(A_CON, FALSE); } +static void +sleep_dialogue(void) +{ + long i = (HSleepy & TIMEOUT); + + if (i == 4) + You("yawn."); +} + DISABLE_WARNING_FORMAT_NONLITERAL /* RESTORE is after slime_dialogue */ static NEARDATA const char *const choke_texts[] = { @@ -590,6 +600,8 @@ nh_timeout(void) levitation_dialogue(); if (HPasses_walls & TIMEOUT) phaze_dialogue(); + if (HSleepy & TIMEOUT) + sleep_dialogue(); if (u.mtimedone && !--u.mtimedone) { if (Unchanging) u.mtimedone = rnd(100 * gy.youmonst.data->mlevel + 1);