Partially restore Lynx force floor behavior
This commit is contained in:
parent
ca42dbcf59
commit
9369b2b167
@ -180,6 +180,10 @@ export const COMPAT_FLAGS = [
|
||||
key: 'no_backwards_override',
|
||||
label: "Player can't override backwards on a force floor",
|
||||
rulesets: new Set(['lynx']),
|
||||
}, {
|
||||
key: 'force_floor_only_on_arrive',
|
||||
label: "Force floors only affect actors when stepped on",
|
||||
rulesets: new Set(['lynx', 'ms']),
|
||||
}, {
|
||||
key: 'traps_like_lynx',
|
||||
label: "Traps eject faster, and even when already open",
|
||||
|
||||
@ -1332,7 +1332,7 @@ export class Level extends LevelInterface {
|
||||
return null;
|
||||
if (! terrain.type.get_slide_direction)
|
||||
return null;
|
||||
if (! (actor.is_pending_slide || terrain.type.slide_automatically))
|
||||
if (! actor.is_pending_slide && ! (terrain.type.slide_automatically && ! this.compat.force_floor_only_on_arrive))
|
||||
return null;
|
||||
if (actor.ignores(terrain.type.name))
|
||||
return null;
|
||||
@ -1792,8 +1792,8 @@ export class Level extends LevelInterface {
|
||||
// does NOT act like a bonk (hence why it's here)
|
||||
if (this.compat.no_backwards_override) {
|
||||
let terrain = orig_cell.get_terrain()
|
||||
if (terrain.type.slide_mode === 'force' && ! actor.ignores(terrain.type.name) &&
|
||||
direction === DIRECTIONS[actor.direction].opposite)
|
||||
if (! actor.ignores(terrain.type.name) &&
|
||||
terrain.type.force_floor_direction === DIRECTIONS[direction].opposite)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
@ -62,6 +62,11 @@ function _define_force_floor(direction, opposite_type) {
|
||||
get_slide_direction(me, level, other) {
|
||||
return direction;
|
||||
},
|
||||
force_floor_direction: direction,
|
||||
on_arrive(me, level, other) {
|
||||
// Necessary for compat.force_floor_only_on_arrive, which disables slide_automatically
|
||||
level._set_tile_prop(other, 'is_pending_slide', true);
|
||||
},
|
||||
activate(me, level) {
|
||||
level.transmute_tile(me, opposite_type);
|
||||
},
|
||||
@ -984,6 +989,10 @@ const TILE_TYPES = {
|
||||
return (level.compat.rff_blocks_monsters &&
|
||||
(other.type.collision_mask & COLLISION.monster_typical));
|
||||
},
|
||||
on_arrive(me, level, other) {
|
||||
// Necessary for compat.force_floor_only_on_arrive, which disables slide_automatically
|
||||
level._set_tile_prop(other, 'is_pending_slide', true);
|
||||
},
|
||||
},
|
||||
slime: {
|
||||
layer: LAYERS.terrain,
|
||||
|
||||
Loading…
Reference in New Issue
Block a user