diff --git a/js/defs.js b/js/defs.js index d1bb0dd..0f21e2c 100644 --- a/js/defs.js +++ b/js/defs.js @@ -142,11 +142,11 @@ export const COMPAT_FLAGS = [ { key: 'no_auto_convert_ccl_popwalls', label: "Recessed walls under actors in CCL levels are left alone", - rulesets: new Set(['steam-strict']), + rulesets: new Set(['steam-strict', 'lynx', 'ms']), }, { key: 'no_auto_convert_ccl_blue_walls', label: "Blue walls under blocks in CCL levels are left alone", - rulesets: new Set(['steam-strict']), + rulesets: new Set(['steam-strict', 'lynx', 'ms']), }, // Core @@ -202,9 +202,13 @@ export const COMPAT_FLAGS = [ key: 'traps_like_lynx', label: "Traps eject faster, and even when already open", rulesets: new Set(['lynx']), +}, { + key: 'popwalls_pop_on_arrive', + label: "Recessed walls activate when stepped on", + rulesets: new Set(['lynx', 'ms']), }, { key: 'blue_floors_vanish_on_arrive', - label: "Fake blue walls vanish on arrival", + label: "Fake blue walls vanish when stepped on", rulesets: new Set(['lynx']), }, { key: 'green_teleports_can_fail', diff --git a/js/tiletypes.js b/js/tiletypes.js index b4b29c1..015fe92 100644 --- a/js/tiletypes.js +++ b/js/tiletypes.js @@ -357,16 +357,27 @@ const TILE_TYPES = { me.type = TILE_TYPES['popwall2']; } }, + activate(me, level, other) { + level.spawn_animation(me.cell, 'puff'); + level.transmute_tile(me, 'wall'); + if (other === level.player) { + level.sfx.play_once('popwall', me.cell); + } + }, + on_arrive(me, level, other) { + // Lynx/MS: These activate on arrival, not departure + if (level.compat.popwalls_pop_on_arrive) { + this.activate(me, level, other); + } + }, on_depart(me, level, other) { // CC2 quirk: nothing happens if there's still an actor on us (i.e. dynamite) // FIXME does this imply on_depart isn't called at all if we walk off dynamite? if (me.cell.has('dynamite_lit')) return; - level.spawn_animation(me.cell, 'puff'); - level.transmute_tile(me, 'wall'); - if (other === level.player) { - level.sfx.play_once('popwall', me.cell); + if (! level.compat.popwalls_pop_on_arrive) { + this.activate(me, level, other); } }, },