2020-08-18 18:02:39 +00:00
|
|
|
import { gMetaBuildingRegistry } from "../core/global_registries";
|
|
|
|
|
import { createLogger } from "../core/logging";
|
2020-09-24 10:53:40 +00:00
|
|
|
import { T } from "../translations";
|
|
|
|
|
import { MetaAnalyzerBuilding } from "./buildings/analyzer";
|
|
|
|
|
import { enumBalancerVariants, MetaBalancerBuilding } from "./buildings/balancer";
|
2020-08-18 18:02:39 +00:00
|
|
|
import { MetaBeltBuilding } from "./buildings/belt";
|
Puzzle DLC (#1172)
* Puzzle mode (#1135)
* Add mode button to main menu
* [WIP] Add mode menu. Add factory-based gameMode creation
* Add savefile migration, serialize, deserialize
* Add hidden HUD elements, zone, and zoom, boundary constraints
* Clean up lint issues
* Add building, HUD exclusion, building exclusion, and refactor
- [WIP] Add ConstantProducer building that combines ConstantSignal
and ItemProducer functionality. Currently using temp assets.
- Add pre-placement check to the zone
- Use Rectangles for zone and boundary
- Simplify zone drawing
- Account for exclusion in savegame data
- [WIP] Add puzzle play and edit buttons in puzzle mode menu
* [WIP] Add building, component, and systems for producing and
accepting user-specified items and checking goal criteria
* Add ingame puzzle mode UI elements
- Add minimal menus in puzzle mode for back, next navigation
- Add lower menu for changing zone dimenensions
Co-authored-by: Greg Considine <gconsidine@users.noreply.github.com>
* Performance optimizations (#1154)
* 1.3.1 preparations
* Minor fixes, update translations
* Fix achievements not working
* Lots of belt optimizations, ~15% performance boost
* Puzzle mode, part 1
* Puzzle mode, part 2
* Fix missing import
* Puzzle mode, part 3
* Fix typo
* Puzzle mode, part 4
* Puzzle Mode fixes: Correct zone restrictions and more (#1155)
* Hide Puzzle Editor Controls in regular game mode, fix typo
* Disallow shrinking zone if there are buildings
* Fix multi-tile buildings for shrinking
* Puzzle mode, Refactor hud
* Puzzle mode
* Fixed typo in latest puzzle commit (#1156)
* Allow completing puzzles
* Puzzle mode, almost done
* Bump version to 1.4.0
* Fixes
* [puzzle] Prevent pipette cheats (miners, emitters) (#1158)
* Puzzle mode, almost done
* Allow clearing belts with 'B'
* Multiple users for the puzzle dlc
* Bump api key
* Minor adjustments
* Update
* Minor fixes
* Fix throughput
* Fix belts
* Minor puzzle adjustments
* New difficulty
* Minor puzzle improvements
* Fix belt path
* Update translations
* Added a button to return to the menu after a puzzle is completed (#1170)
* added another button to return to the menu
* improved menu return
* fixed continue button to not go back to menu
* [Puzzle] Added ability to lock buildings in the puzzle editor! (#1164)
* initial test
* tried to get it to work
* added icon
* added test exclusion
* reverted css
* completed flow for building locking
* added lock option
* finalized look and changed locked building to same sprite
* removed unused art
* added clearing every goal acceptor on lock to prevent creating impossible puzzles
* heavily improved validation and prevented autocompletion
* validation only checks every 100 ticks to improve performance
* validation only checks every 100 ticks to improve performance
* removed clearing goal acceptors as it isn't needed because of validation
* Add soundtrack, puzzle dlc fixes
Co-authored-by: Greg Considine <gconsidine@users.noreply.github.com>
Co-authored-by: dengr1065 <dengr1065@gmail.com>
Co-authored-by: Sense101 <67970865+Sense101@users.noreply.github.com>
2021-05-23 14:32:05 +00:00
|
|
|
import { MetaBlockBuilding } from "./buildings/block";
|
2020-09-24 10:53:40 +00:00
|
|
|
import { MetaComparatorBuilding } from "./buildings/comparator";
|
Puzzle DLC (#1172)
* Puzzle mode (#1135)
* Add mode button to main menu
* [WIP] Add mode menu. Add factory-based gameMode creation
* Add savefile migration, serialize, deserialize
* Add hidden HUD elements, zone, and zoom, boundary constraints
* Clean up lint issues
* Add building, HUD exclusion, building exclusion, and refactor
- [WIP] Add ConstantProducer building that combines ConstantSignal
and ItemProducer functionality. Currently using temp assets.
- Add pre-placement check to the zone
- Use Rectangles for zone and boundary
- Simplify zone drawing
- Account for exclusion in savegame data
- [WIP] Add puzzle play and edit buttons in puzzle mode menu
* [WIP] Add building, component, and systems for producing and
accepting user-specified items and checking goal criteria
* Add ingame puzzle mode UI elements
- Add minimal menus in puzzle mode for back, next navigation
- Add lower menu for changing zone dimenensions
Co-authored-by: Greg Considine <gconsidine@users.noreply.github.com>
* Performance optimizations (#1154)
* 1.3.1 preparations
* Minor fixes, update translations
* Fix achievements not working
* Lots of belt optimizations, ~15% performance boost
* Puzzle mode, part 1
* Puzzle mode, part 2
* Fix missing import
* Puzzle mode, part 3
* Fix typo
* Puzzle mode, part 4
* Puzzle Mode fixes: Correct zone restrictions and more (#1155)
* Hide Puzzle Editor Controls in regular game mode, fix typo
* Disallow shrinking zone if there are buildings
* Fix multi-tile buildings for shrinking
* Puzzle mode, Refactor hud
* Puzzle mode
* Fixed typo in latest puzzle commit (#1156)
* Allow completing puzzles
* Puzzle mode, almost done
* Bump version to 1.4.0
* Fixes
* [puzzle] Prevent pipette cheats (miners, emitters) (#1158)
* Puzzle mode, almost done
* Allow clearing belts with 'B'
* Multiple users for the puzzle dlc
* Bump api key
* Minor adjustments
* Update
* Minor fixes
* Fix throughput
* Fix belts
* Minor puzzle adjustments
* New difficulty
* Minor puzzle improvements
* Fix belt path
* Update translations
* Added a button to return to the menu after a puzzle is completed (#1170)
* added another button to return to the menu
* improved menu return
* fixed continue button to not go back to menu
* [Puzzle] Added ability to lock buildings in the puzzle editor! (#1164)
* initial test
* tried to get it to work
* added icon
* added test exclusion
* reverted css
* completed flow for building locking
* added lock option
* finalized look and changed locked building to same sprite
* removed unused art
* added clearing every goal acceptor on lock to prevent creating impossible puzzles
* heavily improved validation and prevented autocompletion
* validation only checks every 100 ticks to improve performance
* validation only checks every 100 ticks to improve performance
* removed clearing goal acceptors as it isn't needed because of validation
* Add soundtrack, puzzle dlc fixes
Co-authored-by: Greg Considine <gconsidine@users.noreply.github.com>
Co-authored-by: dengr1065 <dengr1065@gmail.com>
Co-authored-by: Sense101 <67970865+Sense101@users.noreply.github.com>
2021-05-23 14:32:05 +00:00
|
|
|
import { MetaConstantProducerBuilding } from "./buildings/constant_producer";
|
2020-09-24 10:53:40 +00:00
|
|
|
import { MetaConstantSignalBuilding } from "./buildings/constant_signal";
|
2020-08-18 18:02:39 +00:00
|
|
|
import { enumCutterVariants, MetaCutterBuilding } from "./buildings/cutter";
|
2020-09-24 10:53:40 +00:00
|
|
|
import { MetaDisplayBuilding } from "./buildings/display";
|
|
|
|
|
import { MetaFilterBuilding } from "./buildings/filter";
|
Puzzle DLC (#1172)
* Puzzle mode (#1135)
* Add mode button to main menu
* [WIP] Add mode menu. Add factory-based gameMode creation
* Add savefile migration, serialize, deserialize
* Add hidden HUD elements, zone, and zoom, boundary constraints
* Clean up lint issues
* Add building, HUD exclusion, building exclusion, and refactor
- [WIP] Add ConstantProducer building that combines ConstantSignal
and ItemProducer functionality. Currently using temp assets.
- Add pre-placement check to the zone
- Use Rectangles for zone and boundary
- Simplify zone drawing
- Account for exclusion in savegame data
- [WIP] Add puzzle play and edit buttons in puzzle mode menu
* [WIP] Add building, component, and systems for producing and
accepting user-specified items and checking goal criteria
* Add ingame puzzle mode UI elements
- Add minimal menus in puzzle mode for back, next navigation
- Add lower menu for changing zone dimenensions
Co-authored-by: Greg Considine <gconsidine@users.noreply.github.com>
* Performance optimizations (#1154)
* 1.3.1 preparations
* Minor fixes, update translations
* Fix achievements not working
* Lots of belt optimizations, ~15% performance boost
* Puzzle mode, part 1
* Puzzle mode, part 2
* Fix missing import
* Puzzle mode, part 3
* Fix typo
* Puzzle mode, part 4
* Puzzle Mode fixes: Correct zone restrictions and more (#1155)
* Hide Puzzle Editor Controls in regular game mode, fix typo
* Disallow shrinking zone if there are buildings
* Fix multi-tile buildings for shrinking
* Puzzle mode, Refactor hud
* Puzzle mode
* Fixed typo in latest puzzle commit (#1156)
* Allow completing puzzles
* Puzzle mode, almost done
* Bump version to 1.4.0
* Fixes
* [puzzle] Prevent pipette cheats (miners, emitters) (#1158)
* Puzzle mode, almost done
* Allow clearing belts with 'B'
* Multiple users for the puzzle dlc
* Bump api key
* Minor adjustments
* Update
* Minor fixes
* Fix throughput
* Fix belts
* Minor puzzle adjustments
* New difficulty
* Minor puzzle improvements
* Fix belt path
* Update translations
* Added a button to return to the menu after a puzzle is completed (#1170)
* added another button to return to the menu
* improved menu return
* fixed continue button to not go back to menu
* [Puzzle] Added ability to lock buildings in the puzzle editor! (#1164)
* initial test
* tried to get it to work
* added icon
* added test exclusion
* reverted css
* completed flow for building locking
* added lock option
* finalized look and changed locked building to same sprite
* removed unused art
* added clearing every goal acceptor on lock to prevent creating impossible puzzles
* heavily improved validation and prevented autocompletion
* validation only checks every 100 ticks to improve performance
* validation only checks every 100 ticks to improve performance
* removed clearing goal acceptors as it isn't needed because of validation
* Add soundtrack, puzzle dlc fixes
Co-authored-by: Greg Considine <gconsidine@users.noreply.github.com>
Co-authored-by: dengr1065 <dengr1065@gmail.com>
Co-authored-by: Sense101 <67970865+Sense101@users.noreply.github.com>
2021-05-23 14:32:05 +00:00
|
|
|
import { MetaGoalAcceptorBuilding } from "./buildings/goal_acceptor";
|
2020-08-18 18:02:39 +00:00
|
|
|
import { MetaHubBuilding } from "./buildings/hub";
|
2020-09-29 08:52:25 +00:00
|
|
|
import { MetaItemProducerBuilding } from "./buildings/item_producer";
|
2020-09-24 10:53:40 +00:00
|
|
|
import { MetaLeverBuilding } from "./buildings/lever";
|
|
|
|
|
import { enumLogicGateVariants, MetaLogicGateBuilding } from "./buildings/logic_gate";
|
2020-08-18 18:02:39 +00:00
|
|
|
import { enumMinerVariants, MetaMinerBuilding } from "./buildings/miner";
|
|
|
|
|
import { MetaMixerBuilding } from "./buildings/mixer";
|
|
|
|
|
import { enumPainterVariants, MetaPainterBuilding } from "./buildings/painter";
|
2020-09-24 10:53:40 +00:00
|
|
|
import { MetaReaderBuilding } from "./buildings/reader";
|
2020-08-18 18:02:39 +00:00
|
|
|
import { enumRotaterVariants, MetaRotaterBuilding } from "./buildings/rotater";
|
|
|
|
|
import { MetaStackerBuilding } from "./buildings/stacker";
|
2020-09-24 10:53:40 +00:00
|
|
|
import { MetaStorageBuilding } from "./buildings/storage";
|
2020-09-29 08:52:25 +00:00
|
|
|
import { enumTransistorVariants, MetaTransistorBuilding } from "./buildings/transistor";
|
2020-09-23 06:59:39 +00:00
|
|
|
import { MetaTrashBuilding } from "./buildings/trash";
|
2020-08-18 18:02:39 +00:00
|
|
|
import { enumUndergroundBeltVariants, MetaUndergroundBeltBuilding } from "./buildings/underground_belt";
|
2020-09-24 10:53:40 +00:00
|
|
|
import { enumVirtualProcessorVariants, MetaVirtualProcessorBuilding } from "./buildings/virtual_processor";
|
2020-08-18 18:02:39 +00:00
|
|
|
import { MetaWireBuilding } from "./buildings/wire";
|
2020-09-24 10:53:40 +00:00
|
|
|
import { MetaWireTunnelBuilding } from "./buildings/wire_tunnel";
|
2020-09-18 18:41:40 +00:00
|
|
|
import { buildBuildingCodeCache, gBuildingVariants, registerBuildingVariant } from "./building_codes";
|
2020-09-24 10:53:40 +00:00
|
|
|
import { enumWireVariant } from "./components/wire";
|
2020-09-23 06:59:39 +00:00
|
|
|
import { KEYMAPPINGS } from "./key_action_mapper";
|
2020-09-24 10:53:40 +00:00
|
|
|
import { defaultBuildingVariant } from "./meta_building";
|
2020-08-18 18:02:39 +00:00
|
|
|
|
|
|
|
|
const logger = createLogger("building_registry");
|
|
|
|
|
|
|
|
|
|
export function initMetaBuildingRegistry() {
|
2020-09-22 12:47:59 +00:00
|
|
|
gMetaBuildingRegistry.register(MetaBalancerBuilding);
|
2020-08-18 18:02:39 +00:00
|
|
|
gMetaBuildingRegistry.register(MetaMinerBuilding);
|
|
|
|
|
gMetaBuildingRegistry.register(MetaCutterBuilding);
|
|
|
|
|
gMetaBuildingRegistry.register(MetaRotaterBuilding);
|
|
|
|
|
gMetaBuildingRegistry.register(MetaStackerBuilding);
|
|
|
|
|
gMetaBuildingRegistry.register(MetaMixerBuilding);
|
|
|
|
|
gMetaBuildingRegistry.register(MetaPainterBuilding);
|
|
|
|
|
gMetaBuildingRegistry.register(MetaTrashBuilding);
|
2020-09-23 06:59:39 +00:00
|
|
|
gMetaBuildingRegistry.register(MetaStorageBuilding);
|
2020-08-18 18:02:39 +00:00
|
|
|
gMetaBuildingRegistry.register(MetaBeltBuilding);
|
|
|
|
|
gMetaBuildingRegistry.register(MetaUndergroundBeltBuilding);
|
Puzzle DLC (#1172)
* Puzzle mode (#1135)
* Add mode button to main menu
* [WIP] Add mode menu. Add factory-based gameMode creation
* Add savefile migration, serialize, deserialize
* Add hidden HUD elements, zone, and zoom, boundary constraints
* Clean up lint issues
* Add building, HUD exclusion, building exclusion, and refactor
- [WIP] Add ConstantProducer building that combines ConstantSignal
and ItemProducer functionality. Currently using temp assets.
- Add pre-placement check to the zone
- Use Rectangles for zone and boundary
- Simplify zone drawing
- Account for exclusion in savegame data
- [WIP] Add puzzle play and edit buttons in puzzle mode menu
* [WIP] Add building, component, and systems for producing and
accepting user-specified items and checking goal criteria
* Add ingame puzzle mode UI elements
- Add minimal menus in puzzle mode for back, next navigation
- Add lower menu for changing zone dimenensions
Co-authored-by: Greg Considine <gconsidine@users.noreply.github.com>
* Performance optimizations (#1154)
* 1.3.1 preparations
* Minor fixes, update translations
* Fix achievements not working
* Lots of belt optimizations, ~15% performance boost
* Puzzle mode, part 1
* Puzzle mode, part 2
* Fix missing import
* Puzzle mode, part 3
* Fix typo
* Puzzle mode, part 4
* Puzzle Mode fixes: Correct zone restrictions and more (#1155)
* Hide Puzzle Editor Controls in regular game mode, fix typo
* Disallow shrinking zone if there are buildings
* Fix multi-tile buildings for shrinking
* Puzzle mode, Refactor hud
* Puzzle mode
* Fixed typo in latest puzzle commit (#1156)
* Allow completing puzzles
* Puzzle mode, almost done
* Bump version to 1.4.0
* Fixes
* [puzzle] Prevent pipette cheats (miners, emitters) (#1158)
* Puzzle mode, almost done
* Allow clearing belts with 'B'
* Multiple users for the puzzle dlc
* Bump api key
* Minor adjustments
* Update
* Minor fixes
* Fix throughput
* Fix belts
* Minor puzzle adjustments
* New difficulty
* Minor puzzle improvements
* Fix belt path
* Update translations
* Added a button to return to the menu after a puzzle is completed (#1170)
* added another button to return to the menu
* improved menu return
* fixed continue button to not go back to menu
* [Puzzle] Added ability to lock buildings in the puzzle editor! (#1164)
* initial test
* tried to get it to work
* added icon
* added test exclusion
* reverted css
* completed flow for building locking
* added lock option
* finalized look and changed locked building to same sprite
* removed unused art
* added clearing every goal acceptor on lock to prevent creating impossible puzzles
* heavily improved validation and prevented autocompletion
* validation only checks every 100 ticks to improve performance
* validation only checks every 100 ticks to improve performance
* removed clearing goal acceptors as it isn't needed because of validation
* Add soundtrack, puzzle dlc fixes
Co-authored-by: Greg Considine <gconsidine@users.noreply.github.com>
Co-authored-by: dengr1065 <dengr1065@gmail.com>
Co-authored-by: Sense101 <67970865+Sense101@users.noreply.github.com>
2021-05-23 14:32:05 +00:00
|
|
|
gMetaBuildingRegistry.register(MetaGoalAcceptorBuilding);
|
2020-08-18 18:02:39 +00:00
|
|
|
gMetaBuildingRegistry.register(MetaHubBuilding);
|
|
|
|
|
gMetaBuildingRegistry.register(MetaWireBuilding);
|
|
|
|
|
gMetaBuildingRegistry.register(MetaConstantSignalBuilding);
|
|
|
|
|
gMetaBuildingRegistry.register(MetaLogicGateBuilding);
|
|
|
|
|
gMetaBuildingRegistry.register(MetaLeverBuilding);
|
|
|
|
|
gMetaBuildingRegistry.register(MetaFilterBuilding);
|
|
|
|
|
gMetaBuildingRegistry.register(MetaWireTunnelBuilding);
|
|
|
|
|
gMetaBuildingRegistry.register(MetaDisplayBuilding);
|
|
|
|
|
gMetaBuildingRegistry.register(MetaVirtualProcessorBuilding);
|
2020-08-29 08:38:23 +00:00
|
|
|
gMetaBuildingRegistry.register(MetaReaderBuilding);
|
2020-09-24 10:53:40 +00:00
|
|
|
gMetaBuildingRegistry.register(MetaTransistorBuilding);
|
|
|
|
|
gMetaBuildingRegistry.register(MetaAnalyzerBuilding);
|
|
|
|
|
gMetaBuildingRegistry.register(MetaComparatorBuilding);
|
2020-09-29 08:52:25 +00:00
|
|
|
gMetaBuildingRegistry.register(MetaItemProducerBuilding);
|
Puzzle DLC (#1172)
* Puzzle mode (#1135)
* Add mode button to main menu
* [WIP] Add mode menu. Add factory-based gameMode creation
* Add savefile migration, serialize, deserialize
* Add hidden HUD elements, zone, and zoom, boundary constraints
* Clean up lint issues
* Add building, HUD exclusion, building exclusion, and refactor
- [WIP] Add ConstantProducer building that combines ConstantSignal
and ItemProducer functionality. Currently using temp assets.
- Add pre-placement check to the zone
- Use Rectangles for zone and boundary
- Simplify zone drawing
- Account for exclusion in savegame data
- [WIP] Add puzzle play and edit buttons in puzzle mode menu
* [WIP] Add building, component, and systems for producing and
accepting user-specified items and checking goal criteria
* Add ingame puzzle mode UI elements
- Add minimal menus in puzzle mode for back, next navigation
- Add lower menu for changing zone dimenensions
Co-authored-by: Greg Considine <gconsidine@users.noreply.github.com>
* Performance optimizations (#1154)
* 1.3.1 preparations
* Minor fixes, update translations
* Fix achievements not working
* Lots of belt optimizations, ~15% performance boost
* Puzzle mode, part 1
* Puzzle mode, part 2
* Fix missing import
* Puzzle mode, part 3
* Fix typo
* Puzzle mode, part 4
* Puzzle Mode fixes: Correct zone restrictions and more (#1155)
* Hide Puzzle Editor Controls in regular game mode, fix typo
* Disallow shrinking zone if there are buildings
* Fix multi-tile buildings for shrinking
* Puzzle mode, Refactor hud
* Puzzle mode
* Fixed typo in latest puzzle commit (#1156)
* Allow completing puzzles
* Puzzle mode, almost done
* Bump version to 1.4.0
* Fixes
* [puzzle] Prevent pipette cheats (miners, emitters) (#1158)
* Puzzle mode, almost done
* Allow clearing belts with 'B'
* Multiple users for the puzzle dlc
* Bump api key
* Minor adjustments
* Update
* Minor fixes
* Fix throughput
* Fix belts
* Minor puzzle adjustments
* New difficulty
* Minor puzzle improvements
* Fix belt path
* Update translations
* Added a button to return to the menu after a puzzle is completed (#1170)
* added another button to return to the menu
* improved menu return
* fixed continue button to not go back to menu
* [Puzzle] Added ability to lock buildings in the puzzle editor! (#1164)
* initial test
* tried to get it to work
* added icon
* added test exclusion
* reverted css
* completed flow for building locking
* added lock option
* finalized look and changed locked building to same sprite
* removed unused art
* added clearing every goal acceptor on lock to prevent creating impossible puzzles
* heavily improved validation and prevented autocompletion
* validation only checks every 100 ticks to improve performance
* validation only checks every 100 ticks to improve performance
* removed clearing goal acceptors as it isn't needed because of validation
* Add soundtrack, puzzle dlc fixes
Co-authored-by: Greg Considine <gconsidine@users.noreply.github.com>
Co-authored-by: dengr1065 <dengr1065@gmail.com>
Co-authored-by: Sense101 <67970865+Sense101@users.noreply.github.com>
2021-05-23 14:32:05 +00:00
|
|
|
gMetaBuildingRegistry.register(MetaConstantProducerBuilding);
|
|
|
|
|
gMetaBuildingRegistry.register(MetaBlockBuilding);
|
2020-08-18 18:02:39 +00:00
|
|
|
|
|
|
|
|
// Belt
|
2020-09-18 10:55:46 +00:00
|
|
|
registerBuildingVariant(1, MetaBeltBuilding, defaultBuildingVariant, 0);
|
|
|
|
|
registerBuildingVariant(2, MetaBeltBuilding, defaultBuildingVariant, 1);
|
|
|
|
|
registerBuildingVariant(3, MetaBeltBuilding, defaultBuildingVariant, 2);
|
2020-08-18 18:02:39 +00:00
|
|
|
|
2020-09-22 12:47:59 +00:00
|
|
|
// Balancer
|
|
|
|
|
registerBuildingVariant(4, MetaBalancerBuilding);
|
|
|
|
|
registerBuildingVariant(5, MetaBalancerBuilding, enumBalancerVariants.merger);
|
|
|
|
|
registerBuildingVariant(6, MetaBalancerBuilding, enumBalancerVariants.mergerInverse);
|
|
|
|
|
registerBuildingVariant(47, MetaBalancerBuilding, enumBalancerVariants.splitter);
|
|
|
|
|
registerBuildingVariant(48, MetaBalancerBuilding, enumBalancerVariants.splitterInverse);
|
2020-08-18 18:02:39 +00:00
|
|
|
|
|
|
|
|
// Miner
|
|
|
|
|
registerBuildingVariant(7, MetaMinerBuilding);
|
|
|
|
|
registerBuildingVariant(8, MetaMinerBuilding, enumMinerVariants.chainable);
|
|
|
|
|
|
|
|
|
|
// Cutter
|
|
|
|
|
registerBuildingVariant(9, MetaCutterBuilding);
|
|
|
|
|
registerBuildingVariant(10, MetaCutterBuilding, enumCutterVariants.quad);
|
|
|
|
|
|
|
|
|
|
// Rotater
|
|
|
|
|
registerBuildingVariant(11, MetaRotaterBuilding);
|
|
|
|
|
registerBuildingVariant(12, MetaRotaterBuilding, enumRotaterVariants.ccw);
|
2020-09-19 15:55:36 +00:00
|
|
|
registerBuildingVariant(13, MetaRotaterBuilding, enumRotaterVariants.rotate180);
|
2020-08-18 18:02:39 +00:00
|
|
|
|
|
|
|
|
// Stacker
|
|
|
|
|
registerBuildingVariant(14, MetaStackerBuilding);
|
|
|
|
|
|
|
|
|
|
// Mixer
|
|
|
|
|
registerBuildingVariant(15, MetaMixerBuilding);
|
|
|
|
|
|
|
|
|
|
// Painter
|
|
|
|
|
registerBuildingVariant(16, MetaPainterBuilding);
|
|
|
|
|
registerBuildingVariant(17, MetaPainterBuilding, enumPainterVariants.mirrored);
|
|
|
|
|
registerBuildingVariant(18, MetaPainterBuilding, enumPainterVariants.double);
|
|
|
|
|
registerBuildingVariant(19, MetaPainterBuilding, enumPainterVariants.quad);
|
|
|
|
|
|
|
|
|
|
// Trash
|
|
|
|
|
registerBuildingVariant(20, MetaTrashBuilding);
|
2020-09-23 06:59:39 +00:00
|
|
|
|
|
|
|
|
// Storage
|
|
|
|
|
registerBuildingVariant(21, MetaStorageBuilding);
|
2020-08-18 18:02:39 +00:00
|
|
|
|
|
|
|
|
// Underground belt
|
|
|
|
|
registerBuildingVariant(22, MetaUndergroundBeltBuilding, defaultBuildingVariant, 0);
|
|
|
|
|
registerBuildingVariant(23, MetaUndergroundBeltBuilding, defaultBuildingVariant, 1);
|
|
|
|
|
registerBuildingVariant(24, MetaUndergroundBeltBuilding, enumUndergroundBeltVariants.tier2, 0);
|
|
|
|
|
registerBuildingVariant(25, MetaUndergroundBeltBuilding, enumUndergroundBeltVariants.tier2, 1);
|
|
|
|
|
|
|
|
|
|
// Hub
|
|
|
|
|
registerBuildingVariant(26, MetaHubBuilding);
|
|
|
|
|
|
|
|
|
|
// Wire
|
|
|
|
|
registerBuildingVariant(27, MetaWireBuilding, defaultBuildingVariant, 0);
|
|
|
|
|
registerBuildingVariant(28, MetaWireBuilding, defaultBuildingVariant, 1);
|
|
|
|
|
registerBuildingVariant(29, MetaWireBuilding, defaultBuildingVariant, 2);
|
|
|
|
|
registerBuildingVariant(30, MetaWireBuilding, defaultBuildingVariant, 3);
|
|
|
|
|
|
2020-09-24 10:53:40 +00:00
|
|
|
registerBuildingVariant(52, MetaWireBuilding, enumWireVariant.second, 0);
|
|
|
|
|
registerBuildingVariant(53, MetaWireBuilding, enumWireVariant.second, 1);
|
|
|
|
|
registerBuildingVariant(54, MetaWireBuilding, enumWireVariant.second, 2);
|
|
|
|
|
registerBuildingVariant(55, MetaWireBuilding, enumWireVariant.second, 3);
|
|
|
|
|
|
2020-08-18 18:02:39 +00:00
|
|
|
// Constant signal
|
|
|
|
|
registerBuildingVariant(31, MetaConstantSignalBuilding);
|
|
|
|
|
|
|
|
|
|
// Logic gate
|
|
|
|
|
registerBuildingVariant(32, MetaLogicGateBuilding);
|
|
|
|
|
registerBuildingVariant(34, MetaLogicGateBuilding, enumLogicGateVariants.not);
|
|
|
|
|
registerBuildingVariant(35, MetaLogicGateBuilding, enumLogicGateVariants.xor);
|
|
|
|
|
registerBuildingVariant(36, MetaLogicGateBuilding, enumLogicGateVariants.or);
|
2020-09-24 10:53:40 +00:00
|
|
|
|
|
|
|
|
// Transistor
|
|
|
|
|
registerBuildingVariant(38, MetaTransistorBuilding, defaultBuildingVariant);
|
|
|
|
|
registerBuildingVariant(60, MetaTransistorBuilding, enumTransistorVariants.mirrored);
|
2020-08-18 18:02:39 +00:00
|
|
|
|
|
|
|
|
// Lever
|
|
|
|
|
registerBuildingVariant(33, MetaLeverBuilding);
|
|
|
|
|
|
|
|
|
|
// Filter
|
|
|
|
|
registerBuildingVariant(37, MetaFilterBuilding);
|
|
|
|
|
|
|
|
|
|
// Wire tunnel
|
|
|
|
|
registerBuildingVariant(39, MetaWireTunnelBuilding);
|
|
|
|
|
|
|
|
|
|
// Display
|
|
|
|
|
registerBuildingVariant(40, MetaDisplayBuilding);
|
|
|
|
|
|
|
|
|
|
// Virtual Processor
|
|
|
|
|
registerBuildingVariant(42, MetaVirtualProcessorBuilding);
|
|
|
|
|
registerBuildingVariant(44, MetaVirtualProcessorBuilding, enumVirtualProcessorVariants.rotater);
|
|
|
|
|
registerBuildingVariant(45, MetaVirtualProcessorBuilding, enumVirtualProcessorVariants.unstacker);
|
2020-09-19 13:33:24 +00:00
|
|
|
registerBuildingVariant(50, MetaVirtualProcessorBuilding, enumVirtualProcessorVariants.stacker);
|
|
|
|
|
registerBuildingVariant(51, MetaVirtualProcessorBuilding, enumVirtualProcessorVariants.painter);
|
2020-08-18 18:02:39 +00:00
|
|
|
|
2020-09-24 10:53:40 +00:00
|
|
|
// Analyzer
|
|
|
|
|
registerBuildingVariant(46, MetaComparatorBuilding);
|
|
|
|
|
registerBuildingVariant(43, MetaAnalyzerBuilding);
|
|
|
|
|
|
2020-08-29 08:38:23 +00:00
|
|
|
// Reader
|
|
|
|
|
registerBuildingVariant(49, MetaReaderBuilding);
|
|
|
|
|
|
2020-09-29 08:52:25 +00:00
|
|
|
// Item producer
|
|
|
|
|
registerBuildingVariant(61, MetaItemProducerBuilding);
|
|
|
|
|
|
Puzzle DLC (#1172)
* Puzzle mode (#1135)
* Add mode button to main menu
* [WIP] Add mode menu. Add factory-based gameMode creation
* Add savefile migration, serialize, deserialize
* Add hidden HUD elements, zone, and zoom, boundary constraints
* Clean up lint issues
* Add building, HUD exclusion, building exclusion, and refactor
- [WIP] Add ConstantProducer building that combines ConstantSignal
and ItemProducer functionality. Currently using temp assets.
- Add pre-placement check to the zone
- Use Rectangles for zone and boundary
- Simplify zone drawing
- Account for exclusion in savegame data
- [WIP] Add puzzle play and edit buttons in puzzle mode menu
* [WIP] Add building, component, and systems for producing and
accepting user-specified items and checking goal criteria
* Add ingame puzzle mode UI elements
- Add minimal menus in puzzle mode for back, next navigation
- Add lower menu for changing zone dimenensions
Co-authored-by: Greg Considine <gconsidine@users.noreply.github.com>
* Performance optimizations (#1154)
* 1.3.1 preparations
* Minor fixes, update translations
* Fix achievements not working
* Lots of belt optimizations, ~15% performance boost
* Puzzle mode, part 1
* Puzzle mode, part 2
* Fix missing import
* Puzzle mode, part 3
* Fix typo
* Puzzle mode, part 4
* Puzzle Mode fixes: Correct zone restrictions and more (#1155)
* Hide Puzzle Editor Controls in regular game mode, fix typo
* Disallow shrinking zone if there are buildings
* Fix multi-tile buildings for shrinking
* Puzzle mode, Refactor hud
* Puzzle mode
* Fixed typo in latest puzzle commit (#1156)
* Allow completing puzzles
* Puzzle mode, almost done
* Bump version to 1.4.0
* Fixes
* [puzzle] Prevent pipette cheats (miners, emitters) (#1158)
* Puzzle mode, almost done
* Allow clearing belts with 'B'
* Multiple users for the puzzle dlc
* Bump api key
* Minor adjustments
* Update
* Minor fixes
* Fix throughput
* Fix belts
* Minor puzzle adjustments
* New difficulty
* Minor puzzle improvements
* Fix belt path
* Update translations
* Added a button to return to the menu after a puzzle is completed (#1170)
* added another button to return to the menu
* improved menu return
* fixed continue button to not go back to menu
* [Puzzle] Added ability to lock buildings in the puzzle editor! (#1164)
* initial test
* tried to get it to work
* added icon
* added test exclusion
* reverted css
* completed flow for building locking
* added lock option
* finalized look and changed locked building to same sprite
* removed unused art
* added clearing every goal acceptor on lock to prevent creating impossible puzzles
* heavily improved validation and prevented autocompletion
* validation only checks every 100 ticks to improve performance
* validation only checks every 100 ticks to improve performance
* removed clearing goal acceptors as it isn't needed because of validation
* Add soundtrack, puzzle dlc fixes
Co-authored-by: Greg Considine <gconsidine@users.noreply.github.com>
Co-authored-by: dengr1065 <dengr1065@gmail.com>
Co-authored-by: Sense101 <67970865+Sense101@users.noreply.github.com>
2021-05-23 14:32:05 +00:00
|
|
|
// Constant producer
|
|
|
|
|
registerBuildingVariant(62, MetaConstantProducerBuilding);
|
|
|
|
|
|
|
|
|
|
// Goal acceptor
|
|
|
|
|
registerBuildingVariant(63, MetaGoalAcceptorBuilding);
|
|
|
|
|
|
|
|
|
|
// Block
|
|
|
|
|
registerBuildingVariant(64, MetaBlockBuilding);
|
|
|
|
|
|
2020-08-18 18:02:39 +00:00
|
|
|
// Propagate instances
|
|
|
|
|
for (const key in gBuildingVariants) {
|
|
|
|
|
gBuildingVariants[key].metaInstance = gMetaBuildingRegistry.findByClass(
|
|
|
|
|
gBuildingVariants[key].metaClass
|
|
|
|
|
);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
for (const key in gBuildingVariants) {
|
|
|
|
|
const variant = gBuildingVariants[key];
|
|
|
|
|
assert(variant.metaClass, "Variant has no meta: " + key);
|
|
|
|
|
|
|
|
|
|
if (typeof variant.rotationVariant === "undefined") {
|
|
|
|
|
variant.rotationVariant = 0;
|
|
|
|
|
}
|
|
|
|
|
if (typeof variant.variant === "undefined") {
|
|
|
|
|
variant.variant = defaultBuildingVariant;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
2020-09-23 06:59:39 +00:00
|
|
|
// Check for valid keycodes
|
|
|
|
|
if (G_IS_DEV) {
|
|
|
|
|
gMetaBuildingRegistry.entries.forEach(metaBuilding => {
|
|
|
|
|
const id = metaBuilding.getId();
|
|
|
|
|
if (!["hub"].includes(id)) {
|
|
|
|
|
if (!KEYMAPPINGS.buildings[id]) {
|
|
|
|
|
assertAlways(
|
|
|
|
|
false,
|
|
|
|
|
"Building " + id + " has no keybinding assigned! Add it to key_action_mapper.js"
|
|
|
|
|
);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if (!T.buildings[id]) {
|
|
|
|
|
assertAlways(false, "Translation for building " + id + " missing!");
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if (!T.buildings[id].default) {
|
|
|
|
|
assertAlways(false, "Translation for building " + id + " missing (default variant)!");
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
});
|
|
|
|
|
}
|
|
|
|
|
|
2020-08-18 18:02:39 +00:00
|
|
|
logger.log("Registered", gMetaBuildingRegistry.getNumEntries(), "buildings");
|
|
|
|
|
logger.log("Registered", Object.keys(gBuildingVariants).length, "building codes");
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* Once all sprites are loaded, propagates the cache
|
|
|
|
|
*/
|
|
|
|
|
export function initBuildingCodesAfterResourcesLoaded() {
|
|
|
|
|
logger.log("Propagating sprite cache");
|
|
|
|
|
for (const key in gBuildingVariants) {
|
|
|
|
|
const variant = gBuildingVariants[key];
|
|
|
|
|
|
|
|
|
|
variant.sprite = variant.metaInstance.getSprite(variant.rotationVariant, variant.variant);
|
|
|
|
|
variant.blueprintSprite = variant.metaInstance.getBlueprintSprite(
|
|
|
|
|
variant.rotationVariant,
|
|
|
|
|
variant.variant
|
|
|
|
|
);
|
2020-09-23 09:14:35 +00:00
|
|
|
variant.silhouetteColor = variant.metaInstance.getSilhouetteColor(
|
|
|
|
|
variant.variant,
|
|
|
|
|
variant.rotationVariant
|
|
|
|
|
);
|
2020-08-18 18:02:39 +00:00
|
|
|
}
|
2020-09-18 18:41:40 +00:00
|
|
|
|
|
|
|
|
// Update caches
|
|
|
|
|
buildBuildingCodeCache();
|
2020-08-18 18:02:39 +00:00
|
|
|
}
|