mirror of
https://github.com/tobspr/shapez.io.git
synced 2026-02-12 19:09:21 +00:00
Add dye incinerator building.
This commit is contained in:
parent
374e8b0db1
commit
f05a282581
@ -9,9 +9,9 @@
|
||||
xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape"
|
||||
inkscape:export-ydpi="96"
|
||||
inkscape:export-xdpi="96"
|
||||
inkscape:export-filename="C:\Users\Jasper\WebstormProjects\shapez.io\res_raw\sprites\buildings\furnace.png"
|
||||
inkscape:export-filename="/home/dualhexagon/Desktop/shapezio/shapez.io/res_raw/sprites/buildings/mixer-incinerator.png"
|
||||
sodipodi:docname="furnace.svg"
|
||||
inkscape:version="1.0 (4035a4fb49, 2020-05-01)"
|
||||
inkscape:version="0.92.3 (2405546, 2018-03-11)"
|
||||
id="svg8"
|
||||
version="1.1"
|
||||
viewBox="0 0 384 192"
|
||||
@ -21,10 +21,10 @@
|
||||
id="defs2" />
|
||||
<sodipodi:namedview
|
||||
inkscape:window-maximized="1"
|
||||
inkscape:window-y="-8"
|
||||
inkscape:window-x="-8"
|
||||
inkscape:window-height="1017"
|
||||
inkscape:window-width="1920"
|
||||
inkscape:window-y="27"
|
||||
inkscape:window-x="67"
|
||||
inkscape:window-height="713"
|
||||
inkscape:window-width="1299"
|
||||
inkscape:bbox-paths="true"
|
||||
inkscape:bbox-nodes="true"
|
||||
inkscape:snap-nodes="false"
|
||||
@ -44,9 +44,9 @@
|
||||
inkscape:document-rotation="0"
|
||||
inkscape:current-layer="layer3"
|
||||
inkscape:document-units="px"
|
||||
inkscape:cy="120.16762"
|
||||
inkscape:cx="210.28118"
|
||||
inkscape:zoom="2.4601423"
|
||||
inkscape:cy="112.64913"
|
||||
inkscape:cx="191.77955"
|
||||
inkscape:zoom="0.947937"
|
||||
inkscape:pageshadow="2"
|
||||
inkscape:pageopacity="0.0"
|
||||
borderopacity="1.0"
|
||||
@ -59,19 +59,23 @@
|
||||
<sodipodi:guide
|
||||
id="guide837"
|
||||
orientation="1,0"
|
||||
position="9,183" />
|
||||
position="9,183"
|
||||
inkscape:locked="false" />
|
||||
<sodipodi:guide
|
||||
id="guide839"
|
||||
orientation="0,-1"
|
||||
position="9,183" />
|
||||
position="9,183"
|
||||
inkscape:locked="false" />
|
||||
<sodipodi:guide
|
||||
id="guide841"
|
||||
orientation="1,0"
|
||||
position="375,183" />
|
||||
position="375,183"
|
||||
inkscape:locked="false" />
|
||||
<sodipodi:guide
|
||||
id="guide843"
|
||||
orientation="0,-1"
|
||||
position="9,9" />
|
||||
position="9,9"
|
||||
inkscape:locked="false" />
|
||||
</sodipodi:namedview>
|
||||
<metadata
|
||||
id="metadata5">
|
||||
|
||||
|
Before Width: | Height: | Size: 9.7 KiB After Width: | Height: | Size: 9.8 KiB |
BIN
res/ui/building_tutorials/mixer-incinerator.png
Normal file
BIN
res/ui/building_tutorials/mixer-incinerator.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 37 KiB |
BIN
res_raw/sprites/blueprints/mixer-incinerator.png
Normal file
BIN
res_raw/sprites/blueprints/mixer-incinerator.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 19 KiB |
BIN
res_raw/sprites/buildings/mixer-incinerator.png
Normal file
BIN
res_raw/sprites/buildings/mixer-incinerator.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 13 KiB |
@ -7,7 +7,7 @@ $buildings: belt, cutter, miner, mixer, painter, rotater, splitter, stacker, tra
|
||||
}
|
||||
|
||||
$buildingsAndVariants: belt, splitter, splitter-compact, splitter-compact-inverse, underground_belt,
|
||||
underground_belt-tier2, miner, miner-chainable, cutter, cutter-quad, rotater, rotater-ccw, stacker, mixer,
|
||||
underground_belt-tier2, miner, miner-chainable, cutter, cutter-quad, rotater, rotater-ccw, stacker, mixer, mixer-incinerator,
|
||||
painter, painter-double, painter-quad, trash, trash-storage;
|
||||
@each $building in $buildingsAndVariants {
|
||||
[data-icon="building_tutorials/#{$building}.png"] {
|
||||
|
||||
@ -65,6 +65,7 @@ export const globalConfig = {
|
||||
painterDouble: 1 / 8,
|
||||
painterQuad: 1 / 8,
|
||||
mixer: 1 / 5,
|
||||
dyeIncinerator: 1 / 4,
|
||||
stacker: 1 / 6,
|
||||
},
|
||||
|
||||
|
||||
@ -4,19 +4,28 @@ import { ItemAcceptorComponent, enumItemAcceptorItemFilter } from "../components
|
||||
import { ItemEjectorComponent } from "../components/item_ejector";
|
||||
import { enumItemProcessorTypes, ItemProcessorComponent } from "../components/item_processor";
|
||||
import { Entity } from "../entity";
|
||||
import { MetaBuilding } from "../meta_building";
|
||||
import { MetaBuilding, defaultBuildingVariant } from "../meta_building";
|
||||
import { GameRoot } from "../root";
|
||||
import { enumHubGoalRewards } from "../tutorial_goals";
|
||||
import { T } from "../../translations";
|
||||
import { formatItemsPerSecond } from "../../core/utils";
|
||||
|
||||
/** @enum {string} */
|
||||
export const enumMixerVariants = { incinerator: "incinerator" };
|
||||
|
||||
export class MetaMixerBuilding extends MetaBuilding {
|
||||
constructor() {
|
||||
super("mixer");
|
||||
}
|
||||
|
||||
getDimensions() {
|
||||
return new Vector(2, 1);
|
||||
getDimensions(variant) {
|
||||
switch (variant) {
|
||||
case defaultBuildingVariant:
|
||||
case enumMixerVariants.incinerator:
|
||||
return new Vector(2, 1);
|
||||
default:
|
||||
assertAlways(false, "Unknown mixer variant: " + variant);
|
||||
}
|
||||
}
|
||||
|
||||
getSilhouetteColor() {
|
||||
@ -36,8 +45,24 @@ export class MetaMixerBuilding extends MetaBuilding {
|
||||
* @returns {Array<[string, string]>}
|
||||
*/
|
||||
getAdditionalStatistics(root, variant) {
|
||||
const speed = root.hubGoals.getProcessorBaseSpeed(enumItemProcessorTypes.mixer);
|
||||
return [[T.ingame.buildingPlacement.infoTexts.speed, formatItemsPerSecond(speed)]];
|
||||
switch (variant) {
|
||||
case defaultBuildingVariant: {
|
||||
const speed = root.hubGoals.getProcessorBaseSpeed(enumItemProcessorTypes.mixer);
|
||||
return [[T.ingame.buildingPlacement.infoTexts.speed, formatItemsPerSecond(speed)]];
|
||||
}
|
||||
case enumMixerVariants.incinerator: {
|
||||
const speed = root.hubGoals.getProcessorBaseSpeed(enumItemProcessorTypes.dyeIncinerator);
|
||||
return [[T.ingame.buildingPlacement.infoTexts.speed, formatItemsPerSecond(speed)]];
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
getAvailableVariants(root) {
|
||||
let variants = [defaultBuildingVariant];
|
||||
if (root.hubGoals.isRewardUnlocked(enumHubGoalRewards.reward_dye_incinerator)) {
|
||||
variants.push(enumMixerVariants.incinerator);
|
||||
}
|
||||
return variants;
|
||||
}
|
||||
|
||||
/**
|
||||
@ -51,12 +76,7 @@ export class MetaMixerBuilding extends MetaBuilding {
|
||||
processorType: enumItemProcessorTypes.mixer,
|
||||
})
|
||||
);
|
||||
|
||||
entity.addComponent(
|
||||
new ItemEjectorComponent({
|
||||
slots: [{ pos: new Vector(0, 0), direction: enumDirection.top }],
|
||||
})
|
||||
);
|
||||
entity.addComponent(new ItemEjectorComponent({}));
|
||||
entity.addComponent(
|
||||
new ItemAcceptorComponent({
|
||||
slots: [
|
||||
@ -74,4 +94,39 @@ export class MetaMixerBuilding extends MetaBuilding {
|
||||
})
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
*
|
||||
* @param {Entity} entity
|
||||
* @param {number} rotationVariant
|
||||
* @param {string} variant
|
||||
*/
|
||||
updateVariants(entity, rotationVariant, variant) {
|
||||
switch (variant) {
|
||||
case defaultBuildingVariant: {
|
||||
entity.components.ItemEjector.setSlots([
|
||||
{ pos: new Vector(0, 0), direction: enumDirection.top },
|
||||
]);
|
||||
break;
|
||||
}
|
||||
case enumMixerVariants.incinerator: {
|
||||
entity.components.ItemProcessor.type = enumItemProcessorTypes.dyeIncinerator;
|
||||
entity.components.ItemProcessor.inputsPerCharge = 1;
|
||||
entity.components.ItemAcceptor.setSlots([
|
||||
{
|
||||
pos: new Vector(0, 0),
|
||||
directions: [enumDirection.left],
|
||||
filter: enumItemAcceptorItemFilter.color,
|
||||
},
|
||||
]);
|
||||
entity.components.ItemEjector.setSlots([
|
||||
{ pos: new Vector(1, 0), direction: enumDirection.right },
|
||||
]);
|
||||
break;
|
||||
}
|
||||
default: {
|
||||
assertAlways(false, "Unknown mixer variant: " + variant);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@ -14,6 +14,7 @@ export const enumItemProcessorTypes = {
|
||||
stacker: "stacker",
|
||||
trash: "trash",
|
||||
mixer: "mixer",
|
||||
dyeIncinerator: "dyeIncinerator",
|
||||
painter: "painter",
|
||||
painterDouble: "painterDouble",
|
||||
painterQuad: "painterQuad",
|
||||
|
||||
@ -395,6 +395,7 @@ export class HubGoals extends BasicSerializableObject {
|
||||
return globalConfig.beltSpeedItemsPerSecond * this.upgradeImprovements.belt * 2;
|
||||
|
||||
case enumItemProcessorTypes.mixer:
|
||||
case enumItemProcessorTypes.dyeIncinerator:
|
||||
case enumItemProcessorTypes.painter:
|
||||
case enumItemProcessorTypes.painterDouble:
|
||||
case enumItemProcessorTypes.painterQuad: {
|
||||
|
||||
@ -240,6 +240,16 @@ export class ItemProcessorSystem extends GameSystemWithFilter {
|
||||
break;
|
||||
}
|
||||
|
||||
// DYE INCINERATOR
|
||||
|
||||
case enumItemProcessorTypes.dyeIncinerator: {
|
||||
outItems.push({
|
||||
item: new ColorItem("uncolored"),
|
||||
});
|
||||
|
||||
break;
|
||||
}
|
||||
|
||||
// PAINTER
|
||||
|
||||
case enumItemProcessorTypes.painter: {
|
||||
|
||||
@ -22,6 +22,7 @@ export const enumHubGoalRewards = {
|
||||
reward_painter_double: "reward_painter_double",
|
||||
reward_painter_quad: "reward_painter_quad",
|
||||
reward_storage: "reward_storage",
|
||||
reward_dye_incinerator: "reward_dye_incinerator",
|
||||
|
||||
reward_blueprints: "reward_blueprints",
|
||||
reward_freeplay: "reward_freeplay",
|
||||
@ -160,6 +161,13 @@ export const tutorialGoals = [
|
||||
},
|
||||
|
||||
// 18
|
||||
{
|
||||
shape: "WpWpWpWp:CwCwCwCw:WpWpWpWp:CwCwCwCw", // painting t4 (two variants)
|
||||
required: 150000,
|
||||
reward: enumHubGoalRewards.reward_dye_incinerator,
|
||||
},
|
||||
|
||||
// 19
|
||||
{
|
||||
shape: finalGameShape,
|
||||
required: 250000,
|
||||
|
||||
@ -2,7 +2,7 @@ import { MetaBuilding, defaultBuildingVariant } from "./meta_building";
|
||||
import { MetaCutterBuilding, enumCutterVariants } from "./buildings/cutter";
|
||||
import { MetaRotaterBuilding, enumRotaterVariants } from "./buildings/rotater";
|
||||
import { MetaPainterBuilding, enumPainterVariants } from "./buildings/painter";
|
||||
import { MetaMixerBuilding } from "./buildings/mixer";
|
||||
import { MetaMixerBuilding, enumMixerVariants } from "./buildings/mixer";
|
||||
import { MetaStackerBuilding } from "./buildings/stacker";
|
||||
import { MetaSplitterBuilding, enumSplitterVariants } from "./buildings/splitter";
|
||||
import { MetaUndergroundBeltBuilding, enumUndergroundBeltVariants } from "./buildings/underground_belt";
|
||||
@ -44,6 +44,7 @@ export const enumHubGoalRewardsToContentUnlocked = {
|
||||
[enumHubGoalRewards.reward_painter_double]: typed([[MetaPainterBuilding, enumPainterVariants.double]]),
|
||||
[enumHubGoalRewards.reward_painter_quad]: typed([[MetaPainterBuilding, enumPainterVariants.quad]]),
|
||||
[enumHubGoalRewards.reward_storage]: typed([[MetaTrashBuilding, enumTrashVariants.storage]]),
|
||||
[enumHubGoalRewards.reward_dye_incinerator]: typed([[MetaMixerBuilding, enumMixerVariants.incinerator]]),
|
||||
|
||||
[enumHubGoalRewards.reward_freeplay]: null,
|
||||
[enumHubGoalRewards.no_reward]: null,
|
||||
|
||||
@ -496,6 +496,9 @@ buildings:
|
||||
default:
|
||||
name: &mixer Color Mixer
|
||||
description: Mixes two colors using additive blending.
|
||||
incinerator:
|
||||
name: Dye Incinerator
|
||||
description: Produce gray dye from any dye you put in.
|
||||
|
||||
painter:
|
||||
default:
|
||||
@ -586,6 +589,10 @@ storyRewards:
|
||||
title: Storage Buffer
|
||||
desc: You have unlocked a variant of the <strong>trash</strong> - It allows to store items up to a given capacity!
|
||||
|
||||
reward_dye_incinerator:
|
||||
title: Dye Incinerator
|
||||
desc: You have unlocked a variant of the <strong>mixer</strong> - It allows you to make gray dye by inputting any dye you have. Very useful with the <strong>quad painter</strong>!
|
||||
|
||||
reward_freeplay:
|
||||
title: Freeplay
|
||||
desc: You did it! You unlocked the <strong>free-play mode</strong>! This means that shapes are now randomly generated! (No worries, more content is planned for the standalone!)
|
||||
|
||||
Loading…
Reference in New Issue
Block a user