enlightenment
Give more information about your attributes in debug mode via Control-X. I'd like to see some way of getting bits of this info to the player during the game (from the Oracle or something), but this patch keeps it limited to debug mode.
This commit is contained in:
@@ -105,6 +105,7 @@ extend Warning to include ice danger
|
|||||||
wishing for particular variety of tin contents (deep fried, broiled, etc.)
|
wishing for particular variety of tin contents (deep fried, broiled, etc.)
|
||||||
debug-mode wishing for random monster(s) via '*'
|
debug-mode wishing for random monster(s) via '*'
|
||||||
health-food store that stocks monk-appropriate foods in mine town when monk
|
health-food store that stocks monk-appropriate foods in mine town when monk
|
||||||
|
give more information about your attributes in debug mode
|
||||||
|
|
||||||
|
|
||||||
Platform- and/or Interface-Specific New Features
|
Platform- and/or Interface-Specific New Features
|
||||||
|
|||||||
@@ -81,6 +81,7 @@ E boolean FDECL(artifact_light, (struct obj *));
|
|||||||
E long FDECL(spec_m2, (struct obj *));
|
E long FDECL(spec_m2, (struct obj *));
|
||||||
E boolean FDECL(artifact_has_invprop, (struct obj *,UCHAR_P));
|
E boolean FDECL(artifact_has_invprop, (struct obj *,UCHAR_P));
|
||||||
E long FDECL(arti_cost, (struct obj *));
|
E long FDECL(arti_cost, (struct obj *));
|
||||||
|
E struct obj *FDECL(what_gives, (long *));
|
||||||
|
|
||||||
/* ### attrib.c ### */
|
/* ### attrib.c ### */
|
||||||
|
|
||||||
@@ -102,6 +103,8 @@ E int NDECL(newhp);
|
|||||||
E schar FDECL(acurr, (int));
|
E schar FDECL(acurr, (int));
|
||||||
E schar NDECL(acurrstr);
|
E schar NDECL(acurrstr);
|
||||||
E void FDECL(adjalign, (int));
|
E void FDECL(adjalign, (int));
|
||||||
|
E int FDECL(is_innate, (int));
|
||||||
|
E char *FDECL(from_what, (int));
|
||||||
|
|
||||||
/* ### ball.c ### */
|
/* ### ball.c ### */
|
||||||
|
|
||||||
@@ -1430,6 +1433,7 @@ E struct obj *FDECL(readobjnam, (char *,struct obj *,BOOLEAN_P));
|
|||||||
E int FDECL(rnd_class, (int,int));
|
E int FDECL(rnd_class, (int,int));
|
||||||
E const char *FDECL(cloak_simple_name, (struct obj *));
|
E const char *FDECL(cloak_simple_name, (struct obj *));
|
||||||
E const char *FDECL(mimic_obj_name, (struct monst *));
|
E const char *FDECL(mimic_obj_name, (struct monst *));
|
||||||
|
E char *FDECL(bare_artifactname, (struct obj *));
|
||||||
|
|
||||||
/* ### options.c ### */
|
/* ### options.c ### */
|
||||||
|
|
||||||
|
|||||||
102
src/artifact.c
102
src/artifact.c
@@ -22,6 +22,9 @@ STATIC_DCL int FDECL(spec_applies, (const struct artifact *,struct monst *));
|
|||||||
STATIC_DCL int FDECL(arti_invoke, (struct obj*));
|
STATIC_DCL int FDECL(arti_invoke, (struct obj*));
|
||||||
STATIC_DCL boolean FDECL(Mb_hit, (struct monst *magr,struct monst *mdef,
|
STATIC_DCL boolean FDECL(Mb_hit, (struct monst *magr,struct monst *mdef,
|
||||||
struct obj *,int *,int,BOOLEAN_P,char *));
|
struct obj *,int *,int,BOOLEAN_P,char *));
|
||||||
|
STATIC_DCL unsigned long FDECL(abil_to_spfx, (long *));
|
||||||
|
STATIC_DCL uchar FDECL(abil_to_adtyp,(long *));
|
||||||
|
|
||||||
|
|
||||||
/* The amount added to the victim's total hit points to insure that the
|
/* The amount added to the victim's total hit points to insure that the
|
||||||
victim will be killed even after damage bonus/penalty adjustments.
|
victim will be killed even after damage bonus/penalty adjustments.
|
||||||
@@ -1436,4 +1439,103 @@ struct obj *otmp;
|
|||||||
return (100L * (long)objects[otmp->otyp].oc_cost);
|
return (100L * (long)objects[otmp->otyp].oc_cost);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
STATIC_OVL uchar
|
||||||
|
abil_to_adtyp(abil)
|
||||||
|
long *abil;
|
||||||
|
{
|
||||||
|
struct abil2adtyp_tag {
|
||||||
|
long *abil;
|
||||||
|
uchar adtyp;
|
||||||
|
} abil2adtyp[] = {
|
||||||
|
{&EFire_resistance, AD_FIRE},
|
||||||
|
{&ECold_resistance, AD_COLD},
|
||||||
|
{&EShock_resistance, AD_ELEC},
|
||||||
|
{&EAntimagic, AD_MAGM},
|
||||||
|
{&EDisint_resistance, AD_DISN},
|
||||||
|
{&EPoison_resistance, AD_DRST},
|
||||||
|
};
|
||||||
|
int k;
|
||||||
|
long adtyp = 0;
|
||||||
|
|
||||||
|
for (k = 0; k < SIZE(abil2adtyp); k++) {
|
||||||
|
if (abil2adtyp[k].abil == abil)
|
||||||
|
return abil2adtyp[k].adtyp;
|
||||||
|
}
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
STATIC_OVL unsigned long
|
||||||
|
abil_to_spfx(abil)
|
||||||
|
long *abil;
|
||||||
|
{
|
||||||
|
struct abil2spfx_tag {
|
||||||
|
long *abil;
|
||||||
|
unsigned long spfx;
|
||||||
|
} abil2spfx[] = {
|
||||||
|
{&ESearching, SPFX_SEARCH},
|
||||||
|
{&EHalluc_resistance, SPFX_HALRES},
|
||||||
|
{&ETelepat, SPFX_ESP},
|
||||||
|
{&EStealth, SPFX_STLTH},
|
||||||
|
{&ERegeneration, SPFX_REGEN},
|
||||||
|
{&ETeleport_control, SPFX_TCTRL},
|
||||||
|
{&EWarn_of_mon, SPFX_WARN},
|
||||||
|
{&EWarning, SPFX_WARN},
|
||||||
|
{&EEnergy_regeneration, SPFX_EREGEN},
|
||||||
|
{&EHalf_spell_damage, SPFX_HSPDAM},
|
||||||
|
{&EHalf_physical_damage, SPFX_HPHDAM},
|
||||||
|
{&EReflecting, SPFX_REFLECT},
|
||||||
|
};
|
||||||
|
int k;
|
||||||
|
long spfx = 0L;
|
||||||
|
|
||||||
|
for (k = 0; k < SIZE(abil2spfx); k++) {
|
||||||
|
if (abil2spfx[k].abil == abil)
|
||||||
|
return abil2spfx[k].spfx;
|
||||||
|
}
|
||||||
|
return 0L;
|
||||||
|
}
|
||||||
|
|
||||||
|
/*
|
||||||
|
* Return the first item that is conveying a particular intrinsic.
|
||||||
|
*/
|
||||||
|
|
||||||
|
struct obj *
|
||||||
|
what_gives(abil)
|
||||||
|
long *abil;
|
||||||
|
{
|
||||||
|
struct obj *obj;
|
||||||
|
uchar dtyp;
|
||||||
|
unsigned long spfx;
|
||||||
|
long wornbits;
|
||||||
|
long wornmask = (W_ARM | W_ARMC | W_ARMH | W_ARMS | W_ARMG | W_ARMF |
|
||||||
|
W_WEP | W_QUIVER | W_SWAPWEP | W_ART | W_ARTI | W_AMUL |
|
||||||
|
W_RINGL | W_RINGR | W_TOOL | W_SADDLE | W_BALL | W_CHAIN
|
||||||
|
#ifdef TOURIST
|
||||||
|
| W_ARMU
|
||||||
|
#endif
|
||||||
|
);
|
||||||
|
|
||||||
|
dtyp = abil_to_adtyp(abil);
|
||||||
|
spfx = abil_to_spfx(abil);
|
||||||
|
wornbits = (wornmask & *abil);
|
||||||
|
|
||||||
|
for(obj = invent; obj; obj = obj->nobj) {
|
||||||
|
if(obj->oartifact) {
|
||||||
|
register const struct artifact *art = get_artifact(obj);
|
||||||
|
if (art) {
|
||||||
|
if (dtyp &&
|
||||||
|
(art->cary.adtyp == dtyp || art->defn.adtyp == dtyp))
|
||||||
|
return obj;
|
||||||
|
if (spfx && ((art->cspfx & spfx) == spfx ||
|
||||||
|
(art->spfx &spfx) == spfx))
|
||||||
|
return obj;
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
if (wornbits == (wornmask & obj->owornmask))
|
||||||
|
return obj;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return (struct obj *)0;
|
||||||
|
}
|
||||||
/*artifact.c*/
|
/*artifact.c*/
|
||||||
|
|
||||||
|
|||||||
97
src/attrib.c
97
src/attrib.c
@@ -97,6 +97,8 @@ const struct innate {
|
|||||||
|
|
||||||
STATIC_DCL void NDECL(exerper);
|
STATIC_DCL void NDECL(exerper);
|
||||||
STATIC_DCL void FDECL(postadjabil, (long *));
|
STATIC_DCL void FDECL(postadjabil, (long *));
|
||||||
|
STATIC_DCL const struct innate *FDECL(check_innate_abil,(long *, long));
|
||||||
|
STATIC_DCL int FDECL(innately, (long *));
|
||||||
|
|
||||||
/* adjust an attribute; return TRUE if change is made, FALSE otherwise */
|
/* adjust an attribute; return TRUE if change is made, FALSE otherwise */
|
||||||
boolean
|
boolean
|
||||||
@@ -600,6 +602,101 @@ long *ability;
|
|||||||
see_monsters();
|
see_monsters();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
STATIC_OVL const struct innate *
|
||||||
|
check_innate_abil(ability, frommask)
|
||||||
|
long *ability;
|
||||||
|
long frommask;
|
||||||
|
{
|
||||||
|
const struct innate *abil;
|
||||||
|
|
||||||
|
if (frommask == FROMEXPER)
|
||||||
|
switch (Role_switch) {
|
||||||
|
case PM_ARCHEOLOGIST: abil = arc_abil; break;
|
||||||
|
case PM_BARBARIAN: abil = bar_abil; break;
|
||||||
|
case PM_CAVEMAN: abil = cav_abil; break;
|
||||||
|
case PM_HEALER: abil = hea_abil; break;
|
||||||
|
case PM_KNIGHT: abil = kni_abil; break;
|
||||||
|
case PM_MONK: abil = mon_abil; break;
|
||||||
|
case PM_PRIEST: abil = pri_abil; break;
|
||||||
|
case PM_RANGER: abil = ran_abil; break;
|
||||||
|
case PM_ROGUE: abil = rog_abil; break;
|
||||||
|
case PM_SAMURAI: abil = sam_abil; break;
|
||||||
|
#ifdef TOURIST
|
||||||
|
case PM_TOURIST: abil = tou_abil; break;
|
||||||
|
#endif
|
||||||
|
case PM_VALKYRIE: abil = val_abil; break;
|
||||||
|
case PM_WIZARD: abil = wiz_abil; break;
|
||||||
|
default: abil = 0; break;
|
||||||
|
}
|
||||||
|
else if (frommask == FROMRACE)
|
||||||
|
switch (Race_switch) {
|
||||||
|
case PM_ELF: abil = elf_abil; break;
|
||||||
|
case PM_ORC: abil = orc_abil; break;
|
||||||
|
case PM_HUMAN:
|
||||||
|
case PM_DWARF:
|
||||||
|
case PM_GNOME:
|
||||||
|
default: abil = 0; break;
|
||||||
|
}
|
||||||
|
|
||||||
|
while (abil && abil->ability) {
|
||||||
|
if((abil->ability == ability) && (u.ulevel >= abil->ulevel))
|
||||||
|
return abil;
|
||||||
|
abil++;
|
||||||
|
}
|
||||||
|
return (struct innate *)0;
|
||||||
|
}
|
||||||
|
|
||||||
|
/*
|
||||||
|
* returns 1 if FROMRACE or FROMEXPER and exper level == 1
|
||||||
|
* returns 2 if FROMEXPER and exper level > 1
|
||||||
|
* otherwise returns 0
|
||||||
|
*/
|
||||||
|
STATIC_OVL int
|
||||||
|
innately(ability)
|
||||||
|
long *ability;
|
||||||
|
{
|
||||||
|
const struct innate *iptr;
|
||||||
|
if ((iptr=check_innate_abil(ability, FROMRACE)))
|
||||||
|
return 1;
|
||||||
|
else if ((iptr=check_innate_abil(ability, FROMEXPER))) {
|
||||||
|
if (iptr->ulevel == 1) return 1;
|
||||||
|
return 2;
|
||||||
|
}
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
int
|
||||||
|
is_innate(propidx)
|
||||||
|
int propidx;
|
||||||
|
{
|
||||||
|
return innately(&u.uprops[propidx].intrinsic);
|
||||||
|
}
|
||||||
|
|
||||||
|
char *
|
||||||
|
from_what(propidx)
|
||||||
|
int propidx;
|
||||||
|
{
|
||||||
|
struct obj *obj = (struct obj *)0;
|
||||||
|
static char buf[BUFSZ];
|
||||||
|
|
||||||
|
buf[0] = '\0';
|
||||||
|
/*
|
||||||
|
* Restrict the source of the attributes just to debug mode for now
|
||||||
|
*/
|
||||||
|
#ifdef WIZARD
|
||||||
|
if (wizard) {
|
||||||
|
if (is_innate(propidx) == 2)
|
||||||
|
Strcpy(buf, " because of your experience");
|
||||||
|
else if (is_innate(propidx) == 1)
|
||||||
|
Strcpy(buf, " innately");
|
||||||
|
else if (wizard && (obj = what_gives(&u.uprops[propidx].extrinsic)))
|
||||||
|
Sprintf(buf, " because of %s",
|
||||||
|
(obj->oartifact) ? bare_artifactname(obj) : yname(obj));
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
return buf;
|
||||||
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
adjabil(oldlevel,newlevel)
|
adjabil(oldlevel,newlevel)
|
||||||
int oldlevel, newlevel;
|
int oldlevel, newlevel;
|
||||||
|
|||||||
244
src/cmd.c
244
src/cmd.c
@@ -145,7 +145,7 @@ STATIC_PTR int NDECL(doattributes);
|
|||||||
STATIC_PTR int NDECL(doconduct); /**/
|
STATIC_PTR int NDECL(doconduct); /**/
|
||||||
STATIC_PTR boolean NDECL(minimal_enlightenment);
|
STATIC_PTR boolean NDECL(minimal_enlightenment);
|
||||||
|
|
||||||
STATIC_DCL void FDECL(enlght_line, (const char *,const char *,const char *));
|
STATIC_DCL void FDECL(enlght_line, (const char *,const char *,const char *,char *));
|
||||||
STATIC_DCL char *FDECL(enlght_combatinc, (const char *,int,int,char *));
|
STATIC_DCL char *FDECL(enlght_combatinc, (const char *,int,int,char *));
|
||||||
#if defined(UNIX) || defined(SAFERHANGUP)
|
#if defined(UNIX) || defined(SAFERHANGUP)
|
||||||
static void NDECL(end_of_input);
|
static void NDECL(end_of_input);
|
||||||
@@ -811,22 +811,23 @@ static const char
|
|||||||
have_been[] = "have been ",
|
have_been[] = "have been ",
|
||||||
have_never[] = "have never ", never[] = "never ";
|
have_never[] = "have never ", never[] = "never ";
|
||||||
|
|
||||||
#define enl_msg(prefix,present,past,suffix) \
|
#define enl_msg(prefix,present,past,suffix,ps) \
|
||||||
enlght_line(prefix, final ? past : present, suffix)
|
enlght_line(prefix, final ? past : present, suffix, ps)
|
||||||
#define you_are(attr) enl_msg(You_,are,were,attr)
|
#define you_are(attr,ps) enl_msg(You_,are,were,attr,ps)
|
||||||
#define you_have(attr) enl_msg(You_,have,had,attr)
|
#define you_have(attr,ps) enl_msg(You_,have,had,attr,ps)
|
||||||
#define you_can(attr) enl_msg(You_,can,could,attr)
|
#define you_can(attr,ps) enl_msg(You_,can,could,attr,ps)
|
||||||
#define you_have_been(goodthing) enl_msg(You_,have_been,were,goodthing)
|
#define you_have_been(goodthing) enl_msg(You_,have_been,were,goodthing,"")
|
||||||
#define you_have_never(badthing) enl_msg(You_,have_never,never,badthing)
|
#define you_have_never(badthing) enl_msg(You_,have_never,never,badthing,"")
|
||||||
#define you_have_X(something) enl_msg(You_,have,(const char *)"",something)
|
#define you_have_X(something) enl_msg(You_,have,(const char *)"",something,"")
|
||||||
|
|
||||||
static void
|
static void
|
||||||
enlght_line(start, middle, end)
|
enlght_line(start, middle, end, ps)
|
||||||
const char *start, *middle, *end;
|
const char *start, *middle, *end;
|
||||||
|
char *ps;
|
||||||
{
|
{
|
||||||
char buf[BUFSZ];
|
char buf[BUFSZ];
|
||||||
|
|
||||||
Sprintf(buf, "%s%s%s.", start, middle, end);
|
Sprintf(buf, "%s%s%s%s.", start, middle, end, ps);
|
||||||
putstr(en_win, 0, buf);
|
putstr(en_win, 0, buf);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -885,104 +886,109 @@ int final; /* 0 => still in progress; 1 => over, survived; 2 => dead */
|
|||||||
"the Envoy of Balance",
|
"the Envoy of Balance",
|
||||||
"the Glory of Arioch"
|
"the Glory of Arioch"
|
||||||
};
|
};
|
||||||
you_are(hofe_titles[u.uevent.uhand_of_elbereth - 1]);
|
you_are(hofe_titles[u.uevent.uhand_of_elbereth - 1],"");
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
/* note: piousness 20 matches MIN_QUEST_ALIGN (quest.h) */
|
/* note: piousness 20 matches MIN_QUEST_ALIGN (quest.h) */
|
||||||
if (u.ualign.record >= 20) you_are("piously aligned");
|
if (u.ualign.record >= 20) you_are("piously aligned","");
|
||||||
else if (u.ualign.record > 13) you_are("devoutly aligned");
|
else if (u.ualign.record > 13) you_are("devoutly aligned","");
|
||||||
else if (u.ualign.record > 8) you_are("fervently aligned");
|
else if (u.ualign.record > 8) you_are("fervently aligned","");
|
||||||
else if (u.ualign.record > 3) you_are("stridently aligned");
|
else if (u.ualign.record > 3) you_are("stridently aligned","");
|
||||||
else if (u.ualign.record == 3) you_are("aligned");
|
else if (u.ualign.record == 3) you_are("aligned","");
|
||||||
else if (u.ualign.record > 0) you_are("haltingly aligned");
|
else if (u.ualign.record > 0) you_are("haltingly aligned","");
|
||||||
else if (u.ualign.record == 0) you_are("nominally aligned");
|
else if (u.ualign.record == 0) you_are("nominally aligned","");
|
||||||
else if (u.ualign.record >= -3) you_have("strayed");
|
else if (u.ualign.record >= -3) you_have("strayed","");
|
||||||
else if (u.ualign.record >= -8) you_have("sinned");
|
else if (u.ualign.record >= -8) you_have("sinned","");
|
||||||
else you_have("transgressed");
|
else you_have("transgressed","");
|
||||||
#ifdef WIZARD
|
#ifdef WIZARD
|
||||||
if (wizard) {
|
if (wizard) {
|
||||||
Sprintf(buf, " %d", u.ualign.record);
|
Sprintf(buf, " %d", u.ualign.record);
|
||||||
enl_msg("Your alignment ", "is", "was", buf);
|
enl_msg("Your alignment ", "is", "was", buf, "");
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
/*** Resistances to troubles ***/
|
/*** Resistances to troubles ***/
|
||||||
if (Fire_resistance) you_are("fire resistant");
|
if (Fire_resistance) you_are("fire resistant",from_what(FIRE_RES));
|
||||||
if (Cold_resistance) you_are("cold resistant");
|
if (Cold_resistance) you_are("cold resistant",from_what(COLD_RES));
|
||||||
if (Sleep_resistance) you_are("sleep resistant");
|
if (Sleep_resistance) you_are("sleep resistant",from_what(SLEEP_RES));
|
||||||
if (Disint_resistance) you_are("disintegration-resistant");
|
if (Disint_resistance)
|
||||||
if (Shock_resistance) you_are("shock resistant");
|
you_are("disintegration-resistant",from_what(DISINT_RES));
|
||||||
if (Poison_resistance) you_are("poison resistant");
|
if (Shock_resistance) you_are("shock resistant",from_what(SHOCK_RES));
|
||||||
if (Drain_resistance) you_are("level-drain resistant");
|
if (Poison_resistance) you_are("poison resistant",from_what(POISON_RES));
|
||||||
if (Sick_resistance) you_are("immune to sickness");
|
if (Drain_resistance)
|
||||||
if (Antimagic) you_are("magic-protected");
|
you_are("level-drain resistant",from_what(DRAIN_RES));
|
||||||
if (Acid_resistance) you_are("acid resistant");
|
if (Sick_resistance) you_are("immune to sickness",from_what(SICK_RES));
|
||||||
|
if (Antimagic) you_are("magic-protected",from_what(ANTIMAGIC));
|
||||||
|
if (Acid_resistance) you_are("acid resistant",from_what(ACID_RES));
|
||||||
if (Stone_resistance)
|
if (Stone_resistance)
|
||||||
you_are("petrification resistant");
|
you_are("petrification resistant",from_what(STONE_RES));
|
||||||
if (Invulnerable) you_are("invulnerable");
|
if (Invulnerable) you_are("invulnerable",from_what(INVULNERABLE));
|
||||||
if (u.uedibility) you_can("recognize detrimental food");
|
if (u.uedibility) you_can("recognize detrimental food","");
|
||||||
|
|
||||||
/*** Troubles ***/
|
/*** Troubles ***/
|
||||||
if (Halluc_resistance)
|
if (Halluc_resistance)
|
||||||
enl_msg("You resist", "", "ed", " hallucinations");
|
enl_msg("You resist", "", "ed", " hallucinations",
|
||||||
|
from_what(HALLUC_RES));
|
||||||
if (final) {
|
if (final) {
|
||||||
if (Hallucination) you_are("hallucinating");
|
if (Hallucination) you_are("hallucinating","");
|
||||||
if (Stunned) you_are("stunned");
|
if (Stunned) you_are("stunned","");
|
||||||
if (Confusion) you_are("confused");
|
if (Confusion) you_are("confused","");
|
||||||
if (Blinded) you_are("blinded");
|
if (Blinded) you_are("blinded",from_what(BLINDED));
|
||||||
if (Deaf) you_are("deaf");
|
if (Deaf) you_are("deaf",from_what(DEAF));
|
||||||
if (Sick) {
|
if (Sick) {
|
||||||
if (u.usick_type & SICK_VOMITABLE)
|
if (u.usick_type & SICK_VOMITABLE)
|
||||||
you_are("sick from food poisoning");
|
you_are("sick from food poisoning","");
|
||||||
if (u.usick_type & SICK_NONVOMITABLE)
|
if (u.usick_type & SICK_NONVOMITABLE)
|
||||||
you_are("sick from illness");
|
you_are("sick from illness","");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (Stoned) you_are("turning to stone");
|
if (Stoned) you_are("turning to stone","");
|
||||||
if (Slimed) you_are("turning into slime");
|
if (Slimed) you_are("turning into slime","");
|
||||||
if (Strangled) you_are((u.uburied) ? "buried" : "being strangled");
|
if (Strangled) you_are((u.uburied) ? "buried" : "being strangled","");
|
||||||
if (Glib) {
|
if (Glib) {
|
||||||
Sprintf(buf, "slippery %s", makeplural(body_part(FINGER)));
|
Sprintf(buf, "slippery %s", makeplural(body_part(FINGER)));
|
||||||
you_have(buf);
|
you_have(buf,"");
|
||||||
}
|
}
|
||||||
if (Fumbling) enl_msg("You fumble", "", "d", "");
|
if (Fumbling) enl_msg("You fumble", "", "d", "",from_what(FUMBLING));
|
||||||
if (Wounded_legs
|
if (Wounded_legs
|
||||||
#ifdef STEED
|
#ifdef STEED
|
||||||
&& !u.usteed
|
&& !u.usteed
|
||||||
#endif
|
#endif
|
||||||
) {
|
) {
|
||||||
Sprintf(buf, "wounded %s", makeplural(body_part(LEG)));
|
Sprintf(buf, "wounded %s", makeplural(body_part(LEG)));
|
||||||
you_have(buf);
|
you_have(buf,"");
|
||||||
}
|
}
|
||||||
#if defined(WIZARD) && defined(STEED)
|
#if defined(WIZARD) && defined(STEED)
|
||||||
if (Wounded_legs && u.usteed && wizard) {
|
if (Wounded_legs && u.usteed && wizard) {
|
||||||
Strcpy(buf, x_monnam(u.usteed, ARTICLE_YOUR, (char *)0,
|
Strcpy(buf, x_monnam(u.usteed, ARTICLE_YOUR, (char *)0,
|
||||||
SUPPRESS_SADDLE | SUPPRESS_HALLUCINATION, FALSE));
|
SUPPRESS_SADDLE | SUPPRESS_HALLUCINATION, FALSE));
|
||||||
*buf = highc(*buf);
|
*buf = highc(*buf);
|
||||||
enl_msg(buf, " has", " had", " wounded legs");
|
enl_msg(buf, " has", " had", " wounded legs", "");
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
if (Sleeping) enl_msg("You ", "fall", "fell", " asleep");
|
if (Sleeping) enl_msg("You ", "fall", "fell", " asleep", "");
|
||||||
if (Hunger) enl_msg("You hunger", "", "ed", " rapidly");
|
if (Hunger) enl_msg("You hunger", "", "ed", " rapidly", "");
|
||||||
|
|
||||||
/*** Vision and senses ***/
|
/*** Vision and senses ***/
|
||||||
if (See_invisible) enl_msg(You_, "see", "saw", " invisible");
|
if (See_invisible) enl_msg(You_, "see", "saw", " invisible",
|
||||||
if (Blind_telepat) you_are("telepathic");
|
from_what(SEE_INVIS));
|
||||||
if (Warning) you_are("warned");
|
if (Blind_telepat) you_are("telepathic",from_what(TELEPAT));
|
||||||
|
if (Warning) you_are("warned", from_what(WARNING));
|
||||||
if (Warn_of_mon && context.warntype) {
|
if (Warn_of_mon && context.warntype) {
|
||||||
Sprintf(buf, "aware of the presence of %s",
|
Sprintf(buf, "aware of the presence of %s",
|
||||||
(context.warntype & M2_ORC) ? "orcs" :
|
(context.warntype & M2_ORC) ? "orcs" :
|
||||||
(context.warntype & M2_DEMON) ? "demons" :
|
(context.warntype & M2_DEMON) ? "demons" :
|
||||||
something);
|
something);
|
||||||
you_are(buf);
|
you_are(buf,from_what(WARN_OF_MON));
|
||||||
}
|
}
|
||||||
if (Undead_warning) you_are("warned of undead");
|
if (Undead_warning) you_are("warned of undead",from_what(WARN_UNDEAD));
|
||||||
if (Searching) you_have("automatic searching");
|
if (Searching) you_have("automatic searching",from_what(SEARCHING));
|
||||||
if (Clairvoyant) you_are("clairvoyant");
|
if (Clairvoyant) you_are("clairvoyant",from_what(CLAIRVOYANT));
|
||||||
if (Infravision) you_have("infravision");
|
if (Infravision) you_have("infravision",from_what(INFRAVISION));
|
||||||
if (Detect_monsters) you_are("sensing the presence of monsters");
|
if (Detect_monsters)
|
||||||
if (u.umconf) you_are("going to confuse monsters");
|
you_are("sensing the presence of monsters", "");
|
||||||
|
if (u.umconf) you_are("going to confuse monsters","");
|
||||||
|
|
||||||
/*** Appearance and behavior ***/
|
/*** Appearance and behavior ***/
|
||||||
if (Adornment) {
|
if (Adornment) {
|
||||||
@@ -991,40 +997,43 @@ int final; /* 0 => still in progress; 1 => over, survived; 2 => dead */
|
|||||||
if(uleft && uleft->otyp == RIN_ADORNMENT) adorn += uleft->spe;
|
if(uleft && uleft->otyp == RIN_ADORNMENT) adorn += uleft->spe;
|
||||||
if(uright && uright->otyp == RIN_ADORNMENT) adorn += uright->spe;
|
if(uright && uright->otyp == RIN_ADORNMENT) adorn += uright->spe;
|
||||||
if (adorn < 0)
|
if (adorn < 0)
|
||||||
you_are("poorly adorned");
|
you_are("poorly adorned","");
|
||||||
else
|
else
|
||||||
you_are("adorned");
|
you_are("adorned","");
|
||||||
}
|
}
|
||||||
if (Invisible) you_are("invisible");
|
if (Invisible) you_are("invisible",from_what(INVIS));
|
||||||
else if (Invis) you_are("invisible to others");
|
else if (Invis) you_are("invisible to others",from_what(INVIS));
|
||||||
/* ordinarily "visible" is redundant; this is a special case for
|
/* ordinarily "visible" is redundant; this is a special case for
|
||||||
the situation when invisibility would be an expected attribute */
|
the situation when invisibility would be an expected attribute */
|
||||||
else if ((HInvis || EInvis || pm_invisible(youmonst.data)) && BInvis)
|
else if ((HInvis || EInvis || pm_invisible(youmonst.data)) && BInvis)
|
||||||
you_are("visible");
|
you_are("visible","");
|
||||||
if (Displaced) you_are("displaced");
|
if (Displaced) you_are("displaced","");
|
||||||
if (Stealth) you_are("stealthy");
|
if (Stealth) you_are("stealthy",from_what(STEALTH));
|
||||||
if (Aggravate_monster) enl_msg("You aggravate", "", "d", " monsters");
|
if (Aggravate_monster)
|
||||||
if (Conflict) enl_msg("You cause", "", "d", " conflict");
|
enl_msg("You aggravate", "", "d", " monsters","");
|
||||||
|
if (Conflict) enl_msg("You cause", "", "d", " conflict","");
|
||||||
|
|
||||||
/*** Transportation ***/
|
/*** Transportation ***/
|
||||||
if (Jumping) you_can("jump");
|
if (Jumping) you_can("jump",from_what(JUMPING));
|
||||||
if (Teleportation) you_can("teleport");
|
if (Teleportation) you_can("teleport",from_what(TELEPORT));
|
||||||
if (Teleport_control) you_have("teleport control");
|
if (Teleport_control)
|
||||||
if (Lev_at_will) you_are("levitating, at will");
|
you_have("teleport control",from_what(TELEPORT_CONTROL));
|
||||||
else if (Levitation) you_are("levitating"); /* without control */
|
if (Lev_at_will) you_are("levitating, at will", "");
|
||||||
else if (Flying) you_can("fly");
|
else if (Levitation)
|
||||||
if (Wwalking) you_can("walk on water");
|
you_are("levitating",from_what(LEVITATION)); /* without control */
|
||||||
if (Swimming) you_can("swim");
|
else if (Flying) you_can("fly",from_what(FLYING));
|
||||||
if (Breathless) you_can("survive without air");
|
if (Wwalking) you_can("walk on water",from_what(WWALKING));
|
||||||
else if (Amphibious) you_can("breathe water");
|
if (Swimming) you_can("swim",from_what(SWIMMING));
|
||||||
if (Passes_walls) you_can("walk through walls");
|
if (Breathless) you_can("survive without air",from_what(MAGICAL_BREATHING));
|
||||||
|
else if (Amphibious) you_can("breathe water",from_what(MAGICAL_BREATHING));
|
||||||
|
if (Passes_walls) you_can("walk through walls",from_what(PASSES_WALLS));
|
||||||
#ifdef STEED
|
#ifdef STEED
|
||||||
/* If you die while dismounting, u.usteed is still set. Since several
|
/* If you die while dismounting, u.usteed is still set. Since several
|
||||||
* places in the done() sequence depend on u.usteed, just detect this
|
* places in the done() sequence depend on u.usteed, just detect this
|
||||||
* special case. */
|
* special case. */
|
||||||
if (u.usteed && (final < 2 || strcmp(killer.name, "riding accident"))) {
|
if (u.usteed && (final < 2 || strcmp(killer.name, "riding accident"))) {
|
||||||
Sprintf(buf, "riding %s", y_monnam(u.usteed));
|
Sprintf(buf, "riding %s", y_monnam(u.usteed));
|
||||||
you_are(buf);
|
you_are(buf,"");
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
if (u.uswallow) {
|
if (u.uswallow) {
|
||||||
@@ -1032,21 +1041,21 @@ int final; /* 0 => still in progress; 1 => over, survived; 2 => dead */
|
|||||||
#ifdef WIZARD
|
#ifdef WIZARD
|
||||||
if (wizard) Sprintf(eos(buf), " (%u)", u.uswldtim);
|
if (wizard) Sprintf(eos(buf), " (%u)", u.uswldtim);
|
||||||
#endif
|
#endif
|
||||||
you_are(buf);
|
you_are(buf,"");
|
||||||
} else if (u.ustuck) {
|
} else if (u.ustuck) {
|
||||||
Sprintf(buf, "%s %s",
|
Sprintf(buf, "%s %s",
|
||||||
(Upolyd && sticks(youmonst.data)) ? "holding" : "held by",
|
(Upolyd && sticks(youmonst.data)) ? "holding" : "held by",
|
||||||
a_monnam(u.ustuck));
|
a_monnam(u.ustuck));
|
||||||
you_are(buf);
|
you_are(buf,"");
|
||||||
}
|
}
|
||||||
|
|
||||||
/*** Physical attributes ***/
|
/*** Physical attributes ***/
|
||||||
if (u.uhitinc)
|
if (u.uhitinc)
|
||||||
you_have(enlght_combatinc("to hit", u.uhitinc, final, buf));
|
you_have(enlght_combatinc("to hit", u.uhitinc, final, buf),"");
|
||||||
if (u.udaminc)
|
if (u.udaminc)
|
||||||
you_have(enlght_combatinc("damage", u.udaminc, final, buf));
|
you_have(enlght_combatinc("damage", u.udaminc, final, buf),"");
|
||||||
if (Slow_digestion) you_have("slower digestion");
|
if (Slow_digestion) you_have("slower digestion",from_what(SLOW_DIGESTION));
|
||||||
if (Regeneration) enl_msg("You regenerate", "", "d", "");
|
if (Regeneration) enl_msg("You regenerate", "", "d", "",from_what(REGENERATION));
|
||||||
if (u.uspellprot || Protection) {
|
if (u.uspellprot || Protection) {
|
||||||
int prot = 0;
|
int prot = 0;
|
||||||
|
|
||||||
@@ -1056,17 +1065,18 @@ int final; /* 0 => still in progress; 1 => over, survived; 2 => dead */
|
|||||||
prot += u.uspellprot;
|
prot += u.uspellprot;
|
||||||
|
|
||||||
if (prot < 0)
|
if (prot < 0)
|
||||||
you_are("ineffectively protected");
|
you_are("ineffectively protected","");
|
||||||
else
|
else
|
||||||
you_are("protected");
|
you_are("protected","");
|
||||||
}
|
}
|
||||||
if (Protection_from_shape_changers)
|
if (Protection_from_shape_changers)
|
||||||
you_are("protected from shape changers");
|
you_are("protected from shape changers","");
|
||||||
if (Polymorph) you_are("polymorphing");
|
if (Polymorph) you_are("polymorphing","");
|
||||||
if (Polymorph_control) you_have("polymorph control");
|
if (Polymorph_control)
|
||||||
|
you_have("polymorph control",from_what(POLYMORPH_CONTROL));
|
||||||
if (u.ulycn >= LOW_PM) {
|
if (u.ulycn >= LOW_PM) {
|
||||||
Strcpy(buf, an(mons[u.ulycn].mname));
|
Strcpy(buf, an(mons[u.ulycn].mname));
|
||||||
you_are(buf);
|
you_are(buf,"");
|
||||||
}
|
}
|
||||||
if (Upolyd) {
|
if (Upolyd) {
|
||||||
if (u.umonnum == u.ulycn) Strcpy(buf, "in beast form");
|
if (u.umonnum == u.ulycn) Strcpy(buf, "in beast form");
|
||||||
@@ -1074,17 +1084,17 @@ int final; /* 0 => still in progress; 1 => over, survived; 2 => dead */
|
|||||||
#ifdef WIZARD
|
#ifdef WIZARD
|
||||||
if (wizard) Sprintf(eos(buf), " (%d)", u.mtimedone);
|
if (wizard) Sprintf(eos(buf), " (%d)", u.mtimedone);
|
||||||
#endif
|
#endif
|
||||||
you_are(buf);
|
you_are(buf,"");
|
||||||
}
|
}
|
||||||
if (Unchanging) you_can("not change from your current form");
|
if (Unchanging) you_can("not change from your current form","");
|
||||||
if (Fast) you_are(Very_fast ? "very fast" : "fast");
|
if (Fast) you_are(Very_fast ? "very fast" : "fast",from_what(FAST));
|
||||||
if (Reflecting) you_have("reflection");
|
if (Reflecting) you_have("reflection",from_what(REFLECTING));
|
||||||
if (Free_action) you_have("free action");
|
if (Free_action) you_have("free action",from_what(FREE_ACTION));
|
||||||
if (Fixed_abil) you_have("fixed abilities");
|
if (Fixed_abil) you_have("fixed abilities",from_what(FIXED_ABIL));
|
||||||
if (Lifesaved)
|
if (Lifesaved)
|
||||||
enl_msg("Your life ", "will be", "would have been", " saved");
|
enl_msg("Your life ", "will be", "would have been", " saved","");
|
||||||
if (u.twoweap) you_are("wielding two weapons at once");
|
if (u.twoweap) you_are("wielding two weapons at once","");
|
||||||
if (u.utraptype == TT_BURIEDBALL) you_are("fastened to a buried ball");
|
if (u.utraptype == TT_BURIEDBALL) you_are("fastened to a buried ball","");
|
||||||
|
|
||||||
/*** Miscellany ***/
|
/*** Miscellany ***/
|
||||||
if (Luck) {
|
if (Luck) {
|
||||||
@@ -1095,19 +1105,19 @@ int final; /* 0 => still in progress; 1 => over, survived; 2 => dead */
|
|||||||
#ifdef WIZARD
|
#ifdef WIZARD
|
||||||
if (wizard) Sprintf(eos(buf), " (%d)", Luck);
|
if (wizard) Sprintf(eos(buf), " (%d)", Luck);
|
||||||
#endif
|
#endif
|
||||||
you_are(buf);
|
you_are(buf,"");
|
||||||
}
|
}
|
||||||
#ifdef WIZARD
|
#ifdef WIZARD
|
||||||
else if (wizard) enl_msg("Your luck ", "is", "was", " zero");
|
else if (wizard) enl_msg("Your luck ", "is", "was", " zero","");
|
||||||
#endif
|
#endif
|
||||||
if (u.moreluck > 0) you_have("extra luck");
|
if (u.moreluck > 0) you_have("extra luck","");
|
||||||
else if (u.moreluck < 0) you_have("reduced luck");
|
else if (u.moreluck < 0) you_have("reduced luck","");
|
||||||
if (carrying(LUCKSTONE) || stone_luck(TRUE)) {
|
if (carrying(LUCKSTONE) || stone_luck(TRUE)) {
|
||||||
ltmp = stone_luck(FALSE);
|
ltmp = stone_luck(0);
|
||||||
if (ltmp <= 0)
|
if (ltmp <= 0)
|
||||||
enl_msg("Bad luck ", "does", "did", " not time out for you");
|
enl_msg("Bad luck ", "does", "did", " not time out for you","");
|
||||||
if (ltmp >= 0)
|
if (ltmp >= 0)
|
||||||
enl_msg("Good luck ", "does", "did", " not time out for you");
|
enl_msg("Good luck ", "does", "did", " not time out for you","");
|
||||||
}
|
}
|
||||||
|
|
||||||
if (u.ugangr) {
|
if (u.ugangr) {
|
||||||
@@ -1116,7 +1126,7 @@ int final; /* 0 => still in progress; 1 => over, survived; 2 => dead */
|
|||||||
#ifdef WIZARD
|
#ifdef WIZARD
|
||||||
if (wizard) Sprintf(eos(buf), " (%d)", u.ugangr);
|
if (wizard) Sprintf(eos(buf), " (%d)", u.ugangr);
|
||||||
#endif
|
#endif
|
||||||
enl_msg(u_gname(), " is", " was", buf);
|
enl_msg(u_gname(), " is", " was", buf,"");
|
||||||
} else
|
} else
|
||||||
/*
|
/*
|
||||||
* We need to suppress this when the game is over, because death
|
* We need to suppress this when the game is over, because death
|
||||||
@@ -1134,7 +1144,7 @@ int final; /* 0 => still in progress; 1 => over, survived; 2 => dead */
|
|||||||
#ifdef WIZARD
|
#ifdef WIZARD
|
||||||
if (wizard) Sprintf(eos(buf), " (%d)", u.ublesscnt);
|
if (wizard) Sprintf(eos(buf), " (%d)", u.ublesscnt);
|
||||||
#endif
|
#endif
|
||||||
you_can(buf);
|
you_can(buf,"");
|
||||||
}
|
}
|
||||||
|
|
||||||
{
|
{
|
||||||
@@ -1161,7 +1171,7 @@ int final; /* 0 => still in progress; 1 => over, survived; 2 => dead */
|
|||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (p) enl_msg(You_, "have been killed ", p, buf);
|
if (p) enl_msg(You_, "have been killed ", p, buf, "");
|
||||||
}
|
}
|
||||||
|
|
||||||
display_nhwindow(en_win, TRUE);
|
display_nhwindow(en_win, TRUE);
|
||||||
@@ -1306,7 +1316,7 @@ int final;
|
|||||||
putstr(en_win, 0, "");
|
putstr(en_win, 0, "");
|
||||||
|
|
||||||
if (!u.uconduct.food)
|
if (!u.uconduct.food)
|
||||||
enl_msg(You_, "have gone", "went", " without food");
|
enl_msg(You_, "have gone", "went", " without food", "");
|
||||||
/* But beverages are okay */
|
/* But beverages are okay */
|
||||||
else if (!u.uconduct.unvegan)
|
else if (!u.uconduct.unvegan)
|
||||||
you_have_X("followed a strict vegan diet");
|
you_have_X("followed a strict vegan diet");
|
||||||
@@ -1376,7 +1386,7 @@ int final;
|
|||||||
|
|
||||||
if (!u.uconduct.wisharti)
|
if (!u.uconduct.wisharti)
|
||||||
enl_msg(You_, "have not wished", "did not wish",
|
enl_msg(You_, "have not wished", "did not wish",
|
||||||
" for any artifacts");
|
" for any artifacts", "");
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Pop up the window and wait for a key */
|
/* Pop up the window and wait for a key */
|
||||||
|
|||||||
10
src/objnam.c
10
src/objnam.c
@@ -1256,6 +1256,16 @@ struct obj *obj;
|
|||||||
return s;
|
return s;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
char *
|
||||||
|
bare_artifactname(obj)
|
||||||
|
struct obj *obj;
|
||||||
|
{
|
||||||
|
char *outbuf = nextobuf();
|
||||||
|
if (obj->oartifact) Strcpy(outbuf, artiname(obj->oartifact));
|
||||||
|
else Strcpy(outbuf, xname(obj));
|
||||||
|
return outbuf;
|
||||||
|
}
|
||||||
|
|
||||||
static const char *wrp[] = {
|
static const char *wrp[] = {
|
||||||
"wand", "ring", "potion", "scroll", "gem", "amulet",
|
"wand", "ring", "potion", "scroll", "gem", "amulet",
|
||||||
"spellbook", "spell book",
|
"spellbook", "spell book",
|
||||||
|
|||||||
Reference in New Issue
Block a user