NetHack / NetHack

Official NetHack Git Repository

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Eating Medusa while temporarily stoning-resistant

Umbire opened this issue · comments

As of 3.7, with certain corpses conferring temporary stoning resistance, it's become possible to eat Medusa's corpse after killing her in the standard fashion of HP damage. In particular, during my ongoing Rogue game I decided I'd eat a source of said stoning resistance (a lizard corpse) and then eat her corpse afterward, putting on an AoLS in case it expired midway and I was turned to stone as a result.

So you can imagine my mild surprise when this turned out to not be the case. ais523 was present at the time and asked me to report it as an issue, so here we are - I think a desirable fix would be to make you stop eating a meal that would turn you to stone the instant your temporary stoning resistance expires (since if you have stoning resistance from polyform or YDSM, it's a moot point).

Are you saying that you did turn to stone, or just that you expected to stop eating and that didn't happen?

     For what do you wish? lizard corpse
     f - a lizard corpse.
     What do you want to eat? [f or ?*] f
     This lizard corpse tastes terrible!
     You finish eating the lizard corpse.
     You feel less concerned about becoming petrified.
     For what do you wish? medusa corpse
     Oops!  Medusa's corpse drops to the floor!
     There is Medusa's corpse here; eat it? [ynq] (n) y
     Ecch - that must have been poisonous!
     You no longer feel secure from petrification.
     You finish eating Medusa's corpse.  You feel healthy.

It is not a case of continuing to eat after becoming vulnerable. The eating code explicitly extends the duration of the temporary resistance turn by turn until the threatening meal is finished. If you get interrupted, that is effectively finishing; you will not be able to safely resume the same meal.

I think the only issue here is message sequencing: the intrinsic timeout message is delivered at the start of the turn while the occupation finish messages are delayed until the next turn (or possibly just shown later in the same turn; I'm not sure off the top of my head). It may need to extend the timeout one extra time, in order to have the no-longer-secure message come after.

Never mind. The message sequencing was ok. The code to extend temporary stoning resistance when eating a where it matters was checking touch_petrifies(), which covers cockatrices but not Medusa so it actually was timing out in the middle of the meal and allowing that meal to continue anyway. Changing that to check flesh_petrifies() will fix the extension to temporary resistance so that it won't end until the meal has ended or been interrupted.

Are you saying that you did turn to stone, or just that you expected to stop eating and that didn't happen?

Late answer, so sorry, genuinely apologize. But for sake of completeness: I expected to turn to stone (hence the AoLS) and was pleasantly surprised to discover I did not.