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:
@@ -17,7 +17,7 @@
|
|||||||
* Incrementing EDITLEVEL can be used to force invalidation of old bones
|
* Incrementing EDITLEVEL can be used to force invalidation of old bones
|
||||||
* and save files.
|
* and save files.
|
||||||
*/
|
*/
|
||||||
#define EDITLEVEL 109
|
#define EDITLEVEL 110
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Development status possibilities.
|
* Development status possibilities.
|
||||||
|
|||||||
+32
-31
@@ -55,41 +55,42 @@ enum prop_types {
|
|||||||
CLAIRVOYANT = 35,
|
CLAIRVOYANT = 35,
|
||||||
INFRAVISION = 36,
|
INFRAVISION = 36,
|
||||||
DETECT_MONSTERS = 37,
|
DETECT_MONSTERS = 37,
|
||||||
|
BLND_RES = 38,
|
||||||
/* Appearance and behavior */
|
/* Appearance and behavior */
|
||||||
ADORNED = 38,
|
ADORNED = 39,
|
||||||
INVIS = 39,
|
INVIS = 40,
|
||||||
DISPLACED = 40,
|
DISPLACED = 41,
|
||||||
STEALTH = 41,
|
STEALTH = 42,
|
||||||
AGGRAVATE_MONSTER = 42,
|
AGGRAVATE_MONSTER = 43,
|
||||||
CONFLICT = 43,
|
CONFLICT = 44,
|
||||||
/* Transportation */
|
/* Transportation */
|
||||||
JUMPING = 44,
|
JUMPING = 45,
|
||||||
TELEPORT = 45,
|
TELEPORT = 46,
|
||||||
TELEPORT_CONTROL = 46,
|
TELEPORT_CONTROL = 47,
|
||||||
LEVITATION = 47,
|
LEVITATION = 48,
|
||||||
FLYING = 48,
|
FLYING = 49,
|
||||||
WWALKING = 49,
|
WWALKING = 50,
|
||||||
SWIMMING = 50,
|
SWIMMING = 51,
|
||||||
MAGICAL_BREATHING = 51,
|
MAGICAL_BREATHING = 52,
|
||||||
PASSES_WALLS = 52,
|
PASSES_WALLS = 53,
|
||||||
/* Physical attributes */
|
/* Physical attributes */
|
||||||
SLOW_DIGESTION = 53,
|
SLOW_DIGESTION = 54,
|
||||||
HALF_SPDAM = 54,
|
HALF_SPDAM = 55,
|
||||||
HALF_PHDAM = 55,
|
HALF_PHDAM = 56,
|
||||||
REGENERATION = 56,
|
REGENERATION = 57,
|
||||||
ENERGY_REGENERATION = 57,
|
ENERGY_REGENERATION = 58,
|
||||||
PROTECTION = 58,
|
PROTECTION = 59,
|
||||||
PROT_FROM_SHAPE_CHANGERS = 59,
|
PROT_FROM_SHAPE_CHANGERS = 60,
|
||||||
POLYMORPH = 60,
|
POLYMORPH = 61,
|
||||||
POLYMORPH_CONTROL = 61,
|
POLYMORPH_CONTROL = 62,
|
||||||
UNCHANGING = 62,
|
UNCHANGING = 63,
|
||||||
FAST = 63,
|
FAST = 64,
|
||||||
REFLECTING = 64,
|
REFLECTING = 65,
|
||||||
FREE_ACTION = 65,
|
FREE_ACTION = 66,
|
||||||
FIXED_ABIL = 66,
|
FIXED_ABIL = 67,
|
||||||
LIFESAVED = 67
|
LIFESAVED = 68,
|
||||||
|
LAST_PROP = LIFESAVED
|
||||||
};
|
};
|
||||||
#define LAST_PROP (LIFESAVED)
|
|
||||||
|
|
||||||
/*** Where the properties come from ***/
|
/*** Where the properties come from ***/
|
||||||
/* Definitions were moved here from obj.h and you.h */
|
/* Definitions were moved here from obj.h and you.h */
|
||||||
|
|||||||
@@ -156,6 +156,10 @@
|
|||||||
#define Blind_telepat (HTelepat || ETelepat)
|
#define Blind_telepat (HTelepat || ETelepat)
|
||||||
#define Unblind_telepat (ETelepat)
|
#define Unblind_telepat (ETelepat)
|
||||||
|
|
||||||
|
#define HBlnd_resist u.uprops[BLND_RES].intrinsic /* from form */
|
||||||
|
#define EBlnd_resist u.uprops[BLND_RES].extrinsic /* wielding Sunsword */
|
||||||
|
#define Blnd_resist (HBlnd_resist || EBlnd_resist)
|
||||||
|
|
||||||
#define HWarning u.uprops[WARNING].intrinsic
|
#define HWarning u.uprops[WARNING].intrinsic
|
||||||
#define EWarning u.uprops[WARNING].extrinsic
|
#define EWarning u.uprops[WARNING].extrinsic
|
||||||
#define Warning (HWarning || EWarning)
|
#define Warning (HWarning || EWarning)
|
||||||
|
|||||||
+15
-1
@@ -629,7 +629,10 @@ protects(struct obj *otmp, boolean being_worn)
|
|||||||
* unworn/unwielded/dropped. Pickup/drop only set/reset the W_ART mask.
|
* unworn/unwielded/dropped. Pickup/drop only set/reset the W_ART mask.
|
||||||
*/
|
*/
|
||||||
void
|
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;
|
long *mask = 0;
|
||||||
const struct artifact *art, *oart = get_artifact(otmp);
|
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))
|
&& (u.uprops[oart->inv_prop].extrinsic & W_ARTI))
|
||||||
(void) arti_invoke(otmp);
|
(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
|
/* 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)
|
if ((art->spfx & spfx) == spfx && obj->owornmask)
|
||||||
return obj;
|
return obj;
|
||||||
}
|
}
|
||||||
|
if (obj == uwep && abil == &EBlnd_resist
|
||||||
|
&& (*abil & W_WEP) != 0L) {
|
||||||
|
return obj; /* Sunsword */
|
||||||
|
}
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
if (wornbits && wornbits == (wornmask & obj->owornmask))
|
if (wornbits && wornbits == (wornmask & obj->owornmask))
|
||||||
|
|||||||
+5
-3
@@ -889,7 +889,8 @@ is_innate(int propidx)
|
|||||||
ignore innateness if equipment is going to claim responsibility */
|
ignore innateness if equipment is going to claim responsibility */
|
||||||
&& !u.uprops[propidx].extrinsic)
|
&& !u.uprops[propidx].extrinsic)
|
||||||
return FROM_ROLE;
|
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_FORM;
|
||||||
return FROM_NONE;
|
return FROM_NONE;
|
||||||
}
|
}
|
||||||
@@ -897,7 +898,8 @@ is_innate(int propidx)
|
|||||||
DISABLE_WARNING_FORMAT_NONLITERAL
|
DISABLE_WARNING_FORMAT_NONLITERAL
|
||||||
|
|
||||||
char *
|
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];
|
static char buf[BUFSZ];
|
||||||
|
|
||||||
@@ -939,7 +941,7 @@ from_what(int propidx) /* special cases can have negative values */
|
|||||||
else if (innateness == FROM_LYCN)
|
else if (innateness == FROM_LYCN)
|
||||||
Strcpy(buf, " due to your lycanthropy");
|
Strcpy(buf, " due to your lycanthropy");
|
||||||
else if (innateness == FROM_FORM)
|
else if (innateness == FROM_FORM)
|
||||||
Strcpy(buf, " from current creature form");
|
Strcpy(buf, " from your creature form");
|
||||||
else if (propidx == FAST && Very_fast)
|
else if (propidx == FAST && Very_fast)
|
||||||
Sprintf(buf, because_of,
|
Sprintf(buf, because_of,
|
||||||
((HFast & TIMEOUT) != 0L) ? "a potion or spell"
|
((HFast & TIMEOUT) != 0L) ? "a potion or spell"
|
||||||
|
|||||||
@@ -1533,6 +1533,9 @@ attributes_enlightenment(
|
|||||||
/*** Vision and senses ***/
|
/*** Vision and senses ***/
|
||||||
if ((HBlinded || EBlinded) && BBlinded) /* blind w/ blindness blocked */
|
if ((HBlinded || EBlinded) && BBlinded) /* blind w/ blindness blocked */
|
||||||
you_can("see", from_what(-BLINDED)); /* Eyes of the Overworld */
|
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 (See_invisible) {
|
||||||
if (!Blind)
|
if (!Blind)
|
||||||
enl_msg(You_, "see", "saw", " invisible", from_what(SEE_INVIS));
|
enl_msg(You_, "see", "saw", " invisible", from_what(SEE_INVIS));
|
||||||
|
|||||||
+9
-1
@@ -187,7 +187,15 @@ resists_blnd(struct monst *mon)
|
|||||||
if (dmgtype_fromattack(ptr, AD_BLND, AT_EXPL)
|
if (dmgtype_fromattack(ptr, AD_BLND, AT_EXPL)
|
||||||
|| dmgtype_fromattack(ptr, AD_BLND, AT_GAZE))
|
|| dmgtype_fromattack(ptr, AD_BLND, AT_GAZE))
|
||||||
return TRUE;
|
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
|
/* True iff monster is resistant to light-induced blindness due to worn
|
||||||
|
|||||||
@@ -103,6 +103,8 @@ set_uasmon(void)
|
|||||||
PROPSET(REGENERATION, regenerates(mdat));
|
PROPSET(REGENERATION, regenerates(mdat));
|
||||||
PROPSET(REFLECTING, (mdat == &mons[PM_SILVER_DRAGON]));
|
PROPSET(REFLECTING, (mdat == &mons[PM_SILVER_DRAGON]));
|
||||||
PROPSET(BLINDED, !haseyes(mdat));
|
PROPSET(BLINDED, !haseyes(mdat));
|
||||||
|
PROPSET(BLND_RES, (dmgtype_fromattack(mdat, AD_BLND, AT_EXPL)
|
||||||
|
|| dmgtype_fromattack(mdat, AD_BLND, AT_GAZE)));
|
||||||
#undef PROPSET
|
#undef PROPSET
|
||||||
|
|
||||||
/* whether the player is flying/floating depends on their steed,
|
/* whether the player is flying/floating depends on their steed,
|
||||||
|
|||||||
@@ -79,6 +79,7 @@ static const struct propname {
|
|||||||
{ SICK_RES, "sickness resistance" },
|
{ SICK_RES, "sickness resistance" },
|
||||||
{ ANTIMAGIC, "magic resistance" },
|
{ ANTIMAGIC, "magic resistance" },
|
||||||
{ HALLUC_RES, "hallucination resistance" },
|
{ HALLUC_RES, "hallucination resistance" },
|
||||||
|
{ BLND_RES, "light-induced blindness resistance" },
|
||||||
{ FUMBLING, "fumbling" },
|
{ FUMBLING, "fumbling" },
|
||||||
{ HUNGER, "voracious hunger" },
|
{ HUNGER, "voracious hunger" },
|
||||||
{ TELEPAT, "telepathic" },
|
{ TELEPAT, "telepathic" },
|
||||||
|
|||||||
Reference in New Issue
Block a user