From 5f7c3f0ab309a1dca410f471f59b633f1d4836e6 Mon Sep 17 00:00:00 2001 From: Anthony Lawn Date: Mon, 12 Dec 2022 13:18:00 -0600 Subject: [PATCH 01/67] Implemented Jack lv1-3 --- src/data/layers/coal.tsx | 10 +++++++++- src/data/layers/elves.tsx | 3 ++- 2 files changed, 11 insertions(+), 2 deletions(-) diff --git a/src/data/layers/coal.tsx b/src/data/layers/coal.tsx index 32fd930..838d70a 100644 --- a/src/data/layers/coal.tsx +++ b/src/data/layers/coal.tsx @@ -431,6 +431,9 @@ const layer = createLayer(id, function (this: BaseLayer) { 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.amount.value).times(v); + if (management.elfTraining.heatedCuttersElfTraining.milestones[0].earned.value) { + v = Decimal.pow(0.95, paper.books.heatedCuttersBook.amount.value).times(v); + } return Decimal.add(v, 1).pow(2.5).times(10); }, display: { @@ -643,7 +646,12 @@ const layer = createLayer(id, function (this: BaseLayer) { multiplier: oil.extractorCoal, description: "Heavy Extractor", enabled: () => Decimal.gt(oil.activeExtractor.value, 0) - })) + })), + createExponentialModifier(() => ({ + exponent: 1.05, + description: "Jack Level 2", + enabled: management.elfTraining.heatedCutterElfTraining.milestones[1].earned + }) ]) as WithRequired; const computedCoalGain = computed(() => coalGain.apply(0)); diff --git a/src/data/layers/elves.tsx b/src/data/layers/elves.tsx index 0030238..793f4d1 100644 --- a/src/data/layers/elves.tsx +++ b/src/data/layers/elves.tsx @@ -554,7 +554,8 @@ const layer = createLayer(id, function (this: BaseLayer) { description: "Jack will automatically purchase heated cutters you can afford, without actually spending any coal.", buyable: coal.heatedCutters, - cooldownModifier: heatedCutterCooldown + cooldownModifier: heatedCutterCooldown, + buyMax: () => management.elfTraining.heatedCutterElfTraining.milestones[2].earned.value }); const heatedPlantersElf = createElf({ name: "Mary", From 880b9772639dbf0eea0786d2097ed505c00c7a2f Mon Sep 17 00:00:00 2001 From: Anthony Lawn Date: Mon, 12 Dec 2022 14:17:53 -0600 Subject: [PATCH 02/67] Implemented Hope lv1-3 --- src/data/layers/coal.tsx | 2 +- src/data/layers/elves.tsx | 3 ++- src/data/layers/management.tsx | 4 ++-- src/data/layers/trees.tsx | 5 +++++ src/data/layers/workshop.tsx | 16 +++++++++------- 5 files changed, 19 insertions(+), 11 deletions(-) diff --git a/src/data/layers/coal.tsx b/src/data/layers/coal.tsx index 838d70a..cc57d17 100644 --- a/src/data/layers/coal.tsx +++ b/src/data/layers/coal.tsx @@ -651,7 +651,7 @@ const layer = createLayer(id, function (this: BaseLayer) { exponent: 1.05, description: "Jack Level 2", enabled: management.elfTraining.heatedCutterElfTraining.milestones[1].earned - }) + })) ]) as WithRequired; const computedCoalGain = computed(() => coalGain.apply(0)); diff --git a/src/data/layers/elves.tsx b/src/data/layers/elves.tsx index 793f4d1..5dfed6c 100644 --- a/src/data/layers/elves.tsx +++ b/src/data/layers/elves.tsx @@ -546,7 +546,8 @@ const layer = createLayer(id, function (this: BaseLayer) { description: "Hope will automatically purchase forest expanders you can afford, without actually spending any logs.", buyable: trees.row1Buyables[2], - cooldownModifier: expanderCooldown + cooldownModifier: expanderCooldown, + buyMax: () => management.elfTraining.expandersElfTraining.milestones[1].earned.value }); const treesElves = [cuttersElf, plantersElf, expandersElf]; const heatedCuttersElf = createElf({ diff --git a/src/data/layers/management.tsx b/src/data/layers/management.tsx index d1988b6..08fcb9d 100644 --- a/src/data/layers/management.tsx +++ b/src/data/layers/management.tsx @@ -301,7 +301,7 @@ const layer = createLayer(id, () => { createMilestone(() => ({ display: { requirement: "Hope Level 1", - effectDisplay: "Planting speed boosts forest size" + effectDisplay: "Forest size grows by trees planted per second raised to ^0.99" }, shouldEarn: () => expandersElfTraining.level.value >= 1 })), @@ -316,7 +316,7 @@ const layer = createLayer(id, () => { createMilestone(() => ({ display: { requirement: "Hope Level 3", - effectDisplay: "The workshop can be expanded past 100%, but costs scale faster." + effectDisplay: "The workshop can be expanded past 100%, but costs scale faster. It also buys max now." }, visibility: () => showIf(expanderElfMilestones[1].earned.value), shouldEarn: () => expandersElfTraining.level.value >= 3 diff --git a/src/data/layers/trees.tsx b/src/data/layers/trees.tsx index 0c6ef6c..5b7ccce 100644 --- a/src/data/layers/trees.tsx +++ b/src/data/layers/trees.tsx @@ -83,6 +83,11 @@ const layer = createLayer(id, function (this: BaseLayer) { addend: dyes.boosts.blue1, description: "Blue Dye Boost 1", enabled: () => Decimal.gte(dyes.dyes.blue.amount.value, 1) + })), + createAdditiveModifier(() => ({ + addend: () => Decimal.pow(computedManualCuttingAmount.value, 0.99), + description: "Hope Level 1", + enabled: management.elfTraining.expandersElfTraining.milestones[0].earned })) ]) as WithRequired; const trees = createResource( diff --git a/src/data/layers/workshop.tsx b/src/data/layers/workshop.tsx index b026eea..d17ba6b 100644 --- a/src/data/layers/workshop.tsx +++ b/src/data/layers/workshop.tsx @@ -8,6 +8,7 @@ import { main } from "data/projEntry"; import { createBar } from "features/bars/bar"; import { createClickable } from "features/clickables/clickable"; import { + addSoftcap, Conversion, createIndependentConversion, createPolynomialScaling, @@ -21,18 +22,19 @@ import { BaseLayer, createLayer } from "game/layers"; import { noPersist } from "game/persistence"; import Decimal, { DecimalSource, formatWhole } from "util/bignum"; import { Direction } from "util/common"; +import { Computable } from "util/computed"; import { render } from "util/vue"; import { computed, unref, watchEffect } from "vue"; import elves from "./elves"; -import trees from "./trees"; import management from "./management"; +import trees from "./trees"; interface FoundationConversionOptions { scaling: ScalingFunction; baseResource: Resource; gainResource: Resource; roundUpCost: boolean; - buyMax: boolean; + buyMax: Computable; spend: (gain: DecimalSource, spent: DecimalSource) => void; } @@ -47,11 +49,11 @@ const layer = createLayer(id, function (this: BaseLayer) { const foundationConversion: Conversion = createIndependentConversion(() => ({ - scaling: createPolynomialScaling(250, 1.5), + scaling: addSoftcap(addSoftcap(createPolynomialScaling(250, 1.5), 100, 1/5), 1000, 1/10), baseResource: trees.logs, gainResource: noPersist(foundationProgress), roundUpCost: true, - buyMax: false, + buyMax: management.elfTraining.heatedCutterElfTraining.milestones[2].earned, spend(gain, spent) { trees.logs.value = Decimal.sub(trees.logs.value, spent); } @@ -75,10 +77,10 @@ const layer = createLayer(id, function (this: BaseLayer) { )), - visibility: () => showIf(Decimal.lt(foundationProgress.value, 100)), + visibility: () => showIf(Decimal.lt(foundationProgress.value, 100) || management.elfTraining.expandersElfTraining.milestones[2].earned.value), canClick: () => Decimal.gte(foundationConversion.actualGain.value, 1) && - Decimal.lt(foundationProgress.value, 100), + (Decimal.lt(foundationProgress.value, 100) || management.elfTraining.expandersElfTraining.milestones[2].earned.value), onClick() { if (!unref(this.canClick)) { return; @@ -280,7 +282,7 @@ const layer = createLayer(id, function (this: BaseLayer) { % completed - {Decimal.lt(foundationProgress.value, 100) ? : null} + {Decimal.lt(foundationProgress.value, 100) || management.elfTraining.expandersElfTraining.milestones[2].earned.value ? : null} {render(buildFoundation)} {milestonesDisplay()} From c7705f467d0619b88f80246c63cb9c69a8f56aa8 Mon Sep 17 00:00:00 2001 From: Anthony Lawn Date: Mon, 12 Dec 2022 14:18:08 -0600 Subject: [PATCH 03/67] Fix addSoftcap not affecting currentAt or nextAt --- src/features/conversion.ts | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/features/conversion.ts b/src/features/conversion.ts index 91636c1..6c95c1e 100644 --- a/src/features/conversion.ts +++ b/src/features/conversion.ts @@ -511,6 +511,8 @@ export function addSoftcap( ): ScalingFunction { return { ...scaling, + currentAt: conversion => softcap(scaling.currentAt(conversion), unref(cap), Decimal.recip(unref(power))), + nextAt: conversion => softcap(scaling.nextAt(conversion), unref(cap), Decimal.recip(unref(power))), currentGain: conversion => softcap(scaling.currentGain(conversion), unref(cap), unref(power)) }; From 640a74e55c52fbc57212b86f022a621db7b8368e Mon Sep 17 00:00:00 2001 From: Anthony Lawn Date: Mon, 12 Dec 2022 14:36:55 -0600 Subject: [PATCH 04/67] Implemented Ivy lv1-3 --- src/data/layers/elves.tsx | 3 ++- src/data/layers/trees.tsx | 7 ++++++- 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/src/data/layers/elves.tsx b/src/data/layers/elves.tsx index 5dfed6c..59afb46 100644 --- a/src/data/layers/elves.tsx +++ b/src/data/layers/elves.tsx @@ -539,7 +539,8 @@ const layer = createLayer(id, function (this: BaseLayer) { description: "Ivy will automatically purchase planters you can afford, without actually spending any logs.", buyable: trees.row1Buyables[1], - cooldownModifier: planterCooldown + cooldownModifier: planterCooldown, + buyMax: () => management.elfTraining.planterElfTraining.milestones[1].earned.value }); const expandersElf = createElf({ name: "Hope", diff --git a/src/data/layers/trees.tsx b/src/data/layers/trees.tsx index 5b7ccce..2aad71f 100644 --- a/src/data/layers/trees.tsx +++ b/src/data/layers/trees.tsx @@ -385,7 +385,12 @@ const layer = createLayer(id, function (this: BaseLayer) { createMultiplicativeModifier(() => ({ multiplier: 2, description: "Mary Level 2", - enabled: management.elfTraining.planterElfTraining.milestones[1].earned + enabled: management.elfTraining.heatedPlanterElfTraining.milestones[1].earned + })), + createMultiplicativeModifier(() => ({ + multiplier: () => Decimal.pow(trees.value, .2).log10().pow_base(2), + description: "Ivy Level 3", + enabled: management.elfTraining.planterElfTraining.milestones[2].earned })) ]) as WithRequired; const computedAutoPlantingAmount = computed(() => autoPlantingAmount.apply(0)); From 1632e16e5d4e796d9766178bdc71cc2fc1ba5191 Mon Sep 17 00:00:00 2001 From: Anthony Lawn Date: Mon, 12 Dec 2022 14:40:49 -0600 Subject: [PATCH 05/67] Implemented holly lv1-3 --- src/data/layers/cloth.tsx | 2 +- src/data/layers/elves.tsx | 3 ++- src/data/layers/management.tsx | 4 ++-- src/data/layers/trees.tsx | 2 +- 4 files changed, 6 insertions(+), 5 deletions(-) diff --git a/src/data/layers/cloth.tsx b/src/data/layers/cloth.tsx index e3f4208..7dbf718 100644 --- a/src/data/layers/cloth.tsx +++ b/src/data/layers/cloth.tsx @@ -331,7 +331,7 @@ const layer = createLayer(id, function (this: BaseLayer) { })); const paperUpgrades = { paperUpgrade4, paperUpgrade3, paperUpgrade2, paperUpgrade1 }; - const hollyEffect = computed(() => Decimal.add(trees.computedAutoCuttingAmount.value, 1).log10().add(1)); + const hollyEffect = computed(() => Decimal.add(trees.computedAutoCuttingAmount.value, 1).root(3)); const gingersnapEffect = computed(() => Decimal.add(dyes.dyeSum.value, 10).log10()); const sheepGain = createSequentialModifier(() => [ diff --git a/src/data/layers/elves.tsx b/src/data/layers/elves.tsx index 59afb46..d7e2f6e 100644 --- a/src/data/layers/elves.tsx +++ b/src/data/layers/elves.tsx @@ -532,7 +532,8 @@ const layer = createLayer(id, function (this: BaseLayer) { description: "Holly will automatically purchase cutters you can afford, without actually spending any logs.", buyable: trees.row1Buyables[0], - cooldownModifier: cutterCooldown + cooldownModifier: cutterCooldown, + buyMax: () => management.elfTraining.cutterElfTraining.milestones[1].earned.value }); const plantersElf = createElf({ name: "Ivy", diff --git a/src/data/layers/management.tsx b/src/data/layers/management.tsx index 08fcb9d..0984d2a 100644 --- a/src/data/layers/management.tsx +++ b/src/data/layers/management.tsx @@ -219,7 +219,7 @@ const layer = createLayer(id, () => { createMilestone(() => ({ display: { requirement: "Holly Level 1", - effectDisplay: jsx(() => <>Multiply log gain by (Cutter amount)3.) + effectDisplay: jsx(() => <>Multiply log gain by 3Cutter amount.) }, shouldEarn: () => cutterElfTraining.level.value >= 1 })), @@ -234,7 +234,7 @@ const layer = createLayer(id, () => { createMilestone(() => ({ display: { requirement: "Holly Level 3", - effectDisplay: jsx(() => <>Multiply all cloth actions' effectiveness by (Cutter amount)3.) + effectDisplay: jsx(() => <>Multiply all cloth actions' effectiveness by 3Cutter amount.) }, visibility: () => showIf(cutterElfMilestones[1].earned.value), shouldEarn: () => cutterElfTraining.level.value >= 3 diff --git a/src/data/layers/trees.tsx b/src/data/layers/trees.tsx index 2aad71f..ae53265 100644 --- a/src/data/layers/trees.tsx +++ b/src/data/layers/trees.tsx @@ -455,7 +455,7 @@ const layer = createLayer(id, function (this: BaseLayer) { })), createMultiplicativeModifier(() => ({ multiplier: computed(() => - Decimal.add(computedAutoCuttingAmount.value, 1).log10().plus(1) + Decimal.add(computedAutoCuttingAmount.value, 1).root(3) ), description: "Holly Level 1", enabled: management.elfTraining.cutterElfTraining.milestones[0].earned From 62b44b3ae359b326e78a00db574a591bd45d6e69 Mon Sep 17 00:00:00 2001 From: Anthony Lawn Date: Mon, 12 Dec 2022 15:29:57 -0600 Subject: [PATCH 06/67] Update >100% workshop milestones --- src/data/layers/workshop.tsx | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/src/data/layers/workshop.tsx b/src/data/layers/workshop.tsx index d17ba6b..961a678 100644 --- a/src/data/layers/workshop.tsx +++ b/src/data/layers/workshop.tsx @@ -173,50 +173,50 @@ const layer = createLayer(id, function (this: BaseLayer) { })); const extraExpansionMilestone1 = createMilestone(() => ({ display: { - requirement: "120% Foundation Completed", + requirement: "200% Foundation Completed", effectDisplay: "The 1% milestone is now +2% and multiplicative" }, - shouldEarn: () => Decimal.gte(foundationProgress.value, 120), + shouldEarn: () => Decimal.gte(foundationProgress.value, 200), visibility: () => showIf(management.elfTraining.expandersElfTraining.milestones[2].earned.value), showPopups: shouldShowPopups })); const extraExpansionMilestone2 = createMilestone(() => ({ display: { - requirement: "140% Foundation Completed", + requirement: "400% Foundation Completed", effectDisplay: "Gain +10% metal for every 10% foundation completed" }, - shouldEarn: () => Decimal.gte(foundationProgress.value, 140), + shouldEarn: () => Decimal.gte(foundationProgress.value, 400), visibility: () => showIf(management.elfTraining.expandersElfTraining.milestones[2].earned.value), showPopups: shouldShowPopups })); const extraExpansionMilestone3 = createMilestone(() => ({ display: { - requirement: "160% Foundation Completed", + requirement: "600% Foundation Completed", effectDisplay: "Gain +10% oil for every 10% foundation completed" }, - shouldEarn: () => Decimal.gte(foundationProgress.value, 160), + shouldEarn: () => Decimal.gte(foundationProgress.value, 600), visibility: () => showIf(management.elfTraining.expandersElfTraining.milestones[2].earned.value), showPopups: shouldShowPopups })); const extraExpansionMilestone4 = createMilestone(() => ({ display: { - requirement: "180% Foundation Completed", + requirement: "800% Foundation Completed", effectDisplay: "Gain +10% plastic for every 10% foundation completed" }, - shouldEarn: () => Decimal.gte(foundationProgress.value, 180), + shouldEarn: () => Decimal.gte(foundationProgress.value, 800), visibility: () => showIf(management.elfTraining.expandersElfTraining.milestones[2].earned.value), showPopups: shouldShowPopups })); const extraExpansionMilestone5 = createMilestone(() => ({ display: { - requirement: "200% Foundation Completed", + requirement: "1000% Foundation Completed", effectDisplay: "Double paper, boxes, and all cloth actions" }, - shouldEarn: () => Decimal.gte(foundationProgress.value, 200), + shouldEarn: () => Decimal.gte(foundationProgress.value, 1000), visibility: () => showIf(management.elfTraining.expandersElfTraining.milestones[2].earned.value), showPopups: shouldShowPopups From 06b9d06da615b553649201533fe2bcff1d6a8083 Mon Sep 17 00:00:00 2001 From: Anthony Lawn Date: Mon, 12 Dec 2022 15:58:13 -0600 Subject: [PATCH 07/67] Workshop scaling --- src/data/layers/workshop.tsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/data/layers/workshop.tsx b/src/data/layers/workshop.tsx index 961a678..aebfc6f 100644 --- a/src/data/layers/workshop.tsx +++ b/src/data/layers/workshop.tsx @@ -49,7 +49,7 @@ const layer = createLayer(id, function (this: BaseLayer) { const foundationConversion: Conversion = createIndependentConversion(() => ({ - scaling: addSoftcap(addSoftcap(createPolynomialScaling(250, 1.5), 100, 1/5), 1000, 1/10), + scaling: addSoftcap(addSoftcap(createPolynomialScaling(250, 1.5), 5387, 1/1e10), 1e20, 1e9), baseResource: trees.logs, gainResource: noPersist(foundationProgress), roundUpCost: true, From 6d268f95fbe3264a44a1b5c290b30ccd7cf60963 Mon Sep 17 00:00:00 2001 From: Anthony Lawn Date: Mon, 12 Dec 2022 15:59:40 -0600 Subject: [PATCH 08/67] WIP setting up day 13 using same layer --- src/data/layers/management.tsx | 5 +++-- src/data/projEntry.tsx | 15 ++++++++------- 2 files changed, 11 insertions(+), 9 deletions(-) diff --git a/src/data/layers/management.tsx b/src/data/layers/management.tsx index 0984d2a..32415ec 100644 --- a/src/data/layers/management.tsx +++ b/src/data/layers/management.tsx @@ -32,6 +32,7 @@ import dyes from "./dyes"; const id = "management"; const day = 12; +const advancedDay = 13; interface ElfTrainingClickable extends GenericClickable { name: string, @@ -58,7 +59,7 @@ const layer = createLayer(id, () => { height: 25, fillStyle: `backgroundColor: ${color}`, progress: () => - main.day.value === day ? totalElfLevels.value / (elves.totalElves.value * 5) : 1, + main.day.value === day ? Object.values(elfTraining).reduce((acc, curr) => acc + curr.level.value / 3, 0) / Object.keys(elves).length : 1, display: jsx(() => main.day.value === day ? ( <> @@ -1137,7 +1138,7 @@ const layer = createLayer(id, () => { display: jsx(() => ( <> - {main.day.value === day ? `Get all elves to level 5.` : `${name} Complete!`} - + {main.day.value === day ? `Get all elves to level 3.` : main.day.value === advancedDay && main.days[advancedDay - 1].opened.value ? `Get all elves to level 5.` : `${name} Complete!`} - {render(modifiersModal)} {render(dayProgress)} -
- {renderCol(schools, classrooms)}{" "} - {renderGrid([teaching, classroomUpgrade])} - { - Decimal.gt(schools.amount.value, 0) ? <> -
+
+ {renderCol(schools, classrooms)} {renderGrid([teaching, classroomUpgrade])} + {Decimal.gt(schools.amount.value, 0) ? ( + <> +
Click on an elf to see their milestones. -

+
+
{render(focusButton)} -
+
{renderGrid( [focusMeter], treeElfTraining, @@ -1167,8 +1276,10 @@ const layer = createLayer(id, () => { )} {currentElfDisplay()} - : "" - } + + ) : ( + "" + )} )) }; From ecfa65548d12540ff1f963ff5e5e5b15fca3dcd5 Mon Sep 17 00:00:00 2001 From: circle-gon <97845741+circle-gon@users.noreply.github.com> Date: Mon, 12 Dec 2022 22:54:01 +0000 Subject: [PATCH 10/67] some more minor fixes and a hotfix for codespaces --- src/data/layers/management.tsx | 258 +++++++++++++++++++++------------ vite.config.ts | 5 + 2 files changed, 169 insertions(+), 94 deletions(-) diff --git a/src/data/layers/management.tsx b/src/data/layers/management.tsx index 32415ec..ea8404e 100644 --- a/src/data/layers/management.tsx +++ b/src/data/layers/management.tsx @@ -11,16 +11,14 @@ import { createLayer } from "game/layers"; import { Persistent, persistent } from "game/persistence"; import Decimal, { DecimalSource, format, formatTime, formatWhole } from "util/bignum"; import { Direction } from "util/common"; -import { render, renderCol, renderGrid, renderRow } from "util/vue"; +import { render, renderCol, renderGrid } from "util/vue"; import { computed, ComputedRef, ref, Ref } from "vue"; -import { createTabFamily } from "features/tabs/tabFamily"; -import { createTab } from "features/tabs/tab"; import elves from "./elves"; import trees from "./trees"; import { globalBus } from "game/events"; import { createMultiplicativeModifier, createSequentialModifier, Modifier } from "game/modifiers"; import Modal from "components/Modal.vue"; -import { createBuyable, GenericBuyable } from "features/buyable"; +import { createBuyable } from "features/buyable"; import { createUpgrade } from "features/upgrades/upgrade"; import coal from "./coal"; import paper from "./paper"; @@ -35,16 +33,16 @@ const day = 12; const advancedDay = 13; interface ElfTrainingClickable extends GenericClickable { - name: string, - state: Persistent, - displayMilestone: JSXFunction, - level: ComputedRef, - exp: Persistent, - milestones: GenericMilestone[], - timeForExp: ComputedRef, - amountOfTimesDone: Ref, - elfXPGainComputed: ComputedRef, - elfXPGain: Modifier, + name: string; + state: Persistent; + displayMilestone: JSXFunction; + level: ComputedRef; + exp: Persistent; + milestones: GenericMilestone[]; + timeForExp: ComputedRef; + amountOfTimesDone: Ref; + elfXPGainComputed: ComputedRef; + elfXPGain: Modifier; } const layer = createLayer(id, () => { @@ -59,7 +57,10 @@ const layer = createLayer(id, () => { height: 25, fillStyle: `backgroundColor: ${color}`, progress: () => - main.day.value === day ? Object.values(elfTraining).reduce((acc, curr) => acc + curr.level.value / 3, 0) / Object.keys(elves).length : 1, + main.day.value === day + ? Object.values(elfTraining).reduce((acc, curr) => acc + curr.level.value / 3, 0) / + Object.keys(elves).length + : 1, display: jsx(() => main.day.value === day ? ( <> @@ -80,7 +81,6 @@ const layer = createLayer(id, () => { return elfLevel; }); - // ------------------------------------------------------------------------------- Upgrades const teaching = createUpgrade(() => ({ @@ -141,17 +141,24 @@ const layer = createLayer(id, () => { height: 12, style: () => ({ "margin-top": "8px", - "box-shadow": focusTargets.value[elf.name] + "box-shadow": focusTargets.value[elf.name] ? "0 0 12px " + (currentShown.value == elf.name ? "black" : "white") - : "", + : "" }), baseStyle: "margin-top: 0", fillStyle: "margin-top: 0; transition-duration: 0s", - borderStyle: () => Decimal.gte(level.value, schools.amount.value) ? "border-color: red" : "", + borderStyle: () => + Decimal.gte(level.value, schools.amount.value) ? "border-color: red" : "", progress: () => Decimal.div(expToNextLevel.value, expRequiredForNextLevel.value), - display: jsx(() => Decimal.gte(level.value, schools.amount.value) - ? <>Limit reached - : <>{format(expToNextLevel.value)}/{format(expRequiredForNextLevel.value)} XP) + display: jsx(() => + Decimal.gte(level.value, schools.amount.value) ? ( + <>Limit reached + ) : ( + <> + {format(expToNextLevel.value)}/{format(expRequiredForNextLevel.value)} XP + + ) + ) })); const { collapseMilestones: state, display: displayMilestone } = createCollapsibleMilestones(milestones as Record); @@ -163,7 +170,7 @@ const layer = createLayer(id, () => { createMultiplicativeModifier(() => ({ multiplier: focusMulti, description: "Focus Multiplier", - enabled: () => focusRolling.value <= 0 && focusTargets.value[elf.name] == true + enabled: () => focusTime.value > 0 && focusTargets.value[elf.name] == true })), ...modifiers ]); @@ -173,10 +180,9 @@ const layer = createLayer(id, () => { title: elf.name, description: jsx(() => ( <> - {elf.name} is currently at level {formatWhole(level.value)}, and - achieved a total of {format(exp.value)} XP. - They buy buyables {formatWhole(elf.computedAutoBuyCooldown.value)} times per - second, gaining{" "} + {elf.name} is currently at level {formatWhole(level.value)}, and achieved a + total of {format(exp.value)} XP. They buy buyables{" "} + {formatWhole(elf.computedAutoBuyCooldown.value)} times per second, gaining{" "} {Decimal.gte(level.value, schools.amount.value) ? 0 : format( @@ -192,7 +198,7 @@ const layer = createLayer(id, () => { }, style: () => ({ width: "190px", - background: currentShown.value == elf.name ? "var(--foreground)" : "", + background: currentShown.value == elf.name ? "var(--foreground)" : "" }), onClick() { currentShown.value = elf.name; @@ -220,7 +226,12 @@ const layer = createLayer(id, () => { createMilestone(() => ({ display: { requirement: "Holly Level 1", - effectDisplay: jsx(() => <>Multiply log gain by 3Cutter amount.) + effectDisplay: jsx(() => ( + <> + Multiply log gain by 3 + Cutter amount. + + )) }, shouldEarn: () => cutterElfTraining.level.value >= 1 })), @@ -235,7 +246,12 @@ const layer = createLayer(id, () => { createMilestone(() => ({ display: { requirement: "Holly Level 3", - effectDisplay: jsx(() => <>Multiply all cloth actions' effectiveness by 3Cutter amount.) + effectDisplay: jsx(() => ( + <> + Multiply all cloth actions' effectiveness by 3 + Cutter amount. + + )) }, visibility: () => showIf(cutterElfMilestones[1].earned.value), shouldEarn: () => cutterElfTraining.level.value >= 3 @@ -276,7 +292,14 @@ const layer = createLayer(id, () => { createMilestone(() => ({ display: { requirement: "Ivy Level 3", - effectDisplay: jsx(() => <>Planting speed is multiplied by 2(log10(logs)0.2)) + effectDisplay: jsx(() => ( + <> + Planting speed is multiplied by 2 + + (log10(logs)0.2) + + + )) }, visibility: () => showIf(planterElfMilestones[1].earned.value), shouldEarn: () => planterElfTraining.level.value >= 3 @@ -317,7 +340,8 @@ const layer = createLayer(id, () => { createMilestone(() => ({ display: { requirement: "Hope Level 3", - effectDisplay: "The workshop can be expanded past 100%, but costs scale faster. It also buys max now." + effectDisplay: + "The workshop can be expanded past 100%, but costs scale faster. It also buys max now." }, visibility: () => showIf(expanderElfMilestones[1].earned.value), shouldEarn: () => expandersElfTraining.level.value >= 3 @@ -418,7 +442,11 @@ const layer = createLayer(id, () => { createMilestone(() => ({ display: { requirement: "Mary Level 5", - effectDisplay: jsx(() => <>Auto smelting speed is multiplied by total XP/1000.) + effectDisplay: jsx(() => ( + <> + Auto smelting speed is multiplied by total XP/1000. + + )) }, visibility: () => showIf(heatedPlanterElfMilestones[3].earned.value && main.day.value >= 13), @@ -429,7 +457,11 @@ const layer = createLayer(id, () => { createMilestone(() => ({ display: { requirement: "Noel Level 1", - effectDisplay: jsx(() => <>Log gain is multiplied by total elf levels.) + effectDisplay: jsx(() => ( + <> + Log gain is multiplied by total elf levels. + + )) }, shouldEarn: () => heatedPlanterElfTraining.level.value >= 1 })), @@ -452,7 +484,11 @@ const layer = createLayer(id, () => { createMilestone(() => ({ display: { requirement: "Noel Level 4", - effectDisplay: jsx(() => <>Reduce oil refinery cost by (Plastic amount)2) + effectDisplay: jsx(() => ( + <> + Reduce oil refinery cost by (Plastic amount)2 + + )) }, visibility: () => showIf(fertilizerElfMilestones[2].earned.value && main.day.value >= 13), @@ -620,7 +656,11 @@ const layer = createLayer(id, () => { createMilestone(() => ({ display: { requirement: "Star Level 4", - effectDisplay: jsx(() => <>Multiply XP requirements by 0.95(total books)) + effectDisplay: jsx(() => ( + <> + Multiply XP requirements by 0.95(total books) + + )) }, visibility: () => showIf(paperElfMilestones[2].earned.value && main.day.value >= 13), shouldEarn: () => paperElfTraining.level.value >= 4 @@ -638,7 +678,11 @@ const layer = createLayer(id, () => { createMilestone(() => ({ display: { requirement: "Bell Level 1", - effectDisplay: jsx(() => <>Every box buyable adds level levels to same-row box buyables.) + effectDisplay: jsx(() => ( + <> + Every box buyable adds level levels to same-row box buyables. + + )) }, shouldEarn: () => boxElfTraining.level.value >= 1 })), @@ -686,7 +730,11 @@ const layer = createLayer(id, () => { createMilestone(() => ({ display: { requirement: "Gingersnap Level 2", - effectDisplay: jsx(() => <>Multiply all cloth actions' effectiveness by log10(dye sum + 10)) + effectDisplay: jsx(() => ( + <> + Multiply all cloth actions' effectiveness by log10(dye sum + 10) + + )) }, visibility: () => showIf(clothElfMilestones[0].earned.value), shouldEarn: () => clothElfTraining.level.value >= 2 @@ -699,26 +747,39 @@ const layer = createLayer(id, () => { visibility: () => showIf(clothElfMilestones[1].earned.value), shouldEarn: () => clothElfTraining.level.value >= 3, onComplete() { - (["red", "yellow", "blue", "orange", "green", "purple"] as const).forEach(dyeColor => { - dyes.dyes[dyeColor].amount.value = 0; - dyes.dyes[dyeColor].buyable.amount.value = 0; - }); + (["red", "yellow", "blue", "orange", "green", "purple"] as const).forEach( + dyeColor => { + dyes.dyes[dyeColor].amount.value = 0; + dyes.dyes[dyeColor].buyable.amount.value = 0; + } + ); } })), createMilestone(() => ({ display: { requirement: "Gingersnap Level 4", - effectDisplay: jsx(() => <>Multiply ALL dye gain by{" "} -
classrooms
2
+1, - but reset all dyes.) + effectDisplay: jsx(() => ( + <> + Multiply ALL dye gain by{" "} + +
+ classrooms +
+
2
+
+ +1, but reset all dyes. + + )) }, visibility: () => showIf(clothElfMilestones[2].earned.value && main.day.value >= 13), shouldEarn: () => clothElfTraining.level.value >= 4, onComplete() { - (["red", "yellow", "blue", "orange", "green", "purple"] as const).forEach(dyeColor => { - dyes.dyes[dyeColor].amount.value = 0; - dyes.dyes[dyeColor].buyable.amount.value = 0; - }); + (["red", "yellow", "blue", "orange", "green", "purple"] as const).forEach( + dyeColor => { + dyes.dyes[dyeColor].amount.value = 0; + dyes.dyes[dyeColor].buyable.amount.value = 0; + } + ); } })), createMilestone(() => ({ @@ -814,24 +875,25 @@ const layer = createLayer(id, () => { ); } } - - if (focusRolling.value > 0) { - focusRolling.value += diff; - focusMulti.value = Decimal.pow(focusMaxMulti.value, 1 - Math.abs(Math.sin((focusRolling.value - 1) * 3))); - rerollFocusTargets(12, 3); - } else { - focusRolling.value = Math.min(focusRolling.value + diff, 0); + focusTime.value = Math.max(focusTime.value - diff, 0); + focusCooldown.value = Math.max(focusCooldown.value - diff, 0); + if (focusTime.value > 0) { + focusMulti.value = Decimal.pow( + focusMaxMulti.value, + 1 - Math.abs(Math.sin((Date.now() / 1000) * 2)) + ); } }); - + // ------------------------------------------------------------------------------- Focus const focusMulti = persistent(1); const focusTargets = persistent>({}); - const focusRolling = persistent(0); + const focusCooldown = persistent(0); + const focusTime = persistent(0); const focusMaxMulti = computed(() => 10); - + const focusMeter = createBar(() => ({ direction: Direction.Right, width: 566, @@ -839,36 +901,36 @@ const layer = createLayer(id, () => { style: `border-radius: 4px 4px 0 0`, borderStyle: `border-radius: 4px 4px 0 0`, fillStyle: `background: ${color}; transition: none`, - progress: () => Decimal.sub(focusMulti.value, 1).div(Decimal.sub(focusMaxMulti.value, 1)).toNumber(), + progress: () => + Decimal.sub(focusMulti.value, 1).div(Decimal.sub(focusMaxMulti.value, 1)).toNumber(), display: jsx(() => <>{format(focusMulti.value)}x) })) as GenericBar; - + const focusButton = createClickable(() => ({ display: { title: "Focus", description: jsx(() => ( <> - {focusRolling.value <= 0 - ? <>Motivate elves to focus, multiplying 3 random elves' XP gain by up to {format(focusMaxMulti.value)}x - : "Click to stop the focus bar" - } - {focusRolling.value < 0 - ? <>
Reroll cooldown: {formatTime(-focusRolling.value)} - : "" - } + Motivate elves to focus, multiplying 3 random elves' XP gain by up to{" "} + {format(focusMaxMulti.value)}x, equal to the focus bars' effect. + {focusCooldown.value > 0 ? ( + <> +
+ Reroll cooldown: {formatTime(focusCooldown.value)} + + ) : ( + "" + )} )) }, style: { width: "300px" }, - canClick: () => focusRolling.value >= 0, + canClick: () => focusCooldown.value === 0, onClick() { - if (focusRolling.value == 0) { - focusRolling.value = 1; - } else if (focusRolling.value > 0) { - focusRolling.value = -30; - } + focusCooldown.value = 15; + focusTime.value = 10; } })); @@ -884,7 +946,7 @@ const layer = createLayer(id, () => { } } } - + // ------------------------------------------------------------------------------- Schools const schoolCost = computed(() => { @@ -909,9 +971,9 @@ const layer = createLayer(id, () => { You gotta start somewhere, right? Each school increases the maximum level for elves by 1, up to 5. -
You have {formatWhole(schools.amount.value)} schools, - which are currently letting elves learn up to level{" "} - {formatWhole(schools.amount.value)}. +
+ You have {formatWhole(schools.amount.value)} schools, which are currently + letting elves learn up to level {formatWhole(schools.amount.value)}.
Costs {format(schoolCost.value.wood)} logs, {format(schoolCost.value.coal)}{" "} @@ -978,8 +1040,9 @@ const layer = createLayer(id, () => { Hopefully it makes the school a bit less boring. Multiplies elves' XP gain by{" "} Classrooms + 1.
-
You have {formatWhole(schools.amount.value)} classrooms, - which are currently multiplying elves' XP gain by {format(classroomEffect.value)} +
+ You have {formatWhole(classrooms.amount.value)} classrooms, which are currently + multiplying elves' XP gain by {format(classroomEffect.value)}
Costs {format(classroomCost.value.wood)} logs,{" "} @@ -1113,7 +1176,6 @@ const layer = createLayer(id, () => { /> )); - // ------------------------------------------------------------------------------- Return return { @@ -1134,11 +1196,17 @@ const layer = createLayer(id, () => { focusMultiplier: focusMulti, focusTargets, - focusRolling, + focusCooldown, + focusTime, display: jsx(() => ( <> - {main.day.value === day ? `Get all elves to level 3.` : main.day.value === advancedDay && main.days[advancedDay - 1].opened.value ? `Get all elves to level 5.` : `${name} Complete!`} - + {main.day.value === day + ? `Get all elves to level 3.` + : main.day.value === advancedDay && main.days[advancedDay - 1].opened.value + ? `Get all elves to level 5.` + : `${name} Complete!`}{" "} + - {render(modifiersModal)} {render(dayProgress)} -
- {renderCol(schools, classrooms)}{" "} - {renderGrid([teaching, classroomUpgrade])} - { - Decimal.gt(schools.amount.value, 0) ? <> -
+
+ {renderCol(schools, classrooms)} {renderGrid([teaching, classroomUpgrade])} + {Decimal.gt(schools.amount.value, 0) ? ( + <> +
Click on an elf to see their milestones. -

+
+
{render(focusButton)} -
+
{renderGrid( [focusMeter], treeElfTraining, @@ -1167,8 +1235,10 @@ const layer = createLayer(id, () => { )} {currentElfDisplay()} - : "" - } + + ) : ( + "" + )} )) }; diff --git a/vite.config.ts b/vite.config.ts index 080d8e6..3772079 100644 --- a/vite.config.ts +++ b/vite.config.ts @@ -24,6 +24,11 @@ export default defineConfig({ vue: "vue/dist/vue.esm-bundler.js" } }, + server: { + hmr: { + clientPort: process.env.CODESPACES ? 443 : undefined + } + }, plugins: [ vue(), vueJsx({ From 25f6a2ab7b3e62a633249b98b249deb32f6b8a5e Mon Sep 17 00:00:00 2001 From: unsoftcapped3 <75136164+unsoftcapped3@users.noreply.github.com> Date: Mon, 12 Dec 2022 15:08:52 -0800 Subject: [PATCH 11/67] add focus upgrades(this will probably cause errors --- src/data/layers/management.tsx | 28 +++++++++++++++++++++++++++- 1 file changed, 27 insertions(+), 1 deletion(-) diff --git a/src/data/layers/management.tsx b/src/data/layers/management.tsx index 0669a79..3b9f37a 100644 --- a/src/data/layers/management.tsx +++ b/src/data/layers/management.tsx @@ -988,7 +988,31 @@ const layer = createLayer(id, () => { } } } - + const focusUpgrade1 = createUpgrade(() => ({ + display: { + title: "Focus Booster", + description: "Double experience multiplier from focus" + }, + resource: trees.trees, + cost: 1e30 + })); + const focusUpgrade2 = createUpgrade(() => ({ + display: { + title: "Focus Buffer", + description: "Increase elves affected by focus by 1" + }, + resource: trees, + cost: 1e40 + })); + const focusUpgrade3 = createUpgrade(() => ({ + display: { + title: "Focus Upgrader", + description: "Focus can now be rerolled every 10 seconds" + }, + resource: trees.trees, + cost: 1e50 + })); + const upgrades = { focusUpgrade1, focusUpgrade2, focusUpgrade3 }; // ------------------------------------------------------------------------------- Schools const schoolCost = computed(() => { @@ -1237,8 +1261,10 @@ const layer = createLayer(id, () => { classroomUpgrade, focusMultiplier: focusMulti, + upgrades, focusTargets, focusRolling, + display: jsx(() => ( <> From b609ea1000a0aaab6ae93646caff38893fc00301 Mon Sep 17 00:00:00 2001 From: unsoftcapped3 <75136164+unsoftcapped3@users.noreply.github.com> Date: Mon, 12 Dec 2022 15:14:19 -0800 Subject: [PATCH 12/67] There is no error. --- src/data/layers/management.tsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/data/layers/management.tsx b/src/data/layers/management.tsx index 3b9f37a..4d3232d 100644 --- a/src/data/layers/management.tsx +++ b/src/data/layers/management.tsx @@ -1001,7 +1001,7 @@ const layer = createLayer(id, () => { title: "Focus Buffer", description: "Increase elves affected by focus by 1" }, - resource: trees, + resource: trees.trees, cost: 1e40 })); const focusUpgrade3 = createUpgrade(() => ({ From bee8ce7d5169e7205fa7dc409d6488a902a890f5 Mon Sep 17 00:00:00 2001 From: thepaperpilot Date: Mon, 12 Dec 2022 17:17:31 -0600 Subject: [PATCH 13/67] Implement Holly and Ivy lv4-5 --- src/data/layers/management.tsx | 22 +++--------- src/data/layers/trees.tsx | 39 +++++++++++++++++---- src/data/layers/workshop.tsx | 63 +++++++++++++++++++--------------- 3 files changed, 73 insertions(+), 51 deletions(-) diff --git a/src/data/layers/management.tsx b/src/data/layers/management.tsx index 4d3232d..f384f72 100644 --- a/src/data/layers/management.tsx +++ b/src/data/layers/management.tsx @@ -32,19 +32,6 @@ const id = "management"; const day = 12; const advancedDay = 13; -interface ElfTrainingClickable extends GenericClickable { - name: string; - state: Persistent; - displayMilestone: JSXFunction; - level: ComputedRef; - exp: Persistent; - milestones: GenericMilestone[]; - timeForExp: ComputedRef; - amountOfTimesDone: Ref; - elfXPGainComputed: ComputedRef; - elfXPGain: Modifier; -} - const layer = createLayer(id, () => { const name = "Management"; const color = "green"; // idk what to do @@ -262,7 +249,7 @@ const layer = createLayer(id, () => { createMilestone(() => ({ display: { requirement: "Holly Level 4", - effectDisplay: "Multiply cutting speed by 1.1 per day completed" + effectDisplay: "Multiply auto cutting amount by 1.1 per day completed" }, visibility: () => showIf(cutterElfMilestones[2].earned.value && main.day.value >= 13), shouldEarn: () => cutterElfTraining.level.value >= 4 @@ -297,7 +284,7 @@ const layer = createLayer(id, () => { requirement: "Ivy Level 3", effectDisplay: jsx(() => ( <> - Planting speed is multiplied by 2 + Auto planting speed is multiplied by 2 (log10(logs)0.2) @@ -318,7 +305,8 @@ const layer = createLayer(id, () => { createMilestone(() => ({ display: { requirement: "Ivy Level 5", - effectDisplay: "Boost planting/cutting speed based on which is falling behind" + effectDisplay: + "The lesser of auto planting and cutting amounts is increased to match the greater" }, visibility: () => showIf(planterElfMilestones[3].earned.value && main.day.value >= 13), shouldEarn: () => planterElfTraining.level.value >= 5 @@ -861,7 +849,7 @@ const layer = createLayer(id, () => { paperElfTraining, boxElfTraining, clothElfTraining - } as Record; + }; const day12Elves = [ cutterElfTraining, planterElfTraining, diff --git a/src/data/layers/trees.tsx b/src/data/layers/trees.tsx index ae53265..0d17f64 100644 --- a/src/data/layers/trees.tsx +++ b/src/data/layers/trees.tsx @@ -27,7 +27,7 @@ import { noPersist, persistent } from "game/persistence"; import Decimal, { DecimalSource, format, formatGain, formatLimit, formatWhole } from "util/bignum"; import { Direction, WithRequired } from "util/common"; import { render, renderGrid, renderRow } from "util/vue"; -import { computed, ref } from "vue"; +import { computed, ref, watch } from "vue"; import boxes from "./boxes"; import cloth from "./cloth"; import coal from "./coal"; @@ -223,7 +223,11 @@ const layer = createLayer(id, function (this: BaseLayer) { 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.plantersBook.amount.value).times(v); - return Decimal.times(100, v).add(200); + let cost = Decimal.times(100, v).add(200); + if (management.elfTraining.planterElfTraining.milestones[3].earned.value) { + cost = Decimal.div(cost, 10); + } + return cost; }, display: { title: "Generic Planters", @@ -310,9 +314,24 @@ const layer = createLayer(id, function (this: BaseLayer) { multiplier: 4, description: "Lumberjack Jeans", enabled: cloth.treesUpgrades.treesUpgrade2.bought + })), + createMultiplicativeModifier(() => ({ + multiplier: () => Decimal.pow(1.1, main.day.value), + description: "Holly Level 4", + enabled: management.elfTraining.cutterElfTraining.milestones[3].earned + })), + createAdditiveModifier(() => ({ + addend: () => + Decimal.sub(lastAutoCuttingAmount.value, lastAutoPlantedAmount.value).max(0), + description: "Ivy Level 5", + enabled: management.elfTraining.planterElfTraining.milestones[4].earned })) ]) as WithRequired; const computedAutoCuttingAmount = computed(() => autoCuttingAmount.apply(0)); + const lastAutoCuttingAmount = ref(0); + watch(computedAutoCuttingAmount, cut => { + lastAutoCuttingAmount.value = cut; + }); const manualPlantingAmount = createSequentialModifier(() => [ createAdditiveModifier(() => ({ @@ -388,12 +407,22 @@ const layer = createLayer(id, function (this: BaseLayer) { enabled: management.elfTraining.heatedPlanterElfTraining.milestones[1].earned })), createMultiplicativeModifier(() => ({ - multiplier: () => Decimal.pow(trees.value, .2).log10().pow_base(2), + multiplier: () => Decimal.pow(trees.value, 0.2).log10().pow_base(2), description: "Ivy Level 3", enabled: management.elfTraining.planterElfTraining.milestones[2].earned + })), + createAdditiveModifier(() => ({ + addend: () => + Decimal.sub(lastAutoPlantedAmount.value, lastAutoCuttingAmount.value).max(0), + description: "Ivy Level 5", + enabled: management.elfTraining.planterElfTraining.milestones[4].earned })) ]) as WithRequired; const computedAutoPlantingAmount = computed(() => autoPlantingAmount.apply(0)); + const lastAutoPlantedAmount = ref(0); + watch(computedAutoPlantingAmount, planted => { + lastAutoPlantedAmount.value = planted; + }); const logGain = createSequentialModifier(() => [ createMultiplicativeModifier(() => ({ @@ -454,9 +483,7 @@ const layer = createLayer(id, function (this: BaseLayer) { enabled: dyes.upgrades.blueDyeUpg.bought })), createMultiplicativeModifier(() => ({ - multiplier: computed(() => - Decimal.add(computedAutoCuttingAmount.value, 1).root(3) - ), + multiplier: computed(() => Decimal.add(computedAutoCuttingAmount.value, 1).root(3)), description: "Holly Level 1", enabled: management.elfTraining.cutterElfTraining.milestones[0].earned })), diff --git a/src/data/layers/workshop.tsx b/src/data/layers/workshop.tsx index aebfc6f..1058726 100644 --- a/src/data/layers/workshop.tsx +++ b/src/data/layers/workshop.tsx @@ -9,35 +9,24 @@ import { createBar } from "features/bars/bar"; import { createClickable } from "features/clickables/clickable"; import { addSoftcap, - Conversion, createIndependentConversion, - createPolynomialScaling, - ScalingFunction + createPolynomialScaling } from "features/conversion"; import { jsx, showIf } from "features/feature"; import { createHotkey } from "features/hotkey"; import { createMilestone } from "features/milestones/milestone"; -import { createResource, displayResource, Resource } from "features/resources/resource"; +import { createResource, displayResource } from "features/resources/resource"; import { BaseLayer, createLayer } from "game/layers"; +import { createExponentialModifier, createSequentialModifier } from "game/modifiers"; import { noPersist } from "game/persistence"; import Decimal, { DecimalSource, formatWhole } from "util/bignum"; import { Direction } from "util/common"; -import { Computable } from "util/computed"; import { render } from "util/vue"; import { computed, unref, watchEffect } from "vue"; import elves from "./elves"; import management from "./management"; import trees from "./trees"; -interface FoundationConversionOptions { - scaling: ScalingFunction; - baseResource: Resource; - gainResource: Resource; - roundUpCost: boolean; - buyMax: Computable; - spend: (gain: DecimalSource, spent: DecimalSource) => void; -} - const id = "workshop"; const day = 2; const layer = createLayer(id, function (this: BaseLayer) { @@ -47,17 +36,27 @@ const layer = createLayer(id, function (this: BaseLayer) { const foundationProgress = createResource(0, "foundation progress"); - const foundationConversion: Conversion = - createIndependentConversion(() => ({ - scaling: addSoftcap(addSoftcap(createPolynomialScaling(250, 1.5), 5387, 1/1e10), 1e20, 1e9), - baseResource: trees.logs, - gainResource: noPersist(foundationProgress), - roundUpCost: true, - buyMax: management.elfTraining.heatedCutterElfTraining.milestones[2].earned, - spend(gain, spent) { - trees.logs.value = Decimal.sub(trees.logs.value, spent); - } - })); + const foundationConversion = createIndependentConversion(() => ({ + scaling: addSoftcap( + addSoftcap(createPolynomialScaling(250, 1.5), 5387, 1 / 1e10), + 1e20, + 1e9 + ), + baseResource: trees.logs, + gainResource: noPersist(foundationProgress), + roundUpCost: true, + buyMax: management.elfTraining.heatedCutterElfTraining.milestones[2].earned, + spend(gain, spent) { + trees.logs.value = Decimal.sub(trees.logs.value, spent); + }, + costModifier: createSequentialModifier(() => [ + createExponentialModifier(() => ({ + exponent: 0.95, + description: "Holly Level 5", + enabled: management.elfTraining.cutterElfTraining.milestones[4].earned + })) + ]) + })); const buildFoundation = createClickable(() => ({ display: jsx(() => ( @@ -77,10 +76,15 @@ const layer = createLayer(id, function (this: BaseLayer) { )), - visibility: () => showIf(Decimal.lt(foundationProgress.value, 100) || management.elfTraining.expandersElfTraining.milestones[2].earned.value), + visibility: () => + showIf( + Decimal.lt(foundationProgress.value, 100) || + management.elfTraining.expandersElfTraining.milestones[2].earned.value + ), canClick: () => Decimal.gte(foundationConversion.actualGain.value, 1) && - (Decimal.lt(foundationProgress.value, 100) || management.elfTraining.expandersElfTraining.milestones[2].earned.value), + (Decimal.lt(foundationProgress.value, 100) || + management.elfTraining.expandersElfTraining.milestones[2].earned.value), onClick() { if (!unref(this.canClick)) { return; @@ -282,7 +286,10 @@ const layer = createLayer(id, function (this: BaseLayer) { % completed
- {Decimal.lt(foundationProgress.value, 100) || management.elfTraining.expandersElfTraining.milestones[2].earned.value ? : null} + {Decimal.lt(foundationProgress.value, 100) || + management.elfTraining.expandersElfTraining.milestones[2].earned.value ? ( + + ) : null} {render(buildFoundation)} {milestonesDisplay()} From 73c52990d8f2e208516a740a7e99b94b4f5be274 Mon Sep 17 00:00:00 2001 From: unsoftcapped3 <75136164+unsoftcapped3@users.noreply.github.com> Date: Mon, 12 Dec 2022 15:28:12 -0800 Subject: [PATCH 14/67] fix build thing --- src/data/layers/coal.tsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/data/layers/coal.tsx b/src/data/layers/coal.tsx index cc57d17..e22cce3 100644 --- a/src/data/layers/coal.tsx +++ b/src/data/layers/coal.tsx @@ -454,7 +454,7 @@ const layer = createLayer(id, function (this: BaseLayer) { 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.amount.value).times(v); - if (management.elfTraining.heatedPlantersElfTraining.milestones[0].earned.value) { + if (management.elfTraining.heatedPlanterElfTraining.milestones[0].earned.value) { v = Decimal.pow(0.95, paper.books.heatedPlantersBook.amount.value).times(v); } return Decimal.add(v, 1).pow(2.5).times(10); From de0cfc22f42f177ca87025e3b7064bfceee38cf3 Mon Sep 17 00:00:00 2001 From: unsoftcapped3 <75136164+unsoftcapped3@users.noreply.github.com> Date: Mon, 12 Dec 2022 15:32:15 -0800 Subject: [PATCH 15/67] Remove merge conflict marker --- src/data/layers/management.tsx | 3 --- 1 file changed, 3 deletions(-) diff --git a/src/data/layers/management.tsx b/src/data/layers/management.tsx index 31b3d8c..b9c1820 100644 --- a/src/data/layers/management.tsx +++ b/src/data/layers/management.tsx @@ -1240,13 +1240,10 @@ const layer = createLayer(id, () => { focusMultiplier: focusMulti, upgrades, focusTargets, -<<<<<<< HEAD focusCooldown, focusTime, -======= focusRolling, ->>>>>>> bee8ce7d5169e7205fa7dc409d6488a902a890f5 display: jsx(() => ( <> From d046f338d16d1b2759f7c1007c69662686c165ca Mon Sep 17 00:00:00 2001 From: unsoftcapped3 <75136164+unsoftcapped3@users.noreply.github.com> Date: Mon, 12 Dec 2022 15:38:10 -0800 Subject: [PATCH 16/67] remove focus rolling --- src/data/layers/management.tsx | 1 - 1 file changed, 1 deletion(-) diff --git a/src/data/layers/management.tsx b/src/data/layers/management.tsx index b9c1820..6323c81 100644 --- a/src/data/layers/management.tsx +++ b/src/data/layers/management.tsx @@ -1242,7 +1242,6 @@ const layer = createLayer(id, () => { focusTargets, focusCooldown, focusTime, - focusRolling, display: jsx(() => ( From dade814450bf1bdcf125639b325f153542dddc84 Mon Sep 17 00:00:00 2001 From: unsoftcapped3 <75136164+unsoftcapped3@users.noreply.github.com> Date: Mon, 12 Dec 2022 15:44:13 -0800 Subject: [PATCH 17/67] why is heatedCuttersElfTraining causing so many errors --- src/data/layers/coal.tsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/data/layers/coal.tsx b/src/data/layers/coal.tsx index e22cce3..f7e90fb 100644 --- a/src/data/layers/coal.tsx +++ b/src/data/layers/coal.tsx @@ -431,7 +431,7 @@ const layer = createLayer(id, function (this: BaseLayer) { 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.amount.value).times(v); - if (management.elfTraining.heatedCuttersElfTraining.milestones[0].earned.value) { + if (management.elfTraining.heatedCutterElfTraining.milestones[0].earned.value) { v = Decimal.pow(0.95, paper.books.heatedCuttersBook.amount.value).times(v); } return Decimal.add(v, 1).pow(2.5).times(10); From 7a5aec69f904b15401aae54096be519adff3b5ce Mon Sep 17 00:00:00 2001 From: unsoftcapped3 <75136164+unsoftcapped3@users.noreply.github.com> Date: Mon, 12 Dec 2022 15:50:49 -0800 Subject: [PATCH 18/67] attempted to add the focus upgrade effects --- src/data/layers/management.tsx | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/data/layers/management.tsx b/src/data/layers/management.tsx index 6323c81..a114018 100644 --- a/src/data/layers/management.tsx +++ b/src/data/layers/management.tsx @@ -901,6 +901,7 @@ const layer = createLayer(id, () => { focusMaxMulti.value, 1 - Math.abs(Math.sin((Date.now() / 1000) * 2)) ); + } }); @@ -911,7 +912,7 @@ const layer = createLayer(id, () => { const focusCooldown = persistent(0); const focusTime = persistent(0); - const focusMaxMulti = computed(() => 10); + const focusMaxMulti = computed(() => focusUpgrade1.bought.value ? 20 : 10); const focusMeter = createBar(() => ({ direction: Direction.Right, @@ -948,8 +949,9 @@ const layer = createLayer(id, () => { }, canClick: () => focusCooldown.value === 0, onClick() { - focusCooldown.value = 15; + focusCooldown.value = focusUpgrade3.bought.value ? 10 : 15; focusTime.value = 10; + rerollFocusTargets(12, focusUpgrade2.bought.value ? 4 : 3); } })); From 92612ff89643b2555fdb6d46977c619c331dcdb4 Mon Sep 17 00:00:00 2001 From: thepaperpilot Date: Mon, 12 Dec 2022 18:30:29 -0600 Subject: [PATCH 19/67] WIP implementing new elves --- src/data/layers/elves.tsx | 133 ++++++++++++++++++++++++++++++++++++-- src/data/layers/metal.tsx | 8 +-- 2 files changed, 133 insertions(+), 8 deletions(-) diff --git a/src/data/layers/elves.tsx b/src/data/layers/elves.tsx index d7e2f6e..c6dca5a 100644 --- a/src/data/layers/elves.tsx +++ b/src/data/layers/elves.tsx @@ -29,6 +29,8 @@ import boxes from "./boxes"; import cloth from "./cloth"; import coal from "./coal"; import management from "./management"; +import metal from "./metal"; +import oil from "./oil"; import paper from "./paper"; import plastic from "./plastic"; import trees from "./trees"; @@ -310,6 +312,57 @@ const layer = createLayer(id, function (this: BaseLayer) { enabled: elvesMilestone2.earned })) ]); + const miningDrillCooldown = createSequentialModifier(() => [ + createMultiplicativeModifier(() => ({ + multiplier: 2, + description: "6 Elves Trained", + enabled: elvesMilestone.earned + })), + // createMultiplicativeModifier(() => ({ + // multiplier: () => Decimal.times(paper.books.clothBook.amount.value, 0.1).add(1), + // description: "Fuzzy Bee and Friends", + // enabled: () => Decimal.gt(paper.books.clothBook.amount.value, 0) + // })), + createMultiplicativeModifier(() => ({ + multiplier: 2, + description: "10 Elves Trained", + enabled: elvesMilestone2.earned + })) + ]); + const metalCooldown = createSequentialModifier(() => [ + createMultiplicativeModifier(() => ({ + multiplier: 2, + description: "6 Elves Trained", + enabled: elvesMilestone.earned + })), + // createMultiplicativeModifier(() => ({ + // multiplier: () => Decimal.times(paper.books.clothBook.amount.value, 0.1).add(1), + // description: "Fuzzy Bee and Friends", + // enabled: () => Decimal.gt(paper.books.clothBook.amount.value, 0) + // })), + createMultiplicativeModifier(() => ({ + multiplier: 2, + description: "10 Elves Trained", + enabled: elvesMilestone2.earned + })) + ]); + const heavyDrillCooldown = createSequentialModifier(() => [ + createMultiplicativeModifier(() => ({ + multiplier: 2, + description: "6 Elves Trained", + enabled: elvesMilestone.earned + })), + // createMultiplicativeModifier(() => ({ + // multiplier: () => Decimal.times(paper.books.clothBook.amount.value, 0.1).add(1), + // description: "Fuzzy Bee and Friends", + // enabled: () => Decimal.gt(paper.books.clothBook.amount.value, 0) + // })), + createMultiplicativeModifier(() => ({ + multiplier: 2, + description: "10 Elves Trained", + enabled: elvesMilestone2.earned + })) + ]); const [generalTab, generalTabCollapsed] = createCollapsibleModifierSections(() => [ { @@ -395,6 +448,27 @@ const layer = createLayer(id, function (this: BaseLayer) { base: 10, unit: "/s", visible: elves.clothElf.bought + }, + { + title: "Peppermint Auto-Buy Frequency", + modifier: miningDrillCooldown, + base: 10, + unit: "/s", + visible: management.elfTraining.expandersElfTraining.milestones[3].earned + }, + { + title: "Twinkle Auto-Buy Frequency", + modifier: metalCooldown, + base: 10, + unit: "/s", + visible: management.elfTraining.expandersElfTraining.milestones[4].earned + }, + { + title: "Frosty Auto-Buy Frequency", + modifier: heavyDrillCooldown, + base: 10, + unit: "/s", + visible: management.elfTraining.heatedCutterElfTraining.milestones[4].earned.value } ]); const showModifiersModal = ref(false); @@ -428,7 +502,7 @@ const layer = createLayer(id, function (this: BaseLayer) { customCost?: (amount: DecimalSource) => DecimalSource; hasToggle?: boolean; toggleDesc?: string; - onAutoPurchase?: VoidFunction; + onAutoPurchase?: (buyable: GenericBuyable & { resource: Resource }) => void; onPurchase?: VoidFunction; // Will get overriden by the custom onpurchase, but that's fine canBuy?: Computable; buyMax?: Computable; @@ -461,7 +535,7 @@ const layer = createLayer(id, function (this: BaseLayer) { ) { buyable.amount.value = Decimal.add(buyable.amount.value, 1); buyProgress.value = Decimal.sub(buyProgress.value, cooldown); - options.onAutoPurchase?.(); + options.onAutoPurchase?.(buyable); } else { buyProgress.value = cooldown; break; @@ -661,6 +735,54 @@ const layer = createLayer(id, function (this: BaseLayer) { visibility: () => showIf(plastic.elfUpgrades.clothElf.bought.value) }); const plasticElves = [paperElf, boxElf, clothElf]; + const miningDrillElf = createElf({ + name: "Peppermint", + description: + "Peppermint will automatically purchase all mining drills you can afford, without actually spending any resources.", + buyable: coal.buildDrill, + cooldownModifier: miningDrillCooldown, + visibility: () => + showIf(management.elfTraining.expandersElfTraining.milestones[3].earned.value), + hasToggle: true, + toggleDesc: "Activate auto-purchased mining drills", + onAutoPurchase() { + if (miningDrillElf.toggle.value) { + coal.activeDrills.value = Decimal.add(coal.activeDrills.value, 1); + } + } + }); + const metalElf = createElf({ + name: "Twinkle", + description: + "Twinkle will automatically purchase all metal buyables you can afford, without actually spending any resources.", + buyable: [metal.oreDrill, metal.industrialCrucible, metal.hotterForge], + cooldownModifier: metalCooldown, + visibility: () => + showIf(management.elfTraining.expandersElfTraining.milestones[4].earned.value) + }); + const heavyDrillElf = createElf({ + name: "Frosty", + description: + "Frosty will automatically purchase all drill types in the oil section, without actually spending any resources.", + buyable: [oil.buildHeavy, oil.buildHeavy2, oil.buildExtractor], + cooldownModifier: heavyDrillCooldown, + visibility: () => + showIf(management.elfTraining.heatedCutterElfTraining.milestones[4].earned.value), + hasToggle: true, + toggleDesc: "Activate auto-purchased oil drills", + onAutoPurchase(buyable) { + if (heavyDrillElf.toggle.value) { + if (buyable === oil.buildHeavy) { + oil.activeHeavy.value = Decimal.add(oil.activeHeavy.value, 1); + } else if (buyable === oil.buildHeavy) { + oil.activeHeavy.value = Decimal.add(oil.activeHeavy.value, 1); + } else if (buyable === oil.buildHeavy) { + oil.activeHeavy.value = Decimal.add(oil.activeHeavy.value, 1); + } + } + } + }); + const managementElves = [miningDrillElf, metalElf, heavyDrillElf]; const elves = { cuttersElf, plantersElf, @@ -673,7 +795,10 @@ const layer = createLayer(id, function (this: BaseLayer) { kilnElf, paperElf, boxElf, - clothElf + clothElf, + miningDrillElf, + metalElf, + heavyDrillElf }; const totalElves = computed(() => Object.values(elves).filter(elf => elf.bought.value).length); @@ -853,7 +978,7 @@ const layer = createLayer(id, function (this: BaseLayer) { {render(modifiersModal)}
- {renderGrid(treesElves, coalElves, fireElves, plasticElves)} + {renderGrid(treesElves, coalElves, fireElves, plasticElves, managementElves)}
{milestonesDisplay()} diff --git a/src/data/layers/metal.tsx b/src/data/layers/metal.tsx index 84a9c2a..c0c06cd 100644 --- a/src/data/layers/metal.tsx +++ b/src/data/layers/metal.tsx @@ -4,7 +4,7 @@ import Toggle from "components/fields/Toggle.vue"; import Modal from "components/Modal.vue"; import { createCollapsibleModifierSections, setUpDailyProgressTracker } from "data/common"; import { jsx, showIf } from "features/feature"; -import { createResource, trackBest } from "features/resources/resource"; +import { createResource, Resource, trackBest } from "features/resources/resource"; import { BaseLayer, createLayer } from "game/layers"; import Decimal, { DecimalSource } from "lib/break_eternity"; import { render, renderRow } from "util/vue"; @@ -359,7 +359,7 @@ const layer = createLayer(id, function (this: BaseLayer) { .gte(10) ), style: { width: "200px" } - })) as GenericBuyable; + })) as GenericBuyable & { resource: Resource }; const industrialCrucible = createBuyable(() => ({ resource: noPersist(metal), cost() { @@ -382,7 +382,7 @@ const layer = createLayer(id, function (this: BaseLayer) { Decimal.gte(bestOre.value, 50) ), style: { width: "200px" } - })) as GenericBuyable; + })) as GenericBuyable & { resource: Resource }; const autoSmeltEnabled = persistent(true); const hotterForge = createBuyable(() => ({ resource: coal.coal, @@ -403,7 +403,7 @@ const layer = createLayer(id, function (this: BaseLayer) { visibility: () => showIf(Decimal.gte(hotterForge.amount.value, 1) || industrialFurnace.bought.value), style: { width: "200px" } - })) as GenericBuyable; + })) as GenericBuyable & { resource: Resource }; const hotterForgeEffect = computed(() => Decimal.times(hotterForge.amount.value, 0.25)); globalBus.on("update", diff => { From b1e1875651605bcb63fa839c2499f7495cbe37ec Mon Sep 17 00:00:00 2001 From: Anthony Lawn Date: Mon, 12 Dec 2022 19:02:55 -0600 Subject: [PATCH 20/67] Added books for new elves --- src/data/layers/elves.tsx | 30 +++++++++++++++--------------- src/data/layers/paper.tsx | 23 ++++++++++++++++++++++- 2 files changed, 37 insertions(+), 16 deletions(-) diff --git a/src/data/layers/elves.tsx b/src/data/layers/elves.tsx index c6dca5a..7eb2a81 100644 --- a/src/data/layers/elves.tsx +++ b/src/data/layers/elves.tsx @@ -318,11 +318,11 @@ const layer = createLayer(id, function (this: BaseLayer) { description: "6 Elves Trained", enabled: elvesMilestone.earned })), - // createMultiplicativeModifier(() => ({ - // multiplier: () => Decimal.times(paper.books.clothBook.amount.value, 0.1).add(1), - // description: "Fuzzy Bee and Friends", - // enabled: () => Decimal.gt(paper.books.clothBook.amount.value, 0) - // })), + createMultiplicativeModifier(() => ({ + multiplier: () => Decimal.times(paper.books.miningDrillBook.amount.value, 0.1).add(1), + description: "Drills and Mills", + enabled: () => Decimal.gt(paper.books.miningDrillBook.amount.value, 0) + })), createMultiplicativeModifier(() => ({ multiplier: 2, description: "10 Elves Trained", @@ -335,11 +335,11 @@ const layer = createLayer(id, function (this: BaseLayer) { description: "6 Elves Trained", enabled: elvesMilestone.earned })), - // createMultiplicativeModifier(() => ({ - // multiplier: () => Decimal.times(paper.books.clothBook.amount.value, 0.1).add(1), - // description: "Fuzzy Bee and Friends", - // enabled: () => Decimal.gt(paper.books.clothBook.amount.value, 0) - // })), + createMultiplicativeModifier(() => ({ + multiplier: () => Decimal.times(paper.books.metalBook.amount.value, 0.1).add(1), + description: "Physical Metallurgy", + enabled: () => Decimal.gt(paper.books.metalBook.amount.value, 0) + })), createMultiplicativeModifier(() => ({ multiplier: 2, description: "10 Elves Trained", @@ -352,11 +352,11 @@ const layer = createLayer(id, function (this: BaseLayer) { description: "6 Elves Trained", enabled: elvesMilestone.earned })), - // createMultiplicativeModifier(() => ({ - // multiplier: () => Decimal.times(paper.books.clothBook.amount.value, 0.1).add(1), - // description: "Fuzzy Bee and Friends", - // enabled: () => Decimal.gt(paper.books.clothBook.amount.value, 0) - // })), + createMultiplicativeModifier(() => ({ + multiplier: () => Decimal.times(paper.books.heavyDrillBook.amount.value, 0.1).add(1), + description: "Deep in the Earth", + enabled: () => Decimal.gt(paper.books.heavyDrillBook.amount.value, 0) + })), createMultiplicativeModifier(() => ({ multiplier: 2, description: "10 Elves Trained", diff --git a/src/data/layers/paper.tsx b/src/data/layers/paper.tsx index 94022e3..6edcfe8 100644 --- a/src/data/layers/paper.tsx +++ b/src/data/layers/paper.tsx @@ -187,6 +187,24 @@ const layer = createLayer(id, function (this: BaseLayer) { buyableName: "Cloth Buyables", visibility: () => showIf(elves.elves.clothElf.bought.value) }); + const miningDrillBook = createBook({ + name: "Drills and Mills", + elfName: "Peppermint", + buyableName: "Mining Drill", + visibility: () => showIf(management.elfTraining.expandersElfTraining.milestones[3].earned.value) + }); + const metalBook = createBook({ + name: "Physical Metallurgy", + elfName: "Twinkle", + buyableName: "Metal Buyables", + visibility: () => showIf(management.elfTraining.expandersElfTraining.milestones[4].earned.value) + }); + const heavyDrillBook = createBook({ + name: "Deep in the Earth", + elfName: "Frosty", + buyableName: "Oil Drills", + visibility: () => showIf(management.elfTraining.heatedCutterElfTraining.milestones[4].earned.value) + }); const books = { cuttersBook, plantersBook, @@ -199,7 +217,10 @@ const layer = createLayer(id, function (this: BaseLayer) { kilnBook, paperBook, boxBook, - clothBook + clothBook, + miningDrillBook, + metalBook, + heavyDrillBook }; const sumBooks = computed(() => Object.values(books).reduce((acc, curr) => acc.add(curr.amount.value), new Decimal(0))); From 872d6208b682d3c14ed9972a017f9badeba4acb7 Mon Sep 17 00:00:00 2001 From: Anthony Lawn Date: Mon, 12 Dec 2022 19:21:35 -0600 Subject: [PATCH 21/67] Fixed upgrades costing trees --- src/data/layers/management.tsx | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/data/layers/management.tsx b/src/data/layers/management.tsx index a114018..1e4d610 100644 --- a/src/data/layers/management.tsx +++ b/src/data/layers/management.tsx @@ -972,7 +972,7 @@ const layer = createLayer(id, () => { title: "Focus Booster", description: "Double experience multiplier from focus" }, - resource: trees.trees, + resource: trees.logs, cost: 1e30 })); const focusUpgrade2 = createUpgrade(() => ({ @@ -980,7 +980,7 @@ const layer = createLayer(id, () => { title: "Focus Buffer", description: "Increase elves affected by focus by 1" }, - resource: trees.trees, + resource: trees.logs, cost: 1e40 })); const focusUpgrade3 = createUpgrade(() => ({ @@ -988,7 +988,7 @@ const layer = createLayer(id, () => { title: "Focus Upgrader", description: "Focus can now be rerolled every 10 seconds" }, - resource: trees.trees, + resource: trees.logs, cost: 1e50 })); const upgrades = { focusUpgrade1, focusUpgrade2, focusUpgrade3 }; From 2803a997365d3929169ef9af3d13f7d9c93c1c72 Mon Sep 17 00:00:00 2001 From: Anthony Lawn Date: Mon, 12 Dec 2022 19:40:14 -0600 Subject: [PATCH 22/67] Fix infinite recursion --- src/data/layers/trees.tsx | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/data/layers/trees.tsx b/src/data/layers/trees.tsx index 0d17f64..5e67dae 100644 --- a/src/data/layers/trees.tsx +++ b/src/data/layers/trees.tsx @@ -329,9 +329,9 @@ const layer = createLayer(id, function (this: BaseLayer) { ]) as WithRequired; const computedAutoCuttingAmount = computed(() => autoCuttingAmount.apply(0)); const lastAutoCuttingAmount = ref(0); - watch(computedAutoCuttingAmount, cut => { + setInterval(() => watch(computedAutoCuttingAmount, cut => { lastAutoCuttingAmount.value = cut; - }); + }), 0); const manualPlantingAmount = createSequentialModifier(() => [ createAdditiveModifier(() => ({ @@ -420,9 +420,9 @@ const layer = createLayer(id, function (this: BaseLayer) { ]) as WithRequired; const computedAutoPlantingAmount = computed(() => autoPlantingAmount.apply(0)); const lastAutoPlantedAmount = ref(0); - watch(computedAutoPlantingAmount, planted => { + setInterval(() => watch(computedAutoPlantingAmount, planted => { lastAutoPlantedAmount.value = planted; - }); + }), 0); const logGain = createSequentialModifier(() => [ createMultiplicativeModifier(() => ({ From 8d6fd36e90910fc952323db1c33caa51402a2dfb Mon Sep 17 00:00:00 2001 From: circle-gon <97845741+circle-gon@users.noreply.github.com> Date: Tue, 13 Dec 2022 02:01:07 +0000 Subject: [PATCH 23/67] more clarifications --- src/data/layers/management.tsx | 60 +++++++++++++++++++++++++++++----- 1 file changed, 52 insertions(+), 8 deletions(-) diff --git a/src/data/layers/management.tsx b/src/data/layers/management.tsx index 1e4d610..bacdb0b 100644 --- a/src/data/layers/management.tsx +++ b/src/data/layers/management.tsx @@ -12,7 +12,12 @@ import { createMilestone, GenericMilestone } from "features/milestones/milestone import { createUpgrade } from "features/upgrades/upgrade"; import { globalBus } from "game/events"; import { createLayer } from "game/layers"; -import { createMultiplicativeModifier, createSequentialModifier, Modifier } from "game/modifiers"; +import { + createAdditiveModifier, + createMultiplicativeModifier, + createSequentialModifier, + Modifier +} from "game/modifiers"; import { persistent } from "game/persistence"; import Decimal, { DecimalSource, format, formatTime, formatWhole } from "util/bignum"; import { Direction } from "util/common"; @@ -896,12 +901,11 @@ const layer = createLayer(id, () => { } focusTime.value = Math.max(focusTime.value - diff, 0); focusCooldown.value = Math.max(focusCooldown.value - diff, 0); - if (focusTime.value > 0) { + if (focusTime.value === 0) { focusMulti.value = Decimal.pow( focusMaxMulti.value, 1 - Math.abs(Math.sin((Date.now() / 1000) * 2)) ); - } }); @@ -912,7 +916,32 @@ const layer = createLayer(id, () => { const focusCooldown = persistent(0); const focusTime = persistent(0); - const focusMaxMulti = computed(() => focusUpgrade1.bought.value ? 20 : 10); + const focusMaxMultiModifiers = createSequentialModifier(() => [ + createMultiplicativeModifier(() => ({ + multiplier: 2, + description: "Focus Upgrade 1", + enabled: focusUpgrade1.bought + })) + ]); + const maximumElvesModifier = createSequentialModifier(() => [ + createAdditiveModifier(() => ({ + addend: 1, + description: "Focus Upgrade 2", + enabled: focusUpgrade2.bought + })) + ]); + + const cooldownModifiers = createSequentialModifier(() => [ + createAdditiveModifier(() => ({ + addend: -5, + description: "Focus Upgrade 3", + enabled: focusUpgrade3.bought + })) + ]); + + const focusMaxMulti = computed(() => focusMaxMultiModifiers.apply(10)); + const maximumElves = computed(() => maximumElvesModifier.apply(3)); + const cooldown = computed(() => cooldownModifiers.apply(15)); const focusMeter = createBar(() => ({ direction: Direction.Right, @@ -949,9 +978,9 @@ const layer = createLayer(id, () => { }, canClick: () => focusCooldown.value === 0, onClick() { - focusCooldown.value = focusUpgrade3.bought.value ? 10 : 15; + focusCooldown.value = cooldown.value; focusTime.value = 10; - rerollFocusTargets(12, focusUpgrade2.bought.value ? 4 : 3); + rerollFocusTargets(12, maximumElves.value); } })); @@ -970,7 +999,7 @@ const layer = createLayer(id, () => { const focusUpgrade1 = createUpgrade(() => ({ display: { title: "Focus Booster", - description: "Double experience multiplier from focus" + description: "Multiplies the maximum experience multiplier from focus by 2" }, resource: trees.logs, cost: 1e30 @@ -1131,6 +1160,22 @@ const layer = createLayer(id, () => { // ------------------------------------------------------------------------------- Modifiers const [generalTab, generalTabCollapsed] = createCollapsibleModifierSections(() => [ + { + title: "Elves affected by Focus", + modifier: maximumElvesModifier, + base: 3 + }, + { + title: "Maximum Focus Effect", + modifier: focusMaxMultiModifiers, + base: 10 + }, + { + title: "Focus Cooldown", + modifier: cooldownModifiers, + unit: " secs", + base: 15 + }, { title: "Global XP Gain", modifier: globalXPModifier, @@ -1244,7 +1289,6 @@ const layer = createLayer(id, () => { focusTargets, focusCooldown, focusTime, - display: jsx(() => ( <> From efbe9ab9c9b97f3db9448783304f3195026b4e3a Mon Sep 17 00:00:00 2001 From: circle-gon <97845741+circle-gon@users.noreply.github.com> Date: Tue, 13 Dec 2022 02:08:18 +0000 Subject: [PATCH 24/67] changes most things to be DecimalSource not number --- src/data/layers/management.tsx | 26 ++++++++++++++------------ 1 file changed, 14 insertions(+), 12 deletions(-) diff --git a/src/data/layers/management.tsx b/src/data/layers/management.tsx index bacdb0b..8a3a299 100644 --- a/src/data/layers/management.tsx +++ b/src/data/layers/management.tsx @@ -165,7 +165,7 @@ const layer = createLayer(id, () => { createMultiplicativeModifier(() => ({ multiplier: focusMulti, description: "Focus Multiplier", - enabled: () => focusTime.value > 0 && focusTargets.value[elf.name] == true + enabled: () => Decimal.gt(focusTime.value, 0) && focusTargets.value[elf.name] == true })), ...modifiers ]); @@ -899,9 +899,9 @@ const layer = createLayer(id, () => { ); } } - focusTime.value = Math.max(focusTime.value - diff, 0); - focusCooldown.value = Math.max(focusCooldown.value - diff, 0); - if (focusTime.value === 0) { + focusTime.value = Decimal.sub(focusTime.value, diff).max(0) + focusCooldown.value = Decimal.sub(focusCooldown.value, diff).max(0) + if (Decimal.eq(focusTime.value, 0)) { focusMulti.value = Decimal.pow( focusMaxMulti.value, 1 - Math.abs(Math.sin((Date.now() / 1000) * 2)) @@ -913,8 +913,8 @@ const layer = createLayer(id, () => { const focusMulti = persistent(1); const focusTargets = persistent>({}); - const focusCooldown = persistent(0); - const focusTime = persistent(0); + const focusCooldown = persistent(0); + const focusTime = persistent(0); const focusMaxMultiModifiers = createSequentialModifier(() => [ createMultiplicativeModifier(() => ({ @@ -941,7 +941,7 @@ const layer = createLayer(id, () => { const focusMaxMulti = computed(() => focusMaxMultiModifiers.apply(10)); const maximumElves = computed(() => maximumElvesModifier.apply(3)); - const cooldown = computed(() => cooldownModifiers.apply(15)); + const cooldown = computed(() => Number(cooldownModifiers.apply(15))); const focusMeter = createBar(() => ({ direction: Direction.Right, @@ -962,7 +962,7 @@ const layer = createLayer(id, () => { <> Motivate elves to focus, multiplying 3 random elves' XP gain by up to{" "} {format(focusMaxMulti.value)}x, equal to the focus bars' effect. - {focusCooldown.value > 0 ? ( + {Decimal.gte(focusCooldown.value, 0) ? ( <>
Reroll cooldown: {formatTime(focusCooldown.value)} @@ -976,19 +976,21 @@ const layer = createLayer(id, () => { style: { width: "300px" }, - canClick: () => focusCooldown.value === 0, + canClick: () => Decimal.eq(focusCooldown.value, 0), onClick() { focusCooldown.value = cooldown.value; focusTime.value = 10; + + // better choice? this has to be a number rerollFocusTargets(12, maximumElves.value); } })); - function rerollFocusTargets(range: number, count: number) { + function rerollFocusTargets(range: number, count: DecimalSource) { let x = 0; focusTargets.value = {}; - count = Math.min(count, range); - while (x < count) { + const newCount = Decimal.min(count, range) + while (newCount.gte(x)) { const roll = Object.values(elfTraining)[Math.floor(Math.random() * range)]?.name ?? ""; if (!focusTargets.value[roll]) { focusTargets.value[roll] = true; From 3572898b75b9f4a760042e7341d6a428c295d4a8 Mon Sep 17 00:00:00 2001 From: unsoftcapped3 <75136164+unsoftcapped3@users.noreply.github.com> Date: Tue, 13 Dec 2022 02:31:50 +0000 Subject: [PATCH 25/67] uh things maybe idk --- src/data/layers/management.tsx | 29 ++++++----------------------- src/data/layers/trees.tsx | 8 ++++---- src/data/projEntry.tsx | 4 ++-- 3 files changed, 12 insertions(+), 29 deletions(-) diff --git a/src/data/layers/management.tsx b/src/data/layers/management.tsx index a114018..b1a95e3 100644 --- a/src/data/layers/management.tsx +++ b/src/data/layers/management.tsx @@ -999,7 +999,7 @@ const layer = createLayer(id, () => { return { wood: schoolFactor.mul(1e21), coal: schoolFactor.mul(1e32), - paper: schoolFactor.mul(1e19), + paper: schoolFactor.mul(1e18), boxes: schoolFactor.mul(1e13), metalIngots: schoolFactor.mul(1e12), cloth: schoolFactor.mul(1e4), @@ -1063,13 +1063,9 @@ const layer = createLayer(id, () => { const classroomFactor = Decimal.add(schools.amount.value, 1).pow(1.5); return { wood: classroomFactor.mul(1e21), - coal: classroomFactor.mul(1e32), - paper: classroomFactor.mul(1e19), + paper: classroomFactor.mul(1e18), boxes: classroomFactor.mul(1e13), - metalIngots: classroomFactor.mul(1e12), - cloth: classroomFactor.mul(1e4), - plastic: classroomFactor.mul(1e6), - dye: classroomFactor.mul(10000) + metalIngots: classroomFactor.mul(1e12) }; }); @@ -1090,38 +1086,25 @@ const layer = createLayer(id, () => { multiplying elves' XP gain by {format(classroomEffect.value)}
- Costs {format(classroomCost.value.wood)} logs,{" "} - {format(classroomCost.value.coal)} coal, {format(classroomCost.value.paper)}{" "} + Costs {format(classroomCost.value.wood)} logs,{format(classroomCost.value.paper)}{" "} paper, {format(classroomCost.value.boxes)} boxes,{" "} - {format(classroomCost.value.metalIngots)} metal ingots,{" "} - {format(classroomCost.value.cloth)} cloth, {format(classroomCost.value.plastic)}{" "} - plastic, and requires {format(classroomCost.value.dye)} of red, yellow, and blue - dye + {format(classroomCost.value.metalIngots)} metal ingots
)), canPurchase(): boolean { return ( classroomCost.value.wood.lte(trees.logs.value) && - classroomCost.value.coal.lte(coal.coal.value) && classroomCost.value.paper.lte(paper.paper.value) && classroomCost.value.boxes.lte(boxes.boxes.value) && - classroomCost.value.metalIngots.lte(metal.metal.value) && - classroomCost.value.cloth.lte(cloth.cloth.value) && - classroomCost.value.plastic.lte(plastic.plastic.value) && - classroomCost.value.dye.lte(dyes.dyes.blue.amount.value) && - classroomCost.value.dye.lte(dyes.dyes.red.amount.value) && - classroomCost.value.dye.lte(dyes.dyes.yellow.amount.value) + classroomCost.value.metalIngots.lte(metal.metal.value) ); }, onPurchase() { trees.logs.value = Decimal.sub(trees.logs.value, classroomCost.value.wood); - coal.coal.value = Decimal.sub(coal.coal.value, classroomCost.value.coal); paper.paper.value = Decimal.sub(paper.paper.value, classroomCost.value.paper); boxes.boxes.value = Decimal.sub(boxes.boxes.value, classroomCost.value.boxes); metal.metal.value = Decimal.sub(metal.metal.value, classroomCost.value.metalIngots); - cloth.cloth.value = Decimal.sub(cloth.cloth.value, classroomCost.value.cloth); - plastic.plastic.value = Decimal.sub(plastic.plastic.value, classroomCost.value.plastic); this.amount.value = Decimal.add(this.amount.value, 1); }, visibility: computed(() => showIf(classroomUpgrade.bought.value)), diff --git a/src/data/layers/trees.tsx b/src/data/layers/trees.tsx index 0d17f64..f14f3c2 100644 --- a/src/data/layers/trees.tsx +++ b/src/data/layers/trees.tsx @@ -329,9 +329,9 @@ const layer = createLayer(id, function (this: BaseLayer) { ]) as WithRequired; const computedAutoCuttingAmount = computed(() => autoCuttingAmount.apply(0)); const lastAutoCuttingAmount = ref(0); - watch(computedAutoCuttingAmount, cut => { + setInterval(() => watch(computedAutoCuttingAmount, cut => { lastAutoCuttingAmount.value = cut; - }); + }), 0); const manualPlantingAmount = createSequentialModifier(() => [ createAdditiveModifier(() => ({ @@ -420,9 +420,9 @@ const layer = createLayer(id, function (this: BaseLayer) { ]) as WithRequired; const computedAutoPlantingAmount = computed(() => autoPlantingAmount.apply(0)); const lastAutoPlantedAmount = ref(0); - watch(computedAutoPlantingAmount, planted => { + setInterval(() => watch(computedAutoPlantingAmount, planted => { lastAutoPlantedAmount.value = planted; - }); + }),0); const logGain = createSequentialModifier(() => [ createMultiplicativeModifier(() => ({ diff --git a/src/data/projEntry.tsx b/src/data/projEntry.tsx index 54ba66a..3d77eae 100644 --- a/src/data/projEntry.tsx +++ b/src/data/projEntry.tsx @@ -457,7 +457,7 @@ export function fixOldSave( if (!["0.0", "0.1", "0.2", "0.3", "0.4"].includes(oldVersion ?? "")) { return; } - player.offlineProd = false; + /*player.offlineProd = false; delete player.layers?.management; if ((player.layers?.main as LayerData | undefined)?.days?.[11]) { (player.layers!.main as LayerData).days![11].opened = false; @@ -468,6 +468,6 @@ export function fixOldSave( } if (player.tabs) { player.tabs = player.tabs.filter(l => l !== "management"); - } + }*/ } /* eslint-enable @typescript-eslint/no-unused-vars */ From 6eaf6b69dee2d45526b778ee15a78de397254457 Mon Sep 17 00:00:00 2001 From: unsoftcapped3 <75136164+unsoftcapped3@users.noreply.github.com> Date: Tue, 13 Dec 2022 03:16:32 +0000 Subject: [PATCH 26/67] Did a bit of balancing --- src/data/layers/elves.tsx | 2 +- src/data/layers/management.tsx | 10 ++++++---- 2 files changed, 7 insertions(+), 5 deletions(-) diff --git a/src/data/layers/elves.tsx b/src/data/layers/elves.tsx index 7eb2a81..7542b87 100644 --- a/src/data/layers/elves.tsx +++ b/src/data/layers/elves.tsx @@ -511,7 +511,7 @@ const layer = createLayer(id, function (this: BaseLayer) { const buyProgress = persistent(0); const amountOfTimesDone = persistent(0); const toggle = options.hasToggle ? persistent(false) : ref(true); - + const computedAutoBuyCooldown = computed(() => options.cooldownModifier.apply(10)); const isActive = convertComputable(options.canBuy ?? true); diff --git a/src/data/layers/management.tsx b/src/data/layers/management.tsx index de2c372..61c4e34 100644 --- a/src/data/layers/management.tsx +++ b/src/data/layers/management.tsx @@ -120,15 +120,16 @@ const layer = createLayer(id, () => { ...modifiers: Modifier[] ) { const exp = persistent(0); - const expRequiredForNextLevel = computed(() => Decimal.pow(10, level.value).mul(1e4)); + const costMulti = ["Holly","Ivy","Hope","Jack","Mary","Noel","Joy","Faith","Snowball","Star","Bell","Gingersnap"].indexOf(elf.name)+1 + const expRequiredForNextLevel = computed(() => Decimal.pow(10, level.value).mul(2022).mul(costMulti)); const level = computed(() => Decimal.min( - Decimal.mul(9, exp.value).div(1e4).add(1).log10().floor(), + Decimal.mul(9, exp.value).div(2022).div(costMulti).add(1).log10().floor(), schools.amount.value ).toNumber() ); const expToNextLevel = computed(() => - Decimal.sub(exp.value, Decimal.pow(10, level.value).sub(1).div(9).mul(1e4)) + Decimal.sub(exp.value, Decimal.pow(10, level.value).sub(1).div(9).mul(2022)) ); const bar = createBar(() => ({ direction: Direction.Right, @@ -1027,8 +1028,9 @@ const layer = createLayer(id, () => { const schoolCost = computed(() => { const schoolFactor = Decimal.pow(10, schools.amount.value); + const woodFactor = Decimal.pow(1e6, schools.amount.value) return { - wood: schoolFactor.mul(1e21), + wood: woodFactor.mul(1e21), coal: schoolFactor.mul(1e32), paper: schoolFactor.mul(1e18), boxes: schoolFactor.mul(1e13), From 55ecd21d55de88d5dae2d65fa55ada9cea4bc124 Mon Sep 17 00:00:00 2001 From: unsoftcapped3 <75136164+unsoftcapped3@users.noreply.github.com> Date: Tue, 13 Dec 2022 04:17:35 +0000 Subject: [PATCH 27/67] balance up to all milestone 1s --- src/data/layers/management.tsx | 32 ++++++++++++++++++-------------- src/data/layers/trees.tsx | 3 ++- 2 files changed, 20 insertions(+), 15 deletions(-) diff --git a/src/data/layers/management.tsx b/src/data/layers/management.tsx index 61c4e34..9b2359e 100644 --- a/src/data/layers/management.tsx +++ b/src/data/layers/management.tsx @@ -120,16 +120,19 @@ const layer = createLayer(id, () => { ...modifiers: Modifier[] ) { const exp = persistent(0); - const costMulti = ["Holly","Ivy","Hope","Jack","Mary","Noel","Joy","Faith","Snowball","Star","Bell","Gingersnap"].indexOf(elf.name)+1 - const expRequiredForNextLevel = computed(() => Decimal.pow(10, level.value).mul(2022).mul(costMulti)); + var costMulti = ["Holly","Ivy","Hope","Jack","Mary","Noel","Joy","Faith","Snowball","Star","Bell","Gingersnap"].indexOf(elf.name)+1 + if(elf.name == "Star" || elf.name == "Bell"){ + costMulti /= 3 + } + const expRequiredForNextLevel = computed(() => Decimal.pow(10, level.value).mul(4000).mul(costMulti)); const level = computed(() => Decimal.min( - Decimal.mul(9, exp.value).div(2022).div(costMulti).add(1).log10().floor(), + Decimal.mul(9, exp.value).div(4000).div(costMulti).add(1).log10().floor(), schools.amount.value ).toNumber() ); const expToNextLevel = computed(() => - Decimal.sub(exp.value, Decimal.pow(10, level.value).sub(1).div(9).mul(2022)) + Decimal.sub(exp.value, Decimal.pow(10, level.value).sub(1).div(9).mul(4000)) ); const bar = createBar(() => ({ direction: Direction.Right, @@ -224,7 +227,7 @@ const layer = createLayer(id, () => { requirement: "Holly Level 1", effectDisplay: jsx(() => ( <> - Multiply log gain by 3 + Multiply log gain by 9 Cutter amount. )) @@ -244,7 +247,7 @@ const layer = createLayer(id, () => { requirement: "Holly Level 3", effectDisplay: jsx(() => ( <> - Multiply all cloth actions' effectiveness by 3 + Multiply all cloth actions' effectiveness by 9 Cutter amount. )) @@ -364,7 +367,7 @@ const layer = createLayer(id, () => { createMilestone(() => ({ display: { requirement: "Jack Level 1", - effectDisplay: "Heated cutters are less expensive." + effectDisplay: '"Fahrenheit 451" affects "Heated Cutters" twice.' }, shouldEarn: () => heatedCutterElfTraining.level.value >= 1 })), @@ -1023,17 +1026,18 @@ const layer = createLayer(id, () => { resource: trees.logs, cost: 1e50 })); - const upgrades = { focusUpgrade1, focusUpgrade2, focusUpgrade3 }; + const upgrades = [ focusUpgrade1, focusUpgrade2, focusUpgrade3 ]; // ------------------------------------------------------------------------------- Schools const schoolCost = computed(() => { const schoolFactor = Decimal.pow(10, schools.amount.value); - const woodFactor = Decimal.pow(1e6, schools.amount.value) + const woodFactor = Decimal.pow(2e4, schools.amount.value) + const coalFactor = Decimal.pow(2000, schools.amount.value) return { wood: woodFactor.mul(1e21), - coal: schoolFactor.mul(1e32), - paper: schoolFactor.mul(1e18), - boxes: schoolFactor.mul(1e13), + coal: coalFactor.mul(1e32), + paper: coalFactor.mul(1e18), + boxes: woodFactor.mul(1e13), metalIngots: schoolFactor.mul(1e12), cloth: schoolFactor.mul(1e4), plastic: schoolFactor.mul(1e6), @@ -1093,7 +1097,7 @@ const layer = createLayer(id, () => { })); const classroomCost = computed(() => { - const classroomFactor = Decimal.add(schools.amount.value, 1).pow(1.5); + const classroomFactor = Decimal.add(classrooms.amount.value, 1).pow(1.5); return { wood: classroomFactor.mul(1e21), paper: classroomFactor.mul(1e18), @@ -1295,7 +1299,7 @@ const layer = createLayer(id, () => { {render(modifiersModal)} {render(dayProgress)}
- {renderCol(schools, classrooms)} {renderGrid([teaching, classroomUpgrade])} + {renderCol(schools, classrooms)} {renderGrid([teaching, classroomUpgrade])} {renderGrid(upgrades)} {Decimal.gt(schools.amount.value, 0) ? ( <>
diff --git a/src/data/layers/trees.tsx b/src/data/layers/trees.tsx index 5e67dae..0bd422b 100644 --- a/src/data/layers/trees.tsx +++ b/src/data/layers/trees.tsx @@ -241,6 +241,7 @@ const layer = createLayer(id, function (this: BaseLayer) { 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.amount.value).times(v); return Decimal.pow(Decimal.add(v, 1), 1.5).times(500); }, @@ -483,7 +484,7 @@ const layer = createLayer(id, function (this: BaseLayer) { enabled: dyes.upgrades.blueDyeUpg.bought })), createMultiplicativeModifier(() => ({ - multiplier: computed(() => Decimal.add(computedAutoCuttingAmount.value, 1).root(3)), + multiplier: computed(() => Decimal.add(computedAutoCuttingAmount.value, 1).root(9)), description: "Holly Level 1", enabled: management.elfTraining.cutterElfTraining.milestones[0].earned })), From e181b2b533da83f64578638352cf6a7bd6893fc5 Mon Sep 17 00:00:00 2001 From: thepaperpilot Date: Mon, 12 Dec 2022 21:15:42 -0600 Subject: [PATCH 28/67] Jack and Mary lv4-5 and Noel lv4 --- src/data/layers/management.tsx | 19 ++++++++++++++----- src/data/layers/metal.tsx | 12 ++++++++++++ src/data/layers/oil.tsx | 10 ++++++++-- src/data/layers/plastic.tsx | 16 +++++++++++++--- 4 files changed, 47 insertions(+), 10 deletions(-) diff --git a/src/data/layers/management.tsx b/src/data/layers/management.tsx index 9b2359e..d4e7eb5 100644 --- a/src/data/layers/management.tsx +++ b/src/data/layers/management.tsx @@ -75,6 +75,9 @@ const layer = createLayer(id, () => { } return elfLevel; }); + const totalElfExp = computed(() => + Object.values(elfTraining).reduce((acc, curr) => acc.add(curr.exp.value), new Decimal(0)) + ); // ------------------------------------------------------------------------------- Upgrades @@ -169,7 +172,8 @@ const layer = createLayer(id, () => { createMultiplicativeModifier(() => ({ multiplier: focusMulti, description: "Focus Multiplier", - enabled: () => Decimal.gt(focusTime.value, 0) && focusTargets.value[elf.name] == true + enabled: () => + Decimal.gt(focusTime.value, 0) && focusTargets.value[elf.name] == true })), ...modifiers ]); @@ -390,7 +394,11 @@ const layer = createLayer(id, () => { createMilestone(() => ({ display: { requirement: "Jack Level 4", - effectDisplay: "Oil gain is multiplied based on total elf levels." + effectDisplay: jsx(() => ( + <> + Oil gain is multiplied by total elf levels. + + )) }, visibility: () => showIf(heatedCutterElfMilestones[2].earned.value && main.day.value >= 13), @@ -903,8 +911,8 @@ const layer = createLayer(id, () => { ); } } - focusTime.value = Decimal.sub(focusTime.value, diff).max(0) - focusCooldown.value = Decimal.sub(focusCooldown.value, diff).max(0) + focusTime.value = Decimal.sub(focusTime.value, diff).max(0); + focusCooldown.value = Decimal.sub(focusCooldown.value, diff).max(0); if (Decimal.eq(focusTime.value, 0)) { focusMulti.value = Decimal.pow( focusMaxMulti.value, @@ -993,7 +1001,7 @@ const layer = createLayer(id, () => { function rerollFocusTargets(range: number, count: DecimalSource) { let x = 0; focusTargets.value = {}; - const newCount = Decimal.min(count, range) + const newCount = Decimal.min(count, range); while (newCount.gte(x)) { const roll = Object.values(elfTraining)[Math.floor(Math.random() * range)]?.name ?? ""; if (!focusTargets.value[roll]) { @@ -1267,6 +1275,7 @@ const layer = createLayer(id, () => { elfTraining, totalElfLevels, + totalElfExp, currentShown, generalTabCollapsed, diff --git a/src/data/layers/metal.tsx b/src/data/layers/metal.tsx index c0c06cd..81d0166 100644 --- a/src/data/layers/metal.tsx +++ b/src/data/layers/metal.tsx @@ -12,6 +12,7 @@ import { persistent } from "game/persistence"; import { globalBus } from "game/events"; import { createAdditiveModifier, + createExponentialModifier, createMultiplicativeModifier, createSequentialModifier } from "game/modifiers"; @@ -30,6 +31,7 @@ import boxes from "./boxes"; import cloth from "./cloth"; import plastic from "./plastic"; import dyes from "./dyes"; +import management from "./management"; const id = "metal"; const day = 7; @@ -78,6 +80,11 @@ const layer = createLayer(id, function (this: BaseLayer) { multiplier: () => Decimal.add(cloth.cloth.value, 1).log10().plus(1), description: "Glistening Paint", enabled: dyes.upgrades.redDyeUpg.bought + })), + createExponentialModifier(() => ({ + exponent: 1.1, + description: "Mary Level 4", + enabled: management.elfTraining.heatedPlanterElfTraining.milestones[3].earned })) ]); const computedOrePurity = computed(() => orePurity.apply(0.1)); @@ -108,6 +115,11 @@ const layer = createLayer(id, function (this: BaseLayer) { multiplier: () => Decimal.add(plastic.activeRefinery.value, 1).sqrt(), description: "De Louvre", enabled: dyes.upgrades.redDyeUpg2.bought + })), + createMultiplicativeModifier(() => ({ + multiplier: () => Decimal.div(management.totalElfExp.value, 1000).add(1).sqrt(), + description: "Mary Level 5", + enabled: management.elfTraining.heatedPlanterElfTraining.milestones[4].earned })) ]); const computedAutoSmeltSpeed = computed(() => autoSmeltSpeed.apply(0)); diff --git a/src/data/layers/oil.tsx b/src/data/layers/oil.tsx index aa7a515..f4636ba 100644 --- a/src/data/layers/oil.tsx +++ b/src/data/layers/oil.tsx @@ -35,6 +35,7 @@ import { formatGain } from "util/bignum"; import plastic from "./plastic"; import paper from "./paper"; import dyes from "./dyes"; +import management from "./management"; const id = "oil"; const day = 9; @@ -247,8 +248,8 @@ const layer = createLayer(id, function (this: BaseLayer) {
Pump that oil from the ground.
- Gain oil based on the number of Heavy buildings active and well - depth, but coal usage is multiplied by {row2Upgrades[3].bought.value ? 4 : 5}×. + Gain oil based on the number of Heavy buildings active and well depth, but coal + usage is multiplied by {row2Upgrades[3].bought.value ? 4 : 5}×.

Currently: @@ -718,6 +719,11 @@ const layer = createLayer(id, function (this: BaseLayer) { multiplier: () => coalEffectiveness.value, description: "Effectiveness", enabled: () => Decimal.lt(coalEffectiveness.value, 1) + })), + createMultiplicativeModifier(() => ({ + multiplier: () => Decimal.sqrt(management.totalElfLevels.value), + description: "Jack Level 4", + enabled: management.elfTraining.heatedCutterElfTraining.milestones[3].earned })) ]); const computedOilSpeed = computed(() => oilSpeed.apply(0)); diff --git a/src/data/layers/plastic.tsx b/src/data/layers/plastic.tsx index 3e3717e..ddaf7a5 100644 --- a/src/data/layers/plastic.tsx +++ b/src/data/layers/plastic.tsx @@ -32,6 +32,7 @@ import boxes from "./boxes"; import metal from "./metal"; import oil from "./oil"; import dyes from "./dyes"; +import management from "./management"; const id = "plastic"; const day = 10; @@ -66,7 +67,11 @@ const layer = createLayer(id, function (this: BaseLayer) { resource: metal.metal, cost() { const v = new Decimal(this.amount.value); - return Decimal.pow(1.2, v).times(1e7); + let cost = Decimal.pow(1.2, v).times(1e7); + if (management.elfTraining.fertilizerElfTraining.milestones[3].earned.value) { + cost = Decimal.sub(cost, Decimal.pow(plastic.value, 2)).max(0); + } + return cost; }, display: jsx(() => ( <> @@ -299,11 +304,16 @@ const layer = createLayer(id, function (this: BaseLayer) { <> {render(trackerDisplay)} - + } + /> {render(buildRefinery)} From 49198eb74643e27442a225be681534a4e36ad862 Mon Sep 17 00:00:00 2001 From: thepaperpilot Date: Mon, 12 Dec 2022 22:26:52 -0600 Subject: [PATCH 29/67] Noel lv5 --- src/data/layers/elves.tsx | 131 +++++++++++++++++++++++---------- src/data/layers/management.tsx | 2 +- src/data/layers/paper.tsx | 52 +++++++++---- 3 files changed, 131 insertions(+), 54 deletions(-) diff --git a/src/data/layers/elves.tsx b/src/data/layers/elves.tsx index 7542b87..e51e7aa 100644 --- a/src/data/layers/elves.tsx +++ b/src/data/layers/elves.tsx @@ -329,23 +329,6 @@ const layer = createLayer(id, function (this: BaseLayer) { enabled: elvesMilestone2.earned })) ]); - const metalCooldown = createSequentialModifier(() => [ - createMultiplicativeModifier(() => ({ - multiplier: 2, - description: "6 Elves Trained", - enabled: elvesMilestone.earned - })), - createMultiplicativeModifier(() => ({ - multiplier: () => Decimal.times(paper.books.metalBook.amount.value, 0.1).add(1), - description: "Physical Metallurgy", - enabled: () => Decimal.gt(paper.books.metalBook.amount.value, 0) - })), - createMultiplicativeModifier(() => ({ - multiplier: 2, - description: "10 Elves Trained", - enabled: elvesMilestone2.earned - })) - ]); const heavyDrillCooldown = createSequentialModifier(() => [ createMultiplicativeModifier(() => ({ multiplier: 2, @@ -363,6 +346,40 @@ const layer = createLayer(id, function (this: BaseLayer) { enabled: elvesMilestone2.earned })) ]); + const oilCooldown = createSequentialModifier(() => [ + createMultiplicativeModifier(() => ({ + multiplier: 2, + description: "6 Elves Trained", + enabled: elvesMilestone.earned + })), + createMultiplicativeModifier(() => ({ + multiplier: () => Decimal.times(paper.books.oilBook.amount.value, 0.1).add(1), + description: "Burning the Midnight Oil", + enabled: () => Decimal.gt(paper.books.oilBook.amount.value, 0) + })), + createMultiplicativeModifier(() => ({ + multiplier: 2, + description: "10 Elves Trained", + enabled: elvesMilestone2.earned + })) + ]); + const metalCooldown = createSequentialModifier(() => [ + createMultiplicativeModifier(() => ({ + multiplier: 2, + description: "6 Elves Trained", + enabled: elvesMilestone.earned + })), + createMultiplicativeModifier(() => ({ + multiplier: () => Decimal.times(paper.books.metalBook.amount.value, 0.1).add(1), + description: "Physical Metallurgy", + enabled: () => Decimal.gt(paper.books.metalBook.amount.value, 0) + })), + createMultiplicativeModifier(() => ({ + multiplier: 2, + description: "10 Elves Trained", + enabled: elvesMilestone2.earned + })) + ]); const [generalTab, generalTabCollapsed] = createCollapsibleModifierSections(() => [ { @@ -456,19 +473,26 @@ const layer = createLayer(id, function (this: BaseLayer) { unit: "/s", visible: management.elfTraining.expandersElfTraining.milestones[3].earned }, + { + title: "Frosty Auto-Buy Frequency", + modifier: heavyDrillCooldown, + base: 10, + unit: "/s", + visible: management.elfTraining.fertilizerElfTraining.milestones[4].earned.value + }, + { + title: "Cocoa Auto-Buy Frequency", + modifier: oilCooldown, + base: 10, + unit: "/s", + visible: management.elfTraining.heatedCutterElfTraining.milestones[4].earned.value + }, { title: "Twinkle Auto-Buy Frequency", modifier: metalCooldown, base: 10, unit: "/s", visible: management.elfTraining.expandersElfTraining.milestones[4].earned - }, - { - title: "Frosty Auto-Buy Frequency", - modifier: heavyDrillCooldown, - base: 10, - unit: "/s", - visible: management.elfTraining.heatedCutterElfTraining.milestones[4].earned.value } ]); const showModifiersModal = ref(false); @@ -751,15 +775,6 @@ const layer = createLayer(id, function (this: BaseLayer) { } } }); - const metalElf = createElf({ - name: "Twinkle", - description: - "Twinkle will automatically purchase all metal buyables you can afford, without actually spending any resources.", - buyable: [metal.oreDrill, metal.industrialCrucible, metal.hotterForge], - cooldownModifier: metalCooldown, - visibility: () => - showIf(management.elfTraining.expandersElfTraining.milestones[4].earned.value) - }); const heavyDrillElf = createElf({ name: "Frosty", description: @@ -767,7 +782,7 @@ const layer = createLayer(id, function (this: BaseLayer) { buyable: [oil.buildHeavy, oil.buildHeavy2, oil.buildExtractor], cooldownModifier: heavyDrillCooldown, visibility: () => - showIf(management.elfTraining.heatedCutterElfTraining.milestones[4].earned.value), + showIf(management.elfTraining.fertilizerElfTraining.milestones[4].earned.value), hasToggle: true, toggleDesc: "Activate auto-purchased oil drills", onAutoPurchase(buyable) { @@ -782,7 +797,39 @@ const layer = createLayer(id, function (this: BaseLayer) { } } }); - const managementElves = [miningDrillElf, metalElf, heavyDrillElf]; + const oilElf = createElf({ + name: "Cocoa", + description: + "Cocoa will automatically purchase all oil-using machines you can afford, without actually spending any resources.", + buyable: [oil.buildPump, oil.buildBurner, oil.buildSmelter], + cooldownModifier: oilCooldown, + visibility: () => + showIf(management.elfTraining.heatedCutterElfTraining.milestones[4].earned.value), + hasToggle: true, + toggleDesc: "Activate auto-purchased oil-using machines", + onAutoPurchase(buyable) { + if (heavyDrillElf.toggle.value) { + if (buyable === oil.buildPump) { + oil.activePump.value = Decimal.add(oil.activePump.value, 1); + } else if (buyable === oil.buildBurner) { + oil.activeBurner.value = Decimal.add(oil.activeBurner.value, 1); + } else if (buyable === oil.buildSmelter) { + oil.activeSmelter.value = Decimal.add(oil.activeSmelter.value, 1); + } + } + } + }); + const managementElves = [miningDrillElf, heavyDrillElf, oilElf]; + const metalElf = createElf({ + name: "Twinkle", + description: + "Twinkle will automatically purchase all metal buyables you can afford, without actually spending any resources.", + buyable: [metal.oreDrill, metal.industrialCrucible, metal.hotterForge], + cooldownModifier: metalCooldown, + visibility: () => + showIf(management.elfTraining.expandersElfTraining.milestones[4].earned.value) + }); + const managementElves2 = [metalElf]; const elves = { cuttersElf, plantersElf, @@ -797,8 +844,9 @@ const layer = createLayer(id, function (this: BaseLayer) { boxElf, clothElf, miningDrillElf, - metalElf, - heavyDrillElf + heavyDrillElf, + oilElf, + metalElf }; const totalElves = computed(() => Object.values(elves).filter(elf => elf.bought.value).length); @@ -978,7 +1026,14 @@ const layer = createLayer(id, function (this: BaseLayer) { {render(modifiersModal)}
- {renderGrid(treesElves, coalElves, fireElves, plasticElves, managementElves)} + {renderGrid( + treesElves, + coalElves, + fireElves, + plasticElves, + managementElves, + managementElves2 + )}
{milestonesDisplay()} diff --git a/src/data/layers/management.tsx b/src/data/layers/management.tsx index d4e7eb5..51cf691 100644 --- a/src/data/layers/management.tsx +++ b/src/data/layers/management.tsx @@ -407,7 +407,7 @@ const layer = createLayer(id, () => { createMilestone(() => ({ display: { requirement: "Jack Level 5", - effectDisplay: "Unlock an elf that autobuys oil buyables." + effectDisplay: "Unlock an elf that autobuys oil-using machines." }, visibility: () => showIf(heatedCutterElfMilestones[3].earned.value && main.day.value >= 13), diff --git a/src/data/layers/paper.tsx b/src/data/layers/paper.tsx index 6edcfe8..4ff2de7 100644 --- a/src/data/layers/paper.tsx +++ b/src/data/layers/paper.tsx @@ -38,7 +38,12 @@ const layer = createLayer(id, function (this: BaseLayer) { const paper = createResource(0, "paper"); const pulp = createResource( - computed(() => Decimal.min(Decimal.div(trees.logs.value, 1e9), Decimal.div(coal.ash.value, computedAshCost.value))), + computed(() => + Decimal.min( + Decimal.div(trees.logs.value, 1e9), + Decimal.div(coal.ash.value, computedAshCost.value) + ) + ), "pulp" ); @@ -49,7 +54,10 @@ const layer = createLayer(id, function (this: BaseLayer) { roundUpCost: true, spend(gain, cost) { trees.logs.value = Decimal.sub(trees.logs.value, Decimal.times(cost, 1e9)); - coal.ash.value = Decimal.sub(coal.ash.value, Decimal.times(cost, computedAshCost.value)); + coal.ash.value = Decimal.sub( + coal.ash.value, + Decimal.times(cost, computedAshCost.value) + ); }, gainModifier: paperGain })); @@ -68,7 +76,8 @@ const layer = createLayer(id, function (this: BaseLayer) { Cost: {displayResource(trees.logs, cost)} {pulp.displayName} ( {formatWhole(Decimal.times(cost, 1e9))} {trees.logs.displayName};{" "} - {formatWhole(Decimal.times(cost, computedAshCost.value))} {coal.ash.displayName}) + {formatWhole(Decimal.times(cost, computedAshCost.value))}{" "} + {coal.ash.displayName}) ); @@ -191,19 +200,29 @@ const layer = createLayer(id, function (this: BaseLayer) { name: "Drills and Mills", elfName: "Peppermint", buyableName: "Mining Drill", - visibility: () => showIf(management.elfTraining.expandersElfTraining.milestones[3].earned.value) - }); - const metalBook = createBook({ - name: "Physical Metallurgy", - elfName: "Twinkle", - buyableName: "Metal Buyables", - visibility: () => showIf(management.elfTraining.expandersElfTraining.milestones[4].earned.value) + visibility: () => + showIf(management.elfTraining.expandersElfTraining.milestones[3].earned.value) }); const heavyDrillBook = createBook({ name: "Deep in the Earth", elfName: "Frosty", buyableName: "Oil Drills", - visibility: () => showIf(management.elfTraining.heatedCutterElfTraining.milestones[4].earned.value) + visibility: () => + showIf(management.elfTraining.fertilizerElfTraining.milestones[4].earned.value) + }); + const oilBook = createBook({ + name: "Burning the Midnight Oil", + elfName: "Cocoa", + buyableName: "Oil-Consuming Machines", + visibility: () => + showIf(management.elfTraining.heatedCutterElfTraining.milestones[4].earned.value) + }); + const metalBook = createBook({ + name: "Physical Metallurgy", + elfName: "Twinkle", + buyableName: "Metal Buyables", + visibility: () => + showIf(management.elfTraining.expandersElfTraining.milestones[4].earned.value) }); const books = { cuttersBook, @@ -219,10 +238,13 @@ const layer = createLayer(id, function (this: BaseLayer) { boxBook, clothBook, miningDrillBook, - metalBook, - heavyDrillBook + heavyDrillBook, + oilBook, + metalBook }; - const sumBooks = computed(() => Object.values(books).reduce((acc, curr) => acc.add(curr.amount.value), new Decimal(0))); + const sumBooks = computed(() => + Object.values(books).reduce((acc, curr) => acc.add(curr.amount.value), new Decimal(0)) + ); const clothUpgrade = createUpgrade(() => ({ resource: noPersist(paper), @@ -282,7 +304,7 @@ const layer = createLayer(id, function (this: BaseLayer) { ]) as WithRequired; const ashCost = createSequentialModifier(() => [ createMultiplicativeModifier(() => ({ - multiplier: .1, + multiplier: 0.1, description: "Star Level 2", enabled: management.elfTraining.paperElfTraining.milestones[1].earned })) From e3b31670034644851683c30b955e78dc64d8d78d Mon Sep 17 00:00:00 2001 From: thepaperpilot Date: Mon, 12 Dec 2022 22:32:22 -0600 Subject: [PATCH 30/67] Cleanup --- src/data/layers/management.tsx | 39 ++++++++++++++++++++++++---------- 1 file changed, 28 insertions(+), 11 deletions(-) diff --git a/src/data/layers/management.tsx b/src/data/layers/management.tsx index 51cf691..3310bb7 100644 --- a/src/data/layers/management.tsx +++ b/src/data/layers/management.tsx @@ -123,11 +123,27 @@ const layer = createLayer(id, () => { ...modifiers: Modifier[] ) { const exp = persistent(0); - var costMulti = ["Holly","Ivy","Hope","Jack","Mary","Noel","Joy","Faith","Snowball","Star","Bell","Gingersnap"].indexOf(elf.name)+1 - if(elf.name == "Star" || elf.name == "Bell"){ - costMulti /= 3 + let costMulti = + [ + "Holly", + "Ivy", + "Hope", + "Jack", + "Mary", + "Noel", + "Joy", + "Faith", + "Snowball", + "Star", + "Bell", + "Gingersnap" + ].indexOf(elf.name) + 1; + if (elf.name == "Star" || elf.name == "Bell") { + costMulti /= 3; } - const expRequiredForNextLevel = computed(() => Decimal.pow(10, level.value).mul(4000).mul(costMulti)); + const expRequiredForNextLevel = computed(() => + Decimal.pow(10, level.value).mul(4000).mul(costMulti) + ); const level = computed(() => Decimal.min( Decimal.mul(9, exp.value).div(4000).div(costMulti).add(1).log10().floor(), @@ -1034,13 +1050,13 @@ const layer = createLayer(id, () => { resource: trees.logs, cost: 1e50 })); - const upgrades = [ focusUpgrade1, focusUpgrade2, focusUpgrade3 ]; + const upgrades = [focusUpgrade1, focusUpgrade2, focusUpgrade3]; // ------------------------------------------------------------------------------- Schools const schoolCost = computed(() => { const schoolFactor = Decimal.pow(10, schools.amount.value); - const woodFactor = Decimal.pow(2e4, schools.amount.value) - const coalFactor = Decimal.pow(2000, schools.amount.value) + const woodFactor = Decimal.pow(2e4, schools.amount.value); + const coalFactor = Decimal.pow(2000, schools.amount.value); return { wood: woodFactor.mul(1e21), coal: coalFactor.mul(1e32), @@ -1131,9 +1147,9 @@ const layer = createLayer(id, () => { multiplying elves' XP gain by {format(classroomEffect.value)}
- Costs {format(classroomCost.value.wood)} logs,{format(classroomCost.value.paper)}{" "} - paper, {format(classroomCost.value.boxes)} boxes,{" "} - {format(classroomCost.value.metalIngots)} metal ingots + Costs {format(classroomCost.value.wood)} logs, + {format(classroomCost.value.paper)} paper, {format(classroomCost.value.boxes)}{" "} + boxes, {format(classroomCost.value.metalIngots)} metal ingots
)), @@ -1308,7 +1324,8 @@ const layer = createLayer(id, () => { {render(modifiersModal)} {render(dayProgress)}
- {renderCol(schools, classrooms)} {renderGrid([teaching, classroomUpgrade])} {renderGrid(upgrades)} + {renderCol(schools, classrooms)} {renderGrid([teaching, classroomUpgrade])}{" "} + {renderGrid(upgrades)} {Decimal.gt(schools.amount.value, 0) ? ( <>
From 7c8d31c3e8244b8b50534519a9d5d2377dcde5c5 Mon Sep 17 00:00:00 2001 From: thepaperpilot Date: Mon, 12 Dec 2022 22:49:36 -0600 Subject: [PATCH 31/67] Boxes --- src/data/layers/boxes.tsx | 96 ++++++++++++++++++++++++++++++++++----- 1 file changed, 84 insertions(+), 12 deletions(-) diff --git a/src/data/layers/boxes.tsx b/src/data/layers/boxes.tsx index d6ffc74..77f4ec8 100644 --- a/src/data/layers/boxes.tsx +++ b/src/data/layers/boxes.tsx @@ -27,7 +27,11 @@ import paper from "./paper"; import plastic from "./plastic"; import trees from "./trees"; -export type BoxesBuyable = GenericBuyable & { resource: Resource; freeLevels: ComputedRef; totalAmount: ComputedRef }; +export type BoxesBuyable = GenericBuyable & { + resource: Resource; + freeLevels: ComputedRef; + totalAmount: ComputedRef; +}; const id = "boxes"; const day = 6; @@ -164,7 +168,7 @@ const layer = createLayer(id, function (this: BaseLayer) { title: "Carry dye in boxes", description: "Double all dye gain" } - })) as GenericUpgrade; + })) as GenericUpgrade; const xpUpgrade = createUpgrade(() => ({ resource: noPersist(boxes), cost: 1e18, @@ -178,7 +182,19 @@ const layer = createLayer(id, function (this: BaseLayer) { const logBoxesBuyable = createBuyable(() => ({ display: { title: "Carry more logs", - description: jsx(() => <>Use boxes to carry even more logs, boosting their gain

Amount: {formatWhole(logBoxesBuyable.amount.value)}{Decimal.gt(logBoxesBuyable.freeLevels.value, 0) ? <> (+{formatWhole(logBoxesBuyable.freeLevels.value)}) : null}
), + description: jsx(() => ( + <> + Use boxes to carry even more logs, boosting their gain +
+
+
+ Amount: {formatWhole(logBoxesBuyable.amount.value)} + {Decimal.gt(logBoxesBuyable.freeLevels.value, 0) ? ( + <> (+{formatWhole(logBoxesBuyable.freeLevels.value)}) + ) : null} +
+ + )), effectDisplay: jsx(() => ( <>{format(Decimal.div(logBoxesBuyable.totalAmount.value, 2).add(1))}x )), @@ -195,13 +211,34 @@ const layer = createLayer(id, function (this: BaseLayer) { return Decimal.pow(scaling, v).times(100).div(dyes.boosts.orange2.value); }, visibility: () => showIf(logsUpgrade.bought.value), - freeLevels: computed(() => management.elfTraining.boxElfTraining.milestones[0].earned.value ? Decimal.max(ashBoxesBuyable.amount.value, 1).sqrt().floor().add(Decimal.max(coalBoxesBuyable.amount.value, 1).sqrt().floor()) : 0), - totalAmount: computed(() => Decimal.add(logBoxesBuyable.amount.value, logBoxesBuyable.freeLevels.value)) + freeLevels: computed(() => + management.elfTraining.boxElfTraining.milestones[0].earned.value + ? Decimal.max(ashBoxesBuyable.amount.value, 1) + .sqrt() + .floor() + .add(Decimal.max(coalBoxesBuyable.amount.value, 1).sqrt().floor()) + : 0 + ), + totalAmount: computed(() => + Decimal.add(logBoxesBuyable.amount.value, logBoxesBuyable.freeLevels.value) + ) })) as BoxesBuyable; const ashBoxesBuyable = createBuyable(() => ({ display: { title: "Carry more ash", - description: jsx(() => <>Use boxes to carry even more ash, boosting its gain

Amount: {formatWhole(ashBoxesBuyable.amount.value)}{Decimal.gt(ashBoxesBuyable.freeLevels.value, 0) ? <> (+{formatWhole(ashBoxesBuyable.freeLevels.value)}) : null}
), + description: jsx(() => ( + <> + Use boxes to carry even more ash, boosting its gain +
+
+
+ Amount: {formatWhole(ashBoxesBuyable.amount.value)} + {Decimal.gt(ashBoxesBuyable.freeLevels.value, 0) ? ( + <> (+{formatWhole(ashBoxesBuyable.freeLevels.value)}) + ) : null} +
+ + )), effectDisplay: jsx(() => ( <>{format(Decimal.div(ashBoxesBuyable.totalAmount.value, 2).add(1))}x )), @@ -218,13 +255,34 @@ const layer = createLayer(id, function (this: BaseLayer) { return Decimal.pow(scaling, v).times(1000).div(dyes.boosts.orange2.value); }, visibility: () => showIf(ashUpgrade.bought.value), - freeLevels: computed(() => management.elfTraining.boxElfTraining.milestones[0].earned.value ? Decimal.max(logBoxesBuyable.amount.value, 1).sqrt().floor().add(Decimal.max(coalBoxesBuyable.amount.value, 1).sqrt().floor()) : 0), - totalAmount: computed(() => Decimal.add(ashBoxesBuyable.amount.value, ashBoxesBuyable.freeLevels.value)) + freeLevels: computed(() => + management.elfTraining.boxElfTraining.milestones[0].earned.value + ? Decimal.max(logBoxesBuyable.amount.value, 1) + .sqrt() + .floor() + .add(Decimal.max(coalBoxesBuyable.amount.value, 1).sqrt().floor()) + : 0 + ), + totalAmount: computed(() => + Decimal.add(ashBoxesBuyable.amount.value, ashBoxesBuyable.freeLevels.value) + ) })) as BoxesBuyable; const coalBoxesBuyable = createBuyable(() => ({ display: { title: "Carry more coal", - description: jsx(() => <>Use boxes to carry even more coal, boosting its gain

Amount: {formatWhole(coalBoxesBuyable.amount.value)}{Decimal.gt(coalBoxesBuyable.freeLevels.value, 0) ? <> (+{formatWhole(coalBoxesBuyable.freeLevels.value)}) : null}
), + description: jsx(() => ( + <> + Use boxes to carry even more coal, boosting its gain +
+
+
+ Amount: {formatWhole(coalBoxesBuyable.amount.value)} + {Decimal.gt(coalBoxesBuyable.freeLevels.value, 0) ? ( + <> (+{formatWhole(coalBoxesBuyable.freeLevels.value)}) + ) : null} +
+ + )), effectDisplay: jsx(() => ( <>{format(Decimal.div(coalBoxesBuyable.totalAmount.value, 2).add(1))}x )), @@ -241,8 +299,17 @@ const layer = createLayer(id, function (this: BaseLayer) { return Decimal.pow(scaling, v).times(1000).div(dyes.boosts.orange2.value); }, visibility: () => showIf(coalUpgrade.bought.value), - freeLevels: computed(() => management.elfTraining.boxElfTraining.milestones[0].earned.value ? Decimal.max(logBoxesBuyable.amount.value, 1).sqrt().floor().add(Decimal.max(ashBoxesBuyable.amount.value, 1).sqrt().floor()) : 0), - totalAmount: computed(() => Decimal.add(coalBoxesBuyable.amount.value, coalBoxesBuyable.freeLevels.value)) + freeLevels: computed(() => + management.elfTraining.boxElfTraining.milestones[0].earned.value + ? Decimal.max(logBoxesBuyable.amount.value, 1) + .sqrt() + .floor() + .add(Decimal.max(ashBoxesBuyable.amount.value, 1).sqrt().floor()) + : 0 + ), + totalAmount: computed(() => + Decimal.add(coalBoxesBuyable.amount.value, coalBoxesBuyable.freeLevels.value) + ) })) as BoxesBuyable; const buyables = { logBoxesBuyable, ashBoxesBuyable, coalBoxesBuyable }; @@ -300,6 +367,7 @@ const layer = createLayer(id, function (this: BaseLayer) { row3Upgrades, buyables, minWidth: 700, + generalTabCollapsed, display: jsx(() => ( <> {render(trackerDisplay)} @@ -308,7 +376,11 @@ const layer = createLayer(id, function (this: BaseLayer) { {render(makeBoxes)} - {renderGrid(Object.values(upgrades), Object.values(row2Upgrades), Object.values(row3Upgrades))} + {renderGrid( + Object.values(upgrades), + Object.values(row2Upgrades), + Object.values(row3Upgrades) + )} {renderRow(...Object.values(buyables))} From 02062856f6a263bcfd9f58740a042b44537aa138 Mon Sep 17 00:00:00 2001 From: thepaperpilot Date: Mon, 12 Dec 2022 22:56:48 -0600 Subject: [PATCH 32/67] Classic off-by-one error --- src/data/layers/management.tsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/data/layers/management.tsx b/src/data/layers/management.tsx index 3310bb7..0526f00 100644 --- a/src/data/layers/management.tsx +++ b/src/data/layers/management.tsx @@ -1018,7 +1018,7 @@ const layer = createLayer(id, () => { let x = 0; focusTargets.value = {}; const newCount = Decimal.min(count, range); - while (newCount.gte(x)) { + while (newCount.gt(x)) { const roll = Object.values(elfTraining)[Math.floor(Math.random() * range)]?.name ?? ""; if (!focusTargets.value[roll]) { focusTargets.value[roll] = true; From 10a03eab18285bb8aab7b82a61168fd817bf8bbf Mon Sep 17 00:00:00 2001 From: thepaperpilot Date: Mon, 12 Dec 2022 22:58:41 -0600 Subject: [PATCH 33/67] Fix classroom effect --- src/data/layers/management.tsx | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/data/layers/management.tsx b/src/data/layers/management.tsx index 0526f00..ba72c0c 100644 --- a/src/data/layers/management.tsx +++ b/src/data/layers/management.tsx @@ -104,12 +104,12 @@ const layer = createLayer(id, () => { })); const globalXPModifier = createSequentialModifier(() => [ createMultiplicativeModifier(() => ({ - multiplier: () => classroomEffect.value, + multiplier: classroomEffect, description: "Classroom Effect", - enabled: () => classroomUpgrade.bought.value + enabled: classroomUpgrade.bought })) ]); - const globalXPModifierComputed = globalXPModifier.apply(1); + const globalXPModifierComputed = computed(() => globalXPModifier.apply(1)); // ------------------------------------------------------------------------------- Training core function From 39dfe97599974cbc0b89740893f3fe0c8cc29141 Mon Sep 17 00:00:00 2001 From: unsoftcapped3 <75136164+unsoftcapped3@users.noreply.github.com> Date: Mon, 12 Dec 2022 21:01:13 -0800 Subject: [PATCH 34/67] add some .value's --- src/data/layers/management.tsx | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/data/layers/management.tsx b/src/data/layers/management.tsx index ba72c0c..a64bbcb 100644 --- a/src/data/layers/management.tsx +++ b/src/data/layers/management.tsx @@ -948,14 +948,14 @@ const layer = createLayer(id, () => { createMultiplicativeModifier(() => ({ multiplier: 2, description: "Focus Upgrade 1", - enabled: focusUpgrade1.bought + enabled: focusUpgrade1.bought.value })) ]); const maximumElvesModifier = createSequentialModifier(() => [ createAdditiveModifier(() => ({ addend: 1, description: "Focus Upgrade 2", - enabled: focusUpgrade2.bought + enabled: focusUpgrade2.bought.value })) ]); @@ -963,7 +963,7 @@ const layer = createLayer(id, () => { createAdditiveModifier(() => ({ addend: -5, description: "Focus Upgrade 3", - enabled: focusUpgrade3.bought + enabled: focusUpgrade3.bought.value })) ]); From 6a00574a78fcd2e8212212b13fe7036b8a003481 Mon Sep 17 00:00:00 2001 From: thepaperpilot Date: Mon, 12 Dec 2022 23:11:42 -0600 Subject: [PATCH 35/67] Fixed some management issues --- src/data/layers/elves.tsx | 2 +- src/data/layers/management.tsx | 21 +++++++++++++-------- 2 files changed, 14 insertions(+), 9 deletions(-) diff --git a/src/data/layers/elves.tsx b/src/data/layers/elves.tsx index e51e7aa..d165c4c 100644 --- a/src/data/layers/elves.tsx +++ b/src/data/layers/elves.tsx @@ -535,7 +535,7 @@ const layer = createLayer(id, function (this: BaseLayer) { const buyProgress = persistent(0); const amountOfTimesDone = persistent(0); const toggle = options.hasToggle ? persistent(false) : ref(true); - + const computedAutoBuyCooldown = computed(() => options.cooldownModifier.apply(10)); const isActive = convertComputable(options.canBuy ?? true); diff --git a/src/data/layers/management.tsx b/src/data/layers/management.tsx index a64bbcb..81a8600 100644 --- a/src/data/layers/management.tsx +++ b/src/data/layers/management.tsx @@ -196,12 +196,17 @@ const layer = createLayer(id, () => { const elfXPGainComputed = computed(() => elfXPGain.apply(0.1)); const click = createClickable(() => ({ display: { - title: elf.name, + title: jsx(() => ( + <> + {elf.name} - LV {formatWhole(level.value)} + + )), description: jsx(() => ( <> - {elf.name} is currently at level {formatWhole(level.value)}, and achieved a - total of {format(exp.value)} XP. They buy buyables{" "} - {formatWhole(elf.computedAutoBuyCooldown.value)} times per second, gaining{" "} + Current XP: {format(exp.value)} +
+ {elf.name} can buy buyables {formatWhole(elf.computedAutoBuyCooldown.value)}{" "} + times per second, gaining{" "} {Decimal.gte(level.value, schools.amount.value) ? 0 : format( @@ -487,7 +492,7 @@ const layer = createLayer(id, () => { )) }, - shouldEarn: () => heatedPlanterElfTraining.level.value >= 1 + shouldEarn: () => fertilizerElfTraining.level.value >= 1 })), createMilestone(() => ({ display: { @@ -495,7 +500,7 @@ const layer = createLayer(id, () => { effectDisplay: `"The Garden Tree's Handbook" affects "Fertilized Soil" twice` }, visibility: () => showIf(fertilizerElfMilestones[0].earned.value), - shouldEarn: () => heatedPlanterElfTraining.level.value >= 2 + shouldEarn: () => fertilizerElfTraining.level.value >= 2 })), createMilestone(() => ({ display: { @@ -503,7 +508,7 @@ const layer = createLayer(id, () => { effectDisplay: "Divide the mining drill cost by ln(Total logs + e)" }, visibility: () => showIf(fertilizerElfMilestones[1].earned.value), - shouldEarn: () => heatedPlanterElfTraining.level.value >= 3 + shouldEarn: () => fertilizerElfTraining.level.value >= 3 })), createMilestone(() => ({ display: { @@ -516,7 +521,7 @@ const layer = createLayer(id, () => { }, visibility: () => showIf(fertilizerElfMilestones[2].earned.value && main.day.value >= 13), - shouldEarn: () => heatedPlanterElfTraining.level.value >= 4 + shouldEarn: () => fertilizerElfTraining.level.value >= 4 })), createMilestone(() => ({ display: { From 8162180017785e454c6e4865bf36076f4bc9f2cb Mon Sep 17 00:00:00 2001 From: thepaperpilot Date: Mon, 12 Dec 2022 23:13:03 -0600 Subject: [PATCH 36/67] Removing more information --- src/data/layers/management.tsx | 2 -- 1 file changed, 2 deletions(-) diff --git a/src/data/layers/management.tsx b/src/data/layers/management.tsx index 81a8600..2dc7b7e 100644 --- a/src/data/layers/management.tsx +++ b/src/data/layers/management.tsx @@ -203,8 +203,6 @@ const layer = createLayer(id, () => { )), description: jsx(() => ( <> - Current XP: {format(exp.value)} -
{elf.name} can buy buyables {formatWhole(elf.computedAutoBuyCooldown.value)}{" "} times per second, gaining{" "} {Decimal.gte(level.value, schools.amount.value) From 707120645059f042b308e5c694d9fe1d750842b0 Mon Sep 17 00:00:00 2001 From: thepaperpilot Date: Mon, 12 Dec 2022 23:13:27 -0600 Subject: [PATCH 37/67] Revert "add some .value's" This reverts commit 39dfe97599974cbc0b89740893f3fe0c8cc29141. --- src/data/layers/management.tsx | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/data/layers/management.tsx b/src/data/layers/management.tsx index 2dc7b7e..fa5f29a 100644 --- a/src/data/layers/management.tsx +++ b/src/data/layers/management.tsx @@ -951,14 +951,14 @@ const layer = createLayer(id, () => { createMultiplicativeModifier(() => ({ multiplier: 2, description: "Focus Upgrade 1", - enabled: focusUpgrade1.bought.value + enabled: focusUpgrade1.bought })) ]); const maximumElvesModifier = createSequentialModifier(() => [ createAdditiveModifier(() => ({ addend: 1, description: "Focus Upgrade 2", - enabled: focusUpgrade2.bought.value + enabled: focusUpgrade2.bought })) ]); @@ -966,7 +966,7 @@ const layer = createLayer(id, () => { createAdditiveModifier(() => ({ addend: -5, description: "Focus Upgrade 3", - enabled: focusUpgrade3.bought.value + enabled: focusUpgrade3.bought })) ]); From 327dac3129bddcd29e88830ef4a9593750369223 Mon Sep 17 00:00:00 2001 From: thepaperpilot Date: Mon, 12 Dec 2022 23:29:58 -0600 Subject: [PATCH 38/67] Re-did joy's lv 1 milestone --- src/data/layers/coal.tsx | 33 ++++++++++++++++++++------------- src/data/layers/management.tsx | 2 +- 2 files changed, 21 insertions(+), 14 deletions(-) diff --git a/src/data/layers/coal.tsx b/src/data/layers/coal.tsx index f7e90fb..ea82998 100644 --- a/src/data/layers/coal.tsx +++ b/src/data/layers/coal.tsx @@ -82,13 +82,7 @@ const layer = createLayer(id, function (this: BaseLayer) { const activeFires = persistent(0); const fireLogs = computed(() => Decimal.times(activeFires.value, 1000)); - const fireCoal = computed(() => { - let gain = Decimal.times(activeFires.value, 0.1); - if (management.elfTraining.smallfireElfTraining.milestones[0].earned.value) { - gain = gain.times(5); - } - return gain; - }); + const fireCoal = computed(() => Decimal.times(activeFires.value, 0.1)); const fireAsh = computed(() => { let gain = Decimal.times(activeFires.value, 50); if (management.elfTraining.smallfireElfTraining.milestones[0].earned.value) { @@ -263,10 +257,11 @@ const layer = createLayer(id, function (this: BaseLayer) { Decimal.times( Decimal.pow(activeDrills.value, oil.row2Upgrades[1].bought.value ? 2 : 1), 5e7 - ).times(metal.efficientDrill.bought.value ? 2 : 1) - .times(management.elfTraining.smallfireElfTraining.milestones[2].earned.value ? 2 : 1) - .times(management.elfTraining.bonfireElfTraining.milestones[2].earned.value ? 2 : 1) - .times(management.elfTraining.kilnElfTraining.milestones[2].earned.value ? 2 : 1) + ) + .times(metal.efficientDrill.bought.value ? 2 : 1) + .times(management.elfTraining.smallfireElfTraining.milestones[2].earned.value ? 2 : 1) + .times(management.elfTraining.bonfireElfTraining.milestones[2].earned.value ? 2 : 1) + .times(management.elfTraining.kilnElfTraining.milestones[2].earned.value ? 2 : 1) ); const buildDrill = createBuyable(() => ({ resource: metal.metal, @@ -596,7 +591,13 @@ const layer = createLayer(id, function (this: BaseLayer) { enabled: boxes.upgrades.coalUpgrade.bought })), createMultiplicativeModifier(() => ({ - multiplier: () => Decimal.div(buildFire.amount.value, 10000).add(1), + multiplier: () => { + let v = buildFire.amount.value; + if (management.elfTraining.smallfireElfTraining.milestones[0].earned.value) { + v = Decimal.div(buildBonfire.amount.value, 10).add(v); + } + return Decimal.div(v, 10000).add(1); + }, description: "Small Fires Synergy", enabled: elves.elves.smallFireElf.bought })), @@ -694,7 +695,13 @@ const layer = createLayer(id, function (this: BaseLayer) { enabled: boxes.upgrades.ashUpgrade.bought })), createMultiplicativeModifier(() => ({ - multiplier: () => Decimal.div(buildFire.amount.value, 1000).add(1), + multiplier: () => { + let v = buildFire.amount.value; + if (management.elfTraining.smallfireElfTraining.milestones[0].earned.value) { + v = Decimal.div(buildBonfire.amount.value, 100).add(v); + } + return Decimal.div(v, 1000).add(1); + }, description: "Small Fires Synergy", enabled: elves.elves.smallFireElf.bought })), diff --git a/src/data/layers/management.tsx b/src/data/layers/management.tsx index fa5f29a..ff6dc6a 100644 --- a/src/data/layers/management.tsx +++ b/src/data/layers/management.tsx @@ -535,7 +535,7 @@ const layer = createLayer(id, () => { createMilestone(() => ({ display: { requirement: "Joy Level 1", - effectDisplay: "Multiply small fire efficiency by 5." + effectDisplay: "Small Fire synergy counts bonfires at reduced rate." }, shouldEarn: () => smallfireElfTraining.level.value >= 1 })), From 944329a2712fc514953cffce6cbc4856d9a30c1b Mon Sep 17 00:00:00 2001 From: thepaperpilot Date: Mon, 12 Dec 2022 23:41:44 -0600 Subject: [PATCH 39/67] Updated management progress display --- src/data/layers/management.tsx | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/src/data/layers/management.tsx b/src/data/layers/management.tsx index ff6dc6a..182071f 100644 --- a/src/data/layers/management.tsx +++ b/src/data/layers/management.tsx @@ -22,7 +22,7 @@ import { persistent } from "game/persistence"; import Decimal, { DecimalSource, format, formatTime, formatWhole } from "util/bignum"; import { Direction } from "util/common"; import { render, renderCol, renderGrid } from "util/vue"; -import { computed, ComputedRef, ref, Ref } from "vue"; +import { computed, ComputedRef, ref, Ref, unref } from "vue"; import elves from "./elves"; import trees from "./trees"; import paper from "./paper"; @@ -59,8 +59,13 @@ const layer = createLayer(id, () => { display: jsx(() => main.day.value === day ? ( <> - {formatWhole(totalElfLevels.value)}/{formatWhole(elves.totalElves.value * 5)}{" "} - elf levels + {formatWhole( + Decimal.times( + unref(dayProgress.progress), + main.day.value === advancedDay ? 80 : 36 + ) + )} + /{main.day.value === advancedDay ? 80 : 36} elf levels ) : ( "" From e904e9da5cd9b16d7c57a25e5fab48b9c1a14b57 Mon Sep 17 00:00:00 2001 From: thepaperpilot Date: Mon, 12 Dec 2022 23:44:52 -0600 Subject: [PATCH 40/67] Fix build error --- src/data/layers/management.tsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/data/layers/management.tsx b/src/data/layers/management.tsx index 182071f..e2b65e0 100644 --- a/src/data/layers/management.tsx +++ b/src/data/layers/management.tsx @@ -57,7 +57,7 @@ const layer = createLayer(id, () => { day13Elves.length : 1, display: jsx(() => - main.day.value === day ? ( + main.day.value === day || main.day.value === advancedDay ? ( <> {formatWhole( Decimal.times( From 40ff736e658b939858fbc7f15d7a91ec16002e2a Mon Sep 17 00:00:00 2001 From: unsoftcapped3 <75136164+unsoftcapped3@users.noreply.github.com> Date: Mon, 12 Dec 2022 22:05:45 -0800 Subject: [PATCH 41/67] reduce xp scaling --- src/data/layers/management.tsx | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/data/layers/management.tsx b/src/data/layers/management.tsx index e2b65e0..6c0a59f 100644 --- a/src/data/layers/management.tsx +++ b/src/data/layers/management.tsx @@ -147,16 +147,16 @@ const layer = createLayer(id, () => { costMulti /= 3; } const expRequiredForNextLevel = computed(() => - Decimal.pow(10, level.value).mul(4000).mul(costMulti) + Decimal.pow(5, level.value).mul(4000).mul(costMulti) ); const level = computed(() => Decimal.min( - Decimal.mul(9, exp.value).div(4000).div(costMulti).add(1).log10().floor(), + Decimal.mul(9, exp.value).div(4000).div(costMulti).add(1).log(5).floor(), schools.amount.value ).toNumber() ); const expToNextLevel = computed(() => - Decimal.sub(exp.value, Decimal.pow(10, level.value).sub(1).div(9).mul(4000)) + Decimal.sub(exp.value, Decimal.pow(5, level.value).sub(1).div(9).mul(4000)) ); const bar = createBar(() => ({ direction: Direction.Right, From 8f9297e162ae82f2ef3d331ee5a4f3b26f2cefae Mon Sep 17 00:00:00 2001 From: thepaperpilot Date: Mon, 12 Dec 2022 23:50:35 -0600 Subject: [PATCH 42/67] Add minimizedDisplay --- src/components/Game.vue | 5 +++-- src/components/Layer.vue | 12 ++++++++---- src/game/layers.tsx | 9 ++++++++- 3 files changed, 19 insertions(+), 7 deletions(-) diff --git a/src/components/Game.vue b/src/components/Game.vue index 7d7e531..238a17a 100644 --- a/src/components/Game.vue +++ b/src/components/Game.vue @@ -66,8 +66,9 @@ const useHeader = projInfo.useHeader; const loreBody = computeOptionalComponent(main.loreBody); function gatherLayerProps(layer: GenericLayer) { - const { display, minimized, minWidth, name, color, minimizable, nodes } = layer; - return { display, minimized, minWidth, name, color, minimizable, nodes }; + const { display, minimized, minWidth, name, color, minimizable, nodes, minimizedDisplay } = + layer; + return { display, minimized, minWidth, name, color, minimizable, nodes, minimizedDisplay }; } diff --git a/src/components/Layer.vue b/src/components/Layer.vue index 8a6e7b1..62cca55 100644 --- a/src/components/Layer.vue +++ b/src/components/Layer.vue @@ -2,7 +2,8 @@
@@ -21,7 +22,7 @@ import type { CoercableComponent } from "features/feature"; import type { FeatureNode } from "game/layers"; import type { Persistent } from "game/persistence"; import player from "game/player"; -import { computeComponent, processedPropType, wrapRef } from "util/vue"; +import { computeComponent, computeOptionalComponent, processedPropType, wrapRef } from "util/vue"; import type { PropType, Ref } from "vue"; import { computed, defineComponent, nextTick, toRefs, unref, watch } from "vue"; import Context from "./Context.vue"; @@ -41,6 +42,7 @@ export default defineComponent({ type: processedPropType(Object, String, Function), required: true }, + minimizedDisplay: processedPropType(Object, String, Function), minimized: { type: Object as PropType>, required: true @@ -61,9 +63,10 @@ export default defineComponent({ } }, setup(props) { - const { display, index, minimized, minWidth, tab } = toRefs(props); + const { display, index, minimized, minWidth, tab, minimizedDisplay } = toRefs(props); const component = computeComponent(display); + const minimizedComponent = computeOptionalComponent(minimizedDisplay); const showGoBack = computed( () => projInfo.allowGoBack && index.value > 0 && !minimized.value ); @@ -106,6 +109,7 @@ export default defineComponent({ return { component, + minimizedComponent, showGoBack, updateNodes, unref, @@ -155,7 +159,7 @@ export default defineComponent({ background-color: transparent; } -.layer-tab.minimized div { +.layer-tab.minimized > * { margin: 0; writing-mode: vertical-rl; padding-left: 10px; diff --git a/src/game/layers.tsx b/src/game/layers.tsx index 404d72c..5435a2d 100644 --- a/src/game/layers.tsx +++ b/src/game/layers.tsx @@ -109,7 +109,7 @@ export interface LayerOptions { color?: Computable; /** * The layout of this layer's features. - * When the layer is open in {@link game/player.PlayerData.tabs}, this is the content that is display. + * When the layer is open in {@link game/player.PlayerData.tabs}, this is the content that is displayed. */ display: Computable; /** An object of classes that should be applied to the display. */ @@ -126,6 +126,11 @@ export interface LayerOptions { * Defaults to true. */ minimizable?: Computable; + /** + * The layout of this layer's features. + * When the layer is open in {@link game/player.PlayerData.tabs}, but the tab is {@link Layer.minimized} this is the content that is displayed. + */ + minimizedDisplay?: Computable; /** * Whether or not to force the go back button to be hidden. * If true, go back will be hidden regardless of {@link data/projInfo.allowGoBack}. @@ -170,6 +175,7 @@ export type Layer = Replace< name: GetComputableTypeWithDefault; minWidth: GetComputableTypeWithDefault; minimizable: GetComputableTypeWithDefault; + minimizedDisplay: GetComputableType; forceHideGoBack: GetComputableType; } >; @@ -231,6 +237,7 @@ export function createLayer( setDefault(layer, "minWidth", 600); processComputable(layer as T, "minimizable"); setDefault(layer, "minimizable", true); + processComputable(layer as T, "minimizedDisplay"); return layer as unknown as Layer; }); From 78a2d8fe7d6af4f9dd845d89a80f73d18c26d2c7 Mon Sep 17 00:00:00 2001 From: thepaperpilot Date: Tue, 13 Dec 2022 00:07:32 -0600 Subject: [PATCH 43/67] Add minimized displays for every layer's main resource --- src/data/layers/boxes.tsx | 5 +++++ src/data/layers/cloth.tsx | 11 +++++++++-- src/data/layers/coal.tsx | 5 +++++ src/data/layers/metal.tsx | 5 +++++ src/data/layers/oil.tsx | 7 ++++++- src/data/layers/paper.tsx | 5 +++++ src/data/layers/plastic.tsx | 5 +++++ src/data/layers/trees.tsx | 25 +++++++++++++++++++------ src/data/layers/workshop.tsx | 7 ++++++- 9 files changed, 65 insertions(+), 10 deletions(-) diff --git a/src/data/layers/boxes.tsx b/src/data/layers/boxes.tsx index 77f4ec8..b87f77c 100644 --- a/src/data/layers/boxes.tsx +++ b/src/data/layers/boxes.tsx @@ -384,6 +384,11 @@ const layer = createLayer(id, function (this: BaseLayer) { {renderRow(...Object.values(buyables))} + )), + minimizedDisplay: jsx(() => ( +
+ {name} - {format(boxes.value)} {boxes.displayName} +
)) }; }); diff --git a/src/data/layers/cloth.tsx b/src/data/layers/cloth.tsx index 7dbf718..a2947c5 100644 --- a/src/data/layers/cloth.tsx +++ b/src/data/layers/cloth.tsx @@ -23,7 +23,7 @@ import { createSequentialModifier } from "game/modifiers"; import { noPersist, persistent } from "game/persistence"; -import Decimal, { DecimalSource } from "util/bignum"; +import Decimal, { DecimalSource, format } from "util/bignum"; import { formatWhole } from "util/break_eternity"; import { Direction } from "util/common"; import { render, renderCol, renderRow } from "util/vue"; @@ -331,7 +331,9 @@ const layer = createLayer(id, function (this: BaseLayer) { })); const paperUpgrades = { paperUpgrade4, paperUpgrade3, paperUpgrade2, paperUpgrade1 }; - const hollyEffect = computed(() => Decimal.add(trees.computedAutoCuttingAmount.value, 1).root(3)); + const hollyEffect = computed(() => + Decimal.add(trees.computedAutoCuttingAmount.value, 1).root(3) + ); const gingersnapEffect = computed(() => Decimal.add(dyes.dyeSum.value, 10).log10()); const sheepGain = createSequentialModifier(() => [ @@ -557,6 +559,11 @@ const layer = createLayer(id, function (this: BaseLayer) { {renderCol(...Object.values(paperUpgrades))} + )), + minimizedDisplay: jsx(() => ( +
+ {name} - {format(cloth.value)} {cloth.displayName} +
)) }; }); diff --git a/src/data/layers/coal.tsx b/src/data/layers/coal.tsx index ea82998..15b5e76 100644 --- a/src/data/layers/coal.tsx +++ b/src/data/layers/coal.tsx @@ -957,6 +957,11 @@ const layer = createLayer(id, function (this: BaseLayer) { {renderGrid(row1upgrades, row2upgrades, row3upgrades)} {renderRow(...row3buyables)} + )), + minimizedDisplay: jsx(() => ( +
+ {name} - {format(coal.value)} {coal.displayName} +
)) }; }); diff --git a/src/data/layers/metal.tsx b/src/data/layers/metal.tsx index 81d0166..0d7d430 100644 --- a/src/data/layers/metal.tsx +++ b/src/data/layers/metal.tsx @@ -585,6 +585,11 @@ const layer = createLayer(id, function (this: BaseLayer) { )} {renderRow(oreDrill, industrialCrucible, hotterForge)} + )), + minimizedDisplay: jsx(() => ( +
+ {name} - {format(metal.value)} {metal.displayName} +
)) }; }); diff --git a/src/data/layers/oil.tsx b/src/data/layers/oil.tsx index f4636ba..ce378b0 100644 --- a/src/data/layers/oil.tsx +++ b/src/data/layers/oil.tsx @@ -1074,7 +1074,12 @@ const layer = createLayer(id, function (this: BaseLayer) { {Decimal.gte(totalOil.value, 50) ? oilMilestonesDisplay() : ""} ); - }) + }), + minimizedDisplay: jsx(() => ( +
+ {name} - {format(oil.value)} {oil.displayName} +
+ )) }; }); diff --git a/src/data/layers/paper.tsx b/src/data/layers/paper.tsx index 4ff2de7..01eb85b 100644 --- a/src/data/layers/paper.tsx +++ b/src/data/layers/paper.tsx @@ -383,6 +383,11 @@ const layer = createLayer(id, function (this: BaseLayer) { {renderCol(...Object.values(books))} + )), + minimizedDisplay: jsx(() => ( +
+ {name} - {format(paper.value)} {paper.displayName} +
)) }; }); diff --git a/src/data/layers/plastic.tsx b/src/data/layers/plastic.tsx index ddaf7a5..1527123 100644 --- a/src/data/layers/plastic.tsx +++ b/src/data/layers/plastic.tsx @@ -329,6 +329,11 @@ const layer = createLayer(id, function (this: BaseLayer) { {renderCol(clothTools, clothElf, clothGains)} + )), + minimizedDisplay: jsx(() => ( +
+ {name} - {format(plastic.value)} {plastic.displayName} +
)) }; }); diff --git a/src/data/layers/trees.tsx b/src/data/layers/trees.tsx index 0bd422b..321db3a 100644 --- a/src/data/layers/trees.tsx +++ b/src/data/layers/trees.tsx @@ -330,9 +330,13 @@ const layer = createLayer(id, function (this: BaseLayer) { ]) as WithRequired; const computedAutoCuttingAmount = computed(() => autoCuttingAmount.apply(0)); const lastAutoCuttingAmount = ref(0); - setInterval(() => watch(computedAutoCuttingAmount, cut => { - lastAutoCuttingAmount.value = cut; - }), 0); + setInterval( + () => + watch(computedAutoCuttingAmount, cut => { + lastAutoCuttingAmount.value = cut; + }), + 0 + ); const manualPlantingAmount = createSequentialModifier(() => [ createAdditiveModifier(() => ({ @@ -421,9 +425,13 @@ const layer = createLayer(id, function (this: BaseLayer) { ]) as WithRequired; const computedAutoPlantingAmount = computed(() => autoPlantingAmount.apply(0)); const lastAutoPlantedAmount = ref(0); - setInterval(() => watch(computedAutoPlantingAmount, planted => { - lastAutoPlantedAmount.value = planted; - }), 0); + setInterval( + () => + watch(computedAutoPlantingAmount, planted => { + lastAutoPlantedAmount.value = planted; + }), + 0 + ); const logGain = createSequentialModifier(() => [ createMultiplicativeModifier(() => ({ @@ -808,6 +816,11 @@ const layer = createLayer(id, function (this: BaseLayer) { {renderRow(...row1Buyables)} + )), + minimizedDisplay: jsx(() => ( +
+ {name} - {format(logs.value)} {logs.displayName} +
)) }; }); diff --git a/src/data/layers/workshop.tsx b/src/data/layers/workshop.tsx index 1058726..c5ff649 100644 --- a/src/data/layers/workshop.tsx +++ b/src/data/layers/workshop.tsx @@ -19,7 +19,7 @@ import { createResource, displayResource } from "features/resources/resource"; import { BaseLayer, createLayer } from "game/layers"; import { createExponentialModifier, createSequentialModifier } from "game/modifiers"; import { noPersist } from "game/persistence"; -import Decimal, { DecimalSource, formatWhole } from "util/bignum"; +import Decimal, { DecimalSource, format, formatWhole } from "util/bignum"; import { Direction } from "util/common"; import { render } from "util/vue"; import { computed, unref, watchEffect } from "vue"; @@ -294,6 +294,11 @@ const layer = createLayer(id, function (this: BaseLayer) { {milestonesDisplay()} + )), + minimizedDisplay: jsx(() => ( +
+ {name} - {format(foundationProgress.value)} {foundationProgress.displayName} +
)) }; }); From f01b7e139caef8c71fe6926619d78a6055b40625 Mon Sep 17 00:00:00 2001 From: thepaperpilot Date: Tue, 13 Dec 2022 01:44:47 -0600 Subject: [PATCH 44/67] balances and tweaks and fixes --- src/data/layers/boxes.tsx | 13 +++++++++++- src/data/layers/cloth.tsx | 18 ++++++++++++++++- src/data/layers/management.tsx | 36 ++++++++++++++++++++-------------- src/data/layers/metal.tsx | 11 +++++++++-- src/data/layers/oil.tsx | 7 +++++++ src/data/layers/paper.tsx | 6 ++++++ src/data/layers/plastic.tsx | 7 +++++++ src/data/layers/trees.tsx | 15 ++++++++------ src/data/layers/workshop.tsx | 35 ++++++++++++++++++++++++--------- 9 files changed, 114 insertions(+), 34 deletions(-) diff --git a/src/data/layers/boxes.tsx b/src/data/layers/boxes.tsx index b87f77c..d896205 100644 --- a/src/data/layers/boxes.tsx +++ b/src/data/layers/boxes.tsx @@ -15,7 +15,12 @@ import { createResource, displayResource, Resource } from "features/resources/re import { createUpgrade, GenericUpgrade } from "features/upgrades/upgrade"; import { globalBus } from "game/events"; import { BaseLayer, createLayer } from "game/layers"; -import { createExponentialModifier, createSequentialModifier, Modifier } from "game/modifiers"; +import { + createExponentialModifier, + createMultiplicativeModifier, + createSequentialModifier, + Modifier +} from "game/modifiers"; import { noPersist } from "game/persistence"; import Decimal, { DecimalSource, format, formatWhole } from "util/bignum"; import { WithRequired } from "util/common"; @@ -26,6 +31,7 @@ import management from "./management"; import paper from "./paper"; import plastic from "./plastic"; import trees from "./trees"; +import workshop from "./workshop"; export type BoxesBuyable = GenericBuyable & { resource: Resource; @@ -42,6 +48,11 @@ const layer = createLayer(id, function (this: BaseLayer) { const boxes = createResource(0, "boxes"); const boxGain = createSequentialModifier(() => [ + createMultiplicativeModifier(() => ({ + multiplier: 2, + description: "1000% Foundation Completed", + enabled: workshop.milestones.extraExpansionMilestone5.earned + })), createExponentialModifier(() => ({ exponent: 1.1, description: "Bell Level 2", diff --git a/src/data/layers/cloth.tsx b/src/data/layers/cloth.tsx index a2947c5..3f28d96 100644 --- a/src/data/layers/cloth.tsx +++ b/src/data/layers/cloth.tsx @@ -34,6 +34,7 @@ import metal from "./metal"; import paper from "./paper"; import plastic from "./plastic"; import trees from "./trees"; +import workshop from "./workshop"; const id = "cloth"; const day = 8; @@ -332,7 +333,7 @@ const layer = createLayer(id, function (this: BaseLayer) { const paperUpgrades = { paperUpgrade4, paperUpgrade3, paperUpgrade2, paperUpgrade1 }; const hollyEffect = computed(() => - Decimal.add(trees.computedAutoCuttingAmount.value, 1).root(3) + Decimal.add(trees.computedAutoCuttingAmount.value, 1).root(9) ); const gingersnapEffect = computed(() => Decimal.add(dyes.dyeSum.value, 10).log10()); @@ -360,6 +361,11 @@ const layer = createLayer(id, function (this: BaseLayer) { multiplier: hollyEffect, description: "Holly Level 3", enabled: management.elfTraining.cutterElfTraining.milestones[2].earned + })), + createMultiplicativeModifier(() => ({ + multiplier: 2, + description: "1000% Foundation Completed", + enabled: workshop.milestones.extraExpansionMilestone5.earned })) ]); const computedSheepGain = computed(() => sheepGain.apply(1)); @@ -390,6 +396,11 @@ const layer = createLayer(id, function (this: BaseLayer) { multiplier: hollyEffect, description: "Holly Level 3", enabled: management.elfTraining.cutterElfTraining.milestones[2].earned + })), + createMultiplicativeModifier(() => ({ + multiplier: 2, + description: "1000% Foundation Completed", + enabled: workshop.milestones.extraExpansionMilestone5.earned })) ]); const computedShearingAmount = computed(() => shearingAmount.apply(1)); @@ -420,6 +431,11 @@ const layer = createLayer(id, function (this: BaseLayer) { multiplier: hollyEffect, description: "Holly Level 3", enabled: management.elfTraining.cutterElfTraining.milestones[2].earned + })), + createMultiplicativeModifier(() => ({ + multiplier: 2, + description: "1000% Foundation Completed", + enabled: workshop.milestones.extraExpansionMilestone5.earned })) ]); const computedSpinningAmount = computed(() => spinningAmount.apply(1)); diff --git a/src/data/layers/management.tsx b/src/data/layers/management.tsx index 6c0a59f..b317d14 100644 --- a/src/data/layers/management.tsx +++ b/src/data/layers/management.tsx @@ -22,7 +22,7 @@ import { persistent } from "game/persistence"; import Decimal, { DecimalSource, format, formatTime, formatWhole } from "util/bignum"; import { Direction } from "util/common"; import { render, renderCol, renderGrid } from "util/vue"; -import { computed, ComputedRef, ref, Ref, unref } from "vue"; +import { computed, ComputedRef, ref, Ref, unref, watch } from "vue"; import elves from "./elves"; import trees from "./trees"; import paper from "./paper"; @@ -151,12 +151,15 @@ const layer = createLayer(id, () => { ); const level = computed(() => Decimal.min( - Decimal.mul(9, exp.value).div(4000).div(costMulti).add(1).log(5).floor(), + Decimal.affordGeometricSeries(exp.value, Decimal.mul(4000, costMulti), 5, 0), schools.amount.value ).toNumber() ); const expToNextLevel = computed(() => - Decimal.sub(exp.value, Decimal.pow(5, level.value).sub(1).div(9).mul(4000)) + Decimal.sub( + exp.value, + Decimal.sumGeometricSeries(level.value, Decimal.mul(4000, costMulti), 5, 0) + ) ); const bar = createBar(() => ({ direction: Direction.Right, @@ -275,8 +278,7 @@ const layer = createLayer(id, () => { requirement: "Holly Level 3", effectDisplay: jsx(() => ( <> - Multiply all cloth actions' effectiveness by 9 - Cutter amount. + Multiply all cloth actions' effectiveness by log10Cutter amount. )) }, @@ -449,7 +451,7 @@ const layer = createLayer(id, () => { createMilestone(() => ({ display: { requirement: "Mary Level 2", - effectDisplay: "Double automatic tree planting speed" + effectDisplay: "Metal gain is raised to the 1.1." }, visibility: () => showIf(heatedPlanterElfMilestones[0].earned.value), shouldEarn: () => heatedPlanterElfTraining.level.value >= 2 @@ -465,7 +467,7 @@ const layer = createLayer(id, () => { createMilestone(() => ({ display: { requirement: "Mary Level 4", - effectDisplay: "Metal gain is raised to the 1.1." + effectDisplay: "Double automatic tree planting speed" }, visibility: () => showIf(heatedPlanterElfMilestones[2].earned.value && main.day.value >= 13), @@ -938,6 +940,7 @@ const layer = createLayer(id, () => { focusTime.value = Decimal.sub(focusTime.value, diff).max(0); focusCooldown.value = Decimal.sub(focusCooldown.value, diff).max(0); if (Decimal.eq(focusTime.value, 0)) { + focusTargets.value = {}; focusMulti.value = Decimal.pow( focusMaxMulti.value, 1 - Math.abs(Math.sin((Date.now() / 1000) * 2)) @@ -1040,7 +1043,7 @@ const layer = createLayer(id, () => { description: "Multiplies the maximum experience multiplier from focus by 2" }, resource: trees.logs, - cost: 1e30 + cost: 1e25 })); const focusUpgrade2 = createUpgrade(() => ({ display: { @@ -1048,7 +1051,7 @@ const layer = createLayer(id, () => { description: "Increase elves affected by focus by 1" }, resource: trees.logs, - cost: 1e40 + cost: 1e30 })); const focusUpgrade3 = createUpgrade(() => ({ display: { @@ -1056,23 +1059,24 @@ const layer = createLayer(id, () => { description: "Focus can now be rerolled every 10 seconds" }, resource: trees.logs, - cost: 1e50 + cost: 1e35 })); const upgrades = [focusUpgrade1, focusUpgrade2, focusUpgrade3]; // ------------------------------------------------------------------------------- Schools const schoolCost = computed(() => { const schoolFactor = Decimal.pow(10, schools.amount.value); - const woodFactor = Decimal.pow(2e4, schools.amount.value); + const nerfedSchoolFactor = Decimal.pow(5, schools.amount.value); + const woodFactor = Decimal.pow(1e4, schools.amount.value); const coalFactor = Decimal.pow(2000, schools.amount.value); return { wood: woodFactor.mul(1e21), coal: coalFactor.mul(1e32), paper: coalFactor.mul(1e18), boxes: woodFactor.mul(1e13), - metalIngots: schoolFactor.mul(1e12), + metalIngots: nerfedSchoolFactor.mul(1e12), cloth: schoolFactor.mul(1e4), - plastic: schoolFactor.mul(1e6), + plastic: nerfedSchoolFactor.mul(1e6), dye: Decimal.add(schools.amount.value, 1).mul(10000) }; }); @@ -1139,7 +1143,7 @@ const layer = createLayer(id, () => { }); const classroomEffect = computed(() => { - return Decimal.add(classrooms.amount.value, 1).sqrt(); + return Decimal.add(classrooms.amount.value, 1).pow(0.9); }); const classrooms = createBuyable(() => ({ @@ -1332,7 +1336,9 @@ const layer = createLayer(id, () => { {render(modifiersModal)} {render(dayProgress)}
- {renderCol(schools, classrooms)} {renderGrid([teaching, classroomUpgrade])}{" "} + {renderCol(schools, classrooms)} + {renderGrid([teaching, classroomUpgrade])} + {renderGrid(upgrades)} {Decimal.gt(schools.amount.value, 0) ? ( <> diff --git a/src/data/layers/metal.tsx b/src/data/layers/metal.tsx index 0d7d430..586deea 100644 --- a/src/data/layers/metal.tsx +++ b/src/data/layers/metal.tsx @@ -32,6 +32,7 @@ import cloth from "./cloth"; import plastic from "./plastic"; import dyes from "./dyes"; import management from "./management"; +import workshop from "./workshop"; const id = "metal"; const day = 7; @@ -81,10 +82,16 @@ const layer = createLayer(id, function (this: BaseLayer) { description: "Glistening Paint", enabled: dyes.upgrades.redDyeUpg.bought })), + createMultiplicativeModifier(() => ({ + multiplier: () => + Decimal.div(workshop.foundationProgress.value, 10).floor().div(10).add(1), + description: "400% Foundation Completed", + enabled: workshop.milestones.extraExpansionMilestone2.earned + })), createExponentialModifier(() => ({ exponent: 1.1, - description: "Mary Level 4", - enabled: management.elfTraining.heatedPlanterElfTraining.milestones[3].earned + description: "Mary Level 2", + enabled: management.elfTraining.heatedPlanterElfTraining.milestones[1].earned })) ]); const computedOrePurity = computed(() => orePurity.apply(0.1)); diff --git a/src/data/layers/oil.tsx b/src/data/layers/oil.tsx index ce378b0..ef5ea76 100644 --- a/src/data/layers/oil.tsx +++ b/src/data/layers/oil.tsx @@ -36,6 +36,7 @@ import plastic from "./plastic"; import paper from "./paper"; import dyes from "./dyes"; import management from "./management"; +import workshop from "./workshop"; const id = "oil"; const day = 9; @@ -720,6 +721,12 @@ const layer = createLayer(id, function (this: BaseLayer) { description: "Effectiveness", enabled: () => Decimal.lt(coalEffectiveness.value, 1) })), + createMultiplicativeModifier(() => ({ + multiplier: () => + Decimal.div(workshop.foundationProgress.value, 10).floor().div(10).add(1), + description: "600% Foundation Completed", + enabled: workshop.milestones.extraExpansionMilestone3.earned + })), createMultiplicativeModifier(() => ({ multiplier: () => Decimal.sqrt(management.totalElfLevels.value), description: "Jack Level 4", diff --git a/src/data/layers/paper.tsx b/src/data/layers/paper.tsx index 01eb85b..06d0223 100644 --- a/src/data/layers/paper.tsx +++ b/src/data/layers/paper.tsx @@ -28,6 +28,7 @@ import plastic from "./plastic"; import trees from "./trees"; import dyes from "./dyes"; import management from "./management"; +import workshop from "./workshop"; const id = "paper"; const day = 5; @@ -300,6 +301,11 @@ const layer = createLayer(id, function (this: BaseLayer) { multiplier: dyes.boosts.yellow1, description: "Yellow Dye Boost 1", enabled: () => Decimal.gte(dyes.dyes.yellow.amount.value, 1) + })), + createMultiplicativeModifier(() => ({ + multiplier: 2, + description: "1000% Foundation Completed", + enabled: workshop.milestones.extraExpansionMilestone5.earned })) ]) as WithRequired; const ashCost = createSequentialModifier(() => [ diff --git a/src/data/layers/plastic.tsx b/src/data/layers/plastic.tsx index 1527123..917f24c 100644 --- a/src/data/layers/plastic.tsx +++ b/src/data/layers/plastic.tsx @@ -33,6 +33,7 @@ import metal from "./metal"; import oil from "./oil"; import dyes from "./dyes"; import management from "./management"; +import workshop from "./workshop"; const id = "plastic"; const day = 10; @@ -262,6 +263,12 @@ const layer = createLayer(id, function (this: BaseLayer) { multiplier: dyes.boosts.yellow1, description: "Yellow Dye Boost 1", enabled: () => Decimal.gte(dyes.dyes.yellow.amount.value, 1) + })), + createMultiplicativeModifier(() => ({ + multiplier: () => + Decimal.div(workshop.foundationProgress.value, 10).floor().div(10).add(1), + description: "800% Foundation Completed", + enabled: workshop.milestones.extraExpansionMilestone4.earned })) ]); const computedPlasticGain = computed(() => plasticGain.apply(0)); diff --git a/src/data/layers/trees.tsx b/src/data/layers/trees.tsx index 321db3a..241085d 100644 --- a/src/data/layers/trees.tsx +++ b/src/data/layers/trees.tsx @@ -292,7 +292,10 @@ const layer = createLayer(id, function (this: BaseLayer) { enabled: researchUpgrade2.bought })), createAdditiveModifier(() => ({ - addend: () => Decimal.div(workshop.foundationProgress.value, 5).floor(), + addend: () => + workshop.milestones.extraExpansionMilestone1.earned + ? Decimal.pow(1.02, workshop.foundationProgress.value) + : Decimal.div(workshop.foundationProgress.value, 5).floor(), description: "10% Foundation Completed", enabled: workshop.milestones.autoCutMilestone1.earned })), @@ -406,16 +409,16 @@ const layer = createLayer(id, function (this: BaseLayer) { description: "Ivy Level 1", enabled: management.elfTraining.planterElfTraining.milestones[0].earned })), - createMultiplicativeModifier(() => ({ - multiplier: 2, - description: "Mary Level 2", - enabled: management.elfTraining.heatedPlanterElfTraining.milestones[1].earned - })), createMultiplicativeModifier(() => ({ multiplier: () => Decimal.pow(trees.value, 0.2).log10().pow_base(2), description: "Ivy Level 3", enabled: management.elfTraining.planterElfTraining.milestones[2].earned })), + createMultiplicativeModifier(() => ({ + multiplier: 2, + description: "Mary Level 4", + enabled: management.elfTraining.heatedPlanterElfTraining.milestones[3].earned + })), createAdditiveModifier(() => ({ addend: () => Decimal.sub(lastAutoPlantedAmount.value, lastAutoCuttingAmount.value).max(0), diff --git a/src/data/layers/workshop.tsx b/src/data/layers/workshop.tsx index c5ff649..e6f5e3a 100644 --- a/src/data/layers/workshop.tsx +++ b/src/data/layers/workshop.tsx @@ -40,12 +40,12 @@ const layer = createLayer(id, function (this: BaseLayer) { scaling: addSoftcap( addSoftcap(createPolynomialScaling(250, 1.5), 5387, 1 / 1e10), 1e20, - 1e9 + 3e8 ), baseResource: trees.logs, gainResource: noPersist(foundationProgress), roundUpCost: true, - buyMax: management.elfTraining.heatedCutterElfTraining.milestones[2].earned, + // buyMax: management.elfTraining.expandersElfTraining.milestones[2].earned, spend(gain, spent) { trees.logs.value = Decimal.sub(trees.logs.value, spent); }, @@ -61,7 +61,9 @@ const layer = createLayer(id, function (this: BaseLayer) { const buildFoundation = createClickable(() => ({ display: jsx(() => ( <> - Build part of the foundation + + Build {formatWhole(foundationConversion.actualGain.value)}% of the foundation +

@@ -82,7 +84,7 @@ const layer = createLayer(id, function (this: BaseLayer) { management.elfTraining.expandersElfTraining.milestones[2].earned.value ), canClick: () => - Decimal.gte(foundationConversion.actualGain.value, 1) && + Decimal.gte(trees.logs.value, foundationConversion.currentAt.value) && (Decimal.lt(foundationProgress.value, 100) || management.elfTraining.expandersElfTraining.milestones[2].earned.value), onClick() { @@ -182,7 +184,10 @@ const layer = createLayer(id, function (this: BaseLayer) { }, shouldEarn: () => Decimal.gte(foundationProgress.value, 200), visibility: () => - showIf(management.elfTraining.expandersElfTraining.milestones[2].earned.value), + showIf( + logGainMilestone3.earned.value && + management.elfTraining.expandersElfTraining.milestones[2].earned.value + ), showPopups: shouldShowPopups })); const extraExpansionMilestone2 = createMilestone(() => ({ @@ -192,7 +197,10 @@ const layer = createLayer(id, function (this: BaseLayer) { }, shouldEarn: () => Decimal.gte(foundationProgress.value, 400), visibility: () => - showIf(management.elfTraining.expandersElfTraining.milestones[2].earned.value), + showIf( + extraExpansionMilestone1.earned.value && + management.elfTraining.expandersElfTraining.milestones[2].earned.value + ), showPopups: shouldShowPopups })); const extraExpansionMilestone3 = createMilestone(() => ({ @@ -202,7 +210,10 @@ const layer = createLayer(id, function (this: BaseLayer) { }, shouldEarn: () => Decimal.gte(foundationProgress.value, 600), visibility: () => - showIf(management.elfTraining.expandersElfTraining.milestones[2].earned.value), + showIf( + extraExpansionMilestone2.earned.value && + management.elfTraining.expandersElfTraining.milestones[2].earned.value + ), showPopups: shouldShowPopups })); const extraExpansionMilestone4 = createMilestone(() => ({ @@ -212,7 +223,10 @@ const layer = createLayer(id, function (this: BaseLayer) { }, shouldEarn: () => Decimal.gte(foundationProgress.value, 800), visibility: () => - showIf(management.elfTraining.expandersElfTraining.milestones[2].earned.value), + showIf( + extraExpansionMilestone3.earned.value && + management.elfTraining.expandersElfTraining.milestones[2].earned.value + ), showPopups: shouldShowPopups })); const extraExpansionMilestone5 = createMilestone(() => ({ @@ -222,7 +236,10 @@ const layer = createLayer(id, function (this: BaseLayer) { }, shouldEarn: () => Decimal.gte(foundationProgress.value, 1000), visibility: () => - showIf(management.elfTraining.expandersElfTraining.milestones[2].earned.value), + showIf( + extraExpansionMilestone4.earned.value && + management.elfTraining.expandersElfTraining.milestones[2].earned.value + ), showPopups: shouldShowPopups })); const milestones = { From 8be07310e977e88e58b1ff6e698e5ccdf145a325 Mon Sep 17 00:00:00 2001 From: ducdat0507 <62660527+ducdat0507@users.noreply.github.com> Date: Tue, 13 Dec 2022 14:55:27 +0700 Subject: [PATCH 45/67] Make focus time clearer --- src/data/layers/management.tsx | 32 ++++++++++++++++++++++---------- 1 file changed, 22 insertions(+), 10 deletions(-) diff --git a/src/data/layers/management.tsx b/src/data/layers/management.tsx index 6c0a59f..d2bb55f 100644 --- a/src/data/layers/management.tsx +++ b/src/data/layers/management.tsx @@ -151,12 +151,12 @@ const layer = createLayer(id, () => { ); const level = computed(() => Decimal.min( - Decimal.mul(9, exp.value).div(4000).div(costMulti).add(1).log(5).floor(), + Decimal.affordGeometricSeries(exp.value, Decimal.mul(4000, costMulti), 5, 0), schools.amount.value ).toNumber() ); const expToNextLevel = computed(() => - Decimal.sub(exp.value, Decimal.pow(5, level.value).sub(1).div(9).mul(4000)) + Decimal.sub(exp.value, Decimal.sumGeometricSeries(level.value, Decimal.mul(4000, costMulti), 5, 0)) ); const bar = createBar(() => ({ direction: Direction.Right, @@ -934,9 +934,11 @@ const layer = createLayer(id, () => { elf.exp.value ); } + } - focusTime.value = Decimal.sub(focusTime.value, diff).max(0); - focusCooldown.value = Decimal.sub(focusCooldown.value, diff).max(0); + focusTime.value = Math.max(focusTime.value - diff, 0); + focusCooldown.value = Math.max(focusCooldown.value - diff, 0); + if (Decimal.eq(focusTime.value, 0)) { focusMulti.value = Decimal.pow( focusMaxMulti.value, @@ -949,8 +951,8 @@ const layer = createLayer(id, () => { const focusMulti = persistent(1); const focusTargets = persistent>({}); - const focusCooldown = persistent(0); - const focusTime = persistent(0); + const focusCooldown = persistent(0); + const focusTime = persistent(0); const focusMaxMultiModifiers = createSequentialModifier(() => [ createMultiplicativeModifier(() => ({ @@ -985,10 +987,20 @@ const layer = createLayer(id, () => { height: 25, style: `border-radius: 4px 4px 0 0`, borderStyle: `border-radius: 4px 4px 0 0`, - fillStyle: `background: ${color}; transition: none`, + fillStyle: () => ({ + background: focusTime.value > 0 ? color : "#7f7f00", + opacity: focusTime.value > 0 ? focusTime.value / 10 : 1, + transition: "none", + }), progress: () => Decimal.sub(focusMulti.value, 1).div(Decimal.sub(focusMaxMulti.value, 1)).toNumber(), - display: jsx(() => <>{format(focusMulti.value)}x) + display: jsx(() => <> + {format(focusMulti.value)}x + {focusTime.value > 0 ? <> + {" "}to {Object.keys(focusTargets.value).join(", ")} + {" "}for {formatTime(focusTime.value)} : "" + } + ) })) as GenericBar; const focusButton = createClickable(() => ({ @@ -997,7 +1009,7 @@ const layer = createLayer(id, () => { description: jsx(() => ( <> Motivate elves to focus, multiplying 3 random elves' XP gain by up to{" "} - {format(focusMaxMulti.value)}x, equal to the focus bars' effect. + {format(focusMaxMulti.value)}x for 10 seconds, equal to the focus bars' effect. {Decimal.gte(focusCooldown.value, 0) ? ( <>
@@ -1333,7 +1345,6 @@ const layer = createLayer(id, () => { {render(dayProgress)}
{renderCol(schools, classrooms)} {renderGrid([teaching, classroomUpgrade])}{" "} - {renderGrid(upgrades)} {Decimal.gt(schools.amount.value, 0) ? ( <>
@@ -1341,6 +1352,7 @@ const layer = createLayer(id, () => {

{render(focusButton)} + {renderGrid(upgrades)}
{renderGrid( [focusMeter], From 12c1b8694e2919602d7ec18b0180b1b2847334b2 Mon Sep 17 00:00:00 2001 From: ducdat0507 <62660527+ducdat0507@users.noreply.github.com> Date: Tue, 13 Dec 2022 14:58:20 +0700 Subject: [PATCH 46/67] There's only one focus bar --- src/data/layers/management.tsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/data/layers/management.tsx b/src/data/layers/management.tsx index a733929..994d1ad 100644 --- a/src/data/layers/management.tsx +++ b/src/data/layers/management.tsx @@ -1012,7 +1012,7 @@ const layer = createLayer(id, () => { description: jsx(() => ( <> Motivate elves to focus, multiplying 3 random elves' XP gain by up to{" "} - {format(focusMaxMulti.value)}x for 10 seconds, equal to the focus bars' effect. + {format(focusMaxMulti.value)}x for 10 seconds, equal to the focus bar's effect. {Decimal.gte(focusCooldown.value, 0) ? ( <>
From 52f86e00dc15734b79ffa95b728c6bfb71a25774 Mon Sep 17 00:00:00 2001 From: ducdat0507 <62660527+ducdat0507@users.noreply.github.com> Date: Tue, 13 Dec 2022 16:29:55 +0700 Subject: [PATCH 47/67] Fix box gain modifier view --- src/data/layers/boxes.tsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/data/layers/boxes.tsx b/src/data/layers/boxes.tsx index d896205..e5cff9a 100644 --- a/src/data/layers/boxes.tsx +++ b/src/data/layers/boxes.tsx @@ -339,7 +339,7 @@ const layer = createLayer(id, function (this: BaseLayer) { { title: "Boxes Gain", modifier: boxGain, - base: 1 + base: () => boxesConversion.scaling.currentGain(boxesConversion) } ]); const showModifiersModal = ref(false); From f193d0f4b38f995645faf5c8a15fcf3c31f0688a Mon Sep 17 00:00:00 2001 From: ducdat0507 <62660527+ducdat0507@users.noreply.github.com> Date: Tue, 13 Dec 2022 17:58:09 +0700 Subject: [PATCH 48/67] Align modifiers --- src/components/Options.vue | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/src/components/Options.vue b/src/components/Options.vue index b8be08b..4ac105a 100644 --- a/src/components/Options.vue +++ b/src/components/Options.vue @@ -11,6 +11,7 @@ + @@ -47,7 +48,7 @@ const settingFieldsComponent = computed(() => { }); const { showTPS, theme } = toRefs(settings); -const { autosave, usingLog } = toRefs(player); +const { autosave, usingLog, alignUnits } = toRefs(player); const isPaused = computed({ get() { return player.devSpeed === 0; @@ -69,7 +70,12 @@ const isPausedTitle = jsx(() => ( )); const progressMethodTitle = jsx(() => ( - Use log for progress bar* + Logarithmic progress bars* + +)); +const alignModifierUnitsTitle = jsx(() => ( + + Align modifier units* )); From 3bdf33a4b65a5cad8488b983d4bf392a05420010 Mon Sep 17 00:00:00 2001 From: ducdat0507 <62660527+ducdat0507@users.noreply.github.com> Date: Tue, 13 Dec 2022 19:53:15 +0700 Subject: [PATCH 49/67] Settings update --- .vscode/settings.json | 2 +- src/components/Options.vue | 119 ++++++++++++++++++++++---- src/components/common/modifiers.css | 5 +- src/components/fields/Select.vue | 4 + src/components/fields/Toggle.vue | 8 +- src/data/common.tsx | 5 +- src/data/layers/management.tsx | 2 +- src/data/projEntry.tsx | 4 +- src/features/challenges/challenge.tsx | 7 +- src/features/milestones/milestone.tsx | 7 +- src/game/modifiers.tsx | 4 +- src/game/player.ts | 8 +- src/game/settings.ts | 17 +++- 13 files changed, 155 insertions(+), 37 deletions(-) diff --git a/.vscode/settings.json b/.vscode/settings.json index ddcd19b..25708ee 100644 --- a/.vscode/settings.json +++ b/.vscode/settings.json @@ -6,7 +6,7 @@ "editor.defaultFormatter": "esbenp.prettier-vscode", "git.ignoreLimitWarning": true, "[typescriptreact]": { - "editor.defaultFormatter": "vscode.typescript-language-features" + "editor.defaultFormatter": "esbenp.prettier-vscode" }, "typescript.tsdk": "node_modules/typescript/lib" } \ No newline at end of file diff --git a/src/components/Options.vue b/src/components/Options.vue index 4ac105a..bc7ed8e 100644 --- a/src/components/Options.vue +++ b/src/components/Options.vue @@ -1,17 +1,26 @@ @@ -25,19 +34,36 @@ import Tooltip from "features/tooltips/Tooltip.vue"; import player from "game/player"; import settings, { settingFields } from "game/settings"; import { camelToTitle } from "util/common"; +import { save } from "util/save"; import { coerceComponent, render } from "util/vue"; import { computed, ref, toRefs } from "vue"; import Select from "./fields/Select.vue"; import Toggle from "./fields/Toggle.vue"; +import FeedbackButton from "./fields/FeedbackButton.vue"; const isOpen = ref(false); +const currentTab = ref("behaviour"); + defineExpose({ + isTab, + setTab, + save() { + save(); + }, open() { isOpen.value = true; } }); +function isTab (tab: string): boolean { + return tab == currentTab.value; +} + +function setTab (tab: string) { + currentTab.value = tab; +} + const themes = Object.keys(rawThemes).map(theme => ({ label: camelToTitle(theme), value: theme @@ -47,8 +73,10 @@ const settingFieldsComponent = computed(() => { return coerceComponent(jsx(() => <>{settingFields.map(render)})); }); -const { showTPS, theme } = toRefs(settings); -const { autosave, usingLog, alignUnits } = toRefs(player); +const { showTPS, theme, usingLog, alignUnits } = toRefs(settings); + +const { autosave, autoPause } = toRefs(player); + const isPaused = computed({ get() { return player.devSpeed === 0; @@ -58,32 +86,85 @@ const isPaused = computed({ } }); + const autosaveTitle = jsx(() => ( - + Autosave* + Automatically save the game every second or when the game is closed. )); const isPausedTitle = jsx(() => ( - + Pause game* + Stop everything from moving. + +)); +const autoPauseTitle = jsx(() => ( + + Auto-pause* + Automatically pause the game when a day is completed. It is best to keep this on to avoid over-grinding. + +)); + +const themeTitle = jsx(() => ( + + Theme + How the game looks. + +)); +const showTPSTitle = jsx(() => ( + + Show TPS + Show TPS meter at the bottom-left corner of the page. )); const progressMethodTitle = jsx(() => ( - - Logarithmic progress bars* + + Logarithmic progress bars + Whether progress bars should be normalized for exponential growth. )); const alignModifierUnitsTitle = jsx(() => ( - - Align modifier units* + + Align modifier units + Align numbers to the beginning of the unit in modifier view. )); - diff --git a/src/components/common/modifiers.css b/src/components/common/modifiers.css index 6842e0c..dc9e66d 100644 --- a/src/components/common/modifiers.css +++ b/src/components/common/modifiers.css @@ -8,10 +8,13 @@ } .modifier-amount { - flex-basis: 100px; flex-shrink: 0; text-align: right; } +:not(:first-of-type, :last-of-type) > .modifier-amount::after { + content: var(--unit); + opacity: 0; +} .modifier-description { flex-grow: 1; diff --git a/src/components/fields/Select.vue b/src/components/fields/Select.vue index f08c40f..72a31b2 100644 --- a/src/components/fields/Select.vue +++ b/src/components/fields/Select.vue @@ -87,6 +87,10 @@ function onUpdate(value: SelectOption) { background-color: var(--bought); } +.vue-input input { + font-size: inherit; +} + .vue-input input::placeholder { color: var(--link); } diff --git a/src/components/fields/Toggle.vue b/src/components/fields/Toggle.vue index 0db8bd1..a1eeff3 100644 --- a/src/components/fields/Toggle.vue +++ b/src/components/fields/Toggle.vue @@ -44,14 +44,16 @@ input { span { width: 100%; + padding-right: 41px; position: relative; } /* track */ input + span::before { content: ""; - float: right; - margin: 5px 0 5px 10px; + position: absolute; + top: calc(50% - 7px); + right: 0px; border-radius: 7px; width: 36px; height: 14px; @@ -66,7 +68,7 @@ input + span::before { input + span::after { content: ""; position: absolute; - top: 2px; + top: calc(50% - 10px); right: 16px; border-radius: 50%; width: 20px; diff --git a/src/data/common.tsx b/src/data/common.tsx index 5c1db03..be75f9b 100644 --- a/src/data/common.tsx +++ b/src/data/common.tsx @@ -20,6 +20,7 @@ import type { Modifier } from "game/modifiers"; import type { Persistent } from "game/persistence"; import { DefaultValue, persistent } from "game/persistence"; import player from "game/player"; +import settings from "game/settings"; import type { DecimalSource } from "util/bignum"; import Decimal, { format } from "util/bignum"; import { formatWhole } from "util/break_eternity"; @@ -333,7 +334,7 @@ export function createCollapsibleModifierSections( return ( <> {hasPreviousSection ?
: null} -
+
{header}
{modifiers} @@ -424,7 +425,7 @@ export function setUpDailyProgressTracker(options: { if (main.day.value !== options.day) return 1; let progress = Decimal.add(total.value, 1); let requirement = options.goal; - if (options.usingLog?.value ?? player.usingLog) { + if (options.usingLog?.value ?? settings.usingLog) { progress = progress.log10(); requirement = Decimal.log10(requirement); } diff --git a/src/data/layers/management.tsx b/src/data/layers/management.tsx index 994d1ad..2987ab2 100644 --- a/src/data/layers/management.tsx +++ b/src/data/layers/management.tsx @@ -1164,7 +1164,7 @@ const layer = createLayer(id, () => {

Build a Classroom

Hopefully it makes the school a bit less boring. Multiplies elves' XP gain by{" "} - Classrooms + 1. + (Classrooms + 1)0.9.
You have {formatWhole(classrooms.amount.value)} classrooms, which are currently diff --git a/src/data/projEntry.tsx b/src/data/projEntry.tsx index 3d77eae..0004f0e 100644 --- a/src/data/projEntry.tsx +++ b/src/data/projEntry.tsx @@ -146,7 +146,7 @@ export const main = createLayer("main", function (this: BaseLayer) { loreScene.value = -1; loreTitle.value = unref(layers[layer ?? "trees"]?.name ?? ""); loreBody.value = story; - player.devSpeed = null; + if (player.autoPause) player.devSpeed = null; showLoreModal.value = true; }, 1000); } @@ -370,7 +370,7 @@ export const main = createLayer("main", function (this: BaseLayer) { showLoreModal.value = true; day.value++; main.minimized.value = false; - player.devSpeed = 0; + if (player.autoPause) player.devSpeed = 0; } return { diff --git a/src/features/challenges/challenge.tsx b/src/features/challenges/challenge.tsx index 469d34a..8128ab2 100644 --- a/src/features/challenges/challenge.tsx +++ b/src/features/challenges/challenge.tsx @@ -299,7 +299,12 @@ globalBus.on("loadSettings", settings => { registerSettingField( jsx(() => ( ( + + Hide maxed challenges + Hide challenges that have been fully completed. + + ))} onUpdate:modelValue={value => (settings.hideChallenges = value)} modelValue={settings.hideChallenges} /> diff --git a/src/features/milestones/milestone.tsx b/src/features/milestones/milestone.tsx index 2671e21..d70d6ec 100644 --- a/src/features/milestones/milestone.tsx +++ b/src/features/milestones/milestone.tsx @@ -204,7 +204,12 @@ const msDisplayOptions = Object.values(MilestoneDisplay).map(option => ({ registerSettingField( jsx(() => (