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:
nethack.rankin
2011-10-01 00:25:57 +00:00
parent cd8eefb622
commit 84f02bd336
24 changed files with 231 additions and 191 deletions

View File

@@ -4407,8 +4407,10 @@ boolean disarm;
Blind ? " and get dizzy" :
" and your vision blurs");
}
make_stunned(HStun + rn1(7, 16),FALSE);
(void) make_hallucinated(HHallucination + rn1(5, 16),FALSE,0L);
make_stunned((HStun & TIMEOUT) + (long)rn1(7, 16),
FALSE);
(void) make_hallucinated((HHallucination & TIMEOUT)
+ (long)rn1(5, 16), FALSE, 0L);
break;
default: impossible("bad chest trap");
break;
@@ -4587,7 +4589,7 @@ register int bodypart;
losehp(Maybe_Half_Phys(dmg), "explosion", KILLED_BY_AN);
exercise(A_STR, FALSE);
if (bodypart) exercise(A_CON, FALSE);
make_stunned(HStun + dmg, TRUE);
make_stunned((HStun & TIMEOUT) + (long)dmg, TRUE);
}
/* Monster is hit by trap. */