Skip to content

Commit

Permalink
Warn the player that invisibility is about to time out
Browse files Browse the repository at this point in the history
  • Loading branch information
Nephi Allred authored and copperwater committed Mar 21, 2024
1 parent 47283fa commit 83d6fbb
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 0 deletions.
2 changes: 2 additions & 0 deletions doc/xnh-changelog-9.0.md
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,8 @@ changes:
- When you #chat and are next to only one observable monster, you will
automatically attempt to chat to that monster without being prompted for a
direction to chat in.
- When you are a few turns from temporary invisibility expiring, you receive a
message warning you that you're becoming visible again.

### Architectural changes

20 changes: 20 additions & 0 deletions src/timeout.c
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ static void stoned_dialogue(void);
static void vomiting_dialogue(void);
static void choke_dialogue(void);
static void levitation_dialogue(void);
static void reappear_dialogue(void);
static void slime_dialogue(void);
static void slimed_to_death(struct kinfo *);
static void sickness_dialogue(void);
Expand Down Expand Up @@ -388,6 +389,23 @@ levitation_dialogue(void)
}
}

static void
reappear_dialogue(void)
{
if (EInvis)
return;

if ((HInvis & TIMEOUT) == 5) {
if (Hallucination) {
You("are starting to get less clarified.");
} else if (See_invisible) {
You("are beginning to unfade.");
} else {
Your("outline is starting to become visible.");
}
}
}

static NEARDATA const char *const slime_texts[] = {
"You are turning a little %s.", /* 5 */
"Your limbs are getting oozy.", /* 4 */
Expand Down Expand Up @@ -587,6 +605,8 @@ nh_timeout(void)
else if (u.uluck < baseluck && (nostone || time_luck > 0))
u.uluck++;
}
if (HInvis & TIMEOUT)
reappear_dialogue();
if (u.uinvulnerable)
return; /* things past this point could kill you */
if (Stoned)
Expand Down

0 comments on commit 83d6fbb

Please sign in to comment.