MCPcopy Create free account
hub / github.com/NetHack/NetHack / do_stone_mon

Function do_stone_mon

src/uhitm.c:3944–3978  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

3942}
3943
3944void
3945do_stone_mon(
3946 struct monst *magr,
3947 struct attack *mattk,
3948 struct monst *mdef, struct mhitm_data *mhm)
3949{
3950 struct permonst *pd = mdef->data;
3951
3952 /* may die from the acid if it eats a stone-curing corpse */
3953 if (munstone(mdef, FALSE))
3954 goto post_stone;
3955 if (poly_when_stoned(pd)) {
3956 mon_to_stone(mdef);
3957 mhm->damage = 0;
3958 return;
3959 }
3960 if (!resists_ston(mdef)) {
3961 if (gv.vis && canseemon(mdef))
3962 pline_mon(mdef, "%s turns to stone!", Monnam(mdef));
3963 monstone(mdef);
3964 post_stone:
3965 if (!DEADMONSTER(mdef)) {
3966 mhm->hitflags = M_ATTK_MISS;
3967 mhm->done = TRUE;
3968 return;
3969 } else if (mdef->mtame && !gv.vis) {
3970 You(brief_feeling, "peculiarly sad");
3971 }
3972 mhm->hitflags = (M_ATTK_DEF_DIED
3973 | (grow_up(magr, mdef) ? 0 : M_ATTK_AGR_DIED));
3974 mhm->done = TRUE;
3975 return;
3976 }
3977 mhm->damage = (mattk->adtyp == AD_STON ? 0 : 1);
3978}
3979
3980void
3981mhitm_ad_phys(

Callers 2

mhitm_ad_physFunction · 0.85
mhitm_ad_stonFunction · 0.85

Calls 9

munstoneFunction · 0.85
poly_when_stonedFunction · 0.85
mon_to_stoneFunction · 0.85
canseemonFunction · 0.85
pline_monFunction · 0.85
MonnamFunction · 0.85
monstoneFunction · 0.85
YouFunction · 0.85
grow_upFunction · 0.85

Tested by

no test coverage detected