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

Function m_everyturn_effect

src/monmove.c:649–663  ·  view source on GitHub ↗

called every turn for each living monster on the map, and the hero; caller makes sure that we're not called for DEADMONSTER() */

Source from the content-addressed store, hash-verified

647/* called every turn for each living monster on the map, and the hero;
648 caller makes sure that we're not called for DEADMONSTER() */
649void
650m_everyturn_effect(struct monst *mtmp)
651{
652 boolean is_u = (mtmp == &gy.youmonst) ? TRUE : FALSE;
653 coordxy x = is_u ? u.ux : mtmp->mx,
654 y = is_u ? u.uy : mtmp->my;
655
656 if (mtmp->data == &mons[PM_FOG_CLOUD]) {
657 /* don't leave a vapor cloud if some other gas cloud is already
658 present, or when flowing under closed doors so that visibility
659 changes aren't mixed with messages about doing such */
660 if (!closed_door(x, y) && !visible_region_at(x, y))
661 create_gas_cloud(x, y, 1, 0); /* harmless vapor */
662 }
663}
664
665/* do whatever effects monster has after moving.
666 called for both monsters and polyed hero.

Callers 2

allmain.cFile · 0.85
movemon_singlemonFunction · 0.85

Calls 3

closed_doorFunction · 0.85
visible_region_atFunction · 0.85
create_gas_cloudFunction · 0.85

Tested by

no test coverage detected