From dfb31207ba19616ff82afd4fc3edae7126bd19a5 Mon Sep 17 00:00:00 2001 From: Timothy Stiles Date: Mon, 15 Feb 2021 14:22:13 +1100 Subject: [PATCH] remove 'transmuted connectable connects buttons to it' mechanic --- js/game.js | 33 +-------------------------------- js/tiletypes.js | 4 ---- 2 files changed, 1 insertion(+), 36 deletions(-) diff --git a/js/game.js b/js/game.js index 139aba8..da6dc9d 100644 --- a/js/game.js +++ b/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) { // 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) diff --git a/js/tiletypes.js b/js/tiletypes.js index e5eef69..0e26e7b 100644 --- a/js/tiletypes.js +++ b/js/tiletypes.js @@ -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'); },