Implement appearing walls and popwalls

This commit is contained in:
Eevee (Evelyn Woods) 2020-08-29 00:30:01 -06:00
parent 576a7b0c26
commit a50de91195
2 changed files with 18 additions and 0 deletions

View File

@ -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;

View File

@ -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']),