diff --git a/res/ui/interactive_tutorial.noinline/21_1_place_quad_painter.gif b/res/ui/interactive_tutorial.noinline/21_1_place_quad_painter.gif new file mode 100644 index 00000000..ea854cf2 Binary files /dev/null and b/res/ui/interactive_tutorial.noinline/21_1_place_quad_painter.gif differ diff --git a/res/ui/interactive_tutorial.noinline/21_2_switch_to_wires.gif b/res/ui/interactive_tutorial.noinline/21_2_switch_to_wires.gif new file mode 100644 index 00000000..78ab6fd2 Binary files /dev/null and b/res/ui/interactive_tutorial.noinline/21_2_switch_to_wires.gif differ diff --git a/res/ui/interactive_tutorial.noinline/21_3_place_button.gif b/res/ui/interactive_tutorial.noinline/21_3_place_button.gif new file mode 100644 index 00000000..52ffb076 Binary files /dev/null and b/res/ui/interactive_tutorial.noinline/21_3_place_button.gif differ diff --git a/res/ui/interactive_tutorial.noinline/21_4_press_button.gif b/res/ui/interactive_tutorial.noinline/21_4_press_button.gif new file mode 100644 index 00000000..5d79f1e3 Binary files /dev/null and b/res/ui/interactive_tutorial.noinline/21_4_press_button.gif differ diff --git a/src/js/game/hud/parts/interactive_tutorial.js b/src/js/game/hud/parts/interactive_tutorial.js index b6037eb2..cb0dde72 100644 --- a/src/js/game/hud/parts/interactive_tutorial.js +++ b/src/js/game/hud/parts/interactive_tutorial.js @@ -8,6 +8,8 @@ import { cachebust } from "../../../core/cachebust"; import { T } from "../../../translations"; import { enumItemProcessorTypes, ItemProcessorComponent } from "../../components/item_processor"; import { ShapeItem } from "../../items/shape_item"; +import { WireComponent } from "../../components/wire"; +import { LeverComponent } from "../../components/lever"; const tutorialsByLevel = [ // Level 1 @@ -15,16 +17,13 @@ const tutorialsByLevel = [ // 1.1. place an extractor { id: "1_1_extractor", - condition: /** @param {GameRoot} root */ root => { - return root.entityMgr.getAllWithComponent(MinerComponent).length === 0; - }, + condition: /** @param {GameRoot} root */ root => + root.entityMgr.getAllWithComponent(MinerComponent).length === 0, }, // 1.2. connect to hub { id: "1_2_conveyor", - condition: /** @param {GameRoot} root */ root => { - return root.hubGoals.getCurrentGoalDelivered() === 0; - }, + condition: /** @param {GameRoot} root */ root => root.hubGoals.getCurrentGoalDelivered() === 0, }, // 1.3 wait for completion { @@ -37,61 +36,101 @@ const tutorialsByLevel = [ // 2.1 place a cutter { id: "2_1_place_cutter", - condition: /** @param {GameRoot} root */ root => { - return ( - root.entityMgr - .getAllWithComponent(ItemProcessorComponent) - .filter(e => e.components.ItemProcessor.type === enumItemProcessorTypes.cutter) - .length === 0 - ); - }, + condition: /** @param {GameRoot} root */ root => + root.entityMgr + .getAllWithComponent(ItemProcessorComponent) + .filter(e => e.components.ItemProcessor.type === enumItemProcessorTypes.cutter).length === + 0, }, // 2.2 place trash { id: "2_2_place_trash", - condition: /** @param {GameRoot} root */ root => { - return ( - root.entityMgr - .getAllWithComponent(ItemProcessorComponent) - .filter(e => e.components.ItemProcessor.type === enumItemProcessorTypes.trash) - .length === 0 - ); - }, + condition: /** @param {GameRoot} root */ root => + root.entityMgr + .getAllWithComponent(ItemProcessorComponent) + .filter(e => e.components.ItemProcessor.type === enumItemProcessorTypes.trash).length === + 0, }, // 2.3 place more cutters { id: "2_3_more_cutters", - condition: /** @param {GameRoot} root */ root => { - return ( - root.entityMgr - .getAllWithComponent(ItemProcessorComponent) - .filter(e => e.components.ItemProcessor.type === enumItemProcessorTypes.cutter) - .length < 3 - ); - }, + condition: /** @param {GameRoot} root */ root => + root.entityMgr + .getAllWithComponent(ItemProcessorComponent) + .filter(e => e.components.ItemProcessor.type === enumItemProcessorTypes.cutter).length < + 3, }, ], - // Level 2 + // Level 3 [ // 3.1. rectangles { id: "3_1_rectangles", - condition: /** @param {GameRoot} root */ root => { - return ( - // 4 miners placed above rectangles and 10 delivered - root.hubGoals.getCurrentGoalDelivered() < 10 || - root.entityMgr.getAllWithComponent(MinerComponent).filter(entity => { - const tile = entity.components.StaticMapEntity.origin; - const below = root.map.getLowerLayerContentXY(tile.x, tile.y); - if (below && below.getItemType() === "shape") { - const shape = /** @type {ShapeItem} */ (below).definition.getHash(); - return shape === "RuRuRuRu"; - } - return false; - }).length < 4 - ); - }, + condition: /** @param {GameRoot} root */ root => + // 4 miners placed above rectangles and 10 delivered + root.hubGoals.getCurrentGoalDelivered() < 10 || + root.entityMgr.getAllWithComponent(MinerComponent).filter(entity => { + const tile = entity.components.StaticMapEntity.origin; + const below = root.map.getLowerLayerContentXY(tile.x, tile.y); + if (below && below.getItemType() === "shape") { + const shape = /** @type {ShapeItem} */ (below).definition.getHash(); + return shape === "RuRuRuRu"; + } + return false; + }).length < 4, + }, + ], + + [], // Level 4 + [], // Level 5 + [], // Level 6 + [], // Level 7 + [], // Level 8 + [], // Level 9 + [], // Level 10 + [], // Level 11 + [], // Level 12 + [], // Level 13 + [], // Level 14 + [], // Level 15 + [], // Level 16 + [], // Level 17 + [], // Level 18 + [], // Level 19 + [], // Level 20 + + // Level 21 + [ + // 21.1 place quad painter + { + id: "21_1_place_quad_painter", + condition: /** @param {GameRoot} root */ root => + root.entityMgr + .getAllWithComponent(ItemProcessorComponent) + .filter(e => e.components.ItemProcessor.type === enumItemProcessorTypes.painterQuad) + .length === 0, + }, + + // 21.2 switch to wires layer + { + id: "21_2_switch_to_wires", + condition: /** @param {GameRoot} root */ root => + root.entityMgr.getAllWithComponent(WireComponent).length < 5, + }, + + // 21.3 place button + { + id: "21_3_place_button", + condition: /** @param {GameRoot} root */ root => + root.entityMgr.getAllWithComponent(LeverComponent).length === 0, + }, + + // 21.4 activate button + { + id: "21_4_press_button", + condition: /** @param {GameRoot} root */ root => + root.entityMgr.getAllWithComponent(LeverComponent).some(e => !e.components.Lever.toggled), }, ], ]; diff --git a/src/js/profile/application_settings.js b/src/js/profile/application_settings.js index 061e3ead..68abf5bb 100644 --- a/src/js/profile/application_settings.js +++ b/src/js/profile/application_settings.js @@ -676,6 +676,10 @@ export class ApplicationSettings extends ReadWriteProxy { if (data.version < 30) { data.settings.mapResourcesScale = 0.5; + + // Re-enable hints as well + data.settings.offerHints = true; + data.version = 30; } diff --git a/translations/base-en.yaml b/translations/base-en.yaml index a0754ba9..45cace79 100644 --- a/translations/base-en.yaml +++ b/translations/base-en.yaml @@ -430,6 +430,20 @@ ingame: Now let's extract some rectangles! Build 4 extractors and connect them to the hub.

PS: Hold SHIFT while dragging a belt to activate the belt planner! + 21_1_place_quad_painter: >- + Place the quad painter and get some circles, white and red color! + + 21_2_switch_to_wires: >- + Switch to the wires layer by pressing E!

+ Then connect all four inputs of the painter with cables! + + 21_3_place_button: >- + Awesome! Now place a Switch and connect it with wires! + + 21_4_press_button: >- + Press the switch to make it emit a truthy signal and thus activate the painter.

+ PS: You don't have to connect all inputs! Try wiring only two. + # Connected miners connectedMiners: one_miner: 1 Extractor @@ -791,7 +805,8 @@ storyRewards: desc: >- You just unlocked the Wires Layer: It is a separate layer on top of the regular layer and introduces a lot of new mechanics!

For the beginning I unlocked you the Quad Painter - Connect the slots you would like to paint with on the wires layer!

- To switch to the wires layer, press E. + To switch to the wires layer, press E.

+ PS: Enable hints in the settings to activate the wires tutorial! reward_filter: title: >-