Merge branch 'NetHack-3.6.2-beta01' into NetHack-3.6.2

This commit is contained in:
nhmall
2019-04-22 14:31:18 -04:00
30 changed files with 126 additions and 114 deletions
+4 -4
View File
@@ -215,13 +215,13 @@
#define display_self() \ #define display_self() \
show_glyph(u.ux, u.uy, \ show_glyph(u.ux, u.uy, \
maybe_display_usteed((youmonst.m_ap_type == M_AP_NOTHING) \ maybe_display_usteed((U_AP_TYPE == M_AP_NOTHING) \
? hero_glyph \ ? hero_glyph \
: (youmonst.m_ap_type == M_AP_FURNITURE) \ : (U_AP_TYPE == M_AP_FURNITURE) \
? cmap_to_glyph(youmonst.mappearance) \ ? cmap_to_glyph(youmonst.mappearance) \
: (youmonst.m_ap_type == M_AP_OBJECT) \ : (U_AP_TYPE == M_AP_OBJECT) \
? objnum_to_glyph(youmonst.mappearance) \ ? objnum_to_glyph(youmonst.mappearance) \
/* else M_AP_MONSTER */ \ /* else U_AP_TYPE == M_AP_MONSTER */ \
: monnum_to_glyph(youmonst.mappearance))) : monnum_to_glyph(youmonst.mappearance)))
/* /*
+10 -3
View File
@@ -50,6 +50,13 @@ enum m_ap_types {
M_AP_MONSTER = 3 /* a monster; mostly used for cloned Wizard */ M_AP_MONSTER = 3 /* a monster; mostly used for cloned Wizard */
}; };
#define M_AP_TYPMASK 0x7
#define M_AP_F_DKNOWN 0x8
#define U_AP_TYPE (youmonst.m_ap_type & M_AP_TYPMASK)
#define U_AP_FLAG (youmonst.m_ap_type & ~M_AP_TYPMASK)
#define M_AP_TYPE(m) ((m)->m_ap_type & M_AP_TYPMASK)
#define M_AP_FLAG(m) ((m)->m_ap_type & ~M_AP_TYPMASK)
struct monst { struct monst {
struct monst *nmon; struct monst *nmon;
struct permonst *data; struct permonst *data;
@@ -170,15 +177,15 @@ struct monst {
/* mimic appearances that block vision/light */ /* mimic appearances that block vision/light */
#define is_lightblocker_mappear(mon) \ #define is_lightblocker_mappear(mon) \
(is_obj_mappear(mon, BOULDER) \ (is_obj_mappear(mon, BOULDER) \
|| ((mon)->m_ap_type == M_AP_FURNITURE \ || (M_AP_TYPE(mon) == M_AP_FURNITURE \
&& ((mon)->mappearance == S_hcdoor \ && ((mon)->mappearance == S_hcdoor \
|| (mon)->mappearance == S_vcdoor \ || (mon)->mappearance == S_vcdoor \
|| (mon)->mappearance < S_ndoor /* = walls */ \ || (mon)->mappearance < S_ndoor /* = walls */ \
|| (mon)->mappearance == S_tree))) || (mon)->mappearance == S_tree)))
#define is_door_mappear(mon) ((mon)->m_ap_type == M_AP_FURNITURE \ #define is_door_mappear(mon) (M_AP_TYPE(mon) == M_AP_FURNITURE \
&& ((mon)->mappearance == S_hcdoor \ && ((mon)->mappearance == S_hcdoor \
|| (mon)->mappearance == S_vcdoor)) || (mon)->mappearance == S_vcdoor))
#define is_obj_mappear(mon,otyp) ((mon)->m_ap_type == M_AP_OBJECT \ #define is_obj_mappear(mon,otyp) (M_AP_TYPE(mon) == M_AP_OBJECT \
&& (mon)->mappearance == (otyp)) && (mon)->mappearance == (otyp))
#endif /* MONST_H */ #endif /* MONST_H */
+4 -4
View File
@@ -384,7 +384,7 @@ register struct obj *obj;
} else if (mtmp->mappearance) { } else if (mtmp->mappearance) {
const char *what = "thing"; const char *what = "thing";
switch (mtmp->m_ap_type) { switch (M_AP_TYPE(mtmp)) {
case M_AP_OBJECT: case M_AP_OBJECT:
what = simple_typename(mtmp->mappearance); what = simple_typename(mtmp->mappearance);
break; break;
@@ -486,7 +486,7 @@ struct obj *obj;
} }
/* mimic must be revealed before we know whether it /* mimic must be revealed before we know whether it
actually moves because line-of-sight may change */ actually moves because line-of-sight may change */
if (mtmp->m_ap_type) if (M_AP_TYPE(mtmp))
seemimic(mtmp); seemimic(mtmp);
omx = mtmp->mx, omy = mtmp->my; omx = mtmp->mx, omy = mtmp->my;
mnexto(mtmp); mnexto(mtmp);
@@ -2109,7 +2109,7 @@ long timeout;
and_vanish[0] = '\0'; and_vanish[0] = '\0';
if ((mtmp->minvis && !See_invisible) if ((mtmp->minvis && !See_invisible)
|| (mtmp->data->mlet == S_MIMIC || (mtmp->data->mlet == S_MIMIC
&& mtmp->m_ap_type != M_AP_NOTHING)) && M_AP_TYPE(mtmp) != M_AP_NOTHING))
suppress_see = TRUE; suppress_see = TRUE;
if (mtmp->mundetected) { if (mtmp->mundetected) {
@@ -2840,7 +2840,7 @@ struct obj *obj;
} }
wakeup(mtmp, TRUE); wakeup(mtmp, TRUE);
} else { } else {
if (mtmp->m_ap_type && !Protection_from_shape_changers if (M_AP_TYPE(mtmp) && !Protection_from_shape_changers
&& !sensemon(mtmp)) && !sensemon(mtmp))
stumble_onto_mimic(mtmp); stumble_onto_mimic(mtmp);
else else
+5 -5
View File
@@ -2272,7 +2272,7 @@ int final;
: surface(u.ux, u.uy)); /* catchall; shouldn't happen */ : surface(u.ux, u.uy)); /* catchall; shouldn't happen */
you_are(buf, from_what(WWALKING)); you_are(buf, from_what(WWALKING));
} }
if (Upolyd && (u.uundetected || youmonst.m_ap_type != M_AP_NOTHING)) if (Upolyd && (u.uundetected || U_AP_TYPE != M_AP_NOTHING))
youhiding(TRUE, final); youhiding(TRUE, final);
/* internal troubles, mostly in the order that prayer ranks them */ /* internal troubles, mostly in the order that prayer ranks them */
@@ -3094,16 +3094,16 @@ int msgflag; /* for variant message phrasing */
char *bp, buf[BUFSZ]; char *bp, buf[BUFSZ];
Strcpy(buf, "hiding"); Strcpy(buf, "hiding");
if (youmonst.m_ap_type != M_AP_NOTHING) { if (U_AP_TYPE != M_AP_NOTHING) {
/* mimic; hero is only able to mimic a strange object or gold /* mimic; hero is only able to mimic a strange object or gold
or hallucinatory alternative to gold, so we skip the details or hallucinatory alternative to gold, so we skip the details
for the hypothetical furniture and monster cases */ for the hypothetical furniture and monster cases */
bp = eos(strcpy(buf, "mimicking")); bp = eos(strcpy(buf, "mimicking"));
if (youmonst.m_ap_type == M_AP_OBJECT) { if (U_AP_TYPE == M_AP_OBJECT) {
Sprintf(bp, " %s", an(simple_typename(youmonst.mappearance))); Sprintf(bp, " %s", an(simple_typename(youmonst.mappearance)));
} else if (youmonst.m_ap_type == M_AP_FURNITURE) { } else if (U_AP_TYPE == M_AP_FURNITURE) {
Strcpy(bp, " something"); Strcpy(bp, " something");
} else if (youmonst.m_ap_type == M_AP_MONSTER) { } else if (U_AP_TYPE == M_AP_MONSTER) {
Strcpy(bp, " someone"); Strcpy(bp, " someone");
} else { } else {
; /* something unexpected; leave 'buf' as-is */ ; /* something unexpected; leave 'buf' as-is */
+5 -5
View File
@@ -655,7 +655,7 @@ int class; /* an object class, 0 for all */
if (do_dknown) if (do_dknown)
do_dknown_of(obj); do_dknown_of(obj);
} }
if ((is_cursed && mtmp->m_ap_type == M_AP_OBJECT if ((is_cursed && M_AP_TYPE(mtmp) == M_AP_OBJECT
&& (!class || class == objects[mtmp->mappearance].oc_class)) && (!class || class == objects[mtmp->mappearance].oc_class))
|| (findgold(mtmp->minvent) && (!class || class == COIN_CLASS))) { || (findgold(mtmp->minvent) && (!class || class == COIN_CLASS))) {
ct++; ct++;
@@ -730,7 +730,7 @@ int class; /* an object class, 0 for all */
break; break;
} }
/* Allow a mimic to override the detected objects it is carrying. */ /* Allow a mimic to override the detected objects it is carrying. */
if (is_cursed && mtmp->m_ap_type == M_AP_OBJECT if (is_cursed && M_AP_TYPE(mtmp) == M_AP_OBJECT
&& (!class || class == objects[mtmp->mappearance].oc_class)) { && (!class || class == objects[mtmp->mappearance].oc_class)) {
struct obj temp; struct obj temp;
@@ -1469,7 +1469,7 @@ genericptr_t num;
(*(int *) num)++; (*(int *) num)++;
} }
} else if ((mtmp = m_at(zx, zy)) != 0) { } else if ((mtmp = m_at(zx, zy)) != 0) {
if (mtmp->m_ap_type) { if (M_AP_TYPE(mtmp)) {
seemimic(mtmp); seemimic(mtmp);
(*(int *) num)++; (*(int *) num)++;
} }
@@ -1633,7 +1633,7 @@ boolean via_warning;
if (via_warning && !warning_of(mtmp)) if (via_warning && !warning_of(mtmp))
return -1; return -1;
if (mtmp->m_ap_type) { if (M_AP_TYPE(mtmp)) {
seemimic(mtmp); seemimic(mtmp);
found_something = TRUE; found_something = TRUE;
} else if (!canspotmon(mtmp)) { } else if (!canspotmon(mtmp)) {
@@ -1862,7 +1862,7 @@ int default_glyph, which_subset;
/* look for a mimic here posing as furniture; /* look for a mimic here posing as furniture;
if we don't find one, we'll have to fake it */ if we don't find one, we'll have to fake it */
if ((mtmp = m_at(x, y)) != 0 if ((mtmp = m_at(x, y)) != 0
&& mtmp->m_ap_type == M_AP_FURNITURE) { && M_AP_TYPE(mtmp) == M_AP_FURNITURE) {
glyph = cmap_to_glyph(mtmp->mappearance); glyph = cmap_to_glyph(mtmp->mappearance);
} else { } else {
/* we have a topology type but we want a screen /* we have a topology type but we want a screen
+2 -2
View File
@@ -377,7 +377,7 @@ int sightflags; /* 1 if the monster is physically seen;
2 if detected using Detect_monsters */ 2 if detected using Detect_monsters */
xchar worm_tail; /* mon is actually a worm tail */ xchar worm_tail; /* mon is actually a worm tail */
{ {
boolean mon_mimic = (mon->m_ap_type != M_AP_NOTHING); boolean mon_mimic = (M_AP_TYPE(mon) != M_AP_NOTHING);
int sensed = (mon_mimic && (Protection_from_shape_changers int sensed = (mon_mimic && (Protection_from_shape_changers
|| sensemon(mon))); || sensemon(mon)));
/* /*
@@ -388,7 +388,7 @@ xchar worm_tail; /* mon is actually a worm tail */
*/ */
if (mon_mimic && (sightflags == PHYSICALLY_SEEN)) { if (mon_mimic && (sightflags == PHYSICALLY_SEEN)) {
switch (mon->m_ap_type) { switch (M_AP_TYPE(mon)) {
default: default:
impossible("display_monster: bad m_ap_type value [ = %d ]", impossible("display_monster: bad m_ap_type value [ = %d ]",
(int) mon->m_ap_type); (int) mon->m_ap_type);
+2 -2
View File
@@ -1149,8 +1149,8 @@ do_mname()
if (!mtmp if (!mtmp
|| (!sensemon(mtmp) || (!sensemon(mtmp)
&& (!(cansee(cx, cy) || see_with_infrared(mtmp)) && (!(cansee(cx, cy) || see_with_infrared(mtmp))
|| mtmp->mundetected || mtmp->m_ap_type == M_AP_FURNITURE || mtmp->mundetected || M_AP_TYPE(mtmp) == M_AP_FURNITURE
|| mtmp->m_ap_type == M_AP_OBJECT || M_AP_TYPE(mtmp) == M_AP_OBJECT
|| (mtmp->minvis && !See_invisible)))) { || (mtmp->minvis && !See_invisible)))) {
pline("I see no monster there."); pline("I see no monster there.");
return; return;
+5 -5
View File
@@ -1361,7 +1361,7 @@ finish_meating(mtmp)
struct monst *mtmp; struct monst *mtmp;
{ {
mtmp->meating = 0; mtmp->meating = 0;
if (mtmp->m_ap_type && mtmp->mappearance && mtmp->cham == NON_PM) { if (M_AP_TYPE(mtmp) && mtmp->mappearance && mtmp->cham == NON_PM) {
/* was eating a mimic and now appearance needs resetting */ /* was eating a mimic and now appearance needs resetting */
mtmp->m_ap_type = 0; mtmp->m_ap_type = 0;
mtmp->mappearance = 0; mtmp->mappearance = 0;
@@ -1415,15 +1415,15 @@ struct monst *mtmp;
newsym(mtmp->mx, mtmp->my); newsym(mtmp->mx, mtmp->my);
You("%s %s %sappear%s where %s was!", You("%s %s %sappear%s where %s was!",
cansee(mtmp->mx, mtmp->my) ? "see" : "sense that", cansee(mtmp->mx, mtmp->my) ? "see" : "sense that",
(mtmp->m_ap_type == M_AP_FURNITURE) (M_AP_TYPE(mtmp) == M_AP_FURNITURE)
? an(defsyms[mtmp->mappearance].explanation) ? an(defsyms[mtmp->mappearance].explanation)
: (mtmp->m_ap_type == M_AP_OBJECT : (M_AP_TYPE(mtmp) == M_AP_OBJECT
&& OBJ_DESCR(objects[mtmp->mappearance])) && OBJ_DESCR(objects[mtmp->mappearance]))
? an(OBJ_DESCR(objects[mtmp->mappearance])) ? an(OBJ_DESCR(objects[mtmp->mappearance]))
: (mtmp->m_ap_type == M_AP_OBJECT : (M_AP_TYPE(mtmp) == M_AP_OBJECT
&& OBJ_NAME(objects[mtmp->mappearance])) && OBJ_NAME(objects[mtmp->mappearance]))
? an(OBJ_NAME(objects[mtmp->mappearance])) ? an(OBJ_NAME(objects[mtmp->mappearance]))
: (mtmp->m_ap_type == M_AP_MONSTER) : (M_AP_TYPE(mtmp) == M_AP_MONSTER)
? an(mons[mtmp->mappearance].mname) ? an(mons[mtmp->mappearance].mname)
: something, : something,
cansee(mtmp->mx, mtmp->my) ? "" : "has ", cansee(mtmp->mx, mtmp->my) ? "" : "has ",
+3 -3
View File
@@ -63,7 +63,7 @@ boolean clumsy;
return; return;
} }
if (mon->m_ap_type) if (M_AP_TYPE(mon))
seemimic(mon); seemimic(mon);
check_caitiff(mon); check_caitiff(mon);
@@ -166,8 +166,8 @@ xchar x, y;
/* reveal hidden target even if kick ends up missing (note: being /* reveal hidden target even if kick ends up missing (note: being
hidden doesn't affect chance to hit so neither does this reveal) */ hidden doesn't affect chance to hit so neither does this reveal) */
if (mon->mundetected if (mon->mundetected
|| (mon->m_ap_type && mon->m_ap_type != M_AP_MONSTER)) { || (M_AP_TYPE(mon) && M_AP_TYPE(mon) != M_AP_MONSTER)) {
if (mon->m_ap_type) if (M_AP_TYPE(mon))
seemimic(mon); seemimic(mon);
mon->mundetected = 0; mon->mundetected = 0;
if (!canspotmon(mon)) if (!canspotmon(mon))
+1 -1
View File
@@ -1487,7 +1487,7 @@ boolean maybe_wakeup;
An attentive player will still notice that this is different from An attentive player will still notice that this is different from
an arrow just landing short of any target (no message in that case), an arrow just landing short of any target (no message in that case),
so will realize that there is a valid target here anyway. */ so will realize that there is a valid target here anyway. */
if (!canseemon(mon) || (mon->m_ap_type && mon->m_ap_type != M_AP_MONSTER)) if (!canseemon(mon) || (M_AP_TYPE(mon) && M_AP_TYPE(mon) != M_AP_MONSTER))
pline("%s %s.", The(missile), otense(obj, "miss")); pline("%s %s.", The(missile), otense(obj, "miss"));
else else
miss(missile, mon); miss(missile, mon);
+1 -1
View File
@@ -2516,7 +2516,7 @@ recalc_mapseen()
if (ltyp == DRAWBRIDGE_UP) if (ltyp == DRAWBRIDGE_UP)
ltyp = db_under_typ(levl[x][y].drawbridgemask); ltyp = db_under_typ(levl[x][y].drawbridgemask);
if ((mtmp = m_at(x, y)) != 0 if ((mtmp = m_at(x, y)) != 0
&& mtmp->m_ap_type == M_AP_FURNITURE && canseemon(mtmp)) && M_AP_TYPE(mtmp) == M_AP_FURNITURE && canseemon(mtmp))
ltyp = cmap_to_type(mtmp->mappearance); ltyp = cmap_to_type(mtmp->mappearance);
lastseentyp[x][y] = ltyp; lastseentyp[x][y] = ltyp;
} }
+1 -1
View File
@@ -161,7 +161,7 @@ eatmdone(VOID_ARGS)
free((genericptr_t) eatmbuf), eatmbuf = 0; free((genericptr_t) eatmbuf), eatmbuf = 0;
} }
/* update display */ /* update display */
if (youmonst.m_ap_type) { if (U_AP_TYPE) {
youmonst.m_ap_type = M_AP_NOTHING; youmonst.m_ap_type = M_AP_NOTHING;
newsym(u.ux, u.uy); newsym(u.ux, u.uy);
} }
+1 -1
View File
@@ -421,7 +421,7 @@ int how;
? &mons[mtmp->cham] ? &mons[mtmp->cham]
: mptr); : mptr);
boolean distorted = (boolean) (Hallucination && canspotmon(mtmp)), boolean distorted = (boolean) (Hallucination && canspotmon(mtmp)),
mimicker = (mtmp->m_ap_type == M_AP_MONSTER), mimicker = (M_AP_TYPE(mtmp) == M_AP_MONSTER),
imitator = (mptr != champtr || mimicker); imitator = (mptr != champtr || mimicker);
You((how == STONING) ? "turn to stone..." : "die..."); You((how == STONING) ? "turn to stone..." : "die...");
+10 -10
View File
@@ -1533,8 +1533,8 @@ domove_core()
/* It's fine to displace pets, though */ /* It's fine to displace pets, though */
/* We should never get here if forcefight */ /* We should never get here if forcefight */
if (context.run && ((!Blind && mon_visible(mtmp) if (context.run && ((!Blind && mon_visible(mtmp)
&& ((mtmp->m_ap_type != M_AP_FURNITURE && ((M_AP_TYPE(mtmp) != M_AP_FURNITURE
&& mtmp->m_ap_type != M_AP_OBJECT) && M_AP_TYPE(mtmp) != M_AP_OBJECT)
|| Protection_from_shape_changers)) || Protection_from_shape_changers))
|| sensemon(mtmp))) { || sensemon(mtmp))) {
nomul(0); nomul(0);
@@ -1574,7 +1574,7 @@ domove_core()
*/ */
if (context.nopick && !context.travel if (context.nopick && !context.travel
&& (canspotmon(mtmp) || glyph_is_invisible(levl[x][y].glyph))) { && (canspotmon(mtmp) || glyph_is_invisible(levl[x][y].glyph))) {
if (mtmp->m_ap_type && !Protection_from_shape_changers if (M_AP_TYPE(mtmp) && !Protection_from_shape_changers
&& !sensemon(mtmp)) && !sensemon(mtmp))
stumble_onto_mimic(mtmp); stumble_onto_mimic(mtmp);
else if (mtmp->mpeaceful && !Hallucination) else if (mtmp->mpeaceful && !Hallucination)
@@ -1762,7 +1762,7 @@ domove_core()
cancel the swap below (we can ignore steed mx,my here) */ cancel the swap below (we can ignore steed mx,my here) */
u.ux = u.ux0, u.uy = u.uy0; u.ux = u.ux0, u.uy = u.uy0;
mtmp->mundetected = 0; mtmp->mundetected = 0;
if (mtmp->m_ap_type) if (M_AP_TYPE(mtmp))
seemimic(mtmp); seemimic(mtmp);
else if (!mtmp->mtame) else if (!mtmp->mtame)
newsym(mtmp->mx, mtmp->my); newsym(mtmp->mx, mtmp->my);
@@ -1866,8 +1866,8 @@ domove_core()
* imitating something that doesn't move. We could extend this * imitating something that doesn't move. We could extend this
* to non-moving monsters... * to non-moving monsters...
*/ */
if ((u.dx || u.dy) && (youmonst.m_ap_type == M_AP_OBJECT if ((u.dx || u.dy) && (U_AP_TYPE == M_AP_OBJECT
|| youmonst.m_ap_type == M_AP_FURNITURE)) || U_AP_TYPE == M_AP_FURNITURE))
youmonst.m_ap_type = M_AP_NOTHING; youmonst.m_ap_type = M_AP_NOTHING;
check_leash(u.ux0, u.uy0); check_leash(u.ux0, u.uy0);
@@ -2655,8 +2655,8 @@ lookaround()
continue; continue;
if ((mtmp = m_at(x, y)) != 0 if ((mtmp = m_at(x, y)) != 0
&& mtmp->m_ap_type != M_AP_FURNITURE && M_AP_TYPE(mtmp) != M_AP_FURNITURE
&& mtmp->m_ap_type != M_AP_OBJECT && M_AP_TYPE(mtmp) != M_AP_OBJECT
&& (!mtmp->minvis || See_invisible) && !mtmp->mundetected) { && (!mtmp->minvis || See_invisible) && !mtmp->mundetected) {
if ((context.run != 1 && !mtmp->mtame) if ((context.run != 1 && !mtmp->mtame)
|| (x == u.ux + u.dx && y == u.uy + u.dy || (x == u.ux + u.dx && y == u.uy + u.dy
@@ -2838,8 +2838,8 @@ monster_nearby()
for (y = u.uy - 1; y <= u.uy + 1; y++) { for (y = u.uy - 1; y <= u.uy + 1; y++) {
if (!isok(x, y) || (x == u.ux && y == u.uy)) if (!isok(x, y) || (x == u.ux && y == u.uy))
continue; continue;
if ((mtmp = m_at(x, y)) && mtmp->m_ap_type != M_AP_FURNITURE if ((mtmp = m_at(x, y)) && M_AP_TYPE(mtmp) != M_AP_FURNITURE
&& mtmp->m_ap_type != M_AP_OBJECT && M_AP_TYPE(mtmp) != M_AP_OBJECT
&& (!mtmp->mpeaceful || Hallucination) && (!mtmp->mpeaceful || Hallucination)
&& (!is_hider(mtmp->data) || !mtmp->mundetected) && (!is_hider(mtmp->data) || !mtmp->mundetected)
&& !noattacks(mtmp->data) && mtmp->mcanmove && !noattacks(mtmp->data) && mtmp->mcanmove
+4 -4
View File
@@ -453,8 +453,8 @@ struct obj *pick;
door = &levl[cc.x][cc.y]; door = &levl[cc.x][cc.y];
mtmp = m_at(cc.x, cc.y); mtmp = m_at(cc.x, cc.y);
if (mtmp && canseemon(mtmp) && mtmp->m_ap_type != M_AP_FURNITURE if (mtmp && canseemon(mtmp) && M_AP_TYPE(mtmp) != M_AP_FURNITURE
&& mtmp->m_ap_type != M_AP_OBJECT) { && M_AP_TYPE(mtmp) != M_AP_OBJECT) {
if (picktyp == CREDIT_CARD if (picktyp == CREDIT_CARD
&& (mtmp->isshk || mtmp->data == &mons[PM_ORACLE])) && (mtmp->isshk || mtmp->data == &mons[PM_ORACLE]))
verbalize("No checks, no credit, no problem."); verbalize("No checks, no credit, no problem.");
@@ -745,8 +745,8 @@ boolean quietly;
{ {
register struct monst *mtmp = m_at(x, y); register struct monst *mtmp = m_at(x, y);
if (mtmp && mtmp->m_ap_type != M_AP_FURNITURE) { if (mtmp && M_AP_TYPE(mtmp) != M_AP_FURNITURE) {
if (mtmp->m_ap_type == M_AP_OBJECT) if (M_AP_TYPE(mtmp) == M_AP_OBJECT)
goto objhere; goto objhere;
if (!quietly) { if (!quietly) {
if ((mtmp->mx != x) || (mtmp->my != y)) { if ((mtmp->mx != x) || (mtmp->my != y)) {
+6 -6
View File
@@ -94,9 +94,9 @@ struct attack *mattk;
map_invisible(magr->mx, magr->my); map_invisible(magr->mx, magr->my);
if (!canspotmon(mdef)) if (!canspotmon(mdef))
map_invisible(mdef->mx, mdef->my); map_invisible(mdef->mx, mdef->my);
if (mdef->m_ap_type) if (M_AP_TYPE(mdef))
seemimic(mdef); seemimic(mdef);
if (magr->m_ap_type) if (M_AP_TYPE(magr))
seemimic(magr); seemimic(magr);
fmt = (could_seduce(magr, mdef, mattk) && !magr->mcan) fmt = (could_seduce(magr, mdef, mattk) && !magr->mcan)
? "%s pretends to be friendly to" ? "%s pretends to be friendly to"
@@ -225,7 +225,7 @@ boolean quietly;
/* undetected monster becomes un-hidden if it is displaced */ /* undetected monster becomes un-hidden if it is displaced */
if (mdef->mundetected) if (mdef->mundetected)
mdef->mundetected = 0; mdef->mundetected = 0;
if (mdef->m_ap_type && mdef->m_ap_type != M_AP_MONSTER) if (M_AP_TYPE(mdef) && M_AP_TYPE(mdef) != M_AP_MONSTER)
seemimic(mdef); seemimic(mdef);
/* wake up the displaced defender */ /* wake up the displaced defender */
mdef->msleeping = 0; mdef->msleeping = 0;
@@ -543,9 +543,9 @@ struct attack *mattk;
map_invisible(magr->mx, magr->my); map_invisible(magr->mx, magr->my);
if (!canspotmon(mdef)) if (!canspotmon(mdef))
map_invisible(mdef->mx, mdef->my); map_invisible(mdef->mx, mdef->my);
if (mdef->m_ap_type) if (M_AP_TYPE(mdef))
seemimic(mdef); seemimic(mdef);
if (magr->m_ap_type) if (M_AP_TYPE(magr))
seemimic(magr); seemimic(magr);
if ((compat = could_seduce(magr, mdef, mattk)) && !magr->mcan) { if ((compat = could_seduce(magr, mdef, mattk)) && !magr->mcan) {
Sprintf(buf, "%s %s", Monnam(magr), Sprintf(buf, "%s %s", Monnam(magr),
@@ -599,7 +599,7 @@ struct attack *mattk;
if (vis) { if (vis) {
if (mdef->data->mlet == S_MIMIC if (mdef->data->mlet == S_MIMIC
&& mdef->m_ap_type != M_AP_NOTHING) && M_AP_TYPE(mdef) != M_AP_NOTHING)
seemimic(mdef); seemimic(mdef);
Sprintf(buf, "%s gazes at", Monnam(magr)); Sprintf(buf, "%s gazes at", Monnam(magr));
pline("%s %s...", buf, pline("%s %s...", buf,
+2 -2
View File
@@ -525,7 +525,7 @@ register struct monst *mtmp;
} }
/* hero might be a mimic, concealed via #monster */ /* hero might be a mimic, concealed via #monster */
if (youmonst.data->mlet == S_MIMIC && youmonst.m_ap_type && !range2 if (youmonst.data->mlet == S_MIMIC && U_AP_TYPE && !range2
&& foundyou && !u.uswallow) { && foundyou && !u.uswallow) {
boolean sticky = sticks(youmonst.data); boolean sticky = sticks(youmonst.data);
@@ -545,7 +545,7 @@ register struct monst *mtmp;
} }
/* non-mimic hero might be mimicking an object after eating m corpse */ /* non-mimic hero might be mimicking an object after eating m corpse */
if (youmonst.m_ap_type == M_AP_OBJECT && !range2 && foundyou if (U_AP_TYPE == M_AP_OBJECT && !range2 && foundyou
&& !u.uswallow) { && !u.uswallow) {
if (!canspotmon(mtmp)) if (!canspotmon(mtmp))
map_invisible(mtmp->mx, mtmp->my); map_invisible(mtmp->mx, mtmp->my);
+11 -11
View File
@@ -799,8 +799,8 @@ movemon()
/* unwatched mimics and piercers may hide again [MRS] */ /* unwatched mimics and piercers may hide again [MRS] */
if (restrap(mtmp)) if (restrap(mtmp))
continue; continue;
if (mtmp->m_ap_type == M_AP_FURNITURE if (M_AP_TYPE(mtmp) == M_AP_FURNITURE
|| mtmp->m_ap_type == M_AP_OBJECT) || M_AP_TYPE(mtmp) == M_AP_OBJECT)
continue; continue;
if (mtmp->mundetected) if (mtmp->mundetected)
continue; continue;
@@ -1682,7 +1682,7 @@ struct monst **monst_list; /* &migrating_mons or &mydogs or null */
clone can continue imitating some other monster form); also, clone can continue imitating some other monster form); also,
might be imitating a boulder so need line-of-sight unblocking */ might be imitating a boulder so need line-of-sight unblocking */
mon->mundetected = 0; mon->mundetected = 0;
if (mon->m_ap_type && mon->m_ap_type != M_AP_MONSTER) if (M_AP_TYPE(mon) && M_AP_TYPE(mon) != M_AP_MONSTER)
seemimic(mon); seemimic(mon);
} }
@@ -1821,7 +1821,7 @@ struct permonst *mptr; /* reflects mtmp->data _prior_ to mtmp's death */
} }
if (emits_light(mptr)) if (emits_light(mptr))
del_light_source(LS_MONSTER, monst_to_any(mtmp)); del_light_source(LS_MONSTER, monst_to_any(mtmp));
if (mtmp->m_ap_type) if (M_AP_TYPE(mtmp))
seemimic(mtmp); seemimic(mtmp);
if (onmap) if (onmap)
newsym(mtmp->mx, mtmp->my); newsym(mtmp->mx, mtmp->my);
@@ -2870,7 +2870,7 @@ register struct monst *mtmp;
boolean via_attack; boolean via_attack;
{ {
mtmp->msleeping = 0; mtmp->msleeping = 0;
if (mtmp->m_ap_type) { if (M_AP_TYPE(mtmp)) {
seemimic(mtmp); seemimic(mtmp);
} else if (context.forcefight && !context.mon_moving } else if (context.forcefight && !context.mon_moving
&& mtmp->mundetected) { && mtmp->mundetected) {
@@ -2958,7 +2958,7 @@ rescham()
} }
if (is_were(mtmp->data) && mtmp->data->mlet != S_HUMAN) if (is_were(mtmp->data) && mtmp->data->mlet != S_HUMAN)
new_were(mtmp); new_were(mtmp);
if (mtmp->m_ap_type && cansee(mtmp->mx, mtmp->my)) { if (M_AP_TYPE(mtmp) && cansee(mtmp->mx, mtmp->my)) {
seemimic(mtmp); seemimic(mtmp);
/* we pretend that the mimic doesn't /* we pretend that the mimic doesn't
know that it has been unmasked */ know that it has been unmasked */
@@ -3015,7 +3015,7 @@ register struct monst *mtmp;
{ {
struct trap *t; struct trap *t;
if (mtmp->mcan || mtmp->m_ap_type || cansee(mtmp->mx, mtmp->my) if (mtmp->mcan || M_AP_TYPE(mtmp) || cansee(mtmp->mx, mtmp->my)
|| rn2(3) || mtmp == u.ustuck || rn2(3) || mtmp == u.ustuck
/* can't hide while trapped except in pits */ /* can't hide while trapped except in pits */
|| (mtmp->mtrapped && (t = t_at(mtmp->mx, mtmp->my)) != 0 || (mtmp->mtrapped && (t = t_at(mtmp->mx, mtmp->my)) != 0
@@ -3076,7 +3076,7 @@ struct monst *mon;
boolean hider_under = hides_under(mon->data) || mon->data->mlet == S_EEL; boolean hider_under = hides_under(mon->data) || mon->data->mlet == S_EEL;
if ((is_hider(mon->data) || hider_under) if ((is_hider(mon->data) || hider_under)
&& !(mon->mundetected || mon->m_ap_type)) { && !(mon->mundetected || M_AP_TYPE(mon))) {
xchar x = mon->mx, y = mon->my; xchar x = mon->mx, y = mon->my;
char save_viz = viz_array[y][x]; char save_viz = viz_array[y][x];
@@ -3085,7 +3085,7 @@ struct monst *mon;
if (is_hider(mon->data)) if (is_hider(mon->data))
(void) restrap(mon); (void) restrap(mon);
/* try again if mimic missed its 1/3 chance to hide */ /* try again if mimic missed its 1/3 chance to hide */
if (mon->data->mlet == S_MIMIC && !mon->m_ap_type) if (mon->data->mlet == S_MIMIC && !M_AP_TYPE(mon))
(void) restrap(mon); (void) restrap(mon);
if (hider_under) if (hider_under)
(void) hideunder(mon); (void) hideunder(mon);
@@ -3551,7 +3551,7 @@ boolean msg; /* "The oldmon turns into a newmon!" */
wormgone(mtmp); wormgone(mtmp);
place_monster(mtmp, mtmp->mx, mtmp->my); place_monster(mtmp, mtmp->mx, mtmp->my);
} }
if (mtmp->m_ap_type && mdat->mlet != S_MIMIC) if (M_AP_TYPE(mtmp) && mdat->mlet != S_MIMIC)
seemimic(mtmp); /* revert to normal monster */ seemimic(mtmp); /* revert to normal monster */
/* (this code used to try to adjust the monster's health based on /* (this code used to try to adjust the monster's health based on
@@ -3940,7 +3940,7 @@ short otyp;
{ {
short ap = mtmp->mappearance; short ap = mtmp->mappearance;
switch (mtmp->m_ap_type) { switch (M_AP_TYPE(mtmp)) {
case M_AP_NOTHING: case M_AP_NOTHING:
case M_AP_FURNITURE: case M_AP_FURNITURE:
case M_AP_MONSTER: case M_AP_MONSTER:
+4 -4
View File
@@ -231,8 +231,8 @@ register struct monst *mtmp;
|| mtmp->data->mlet == S_LEPRECHAUN) || !rn2(50)) || mtmp->data->mlet == S_LEPRECHAUN) || !rn2(50))
&& (Aggravate_monster && (Aggravate_monster
|| (mtmp->data->mlet == S_DOG || mtmp->data->mlet == S_HUMAN) || (mtmp->data->mlet == S_DOG || mtmp->data->mlet == S_HUMAN)
|| (!rn2(7) && mtmp->m_ap_type != M_AP_FURNITURE || (!rn2(7) && M_AP_TYPE(mtmp) != M_AP_FURNITURE
&& mtmp->m_ap_type != M_AP_OBJECT))) { && M_AP_TYPE(mtmp) != M_AP_OBJECT))) {
mtmp->msleeping = 0; mtmp->msleeping = 0;
return 1; return 1;
} }
@@ -289,8 +289,8 @@ boolean fleemsg;
mtmp->mfleetim = (unsigned) min(fleetime, 127); mtmp->mfleetim = (unsigned) min(fleetime, 127);
} }
if (!mtmp->mflee && fleemsg && canseemon(mtmp) if (!mtmp->mflee && fleemsg && canseemon(mtmp)
&& mtmp->m_ap_type != M_AP_FURNITURE && M_AP_TYPE(mtmp) != M_AP_FURNITURE
&& mtmp->m_ap_type != M_AP_OBJECT) { && M_AP_TYPE(mtmp) != M_AP_OBJECT) {
/* unfortunately we can't distinguish between temporary /* unfortunately we can't distinguish between temporary
sleep and temporary paralysis, so both conditions sleep and temporary paralysis, so both conditions
receive the same alternate message */ receive the same alternate message */
+3 -3
View File
@@ -313,7 +313,7 @@ boolean verbose; /* give message(s) even when you can't see what happened */
struct obj *mon_launcher = archer ? MON_WEP(archer) : NULL; struct obj *mon_launcher = archer ? MON_WEP(archer) : NULL;
notonhead = (bhitpos.x != mtmp->mx || bhitpos.y != mtmp->my); notonhead = (bhitpos.x != mtmp->mx || bhitpos.y != mtmp->my);
ismimic = mtmp->m_ap_type && mtmp->m_ap_type != M_AP_MONSTER; ismimic = M_AP_TYPE(mtmp) && M_AP_TYPE(mtmp) != M_AP_MONSTER;
vis = cansee(bhitpos.x, bhitpos.y); vis = cansee(bhitpos.x, bhitpos.y);
tmp = 5 + find_mac(mtmp) + omon_adj(mtmp, otmp, FALSE); tmp = 5 + find_mac(mtmp) + omon_adj(mtmp, otmp, FALSE);
@@ -1073,8 +1073,8 @@ register struct monst *mtmp;
/* hero concealment usually trumps monst awareness of being lined up */ /* hero concealment usually trumps monst awareness of being lined up */
if (Upolyd && rn2(25) if (Upolyd && rn2(25)
&& (u.uundetected || (youmonst.m_ap_type != M_AP_NOTHING && (u.uundetected || (U_AP_TYPE != M_AP_NOTHING
&& youmonst.m_ap_type != M_AP_MONSTER))) && U_AP_TYPE != M_AP_MONSTER)))
return FALSE; return FALSE;
ignore_boulders = (throws_rocks(mtmp->data) ignore_boulders = (throws_rocks(mtmp->data)
+1 -1
View File
@@ -4111,7 +4111,7 @@ const char *
mimic_obj_name(mtmp) mimic_obj_name(mtmp)
struct monst *mtmp; struct monst *mtmp;
{ {
if (mtmp->m_ap_type == M_AP_OBJECT) { if (M_AP_TYPE(mtmp) == M_AP_OBJECT) {
if (mtmp->mappearance == GOLD_PIECE) if (mtmp->mappearance == GOLD_PIECE)
return "gold"; return "gold";
if (mtmp->mappearance != STRANGE_OBJECT) if (mtmp->mappearance != STRANGE_OBJECT)
+16 -11
View File
@@ -89,7 +89,7 @@ char *outbuf;
mons[u.umonnum].mname, plname); mons[u.umonnum].mname, plname);
if (u.usteed) if (u.usteed)
Sprintf(eos(outbuf), ", mounted on %s", y_monnam(u.usteed)); Sprintf(eos(outbuf), ", mounted on %s", y_monnam(u.usteed));
if (u.uundetected || (Upolyd && youmonst.m_ap_type)) if (u.uundetected || (Upolyd && U_AP_TYPE))
mhidden_description(&youmonst, FALSE, eos(outbuf)); mhidden_description(&youmonst, FALSE, eos(outbuf));
return outbuf; return outbuf;
} }
@@ -109,12 +109,12 @@ char *outbuf;
: glyph_at(x, y); : glyph_at(x, y);
*outbuf = '\0'; *outbuf = '\0';
if (mon->m_ap_type == M_AP_FURNITURE if (M_AP_TYPE(mon) == M_AP_FURNITURE
|| mon->m_ap_type == M_AP_OBJECT) { || M_AP_TYPE(mon) == M_AP_OBJECT) {
Strcpy(outbuf, ", mimicking "); Strcpy(outbuf, ", mimicking ");
if (mon->m_ap_type == M_AP_FURNITURE) { if (M_AP_TYPE(mon) == M_AP_FURNITURE) {
Strcat(outbuf, an(defsyms[mon->mappearance].explanation)); Strcat(outbuf, an(defsyms[mon->mappearance].explanation));
} else if (mon->m_ap_type == M_AP_OBJECT } else if (M_AP_TYPE(mon) == M_AP_OBJECT
/* remembered glyph, not glyph_at() which is 'mon' */ /* remembered glyph, not glyph_at() which is 'mon' */
&& glyph_is_object(glyph)) { && glyph_is_object(glyph)) {
objfrommap: objfrommap:
@@ -130,7 +130,7 @@ char *outbuf;
} else { } else {
Strcat(outbuf, something); Strcat(outbuf, something);
} }
} else if (mon->m_ap_type == M_AP_MONSTER) { } else if (M_AP_TYPE(mon) == M_AP_MONSTER) {
if (altmon) if (altmon)
Sprintf(outbuf, ", masquerading as %s", Sprintf(outbuf, ", masquerading as %s",
an(mons[mon->mappearance].mname)); an(mons[mon->mappearance].mname));
@@ -160,7 +160,7 @@ object_from_map(glyph, x, y, obj_p)
int glyph, x, y; int glyph, x, y;
struct obj **obj_p; struct obj **obj_p;
{ {
boolean fakeobj = FALSE; boolean fakeobj = FALSE, mimic_obj = FALSE;
struct monst *mtmp; struct monst *mtmp;
struct obj *otmp; struct obj *otmp;
int glyphotyp = glyph_to_obj(glyph); int glyphotyp = glyph_to_obj(glyph);
@@ -174,9 +174,10 @@ struct obj **obj_p;
/* there might be a mimic here posing as an object */ /* there might be a mimic here posing as an object */
mtmp = m_at(x, y); mtmp = m_at(x, y);
if (mtmp && is_obj_mappear(mtmp, (unsigned) glyphotyp)) if (mtmp && is_obj_mappear(mtmp, (unsigned) glyphotyp)) {
otmp = 0; otmp = 0;
else mimic_obj = TRUE;
} else
mtmp = 0; mtmp = 0;
if (!otmp || otmp->otyp != glyphotyp) { if (!otmp || otmp->otyp != glyphotyp) {
@@ -214,7 +215,11 @@ struct obj **obj_p;
/* terrain mode views what's already known, doesn't learn new stuff */ /* terrain mode views what's already known, doesn't learn new stuff */
&& !iflags.terrainmode) /* so don't set dknown when in terrain mode */ && !iflags.terrainmode) /* so don't set dknown when in terrain mode */
otmp->dknown = 1; /* if a pile, clearly see the top item only */ otmp->dknown = 1; /* if a pile, clearly see the top item only */
if (fakeobj && mtmp && mimic_obj &&
(otmp->dknown || (M_AP_FLAG(mtmp) & M_AP_F_DKNOWN))) {
mtmp->m_ap_type |= M_AP_F_DKNOWN;
otmp->dknown = 1;
}
*obj_p = otmp; *obj_p = otmp;
return fakeobj; /* when True, caller needs to dealloc *obj_p */ return fakeobj; /* when True, caller needs to dealloc *obj_p */
} }
@@ -299,7 +304,7 @@ int x, y;
/* we know the hero sees a monster at this location, but if it's shown /* we know the hero sees a monster at this location, but if it's shown
due to persistant monster detection he might remember something else */ due to persistant monster detection he might remember something else */
if (mtmp->mundetected || mtmp->m_ap_type) if (mtmp->mundetected || M_AP_TYPE(mtmp))
mhidden_description(mtmp, FALSE, eos(buf)); mhidden_description(mtmp, FALSE, eos(buf));
if (monbuf) { if (monbuf) {
+6 -6
View File
@@ -162,7 +162,7 @@ polyman(fmt, arg)
const char *fmt, *arg; const char *fmt, *arg;
{ {
boolean sticky = (sticks(youmonst.data) && u.ustuck && !u.uswallow), boolean sticky = (sticks(youmonst.data) && u.ustuck && !u.uswallow),
was_mimicking = (youmonst.m_ap_type == M_AP_OBJECT); was_mimicking = (U_AP_TYPE == M_AP_OBJECT);
boolean was_blind = !!Blind; boolean was_blind = !!Blind;
if (Upolyd) { if (Upolyd) {
@@ -625,7 +625,7 @@ int mntmp;
} }
/* if stuck mimicking gold, stop immediately */ /* if stuck mimicking gold, stop immediately */
if (multi < 0 && youmonst.m_ap_type == M_AP_OBJECT if (multi < 0 && U_AP_TYPE == M_AP_OBJECT
&& youmonst.data->mlet != S_MIMIC) && youmonst.data->mlet != S_MIMIC)
unmul(""); unmul("");
/* if becoming a non-mimic, stop mimicking anything */ /* if becoming a non-mimic, stop mimicking anything */
@@ -1323,8 +1323,8 @@ dogaze()
pline("%s seems not to notice your gaze.", Monnam(mtmp)); pline("%s seems not to notice your gaze.", Monnam(mtmp));
} else if (mtmp->minvis && !See_invisible) { } else if (mtmp->minvis && !See_invisible) {
You_cant("see where to gaze at %s.", Monnam(mtmp)); You_cant("see where to gaze at %s.", Monnam(mtmp));
} else if (mtmp->m_ap_type == M_AP_FURNITURE } else if (M_AP_TYPE(mtmp) == M_AP_FURNITURE
|| mtmp->m_ap_type == M_AP_OBJECT) { || M_AP_TYPE(mtmp) == M_AP_OBJECT) {
looked--; looked--;
continue; continue;
} else if (flags.safe_dog && mtmp->mtame && !Confusion) { } else if (flags.safe_dog && mtmp->mtame && !Confusion) {
@@ -1432,7 +1432,7 @@ dohide()
: (humanoid(u.ustuck->data) ? "holding someone" : (humanoid(u.ustuck->data) ? "holding someone"
: "holding that creature")); : "holding that creature"));
if (u.uundetected if (u.uundetected
|| (ismimic && youmonst.m_ap_type != M_AP_NOTHING)) { || (ismimic && U_AP_TYPE != M_AP_NOTHING)) {
u.uundetected = 0; u.uundetected = 0;
youmonst.m_ap_type = M_AP_NOTHING; youmonst.m_ap_type = M_AP_NOTHING;
newsym(u.ux, u.uy); newsym(u.ux, u.uy);
@@ -1470,7 +1470,7 @@ dohide()
* else make youhiding() give smarter messages at such spots. * else make youhiding() give smarter messages at such spots.
*/ */
if (u.uundetected || (ismimic && youmonst.m_ap_type != M_AP_NOTHING)) { if (u.uundetected || (ismimic && U_AP_TYPE != M_AP_NOTHING)) {
youhiding(FALSE, 1); /* "you are already hiding" */ youhiding(FALSE, 1); /* "you are already hiding" */
return 0; return 0;
} }
+2 -2
View File
@@ -517,8 +517,8 @@ deserted_shop(enterstring)
continue; continue;
if ((mtmp = m_at(x, y)) != 0) { if ((mtmp = m_at(x, y)) != 0) {
++n; ++n;
if (sensemon(mtmp) || ((mtmp->m_ap_type == M_AP_NOTHING if (sensemon(mtmp) || ((M_AP_TYPE(mtmp) == M_AP_NOTHING
|| mtmp->m_ap_type == M_AP_MONSTER) || M_AP_TYPE(mtmp) == M_AP_MONSTER)
&& canseemon(mtmp))) && canseemon(mtmp)))
++m; ++m;
} }
+2 -2
View File
@@ -1059,8 +1059,8 @@ dochat()
return 0; return 0;
} }
if (!mtmp || mtmp->mundetected || mtmp->m_ap_type == M_AP_FURNITURE if (!mtmp || mtmp->mundetected || M_AP_TYPE(mtmp) == M_AP_FURNITURE
|| mtmp->m_ap_type == M_AP_OBJECT) || M_AP_TYPE(mtmp) == M_AP_OBJECT)
return 0; return 0;
/* sleeping monsters won't talk, except priests (who wake up) */ /* sleeping monsters won't talk, except priests (who wake up) */
+2 -2
View File
@@ -238,8 +238,8 @@ boolean force; /* Quietly force this animal */
/* Can the player reach and see the monster? */ /* Can the player reach and see the monster? */
if (!mtmp || (!force && ((Blind && !Blind_telepat) || mtmp->mundetected if (!mtmp || (!force && ((Blind && !Blind_telepat) || mtmp->mundetected
|| mtmp->m_ap_type == M_AP_FURNITURE || M_AP_TYPE(mtmp) == M_AP_FURNITURE
|| mtmp->m_ap_type == M_AP_OBJECT))) { || M_AP_TYPE(mtmp) == M_AP_OBJECT))) {
pline("I see nobody there."); pline("I see nobody there.");
return (FALSE); return (FALSE);
} }
+3 -3
View File
@@ -632,7 +632,7 @@ int *fail_reason;
if (has_oname(statue) && !unique_corpstat(mon->data)) if (has_oname(statue) && !unique_corpstat(mon->data))
mon = christen_monst(mon, ONAME(statue)); mon = christen_monst(mon, ONAME(statue));
/* mimic statue becomes seen mimic; other hiders won't be hidden */ /* mimic statue becomes seen mimic; other hiders won't be hidden */
if (mon->m_ap_type) if (M_AP_TYPE(mon))
seemimic(mon); seemimic(mon);
else else
mon->mundetected = FALSE; mon->mundetected = FALSE;
@@ -4444,8 +4444,8 @@ boolean force;
return 1; return 1;
} }
if ((mtmp = m_at(x, y)) != 0 if ((mtmp = m_at(x, y)) != 0
&& (mtmp->m_ap_type == M_AP_FURNITURE && (M_AP_TYPE(mtmp) == M_AP_FURNITURE
|| mtmp->m_ap_type == M_AP_OBJECT)) { || M_AP_TYPE(mtmp) == M_AP_OBJECT)) {
stumble_onto_mimic(mtmp); stumble_onto_mimic(mtmp);
return 1; return 1;
} }
+4 -4
View File
@@ -146,7 +146,7 @@ struct obj *wep; /* uwep for attack(), null for kick_monster() */
/* if it was an invisible mimic, treat it as if we stumbled /* if it was an invisible mimic, treat it as if we stumbled
* onto a visible mimic * onto a visible mimic
*/ */
if (mtmp->m_ap_type && !Protection_from_shape_changers if (M_AP_TYPE(mtmp) && !Protection_from_shape_changers
/* applied pole-arm attack is too far to get stuck */ /* applied pole-arm attack is too far to get stuck */
&& distu(mtmp->mx, mtmp->my) <= 2) { && distu(mtmp->mx, mtmp->my) <= 2) {
if (!u.ustuck && !mtmp->mflee && dmgtype(mtmp->data, AD_STCK)) if (!u.ustuck && !mtmp->mflee && dmgtype(mtmp->data, AD_STCK))
@@ -162,7 +162,7 @@ struct obj *wep; /* uwep for attack(), null for kick_monster() */
return TRUE; return TRUE;
} }
if (mtmp->m_ap_type && !Protection_from_shape_changers && !sensemon(mtmp) if (M_AP_TYPE(mtmp) && !Protection_from_shape_changers && !sensemon(mtmp)
&& !glyph_is_warning(glyph)) { && !glyph_is_warning(glyph)) {
/* If a hidden mimic was in a square where a player remembers /* If a hidden mimic was in a square where a player remembers
* some (probably different) unseen monster, the player is in * some (probably different) unseen monster, the player is in
@@ -204,7 +204,7 @@ struct obj *wep; /* uwep for attack(), null for kick_monster() */
* make sure to wake up a monster from the above cases if the * make sure to wake up a monster from the above cases if the
* hero can sense that the monster is there. * hero can sense that the monster is there.
*/ */
if ((mtmp->mundetected || mtmp->m_ap_type) && sensemon(mtmp)) { if ((mtmp->mundetected || M_AP_TYPE(mtmp)) && sensemon(mtmp)) {
mtmp->mundetected = 0; mtmp->mundetected = 0;
wakeup(mtmp, TRUE); wakeup(mtmp, TRUE);
} }
@@ -2993,7 +2993,7 @@ struct monst *mtmp;
if (Blind) { if (Blind) {
if (!Blind_telepat) if (!Blind_telepat)
what = generic; /* with default fmt */ what = generic; /* with default fmt */
else if (mtmp->m_ap_type == M_AP_MONSTER) else if (M_AP_TYPE(mtmp) == M_AP_MONSTER)
what = a_monnam(mtmp); /* differs from what was sensed */ what = a_monnam(mtmp); /* differs from what was sensed */
} else { } else {
int glyph = levl[u.ux + u.dx][u.uy + u.dy].glyph; int glyph = levl[u.ux + u.dx][u.uy + u.dy].glyph;
+2 -2
View File
@@ -412,8 +412,8 @@ invault()
mongone(guard); mongone(guard);
return; return;
} }
if (youmonst.m_ap_type == M_AP_OBJECT || u.uundetected) { if (U_AP_TYPE == M_AP_OBJECT || u.uundetected) {
if (youmonst.m_ap_type == M_AP_OBJECT if (U_AP_TYPE == M_AP_OBJECT
&& youmonst.mappearance != GOLD_PIECE) && youmonst.mappearance != GOLD_PIECE)
if (!Deaf) if (!Deaf)
verbalize("Hey! Who left that %s in here?", verbalize("Hey! Who left that %s in here?",
+4 -4
View File
@@ -144,7 +144,7 @@ struct obj *otmp;
const char *zap_type_text = "spell"; const char *zap_type_text = "spell";
struct obj *obj; struct obj *obj;
boolean disguised_mimic = (mtmp->data->mlet == S_MIMIC boolean disguised_mimic = (mtmp->data->mlet == S_MIMIC
&& mtmp->m_ap_type != M_AP_NOTHING); && M_AP_TYPE(mtmp) != M_AP_NOTHING);
if (u.uswallow && mtmp == u.ustuck) if (u.uswallow && mtmp == u.ustuck)
reveal_invis = FALSE; reveal_invis = FALSE;
@@ -461,7 +461,7 @@ struct obj *otmp;
m_respond(mtmp); m_respond(mtmp);
if (mtmp->isshk && !*u.ushops) if (mtmp->isshk && !*u.ushops)
hot_pursuit(mtmp); hot_pursuit(mtmp);
} else if (mtmp->m_ap_type) } else if (M_AP_TYPE(mtmp))
seemimic(mtmp); /* might unblock if mimicing a boulder/door */ seemimic(mtmp); /* might unblock if mimicing a boulder/door */
} }
/* note: bhitpos won't be set if swallowed, but that's okay since /* note: bhitpos won't be set if swallowed, but that's okay since
@@ -826,7 +826,7 @@ boolean by_hero;
mtmp->mundetected = 0; mtmp->mundetected = 0;
newsym(mtmp->mx, mtmp->my); newsym(mtmp->mx, mtmp->my);
} }
if (mtmp->m_ap_type) if (M_AP_TYPE(mtmp))
seemimic(mtmp); seemimic(mtmp);
one_of = (corpse->quan > 1L); one_of = (corpse->quan > 1L);
@@ -2755,7 +2755,7 @@ boolean youattack, allow_cancel_kill, self_cancel;
} else { } else {
mdef->mcan = 1; mdef->mcan = 1;
/* force shapeshifter into its base form */ /* force shapeshifter into its base form */
if (mdef->m_ap_type != M_AP_NOTHING) if (M_AP_TYPE(mdef) != M_AP_NOTHING)
seemimic(mdef); seemimic(mdef);
/* [not 'else if'; chameleon might have been hiding as a mimic] */ /* [not 'else if'; chameleon might have been hiding as a mimic] */
if (mdef->cham >= LOW_PM) { if (mdef->cham >= LOW_PM) {