new property: BLND_RES
Add enlightenment feedback for Sunsword's blocking of becoming blind from light flashes. It uses an extra property so that wizard mode can report the reason. EDITLEVEL is being incremented, so existing save and bones files are invalidated.
This commit is contained in:
@@ -629,7 +629,10 @@ protects(struct obj *otmp, boolean being_worn)
|
||||
* unworn/unwielded/dropped. Pickup/drop only set/reset the W_ART mask.
|
||||
*/
|
||||
void
|
||||
set_artifact_intrinsic(struct obj *otmp, boolean on, long wp_mask)
|
||||
set_artifact_intrinsic(
|
||||
struct obj *otmp,
|
||||
boolean on,
|
||||
long wp_mask)
|
||||
{
|
||||
long *mask = 0;
|
||||
const struct artifact *art, *oart = get_artifact(otmp);
|
||||
@@ -796,6 +799,13 @@ set_artifact_intrinsic(struct obj *otmp, boolean on, long wp_mask)
|
||||
&& (u.uprops[oart->inv_prop].extrinsic & W_ARTI))
|
||||
(void) arti_invoke(otmp);
|
||||
}
|
||||
|
||||
if (wp_mask == W_WEP && is_art(otmp, ART_SUNSWORD)) {
|
||||
if (on)
|
||||
EBlnd_resist |= wp_mask;
|
||||
else
|
||||
EBlnd_resist &= ~wp_mask;
|
||||
}
|
||||
}
|
||||
|
||||
/* touch_artifact()'s return value isn't sufficient to tell whether it
|
||||
@@ -2210,6 +2220,10 @@ what_gives(long *abil)
|
||||
if ((art->spfx & spfx) == spfx && obj->owornmask)
|
||||
return obj;
|
||||
}
|
||||
if (obj == uwep && abil == &EBlnd_resist
|
||||
&& (*abil & W_WEP) != 0L) {
|
||||
return obj; /* Sunsword */
|
||||
}
|
||||
}
|
||||
} else {
|
||||
if (wornbits && wornbits == (wornmask & obj->owornmask))
|
||||
|
||||
@@ -889,7 +889,8 @@ is_innate(int propidx)
|
||||
ignore innateness if equipment is going to claim responsibility */
|
||||
&& !u.uprops[propidx].extrinsic)
|
||||
return FROM_ROLE;
|
||||
if (propidx == BLINDED && !haseyes(gy.youmonst.data))
|
||||
if ((propidx == BLINDED && !haseyes(gy.youmonst.data))
|
||||
|| (propidx == BLND_RES && (HBlnd_resist & FROMFORM) != 0))
|
||||
return FROM_FORM;
|
||||
return FROM_NONE;
|
||||
}
|
||||
@@ -897,7 +898,8 @@ is_innate(int propidx)
|
||||
DISABLE_WARNING_FORMAT_NONLITERAL
|
||||
|
||||
char *
|
||||
from_what(int propidx) /* special cases can have negative values */
|
||||
from_what(
|
||||
int propidx) /* special cases can have negative values */
|
||||
{
|
||||
static char buf[BUFSZ];
|
||||
|
||||
@@ -939,7 +941,7 @@ from_what(int propidx) /* special cases can have negative values */
|
||||
else if (innateness == FROM_LYCN)
|
||||
Strcpy(buf, " due to your lycanthropy");
|
||||
else if (innateness == FROM_FORM)
|
||||
Strcpy(buf, " from current creature form");
|
||||
Strcpy(buf, " from your creature form");
|
||||
else if (propidx == FAST && Very_fast)
|
||||
Sprintf(buf, because_of,
|
||||
((HFast & TIMEOUT) != 0L) ? "a potion or spell"
|
||||
|
||||
@@ -1533,6 +1533,9 @@ attributes_enlightenment(
|
||||
/*** Vision and senses ***/
|
||||
if ((HBlinded || EBlinded) && BBlinded) /* blind w/ blindness blocked */
|
||||
you_can("see", from_what(-BLINDED)); /* Eyes of the Overworld */
|
||||
if (Blnd_resist && !Blind) /* skip if no eyes or blindfolded */
|
||||
you_are("not subject to light-induced blindness",
|
||||
from_what(BLND_RES));
|
||||
if (See_invisible) {
|
||||
if (!Blind)
|
||||
enl_msg(You_, "see", "saw", " invisible", from_what(SEE_INVIS));
|
||||
|
||||
@@ -187,7 +187,15 @@ resists_blnd(struct monst *mon)
|
||||
if (dmgtype_fromattack(ptr, AD_BLND, AT_EXPL)
|
||||
|| dmgtype_fromattack(ptr, AD_BLND, AT_GAZE))
|
||||
return TRUE;
|
||||
return resists_blnd_by_arti(mon);
|
||||
/* Sunsword */
|
||||
if (resists_blnd_by_arti(mon))
|
||||
return TRUE;
|
||||
/* catchall */
|
||||
if (is_you && Blnd_resist) {
|
||||
impossible("'Blnd_resist' but not resists_blnd()?");
|
||||
return TRUE;
|
||||
}
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
/* True iff monster is resistant to light-induced blindness due to worn
|
||||
|
||||
@@ -103,6 +103,8 @@ set_uasmon(void)
|
||||
PROPSET(REGENERATION, regenerates(mdat));
|
||||
PROPSET(REFLECTING, (mdat == &mons[PM_SILVER_DRAGON]));
|
||||
PROPSET(BLINDED, !haseyes(mdat));
|
||||
PROPSET(BLND_RES, (dmgtype_fromattack(mdat, AD_BLND, AT_EXPL)
|
||||
|| dmgtype_fromattack(mdat, AD_BLND, AT_GAZE)));
|
||||
#undef PROPSET
|
||||
|
||||
/* whether the player is flying/floating depends on their steed,
|
||||
|
||||
@@ -79,6 +79,7 @@ static const struct propname {
|
||||
{ SICK_RES, "sickness resistance" },
|
||||
{ ANTIMAGIC, "magic resistance" },
|
||||
{ HALLUC_RES, "hallucination resistance" },
|
||||
{ BLND_RES, "light-induced blindness resistance" },
|
||||
{ FUMBLING, "fumbling" },
|
||||
{ HUNGER, "voracious hunger" },
|
||||
{ TELEPAT, "telepathic" },
|
||||
|
||||
Reference in New Issue
Block a user