Skip to content

Commit

Permalink
enlightenment feedback for sight-based properties (trunk only)
Browse files Browse the repository at this point in the history
     "You can see invisible" is misleading when you can't see anything,
so use alternate phrasing for See_invisible when blind.  Also, add extra
wizard mode feedback when blindness is overridden by the monk's Eyes
artifact, when invisibility is blocked by worn mummy wrapping, and when
clairvoyance is blocked by worn cornuthaum.  And fix end-of-game disclosure
for blindness; it was only being shown if/when caused by worn blindfold.
  • Loading branch information
nethack.rankin committed Oct 26, 2007
1 parent bdb0930 commit cac2dd4
Show file tree
Hide file tree
Showing 3 changed files with 58 additions and 16 deletions.
1 change: 1 addition & 0 deletions doc/fixes35.0
Expand Up @@ -342,6 +342,7 @@ add Roderick Schertler's pickup_thrown patch
add ability to sort the list when viewing known spells with '+' command
describe magic cancellation from worn armor in enlightment/end-of-game feedback
disclose half physical and/or spell damage in enlightment/end-of-game feedback
rephrase see invisibility enlightenment feedback when unable to see at all
add atmospheric sound messages for temples
sometimes give announcement message when monsters teleport to hero's vicinity
obsolete config file keywords: GRAPHICS, OBJECTS, TRAPS, EFFECTS
Expand Down
44 changes: 35 additions & 9 deletions src/attrib.c
Expand Up @@ -668,21 +668,25 @@ int
is_innate(propidx)
int propidx;
{
if (propidx == BLINDED && !haseyes(youmonst.data)) return 1;
return innately(&u.uprops[propidx].intrinsic);
}

char *
from_what(propidx)
int propidx;
int propidx; /* special cases can have negative values */
{
static char buf[BUFSZ];
static char buf[BUFSZ];

buf[0] = '\0';
/*
* Restrict the source of the attributes just to debug mode for now
*/
buf[0] = '\0';
/*
* Restrict the source of the attributes just to debug mode for now
*/
#ifdef WIZARD
if (wizard) {
if (wizard) {
static NEARDATA const char because_of[] = " because of %s";

if (propidx >= 0) {
struct obj *obj = (struct obj *)0;
int innate = is_innate(propidx);

Expand All @@ -691,11 +695,33 @@ int propidx;
else if (innate == 1)
Strcpy(buf, " innately");
else if (wizard && (obj = what_gives(&u.uprops[propidx].extrinsic)))
Sprintf(buf, " because of %s",
Sprintf(buf, because_of,
(obj->oartifact) ? bare_artifactname(obj) : yname(obj));
else if (propidx == BLINDED && Blindfolded_only)
Sprintf(buf, because_of, yname(ublindf));

} else { /* negative property index */
/* if more blocking capabilities get implemented we'll need to
replace this with what_blocks() comparable to what_gives() */
switch (-propidx) {
case BLINDED:
if (ublindf && ublindf->oartifact == ART_EYES_OF_THE_OVERWORLD)
Sprintf(buf, because_of, bare_artifactname(ublindf));
break;
case INVIS:
if (u.uprops[INVIS].blocked & W_ARMC)
Sprintf(buf, because_of, yname(uarmc)); /* mummy wrapping */
break;
case CLAIRVOYANT:
if (wizard && (u.uprops[CLAIRVOYANT].blocked & W_ARMH))
Sprintf(buf, because_of, yname(uarmh)); /* cornuthaum */
break;
}
}

} /*wizard*/
#endif
return buf;
return buf;
}

void
Expand Down
29 changes: 22 additions & 7 deletions src/cmd.c
Expand Up @@ -1111,7 +1111,7 @@ int final; /* 0 => still in progress; 1 => over, survived; 2 => dead */
if (Hallucination) you_are("hallucinating","");
if (Stunned) you_are("stunned","");
if (Confusion) you_are("confused","");
if (Blinded) you_are("blinded",from_what(BLINDED));
if (Blind) you_are("blind",from_what(BLINDED));
if (Deaf) you_are("deaf",from_what(DEAF));
if (Sick) {
if (u.usick_type & SICK_VOMITABLE)
Expand Down Expand Up @@ -1150,8 +1150,15 @@ int final; /* 0 => still in progress; 1 => over, survived; 2 => dead */
if (Hate_silver) you_are("harmed by silver","");

/*** Vision and senses ***/
if (See_invisible) enl_msg(You_, "see", "saw", " invisible",
from_what(SEE_INVIS));
if (!Blind && (Blinded || !haseyes(youmonst.data)))
you_can("see", from_what(-BLINDED)); /* Eyes of the Overworld */
if (See_invisible) {
if (!Blind)
enl_msg(You_, "see", "saw", " invisible", from_what(SEE_INVIS));
else
enl_msg(You_, "will see", "would have seen",
" invisible when not blind", from_what(SEE_INVIS));
}
if (Blind_telepat) you_are("telepathic",from_what(TELEPAT));
if (Warning) you_are("warned", from_what(WARNING));
if (Warn_of_mon && context.warntype.obj) {
Expand All @@ -1163,8 +1170,8 @@ int final; /* 0 => still in progress; 1 => over, survived; 2 => dead */
}
if (Warn_of_mon && context.warntype.polyd) {
Sprintf(buf, "aware of the presence of %s",
((context.warntype.polyd &
(M2_HUMAN|M2_ELF))==(M2_HUMAN|M2_ELF)) ? "humans and elves" :
((context.warntype.polyd & (M2_HUMAN|M2_ELF))
== (M2_HUMAN|M2_ELF)) ? "humans and elves" :
(context.warntype.polyd & M2_HUMAN) ? "humans" :
(context.warntype.polyd & M2_ELF) ? "elves" :
(context.warntype.polyd & M2_ORC) ? "orcs" :
Expand All @@ -1180,9 +1187,17 @@ int final; /* 0 => still in progress; 1 => over, survived; 2 => dead */
if (Undead_warning) you_are("warned of undead",from_what(WARN_UNDEAD));
if (Searching) you_have("automatic searching",from_what(SEARCHING));
if (Clairvoyant) you_are("clairvoyant",from_what(CLAIRVOYANT));
else if ((HClairvoyant || EClairvoyant) && BClairvoyant) {
Strcpy(buf, from_what(-CLAIRVOYANT));
if (!strncmp(buf, " because of ", 12))
/* overwrite substring; strncpy doesn't add terminator */
(void) strncpy(buf, " if not for ", 12);
enl_msg(You_, "could be", "could have been",
" clairvoyant", buf);
}
if (Infravision) you_have("infravision",from_what(INFRAVISION));
if (Detect_monsters)
you_are("sensing the presence of monsters", "");
you_are("sensing the presence of monsters", "");
if (u.umconf) you_are("going to confuse monsters","");

/*** Appearance and behavior ***/
Expand All @@ -1201,7 +1216,7 @@ int final; /* 0 => still in progress; 1 => over, survived; 2 => dead */
/* ordinarily "visible" is redundant; this is a special case for
the situation when invisibility would be an expected attribute */
else if ((HInvis || EInvis || pm_invisible(youmonst.data)) && BInvis)
you_are("visible","");
you_are("visible", from_what(-INVIS));
if (Displaced) you_are("displaced",from_what(DISPLACED));
if (Stealth) you_are("stealthy",from_what(STEALTH));
if (Aggravate_monster)
Expand Down

0 comments on commit cac2dd4

Please sign in to comment.