diff --git a/js/main.js b/js/main.js index 2615881..1fcbc8c 100644 --- a/js/main.js +++ b/js/main.js @@ -414,6 +414,18 @@ class Level { original_cell.is_dirty = true; goal_cell.is_dirty = true; + // Announce we're leaving, for the handful of tiles that care about it + original_cell.each(tile => { + if (tile === actor) + return; + if (actor.ignores(tile.type.name)) + return; + + if (tile.type.on_depart) { + tile.type.on_depart(tile, this, actor); + } + }); + // Step on all the tiles in the new cell if (actor === this.player) { this.hint_shown = null; diff --git a/js/tiletypes.js b/js/tiletypes.js index 1abe4af..a9105e1 100644 --- a/js/tiletypes.js +++ b/js/tiletypes.js @@ -12,8 +12,14 @@ const TILE_TYPES = { }, wall_appearing: { blocks: true, + on_bump(me, level, other) { + me.become('wall'); + } }, popwall: { + on_depart(me, level, other) { + me.become('wall'); + } }, thinwall_n: { thin_walls: new Set(['north']),