Add a teleport flash
This commit is contained in:
parent
1e79704f70
commit
f6f83a45f1
@ -1532,8 +1532,8 @@ export class Level extends LevelInterface {
|
|||||||
let dest, direction;
|
let dest, direction;
|
||||||
for ([dest, direction] of teleporter.type.teleport_dest_order(teleporter, this, actor)) {
|
for ([dest, direction] of teleporter.type.teleport_dest_order(teleporter, this, actor)) {
|
||||||
// Teleporters already containing an actor are blocked and unusable
|
// Teleporters already containing an actor are blocked and unusable
|
||||||
// FIXME should check collision?
|
// FIXME should check collision? otherwise this catches non-blocking vfx...
|
||||||
if (dest.cell.some(tile => tile.type.is_actor && tile !== actor))
|
if (dest.cell.some(tile => tile.type.is_actor && tile !== actor && ! tile.type.ttl))
|
||||||
continue;
|
continue;
|
||||||
|
|
||||||
// XXX lynx treats this as a slide and does it in a pass in the main loop
|
// 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.set_actor_direction(actor, direction);
|
||||||
this.make_slide(actor, 'teleport');
|
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
|
// Now physically move the actor, but their movement waits until next decision phase
|
||||||
this.remove_tile(actor);
|
this.remove_tile(actor);
|
||||||
this.add_tile(actor, dest.cell);
|
this.add_tile(actor, dest.cell);
|
||||||
|
|||||||
@ -882,6 +882,7 @@ export const LL_TILESET_LAYOUT = Object.assign({}, CC2_TILESET_LAYOUT, {
|
|||||||
|
|
||||||
// Custom VFX
|
// Custom VFX
|
||||||
splash_slime: [[0, 38], [1, 38], [2, 38], [3, 38]],
|
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]],
|
player1_exit: [[8, 38], [9, 38], [10, 38], [11, 38]],
|
||||||
player2_exit: [[12, 38], [13, 38], [14, 38], [15, 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],
|
gate_green: [3, 39],
|
||||||
|
|
||||||
skeleton_key: [4, 39],
|
skeleton_key: [4, 39],
|
||||||
|
|
||||||
});
|
});
|
||||||
|
|
||||||
export class Tileset {
|
export class Tileset {
|
||||||
|
|||||||
@ -2693,6 +2693,13 @@ const TILE_TYPES = {
|
|||||||
collision_mask: 0,
|
collision_mask: 0,
|
||||||
ttl: 8 * 3,
|
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
|
// Invalid tiles that appear in some CCL levels because community level
|
||||||
// designers love to make nonsense
|
// designers love to make nonsense
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user