Skip to content

Commit 4eb0592

Browse files
author
PatR
committed
sickness countdown
Give messages when sickness countdown has nearly expired to warn player that hero is dying and also so that death at the end doesn't seem so abrupt after an arbitrary period with just "TermIll" and/or "FoodPois" on the status line. Also, abuse constitution each turn when Sick (either variation, but not a double amount if both).
1 parent 75fe21d commit 4eb0592

File tree

2 files changed

+36
-0
lines changed

2 files changed

+36
-0
lines changed

doc/fixes37.0

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1299,6 +1299,8 @@ decaying globs of {ooze,pudding,slime} shrink over time based on their total
12991299
poisoning effect when eaten
13001300
track peak maximum HP and peak maximum energy/power; no noticeable effect
13011301
give some dragon armor extra effects when worn
1302+
issue messages during last stage of food poisoning/terminal illness countdown
1303+
when hero's demise is imminent
13021304

13031305

13041306
Platform- and/or Interface-Specific New Features

src/timeout.c

Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@ static void choke_dialogue(void);
1111
static void levitation_dialogue(void);
1212
static void slime_dialogue(void);
1313
static void slimed_to_death(struct kinfo *);
14+
static void sickness_dialogue(void);
1415
static void phaze_dialogue(void);
1516
static void done_timeout(int, int);
1617
static void slip_or_trip(void);
@@ -278,6 +279,37 @@ choke_dialogue(void)
278279
exercise(A_STR, FALSE);
279280
}
280281

282+
static NEARDATA const char *const sickness_texts[] = {
283+
"Your illness feels worse.",
284+
"Your illness is severe.",
285+
"You are at Death's door.",
286+
};
287+
288+
static void
289+
sickness_dialogue(void)
290+
{
291+
long j = (Sick & TIMEOUT), i = j / 2L;
292+
293+
if (i > 0L && i <= SIZE(sickness_texts) && (j % 2) != 0) {
294+
char buf[BUFSZ], pronounbuf[40];
295+
296+
Strcpy(buf, sickness_texts[SIZE(sickness_texts) - i]);
297+
/* change the message slightly for food poisoning */
298+
if ((u.usick_type & SICK_NONVOMITABLE) == 0)
299+
(void) strsubst(buf, "illness", "sickness");
300+
if (Hallucination && strstri(buf, "Death's door")) {
301+
/* youmonst: for Hallucination, mhe()'s mon argument isn't used */
302+
Strcpy(pronounbuf, mhe(&g.youmonst));
303+
Sprintf(eos(buf), " %s %s inviting you in.",
304+
/* upstart() modifies its argument but vtense() doesn't
305+
care whether or not that has already happened */
306+
upstart(pronounbuf), vtense(pronounbuf, "are"));
307+
}
308+
urgent_pline("%s", buf);
309+
}
310+
exercise(A_CON, FALSE);
311+
}
312+
281313
static NEARDATA const char *const levi_texts[] = {
282314
"You float slightly lower.",
283315
"You wobble unsteadily %s the %s."
@@ -530,6 +562,8 @@ nh_timeout(void)
530562
vomiting_dialogue();
531563
if (Strangled)
532564
choke_dialogue();
565+
if (Sick)
566+
sickness_dialogue();
533567
if (HLevitation & TIMEOUT)
534568
levitation_dialogue();
535569
if (HPasses_walls & TIMEOUT)

0 commit comments

Comments
 (0)