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

@@ -703,7 +703,7 @@ peffects(otmp)
if (Detect_monsters) nothing++;
unkn++;
/* after a while, repeated uses become less effective */
if (HDetect_monsters >= 300L)
if ((HDetect_monsters & TIMEOUT) >= 300L)
i = 1;
else
i = rn1(40,21);
@@ -906,10 +906,10 @@ peffects(otmp)
if (otmp->cursed) HLevitation &= ~I_SPECIAL;
if(!Levitation) {
/* kludge to ensure proper operation of float_up() */
HLevitation = 1;
set_itimeout(&HLevitation, 1L);
float_up();
/* reverse kludge */
HLevitation = 0;
set_itimeout(&HLevitation, 0L);
if (otmp->cursed && !Is_waterlevel(&u.uz)) {
if((u.ux != xupstair || u.uy != yupstair)
&& (u.ux != sstairs.sx || u.uy != sstairs.sy || !sstairs.up)