tmewett / BrogueCE

Brogue: Community Edition - a community-lead fork of the much-loved minimalist roguelike game
https://sites.google.com/site/broguegame/
GNU Affero General Public License v3.0
942 stars 100 forks source link

Mangrove Dryad doesn't avoid known net trap triggers #693

Open brturn opened 1 month ago

brturn commented 1 month ago

https://discord.com/channels/205277826788622337/205347357745872896/1235060363742150776

image

brturn commented 1 month ago
(Monsters.c @ 1451)
    // gas or other environmental traps
    if ((tFlags & T_IS_DF_TRAP & ~terrainImmunities)
       …
       && (!(tFlags & T_ENTANGLES) || !(monst->info.flags & MONST_IMMUNE_TO_WEBS))) {

 (Time.c @ 219)
…
  && cellHasTerrainFlag((pos){ *x, *y }, T_IS_DF_TRAP)
  && !(pmap[*x][*y].flags & PRESSURE_PLATE_DEPRESSED)) {

Looking into this one.

If I’m reading this correctly, several conditions in monsterAvoids() check for tangling terrain, which I’m assuming would come from a nearby net trap or spider. If there a net/web covering the pressure plate, then the monster treats the space like a net/web tile instead of a pressure plate.

This allows behaviors like monsters climbing across chasms on webs.

The Mangrove Dryad is immune to webs, so if a net/web covers a pressure plate, the dryad will ignore the pressure plate and treat the tile like a net/web, thus triggering the trap repeatedly.

Seems like the fix here is to avoid a tile if you would avoid any part of the tile (nets or plates). But if that fix were to be applied generally, it would break the chasm crossing behavior.

Another fix would be to make pressure plates not trigger if they are covered by a net/web. This changes an existing game behavior which is relatively common in my experience.

So I think this fix should check pressure plates separately from nets, and avoid the tile if the monster would avoid any of them. I can’t think of a reason for a monster to ignore pressure plates with webs over them…?