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).
This commit is contained in:
PatR
2021-12-22 19:36:52 -08:00
parent 75fe21d00f
commit 4eb0592959
2 changed files with 36 additions and 0 deletions

View File

@@ -1299,6 +1299,8 @@ decaying globs of {ooze,pudding,slime} shrink over time based on their total
poisoning effect when eaten
track peak maximum HP and peak maximum energy/power; no noticeable effect
give some dragon armor extra effects when worn
issue messages during last stage of food poisoning/terminal illness countdown
when hero's demise is imminent
Platform- and/or Interface-Specific New Features

View File

@@ -11,6 +11,7 @@ static void choke_dialogue(void);
static void levitation_dialogue(void);
static void slime_dialogue(void);
static void slimed_to_death(struct kinfo *);
static void sickness_dialogue(void);
static void phaze_dialogue(void);
static void done_timeout(int, int);
static void slip_or_trip(void);
@@ -278,6 +279,37 @@ choke_dialogue(void)
exercise(A_STR, FALSE);
}
static NEARDATA const char *const sickness_texts[] = {
"Your illness feels worse.",
"Your illness is severe.",
"You are at Death's door.",
};
static void
sickness_dialogue(void)
{
long j = (Sick & TIMEOUT), i = j / 2L;
if (i > 0L && i <= SIZE(sickness_texts) && (j % 2) != 0) {
char buf[BUFSZ], pronounbuf[40];
Strcpy(buf, sickness_texts[SIZE(sickness_texts) - i]);
/* change the message slightly for food poisoning */
if ((u.usick_type & SICK_NONVOMITABLE) == 0)
(void) strsubst(buf, "illness", "sickness");
if (Hallucination && strstri(buf, "Death's door")) {
/* youmonst: for Hallucination, mhe()'s mon argument isn't used */
Strcpy(pronounbuf, mhe(&g.youmonst));
Sprintf(eos(buf), " %s %s inviting you in.",
/* upstart() modifies its argument but vtense() doesn't
care whether or not that has already happened */
upstart(pronounbuf), vtense(pronounbuf, "are"));
}
urgent_pline("%s", buf);
}
exercise(A_CON, FALSE);
}
static NEARDATA const char *const levi_texts[] = {
"You float slightly lower.",
"You wobble unsteadily %s the %s."
@@ -530,6 +562,8 @@ nh_timeout(void)
vomiting_dialogue();
if (Strangled)
choke_dialogue();
if (Sick)
sickness_dialogue();
if (HLevitation & TIMEOUT)
levitation_dialogue();
if (HPasses_walls & TIMEOUT)