remove 'transmuted connectable connects buttons to it' mechanic
This commit is contained in:
parent
4097aa6e84
commit
dfb31207ba
33
js/game.js
33
js/game.js
@ -605,33 +605,6 @@ export class Level extends LevelInterface {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
connect_buttons_to(tile) {
|
|
||||||
//iterate all terrain in the level for things that can connect to this
|
|
||||||
//if they didn't before and now do, commit and make an undo for it.
|
|
||||||
//otherwise, change it back (so we don't accidentally rewire other things)
|
|
||||||
for (var i = 0; i < this.width; ++i)
|
|
||||||
{
|
|
||||||
for (var j = 0; j < this.height; ++j)
|
|
||||||
{
|
|
||||||
let terrain = this.cell(i, j).get_terrain();
|
|
||||||
if (terrain.type.name === tile.type.connected_from)
|
|
||||||
{
|
|
||||||
let old_connection = terrain.connection;
|
|
||||||
this.connect_button(terrain);
|
|
||||||
if (terrain.connection === tile)
|
|
||||||
{
|
|
||||||
terrain.connection = old_connection;
|
|
||||||
this._set_tile_prop(terrain, 'connection', tile);
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
terrain.connection = old_connection;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
recalculate_circuitry(first_time = false) {
|
recalculate_circuitry(first_time = false) {
|
||||||
// Build circuits out of connected wires
|
// Build circuits out of connected wires
|
||||||
// TODO document this idea
|
// TODO document this idea
|
||||||
@ -2534,15 +2507,11 @@ export class Level extends LevelInterface {
|
|||||||
this.static_on_tic_tiles.push(tile);
|
this.static_on_tic_tiles.push(tile);
|
||||||
}
|
}
|
||||||
|
|
||||||
//if we made a button or something that's buttonable, update accordingly
|
//if we made a button, update accordingly
|
||||||
if (new_type.connects_to && (new_type.connects_to !== old_type.connects_to))
|
if (new_type.connects_to && (new_type.connects_to !== old_type.connects_to))
|
||||||
{
|
{
|
||||||
this.connect_button(tile);
|
this.connect_button(tile);
|
||||||
}
|
}
|
||||||
else if (new_type.connected_from && (new_type.connected_from !== old_type.connected_from))
|
|
||||||
{
|
|
||||||
this.connect_buttons_to(tile);
|
|
||||||
}
|
|
||||||
|
|
||||||
//ready the tile
|
//ready the tile
|
||||||
if (new_type.on_begin)
|
if (new_type.on_begin)
|
||||||
|
|||||||
@ -1383,7 +1383,6 @@ const TILE_TYPES = {
|
|||||||
cloner: {
|
cloner: {
|
||||||
layer: LAYERS.terrain,
|
layer: LAYERS.terrain,
|
||||||
blocks_collision: COLLISION.real_player | COLLISION.block_cc1 | COLLISION.monster_solid,
|
blocks_collision: COLLISION.real_player | COLLISION.block_cc1 | COLLISION.monster_solid,
|
||||||
connected_from: 'button_red',
|
|
||||||
traps(me, actor) {
|
traps(me, actor) {
|
||||||
return ! actor._clone_release;
|
return ! actor._clone_release;
|
||||||
},
|
},
|
||||||
@ -1436,7 +1435,6 @@ const TILE_TYPES = {
|
|||||||
},
|
},
|
||||||
trap: {
|
trap: {
|
||||||
layer: LAYERS.terrain,
|
layer: LAYERS.terrain,
|
||||||
connected_from: 'button_brown',
|
|
||||||
on_begin(me, level) {
|
on_begin(me, level) {
|
||||||
me.presses = 0;
|
me.presses = 0;
|
||||||
},
|
},
|
||||||
@ -1733,7 +1731,6 @@ const TILE_TYPES = {
|
|||||||
// - Gray button toggles it permanently
|
// - Gray button toggles it permanently
|
||||||
flame_jet_off: {
|
flame_jet_off: {
|
||||||
layer: LAYERS.terrain,
|
layer: LAYERS.terrain,
|
||||||
connected_from: 'button_orange',
|
|
||||||
activate(me, level) {
|
activate(me, level) {
|
||||||
level.transmute_tile(me, 'flame_jet_on');
|
level.transmute_tile(me, 'flame_jet_on');
|
||||||
// Do NOT immediately nuke anything on us, or it'd be impossible to push a block off an
|
// Do NOT immediately nuke anything on us, or it'd be impossible to push a block off an
|
||||||
@ -1751,7 +1748,6 @@ const TILE_TYPES = {
|
|||||||
},
|
},
|
||||||
flame_jet_on: {
|
flame_jet_on: {
|
||||||
layer: LAYERS.terrain,
|
layer: LAYERS.terrain,
|
||||||
connected_from: 'button_orange',
|
|
||||||
activate(me, level) {
|
activate(me, level) {
|
||||||
level.transmute_tile(me, 'flame_jet_off');
|
level.transmute_tile(me, 'flame_jet_off');
|
||||||
},
|
},
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user