Hidden (object-form) mimics aren't hit by thrown objects

This is both a bugfix (the hero would be unlikely to aim their
throw at what appeared to be an object) and a balance fix (it was
possible to, somewhat tediously, defend yourself from mimics by
throwing gold pieces at them, and for many players this became
standard strategy in shops, negating the threat from mimics).
This commit is contained in:
Alex Smith
2025-05-29 18:15:24 +01:00
parent 47724f0137
commit 90e3abdf9b

View File

@@ -3957,9 +3957,15 @@ bhit(
give message and skip it in order to keep going;
if attack is light and mtmp is a mimic pretending to be an
object, behave as if there is no monster here (if pretending
to be furniture, it will be revealed by flash_hits_mon()) */
to be furniture, it will be revealed by flash_hits_mon());
thrown objects don't hit mimics pretending to be objects (both
because the hero is likely aiming to throw over what seems to
be an object rather than at it, and for balance because
otherwise mimics are too easy to identify by throwing gold at
them) */
if (mtmp && (((weapon == THROWN_WEAPON || weapon == KICKED_WEAPON)
&& shade_miss(&gy.youmonst, mtmp, obj, TRUE, TRUE))
&& (shade_miss(&gy.youmonst, mtmp, obj, TRUE, TRUE)
|| M_AP_TYPE(mtmp) == M_AP_OBJECT))
|| (weapon == FLASHED_LIGHT
&& M_AP_TYPE(mtmp) == M_AP_OBJECT)))
mtmp = (struct monst *) 0;