1
0
mirror of https://github.com/tobspr/shapez.io.git synced 2026-03-02 03:39:21 +00:00

Add sandbox building, restructure levels, show pinned shapes in constant signal dialog

This commit is contained in:
tobspr
2020-09-29 10:52:25 +02:00
parent fd3bbcdc20
commit db6db7caca
36 changed files with 499 additions and 312 deletions

View File

@@ -23,7 +23,7 @@ export class MetaFilterBuilding extends MetaBuilding {
* @param {GameRoot} root
*/
getIsUnlocked(root) {
return root.hubGoals.isRewardUnlocked(enumHubGoalRewards.reward_wires_filters_and_levers);
return root.hubGoals.isRewardUnlocked(enumHubGoalRewards.reward_filter);
}
getDimensions() {

View File

@@ -0,0 +1,40 @@
import { enumDirection, Vector } from "../../core/vector";
import { ItemEjectorComponent } from "../components/item_ejector";
import { ItemProducerComponent } from "../components/item_producer";
import { enumPinSlotType, WiredPinsComponent } from "../components/wired_pins";
import { Entity } from "../entity";
import { MetaBuilding } from "../meta_building";
export class MetaItemProducerBuilding extends MetaBuilding {
constructor() {
super("item_producer");
}
getSilhouetteColor() {
return "#b37dcd";
}
/**
* Creates the entity at the given location
* @param {Entity} entity
*/
setupEntityComponents(entity) {
entity.addComponent(
new ItemEjectorComponent({
slots: [{ pos: new Vector(0, 0), direction: enumDirection.top }],
})
);
entity.addComponent(
new WiredPinsComponent({
slots: [
{
pos: new Vector(0, 0),
type: enumPinSlotType.logicalAcceptor,
direction: enumDirection.bottom,
},
],
})
);
entity.addComponent(new ItemProducerComponent());
}
}

View File

@@ -20,7 +20,7 @@ export class MetaLeverBuilding extends MetaBuilding {
* @param {GameRoot} root
*/
getIsUnlocked(root) {
return root.hubGoals.isRewardUnlocked(enumHubGoalRewards.reward_wires_filters_and_levers);
return root.hubGoals.isRewardUnlocked(enumHubGoalRewards.reward_wires_painter_and_levers);
}
getDimensions() {

View File

@@ -71,7 +71,7 @@ export class MetaPainterBuilding extends MetaBuilding {
if (root.hubGoals.isRewardUnlocked(enumHubGoalRewards.reward_painter_double)) {
variants.push(enumPainterVariants.double);
}
if (root.hubGoals.isRewardUnlocked(enumHubGoalRewards.reward_painter_quad)) {
if (root.hubGoals.isRewardUnlocked(enumHubGoalRewards.reward_wires_painter_and_levers)) {
variants.push(enumPainterVariants.quad);
}
return variants;

View File

@@ -4,6 +4,7 @@ import { WiredPinsComponent, enumPinSlotType } from "../components/wired_pins";
import { Entity } from "../entity";
import { defaultBuildingVariant, MetaBuilding } from "../meta_building";
import { GameRoot } from "../root";
import { enumHubGoalRewards } from "../tutorial_goals";
import { MetaCutterBuilding } from "./cutter";
import { MetaPainterBuilding } from "./painter";
import { MetaRotaterBuilding } from "./rotater";
@@ -47,8 +48,7 @@ export class MetaVirtualProcessorBuilding extends MetaBuilding {
* @param {GameRoot} root
*/
getIsUnlocked(root) {
// @todo
return true;
return root.hubGoals.isRewardUnlocked(enumHubGoalRewards.reward_virtual_processing);
}
/** @returns {"wires"} **/

View File

@@ -82,7 +82,7 @@ export class MetaWireBuilding extends MetaBuilding {
* @param {GameRoot} root
*/
getIsUnlocked(root) {
return root.hubGoals.isRewardUnlocked(enumHubGoalRewards.reward_wires_filters_and_levers);
return root.hubGoals.isRewardUnlocked(enumHubGoalRewards.reward_wires_painter_and_levers);
}
/**

View File

@@ -21,7 +21,7 @@ export class MetaWireTunnelBuilding extends MetaBuilding {
* @param {GameRoot} root
*/
getIsUnlocked(root) {
return root.hubGoals.isRewardUnlocked(enumHubGoalRewards.reward_wires_filters_and_levers);
return root.hubGoals.isRewardUnlocked(enumHubGoalRewards.reward_wires_painter_and_levers);
}
/**