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

Function m_postmove_effect

src/monmove.c:671–683  ·  view source on GitHub ↗

do whatever effects monster has after moving. called for both monsters and polyed hero. for hero, called after location changes, to prevent spam messages for hero getting enveloped in a cloud. for monsters, called before location changes, because monsters don't have "previous location" field */

Source from the content-addressed store, hash-verified

669 for monsters, called before location changes,
670 because monsters don't have "previous location" field */
671void
672m_postmove_effect(struct monst *mtmp)
673{
674 boolean is_u = (mtmp == &gy.youmonst) ? TRUE : FALSE;
675 coordxy x = is_u ? u.ux0 : mtmp->mx,
676 y = is_u ? u.uy0 : mtmp->my;
677
678 /* Hezrous create clouds of stench. This does not cost a move. */
679 if (mtmp->data == &mons[PM_HEZROU]) /* stench */
680 create_gas_cloud(x, y, 1, 8);
681 else if (mtmp->data == &mons[PM_STEAM_VORTEX] && !mtmp->mcan)
682 create_gas_cloud(x, y, 1, 0); /* harmless vapor */
683}
684
685/* returns 1 if monster died moving, 0 otherwise */
686/* The whole dochugw/m_move/distfleeck/mfndpos section is serious spaghetti

Callers 2

domove_coreFunction · 0.85
m_moveFunction · 0.85

Calls 1

create_gas_cloudFunction · 0.85

Tested by

no test coverage detected