mirror of
https://github.com/tobspr/shapez.io.git
synced 2025-06-13 13:04:03 +00:00
Add Bleacher building
This commit is contained in:
parent
c895540ad2
commit
9b8679c41a
@ -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,
|
||||
|
||||
@ -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);
|
||||
}
|
||||
|
||||
@ -16,6 +16,7 @@ export const enumItemProcessorTypes = {
|
||||
painter: "painter",
|
||||
painterDouble: "painterDouble",
|
||||
painterQuad: "painterQuad",
|
||||
bleacher: "bleacher",
|
||||
advancedProcessor: "advancedProcessor",
|
||||
hub: "hub",
|
||||
};
|
||||
|
||||
@ -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
|
||||
|
||||
@ -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: {
|
||||
|
||||
@ -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
|
||||
|
||||
@ -507,6 +507,9 @@ buildings:
|
||||
mirrored:
|
||||
name: *painter
|
||||
description: *painter_desc
|
||||
bleacher:
|
||||
name: 脱色機
|
||||
description: 入力された形の全体を無色にします。
|
||||
|
||||
trash:
|
||||
default:
|
||||
|
||||
Loading…
Reference in New Issue
Block a user