lexy w/ skates and cerise now crack but don't slide on cracked ice (fixes #82)

This commit is contained in:
Timothy Stiles 2021-11-18 20:22:00 +11:00
parent d675cddafb
commit a87db67d84
2 changed files with 8 additions and 7 deletions

View File

@ -1881,7 +1881,7 @@ export class Level extends LevelInterface {
// Whether we're sliding is determined entirely by whether we most recently moved onto a
// sliding tile that we don't ignore. This could /almost/ be computed on the fly, except
// that an actor that starts on e.g. ice or a teleporter is not considered sliding.
this._set_tile_prop(actor, 'is_sliding', terrain.type.slide_mode && ! actor.ignores(terrain.type.name));
this._set_tile_prop(actor, 'is_sliding', terrain.type.slide_mode && !actor.ignores(terrain.type.name) && !actor.slide_ignores(terrain.type.name));
// Do Lexy-style hooking here: only attempt to pull things just after we've actually moved
// successfully, which means the hook can never stop us from moving and hook slapping is not
@ -1969,9 +1969,7 @@ export class Level extends LevelInterface {
continue;
if (actor.ignores(tile.type.name))
continue;
if (actor.slide_ignores(tile.type.name))
continue;
if (tile.type.on_approach) {
tile.type.on_approach(tile, this, actor);
}
@ -2036,7 +2034,8 @@ export class Level extends LevelInterface {
continue;
}
}
else if (tile.type.on_arrive) {
else if (tile.type.on_arrive && !actor.slide_ignores(tile.type.name)) {
// Kind of weird putting slide_ignores here, except that all sliding happens on on_arrive, and tiles that make you slide in on_arrive don't do anything else, so for now it works
tile.type.on_arrive(tile, this, actor);
}

View File

@ -3006,7 +3006,8 @@ const TILE_TYPES = {
item_pickup_priority: PICKUP_PRIORITIES.real_player,
can_reveal_walls: true,
movement_speed: 4,
ignores: new Set(['ice', 'ice_nw', 'ice_ne', 'ice_sw', 'ice_se', 'cracked_ice']),
ignores: new Set(['ice', 'ice_nw', 'ice_ne', 'ice_sw', 'ice_se']),
slide_ignores: new Set(['cracked_ice']),
pushes: {
dirt_block: true,
ice_block: true,
@ -3060,7 +3061,8 @@ const TILE_TYPES = {
item_pickup_priority: PICKUP_PRIORITIES.player,
can_reveal_walls: true, // XXX i think?
movement_speed: 4,
ignores: new Set(['ice', 'ice_nw', 'ice_ne', 'ice_sw', 'ice_se', 'cracked_ice']),
ignores: new Set(['ice', 'ice_nw', 'ice_ne', 'ice_sw', 'ice_se']),
slide_ignores: new Set(['cracked_ice']),
pushes: {
dirt_block: true,
ice_block: true,