From 4ee56fad013cf83c2daa88ebd911f44bcbf56f8f Mon Sep 17 00:00:00 2001 From: "Eevee (Evelyn Woods)" Date: Tue, 8 Dec 2020 12:48:25 -0700 Subject: [PATCH] Briefly reveal invisible walls, as in CC2 --- js/tileset.js | 3 +++ js/tiletypes.js | 15 ++++++++++++++- 2 files changed, 17 insertions(+), 1 deletion(-) diff --git a/js/tileset.js b/js/tileset.js index ef564f8..0382098 100644 --- a/js/tileset.js +++ b/js/tileset.js @@ -72,6 +72,8 @@ export const CC2_TILESET_LAYOUT = { hidden: [0, 2], revealed: [9, 31], }, + // FIXME this shouldn't be visible with seeing eye (or should it not spawn at all?) + wall_invisible_revealed: [1, 2], wall_appearing: { special: 'perception', threshold: 2, @@ -627,6 +629,7 @@ export const TILE_WORLD_TILESET_LAYOUT = { water: [0, 3], fire: [0, 4], wall_invisible: [0, 5], + wall_invisible_revealed: [0, 1], thinwall_n: [0, 6], thinwall_w: [0, 7], thinwall_s: [0, 8], diff --git a/js/tiletypes.js b/js/tiletypes.js index 5a3114d..51d2598 100644 --- a/js/tiletypes.js +++ b/js/tiletypes.js @@ -175,8 +175,12 @@ const TILE_TYPES = { }, wall_invisible: { draw_layer: DRAW_LAYERS.terrain, - // FIXME cc2 seems to make these flicker briefly blocks_collision: COLLISION.all_but_ghost, + on_bump(me, level, other) { + if (other.type.can_reveal_walls) { + level.spawn_animation(me.cell, 'wall_invisible_revealed'); + } + }, }, wall_appearing: { draw_layer: DRAW_LAYERS.terrain, @@ -2155,6 +2159,15 @@ const TILE_TYPES = { blocks_collision: COLLISION.player, ttl: 6, }, + // Used as an easy way to show an invisible wall when bumped + wall_invisible_revealed: { + draw_layer: DRAW_LAYERS.terrain, + is_actor: true, + collision_mask: 0, + blocks_collision: 0, + // determined experimentally + ttl: 12, + }, // Custom VFX (identical function, but different aesthetic) splash_slime: { draw_layer: DRAW_LAYERS.overlay,