don't display "turns to flee" message for a mimicing mimic
dipping acid in a fountain could cause an explosion but not destroy the potion
if your blindfold glows and you're not otherwise blinded, you can see it
+added strsubst() to hacklib
+be consistent with use of "removing" rather than "lifting" for encumber
+ messages associated with taking things out of a bag of holding
Platform- and/or Interface-Specific Fixes
E boolean FDECL(onlyspace, (const char *));
E char *FDECL(tabexpand, (char *));
E char *FDECL(visctrl, (CHAR_P));
+E char *FDECL(strsubst, (char *,const char *,const char *));
E const char *FDECL(ordin, (int));
E char *FDECL(sitoa, (int));
E int FDECL(sgn, (int));
-/* SCCS Id: @(#)hacklib.c 3.4 2002/12/13 */
+/* SCCS Id: @(#)hacklib.c 3.4 2004/04/11 */
/* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */
/* Copyright (c) Robert Patrick Rankin, 1991 */
/* NetHack may be freely redistributed. See license for details. */
boolean onlyspace (const char *)
char * tabexpand (char *)
char * visctrl (char)
+ char * strsubst (char *, const char *, const char *)
const char * ordin (int)
char * sitoa (int)
int sgn (int)
return ccc;
}
+/* substitute a word or phrase in a string (in place) */
+/* caller is responsible for ensuring that bp points to big enough buffer */
+char *
+strsubst(bp, orig, replacement)
+ char *bp;
+ const char *orig, *replacement;
+{
+ char *found, buf[BUFSZ];
+
+ if (bp) {
+ found = strstr(bp, orig);
+ if (found) {
+ Strcpy(buf, found + strlen(orig));
+ Strcpy(found, replacement);
+ Strcat(bp, buf);
+ }
+ }
+ return bp;
+}
+
+
const char *
ordin(n) /* return the ordinal suffix of a number */
int n; /* note: should be non-negative */
(next_encumbr > HVY_ENCUMBER) ? overloadmsg :
(next_encumbr > MOD_ENCUMBER) ? nearloadmsg :
moderateloadmsg);
+ if (container) (void) strsubst(qbuf,"lifting","removing");
Sprintf(eos(qbuf), " %s. Continue?",
safe_qbuf(qbuf, sizeof(" . Continue?"),
doname(obj), an(simple_typename(obj->otyp)), "something"));