Briefly reveal invisible walls, as in CC2

This commit is contained in:
Eevee (Evelyn Woods) 2020-12-08 12:48:25 -07:00
parent 9735ef93e9
commit 4ee56fad01
2 changed files with 17 additions and 1 deletions

View File

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

View File

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