From 02967bb0e150c3b48e43c2605dd118d3c82fd786 Mon Sep 17 00:00:00 2001 From: thepaperpilot Date: Sun, 18 Dec 2022 23:58:26 -0600 Subject: [PATCH] Make workshop use cost modifier method again --- src/data/layers/workshop.tsx | 39 +++++++++++------------------- src/data/layers/wrapping-paper.tsx | 4 ++- 2 files changed, 17 insertions(+), 26 deletions(-) diff --git a/src/data/layers/workshop.tsx b/src/data/layers/workshop.tsx index a9cb2de..1252950 100644 --- a/src/data/layers/workshop.tsx +++ b/src/data/layers/workshop.tsx @@ -42,33 +42,10 @@ const layer = createLayer(id, function (this: BaseLayer) { const foundationProgress = createResource(0, "foundation progress"); - const costDecrease = createSequentialModifier(() => [ - createMultiplicativeModifier(() => ({ - multiplier: computed(() => Decimal.recip(wrappingPaper.boosts.beach1.value)), - description: "Beach Wrapping Paper", - enabled: computed(() => Decimal.gt(wrappingPaper.boosts.beach1.value, 1)) - })), - createExponentialModifier(() => ({ - exponent: 0.99, - description: "Holly Level 5", - enabled: management.elfTraining.cutterElfTraining.milestones[4].earned - })) - ]); - - const addScaling = (value: DecimalSource) => computed(() => costDecrease.apply(value)); - const foundationConversion = createIndependentConversion(() => ({ // note: 5423 is a magic number. Don't touch this or it'll self-destruct. scaling: addHardcap( - addSoftcap( - addSoftcap( - createPolynomialScaling(addScaling(250), 1.5), - addScaling(5423), - 1 / 1e10 - ), - addScaling(1e20), - 3e8 - ), + addSoftcap(addSoftcap(createPolynomialScaling(250, 1.5), 5423, 1 / 1e10), 1e20, 3e8), computed(() => management.elfTraining.expandersElfTraining.milestones[2].earned.value ? 1000 : 100 ) @@ -80,7 +57,19 @@ const layer = createLayer(id, function (this: BaseLayer) { spend(gain, spent) { if (masteryEffectActive.value) return; trees.logs.value = Decimal.sub(trees.logs.value, spent); - } + }, + costModifier: createSequentialModifier(() => [ + createMultiplicativeModifier(() => ({ + multiplier: wrappingPaper.boosts.beach1, + description: "Beach Wrapping Paper", + enabled: computed(() => Decimal.gt(wrappingPaper.boosts.beach1.value, 1)) + })), + createExponentialModifier(() => ({ + exponent: 1 / 0.99, + description: "Holly Level 5", + enabled: management.elfTraining.cutterElfTraining.milestones[4].earned + })) + ]) })); const buildFoundation = createClickable(() => ({ diff --git a/src/data/layers/wrapping-paper.tsx b/src/data/layers/wrapping-paper.tsx index 19db846..0e3164c 100644 --- a/src/data/layers/wrapping-paper.tsx +++ b/src/data/layers/wrapping-paper.tsx @@ -269,7 +269,9 @@ const layer = createLayer(id, () => { main.isMastery.value ? 1 : Decimal.pow(1.5, wrappingPaper.ocean.buyable.amount.value) ), beach1: computed(() => - main.isMastery.value ? 1 : Decimal.add(wrappingPaper.beach.buyable.amount.value, 1) + main.isMastery.value + ? 1 + : Decimal.add(wrappingPaper.beach.buyable.amount.value, 1).log10().add(1) ) }; const wrappingPaperSum = createResource(