Make turntables slide actors out of them and toggle on edge flip
Also fix the default display of unpowered tiles while I'm in here.
This commit is contained in:
parent
59d26e6a00
commit
db34ca72f9
10
js/game.js
10
js/game.js
@ -1159,6 +1159,10 @@ export class Level extends LevelInterface {
|
|||||||
if (actor.pending_push) {
|
if (actor.pending_push) {
|
||||||
this._set_tile_prop(actor, 'pending_push', null);
|
this._set_tile_prop(actor, 'pending_push', null);
|
||||||
}
|
}
|
||||||
|
// Turntable slide wears off after a single /attempted/ move
|
||||||
|
if (actor.slide_mode === 'turntable') {
|
||||||
|
this.make_slide(actor, null);
|
||||||
|
}
|
||||||
|
|
||||||
// Actor is allowed to move, so do so
|
// Actor is allowed to move, so do so
|
||||||
let success = this.attempt_step(actor, direction);
|
let success = this.attempt_step(actor, direction);
|
||||||
@ -1719,6 +1723,12 @@ export class Level extends LevelInterface {
|
|||||||
}
|
}
|
||||||
|
|
||||||
attempt_out_of_turn_step(actor, direction, frameskip = 0) {
|
attempt_out_of_turn_step(actor, direction, frameskip = 0) {
|
||||||
|
if (actor.slide_mode === 'turntable') {
|
||||||
|
// Something is (e.g.) pushing a block that just landed on a turntable and is waiting to
|
||||||
|
// slide out of it. Ignore the push direction and move in its current direction;
|
||||||
|
// otherwise a player will push a block straight through, then turn, which sucks
|
||||||
|
direction = actor.direction;
|
||||||
|
}
|
||||||
let success = this.attempt_step(actor, direction, frameskip);
|
let success = this.attempt_step(actor, direction, frameskip);
|
||||||
if (success) {
|
if (success) {
|
||||||
this._do_extra_cooldown(actor);
|
this._do_extra_cooldown(actor);
|
||||||
|
|||||||
@ -1274,7 +1274,7 @@ export const LL_TILESET_LAYOUT = {
|
|||||||
swivel_nw: [7, 14],
|
swivel_nw: [7, 14],
|
||||||
dash_floor: {
|
dash_floor: {
|
||||||
__special__: 'animated',
|
__special__: 'animated',
|
||||||
duration: 16,
|
duration: 24,
|
||||||
all: [[0, 15], [1, 15], [2, 15], [3, 15], [4, 15], [5, 15], [6, 15], [7, 15]],
|
all: [[0, 15], [1, 15], [2, 15], [3, 15], [4, 15], [5, 15], [6, 15], [7, 15]],
|
||||||
},
|
},
|
||||||
|
|
||||||
@ -1415,26 +1415,20 @@ export const LL_TILESET_LAYOUT = {
|
|||||||
__special__: 'wires',
|
__special__: 'wires',
|
||||||
base: [0, 2],
|
base: [0, 2],
|
||||||
wired: {
|
wired: {
|
||||||
__special__: 'visual-state',
|
|
||||||
active: {
|
|
||||||
__special__: 'animated',
|
__special__: 'animated',
|
||||||
duration: 16,
|
duration: 12,
|
||||||
|
cc2_duration: 16,
|
||||||
all: [[8, 21], [9, 21], [10, 21], [11, 21]],
|
all: [[8, 21], [9, 21], [10, 21], [11, 21]],
|
||||||
},
|
|
||||||
inactive: [8, 21],
|
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
turntable_ccw: {
|
turntable_ccw: {
|
||||||
__special__: 'wires',
|
__special__: 'wires',
|
||||||
base: [0, 2],
|
base: [0, 2],
|
||||||
wired: {
|
wired: {
|
||||||
__special__: 'visual-state',
|
|
||||||
active: {
|
|
||||||
__special__: 'animated',
|
__special__: 'animated',
|
||||||
duration: 16,
|
duration: 12,
|
||||||
|
cc2_duration: 16,
|
||||||
all: [[8, 22], [9, 22], [10, 22], [11, 22]],
|
all: [[8, 22], [9, 22], [10, 22], [11, 22]],
|
||||||
},
|
|
||||||
inactive: [8, 22],
|
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
flame_jet_off: [12, 21],
|
flame_jet_off: [12, 21],
|
||||||
|
|||||||
@ -713,64 +713,34 @@ const TILE_TYPES = {
|
|||||||
turntable_cw: {
|
turntable_cw: {
|
||||||
layer: LAYERS.terrain,
|
layer: LAYERS.terrain,
|
||||||
wire_propagation_mode: 'all',
|
wire_propagation_mode: 'all',
|
||||||
// Not actually a teleporter, but we use the same slide type
|
|
||||||
teleport_allow_override: true,
|
|
||||||
on_begin(me, level) {
|
|
||||||
update_wireable(me, level);
|
|
||||||
},
|
|
||||||
on_arrive(me, level, other) {
|
on_arrive(me, level, other) {
|
||||||
if (! me.is_active)
|
|
||||||
return;
|
|
||||||
level.set_actor_direction(other, DIRECTIONS[other.direction].right);
|
level.set_actor_direction(other, DIRECTIONS[other.direction].right);
|
||||||
if (other.type.on_rotate) {
|
if (other.type.on_rotate) {
|
||||||
other.type.on_rotate(other, level, 'right');
|
other.type.on_rotate(other, level, 'right');
|
||||||
}
|
}
|
||||||
level.make_slide(other, 'teleport-forever');
|
level.make_slide(other, 'turntable');
|
||||||
},
|
},
|
||||||
on_power(me, level) {
|
activate(me, level) {
|
||||||
if (me.is_wired) {
|
level.transmute_tile(me, 'turntable_ccw');
|
||||||
level._set_tile_prop(me, 'is_active', true);
|
|
||||||
}
|
|
||||||
},
|
|
||||||
on_depower(me, level) {
|
|
||||||
if (me.is_wired) {
|
|
||||||
level._set_tile_prop(me, 'is_active', false);
|
|
||||||
}
|
|
||||||
},
|
|
||||||
visual_state(me) {
|
|
||||||
return ! me || me.is_active ? 'active' : 'inactive';
|
|
||||||
},
|
},
|
||||||
|
on_gray_button: activate_me,
|
||||||
|
on_power: activate_me,
|
||||||
},
|
},
|
||||||
turntable_ccw: {
|
turntable_ccw: {
|
||||||
layer: LAYERS.terrain,
|
layer: LAYERS.terrain,
|
||||||
wire_propagation_mode: 'all',
|
wire_propagation_mode: 'all',
|
||||||
// Not actually a teleporter, but we use the same slide type
|
|
||||||
teleport_allow_override: true,
|
|
||||||
on_begin(me, level) {
|
|
||||||
update_wireable(me, level);
|
|
||||||
},
|
|
||||||
on_arrive(me, level, other) {
|
on_arrive(me, level, other) {
|
||||||
if (! me.is_active)
|
|
||||||
return;
|
|
||||||
level.set_actor_direction(other, DIRECTIONS[other.direction].left);
|
level.set_actor_direction(other, DIRECTIONS[other.direction].left);
|
||||||
if (other.type.on_rotate) {
|
if (other.type.on_rotate) {
|
||||||
other.type.on_rotate(other, level, 'left');
|
other.type.on_rotate(other, level, 'left');
|
||||||
}
|
}
|
||||||
level.make_slide(other, 'teleport-forever');
|
level.make_slide(other, 'turntable');
|
||||||
},
|
},
|
||||||
on_power(me, level) {
|
activate(me, level) {
|
||||||
if (me.is_wired) {
|
level.transmute_tile(me, 'turntable_cw');
|
||||||
level._set_tile_prop(me, 'is_active', true);
|
|
||||||
}
|
|
||||||
},
|
|
||||||
on_depower(me, level) {
|
|
||||||
if (me.is_wired) {
|
|
||||||
level._set_tile_prop(me, 'is_active', false);
|
|
||||||
}
|
|
||||||
},
|
|
||||||
visual_state(me) {
|
|
||||||
return ! me || me.is_active ? 'active' : 'inactive';
|
|
||||||
},
|
},
|
||||||
|
on_gray_button: activate_me,
|
||||||
|
on_power: activate_me,
|
||||||
},
|
},
|
||||||
|
|
||||||
// Hazards
|
// Hazards
|
||||||
@ -1738,7 +1708,7 @@ const TILE_TYPES = {
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
visual_state(me) {
|
visual_state(me) {
|
||||||
return ! me || me.is_active ? 'active' : 'inactive';
|
return me && me.is_active === false ? 'inactive' : 'active';
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
teleport_blue: {
|
teleport_blue: {
|
||||||
@ -1876,7 +1846,7 @@ const TILE_TYPES = {
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
visual_state(me) {
|
visual_state(me) {
|
||||||
return ! me || me.is_active ? 'active' : 'inactive';
|
return me && me.is_active === false ? 'inactive' : 'active';
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
teleport_green: {
|
teleport_green: {
|
||||||
@ -2006,7 +1976,7 @@ const TILE_TYPES = {
|
|||||||
level.recalculate_circuitry_next_wire_phase = true;
|
level.recalculate_circuitry_next_wire_phase = true;
|
||||||
},
|
},
|
||||||
visual_state(me) {
|
visual_state(me) {
|
||||||
return ! me || me.is_active ? 'active' : 'inactive';
|
return me && me.is_active === false ? 'inactive' : 'active';
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
|
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user