From: Pasi Kallinen Date: Sun, 15 Mar 2015 07:53:34 +0000 (+0200) Subject: Death talks in CAPITAL LETTERS X-Git-Tag: NetHack-3.6.0_RC01~603 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=3bbbb01c53d7dca5bb36cba84425374aedf945c4;p=nethack Death talks in CAPITAL LETTERS --- diff --git a/include/extern.h b/include/extern.h index f382c4f7a..0a1dabe77 100644 --- a/include/extern.h +++ b/include/extern.h @@ -800,6 +800,7 @@ E boolean FDECL(letter, (CHAR_P)); E char FDECL(highc, (CHAR_P)); E char FDECL(lowc, (CHAR_P)); E char *FDECL(lcase, (char *)); +E char *FDECL(ucase, (char *)); E char *FDECL(upstart, (char *)); E char *FDECL(mungspaces, (char *)); E char *FDECL(eos, (char *)); diff --git a/src/hacklib.c b/src/hacklib.c index 4565f6d65..fd4273074 100644 --- a/src/hacklib.c +++ b/src/hacklib.c @@ -17,6 +17,7 @@ NetHack, except that rounddiv may call panic(). char highc (char) char lowc (char) char * lcase (char *) + char * ucase (char *) char * upstart (char *) char * mungspaces (char *) char * eos (char *) @@ -99,6 +100,17 @@ lcase(s) /* convert a string into all lowercase */ return s; } +char * +ucase(s) /* convert a string into all uppercase */ + char *s; +{ + register char *p; + + for (p = s; *p; p++) + if ('a' <= *p && *p <= 'z') *p &= ~040; + return s; +} + char * upstart(s) /* convert first character of a string to uppercase */ char *s; diff --git a/src/sounds.c b/src/sounds.c index d57904778..3b2ee2f56 100644 --- a/src/sounds.c +++ b/src/sounds.c @@ -901,7 +901,15 @@ register struct monst *mtmp; if (pline_msg) pline("%s %s", Monnam(mtmp), pline_msg); else if (mtmp->mcan && verbl_msg_mcan) verbalize1(verbl_msg_mcan); - else if (verbl_msg) verbalize1(verbl_msg); + else if (verbl_msg) { + if (ptr == &mons[PM_DEATH]) { /* Death talks in CAPITAL LETTERS */ + char tmpbuf[BUFSZ]; + Sprintf(tmpbuf, "%s", verbl_msg); + verbalize1(ucase(tmpbuf)); + } else { + verbalize1(verbl_msg); + } + } return(1); }