New compat flag for making popwalls actually pop on arrival
This commit is contained in:
parent
991704ee19
commit
7e210de5e7
10
js/defs.js
10
js/defs.js
@ -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',
|
||||||
|
|||||||
@ -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);
|
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user