diff --git a/src/js/core/config.js b/src/js/core/config.js index 55e8217f..f57f935d 100644 --- a/src/js/core/config.js +++ b/src/js/core/config.js @@ -64,6 +64,7 @@ export const globalConfig = { painter: 1 / 6, painterDouble: 1 / 8, painterQuad: 1 / 8, + bleacher: 1 / 8, mixer: 1 / 5, stacker: 1 / 6, advancedProcessor: 1 / 15, diff --git a/src/js/game/buildings/painter.js b/src/js/game/buildings/painter.js index 61e77a7c..c9ec6675 100644 --- a/src/js/game/buildings/painter.js +++ b/src/js/game/buildings/painter.js @@ -11,7 +11,12 @@ import { enumHubGoalRewards } from "../tutorial_goals"; import { enumItemType } from "../base_item"; /** @enum {string} */ -export const enumPainterVariants = { mirrored: "mirrored", double: "double", quad: "quad" }; +export const enumPainterVariants = { + mirrored: "mirrored", + double: "double", + quad: "quad", + bleacher: "bleacher", +}; export class MetaPainterBuilding extends MetaBuilding { constructor() { @@ -27,6 +32,8 @@ export class MetaPainterBuilding extends MetaBuilding { return new Vector(2, 2); case enumPainterVariants.quad: return new Vector(4, 1); + case enumPainterVariants.bleacher: + return new Vector(1, 1); default: assertAlways(false, "Unknown painter variant: " + variant); } @@ -56,6 +63,10 @@ export class MetaPainterBuilding extends MetaBuilding { const speed = root.hubGoals.getProcessorBaseSpeed(enumItemProcessorTypes.painterQuad); return [[T.ingame.buildingPlacement.infoTexts.speed, formatItemsPerSecond(speed)]]; } + case enumPainterVariants.bleacher: { + const speed = root.hubGoals.getProcessorBaseSpeed(enumItemProcessorTypes.bleacher); + return [[T.ingame.buildingPlacement.infoTexts.speed, formatItemsPerSecond(speed)]]; + } } } @@ -69,6 +80,7 @@ export class MetaPainterBuilding extends MetaBuilding { } if (root.hubGoals.isRewardUnlocked(enumHubGoalRewards.reward_painter_quad)) { variants.push(enumPainterVariants.quad); + variants.push(enumPainterVariants.bleacher); } return variants; } @@ -206,6 +218,22 @@ export class MetaPainterBuilding extends MetaBuilding { ]); break; } + case enumPainterVariants.bleacher: { + entity.components.ItemAcceptor.setSlots([ + { + pos: new Vector(0, 0), + directions: [enumDirection.left], + filter: enumItemType.shape, + }, + ]); + + entity.components.ItemProcessor.type = enumItemProcessorTypes.bleacher; + entity.components.ItemProcessor.inputsPerCharge = 1; + entity.components.ItemEjector.setSlots([ + { pos: new Vector(0, 0), direction: enumDirection.right }, + ]); + break; + } default: assertAlways(false, "Unknown painter variant: " + variant); } diff --git a/src/js/game/components/item_processor.js b/src/js/game/components/item_processor.js index 478450a7..98ca461e 100644 --- a/src/js/game/components/item_processor.js +++ b/src/js/game/components/item_processor.js @@ -16,6 +16,7 @@ export const enumItemProcessorTypes = { painter: "painter", painterDouble: "painterDouble", painterQuad: "painterQuad", + bleacher: "bleacher", advancedProcessor: "advancedProcessor", hub: "hub", }; diff --git a/src/js/game/hub_goals.js b/src/js/game/hub_goals.js index cb1e27c8..b5b7b4e0 100644 --- a/src/js/game/hub_goals.js +++ b/src/js/game/hub_goals.js @@ -408,7 +408,8 @@ export class HubGoals extends BasicSerializableObject { case enumItemProcessorTypes.mixer: case enumItemProcessorTypes.painter: case enumItemProcessorTypes.painterDouble: - case enumItemProcessorTypes.painterQuad: { + case enumItemProcessorTypes.painterQuad: + case enumItemProcessorTypes.bleacher: { assert( globalConfig.buildingSpeeds[processorType], "Processor type has no speed set in globalConfig.buildingSpeeds: " + processorType diff --git a/src/js/game/systems/item_processor.js b/src/js/game/systems/item_processor.js index 6d6fc8e9..09bd02ee 100644 --- a/src/js/game/systems/item_processor.js +++ b/src/js/game/systems/item_processor.js @@ -8,6 +8,7 @@ import { ColorItem } from "../items/color_item"; import { ShapeItem } from "../items/shape_item"; import { enumLayer } from "../root"; import { NEGATIVE_ENERGY_ITEM_SINGLETON } from "../items/negative_energy_item"; +import { enumColors } from "../../game/colors"; export class ItemProcessorSystem extends GameSystemWithFilter { constructor(root) { @@ -320,6 +321,23 @@ export class ItemProcessorSystem extends GameSystemWithFilter { break; } + // BLEACHER + + case enumItemProcessorTypes.bleacher: { + const shapeItem = /** @type {ShapeItem} */ (items[0].item); + + const colorizedDefinition = this.root.shapeDefinitionMgr.shapeActionPaintWith( + shapeItem.definition, + enumColors.uncolored + ); + + outItems.push({ + item: new ShapeItem(colorizedDefinition), + }); + + break; + } + // HUB case enumItemProcessorTypes.hub: { diff --git a/translations/base-en.yaml b/translations/base-en.yaml index db806a09..a8d5e334 100644 --- a/translations/base-en.yaml +++ b/translations/base-en.yaml @@ -524,6 +524,10 @@ buildings: name: Painter (Quad) description: Allows to color each quadrant of the shape with a different color. + bleacher: + name: Bleacher + description: Bleaches the whole shape.. + trash: default: name: &trash Trash diff --git a/translations/base-ja.yaml b/translations/base-ja.yaml index 500238db..f90ab998 100644 --- a/translations/base-ja.yaml +++ b/translations/base-ja.yaml @@ -507,6 +507,9 @@ buildings: mirrored: name: *painter description: *painter_desc + bleacher: + name: 脱色機 + description: 入力された形の全体を無色にします。 trash: default: