from_what()
Enlightenment/attribute disclosure while in wizard mode shows reasons for some of the intrinsics. This adds some more of those: innately due to polymorph for lots of things, and innately due to role for knight's jumping. (Drain_resistance from equipped item came with the 'resistance from Excalibur' patch.)
This commit is contained in:
@@ -59,6 +59,7 @@ allow optional parameter "true", "yes", "false", or "no" for boolean options
|
|||||||
actually make the castle chest not trapped
|
actually make the castle chest not trapped
|
||||||
level-drain resistance wasn't shown during enlightenment if it was conferred
|
level-drain resistance wasn't shown during enlightenment if it was conferred
|
||||||
by worn/wielded equipment
|
by worn/wielded equipment
|
||||||
|
wizard mode enlightenment now shows more reasons for various intrinsics
|
||||||
|
|
||||||
|
|
||||||
Platform- and/or Interface-Specific Fixes
|
Platform- and/or Interface-Specific Fixes
|
||||||
|
|||||||
+33
-16
@@ -1,4 +1,4 @@
|
|||||||
/* NetHack 3.6 attrib.c $NHDT-Date: 1449269911 2015/12/04 22:58:31 $ $NHDT-Branch: NetHack-3.6.0 $:$NHDT-Revision: 1.51 $ */
|
/* NetHack 3.6 attrib.c $NHDT-Date: 1451081651 2015/12/25 22:14:11 $ $NHDT-Branch: NetHack-3.6.0 $:$NHDT-Revision: 1.52 $ */
|
||||||
/* Copyright 1988, 1989, 1990, 1992, M. Stephenson */
|
/* Copyright 1988, 1989, 1990, 1992, M. Stephenson */
|
||||||
/* NetHack may be freely redistributed. See license for details. */
|
/* NetHack may be freely redistributed. See license for details. */
|
||||||
|
|
||||||
@@ -707,31 +707,46 @@ long frommask;
|
|||||||
return (struct innate *) 0;
|
return (struct innate *) 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/* reasons for innate ability */
|
||||||
* returns 1 if FROMRACE or FROMEXPER and exper level == 1
|
#define FROM_NONE 0
|
||||||
* returns 2 if FROMEXPER and exper level > 1
|
#define FROM_ROLE 1 /* from experience at level 1 */
|
||||||
* otherwise returns 0
|
#define FROM_RACE 2
|
||||||
*/
|
#define FROM_EXP 3 /* from experience for some level > 1 */
|
||||||
|
#define FROM_FORM 4
|
||||||
|
|
||||||
|
|
||||||
|
/* check whether particular ability has been obtained via innate attribute */
|
||||||
STATIC_OVL int
|
STATIC_OVL int
|
||||||
innately(ability)
|
innately(ability)
|
||||||
long *ability;
|
long *ability;
|
||||||
{
|
{
|
||||||
const struct innate *iptr;
|
const struct innate *iptr;
|
||||||
|
|
||||||
|
if ((iptr = check_innate_abil(ability, FROMEXPER)) != 0)
|
||||||
|
return (iptr->ulevel == 1) ? FROM_ROLE : FROM_EXP;
|
||||||
if ((iptr = check_innate_abil(ability, FROMRACE)) != 0)
|
if ((iptr = check_innate_abil(ability, FROMRACE)) != 0)
|
||||||
return 1;
|
return FROM_RACE;
|
||||||
else if ((iptr = check_innate_abil(ability, FROMEXPER)) != 0)
|
if ((*ability & FROMFORM) != 0L)
|
||||||
return (iptr->ulevel == 1) ? 1 : 2;
|
return FROM_FORM;
|
||||||
return 0;
|
return FROM_NONE;
|
||||||
}
|
}
|
||||||
|
|
||||||
int
|
int
|
||||||
is_innate(propidx)
|
is_innate(propidx)
|
||||||
int propidx;
|
int propidx;
|
||||||
{
|
{
|
||||||
|
int innateness = innately(&u.uprops[propidx].intrinsic);
|
||||||
|
|
||||||
|
if (innateness != FROM_NONE)
|
||||||
|
return innateness;
|
||||||
|
if (propidx == JUMPING && Role_if(PM_KNIGHT)
|
||||||
|
/* knight has intrinsic jumping, but extrinsic is more versatile so
|
||||||
|
ignore innateness if equipment is going to claim responsibility */
|
||||||
|
&& !u.uprops[propidx].extrinsic)
|
||||||
|
return FROM_ROLE;
|
||||||
if (propidx == BLINDED && !haseyes(youmonst.data))
|
if (propidx == BLINDED && !haseyes(youmonst.data))
|
||||||
return 1;
|
return FROM_FORM;
|
||||||
return innately(&u.uprops[propidx].intrinsic);
|
return FROM_NONE;
|
||||||
}
|
}
|
||||||
|
|
||||||
char *
|
char *
|
||||||
@@ -750,14 +765,16 @@ int propidx; /* special cases can have negative values */
|
|||||||
if (propidx >= 0) {
|
if (propidx >= 0) {
|
||||||
char *p;
|
char *p;
|
||||||
struct obj *obj = (struct obj *) 0;
|
struct obj *obj = (struct obj *) 0;
|
||||||
int innate = is_innate(propidx);
|
int innateness = is_innate(propidx);
|
||||||
|
|
||||||
if (innate == 2)
|
if (innateness == FROM_EXP)
|
||||||
Strcpy(buf, " because of your experience");
|
Strcpy(buf, " because of your experience");
|
||||||
else if (innate == 1)
|
else if (innateness == FROM_FORM)
|
||||||
|
Strcpy(buf, " from current creature form");
|
||||||
|
else if (innateness == FROM_ROLE || innateness == FROM_RACE)
|
||||||
Strcpy(buf, " innately");
|
Strcpy(buf, " innately");
|
||||||
else if (wizard
|
else if (wizard
|
||||||
&& (obj = what_gives(&u.uprops[propidx].extrinsic)))
|
&& (obj = what_gives(&u.uprops[propidx].extrinsic)) != 0)
|
||||||
Sprintf(buf, because_of, obj->oartifact
|
Sprintf(buf, because_of, obj->oartifact
|
||||||
? bare_artifactname(obj)
|
? bare_artifactname(obj)
|
||||||
: ysimple_name(obj));
|
: ysimple_name(obj));
|
||||||
|
|||||||
Reference in New Issue
Block a user