remove 'transmuted connectable connects buttons to it' mechanic

This commit is contained in:
Timothy Stiles 2021-02-15 14:22:13 +11:00
parent 4097aa6e84
commit dfb31207ba
2 changed files with 1 additions and 36 deletions

View File

@ -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) {
// Build circuits out of connected wires
// TODO document this idea
@ -2534,15 +2507,11 @@ export class Level extends LevelInterface {
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))
{
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
if (new_type.on_begin)

View File

@ -1383,7 +1383,6 @@ const TILE_TYPES = {
cloner: {
layer: LAYERS.terrain,
blocks_collision: COLLISION.real_player | COLLISION.block_cc1 | COLLISION.monster_solid,
connected_from: 'button_red',
traps(me, actor) {
return ! actor._clone_release;
},
@ -1436,7 +1435,6 @@ const TILE_TYPES = {
},
trap: {
layer: LAYERS.terrain,
connected_from: 'button_brown',
on_begin(me, level) {
me.presses = 0;
},
@ -1733,7 +1731,6 @@ const TILE_TYPES = {
// - Gray button toggles it permanently
flame_jet_off: {
layer: LAYERS.terrain,
connected_from: 'button_orange',
activate(me, level) {
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
@ -1751,7 +1748,6 @@ const TILE_TYPES = {
},
flame_jet_on: {
layer: LAYERS.terrain,
connected_from: 'button_orange',
activate(me, level) {
level.transmute_tile(me, 'flame_jet_off');
},