From c1f6741c754c20181bb0d2df750febeacf4597d1 Mon Sep 17 00:00:00 2001 From: circle-gon <97845741+circle-gon@users.noreply.github.com> Date: Fri, 23 Dec 2022 09:28:14 -0500 Subject: [PATCH 1/8] fixes computed inputs/outputs not actually checking properly --- src/data/layers/factory.tsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/data/layers/factory.tsx b/src/data/layers/factory.tsx index 0eeda6f..1884ca7 100644 --- a/src/data/layers/factory.tsx +++ b/src/data/layers/factory.tsx @@ -1572,7 +1572,7 @@ const factory = createLayer(id, () => { const compData = components.value[x + "x" + y] as FactoryComponentProcessor; if (factoryBaseData.inputs !== undefined) { for (const [res, val] of Object.entries(factoryBaseData.inputs)) - if ((compData.inputStock?.[res as ResourceNames] ?? 0) < val.amount) + if ((compData.inputStock?.[res as ResourceNames] ?? 0) < unref(val.amount)) return false; } if (factoryBaseData.outputs !== undefined) { From dcabdac385e88c5836cddef5fd2cfe245dbfa264 Mon Sep 17 00:00:00 2001 From: thepaperpilot Date: Fri, 23 Dec 2022 08:48:17 -0600 Subject: [PATCH 2/8] Fixed random error I started getting about main being undefined?? --- src/components/Options.vue | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/components/Options.vue b/src/components/Options.vue index 657388f..08245dc 100644 --- a/src/components/Options.vue +++ b/src/components/Options.vue @@ -98,7 +98,7 @@ const isPaused = computed({ }); const canAutoSave = computed( - () => (layers as any).main.days[(layers as any).main.day.value - 1].opened.value + () => (layers as any).main?.days[(layers as any).main?.day.value - 1].opened.value ); const autosaveTitle = jsx(() => ( From d43899e938237bec2f1a2471b3fe1d37d4e204d4 Mon Sep 17 00:00:00 2001 From: thepaperpilot Date: Fri, 23 Dec 2022 08:55:36 -0600 Subject: [PATCH 3/8] Fix build errors --- src/data/layers/factory.tsx | 66 +++++++++++++++++++++++++++---------- 1 file changed, 49 insertions(+), 17 deletions(-) diff --git a/src/data/layers/factory.tsx b/src/data/layers/factory.tsx index 1884ca7..f7f6b51 100644 --- a/src/data/layers/factory.tsx +++ b/src/data/layers/factory.tsx @@ -206,7 +206,10 @@ const factory = createLayer(id, () => { createMultiplicativeModifier(() => ({ multiplier: Decimal.lt(energyEfficiency.value, 1) ? 1 - : Decimal.sub(2, Decimal.div(energyConsumption.value, Decimal.max(computedEnergy.value, 1))), + : Decimal.sub( + 2, + Decimal.div(energyConsumption.value, Decimal.max(computedEnergy.value, 1)) + ), description: "Brighter work rooms", enabled: () => upgrades[2][0].bought.value })), @@ -287,17 +290,29 @@ const factory = createLayer(id, () => { // ---------------------------------------------- Components - function generateComponentDescription(declaration: FactoryComponentDeclaration) { - let str = declaration.inputs === undefined ? "Produces " : "Turns "; if (declaration.inputs !== undefined) { - str += formatList(Object.entries(declaration.inputs) - .map(x => formatWhole(unref(x[1].amount)) + " " + RESOURCES[x[0] as ResourceNames].name)) + " into "; + str += + formatList( + Object.entries(declaration.inputs).map( + x => + formatWhole(unref(x[1].amount)) + + " " + + RESOURCES[x[0] as ResourceNames].name + ) + ) + " into "; } if (declaration.outputs !== undefined) { - str += formatList(Object.entries(declaration.outputs) - .map(x => formatWhole(unref(x[1].amount)) + " " + RESOURCES[x[0] as ResourceNames].name)) + " per tick."; + str += + formatList( + Object.entries(declaration.outputs).map( + x => + formatWhole(unref(x[1].amount)) + + " " + + RESOURCES[x[0] as ResourceNames].name + ) + ) + " per tick."; } return str; } @@ -569,7 +584,9 @@ const factory = createLayer(id, () => { key: "shift+8", name: "Circuit Board Manufacturer", type: "processor", - description: computed(() => generateComponentDescription(FACTORY_COMPONENTS.circuitBoard)), + description: computed(() => + generateComponentDescription(FACTORY_COMPONENTS.circuitBoard) + ), energyCost: 2, tick: 1, inputs: { @@ -691,7 +708,9 @@ const factory = createLayer(id, () => { key: "ctrl+5", name: "Shovel and Pail Maker", type: "processor", - description: computed(() => generateComponentDescription(FACTORY_COMPONENTS.bucketShovel)), + description: computed(() => + generateComponentDescription(FACTORY_COMPONENTS.bucketShovel) + ), energyCost: 20, tick: 1, inputs: { @@ -1548,7 +1567,11 @@ const factory = createLayer(id, () => { lastProdTimes: !isConveyor ? (reactive([]) as number[]) : undefined, lastFactoryProd: !isConveyor ? Date.now() - - 1000 * Decimal.div(data.ticksDone ?? 0, computedActualTickRate.value).toNumber() + 1000 * + Decimal.div( + (data as FactoryComponentProcessor).ticksDone ?? 0, + computedActualTickRate.value + ).toNumber() : undefined, average: !isConveyor ? computed(() => { @@ -1914,32 +1937,41 @@ const factory = createLayer(id, () => { compInternalHovered.value.type !== "conveyor" ? ( <> {showStockAmount( - compHovered.value.inputStock, + (compHovered.value as FactoryComponentProcessor).inputStock, FACTORY_COMPONENTS[compHovered.value.type].inputs, "Inputs:" )} {showStockAmount( - compHovered.value.outputStock, + (compHovered.value as FactoryComponentProcessor).outputStock, FACTORY_COMPONENTS[compHovered.value.type].outputs, "Outputs:", false )}
Efficency:{" "} - {compInternalHovered.value.average.value !== undefined ? ( + {(compInternalHovered.value as FactoryInternalProcessor).average.value !== + undefined ? ( 1 + (compInternalHovered.value as FactoryInternalProcessor) + .average.value! > 1 ? "purple" - : compInternalHovered.value.average.value >= 0.9 + : ( + compInternalHovered.value as FactoryInternalProcessor + ).average.value! >= 0.9 ? "green" - : compInternalHovered.value.average.value >= 0.5 + : ( + compInternalHovered.value as FactoryInternalProcessor + ).average.value! >= 0.5 ? "yellow" : "red" }} > - {formatWhole(compInternalHovered.value.average.value * 100)} + {formatWhole( + (compInternalHovered.value as FactoryInternalProcessor).average + .value! * 100 + )} ) : ( "--" From 8367ef20992c648ba93853f3ae89d79893418790 Mon Sep 17 00:00:00 2001 From: thepaperpilot Date: Fri, 23 Dec 2022 09:42:26 -0600 Subject: [PATCH 4/8] Fixed factory error when changing saves --- src/data/layers/factory.tsx | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/data/layers/factory.tsx b/src/data/layers/factory.tsx index f7f6b51..d234204 100644 --- a/src/data/layers/factory.tsx +++ b/src/data/layers/factory.tsx @@ -1239,6 +1239,9 @@ const factory = createLayer(id, () => { let loaded = false; globalBus.on("onLoad", async () => { + if (loaded) { + return; + } loaded = false; spriteContainer.destroy({ From eea9a6f0e8e579b8c0fe96f65e55b8025f906a39 Mon Sep 17 00:00:00 2001 From: thepaperpilot Date: Fri, 23 Dec 2022 09:42:45 -0600 Subject: [PATCH 5/8] Fix visibility not working on components --- src/data/layers/factory.tsx | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/data/layers/factory.tsx b/src/data/layers/factory.tsx index d234204..bd47fef 100644 --- a/src/data/layers/factory.tsx +++ b/src/data/layers/factory.tsx @@ -1841,6 +1841,9 @@ const factory = createLayer(id, () => { {Object.entries(FACTORY_COMPONENTS).map(value => { const key = value[0] as FactoryCompNames; const item = value[1]; + if (unref(item.visible) === false) { + return null; + } return (
Date: Fri, 23 Dec 2022 09:44:13 -0600 Subject: [PATCH 6/8] Fix factory buyables and upgrade grid being visible in day 18 --- src/data/layers/factory.tsx | 30 +++++++++++++++--------------- 1 file changed, 15 insertions(+), 15 deletions(-) diff --git a/src/data/layers/factory.tsx b/src/data/layers/factory.tsx index bd47fef..1d97c5e 100644 --- a/src/data/layers/factory.tsx +++ b/src/data/layers/factory.tsx @@ -1057,7 +1057,7 @@ const factory = createLayer(id, () => { showAmount: false }, style: "width: 200px", - visible: () => showIf(main.days[advancedDay - 1].opened.value) + visibility: () => showIf(main.days[advancedDay - 1].opened.value) })) as GenericBuyable; const oilFuel = createBuyable(() => ({ resource: oil.oil, @@ -1071,7 +1071,7 @@ const factory = createLayer(id, () => { showAmount: false }, style: "width: 200px", - visible: () => showIf(main.days[advancedDay - 1].opened.value) + visibility: () => showIf(main.days[advancedDay - 1].opened.value) })) as GenericBuyable; const carryToys = createBuyable(() => ({ resource: boxes.boxes, @@ -1087,7 +1087,7 @@ const factory = createLayer(id, () => { showAmount: false }, style: "width: 200px", - visible: () => showIf(main.days[advancedDay - 1].opened.value) + visibility: () => showIf(main.days[advancedDay - 1].opened.value) })) as GenericBuyable; const factoryBuyables = { expandFactory, oilFuel, carryToys }; const upgrades = [ @@ -1100,7 +1100,7 @@ const factory = createLayer(id, () => { description: "Double sawmill consumption and production and metal supplier efficiency" }, - visible: () => showIf(main.days[advancedDay - 1].opened.value) + visibility: () => showIf(main.days[advancedDay - 1].opened.value) })), createUpgrade(() => ({ resource: paper.paper, @@ -1109,7 +1109,7 @@ const factory = createLayer(id, () => { title: "News Ticker", description: "Paper boosts tick speed" }, - visible: () => showIf(main.days[advancedDay - 1].opened.value) + visibility: () => showIf(main.days[advancedDay - 1].opened.value) })), createUpgrade(() => ({ resource: toys.trucks, @@ -1118,7 +1118,7 @@ const factory = createLayer(id, () => { title: "Haul wood in trucks", description: "Trucks multiply wood gain" }, - visible: () => showIf(main.days[advancedDay - 1].opened.value) + visibility: () => showIf(main.days[advancedDay - 1].opened.value) })), createUpgrade(() => ({ resource: metal.metal, @@ -1127,7 +1127,7 @@ const factory = createLayer(id, () => { title: "Diamond-tipped drills", description: "Drill power ^1.2" }, - visible: () => showIf(main.days[advancedDay - 1].opened.value) + visibility: () => showIf(main.days[advancedDay - 1].opened.value) })) ], [ @@ -1138,7 +1138,7 @@ const factory = createLayer(id, () => { title: "Larger wood pieces", description: "Wooden block producers produce 3x as much" }, - visible: () => showIf(main.days[advancedDay - 1].opened.value) + visibility: () => showIf(main.days[advancedDay - 1].opened.value) })), createUpgrade(() => ({ resource: dyes.dyes.red.amount, @@ -1147,7 +1147,7 @@ const factory = createLayer(id, () => { title: "Colorful clothes", description: "Dye producers produce 4x as much" }, - visible: () => showIf(main.days[advancedDay - 1].opened.value) + visibility: () => showIf(main.days[advancedDay - 1].opened.value) })), createUpgrade(() => ({ resource: plastic.plastic, @@ -1156,7 +1156,7 @@ const factory = createLayer(id, () => { title: "Improved plastic producers", description: "Plastic producers produce 4x as much" }, - visible: () => showIf(main.days[advancedDay - 1].opened.value) + visibility: () => showIf(main.days[advancedDay - 1].opened.value) })), createUpgrade(() => ({ resource: oil.oil, @@ -1165,7 +1165,7 @@ const factory = createLayer(id, () => { title: "Capitalism", description: "Console production is tripled" }, - visible: () => showIf(main.days[advancedDay - 1].opened.value) + visibility: () => showIf(main.days[advancedDay - 1].opened.value) })) ], [ @@ -1176,7 +1176,7 @@ const factory = createLayer(id, () => { title: "Brighter work rooms", description: "Unused electricity makes ticks faster" }, - visible: () => showIf(main.days[advancedDay - 1].opened.value) + visibility: () => showIf(main.days[advancedDay - 1].opened.value) })), createUpgrade(() => ({ resource: dyes.dyes.blue.amount, @@ -1185,7 +1185,7 @@ const factory = createLayer(id, () => { title: "Colorful teddy bears", description: "Teddy bears produce 2x as much" }, - visible: () => showIf(main.days[advancedDay - 1].opened.value) + visibility: () => showIf(main.days[advancedDay - 1].opened.value) })), createUpgrade(() => ({ resource: dyes.dyes.black.amount, @@ -1194,7 +1194,7 @@ const factory = createLayer(id, () => { title: "New Colors", description: "Unlock white dye" }, - visible: () => showIf(main.days[advancedDay - 1].opened.value) + visibility: () => showIf(main.days[advancedDay - 1].opened.value) })), createUpgrade(() => ({ resource: boxes.boxes, @@ -1203,7 +1203,7 @@ const factory = createLayer(id, () => { title: "Carry ticks in boxes", description: "Tick speed x1.5" }, - visible: () => showIf(main.days[advancedDay - 1].opened.value) + visibility: () => showIf(main.days[advancedDay - 1].opened.value) })) ] ]; From 4b9b2f263a78c049160c638f40eb0c5c8374807a Mon Sep 17 00:00:00 2001 From: unsoftcapped3 <75136164+unsoftcapped3@users.noreply.github.com> Date: Fri, 23 Dec 2022 10:20:54 -0800 Subject: [PATCH 7/8] add message about holding L --- src/data/layers/letters.tsx | 1 + 1 file changed, 1 insertion(+) diff --git a/src/data/layers/letters.tsx b/src/data/layers/letters.tsx index 62b8e13..6f27eb6 100644 --- a/src/data/layers/letters.tsx +++ b/src/data/layers/letters.tsx @@ -339,6 +339,7 @@ const layer = createLayer(id, function (this: BaseLayer) { ) : null} {render(process)} + If your letters are stuck, try holding L {Decimal.lt(totalLetters.value, 8e9) ? (
The more letters you process, the more you'll improve at processing letters. From 1bc299e50c9f3b2fe4a7a97e929a2895a9c12ada Mon Sep 17 00:00:00 2001 From: unsoftcapped3 <75136164+unsoftcapped3@users.noreply.github.com> Date: Fri, 23 Dec 2022 12:00:40 -0800 Subject: [PATCH 8/8] fix foundation going above what it should be --- src/data/layers/workshop.tsx | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/data/layers/workshop.tsx b/src/data/layers/workshop.tsx index 831761c..b550e2e 100644 --- a/src/data/layers/workshop.tsx +++ b/src/data/layers/workshop.tsx @@ -123,6 +123,9 @@ const layer = createLayer(id, function (this: BaseLayer) { )), visibility: () => showIf(Decimal.lt(foundationProgress.value, computedMaxFoundation.value)), canClick: () => { + if (Decimal.gt(computedMaxFoundation.value, foundationProgress.value)){ + foundationProgress.value = Decimal.min(0, computedMaxFoundation.value) + } if (Decimal.lt(trees.logs.value, foundationConversion.nextAt.value)) { return false; }