mirror of
https://github.com/tobspr/shapez.io.git
synced 2026-03-02 03:39:21 +00:00
Add more tutorials
This commit is contained in:
@@ -73,8 +73,8 @@ ingame_HUD_KeybindingOverlay,
|
||||
ingame_HUD_Notifications,
|
||||
ingame_HUD_DebugInfo,
|
||||
ingame_HUD_EntityDebugger,
|
||||
ingame_HUD_InteractiveTutorial,
|
||||
ingame_HUD_TutorialHints,
|
||||
ingame_HUD_InteractiveTutorial,
|
||||
ingame_HUD_BuildingsToolbar,
|
||||
ingame_HUD_wires_toolbar,
|
||||
ingame_HUD_BlueprintPlacer,
|
||||
|
||||
@@ -132,3 +132,8 @@ if (G_IS_DEV && globalConfig.debug.renderForTrailer) {
|
||||
if (globalConfig.debug.fastGameEnter) {
|
||||
globalConfig.debug.noArtificialDelays = true;
|
||||
}
|
||||
|
||||
if (G_IS_DEV && globalConfig.debug.noArtificialDelays) {
|
||||
globalConfig.warmupTimeSecondsFast = 0;
|
||||
globalConfig.warmupTimeSecondsRegular = 0;
|
||||
}
|
||||
|
||||
@@ -6,6 +6,8 @@ import { DynamicDomAttach } from "../dynamic_dom_attach";
|
||||
import { TrackedState } from "../../../core/tracked_state";
|
||||
import { cachebust } from "../../../core/cachebust";
|
||||
import { T } from "../../../translations";
|
||||
import { enumItemProcessorTypes, ItemProcessorComponent } from "../../components/item_processor";
|
||||
import { ShapeItem } from "../../items/shape_item";
|
||||
|
||||
const tutorialsByLevel = [
|
||||
// Level 1
|
||||
@@ -30,6 +32,68 @@ const tutorialsByLevel = [
|
||||
condition: () => true,
|
||||
},
|
||||
],
|
||||
// Level 2
|
||||
[
|
||||
// 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
|
||||
);
|
||||
},
|
||||
},
|
||||
// 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
|
||||
);
|
||||
},
|
||||
},
|
||||
// 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
|
||||
);
|
||||
},
|
||||
},
|
||||
],
|
||||
|
||||
// Level 2
|
||||
[
|
||||
// 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
|
||||
);
|
||||
},
|
||||
},
|
||||
],
|
||||
];
|
||||
|
||||
export class HUDInteractiveTutorial extends BaseHUDPart {
|
||||
|
||||
@@ -45,7 +45,7 @@ function generateUpgrades(limitedVersion = false) {
|
||||
const upgrades = {
|
||||
belt: [
|
||||
{
|
||||
required: [{ shape: "CuCuCuCu", amount: 60 }],
|
||||
required: [{ shape: "CuCuCuCu", amount: 30 }],
|
||||
},
|
||||
{
|
||||
required: [{ shape: "--CuCu--", amount: 500 }],
|
||||
|
||||
@@ -285,14 +285,10 @@ export class InGameState extends GameState {
|
||||
*/
|
||||
stage7Warmup() {
|
||||
if (this.switchStage(stages.s7_warmup)) {
|
||||
if (G_IS_DEV && globalConfig.debug.noArtificialDelays) {
|
||||
this.warmupTimeSeconds = 0.05;
|
||||
if (this.creationPayload.fastEnter) {
|
||||
this.warmupTimeSeconds = globalConfig.warmupTimeSecondsFast;
|
||||
} else {
|
||||
if (this.creationPayload.fastEnter) {
|
||||
this.warmupTimeSeconds = globalConfig.warmupTimeSecondsFast;
|
||||
} else {
|
||||
this.warmupTimeSeconds = globalConfig.warmupTimeSecondsRegular;
|
||||
}
|
||||
this.warmupTimeSeconds = globalConfig.warmupTimeSecondsRegular;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user