From be264b7fe5c6da6f08d41444fc7f700dce378f2e Mon Sep 17 00:00:00 2001 From: unsoftcapped3 <75136164+unsoftcapped3@users.noreply.github.com> Date: Wed, 14 Dec 2022 03:01:20 +0000 Subject: [PATCH 01/48] made gingersnap 4 say it's resetting primary dyes --- 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 9291b30..136456a 100644 --- a/src/data/layers/management.tsx +++ b/src/data/layers/management.tsx @@ -796,7 +796,7 @@ const layer = createLayer(id, () => { createMilestone(() => ({ display: { requirement: "Gingersnap Level 4", - effectDisplay: "Raise secondary dyes' first effects to the 1.1" + effectDisplay: "Raise secondary dyes' first effects to the 1.1 but reset primary dyes" }, visibility: () => showIf(clothElfMilestones[2].earned.value && main.day.value >= 13), shouldEarn: () => clothElfTraining.level.value >= 4, From 69fe67c6a609ef8b40885119e24b10259b11668c Mon Sep 17 00:00:00 2001 From: unsoftcapped3 <75136164+unsoftcapped3@users.noreply.github.com> Date: Wed, 14 Dec 2022 03:18:09 +0000 Subject: [PATCH 02/48] add paper upgrade descriptions --- src/data/layers/paper.tsx | 30 +++++++++++++++++++++++++++++- 1 file changed, 29 insertions(+), 1 deletion(-) diff --git a/src/data/layers/paper.tsx b/src/data/layers/paper.tsx index ff3282d..0eab68a 100644 --- a/src/data/layers/paper.tsx +++ b/src/data/layers/paper.tsx @@ -294,7 +294,34 @@ const layer = createLayer(id, function (this: BaseLayer) { } })); const upgrades = { clothUpgrade, drillingUpgrade, oilUpgrade }; - + const ashUpgrade = createUpgrade(() => ({ + resource: noPersist(paper), + cost: 1e36, + visibility: () => showIf(management.elfTraining.heavyDrillElfTraining.milestones[4].earned.value), + display: { + title: "Paper burning", + description: "Paper adds to ash gain after all other modifiers" + } + })); + const bookUpgrade = createUpgrade(() => ({ + resource: noPersist(paper), + cost: 1e40, + visibility: () => showIf(management.elfTraining.heavyDrillElfTraining.milestones[4].earned.value), + display: { + title: "Book Cheapener", + description: "Books are less expensive" + } + })); + const classroomUpgrade = createUpgrade(() => ({ + resource: noPersist(paper), + cost: 1e44, + visibility: () => showIf(management.elfTraining.heavyDrillElfTraining.milestones[4].earned.value), + display: { + title: "Classroom Supplies", + description: "Classrooms' effect is raised to the 1.1" + } + })); + const upgrades2 = { ashUpgrade, bookUpgrade, classroomUpgrade }; const paperGain = createSequentialModifier(() => [ createMultiplicativeModifier(() => ({ multiplier: 2, @@ -399,6 +426,7 @@ const layer = createLayer(id, function (this: BaseLayer) { paperConversion, books, upgrades, + upgrades2, generalTabCollapsed, minWidth: 700, display: jsx(() => ( From ecc002fea3e073f2d58b86cdd4d4c6d0c8d4e0dc Mon Sep 17 00:00:00 2001 From: Chunkybanana <62921243+chunkybanana@users.noreply.github.com> Date: Wed, 14 Dec 2022 03:32:12 +0000 Subject: [PATCH 03/48] Fixed issue with dyes not resetting --- src/data/layers/dyes.tsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/data/layers/dyes.tsx b/src/data/layers/dyes.tsx index 2f59ced..cb6880f 100644 --- a/src/data/layers/dyes.tsx +++ b/src/data/layers/dyes.tsx @@ -234,7 +234,7 @@ const layer = createLayer(id, function (this: BaseLayer) { amount.value = Decimal.add(amount.value, computedToGenerate.value); buyable.amount.value = Decimal.add(buyable.amount.value, 1); - if (!wrappingPaper.milestones.secondaryNoReset.earned) { + if (!wrappingPaper.milestones.secondaryNoReset.earned.value) { unref(costs).forEach(c => { c.res.value = Decimal.sub( c.res.value, From 24eed7afccf51f773252da615d44d37f40cfce08 Mon Sep 17 00:00:00 2001 From: ducdat0507 <62660527+ducdat0507@users.noreply.github.com> Date: Wed, 14 Dec 2022 10:49:05 +0700 Subject: [PATCH 04/48] Fix school max count not displaying correctly --- 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 136456a..ff0ca47 100644 --- a/src/data/layers/management.tsx +++ b/src/data/layers/management.tsx @@ -1282,7 +1282,7 @@ const layer = createLayer(id, () => {

Build a School

