diff --git a/js/game.js b/js/game.js index af62471..9e82dbf 100644 --- a/js/game.js +++ b/js/game.js @@ -1532,8 +1532,8 @@ export class Level extends LevelInterface { let dest, direction; for ([dest, direction] of teleporter.type.teleport_dest_order(teleporter, this, actor)) { // Teleporters already containing an actor are blocked and unusable - // FIXME should check collision? - if (dest.cell.some(tile => tile.type.is_actor && tile !== actor)) + // FIXME should check collision? otherwise this catches non-blocking vfx... + if (dest.cell.some(tile => tile.type.is_actor && tile !== actor && ! tile.type.ttl)) continue; // XXX lynx treats this as a slide and does it in a pass in the main loop @@ -1563,6 +1563,9 @@ export class Level extends LevelInterface { this.set_actor_direction(actor, direction); this.make_slide(actor, 'teleport'); + this.spawn_animation(actor.cell, 'teleport_flash'); + this.spawn_animation(dest.cell, 'teleport_flash'); + // Now physically move the actor, but their movement waits until next decision phase this.remove_tile(actor); this.add_tile(actor, dest.cell); diff --git a/js/tileset.js b/js/tileset.js index b62eaf6..a9ef498 100644 --- a/js/tileset.js +++ b/js/tileset.js @@ -882,6 +882,7 @@ export const LL_TILESET_LAYOUT = Object.assign({}, CC2_TILESET_LAYOUT, { // Custom VFX splash_slime: [[0, 38], [1, 38], [2, 38], [3, 38]], + teleport_flash: [[4, 38], [5, 38], [6, 38], [7, 38]], player1_exit: [[8, 38], [9, 38], [10, 38], [11, 38]], player2_exit: [[12, 38], [13, 38], [14, 38], [15, 38]], @@ -892,7 +893,6 @@ export const LL_TILESET_LAYOUT = Object.assign({}, CC2_TILESET_LAYOUT, { gate_green: [3, 39], skeleton_key: [4, 39], - }); export class Tileset { diff --git a/js/tiletypes.js b/js/tiletypes.js index f352e60..f934234 100644 --- a/js/tiletypes.js +++ b/js/tiletypes.js @@ -2693,6 +2693,13 @@ const TILE_TYPES = { collision_mask: 0, ttl: 8 * 3, }, + teleport_flash: { + // TODO probably not the right layer, vfx might need their own idk + draw_layer: DRAW_LAYERS.actor, + is_actor: true, + collision_mask: 0, + ttl: 8 * 3, + }, // Invalid tiles that appear in some CCL levels because community level // designers love to make nonsense