New compat flag for making popwalls actually pop on arrival

This commit is contained in:
Eevee (Evelyn Woods) 2024-04-23 02:56:10 -06:00
parent 991704ee19
commit 7e210de5e7
2 changed files with 22 additions and 7 deletions

View File

@ -142,11 +142,11 @@ export const COMPAT_FLAGS = [
{ {
key: 'no_auto_convert_ccl_popwalls', key: 'no_auto_convert_ccl_popwalls',
label: "Recessed walls under actors in CCL levels are left alone", 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', key: 'no_auto_convert_ccl_blue_walls',
label: "Blue walls under blocks in CCL levels are left alone", label: "Blue walls under blocks in CCL levels are left alone",
rulesets: new Set(['steam-strict']), rulesets: new Set(['steam-strict', 'lynx', 'ms']),
}, },
// Core // Core
@ -202,9 +202,13 @@ export const COMPAT_FLAGS = [
key: 'traps_like_lynx', key: 'traps_like_lynx',
label: "Traps eject faster, and even when already open", label: "Traps eject faster, and even when already open",
rulesets: new Set(['lynx']), 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', 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']), rulesets: new Set(['lynx']),
}, { }, {
key: 'green_teleports_can_fail', key: 'green_teleports_can_fail',

View File

@ -357,16 +357,27 @@ const TILE_TYPES = {
me.type = TILE_TYPES['popwall2']; 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) { on_depart(me, level, other) {
// CC2 quirk: nothing happens if there's still an actor on us (i.e. dynamite) // 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? // FIXME does this imply on_depart isn't called at all if we walk off dynamite?
if (me.cell.has('dynamite_lit')) if (me.cell.has('dynamite_lit'))
return; return;
level.spawn_animation(me.cell, 'puff'); if (! level.compat.popwalls_pop_on_arrive) {
level.transmute_tile(me, 'wall'); this.activate(me, level, other);
if (other === level.player) {
level.sfx.play_once('popwall', me.cell);
} }
}, },
}, },