+ {renderRow(dyes.black.display)}
+ {renderRow(dyes.black.buyable)}
+
{renderRow(dyes.red.display, dyes.yellow.display, dyes.blue.display)}
{renderRow(dyes.red.buyable, dyes.yellow.buyable, dyes.blue.buyable)}
diff --git a/src/data/layers/letters.tsx b/src/data/layers/letters.tsx
index 697cdc6..219a40a 100644
--- a/src/data/layers/letters.tsx
+++ b/src/data/layers/letters.tsx
@@ -24,6 +24,7 @@ import { createBuyable, GenericBuyable } from "features/buyable";
import metal from "./metal";
import plastic from "./plastic";
import paper from "./paper";
+import dyes from "./dyes";
import SqrtVue from "components/math/Sqrt.vue";
import { globalBus } from "game/events";
import { main } from "data/projEntry";
@@ -190,7 +191,12 @@ const layer = createLayer(id, function (this: BaseLayer) {
createMultiplicativeModifier(() => ({
multiplier: () => Decimal.div(paperBuyable.amount.value, 2).add(1),
description: "Printed Labels"
+ })),
+ createMultiplicativeModifier(() => ({
+ multiplier: () => dyes.boosts.black1.value,
+ description: "Black Dye Boost"
}))
+
]);
const computedLettersGain = computed(() => lettersGain.apply(1));
const processingCooldown = createSequentialModifier(() => [
diff --git a/src/data/layers/metal.tsx b/src/data/layers/metal.tsx
index ecd0f82..8f8bdf1 100644
--- a/src/data/layers/metal.tsx
+++ b/src/data/layers/metal.tsx
@@ -35,6 +35,7 @@ import oil from "./oil";
import paper from "./paper";
import plastic from "./plastic";
import workshop from "./workshop";
+import toys from "./toys";
const id = "metal";
const day = 7;
@@ -193,6 +194,11 @@ const layer = createLayer(id, function (this: BaseLayer) {
multiplier: () => Decimal.add(industrialCrucible.amount.value, 1).sqrt(),
description: "100,000 Letters Processed",
enabled: letters.milestones.industrialCrucibleMilestone.earned
+ })),
+ createMultiplicativeModifier(() => ({
+ multiplier: () => Decimal.add(toys.clothes.value, 1),
+ description: "Give elves clothes to wear",
+ enabled: toys.row1Upgrades[1].bought
}))
]);
const computedAutoSmeltMulti = computed(() => autoSmeltMulti.apply(1));
@@ -268,7 +274,12 @@ const layer = createLayer(id, function (this: BaseLayer) {
multiplier: () => Decimal.add(dyes.dyes.blue.amount.value, 1).sqrt(),
description: "1000 Letters Processed",
enabled: letters.milestones.miningMilestone.earned
- }))
+ })),
+ createMultiplicativeModifier(() => ({
+ multiplier: () => Decimal.add(toys.clothes.value, 1),
+ description: "Give elves clothes to wear",
+ enabled: toys.row1Upgrades[1].bought
+ })),
]);
const computedOreAmount = computed(() => oreAmount.apply(1));
const oreSpeed = createSequentialModifier(() => [
diff --git a/src/data/layers/oil.tsx b/src/data/layers/oil.tsx
index a3a7f0c..ce19ca5 100644
--- a/src/data/layers/oil.tsx
+++ b/src/data/layers/oil.tsx
@@ -861,6 +861,11 @@ const layer = createLayer(id, function (this: BaseLayer) {
description: "Cocoa Level 3",
enabled: management.elfTraining.oilElfTraining.milestones[2].earned
})),
+ createMultiplicativeModifier(() => ({
+ multiplier: 4,
+ description: "Workshop 1200%",
+ enabled: workshop.milestones.extraExpansionMilestone6.earned
+ })),
createMultiplicativeModifier(() => ({
multiplier: () => coalEffectiveness.value,
description: "Effectiveness",
diff --git a/src/data/layers/toys.tsx b/src/data/layers/toys.tsx
index 0c5a202..e01bd13 100644
--- a/src/data/layers/toys.tsx
+++ b/src/data/layers/toys.tsx
@@ -160,7 +160,7 @@ const layer = createLayer(id, function (this: BaseLayer) {
- You have {formatWhole(woodenBlocks.value)} wooden blocks.
+ You have {formatWhole(trucks.value)} trucks.
@@ -182,14 +182,51 @@ const layer = createLayer(id, function (this: BaseLayer) {
},
})) as GenericBuyable;
const buyables = [ clothesBuyable, woodenBlocksBuyable, trucksBuyable ];
+ const trucksUpgrade1 = createUpgrade(() => ({
+ resource: noPersist(trucks),
+ cost: 10,
+ display: {
+ title: "Load logs onto trucks",
+ description: "Log gain is doubled."
+ }
+ }))
+ const clothesUpgrade1 = createUpgrade(() => ({
+ resource: noPersist(clothes),
+ cost: 30,
+ display: {
+ title: "Give elves clothes to wear",
+ description: "Multiply ore per mining operation and auto-smelt purity by the number of clothes you have."
+ }
+ }))
+
+ const woodenBlocksUpgrade1 = createUpgrade(() => ({
+ resource: noPersist(woodenBlocks),
+ cost: 15,
+ display: {
+ title: "Build wooden towers",
+ description: "You can now build 2 extra tall workshops!"
+ }
+ }))
+const row1Upgrades = [
+ trucksUpgrade1,
+ clothesUpgrade1,
+ woodenBlocksUpgrade1
+ ];
const milestone1 = createMilestone(() => ({
display: {
requirement: "10 toys",
- effectDisplay: "The number of complete workshops you have divides the cost to make toys."
+ effectDisplay: "The cost of making toys is divided by the number of complete workshops you have."
},
shouldEarn: () => Decimal.gte(toySum.value, 10)
}));
-const milestones = {milestone1}
+ const milestone2 = createMilestone(() => ({
+ display: {
+ requirement: "100 toys",
+ effectDisplay: "Unlock black dyes."
+ },
+ shouldEarn: () => Decimal.gte(toySum.value, 100)
+ }));
+const milestones = {milestone1, milestone2}
const { collapseMilestones, display: milestonesDisplay } =
createCollapsibleMilestones(milestones);
@@ -217,14 +254,22 @@ const { collapseMilestones, display: milestonesDisplay } =
if (Decimal.lt(main.day.value, day)) {
return;
}
-
+ if (Decimal.lt(clothes.value, clothesBuyable.amount.value)){
+ clothesBuyable.amount.value = clothes.value
+ }
+ if (Decimal.lt(woodenBlocks.value, woodenBlocksBuyable.amount.value)){
+ woodenBlocksBuyable.amount.value = woodenBlocks.value
+ }
+ if (Decimal.lt(trucks.value, trucksBuyable.amount.value)){
+ trucksBuyable.amount.value = trucks.value
+ }
});
const { total: totalToys, trackerDisplay } = setUpDailyProgressTracker({
resource: toySum,
- goal: 8e9,
+ goal: 200,
name,
day,
color: colorDark,
@@ -244,6 +289,7 @@ const { collapseMilestones, display: milestonesDisplay } =
toySum,
totalToys,
buyables,
+ row1Upgrades,
milestones,
generalTabCollapsed,
collapseMilestones,
@@ -273,6 +319,8 @@ const { collapseMilestones, display: milestonesDisplay } =
{renderRow(...buyables)}
+ {renderGrid(row1Upgrades)}
+
{milestonesDisplay()}
>
)),
diff --git a/src/data/layers/trees.tsx b/src/data/layers/trees.tsx
index 49193c9..2555ef9 100644
--- a/src/data/layers/trees.tsx
+++ b/src/data/layers/trees.tsx
@@ -37,6 +37,7 @@ import management from "./management";
import paper from "./paper";
import workshop from "./workshop";
import wrappingPaper from "./wrapping-paper";
+import toys from "./toys";
const id = "trees";
const day = 1;
@@ -528,6 +529,11 @@ const layer = createLayer(id, function (this: BaseLayer) {
description: "Christmas Wrapping Paper",
enabled: computed(() => Decimal.gt(wrappingPaper.boosts.christmas1.value, 1))
})),
+ createMultiplicativeModifier(() => ({
+ multiplier: 2,
+ description: "Load logs onto trucks",
+ enabled: toys.row1Upgrades[0].bought
+ })),
createExponentialModifier(() => ({
exponent: 1.2,
description: "100% Foundation Completed",
diff --git a/src/data/layers/workshop.tsx b/src/data/layers/workshop.tsx
index c217bd7..e36ea8f 100644
--- a/src/data/layers/workshop.tsx
+++ b/src/data/layers/workshop.tsx
@@ -32,6 +32,7 @@ import elves from "./elves";
import management from "./management";
import trees from "./trees";
import wrappingPaper from "./wrapping-paper";
+import toys from "./toys"
const id = "workshop";
const day = 2;
@@ -47,7 +48,7 @@ const layer = createLayer(id, function (this: BaseLayer) {
scaling: addHardcap(
addSoftcap(addSoftcap(createPolynomialScaling(250, 1.5), 5423, 1 / 1e10), 1e20, 3e8),
computed(() =>
- management.elfTraining.expandersElfTraining.milestones[2].earned.value ? 1000 : 100
+ toys.row1Upgrades[2].bought ? 1200 : management.elfTraining.expandersElfTraining.milestones[2].earned.value ? 1000 : 100
)
),
baseResource: trees.logs,
@@ -95,7 +96,7 @@ const layer = createLayer(id, function (this: BaseLayer) {
showIf(
Decimal.lt(
foundationProgress.value,
- management.elfTraining.expandersElfTraining.milestones[2].earned.value
+ toys.row1Upgrades[2].bought.value ? 1200 : management.elfTraining.expandersElfTraining.milestones[2].earned.value
? 1000
: 100
)
@@ -104,7 +105,7 @@ const layer = createLayer(id, function (this: BaseLayer) {
Decimal.gte(trees.logs.value, foundationConversion.nextAt.value) &&
Decimal.lt(
foundationProgress.value,
- management.elfTraining.expandersElfTraining.milestones[2].earned.value ? 1000 : 100
+ toys.row1Upgrades[2].bought.value ? 1200 : management.elfTraining.expandersElfTraining.milestones[2].earned.value ? 1000 : 100
),
onClick() {
if (!unref(this.canClick)) {
@@ -261,6 +262,19 @@ const layer = createLayer(id, function (this: BaseLayer) {
),
showPopups: shouldShowPopups
}));
+ const extraExpansionMilestone6 = createMilestone(() => ({
+ display: {
+ requirement: "1200% Foundation Completed",
+ effectDisplay: "Quadruple oil gain"
+ },
+ shouldEarn: () => Decimal.gte(foundationProgress.value, 1200),
+ visibility: () =>
+ showIf(
+ extraExpansionMilestone5.earned.value &&
+ toys.row1Upgrades[2].bought.value
+ ),
+ showPopups: shouldShowPopups
+ }));
const milestones = {
logGainMilestone1,
autoCutMilestone1,
@@ -274,7 +288,8 @@ const layer = createLayer(id, function (this: BaseLayer) {
extraExpansionMilestone2,
extraExpansionMilestone3,
extraExpansionMilestone4,
- extraExpansionMilestone5
+ extraExpansionMilestone5,
+ extraExpansionMilestone6
};
const { collapseMilestones, display: milestonesDisplay } =
createCollapsibleMilestones(milestones);
From bc13b05d8506ae29f1e6ec12dc4c454a4bf7ce22 Mon Sep 17 00:00:00 2001
From: thepaperpilot
Date: Fri, 16 Dec 2022 00:40:03 -0600
Subject: [PATCH 023/124] Fixed mastery.saplings
---
src/data/layers/trees.tsx | 151 ++++++++++++++++++++++++++++----------
1 file changed, 111 insertions(+), 40 deletions(-)
diff --git a/src/data/layers/trees.tsx b/src/data/layers/trees.tsx
index 83dec00..a127bc0 100644
--- a/src/data/layers/trees.tsx
+++ b/src/data/layers/trees.tsx
@@ -61,7 +61,12 @@ const layer = createLayer(id, function (this: BaseLayer) {
const totalTrees = createSequentialModifier(() => [
createAdditiveModifier(() => ({
- addend: () => Decimal.times((main.isMastery.value ? mastery.expandingForestBuyable : expandingForestBuyable).amount.value, 10),
+ addend: () =>
+ Decimal.times(
+ (main.isMastery.value ? mastery.expandingForestBuyable : expandingForestBuyable)
+ .amount.value,
+ 10
+ ),
description: "Expand Forest",
enabled: (main.isMastery.value ? mastery.researchUpgrade2 : researchUpgrade2).bought
})),
@@ -93,7 +98,9 @@ const layer = createLayer(id, function (this: BaseLayer) {
createAdditiveModifier(() => ({
addend: () => Decimal.pow(computedManualCuttingAmount.value, 0.99),
description: "Hope Level 1",
- enabled: () => management.elfTraining.expandersElfTraining.milestones[0].earned.value && !main.isMastery.value
+ enabled: () =>
+ management.elfTraining.expandersElfTraining.milestones[0].earned.value &&
+ !main.isMastery.value
}))
]) as WithRequired;
const trees = createResource(
@@ -299,7 +306,9 @@ const layer = createLayer(id, function (this: BaseLayer) {
createAdditiveModifier(() => ({
addend: computedAutoCuttingAmount,
description: "Smart Knives",
- enabled: main.isMastery.value ? mastery.manualCutUpgrade3.bought : manualCutUpgrade3.bought
+ enabled: main.isMastery.value
+ ? mastery.manualCutUpgrade3.bought
+ : manualCutUpgrade3.bought
}))
]);
const computedManualCuttingAmount = computed(() => manualCuttingAmount.apply(1));
@@ -307,7 +316,9 @@ const layer = createLayer(id, function (this: BaseLayer) {
createMultiplicativeModifier(() => ({
multiplier: 0.5,
description: "Sharper Fingers",
- enabled: main.isMastery.value ? mastery.manualCutUpgrade2.bought : manualCutUpgrade2.bought
+ enabled: main.isMastery.value
+ ? mastery.manualCutUpgrade2.bought
+ : manualCutUpgrade2.bought
})),
createMultiplicativeModifier(() => ({
multiplier: () => Decimal.pow(0.5, elves.totalElves.value),
@@ -356,13 +367,17 @@ const layer = createLayer(id, function (this: BaseLayer) {
createMultiplicativeModifier(() => ({
multiplier: () => Decimal.pow(1.1, main.day.value),
description: "Holly Level 4",
- enabled: () => management.elfTraining.cutterElfTraining.milestones[3].earned.value && !main.isMastery.value
+ enabled: () =>
+ management.elfTraining.cutterElfTraining.milestones[3].earned.value &&
+ !main.isMastery.value
})),
createAdditiveModifier(() => ({
addend: () =>
Decimal.sub(lastAutoPlantedAmount.value, lastAutoCuttingAmount.value).max(0),
description: "Ivy Level 5",
- enabled: () => management.elfTraining.planterElfTraining.milestones[4].earned.value && !main.isMastery.value
+ enabled: () =>
+ management.elfTraining.planterElfTraining.milestones[4].earned.value &&
+ !main.isMastery.value
}))
]) as WithRequired;
const computedAutoCuttingAmount = computed(() => autoCuttingAmount.apply(0));
@@ -371,12 +386,16 @@ const layer = createLayer(id, function (this: BaseLayer) {
createAdditiveModifier(() => ({
addend: 1,
description: "Leafy Fingers",
- enabled: main.isMastery.value ? mastery.manualPlantUpgrade1.bought : manualPlantUpgrade1.bought
+ enabled: main.isMastery.value
+ ? mastery.manualPlantUpgrade1.bought
+ : manualPlantUpgrade1.bought
})),
createAdditiveModifier(() => ({
addend: computedAutoPlantingAmount,
description: "Smart Spades",
- enabled: main.isMastery.value ? mastery.manualPlantUpgrade3.bought : manualPlantUpgrade3.bought
+ enabled: main.isMastery.value
+ ? mastery.manualPlantUpgrade3.bought
+ : manualPlantUpgrade3.bought
}))
]);
const computedManualPlantingAmount = computed(() => manualPlantingAmount.apply(1));
@@ -384,7 +403,9 @@ const layer = createLayer(id, function (this: BaseLayer) {
createMultiplicativeModifier(() => ({
multiplier: 0.5,
description: "Greener Fingers",
- enabled: main.isMastery.value ? mastery.manualPlantUpgrade2.bought : manualPlantUpgrade2.bought
+ enabled: main.isMastery.value
+ ? mastery.manualPlantUpgrade2.bought
+ : manualPlantUpgrade2.bought
})),
createMultiplicativeModifier(() => ({
multiplier: () => Decimal.pow(0.5, elves.totalElves.value),
@@ -398,10 +419,18 @@ const layer = createLayer(id, function (this: BaseLayer) {
createAdditiveModifier(() => ({
addend: 1,
description: "Automated Spade",
- enabled: main.isMastery.value ? mastery.autoPlantUpgrade1.bought : autoPlantUpgrade1.bought
+ enabled: main.isMastery.value
+ ? mastery.autoPlantUpgrade1.bought
+ : autoPlantUpgrade1.bought
})),
createAdditiveModifier(() => ({
- addend: () => Decimal.div(main.isMastery.value ? mastery.autoPlantingBuyable1.amount.value : autoPlantingBuyable1.amount.value, 2),
+ addend: () =>
+ Decimal.div(
+ main.isMastery.value
+ ? mastery.autoPlantingBuyable1.amount.value
+ : autoPlantingBuyable1.amount.value,
+ 2
+ ),
description: "Generic Planters",
enabled: researchUpgrade2.bought
})),
@@ -433,23 +462,31 @@ const layer = createLayer(id, function (this: BaseLayer) {
createMultiplicativeModifier(() => ({
multiplier: 2,
description: "Ivy Level 1",
- enabled: () => management.elfTraining.planterElfTraining.milestones[0].earned.value && !main.isMastery.value
+ enabled: () =>
+ management.elfTraining.planterElfTraining.milestones[0].earned.value &&
+ !main.isMastery.value
})),
createMultiplicativeModifier(() => ({
multiplier: () => Decimal.pow(trees.value, 0.2).max(1).log10().pow_base(2),
description: "Ivy Level 3",
- enabled: () => management.elfTraining.planterElfTraining.milestones[2].earned.value && !main.isMastery.value
+ enabled: () =>
+ management.elfTraining.planterElfTraining.milestones[2].earned.value &&
+ !main.isMastery.value
})),
createMultiplicativeModifier(() => ({
multiplier: 2,
description: "Mary Level 4",
- enabled: () => management.elfTraining.heatedPlanterElfTraining.milestones[3].earned.value && !main.isMastery.value
+ enabled: () =>
+ management.elfTraining.heatedPlanterElfTraining.milestones[3].earned.value &&
+ !main.isMastery.value
})),
createAdditiveModifier(() => ({
addend: () =>
Decimal.sub(lastAutoCuttingAmount.value, lastAutoPlantedAmount.value).max(0),
description: "Ivy Level 5",
- enabled: () => management.elfTraining.planterElfTraining.milestones[4].earned.value && !main.isMastery.value
+ enabled: () =>
+ management.elfTraining.planterElfTraining.milestones[4].earned.value &&
+ !main.isMastery.value
}))
]) as WithRequired;
const computedAutoPlantingAmount = computed(() => autoPlantingAmount.apply(0));
@@ -458,12 +495,16 @@ const layer = createLayer(id, function (this: BaseLayer) {
createMultiplicativeModifier(() => ({
multiplier: 1.25,
description: "Research I",
- enabled: main.isMastery.value ? mastery.researchUpgrade1.bought : researchUpgrade1.bought
+ enabled: main.isMastery.value
+ ? mastery.researchUpgrade1.bought
+ : researchUpgrade1.bought
})),
createMultiplicativeModifier(() => ({
multiplier: 1.25,
description: "Research II",
- enabled: main.isMastery.value ? mastery.researchUpgrade2.bought : researchUpgrade2.bought
+ enabled: main.isMastery.value
+ ? mastery.researchUpgrade2.bought
+ : researchUpgrade2.bought
})),
createMultiplicativeModifier(() => ({
multiplier: () =>
@@ -518,15 +559,21 @@ const layer = createLayer(id, function (this: BaseLayer) {
createMultiplicativeModifier(() => ({
multiplier: computed(() => Decimal.add(computedAutoCuttingAmount.value, 1).root(9)),
description: "Holly Level 1",
- enabled () {
- return management.elfTraining.cutterElfTraining.milestones[0].earned.value && !main.isMastery.value;
+ enabled() {
+ return (
+ management.elfTraining.cutterElfTraining.milestones[0].earned.value &&
+ !main.isMastery.value
+ );
}
})),
createMultiplicativeModifier(() => ({
multiplier: () => Decimal.sqrt(management.totalElfLevels.value),
description: "Noel Level 1",
- enabled () {
- return management.elfTraining.fertilizerElfTraining.milestones[0].earned.value && !main.isMastery.value;
+ enabled() {
+ return (
+ management.elfTraining.fertilizerElfTraining.milestones[0].earned.value &&
+ !main.isMastery.value
+ );
}
})),
createMultiplicativeModifier(() => ({
@@ -574,7 +621,7 @@ const layer = createLayer(id, function (this: BaseLayer) {
minHeight: "80px"
},
canClick: () =>
- Decimal.gte((main.isMastery.value ? mastery.trees.value : trees.value), 1) &&
+ Decimal.gte(main.isMastery.value ? mastery.trees.value : trees.value, 1) &&
Decimal.gte(manualCutProgress.value, computedManualCuttingCooldown.value),
onClick() {
if (Decimal.lt(manualCutProgress.value, computedManualCuttingCooldown.value)) {
@@ -593,8 +640,14 @@ const layer = createLayer(id, function (this: BaseLayer) {
)
);
if (main.isMastery.value) {
- mastery.logs.value = Decimal.add(mastery.logs.value, Decimal.times(logGain.apply(1), amount));
- mastery.saplings.value = Decimal.add(Decimal.mul(mastery.saplings.value, 2), amount);
+ mastery.logs.value = Decimal.add(
+ mastery.logs.value,
+ Decimal.times(logGain.apply(1), amount)
+ );
+ mastery.saplings.value = Decimal.add(
+ Decimal.mul(mastery.saplings.value, 2),
+ amount
+ );
} else {
logs.value = Decimal.add(logs.value, Decimal.times(logGain.apply(1), amount));
saplings.value = Decimal.add(saplings.value, amount);
@@ -662,34 +715,44 @@ const layer = createLayer(id, function (this: BaseLayer) {
title: "Logs per Tree",
modifier: logGain,
base: 1,
- visible: main.isMastery.value ? mastery.researchUpgrade1.bought : researchUpgrade1.bought
+ visible: main.isMastery.value
+ ? mastery.researchUpgrade1.bought
+ : researchUpgrade1.bought
},
{
title: "Manual Cutting Amount",
modifier: manualCuttingAmount,
base: 1,
- visible: main.isMastery.value ? mastery.manualCutUpgrade1.bought : manualCutUpgrade1.bought,
+ visible: main.isMastery.value
+ ? mastery.manualCutUpgrade1.bought
+ : manualCutUpgrade1.bought,
unit: "/click"
},
{
title: "Manual Cutting Cooldown",
modifier: manualCuttingCooldown,
base: 1,
- visible: main.isMastery.value ? mastery.manualCutUpgrade1.bought : manualCutUpgrade1.bought,
+ visible: main.isMastery.value
+ ? mastery.manualCutUpgrade1.bought
+ : manualCutUpgrade1.bought,
unit: "s"
},
{
title: "Manual Planting Amount",
modifier: manualPlantingAmount,
base: 1,
- visible: main.isMastery.value ? mastery.manualPlantUpgrade1.bought : manualPlantUpgrade1.bought,
+ visible: main.isMastery.value
+ ? mastery.manualPlantUpgrade1.bought
+ : manualPlantUpgrade1.bought,
unit: "/click"
},
{
title: "Manual Planting Cooldown",
modifier: manualPlantingCooldown,
base: 1,
- visible: main.isMastery.value ? mastery.manualPlantUpgrade1.bought : manualPlantUpgrade1.bought,
+ visible: main.isMastery.value
+ ? mastery.manualPlantUpgrade1.bought
+ : manualPlantUpgrade1.bought,
unit: "s"
},
{
@@ -710,7 +773,9 @@ const layer = createLayer(id, function (this: BaseLayer) {
title: `Forest Size`,
modifier: totalTrees,
base: 10,
- visible: main.isMastery.value ? mastery.researchUpgrade2.bought: researchUpgrade2.bought,
+ visible: main.isMastery.value
+ ? mastery.researchUpgrade2.bought
+ : researchUpgrade2.bought
}
]);
const showModifiersModal = ref(false);
@@ -759,7 +824,7 @@ const layer = createLayer(id, function (this: BaseLayer) {
lastAutoCuttingAmount.value = Decimal.isNaN(cuttingAmount) ? 0 : cuttingAmount;
const amountCut = Decimal.min(
- (main.isMastery ? mastery.trees.value : trees.value),
+ main.isMastery ? mastery.trees.value : trees.value,
Decimal.times(computedAutoCuttingAmount.value, diff)
);
const logsGained = Decimal.mul(logGain.apply(1), amountCut);
@@ -823,7 +888,8 @@ const layer = createLayer(id, function (this: BaseLayer) {
// This would be a lazy proxy if the typings worked properly, REEE
// Doesn't matter too much, nothing needs lazy inittialization
const mastery = (() => {
- const logs = createResource(0, "logs")
+ const logs = createResource(0, "logs");
+ const saplings = createResource(0, "saplings");
const manualCutUpgrade1 = createUpgrade(() => ({
resource: noPersist(logs),
cost: 10,
@@ -871,7 +937,7 @@ const layer = createLayer(id, function (this: BaseLayer) {
autoPlantUpgrade1,
researchUpgrade1
];
-
+
const manualCutUpgrade2 = createUpgrade(() => ({
resource: noPersist(logs),
cost: 50,
@@ -926,7 +992,7 @@ const layer = createLayer(id, function (this: BaseLayer) {
manualPlantUpgrade3,
researchUpgrade2
];
-
+
const autoCuttingBuyable1 = createBuyable(() => ({
resource: noPersist(logs),
cost() {
@@ -962,7 +1028,7 @@ const layer = createLayer(id, function (this: BaseLayer) {
if (Decimal.gte(v, 2e6)) v = Decimal.pow(v, 2).div(2e6);
if (Decimal.gte(v, 2e30)) v = Decimal.pow(v, 10).div(Decimal.pow(2e30, 9));
v = Decimal.pow(0.95, paper.books.plantersBook.totalAmount.value).times(v);
- let cost = Decimal.times(100, v).add(200);
+ const cost = Decimal.times(100, v).add(200);
/*if (management.elfTraining.planterElfTraining.milestones[3].earned.value) {
cost = Decimal.div(cost, 10);
}*/
@@ -1034,8 +1100,8 @@ const layer = createLayer(id, function (this: BaseLayer) {
row1Buyables,
row1Upgrades,
row2Upgrades
- }
- })();
+ };
+ })();
//mastery.manualCutUpgrade1
return {
@@ -1096,14 +1162,19 @@ const layer = createLayer(id, function (this: BaseLayer) {
{renderRow(cutTree, plantTree)}
Tip: You can hold down on actions to perform them automatically
- {renderGrid(...main.isMastery.value ? [mastery.row1Upgrades, mastery.row2Upgrades] : [row1Upgrades, row2Upgrades])}
+ {renderGrid(
+ ...(main.isMastery.value
+ ? [mastery.row1Upgrades, mastery.row2Upgrades]
+ : [row1Upgrades, row2Upgrades])
+ )}
- {renderRow(...main.isMastery.value ? mastery.row1Buyables : row1Buyables)}
+ {renderRow(...(main.isMastery.value ? mastery.row1Buyables : row1Buyables))}
>
)),
minimizedDisplay: jsx(() => (
- {name} - {format(main.isMastery.value ? mastery.logs.value : logs.value)} {logs.displayName}
+ {name} - {format(main.isMastery.value ? mastery.logs.value : logs.value)}{" "}
+ {logs.displayName}
)),
mastered
From 6725fc850fd48ca38bef3549747aee93f2d6801b Mon Sep 17 00:00:00 2001
From: thepaperpilot
Date: Fri, 16 Dec 2022 00:42:04 -0600
Subject: [PATCH 024/124] Added mastered effect to calendar days
---
src/data/Day.vue | 73 ++++++++++++++++++++++++++++++++++++++----
src/data/projEntry.tsx | 7 ++--
2 files changed, 71 insertions(+), 9 deletions(-)
diff --git a/src/data/Day.vue b/src/data/Day.vue
index cb806d0..79e5410 100644
--- a/src/data/Day.vue
+++ b/src/data/Day.vue
@@ -1,13 +1,21 @@
-
-
+
+
Dec
{{ day }}
Dec
{{ day }}
-
+
?
@@ -15,14 +23,18 @@
Dec
{{ day }}
lock
- {{ main.timeUntilNewDay.value < 0 ? "NYI, sorry" : formatTime(main.timeUntilNewDay.value, 0) }}
+ {{
+ main.timeUntilNewDay.value < 0
+ ? "NYI, sorry"
+ : formatTime(main.timeUntilNewDay.value, 0)
+ }}
@@ -47,6 +59,7 @@ const props = defineProps<{
opened: Ref
;
recentlyUpdated: Ref;
shouldNotify: ProcessedComputable;
+ mastered: Ref;
}>();
const emit = defineEmits<{
@@ -78,6 +91,30 @@ function tryUnlock() {
background-color: var(--raised-background);
aspect-ratio: 1;
margin: 5%;
+ box-shadow: rgb(0 0 0 / 13%) 0px 3px 0px inset, rgb(0 0 0 / 13%) 3px 0px 0px inset,
+ rgb(0 0 0 / 13%) 0px 0px 3px inset, rgb(0 0 0 / 13%) 0px 0px 0px 3px inset;
+}
+
+.mastered.day {
+ background: linear-gradient(
+ 225deg,
+ rgb(255, 76, 76) 10.8%,
+ rgb(255, 255, 255) 11.1%,
+ rgb(255, 255, 255) 21.9%,
+ rgb(65, 255, 95) 22.2%,
+ rgb(65, 255, 95) 33%,
+ rgb(255, 255, 255) 33.3%,
+ rgb(255, 255, 255) 44.1%,
+ rgb(255, 76, 76) 44.4%,
+ rgb(255, 76, 76) 55.2%,
+ rgb(255, 255, 255) 55.5%,
+ rgb(255, 255, 255) 66.3%,
+ rgb(65, 255, 95) 66.6%,
+ rgb(65, 255, 95) 77.4%,
+ rgb(255, 255, 255) 77.7%,
+ rgb(255, 255, 255) 88.5%,
+ rgb(255, 76, 76) 88.8%
+ );
}
.door-enter-from::before,
@@ -132,7 +169,8 @@ function tryUnlock() {
clip-path: polygon(100% 0, 50% 0, 50% 100%, 100% 100%);
}
-.tooltip-container, .doors {
+.tooltip-container,
+.doors {
position: absolute;
width: 100%;
height: 100%;
@@ -164,6 +202,29 @@ function tryUnlock() {
right: 0;
}
+.mastered .doors::before,
+.mastered .doors::after {
+ background: linear-gradient(
+ 225deg,
+ rgb(255, 76, 76) 10.8%,
+ rgb(255, 255, 255) 11.1%,
+ rgb(255, 255, 255) 21.9%,
+ rgb(65, 255, 95) 22.2%,
+ rgb(65, 255, 95) 33%,
+ rgb(255, 255, 255) 33.3%,
+ rgb(255, 255, 255) 44.1%,
+ rgb(255, 76, 76) 44.4%,
+ rgb(255, 76, 76) 55.2%,
+ rgb(255, 255, 255) 55.5%,
+ rgb(255, 255, 255) 66.3%,
+ rgb(65, 255, 95) 66.6%,
+ rgb(65, 255, 95) 77.4%,
+ rgb(255, 255, 255) 77.7%,
+ rgb(255, 255, 255) 88.5%,
+ rgb(255, 76, 76) 88.8%
+ );
+}
+
.date {
position: absolute;
top: 50%;
diff --git a/src/data/projEntry.tsx b/src/data/projEntry.tsx
index bec7b5d..00b2d3e 100644
--- a/src/data/projEntry.tsx
+++ b/src/data/projEntry.tsx
@@ -73,7 +73,7 @@ const masterableLayers = [
oil,
plastic,
dyes
-]
+];
export const main = createLayer("main", function (this: BaseLayer) {
const day = persistent(1);
@@ -89,7 +89,7 @@ export const main = createLayer("main", function (this: BaseLayer) {
const isMastery = persistent(false);
const toggleMastery = () => {
isMastery.value = !isMastery.value;
- }
+ };
function createDay(
optionsFunc: () => {
@@ -127,7 +127,7 @@ export const main = createLayer("main", function (this: BaseLayer) {
shouldNotify,
story,
completedStory,
- recentlyUpdated,
+ recentlyUpdated
} = this;
return {
@@ -137,6 +137,7 @@ export const main = createLayer("main", function (this: BaseLayer) {
opened,
recentlyUpdated,
shouldNotify,
+ mastered: (layers[layer ?? ""] as any)?.mastered ?? ref(false),
onOpenLore() {
const completed = main.day.value > day;
loreScene.value = completed ? day - 1 : -1;
From 93038164e670b4c50c5e4bb1a7af3f88559217ed Mon Sep 17 00:00:00 2001
From: thepaperpilot
Date: Fri, 16 Dec 2022 01:05:38 -0600
Subject: [PATCH 025/124] Add mastered effect to ribbon days
---
src/data/Day.vue | 45 +++++++++++++++++++++++++++++++++++++++++----
1 file changed, 41 insertions(+), 4 deletions(-)
diff --git a/src/data/Day.vue b/src/data/Day.vue
index 79e5410..09ff09a 100644
--- a/src/data/Day.vue
+++ b/src/data/Day.vue
@@ -1,9 +1,10 @@
+
@@ -95,7 +96,7 @@ function tryUnlock() {
rgb(0 0 0 / 13%) 0px 0px 3px inset, rgb(0 0 0 / 13%) 0px 0px 0px 3px inset;
}
-.mastered.day {
+.mastered.day.wallpaper {
background: linear-gradient(
225deg,
rgb(255, 76, 76) 10.8%,
@@ -202,8 +203,8 @@ function tryUnlock() {
right: 0;
}
-.mastered .doors::before,
-.mastered .doors::after {
+.mastered.wallpaper .doors::before,
+.mastered.wallpaper .doors::after {
background: linear-gradient(
225deg,
rgb(255, 76, 76) 10.8%,
@@ -225,6 +226,42 @@ function tryUnlock() {
);
}
+.mastered .ribbon {
+ position: absolute;
+ top: -2px;
+ left: 0px;
+ width: calc(100% + 0px);
+ height: calc(100% + 4px);
+ overflow: hidden;
+ pointer-events: none;
+ user-select: none;
+ z-index: 11;
+}
+
+.mastered .ribbon::after {
+ content: "🎀";
+ position: absolute;
+ top: -5px;
+ left: -5px;
+ font-size: xx-large;
+ transform: rotateZ(-45deg);
+ z-index: 1;
+}
+
+.mastered .ribbon::before {
+ content: "";
+ width: calc(100% - 24px);
+ height: 100%;
+ border: solid darkred 8px;
+ transform: rotateZ(45deg);
+ position: absolute;
+ top: 0;
+ left: 0;
+ border-top: none;
+ border-bottom: none;
+ z-index: 1;
+}
+
.date {
position: absolute;
top: 50%;
From 5235dc924e032fd9011a69fd8e2820a576fbadae Mon Sep 17 00:00:00 2001
From: thepaperpilot
Date: Fri, 16 Dec 2022 01:08:43 -0600
Subject: [PATCH 026/124] Add wrapping paper and ribbons to scene
---
src/data/Scene.vue | 4 ++++
src/data/projEntry.tsx | 3 ++-
2 files changed, 6 insertions(+), 1 deletion(-)
diff --git a/src/data/Scene.vue b/src/data/Scene.vue
index 4cbed77..1e090a1 100644
--- a/src/data/Scene.vue
+++ b/src/data/Scene.vue
@@ -56,6 +56,8 @@
+
+
@@ -75,6 +77,8 @@ import dyes from "./symbols/dyes.png";
import management from "./symbols/elfManagement.png";
import advManagement from "./symbols/workshopMansion.png";
import letters from "./symbols/letterbox.png";
+import wrappingPaper from "./symbols/wrappingPaper.png";
+import ribbons from "./symbols/ribbons.png";
defineProps<{
day: number;
diff --git a/src/data/projEntry.tsx b/src/data/projEntry.tsx
index 00b2d3e..116e20d 100644
--- a/src/data/projEntry.tsx
+++ b/src/data/projEntry.tsx
@@ -34,6 +34,7 @@ import workshopSymbol from "./symbols/sws.png";
import treeSymbol from "./symbols/tree.png";
import advManagementSymbol from "./symbols/workshopMansion.png";
import wrappingPaperSymbol from "./symbols/wrappingPaper.png";
+import ribbonsSymbol from "./symbols/ribbons.png";
import coal from "./layers/coal";
import elves from "./layers/elves";
import trees from "./layers/trees";
@@ -325,7 +326,7 @@ export const main = createLayer("main", function (this: BaseLayer) {
day: 16,
shouldNotify: false,
layer: null, // "ribbons"
- symbol: "",
+ symbol: ribbonsSymbol,
story: "",
completedStory: ""
})),
From e314f234eb5a4a34f9a7c36ec8ceb64bff833cda Mon Sep 17 00:00:00 2001
From: Seth Posner
Date: Fri, 16 Dec 2022 15:24:24 -0800
Subject: [PATCH 027/124] Change mastery system to swap out persistent refs
---
src/data/layers/coal.tsx | 674 ++++++-----------------------
src/data/layers/trees.tsx | 475 +++++---------------
src/data/layers/workshop.tsx | 335 +++-----------
src/data/projEntry.tsx | 38 +-
src/features/resources/resource.ts | 3 +-
5 files changed, 319 insertions(+), 1206 deletions(-)
diff --git a/src/data/layers/coal.tsx b/src/data/layers/coal.tsx
index 0f4043d..ad39c86 100644
--- a/src/data/layers/coal.tsx
+++ b/src/data/layers/coal.tsx
@@ -83,10 +83,10 @@ const layer = createLayer(id, function (this: BaseLayer) {
const ash = createResource(0, "ash");
const activeFires = persistent(0);
- const fireLogs = computed(() => Decimal.times(main.isMastery.value ? mastery.activeFires.value : activeFires.value, 1000));
- const fireCoal = computed(() => Decimal.times(main.isMastery.value ? mastery.activeFires.value : activeFires.value, 0.1));
+ const fireLogs = computed(() => Decimal.times(activeFires.value, 1000));
+ const fireCoal = computed(() => Decimal.times(activeFires.value, 0.1));
const fireAsh = computed(() => {
- let gain = Decimal.times(main.isMastery.value ? mastery.activeFires.value : activeFires.value, 50);
+ let gain = Decimal.times(activeFires.value, 50);
if (management.elfTraining.smallfireElfTraining.milestones[0].earned.value) {
gain = gain.times(5);
}
@@ -148,16 +148,16 @@ const layer = createLayer(id, function (this: BaseLayer) {
const fireResource = createResource(buildFire.amount, "small fires");
const activeBonfires = persistent(0);
- const bonfireLogs = computed(() => Decimal.times(main.isMastery.value ? mastery.activeBonfires.value : activeBonfires.value, 10000));
+ const bonfireLogs = computed(() => Decimal.times(activeBonfires.value, 10000));
const bonfireCoal = computed(() => {
- let gain = Decimal.times(main.isMastery.value ? mastery.activeBonfires.value : activeBonfires.value, 10);
+ let gain = Decimal.times(activeBonfires.value, 10);
if (management.elfTraining.bonfireElfTraining.milestones[0].earned.value) {
gain = gain.times(5);
}
return gain;
});
const bonfireAsh = computed(() => {
- let gain = Decimal.times(main.isMastery.value ? mastery.activeBonfires.value : activeBonfires.value, 1000);
+ let gain = Decimal.times(activeBonfires.value, 1000);
if (management.elfTraining.bonfireElfTraining.milestones[0].earned.value) {
gain = gain.times(5);
}
@@ -210,16 +210,16 @@ const layer = createLayer(id, function (this: BaseLayer) {
active: activeBonfires
});
const activeKilns = persistent(0);
- const kilnLogs = computed(() => Decimal.times(main.isMastery.value ? mastery.activeKilns.value : activeKilns.value, 1e6));
+ const kilnLogs = computed(() => Decimal.times(activeKilns.value, 1e6));
const kilnCoal = computed(() => {
- let gain = Decimal.times(main.isMastery.value ? mastery.activeKilns.value : activeKilns.value, 1e4);
+ let gain = Decimal.times(activeKilns.value, 1e4);
if (management.elfTraining.kilnElfTraining.milestones[0].earned.value) {
gain = gain.times(5);
}
return gain;
});
const kilnAsh = computed(() => {
- let gain = Decimal.times(main.isMastery.value ? mastery.activeKilns.value : activeKilns.value, 1e4);
+ let gain = Decimal.times(activeKilns.value, 1e4);
if (management.elfTraining.kilnElfTraining.milestones[0].earned.value) {
gain = gain.times(5);
}
@@ -278,7 +278,7 @@ const layer = createLayer(id, function (this: BaseLayer) {
const activeDrills = persistent(0);
const drillCoal = computed(() =>
Decimal.times(
- Decimal.pow(main.isMastery.value ? mastery.activeDrills.value : activeDrills.value, oil.row2Upgrades[1].bought.value ? 2 : 1),
+ Decimal.pow(activeDrills.value, oil.row2Upgrades[1].bought.value ? 2 : 1),
5e7
)
.times(metal.efficientDrill.bought.value ? 2 : 1)
@@ -603,17 +603,17 @@ const layer = createLayer(id, function (this: BaseLayer) {
const heatedCutterEffect = createSequentialModifier(() => [
createAdditiveModifier(() => ({
addend() {
- return Decimal.times(main.isMastery.value ? mastery.heatedCutters.amount.value : heatedCutters.amount.value, 0.25);
+ return Decimal.times(heatedCutters.amount.value, 0.25);
},
description: "Heated Cutters",
enabled() {
- return Decimal.gt(main.isMastery.value ? mastery.heatedCutters.amount.value : heatedCutters.amount.value, 0);
+ return Decimal.gt(heatedCutters.amount.value, 0);
}
})),
createMultiplicativeModifier(() => ({
multiplier: 2,
description: "Dedicated Cutter Heaters",
- enabled: () => main.isMastery.value ? mastery.dedicatedCutters.bought.value : dedicatedCutters.bought.value
+ enabled: () => dedicatedCutters.bought.value
}))
]);
const computedHeatedCutterEffect = computed(() => heatedCutterEffect.apply(1));
@@ -621,17 +621,17 @@ const layer = createLayer(id, function (this: BaseLayer) {
const heatedPlanterEffect = createSequentialModifier(() => [
createAdditiveModifier(() => ({
addend() {
- return Decimal.times(main.isMastery.value ? mastery.heatedPlanters.amount.value : heatedPlanters.amount.value, 0.25);
+ return Decimal.times(heatedPlanters.amount.value, 0.25);
},
description: "Heated Planters",
enabled() {
- return Decimal.gt(main.isMastery.value ? mastery.heatedPlanters.amount.value : heatedPlanters.amount.value, 0);
+ return Decimal.gt(heatedPlanters.amount.value, 0);
}
})),
createMultiplicativeModifier(() => ({
multiplier: 2,
description: "Dedicated Planter Heaters",
- enabled: () => main.isMastery.value ? mastery.dedicatedPlanters.bought.value : dedicatedPlanters.bought.value
+ enabled: () => dedicatedPlanters.bought.value
}))
]);
const computedHeatedPlanterEffect = computed(() => heatedPlanterEffect.apply(1));
@@ -639,17 +639,17 @@ const layer = createLayer(id, function (this: BaseLayer) {
const fertilizerEffect = createSequentialModifier(() => [
createAdditiveModifier(() => ({
addend() {
- return Decimal.times(main.isMastery.value ? mastery.moreFertilizer.amount.value : moreFertilizer.amount.value, 0.25);
+ return Decimal.times(moreFertilizer.amount.value, 0.25);
},
description: "Fertilized Soil",
enabled() {
- return Decimal.gt(main.isMastery.value ? mastery.moreFertilizer.amount.value : moreFertilizer.amount.value, 0);
+ return Decimal.gt(moreFertilizer.amount.value, 0);
}
})),
createMultiplicativeModifier(() => ({
multiplier: 2,
description: "Mulched Soil",
- enabled: () => main.isMastery.value ? mastery.betterFertilizer.bought.value : betterFertilizer.bought.value
+ enabled: () => betterFertilizer.bought.value
}))
]);
const computedFertilizerEffect = computed(() => fertilizerEffect.apply(1));
@@ -661,7 +661,7 @@ const layer = createLayer(id, function (this: BaseLayer) {
},
description: "Small Fires",
enabled() {
- return Decimal.gt(main.isMastery.value ? mastery.activeFires.value : activeFires.value, 0);
+ return Decimal.gt(activeFires.value, 0);
}
})),
createAdditiveModifier(() => ({
@@ -670,7 +670,7 @@ const layer = createLayer(id, function (this: BaseLayer) {
},
description: "Bonfires",
enabled() {
- return Decimal.gt(main.isMastery.value ? mastery.activeBonfires.value : activeBonfires.value, 0);
+ return Decimal.gt(activeBonfires.value, 0);
}
})),
createAdditiveModifier(() => ({
@@ -679,7 +679,7 @@ const layer = createLayer(id, function (this: BaseLayer) {
},
description: "Charcoal Kilns",
enabled() {
- return Decimal.gt(main.isMastery.value ? mastery.activeKilns.value : activeKilns.value, 0);
+ return Decimal.gt(activeKilns.value, 0);
}
})),
createAdditiveModifier(() => ({
@@ -688,7 +688,7 @@ const layer = createLayer(id, function (this: BaseLayer) {
},
description: "Coal Drills",
enabled() {
- return Decimal.gt(main.isMastery.value ? mastery.activeDrills.value : activeDrills.value, 0);
+ return Decimal.gt(activeDrills.value, 0);
}
})),
createMultiplicativeModifier(() => ({
@@ -703,7 +703,7 @@ const layer = createLayer(id, function (this: BaseLayer) {
})),
createMultiplicativeModifier(() => ({
multiplier: () => {
- let v = main.isMastery.value ? mastery.buildFire.amount.value : buildFire.amount.value;
+ let v = buildFire.amount.value;
if (management.elfTraining.smallfireElfTraining.milestones[0].earned.value) {
v = Decimal.div(buildBonfire.amount.value, 10).add(v);
}
@@ -717,13 +717,13 @@ const layer = createLayer(id, function (this: BaseLayer) {
enabled: elves.elves.smallFireElf.bought
})),
createMultiplicativeModifier(() => ({
- multiplier: () => Decimal.div(main.isMastery.value ? mastery.buildBonfire.amount.value : buildBonfire.amount.value, 1000).add(1),
+ multiplier: () => Decimal.div(buildBonfire.amount.value, 1000).add(1),
description: "Bonfires Synergy",
enabled: elves.elves.bonfireElf.bought
})),
createMultiplicativeModifier(() => ({
multiplier: () =>
- Decimal.div(main.isMastery.value ? mastery.buildKiln.amount.value : buildKiln.amount.value, 100).times(dyes.boosts.green2.value).add(1),
+ Decimal.div(buildKiln.amount.value, 100).times(dyes.boosts.green2.value).add(1),
description: "Kiln Synergy",
enabled: elves.elves.kilnElf.bought
})),
@@ -795,7 +795,7 @@ const layer = createLayer(id, function (this: BaseLayer) {
},
description: "Small Fires",
enabled() {
- return Decimal.gt(main.isMastery.value ? mastery.activeFires.value : activeFires.value, 0);
+ return Decimal.gt(activeFires.value, 0);
}
})),
createAdditiveModifier(() => ({
@@ -804,7 +804,7 @@ const layer = createLayer(id, function (this: BaseLayer) {
},
description: "Bonfires",
enabled() {
- return Decimal.gt(main.isMastery.value ? mastery.activeBonfires.value : activeBonfires.value, 0);
+ return Decimal.gt(activeBonfires.value, 0);
}
})),
createAdditiveModifier(() => ({
@@ -828,7 +828,7 @@ const layer = createLayer(id, function (this: BaseLayer) {
})),
createMultiplicativeModifier(() => ({
multiplier: () => {
- let v = main.isMastery.value ? mastery.buildFire.amount.value : buildFire.amount.value;
+ let v = buildFire.amount.value;
if (management.elfTraining.smallfireElfTraining.milestones[0].earned.value) {
v = Decimal.div(buildBonfire.amount.value, 100).add(v);
}
@@ -838,13 +838,13 @@ const layer = createLayer(id, function (this: BaseLayer) {
enabled: elves.elves.smallFireElf.bought
})),
createMultiplicativeModifier(() => ({
- multiplier: () => Decimal.div(main.isMastery.value ? mastery.buildBonfire.amount.value : buildBonfire.amount.value, 1000).add(1),
+ multiplier: () => Decimal.div(buildBonfire.amount.value, 1000).add(1),
description: "Bonfires Synergy",
enabled: elves.elves.bonfireElf.bought
})),
createMultiplicativeModifier(() => ({
multiplier: () =>
- Decimal.div(main.isMastery.value ? mastery.buildKiln.amount.value : buildKiln.amount.value, 100).times(dyes.boosts.green2.value).add(1),
+ Decimal.div(buildKiln.amount.value, 100).times(dyes.boosts.green2.value).add(1),
description: "Kiln Synergy",
enabled: elves.elves.kilnElf.bought
})),
@@ -888,7 +888,7 @@ const layer = createLayer(id, function (this: BaseLayer) {
},
description: "Small Fires",
enabled() {
- return Decimal.gt(main.isMastery.value ? mastery.activeFires.value : activeFires.value, 0);
+ return Decimal.gt(activeFires.value, 0);
}
})),
createAdditiveModifier(() => ({
@@ -897,7 +897,7 @@ const layer = createLayer(id, function (this: BaseLayer) {
},
description: "Bonfires",
enabled() {
- return Decimal.gt(main.isMastery.value ? mastery.activeBonfires.value : activeBonfires.value, 0);
+ return Decimal.gt(activeBonfires.value, 0);
}
})),
createAdditiveModifier(() => ({
@@ -906,7 +906,7 @@ const layer = createLayer(id, function (this: BaseLayer) {
},
description: "Charcoal Kilns",
enabled() {
- return Decimal.gt(main.isMastery.value ? mastery.activeKilns.value : activeKilns.value, 0);
+ return Decimal.gt(activeKilns.value, 0);
}
}))
]);
@@ -919,9 +919,9 @@ const layer = createLayer(id, function (this: BaseLayer) {
base: 0,
visible() {
return (
- Decimal.gt(main.isMastery.value ? mastery.activeFires.value : activeFires.value, 0) ||
- Decimal.gt(main.isMastery.value ? mastery.activeBonfires.value : activeBonfires.value, 0) ||
- Decimal.gt(main.isMastery.value ? mastery.activeKilns.value : activeKilns.value, 0)
+ Decimal.gt(activeFires.value, 0) ||
+ Decimal.gt(activeBonfires.value, 0) ||
+ Decimal.gt(activeKilns.value, 0)
);
}
},
@@ -931,9 +931,9 @@ const layer = createLayer(id, function (this: BaseLayer) {
base: 0,
visible() {
return (
- Decimal.gt(main.isMastery.value ? mastery.activeFires.value : activeFires.value, 0) ||
- Decimal.gt(main.isMastery.value ? mastery.activeBonfires.value : activeBonfires.value, 0) ||
- Decimal.gt(main.isMastery.value ? mastery.activeKilns.value : activeKilns.value, 0)
+ Decimal.gt(activeFires.value, 0) ||
+ Decimal.gt(activeBonfires.value, 0) ||
+ Decimal.gt(activeKilns.value, 0)
);
}
},
@@ -943,9 +943,9 @@ const layer = createLayer(id, function (this: BaseLayer) {
base: 0,
visible() {
return (
- Decimal.gt(main.isMastery.value ? mastery.activeFires.value : activeFires.value, 0) ||
- Decimal.gt(main.isMastery.value ? mastery.activeBonfires.value : activeBonfires.value, 0) ||
- Decimal.gt(main.isMastery.value ? mastery.activeKilns.value : activeKilns.value, 0)
+ Decimal.gt(activeFires.value, 0) ||
+ Decimal.gt(activeBonfires.value, 0) ||
+ Decimal.gt(activeKilns.value, 0)
);
}
}
@@ -995,489 +995,63 @@ const layer = createLayer(id, function (this: BaseLayer) {
}
});
- const mastery = (() => {
- const activeFires = persistent(0);
- const activeBonfires = persistent(0);
- const activeKilns = persistent(0);
-
- const coal = createResource(0,"coal");
- const ash = createResource(0,"ash");
-
- const buildFire = createBuyable(() => ({
- resource: noPersist(trees.mastery.logs), // apparently necessary
- cost() {
- let v = Decimal.times(buildBonfire.amount.value, unref(buildBonfire.cost!)).plus(
- this.amount.value
- );
- if (Decimal.gte(v, 100)) v = Decimal.pow(v, 2).div(100);
- if (Decimal.gte(v, 10000)) v = Decimal.pow(v, 2).div(10000);
- v = Decimal.pow(0.95, paper.books.smallFireBook.totalAmount.value).times(v);
- return v.pow(1.5).times(1e4);
- },
- inverseCost(x: DecimalSource) {
- let v = Decimal.div(x, 1e4).root(1.5);
- v = v.div(Decimal.pow(0.95, paper.books.smallFireBook.totalAmount.value));
- if (Decimal.gte(v, 10000)) v = Decimal.mul(v, 10000).root(2);
- if (Decimal.gte(v, 100)) v = Decimal.mul(v, 100).root(2);
- v = v.sub(Decimal.times(buildBonfire.amount.value, unref(buildBonfire.cost!)));
- return Decimal.isNaN(v) ? Decimal.dZero : v.floor().max(0);
- },
- display: jsx(() => (
- <>
- Small Fire
-
- Burn 1000 logs for 0.1 coal and 50 ash
-
-
- Currently:
-
-{format(fireLogs.value)} logs/sec
-
+{format(fireCoal.value)} coal/sec
-
+{format(fireAsh.value)} ash/sec
-
-
- Cost: {formatWhole(unref(buildFire.cost!))} {buildFire.resource!.displayName}
- >
- )),
- onPurchase() {
- activeFires.value = Decimal.add(activeFires.value, 1);
- },
- style: {
- color: colorText,
- width: "160px"
- }
- })) as ElfBuyable & { resource: Resource };
- const {
- min: minFire,
- max: maxFire,
- add: addFire,
- remove: removeFire
- } = changeActiveBuyables({
- active: activeFires,
- buyable: buildFire
- });
- const fireResource = createResource(buildFire.amount, "small fires");
-
- const buildBonfire = createBuyable(() => ({
- resource: fireResource,
- cost() {
- return Decimal.pow(0.95, paper.books.bonfireBook.totalAmount.value).times(10);
- },
- inverseCost(x: DecimalSource) {
- return Decimal.div(
- x,
- Decimal.pow(0.95, paper.books.bonfireBook.totalAmount.value).times(10)
- ).floor();
- },
- display: jsx(() => (
- <>
- Bonfire
-
- Burn 10,000 logs for 10 coal and 1000 ash
-
-
- Currently:
-
-{format(bonfireLogs.value)} logs/sec
-
+{format(bonfireCoal.value)} coal/sec
-
+{format(bonfireAsh.value)} ash/sec
-
-
- Cost: {formatWhole(unref(buildBonfire.cost!))} {buildBonfire.resource!.displayName}
- >
- )),
- onPurchase(cost) {
- activeFires.value = Decimal.sub(activeFires.value, cost!).max(0);
- activeBonfires.value = Decimal.add(activeBonfires.value, 1);
- },
- style: {
- color: colorText,
- width: "160px"
- },
- visibility: () => showIf(unlockBonfire.bought.value)
- })) as ElfBuyable & { resource: Resource };
- const {
- min: minBonfire,
- max: maxBonfire,
- add: addBonfire,
- remove: removeBonfire
- } = changeActiveBuyables({
- buyable: buildBonfire,
- active: activeBonfires
- });
-
- const buildKiln = createBuyable(() => ({
- resource: noPersist(trees.mastery.logs),
- cost() {
- let v = this.amount.value;
- if (Decimal.gte(v, 100)) v = Decimal.pow(v, 2).div(100);
- if (Decimal.gte(v, 10000)) v = Decimal.pow(v, 2).div(10000);
- v = Decimal.pow(0.95, paper.books.kilnBook.totalAmount.value).times(v);
- return Decimal.pow(1.1, v).times(1e7);
- },
- inverseCost(x: DecimalSource) {
- let v = Decimal.div(x, 1e7).log(1.1);
- v = v.div(Decimal.pow(0.95, paper.books.kilnBook.totalAmount.value));
- if (Decimal.gte(v, 10000)) v = Decimal.mul(v, 10000).root(2);
- if (Decimal.gte(v, 100)) v = Decimal.mul(v, 100).root(2);
- return Decimal.isNaN(v) ? Decimal.dZero : v.floor().max(0);
- },
- display: jsx(() => (
- <>
- Charcoal Kiln
-
- Burn 1,000,000 logs for 10,000 coal and 10,000 ash
-
-
- Currently:
-
-{format(kilnLogs.value)} logs/sec
-
+{format(kilnCoal.value)} coal/sec
-
+{format(kilnAsh.value)} ash/sec
-
-
- Cost: {formatWhole(unref(buildKiln.cost!))} {buildKiln.resource!.displayName}
- >
- )),
- onPurchase() {
- activeKilns.value = Decimal.add(activeKilns.value, 1);
- },
- style: {
- color: colorText,
- width: "160px"
- },
- visibility: () => showIf(unlockKiln.bought.value)
- })) as ElfBuyable & { resource: Resource };
- const {
- min: minKiln,
- max: maxKiln,
- add: addKiln,
- remove: removeKiln
- } = changeActiveBuyables({
- buyable: buildKiln,
- active: activeKilns
- });
- const warmerCutters = createUpgrade(() => ({
- resource: noPersist(coal),
- cost: 5,
- display: {
- title: "Warmer Cutters",
- description: "Cut down twice as many trees/s"
- },
- style: { color: colorText }
- }));
- const warmerPlanters = createUpgrade(() => ({
- resource: noPersist(coal),
- cost: 5,
- display: {
- title: "Warmer Planters",
- description: "Plant twice as many trees/s"
- },
- style: { color: colorText }
- }));
- const basicFertilizer = createUpgrade(() => ({
- resource: noPersist(ash),
- cost: 5000,
- display: {
- title: "Ashy Soil",
- description: "Trees give 25% more logs"
- },
- style: { color: colorText }
- }));
- const unlockBonfire = createUpgrade(() => ({
- resource: fireResource,
- cost: 10,
- display: {
- title: "Bigger Fires",
- description: "Put all those fires together into a larger blaze"
- },
- onPurchase() {
- fireResource.value = Decimal.add(fireResource.value, this.cost);
- },
- style: { color: colorText }
- }));
- const row1upgrades = [warmerCutters, warmerPlanters, basicFertilizer, unlockBonfire];
-
- const dedicatedCutters = createUpgrade(() => ({
- resource: noPersist(coal),
- cost: 250,
- display: {
- title: "Dedicated Cutter Heaters",
- description: "Double the bonus from Heated Cutters"
- },
- style: { color: colorText },
- visibility: () => showIf(unlockBonfire.bought.value)
- }));
- const dedicatedPlanters = createUpgrade(() => ({
- resource: noPersist(coal),
- cost: 250,
- display: {
- title: "Dedicated Planter Heaters",
- description: "Double the bonus from Heated Planters"
- },
- style: { color: colorText },
- visibility: () => showIf(unlockBonfire.bought.value)
- }));
- const betterFertilizer: Upgrade = createUpgrade(() => ({
- canAfford() {
- return Decimal.gte(trees.logs.value, 1e5) && Decimal.gte(ash.value, 1e5);
- },
- onPurchase() {
- trees.logs.value = Decimal.sub(trees.logs.value, 1e5);
- ash.value = Decimal.sub(ash.value, 1e5);
- },
- display: jsx(() => (
- <>
- Mulched Soil
-
- Double the bonus from Fertilized Soil
-
-
- Cost: {formatWhole(1e5)} {trees.logs.displayName}
-
- {formatWhole(1e5)} {ash.displayName}
- >
- )),
- style: { color: colorText },
- visibility: () => showIf(unlockBonfire.bought.value)
- }));
-
- const unlockKiln: Upgrade = createUpgrade(() => ({
- resource: trees.logs,
- cost: 1e7,
- display: {
- title: "Efficient Fires",
- description: "Move the fires underground to keep the coal from turning to ash"
- },
- style: { color: colorText },
- visibility: () => showIf(unlockBonfire.bought.value)
- }));
- const row2upgrades = [dedicatedCutters, dedicatedPlanters, betterFertilizer, unlockKiln];
-
- const efficientSmelther: Upgrade = createUpgrade(() => ({
- resource: noPersist(coal),
- cost: 1e19,
- display: {
- title: "Efficient Crucibles",
- description: "Double auto smelting speed and triple metal gain from auto smelting"
- },
- style: { color: colorText },
- visibility: () => showIf(oil.depthMilestones[4].earned.value)
- }));
- const row3upgrades = [efficientSmelther];
- const buildDrill = createBuyable(() => ({
- resource: metal.metal,
- cost() {
- let v = this.amount.value;
- if (Decimal.gte(v, 100)) v = Decimal.pow(v, 2).div(100);
- if (Decimal.gte(v, 10000)) v = Decimal.pow(v, 2).div(10000);
- v = Decimal.pow(0.95, paper.books.coalDrillBook.totalAmount.value).times(v);
- let cost = Decimal.pow(1.15, v).times(10);
- if (management.elfTraining.fertilizerElfTraining.milestones[2].earned.value) {
- cost = cost.div(Decimal.add(trees.totalLogs.value, Math.E).ln());
- }
- if (management.elfTraining.coalDrillElfTraining.milestones[2].earned.value) {
- cost = cost.div(10);
- }
- return cost;
- },
- inverseCost(x: DecimalSource) {
- if (management.elfTraining.coalDrillElfTraining.milestones[2].earned.value) {
- x = Decimal.mul(x, 10);
- }
- if (management.elfTraining.fertilizerElfTraining.milestones[2].earned.value) {
- x = Decimal.mul(x, Decimal.add(trees.totalLogs.value, Math.E).ln());
- }
- let v = Decimal.div(x, 10).log(1.15);
- v = v.div(Decimal.pow(0.95, paper.books.coalDrillBook.totalAmount.value));
- if (Decimal.gte(v, 10000)) v = Decimal.mul(v, 10000).root(2);
- if (Decimal.gte(v, 100)) v = Decimal.mul(v, 100).root(2);
- return Decimal.isNaN(v) ? Decimal.dZero : v.floor().max(0);
- },
- display: jsx(() => (
- <>
- Coal Drill
-
- Dig through the ground to find 50,000,000 coal
-
-
- Currently:
-
+{format(drillCoal.value)} coal/sec
-
-
- Cost: {formatWhole(unref(buildDrill.cost!))} {buildDrill.resource.displayName}
- >
- )),
- onPurchase() {
- activeDrills.value = Decimal.add(activeDrills.value, 1);
- },
- style: {
- color: colorText,
- width: "160px"
- },
- visibility: () => showIf(metal.coalDrill.bought.value)
- })) as ElfBuyable & { resource: Resource };
- const activeDrills = persistent(0)
- const {
- max: maxDrill,
- min: minDrill,
- add: addDrill,
- remove: removeDrill
- } = changeActiveBuyables({
- buyable: buildDrill,
- active: activeDrills
- });
- const heatedCutters = createBuyable(() => ({
- resource: noPersist(coal),
- cost() {
- let v = this.amount.value;
- if (Decimal.gte(v, 50)) v = Decimal.pow(v, 2).div(50);
- if (Decimal.gte(v, 200)) v = Decimal.pow(v, 2).div(200);
- if (Decimal.gte(v, 2e6)) v = Decimal.pow(v, 2).div(2e6);
- v = Decimal.pow(0.95, paper.books.heatedCuttersBook.totalAmount.value).times(v);
- if (management.elfTraining.heatedCutterElfTraining.milestones[0].earned.value) {
- v = Decimal.pow(0.95, paper.books.heatedCuttersBook.totalAmount.value).times(v);
- }
- v = v.div(wrappingPaper.boosts.rainbow1.value);
- return Decimal.add(v, 1).pow(2.5).times(10);
- },
- inverseCost(x: DecimalSource) {
- let v = Decimal.div(x, 10).root(2.5).sub(1);
- v = v.mul(wrappingPaper.boosts.rainbow1.value);
- if (management.elfTraining.heatedCutterElfTraining.milestones[0].earned.value) {
- v = v.div(Decimal.pow(0.95, paper.books.heatedCuttersBook.totalAmount.value));
- }
- v = v.div(Decimal.pow(0.95, paper.books.heatedCuttersBook.totalAmount.value));
- if (Decimal.gte(v, 2e6)) v = Decimal.mul(v, 2e6).root(2);
- if (Decimal.gte(v, 200)) v = Decimal.mul(v, 200).root(2);
- if (Decimal.gte(v, 50)) v = Decimal.mul(v, 50).root(2);
- return Decimal.isNaN(v) ? Decimal.dZero : v.floor().max(0);
- },
- display: {
- title: "Heated Cutters",
- description: "Even warmer cutters cut down trees faster",
- effectDisplay: jsx(() => (
- <>Cutters cut down trees {format(computedHeatedCutterEffect.value)}x faster>
- ))
- },
- style: { color: colorText },
- visibility: () => showIf(warmerCutters.bought.value)
- })) as ElfBuyable & { display: { title: string }; resource: Resource };
- const heatedPlanters = createBuyable(() => ({
- resource: noPersist(coal),
- cost() {
- let v = this.amount.value;
- if (Decimal.gte(v, 50)) v = Decimal.pow(v, 2).div(50);
- if (Decimal.gte(v, 200)) v = Decimal.pow(v, 2).div(200);
- if (Decimal.gte(v, 2e6)) v = Decimal.pow(v, 2).div(2e6);
- v = Decimal.pow(0.95, paper.books.heatedPlantersBook.totalAmount.value).times(v);
- if (management.elfTraining.heatedPlanterElfTraining.milestones[0].earned.value) {
- v = Decimal.pow(0.95, paper.books.heatedPlantersBook.totalAmount.value).times(v);
- }
- v = v.div(wrappingPaper.boosts.rainbow1.value);
- return Decimal.add(v, 1).pow(2.5).times(10);
- },
- inverseCost(x: DecimalSource) {
- let v = Decimal.div(x, 10).root(2.5).sub(1);
- v = v.mul(wrappingPaper.boosts.rainbow1.value);
- if (management.elfTraining.heatedPlanterElfTraining.milestones[0].earned.value) {
- v = v.div(Decimal.pow(0.95, paper.books.heatedPlantersBook.totalAmount.value));
- }
- v = v.div(Decimal.pow(0.95, paper.books.heatedPlantersBook.totalAmount.value));
- if (Decimal.gte(v, 2e6)) v = Decimal.mul(v, 2e6).root(2);
- if (Decimal.gte(v, 200)) v = Decimal.mul(v, 200).root(2);
- if (Decimal.gte(v, 50)) v = Decimal.mul(v, 50).root(2);
- return Decimal.isNaN(v) ? Decimal.dZero : v.floor().max(0);
- },
- display: {
- title: "Heated Planters",
- description: "Even warmer planters plant trees faster",
- effectDisplay: jsx(() => (
- <>Planters plant trees {format(computedHeatedPlanterEffect.value)}x faster>
- ))
- },
- style: { color: colorText },
- visibility: () => showIf(warmerPlanters.bought.value)
- })) as ElfBuyable & { display: { title: string }; resource: Resource };
- const moreFertilizer = createBuyable(() => ({
- resource: noPersist(ash),
- cost() {
- let v = this.amount.value;
- if (Decimal.gte(v, 50)) v = Decimal.pow(v, 2).div(50);
- if (Decimal.gte(v, 200)) v = Decimal.pow(v, 2).div(200);
- if (Decimal.gte(v, 2e6)) v = Decimal.pow(v, 2).div(2e6);
- v = Decimal.pow(0.95, paper.books.fertilizerBook.totalAmount.value).times(v);
- if (management.elfTraining.fertilizerElfTraining.milestones[1].earned.value) {
- v = Decimal.pow(0.95, paper.books.fertilizerBook.totalAmount.value).times(v);
- }
- v = v.div(wrappingPaper.boosts.rainbow1.value);
- return Decimal.add(v, 1).pow(1.5).times(50000);
- },
- inverseCost(x: DecimalSource) {
- let v = Decimal.div(x, 50000).root(1.5).sub(1);
- v = v.mul(wrappingPaper.boosts.rainbow1.value);
- if (management.elfTraining.fertilizerElfTraining.milestones[0].earned.value) {
- v = v.div(Decimal.pow(0.95, paper.books.fertilizerBook.totalAmount.value));
- }
- v = v.div(Decimal.pow(0.95, paper.books.fertilizerBook.totalAmount.value));
- if (Decimal.gte(v, 2e6)) v = Decimal.mul(v, 2e6).root(2);
- if (Decimal.gte(v, 200)) v = Decimal.mul(v, 200).root(2);
- if (Decimal.gte(v, 50)) v = Decimal.mul(v, 50).root(2);
- return Decimal.isNaN(v) ? Decimal.dZero : v.floor().max(0);
- },
- display: {
- title: "Fertilized Soil",
- description: "More fertilizer helps trees grow bigger",
- effectDisplay: jsx(() => (
- <>Trees give {format(computedFertilizerEffect.value)}x more logs>
- ))
- },
- style: { color: colorText },
- visibility: () => showIf(basicFertilizer.bought.value)
- })) as ElfBuyable & { display: { title: string }; resource: Resource };
- const row3buyables = [heatedCutters, heatedPlanters, moreFertilizer];
- return {
- buildFire,
- activeFires,
- buildBonfire,
- activeBonfires,
- buildKiln,
- activeKilns,
- minFire,
- maxFire,
- addFire,
- removeFire,
- minBonfire,
- maxBonfire,
- addBonfire,
- removeBonfire,
- minKiln,
- maxKiln,
- addKiln,
- removeKiln,
- row1upgrades,
- row2upgrades,
- row3upgrades,
- unlockBonfire,
- unlockKiln,
- dedicatedCutters,
- dedicatedPlanters,
- betterFertilizer,
- efficientSmelther,
- warmerCutters,
- warmerPlanters,
- basicFertilizer,
- activeDrills,
- buildDrill,
- minDrill,
- maxDrill,
- addDrill,
- removeDrill,
- coal,
- ash,
- heatedCutters,
- heatedPlanters,
- moreFertilizer,
- row3buyables,
- }
- })()
+ const mastery = {
+ coal: persistent(0),
+ totalCoal: persistent(0),
+ ash: persistent(0),
+ activeFires: persistent(0),
+ buildFire: { amount: persistent(0) },
+ activeBonfires: persistent(0),
+ buildBonfire: { amount: persistent(0) },
+ activeKilns: persistent(0),
+ buildKiln: { amount: persistent(0) },
+ activeDrills: persistent(0),
+ buildDrill: { amount: persistent(0) },
+ warmerCutters: { bought: persistent(false) },
+ warmerPlanters: { bought: persistent(false) },
+ basicFertilizer: { bought: persistent(false) },
+ unlockBonfire: { bought: persistent(false) },
+ dedicatedCutters: { bought: persistent(false) },
+ dedicatedPlanters: { bought: persistent(false) },
+ betterFertilizer: { bought: persistent(false) },
+ unlockKiln: { bought: persistent(false) },
+ efficientSmelther: { bought: persistent(false) },
+ arsonistAssistance: { bought: persistent(false) },
+ refinedCoal: { bought: persistent(false) },
+ coloredFire: { bought: persistent(false) },
+ heatedCutters: { amount: persistent(0) },
+ heatedPlanters: { amount: persistent(0) },
+ moreFertilizer: { amount: persistent(0) }
+ };
+ function swapMastery() {
+ [coal.value, mastery.coal.value] = [mastery.coal.value, coal.value];
+ [totalCoal.value, mastery.totalCoal.value] = [mastery.totalCoal.value, totalCoal.value];
+ [ash.value, mastery.ash.value] = [mastery.ash.value, ash.value];
+ [activeFires.value, mastery.activeFires.value] = [mastery.activeFires.value, activeFires.value];
+ [buildFire.amount.value, mastery.buildFire.amount.value] = [mastery.buildFire.amount.value, buildFire.amount.value];
+ [activeBonfires.value, mastery.activeBonfires.value] = [mastery.activeBonfires.value, activeBonfires.value];
+ [buildBonfire.amount.value, mastery.buildBonfire.amount.value] = [mastery.buildBonfire.amount.value, buildBonfire.amount.value];
+ [activeKilns.value, mastery.activeKilns.value] = [mastery.activeKilns.value, activeKilns.value];
+ [buildKiln.amount.value, mastery.buildKiln.amount.value] = [mastery.buildKiln.amount.value, buildKiln.amount.value];
+ [activeDrills.value, mastery.activeDrills.value] = [mastery.activeDrills.value, activeDrills.value];
+ [buildDrill.amount.value, mastery.buildDrill.amount.value] = [mastery.buildDrill.amount.value, buildDrill.amount.value];
+ [warmerCutters.bought.value, mastery.warmerCutters.bought.value] = [mastery.warmerCutters.bought.value, warmerCutters.bought.value];
+ [warmerPlanters.bought.value, mastery.warmerPlanters.bought.value] = [mastery.warmerPlanters.bought.value, warmerPlanters.bought.value];
+ [basicFertilizer.bought.value, mastery.basicFertilizer.bought.value] = [mastery.basicFertilizer.bought.value, basicFertilizer.bought.value];
+ [unlockBonfire.bought.value, mastery.unlockBonfire.bought.value] = [mastery.unlockBonfire.bought.value, unlockBonfire.bought.value];
+ [dedicatedCutters.bought.value, mastery.dedicatedCutters.bought.value] = [mastery.dedicatedCutters.bought.value, dedicatedCutters.bought.value];
+ [dedicatedPlanters.bought.value, mastery.dedicatedPlanters.bought.value] = [mastery.dedicatedPlanters.bought.value, dedicatedPlanters.bought.value];
+ [betterFertilizer.bought.value, mastery.betterFertilizer.bought.value] = [mastery.betterFertilizer.bought.value, betterFertilizer.bought.value];
+ [unlockKiln.bought.value, mastery.unlockKiln.bought.value] = [mastery.unlockKiln.bought.value, unlockKiln.bought.value];
+ [efficientSmelther.bought.value, mastery.efficientSmelther.bought.value] = [mastery.efficientSmelther.bought.value, efficientSmelther.bought.value];
+ [arsonistAssistance.bought.value, mastery.arsonistAssistance.bought.value] = [mastery.arsonistAssistance.bought.value, arsonistAssistance.bought.value];
+ [refinedCoal.bought.value, mastery.refinedCoal.bought.value] = [mastery.refinedCoal.bought.value, refinedCoal.bought.value];
+ [coloredFire.bought.value, mastery.coloredFire.bought.value] = [mastery.coloredFire.bought.value, coloredFire.bought.value];
+ [heatedCutters.amount.value, mastery.heatedCutters.amount.value] = [mastery.heatedCutters.amount.value, heatedCutters.amount.value];
+ [heatedPlanters.amount.value, mastery.heatedPlanters.amount.value] = [mastery.heatedPlanters.amount.value, heatedPlanters.amount.value];
+ [moreFertilizer.amount.value, mastery.moreFertilizer.amount.value] = [mastery.moreFertilizer.amount.value, moreFertilizer.amount.value];
+ }
+ const mastered = persistent(false);
return {
name,
@@ -1514,13 +1088,12 @@ const layer = createLayer(id, function (this: BaseLayer) {
computedFertilizerEffect,
generalTabCollapsed,
minWidth: 700,
- mastery,
display: jsx(() => (
<>
{render(trackerDisplay)}
- {render(main.isMastery.value ? mastery.buildFire : buildFire)}
+ {render(buildFire)}
{formatWhole(Decimal.floor(main.isMastery ? mastery.activeFires.value : activeFires.value))}/
{formatWhole(Decimal.floor(main.isMastery ? mastery.buildFire.amount.value : buildFire.amount.value))}
- {renderRow(... main.isMastery.value ? [mastery.minFire, mastery.removeFire, mastery.addFire, mastery.maxFire] : [minFire, removeFire, addFire, maxFire])}
+ {renderRow(minFire, removeFire, addFire, maxFire)}
- {(main.isMastery.value ? mastery.unlockBonfire.bought.value : unlockBonfire.bought.value) ? (
+ {(unlockBonfire.bought.value) ? (
<>
{render(buildBonfire)}
- {formatWhole(main.isMastery.value ? mastery.activeBonfires.value : activeBonfires.value)}/
- {formatWhole(main.isMastery.value ? mastery.buildBonfire.amount.value : buildBonfire.amount.value)}
+ {formatWhole(activeBonfires.value)}/
+ {formatWhole(buildBonfire.amount.value)}
- {renderRow(...main.isMastery.value ? [mastery.minBonfire, mastery.removeBonfire, mastery.addBonfire, mastery.maxBonfire] : [minBonfire, removeBonfire, addBonfire, maxBonfire] )}
+ {renderRow(minBonfire, removeBonfire, addBonfire, maxBonfire)}
>
) : undefined}
- {(main.isMastery.value ? mastery.unlockKiln.bought.value : unlockKiln.bought.value) ? (
+ {(unlockKiln.bought.value) ? (
<>
- {render(main.isMastery.value ? mastery.buildKiln : buildKiln)}
+ {render(buildKiln)}
- {formatWhole(main.isMastery.value ? mastery.activeKilns.value : activeKilns.value)}/
- {formatWhole(main.isMastery.value ? mastery.buildKiln.amount.value : buildKiln.amount.value)}
+ {formatWhole(activeKilns.value)}/
+ {formatWhole(buildKiln.amount.value)}
- {renderRow(...main.isMastery.value ? [mastery.minKiln, mastery.removeKiln, mastery.addKiln, mastery.maxKiln] : [minKiln, removeKiln, addKiln, maxKiln])}
+ {renderRow(minKiln, removeKiln, addKiln, maxKiln)}
>
) : undefined}
@@ -1581,26 +1154,25 @@ const layer = createLayer(id, function (this: BaseLayer) {
<>
- {render(main.isMastery.value ? mastery.buildDrill : buildDrill)}
+ {render(buildDrill)}
- {formatWhole(main.isMastery.value ? mastery.activeDrills.value : activeDrills.value)}/
- {formatWhole(main.isMastery.value ? mastery.buildDrill.amount.value : buildDrill.amount.value)}
+ {formatWhole(activeDrills.value)}/
+ {formatWhole(buildDrill.amount.value)}
- {renderRow(...main.isMastery.value ? [mastery.minDrill, mastery.removeDrill, mastery.addDrill, mastery.maxDrill] : [minDrill, removeDrill, addDrill, maxDrill])}
+ {renderRow(minDrill, removeDrill, addDrill, maxDrill)}
>
) : undefined}
- {renderGrid(...main.isMastery.value ? [mastery.row1upgrades, mastery.row2upgrades, mastery.row3upgrades] : [row1upgrades, row2upgrades, row3upgrades] )}
- {renderRow(...main.isMastery.value ? mastery.row3buyables : row3buyables)}
+ {renderGrid(row1upgrades, row2upgrades, row3upgrades)}
+ {renderRow(...row3buyables)}
>
)),
- minimizedDisplay: jsx(() => (
-
- {name} - {format(main.isMastery.value ? mastery.coal.value : coal.value)} {coal.displayName}
-
- ))
+ minimizedDisplay: jsx(() => ({name} - {format(coal.value)} {coal.displayName}
)),
+ mastery,
+ swapMastery,
+ mastered
};
});
diff --git a/src/data/layers/trees.tsx b/src/data/layers/trees.tsx
index a127bc0..92375a4 100644
--- a/src/data/layers/trees.tsx
+++ b/src/data/layers/trees.tsx
@@ -7,12 +7,12 @@ import Modal from "components/Modal.vue";
import { createCollapsibleModifierSections, setUpDailyProgressTracker } from "data/common";
import { main } from "data/projEntry";
import { createBar } from "features/bars/bar";
-import { createBuyable, GenericBuyable } from "features/buyable";
+import { createBuyable } from "features/buyable";
import { createClickable } from "features/clickables/clickable";
import { jsx, showIf } from "features/feature";
import { createHotkey } from "features/hotkey";
import MainDisplay from "features/resources/MainDisplay.vue";
-import { createResource, Resource } from "features/resources/resource";
+import { createResource, Resource, trackTotal } from "features/resources/resource";
import { createUpgrade } from "features/upgrades/upgrade";
import { globalBus } from "game/events";
import { BaseLayer, createLayer } from "game/layers";
@@ -26,7 +26,6 @@ import {
import { noPersist, persistent } from "game/persistence";
import Decimal, { DecimalSource, format, formatGain, formatLimit, formatWhole } from "util/bignum";
import { Direction, WithRequired } from "util/common";
-import { createLazyProxy } from "util/proxies";
import { render, renderGrid, renderRow } from "util/vue";
import { computed, ref } from "vue";
import boxes from "./boxes";
@@ -52,23 +51,17 @@ const layer = createLayer(id, function (this: BaseLayer) {
const logs = createResource(0, "logs");
// Think of saplings as spent trees
const saplings = createResource(0, "saplings");
- const mastered = persistent(false);
- const ema = ref(0);
+ const averageLogGain = ref(0);
const lastAutoCuttingAmount = ref(0);
const lastAutoPlantedAmount = ref(0);
const totalTrees = createSequentialModifier(() => [
createAdditiveModifier(() => ({
- addend: () =>
- Decimal.times(
- (main.isMastery.value ? mastery.expandingForestBuyable : expandingForestBuyable)
- .amount.value,
- 10
- ),
+ addend: () => Decimal.times(expandingForestBuyable.amount.value, 10),
description: "Expand Forest",
- enabled: (main.isMastery.value ? mastery.researchUpgrade2 : researchUpgrade2).bought
+ enabled: researchUpgrade2.bought
})),
createAdditiveModifier(() => ({
addend: () => Decimal.div(workshop.foundationProgress.value, 2),
@@ -98,9 +91,7 @@ const layer = createLayer(id, function (this: BaseLayer) {
createAdditiveModifier(() => ({
addend: () => Decimal.pow(computedManualCuttingAmount.value, 0.99),
description: "Hope Level 1",
- enabled: () =>
- management.elfTraining.expandersElfTraining.milestones[0].earned.value &&
- !main.isMastery.value
+ enabled: management.elfTraining.expandersElfTraining.milestones[0].earned
}))
]) as WithRequired;
const trees = createResource(
@@ -301,14 +292,12 @@ const layer = createLayer(id, function (this: BaseLayer) {
createAdditiveModifier(() => ({
addend: 1,
description: "Wooden Fingers",
- enabled: (main.isMastery ? mastery.manualCutUpgrade1 : manualCutUpgrade1).bought
+ enabled: manualCutUpgrade1.bought
})),
createAdditiveModifier(() => ({
addend: computedAutoCuttingAmount,
description: "Smart Knives",
- enabled: main.isMastery.value
- ? mastery.manualCutUpgrade3.bought
- : manualCutUpgrade3.bought
+ enabled: manualCutUpgrade3.bought
}))
]);
const computedManualCuttingAmount = computed(() => manualCuttingAmount.apply(1));
@@ -316,9 +305,7 @@ const layer = createLayer(id, function (this: BaseLayer) {
createMultiplicativeModifier(() => ({
multiplier: 0.5,
description: "Sharper Fingers",
- enabled: main.isMastery.value
- ? mastery.manualCutUpgrade2.bought
- : manualCutUpgrade2.bought
+ enabled: manualCutUpgrade2.bought
})),
createMultiplicativeModifier(() => ({
multiplier: () => Decimal.pow(0.5, elves.totalElves.value),
@@ -367,17 +354,13 @@ const layer = createLayer(id, function (this: BaseLayer) {
createMultiplicativeModifier(() => ({
multiplier: () => Decimal.pow(1.1, main.day.value),
description: "Holly Level 4",
- enabled: () =>
- management.elfTraining.cutterElfTraining.milestones[3].earned.value &&
- !main.isMastery.value
+ enabled: management.elfTraining.cutterElfTraining.milestones[3].earned
})),
createAdditiveModifier(() => ({
addend: () =>
Decimal.sub(lastAutoPlantedAmount.value, lastAutoCuttingAmount.value).max(0),
description: "Ivy Level 5",
- enabled: () =>
- management.elfTraining.planterElfTraining.milestones[4].earned.value &&
- !main.isMastery.value
+ enabled: management.elfTraining.planterElfTraining.milestones[4].earned
}))
]) as WithRequired;
const computedAutoCuttingAmount = computed(() => autoCuttingAmount.apply(0));
@@ -386,16 +369,12 @@ const layer = createLayer(id, function (this: BaseLayer) {
createAdditiveModifier(() => ({
addend: 1,
description: "Leafy Fingers",
- enabled: main.isMastery.value
- ? mastery.manualPlantUpgrade1.bought
- : manualPlantUpgrade1.bought
+ enabled: manualPlantUpgrade1.bought
})),
createAdditiveModifier(() => ({
addend: computedAutoPlantingAmount,
description: "Smart Spades",
- enabled: main.isMastery.value
- ? mastery.manualPlantUpgrade3.bought
- : manualPlantUpgrade3.bought
+ enabled: manualPlantUpgrade3.bought
}))
]);
const computedManualPlantingAmount = computed(() => manualPlantingAmount.apply(1));
@@ -403,9 +382,7 @@ const layer = createLayer(id, function (this: BaseLayer) {
createMultiplicativeModifier(() => ({
multiplier: 0.5,
description: "Greener Fingers",
- enabled: main.isMastery.value
- ? mastery.manualPlantUpgrade2.bought
- : manualPlantUpgrade2.bought
+ enabled: manualPlantUpgrade2.bought
})),
createMultiplicativeModifier(() => ({
multiplier: () => Decimal.pow(0.5, elves.totalElves.value),
@@ -419,16 +396,11 @@ const layer = createLayer(id, function (this: BaseLayer) {
createAdditiveModifier(() => ({
addend: 1,
description: "Automated Spade",
- enabled: main.isMastery.value
- ? mastery.autoPlantUpgrade1.bought
- : autoPlantUpgrade1.bought
+ enabled: autoPlantUpgrade1.bought.value
})),
createAdditiveModifier(() => ({
- addend: () =>
- Decimal.div(
- main.isMastery.value
- ? mastery.autoPlantingBuyable1.amount.value
- : autoPlantingBuyable1.amount.value,
+ addend: () => Decimal.div(
+ autoPlantingBuyable1.amount.value,
2
),
description: "Generic Planters",
@@ -462,49 +434,41 @@ const layer = createLayer(id, function (this: BaseLayer) {
createMultiplicativeModifier(() => ({
multiplier: 2,
description: "Ivy Level 1",
- enabled: () =>
- management.elfTraining.planterElfTraining.milestones[0].earned.value &&
- !main.isMastery.value
+ enabled: management.elfTraining.planterElfTraining.milestones[0].earned
})),
createMultiplicativeModifier(() => ({
multiplier: () => Decimal.pow(trees.value, 0.2).max(1).log10().pow_base(2),
description: "Ivy Level 3",
- enabled: () =>
- management.elfTraining.planterElfTraining.milestones[2].earned.value &&
- !main.isMastery.value
+ enabled: management.elfTraining.planterElfTraining.milestones[2].earned
})),
createMultiplicativeModifier(() => ({
multiplier: 2,
description: "Mary Level 4",
- enabled: () =>
- management.elfTraining.heatedPlanterElfTraining.milestones[3].earned.value &&
- !main.isMastery.value
+ enabled: management.elfTraining.heatedPlanterElfTraining.milestones[3].earned
})),
createAdditiveModifier(() => ({
- addend: () =>
- Decimal.sub(lastAutoCuttingAmount.value, lastAutoPlantedAmount.value).max(0),
+ addend: () => Decimal.sub(lastAutoCuttingAmount.value, lastAutoPlantedAmount.value).max(0),
description: "Ivy Level 5",
- enabled: () =>
- management.elfTraining.planterElfTraining.milestones[4].earned.value &&
- !main.isMastery.value
+ enabled: management.elfTraining.planterElfTraining.milestones[4].earned
}))
]) as WithRequired;
const computedAutoPlantingAmount = computed(() => autoPlantingAmount.apply(0));
const logGain = createSequentialModifier(() => [
+ createAdditiveModifier(() => ({
+ addend: () => totalTrees.apply(0),
+ description: "Tree Mastery",
+ enabled: () => main.isMastery.value || mastered.value
+ })),
createMultiplicativeModifier(() => ({
multiplier: 1.25,
description: "Research I",
- enabled: main.isMastery.value
- ? mastery.researchUpgrade1.bought
- : researchUpgrade1.bought
+ enabled: researchUpgrade1.bought
})),
createMultiplicativeModifier(() => ({
multiplier: 1.25,
description: "Research II",
- enabled: main.isMastery.value
- ? mastery.researchUpgrade2.bought
- : researchUpgrade2.bought
+ enabled: researchUpgrade2.bought
})),
createMultiplicativeModifier(() => ({
multiplier: () =>
@@ -559,22 +523,12 @@ const layer = createLayer(id, function (this: BaseLayer) {
createMultiplicativeModifier(() => ({
multiplier: computed(() => Decimal.add(computedAutoCuttingAmount.value, 1).root(9)),
description: "Holly Level 1",
- enabled() {
- return (
- management.elfTraining.cutterElfTraining.milestones[0].earned.value &&
- !main.isMastery.value
- );
- }
+ enabled: management.elfTraining.cutterElfTraining.milestones[0].earned
})),
createMultiplicativeModifier(() => ({
multiplier: () => Decimal.sqrt(management.totalElfLevels.value),
description: "Noel Level 1",
- enabled() {
- return (
- management.elfTraining.fertilizerElfTraining.milestones[0].earned.value &&
- !main.isMastery.value
- );
- }
+ enabled: management.elfTraining.fertilizerElfTraining.milestones[0].earned
})),
createMultiplicativeModifier(() => ({
multiplier: wrappingPaper.boosts.christmas1,
@@ -621,7 +575,7 @@ const layer = createLayer(id, function (this: BaseLayer) {
minHeight: "80px"
},
canClick: () =>
- Decimal.gte(main.isMastery.value ? mastery.trees.value : trees.value, 1) &&
+ Decimal.gte(trees.value, 1) &&
Decimal.gte(manualCutProgress.value, computedManualCuttingCooldown.value),
onClick() {
if (Decimal.lt(manualCutProgress.value, computedManualCuttingCooldown.value)) {
@@ -629,7 +583,7 @@ const layer = createLayer(id, function (this: BaseLayer) {
}
const amount = Decimal.floor(
Decimal.min(
- main.isMastery.value ? mastery.trees.value : trees.value,
+ trees.value,
Decimal.times(
computedManualCuttingAmount.value,
Decimal.div(
@@ -639,19 +593,8 @@ const layer = createLayer(id, function (this: BaseLayer) {
)
)
);
- if (main.isMastery.value) {
- mastery.logs.value = Decimal.add(
- mastery.logs.value,
- Decimal.times(logGain.apply(1), amount)
- );
- mastery.saplings.value = Decimal.add(
- Decimal.mul(mastery.saplings.value, 2),
- amount
- );
- } else {
- logs.value = Decimal.add(logs.value, Decimal.times(logGain.apply(1), amount));
- saplings.value = Decimal.add(saplings.value, amount);
- }
+ logs.value = Decimal.add(logs.value, Decimal.times(logGain.apply(1), amount));
+ saplings.value = Decimal.add(saplings.value, amount.times((main.isMastery.value || mastered.value) ? 2 : 1));
manualCutProgress.value = 0;
}
}));
@@ -683,7 +626,7 @@ const layer = createLayer(id, function (this: BaseLayer) {
minHeight: "80px"
},
canClick: () =>
- Decimal.gte(main.isMastery.value ? mastery.saplings.value : saplings.value, 1) &&
+ Decimal.gte(saplings.value, 1) &&
Decimal.gte(manualPlantProgress.value, computedManualPlantingCooldown.value),
onClick() {
if (Decimal.lt(manualPlantProgress.value, computedManualPlantingCooldown.value)) {
@@ -691,7 +634,7 @@ const layer = createLayer(id, function (this: BaseLayer) {
}
const amount = Decimal.floor(
Decimal.min(
- main.isMastery.value ? mastery.saplings.value : saplings.value,
+ saplings.value,
Decimal.times(
computedManualPlantingAmount.value,
Decimal.div(
@@ -701,11 +644,7 @@ const layer = createLayer(id, function (this: BaseLayer) {
)
)
);
- if (main.isMastery.value) {
- mastery.saplings.value = Decimal.sub(mastery.saplings.value, amount);
- } else {
- saplings.value = Decimal.sub(saplings.value, amount);
- }
+ saplings.value = Decimal.sub(saplings.value, amount);
manualPlantProgress.value = 0;
}
}));
@@ -715,67 +654,55 @@ const layer = createLayer(id, function (this: BaseLayer) {
title: "Logs per Tree",
modifier: logGain,
base: 1,
- visible: main.isMastery.value
- ? mastery.researchUpgrade1.bought
- : researchUpgrade1.bought
+ visible: researchUpgrade1.bought
},
{
title: "Manual Cutting Amount",
modifier: manualCuttingAmount,
base: 1,
- visible: main.isMastery.value
- ? mastery.manualCutUpgrade1.bought
- : manualCutUpgrade1.bought,
+ visible: manualCutUpgrade1.bought,
unit: "/click"
},
{
title: "Manual Cutting Cooldown",
modifier: manualCuttingCooldown,
base: 1,
- visible: main.isMastery.value
- ? mastery.manualCutUpgrade1.bought
- : manualCutUpgrade1.bought,
+ visible: manualCutUpgrade1.bought,
unit: "s"
},
{
title: "Manual Planting Amount",
modifier: manualPlantingAmount,
base: 1,
- visible: main.isMastery.value
- ? mastery.manualPlantUpgrade1.bought
- : manualPlantUpgrade1.bought,
+ visible: manualPlantUpgrade1.bought,
unit: "/click"
},
{
title: "Manual Planting Cooldown",
modifier: manualPlantingCooldown,
base: 1,
- visible: main.isMastery.value
- ? mastery.manualPlantUpgrade1.bought
- : manualPlantUpgrade1.bought,
+ visible: manualPlantUpgrade1.bought,
unit: "s"
},
{
title: `Auto Cutting Amount`,
modifier: autoCuttingAmount,
base: 0,
- visible: main.isMastery.value ? mastery.autoCutUpgrade1.bought : autoCutUpgrade1.bought,
+ visible: autoCutUpgrade1.bought,
unit: "/s"
},
{
title: `Auto Planting Amount`,
modifier: autoPlantingAmount,
base: 0,
- visible: main.isMastery.value ? mastery.autoCutUpgrade1.bought : autoCutUpgrade1.bought,
+ visible: autoCutUpgrade1.bought,
unit: "/s"
},
{
title: `Forest Size`,
modifier: totalTrees,
base: 10,
- visible: main.isMastery.value
- ? mastery.researchUpgrade2.bought
- : researchUpgrade2.bought
+ visible: researchUpgrade2.bought.value
}
]);
const showModifiersModal = ref(false);
@@ -824,31 +751,22 @@ const layer = createLayer(id, function (this: BaseLayer) {
lastAutoCuttingAmount.value = Decimal.isNaN(cuttingAmount) ? 0 : cuttingAmount;
const amountCut = Decimal.min(
- main.isMastery ? mastery.trees.value : trees.value,
+ trees.value,
Decimal.times(computedAutoCuttingAmount.value, diff)
);
const logsGained = Decimal.mul(logGain.apply(1), amountCut);
const effectiveLogsGained = Decimal.div(logsGained, diff);
- ema.value = Decimal.mul(effectiveLogsGained, SMOOTHING_FACTOR).add(
- Decimal.mul(ema.value, Decimal.dOne.sub(SMOOTHING_FACTOR))
+ averageLogGain.value = Decimal.mul(effectiveLogsGained, SMOOTHING_FACTOR).add(
+ Decimal.mul(averageLogGain.value, Decimal.dOne.sub(SMOOTHING_FACTOR))
);
- if (main.isMastery.value) {
- mastery.logs.value = Decimal.add(mastery.logs.value, logsGained);
- mastery.saplings.value = Decimal.add(Decimal.mul(mastery.saplings.value, 2), amountCut);
- } else {
- logs.value = Decimal.add(logs.value, logsGained);
- saplings.value = Decimal.add(Decimal.mul(saplings.value, mastered ? 2 : 1), amountCut);
- }
+ logs.value = Decimal.add(logs.value, logsGained);
+ saplings.value = Decimal.add(Decimal.mul(saplings.value, (main.isMastery.value || mastered.value) ? 2 : 1), amountCut);
const amountPlanted = Decimal.min(
saplings.value,
Decimal.times(computedAutoPlantingAmount.value, diff)
);
- if (main.isMastery.value) {
- mastery.saplings.value = Decimal.sub(mastery.saplings.value, amountPlanted);
- } else {
- saplings.value = Decimal.sub(saplings.value, amountPlanted);
- }
+ saplings.value = Decimal.sub(saplings.value, amountPlanted);
});
const netSaplingGain = computed(() =>
@@ -885,224 +803,49 @@ const layer = createLayer(id, function (this: BaseLayer) {
}
});
- // This would be a lazy proxy if the typings worked properly, REEE
- // Doesn't matter too much, nothing needs lazy inittialization
- const mastery = (() => {
- const logs = createResource(0, "logs");
- const saplings = createResource(0, "saplings");
- const manualCutUpgrade1 = createUpgrade(() => ({
- resource: noPersist(logs),
- cost: 10,
- display: {
- title: "Wooden Fingers",
- description: "Cut down an additional tree per click"
- }
- }));
- const manualPlantUpgrade1 = createUpgrade(() => ({
- resource: noPersist(logs),
- cost: 10,
- display: {
- title: "Leafy Fingers",
- description: "Plant an additional tree per click"
- }
- }));
- const autoCutUpgrade1 = createUpgrade(() => ({
- resource: noPersist(logs),
- cost: 25,
- display: {
- title: "Automated Knives",
- description: "Cut down a tree every second"
- }
- }));
- const autoPlantUpgrade1 = createUpgrade(() => ({
- resource: noPersist(logs),
- cost: 25,
- display: {
- title: "Automated Spade",
- description: "Plant a tree every second"
- }
- }));
- const researchUpgrade1 = createUpgrade(() => ({
- resource: noPersist(logs),
- cost: 40,
- display: {
- title: "Research I",
- description: "Trees give 25% more logs, and unlock more upgrades"
- }
- }));
- const row1Upgrades = [
- manualCutUpgrade1,
- manualPlantUpgrade1,
- autoCutUpgrade1,
- autoPlantUpgrade1,
- researchUpgrade1
- ];
-
- const manualCutUpgrade2 = createUpgrade(() => ({
- resource: noPersist(logs),
- cost: 50,
- visibility: () => showIf(researchUpgrade1.bought.value),
- display: {
- title: "Sharper Fingers",
- description: "Manually cut trees twice as often"
- }
- }));
- const manualPlantUpgrade2 = createUpgrade(() => ({
- resource: noPersist(logs),
- cost: 50,
- visibility: () => showIf(researchUpgrade1.bought.value),
- display: {
- title: "Greener Fingers",
- description: "Manually Plant trees twice as often"
- }
- }));
- const manualCutUpgrade3 = createUpgrade(() => ({
- resource: noPersist(logs),
- cost: 150,
- visibility: () => showIf(researchUpgrade1.bought.value),
- display: {
- title: "Smart Knives",
- description:
- "Each time you manually chop trees, gain 1s of automatic tree chopping production"
- }
- }));
- const manualPlantUpgrade3 = createUpgrade(() => ({
- resource: noPersist(logs),
- cost: 150,
- visibility: () => showIf(researchUpgrade1.bought.value),
- display: {
- title: "Smart Spades",
- description:
- "Each time you manually plant trees, gain 1s of automatic tree planting production"
- }
- }));
- const researchUpgrade2 = createUpgrade(() => ({
- resource: noPersist(logs),
- cost: 300,
- visibility: () => showIf(researchUpgrade1.bought.value),
- display: {
- title: "Research II",
- description: "Trees give 25% more logs, and unlock repeatable purchases"
- }
- }));
- const row2Upgrades = [
- manualCutUpgrade2,
- manualPlantUpgrade2,
- manualCutUpgrade3,
- manualPlantUpgrade3,
- researchUpgrade2
- ];
-
- const autoCuttingBuyable1 = createBuyable(() => ({
- resource: noPersist(logs),
- cost() {
- let v = this.amount.value;
- if (Decimal.gte(v, 50)) v = Decimal.pow(v, 2).div(50);
- if (Decimal.gte(v, 200)) v = Decimal.pow(v, 2).div(200);
- if (Decimal.gte(v, 2e6)) v = Decimal.pow(v, 2).div(2e6);
- if (Decimal.gte(v, 2e30)) v = Decimal.pow(v, 10).div(Decimal.pow(2e30, 9));
- v = Decimal.pow(0.95, paper.books.cuttersBook.totalAmount.value).times(v);
- return Decimal.times(100, v).add(200);
- },
- inverseCost(x: DecimalSource) {
- let v = Decimal.sub(x, 200).div(100);
- v = v.div(Decimal.pow(0.95, paper.books.cuttersBook.totalAmount.value));
- if (Decimal.gte(v, 2e30)) v = Decimal.mul(v, Decimal.pow(2e30, 9)).root(10);
- if (Decimal.gte(v, 2e6)) v = Decimal.mul(v, 2e6).root(2);
- if (Decimal.gte(v, 200)) v = Decimal.mul(v, 200).root(2);
- if (Decimal.gte(v, 50)) v = Decimal.mul(v, 50).root(2);
- return Decimal.isNaN(v) ? Decimal.dZero : v.floor().max(0);
- },
- display: {
- title: "Generic Cutters",
- description: "Each cutter cuts down 1 tree/s"
- },
- visibility: () => showIf(researchUpgrade2.bought.value)
- })) as ElfBuyable & { display: { title: string }; resource: Resource };
- const autoPlantingBuyable1 = createBuyable(() => ({
- resource: noPersist(logs),
- cost() {
- let v = this.amount.value;
- if (Decimal.gte(v, 50)) v = Decimal.pow(v, 2).div(50);
- if (Decimal.gte(v, 200)) v = Decimal.pow(v, 2).div(200);
- if (Decimal.gte(v, 2e6)) v = Decimal.pow(v, 2).div(2e6);
- if (Decimal.gte(v, 2e30)) v = Decimal.pow(v, 10).div(Decimal.pow(2e30, 9));
- v = Decimal.pow(0.95, paper.books.plantersBook.totalAmount.value).times(v);
- const cost = Decimal.times(100, v).add(200);
- /*if (management.elfTraining.planterElfTraining.milestones[3].earned.value) {
- cost = Decimal.div(cost, 10);
- }*/
- return cost;
- },
- inverseCost(x: DecimalSource) {
- /*if (management.elfTraining.planterElfTraining.milestones[3].earned.value) {
- x = Decimal.mul(x, 10);
- }*/
- let v = Decimal.sub(x, 200).div(100);
- v = v.div(Decimal.pow(0.95, paper.books.plantersBook.totalAmount.value));
- if (Decimal.gte(v, 2e30)) v = Decimal.mul(v, Decimal.pow(2e30, 9)).root(10);
- if (Decimal.gte(v, 2e6)) v = Decimal.mul(v, 2e6).root(2);
- if (Decimal.gte(v, 200)) v = Decimal.mul(v, 200).root(2);
- if (Decimal.gte(v, 50)) v = Decimal.mul(v, 50).root(2);
- return Decimal.isNaN(v) ? Decimal.dZero : v.floor().max(0);
- },
- display: {
- title: "Generic Planters",
- description: "Each planter plants 0.5 trees/s"
- },
- visibility: () => showIf(researchUpgrade2.bought.value)
- })) as ElfBuyable & { display: { title: string }; resource: Resource };
- const expandingForestBuyable = createBuyable(() => ({
- resource: noPersist(logs),
- cost() {
- let v = this.amount.value;
- if (Decimal.gte(v, 100)) v = Decimal.pow(v, 2).div(100);
- if (Decimal.gte(v, 1e5)) v = Decimal.pow(v, 2).div(1e5);
- if (Decimal.gte(v, 1e15)) v = Decimal.pow(v, 10).div(1e135);
- v = Decimal.pow(0.95, paper.books.expandersBook.totalAmount.value).times(v);
- return Decimal.pow(Decimal.add(v, 1), 1.5).times(500);
- },
- inverseCost(x: DecimalSource) {
- let v = Decimal.div(x, 500).root(1.5).sub(1);
- v = v.div(Decimal.pow(0.95, paper.books.expandersBook.totalAmount.value));
- if (Decimal.gte(v, 1e15)) v = Decimal.mul(v, 1e135).root(10);
- if (Decimal.gte(v, 1e5)) v = Decimal.mul(v, 1e5).root(2);
- if (Decimal.gte(v, 100)) v = Decimal.mul(v, 100).root(2);
- return Decimal.isNaN(v) ? Decimal.dZero : v.floor().max(0);
- },
- display: {
- title: "Expand Forest",
- description: "Add 10 trees to the forest"
- },
- visibility: () => showIf(researchUpgrade2.bought.value)
- })) as ElfBuyable & { display: { title: string }; resource: Resource };
- const trees = createResource(
- computed(() => Decimal.sub(totalTrees.apply(10), saplings.value)),
- "trees"
- );
- return {
- logs,
- saplings,
- trees,
- manualCutUpgrade1,
- manualCutUpgrade2,
- manualCutUpgrade3,
- manualPlantUpgrade1,
- manualPlantUpgrade2,
- manualPlantUpgrade3,
- autoCuttingBuyable1,
- autoPlantingBuyable1,
- expandingForestBuyable,
- researchUpgrade1,
- researchUpgrade2,
- autoCutUpgrade1,
- autoPlantUpgrade1,
- row1Buyables,
- row1Upgrades,
- row2Upgrades
- };
- })();
- //mastery.manualCutUpgrade1
+ const mastery = {
+ logs: persistent(0),
+ totalLogs: persistent(0),
+ saplings: persistent(0),
+ row1Upgrades: [
+ { bought: persistent(false) },
+ { bought: persistent(false) },
+ { bought: persistent(false) },
+ { bought: persistent(false) },
+ { bought: persistent(false) }
+ ],
+ row2Upgrades: [
+ { bought: persistent(false) },
+ { bought: persistent(false) },
+ { bought: persistent(false) },
+ { bought: persistent(false) },
+ { bought: persistent(false) }
+ ],
+ row1Buyables: [
+ { amount: persistent(0) },
+ { amount: persistent(0) },
+ { amount: persistent(0) }
+ ]
+ };
+ function swapMastery() {
+ [logs.value, mastery.logs.value] = [mastery.logs.value, logs.value];
+ [totalLogs.value, mastery.totalLogs.value] = [mastery.totalLogs.value, totalLogs.value];
+ [saplings.value, mastery.saplings.value] = [mastery.saplings.value, saplings.value];
+ [row1Upgrades[0].bought.value, mastery.row1Upgrades[0].bought.value] = [mastery.row1Upgrades[0].bought.value, row1Upgrades[0].bought.value];
+ [row1Upgrades[1].bought.value, mastery.row1Upgrades[1].bought.value] = [mastery.row1Upgrades[1].bought.value, row1Upgrades[1].bought.value];
+ [row1Upgrades[2].bought.value, mastery.row1Upgrades[2].bought.value] = [mastery.row1Upgrades[2].bought.value, row1Upgrades[2].bought.value];
+ [row1Upgrades[3].bought.value, mastery.row1Upgrades[3].bought.value] = [mastery.row1Upgrades[3].bought.value, row1Upgrades[3].bought.value];
+ [row1Upgrades[4].bought.value, mastery.row1Upgrades[4].bought.value] = [mastery.row1Upgrades[4].bought.value, row1Upgrades[4].bought.value];
+ [row2Upgrades[0].bought.value, mastery.row2Upgrades[0].bought.value] = [mastery.row2Upgrades[0].bought.value, row2Upgrades[0].bought.value];
+ [row2Upgrades[1].bought.value, mastery.row2Upgrades[1].bought.value] = [mastery.row2Upgrades[1].bought.value, row2Upgrades[1].bought.value];
+ [row2Upgrades[2].bought.value, mastery.row2Upgrades[2].bought.value] = [mastery.row2Upgrades[2].bought.value, row2Upgrades[2].bought.value];
+ [row2Upgrades[3].bought.value, mastery.row2Upgrades[3].bought.value] = [mastery.row2Upgrades[3].bought.value, row2Upgrades[3].bought.value];
+ [row2Upgrades[4].bought.value, mastery.row2Upgrades[4].bought.value] = [mastery.row2Upgrades[4].bought.value, row2Upgrades[4].bought.value];
+ [row1Buyables[0].amount.value, mastery.row1Buyables[0].amount.value] = [mastery.row1Buyables[0].amount.value, row1Buyables[0].amount.value];
+ [row1Buyables[1].amount.value, mastery.row1Buyables[1].amount.value] = [mastery.row1Buyables[1].amount.value, row1Buyables[1].amount.value];
+ [row1Buyables[2].amount.value, mastery.row1Buyables[2].amount.value] = [mastery.row1Buyables[2].amount.value, row1Buyables[2].amount.value];
+ }
+ const mastered = persistent(false);
return {
name,
@@ -1122,19 +865,18 @@ const layer = createLayer(id, function (this: BaseLayer) {
manualPlantProgress,
generalTabCollapsed,
computedAutoCuttingAmount,
- mastery,
minWidth: 700,
display: jsx(() => (
<>
{render(trackerDisplay)}
equilibrium: +${formatLimit(
+ ? `+${format(averageLogGain.value)}/s average
equilibrium: +${formatLimit(
[
[computedAutoCuttingAmount.value, "cutting speed"],
[computedAutoPlantingAmount.value, "planting speed"],
@@ -1147,13 +889,13 @@ const layer = createLayer(id, function (this: BaseLayer) {
}
/>
Tip: You can hold down on actions to perform them automatically
- {renderGrid(
- ...(main.isMastery.value
- ? [mastery.row1Upgrades, mastery.row2Upgrades]
- : [row1Upgrades, row2Upgrades])
- )}
+ {renderGrid(row1Upgrades, row2Upgrades)}
- {renderRow(...(main.isMastery.value ? mastery.row1Buyables : row1Buyables))}
+ {renderRow(...row1Buyables)}
>
)),
- minimizedDisplay: jsx(() => (
-
- {name} - {format(main.isMastery.value ? mastery.logs.value : logs.value)}{" "}
- {logs.displayName}
-
- )),
- mastered
+ minimizedDisplay: jsx(() => ({name} - {format(logs.value)} {logs.displayName}
)),
+ mastery,
+ swapMastery,
+ mastered,
};
});
diff --git a/src/data/layers/workshop.tsx b/src/data/layers/workshop.tsx
index 2f5bce9..19ad59c 100644
--- a/src/data/layers/workshop.tsx
+++ b/src/data/layers/workshop.tsx
@@ -39,7 +39,6 @@ const layer = createLayer(id, function (this: BaseLayer) {
const name = "Workshop";
const color = "#D66B02";
const colorDark = "#D66B02";
- const mastered = persistent(false);
const foundationProgress = createResource(0, "foundation progress");
@@ -52,9 +51,7 @@ const layer = createLayer(id, function (this: BaseLayer) {
createExponentialModifier(() => ({
exponent: 0.99,
description: "Holly Level 5",
- enabled: () =>
- management.elfTraining.cutterElfTraining.milestones[4].earned.value &&
- !main.isMastery.value
+ enabled: management.elfTraining.cutterElfTraining.milestones[4].earned
}))
]);
@@ -81,6 +78,7 @@ const layer = createLayer(id, function (this: BaseLayer) {
roundUpCost: true,
// buyMax: management.elfTraining.expandersElfTraining.milestones[2].earned,
spend(gain, spent) {
+ if (main.isMastery.value || mastered.value) return;
trees.logs.value = Decimal.sub(trees.logs.value, spent);
}
}));
@@ -90,73 +88,40 @@ const layer = createLayer(id, function (this: BaseLayer) {
<>
Build{" "}
- {formatWhole(
- (main.isMastery.value ? mastery.foundationConversion : foundationConversion)
- .actualGain.value
- )}
+ {formatWhole(foundationConversion.actualGain.value)}
% of the foundation
- {main.isMastery.value || mastered ? "Requirement" : "Cost"}:{" "}
+ {(main.isMastery.value || mastered.value) ? "Requirement" : "Cost"}:{" "}
{displayResource(
- main.isMastery.value ? trees.mastery.logs : trees.logs,
- Decimal.gte(
- (main.isMastery.value
- ? mastery.foundationConversion
- : foundationConversion
- ).actualGain.value,
- 1
- )
- ? (main.isMastery.value
- ? mastery.foundationConversion
- : foundationConversion
- ).currentAt.value
- : (main.isMastery.value
- ? mastery.foundationConversion
- : foundationConversion
- ).nextAt.value
- )}{" "}
- {trees.logs.displayName}
+ trees.logs,
+ Decimal.gte(foundationConversion.actualGain.value, 1)
+ ? foundationConversion.currentAt.value
+ : foundationConversion.nextAt.value
+ )} {trees.logs.displayName}
>
)),
visibility: () =>
- showIf(
- main.isMastery.value
- ? Decimal.lt(mastery.foundationProgress.value, 100)
- : Decimal.lt(
- foundationProgress.value,
- management.elfTraining.expandersElfTraining.milestones[2].earned.value
- ? 1000
- : 100
- )
- ),
+ showIf(Decimal.lt(
+ foundationProgress.value,
+ management.elfTraining.expandersElfTraining.milestones[2].earned.value
+ ? 1000
+ : 100
+ )),
canClick: () => {
- if (main.isMastery.value) {
- if (
- Decimal.lt(trees.mastery.logs.value, mastery.foundationConversion.nextAt.value)
- ) {
- return false;
- }
- if (Decimal.gte(foundationProgress.value, 100)) {
- return false;
- }
- } else {
- if (Decimal.lt(trees.logs.value, foundationConversion.nextAt.value)) {
- return false;
- }
- if (
- Decimal.gte(
- foundationProgress.value,
- management.elfTraining.expandersElfTraining.milestones[2].earned.value
- ? 1000
- : 100
- )
- ) {
- return false;
- }
+ if (Decimal.lt(trees.logs.value, foundationConversion.nextAt.value)) {
+ return false;
+ }
+ if (Decimal.gte(
+ foundationProgress.value,
+ management.elfTraining.expandersElfTraining.milestones[2].earned.value
+ ? 1000
+ : 100
+ )) {
+ return false;
}
return true;
},
@@ -164,7 +129,7 @@ const layer = createLayer(id, function (this: BaseLayer) {
if (!unref(this.canClick)) {
return;
}
- (main.isMastery.value ? mastery.foundationConversion : foundationConversion).convert();
+ foundationConversion.convert();
},
style: "width: 600px; min-height: unset"
}));
@@ -350,200 +315,41 @@ const layer = createLayer(id, function (this: BaseLayer) {
}
});
- const mastery = (() => {
- const foundationProgress = createResource(0, "foundation progress");
- const foundationConversion = createIndependentConversion(() => ({
- scaling: addSoftcap(
- addSoftcap(
- createPolynomialScaling(addScaling(250), 1.5),
- addScaling(5423),
- 1 / 1e10
- ),
- addScaling(1e20),
- 3e8
- ),
- baseResource: trees.logs,
- gainResource: noPersist(foundationProgress),
- roundUpCost: true,
- // buyMax: management.elfTraining.expandersElfTraining.milestones[2].earned,
- spend(gain, spent) {}
- }));
- const logGainMilestone1 = createMilestone(() => ({
- display: {
- requirement: "1% Foundation Completed",
- effectDisplay: "Trees give 5% more logs for each % of foundation completed"
- },
- shouldEarn: () => Decimal.gte(foundationProgress.value, 1),
- showPopups: shouldShowPopups
- }));
- const autoCutMilestone1 = createMilestone(() => ({
- display: {
- requirement: "10% Foundation Completed",
- effectDisplay:
- "Cut an additional tree per second for each 5% of foundation completed"
- },
- shouldEarn: () => Decimal.gte(foundationProgress.value, 10),
- visibility: () => showIf(logGainMilestone1.earned.value),
- showPopups: shouldShowPopups
- }));
- const autoPlantMilestone1 = createMilestone(() => ({
- display: {
- requirement: "20% Foundation Completed",
- effectDisplay:
- "Plant an additional tree per second for each 10% of foundation completed"
- },
- shouldEarn: () => Decimal.gte(foundationProgress.value, 20),
- visibility: () => showIf(autoCutMilestone1.earned.value),
- showPopups: shouldShowPopups
- }));
- const autoCutMilestone2 = createMilestone(() => ({
- display: {
- requirement: "30% Foundation Completed",
- effectDisplay: "All automatic tree cutting is doubled"
- },
- shouldEarn: () => Decimal.gte(foundationProgress.value, 30),
- visibility: () => showIf(autoPlantMilestone1.earned.value),
- showPopups: shouldShowPopups
- }));
- const autoPlantMilestone2 = createMilestone(() => ({
- display: {
- requirement: "40% Foundation Completed",
- effectDisplay: "All automatic tree planting is doubled"
- },
- shouldEarn: () => Decimal.gte(foundationProgress.value, 40),
- visibility: () => showIf(autoCutMilestone2.earned.value),
- showPopups: shouldShowPopups
- }));
- const logGainMilestone2 = createMilestone(() => ({
- display: {
- requirement: "50% Foundation Completed",
- effectDisplay: "Trees give twice as many logs"
- },
- shouldEarn: () => Decimal.gte(foundationProgress.value, 50),
- visibility: () => showIf(autoPlantMilestone2.earned.value),
- showPopups: shouldShowPopups
- }));
- const morePlantsMilestone1 = createMilestone(() => ({
- display: {
- requirement: "75% Foundation Completed",
- effectDisplay: "The forest gains an extra tree for every 2% of foundation completed"
- },
- shouldEarn: () => Decimal.gte(foundationProgress.value, 75),
- visibility: () => showIf(logGainMilestone2.earned.value),
- showPopups: shouldShowPopups
- }));
- const logGainMilestone3 = createMilestone(() => ({
- display: {
- requirement: "100% Foundation Completed",
- effectDisplay: "Log per tree is raised to the 1.2th power"
- },
- shouldEarn: () => Decimal.gte(foundationProgress.value, 100),
- visibility: () => showIf(morePlantsMilestone1.earned.value),
- showPopups: shouldShowPopups
- }));
- const extraExpansionMilestone1 = createMilestone(() => ({
- display: {
- requirement: "200% Foundation Completed",
- effectDisplay: "The 1% milestone is now +2% and multiplicative"
- },
- shouldEarn: () => Decimal.gte(foundationProgress.value, 200),
- visibility: () =>
- showIf(
- logGainMilestone3.earned.value &&
- management.elfTraining.expandersElfTraining.milestones[2].earned.value
- ),
- showPopups: shouldShowPopups
- }));
- const extraExpansionMilestone2 = createMilestone(() => ({
- display: {
- requirement: "400% Foundation Completed",
- effectDisplay: "Gain +10% metal for every 10% foundation completed"
- },
- shouldEarn: () => Decimal.gte(foundationProgress.value, 400),
- visibility: () =>
- showIf(
- extraExpansionMilestone1.earned.value &&
- management.elfTraining.expandersElfTraining.milestones[2].earned.value
- ),
- showPopups: shouldShowPopups
- }));
- const extraExpansionMilestone3 = createMilestone(() => ({
- display: {
- requirement: "600% Foundation Completed",
- effectDisplay: "Gain +10% oil for every 10% foundation completed"
- },
- shouldEarn: () => Decimal.gte(foundationProgress.value, 600),
- visibility: () =>
- showIf(
- extraExpansionMilestone2.earned.value &&
- management.elfTraining.expandersElfTraining.milestones[2].earned.value
- ),
- showPopups: shouldShowPopups
- }));
- const extraExpansionMilestone4 = createMilestone(() => ({
- display: {
- requirement: "800% Foundation Completed",
- effectDisplay: "Gain +10% plastic for every 10% foundation completed"
- },
- shouldEarn: () => Decimal.gte(foundationProgress.value, 800),
- visibility: () =>
- showIf(
- extraExpansionMilestone3.earned.value &&
- management.elfTraining.expandersElfTraining.milestones[2].earned.value
- ),
- showPopups: shouldShowPopups
- }));
- const extraExpansionMilestone5 = createMilestone(() => ({
- display: {
- requirement: "1000% Foundation Completed",
- effectDisplay: "Double paper, boxes, and all cloth actions"
- },
- shouldEarn: () => Decimal.gte(foundationProgress.value, 1000),
- visibility: () =>
- showIf(
- extraExpansionMilestone4.earned.value &&
- management.elfTraining.expandersElfTraining.milestones[2].earned.value
- ),
- showPopups: shouldShowPopups
- }));
- const milestones = {
- logGainMilestone1,
- autoCutMilestone1,
- autoPlantMilestone1,
- autoCutMilestone2,
- autoPlantMilestone2,
- logGainMilestone2,
- morePlantsMilestone1,
- logGainMilestone3,
- extraExpansionMilestone1,
- extraExpansionMilestone2,
- extraExpansionMilestone3,
- extraExpansionMilestone4,
- extraExpansionMilestone5
- };
- const { collapseMilestones, display: milestonesDisplay } =
- createCollapsibleMilestones(milestones);
- return {
- foundationProgress,
- foundationConversion,
- milestones,
- collapseMilestones,
- milestonesDisplay,
- logGainMilestone1,
- autoCutMilestone1,
- autoPlantMilestone1,
- autoCutMilestone2,
- autoPlantMilestone2,
- logGainMilestone2,
- morePlantsMilestone1,
- logGainMilestone3,
- extraExpansionMilestone1,
- extraExpansionMilestone2,
- extraExpansionMilestone3,
- extraExpansionMilestone4,
- extraExpansionMilestone5
- };
- })();
+ const mastery = {
+ foundationProgress: persistent(0),
+ milestones: {
+ logGainMilestone1: { earned: persistent(false) },
+ autoCutMilestone1: { earned: persistent(false) },
+ autoPlantMilestone1: { earned: persistent(false) },
+ autoCutMilestone2: { earned: persistent(false) },
+ autoPlantMilestone2: { earned: persistent(false) },
+ logGainMilestone2: { earned: persistent(false) },
+ morePlantsMilestone1: { earned: persistent(false) },
+ logGainMilestone3: { earned: persistent(false) },
+ extraExpansionMilestone1: { earned: persistent(false) },
+ extraExpansionMilestone2: { earned: persistent(false) },
+ extraExpansionMilestone3: { earned: persistent(false) },
+ extraExpansionMilestone4: { earned: persistent(false) },
+ extraExpansionMilestone5: { earned: persistent(false) },
+ }
+ };
+ function swapMastery() {
+ [foundationProgress.value, mastery.foundationProgress.value] = [mastery.foundationProgress.value, foundationProgress.value];
+ [milestones.logGainMilestone1.earned.value, mastery.milestones.logGainMilestone1.earned.value] = [mastery.milestones.logGainMilestone1.earned.value, milestones.logGainMilestone1.earned.value];
+ [milestones.autoCutMilestone1.earned.value, mastery.milestones.autoCutMilestone1.earned.value] = [mastery.milestones.autoCutMilestone1.earned.value, milestones.autoCutMilestone1.earned.value];
+ [milestones.autoPlantMilestone1.earned.value, mastery.milestones.autoPlantMilestone1.earned.value] = [mastery.milestones.autoPlantMilestone1.earned.value, milestones.autoPlantMilestone1.earned.value];
+ [milestones.autoCutMilestone2.earned.value, mastery.milestones.autoCutMilestone2.earned.value] = [mastery.milestones.autoCutMilestone2.earned.value, milestones.autoCutMilestone2.earned.value];
+ [milestones.autoPlantMilestone2.earned.value, mastery.milestones.autoPlantMilestone2.earned.value] = [mastery.milestones.autoPlantMilestone2.earned.value, milestones.autoPlantMilestone2.earned.value];
+ [milestones.logGainMilestone2.earned.value, mastery.milestones.logGainMilestone2.earned.value] = [mastery.milestones.logGainMilestone2.earned.value, milestones.logGainMilestone2.earned.value];
+ [milestones.morePlantsMilestone1.earned.value, mastery.milestones.morePlantsMilestone1.earned.value] = [mastery.milestones.morePlantsMilestone1.earned.value, milestones.morePlantsMilestone1.earned.value];
+ [milestones.logGainMilestone3.earned.value, mastery.milestones.logGainMilestone3.earned.value] = [mastery.milestones.logGainMilestone3.earned.value, milestones.logGainMilestone3.earned.value];
+ [milestones.extraExpansionMilestone1.earned.value, mastery.milestones.extraExpansionMilestone1.earned.value] = [mastery.milestones.extraExpansionMilestone1.earned.value, milestones.extraExpansionMilestone1.earned.value];
+ [milestones.extraExpansionMilestone2.earned.value, mastery.milestones.extraExpansionMilestone2.earned.value] = [mastery.milestones.extraExpansionMilestone2.earned.value, milestones.extraExpansionMilestone2.earned.value];
+ [milestones.extraExpansionMilestone3.earned.value, mastery.milestones.extraExpansionMilestone3.earned.value] = [mastery.milestones.extraExpansionMilestone3.earned.value, milestones.extraExpansionMilestone3.earned.value];
+ [milestones.extraExpansionMilestone4.earned.value, mastery.milestones.extraExpansionMilestone4.earned.value] = [mastery.milestones.extraExpansionMilestone4.earned.value, milestones.extraExpansionMilestone4.earned.value];
+ [milestones.extraExpansionMilestone5.earned.value, mastery.milestones.extraExpansionMilestone5.earned.value] = [mastery.milestones.extraExpansionMilestone5.earned.value, milestones.extraExpansionMilestone5.earned.value];
+ }
+ const mastered = persistent(false);
return {
name,
@@ -555,8 +361,6 @@ const layer = createLayer(id, function (this: BaseLayer) {
collapseMilestones,
minWidth: 700,
buildFoundationHK,
- mastery,
- mastered,
display: jsx(() => (
<>
@@ -569,11 +373,7 @@ const layer = createLayer(id, function (this: BaseLayer) {
The foundation is
- {formatWhole(
- main.isMastery.value
- ? mastery.foundationProgress.value
- : foundationProgress.value
- )}
+ {formatWhole(foundationProgress.value)}
% completed
@@ -583,14 +383,13 @@ const layer = createLayer(id, function (this: BaseLayer) {
) : null}
{render(buildFoundation)}
- {(main.isMastery.value ? mastery.milestonesDisplay : milestonesDisplay)()}
+ {milestonesDisplay()}
>
)),
- minimizedDisplay: jsx(() => (
-
- {name} - {format(foundationProgress.value)}% {foundationProgress.displayName}
-
- ))
+ minimizedDisplay: jsx(() => (
{name} - {format(foundationProgress.value)}% {foundationProgress.displayName}
)),
+ mastery,
+ swapMastery,
+ mastered
};
});
diff --git a/src/data/projEntry.tsx b/src/data/projEntry.tsx
index 116e20d..b81029a 100644
--- a/src/data/projEntry.tsx
+++ b/src/data/projEntry.tsx
@@ -7,7 +7,7 @@ import {
jsx
} from "features/feature";
import { BaseLayer, createLayer, GenericLayer, layers } from "game/layers";
-import { persistent } from "game/persistence";
+import { Persistent, persistent } from "game/persistence";
import type { LayerData, PlayerData } from "game/player";
import player from "game/player";
import Decimal, { format, formatTime } from "util/bignum";
@@ -49,7 +49,6 @@ import dyes from "./layers/dyes";
import letters from "./layers/letters";
import management from "./layers/management";
import wrappingPaper from "./layers/wrapping-paper";
-import { createReset } from "features/reset";
export interface Day extends VueFeature {
day: number;
@@ -62,20 +61,6 @@ export interface Day extends VueFeature {
shouldNotify: ProcessedComputable
;
}
-const masterableLayers = [
- trees,
- workshop,
- coal,
- elves,
- paper,
- boxes,
- metal,
- cloth,
- oil,
- plastic,
- dyes
-];
-
export const main = createLayer("main", function (this: BaseLayer) {
const day = persistent(1);
const timeUntilNewDay = computed(
@@ -87,9 +72,29 @@ export const main = createLayer("main", function (this: BaseLayer) {
const loreTitle = ref("");
const loreBody = ref();
+ const swappingMastery = ref(false);
const isMastery = persistent(false);
const toggleMastery = () => {
+ swappingMastery.value = true;
isMastery.value = !isMastery.value;
+
+ for (const layer of [
+ trees,
+ workshop,
+ coal,
+ // elves,
+ // paper,
+ // boxes,
+ // metal,
+ // cloth,
+ // oil,
+ // plastic,
+ // dyes,
+ // management,
+ // letters
+ ]) { layer.swapMastery() }
+
+ swappingMastery.value = false;
};
function createDay(
@@ -420,6 +425,7 @@ export const main = createLayer("main", function (this: BaseLayer) {
minWidth: 700,
isMastery,
toggleMastery,
+ swappingMastery,
display: jsx(() => (
<>
{player.devSpeed === 0 ? Game Paused
: null}
diff --git a/src/features/resources/resource.ts b/src/features/resources/resource.ts
index be42e7e..11740b3 100644
--- a/src/features/resources/resource.ts
+++ b/src/features/resources/resource.ts
@@ -1,3 +1,4 @@
+import { main } from "data/projEntry";
import { globalBus } from "game/events";
import { NonPersistent, Persistent, State } from "game/persistence";
import { persistent } from "game/persistence";
@@ -67,7 +68,7 @@ export function trackBest(resource: Resource): Ref {
export function trackTotal(resource: Resource): Ref {
const total = persistent(resource.value);
watch(resource, (amount, prevAmount) => {
- if (loadingSave.value) {
+ if (loadingSave.value || main.swappingMastery.value) {
return;
}
if (Decimal.gt(amount, prevAmount)) {
From 95fed061169fd12268679b8c229866d14e40dc6b Mon Sep 17 00:00:00 2001
From: Seth Posner
Date: Fri, 16 Dec 2022 15:46:26 -0800
Subject: [PATCH 028/124] Add elf mastery data
---
src/data/layers/elves.tsx | 191 +++++++++++++++++++++++++++++++++++++-
src/data/projEntry.tsx | 2 +-
2 files changed, 189 insertions(+), 4 deletions(-)
diff --git a/src/data/layers/elves.tsx b/src/data/layers/elves.tsx
index 610c320..509e587 100644
--- a/src/data/layers/elves.tsx
+++ b/src/data/layers/elves.tsx
@@ -588,7 +588,7 @@ const layer = createLayer(id, function (this: BaseLayer) {
} & Partial
) {
const buyProgress = persistent(0);
- const amountOfTimesDone = persistent(0);
+ const amountOfTimesDone = persistent(0);
const toggle = options.hasToggle ? persistent(false) : ref(true);
const computedAutoBuyCooldown = computed(() => options.cooldownModifier.apply(10));
@@ -684,7 +684,7 @@ const layer = createLayer(id, function (this: BaseLayer) {
}
};
}) as GenericUpgrade & {
- buyProgress: Ref;
+ buyProgress: Ref;
update: (diff: number) => void;
toggle: Ref;
name: string;
@@ -1079,6 +1079,188 @@ const layer = createLayer(id, function (this: BaseLayer) {
}
});
+ const mastery = {
+ elves: {
+ cuttersElf: {
+ buyProgress: persistent(0),
+ amountOfTimesDone: persistent(0),
+ bought: persistent(false)
+ },
+ plantersElf: {
+ buyProgress: persistent(0),
+ amountOfTimesDone: persistent(0),
+ bought: persistent(false)
+ },
+ expandersElf: {
+ buyProgress: persistent(0),
+ amountOfTimesDone: persistent(0),
+ bought: persistent(false)
+ },
+ heatedCuttersElf: {
+ buyProgress: persistent(0),
+ amountOfTimesDone: persistent(0),
+ bought: persistent(false)
+ },
+ heatedPlantersElf: {
+ buyProgress: persistent(0),
+ amountOfTimesDone: persistent(0),
+ bought: persistent(false)
+ },
+ fertilizerElf: {
+ buyProgress: persistent(0),
+ amountOfTimesDone: persistent(0),
+ bought: persistent(false)
+ },
+ smallFireElf: {
+ buyProgress: persistent(0),
+ amountOfTimesDone: persistent(0),
+ toggle: persistent(false),
+ bought: persistent(false)
+ },
+ bonfireElf: {
+ buyProgress: persistent(0),
+ amountOfTimesDone: persistent(0),
+ toggle: persistent(false),
+ bought: persistent(false)
+ },
+ kilnElf: {
+ buyProgress: persistent(0),
+ amountOfTimesDone: persistent(0),
+ toggle: persistent(false),
+ bought: persistent(false)
+ },
+ paperElf: {
+ buyProgress: persistent(0),
+ amountOfTimesDone: persistent(0),
+ bought: persistent(false)
+ },
+ boxElf: {
+ buyProgress: persistent(0),
+ amountOfTimesDone: persistent(0),
+ bought: persistent(false)
+ },
+ clothElf: {
+ buyProgress: persistent(0),
+ amountOfTimesDone: persistent(0),
+ bought: persistent(false)
+ },
+ coalDrillElf: {
+ buyProgress: persistent(0),
+ amountOfTimesDone: persistent(0),
+ toggle: persistent(false),
+ bought: persistent(false)
+ },
+ heavyDrillElf: {
+ buyProgress: persistent(0),
+ amountOfTimesDone: persistent(0),
+ toggle: persistent(false),
+ bought: persistent(false)
+ },
+ oilElf: {
+ buyProgress: persistent(0),
+ amountOfTimesDone: persistent(0),
+ toggle: persistent(false),
+ bought: persistent(false)
+ },
+ metalElf: {
+ buyProgress: persistent(0),
+ amountOfTimesDone: persistent(0),
+ bought: persistent(false)
+ },
+ dyeElf: {
+ buyProgress: persistent(0),
+ amountOfTimesDone: persistent(0),
+ bought: persistent(false)
+ }
+ },
+ milestones: [
+ { earned: persistent(false) },
+ { earned: persistent(false) },
+ { earned: persistent(false) },
+ { earned: persistent(false) },
+ { earned: persistent(false) },
+ { earned: persistent(false) },
+ { earned: persistent(false) },
+ { earned: persistent(false) },
+ { earned: persistent(false) },
+ { earned: persistent(false) },
+ { earned: persistent(false) },
+ { earned: persistent(false) },
+ ]
+ };
+ function swapMastery() {
+ [elves.cuttersElf.buyProgress.value, mastery.elves.cuttersElf.buyProgress.value] = [mastery.elves.cuttersElf.buyProgress.value, elves.cuttersElf.buyProgress.value];
+ [elves.cuttersElf.amountOfTimesDone.value, mastery.elves.cuttersElf.amountOfTimesDone.value] = [mastery.elves.cuttersElf.amountOfTimesDone.value, elves.cuttersElf.amountOfTimesDone.value];
+ [elves.cuttersElf.bought.value, mastery.elves.cuttersElf.bought.value] = [mastery.elves.cuttersElf.bought.value, elves.cuttersElf.bought.value];
+ [elves.plantersElf.buyProgress.value, mastery.elves.plantersElf.buyProgress.value] = [mastery.elves.plantersElf.buyProgress.value, elves.plantersElf.buyProgress.value];
+ [elves.plantersElf.amountOfTimesDone.value, mastery.elves.plantersElf.amountOfTimesDone.value] = [mastery.elves.plantersElf.amountOfTimesDone.value, elves.plantersElf.amountOfTimesDone.value];
+ [elves.plantersElf.bought.value, mastery.elves.plantersElf.bought.value] = [mastery.elves.plantersElf.bought.value, elves.plantersElf.bought.value];
+ [elves.expandersElf.buyProgress.value, mastery.elves.expandersElf.buyProgress.value] = [mastery.elves.expandersElf.buyProgress.value, elves.expandersElf.buyProgress.value];
+ [elves.expandersElf.amountOfTimesDone.value, mastery.elves.expandersElf.amountOfTimesDone.value] = [mastery.elves.expandersElf.amountOfTimesDone.value, elves.expandersElf.amountOfTimesDone.value];
+ [elves.expandersElf.bought.value, mastery.elves.expandersElf.bought.value] = [mastery.elves.expandersElf.bought.value, elves.expandersElf.bought.value];
+ [elves.heatedCuttersElf.buyProgress.value, mastery.elves.heatedCuttersElf.buyProgress.value] = [mastery.elves.heatedCuttersElf.buyProgress.value, elves.heatedCuttersElf.buyProgress.value];
+ [elves.heatedCuttersElf.amountOfTimesDone.value, mastery.elves.heatedCuttersElf.amountOfTimesDone.value] = [mastery.elves.heatedCuttersElf.amountOfTimesDone.value, elves.heatedCuttersElf.amountOfTimesDone.value];
+ [elves.heatedCuttersElf.bought.value, mastery.elves.heatedCuttersElf.bought.value] = [mastery.elves.heatedCuttersElf.bought.value, elves.heatedCuttersElf.bought.value];
+ [elves.heatedPlantersElf.buyProgress.value, mastery.elves.heatedPlantersElf.buyProgress.value] = [mastery.elves.heatedPlantersElf.buyProgress.value, elves.heatedPlantersElf.buyProgress.value];
+ [elves.heatedPlantersElf.amountOfTimesDone.value, mastery.elves.heatedPlantersElf.amountOfTimesDone.value] = [mastery.elves.heatedPlantersElf.amountOfTimesDone.value, elves.heatedPlantersElf.amountOfTimesDone.value];
+ [elves.heatedPlantersElf.bought.value, mastery.elves.heatedPlantersElf.bought.value] = [mastery.elves.heatedPlantersElf.bought.value, elves.heatedPlantersElf.bought.value];
+ [elves.fertilizerElf.buyProgress.value, mastery.elves.fertilizerElf.buyProgress.value] = [mastery.elves.fertilizerElf.buyProgress.value, elves.fertilizerElf.buyProgress.value];
+ [elves.fertilizerElf.amountOfTimesDone.value, mastery.elves.fertilizerElf.amountOfTimesDone.value] = [mastery.elves.fertilizerElf.amountOfTimesDone.value, elves.fertilizerElf.amountOfTimesDone.value];
+ [elves.fertilizerElf.bought.value, mastery.elves.fertilizerElf.bought.value] = [mastery.elves.fertilizerElf.bought.value, elves.fertilizerElf.bought.value];
+ [elves.smallFireElf.buyProgress.value, mastery.elves.smallFireElf.buyProgress.value] = [mastery.elves.smallFireElf.buyProgress.value, elves.smallFireElf.buyProgress.value];
+ [elves.smallFireElf.amountOfTimesDone.value, mastery.elves.smallFireElf.amountOfTimesDone.value] = [mastery.elves.smallFireElf.amountOfTimesDone.value, elves.smallFireElf.amountOfTimesDone.value];
+ [elves.smallFireElf.toggle.value, mastery.elves.smallFireElf.toggle.value] = [mastery.elves.smallFireElf.toggle.value, elves.smallFireElf.toggle.value];
+ [elves.smallFireElf.bought.value, mastery.elves.smallFireElf.bought.value] = [mastery.elves.smallFireElf.bought.value, elves.smallFireElf.bought.value];
+ [elves.bonfireElf.buyProgress.value, mastery.elves.bonfireElf.buyProgress.value] = [mastery.elves.bonfireElf.buyProgress.value, elves.bonfireElf.buyProgress.value];
+ [elves.bonfireElf.amountOfTimesDone.value, mastery.elves.bonfireElf.amountOfTimesDone.value] = [mastery.elves.bonfireElf.amountOfTimesDone.value, elves.bonfireElf.amountOfTimesDone.value];
+ [elves.bonfireElf.toggle.value, mastery.elves.bonfireElf.toggle.value] = [mastery.elves.bonfireElf.toggle.value, elves.bonfireElf.toggle.value];
+ [elves.bonfireElf.bought.value, mastery.elves.bonfireElf.bought.value] = [mastery.elves.bonfireElf.bought.value, elves.bonfireElf.bought.value];
+ [elves.kilnElf.buyProgress.value, mastery.elves.kilnElf.buyProgress.value] = [mastery.elves.kilnElf.buyProgress.value, elves.kilnElf.buyProgress.value];
+ [elves.kilnElf.amountOfTimesDone.value, mastery.elves.kilnElf.amountOfTimesDone.value] = [mastery.elves.kilnElf.amountOfTimesDone.value, elves.kilnElf.amountOfTimesDone.value];
+ [elves.kilnElf.toggle.value, mastery.elves.kilnElf.toggle.value] = [mastery.elves.kilnElf.toggle.value, elves.kilnElf.toggle.value];
+ [elves.kilnElf.bought.value, mastery.elves.kilnElf.bought.value] = [mastery.elves.kilnElf.bought.value, elves.kilnElf.bought.value];
+ [elves.paperElf.buyProgress.value, mastery.elves.paperElf.buyProgress.value] = [mastery.elves.paperElf.buyProgress.value, elves.paperElf.buyProgress.value];
+ [elves.paperElf.amountOfTimesDone.value, mastery.elves.paperElf.amountOfTimesDone.value] = [mastery.elves.paperElf.amountOfTimesDone.value, elves.paperElf.amountOfTimesDone.value];
+ [elves.paperElf.bought.value, mastery.elves.paperElf.bought.value] = [mastery.elves.paperElf.bought.value, elves.paperElf.bought.value];
+ [elves.boxElf.buyProgress.value, mastery.elves.boxElf.buyProgress.value] = [mastery.elves.boxElf.buyProgress.value, elves.boxElf.buyProgress.value];
+ [elves.boxElf.amountOfTimesDone.value, mastery.elves.boxElf.amountOfTimesDone.value] = [mastery.elves.boxElf.amountOfTimesDone.value, elves.boxElf.amountOfTimesDone.value];
+ [elves.boxElf.bought.value, mastery.elves.boxElf.bought.value] = [mastery.elves.boxElf.bought.value, elves.boxElf.bought.value];
+ [elves.clothElf.buyProgress.value, mastery.elves.clothElf.buyProgress.value] = [mastery.elves.clothElf.buyProgress.value, elves.clothElf.buyProgress.value];
+ [elves.clothElf.amountOfTimesDone.value, mastery.elves.clothElf.amountOfTimesDone.value] = [mastery.elves.clothElf.amountOfTimesDone.value, elves.clothElf.amountOfTimesDone.value];
+ [elves.clothElf.bought.value, mastery.elves.clothElf.bought.value] = [mastery.elves.clothElf.bought.value, elves.clothElf.bought.value];
+ [elves.coalDrillElf.buyProgress.value, mastery.elves.coalDrillElf.buyProgress.value] = [mastery.elves.coalDrillElf.buyProgress.value, elves.coalDrillElf.buyProgress.value];
+ [elves.coalDrillElf.amountOfTimesDone.value, mastery.elves.coalDrillElf.amountOfTimesDone.value] = [mastery.elves.coalDrillElf.amountOfTimesDone.value, elves.coalDrillElf.amountOfTimesDone.value];
+ [elves.coalDrillElf.toggle.value, mastery.elves.coalDrillElf.toggle.value] = [mastery.elves.coalDrillElf.toggle.value, elves.coalDrillElf.toggle.value];
+ [elves.coalDrillElf.bought.value, mastery.elves.coalDrillElf.bought.value] = [mastery.elves.coalDrillElf.bought.value, elves.coalDrillElf.bought.value];
+ [elves.heavyDrillElf.buyProgress.value, mastery.elves.heavyDrillElf.buyProgress.value] = [mastery.elves.heavyDrillElf.buyProgress.value, elves.heavyDrillElf.buyProgress.value];
+ [elves.heavyDrillElf.amountOfTimesDone.value, mastery.elves.heavyDrillElf.amountOfTimesDone.value] = [mastery.elves.heavyDrillElf.amountOfTimesDone.value, elves.heavyDrillElf.amountOfTimesDone.value];
+ [elves.heavyDrillElf.toggle.value, mastery.elves.heavyDrillElf.toggle.value] = [mastery.elves.heavyDrillElf.toggle.value, elves.heavyDrillElf.toggle.value];
+ [elves.heavyDrillElf.bought.value, mastery.elves.heavyDrillElf.bought.value] = [mastery.elves.heavyDrillElf.bought.value, elves.heavyDrillElf.bought.value];
+ [elves.oilElf.buyProgress.value, mastery.elves.oilElf.buyProgress.value] = [mastery.elves.oilElf.buyProgress.value, elves.oilElf.buyProgress.value];
+ [elves.oilElf.amountOfTimesDone.value, mastery.elves.oilElf.amountOfTimesDone.value] = [mastery.elves.oilElf.amountOfTimesDone.value, elves.oilElf.amountOfTimesDone.value];
+ [elves.oilElf.toggle.value, mastery.elves.oilElf.toggle.value] = [mastery.elves.oilElf.toggle.value, elves.oilElf.toggle.value];
+ [elves.oilElf.bought.value, mastery.elves.oilElf.bought.value] = [mastery.elves.oilElf.bought.value, elves.oilElf.bought.value];
+ [elves.metalElf.buyProgress.value, mastery.elves.metalElf.buyProgress.value] = [mastery.elves.metalElf.buyProgress.value, elves.metalElf.buyProgress.value];
+ [elves.metalElf.amountOfTimesDone.value, mastery.elves.metalElf.amountOfTimesDone.value] = [mastery.elves.metalElf.amountOfTimesDone.value, elves.metalElf.amountOfTimesDone.value];
+ [elves.metalElf.bought.value, mastery.elves.metalElf.bought.value] = [mastery.elves.metalElf.bought.value, elves.metalElf.bought.value];
+ [elves.dyeElf.buyProgress.value, mastery.elves.dyeElf.buyProgress.value] = [mastery.elves.dyeElf.buyProgress.value, elves.dyeElf.buyProgress.value];
+ [elves.dyeElf.amountOfTimesDone.value, mastery.elves.dyeElf.amountOfTimesDone.value] = [mastery.elves.dyeElf.amountOfTimesDone.value, elves.dyeElf.amountOfTimesDone.value];
+ [elves.dyeElf.bought.value, mastery.elves.dyeElf.bought.value] = [mastery.elves.dyeElf.bought.value, elves.dyeElf.bought.value];
+ [milestones[0].earned.value, mastery.milestones[0].earned.value] = [mastery.milestones[0].earned.value, milestones[0].earned.value];
+ [milestones[1].earned.value, mastery.milestones[1].earned.value] = [mastery.milestones[1].earned.value, milestones[1].earned.value];
+ [milestones[2].earned.value, mastery.milestones[2].earned.value] = [mastery.milestones[2].earned.value, milestones[2].earned.value];
+ [milestones[3].earned.value, mastery.milestones[3].earned.value] = [mastery.milestones[3].earned.value, milestones[3].earned.value];
+ [milestones[4].earned.value, mastery.milestones[4].earned.value] = [mastery.milestones[4].earned.value, milestones[4].earned.value];
+ [milestones[5].earned.value, mastery.milestones[5].earned.value] = [mastery.milestones[5].earned.value, milestones[5].earned.value];
+ [milestones[6].earned.value, mastery.milestones[6].earned.value] = [mastery.milestones[6].earned.value, milestones[6].earned.value];
+ [milestones[7].earned.value, mastery.milestones[7].earned.value] = [mastery.milestones[7].earned.value, milestones[7].earned.value];
+ [milestones[8].earned.value, mastery.milestones[8].earned.value] = [mastery.milestones[8].earned.value, milestones[8].earned.value];
+ [milestones[9].earned.value, mastery.milestones[9].earned.value] = [mastery.milestones[9].earned.value, milestones[9].earned.value];
+ [milestones[10].earned.value, mastery.milestones[10].earned.value] = [mastery.milestones[10].earned.value, milestones[10].earned.value];
+ [milestones[11].earned.value, mastery.milestones[11].earned.value] = [mastery.milestones[11].earned.value, milestones[11].earned.value];
+ };
+ const mastered = persistent(false);
+
return {
name,
color: colorBright,
@@ -1120,7 +1302,10 @@ const layer = createLayer(id, function (this: BaseLayer) {
{milestonesDisplay()}
>
- ))
+ )),
+ mastery,
+ swapMastery,
+ mastered
};
});
diff --git a/src/data/projEntry.tsx b/src/data/projEntry.tsx
index b81029a..39acb87 100644
--- a/src/data/projEntry.tsx
+++ b/src/data/projEntry.tsx
@@ -82,7 +82,7 @@ export const main = createLayer("main", function (this: BaseLayer) {
trees,
workshop,
coal,
- // elves,
+ elves,
// paper,
// boxes,
// metal,
From ed2c8d08b1975c6cafac14ab4f010179efd7a0c4 Mon Sep 17 00:00:00 2001
From: Seth Posner
Date: Fri, 16 Dec 2022 15:57:27 -0800
Subject: [PATCH 029/124] Add paper mastery data
---
src/data/layers/paper.tsx | 73 +++++++++++++++++++++++++++++++++++----
src/data/projEntry.tsx | 2 +-
2 files changed, 68 insertions(+), 7 deletions(-)
diff --git a/src/data/layers/paper.tsx b/src/data/layers/paper.tsx
index afd355b..f1299d9 100644
--- a/src/data/layers/paper.tsx
+++ b/src/data/layers/paper.tsx
@@ -16,7 +16,7 @@ import { createUpgrade, GenericUpgrade } from "features/upgrades/upgrade";
import { globalBus } from "game/events";
import { BaseLayer, createLayer } from "game/layers";
import { createMultiplicativeModifier, createSequentialModifier, Modifier } from "game/modifiers";
-import { noPersist } from "game/persistence";
+import { noPersist, persistent } from "game/persistence";
import Decimal, { DecimalSource, format, formatSmall, formatWhole } from "util/bignum";
import { WithRequired } from "util/common";
import { render, renderCol, renderGrid } from "util/vue";
@@ -466,6 +466,68 @@ const layer = createLayer(id, function (this: BaseLayer) {
}
});
+ const mastery = {
+ paper: persistent(0),
+ totalPaper: persistent(0),
+ books: {
+ cuttersBook: { amount: persistent(0) },
+ plantersBook: { amount: persistent(0) },
+ expandersBook: { amount: persistent(0) },
+ heatedCuttersBook: { amount: persistent(0) },
+ heatedPlantersBook: { amount: persistent(0) },
+ fertilizerBook: { amount: persistent(0) },
+ smallFireBook: { amount: persistent(0) },
+ bonfireBook: { amount: persistent(0) },
+ kilnBook: { amount: persistent(0) },
+ paperBook: { amount: persistent(0) },
+ boxBook: { amount: persistent(0) },
+ clothBook: { amount: persistent(0) },
+ coalDrillBook: { amount: persistent(0) },
+ heavyDrillBook: { amount: persistent(0) },
+ oilBook: { amount: persistent(0) },
+ metalBook: { amount: persistent(0) },
+ dyeBook: { amount: persistent(0) }
+ },
+ upgrades: {
+ clothUpgrade: { bought: persistent(false) },
+ drillingUpgrade: { bought: persistent(false) },
+ oilUpgrade: { bought: persistent(false) }
+ },
+ upgrades2: {
+ ashUpgrade: { bought: persistent(false) },
+ bookUpgrade: { bought: persistent(false) },
+ treeUpgrade: { bought: persistent(false) }
+ }
+ };
+ function swapMastery() {
+ [paper.value, mastery.paper.value] = [mastery.paper.value, paper.value];
+ [totalPaper.value, mastery.totalPaper.value] = [mastery.totalPaper.value, totalPaper.value];
+ [books.cuttersBook.amount.value, mastery.books.cuttersBook.amount.value] = [mastery.books.cuttersBook.amount.value, books.cuttersBook.amount.value];
+ [books.plantersBook.amount.value, mastery.books.plantersBook.amount.value] = [mastery.books.plantersBook.amount.value, books.plantersBook.amount.value];
+ [books.expandersBook.amount.value, mastery.books.expandersBook.amount.value] = [mastery.books.expandersBook.amount.value, books.expandersBook.amount.value];
+ [books.heatedCuttersBook.amount.value, mastery.books.heatedCuttersBook.amount.value] = [mastery.books.heatedCuttersBook.amount.value, books.heatedCuttersBook.amount.value];
+ [books.heatedPlantersBook.amount.value, mastery.books.heatedPlantersBook.amount.value] = [mastery.books.heatedPlantersBook.amount.value, books.heatedPlantersBook.amount.value];
+ [books.fertilizerBook.amount.value, mastery.books.fertilizerBook.amount.value] = [mastery.books.fertilizerBook.amount.value, books.fertilizerBook.amount.value];
+ [books.smallFireBook.amount.value, mastery.books.smallFireBook.amount.value] = [mastery.books.smallFireBook.amount.value, books.smallFireBook.amount.value];
+ [books.bonfireBook.amount.value, mastery.books.bonfireBook.amount.value] = [mastery.books.bonfireBook.amount.value, books.bonfireBook.amount.value];
+ [books.kilnBook.amount.value, mastery.books.kilnBook.amount.value] = [mastery.books.kilnBook.amount.value, books.kilnBook.amount.value];
+ [books.paperBook.amount.value, mastery.books.paperBook.amount.value] = [mastery.books.paperBook.amount.value, books.paperBook.amount.value];
+ [books.boxBook.amount.value, mastery.books.boxBook.amount.value] = [mastery.books.boxBook.amount.value, books.boxBook.amount.value];
+ [books.clothBook.amount.value, mastery.books.clothBook.amount.value] = [mastery.books.clothBook.amount.value, books.clothBook.amount.value];
+ [books.coalDrillBook.amount.value, mastery.books.coalDrillBook.amount.value] = [mastery.books.coalDrillBook.amount.value, books.coalDrillBook.amount.value];
+ [books.heavyDrillBook.amount.value, mastery.books.heavyDrillBook.amount.value] = [mastery.books.heavyDrillBook.amount.value, books.heavyDrillBook.amount.value];
+ [books.oilBook.amount.value, mastery.books.oilBook.amount.value] = [mastery.books.oilBook.amount.value, books.oilBook.amount.value];
+ [books.metalBook.amount.value, mastery.books.metalBook.amount.value] = [mastery.books.metalBook.amount.value, books.metalBook.amount.value];
+ [books.dyeBook.amount.value, mastery.books.dyeBook.amount.value] = [mastery.books.dyeBook.amount.value, books.dyeBook.amount.value];
+ [upgrades.clothUpgrade.bought.value, mastery.upgrades.clothUpgrade.bought.value] = [mastery.upgrades.clothUpgrade.bought.value, upgrades.clothUpgrade.bought.value];
+ [upgrades.drillingUpgrade.bought.value, mastery.upgrades.drillingUpgrade.bought.value] = [mastery.upgrades.drillingUpgrade.bought.value, upgrades.drillingUpgrade.bought.value];
+ [upgrades.oilUpgrade.bought.value, mastery.upgrades.oilUpgrade.bought.value] = [mastery.upgrades.oilUpgrade.bought.value, upgrades.oilUpgrade.bought.value];
+ [upgrades2.ashUpgrade.bought.value, mastery.upgrades2.ashUpgrade.bought.value] = [mastery.upgrades2.ashUpgrade.bought.value, upgrades2.ashUpgrade.bought.value];
+ [upgrades2.bookUpgrade.bought.value, mastery.upgrades2.bookUpgrade.bought.value] = [mastery.upgrades2.bookUpgrade.bought.value, upgrades2.bookUpgrade.bought.value];
+ [upgrades2.treeUpgrade.bought.value, mastery.upgrades2.treeUpgrade.bought.value] = [mastery.upgrades2.treeUpgrade.bought.value, upgrades2.treeUpgrade.bought.value];
+ };
+ const mastered = persistent(false);
+
return {
name,
day,
@@ -491,11 +553,10 @@ const layer = createLayer(id, function (this: BaseLayer) {
{renderCol(...Object.values(books))}
>
)),
- minimizedDisplay: jsx(() => (
-
- {name} - {format(paper.value)} {paper.displayName}
-
- ))
+ minimizedDisplay: jsx(() => ({name} - {format(paper.value)} {paper.displayName}
)),
+ mastery,
+ swapMastery,
+ mastered
};
});
diff --git a/src/data/projEntry.tsx b/src/data/projEntry.tsx
index 39acb87..978ff88 100644
--- a/src/data/projEntry.tsx
+++ b/src/data/projEntry.tsx
@@ -83,7 +83,7 @@ export const main = createLayer("main", function (this: BaseLayer) {
workshop,
coal,
elves,
- // paper,
+ paper,
// boxes,
// metal,
// cloth,
From 9e68dab91490e77f1e88da3b921ce13311d6d2c8 Mon Sep 17 00:00:00 2001
From: Seth Posner
Date: Fri, 16 Dec 2022 16:15:46 -0800
Subject: [PATCH 030/124] Make better mastery data swap method
---
src/data/layers/boxes.tsx | 41 +++++++++++++++++---
src/data/layers/coal.tsx | 29 ---------------
src/data/layers/elves.tsx | 72 ------------------------------------
src/data/layers/paper.tsx | 28 --------------
src/data/layers/trees.tsx | 19 ----------
src/data/layers/workshop.tsx | 17 ---------
src/data/projEntry.tsx | 16 ++++++--
7 files changed, 48 insertions(+), 174 deletions(-)
diff --git a/src/data/layers/boxes.tsx b/src/data/layers/boxes.tsx
index 68bceef..e656fbd 100644
--- a/src/data/layers/boxes.tsx
+++ b/src/data/layers/boxes.tsx
@@ -21,7 +21,7 @@ import {
createSequentialModifier,
Modifier
} from "game/modifiers";
-import { noPersist } from "game/persistence";
+import { isPersistent, noPersist, persistent } from "game/persistence";
import Decimal, { DecimalSource, format, formatWhole } from "util/bignum";
import { WithRequired } from "util/common";
import { render, renderGrid, renderRow } from "util/vue";
@@ -584,6 +584,37 @@ const layer = createLayer(id, function (this: BaseLayer) {
}
});
+ const mastery = {
+ boxes: persistent(0),
+ totalBoxes: persistent(0),
+ upgrades: {
+ logsUpgrade: { bought: persistent(false) },
+ ashUpgrade: { bought: persistent(false) },
+ coalUpgrade: { bought: persistent(false) }
+ },
+ row2Upgrades: {
+ oreUpgrade: { bought: persistent(false) },
+ metalUpgrade: { bought: persistent(false) },
+ plasticUpgrade: { bought: persistent(false) }
+ },
+ row3Upgrades: {
+ clothUpgrade: { bought: persistent(false) },
+ dyeUpgrade: { bought: persistent(false) },
+ xpUpgrade: { bought: persistent(false) },
+ },
+ buyables: {
+ logBoxesBuyable: { amount: persistent(0) },
+ ashBoxesBuyable: { amount: persistent(0) },
+ coalBoxesBuyable: { amount: persistent(0) }
+ },
+ buyables2: {
+ oreBoxesBuyable: { amount: persistent(0) },
+ metalBoxesBuyable: { amount: persistent(0) },
+ plasticBoxesBuyable: { amount: persistent(0) }
+ }
+ };
+ const mastered = persistent(false);
+
return {
name,
day,
@@ -615,11 +646,9 @@ const layer = createLayer(id, function (this: BaseLayer) {
{renderGrid(Object.values(buyables), Object.values(buyables2))}
>
)),
- minimizedDisplay: jsx(() => (
-
- {name} - {format(boxes.value)} {boxes.displayName}
-
- ))
+ minimizedDisplay: jsx(() => ({name} - {format(boxes.value)} {boxes.displayName}
)),
+ mastery,
+ mastered
};
});
diff --git a/src/data/layers/coal.tsx b/src/data/layers/coal.tsx
index ad39c86..78d0000 100644
--- a/src/data/layers/coal.tsx
+++ b/src/data/layers/coal.tsx
@@ -1023,34 +1023,6 @@ const layer = createLayer(id, function (this: BaseLayer) {
heatedPlanters: { amount: persistent(0) },
moreFertilizer: { amount: persistent(0) }
};
- function swapMastery() {
- [coal.value, mastery.coal.value] = [mastery.coal.value, coal.value];
- [totalCoal.value, mastery.totalCoal.value] = [mastery.totalCoal.value, totalCoal.value];
- [ash.value, mastery.ash.value] = [mastery.ash.value, ash.value];
- [activeFires.value, mastery.activeFires.value] = [mastery.activeFires.value, activeFires.value];
- [buildFire.amount.value, mastery.buildFire.amount.value] = [mastery.buildFire.amount.value, buildFire.amount.value];
- [activeBonfires.value, mastery.activeBonfires.value] = [mastery.activeBonfires.value, activeBonfires.value];
- [buildBonfire.amount.value, mastery.buildBonfire.amount.value] = [mastery.buildBonfire.amount.value, buildBonfire.amount.value];
- [activeKilns.value, mastery.activeKilns.value] = [mastery.activeKilns.value, activeKilns.value];
- [buildKiln.amount.value, mastery.buildKiln.amount.value] = [mastery.buildKiln.amount.value, buildKiln.amount.value];
- [activeDrills.value, mastery.activeDrills.value] = [mastery.activeDrills.value, activeDrills.value];
- [buildDrill.amount.value, mastery.buildDrill.amount.value] = [mastery.buildDrill.amount.value, buildDrill.amount.value];
- [warmerCutters.bought.value, mastery.warmerCutters.bought.value] = [mastery.warmerCutters.bought.value, warmerCutters.bought.value];
- [warmerPlanters.bought.value, mastery.warmerPlanters.bought.value] = [mastery.warmerPlanters.bought.value, warmerPlanters.bought.value];
- [basicFertilizer.bought.value, mastery.basicFertilizer.bought.value] = [mastery.basicFertilizer.bought.value, basicFertilizer.bought.value];
- [unlockBonfire.bought.value, mastery.unlockBonfire.bought.value] = [mastery.unlockBonfire.bought.value, unlockBonfire.bought.value];
- [dedicatedCutters.bought.value, mastery.dedicatedCutters.bought.value] = [mastery.dedicatedCutters.bought.value, dedicatedCutters.bought.value];
- [dedicatedPlanters.bought.value, mastery.dedicatedPlanters.bought.value] = [mastery.dedicatedPlanters.bought.value, dedicatedPlanters.bought.value];
- [betterFertilizer.bought.value, mastery.betterFertilizer.bought.value] = [mastery.betterFertilizer.bought.value, betterFertilizer.bought.value];
- [unlockKiln.bought.value, mastery.unlockKiln.bought.value] = [mastery.unlockKiln.bought.value, unlockKiln.bought.value];
- [efficientSmelther.bought.value, mastery.efficientSmelther.bought.value] = [mastery.efficientSmelther.bought.value, efficientSmelther.bought.value];
- [arsonistAssistance.bought.value, mastery.arsonistAssistance.bought.value] = [mastery.arsonistAssistance.bought.value, arsonistAssistance.bought.value];
- [refinedCoal.bought.value, mastery.refinedCoal.bought.value] = [mastery.refinedCoal.bought.value, refinedCoal.bought.value];
- [coloredFire.bought.value, mastery.coloredFire.bought.value] = [mastery.coloredFire.bought.value, coloredFire.bought.value];
- [heatedCutters.amount.value, mastery.heatedCutters.amount.value] = [mastery.heatedCutters.amount.value, heatedCutters.amount.value];
- [heatedPlanters.amount.value, mastery.heatedPlanters.amount.value] = [mastery.heatedPlanters.amount.value, heatedPlanters.amount.value];
- [moreFertilizer.amount.value, mastery.moreFertilizer.amount.value] = [mastery.moreFertilizer.amount.value, moreFertilizer.amount.value];
- }
const mastered = persistent(false);
return {
@@ -1171,7 +1143,6 @@ const layer = createLayer(id, function (this: BaseLayer) {
)),
minimizedDisplay: jsx(() => ({name} - {format(coal.value)} {coal.displayName}
)),
mastery,
- swapMastery,
mastered
};
});
diff --git a/src/data/layers/elves.tsx b/src/data/layers/elves.tsx
index 509e587..0ee406a 100644
--- a/src/data/layers/elves.tsx
+++ b/src/data/layers/elves.tsx
@@ -1188,77 +1188,6 @@ const layer = createLayer(id, function (this: BaseLayer) {
{ earned: persistent(false) },
]
};
- function swapMastery() {
- [elves.cuttersElf.buyProgress.value, mastery.elves.cuttersElf.buyProgress.value] = [mastery.elves.cuttersElf.buyProgress.value, elves.cuttersElf.buyProgress.value];
- [elves.cuttersElf.amountOfTimesDone.value, mastery.elves.cuttersElf.amountOfTimesDone.value] = [mastery.elves.cuttersElf.amountOfTimesDone.value, elves.cuttersElf.amountOfTimesDone.value];
- [elves.cuttersElf.bought.value, mastery.elves.cuttersElf.bought.value] = [mastery.elves.cuttersElf.bought.value, elves.cuttersElf.bought.value];
- [elves.plantersElf.buyProgress.value, mastery.elves.plantersElf.buyProgress.value] = [mastery.elves.plantersElf.buyProgress.value, elves.plantersElf.buyProgress.value];
- [elves.plantersElf.amountOfTimesDone.value, mastery.elves.plantersElf.amountOfTimesDone.value] = [mastery.elves.plantersElf.amountOfTimesDone.value, elves.plantersElf.amountOfTimesDone.value];
- [elves.plantersElf.bought.value, mastery.elves.plantersElf.bought.value] = [mastery.elves.plantersElf.bought.value, elves.plantersElf.bought.value];
- [elves.expandersElf.buyProgress.value, mastery.elves.expandersElf.buyProgress.value] = [mastery.elves.expandersElf.buyProgress.value, elves.expandersElf.buyProgress.value];
- [elves.expandersElf.amountOfTimesDone.value, mastery.elves.expandersElf.amountOfTimesDone.value] = [mastery.elves.expandersElf.amountOfTimesDone.value, elves.expandersElf.amountOfTimesDone.value];
- [elves.expandersElf.bought.value, mastery.elves.expandersElf.bought.value] = [mastery.elves.expandersElf.bought.value, elves.expandersElf.bought.value];
- [elves.heatedCuttersElf.buyProgress.value, mastery.elves.heatedCuttersElf.buyProgress.value] = [mastery.elves.heatedCuttersElf.buyProgress.value, elves.heatedCuttersElf.buyProgress.value];
- [elves.heatedCuttersElf.amountOfTimesDone.value, mastery.elves.heatedCuttersElf.amountOfTimesDone.value] = [mastery.elves.heatedCuttersElf.amountOfTimesDone.value, elves.heatedCuttersElf.amountOfTimesDone.value];
- [elves.heatedCuttersElf.bought.value, mastery.elves.heatedCuttersElf.bought.value] = [mastery.elves.heatedCuttersElf.bought.value, elves.heatedCuttersElf.bought.value];
- [elves.heatedPlantersElf.buyProgress.value, mastery.elves.heatedPlantersElf.buyProgress.value] = [mastery.elves.heatedPlantersElf.buyProgress.value, elves.heatedPlantersElf.buyProgress.value];
- [elves.heatedPlantersElf.amountOfTimesDone.value, mastery.elves.heatedPlantersElf.amountOfTimesDone.value] = [mastery.elves.heatedPlantersElf.amountOfTimesDone.value, elves.heatedPlantersElf.amountOfTimesDone.value];
- [elves.heatedPlantersElf.bought.value, mastery.elves.heatedPlantersElf.bought.value] = [mastery.elves.heatedPlantersElf.bought.value, elves.heatedPlantersElf.bought.value];
- [elves.fertilizerElf.buyProgress.value, mastery.elves.fertilizerElf.buyProgress.value] = [mastery.elves.fertilizerElf.buyProgress.value, elves.fertilizerElf.buyProgress.value];
- [elves.fertilizerElf.amountOfTimesDone.value, mastery.elves.fertilizerElf.amountOfTimesDone.value] = [mastery.elves.fertilizerElf.amountOfTimesDone.value, elves.fertilizerElf.amountOfTimesDone.value];
- [elves.fertilizerElf.bought.value, mastery.elves.fertilizerElf.bought.value] = [mastery.elves.fertilizerElf.bought.value, elves.fertilizerElf.bought.value];
- [elves.smallFireElf.buyProgress.value, mastery.elves.smallFireElf.buyProgress.value] = [mastery.elves.smallFireElf.buyProgress.value, elves.smallFireElf.buyProgress.value];
- [elves.smallFireElf.amountOfTimesDone.value, mastery.elves.smallFireElf.amountOfTimesDone.value] = [mastery.elves.smallFireElf.amountOfTimesDone.value, elves.smallFireElf.amountOfTimesDone.value];
- [elves.smallFireElf.toggle.value, mastery.elves.smallFireElf.toggle.value] = [mastery.elves.smallFireElf.toggle.value, elves.smallFireElf.toggle.value];
- [elves.smallFireElf.bought.value, mastery.elves.smallFireElf.bought.value] = [mastery.elves.smallFireElf.bought.value, elves.smallFireElf.bought.value];
- [elves.bonfireElf.buyProgress.value, mastery.elves.bonfireElf.buyProgress.value] = [mastery.elves.bonfireElf.buyProgress.value, elves.bonfireElf.buyProgress.value];
- [elves.bonfireElf.amountOfTimesDone.value, mastery.elves.bonfireElf.amountOfTimesDone.value] = [mastery.elves.bonfireElf.amountOfTimesDone.value, elves.bonfireElf.amountOfTimesDone.value];
- [elves.bonfireElf.toggle.value, mastery.elves.bonfireElf.toggle.value] = [mastery.elves.bonfireElf.toggle.value, elves.bonfireElf.toggle.value];
- [elves.bonfireElf.bought.value, mastery.elves.bonfireElf.bought.value] = [mastery.elves.bonfireElf.bought.value, elves.bonfireElf.bought.value];
- [elves.kilnElf.buyProgress.value, mastery.elves.kilnElf.buyProgress.value] = [mastery.elves.kilnElf.buyProgress.value, elves.kilnElf.buyProgress.value];
- [elves.kilnElf.amountOfTimesDone.value, mastery.elves.kilnElf.amountOfTimesDone.value] = [mastery.elves.kilnElf.amountOfTimesDone.value, elves.kilnElf.amountOfTimesDone.value];
- [elves.kilnElf.toggle.value, mastery.elves.kilnElf.toggle.value] = [mastery.elves.kilnElf.toggle.value, elves.kilnElf.toggle.value];
- [elves.kilnElf.bought.value, mastery.elves.kilnElf.bought.value] = [mastery.elves.kilnElf.bought.value, elves.kilnElf.bought.value];
- [elves.paperElf.buyProgress.value, mastery.elves.paperElf.buyProgress.value] = [mastery.elves.paperElf.buyProgress.value, elves.paperElf.buyProgress.value];
- [elves.paperElf.amountOfTimesDone.value, mastery.elves.paperElf.amountOfTimesDone.value] = [mastery.elves.paperElf.amountOfTimesDone.value, elves.paperElf.amountOfTimesDone.value];
- [elves.paperElf.bought.value, mastery.elves.paperElf.bought.value] = [mastery.elves.paperElf.bought.value, elves.paperElf.bought.value];
- [elves.boxElf.buyProgress.value, mastery.elves.boxElf.buyProgress.value] = [mastery.elves.boxElf.buyProgress.value, elves.boxElf.buyProgress.value];
- [elves.boxElf.amountOfTimesDone.value, mastery.elves.boxElf.amountOfTimesDone.value] = [mastery.elves.boxElf.amountOfTimesDone.value, elves.boxElf.amountOfTimesDone.value];
- [elves.boxElf.bought.value, mastery.elves.boxElf.bought.value] = [mastery.elves.boxElf.bought.value, elves.boxElf.bought.value];
- [elves.clothElf.buyProgress.value, mastery.elves.clothElf.buyProgress.value] = [mastery.elves.clothElf.buyProgress.value, elves.clothElf.buyProgress.value];
- [elves.clothElf.amountOfTimesDone.value, mastery.elves.clothElf.amountOfTimesDone.value] = [mastery.elves.clothElf.amountOfTimesDone.value, elves.clothElf.amountOfTimesDone.value];
- [elves.clothElf.bought.value, mastery.elves.clothElf.bought.value] = [mastery.elves.clothElf.bought.value, elves.clothElf.bought.value];
- [elves.coalDrillElf.buyProgress.value, mastery.elves.coalDrillElf.buyProgress.value] = [mastery.elves.coalDrillElf.buyProgress.value, elves.coalDrillElf.buyProgress.value];
- [elves.coalDrillElf.amountOfTimesDone.value, mastery.elves.coalDrillElf.amountOfTimesDone.value] = [mastery.elves.coalDrillElf.amountOfTimesDone.value, elves.coalDrillElf.amountOfTimesDone.value];
- [elves.coalDrillElf.toggle.value, mastery.elves.coalDrillElf.toggle.value] = [mastery.elves.coalDrillElf.toggle.value, elves.coalDrillElf.toggle.value];
- [elves.coalDrillElf.bought.value, mastery.elves.coalDrillElf.bought.value] = [mastery.elves.coalDrillElf.bought.value, elves.coalDrillElf.bought.value];
- [elves.heavyDrillElf.buyProgress.value, mastery.elves.heavyDrillElf.buyProgress.value] = [mastery.elves.heavyDrillElf.buyProgress.value, elves.heavyDrillElf.buyProgress.value];
- [elves.heavyDrillElf.amountOfTimesDone.value, mastery.elves.heavyDrillElf.amountOfTimesDone.value] = [mastery.elves.heavyDrillElf.amountOfTimesDone.value, elves.heavyDrillElf.amountOfTimesDone.value];
- [elves.heavyDrillElf.toggle.value, mastery.elves.heavyDrillElf.toggle.value] = [mastery.elves.heavyDrillElf.toggle.value, elves.heavyDrillElf.toggle.value];
- [elves.heavyDrillElf.bought.value, mastery.elves.heavyDrillElf.bought.value] = [mastery.elves.heavyDrillElf.bought.value, elves.heavyDrillElf.bought.value];
- [elves.oilElf.buyProgress.value, mastery.elves.oilElf.buyProgress.value] = [mastery.elves.oilElf.buyProgress.value, elves.oilElf.buyProgress.value];
- [elves.oilElf.amountOfTimesDone.value, mastery.elves.oilElf.amountOfTimesDone.value] = [mastery.elves.oilElf.amountOfTimesDone.value, elves.oilElf.amountOfTimesDone.value];
- [elves.oilElf.toggle.value, mastery.elves.oilElf.toggle.value] = [mastery.elves.oilElf.toggle.value, elves.oilElf.toggle.value];
- [elves.oilElf.bought.value, mastery.elves.oilElf.bought.value] = [mastery.elves.oilElf.bought.value, elves.oilElf.bought.value];
- [elves.metalElf.buyProgress.value, mastery.elves.metalElf.buyProgress.value] = [mastery.elves.metalElf.buyProgress.value, elves.metalElf.buyProgress.value];
- [elves.metalElf.amountOfTimesDone.value, mastery.elves.metalElf.amountOfTimesDone.value] = [mastery.elves.metalElf.amountOfTimesDone.value, elves.metalElf.amountOfTimesDone.value];
- [elves.metalElf.bought.value, mastery.elves.metalElf.bought.value] = [mastery.elves.metalElf.bought.value, elves.metalElf.bought.value];
- [elves.dyeElf.buyProgress.value, mastery.elves.dyeElf.buyProgress.value] = [mastery.elves.dyeElf.buyProgress.value, elves.dyeElf.buyProgress.value];
- [elves.dyeElf.amountOfTimesDone.value, mastery.elves.dyeElf.amountOfTimesDone.value] = [mastery.elves.dyeElf.amountOfTimesDone.value, elves.dyeElf.amountOfTimesDone.value];
- [elves.dyeElf.bought.value, mastery.elves.dyeElf.bought.value] = [mastery.elves.dyeElf.bought.value, elves.dyeElf.bought.value];
- [milestones[0].earned.value, mastery.milestones[0].earned.value] = [mastery.milestones[0].earned.value, milestones[0].earned.value];
- [milestones[1].earned.value, mastery.milestones[1].earned.value] = [mastery.milestones[1].earned.value, milestones[1].earned.value];
- [milestones[2].earned.value, mastery.milestones[2].earned.value] = [mastery.milestones[2].earned.value, milestones[2].earned.value];
- [milestones[3].earned.value, mastery.milestones[3].earned.value] = [mastery.milestones[3].earned.value, milestones[3].earned.value];
- [milestones[4].earned.value, mastery.milestones[4].earned.value] = [mastery.milestones[4].earned.value, milestones[4].earned.value];
- [milestones[5].earned.value, mastery.milestones[5].earned.value] = [mastery.milestones[5].earned.value, milestones[5].earned.value];
- [milestones[6].earned.value, mastery.milestones[6].earned.value] = [mastery.milestones[6].earned.value, milestones[6].earned.value];
- [milestones[7].earned.value, mastery.milestones[7].earned.value] = [mastery.milestones[7].earned.value, milestones[7].earned.value];
- [milestones[8].earned.value, mastery.milestones[8].earned.value] = [mastery.milestones[8].earned.value, milestones[8].earned.value];
- [milestones[9].earned.value, mastery.milestones[9].earned.value] = [mastery.milestones[9].earned.value, milestones[9].earned.value];
- [milestones[10].earned.value, mastery.milestones[10].earned.value] = [mastery.milestones[10].earned.value, milestones[10].earned.value];
- [milestones[11].earned.value, mastery.milestones[11].earned.value] = [mastery.milestones[11].earned.value, milestones[11].earned.value];
- };
const mastered = persistent(false);
return {
@@ -1304,7 +1233,6 @@ const layer = createLayer(id, function (this: BaseLayer) {
>
)),
mastery,
- swapMastery,
mastered
};
});
diff --git a/src/data/layers/paper.tsx b/src/data/layers/paper.tsx
index f1299d9..8d6dedd 100644
--- a/src/data/layers/paper.tsx
+++ b/src/data/layers/paper.tsx
@@ -499,33 +499,6 @@ const layer = createLayer(id, function (this: BaseLayer) {
treeUpgrade: { bought: persistent(false) }
}
};
- function swapMastery() {
- [paper.value, mastery.paper.value] = [mastery.paper.value, paper.value];
- [totalPaper.value, mastery.totalPaper.value] = [mastery.totalPaper.value, totalPaper.value];
- [books.cuttersBook.amount.value, mastery.books.cuttersBook.amount.value] = [mastery.books.cuttersBook.amount.value, books.cuttersBook.amount.value];
- [books.plantersBook.amount.value, mastery.books.plantersBook.amount.value] = [mastery.books.plantersBook.amount.value, books.plantersBook.amount.value];
- [books.expandersBook.amount.value, mastery.books.expandersBook.amount.value] = [mastery.books.expandersBook.amount.value, books.expandersBook.amount.value];
- [books.heatedCuttersBook.amount.value, mastery.books.heatedCuttersBook.amount.value] = [mastery.books.heatedCuttersBook.amount.value, books.heatedCuttersBook.amount.value];
- [books.heatedPlantersBook.amount.value, mastery.books.heatedPlantersBook.amount.value] = [mastery.books.heatedPlantersBook.amount.value, books.heatedPlantersBook.amount.value];
- [books.fertilizerBook.amount.value, mastery.books.fertilizerBook.amount.value] = [mastery.books.fertilizerBook.amount.value, books.fertilizerBook.amount.value];
- [books.smallFireBook.amount.value, mastery.books.smallFireBook.amount.value] = [mastery.books.smallFireBook.amount.value, books.smallFireBook.amount.value];
- [books.bonfireBook.amount.value, mastery.books.bonfireBook.amount.value] = [mastery.books.bonfireBook.amount.value, books.bonfireBook.amount.value];
- [books.kilnBook.amount.value, mastery.books.kilnBook.amount.value] = [mastery.books.kilnBook.amount.value, books.kilnBook.amount.value];
- [books.paperBook.amount.value, mastery.books.paperBook.amount.value] = [mastery.books.paperBook.amount.value, books.paperBook.amount.value];
- [books.boxBook.amount.value, mastery.books.boxBook.amount.value] = [mastery.books.boxBook.amount.value, books.boxBook.amount.value];
- [books.clothBook.amount.value, mastery.books.clothBook.amount.value] = [mastery.books.clothBook.amount.value, books.clothBook.amount.value];
- [books.coalDrillBook.amount.value, mastery.books.coalDrillBook.amount.value] = [mastery.books.coalDrillBook.amount.value, books.coalDrillBook.amount.value];
- [books.heavyDrillBook.amount.value, mastery.books.heavyDrillBook.amount.value] = [mastery.books.heavyDrillBook.amount.value, books.heavyDrillBook.amount.value];
- [books.oilBook.amount.value, mastery.books.oilBook.amount.value] = [mastery.books.oilBook.amount.value, books.oilBook.amount.value];
- [books.metalBook.amount.value, mastery.books.metalBook.amount.value] = [mastery.books.metalBook.amount.value, books.metalBook.amount.value];
- [books.dyeBook.amount.value, mastery.books.dyeBook.amount.value] = [mastery.books.dyeBook.amount.value, books.dyeBook.amount.value];
- [upgrades.clothUpgrade.bought.value, mastery.upgrades.clothUpgrade.bought.value] = [mastery.upgrades.clothUpgrade.bought.value, upgrades.clothUpgrade.bought.value];
- [upgrades.drillingUpgrade.bought.value, mastery.upgrades.drillingUpgrade.bought.value] = [mastery.upgrades.drillingUpgrade.bought.value, upgrades.drillingUpgrade.bought.value];
- [upgrades.oilUpgrade.bought.value, mastery.upgrades.oilUpgrade.bought.value] = [mastery.upgrades.oilUpgrade.bought.value, upgrades.oilUpgrade.bought.value];
- [upgrades2.ashUpgrade.bought.value, mastery.upgrades2.ashUpgrade.bought.value] = [mastery.upgrades2.ashUpgrade.bought.value, upgrades2.ashUpgrade.bought.value];
- [upgrades2.bookUpgrade.bought.value, mastery.upgrades2.bookUpgrade.bought.value] = [mastery.upgrades2.bookUpgrade.bought.value, upgrades2.bookUpgrade.bought.value];
- [upgrades2.treeUpgrade.bought.value, mastery.upgrades2.treeUpgrade.bought.value] = [mastery.upgrades2.treeUpgrade.bought.value, upgrades2.treeUpgrade.bought.value];
- };
const mastered = persistent(false);
return {
@@ -555,7 +528,6 @@ const layer = createLayer(id, function (this: BaseLayer) {
)),
minimizedDisplay: jsx(() => ({name} - {format(paper.value)} {paper.displayName}
)),
mastery,
- swapMastery,
mastered
};
});
diff --git a/src/data/layers/trees.tsx b/src/data/layers/trees.tsx
index 92375a4..222ceef 100644
--- a/src/data/layers/trees.tsx
+++ b/src/data/layers/trees.tsx
@@ -827,24 +827,6 @@ const layer = createLayer(id, function (this: BaseLayer) {
{ amount: persistent(0) }
]
};
- function swapMastery() {
- [logs.value, mastery.logs.value] = [mastery.logs.value, logs.value];
- [totalLogs.value, mastery.totalLogs.value] = [mastery.totalLogs.value, totalLogs.value];
- [saplings.value, mastery.saplings.value] = [mastery.saplings.value, saplings.value];
- [row1Upgrades[0].bought.value, mastery.row1Upgrades[0].bought.value] = [mastery.row1Upgrades[0].bought.value, row1Upgrades[0].bought.value];
- [row1Upgrades[1].bought.value, mastery.row1Upgrades[1].bought.value] = [mastery.row1Upgrades[1].bought.value, row1Upgrades[1].bought.value];
- [row1Upgrades[2].bought.value, mastery.row1Upgrades[2].bought.value] = [mastery.row1Upgrades[2].bought.value, row1Upgrades[2].bought.value];
- [row1Upgrades[3].bought.value, mastery.row1Upgrades[3].bought.value] = [mastery.row1Upgrades[3].bought.value, row1Upgrades[3].bought.value];
- [row1Upgrades[4].bought.value, mastery.row1Upgrades[4].bought.value] = [mastery.row1Upgrades[4].bought.value, row1Upgrades[4].bought.value];
- [row2Upgrades[0].bought.value, mastery.row2Upgrades[0].bought.value] = [mastery.row2Upgrades[0].bought.value, row2Upgrades[0].bought.value];
- [row2Upgrades[1].bought.value, mastery.row2Upgrades[1].bought.value] = [mastery.row2Upgrades[1].bought.value, row2Upgrades[1].bought.value];
- [row2Upgrades[2].bought.value, mastery.row2Upgrades[2].bought.value] = [mastery.row2Upgrades[2].bought.value, row2Upgrades[2].bought.value];
- [row2Upgrades[3].bought.value, mastery.row2Upgrades[3].bought.value] = [mastery.row2Upgrades[3].bought.value, row2Upgrades[3].bought.value];
- [row2Upgrades[4].bought.value, mastery.row2Upgrades[4].bought.value] = [mastery.row2Upgrades[4].bought.value, row2Upgrades[4].bought.value];
- [row1Buyables[0].amount.value, mastery.row1Buyables[0].amount.value] = [mastery.row1Buyables[0].amount.value, row1Buyables[0].amount.value];
- [row1Buyables[1].amount.value, mastery.row1Buyables[1].amount.value] = [mastery.row1Buyables[1].amount.value, row1Buyables[1].amount.value];
- [row1Buyables[2].amount.value, mastery.row1Buyables[2].amount.value] = [mastery.row1Buyables[2].amount.value, row1Buyables[2].amount.value];
- }
const mastered = persistent(false);
return {
@@ -911,7 +893,6 @@ const layer = createLayer(id, function (this: BaseLayer) {
)),
minimizedDisplay: jsx(() => ({name} - {format(logs.value)} {logs.displayName}
)),
mastery,
- swapMastery,
mastered,
};
});
diff --git a/src/data/layers/workshop.tsx b/src/data/layers/workshop.tsx
index 19ad59c..815639d 100644
--- a/src/data/layers/workshop.tsx
+++ b/src/data/layers/workshop.tsx
@@ -333,22 +333,6 @@ const layer = createLayer(id, function (this: BaseLayer) {
extraExpansionMilestone5: { earned: persistent(false) },
}
};
- function swapMastery() {
- [foundationProgress.value, mastery.foundationProgress.value] = [mastery.foundationProgress.value, foundationProgress.value];
- [milestones.logGainMilestone1.earned.value, mastery.milestones.logGainMilestone1.earned.value] = [mastery.milestones.logGainMilestone1.earned.value, milestones.logGainMilestone1.earned.value];
- [milestones.autoCutMilestone1.earned.value, mastery.milestones.autoCutMilestone1.earned.value] = [mastery.milestones.autoCutMilestone1.earned.value, milestones.autoCutMilestone1.earned.value];
- [milestones.autoPlantMilestone1.earned.value, mastery.milestones.autoPlantMilestone1.earned.value] = [mastery.milestones.autoPlantMilestone1.earned.value, milestones.autoPlantMilestone1.earned.value];
- [milestones.autoCutMilestone2.earned.value, mastery.milestones.autoCutMilestone2.earned.value] = [mastery.milestones.autoCutMilestone2.earned.value, milestones.autoCutMilestone2.earned.value];
- [milestones.autoPlantMilestone2.earned.value, mastery.milestones.autoPlantMilestone2.earned.value] = [mastery.milestones.autoPlantMilestone2.earned.value, milestones.autoPlantMilestone2.earned.value];
- [milestones.logGainMilestone2.earned.value, mastery.milestones.logGainMilestone2.earned.value] = [mastery.milestones.logGainMilestone2.earned.value, milestones.logGainMilestone2.earned.value];
- [milestones.morePlantsMilestone1.earned.value, mastery.milestones.morePlantsMilestone1.earned.value] = [mastery.milestones.morePlantsMilestone1.earned.value, milestones.morePlantsMilestone1.earned.value];
- [milestones.logGainMilestone3.earned.value, mastery.milestones.logGainMilestone3.earned.value] = [mastery.milestones.logGainMilestone3.earned.value, milestones.logGainMilestone3.earned.value];
- [milestones.extraExpansionMilestone1.earned.value, mastery.milestones.extraExpansionMilestone1.earned.value] = [mastery.milestones.extraExpansionMilestone1.earned.value, milestones.extraExpansionMilestone1.earned.value];
- [milestones.extraExpansionMilestone2.earned.value, mastery.milestones.extraExpansionMilestone2.earned.value] = [mastery.milestones.extraExpansionMilestone2.earned.value, milestones.extraExpansionMilestone2.earned.value];
- [milestones.extraExpansionMilestone3.earned.value, mastery.milestones.extraExpansionMilestone3.earned.value] = [mastery.milestones.extraExpansionMilestone3.earned.value, milestones.extraExpansionMilestone3.earned.value];
- [milestones.extraExpansionMilestone4.earned.value, mastery.milestones.extraExpansionMilestone4.earned.value] = [mastery.milestones.extraExpansionMilestone4.earned.value, milestones.extraExpansionMilestone4.earned.value];
- [milestones.extraExpansionMilestone5.earned.value, mastery.milestones.extraExpansionMilestone5.earned.value] = [mastery.milestones.extraExpansionMilestone5.earned.value, milestones.extraExpansionMilestone5.earned.value];
- }
const mastered = persistent(false);
return {
@@ -388,7 +372,6 @@ const layer = createLayer(id, function (this: BaseLayer) {
)),
minimizedDisplay: jsx(() => ({name} - {format(foundationProgress.value)}% {foundationProgress.displayName}
)),
mastery,
- swapMastery,
mastered
};
});
diff --git a/src/data/projEntry.tsx b/src/data/projEntry.tsx
index 978ff88..99ef35f 100644
--- a/src/data/projEntry.tsx
+++ b/src/data/projEntry.tsx
@@ -7,7 +7,7 @@ import {
jsx
} from "features/feature";
import { BaseLayer, createLayer, GenericLayer, layers } from "game/layers";
-import { Persistent, persistent } from "game/persistence";
+import { isPersistent, Persistent, persistent } from "game/persistence";
import type { LayerData, PlayerData } from "game/player";
import player from "game/player";
import Decimal, { format, formatTime } from "util/bignum";
@@ -84,7 +84,7 @@ export const main = createLayer("main", function (this: BaseLayer) {
coal,
elves,
paper,
- // boxes,
+ boxes,
// metal,
// cloth,
// oil,
@@ -92,10 +92,20 @@ export const main = createLayer("main", function (this: BaseLayer) {
// dyes,
// management,
// letters
- ]) { layer.swapMastery() }
+ ]) { swapMastery(layer.mastery, layer) }
swappingMastery.value = false;
};
+ function swapMastery(mastery: Record, layer: Record) {
+ for (const key of Object.keys(mastery)) {
+ if (isPersistent(mastery[key])) {
+ [mastery[key].value, layer[key].value] = [layer[key].value, mastery[key].value];
+ }
+ else {
+ swapMastery(mastery[key], layer[key]);
+ }
+ }
+ }
function createDay(
optionsFunc: () => {
From e9d45cae020a9bfbfaee9666c000fc36bfde0bac Mon Sep 17 00:00:00 2001
From: Seth Posner
Date: Fri, 16 Dec 2022 16:29:03 -0800
Subject: [PATCH 031/124] Add mastery data to Cloth, Oil, and Metal
---
src/data/layers/cloth.tsx | 37 +++++++++++++++++++---
src/data/layers/metal.tsx | 27 +++++++++++++---
src/data/layers/oil.tsx | 65 ++++++++++++++++++++++++++++++++++++---
src/data/projEntry.tsx | 6 ++--
4 files changed, 117 insertions(+), 18 deletions(-)
diff --git a/src/data/layers/cloth.tsx b/src/data/layers/cloth.tsx
index bb46ba3..6f31c59 100644
--- a/src/data/layers/cloth.tsx
+++ b/src/data/layers/cloth.tsx
@@ -573,6 +573,35 @@ const layer = createLayer(id, function (this: BaseLayer) {
}
});
+ const mastery = {
+ cloth: persistent(0),
+ totalCloth: persistent(0),
+ wool: persistent(0),
+ sheep: persistent(0),
+ buildPens: { amount: persistent(0) },
+ betterShears: { amount: persistent(0) },
+ fasterSpinning: { amount: persistent(0) },
+ treesUpgrades: {
+ treesUpgrade1: { bought: persistent(false) },
+ treesUpgrade2: { bought: persistent(false) },
+ treesUpgrade3: { bought: persistent(false) },
+ treesUpgrade4: { bought: persistent(false) }
+ },
+ metalUpgrades: {
+ metalUpgrade1: { bought: persistent(false) },
+ metalUpgrade2: { bought: persistent(false) },
+ metalUpgrade3: { bought: persistent(false) },
+ metalUpgrade4: { bought: persistent(false) }
+ },
+ paperUpgrades: {
+ paperUpgrade1: { bought: persistent(false) },
+ paperUpgrade2: { bought: persistent(false) },
+ paperUpgrade3: { bought: persistent(false) },
+ paperUpgrade4: { bought: persistent(false) }
+ }
+ };
+ const mastered = persistent(false);
+
return {
name,
color,
@@ -611,11 +640,9 @@ const layer = createLayer(id, function (this: BaseLayer) {
>
)),
- minimizedDisplay: jsx(() => (
-
- {name} - {format(cloth.value)} {cloth.displayName}
-
- ))
+ minimizedDisplay: jsx(() => ({name} - {format(cloth.value)} {cloth.displayName}
)),
+ mastery,
+ mastered
};
});
diff --git a/src/data/layers/metal.tsx b/src/data/layers/metal.tsx
index 36e6be8..165962c 100644
--- a/src/data/layers/metal.tsx
+++ b/src/data/layers/metal.tsx
@@ -624,6 +624,25 @@ const layer = createLayer(id, function (this: BaseLayer) {
}
});
+ const mastery = {
+ ore: persistent(0),
+ bestOre: persistent(0),
+ oreProgress: persistent(0),
+ metal: persistent(0),
+ bestMetal: persistent(0),
+ totalMetal: persistent(0),
+ simplePickaxe: { bought: persistent(false) },
+ doublePickaxe: { bought: persistent(false) },
+ crucible: { bought: persistent(false) },
+ coalDrill: { bought: persistent(false) },
+ industrialFurnace: { bought: persistent(false) },
+ efficientDrill: { bought: persistent(false) },
+ oreDrill: { amount: persistent(0) },
+ industrialCrucible: { amount: persistent(0) },
+ hotterForge: { amount: persistent(0) }
+ };
+ const mastered = persistent(false);
+
return {
name,
day,
@@ -719,11 +738,9 @@ const layer = createLayer(id, function (this: BaseLayer) {
{renderRow(oreDrill, industrialCrucible, hotterForge)}
>
)),
- minimizedDisplay: jsx(() => (
-
- {name} - {format(metal.value)} {metal.displayName}
-
- ))
+ minimizedDisplay: jsx(() => ({name} - {format(metal.value)} {metal.displayName}
)),
+ mastery,
+ mastered
};
});
diff --git a/src/data/layers/oil.tsx b/src/data/layers/oil.tsx
index 71da3ae..afa44d5 100644
--- a/src/data/layers/oil.tsx
+++ b/src/data/layers/oil.tsx
@@ -1086,6 +1086,62 @@ const layer = createLayer(id, function (this: BaseLayer) {
}
});
+ const mastery = {
+ oil: persistent(0),
+ totalOil: persistent(0),
+ depth: persistent(0),
+ drillProgress: persistent(0),
+ activeHeavy: persistent(0),
+ buildHeavy: { amount: persistent(0) },
+ activeHeavy2: persistent(0),
+ buildHeavy2: { amount: persistent(0) },
+ activeExtractor: persistent(0),
+ buildExtractor: { amount: persistent(0) },
+ activePump: persistent(0),
+ buildPump: { amount: persistent(0) },
+ activeBurner: persistent(0),
+ buildBurner: { amount: persistent(0) },
+ activeSmelter: persistent(0),
+ buildSmelter: { amount: persistent(0) },
+ depthMilestones: [
+ { earned: persistent(false) },
+ { earned: persistent(false) },
+ { earned: persistent