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

@@ -1013,7 +1013,7 @@ char *hittee; /* target's name: "you" or mon_nam(mdef) */
/* stun if that was selected and a worse effect didn't occur */
if (do_stun) {
if (youdefend)
make_stunned((HStun + 3), FALSE);
make_stunned(((HStun & TIMEOUT) + 3L), FALSE);
else
mdef->mstun = 1;
/* avoid extra stun message below if we used mb_verb["stun"] above */
@@ -1023,7 +1023,7 @@ char *hittee; /* target's name: "you" or mon_nam(mdef) */
do_confuse = !rn2(12);
if (do_confuse) {
if (youdefend)
make_confused(HConfusion + 4, FALSE);
make_confused((HConfusion & TIMEOUT) + 4L, FALSE);
else
mdef->mconf = 1;
}