From c01808e46ce713bdb069267b3c6c47d0d7f7591a Mon Sep 17 00:00:00 2001 From: Jacorb90 <39597610+Jacorb90@users.noreply.github.com> Date: Sat, 10 Dec 2022 02:10:38 -0500 Subject: [PATCH] Created Dye Layer --- src/data/common.tsx | 5 +- src/data/layers/boxes.tsx | 7 +- src/data/layers/coal.tsx | 5 +- src/data/layers/dyes.tsx | 553 ++++++++++++++++++++++++++++++++++++ src/data/layers/metal.tsx | 23 ++ src/data/layers/oil.tsx | 21 +- src/data/layers/paper.tsx | 6 + src/data/layers/plastic.tsx | 6 + src/data/layers/trees.tsx | 11 + src/data/projEntry.tsx | 12 +- 10 files changed, 636 insertions(+), 13 deletions(-) create mode 100644 src/data/layers/dyes.tsx diff --git a/src/data/common.tsx b/src/data/common.tsx index df7094c..a223ada 100644 --- a/src/data/common.tsx +++ b/src/data/common.tsx @@ -417,8 +417,9 @@ export function setUpDailyProgressTracker(options: { display: VueFeature | CoercableComponent; }; usingLog?: Ref; + ignoreTotal?: boolean }) { - const total = trackTotal(options.resource); + const total = options.ignoreTotal ? options.resource : trackTotal(options.resource); const progressFunc = () => { if (main.day.value !== options.day) return 1; let progress = Decimal.add(total.value, 1); @@ -452,7 +453,7 @@ export function setUpDailyProgressTracker(options: {
{main.day.value === options.day ? ( <> - Reach {formatWhole(options.goal)} total {options.resource.displayName} to + Reach {formatWhole(options.goal)} {options.ignoreTotal ? "" : ("total ")}{options.resource.displayName} to complete the day ) : ( diff --git a/src/data/layers/boxes.tsx b/src/data/layers/boxes.tsx index 9a0254e..c28ce6a 100644 --- a/src/data/layers/boxes.tsx +++ b/src/data/layers/boxes.tsx @@ -21,6 +21,7 @@ import { unref } from "vue"; import paper from "./paper"; import plastic from "./plastic"; import trees from "./trees"; +import dyes from "./dyes"; const id = "boxes"; const day = 6; @@ -144,7 +145,7 @@ const layer = createLayer(id, function (this: BaseLayer) { cost() { let v = this.amount.value; v = Decimal.pow(0.95, paper.books.boxBook.amount.value).times(v); - return Decimal.pow(3, v).times(100); + return Decimal.pow(3, v).times(100).div(dyes.boosts.orange2.value); }, visibility: () => showIf(logsUpgrade.bought.value) })) as GenericBuyable & { resource: Resource }; @@ -160,7 +161,7 @@ const layer = createLayer(id, function (this: BaseLayer) { cost() { let v = this.amount.value; v = Decimal.pow(0.95, paper.books.boxBook.amount.value).times(v); - return Decimal.pow(5, v).times(1000); + return Decimal.pow(5, v).times(1000).div(dyes.boosts.orange2.value);; }, visibility: () => showIf(ashUpgrade.bought.value) })) as GenericBuyable & { resource: Resource }; @@ -176,7 +177,7 @@ const layer = createLayer(id, function (this: BaseLayer) { cost() { let v = this.amount.value; v = Decimal.pow(0.95, paper.books.boxBook.amount.value).times(v); - return Decimal.pow(7, v).times(1000); + return Decimal.pow(7, v).times(1000).div(dyes.boosts.orange2.value); }, visibility: () => showIf(coalUpgrade.bought.value) })) as GenericBuyable & { resource: Resource }; diff --git a/src/data/layers/coal.tsx b/src/data/layers/coal.tsx index ead1e0e..3cde479 100644 --- a/src/data/layers/coal.tsx +++ b/src/data/layers/coal.tsx @@ -37,6 +37,7 @@ import metal from "./metal"; import oil from "./oil"; import paper from "./paper"; import trees from "./trees"; +import dyes from "./dyes"; interface BetterFertilizerUpgOptions { canAfford: () => boolean; @@ -551,7 +552,7 @@ const layer = createLayer(id, function (this: BaseLayer) { enabled: elves.elves.bonfireElf.bought })), createMultiplicativeModifier(() => ({ - multiplier: () => Decimal.div(buildKiln.amount.value, 100).add(1), + multiplier: () => Decimal.div(buildKiln.amount.value, 100).times(dyes.boosts.green2.value).add(1), description: "Kiln Synergy", enabled: elves.elves.kilnElf.bought })), @@ -643,7 +644,7 @@ const layer = createLayer(id, function (this: BaseLayer) { enabled: elves.elves.bonfireElf.bought })), createMultiplicativeModifier(() => ({ - multiplier: () => Decimal.div(buildKiln.amount.value, 100).add(1), + multiplier: () => Decimal.div(buildKiln.amount.value, 100).times(dyes.boosts.green2.value).add(1), description: "Kiln Synergy", enabled: elves.elves.kilnElf.bought })), diff --git a/src/data/layers/dyes.tsx b/src/data/layers/dyes.tsx new file mode 100644 index 0000000..25ccc47 --- /dev/null +++ b/src/data/layers/dyes.tsx @@ -0,0 +1,553 @@ +/** + * @module + * @hidden + */ +import Modal from "components/Modal.vue"; +import MainDisplay from "features/resources/MainDisplay.vue"; +import Spacer from "components/layout/Spacer.vue"; +import { BuyableOptions, GenericBuyable, createBuyable } from "features/buyable"; +import { jsx, JSXFunction, Visibility } from "features/feature"; +import { createResource, Resource } from "features/resources/resource"; +import { globalBus } from "game/events"; +import { BaseLayer, createLayer } from "game/layers"; +import { noPersist, persistent } from "game/persistence"; +import Decimal, { DecimalSource, format, formatWhole } from "util/bignum"; +import { computed, ComputedRef, ref, Ref, unref } from "vue"; +import trees from "./trees"; +import oil from "./oil"; +import { coerceComponent, render, renderCol, renderRow } from "util/vue"; +import { setUpDailyProgressTracker, createCollapsibleModifierSections } from "data/common"; +import { createAdditiveModifier, createMultiplicativeModifier, createSequentialModifier, Modifier } from "game/modifiers"; +import { WithRequired } from "util/common"; +import { createUpgrade, GenericUpgrade } from "features/upgrades/upgrade"; +import { createLazyProxy } from "util/proxies"; +import coal from "./coal"; + +interface Dye { + name: string, + amount: Resource, + buyable: GenericBuyable, + toGenerate: WithRequired, + computedToGenerate: ComputedRef, + display: JSXFunction +} + +type DyeUpg = "blueDyeUpg" | "redDyeUpg" | "yellowDyeUpg" | "yellowDyeUpg2" | "redDyeUpg2" | "blueDyeUpg2" | "coalUpg" + +const id = "dyes"; +const day = 11; +const layer = createLayer(id, function (this: BaseLayer) { + const name = "Dyes"; + const color = "#D4D4F4"; + + function createDye( + optionsFunc: () => { + name: string; + color: string; + costs: { + base: Ref | DecimalSource; + root?: Ref | DecimalSource, + res: Resource + }[]; + listedBoosts: { + visible: Ref | boolean, + desc: Ref + }[]; + dyesToReset: { + name: string, + reset: VoidFunction + }[] + } & Partial + ): Dye { + return createLazyProxy(() => { + const options = optionsFunc(); + + const amount = createResource(0, optionsFunc().name); + const toGenerate = createSequentialModifier(() => [ + createAdditiveModifier(() => ({ + addend: () => Decimal.add(buyable.amount.value, 1), + description: `${options.name} Chambers` + })), + createMultiplicativeModifier(() => ({ + multiplier: boosts.orange1, + description: "Orange Dye Boost 1", + enabled: options.color == "red" || options.color == "yellow" + })), + createMultiplicativeModifier(() => ({ + multiplier: boosts.green1, + description: "Green Dye Boost 1", + enabled: options.color == "yellow" || options.color == "blue" + })), + createMultiplicativeModifier(() => ({ + multiplier: boosts.purple1, + description: "Purple Dye Boost 1", + enabled: options.color == "red" || options.color == "blue" + })), + createMultiplicativeModifier(() => ({ + multiplier: 2, + description: "Wetter Dyes", + enabled: () => upgrades.yellowDyeUpg.bought.value && options.color == "red" || options.color == "yellow" || options.color == "blue" + })) + ]) as WithRequired; + const computedToGenerate = computed(() => toGenerate.apply(0)); + + const buyable: GenericBuyable = createBuyable(() => ({ + ...options, + style: () => ({ backgroundColor: unref(buyable.canPurchase) ? color : "#545454", minWidth: "200px" }), + display: jsx(() => { + return ( + +

{options.name} Chambers

+
+ Create {format(computedToGenerate.value)} {options.name}{options.dyesToReset.length > 0 ? ", but reset " + options.dyesToReset.map(dye => dye.name).join(", ") : ""}. +
+ + Currently: {options.listedBoosts.filter(b => unref(b.visible)).map(b => render(jsx(() =>
{unref(b.desc)}
)))} +
+
+ Cost: {options.costs.map(c => render(jsx(() => +
+ {format(unref(Decimal.pow(unref(buyable.cost) ?? Decimal.dInf, unref(c.root ?? 1)).times(unref(c.base))))} + {" "}{c.res.displayName}
+
)))} +
+
+ ); + }), + cost() { + let v = buyable.amount.value; + if (Decimal.gte(v, 25)) v = Decimal.pow(v, 2).div(20) // intentional price jump #2 + if (Decimal.gte(v, 10)) v = Decimal.pow(v, 2).div(5); // intentional price jump + return Decimal.div(v, 10).plus(1); + }, + canPurchase: computed((cost?: DecimalSource) => { + if (unref(buyable.visibility) != Visibility.Visible) return false; + const trueCost = cost ?? unref(buyable.cost) ?? Decimal.dInf; + return options.costs.every(c => Decimal.div(c.res.value, unref(c.base)).root(unref(c.root ?? 1)).gte(trueCost)); + }), + onPurchase(cost?: DecimalSource) { + const trueCost = cost ?? unref(buyable.cost) ?? Decimal.dInf; + options.costs.forEach(c => { + c.res.value = Decimal.sub(c.res.value, Decimal.pow(trueCost, unref(c.root ?? 1)).times(unref(c.base))); + }); + + amount.value = Decimal.add(amount.value, computedToGenerate.value); + buyable.amount.value = Decimal.add(buyable.amount.value, 1); + + options.dyesToReset.forEach(dye => dye.reset()); + } + })); + + return { + name: options.name, + amount, + buyable, + toGenerate, + computedToGenerate, + display: jsx(() => ( +
+ + + {render(buyable)} +
+ )) + } + }) + } + + const dyes: Record<"red" | "yellow" | "blue" | "orange" | "green" | "purple", Dye> = { + red: createDye(() => ({ + name: "Red Dye", + color: "red", + costs: [ + { + base: '2e18', + root: 5, + res: trees.logs + }, + { + base: computed(() => upgrades.yellowDyeUpg2.bought.value ? '2.5e5' : '5e5'), + root: 2, + res: oil.oil + } + ], + listedBoosts: [ + { + visible: true, + desc: computed(() => `Increase effective Oil Pumps by ${format(boosts.red1.value)} (does not impact coal consumption)`) + } + ], + dyesToReset: [], + })), + yellow: createDye(() => ({ + name: "Yellow Dye", + color: "yellow", + costs: [ + { + base: '1e18', + root: 5, + res: trees.logs + }, + { + base: computed(() => upgrades.yellowDyeUpg2.bought.value ? '5e5' : '1e6'), + root: 2, + res: oil.oil + } + ], + listedBoosts: [ + { + visible: true, + desc: computed(() => `Multiply Paper \& Plastic gain by ${format(boosts.yellow1.value)}`) + } + ], + dyesToReset: [], + })), + blue: createDye(() => ({ + name: "Blue Dye", + color: "blue", + costs: [ + { + base: '5e17', + root: 5, + res: trees.logs + }, + { + base: computed(() => upgrades.yellowDyeUpg2.bought.value ? '1e6' : '2e6'), + root: 2, + res: oil.oil + } + ], + listedBoosts: [ + { + visible: true, + desc: computed(() => `Add ${formatWhole(boosts.blue1.value)} trees to the forest (after all other modifiers).`) + } + ], + dyesToReset: [], + })), + orange: createDye(() => ({ + name: "Orange Dye", + color: "orange", + costs: [ + { + base: 15, + root: 2, + res: dyes.red.amount + }, + { + base: 10, + root: 2, + res: dyes.yellow.amount + } + ], + listedBoosts: [ + { + visible: true, + desc: computed(() => `Multiply Red and Yellow Dye gain by ${format(boosts.orange1.value)}`) + }, + { + visible: true, + desc: computed(() => `Divide Box buyable costs by ${format(boosts.orange2.value)}.`) + } + ], + dyesToReset: [{ + name: "Red Dye", + reset() { + dyes.red.amount.value = 0; + dyes.red.buyable.amount.value = 0; + } + }, { + name: "Yellow Dye", + reset() { + dyes.yellow.amount.value = 0; + dyes.yellow.buyable.amount.value = 0; + } + }], + })), + green: createDye(() => ({ + name: "Green Dye", + color: "green", + costs: [ + { + base: 15, + root: 2, + res: dyes.yellow.amount + }, + { + base: 10, + root: 2, + res: dyes.blue.amount + } + ], + listedBoosts: [ + { + visible: true, + desc: computed(() => `Multiply Yellow and Blue Dye gain by ${format(boosts.green1.value)}`) + }, + { + visible: true, + desc: computed(() => `Kiln synergy to Coal and Ash gain is ${formatWhole(Decimal.sub(boosts.green2.value, 1).times(100))}% stronger.`) + } + ], + dyesToReset: [{ + name: "Yellow Dye", + reset() { + dyes.yellow.amount.value = 0; + dyes.yellow.buyable.amount.value = 0; + } + },{ + name: "Blue Dye", + reset() { + dyes.blue.amount.value = 0; + dyes.blue.buyable.amount.value = 0; + } + }], + })), + purple: createDye(() => ({ + name: "Purple Dye", + color: "purple", + costs: [ + { + base: 15, + root: 2, + res: dyes.blue.amount + }, + { + base: 10, + root: 2, + res: dyes.red.amount + } + ], + listedBoosts: [ + { + visible: true, + desc: computed(() => `Multiply Red and Blue Dye gain by ${format(boosts.purple1.value)}`) + }, + { + visible: true, + desc: computed(() => `Multiply Smelting Speed and Ore Purity by ${format(boosts.purple2.value)}`) + } + ], + dyesToReset: [{ + name: "Blue Dye", + reset() { + dyes.blue.amount.value = 0; + dyes.blue.buyable.amount.value = 0; + } + }, { + name: "Red Dye", + reset() { + dyes.red.amount.value = 0; + dyes.red.buyable.amount.value = 0; + } + }], + })) + }; + + const boosts = { + red1: computed(() => Decimal.pow(Decimal.add(dyes.red.amount.value, 1).log2().plus(1).log2().div(2), upgrades.blueDyeUpg2.bought.value ? 1.5 : 1)), + yellow1: computed(() => Decimal.add(dyes.yellow.amount.value, 1).log2().plus(1)), + 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)), + 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)), + green2: computed(() => Decimal.add(dyes.green.amount.value, 1).log2().plus(1).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)), + purple2: computed(() => Decimal.add(dyes.purple.amount.value, 1).log2().plus(1)), + } + + const [generalTab, generalTabCollapsed] = createCollapsibleModifierSections(() => [ + { + title: "Red Dye Creation", + modifier: dyes.red.toGenerate, + base: 0 + }, + { + title: "Yellow Dye Creation", + modifier: dyes.yellow.toGenerate, + base: 0 + }, + { + title: "Blue Dye Creation", + modifier: dyes.blue.toGenerate, + base: 0 + }, + { + title: "Orange Dye Creation", + modifier: dyes.orange.toGenerate, + base: 0 + }, + { + title: "Green Dye Creation", + modifier: dyes.green.toGenerate, + base: 0 + }, + { + title: "Purple Dye Creation", + modifier: dyes.purple.toGenerate, + base: 0 + } + ]); + + const upgrades: Record = { + blueDyeUpg: createUpgrade(() => ({ + visibility: () => (Decimal.add(dyes.orange.amount.value, dyes.green.amount.value).add(dyes.purple.amount.value).gte(1) || upgrades.blueDyeUpg.bought.value) ? Visibility.Visible : Visibility.Hidden, + display: { + title: "Is Blue Dye just Water?", + description: "Multiply Log gain by log(Auto Cutting Amount)+1." + }, + cost: 1000, + resource: dyes.blue.amount, + onPurchase() { + dyes.blue.amount.value = 0; + dyes.blue.buyable.amount.value = 0; + } + })), + redDyeUpg: createUpgrade(() => ({ + visibility: () => (Decimal.add(dyes.orange.amount.value, dyes.green.amount.value).add(dyes.purple.amount.value).gte(10) || upgrades.redDyeUpg.bought.value) ? Visibility.Visible : Visibility.Hidden, + display: { + title: "Glistening Paint", + description: "Multiply Ore Purity by log(Cloth)+1." + }, + cost: 1500, + resource: dyes.red.amount, + onPurchase() { + dyes.red.amount.value = 0; + dyes.red.buyable.amount.value = 0; + } + })), + yellowDyeUpg: createUpgrade(() => ({ + visibility: () => (Decimal.add(dyes.orange.amount.value, dyes.green.amount.value).add(dyes.purple.amount.value).gte(100) || upgrades.yellowDyeUpg.bought.value) ? Visibility.Visible : Visibility.Hidden, + display: { + title: "Wetter Dyes", + description: "Double Red, Yellow, and Blue Dye gain, but reset their amounts." + }, + cost: 2000, + resource: dyes.yellow.amount, + onPurchase() { + dyes.red.amount.value = 0; + dyes.red.buyable.amount.value = 0; + + dyes.yellow.amount.value = 0; + dyes.yellow.buyable.amount.value = 0; + + dyes.blue.amount.value = 0; + dyes.blue.buyable.amount.value = 0; + } + })), + yellowDyeUpg2: createUpgrade(() => ({ + visibility: () => upgrades.yellowDyeUpg.bought.value ? Visibility.Visible : Visibility.Hidden, + display: { + title: "Golden Wash", + description: "Halve the Oil cost of Red, Yellow, and Blue Dyes." + }, + cost: 5000, + resource: dyes.yellow.amount, + onPurchase() { + dyes.yellow.amount.value = 0; + dyes.yellow.buyable.amount.value = 0; + } + })), + redDyeUpg2: createUpgrade(() => ({ + visibility: () => upgrades.redDyeUpg.bought.value ? Visibility.Visible : Visibility.Hidden, + display: { + title: "De Louvre", + description: "Multiply Smelting Speed by sqrt(Refineries+1)" + }, + cost: 6000, + resource: dyes.red.amount, + onPurchase() { + dyes.red.amount.value = 0; + dyes.red.buyable.amount.value = 0; + } + })), + blueDyeUpg2: createUpgrade(() => ({ + visibility: () => upgrades.blueDyeUpg.bought.value ? Visibility.Visible : Visibility.Hidden, + display: { + title: "Hydrophobia", + description: "Raise Red Dye's effect ^1.5." + }, + cost: 7500, + resource: dyes.blue.amount, + onPurchase() { + dyes.blue.amount.value = 0; + dyes.blue.buyable.amount.value = 0; + } + })), + coalUpg: createUpgrade(() => ({ + visibility: () => (upgrades.blueDyeUpg2.bought.value && upgrades.redDyeUpg2.bought.value && upgrades.yellowDyeUpg2.bought.value) ? Visibility.Visible : Visibility.Hidden, + display: { + title: "Denser Spectrum", + description: "Orange, Green, and Purple Dyes' first effect is raised ^1.2, and Green Dye's second effect is squared." + }, + cost: "5e30", + resource: coal.coal, + onPurchase() { + dyes.red.amount.value = 0; + dyes.red.buyable.amount.value = 0; + + dyes.yellow.amount.value = 0; + dyes.yellow.buyable.amount.value = 0; + + dyes.blue.amount.value = 0; + dyes.blue.buyable.amount.value = 0; + } + })) + } + + const showModifiersModal = ref(false); + const modifiersModal = jsx(() => ( + (showModifiersModal.value = value)} + v-slots={{ + header: () =>

{name} Modifiers

, + body: generalTab + }} + /> + )); + + const dyeSum = createResource(computed(() => Object.values(dyes).reduce((a,c) => Decimal.add(a, c.amount.value), 0)), "Sum of Dyes"); + + const { total: totalDyeSum, trackerDisplay } = setUpDailyProgressTracker({ + resource: dyeSum, + goal: 6e4, + name, + day, + color, + textColor: "var(--feature-foreground)", + modal: { + show: showModifiersModal, + display: modifiersModal + }, + ignoreTotal: true + }); + + return { + name, + color, + dyes, + dyeSum, + boosts, + totalDyeSum, + minWidth: 700, + generalTabCollapsed, + upgrades, + display: jsx(() => ( + <> + {render(trackerDisplay)} + + {renderRow(dyes.red.display, dyes.yellow.display, dyes.blue.display)} + + {renderRow(dyes.orange.display, dyes.green.display, dyes.purple.display)} + + {renderRow(upgrades.redDyeUpg, upgrades.yellowDyeUpg, upgrades.blueDyeUpg)} + {renderRow(upgrades.redDyeUpg2, upgrades.yellowDyeUpg2, upgrades.blueDyeUpg2)} + {render(upgrades.coalUpg)} + + )) + } +}); + +export default layer; \ No newline at end of file diff --git a/src/data/layers/metal.tsx b/src/data/layers/metal.tsx index d4a1c98..84a9c2a 100644 --- a/src/data/layers/metal.tsx +++ b/src/data/layers/metal.tsx @@ -27,6 +27,9 @@ import { createBuyable, GenericBuyable } from "features/buyable"; import { main } from "../projEntry"; import oil from "./oil"; import boxes from "./boxes"; +import cloth from "./cloth"; +import plastic from "./plastic"; +import dyes from "./dyes"; const id = "metal"; const day = 7; @@ -65,6 +68,16 @@ const layer = createLayer(id, function (this: BaseLayer) { multiplier: 2, description: "Carry metal in boxes", enabled: boxes.row2Upgrades.metalUpgrade.bought + })), + createMultiplicativeModifier(() => ({ + multiplier: dyes.boosts.purple2, + description: "Purple Dye Boost 2", + enabled: () => Decimal.gte(dyes.dyes.purple.amount.value, 1) + })), + createMultiplicativeModifier(() => ({ + multiplier: () => Decimal.add(cloth.cloth.value, 1).log10().plus(1), + description: "Glistening Paint", + enabled: dyes.upgrades.redDyeUpg.bought })) ]); const computedOrePurity = computed(() => orePurity.apply(0.1)); @@ -85,6 +98,16 @@ const layer = createLayer(id, function (this: BaseLayer) { Decimal.mul(oil.activeSmelter.value, oil.oilEffectiveness.value).add(1), description: "Oil Smelter", enabled: () => Decimal.gt(oil.activeSmelter.value, 0) + })), + createMultiplicativeModifier(() => ({ + multiplier: dyes.boosts.purple2, + description: "Purple Dye Boost 2", + enabled: () => Decimal.gte(dyes.dyes.purple.amount.value, 1) + })), + createMultiplicativeModifier(() => ({ + multiplier: () => Decimal.add(plastic.activeRefinery.value, 1).sqrt(), + description: "De Louvre", + enabled: dyes.upgrades.redDyeUpg2.bought })) ]); const computedAutoSmeltSpeed = computed(() => autoSmeltSpeed.apply(0)); diff --git a/src/data/layers/oil.tsx b/src/data/layers/oil.tsx index 72a412d..4535895 100644 --- a/src/data/layers/oil.tsx +++ b/src/data/layers/oil.tsx @@ -34,6 +34,7 @@ import { createMilestone, GenericMilestone } from "features/milestones/milestone import { formatGain } from "util/bignum"; import plastic from "./plastic"; import paper from "./paper"; +import dyes from "./dyes"; const id = "oil"; const day = 9; @@ -223,7 +224,8 @@ const layer = createLayer(id, function (this: BaseLayer) { Decimal.pow(row2Upgrades[3].bought.value ? 4 : 5, activePump.value) ); const pumpOil = computed(() => - Decimal.pow(activePump.value, 2) + Decimal.add(activePump.value, computedExtraOilPumps.value) + .pow(2) .mul(activeHeavy.value) .mul(Decimal.add(activeHeavy2.value, 1)) .mul(activeExtractor.value) @@ -753,6 +755,15 @@ const layer = createLayer(id, function (this: BaseLayer) { ]); const computedOilSubstitution = computed(() => oilSubstitution.apply(0)); + const extraOilPumps = createSequentialModifier(() => [ + createAdditiveModifier(() => ({ + addend: dyes.boosts.red1, + description: "Red Dye Boost 1", + enabled: () => Decimal.gte(dyes.dyes.red.amount.value, 1) + })) + ]) + const computedExtraOilPumps = computed(() => extraOilPumps.apply(0)); + const [generalTab, generalTabCollapsed] = createCollapsibleModifierSections(() => [ { title: "Coal Consumption", @@ -799,6 +810,14 @@ const layer = createLayer(id, function (this: BaseLayer) { visible() { return Decimal.gt(computedOilSubstitution.value, 0); } + }, + { + title: "Extra Oil Pumps", + modifier: extraOilPumps, + base: 0, + visible() { + return Decimal.gt(computedExtraOilPumps.value, 0) + } } ]); const showModifiersModal = ref(false); diff --git a/src/data/layers/paper.tsx b/src/data/layers/paper.tsx index 0db2d63..2f257c2 100644 --- a/src/data/layers/paper.tsx +++ b/src/data/layers/paper.tsx @@ -26,6 +26,7 @@ import coal from "./coal"; import elves from "./elves"; import plastic from "./plastic"; import trees from "./trees"; +import dyes from "./dyes"; const id = "paper"; const day = 5; @@ -243,6 +244,11 @@ const layer = createLayer(id, function (this: BaseLayer) { multiplier: 10, description: "Felt Elbow Pads", enabled: cloth.paperUpgrades.paperUpgrade4.bought + })), + createMultiplicativeModifier(() => ({ + multiplier: dyes.boosts.yellow1, + description: "Yellow Dye Boost 1", + enabled: () => Decimal.gte(dyes.dyes.yellow.amount.value, 1) })) ]) as WithRequired; diff --git a/src/data/layers/plastic.tsx b/src/data/layers/plastic.tsx index 0512690..3e3717e 100644 --- a/src/data/layers/plastic.tsx +++ b/src/data/layers/plastic.tsx @@ -31,6 +31,7 @@ import { computed, ref, unref } from "vue"; import boxes from "./boxes"; import metal from "./metal"; import oil from "./oil"; +import dyes from "./dyes"; const id = "plastic"; const day = 10; @@ -251,6 +252,11 @@ const layer = createLayer(id, function (this: BaseLayer) { multiplier: () => oil.oilEffectiveness.value, description: "Effectiveness", enabled: () => Decimal.lt(oil.oilEffectiveness.value, 1) + })), + createMultiplicativeModifier(() => ({ + multiplier: dyes.boosts.yellow1, + description: "Yellow Dye Boost 1", + enabled: () => Decimal.gte(dyes.dyes.yellow.amount.value, 1) })) ]); const computedPlasticGain = computed(() => plasticGain.apply(0)); diff --git a/src/data/layers/trees.tsx b/src/data/layers/trees.tsx index 4db898d..86e3333 100644 --- a/src/data/layers/trees.tsx +++ b/src/data/layers/trees.tsx @@ -34,6 +34,7 @@ import coal from "./coal"; import elves from "./elves"; import paper from "./paper"; import workshop from "./workshop"; +import dyes from "./dyes"; const id = "trees"; const day = 1; @@ -76,6 +77,11 @@ const layer = createLayer(id, function (this: BaseLayer) { multiplier: 4, description: "Lumberjack Boots", enabled: cloth.treesUpgrades.treesUpgrade1.bought + })), + createAdditiveModifier(() => ({ + addend: dyes.boosts.blue1, + description: "Blue Dye Boost 1", + enabled: () => Decimal.gte(dyes.dyes.blue.amount.value, 1) })) ]) as WithRequired; const trees = createResource( @@ -419,6 +425,11 @@ const layer = createLayer(id, function (this: BaseLayer) { description: "Felt-Gripped Axe", enabled: cloth.treesUpgrades.treesUpgrade4.bought })), + createMultiplicativeModifier(() => ({ + multiplier: computed(() => Decimal.add(computedAutoCuttingAmount.value, 1).log10().plus(1)), + description: "Is Blue Dye just Water?", + enabled: dyes.upgrades.blueDyeUpg.bought + })), createExponentialModifier(() => ({ exponent: 1.2, description: "100% Foundation Completed", diff --git a/src/data/projEntry.tsx b/src/data/projEntry.tsx index 576ab11..25ec534 100644 --- a/src/data/projEntry.tsx +++ b/src/data/projEntry.tsx @@ -38,6 +38,7 @@ 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"; export interface Day extends VueFeature { day: number; @@ -247,10 +248,10 @@ export const main = createLayer("main", function (this: BaseLayer) { createDay(() => ({ day: 11, shouldNotify: false, - layer: null, // "dyes" - symbol: "", - story: "", - completedStory: "" + layer: "dyes", + symbol: "", // TODO: Add symbol for dyes + story: "To make toys, we're going to need some color to make them look nice and enticing! We can't just give kids clear toys after all! To add some color to our toys, we'll need some dyes!", + completedStory: "After all that effort, you finally have a rainbow of dyes to choose from! Now the children won't be able to resist the toys you have to offer, once you get them made of course..." })), createDay(() => ({ day: 12, @@ -426,7 +427,8 @@ export const getInitialLayers = ( metal, cloth, oil, - plastic + plastic, + dyes ]; /**