Skip to content

Commit

Permalink
github issue #890 - hobbit #chat feedback
Browse files Browse the repository at this point in the history
Issue reported by eakaye:  the alternate hobbit chat message is a
complaint about dungeon conditions, given if its current HP is 10
or more less than its maximum HP.  But since hobbits are level 1,
they will almost never have 10 HP so won't be alive to chat when
at max minus 10.

Keep the old behavior if maximum happens to be more than 10, but
give alternate feedback when less than max if max is 10 or less.

Fixes #890
  • Loading branch information
PatR committed Oct 4, 2022
1 parent 546fea7 commit 5902ace
Showing 1 changed file with 10 additions and 5 deletions.
15 changes: 10 additions & 5 deletions src/sounds.c
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
/* NetHack 3.7 sounds.c $NHDT-Date: 1600933442 2020/09/24 07:44:02 $ $NHDT-Branch: NetHack-3.7 $:$NHDT-Revision: 1.103 $ */
/* NetHack 3.7 sounds.c $NHDT-Date: 1664920994 2022/10/04 22:03:14 $ $NHDT-Branch: NetHack-3.7 $:$NHDT-Revision: 1.123 $ */
/* Copyright (c) 1989 Janet Walz, Mike Threepoint */
/* NetHack may be freely redistributed. See license for details. */

Expand Down Expand Up @@ -949,10 +949,15 @@ domonnoise(register struct monst* mtmp)
else
switch (monsndx(ptr)) {
case PM_HOBBIT:
pline_msg =
(mtmp->mhpmax - mtmp->mhp >= 10)
? "complains about unpleasant dungeon conditions."
: "asks you about the One Ring.";
/* 3.7: the 'complains' message used to be given if the
hobbit's current hit points were at 10 below max or
less, but their max is normally less than 10 so it
would almost never occur */
pline_msg = (mtmp->mhp < mtmp->mhpmax
&& (mtmp->mhpmax <= 10
|| mtmp->mhp <= mtmp->mhpmax - 10))
? "complains about unpleasant dungeon conditions."
: "asks you about the One Ring.";
break;
case PM_ARCHEOLOGIST:
pline_msg =
Expand Down

0 comments on commit 5902ace

Please sign in to comment.