intrinsics revamp (trunk only)
Simplify many of the intrinsics macros from
#define xxx_resistance (Hxxx || Exxx || resists_xxx(&youmonst))
down to
#define xxx_resistance (Hxxx || Exxx)
by setting or clearing an extra bit in Hxxx during polymorph so that the
resists_xxx() check becomes implicit.
Unfornately there were lots of places in the code that treat Hxxx
as a timeout number--primarily for Stunned, Confused, and Hallucination;
Stunned happens to be one of the revised macros--rather than as a bit
mask, so this patch needed a lot more changes than originally antipated.
This commit is contained in:
@@ -497,7 +497,7 @@ dosinkfall()
|
||||
register struct obj *obj;
|
||||
int dmg;
|
||||
|
||||
if (is_floater(youmonst.data) || (HLevitation & FROMOUTSIDE)) {
|
||||
if (HLevitation & (FROMOUTSIDE|FROMFORM)) {
|
||||
You("wobble unsteadily for a moment.");
|
||||
} else {
|
||||
long save_ELev = ELevitation, save_HLev = HLevitation;
|
||||
@@ -1755,9 +1755,10 @@ boolean pick;
|
||||
turn, allowing it to do so could give the perception
|
||||
that a trap here is being triggered twice, so adjust
|
||||
the timeout to prevent that */
|
||||
if (trap && (HLevitation & TIMEOUT) == 1L) {
|
||||
if (trap && (HLevitation & TIMEOUT) == 1L &&
|
||||
!ELevitation && !(HLevitation & ~TIMEOUT)) {
|
||||
if (rn2(2)) { /* defer timeout */
|
||||
HLevitation += 1L;
|
||||
incr_itimeout(&HLevitation, 1L);
|
||||
} else { /* timeout early */
|
||||
if (float_down(I_SPECIAL|TIMEOUT, 0L)) {
|
||||
/* levitation has ended; we've already triggered
|
||||
|
||||
Reference in New Issue
Block a user