BrogueCE icon indicating copy to clipboard operation
BrogueCE copied to clipboard

Entranced monsters don't make movements in webs/nets

Open tmewett opened this issue 4 years ago • 2 comments

/u/xorwich:

Bug (I assume): an entranced enemy stuck in a spider web didn't attack the adjacent spider or begin to un-stick itself as my movements should have made it

Needs further investigation.

tmewett avatar Sep 28 '21 22:09 tmewett

Confirmed. This appears to be intentional. I did a quick test by removing the STATUS_STUCK check below in Movement.c, and the behavior was as expected. The monster successively got less stuck on each player movement and also attacked an adjacent monster.

void moveEntrancedMonsters(enum directions dir) {
    dir = oppositeDirection(dir);

    for (creatureIterator it = iterateCreatures(monsters); hasNextCreature(it);) {
        creature *monst = nextCreature(&it);
        monst->bookkeepingFlags &= ~MB_HAS_ENTRANCED_MOVED;
    }

    for (creatureIterator it = iterateCreatures(monsters); hasNextCreature(it);) {
        creature *monst = nextCreature(&it);
        if (!(monst->bookkeepingFlags & MB_HAS_ENTRANCED_MOVED)
            && monst->status[STATUS_ENTRANCED]
            && !monst->status[STATUS_STUCK]
            && !monst->status[STATUS_PARALYZED]
            && !(monst->bookkeepingFlags & MB_CAPTIVE)) {

            moveMonster(monst, nbDirs[dir][0], nbDirs[dir][1]);
            monst->bookkeepingFlags |= MB_HAS_ENTRANCED_MOVED;
            restartIterator(&it); // loop through from the beginning to be safe
        }
    }
}

zenzombie avatar Nov 14 '21 03:11 zenzombie

Confirmed. This appears to be intentional. I did a quick test by removing the STATUS_STUCK check below in Movement.c, and the behavior was as expected. The monster successively got less stuck on each player movement and also attacked an adjacent monster.

I have no idea why this behavior would have been intended, for whatever it's worth... intuitively it does seem like entranced creatures stuck in webs should attempt to move. Maybe I included !monst->status[STATUS_STUCK] inadvertently.

pender avatar Feb 17 '22 21:02 pender