From 582a875c52292a51f054daeb816e87d6d0fa466b Mon Sep 17 00:00:00 2001 From: "Eevee (Evelyn Woods)" Date: Sat, 19 Sep 2020 22:53:38 -0600 Subject: [PATCH] Don't use "ignores" to override blocking; it breaks ice corners --- js/game.js | 21 ++++++++++----------- js/tiletypes.js | 2 +- 2 files changed, 11 insertions(+), 12 deletions(-) diff --git a/js/game.js b/js/game.js index 99eb151..8f17337 100644 --- a/js/game.js +++ b/js/game.js @@ -138,7 +138,6 @@ export class Cell extends Array { blocks_entering(actor, direction, level, ignore_pushables = false) { for (let tile of this) { if (tile.blocks(actor, direction, level) && - ! actor.ignores(tile.type.name) && ! (ignore_pushables && actor.can_push(tile))) { return true; @@ -660,6 +659,16 @@ export class Level { let has_slide_tile = false; let blocked_by_pushable = false; for (let tile of goal_cell) { + if (tile.blocks(actor, direction, this)) { + if (actor.can_push(tile)) { + blocked_by_pushable = true; + } + else { + blocked = true; + // Don't break here, because we might still want to bump other tiles + } + } + if (actor.ignores(tile.type.name)) continue; @@ -672,16 +681,6 @@ export class Level { if (tile.type.on_bump) { tile.type.on_bump(tile, this, actor); } - - if (tile.blocks(actor, direction, this)) { - if (actor.can_push(tile)) { - blocked_by_pushable = true; - } - else { - blocked = true; - break; - } - } } if (has_slide_tile) { diff --git a/js/tiletypes.js b/js/tiletypes.js index fa90ce5..a2aa709 100644 --- a/js/tiletypes.js +++ b/js/tiletypes.js @@ -939,7 +939,6 @@ const TILE_TYPES = { blocks_blocks: true, movement_mode: 'turn-right', movement_speed: 4, - ignores: new Set(['wall']), // TODO ignores /most/ walls. collision is basically completely different. has a regular inventory, except red key. good grief }, floor_mimic: { @@ -1079,6 +1078,7 @@ const TILE_TYPES = { is_tool: true, blocks_monsters: true, blocks_blocks: true, + // FIXME this doesn't work any more, need to put it in railroad blocks impl item_ignores: new Set(['railroad']), }, foil: {