You gotta start somewhere, right? Each school increases the maximum level for - elves by 1, maximum of {main.days[13].opened ? 5 : 3} schools. + elves by 1, maximum of {main.days[13].opened.value ? 5 : 3} schools.
You have {formatWhole(schools.amount.value)} schools, which are currently From da55da22538e0805964e15c2061232b3c54cdb0b Mon Sep 17 00:00:00 2001 From: unsoftcapped3 <75136164+unsoftcapped3@users.noreply.github.com> Date: Wed, 14 Dec 2022 03:50:47 +0000 Subject: [PATCH 05/48] oil upgrades --- src/data/layers/management.tsx | 2 +- src/data/layers/oil.tsx | 55 +++++++++++++++++++++++++++++++++- 2 files changed, 55 insertions(+), 2 deletions(-) diff --git a/src/data/layers/management.tsx b/src/data/layers/management.tsx index 136456a..7704802 100644 --- a/src/data/layers/management.tsx +++ b/src/data/layers/management.tsx @@ -896,7 +896,7 @@ const layer = createLayer(id, () => { createMilestone(() => ({ display: { requirement: "Twinkle Level 5", - effectDisplay: "Unlock another row of metal upgrades" + effectDisplay: "Unlock another row of focus upgrades" }, visibility: () => showIf(metalElfMilestones[3].earned.value && main.day.value >= 13), shouldEarn: () => metalElfTraining.level.value >= 5 diff --git a/src/data/layers/oil.tsx b/src/data/layers/oil.tsx index 1bbb05e..353c78f 100644 --- a/src/data/layers/oil.tsx +++ b/src/data/layers/oil.tsx @@ -629,7 +629,59 @@ const layer = createLayer(id, function (this: BaseLayer) { style: { color: colorText } })) ]; - + const row3Upgrades = [ + createUpgrade(() => ({ + resource: noPersist(oil), + cost: 1e11, + display: { + title: "Dye Synergy I", + description: "Red dye boosts yellow dye gain *(log(x)^0.75)" + }, + visibility: () => showIf(management.elfTraining.oilElfTraining.milestones[4].earned.value), + style: { color: colorText } + })), + createUpgrade(() => ({ + resource: noPersist(oil), + cost: 1e12, + display: { + title: "Orange-colored boxes", + description: + "Orange dye's 2nd effect is raised to the 2.5" + }, + visibility: () => showIf(management.elfTraining.oilElfTraining.milestones[4].earned.value), + style: { color: colorText } + })), + createUpgrade(() => ({ + resource: noPersist(oil), + cost: 1e13, + display: { + title: "Colorful Focus", + description: "Sum of secondary dyes increases max focus multiplier by cbrt(x)" + }, + visibility: () => showIf(management.elfTraining.oilElfTraining.milestones[4].earned.value), + style: { color: colorText } + })), + createUpgrade(() => ({ + resource: noPersist(oil), + cost: 1e14, + display: { + title: "Dye Synergy II", + description: "Blue dye boosts red dye gain *log(x)" + }, + visibility: () => showIf(management.elfTraining.oilElfTraining.milestones[4].earned.value), + style: { color: colorText } + })), + createUpgrade(() => ({ + resource: noPersist(oil), + cost: 1e15, + display: { + title: "The Ultimate Metal Dye", + description: "Product of primary dyes makes all metal costs cheaper" + }, + visibility: () => showIf(management.elfTraining.oilElfTraining.milestones[4].earned.value), + style: { color: colorText } + })) + ]; const coalConsumption = createSequentialModifier(() => [ createAdditiveModifier(() => ({ addend: () => Decimal.negate(heavyCoal.value), @@ -938,6 +990,7 @@ const layer = createLayer(id, function (this: BaseLayer) { row1Upgrades, row2Upgrades, + row3Upgrades, minWidth: 700, From 3dbfd0127b7e52003811d60fcc2cb5cf984f0600 Mon Sep 17 00:00:00 2001 From: unsoftcapped3 <75136164+unsoftcapped3@users.noreply.github.com> Date: Wed, 14 Dec 2022 03:51:42 +0000 Subject: [PATCH 06/48] wording --- src/data/layers/oil.tsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/data/layers/oil.tsx b/src/data/layers/oil.tsx index 353c78f..9b791ec 100644 --- a/src/data/layers/oil.tsx +++ b/src/data/layers/oil.tsx @@ -676,7 +676,7 @@ const layer = createLayer(id, function (this: BaseLayer) { cost: 1e15, display: { title: "The Ultimate Metal Dye", - description: "Product of primary dyes makes all metal costs cheaper" + description: "Product of primary dyes makes everything that costs metal cost less metal" }, visibility: () => showIf(management.elfTraining.oilElfTraining.milestones[4].earned.value), style: { color: colorText } From b0c57fd7c1e7e22de58b99c5f153f8cd49c2b044 Mon Sep 17 00:00:00 2001 From: thepaperpilot Date: Tue, 13 Dec 2022 21:54:20 -0600 Subject: [PATCH 07/48] Implement Peppermint milestones --- src/data/layers/coal.tsx | 72 ++++++++++++++++++++++++++++++++-- src/data/layers/management.tsx | 14 +++---- src/data/layers/oil.tsx | 16 ++++++-- 3 files changed, 88 insertions(+), 14 deletions(-) diff --git a/src/data/layers/coal.tsx b/src/data/layers/coal.tsx index 1f85741..c19a769 100644 --- a/src/data/layers/coal.tsx +++ b/src/data/layers/coal.tsx @@ -41,6 +41,7 @@ import trees from "./trees"; import dyes from "./dyes"; import management from "./management"; import wrappingPaper from "./wrapping-paper"; +import plastic from "./plastic"; interface BetterFertilizerUpgOptions { canAfford: () => boolean; @@ -275,6 +276,9 @@ const layer = createLayer(id, function (this: BaseLayer) { if (management.elfTraining.fertilizerElfTraining.milestones[2].earned.value) { cost = cost.div(Decimal.add(trees.totalLogs.value, Math.E).ln()); } + if (management.elfTraining.coalDrillElfTraining.milestones[2].earned.value) { + cost = cost.div(10); + } return cost; }, display: jsx(() => ( @@ -417,7 +421,40 @@ const layer = createLayer(id, function (this: BaseLayer) { style: { color: colorText }, visibility: () => showIf(oil.depthMilestones[4].earned.value) })); - const row3upgrades = [efficientSmelther]; + const arsonistAssistance = createUpgrade(() => ({ + resource: noPersist(coal), + cost: 1e45, + display: { + title: "Arsonist Assistance", + description: "Every elf at or above level 5 doubles ash gain" + }, + style: { color: colorText }, + visibility: () => + showIf(management.elfTraining.coalDrillElfTraining.milestones[3].earned.value) + })); + const refinedCoal = createUpgrade(() => ({ + resource: noPersist(coal), + cost: 1e50, + display: { + title: "Refined Coal", + description: "Refineries boost coal gain" + }, + style: { color: colorText }, + visibility: () => + showIf(management.elfTraining.coalDrillElfTraining.milestones[3].earned.value) + })); + const coloredFire = createUpgrade(() => ({ + resource: noPersist(coal), + cost: 1e55, + display: { + title: "Colored Fire", + description: "Green dye also affects small fire synergy" + }, + style: { color: colorText }, + visibility: () => + showIf(management.elfTraining.coalDrillElfTraining.milestones[3].earned.value) + })); + const row3upgrades = [efficientSmelther, arsonistAssistance, refinedCoal, coloredFire]; const heatedCutters = createBuyable(() => ({ resource: noPersist(coal), @@ -600,7 +637,11 @@ const layer = createLayer(id, function (this: BaseLayer) { if (management.elfTraining.smallfireElfTraining.milestones[0].earned.value) { v = Decimal.div(buildBonfire.amount.value, 10).add(v); } - return Decimal.div(v, 10000).add(1); + let multi = Decimal.div(v, 10000).add(1); + if (coloredFire.bought.value) { + multi = Decimal.add(multi, dyes.dyes.green.amount.value); + } + return multi; }, description: "Small Fires Synergy", enabled: elves.elves.smallFireElf.bought @@ -643,7 +684,14 @@ const layer = createLayer(id, function (this: BaseLayer) { supportLowNumbers: true })), createMultiplicativeModifier(() => ({ - multiplier: () => Decimal.mul(oil.depth.value, 0.25).add(1), + multiplier: () => + Decimal.mul(oil.depth.value, 0.25) + .pow( + management.elfTraining.coalDrillElfTraining.milestones[4].earned.value + ? 1.5 + : 1 + ) + .add(1), description: "5m Well Depth", enabled: oil.depthMilestones[0].earned })), @@ -652,6 +700,16 @@ const layer = createLayer(id, function (this: BaseLayer) { description: "Heavy Extractor", enabled: () => Decimal.gt(oil.activeExtractor.value, 0) })), + createMultiplicativeModifier(() => ({ + multiplier: Decimal.add(coal.value, 1).log10().add(1).sqrt(), + description: "Peppermint Level 2", + enabled: management.elfTraining.coalDrillElfTraining.milestones[1].earned + })), + createMultiplicativeModifier(() => ({ + multiplier: Decimal.add(plastic.buildRefinery.amount.value, 1).sqrt(), + description: "Refined Coal", + enabled: refinedCoal.bought + })), createExponentialModifier(() => ({ exponent: 1.05, description: "Jack Level 2", @@ -725,6 +783,11 @@ const layer = createLayer(id, function (this: BaseLayer) { description: "Mining boots", enabled: cloth.metalUpgrades.metalUpgrade1.bought })), + createMultiplicativeModifier(() => ({ + multiplier: () => Decimal.pow(2, management.level5Elves.value), + description: "Arson Assistance", + enabled: arsonistAssistance.bought + })), createExponentialModifier(() => ({ exponent: 1.1, description: "Joy Level 2", @@ -874,6 +937,9 @@ const layer = createLayer(id, function (this: BaseLayer) { betterFertilizer, unlockKiln, efficientSmelther, + arsonistAssistance, + refinedCoal, + coloredFire, heatedCutters, heatedPlanters, moreFertilizer, diff --git a/src/data/layers/management.tsx b/src/data/layers/management.tsx index ad86680..87639a5 100644 --- a/src/data/layers/management.tsx +++ b/src/data/layers/management.tsx @@ -801,12 +801,10 @@ const layer = createLayer(id, () => { visibility: () => showIf(clothElfMilestones[2].earned.value && main.day.value >= 13), shouldEarn: () => clothElfTraining.level.value >= 4, onComplete() { - (["red", "yellow", "blue"] as const).forEach( - dyeColor => { - dyes.dyes[dyeColor].amount.value = 0; - dyes.dyes[dyeColor].buyable.amount.value = 0; - } - ); + (["red", "yellow", "blue"] as const).forEach(dyeColor => { + dyes.dyes[dyeColor].amount.value = 0; + dyes.dyes[dyeColor].buyable.amount.value = 0; + }); } })), createMilestone(() => ({ @@ -837,7 +835,7 @@ const layer = createLayer(id, () => { createMilestone(() => ({ display: { requirement: "Peppermint Level 3", - effectDisplay: "The coal drill cost is decreased" + effectDisplay: "The coal drill cost is 10x cheaper" }, visibility: () => showIf(coalDrillElfMilestones[1].earned.value), shouldEarn: () => coalDrillElfTraining.level.value >= 3 @@ -854,7 +852,7 @@ const layer = createLayer(id, () => { createMilestone(() => ({ display: { requirement: "Peppermint Level 5", - effectDisplay: "Well depth boosts coal gain more" + effectDisplay: "Well depth boosts coal gain an additional half time" }, visibility: () => showIf(coalDrillElfMilestones[3].earned.value && main.day.value >= 13), diff --git a/src/data/layers/oil.tsx b/src/data/layers/oil.tsx index 9b791ec..4172cac 100644 --- a/src/data/layers/oil.tsx +++ b/src/data/layers/oil.tsx @@ -84,7 +84,12 @@ const layer = createLayer(id, function (this: BaseLayer) { const activeHeavy = persistent(0); const heavyCoal = computed(() => - Decimal.times(Decimal.pow(activeHeavy.value, heavy2Power.value).pow(2), 1e14) + Decimal.times( + Decimal.pow(activeHeavy.value, heavy2Power.value).pow( + management.elfTraining.coalDrillElfTraining.milestones[0].earned.value ? 2.5 : 2 + ), + 1e14 + ) ); const heavyPower = computed(() => Decimal.times(Decimal.pow(activeHeavy.value, heavy2Power.value), 1) @@ -102,8 +107,13 @@ const layer = createLayer(id, function (this: BaseLayer) {
A large drill specialized at deep mining.
- Consumes 1e14*(Heavy Drills amount)2 coal/sec for (Heavy Drills amount) - drill power. + Consumes 1e14*(Heavy Drills amount) + + {management.elfTraining.coalDrillElfTraining.milestones[0].earned.value + ? 2.5 + : 2} + {" "} + coal/sec for (Heavy Drills amount) drill power.

Currently: From 5753f8605151abe7af00bdbcb2de2a4cb6abe21f Mon Sep 17 00:00:00 2001 From: thepaperpilot Date: Tue, 13 Dec 2022 21:54:36 -0600 Subject: [PATCH 08/48] Un-minimize layers when opened from calendar --- src/data/projEntry.tsx | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/data/projEntry.tsx b/src/data/projEntry.tsx index f7adfac..a66fb51 100644 --- a/src/data/projEntry.tsx +++ b/src/data/projEntry.tsx @@ -140,6 +140,7 @@ export const main = createLayer("main", function (this: BaseLayer) { // Mobile, use single tab mode player.tabs.splice(1, Infinity, layer ?? "trees"); } + layers[layer ?? "trees"]!.minimized.value = false; }, onUnlockLayer() { if (layer) { @@ -291,7 +292,8 @@ export const main = createLayer("main", function (this: BaseLayer) { layer: null, // "wrapping paper" symbol: wrappingPaperSymbol, story: "You'll need to produce wrapping paper so the presents can be wrapped. The elves are getting a bit bored of their boring old workstations, so you decide to let them decorate with some wrapping paper.", - completedStory: "You've produced enough wrapping paper, and the elves are happy with their new workstations. However, some will need more than just wrapping paper to decorate." + completedStory: + "You've produced enough wrapping paper, and the elves are happy with their new workstations. However, some will need more than just wrapping paper to decorate." })), createDay(() => ({ day: 16, From d849b0ef1d9923294b810571675d8512c5a4fd56 Mon Sep 17 00:00:00 2001 From: ducdat0507 <62660527+ducdat0507@users.noreply.github.com> Date: Wed, 14 Dec 2022 10:56:51 +0700 Subject: [PATCH 09/48] Fix invisible scrollbar --- src/main.css | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/main.css b/src/main.css index adc4ed2..52aa0c7 100644 --- a/src/main.css +++ b/src/main.css @@ -70,7 +70,7 @@ ul { /* Scrollbar stuff */ * { - scrollbar-color: #ffffff0f var(--accent1); + scrollbar-color: var(--accent1) #ffffff0f; } ::-webkit-scrollbar { From e9d110d0709e7a2d4609db85eb9a04f2d9a33083 Mon Sep 17 00:00:00 2001 From: unsoftcapped3 <75136164+unsoftcapped3@users.noreply.github.com> Date: Wed, 14 Dec 2022 04:04:39 +0000 Subject: [PATCH 10/48] Focus Upgrades --- src/data/layers/management.tsx | 29 +++++++++++++++++++++++++++++ 1 file changed, 29 insertions(+) diff --git a/src/data/layers/management.tsx b/src/data/layers/management.tsx index ad86680..e977bbe 100644 --- a/src/data/layers/management.tsx +++ b/src/data/layers/management.tsx @@ -1257,6 +1257,34 @@ const layer = createLayer(id, () => { cost: 1e35 })); const upgrades = [focusUpgrade1, focusUpgrade2, focusUpgrade3]; + const focusUpgrade4 = createUpgrade(() => ({ + display: { + title: "Focus Improver", + description: "Square root the focus multiplier exponent" + }, + resource: trees.logs, + visibility: () => showIf(elfTraining.metalElfTraining.milestones[4].earned.value), + cost: 1e40 + })); + const focusUpgrade5 = createUpgrade(() => ({ + display: { + title: "Focus Focuser", + description: "The bar moves slower when it's closer to the right and faster when it's closer to the left" + }, + resource: trees.logs, + visibility: () => showIf(elfTraining.metalElfTraining.milestones[4].earned.value), + cost: 1e45 + })); + const focusUpgrade6 = createUpgrade(() => ({ + display: { + title: "Focus Doubler", + description: "Focus now applies to 6 elves." + }, + resource: trees.logs, + visibility: () => showIf(elfTraining.metalElfTraining.milestones[4].earned.value), + cost: 1e50 + })); + const upgrades2 = [focusUpgrade4, focusUpgrade5, focusUpgrade6]; // ------------------------------------------------------------------------------- Schools const schoolCost = computed(() => { @@ -1524,6 +1552,7 @@ const layer = createLayer(id, () => { focusMultiplier: focusMulti, upgrades, + upgrades2, focusTargets, focusCooldown, focusTime, From 44a602c7973b18004ee1bf17fbd7c7f6fb01c905 Mon Sep 17 00:00:00 2001 From: thepaperpilot Date: Tue, 13 Dec 2022 22:07:24 -0600 Subject: [PATCH 11/48] Implement gingersnap lv4-5 --- src/data/layers/dyes.tsx | 18 +++++++++--------- src/data/layers/management.tsx | 9 +++++++-- src/data/layers/metal.tsx | 18 +++++++++++++++--- 3 files changed, 31 insertions(+), 14 deletions(-) diff --git a/src/data/layers/dyes.tsx b/src/data/layers/dyes.tsx index cb6880f..26f740c 100644 --- a/src/data/layers/dyes.tsx +++ b/src/data/layers/dyes.tsx @@ -490,15 +490,15 @@ const layer = createLayer(id, function (this: BaseLayer) { blue1: computed(() => Decimal.add(dyes.blue.amount.value, 1).log2().sqrt().times(5e6)), orange1: computed(() => - Decimal.pow(2, Decimal.add(dyes.orange.amount.value, 1).log2().sqrt()).pow( - upgrades.coalUpg.bought.value ? 1.2 : 1 - ) + Decimal.pow(2, Decimal.add(dyes.orange.amount.value, 1).log2().sqrt()) + .pow(upgrades.coalUpg.bought.value ? 1.2 : 1) + .pow(management.elfTraining.clothElfTraining.milestones[3].earned.value ? 1.1 : 1) ), orange2: computed(() => Decimal.add(dyes.orange.amount.value, 1).log2().plus(1)), green1: computed(() => - Decimal.pow(2, Decimal.add(dyes.green.amount.value, 1).log2().sqrt()).pow( - upgrades.coalUpg.bought.value ? 1.2 : 1 - ) + Decimal.pow(2, Decimal.add(dyes.green.amount.value, 1).log2().sqrt()) + .pow(upgrades.coalUpg.bought.value ? 1.2 : 1) + .pow(management.elfTraining.clothElfTraining.milestones[3].earned.value ? 1.1 : 1) ), green2: computed(() => Decimal.add(dyes.green.amount.value, 1) @@ -507,9 +507,9 @@ const layer = createLayer(id, function (this: BaseLayer) { .pow(upgrades.coalUpg.bought.value ? 2 : 1) ), purple1: computed(() => - Decimal.pow(2, Decimal.add(dyes.purple.amount.value, 1).log2().sqrt()).pow( - upgrades.coalUpg.bought.value ? 1.2 : 1 - ) + Decimal.pow(2, Decimal.add(dyes.purple.amount.value, 1).log2().sqrt()) + .pow(upgrades.coalUpg.bought.value ? 1.2 : 1) + .pow(management.elfTraining.clothElfTraining.milestones[3].earned.value ? 1.1 : 1) ), purple2: computed(() => Decimal.add(dyes.purple.amount.value, 1).log2().plus(1)) }; diff --git a/src/data/layers/management.tsx b/src/data/layers/management.tsx index a606f66..46ebb55 100644 --- a/src/data/layers/management.tsx +++ b/src/data/layers/management.tsx @@ -796,7 +796,8 @@ const layer = createLayer(id, () => { createMilestone(() => ({ display: { requirement: "Gingersnap Level 4", - effectDisplay: "Raise secondary dyes' first effects to the 1.1 but reset primary dyes" + effectDisplay: + "Raise secondary dyes' first effects to the 1.1 but reset primary dyes" }, visibility: () => showIf(clothElfMilestones[2].earned.value && main.day.value >= 13), shouldEarn: () => clothElfTraining.level.value >= 4, @@ -810,7 +811,11 @@ const layer = createLayer(id, () => { createMilestone(() => ({ display: { requirement: "Gingersnap Level 5", - effectDisplay: "Well depth divides metal machine costs" + effectDisplay: jsx(() => ( + <> + Well depth divides metal machine costs + + )) }, visibility: () => showIf(clothElfMilestones[3].earned.value && main.day.value >= 13), shouldEarn: () => clothElfTraining.level.value >= 5 diff --git a/src/data/layers/metal.tsx b/src/data/layers/metal.tsx index a3295ad..67a9287 100644 --- a/src/data/layers/metal.tsx +++ b/src/data/layers/metal.tsx @@ -381,7 +381,11 @@ const layer = createLayer(id, function (this: BaseLayer) { cost() { let v = new Decimal(this.amount.value); v = Decimal.pow(0.95, paper.books.metalBook.totalAmount.value).times(v); - return Decimal.pow(1.15, v).times(10); + let cost = Decimal.pow(1.15, v).times(10); + if (management.elfTraining.clothElfTraining.milestones[4].earned.value) { + cost = Decimal.div(cost, Decimal.add(oil.depth.value, 1).sqrt()); + } + return cost; }, display: { title: "Metal Drill", @@ -407,7 +411,11 @@ const layer = createLayer(id, function (this: BaseLayer) { cost() { let v = new Decimal(this.amount.value); v = Decimal.pow(0.95, paper.books.metalBook.totalAmount.value).times(v); - return Decimal.pow(1.15, Decimal.times(v, 10)).times(10); + let cost = Decimal.pow(1.15, Decimal.times(v, 10)).times(10); + if (management.elfTraining.clothElfTraining.milestones[4].earned.value) { + cost = Decimal.div(cost, Decimal.add(oil.depth.value, 1).sqrt()); + } + return cost; }, display: { title: "Industrial Crucible", @@ -433,7 +441,11 @@ const layer = createLayer(id, function (this: BaseLayer) { cost() { let v = new Decimal(this.amount.value); v = Decimal.pow(0.95, paper.books.metalBook.totalAmount.value).times(v); - return Decimal.pow(10, v).times(1e12); + let cost = Decimal.pow(10, v).times(1e12); + if (management.elfTraining.clothElfTraining.milestones[4].earned.value) { + cost = Decimal.div(cost, Decimal.add(oil.depth.value, 1).sqrt()); + } + return cost; }, display: { title: "Hotter Forges", From 07d085d15b44434b14d2198914a3ecc6b7fde0c9 Mon Sep 17 00:00:00 2001 From: unsoftcapped3 <75136164+unsoftcapped3@users.noreply.github.com> Date: Wed, 14 Dec 2022 04:11:48 +0000 Subject: [PATCH 12/48] implement focus upgrades 4, 6 --- src/data/layers/management.tsx | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/data/layers/management.tsx b/src/data/layers/management.tsx index a606f66..ba1744f 100644 --- a/src/data/layers/management.tsx +++ b/src/data/layers/management.tsx @@ -1121,7 +1121,7 @@ const layer = createLayer(id, () => { focusTargets.value = {}; focusMulti.value = Decimal.pow( focusMaxMulti.value, - 1 - Math.abs(Math.sin((Date.now() / 1000) * 2)) + Decimal.pow(1 - Math.abs(Math.sin((Date.now() / 1000) * 2)), focusUpgrade4.bought ? 0.5 : 1) ); } }); @@ -1145,6 +1145,11 @@ const layer = createLayer(id, () => { addend: 1, description: "Focus Upgrade 2", enabled: focusUpgrade2.bought + })), + createAdditiveModifier(() => ({ + addend: 1, + description: "Focus Upgrade 6", + enabled: focusUpgrade6.bought })) ]); From 4d37bab43a0f572c3fb65dec18f25a671315976e Mon Sep 17 00:00:00 2001 From: unsoftcapped3 <75136164+unsoftcapped3@users.noreply.github.com> Date: Wed, 14 Dec 2022 04:18:38 +0000 Subject: [PATCH 13/48] implement paper upgrades 4 and 6 --- src/data/layers/coal.tsx | 5 +++++ src/data/layers/management.tsx | 2 +- src/data/layers/paper.tsx | 2 +- 3 files changed, 7 insertions(+), 2 deletions(-) diff --git a/src/data/layers/coal.tsx b/src/data/layers/coal.tsx index c19a769..10facff 100644 --- a/src/data/layers/coal.tsx +++ b/src/data/layers/coal.tsx @@ -802,6 +802,11 @@ const layer = createLayer(id, function (this: BaseLayer) { exponent: 1.1, description: "Snowball Level 2", enabled: management.elfTraining.kilnElfTraining.milestones[1].earned + })), + createAdditiveModifier(() => ({ + addend(){return paper.paper.value}, + description: "Paper Burning", + enabled: paper.ashUpgrade.bought })) ]); const computedAshGain = computed(() => ashGain.apply(0)); diff --git a/src/data/layers/management.tsx b/src/data/layers/management.tsx index 2cf1850..f0c1525 100644 --- a/src/data/layers/management.tsx +++ b/src/data/layers/management.tsx @@ -1377,7 +1377,7 @@ const layer = createLayer(id, () => { }); const classroomEffect = computed(() => { - return Decimal.add(classrooms.amount.value, 1).pow(0.9); + return Decimal.add(classrooms.amount.value, 1).pow(0.9).pow(paper.classroomUpgrade.bought.value ? 1.1 : 1); }); const classrooms = createBuyable(() => ({ diff --git a/src/data/layers/paper.tsx b/src/data/layers/paper.tsx index 0eab68a..a93b0db 100644 --- a/src/data/layers/paper.tsx +++ b/src/data/layers/paper.tsx @@ -299,7 +299,7 @@ const layer = createLayer(id, function (this: BaseLayer) { cost: 1e36, visibility: () => showIf(management.elfTraining.heavyDrillElfTraining.milestones[4].earned.value), display: { - title: "Paper burning", + title: "Paper Burning", description: "Paper adds to ash gain after all other modifiers" } })); From 08c9fe78df97172ca297d1950f7b1cda4e24c278 Mon Sep 17 00:00:00 2001 From: thepaperpilot Date: Tue, 13 Dec 2022 22:19:24 -0600 Subject: [PATCH 14/48] Implement bell lv5 upgrades --- src/data/layers/boxes.tsx | 11 ++++++++++- src/data/layers/cloth.tsx | 16 ++++++++++++++++ src/data/layers/dyes.tsx | 8 ++++++++ src/data/layers/management.tsx | 8 +++++++- 4 files changed, 41 insertions(+), 2 deletions(-) diff --git a/src/data/layers/boxes.tsx b/src/data/layers/boxes.tsx index d318634..8a1f27c 100644 --- a/src/data/layers/boxes.tsx +++ b/src/data/layers/boxes.tsx @@ -179,6 +179,12 @@ const layer = createLayer(id, function (this: BaseLayer) { display: { title: "Carry dye in boxes", description: "Double all dye gain" + }, + onPurchase() { + (["red", "yellow", "blue", "orange", "green", "purple"] as const).forEach(dyeColor => { + dyes.dyes[dyeColor].amount.value = 0; + dyes.dyes[dyeColor].buyable.amount.value = 0; + }); } })) as GenericUpgrade; const xpUpgrade = createUpgrade(() => ({ @@ -356,7 +362,10 @@ const layer = createLayer(id, function (this: BaseLayer) { if (management.elfTraining.boxElfTraining.milestones[2].earned.value) { scaling--; } - return Decimal.pow(scaling, v).times(1e25).div(dyes.boosts.orange2.value).div(wrappingPaper.boosts.ocean1.value); + return Decimal.pow(scaling, v) + .times(1e25) + .div(dyes.boosts.orange2.value) + .div(wrappingPaper.boosts.ocean1.value); }, visibility: () => showIf(management.elfTraining.boxElfTraining.milestones[3].earned.value), freeLevels: computed(() => diff --git a/src/data/layers/cloth.tsx b/src/data/layers/cloth.tsx index dab4aa7..6fdbf41 100644 --- a/src/data/layers/cloth.tsx +++ b/src/data/layers/cloth.tsx @@ -28,6 +28,7 @@ import { formatWhole } from "util/break_eternity"; import { Direction } from "util/common"; import { render, renderCol, renderRow } from "util/vue"; import { computed, ref } from "vue"; +import boxes from "./boxes"; import dyes from "./dyes"; import management from "./management"; import metal from "./metal"; @@ -366,6 +367,11 @@ const layer = createLayer(id, function (this: BaseLayer) { multiplier: 2, description: "1000% Foundation Completed", enabled: workshop.milestones.extraExpansionMilestone5.earned + })), + createMultiplicativeModifier(() => ({ + multiplier: 2, + description: "Carry cloth in boxes", + enabled: boxes.row3Upgrades.clothUpgrade.bought })) ]); const computedSheepGain = computed(() => sheepGain.apply(1)); @@ -401,6 +407,11 @@ const layer = createLayer(id, function (this: BaseLayer) { multiplier: 2, description: "1000% Foundation Completed", enabled: workshop.milestones.extraExpansionMilestone5.earned + })), + createMultiplicativeModifier(() => ({ + multiplier: 2, + description: "Carry cloth in boxes", + enabled: boxes.row3Upgrades.clothUpgrade.bought })) ]); const computedShearingAmount = computed(() => shearingAmount.apply(1)); @@ -436,6 +447,11 @@ const layer = createLayer(id, function (this: BaseLayer) { multiplier: 2, description: "1000% Foundation Completed", enabled: workshop.milestones.extraExpansionMilestone5.earned + })), + createMultiplicativeModifier(() => ({ + multiplier: 2, + description: "Carry cloth in boxes", + enabled: boxes.row3Upgrades.clothUpgrade.bought })) ]); const computedSpinningAmount = computed(() => spinningAmount.apply(1)); diff --git a/src/data/layers/dyes.tsx b/src/data/layers/dyes.tsx index 26f740c..fa56269 100644 --- a/src/data/layers/dyes.tsx +++ b/src/data/layers/dyes.tsx @@ -31,6 +31,7 @@ import oil from "./oil"; import trees from "./trees"; import wrappingPaper from "./wrapping-paper"; import paper from "./paper"; +import boxes from "./boxes"; interface Dye { name: string; @@ -156,6 +157,13 @@ const layer = createLayer(id, function (this: BaseLayer) { enabled: management.elfTraining.clothElfTraining.milestones[2].earned })) ); + modifiers.push( + createMultiplicativeModifier(() => ({ + multiplier: 2, + description: "Carry dye in boxes", + enabled: boxes.row3Upgrades.dyeUpgrade.bought + })) + ); return modifiers; }) as WithRequired; const computedToGenerate = computed(() => toGenerate.apply(0)); diff --git a/src/data/layers/management.tsx b/src/data/layers/management.tsx index f0c1525..9561348 100644 --- a/src/data/layers/management.tsx +++ b/src/data/layers/management.tsx @@ -117,6 +117,11 @@ const layer = createLayer(id, () => { multiplier: classroomEffect, description: "Classroom Effect", enabled: classroomUpgrade.bought + })), + createMultiplicativeModifier(() => ({ + multiplier: 2, + description: "Carry experience in boxes???", + enabled: boxes.row3Upgrades.xpUpgrade.bought })) ]); const globalXPModifierComputed = computed(() => globalXPModifier.apply(1)); @@ -1277,7 +1282,8 @@ const layer = createLayer(id, () => { const focusUpgrade5 = createUpgrade(() => ({ display: { title: "Focus Focuser", - description: "The bar moves slower when it's closer to the right and faster when it's closer to the left" + description: + "The bar moves slower when it's closer to the right and faster when it's closer to the left" }, resource: trees.logs, visibility: () => showIf(elfTraining.metalElfTraining.milestones[4].earned.value), From 43a24bb4279739d7744d06d9cad1906587b77b42 Mon Sep 17 00:00:00 2001 From: unsoftcapped3 <75136164+unsoftcapped3@users.noreply.github.com> Date: Wed, 14 Dec 2022 04:22:40 +0000 Subject: [PATCH 15/48] implement paper upgard 5 --- src/data/layers/paper.tsx | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/data/layers/paper.tsx b/src/data/layers/paper.tsx index a93b0db..2ce7554 100644 --- a/src/data/layers/paper.tsx +++ b/src/data/layers/paper.tsx @@ -126,6 +126,9 @@ const layer = createLayer(id, function (this: BaseLayer) { if (management.elfTraining.paperElfTraining.milestones[0].earned.value) { cost = Decimal.div(cost, sumBooks.value.max(1)); } + if (bookUpgrade.bought){ + cost = cost.div(10); + } return cost; }, style: "width: 600px", From d77c3ecb880b4c119fba0999e3e28809e08dacc3 Mon Sep 17 00:00:00 2001 From: thepaperpilot Date: Tue, 13 Dec 2022 22:33:25 -0600 Subject: [PATCH 16/48] Fix build issues --- src/data/layers/management.tsx | 13 +++++++++---- src/data/layers/paper.tsx | 15 +++++++++------ 2 files changed, 18 insertions(+), 10 deletions(-) diff --git a/src/data/layers/management.tsx b/src/data/layers/management.tsx index 9561348..7a549f2 100644 --- a/src/data/layers/management.tsx +++ b/src/data/layers/management.tsx @@ -20,7 +20,7 @@ import { } from "game/modifiers"; import { persistent } from "game/persistence"; import Decimal, { DecimalSource, format, formatTime, formatWhole } from "util/bignum"; -import { Direction } from "util/common"; +import { Direction, WithRequired } from "util/common"; import { ProcessedComputable } from "util/computed"; import { render, renderCol, renderGrid } from "util/vue"; import { computed, ComputedRef, ref, Ref, unref, watchEffect } from "vue"; @@ -123,7 +123,7 @@ const layer = createLayer(id, () => { description: "Carry experience in boxes???", enabled: boxes.row3Upgrades.xpUpgrade.bought })) - ]); + ]) as WithRequired; const globalXPModifierComputed = computed(() => globalXPModifier.apply(1)); // ------------------------------------------------------------------------------- Training core function @@ -1131,7 +1131,10 @@ const layer = createLayer(id, () => { focusTargets.value = {}; focusMulti.value = Decimal.pow( focusMaxMulti.value, - Decimal.pow(1 - Math.abs(Math.sin((Date.now() / 1000) * 2)), focusUpgrade4.bought ? 0.5 : 1) + Decimal.pow( + 1 - Math.abs(Math.sin((Date.now() / 1000) * 2)), + focusUpgrade4.bought ? 0.5 : 1 + ) ); } }); @@ -1383,7 +1386,9 @@ const layer = createLayer(id, () => { }); const classroomEffect = computed(() => { - return Decimal.add(classrooms.amount.value, 1).pow(0.9).pow(paper.classroomUpgrade.bought.value ? 1.1 : 1); + return Decimal.add(classrooms.amount.value, 1) + .pow(0.9) + .pow(paper.upgrades2.classroomUpgrade.bought.value ? 1.1 : 1); }); const classrooms = createBuyable(() => ({ diff --git a/src/data/layers/paper.tsx b/src/data/layers/paper.tsx index 2ce7554..1f132fa 100644 --- a/src/data/layers/paper.tsx +++ b/src/data/layers/paper.tsx @@ -12,7 +12,7 @@ import { createCumulativeConversion, createPolynomialScaling } from "features/co import { jsx, showIf } from "features/feature"; import MainDisplay from "features/resources/MainDisplay.vue"; import { createResource, displayResource, Resource } from "features/resources/resource"; -import { createUpgrade } from "features/upgrades/upgrade"; +import { createUpgrade, GenericUpgrade } from "features/upgrades/upgrade"; import { globalBus } from "game/events"; import { BaseLayer, createLayer } from "game/layers"; import { createMultiplicativeModifier, createSequentialModifier, Modifier } from "game/modifiers"; @@ -300,16 +300,18 @@ const layer = createLayer(id, function (this: BaseLayer) { const ashUpgrade = createUpgrade(() => ({ resource: noPersist(paper), cost: 1e36, - visibility: () => showIf(management.elfTraining.heavyDrillElfTraining.milestones[4].earned.value), + visibility: () => + showIf(management.elfTraining.heavyDrillElfTraining.milestones[4].earned.value), display: { title: "Paper Burning", description: "Paper adds to ash gain after all other modifiers" } - })); + })) as GenericUpgrade; const bookUpgrade = createUpgrade(() => ({ resource: noPersist(paper), cost: 1e40, - visibility: () => showIf(management.elfTraining.heavyDrillElfTraining.milestones[4].earned.value), + visibility: () => + showIf(management.elfTraining.heavyDrillElfTraining.milestones[4].earned.value), display: { title: "Book Cheapener", description: "Books are less expensive" @@ -318,7 +320,8 @@ const layer = createLayer(id, function (this: BaseLayer) { const classroomUpgrade = createUpgrade(() => ({ resource: noPersist(paper), cost: 1e44, - visibility: () => showIf(management.elfTraining.heavyDrillElfTraining.milestones[4].earned.value), + visibility: () => + showIf(management.elfTraining.heavyDrillElfTraining.milestones[4].earned.value), display: { title: "Classroom Supplies", description: "Classrooms' effect is raised to the 1.1" @@ -368,7 +371,7 @@ const layer = createLayer(id, function (this: BaseLayer) { description: "Star Level 2", enabled: management.elfTraining.paperElfTraining.milestones[1].earned })) - ]); + ]) as WithRequired; const computedAshCost = computed(() => ashCost.apply(1e6)); const [generalTab, generalTabCollapsed] = createCollapsibleModifierSections(() => [ From 279e8b22c4a51e0578ab98afe9a03f6d8575c76a Mon Sep 17 00:00:00 2001 From: thepaperpilot Date: Tue, 13 Dec 2022 22:35:08 -0600 Subject: [PATCH 17/48] More build issues --- src/data/layers/coal.tsx | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/data/layers/coal.tsx b/src/data/layers/coal.tsx index 10facff..d2a84da 100644 --- a/src/data/layers/coal.tsx +++ b/src/data/layers/coal.tsx @@ -804,9 +804,9 @@ const layer = createLayer(id, function (this: BaseLayer) { enabled: management.elfTraining.kilnElfTraining.milestones[1].earned })), createAdditiveModifier(() => ({ - addend(){return paper.paper.value}, + addend: paper.paper, description: "Paper Burning", - enabled: paper.ashUpgrade.bought + enabled: paper.upgrades2.ashUpgrade.bought })) ]); const computedAshGain = computed(() => ashGain.apply(0)); From 55d7a6017171707c99748dedb6ca1d1ba91eb01e Mon Sep 17 00:00:00 2001 From: thepaperpilot Date: Tue, 13 Dec 2022 22:36:24 -0600 Subject: [PATCH 18/48] Fix bookupgrade effect always applying --- src/data/layers/paper.tsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/data/layers/paper.tsx b/src/data/layers/paper.tsx index 1f132fa..88430b0 100644 --- a/src/data/layers/paper.tsx +++ b/src/data/layers/paper.tsx @@ -126,7 +126,7 @@ const layer = createLayer(id, function (this: BaseLayer) { if (management.elfTraining.paperElfTraining.milestones[0].earned.value) { cost = Decimal.div(cost, sumBooks.value.max(1)); } - if (bookUpgrade.bought){ + if (bookUpgrade.bought.value) { cost = cost.div(10); } return cost; From 943500732dfbfc6b057cef78fa420dc62ea3889c Mon Sep 17 00:00:00 2001 From: thepaperpilot Date: Tue, 13 Dec 2022 22:56:42 -0600 Subject: [PATCH 19/48] Fix school being purchasable beyond its purchase limit --- src/data/layers/management.tsx | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/data/layers/management.tsx b/src/data/layers/management.tsx index 7a549f2..0790793 100644 --- a/src/data/layers/management.tsx +++ b/src/data/layers/management.tsx @@ -1354,7 +1354,8 @@ const layer = createLayer(id, () => { schoolCost.value.plastic.lte(plastic.plastic.value) && schoolCost.value.dye.lte(dyes.dyes.blue.amount.value) && schoolCost.value.dye.lte(dyes.dyes.red.amount.value) && - schoolCost.value.dye.lte(dyes.dyes.yellow.amount.value) + schoolCost.value.dye.lte(dyes.dyes.yellow.amount.value) && + Decimal.lt(schools.amount.value, unref(schools.purchaseLimit)) ); }, onPurchase() { From 2f2d622e49752872a6a5a542bdd58f1cff3b3d9f Mon Sep 17 00:00:00 2001 From: thepaperpilot Date: Tue, 13 Dec 2022 23:02:24 -0600 Subject: [PATCH 20/48] Make focus roll amongst all visible elves --- src/data/layers/management.tsx | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/data/layers/management.tsx b/src/data/layers/management.tsx index 0790793..fea8a24 100644 --- a/src/data/layers/management.tsx +++ b/src/data/layers/management.tsx @@ -1232,7 +1232,12 @@ const layer = createLayer(id, () => { onClick() { focusCooldown.value = Decimal.fromValue(cooldown.value).toNumber(); focusTime.value = 10; - rerollFocusTargets(12, maximumElves.value); + rerollFocusTargets( + Object.values(elfTraining).filter( + elf => unref(elf.visibility) === Visibility.Visible + ).length, + maximumElves.value + ); } })); From 1e2b3f1b12802de34e81c12d96d5af31df4cb994 Mon Sep 17 00:00:00 2001 From: unsoftcapped3 <75136164+unsoftcapped3@users.noreply.github.com> Date: Wed, 14 Dec 2022 05:11:07 +0000 Subject: [PATCH 21/48] oil upgrades 1 and 4 effects --- src/data/layers/dyes.tsx | 16 ++++++++++++++++ src/data/layers/oil.tsx | 2 +- 2 files changed, 17 insertions(+), 1 deletion(-) diff --git a/src/data/layers/dyes.tsx b/src/data/layers/dyes.tsx index fa56269..5daf320 100644 --- a/src/data/layers/dyes.tsx +++ b/src/data/layers/dyes.tsx @@ -90,6 +90,22 @@ const layer = createLayer(id, function (this: BaseLayer) { description: `${options.name} Chambers` })) ]; + if (options.color === "yellow" && oil.row3Upgrades[0].bought.value){ + modifiers.push( + createMultiplicativeModifier(() => ({ + multiplier(){return Decimal.add(dyes.red.amount.value,1).log10().pow(0.75)}, + description: "Dye Synergy I" + })) + ) + } + if (options.color === "red" && oil.row3Upgrades[3].bought.value){ + modifiers.push( + createMultiplicativeModifier(() => ({ + multiplier(){return Decimal.add(dyes.blue.amount.value,1).log10()}, + description: "Dye Synergy II" + })) + ) + } if (options.color === "red" || options.color === "yellow") { modifiers.push( createMultiplicativeModifier(() => ({ diff --git a/src/data/layers/oil.tsx b/src/data/layers/oil.tsx index 4172cac..4d507bf 100644 --- a/src/data/layers/oil.tsx +++ b/src/data/layers/oil.tsx @@ -686,7 +686,7 @@ const layer = createLayer(id, function (this: BaseLayer) { cost: 1e15, display: { title: "The Ultimate Metal Dye", - description: "Product of primary dyes makes everything that costs metal cost less metal" + description: "Sum of primary dyes boosts auto smelt speed" }, visibility: () => showIf(management.elfTraining.oilElfTraining.milestones[4].earned.value), style: { color: colorText } From 3646be388b767c02246cfe61597ac557f1129de3 Mon Sep 17 00:00:00 2001 From: unsoftcapped3 <75136164+unsoftcapped3@users.noreply.github.com> Date: Wed, 14 Dec 2022 05:18:20 +0000 Subject: [PATCH 22/48] implement oil upgrades --- src/data/layers/dyes.tsx | 2 +- src/data/layers/management.tsx | 9 +++++++-- src/data/layers/metal.tsx | 5 +++++ 3 files changed, 13 insertions(+), 3 deletions(-) diff --git a/src/data/layers/dyes.tsx b/src/data/layers/dyes.tsx index 5daf320..93f461c 100644 --- a/src/data/layers/dyes.tsx +++ b/src/data/layers/dyes.tsx @@ -518,7 +518,7 @@ const layer = createLayer(id, function (this: BaseLayer) { .pow(upgrades.coalUpg.bought.value ? 1.2 : 1) .pow(management.elfTraining.clothElfTraining.milestones[3].earned.value ? 1.1 : 1) ), - orange2: computed(() => Decimal.add(dyes.orange.amount.value, 1).log2().plus(1)), + orange2: computed(() => Decimal.add(dyes.orange.amount.value, 1).log2().plus(1).pow(oil.row3Upgrades[1].bought.value ? 2.5 : 1)), green1: computed(() => Decimal.pow(2, Decimal.add(dyes.green.amount.value, 1).log2().sqrt()) .pow(upgrades.coalUpg.bought.value ? 1.2 : 1) diff --git a/src/data/layers/management.tsx b/src/data/layers/management.tsx index fea8a24..5953db3 100644 --- a/src/data/layers/management.tsx +++ b/src/data/layers/management.tsx @@ -33,7 +33,7 @@ import metal from "./metal"; import paper from "./paper"; import plastic from "./plastic"; import trees from "./trees"; - +import oil from "./oil"; const id = "management"; const day = 12; const advancedDay = 13; @@ -1151,7 +1151,12 @@ const layer = createLayer(id, () => { multiplier: 2, description: "Focus Upgrade 1", enabled: focusUpgrade1.bought - })) + })), + createAdditiveModifier(() => ({ + addend(){return Decimal.add(dyes.dyes.orange.amount, dyes.dyes.purple.amount).add(dyes.dyes.green.amount).add(1).cbrt()}, + description: "Colorful Focus", + enabled: oil.row3Upgrades[2].bought.value + })), ]); const maximumElvesModifier = createSequentialModifier(() => [ createAdditiveModifier(() => ({ diff --git a/src/data/layers/metal.tsx b/src/data/layers/metal.tsx index 67a9287..c12fad5 100644 --- a/src/data/layers/metal.tsx +++ b/src/data/layers/metal.tsx @@ -148,6 +148,11 @@ const layer = createLayer(id, function (this: BaseLayer) { multiplier: () => Decimal.div(management.totalElfExp.value, 1000).add(1).sqrt(), description: "Mary Level 5", enabled: management.elfTraining.heatedPlanterElfTraining.milestones[4].earned + })), + createMultiplicativeModifier(() => ({ + multiplier: () => Decimal.add(dyes.dyes.red.amount, dyes.dyes.blue.amount).add(dyes.dyes.yellow.amount).add(1).log10(), + description: "The Ultimate Metal Dye", + enabled: oil.row3Upgrades[4].bought.value })) ]); const computedAutoSmeltSpeed = computed(() => autoSmeltSpeed.apply(0)); From b588d5a6370c8b522a1c33f70c160b2a2d7d0d36 Mon Sep 17 00:00:00 2001 From: thepaperpilot Date: Tue, 13 Dec 2022 23:21:42 -0600 Subject: [PATCH 23/48] Implemented Twinkle milestones --- src/data/layers/management.tsx | 23 +++++++++++------------ src/data/layers/metal.tsx | 25 +++++++++++++++++++++++++ src/data/layers/oil.tsx | 20 ++++++++++++-------- 3 files changed, 48 insertions(+), 20 deletions(-) diff --git a/src/data/layers/management.tsx b/src/data/layers/management.tsx index 5953db3..0d94788 100644 --- a/src/data/layers/management.tsx +++ b/src/data/layers/management.tsx @@ -888,7 +888,7 @@ const layer = createLayer(id, () => { createMilestone(() => ({ display: { requirement: "Twinkle Level 3", - effectDisplay: "Auto smelting purity is tripled." + effectDisplay: "Auto smelting multi is tripled." }, visibility: () => showIf(metalElfMilestones[1].earned.value), shouldEarn: () => metalElfTraining.level.value >= 3 @@ -896,7 +896,7 @@ const layer = createLayer(id, () => { createMilestone(() => ({ display: { requirement: "Twinkle Level 4", - effectDisplay: "All metal buyables are cheaper" + effectDisplay: "All metal machines are 10x cheaper" }, visibility: () => showIf(metalElfMilestones[2].earned.value && main.day.value >= 13), shouldEarn: () => metalElfTraining.level.value >= 4 @@ -1129,13 +1129,12 @@ const layer = createLayer(id, () => { if (Decimal.eq(focusTime.value, 0)) { focusTargets.value = {}; - focusMulti.value = Decimal.pow( - focusMaxMulti.value, - Decimal.pow( - 1 - Math.abs(Math.sin((Date.now() / 1000) * 2)), - focusUpgrade4.bought ? 0.5 : 1 - ) - ); + const speed = focusUpgrade5.bought.value ? 2000 : 1000; + let stoppedAt = 1 - Math.abs(Math.sin((Date.now() / speed) * 2)); + if (focusUpgrade4.bought.value) { + stoppedAt = 1 - (1 - stoppedAt) ** 2; + } + focusMulti.value = Decimal.pow(focusMaxMulti.value, stoppedAt); } }); @@ -1286,7 +1285,8 @@ const layer = createLayer(id, () => { const focusUpgrade4 = createUpgrade(() => ({ display: { title: "Focus Improver", - description: "Square root the focus multiplier exponent" + description: + "The bar moves slower when it's closer to the right and faster when it's closer to the left" }, resource: trees.logs, visibility: () => showIf(elfTraining.metalElfTraining.milestones[4].earned.value), @@ -1295,8 +1295,7 @@ const layer = createLayer(id, () => { const focusUpgrade5 = createUpgrade(() => ({ display: { title: "Focus Focuser", - description: - "The bar moves slower when it's closer to the right and faster when it's closer to the left" + description: "The bar moves 2x slower" }, resource: trees.logs, visibility: () => showIf(elfTraining.metalElfTraining.milestones[4].earned.value), diff --git a/src/data/layers/metal.tsx b/src/data/layers/metal.tsx index c12fad5..4b31d22 100644 --- a/src/data/layers/metal.tsx +++ b/src/data/layers/metal.tsx @@ -94,6 +94,11 @@ const layer = createLayer(id, function (this: BaseLayer) { description: "Joy Level 4", enabled: management.elfTraining.smallfireElfTraining.milestones[3].earned })), + createMultiplicativeModifier(() => ({ + multiplier: () => Decimal.add(management.schools.amount.value, 1), + description: "Twinkle Level 1", + enabled: management.elfTraining.metalElfTraining.milestones[0].earned + })), createExponentialModifier(() => ({ exponent: 1.1, description: "Mary Level 2", @@ -149,6 +154,12 @@ const layer = createLayer(id, function (this: BaseLayer) { description: "Mary Level 5", enabled: management.elfTraining.heatedPlanterElfTraining.milestones[4].earned })), + createMultiplicativeModifier(() => ({ + multiplier: () => + Decimal.pow(1.25, management.elfTraining.metalElfTraining.level.value), + description: "Twinkle Level 2", + enabled: management.elfTraining.metalElfTraining.milestones[1].earned + })), createMultiplicativeModifier(() => ({ multiplier: () => Decimal.add(dyes.dyes.red.amount, dyes.dyes.blue.amount).add(dyes.dyes.yellow.amount).add(1).log10(), description: "The Ultimate Metal Dye", @@ -167,6 +178,11 @@ const layer = createLayer(id, function (this: BaseLayer) { Decimal.add(oil.activeBurner.value, 1).mul(oil.oilEffectiveness.value), description: "Blaster Burner", enabled: oil.row2Upgrades[2].bought + })), + createMultiplicativeModifier(() => ({ + multiplier: 3, + description: "Twinkle Level 3", + enabled: management.elfTraining.metalElfTraining.milestones[2].earned })) ]); const computedAutoSmeltMulti = computed(() => autoSmeltMulti.apply(1)); @@ -390,6 +406,9 @@ const layer = createLayer(id, function (this: BaseLayer) { if (management.elfTraining.clothElfTraining.milestones[4].earned.value) { cost = Decimal.div(cost, Decimal.add(oil.depth.value, 1).sqrt()); } + if (management.elfTraining.metalElfTraining.milestones[3].earned.value) { + cost = Decimal.div(cost, 10); + } return cost; }, display: { @@ -420,6 +439,9 @@ const layer = createLayer(id, function (this: BaseLayer) { if (management.elfTraining.clothElfTraining.milestones[4].earned.value) { cost = Decimal.div(cost, Decimal.add(oil.depth.value, 1).sqrt()); } + if (management.elfTraining.metalElfTraining.milestones[3].earned.value) { + cost = Decimal.div(cost, 10); + } return cost; }, display: { @@ -450,6 +472,9 @@ const layer = createLayer(id, function (this: BaseLayer) { if (management.elfTraining.clothElfTraining.milestones[4].earned.value) { cost = Decimal.div(cost, Decimal.add(oil.depth.value, 1).sqrt()); } + if (management.elfTraining.metalElfTraining.milestones[3].earned.value) { + cost = Decimal.div(cost, 10); + } return cost; }, display: { diff --git a/src/data/layers/oil.tsx b/src/data/layers/oil.tsx index 4d507bf..04b2867 100644 --- a/src/data/layers/oil.tsx +++ b/src/data/layers/oil.tsx @@ -611,7 +611,7 @@ const layer = createLayer(id, function (this: BaseLayer) { cost: 1500, display: { title: "Blaster Burner", - description: "The Oil Burner can now increase your metal gain." + description: "The Oil Burner can now increase your auto smelting multi." }, style: { color: colorText } })), @@ -647,7 +647,8 @@ const layer = createLayer(id, function (this: BaseLayer) { title: "Dye Synergy I", description: "Red dye boosts yellow dye gain *(log(x)^0.75)" }, - visibility: () => showIf(management.elfTraining.oilElfTraining.milestones[4].earned.value), + visibility: () => + showIf(management.elfTraining.oilElfTraining.milestones[4].earned.value), style: { color: colorText } })), createUpgrade(() => ({ @@ -655,10 +656,10 @@ const layer = createLayer(id, function (this: BaseLayer) { cost: 1e12, display: { title: "Orange-colored boxes", - description: - "Orange dye's 2nd effect is raised to the 2.5" + description: "Orange dye's 2nd effect is raised to the 2.5" }, - visibility: () => showIf(management.elfTraining.oilElfTraining.milestones[4].earned.value), + visibility: () => + showIf(management.elfTraining.oilElfTraining.milestones[4].earned.value), style: { color: colorText } })), createUpgrade(() => ({ @@ -668,7 +669,8 @@ const layer = createLayer(id, function (this: BaseLayer) { title: "Colorful Focus", description: "Sum of secondary dyes increases max focus multiplier by cbrt(x)" }, - visibility: () => showIf(management.elfTraining.oilElfTraining.milestones[4].earned.value), + visibility: () => + showIf(management.elfTraining.oilElfTraining.milestones[4].earned.value), style: { color: colorText } })), createUpgrade(() => ({ @@ -678,7 +680,8 @@ const layer = createLayer(id, function (this: BaseLayer) { title: "Dye Synergy II", description: "Blue dye boosts red dye gain *log(x)" }, - visibility: () => showIf(management.elfTraining.oilElfTraining.milestones[4].earned.value), + visibility: () => + showIf(management.elfTraining.oilElfTraining.milestones[4].earned.value), style: { color: colorText } })), createUpgrade(() => ({ @@ -688,7 +691,8 @@ const layer = createLayer(id, function (this: BaseLayer) { title: "The Ultimate Metal Dye", description: "Sum of primary dyes boosts auto smelt speed" }, - visibility: () => showIf(management.elfTraining.oilElfTraining.milestones[4].earned.value), + visibility: () => + showIf(management.elfTraining.oilElfTraining.milestones[4].earned.value), style: { color: colorText } })) ]; From cd0a2a82fd9899c0a3274bfbe2c2f66cb50de65c Mon Sep 17 00:00:00 2001 From: thepaperpilot Date: Tue, 13 Dec 2022 23:24:07 -0600 Subject: [PATCH 24/48] Fix build error --- 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 0d94788..02be305 100644 --- a/src/data/layers/management.tsx +++ b/src/data/layers/management.tsx @@ -1152,11 +1152,16 @@ const layer = createLayer(id, () => { enabled: focusUpgrade1.bought })), createAdditiveModifier(() => ({ - addend(){return Decimal.add(dyes.dyes.orange.amount, dyes.dyes.purple.amount).add(dyes.dyes.green.amount).add(1).cbrt()}, + addend() { + return Decimal.add(dyes.dyes.orange.amount, dyes.dyes.purple.amount) + .add(dyes.dyes.green.amount) + .add(1) + .cbrt(); + }, description: "Colorful Focus", enabled: oil.row3Upgrades[2].bought.value - })), - ]); + })) + ]) as WithRequired; const maximumElvesModifier = createSequentialModifier(() => [ createAdditiveModifier(() => ({ addend: 1, From 7942f8f22c995b7f2cf9c29b1b4996e6c5e07d5e Mon Sep 17 00:00:00 2001 From: thepaperpilot Date: Tue, 13 Dec 2022 23:25:34 -0600 Subject: [PATCH 25/48] Fix some refs being unwrapped --- src/data/layers/management.tsx | 2 +- src/data/layers/metal.tsx | 8 ++++++-- 2 files changed, 7 insertions(+), 3 deletions(-) diff --git a/src/data/layers/management.tsx b/src/data/layers/management.tsx index 02be305..0ba59e2 100644 --- a/src/data/layers/management.tsx +++ b/src/data/layers/management.tsx @@ -1159,7 +1159,7 @@ const layer = createLayer(id, () => { .cbrt(); }, description: "Colorful Focus", - enabled: oil.row3Upgrades[2].bought.value + enabled: oil.row3Upgrades[2].bought })) ]) as WithRequired; const maximumElvesModifier = createSequentialModifier(() => [ diff --git a/src/data/layers/metal.tsx b/src/data/layers/metal.tsx index 4b31d22..7ac0eb7 100644 --- a/src/data/layers/metal.tsx +++ b/src/data/layers/metal.tsx @@ -161,9 +161,13 @@ const layer = createLayer(id, function (this: BaseLayer) { enabled: management.elfTraining.metalElfTraining.milestones[1].earned })), createMultiplicativeModifier(() => ({ - multiplier: () => Decimal.add(dyes.dyes.red.amount, dyes.dyes.blue.amount).add(dyes.dyes.yellow.amount).add(1).log10(), + multiplier: () => + Decimal.add(dyes.dyes.red.amount, dyes.dyes.blue.amount) + .add(dyes.dyes.yellow.amount) + .add(1) + .log10(), description: "The Ultimate Metal Dye", - enabled: oil.row3Upgrades[4].bought.value + enabled: oil.row3Upgrades[4].bought })) ]); const computedAutoSmeltSpeed = computed(() => autoSmeltSpeed.apply(0)); From 967ed4a7a0a62e627681023f42b25ea2019db553 Mon Sep 17 00:00:00 2001 From: thepaperpilot Date: Tue, 13 Dec 2022 23:29:13 -0600 Subject: [PATCH 26/48] More build errors --- src/data/layers/management.tsx | 4 ++-- src/data/layers/metal.tsx | 4 ++-- src/data/layers/oil.tsx | 6 ++++-- 3 files changed, 8 insertions(+), 6 deletions(-) diff --git a/src/data/layers/management.tsx b/src/data/layers/management.tsx index 0ba59e2..b6deac2 100644 --- a/src/data/layers/management.tsx +++ b/src/data/layers/management.tsx @@ -1153,8 +1153,8 @@ const layer = createLayer(id, () => { })), createAdditiveModifier(() => ({ addend() { - return Decimal.add(dyes.dyes.orange.amount, dyes.dyes.purple.amount) - .add(dyes.dyes.green.amount) + return Decimal.add(dyes.dyes.orange.amount.value, dyes.dyes.purple.amount.value) + .add(dyes.dyes.green.amount.value) .add(1) .cbrt(); }, diff --git a/src/data/layers/metal.tsx b/src/data/layers/metal.tsx index 7ac0eb7..e82f2f2 100644 --- a/src/data/layers/metal.tsx +++ b/src/data/layers/metal.tsx @@ -162,8 +162,8 @@ const layer = createLayer(id, function (this: BaseLayer) { })), createMultiplicativeModifier(() => ({ multiplier: () => - Decimal.add(dyes.dyes.red.amount, dyes.dyes.blue.amount) - .add(dyes.dyes.yellow.amount) + Decimal.add(dyes.dyes.red.amount.value, dyes.dyes.blue.amount.value) + .add(dyes.dyes.yellow.amount.value) .add(1) .log10(), description: "The Ultimate Metal Dye", diff --git a/src/data/layers/oil.tsx b/src/data/layers/oil.tsx index 04b2867..2fbbb29 100644 --- a/src/data/layers/oil.tsx +++ b/src/data/layers/oil.tsx @@ -24,7 +24,8 @@ import metal from "./metal"; import { createSequentialModifier, createAdditiveModifier, - createMultiplicativeModifier + createMultiplicativeModifier, + Modifier } from "game/modifiers"; import { main } from "data/projEntry"; import { globalBus } from "game/events"; @@ -37,6 +38,7 @@ import paper from "./paper"; import dyes from "./dyes"; import management from "./management"; import workshop from "./workshop"; +import { WithRequired } from "util/common"; const id = "oil"; const day = 9; @@ -809,7 +811,7 @@ const layer = createLayer(id, function (this: BaseLayer) { description: "Faith Level 4", enabled: management.elfTraining.bonfireElfTraining.milestones[3].earned })) - ]); + ]) as WithRequired; const computedOilSpeed = computed(() => oilSpeed.apply(0)); const oilConsumption = createSequentialModifier(() => [ From 2665ca87f8dd2ef90171542c254c07e0960ee08b Mon Sep 17 00:00:00 2001 From: thepaperpilot Date: Tue, 13 Dec 2022 23:44:50 -0600 Subject: [PATCH 27/48] Implemented Cocoa lv1-4 --- src/data/layers/oil.tsx | 25 ++++++++++++++++++++++++- src/data/layers/plastic.tsx | 13 ++++++++++--- 2 files changed, 34 insertions(+), 4 deletions(-) diff --git a/src/data/layers/oil.tsx b/src/data/layers/oil.tsx index 2fbbb29..a50658f 100644 --- a/src/data/layers/oil.tsx +++ b/src/data/layers/oil.tsx @@ -246,7 +246,12 @@ const layer = createLayer(id, function (this: BaseLayer) { .mul(activeHeavy.value) .mul(Decimal.add(activeHeavy2.value, 1)) .mul(activeExtractor.value) - .mul(depth.value) + .mul( + Decimal.pow( + depth.value, + management.elfTraining.oilElfTraining.milestones[0].earned.value ? 1.2 : 1 + ) + ) .div(1e5) ); const buildPump = createBuyable(() => ({ @@ -752,6 +757,16 @@ const layer = createLayer(id, function (this: BaseLayer) { description: "Guide to drilling", enabled: paper.upgrades.drillingUpgrade.bought })), + createMultiplicativeModifier(() => ({ + multiplier: () => Decimal.add(totalOil.value, 1).log10().add(1), + description: "Cocoa Level 2", + enabled: management.elfTraining.oilElfTraining.milestones[1].earned + })), + createMultiplicativeModifier(() => ({ + multiplier: 2, + description: "Cocoa Level 3", + enabled: management.elfTraining.oilElfTraining.milestones[2].earned + })), createMultiplicativeModifier(() => ({ multiplier: () => coalEffectiveness.value, description: "Effectiveness", @@ -810,6 +825,11 @@ const layer = createLayer(id, function (this: BaseLayer) { multiplier: () => Decimal.add(buildHeavy2.amount.value, 1).sqrt(), description: "Faith Level 4", enabled: management.elfTraining.bonfireElfTraining.milestones[3].earned + })), + createMultiplicativeModifier(() => ({ + multiplier: 2, + description: "Cocoa Level 3", + enabled: management.elfTraining.oilElfTraining.milestones[2].earned })) ]) as WithRequired; const computedOilSpeed = computed(() => oilSpeed.apply(0)); @@ -1023,6 +1043,9 @@ const layer = createLayer(id, function (this: BaseLayer) { if (oilMilestones[1].earned.value) { upgrades.push(row2Upgrades); } + if (management.elfTraining.oilElfTraining.milestones[4].earned.value) { + upgrades.push(row3Upgrades); + } return ( <> {render(trackerDisplay)} diff --git a/src/data/layers/plastic.tsx b/src/data/layers/plastic.tsx index c8b7121..de55ba3 100644 --- a/src/data/layers/plastic.tsx +++ b/src/data/layers/plastic.tsx @@ -27,7 +27,7 @@ import { import { noPersist, persistent } from "game/persistence"; import Decimal, { DecimalSource, format, formatWhole } from "util/bignum"; import { render, renderCol, renderRow } from "util/vue"; -import { computed, ref, unref } from "vue"; +import { computed, ComputedRef, ref, unref } from "vue"; import boxes from "./boxes"; import metal from "./metal"; import oil from "./oil"; @@ -63,7 +63,11 @@ const layer = createLayer(id, function (this: BaseLayer) { )); const activeRefinery = persistent(0); - const oilCost = computed(() => Decimal.times(activeRefinery.value, 100)); + const oilCost = computed(() => + Decimal.times(activeRefinery.value, 100).times( + management.elfTraining.oilElfTraining.milestones[3].earned.value ? 5 : 1 + ) + ) as ComputedRef; const buildRefinery = createBuyable(() => ({ resource: metal.metal, cost() { @@ -230,7 +234,10 @@ const layer = createLayer(id, function (this: BaseLayer) { const plasticGain = createSequentialModifier(() => [ createAdditiveModifier(() => ({ - addend: activeRefinery, + addend: () => + management.elfTraining.oilElfTraining.milestones[3].earned.value + ? Decimal.times(activeRefinery.value, 5) + : activeRefinery.value, description: "Oil Refinery", enabled: () => Decimal.gt(activeRefinery.value, 0) })), From 46918a6719bdb677196d34646d1cd31494c6115e Mon Sep 17 00:00:00 2001 From: thepaperpilot Date: Tue, 13 Dec 2022 23:55:28 -0600 Subject: [PATCH 28/48] Implement Frost lv1-4 --- src/data/layers/management.tsx | 28 ++++++++++++++++++++---- src/data/layers/metal.tsx | 2 +- src/data/layers/oil.tsx | 40 +++++++++++++++++++++++++++++----- 3 files changed, 59 insertions(+), 11 deletions(-) diff --git a/src/data/layers/management.tsx b/src/data/layers/management.tsx index b6deac2..a459949 100644 --- a/src/data/layers/management.tsx +++ b/src/data/layers/management.tsx @@ -962,7 +962,7 @@ const layer = createLayer(id, () => { createMilestone(() => ({ display: { requirement: "Frosty Level 2", - effectDisplay: "Oil pumps are cheaper" + effectDisplay: "Oil pumps are 10x cheaper" }, visibility: () => showIf(heavyDrillElfMilestones[0].earned.value), shouldEarn: () => heavyDrillElfTraining.level.value >= 2 @@ -978,7 +978,11 @@ const layer = createLayer(id, () => { createMilestone(() => ({ display: { requirement: "Frosty Level 4", - effectDisplay: "Heavy drill's ln is now log2.5" + effectDisplay: jsx(() => ( + <> + Heavy drill drill's ln is now log2.5 + + )) }, visibility: () => showIf(heavyDrillElfMilestones[2].earned.value && main.day.value >= 13), @@ -1042,8 +1046,24 @@ const layer = createLayer(id, () => { const kilnElfTraining = createElfTraining(elves.elves.kilnElf, kilnElfMilestones); const fireElfTraining = [smallfireElfTraining, bonfireElfTraining, kilnElfTraining]; - const paperElfTraining = createElfTraining(elves.elves.paperElf, paperElfMilestones); - const boxElfTraining = createElfTraining(elves.elves.boxElf, boxElfMilestones); + const paperElfTraining = createElfTraining( + elves.elves.paperElf, + paperElfMilestones, + createMultiplicativeModifier(() => ({ + multiplier: () => Decimal.add(oil.oil.value, 1).log10(), + description: "Frosty Level 1", + enabled: heavyDrillElfMilestones[0].earned + })) + ); + const boxElfTraining = createElfTraining( + elves.elves.boxElf, + boxElfMilestones, + createMultiplicativeModifier(() => ({ + multiplier: () => Decimal.add(oil.oil.value, 1).log10(), + description: "Frosty Level 1", + enabled: heavyDrillElfMilestones[0].earned + })) + ); const clothElfTraining = createElfTraining(elves.elves.clothElf, clothElfMilestones); const plasticElfTraining = [paperElfTraining, boxElfTraining, clothElfTraining]; const coalDrillElfTraining = createElfTraining( diff --git a/src/data/layers/metal.tsx b/src/data/layers/metal.tsx index e82f2f2..2fa0d73 100644 --- a/src/data/layers/metal.tsx +++ b/src/data/layers/metal.tsx @@ -179,7 +179,7 @@ const layer = createLayer(id, function (this: BaseLayer) { })), createMultiplicativeModifier(() => ({ multiplier: () => - Decimal.add(oil.activeBurner.value, 1).mul(oil.oilEffectiveness.value), + Decimal.add(oil.effectiveBurners.value, 1).mul(oil.oilEffectiveness.value), description: "Blaster Burner", enabled: oil.row2Upgrades[2].bought })), diff --git a/src/data/layers/oil.tsx b/src/data/layers/oil.tsx index a50658f..a2013a2 100644 --- a/src/data/layers/oil.tsx +++ b/src/data/layers/oil.tsx @@ -144,7 +144,15 @@ const layer = createLayer(id, function (this: BaseLayer) { active: activeHeavy }); const activeHeavy2 = persistent(0); - const heavy2Power = computed(() => Decimal.add(activeHeavy2.value, Math.E).ln()); + const heavy2Power = computed(() => { + let power = Decimal.add(activeHeavy2.value, Math.E); + if (management.elfTraining.heavyDrillElfTraining.milestones[3].earned.value) { + power = power.log(2.5); + } else { + power = power.ln(); + } + return power; + }); const buildHeavy2 = createBuyable(() => ({ resource: metal.metal, cost() { @@ -158,7 +166,15 @@ const layer = createLayer(id, function (this: BaseLayer) {
Attach extra drills to Heavy Drills to make them faster
- Raise amount of effective Heavy Drills by ^ln(Heavy Drill Drill amount + e). + Raise amount of effective Heavy Drills by ^ + {management.elfTraining.heavyDrillElfTraining.milestones[3].earned.value ? ( + <> + log2.5 + + ) : ( + <>ln + )} + (Heavy Drill Drill amount + e).
(also affects coal consumption).
@@ -260,8 +276,12 @@ const layer = createLayer(id, function (this: BaseLayer) { let v = new Decimal(this.amount.value); v = Decimal.pow(0.95, paper.books.oilBook.totalAmount.value).times(v); let price = Decimal.pow(16, v).times(2e6); - if (row2Upgrades[4].bought.value) + if (row2Upgrades[4].bought.value) { price = price.div(Decimal.add(totalOil.value, 1).root(6)); + } + if (management.elfTraining.heavyDrillElfTraining.milestones[1].earned.value) { + price = price.div(10); + } return price; }, display: jsx(() => ( @@ -301,9 +321,16 @@ const layer = createLayer(id, function (this: BaseLayer) { }); const activeBurner = persistent(0); - const burnerOil = computed(() => Decimal.pow(activeBurner.value, 2)); - const burnerCoal = computed(() => Decimal.pow(activeBurner.value, 3).mul(1e19)); - const burnerMetal = computed(() => Decimal.add(activeBurner.value, 1)); + const effectiveBurners = computed(() => { + let burners = activeBurner.value; + if (management.elfTraining.heavyDrillElfTraining.milestones[2].earned.value) { + burners = Decimal.pow(burners, 1.5); + } + return burners; + }); + const burnerOil = computed(() => Decimal.pow(effectiveBurners.value, 2)); + const burnerCoal = computed(() => Decimal.pow(effectiveBurners.value, 3).mul(1e19)); + const burnerMetal = computed(() => Decimal.add(effectiveBurners.value, 1)); const buildBurner = createBuyable(() => ({ resource: noPersist(oil), cost() { @@ -1011,6 +1038,7 @@ const layer = createLayer(id, function (this: BaseLayer) { activePump, buildPump, activeBurner, + effectiveBurners, buildBurner, activeSmelter, buildSmelter, From 285da2744fd4cc42e3ebde5e17b79adbad4c2e6e Mon Sep 17 00:00:00 2001 From: thepaperpilot Date: Tue, 13 Dec 2022 23:59:18 -0600 Subject: [PATCH 29/48] Enabled day 13 --- src/data/projEntry.tsx | 53 +++++++++++++++++++++--------------------- 1 file changed, 27 insertions(+), 26 deletions(-) diff --git a/src/data/projEntry.tsx b/src/data/projEntry.tsx index a66fb51..2cf2ed4 100644 --- a/src/data/projEntry.tsx +++ b/src/data/projEntry.tsx @@ -8,7 +8,7 @@ import { } from "features/feature"; import { BaseLayer, createLayer, GenericLayer, layers } from "game/layers"; import { persistent } from "game/persistence"; -import type { LayerData, PlayerData } from "game/player"; +import type { PlayerData } from "game/player"; import player from "game/player"; import { format, formatTime } from "util/bignum"; import { Computable, convertComputable, ProcessedComputable } from "util/computed"; @@ -18,32 +18,33 @@ import type { Ref } from "vue"; import { computed, ref, unref } from "vue"; import "./advent.css"; import Day from "./Day.vue"; +import boxes from "./layers/boxes"; +import cloth from "./layers/cloth"; +import coal from "./layers/coal"; +import dyes from "./layers/dyes"; +import elves from "./layers/elves"; +import management from "./layers/management"; +import metal from "./layers/metal"; +import oil from "./layers/oil"; +import paper from "./layers/paper"; +import plastic from "./layers/plastic"; import trees from "./layers/trees"; import workshop from "./layers/workshop"; -import treeSymbol from "./symbols/tree.png"; -import workshopSymbol from "./symbols/sws.png"; -import coalSymbol from "./symbols/coal.png"; -import elfSymbol from "./symbols/elf.png"; -import paperSymbol from "./symbols/paperStacks.png"; -import boxesSymbol from "./symbols/cardboardBox.png"; -import metalSymbol from "./symbols/metal.png"; -import clothSymbol from "./symbols/cloth.png"; -import oilSymbol from "./symbols/oil.png"; -import plasticSymbol from "./symbols/plastic.png"; -import dyesSymbol from "./symbols/dyes.png"; -import managementSymbol from "./symbols/elfManagement.png"; -import wrappingPaperSymbol from "./symbols/wrappingPaper.png"; -import coal from "./layers/coal"; -import elves from "./layers/elves"; -import paper from "./layers/paper"; -import boxes from "./layers/boxes"; -import metal from "./layers/metal"; -import cloth from "./layers/cloth"; -import oil from "./layers/oil"; -import plastic from "./layers/plastic"; -import dyes from "./layers/dyes"; -import management from "./layers/management"; import wrappingPaper from "./layers/wrapping-paper"; +import boxesSymbol from "./symbols/cardboardBox.png"; +import clothSymbol from "./symbols/cloth.png"; +import coalSymbol from "./symbols/coal.png"; +import dyesSymbol from "./symbols/dyes.png"; +import elfSymbol from "./symbols/elf.png"; +import managementSymbol from "./symbols/elfManagement.png"; +import metalSymbol from "./symbols/metal.png"; +import oilSymbol from "./symbols/oil.png"; +import paperSymbol from "./symbols/paperStacks.png"; +import plasticSymbol from "./symbols/plastic.png"; +import workshopSymbol from "./symbols/sws.png"; +import treeSymbol from "./symbols/tree.png"; +import advManagementSymbol from "./symbols/workshopMansion.png"; +import wrappingPaperSymbol from "./symbols/wrappingPaper.png"; export interface Day extends VueFeature { day: number; @@ -272,8 +273,8 @@ export const main = createLayer("main", function (this: BaseLayer) { createDay(() => ({ day: 13, shouldNotify: false, - layer: null, // "management" (advanced) - symbol: "", + layer: "management", + symbol: advManagementSymbol, story: "So after a good night's rest you decide that maybe making these elves able to do all the work for you isn't something to be scared of, but rather encouraged. Let's spend another day continuing to train them up and really get this place spinning. They are Santa's elves after all, they're supposed to be able to run everything without you!", completedStory: "The elves are doing an incredible job, and Santa does not seem keen on firing you - Score! Now you can get to work on guiding this properly trained highly functional group of hard workers to make Christmas as great as possible. Good Job!" From 363f4f34421ee8cb0de9ab35d776cbbba30549ea Mon Sep 17 00:00:00 2001 From: thepaperpilot Date: Wed, 14 Dec 2022 00:08:04 -0600 Subject: [PATCH 30/48] Tweak elf xp bar display --- src/data/layers/management.tsx | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/src/data/layers/management.tsx b/src/data/layers/management.tsx index a459949..b498b57 100644 --- a/src/data/layers/management.tsx +++ b/src/data/layers/management.tsx @@ -183,7 +183,10 @@ const layer = createLayer(id, () => { : "" }), baseStyle: "margin-top: 0", - fillStyle: "margin-top: 0; transition-duration: 0s", + fillStyle: () => + focusTargets.value[elf.name] + ? "margin-top: 0; transition-duration: 0s;" + : "margin-top: 0; transition-duration: 0s; background-color: var(--bought)", borderStyle: () => Decimal.gte(level.value, schools.amount.value) ? "border-color: red" : "", progress: () => Decimal.div(expToNextLevel.value, expRequiredForNextLevel.value), @@ -239,7 +242,7 @@ const layer = createLayer(id, () => { }, style: () => ({ width: "190px", - background: currentShown.value == elf.name ? "var(--foreground)" : "" + background: currentShown.value == elf.name ? "var(--accent2)" : "" }), onClick() { currentShown.value = elf.name; From 41aec013dfd687075d8c6bab16b9a3ed1e6a1295 Mon Sep 17 00:00:00 2001 From: thepaperpilot Date: Wed, 14 Dec 2022 01:50:01 -0600 Subject: [PATCH 31/48] Balance/bug pass --- src/data/layers/elves.tsx | 11 +++--- src/data/layers/management.tsx | 62 +++++++++++++++++++++++----------- src/data/layers/oil.tsx | 12 +++++-- src/data/layers/paper.tsx | 4 +-- src/data/layers/plastic.tsx | 2 +- src/data/layers/trees.tsx | 36 ++++++++++---------- src/data/layers/workshop.tsx | 10 ++++-- 7 files changed, 86 insertions(+), 51 deletions(-) diff --git a/src/data/layers/elves.tsx b/src/data/layers/elves.tsx index f853732..24c0c5b 100644 --- a/src/data/layers/elves.tsx +++ b/src/data/layers/elves.tsx @@ -531,6 +531,9 @@ const layer = createLayer(id, function (this: BaseLayer) { if (Decimal.gte(totalElves.value, 9)) { cost = Decimal.times(cost, 1e15); } + if (Decimal.gte(totalElves.value, 12)) { + cost = Decimal.times(cost, 1e18); + } return cost; }); @@ -808,10 +811,10 @@ const layer = createLayer(id, function (this: BaseLayer) { 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); + } else if (buyable === oil.buildHeavy2) { + oil.activeHeavy2.value = Decimal.add(oil.activeHeavy2.value, 1); + } else if (buyable === oil.buildExtractor) { + oil.activeExtractor.value = Decimal.add(oil.activeExtractor.value, 1); } } } diff --git a/src/data/layers/management.tsx b/src/data/layers/management.tsx index b498b57..d4d471b 100644 --- a/src/data/layers/management.tsx +++ b/src/data/layers/management.tsx @@ -1,11 +1,10 @@ import Spacer from "components/layout/Spacer.vue"; -import Fraction from "components/math/Fraction.vue"; import Sqrt from "components/math/Sqrt.vue"; import Modal from "components/Modal.vue"; import { createCollapsibleMilestones, createCollapsibleModifierSections } from "data/common"; import { main } from "data/projEntry"; import { createBar, GenericBar } from "features/bars/bar"; -import { createBuyable } from "features/buyable"; +import { createBuyable, GenericBuyable } from "features/buyable"; import { createClickable } from "features/clickables/clickable"; import { jsx, showIf, Visibility } from "features/feature"; import { createMilestone, GenericMilestone } from "features/milestones/milestone"; @@ -21,7 +20,6 @@ import { import { persistent } from "game/persistence"; import Decimal, { DecimalSource, format, formatTime, formatWhole } from "util/bignum"; import { Direction, WithRequired } from "util/common"; -import { ProcessedComputable } from "util/computed"; import { render, renderCol, renderGrid } from "util/vue"; import { computed, ComputedRef, ref, Ref, unref, watchEffect } from "vue"; import boxes from "./boxes"; @@ -30,10 +28,10 @@ import coal from "./coal"; import dyes from "./dyes"; import elves from "./elves"; import metal from "./metal"; +import oil from "./oil"; import paper from "./paper"; import plastic from "./plastic"; import trees from "./trees"; -import oil from "./oil"; const id = "management"; const day = 12; const advancedDay = 13; @@ -112,12 +110,29 @@ const layer = createLayer(id, () => { style: "width: 150px", cost: 1e13 })); + const advancedUpgrade = createUpgrade(() => ({ + display: { + title: "Advanced Training", + description: + "Time for some advanced training! Now that all the elves know the basics, you have a foundation you can truly build off of. Everyone seems to be learning 10x as quickly!" + }, + visibility: () => + showIf(main.day.value >= advancedDay && main.days[advancedDay - 1].opened.value), + resource: boxes.boxes, + style: "width: 150px", + cost: 1e26 + })); const globalXPModifier = createSequentialModifier(() => [ createMultiplicativeModifier(() => ({ multiplier: classroomEffect, description: "Classroom Effect", enabled: classroomUpgrade.bought })), + createMultiplicativeModifier(() => ({ + multiplier: 10, + description: "Advanced Training", + enabled: advancedUpgrade.bought + })), createMultiplicativeModifier(() => ({ multiplier: 2, description: "Carry experience in boxes???", @@ -133,7 +148,7 @@ const layer = createLayer(id, () => { name: string; computedAutoBuyCooldown: ComputedRef; amountOfTimesDone: Ref; - visibility: ProcessedComputable; + bought: Ref; }, milestones: Array, ...modifiers: Modifier[] @@ -250,7 +265,7 @@ const layer = createLayer(id, () => { canClick() { return currentShown.value !== elf.name; }, - visibility: elf.visibility, + visibility: () => showIf(elf.bought.value), name: elf.name, state, displayMilestone, @@ -312,7 +327,7 @@ const layer = createLayer(id, () => { createMilestone(() => ({ display: { requirement: "Holly Level 5", - effectDisplay: "Raise workshop expansion cost by 0.95" + effectDisplay: "Raise workshop expansion cost by 0.99" }, visibility: () => showIf(cutterElfMilestones[3].earned.value && main.day.value >= 13), shouldEarn: () => cutterElfTraining.level.value >= 5 @@ -551,7 +566,7 @@ const layer = createLayer(id, () => { }, visibility: () => showIf(fertilizerElfMilestones[3].earned.value && main.day.value >= 13), - shouldEarn: () => heatedPlanterElfTraining.level.value >= 5 + shouldEarn: () => fertilizerElfTraining.level.value >= 5 })) ] as Array; const smallfireElfMilestones = [ @@ -1213,7 +1228,7 @@ const layer = createLayer(id, () => { const focusMeter = createBar(() => ({ direction: Direction.Right, width: 566, - height: 25, + height: 50, style: `border-radius: 4px 4px 0 0`, borderStyle: `border-radius: 4px 4px 0 0`, fillStyle: () => ({ @@ -1344,7 +1359,10 @@ const layer = createLayer(id, () => { const schoolCost = computed(() => { const schoolFactor = Decimal.pow(10, schools.amount.value); const nerfedSchoolFactor = Decimal.pow(5, schools.amount.value); - const woodFactor = Decimal.pow(2e4, Decimal.pow(schools.amount.value, 0.75)); + let woodFactor = Decimal.pow(2e4, Decimal.pow(schools.amount.value, 0.75)); + if (Decimal.gte(schools.amount.value, 4)) { + woodFactor = woodFactor.div(1e3); + } const coalFactor = Decimal.pow(2000, schools.amount.value); return { wood: woodFactor.mul(1e21), @@ -1370,14 +1388,17 @@ const layer = createLayer(id, () => { 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)}{" "} - coal, {format(schoolCost.value.paper)} paper, {format(schoolCost.value.boxes)}{" "} - boxes, {format(schoolCost.value.metalIngots)} metal ingots,{" "} - {format(schoolCost.value.cloth)} cloth, {format(schoolCost.value.plastic)}{" "} - plastic, and requires {format(schoolCost.value.dye)} of red, yellow, and blue - dye -
+ {Decimal.lt(schools.amount.value, unref(schools.purchaseLimit)) ? ( +
+ Costs {format(schoolCost.value.wood)} logs, {format(schoolCost.value.coal)}{" "} + coal, {format(schoolCost.value.paper)} paper,{" "} + {format(schoolCost.value.boxes)} boxes,{" "} + {format(schoolCost.value.metalIngots)} metal ingots,{" "} + {format(schoolCost.value.cloth)} cloth, {format(schoolCost.value.plastic)}{" "} + plastic, and requires {format(schoolCost.value.dye)} of red, yellow, and + blue dye +
+ ) : null} )), canPurchase(): boolean { @@ -1411,7 +1432,7 @@ const layer = createLayer(id, () => { }, visibility: computed(() => showIf(teaching.bought.value)), style: "width: 600px" - })); + })) as GenericBuyable; const classroomCost = computed(() => { const classroomFactor = Decimal.add(classrooms.amount.value, 1).pow(1.5); @@ -1606,6 +1627,7 @@ const layer = createLayer(id, () => { schools, classrooms, classroomUpgrade, + advancedUpgrade, focusMultiplier: focusMulti, upgrades, @@ -1633,7 +1655,7 @@ const layer = createLayer(id, () => { {render(dayProgress)}
{renderCol(schools, classrooms)} - {renderGrid([teaching, classroomUpgrade])} + {renderGrid([teaching, classroomUpgrade, advancedUpgrade])} {Decimal.gt(schools.amount.value, 0) ? ( <> diff --git a/src/data/layers/oil.tsx b/src/data/layers/oil.tsx index a2013a2..e8d4ffc 100644 --- a/src/data/layers/oil.tsx +++ b/src/data/layers/oil.tsx @@ -32,7 +32,7 @@ import { globalBus } from "game/events"; import coal from "./coal"; import { createUpgrade, GenericUpgrade } from "features/upgrades/upgrade"; import { createMilestone, GenericMilestone } from "features/milestones/milestone"; -import { formatGain } from "util/bignum"; +import { formatGain, formatSmall } from "util/bignum"; import plastic from "./plastic"; import paper from "./paper"; import dyes from "./dyes"; @@ -100,6 +100,7 @@ const layer = createLayer(id, function (this: BaseLayer) { resource: metal.metal, cost() { let v = new Decimal(this.amount.value); + if (Decimal.gte(v, 100)) v = Decimal.pow(v, 4).div(100); v = Decimal.pow(0.95, paper.books.heavyDrillBook.totalAmount.value).times(v); return Decimal.pow(1.3, v).times(2.5e4); }, @@ -157,6 +158,7 @@ const layer = createLayer(id, function (this: BaseLayer) { resource: metal.metal, cost() { let v = new Decimal(this.amount.value); + if (Decimal.gte(v, 50)) v = Decimal.pow(v, 4).div(50); v = Decimal.pow(0.95, paper.books.heavyDrillBook.totalAmount.value).times(v); return Decimal.pow(2, v).times(1e5); }, @@ -212,6 +214,7 @@ const layer = createLayer(id, function (this: BaseLayer) { resource: metal.metal, cost() { let v = new Decimal(this.amount.value); + if (Decimal.gte(v, 100)) v = Decimal.pow(v, 4).div(100); v = Decimal.pow(0.95, paper.books.heavyDrillBook.totalAmount.value).times(v); return Decimal.pow(8, v).times(2e5); }, @@ -225,7 +228,7 @@ const layer = createLayer(id, function (this: BaseLayer) {

Currently: -
×{format(extractorPower.value)} drill power +
×{formatSmall(extractorPower.value)} drill power
×{format(extractorCoal.value)} coal/sec
×{format(extractorOre.value)} ore/sec
@@ -274,6 +277,7 @@ const layer = createLayer(id, function (this: BaseLayer) { resource: metal.metal, cost() { let v = new Decimal(this.amount.value); + if (Decimal.gte(v, 100)) v = Decimal.pow(v, 4).div(100); v = Decimal.pow(0.95, paper.books.oilBook.totalAmount.value).times(v); let price = Decimal.pow(16, v).times(2e6); if (row2Upgrades[4].bought.value) { @@ -335,6 +339,7 @@ const layer = createLayer(id, function (this: BaseLayer) { resource: noPersist(oil), cost() { let v = new Decimal(this.amount.value); + if (Decimal.gte(v, 100)) v = Decimal.pow(v, 4).div(100); v = Decimal.pow(0.95, paper.books.oilBook.totalAmount.value).times(v); return Decimal.pow(2, v).times(50); }, @@ -388,6 +393,9 @@ const layer = createLayer(id, function (this: BaseLayer) { resource: metal.metal, cost() { let v = new Decimal(this.amount.value); + if (Decimal.gte(v, 50)) v = Decimal.pow(v, 2).div(50); + if (Decimal.gte(v, 200)) v = Decimal.pow(v, 2).div(200); + if (Decimal.gte(v, 1e4)) v = Decimal.pow(v, 2).div(1e4); v = Decimal.pow(0.95, paper.books.oilBook.totalAmount.value).times(v); let price = Decimal.pow(10, v).times(1e7); if (row2Upgrades[4].bought.value) diff --git a/src/data/layers/paper.tsx b/src/data/layers/paper.tsx index 88430b0..b6e8ac7 100644 --- a/src/data/layers/paper.tsx +++ b/src/data/layers/paper.tsx @@ -17,7 +17,7 @@ import { globalBus } from "game/events"; import { BaseLayer, createLayer } from "game/layers"; import { createMultiplicativeModifier, createSequentialModifier, Modifier } from "game/modifiers"; import { noPersist } from "game/persistence"; -import Decimal, { DecimalSource, format, formatWhole } from "util/bignum"; +import Decimal, { DecimalSource, format, formatSmall, formatWhole } from "util/bignum"; import { WithRequired } from "util/common"; import { render, renderCol, renderRow } from "util/vue"; import { computed, ComputedRef, ref, unref } from "vue"; @@ -104,7 +104,7 @@ const layer = createLayer(id, function (this: BaseLayer) { description: `Print a copy of "${options.name}", which ${options.elfName} will use to improve their skills! Each copy printed will reduce the "${options.buyableName}" price scaling by 0.95x and make ${options.elfName} purchase +10% faster!`, effectDisplay: jsx(() => ( <> - {format(Decimal.pow(0.95, buyable.totalAmount.value))}x price scaling,{" "} + {formatSmall(Decimal.pow(0.95, buyable.totalAmount.value))}x price scaling,{" "} {format(Decimal.div(buyable.totalAmount.value, 10).add(1))}x auto-purchase speed diff --git a/src/data/layers/plastic.tsx b/src/data/layers/plastic.tsx index de55ba3..906dba8 100644 --- a/src/data/layers/plastic.tsx +++ b/src/data/layers/plastic.tsx @@ -278,7 +278,7 @@ const layer = createLayer(id, function (this: BaseLayer) { enabled: workshop.milestones.extraExpansionMilestone4.earned })), createMultiplicativeModifier(() => ({ - multiplier: () => Decimal.add(oil.buildExtractor.amount.value, 1).sqrt(), + multiplier: () => Decimal.add(oil.buildExtractor.amount.value, 1), description: "Snowball Level 4", enabled: management.elfTraining.kilnElfTraining.milestones[3].earned })) diff --git a/src/data/layers/trees.tsx b/src/data/layers/trees.tsx index 19e76bb..4c932fd 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, watch } from "vue"; +import { computed, ref } from "vue"; import boxes from "./boxes"; import cloth from "./cloth"; import coal from "./coal"; @@ -54,6 +54,9 @@ const layer = createLayer(id, function (this: BaseLayer) { const ema = ref(0); + const lastAutoCuttingAmount = ref(0); + const lastAutoPlantedAmount = ref(0); + const totalTrees = createSequentialModifier(() => [ createAdditiveModifier(() => ({ addend: () => Decimal.times(expandingForestBuyable.amount.value, 10), @@ -326,20 +329,12 @@ const layer = createLayer(id, function (this: BaseLayer) { })), createAdditiveModifier(() => ({ addend: () => - Decimal.sub(lastAutoCuttingAmount.value, lastAutoPlantedAmount.value).max(0), + Decimal.sub(lastAutoPlantedAmount.value, lastAutoCuttingAmount.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); - setInterval( - () => - watch(computedAutoCuttingAmount, cut => { - lastAutoCuttingAmount.value = cut; - }), - 0 - ); const manualPlantingAmount = createSequentialModifier(() => [ createAdditiveModifier(() => ({ @@ -421,20 +416,12 @@ const layer = createLayer(id, function (this: BaseLayer) { })), createAdditiveModifier(() => ({ addend: () => - Decimal.sub(lastAutoPlantedAmount.value, lastAutoCuttingAmount.value).max(0), + Decimal.sub(lastAutoCuttingAmount.value, lastAutoPlantedAmount.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); - setInterval( - () => - watch(computedAutoPlantingAmount, planted => { - lastAutoPlantedAmount.value = planted; - }), - 0 - ); const logGain = createSequentialModifier(() => [ createMultiplicativeModifier(() => ({ @@ -711,6 +698,17 @@ const layer = createLayer(id, function (this: BaseLayer) { } } + const plantingAmount = Decimal.sub( + computedAutoPlantingAmount.value, + Decimal.sub(lastAutoCuttingAmount.value, lastAutoPlantedAmount.value).max(0) + ); + const cuttingAmount = Decimal.sub( + computedAutoCuttingAmount.value, + Decimal.sub(lastAutoPlantedAmount.value, lastAutoCuttingAmount.value).max(0) + ); + lastAutoPlantedAmount.value = plantingAmount; + lastAutoCuttingAmount.value = cuttingAmount; + const amountCut = Decimal.min( trees.value, Decimal.times(computedAutoCuttingAmount.value, diff) diff --git a/src/data/layers/workshop.tsx b/src/data/layers/workshop.tsx index bc73932..17b66c9 100644 --- a/src/data/layers/workshop.tsx +++ b/src/data/layers/workshop.tsx @@ -17,7 +17,11 @@ import { createHotkey } from "features/hotkey"; import { createMilestone } from "features/milestones/milestone"; import { createResource, displayResource } from "features/resources/resource"; import { BaseLayer, createLayer } from "game/layers"; -import { createExponentialModifier, createMultiplicativeModifier, createSequentialModifier } from "game/modifiers"; +import { + createExponentialModifier, + createMultiplicativeModifier, + createSequentialModifier +} from "game/modifiers"; import { noPersist } from "game/persistence"; import Decimal, { DecimalSource, format, formatWhole } from "util/bignum"; import { Direction } from "util/common"; @@ -54,10 +58,10 @@ const layer = createLayer(id, function (this: BaseLayer) { createMultiplicativeModifier(() => ({ multiplier: computed(() => wrappingPaper.boosts.beach1.value), description: "Beach Wrapping Paper", - enabled: computed(() => Decimal.gt(wrappingPaper.boosts.beach1.value,1)) + enabled: computed(() => Decimal.gt(wrappingPaper.boosts.beach1.value, 1)) })), createExponentialModifier(() => ({ - exponent: 0.95, // Needs fixing + exponent: 1 / 0.99, description: "Holly Level 5", enabled: management.elfTraining.cutterElfTraining.milestones[4].earned })) From eb7bd1d13a0ae3ffc26e7dfc85203478051ff891 Mon Sep 17 00:00:00 2001 From: ducdat0507 <62660527+ducdat0507@users.noreply.github.com> Date: Wed, 14 Dec 2022 15:42:28 +0700 Subject: [PATCH 32/48] Make the focus highlight more visible --- src/data/layers/management.tsx | 26 +++++++++++----- src/data/layers/styles/management.css | 21 +++++++++++++ src/features/bars/Bar.vue | 44 +++++++++++++++------------ 3 files changed, 64 insertions(+), 27 deletions(-) create mode 100644 src/data/layers/styles/management.css diff --git a/src/data/layers/management.tsx b/src/data/layers/management.tsx index b498b57..6037c76 100644 --- a/src/data/layers/management.tsx +++ b/src/data/layers/management.tsx @@ -34,6 +34,9 @@ import paper from "./paper"; import plastic from "./plastic"; import trees from "./trees"; import oil from "./oil"; + +import "./styles/management.css"; + const id = "management"; const day = 12; const advancedDay = 13; @@ -175,18 +178,24 @@ const layer = createLayer(id, () => { const bar = createBar(() => ({ direction: Direction.Right, width: 160, - height: 12, + height: 14, style: () => ({ "margin-top": "8px", - "box-shadow": focusTargets.value[elf.name] - ? "0 0 12px " + (currentShown.value == elf.name ? "black" : "white") + "background": color, + "box-shadow": + currentShown.value == elf.name ? "0 0 12px black" + : focusTargets.value[elf.name] ? "0 0 12px white" : "" }), - baseStyle: "margin-top: 0", - fillStyle: () => - focusTargets.value[elf.name] - ? "margin-top: 0; transition-duration: 0s;" - : "margin-top: 0; transition-duration: 0s; background-color: var(--bought)", + baseStyle: "margin-top: -1px", + fillStyle: () => ({ + "margin-top": "-1px", + "transition-duration": "0s", + "background": "white", + "animation": focusTargets.value[elf.name] + ? ".5s focused-xp-bar linear infinite" + : "", + }), borderStyle: () => Decimal.gte(level.value, schools.amount.value) ? "border-color: red" : "", progress: () => Decimal.div(expToNextLevel.value, expRequiredForNextLevel.value), @@ -1218,6 +1227,7 @@ const layer = createLayer(id, () => { borderStyle: `border-radius: 4px 4px 0 0`, fillStyle: () => ({ background: focusTime.value > 0 ? color : "#7f7f00", + animation: focusTime.value > 0 ? "1s focused-focus-bar linear infinite" : "", opacity: focusTime.value > 0 ? focusTime.value / 10 : 1, transition: "none" }), diff --git a/src/data/layers/styles/management.css b/src/data/layers/styles/management.css new file mode 100644 index 0000000..6ec7422 --- /dev/null +++ b/src/data/layers/styles/management.css @@ -0,0 +1,21 @@ +@keyframes focused-focus-bar { + from { + background: 0 0 / 28px 28px repeat + repeating-linear-gradient(-45deg, red, red 10px, green 10px, green 20px); + } + to { + background: 28px 0px / 28px 28px repeat + repeating-linear-gradient(-45deg, red, red 10px, green 10px, green 20px); + } +} + +@keyframes focused-xp-bar { + from { + background: 0 0 / 28px 28px repeat + repeating-linear-gradient(-45deg, yellow, yellow 10px, lime 10px, lime 20px); + } + to { + background: 28px 0px / 28px 28px repeat + repeating-linear-gradient(-45deg, yellow, yellow 10px, lime 10px, lime 20px); + } +} diff --git a/src/features/bars/Bar.vue b/src/features/bars/Bar.vue index 3a7a71f..4a48293 100644 --- a/src/features/bars/Bar.vue +++ b/src/features/bars/Bar.vue @@ -14,17 +14,6 @@ ...unref(classes) }" > -
- - - -
+
+ + + +
@@ -109,21 +109,21 @@ export default defineComponent({ }; switch (unref(direction)) { case Direction.Up: - barStyle.clipPath = `inset(${normalizedProgress.value}% -2px -2px -2px)`; - barStyle.width = unwrapRef(width) + 2 + "px"; + barStyle.clipPath = `inset(${normalizedProgress.value}% -1px -1px -1px)`; + barStyle.width = unwrapRef(width) + 1 + "px"; break; case Direction.Down: - barStyle.clipPath = `inset(-2px -2px ${normalizedProgress.value}% -2px)`; - barStyle.width = unwrapRef(width) + 2 + "px"; + barStyle.clipPath = `inset(-1px -1px ${normalizedProgress.value}% -1px)`; + barStyle.width = unwrapRef(width) + 1 + "px"; break; case Direction.Right: - barStyle.clipPath = `inset(-2px ${normalizedProgress.value}% -2px -2px)`; + barStyle.clipPath = `inset(-1px ${normalizedProgress.value}% -1px -1px)`; break; case Direction.Left: - barStyle.clipPath = `inset(-2px -2px -2px ${normalizedProgress.value} + '%)`; + barStyle.clipPath = `inset(-1px -1px -1px ${normalizedProgress.value} + '%)`; break; case Direction.Default: - barStyle.clipPath = "inset(-2px 50% -2px -2px)"; + barStyle.clipPath = "inset(-1px 50% -1px -1px)"; break; } return barStyle; @@ -148,10 +148,12 @@ export default defineComponent({ display: table; overflow: hidden; border-radius: 10px; + padding-bottom: 1px; } .overlayTextContainer { position: absolute; + top: 0; border-radius: 10px; vertical-align: middle; display: flex; @@ -168,13 +170,17 @@ export default defineComponent({ border-radius: 10px; border-color: var(--foreground); overflow: hidden; - margin: 0; +} + +.border:not(.overlayTextContainer) { + margin: -1px 0 -1px -1px; } .fill { position: absolute; background-color: var(--foreground); overflow: hidden; + padding: 2px 1px; margin-left: -0.5px; transition-duration: 0.2s; z-index: 2; From 8eac9490eed6bdbdc8badfe7e063f47fd30ceb67 Mon Sep 17 00:00:00 2001 From: ducdat0507 <62660527+ducdat0507@users.noreply.github.com> Date: Wed, 14 Dec 2022 16:01:56 +0700 Subject: [PATCH 33/48] Whoops --- src/features/bars/Bar.vue | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/features/bars/Bar.vue b/src/features/bars/Bar.vue index 4a48293..fc0530d 100644 --- a/src/features/bars/Bar.vue +++ b/src/features/bars/Bar.vue @@ -28,7 +28,7 @@
From 1ccdbeeadcbe3ef3e37a7b54ce203201e78b21cf Mon Sep 17 00:00:00 2001 From: ducdat0507 <62660527+ducdat0507@users.noreply.github.com> Date: Wed, 14 Dec 2022 19:55:32 +0700 Subject: [PATCH 34/48] (DISABLE AUTOSAVE BEFORE UPDATING) Rough max buy implementation --- src/data/layers/boxes.tsx | 77 +++++++++++++++++++++++++++++++++++- src/data/layers/cloth.tsx | 25 ++++++++++-- src/data/layers/coal.tsx | 83 +++++++++++++++++++++++++++++++++++---- src/data/layers/dyes.tsx | 18 ++++++++- src/data/layers/elves.tsx | 77 +++++++++++++++++++----------------- src/data/layers/metal.tsx | 40 +++++++++++++++++-- src/data/layers/oil.tsx | 58 ++++++++++++++++++++++++--- src/data/layers/paper.tsx | 26 +++++++++++- src/data/layers/trees.tsx | 37 +++++++++++++++-- 9 files changed, 377 insertions(+), 64 deletions(-) diff --git a/src/data/layers/boxes.tsx b/src/data/layers/boxes.tsx index 8a1f27c..34a5884 100644 --- a/src/data/layers/boxes.tsx +++ b/src/data/layers/boxes.tsx @@ -27,6 +27,7 @@ import { WithRequired } from "util/common"; import { render, renderGrid, renderRow } from "util/vue"; import { computed, ComputedRef, ref, unref } from "vue"; import dyes from "./dyes"; +import { ElfBuyable } from "./elves"; import management from "./management"; import paper from "./paper"; import plastic from "./plastic"; @@ -34,7 +35,7 @@ import trees from "./trees"; import workshop from "./workshop"; import wrappingPaper from "./wrapping-paper"; -export type BoxesBuyable = GenericBuyable & { +export type BoxesBuyable = ElfBuyable & { resource: Resource; freeLevels: ComputedRef; totalAmount: ComputedRef; @@ -231,6 +232,19 @@ const layer = createLayer(id, function (this: BaseLayer) { .div(dyes.boosts.orange2.value) .div(wrappingPaper.boosts.ocean1.value); }, + inverseCost(x: DecimalSource) { + let scaling = 3; + if (management.elfTraining.boxElfTraining.milestones[2].earned.value) { + scaling--; + } + + let v = Decimal.mul(x, wrappingPaper.boosts.ocean1.value) + .mul(dyes.boosts.orange2.value) + .div(100).log(scaling); + + v = v.div(Decimal.pow(0.95, paper.books.boxBook.totalAmount.value)); + return Decimal.isNaN(v) ? Decimal.dZero : v.floor().max(0); + }, visibility: () => showIf(logsUpgrade.bought.value), freeLevels: computed(() => management.elfTraining.boxElfTraining.milestones[0].earned.value @@ -275,6 +289,18 @@ const layer = createLayer(id, function (this: BaseLayer) { } return Decimal.pow(scaling, v).times(1000).div(dyes.boosts.orange2.value); }, + inverseCost(x: DecimalSource) { + let scaling = 5; + if (management.elfTraining.boxElfTraining.milestones[2].earned.value) { + scaling--; + } + + let v = Decimal.mul(x, dyes.boosts.orange2.value) + .div(1000).log(scaling); + + v = v.div(Decimal.pow(0.95, paper.books.boxBook.totalAmount.value)); + return Decimal.isNaN(v) ? Decimal.dZero : v.floor().max(0); + }, visibility: () => showIf(ashUpgrade.bought.value), freeLevels: computed(() => management.elfTraining.boxElfTraining.milestones[0].earned.value @@ -319,6 +345,18 @@ const layer = createLayer(id, function (this: BaseLayer) { } return Decimal.pow(scaling, v).times(1000).div(dyes.boosts.orange2.value); }, + inverseCost(x: DecimalSource) { + let scaling = 7; + if (management.elfTraining.boxElfTraining.milestones[2].earned.value) { + scaling--; + } + + let v = Decimal.mul(x, dyes.boosts.orange2.value) + .div(1000).log(scaling); + + v = v.div(Decimal.pow(0.95, paper.books.boxBook.totalAmount.value)); + return Decimal.isNaN(v) ? Decimal.dZero : v.floor().max(0); + }, visibility: () => showIf(coalUpgrade.bought.value), freeLevels: computed(() => management.elfTraining.boxElfTraining.milestones[0].earned.value @@ -367,6 +405,19 @@ const layer = createLayer(id, function (this: BaseLayer) { .div(dyes.boosts.orange2.value) .div(wrappingPaper.boosts.ocean1.value); }, + inverseCost(x: DecimalSource) { + let scaling = 10; + if (management.elfTraining.boxElfTraining.milestones[2].earned.value) { + scaling--; + } + + let v = Decimal.mul(x, wrappingPaper.boosts.ocean1.value) + .mul(dyes.boosts.orange2.value) + .div(1e25).log(scaling); + + v = v.div(Decimal.pow(0.95, paper.books.boxBook.totalAmount.value)); + return Decimal.isNaN(v) ? Decimal.dZero : v.floor().max(0); + }, visibility: () => showIf(management.elfTraining.boxElfTraining.milestones[3].earned.value), freeLevels: computed(() => management.elfTraining.boxElfTraining.milestones[0].earned.value @@ -411,6 +462,18 @@ const layer = createLayer(id, function (this: BaseLayer) { } return Decimal.pow(scaling, v).times(1e28).div(dyes.boosts.orange2.value); }, + inverseCost(x: DecimalSource) { + let scaling = 15; + if (management.elfTraining.boxElfTraining.milestones[2].earned.value) { + scaling--; + } + + let v = Decimal.mul(x, dyes.boosts.orange2.value) + .div(1e28).log(scaling); + + v = v.div(Decimal.pow(0.95, paper.books.boxBook.totalAmount.value)); + return Decimal.isNaN(v) ? Decimal.dZero : v.floor().max(0); + }, visibility: () => showIf(management.elfTraining.boxElfTraining.milestones[3].earned.value), freeLevels: computed(() => management.elfTraining.boxElfTraining.milestones[0].earned.value @@ -455,6 +518,18 @@ const layer = createLayer(id, function (this: BaseLayer) { } return Decimal.pow(scaling, v).times(1000).div(dyes.boosts.orange2.value); }, + inverseCost(x: DecimalSource) { + let scaling = 20; + if (management.elfTraining.boxElfTraining.milestones[2].earned.value) { + scaling--; + } + + let v = Decimal.mul(x, dyes.boosts.orange2.value) + .div(1000).log(scaling); + + v = v.div(Decimal.pow(0.95, paper.books.boxBook.totalAmount.value)); + return Decimal.isNaN(v) ? Decimal.dZero : v.floor().max(0); + }, visibility: () => showIf(management.elfTraining.boxElfTraining.milestones[3].earned.value), freeLevels: computed(() => management.elfTraining.boxElfTraining.milestones[0].earned.value diff --git a/src/data/layers/cloth.tsx b/src/data/layers/cloth.tsx index 6fdbf41..3d910b0 100644 --- a/src/data/layers/cloth.tsx +++ b/src/data/layers/cloth.tsx @@ -30,6 +30,7 @@ import { render, renderCol, renderRow } from "util/vue"; import { computed, ref } from "vue"; import boxes from "./boxes"; import dyes from "./dyes"; +import { ElfBuyable } from "./elves"; import management from "./management"; import metal from "./metal"; import paper from "./paper"; @@ -188,11 +189,17 @@ const layer = createLayer(id, function (this: BaseLayer) { v = Decimal.pow(0.95, paper.books.clothBook.totalAmount.value).times(v); return Decimal.pow(1.5, v).times(1e14); }, + inverseCost(x: DecimalSource) { + let v = Decimal.div(x, 1e14).log(1.5); + v = v.div(Decimal.pow(0.95, paper.books.clothBook.totalAmount.value)); + if (Decimal.gte(v, 100)) v = Decimal.mul(v, 100).root(2); + return Decimal.isNaN(v) ? Decimal.dZero : v.floor().max(0); + }, display: { title: "Build more pens", description: "Breed +1 sheep at once" } - })) as GenericBuyable & { resource: Resource }; + })) as ElfBuyable & { resource: Resource }; const betterShears = createBuyable(() => ({ resource: metal.metal, @@ -202,11 +209,17 @@ const layer = createLayer(id, function (this: BaseLayer) { v = Decimal.pow(0.95, paper.books.clothBook.totalAmount.value).times(v); return Decimal.pow(1.4, v).times(10000); }, + inverseCost(x: DecimalSource) { + let v = Decimal.div(x, 10000).log(1.4); + v = v.div(Decimal.pow(0.95, paper.books.clothBook.totalAmount.value)); + if (Decimal.gte(v, 100)) v = Decimal.mul(v, 100).root(2); + return Decimal.isNaN(v) ? Decimal.dZero : v.floor().max(0); + }, display: { title: "Make stronger shears", description: "Shear +1 sheep at once" } - })) as GenericBuyable & { resource: Resource }; + })) as ElfBuyable & { resource: Resource }; const fasterSpinning = createBuyable(() => ({ resource: paper.paper, @@ -216,11 +229,17 @@ const layer = createLayer(id, function (this: BaseLayer) { v = Decimal.pow(0.95, paper.books.clothBook.totalAmount.value).times(v); return Decimal.pow(1.3, v).times(1000000); }, + inverseCost(x: DecimalSource) { + let v = Decimal.div(x, 1000000).log(1.3); + v = v.div(Decimal.pow(0.95, paper.books.clothBook.totalAmount.value)); + if (Decimal.gte(v, 100)) v = Decimal.mul(v, 100).root(2); + return Decimal.isNaN(v) ? Decimal.dZero : v.floor().max(0); + }, display: { title: "Learn how to spin", description: "Spin +1 wool at once" } - })) as GenericBuyable & { resource: Resource }; + })) as ElfBuyable & { resource: Resource }; const treesUpgrade1 = createUpgrade(() => ({ resource: noPersist(cloth), diff --git a/src/data/layers/coal.tsx b/src/data/layers/coal.tsx index d2a84da..b8ac8ed 100644 --- a/src/data/layers/coal.tsx +++ b/src/data/layers/coal.tsx @@ -33,7 +33,7 @@ import { render, renderGrid, renderRow } from "util/vue"; import { computed, ref, unref } from "vue"; import boxes from "./boxes"; import cloth from "./cloth"; -import elves from "./elves"; +import elves, { ElfBuyable } from "./elves"; import metal from "./metal"; import oil from "./oil"; import paper from "./paper"; @@ -103,6 +103,14 @@ const layer = createLayer(id, function (this: BaseLayer) { v = Decimal.pow(0.95, paper.books.smallFireBook.totalAmount.value).times(v); return v.pow(1.5).times(1e4); }, + inverseCost(x: DecimalSource) { + let v = Decimal.div(x, 1e4).root(1.5); + v = v.div(Decimal.pow(0.95, paper.books.smallFireBook.totalAmount.value)); + if (Decimal.gte(v, 10000)) v = Decimal.mul(v, 10000).root(2); + if (Decimal.gte(v, 100)) v = Decimal.mul(v, 100).root(2); + v = v.sub(Decimal.times(buildBonfire.amount.value, unref(buildBonfire.cost!))); + return Decimal.isNaN(v) ? Decimal.dZero : v.floor().max(0); + }, display: jsx(() => ( <>

Small Fire

@@ -126,7 +134,7 @@ const layer = createLayer(id, function (this: BaseLayer) { color: colorText, width: "160px" } - })) as GenericBuyable & { resource: Resource }; + })) as ElfBuyable & { resource: Resource }; const { min: minFire, @@ -160,6 +168,9 @@ const layer = createLayer(id, function (this: BaseLayer) { cost() { return Decimal.pow(0.95, paper.books.bonfireBook.totalAmount.value).times(10); }, + inverseCost(x: DecimalSource) { + return Decimal.div(x, Decimal.pow(0.95, paper.books.bonfireBook.totalAmount.value).times(10)).floor(); + }, display: jsx(() => ( <>

Bonfire

@@ -185,7 +196,7 @@ const layer = createLayer(id, function (this: BaseLayer) { width: "160px" }, visibility: () => showIf(unlockBonfire.bought.value) - })) as GenericBuyable & { resource: Resource }; + })) as ElfBuyable & { resource: Resource }; const { min: minBonfire, max: maxBonfire, @@ -220,6 +231,13 @@ const layer = createLayer(id, function (this: BaseLayer) { v = Decimal.pow(0.95, paper.books.kilnBook.totalAmount.value).times(v); return Decimal.pow(1.1, v).times(1e7); }, + inverseCost(x: DecimalSource) { + let v = Decimal.div(x, 1e7).log(1.1); + v = v.div(Decimal.pow(0.95, paper.books.kilnBook.totalAmount.value)); + if (Decimal.gte(v, 10000)) v = Decimal.mul(v, 10000).root(2); + if (Decimal.gte(v, 100)) v = Decimal.mul(v, 100).root(2); + return Decimal.isNaN(v) ? Decimal.dZero : v.floor().max(0); + }, display: jsx(() => ( <>

Charcoal Kiln

@@ -244,7 +262,7 @@ const layer = createLayer(id, function (this: BaseLayer) { width: "160px" }, visibility: () => showIf(unlockKiln.bought.value) - })) as GenericBuyable & { resource: Resource }; + })) as ElfBuyable & { resource: Resource }; const { min: minKiln, max: maxKiln, @@ -281,6 +299,19 @@ const layer = createLayer(id, function (this: BaseLayer) { } return cost; }, + inverseCost(x: DecimalSource) { + if (management.elfTraining.coalDrillElfTraining.milestones[2].earned.value) { + x = Decimal.div(x, 10); + } + if (management.elfTraining.fertilizerElfTraining.milestones[2].earned.value) { + x = Decimal.div(x, Decimal.add(trees.totalLogs.value, Math.E).ln()); + } + let v = Decimal.div(x, 10).log(1.15); + v = v.div(Decimal.pow(0.95, paper.books.coalDrillBook.totalAmount.value)); + if (Decimal.gte(v, 10000)) v = Decimal.mul(v, 10000).root(2); + if (Decimal.gte(v, 100)) v = Decimal.mul(v, 100).root(2); + return Decimal.isNaN(v) ? Decimal.dZero : v.floor().max(0); + }, display: jsx(() => ( <>

Coal Drill

@@ -303,7 +334,7 @@ const layer = createLayer(id, function (this: BaseLayer) { width: "160px" }, visibility: () => showIf(metal.coalDrill.bought.value) - })) as GenericBuyable & { resource: Resource }; + })) as ElfBuyable & { resource: Resource }; const { max: maxDrill, min: minDrill, @@ -470,6 +501,18 @@ const layer = createLayer(id, function (this: BaseLayer) { v = v.div(wrappingPaper.boosts.rainbow1.value); return Decimal.add(v, 1).pow(2.5).times(10); }, + inverseCost(x: DecimalSource) { + let v = Decimal.div(x, 10).root(2.5).sub(1); + v = v.mul(wrappingPaper.boosts.rainbow1.value); + if (management.elfTraining.heatedCutterElfTraining.milestones[0].earned.value) { + v = v.div(Decimal.pow(0.95, paper.books.heatedCuttersBook.totalAmount.value)); + } + v = v.div(Decimal.pow(0.95, paper.books.heatedCuttersBook.totalAmount.value)); + if (Decimal.gte(v, 2e6)) v = Decimal.mul(v, 2e6).root(2); + if (Decimal.gte(v, 200)) v = Decimal.mul(v, 200).root(2); + if (Decimal.gte(v, 50)) v = Decimal.mul(v, 50).root(2); + return Decimal.isNaN(v) ? Decimal.dZero : v.floor().max(0); + }, display: { title: "Heated Cutters", description: "Even warmer cutters cut down trees faster", @@ -479,7 +522,7 @@ const layer = createLayer(id, function (this: BaseLayer) { }, style: { color: colorText }, visibility: () => showIf(warmerCutters.bought.value) - })) as GenericBuyable & { display: { title: string }; resource: Resource }; + })) as ElfBuyable & { display: { title: string }; resource: Resource }; const heatedPlanters = createBuyable(() => ({ resource: noPersist(coal), cost() { @@ -494,6 +537,18 @@ const layer = createLayer(id, function (this: BaseLayer) { v = v.div(wrappingPaper.boosts.rainbow1.value); return Decimal.add(v, 1).pow(2.5).times(10); }, + inverseCost(x: DecimalSource) { + let v = Decimal.div(x, 10).root(2.5).sub(1); + v = v.mul(wrappingPaper.boosts.rainbow1.value); + if (management.elfTraining.heatedPlanterElfTraining.milestones[0].earned.value) { + v = v.div(Decimal.pow(0.95, paper.books.heatedPlantersBook.totalAmount.value)); + } + v = v.div(Decimal.pow(0.95, paper.books.heatedPlantersBook.totalAmount.value)); + if (Decimal.gte(v, 2e6)) v = Decimal.mul(v, 2e6).root(2); + if (Decimal.gte(v, 200)) v = Decimal.mul(v, 200).root(2); + if (Decimal.gte(v, 50)) v = Decimal.mul(v, 50).root(2); + return Decimal.isNaN(v) ? Decimal.dZero : v.floor().max(0); + }, display: { title: "Heated Planters", description: "Even warmer planters plant trees faster", @@ -503,7 +558,7 @@ const layer = createLayer(id, function (this: BaseLayer) { }, style: { color: colorText }, visibility: () => showIf(warmerPlanters.bought.value) - })) as GenericBuyable & { display: { title: string }; resource: Resource }; + })) as ElfBuyable & { display: { title: string }; resource: Resource }; const moreFertilizer = createBuyable(() => ({ resource: noPersist(ash), cost() { @@ -518,6 +573,18 @@ const layer = createLayer(id, function (this: BaseLayer) { v = v.div(wrappingPaper.boosts.rainbow1.value); return Decimal.add(v, 1).pow(1.5).times(50000); }, + inverseCost(x: DecimalSource) { + let v = Decimal.div(x, 50000).root(1.5).sub(1); + v = v.mul(wrappingPaper.boosts.rainbow1.value); + if (management.elfTraining.fertilizerElfTraining.milestones[0].earned.value) { + v = v.div(Decimal.pow(0.95, paper.books.fertilizerBook.totalAmount.value)); + } + v = v.div(Decimal.pow(0.95, paper.books.fertilizerBook.totalAmount.value)); + if (Decimal.gte(v, 2e6)) v = Decimal.mul(v, 2e6).root(2); + if (Decimal.gte(v, 200)) v = Decimal.mul(v, 200).root(2); + if (Decimal.gte(v, 50)) v = Decimal.mul(v, 50).root(2); + return Decimal.isNaN(v) ? Decimal.dZero : v.floor().max(0); + }, display: { title: "Fertilized Soil", description: "More fertilizer helps trees grow bigger", @@ -527,7 +594,7 @@ const layer = createLayer(id, function (this: BaseLayer) { }, style: { color: colorText }, visibility: () => showIf(basicFertilizer.bought.value) - })) as GenericBuyable & { display: { title: string }; resource: Resource }; + })) as ElfBuyable & { display: { title: string }; resource: Resource }; const row3buyables = [heatedCutters, heatedPlanters, moreFertilizer]; const heatedCutterEffect = createSequentialModifier(() => [ diff --git a/src/data/layers/dyes.tsx b/src/data/layers/dyes.tsx index 93f461c..4d7a5b6 100644 --- a/src/data/layers/dyes.tsx +++ b/src/data/layers/dyes.tsx @@ -32,12 +32,13 @@ import trees from "./trees"; import wrappingPaper from "./wrapping-paper"; import paper from "./paper"; import boxes from "./boxes"; +import { ElfBuyable } from "./elves"; interface Dye { name: string; amount: Resource & Persistent & { [NonPersistent]: Resource }; - buyable: GenericBuyable; + buyable: ElfBuyable; toGenerate: WithRequired; computedToGenerate: ComputedRef; display: JSXFunction; @@ -184,7 +185,7 @@ const layer = createLayer(id, function (this: BaseLayer) { }) as WithRequired; const computedToGenerate = computed(() => toGenerate.apply(0)); - const buyable: GenericBuyable = createBuyable(() => { + const buyable: ElfBuyable = createBuyable(() => { const costs = convertComputable(options.costs); return { ...options, @@ -243,6 +244,19 @@ const layer = createLayer(id, function (this: BaseLayer) { v = Decimal.mul(v, Decimal.pow(0.95, paper.books.dyeBook.totalAmount.value)); return Decimal.div(v, 10).plus(1); }, + inverseCostPre(x: DecimalSource) { + let v = Decimal.sub(x, 1).mul(10); + v = v.div(Decimal.pow(0.95, paper.books.dyeBook.totalAmount.value)); + if (Decimal.gte(v, 10)) v = Decimal.mul(v, 5).root(2); + if (Decimal.gte(v, 25)) v = Decimal.mul(v, 20).root(2); + return Decimal.isNaN(v) ? Decimal.dZero : v.floor().max(0); + }, + inverseCost() { + if (unref(buyable.visibility) != Visibility.Visible) return Decimal.dZero; + return unref(costs).reduce((pre, c) => + Decimal.min(this.inverseCostPre(Decimal.div(c.res.value, unref(c.base)).root(unref(c.root ?? 1))), pre) + , Decimal.dInf); + }, canPurchase: computed((cost?: DecimalSource) => { if (unref(buyable.visibility) != Visibility.Visible) return false; const trueCost = cost ?? unref(buyable.cost) ?? Decimal.dInf; diff --git a/src/data/layers/elves.tsx b/src/data/layers/elves.tsx index 24c0c5b..d01ddd2 100644 --- a/src/data/layers/elves.tsx +++ b/src/data/layers/elves.tsx @@ -38,8 +38,14 @@ import workshop from "./workshop"; import wrappingPaper from "./wrapping-paper"; import dyes from "./dyes"; +export interface ElfBuyable extends GenericBuyable { + /** The inverse function of the cost formula, used to calculate the maximum amount that can be bought by elves. */ + inverseCost: (x?: DecimalSource) => DecimalSource +} + const id = "elves"; const day = 4; + const layer = createLayer(id, function (this: BaseLayer) { const name = "Elves"; const colorBright = "red"; @@ -542,13 +548,12 @@ const layer = createLayer(id, function (this: BaseLayer) { name: string; description: string; buyable: - | (GenericBuyable & { resource?: Resource }) - | (GenericBuyable & { resource?: Resource })[]; + | (ElfBuyable & { resource?: Resource }) + | (ElfBuyable & { resource?: Resource })[]; cooldownModifier: Modifier; - customCost?: (amount: DecimalSource) => DecimalSource; hasToggle?: boolean; toggleDesc?: string; - onAutoPurchase?: (buyable: GenericBuyable & { resource?: Resource }) => void; + onAutoPurchase?: (buyable: ElfBuyable & { resource?: Resource }, amount: DecimalSource) => void; onPurchase?: VoidFunction; // Will get overriden by the custom onpurchase, but that's fine canBuy?: Computable; buyMax?: Computable; @@ -566,27 +571,29 @@ const layer = createLayer(id, function (this: BaseLayer) { function update(diff: number) { if (upgrade.bought.value && unref(isActive)) { buyProgress.value = Decimal.add(buyProgress.value, diff); + const cooldown = Decimal.recip(computedAutoBuyCooldown.value); amountOfTimesDone.value += diff / cooldown.toNumber(); + + let maxBuyAmount = Decimal.div(buyProgress.value, cooldown).floor(); + buyProgress.value = Decimal.sub(buyProgress.value, maxBuyAmount.mul(cooldown)); + + if (unref(buyMax)) maxBuyAmount = Decimal.dInf; + (isArray(options.buyable) ? options.buyable : [options.buyable]).forEach( buyable => { - while (buyMax ? true : Decimal.gte(buyProgress.value, cooldown)) { - if ( - options.customCost && buyable.resource - ? Decimal.gte( - buyable.resource.value, - options.customCost(buyable.amount.value) - ) - : unref(buyable.canPurchase) - ) { - buyable.amount.value = Decimal.add(buyable.amount.value, 1); - buyProgress.value = Decimal.sub(buyProgress.value, cooldown); - options.onAutoPurchase?.(buyable); - } else { - buyProgress.value = cooldown; - break; - } - } + const buyAmount = Decimal.min( + Decimal.sub(buyable.inverseCost(buyable.resource?.value), buyable.amount.value), + maxBuyAmount + ); + + if (buyAmount.lte(0)) return; + + buyable.amount.value = Decimal.add(buyable.amount.value, buyAmount); + maxBuyAmount = Decimal.sub(maxBuyAmount, buyAmount); + options.onAutoPurchase?.(buyable, buyAmount); + + if (maxBuyAmount.lte(0)) return; } ); } @@ -723,8 +730,8 @@ const layer = createLayer(id, function (this: BaseLayer) { visibility: () => showIf(boxes.upgrades.ashUpgrade.bought.value), hasToggle: true, toggleDesc: "Activate auto-purchased bonfires", - onAutoPurchase() { - const spent = unref((this.buyable as GenericBuyable).cost!); + onAutoPurchase(buyable, amount) { + const spent = Decimal.mul(unref(buyable.cost ?? 0), amount); coal.activeFires.value = Decimal.sub(coal.activeFires.value, spent).max(0); coal.buildFire.amount.value = Decimal.sub(coal.buildFire.amount.value, spent).max(0); if (bonfireElf.toggle.value) { @@ -745,9 +752,9 @@ const layer = createLayer(id, function (this: BaseLayer) { visibility: () => showIf(boxes.upgrades.coalUpgrade.bought.value), hasToggle: true, toggleDesc: "Activate auto-purchased kilns", - onAutoPurchase() { + onAutoPurchase(_, amount) { if (kilnElf.toggle.value) { - coal.activeKilns.value = Decimal.add(coal.activeKilns.value, 1); + coal.activeKilns.value = Decimal.add(coal.activeKilns.value, amount); } }, onPurchase() { @@ -791,9 +798,9 @@ const layer = createLayer(id, function (this: BaseLayer) { showIf(management.elfTraining.expandersElfTraining.milestones[3].earned.value), hasToggle: true, toggleDesc: "Activate auto-purchased coal drills", - onAutoPurchase() { + onAutoPurchase(_, amount) { if (coalDrillElf.toggle.value) { - coal.activeDrills.value = Decimal.add(coal.activeDrills.value, 1); + coal.activeDrills.value = Decimal.add(coal.activeDrills.value, amount); } } }); @@ -807,14 +814,14 @@ const layer = createLayer(id, function (this: BaseLayer) { showIf(management.elfTraining.fertilizerElfTraining.milestones[4].earned.value), hasToggle: true, toggleDesc: "Activate auto-purchased oil drills", - onAutoPurchase(buyable) { + onAutoPurchase(buyable, amount) { if (heavyDrillElf.toggle.value) { if (buyable === oil.buildHeavy) { - oil.activeHeavy.value = Decimal.add(oil.activeHeavy.value, 1); + oil.activeHeavy.value = Decimal.add(oil.activeHeavy.value, amount); } else if (buyable === oil.buildHeavy2) { - oil.activeHeavy2.value = Decimal.add(oil.activeHeavy2.value, 1); + oil.activeHeavy2.value = Decimal.add(oil.activeHeavy2.value, amount); } else if (buyable === oil.buildExtractor) { - oil.activeExtractor.value = Decimal.add(oil.activeExtractor.value, 1); + oil.activeExtractor.value = Decimal.add(oil.activeExtractor.value, amount); } } } @@ -829,14 +836,14 @@ const layer = createLayer(id, function (this: BaseLayer) { showIf(management.elfTraining.heatedCutterElfTraining.milestones[4].earned.value), hasToggle: true, toggleDesc: "Activate auto-purchased oil-using machines", - onAutoPurchase(buyable) { + onAutoPurchase(buyable, amount) { if (heavyDrillElf.toggle.value) { if (buyable === oil.buildPump) { - oil.activePump.value = Decimal.add(oil.activePump.value, 1); + oil.activePump.value = Decimal.add(oil.activePump.value, amount); } else if (buyable === oil.buildBurner) { - oil.activeBurner.value = Decimal.add(oil.activeBurner.value, 1); + oil.activeBurner.value = Decimal.add(oil.activeBurner.value, amount); } else if (buyable === oil.buildSmelter) { - oil.activeSmelter.value = Decimal.add(oil.activeSmelter.value, 1); + oil.activeSmelter.value = Decimal.add(oil.activeSmelter.value, amount); } } } diff --git a/src/data/layers/metal.tsx b/src/data/layers/metal.tsx index 2fa0d73..a08bf55 100644 --- a/src/data/layers/metal.tsx +++ b/src/data/layers/metal.tsx @@ -34,6 +34,7 @@ import dyes from "./dyes"; import management from "./management"; import workshop from "./workshop"; import paper from "./paper"; +import { ElfBuyable } from "./elves"; const id = "metal"; const day = 7; @@ -415,6 +416,17 @@ const layer = createLayer(id, function (this: BaseLayer) { } return cost; }, + inverseCost(x: DecimalSource) { + if (management.elfTraining.metalElfTraining.milestones[3].earned.value) { + x = Decimal.mul(x, 10); + } + if (management.elfTraining.clothElfTraining.milestones[4].earned.value) { + x = Decimal.mul(x, Decimal.add(oil.depth.value, 1).sqrt()); + } + let v = Decimal.div(x, 10).log(1.15); + v = v.div(Decimal.pow(0.95, paper.books.metalBook.totalAmount.value)); + return Decimal.isNaN(v) ? Decimal.dZero : v.floor().max(0); + }, display: { title: "Metal Drill", description: "An automated machine to help you mine more ore, faster", @@ -433,7 +445,7 @@ const layer = createLayer(id, function (this: BaseLayer) { .gte(10) ), style: { width: "200px" } - })) as GenericBuyable & { resource: Resource }; + })) as ElfBuyable & { resource: Resource }; const industrialCrucible = createBuyable(() => ({ resource: noPersist(metal), cost() { @@ -448,6 +460,17 @@ const layer = createLayer(id, function (this: BaseLayer) { } return cost; }, + inverseCost(x: DecimalSource) { + if (management.elfTraining.metalElfTraining.milestones[3].earned.value) { + x = Decimal.mul(x, 10); + } + if (management.elfTraining.clothElfTraining.milestones[4].earned.value) { + x = Decimal.mul(x, Decimal.add(oil.depth.value, 1).sqrt()); + } + let v = Decimal.div(x, 10).log(1.15).div(10); + v = v.div(Decimal.pow(0.95, paper.books.metalBook.totalAmount.value)); + return Decimal.isNaN(v) ? Decimal.dZero : v.floor().max(0); + }, display: { title: "Industrial Crucible", description: "A giant automated crucible furnace, letting you smelt ore faster", @@ -465,7 +488,7 @@ const layer = createLayer(id, function (this: BaseLayer) { Decimal.gte(bestOre.value, 50) ), style: { width: "200px" } - })) as GenericBuyable & { resource: Resource }; + })) as ElfBuyable & { resource: Resource }; const autoSmeltEnabled = persistent(true); const hotterForge = createBuyable(() => ({ resource: coal.coal, @@ -481,6 +504,17 @@ const layer = createLayer(id, function (this: BaseLayer) { } return cost; }, + inverseCost(x: DecimalSource) { + if (management.elfTraining.metalElfTraining.milestones[3].earned.value) { + x = Decimal.mul(x, 10); + } + if (management.elfTraining.clothElfTraining.milestones[4].earned.value) { + x = Decimal.mul(x, Decimal.add(oil.depth.value, 1).sqrt()); + } + let v = Decimal.div(x, 1e12).log(10); + v = v.div(Decimal.pow(0.95, paper.books.metalBook.totalAmount.value)); + return Decimal.isNaN(v) ? Decimal.dZero : v.floor().max(0); + }, display: { title: "Hotter Forges", description: @@ -495,7 +529,7 @@ const layer = createLayer(id, function (this: BaseLayer) { visibility: () => showIf(Decimal.gte(hotterForge.amount.value, 1) || industrialFurnace.bought.value), style: { width: "200px" } - })) as GenericBuyable & { resource: Resource }; + })) as ElfBuyable & { resource: Resource }; const hotterForgeEffect = computed(() => Decimal.times(hotterForge.amount.value, 0.25)); globalBus.on("update", diff => { diff --git a/src/data/layers/oil.tsx b/src/data/layers/oil.tsx index e8d4ffc..5b74056 100644 --- a/src/data/layers/oil.tsx +++ b/src/data/layers/oil.tsx @@ -39,6 +39,7 @@ import dyes from "./dyes"; import management from "./management"; import workshop from "./workshop"; import { WithRequired } from "util/common"; +import { ElfBuyable } from "./elves"; const id = "oil"; const day = 9; @@ -104,6 +105,12 @@ const layer = createLayer(id, function (this: BaseLayer) { v = Decimal.pow(0.95, paper.books.heavyDrillBook.totalAmount.value).times(v); return Decimal.pow(1.3, v).times(2.5e4); }, + inverseCost(x: DecimalSource) { + let v = Decimal.div(x, 2.5e4).log(1.3); + v = v.div(Decimal.pow(0.95, paper.books.heavyDrillBook.totalAmount.value)); + if (Decimal.gte(v, 100)) v = Decimal.mul(v, 100).root(4); + return Decimal.isNaN(v) ? Decimal.dZero : v.floor().max(0); + }, display: jsx(() => ( <>

Heavy Drill

@@ -134,7 +141,7 @@ const layer = createLayer(id, function (this: BaseLayer) { color: colorText, width: "160px" } - })) as GenericBuyable & { resource: Resource }; + })) as ElfBuyable & { resource: Resource }; const { min: minHeavy, max: maxHeavy, @@ -162,6 +169,12 @@ const layer = createLayer(id, function (this: BaseLayer) { v = Decimal.pow(0.95, paper.books.heavyDrillBook.totalAmount.value).times(v); return Decimal.pow(2, v).times(1e5); }, + inverseCost(x: DecimalSource) { + let v = Decimal.div(x, 1e5).log(2); + v = v.div(Decimal.pow(0.95, paper.books.heavyDrillBook.totalAmount.value)); + if (Decimal.gte(v, 50)) v = Decimal.mul(v, 50).root(4); + return Decimal.isNaN(v) ? Decimal.dZero : v.floor().max(0); + }, display: jsx(() => ( <>

Heavy Drill Drill

@@ -195,7 +208,7 @@ const layer = createLayer(id, function (this: BaseLayer) { color: colorText, width: "160px" } - })) as GenericBuyable & { resource: Resource }; + })) as ElfBuyable & { resource: Resource }; const { min: minHeavy2, max: maxHeavy2, @@ -218,6 +231,12 @@ const layer = createLayer(id, function (this: BaseLayer) { v = Decimal.pow(0.95, paper.books.heavyDrillBook.totalAmount.value).times(v); return Decimal.pow(8, v).times(2e5); }, + inverseCost(x: DecimalSource) { + let v = Decimal.div(x, 2e5).log(8); + v = v.div(Decimal.pow(0.95, paper.books.heavyDrillBook.totalAmount.value)); + if (Decimal.gte(v, 100)) v = Decimal.mul(v, 100).root(4); + return Decimal.isNaN(v) ? Decimal.dZero : v.floor().max(0); + }, display: jsx(() => ( <>

Heavy Extractor

@@ -244,7 +263,7 @@ const layer = createLayer(id, function (this: BaseLayer) { color: colorText, width: "160px" } - })) as GenericBuyable & { resource: Resource }; + })) as ElfBuyable & { resource: Resource }; const { min: minExtractor, max: maxExtractor, @@ -288,6 +307,18 @@ const layer = createLayer(id, function (this: BaseLayer) { } return price; }, + inverseCost(x: DecimalSource) { + if (management.elfTraining.heavyDrillElfTraining.milestones[1].earned.value) { + x = Decimal.mul(x, 10); + } + if (row2Upgrades[4].bought.value) { + x = Decimal.mul(x, Decimal.add(totalOil.value, 1).root(6)); + } + let v = Decimal.div(x, 2e6).log(16); + v = v.div(Decimal.pow(0.95, paper.books.heavyDrillBook.totalAmount.value)); + if (Decimal.gte(v, 100)) v = Decimal.mul(v, 100).root(4); + return Decimal.isNaN(v) ? Decimal.dZero : v.floor().max(0); + }, display: jsx(() => ( <>

Oil Pump

@@ -313,7 +344,7 @@ const layer = createLayer(id, function (this: BaseLayer) { color: colorText, width: "160px" } - })) as GenericBuyable & { resource: Resource }; + })) as ElfBuyable & { resource: Resource }; const { max: maxPump, min: minPump, @@ -343,6 +374,12 @@ const layer = createLayer(id, function (this: BaseLayer) { v = Decimal.pow(0.95, paper.books.oilBook.totalAmount.value).times(v); return Decimal.pow(2, v).times(50); }, + inverseCost(x: DecimalSource) { + let v = Decimal.div(x, 50).log(2); + v = v.div(Decimal.pow(0.95, paper.books.oilBook.totalAmount.value)); + if (Decimal.gte(v, 100)) v = Decimal.mul(v, 100).root(4); + return Decimal.isNaN(v) ? Decimal.dZero : v.floor().max(0); + }, display: jsx(() => ( <>

Oil Burner

@@ -375,7 +412,7 @@ const layer = createLayer(id, function (this: BaseLayer) { color: colorText, width: "160px" } - })) as GenericBuyable & { resource: Resource }; + })) as ElfBuyable & { resource: Resource }; const { max: maxBurner, min: minBurner, @@ -402,6 +439,15 @@ const layer = createLayer(id, function (this: BaseLayer) { price = price.div(Decimal.add(totalOil.value, 1).root(6)); return price; }, + inverseCost(x: DecimalSource) { + if (row2Upgrades[4].bought.value) { + x = Decimal.mul(x, Decimal.add(totalOil.value, 1).root(6)); + } + let v = Decimal.div(x, 1e7).log(10); + v = v.div(Decimal.pow(0.95, paper.books.oilBook.totalAmount.value)); + if (Decimal.gte(v, 100)) v = Decimal.mul(v, 100).root(4); + return Decimal.isNaN(v) ? Decimal.dZero : v.floor().max(0); + }, display: jsx(() => ( <>

Oil Smelter

@@ -426,7 +472,7 @@ const layer = createLayer(id, function (this: BaseLayer) { color: colorText, width: "160px" } - })) as GenericBuyable & { resource: Resource }; + })) as ElfBuyable & { resource: Resource }; const { max: maxSmelter, diff --git a/src/data/layers/paper.tsx b/src/data/layers/paper.tsx index b6e8ac7..22e1f40 100644 --- a/src/data/layers/paper.tsx +++ b/src/data/layers/paper.tsx @@ -23,7 +23,7 @@ import { render, renderCol, renderRow } from "util/vue"; import { computed, ComputedRef, ref, unref } from "vue"; import cloth from "./cloth"; import coal from "./coal"; -import elves from "./elves"; +import elves, { ElfBuyable } from "./elves"; import plastic from "./plastic"; import trees from "./trees"; import dyes from "./dyes"; @@ -131,6 +131,28 @@ const layer = createLayer(id, function (this: BaseLayer) { } return cost; }, + inverseCost(x: DecimalSource) { + if (bookUpgrade.bought.value) { + x = Decimal.div(x, 10); + } + if (management.elfTraining.paperElfTraining.milestones[0].earned.value) { + x = Decimal.div(x, sumBooks.value.max(1)); + } + + let scaling = 5; + if (management.elfTraining.paperElfTraining.milestones[0].earned.value) { + scaling--; + } + + let v = Decimal.div(x, 10).log(scaling); + + v = v.div(Decimal.pow(0.95, paperBook.totalAmount.value)); + if (Decimal.gte(v, 10000)) v = Decimal.mul(v, 10000).root(2); + if (Decimal.gte(v, 100)) v = Decimal.mul(v, 100).root(2); + if (options.elfName === "Star" || options.elfName === "Bell") v = Decimal.root(v, 2); + + return Decimal.isNaN(v) ? Decimal.dZero : v.floor().max(0); + }, style: "width: 600px", freeLevels: computed(() => management.elfTraining.paperElfTraining.milestones[4].earned.value @@ -138,7 +160,7 @@ const layer = createLayer(id, function (this: BaseLayer) { : 0 ), totalAmount: computed(() => Decimal.add(buyable.amount.value, buyable.freeLevels.value)) - })) as GenericBuyable & { + })) as ElfBuyable & { resource: Resource; freeLevels: ComputedRef; totalAmount: ComputedRef; diff --git a/src/data/layers/trees.tsx b/src/data/layers/trees.tsx index 4c932fd..1dab5fb 100644 --- a/src/data/layers/trees.tsx +++ b/src/data/layers/trees.tsx @@ -32,7 +32,7 @@ import boxes from "./boxes"; import cloth from "./cloth"; import coal from "./coal"; import dyes from "./dyes"; -import elves from "./elves"; +import elves, { ElfBuyable } from "./elves"; import management from "./management"; import paper from "./paper"; import workshop from "./workshop"; @@ -214,12 +214,21 @@ const layer = createLayer(id, function (this: BaseLayer) { v = Decimal.pow(0.95, paper.books.cuttersBook.totalAmount.value).times(v); return Decimal.times(100, v).add(200); }, + inverseCost(x: DecimalSource) { + let v = Decimal.sub(x, 200).div(100); + v = v.div(Decimal.pow(0.95, paper.books.cuttersBook.totalAmount.value)); + if (Decimal.gte(v, 2e30)) v = Decimal.mul(v, Decimal.pow(2e30, 9999)).root(10000); + if (Decimal.gte(v, 2e6)) v = Decimal.mul(v, 2e6).root(2); + if (Decimal.gte(v, 200)) v = Decimal.mul(v, 200).root(2); + if (Decimal.gte(v, 50)) v = Decimal.mul(v, 50).root(2); + return Decimal.isNaN(v) ? Decimal.dZero : v.floor().max(0); + }, display: { title: "Generic Cutters", description: "Each cutter cuts down 1 tree/s" }, visibility: () => showIf(researchUpgrade2.bought.value) - })) as GenericBuyable & { display: { title: string }; resource: Resource }; + })) as ElfBuyable & { display: { title: string }; resource: Resource }; const autoPlantingBuyable1 = createBuyable(() => ({ resource: noPersist(logs), cost() { @@ -235,12 +244,24 @@ const layer = createLayer(id, function (this: BaseLayer) { } return cost; }, + inverseCost(x: DecimalSource) { + if (management.elfTraining.planterElfTraining.milestones[3].earned.value) { + x = Decimal.mul(x, 10); + } + let v = Decimal.sub(x, 200).div(100); + v = v.div(Decimal.pow(0.95, paper.books.plantersBook.totalAmount.value)); + if (Decimal.gte(v, 2e30)) v = Decimal.mul(v, Decimal.pow(2e30, 9999)).root(10000); + if (Decimal.gte(v, 2e6)) v = Decimal.mul(v, 2e6).root(2); + if (Decimal.gte(v, 200)) v = Decimal.mul(v, 200).root(2); + if (Decimal.gte(v, 50)) v = Decimal.mul(v, 50).root(2); + return Decimal.isNaN(v) ? Decimal.dZero : v.floor().max(0); + }, display: { title: "Generic Planters", description: "Each planter plants 0.5 trees/s" }, visibility: () => showIf(researchUpgrade2.bought.value) - })) as GenericBuyable & { display: { title: string }; resource: Resource }; + })) as ElfBuyable & { display: { title: string }; resource: Resource }; const expandingForestBuyable = createBuyable(() => ({ resource: noPersist(logs), cost() { @@ -251,12 +272,20 @@ const layer = createLayer(id, function (this: BaseLayer) { v = Decimal.pow(0.95, paper.books.expandersBook.totalAmount.value).times(v); return Decimal.pow(Decimal.add(v, 1), 1.5).times(500); }, + inverseCost(x: DecimalSource) { + let v = Decimal.div(x, 500).root(1.5).sub(1); + v = v.div(Decimal.pow(0.95, paper.books.expandersBook.totalAmount.value)); + if (Decimal.gte(v, 1e15)) v = Decimal.mul(v, 1e135).root(10); + if (Decimal.gte(v, 1e5)) v = Decimal.mul(v, 1e5).root(2); + if (Decimal.gte(v, 100)) v = Decimal.mul(v, 100).root(2); + return Decimal.isNaN(v) ? Decimal.dZero : v.floor().max(0); + }, display: { title: "Expand Forest", description: "Add 10 trees to the forest" }, visibility: () => showIf(researchUpgrade2.bought.value) - })) as GenericBuyable & { display: { title: string }; resource: Resource }; + })) as ElfBuyable & { display: { title: string }; resource: Resource }; const row1Buyables = [autoCuttingBuyable1, autoPlantingBuyable1, expandingForestBuyable]; const manualCuttingAmount = createSequentialModifier(() => [ From dfe9ea515c200da6e095bfa636f408718d5da590 Mon Sep 17 00:00:00 2001 From: thepaperpilot Date: Wed, 14 Dec 2022 08:40:38 -0600 Subject: [PATCH 35/48] Balance tweaks --- src/data/layers/elves.tsx | 14 ++++++++++---- src/data/layers/management.tsx | 24 ++++++++++++------------ 2 files changed, 22 insertions(+), 16 deletions(-) diff --git a/src/data/layers/elves.tsx b/src/data/layers/elves.tsx index d01ddd2..d3dbef2 100644 --- a/src/data/layers/elves.tsx +++ b/src/data/layers/elves.tsx @@ -40,7 +40,7 @@ import dyes from "./dyes"; export interface ElfBuyable extends GenericBuyable { /** The inverse function of the cost formula, used to calculate the maximum amount that can be bought by elves. */ - inverseCost: (x?: DecimalSource) => DecimalSource + inverseCost: (x?: DecimalSource) => DecimalSource; } const id = "elves"; @@ -538,7 +538,7 @@ const layer = createLayer(id, function (this: BaseLayer) { cost = Decimal.times(cost, 1e15); } if (Decimal.gte(totalElves.value, 12)) { - cost = Decimal.times(cost, 1e18); + cost = Decimal.times(cost, 1e15); } return cost; }); @@ -553,7 +553,10 @@ const layer = createLayer(id, function (this: BaseLayer) { cooldownModifier: Modifier; hasToggle?: boolean; toggleDesc?: string; - onAutoPurchase?: (buyable: ElfBuyable & { resource?: Resource }, amount: DecimalSource) => void; + onAutoPurchase?: ( + buyable: ElfBuyable & { resource?: Resource }, + amount: DecimalSource + ) => void; onPurchase?: VoidFunction; // Will get overriden by the custom onpurchase, but that's fine canBuy?: Computable; buyMax?: Computable; @@ -583,7 +586,10 @@ const layer = createLayer(id, function (this: BaseLayer) { (isArray(options.buyable) ? options.buyable : [options.buyable]).forEach( buyable => { const buyAmount = Decimal.min( - Decimal.sub(buyable.inverseCost(buyable.resource?.value), buyable.amount.value), + Decimal.sub( + buyable.inverseCost(buyable.resource?.value), + buyable.amount.value + ), maxBuyAmount ); diff --git a/src/data/layers/management.tsx b/src/data/layers/management.tsx index 6012ca2..1123408 100644 --- a/src/data/layers/management.tsx +++ b/src/data/layers/management.tsx @@ -117,7 +117,7 @@ const layer = createLayer(id, () => { display: { title: "Advanced Training", description: - "Time for some advanced training! Now that all the elves know the basics, you have a foundation you can truly build off of. Everyone seems to be learning 10x as quickly!" + "Time for some advanced training! Now that all the elves know the basics, you have a foundation you can truly build off of. Everyone seems to be learning twice as quickly!" }, visibility: () => showIf(main.day.value >= advancedDay && main.days[advancedDay - 1].opened.value), @@ -132,7 +132,7 @@ const layer = createLayer(id, () => { enabled: classroomUpgrade.bought })), createMultiplicativeModifier(() => ({ - multiplier: 10, + multiplier: 2, description: "Advanced Training", enabled: advancedUpgrade.bought })), @@ -196,20 +196,20 @@ const layer = createLayer(id, () => { height: 14, style: () => ({ "margin-top": "8px", - "background": color, - "box-shadow": - currentShown.value == elf.name ? "0 0 12px black" - : focusTargets.value[elf.name] ? "0 0 12px white" - : "" + background: color, + "box-shadow": + currentShown.value == elf.name + ? "0 0 12px black" + : focusTargets.value[elf.name] + ? "0 0 12px white" + : "" }), baseStyle: "margin-top: -1px", fillStyle: () => ({ "margin-top": "-1px", "transition-duration": "0s", - "background": "white", - "animation": focusTargets.value[elf.name] - ? ".5s focused-xp-bar linear infinite" - : "", + background: "white", + animation: focusTargets.value[elf.name] ? ".5s focused-xp-bar linear infinite" : "" }), borderStyle: () => Decimal.gte(level.value, schools.amount.value) ? "border-color: red" : "", @@ -1368,7 +1368,7 @@ const layer = createLayer(id, () => { const schoolCost = computed(() => { const schoolFactor = Decimal.pow(10, schools.amount.value); - const nerfedSchoolFactor = Decimal.pow(5, schools.amount.value); + const nerfedSchoolFactor = Decimal.pow(4, schools.amount.value); let woodFactor = Decimal.pow(2e4, Decimal.pow(schools.amount.value, 0.75)); if (Decimal.gte(schools.amount.value, 4)) { woodFactor = woodFactor.div(1e3); From a36b690c00d39e8e740194f5da9008c51818974c Mon Sep 17 00:00:00 2001 From: thepaperpilot Date: Wed, 14 Dec 2022 08:42:39 -0600 Subject: [PATCH 36/48] Fixed small fires and bonfires not activating max --- src/data/layers/elves.tsx | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/data/layers/elves.tsx b/src/data/layers/elves.tsx index d3dbef2..b4e2f91 100644 --- a/src/data/layers/elves.tsx +++ b/src/data/layers/elves.tsx @@ -718,9 +718,9 @@ const layer = createLayer(id, function (this: BaseLayer) { visibility: () => showIf(boxes.upgrades.logsUpgrade.bought.value), hasToggle: true, toggleDesc: "Activate auto-purchased small fires", - onAutoPurchase() { + onAutoPurchase(_, amount) { if (smallFireElf.toggle.value) { - coal.activeFires.value = Decimal.add(coal.activeFires.value, 1); + coal.activeFires.value = Decimal.add(coal.activeFires.value, amount); } }, onPurchase() { @@ -741,7 +741,7 @@ const layer = createLayer(id, function (this: BaseLayer) { coal.activeFires.value = Decimal.sub(coal.activeFires.value, spent).max(0); coal.buildFire.amount.value = Decimal.sub(coal.buildFire.amount.value, spent).max(0); if (bonfireElf.toggle.value) { - coal.activeBonfires.value = Decimal.add(coal.activeBonfires.value, 1); + coal.activeBonfires.value = Decimal.add(coal.activeBonfires.value, amount); } }, onPurchase() { From 3efa0e4374e9956b92ce6a424fb829a82119ea5f Mon Sep 17 00:00:00 2001 From: unsoftcapped3 <75136164+unsoftcapped3@users.noreply.github.com> Date: Wed, 14 Dec 2022 07:02:29 -0800 Subject: [PATCH 37/48] fix base cost of plastic box buyable --- src/data/layers/boxes.tsx | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/data/layers/boxes.tsx b/src/data/layers/boxes.tsx index 34a5884..86401b5 100644 --- a/src/data/layers/boxes.tsx +++ b/src/data/layers/boxes.tsx @@ -516,7 +516,7 @@ const layer = createLayer(id, function (this: BaseLayer) { if (management.elfTraining.boxElfTraining.milestones[2].earned.value) { scaling--; } - return Decimal.pow(scaling, v).times(1000).div(dyes.boosts.orange2.value); + return Decimal.pow(scaling, v).times(1e31).div(dyes.boosts.orange2.value); }, inverseCost(x: DecimalSource) { let scaling = 20; @@ -525,7 +525,7 @@ const layer = createLayer(id, function (this: BaseLayer) { } let v = Decimal.mul(x, dyes.boosts.orange2.value) - .div(1000).log(scaling); + .div(1e31).log(scaling); v = v.div(Decimal.pow(0.95, paper.books.boxBook.totalAmount.value)); return Decimal.isNaN(v) ? Decimal.dZero : v.floor().max(0); From 2057c13f98e9ad445fcedd2f54fefb77d6cc4739 Mon Sep 17 00:00:00 2001 From: unsoftcapped3 <75136164+unsoftcapped3@users.noreply.github.com> Date: Wed, 14 Dec 2022 07:04:24 -0800 Subject: [PATCH 38/48] **3 --- src/data/layers/oil.tsx | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/src/data/layers/oil.tsx b/src/data/layers/oil.tsx index 5b74056..cdcfc8e 100644 --- a/src/data/layers/oil.tsx +++ b/src/data/layers/oil.tsx @@ -101,14 +101,14 @@ const layer = createLayer(id, function (this: BaseLayer) { resource: metal.metal, cost() { let v = new Decimal(this.amount.value); - if (Decimal.gte(v, 100)) v = Decimal.pow(v, 4).div(100); + if (Decimal.gte(v, 100)) v = Decimal.pow(v, 4).div(100**3); v = Decimal.pow(0.95, paper.books.heavyDrillBook.totalAmount.value).times(v); return Decimal.pow(1.3, v).times(2.5e4); }, inverseCost(x: DecimalSource) { let v = Decimal.div(x, 2.5e4).log(1.3); v = v.div(Decimal.pow(0.95, paper.books.heavyDrillBook.totalAmount.value)); - if (Decimal.gte(v, 100)) v = Decimal.mul(v, 100).root(4); + if (Decimal.gte(v, 100)) v = Decimal.mul(v, 100**3).root(4); return Decimal.isNaN(v) ? Decimal.dZero : v.floor().max(0); }, display: jsx(() => ( @@ -165,14 +165,14 @@ const layer = createLayer(id, function (this: BaseLayer) { resource: metal.metal, cost() { let v = new Decimal(this.amount.value); - if (Decimal.gte(v, 50)) v = Decimal.pow(v, 4).div(50); + if (Decimal.gte(v, 50)) v = Decimal.pow(v, 4).div(50**3); v = Decimal.pow(0.95, paper.books.heavyDrillBook.totalAmount.value).times(v); return Decimal.pow(2, v).times(1e5); }, inverseCost(x: DecimalSource) { let v = Decimal.div(x, 1e5).log(2); v = v.div(Decimal.pow(0.95, paper.books.heavyDrillBook.totalAmount.value)); - if (Decimal.gte(v, 50)) v = Decimal.mul(v, 50).root(4); + if (Decimal.gte(v, 50)) v = Decimal.mul(v, 50**3).root(4); return Decimal.isNaN(v) ? Decimal.dZero : v.floor().max(0); }, display: jsx(() => ( @@ -227,14 +227,14 @@ const layer = createLayer(id, function (this: BaseLayer) { resource: metal.metal, cost() { let v = new Decimal(this.amount.value); - if (Decimal.gte(v, 100)) v = Decimal.pow(v, 4).div(100); + if (Decimal.gte(v, 100)) v = Decimal.pow(v, 4).div(100**3); v = Decimal.pow(0.95, paper.books.heavyDrillBook.totalAmount.value).times(v); return Decimal.pow(8, v).times(2e5); }, inverseCost(x: DecimalSource) { let v = Decimal.div(x, 2e5).log(8); v = v.div(Decimal.pow(0.95, paper.books.heavyDrillBook.totalAmount.value)); - if (Decimal.gte(v, 100)) v = Decimal.mul(v, 100).root(4); + if (Decimal.gte(v, 100)) v = Decimal.mul(v, 100**3).root(4); return Decimal.isNaN(v) ? Decimal.dZero : v.floor().max(0); }, display: jsx(() => ( From 2349748353c70177b5d2a699a6f1bd1b7944d224 Mon Sep 17 00:00:00 2001 From: unsoftcapped3 <75136164+unsoftcapped3@users.noreply.github.com> Date: Wed, 14 Dec 2022 07:21:14 -0800 Subject: [PATCH 39/48] Star book scaling to prevent future inflation --- src/data/layers/paper.tsx | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/data/layers/paper.tsx b/src/data/layers/paper.tsx index 22e1f40..2917689 100644 --- a/src/data/layers/paper.tsx +++ b/src/data/layers/paper.tsx @@ -114,6 +114,7 @@ const layer = createLayer(id, function (this: BaseLayer) { resource: noPersist(paper), cost() { let v = this.amount.value; + if (options.elfName === "Star" && Decimal.gte(v, 10)) v = Decimal.pow(10, v.div(10)); if (options.elfName === "Star" || options.elfName === "Bell") v = Decimal.pow(v, 2); if (Decimal.gte(v, 100)) v = Decimal.pow(v, 2).div(100); if (Decimal.gte(v, 10000)) v = Decimal.pow(v, 2).div(10000); @@ -150,7 +151,7 @@ const layer = createLayer(id, function (this: BaseLayer) { if (Decimal.gte(v, 10000)) v = Decimal.mul(v, 10000).root(2); if (Decimal.gte(v, 100)) v = Decimal.mul(v, 100).root(2); if (options.elfName === "Star" || options.elfName === "Bell") v = Decimal.root(v, 2); - +if (options.elfName === "Star" && Decimal.gte(v, 10)) v=v.mul(10).log10(); return Decimal.isNaN(v) ? Decimal.dZero : v.floor().max(0); }, style: "width: 600px", From 551aa299f97b22fa31ca6a5f25783c2a2ba85dc2 Mon Sep 17 00:00:00 2001 From: thepaperpilot Date: Wed, 14 Dec 2022 09:37:15 -0600 Subject: [PATCH 40/48] Fix build issues --- src/data/layers/paper.tsx | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/src/data/layers/paper.tsx b/src/data/layers/paper.tsx index 2917689..35267e6 100644 --- a/src/data/layers/paper.tsx +++ b/src/data/layers/paper.tsx @@ -113,8 +113,9 @@ const layer = createLayer(id, function (this: BaseLayer) { }, resource: noPersist(paper), cost() { - let v = this.amount.value; - if (options.elfName === "Star" && Decimal.gte(v, 10)) v = Decimal.pow(10, v.div(10)); + let v = buyable.amount.value; + if (options.elfName === "Star" && Decimal.gte(v, 10)) + v = Decimal.pow(10, Decimal.div(v, 10)); if (options.elfName === "Star" || options.elfName === "Bell") v = Decimal.pow(v, 2); if (Decimal.gte(v, 100)) v = Decimal.pow(v, 2).div(100); if (Decimal.gte(v, 10000)) v = Decimal.pow(v, 2).div(10000); @@ -139,7 +140,7 @@ const layer = createLayer(id, function (this: BaseLayer) { if (management.elfTraining.paperElfTraining.milestones[0].earned.value) { x = Decimal.div(x, sumBooks.value.max(1)); } - + let scaling = 5; if (management.elfTraining.paperElfTraining.milestones[0].earned.value) { scaling--; @@ -150,8 +151,9 @@ const layer = createLayer(id, function (this: BaseLayer) { v = v.div(Decimal.pow(0.95, paperBook.totalAmount.value)); if (Decimal.gte(v, 10000)) v = Decimal.mul(v, 10000).root(2); if (Decimal.gte(v, 100)) v = Decimal.mul(v, 100).root(2); - if (options.elfName === "Star" || options.elfName === "Bell") v = Decimal.root(v, 2); -if (options.elfName === "Star" && Decimal.gte(v, 10)) v=v.mul(10).log10(); + if (options.elfName === "Star" || options.elfName === "Bell") + v = Decimal.root(v, 2); + if (options.elfName === "Star" && Decimal.gte(v, 10)) v = v.mul(10).log10(); return Decimal.isNaN(v) ? Decimal.dZero : v.floor().max(0); }, style: "width: 600px", From 894b37015cd997d4d5e0060ce890f0d3b46d9bc0 Mon Sep 17 00:00:00 2001 From: unsoftcapped3 <75136164+unsoftcapped3@users.noreply.github.com> Date: Wed, 14 Dec 2022 09:37:16 -0800 Subject: [PATCH 41/48] made Star level 3 not activate at level 1 --- src/data/layers/paper.tsx | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/data/layers/paper.tsx b/src/data/layers/paper.tsx index 35267e6..01a77ca 100644 --- a/src/data/layers/paper.tsx +++ b/src/data/layers/paper.tsx @@ -121,7 +121,7 @@ const layer = createLayer(id, function (this: BaseLayer) { if (Decimal.gte(v, 10000)) v = Decimal.pow(v, 2).div(10000); v = Decimal.pow(0.95, paperBook.totalAmount.value).times(v); let scaling = 5; - if (management.elfTraining.paperElfTraining.milestones[0].earned.value) { + if (management.elfTraining.paperElfTraining.milestones[2].earned.value) { scaling--; } let cost = Decimal.pow(scaling, v).times(10); @@ -142,7 +142,7 @@ const layer = createLayer(id, function (this: BaseLayer) { } let scaling = 5; - if (management.elfTraining.paperElfTraining.milestones[0].earned.value) { + if (management.elfTraining.paperElfTraining.milestones[2].earned.value) { scaling--; } From 00cb558561c9ee1155d839dd57e2bd48a3cf9a50 Mon Sep 17 00:00:00 2001 From: unsoftcapped3 <75136164+unsoftcapped3@users.noreply.github.com> Date: Wed, 14 Dec 2022 11:12:31 -0800 Subject: [PATCH 42/48] implement asdaf's fix --- src/data/layers/paper.tsx | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/data/layers/paper.tsx b/src/data/layers/paper.tsx index 01a77ca..0bc6944 100644 --- a/src/data/layers/paper.tsx +++ b/src/data/layers/paper.tsx @@ -135,10 +135,10 @@ const layer = createLayer(id, function (this: BaseLayer) { }, inverseCost(x: DecimalSource) { if (bookUpgrade.bought.value) { - x = Decimal.div(x, 10); + x = Decimal.mul(x, 10); } if (management.elfTraining.paperElfTraining.milestones[0].earned.value) { - x = Decimal.div(x, sumBooks.value.max(1)); + x = Decimal.mul(x, sumBooks.value.max(1)); } let scaling = 5; From 1d395163e13572a21f3e07eaaadfb5c96e6767ac Mon Sep 17 00:00:00 2001 From: adsaf123 Date: Wed, 14 Dec 2022 20:46:07 +0100 Subject: [PATCH 43/48] changed order of operations to fix bug --- src/data/layers/paper.tsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/data/layers/paper.tsx b/src/data/layers/paper.tsx index 0bc6944..282e75c 100644 --- a/src/data/layers/paper.tsx +++ b/src/data/layers/paper.tsx @@ -153,7 +153,7 @@ const layer = createLayer(id, function (this: BaseLayer) { if (Decimal.gte(v, 100)) v = Decimal.mul(v, 100).root(2); if (options.elfName === "Star" || options.elfName === "Bell") v = Decimal.root(v, 2); - if (options.elfName === "Star" && Decimal.gte(v, 10)) v = v.mul(10).log10(); + if (options.elfName === "Star" && Decimal.gte(v, 10)) v = v.log10().mul(10); return Decimal.isNaN(v) ? Decimal.dZero : v.floor().max(0); }, style: "width: 600px", From e99391a9bb1e043e409c2fe922da294da427fe5d Mon Sep 17 00:00:00 2001 From: unsoftcapped3 <75136164+unsoftcapped3@users.noreply.github.com> Date: Wed, 14 Dec 2022 12:08:36 -0800 Subject: [PATCH 44/48] remove off by 1 eeror --- src/data/layers/elves.tsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/data/layers/elves.tsx b/src/data/layers/elves.tsx index b4e2f91..cf8e6e2 100644 --- a/src/data/layers/elves.tsx +++ b/src/data/layers/elves.tsx @@ -587,7 +587,7 @@ const layer = createLayer(id, function (this: BaseLayer) { buyable => { const buyAmount = Decimal.min( Decimal.sub( - buyable.inverseCost(buyable.resource?.value), + buyable.inverseCost(buyable.resource?.value).add(1), buyable.amount.value ), maxBuyAmount From 5efb6c65a76480bf6c564058bd6d7fee7ac8b956 Mon Sep 17 00:00:00 2001 From: circle-gon <97845741+circle-gon@users.noreply.github.com> Date: Wed, 14 Dec 2022 15:49:35 -0500 Subject: [PATCH 45/48] fixes type error --- src/data/layers/elves.tsx | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/data/layers/elves.tsx b/src/data/layers/elves.tsx index cf8e6e2..0770aec 100644 --- a/src/data/layers/elves.tsx +++ b/src/data/layers/elves.tsx @@ -587,9 +587,9 @@ const layer = createLayer(id, function (this: BaseLayer) { buyable => { const buyAmount = Decimal.min( Decimal.sub( - buyable.inverseCost(buyable.resource?.value).add(1), + buyable.inverseCost(buyable.resource?.value), buyable.amount.value - ), + ).add(1), maxBuyAmount ); From df91f98c6a60384fd73656e648f9b774a8aae98c Mon Sep 17 00:00:00 2001 From: adsaf123 <87658415+adsaf123@users.noreply.github.com> Date: Wed, 14 Dec 2022 21:56:26 +0100 Subject: [PATCH 46/48] Update workshop.tsx --- 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 17b66c9..2f945f5 100644 --- a/src/data/layers/workshop.tsx +++ b/src/data/layers/workshop.tsx @@ -94,7 +94,7 @@ const layer = createLayer(id, function (this: BaseLayer) { management.elfTraining.expandersElfTraining.milestones[2].earned.value ), canClick: () => - Decimal.gte(trees.logs.value, foundationConversion.currentAt.value) && + Decimal.gte(trees.logs.value, foundationConversion.nextAt.value) && (Decimal.lt(foundationProgress.value, 100) || management.elfTraining.expandersElfTraining.milestones[2].earned.value), onClick() { From 0b3cebee3f13b74b57a70ae02be1a8b295095978 Mon Sep 17 00:00:00 2001 From: circle-gon <97845741+circle-gon@users.noreply.github.com> Date: Wed, 14 Dec 2022 23:29:57 +0000 Subject: [PATCH 47/48] remove off by 1 eeror --- src/data/layers/elves.tsx | 2 +- src/data/layers/management.tsx | 12 ++++++++---- src/data/layers/workshop.tsx | 2 +- 3 files changed, 10 insertions(+), 6 deletions(-) diff --git a/src/data/layers/elves.tsx b/src/data/layers/elves.tsx index b4e2f91..0770aec 100644 --- a/src/data/layers/elves.tsx +++ b/src/data/layers/elves.tsx @@ -589,7 +589,7 @@ const layer = createLayer(id, function (this: BaseLayer) { Decimal.sub( buyable.inverseCost(buyable.resource?.value), buyable.amount.value - ), + ).add(1), maxBuyAmount ); diff --git a/src/data/layers/management.tsx b/src/data/layers/management.tsx index 1123408..8469cfc 100644 --- a/src/data/layers/management.tsx +++ b/src/data/layers/management.tsx @@ -180,15 +180,19 @@ const layer = createLayer(id, () => { if (elf.name == "Star" || elf.name == "Bell") { costMulti /= 3; } - const costBase = Decimal.mul(paperElfMilestones[3].earned.value ? 2000 : 4000, costMulti); - const expRequiredForNextLevel = computed(() => Decimal.pow(5, level.value).mul(costBase)); + const costBase = computed(() => { + return Decimal.mul(paperElfMilestones[3].earned.value ? 2000 : 4000, costMulti); + }); + const expRequiredForNextLevel = computed(() => + Decimal.pow(5, level.value).mul(costBase.value) + ) const level = computed(() => - Decimal.affordGeometricSeries(exp.value, costBase, 5, 0) + Decimal.affordGeometricSeries(exp.value, costBase.value, 5, 0) .min(schools.amount.value) .toNumber() ); const expToNextLevel = computed(() => - Decimal.sub(exp.value, Decimal.sumGeometricSeries(level.value, costBase, 5, 0)) + Decimal.sub(exp.value, Decimal.sumGeometricSeries(level.value, costBase.value, 5, 0)) ); const bar = createBar(() => ({ direction: Direction.Right, diff --git a/src/data/layers/workshop.tsx b/src/data/layers/workshop.tsx index 17b66c9..2f945f5 100644 --- a/src/data/layers/workshop.tsx +++ b/src/data/layers/workshop.tsx @@ -94,7 +94,7 @@ const layer = createLayer(id, function (this: BaseLayer) { management.elfTraining.expandersElfTraining.milestones[2].earned.value ), canClick: () => - Decimal.gte(trees.logs.value, foundationConversion.currentAt.value) && + Decimal.gte(trees.logs.value, foundationConversion.nextAt.value) && (Decimal.lt(foundationProgress.value, 100) || management.elfTraining.expandersElfTraining.milestones[2].earned.value), onClick() { From 0e9d09fc6a1dfd3ccc353aa2941017d5c8d38f60 Mon Sep 17 00:00:00 2001 From: unsoftcapped3 <75136164+unsoftcapped3@users.noreply.github.com> Date: Wed, 14 Dec 2022 15:44:11 -0800 Subject: [PATCH 48/48] You need to start the scaling at a lower amount, like in this case, 10 instead of 100. --- src/data/layers/oil.tsx | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/data/layers/oil.tsx b/src/data/layers/oil.tsx index cdcfc8e..89df301 100644 --- a/src/data/layers/oil.tsx +++ b/src/data/layers/oil.tsx @@ -227,14 +227,14 @@ const layer = createLayer(id, function (this: BaseLayer) { resource: metal.metal, cost() { let v = new Decimal(this.amount.value); - if (Decimal.gte(v, 100)) v = Decimal.pow(v, 4).div(100**3); + if (Decimal.gte(v, 10)) v = Decimal.pow(v, 4).div(10**3); v = Decimal.pow(0.95, paper.books.heavyDrillBook.totalAmount.value).times(v); return Decimal.pow(8, v).times(2e5); }, inverseCost(x: DecimalSource) { let v = Decimal.div(x, 2e5).log(8); v = v.div(Decimal.pow(0.95, paper.books.heavyDrillBook.totalAmount.value)); - if (Decimal.gte(v, 100)) v = Decimal.mul(v, 100**3).root(4); + if (Decimal.gte(v, 10)) v = Decimal.mul(v, 10**3).root(4); return Decimal.isNaN(v) ? Decimal.dZero : v.floor().max(0); }, display: jsx(() => (