Make turntables eject their contents
This commit is contained in:
parent
0be59c21eb
commit
e5fd2b67da
@ -1930,6 +1930,8 @@ export class Level extends LevelInterface {
|
|||||||
// Curious special-case red teleporter behavior: if you pass through a wired but
|
// Curious special-case red teleporter behavior: if you pass through a wired but
|
||||||
// inactive one, you keep sliding indefinitely. Players can override out of it, but
|
// inactive one, you keep sliding indefinitely. Players can override out of it, but
|
||||||
// other actors cannot. (Normally, a teleport slide ends after one decision phase.)
|
// other actors cannot. (Normally, a teleport slide ends after one decision phase.)
|
||||||
|
// XXX this is useful when the exit is briefly blocked, but it can also get monsters
|
||||||
|
// stuck forever :(
|
||||||
this.make_slide(actor, 'teleport-forever');
|
this.make_slide(actor, 'teleport-forever');
|
||||||
// Also, there's no sound and whatnot, so everything else is skipped outright.
|
// Also, there's no sound and whatnot, so everything else is skipped outright.
|
||||||
return;
|
return;
|
||||||
|
|||||||
@ -713,16 +713,19 @@ 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) {
|
on_begin(me, level) {
|
||||||
update_wireable(me, level);
|
update_wireable(me, level);
|
||||||
},
|
},
|
||||||
on_arrive(me, level, other) {
|
on_arrive(me, level, other) {
|
||||||
if (! me.is_active)
|
if (! me.is_active)
|
||||||
return;
|
return;
|
||||||
other.direction = 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');
|
||||||
},
|
},
|
||||||
on_power(me, level) {
|
on_power(me, level) {
|
||||||
if (me.is_wired) {
|
if (me.is_wired) {
|
||||||
@ -741,16 +744,19 @@ const TILE_TYPES = {
|
|||||||
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) {
|
on_begin(me, level) {
|
||||||
update_wireable(me, level);
|
update_wireable(me, level);
|
||||||
},
|
},
|
||||||
on_arrive(me, level, other) {
|
on_arrive(me, level, other) {
|
||||||
if (! me.is_active)
|
if (! me.is_active)
|
||||||
return;
|
return;
|
||||||
other.direction = 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');
|
||||||
},
|
},
|
||||||
on_power(me, level) {
|
on_power(me, level) {
|
||||||
if (me.is_wired) {
|
if (me.is_wired) {
|
||||||
@ -1569,7 +1575,7 @@ const TILE_TYPES = {
|
|||||||
me.arrows = 0; // bitmask of glowing arrows (visual, no gameplay impact)
|
me.arrows = 0; // bitmask of glowing arrows (visual, no gameplay impact)
|
||||||
},
|
},
|
||||||
on_ready(me, level) {
|
on_ready(me, level) {
|
||||||
me.arrows ??= 0;
|
me.arrows = me.arrows ?? 0;
|
||||||
},
|
},
|
||||||
traps(me, actor) {
|
traps(me, actor) {
|
||||||
return ! actor._clone_release;
|
return ! actor._clone_release;
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user