From 2d7df413eecbb23b76f1179d7221533587dd9984 Mon Sep 17 00:00:00 2001 From: "Eevee (Evelyn Woods)" Date: Mon, 14 Dec 2020 23:59:38 -0700 Subject: [PATCH] Allow ghosts to pass through thin walls --- js/game.js | 4 +++- js/main.js | 2 +- js/tiletypes.js | 3 ++- 3 files changed, 6 insertions(+), 3 deletions(-) diff --git a/js/game.js b/js/game.js index 6ca02c0..b24e25e 100644 --- a/js/game.js +++ b/js/game.js @@ -59,8 +59,10 @@ export class Tile { if (this.type.blocks_collision & other.type.collision_mask) return true; + // FIXME get this out of here if (this.type.thin_walls && - this.type.thin_walls.has(DIRECTIONS[direction].opposite)) + this.type.thin_walls.has(DIRECTIONS[direction].opposite) && + other.type.name !== 'ghost') return true; if (this.type.blocks) diff --git a/js/main.js b/js/main.js index 10089f1..ab93bb7 100644 --- a/js/main.js +++ b/js/main.js @@ -2098,7 +2098,7 @@ class PackTestDialog extends DialogOverlay { if (index === undefined) return; this.close(); - this.conductor.change_level(index); + this.conductor.change_level(parseInt(index, 10)); }); this.main.append( diff --git a/js/tiletypes.js b/js/tiletypes.js index 320d7b7..973a4b3 100644 --- a/js/tiletypes.js +++ b/js/tiletypes.js @@ -40,7 +40,7 @@ function on_ready_force_floor(me, level) { } function blocks_leaving_thin_walls(me, actor, direction) { - return me.type.thin_walls.has(direction); + return me.type.thin_walls.has(direction) && actor.type.name !== 'ghost'; } function player_visual_state(me) { @@ -2276,6 +2276,7 @@ const TILE_TYPES = { is_player: true, is_monster: true, collision_mask: COLLISION.player1, + // FIXME these fuckers should block each OTHER though blocks_collision: COLLISION.all_but_player, has_inventory: true, can_reveal_walls: true, // XXX i think?