preserve dknown field between fakeobj instances
Preserve temporary fake object's previous dknown value by storing it as a flag value within the m_ap_type field of the posing monster, and recalling it when it is needed. This is intended to help eliminate observable differences in price display between real objects and mimics posing as objects. 98% of this is just switching the code to utilize macro M_AP_TYPE(mon) everywhere to ensure that the flag bits are stripped off when needed.
This commit is contained in:
@@ -144,7 +144,7 @@ struct obj *otmp;
|
||||
const char *zap_type_text = "spell";
|
||||
struct obj *obj;
|
||||
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)
|
||||
reveal_invis = FALSE;
|
||||
@@ -461,7 +461,7 @@ struct obj *otmp;
|
||||
m_respond(mtmp);
|
||||
if (mtmp->isshk && !*u.ushops)
|
||||
hot_pursuit(mtmp);
|
||||
} else if (mtmp->m_ap_type)
|
||||
} else if (M_AP_TYPE(mtmp))
|
||||
seemimic(mtmp); /* might unblock if mimicing a boulder/door */
|
||||
}
|
||||
/* note: bhitpos won't be set if swallowed, but that's okay since
|
||||
@@ -826,7 +826,7 @@ boolean by_hero;
|
||||
mtmp->mundetected = 0;
|
||||
newsym(mtmp->mx, mtmp->my);
|
||||
}
|
||||
if (mtmp->m_ap_type)
|
||||
if (M_AP_TYPE(mtmp))
|
||||
seemimic(mtmp);
|
||||
|
||||
one_of = (corpse->quan > 1L);
|
||||
@@ -2755,7 +2755,7 @@ boolean youattack, allow_cancel_kill, self_cancel;
|
||||
} else {
|
||||
mdef->mcan = 1;
|
||||
/* force shapeshifter into its base form */
|
||||
if (mdef->m_ap_type != M_AP_NOTHING)
|
||||
if (M_AP_TYPE(mdef) != M_AP_NOTHING)
|
||||
seemimic(mdef);
|
||||
/* [not 'else if'; chameleon might have been hiding as a mimic] */
|
||||
if (mdef->cham >= LOW_PM) {
|
||||
|
||||
Reference in New Issue
Block a user