From 6a9e3cc1ac03fa00d709718a5224466c2f099176 Mon Sep 17 00:00:00 2001 From: ducdat0507 <62660527+ducdat0507@users.noreply.github.com> Date: Thu, 8 Dec 2022 21:04:58 +0700 Subject: [PATCH] Oil prototype --- .vscode/settings.json | 5 +- src/data/common.tsx | 2 +- src/data/layers/cloth.tsx | 9 +- src/data/layers/coal.tsx | 43 +- src/data/layers/metal.tsx | 140 +++-- src/data/layers/oil.tsx | 1094 +++++++++++++++++++++++++++++++++++++ src/data/projEntry.tsx | 9 +- 7 files changed, 1250 insertions(+), 52 deletions(-) create mode 100644 src/data/layers/oil.tsx diff --git a/.vscode/settings.json b/.vscode/settings.json index 72e80ed..ddcd19b 100644 --- a/.vscode/settings.json +++ b/.vscode/settings.json @@ -5,5 +5,8 @@ }, "editor.defaultFormatter": "esbenp.prettier-vscode", "git.ignoreLimitWarning": true, - "typescript.tsdk": "node_modules/typescript/lib", + "[typescriptreact]": { + "editor.defaultFormatter": "vscode.typescript-language-features" + }, + "typescript.tsdk": "node_modules/typescript/lib" } \ No newline at end of file diff --git a/src/data/common.tsx b/src/data/common.tsx index e0c5b43..3ae395f 100644 --- a/src/data/common.tsx +++ b/src/data/common.tsx @@ -482,4 +482,4 @@ export function setUpDailyProgressTracker(options: { total, trackerDisplay }; -} +} \ No newline at end of file diff --git a/src/data/layers/cloth.tsx b/src/data/layers/cloth.tsx index 2c449aa..699042f 100644 --- a/src/data/layers/cloth.tsx +++ b/src/data/layers/cloth.tsx @@ -44,8 +44,9 @@ const layer = createLayer(id, function (this: BaseLayer) { width: 100, height: 10, style: "margin-top: 8px", + borderStyle: "border-color: black", baseStyle: "margin-top: 0", - fillStyle: "margin-top: 0; transition-duration: 0s", + fillStyle: "margin-top: 0; transition-duration: 0s; background: black", progress: () => Decimal.div(breedingProgress.value, computedBreedingCooldown.value) })); const breeding = createClickable(() => ({ @@ -79,8 +80,9 @@ const layer = createLayer(id, function (this: BaseLayer) { width: 100, height: 10, style: "margin-top: 8px", + borderStyle: "border-color: black", baseStyle: "margin-top: 0", - fillStyle: "margin-top: 0; transition-duration: 0s", + fillStyle: "margin-top: 0; transition-duration: 0s; background: black", progress: () => Decimal.div(shearingProgress.value, computedShearingCooldown.value) })); const shearing = createClickable(() => ({ @@ -114,8 +116,9 @@ const layer = createLayer(id, function (this: BaseLayer) { width: 100, height: 10, style: "margin-top: 8px", + borderStyle: "border-color: black", baseStyle: "margin-top: 0", - fillStyle: "margin-top: 0; transition-duration: 0s", + fillStyle: "margin-top: 0; transition-duration: 0s; background: black", progress: () => Decimal.div(spinningProgress.value, computedSpinningCooldown.value) })); const spinning = createClickable(() => ({ diff --git a/src/data/layers/coal.tsx b/src/data/layers/coal.tsx index bf570e1..e6ecb96 100644 --- a/src/data/layers/coal.tsx +++ b/src/data/layers/coal.tsx @@ -27,7 +27,7 @@ import { createSequentialModifier, Modifier } from "game/modifiers"; -import { createUpgrade, Upgrade } from "features/upgrades/upgrade"; +import { createUpgrade, Upgrade, UpgradeOptions } from "features/upgrades/upgrade"; import elves from "./elves"; import paper from "./paper"; import boxes from "./boxes"; @@ -35,6 +35,7 @@ import metal from "./metal"; import { cloneWithoutLoc } from "@babel/types"; import cloth from "./cloth"; import { WithRequired } from "util/common"; +import oil from "./oil"; interface BetterFertilizerUpgOptions { canAfford: () => boolean; @@ -53,6 +54,16 @@ interface UnlockKilnUpgOptions { style: StyleValue; visibility: () => Visibility; } +interface EfficientSmeltherUpgOptions { + resource: Resource; + cost: DecimalSource; + display: { + title: string; + description: string; + }; + style: StyleValue; + visibility: () => Visibility; +} const id = "coal"; const day = 3; @@ -144,8 +155,8 @@ const layer = createLayer(id, function (this: BaseLayer) { activeFires.value = buildFire.amount.value; } })); - const fireResource = createResource(buildFire.amount, "small fires"); + const activeBonfires = persistent(0); const bonfireLogs = computed(() => Decimal.times(activeBonfires.value, 10000)); const bonfireCoal = computed(() => Decimal.times(activeBonfires.value, 10)); @@ -302,7 +313,7 @@ const layer = createLayer(id, function (this: BaseLayer) { })); const activeDrills = persistent(0); - const drillCoal = computed(() => Decimal.times(activeDrills.value, 5e7)); + const drillCoal = computed(() => Decimal.times(Decimal.pow(activeDrills.value, oil.row2Upgrades[1].bought.value ? 2 : 1), 5e7).times(metal.efficientDrill.bought.value ? 2 : 1)); const buildDrill = createBuyable(() => ({ resource: metal.metal, cost() { @@ -472,6 +483,18 @@ const layer = createLayer(id, function (this: BaseLayer) { visibility: () => showIf(unlockBonfire.bought.value) })); const row2upgrades = [dedicatedCutters, dedicatedPlanters, betterFertilizer, unlockKiln]; + + const efficientSmelther: Upgrade = createUpgrade(() => ({ + resource: coal, + cost: 1e19, + display: { + title: "Efficient Crucibles", + description: "Double auto smelting speed and triple metal gain from auto smelting" + }, + style: { color: colorText }, + visibility: () => showIf(oil.depthMilestones[4].earned.value) + })); + const row3upgrades = [efficientSmelther]; const heatedCutters = createBuyable(() => ({ resource: noPersist(coal), @@ -666,7 +689,17 @@ const layer = createLayer(id, function (this: BaseLayer) { description: "3 Elves Trained", enabled: elves.milestones[2].earned, supportLowNumbers: true - })) + })), + createMultiplicativeModifier(() => ({ + multiplier: () => Decimal.mul(oil.depth.value, 0.25).add(1), + description: "5m Well Depth", + enabled: oil.depthMilestones[0].earned, + })), + createMultiplicativeModifier(() => ({ + multiplier: oil.extractorCoal, + description: "Heavy Extractor", + enabled: () => Decimal.gt(oil.activeExtractor.value, 0) + })), ]) as WithRequired; const computedCoalGain = computed(() => coalGain.apply(0)); @@ -861,6 +894,7 @@ const layer = createLayer(id, function (this: BaseLayer) { dedicatedPlanters, betterFertilizer, unlockKiln, + efficientSmelther, heatedCutters, heatedPlanters, moreFertilizer, @@ -947,6 +981,7 @@ const layer = createLayer(id, function (this: BaseLayer) { {renderRow(...row1upgrades)} {renderRow(...row2upgrades)} + {renderRow(...row3upgrades)} {renderRow(...row3buyables)} )) diff --git a/src/data/layers/metal.tsx b/src/data/layers/metal.tsx index d505f08..0ee15a5 100644 --- a/src/data/layers/metal.tsx +++ b/src/data/layers/metal.tsx @@ -25,6 +25,7 @@ import { createUpgrade, GenericUpgrade } from "features/upgrades/upgrade"; import { noPersist } from "game/persistence"; import { createBuyable, GenericBuyable } from "features/buyable"; import { main } from "../projEntry"; +import oil from "./oil"; const id = "metal"; const day = 7; @@ -67,9 +68,32 @@ const layer = createLayer(id, function (this: BaseLayer) { addend: () => Decimal.times(industrialCrucible.amount.value, 10), description: "Industrial Crucibles", enabled: () => Decimal.gte(industrialCrucible.amount.value, 1) - })) + })), + createMultiplicativeModifier(() => ({ + multiplier: 2, + description: "Efficient Crucibles", + enabled: coal.efficientSmelther.bought + })), + createMultiplicativeModifier(() => ({ + multiplier: () => Decimal.mul(oil.activeSmelter.value, oil.oilEffectiveness.value).add(1), + description: "Oil Smelter", + enabled: () => Decimal.gt(oil.activeSmelter.value, 0) + })), ]); const computedAutoSmeltSpeed = computed(() => autoSmeltSpeed.apply(0)); + const autoSmeltMulti = createSequentialModifier(() => [ + createMultiplicativeModifier(() => ({ + multiplier: 3, + description: "Efficient Crucibles", + enabled: coal.efficientSmelther.bought + })), + createMultiplicativeModifier(() => ({ + multiplier: () => Decimal.add(oil.activeBurner.value, 1).mul(oil.oilEffectiveness.value), + description: "Blaster Burner", + enabled: oil.row2Upgrades[2].bought + })), + ]); + const computedAutoSmeltMulti = computed(() => autoSmeltMulti.apply(1)); const coalCost = 1e10; const smeltableOre = computed(() => @@ -106,9 +130,9 @@ const layer = createLayer(id, function (this: BaseLayer) { minHeight: "unset" } })); - function smeltOre(amount: DecimalSource) { + function smeltOre(amount: DecimalSource, multi: DecimalSource = 1) { const [metalGain, oreConsumption, coalConsumption] = [ - Decimal.times(amount, computedOrePurity.value), + Decimal.times(amount, computedOrePurity.value).times(multi), amount, Decimal.times(amount, coalCost) ]; @@ -122,7 +146,17 @@ const layer = createLayer(id, function (this: BaseLayer) { addend: () => oreDrill.amount.value, description: "Mining Drills", enabled: () => Decimal.gte(oreDrill.amount.value, 1) - })) + })), + createMultiplicativeModifier(() => ({ + multiplier: () => Decimal.mul(oil.depth.value, 0.05).add(1), + description: "25m Well Depth", + enabled: oil.depthMilestones[2].earned, + })), + createMultiplicativeModifier(() => ({ + multiplier: oil.extractorOre, + description: "Heavy Extractor", + enabled: () => Decimal.gt(oil.activeExtractor.value, 0) + })), ]); const computedOreAmount = computed(() => oreAmount.apply(1)); const oreSpeed = createSequentialModifier(() => [ @@ -140,9 +174,19 @@ const layer = createLayer(id, function (this: BaseLayer) { multiplier: 2.5, description: "Mining Drills", enabled: () => Decimal.gte(oreDrill.amount.value, 1) + })), + createMultiplicativeModifier(() => ({ + multiplier: 2, + description: "Efficient Drills", + enabled: efficientDrill.bought + })), + createMultiplicativeModifier(() => ({ + multiplier: 2, + description: "Oil the Mining Drills", + enabled: oil.row2Upgrades[1].bought })) ]); - const computedOreSpeed = computed(() => oreSpeed.apply(1)); + const computedOreSpeed = computed(() => oreSpeed.apply(Decimal.recip(maxOreProgress))); const oreProgress = persistent(0); const maxOreProgress = 10; const oreBar = createBar(() => ({ @@ -150,7 +194,7 @@ const layer = createLayer(id, function (this: BaseLayer) { height: 25, direction: Direction.Right, fillStyle: { backgroundColor: color }, - progress: () => Decimal.div(oreProgress.value, maxOreProgress) + progress: () => oreProgress.value })); const oreGain = createSequentialModifier(() => [ @@ -160,9 +204,6 @@ const layer = createLayer(id, function (this: BaseLayer) { createMultiplicativeModifier(() => ({ multiplier: computedOreSpeed })), - createMultiplicativeModifier(() => ({ - multiplier: Decimal.reciprocate(maxOreProgress) - })) ]); const computedOreGain = computed(() => oreGain.apply(0)); const netOreGain = createSequentialModifier(() => [ @@ -175,6 +216,7 @@ const layer = createLayer(id, function (this: BaseLayer) { })) ]); const computedNetOreGain = computed(() => netOreGain.apply(0)); + const simplePickaxe = createUpgrade(() => ({ resource: noPersist(metal), @@ -206,7 +248,7 @@ const layer = createLayer(id, function (this: BaseLayer) { visibility: () => showIf( crucible.bought.value || - Decimal.div(bestOre.value, computedOrePurity.value).plus(bestMetal.value).gte(1) + Decimal.div(bestOre.value, computedOrePurity.value).plus(bestMetal.value).gte(1) ) })) as GenericUpgrade; const coalDrill = createUpgrade(() => ({ @@ -220,13 +262,12 @@ const layer = createLayer(id, function (this: BaseLayer) { visibility: () => showIf( Decimal.gte(oreDrill.amount.value, 1) && - (coalDrill.bought.value || - Decimal.lt( - coal.computedCoalGain.value, - Decimal.times(computedOreAmount.value, computedOreSpeed.value) - .div(maxOreProgress) - .times(coalCost) - )) + (coalDrill.bought.value || + Decimal.lt( + coal.computedCoalGain.value, + Decimal.times(computedOreAmount.value, computedOreSpeed.value) + .times(coalCost) + )) ), onPurchase() { main.days[2].recentlyUpdated.value = true; @@ -248,6 +289,16 @@ const layer = createLayer(id, function (this: BaseLayer) { Cost: 50 ${metal.displayName}
${format(1e11)} ${coal.coal.displayName}` } })); + const efficientDrill = createUpgrade(() => ({ + resource: noPersist(metal), + cost: 100000, + display: { + title: "Efficient Drills", + description: `Use metal and a bunch of R&D to make drilling stuff faster. Double coal and ore mining speed.` + }, + visibilty: () => showIf(oil.depthMilestones[4].earned.value) + })); + const oreDrill = createBuyable(() => ({ resource: noPersist(metal), @@ -267,9 +318,9 @@ const layer = createLayer(id, function (this: BaseLayer) { visibility: () => showIf( Decimal.gte(oreDrill.amount.value, 1) || - Decimal.div(bestOre.value, computedOrePurity.value) - .plus(bestMetal.value) - .gte(10) + Decimal.div(bestOre.value, computedOrePurity.value) + .plus(bestMetal.value) + .gte(10) ), style: { width: "200px" } })) as GenericBuyable; @@ -291,8 +342,8 @@ const layer = createLayer(id, function (this: BaseLayer) { visibility: () => showIf( Decimal.gte(industrialCrucible.amount.value, 1) || - Decimal.gte(oreDrill.amount.value, 4) || - Decimal.gte(bestOre.value, 50) + Decimal.gte(oreDrill.amount.value, 4) || + Decimal.gte(bestOre.value, 50) ), style: { width: "200px" } })) as GenericBuyable; @@ -321,29 +372,38 @@ const layer = createLayer(id, function (this: BaseLayer) { globalBus.on("update", diff => { oreProgress.value = Decimal.times(diff, computedOreSpeed.value).plus(oreProgress.value); - const oreGain = oreProgress.value.div(maxOreProgress).trunc(); - oreProgress.value = oreProgress.value.minus(oreGain.times(maxOreProgress)); + const oreGain = oreProgress.value.trunc(); + oreProgress.value = oreProgress.value.minus(oreGain); ore.value = Decimal.add(ore.value, Decimal.times(oreGain, computedOreAmount.value)); if (autoSmeltEnabled.value) { smeltOre( Decimal.min( smeltableOre.value, - Decimal.times(industrialCrucible.amount.value, 10).times(diff) - ) + Decimal.times(computedAutoSmeltSpeed.value, diff) + ), computedAutoSmeltMulti.value ); } }); const [generalTab, generalTabCollapsed] = createCollapsibleModifierSections(() => [ { - title: "Automatic Smelting", + title: "Auto Smelt Speed", modifier: autoSmeltSpeed, base: 0, + unit: "/s", visible() { return Decimal.gt(industrialCrucible.amount.value, 0); } }, + { + title: "Auto Smelt Multiplier", + modifier: autoSmeltMulti, + base: 1, + visible() { + return Decimal.gt(computedAutoSmeltMulti.value, 1); + } + }, { title: "Metal per Ore", modifier: orePurity, @@ -357,7 +417,8 @@ const layer = createLayer(id, function (this: BaseLayer) { { title: "Mining Speed", modifier: oreSpeed, - base: 1 + base: 0.1, + unit: "/s", } ]); const showModifiersModal = ref(false); @@ -399,6 +460,7 @@ const layer = createLayer(id, function (this: BaseLayer) { crucible, coalDrill, industrialFurnace, + efficientDrill, oreDrill, industrialCrucible, autoSmeltEnabled, @@ -418,14 +480,14 @@ const layer = createLayer(id, function (this: BaseLayer) { <> {autoSmeltEnabled.value && Decimal.gte(industrialCrucible.amount.value, 1) ? `+${formatLimit( - [ - [computedAutoSmeltSpeed.value, "smelting speed"], - [computedOreGain.value, "ore gain"], - [Decimal.div(coal.computedCoalGain.value, coalCost), "coal gain"] - ], - "/s", - computedOrePurity.value - )}` + [ + [computedAutoSmeltSpeed.value, "smelting speed"], + [computedOreGain.value, "ore gain"], + [Decimal.div(coal.computedCoalGain.value, coalCost), "coal gain"] + ], + "/s", + Decimal.mul(computedOrePurity.value, computedAutoSmeltMulti.value) + )}` : undefined} ))} @@ -437,7 +499,7 @@ const layer = createLayer(id, function (this: BaseLayer) { (autoSmeltEnabled.value = value)} + onUpdate:modelValue={(value: boolean) => (autoSmeltEnabled.value = value)} /> ) : undefined} @@ -454,11 +516,11 @@ const layer = createLayer(id, function (this: BaseLayer) {
Currently mining {format(computedOreAmount.value)} ore every{" "} - {format(Decimal.div(maxOreProgress, computedOreSpeed.value))} seconds + {format(Decimal.recip(computedOreSpeed.value))} seconds
{render(oreBar)} - {renderRow(simplePickaxe, doublePickaxe, crucible, coalDrill, industrialFurnace)} + {renderRow(simplePickaxe, doublePickaxe, crucible, coalDrill, industrialFurnace, efficientDrill)} {renderRow(oreDrill, industrialCrucible, hotterForge)} )) diff --git a/src/data/layers/oil.tsx b/src/data/layers/oil.tsx new file mode 100644 index 0000000..5e3c574 --- /dev/null +++ b/src/data/layers/oil.tsx @@ -0,0 +1,1094 @@ +import Modal from "components/Modal.vue"; +import Spacer from "components/layout/Spacer.vue"; +import Row from "components/layout/Row.vue"; +import Column from "components/layout/Column.vue"; +import MainDisplay from "features/resources/MainDisplay.vue"; +import Sqrt from "components/math/Sqrt.vue"; + +import { colorText, createCollapsibleModifierSections, createCollapsibleMilestones, setUpDailyProgressTracker } from "data/common"; +import { jsx, showIf } from "features/feature"; +import { createResource, Resource, trackBest } from "features/resources/resource"; +import { BaseLayer, createLayer } from "game/layers"; +import Decimal, { DecimalSource } from "lib/break_eternity"; +import { render, renderRow } from "util/vue"; +import { computed, ComputedRef, ref, unref } from "vue"; +import { noPersist, persistent } from "game/persistence"; +import { createBuyable, GenericBuyable } from "features/buyable"; +import { createClickable } from "features/clickables/clickable"; +import { format, formatWhole } from "util/break_eternity"; +import metal from "./metal"; +import { createSequentialModifier, createAdditiveModifier, createMultiplicativeModifier } from "game/modifiers"; +import { main } from "data/projEntry"; +import { globalBus } from "game/events"; +import coal from "./coal"; +import { createUpgrade } from "features/upgrades/upgrade"; +import { createMilestone, GenericMilestone, Milestone } from "features/milestones/milestone"; +import { formatGain } from "util/bignum"; + + +const id = "oil"; +const day = 9; +const layer = createLayer(id, function (this: BaseLayer) { + + const name = "Oil"; + const color = "#000000"; + const colorText = "var(--foreground)"; + + const oil = createResource(0, "oil"); + const depth = createResource(0, "depth"); + const drillProgress = persistent(0); + const drillProgressReq = computed(() => Decimal.lt(depth.value, 990) ? Decimal.add(10, depth.value) : Decimal.pow(1.001, Decimal.sub(depth.value, 990)).mul(1000)); + + function checkDrillProgress() { + if (Decimal.lt(depth.value, 990)) { + const amt = Decimal.min(Decimal.affordArithmeticSeries(drillProgress.value, 10, 1, depth.value), Decimal.sub(990, depth.value)); + const cost = Decimal.sumArithmeticSeries(amt, 10, 1, depth.value); + drillProgress.value = Decimal.sub(drillProgress.value, cost); + depth.value = Decimal.add(depth.value, amt); + } + if (Decimal.gte(depth.value, 990)) { + const amt = Decimal.affordGeometricSeries(drillProgress.value, 1000, 1.001, Decimal.sub(depth.value, 990)); + const cost = Decimal.sumGeometricSeries(amt, 1000, 1.001, Decimal.sub(depth.value, 990)); + drillProgress.value = Decimal.sub(drillProgress.value, cost); + depth.value = Decimal.add(depth.value, amt); + } + } + + const activeHeavy = persistent(0); + const heavyCoal = computed(() => Decimal.times(Decimal.pow(activeHeavy.value, heavy2Power.value).pow(2), 1e14)); + const heavyPower = computed(() => Decimal.times(Decimal.pow(activeHeavy.value, heavy2Power.value), 1)); + const buildHeavy = createBuyable(() => ({ + resource: metal.metal, + cost() { + let v = new Decimal(this.amount.value); + return Decimal.pow(1.3, v).times(2.5e4); + }, + display: jsx(() => ( + <> +

Heavy Drill

+
+ A large drill specialized at deep mining. +
Consumes 1e14x2 coal/sec for 1x drill power. +
+
+ Currently: +
-{format(heavyCoal.value)} coal/sec +
+{format(heavyPower.value)} drill power +
+
+ Cost: {formatWhole(unref(buildHeavy.cost!))} {buildHeavy.resource!.displayName} + + )), + onPurchase() { + activeHeavy.value = Decimal.add(activeHeavy.value, 1); + }, + style: { + color: colorText, + width: "160px" + } + })) as GenericBuyable & { resource: Resource }; + const minHeavy = createClickable(() => ({ + display: "0", + style: { minHeight: "20px", width: "40px", color: colorText }, + canClick() { + return Decimal.gt(activeHeavy.value, 0); + }, + onClick() { + activeHeavy.value = 0; + } + })); + const removeHeavy = createClickable(() => ({ + display: "-", + style: { minHeight: "20px", width: "40px", color: colorText }, + canClick() { + return Decimal.gt(activeHeavy.value, 0); + }, + onClick() { + activeHeavy.value = Decimal.sub(activeHeavy.value, 1); + } + })); + const addHeavy = createClickable(() => ({ + display: "+", + style: { minHeight: "20px", width: "40px", color: colorText }, + canClick() { + return Decimal.lt(activeHeavy.value, buildHeavy.amount.value); + }, + onClick() { + activeHeavy.value = Decimal.add(activeHeavy.value, 1); + } + })); + const maxHeavy = createClickable(() => ({ + display: "Max", + style: { minHeight: "20px", width: "40px", color: colorText }, + canClick() { + return Decimal.lt(activeHeavy.value, buildHeavy.amount.value); + }, + onClick() { + activeHeavy.value = buildHeavy.amount.value; + } + })); + + const activeHeavy2 = persistent(0); + const heavy2Power = computed(() => Decimal.add(activeHeavy2.value, Math.E).ln()); + const buildHeavy2 = createBuyable(() => ({ + resource: metal.metal, + cost() { + let v = new Decimal(this.amount.value); + return Decimal.pow(2, v).times(1e5); + }, + display: jsx(() => ( + <> +

Heavy Drill Drill

+
+ Attach extra drills to Heavy Drills to make them faster +
Raise amount of effective Heavy Drills by ^ln(x + e). +
(also affect coal consumption). +
+
+ Currently: +
^{format(heavy2Power.value)} Heavy Drill amount +
+
+ Cost: {formatWhole(unref(buildHeavy2.cost!))} {buildHeavy2.resource!.displayName} + + )), + onPurchase() { + activeHeavy2.value = Decimal.add(activeHeavy2.value, 1); + }, + style: { + color: colorText, + width: "160px" + } + })) as GenericBuyable & { resource: Resource }; + const minHeavy2 = createClickable(() => ({ + display: "0", + style: { minHeight: "20px", width: "40px", color: colorText }, + canClick() { + return Decimal.gt(activeHeavy2.value, 0); + }, + onClick() { + activeHeavy2.value = 0; + } + })); + const removeHeavy2 = createClickable(() => ({ + display: "-", + style: { minHeight: "20px", width: "40px", color: colorText }, + canClick() { + return Decimal.gt(activeHeavy2.value, 0); + }, + onClick() { + activeHeavy2.value = Decimal.sub(activeHeavy2.value, 1); + } + })); + const addHeavy2 = createClickable(() => ({ + display: "+", + style: { minHeight: "20px", width: "40px", color: colorText }, + canClick() { + return Decimal.lt(activeHeavy2.value, buildHeavy2.amount.value); + }, + onClick() { + activeHeavy2.value = Decimal.add(activeHeavy2.value, 1); + } + })); + const maxHeavy2 = createClickable(() => ({ + display: "Max", + style: { minHeight: "20px", width: "40px", color: colorText }, + canClick() { + return Decimal.lt(activeHeavy2.value, buildHeavy2.amount.value); + }, + onClick() { + activeHeavy2.value = buildHeavy2.amount.value; + } + })); + + const activeExtractor = persistent(0); + const extractorPower = computed(() => Decimal.pow(1 / 3, activeExtractor.value)); + const extractorCoal = computed(() => Decimal.pow(2, activeExtractor.value)); + const extractorOre = computed(() => Decimal.pow(1.2, activeExtractor.value)); + const buildExtractor = createBuyable(() => ({ + resource: metal.metal, + cost() { + let v = new Decimal(this.amount.value); + return Decimal.pow(8, v).times(2e5); + }, + display: jsx(() => ( + <> +

Heavy Extractor

+
+ Attach extractors to the drill to mine coal and ore, with a price. +
Sacrifice 3× drill power to get 2× coal/sec and 1.2× ore/sec. +
+
+ Currently: +
×{format(extractorPower.value)} drill power +
×{format(extractorCoal.value)} coal/sec +
×{format(extractorOre.value)} ore/sec +
+
+ Cost: {formatWhole(unref(buildExtractor.cost!))} {buildExtractor.resource!.displayName} + + )), + onPurchase() { + activeExtractor.value = Decimal.add(activeExtractor.value, 1); + }, + style: { + color: colorText, + width: "160px" + } + })) as GenericBuyable & { resource: Resource }; + const minExtractor = createClickable(() => ({ + display: "0", + style: { minHeight: "20px", width: "40px", color: colorText }, + canClick() { + return Decimal.gt(activeExtractor.value, 0); + }, + onClick() { + activeExtractor.value = 0; + } + })); + const removeExtractor = createClickable(() => ({ + display: "-", + style: { minHeight: "20px", width: "40px", color: colorText }, + canClick() { + return Decimal.gt(activeExtractor.value, 0); + }, + onClick() { + activeExtractor.value = Decimal.sub(activeExtractor.value, 1); + } + })); + const addExtractor = createClickable(() => ({ + display: "+", + style: { minHeight: "20px", width: "40px", color: colorText }, + canClick() { + return Decimal.lt(activeExtractor.value, buildExtractor.amount.value); + }, + onClick() { + activeExtractor.value = Decimal.add(activeExtractor.value, 1); + } + })); + const maxExtractor = createClickable(() => ({ + display: "Max", + style: { minHeight: "20px", width: "40px", color: colorText }, + canClick() { + return Decimal.lt(activeExtractor.value, buildExtractor.amount.value); + }, + onClick() { + activeExtractor.value = buildExtractor.amount.value; + } + })); + + const activePump = persistent(0); + const pumpCoal = computed(() => Decimal.pow(row2Upgrades[3].bought ? 4 : 5, activePump.value)); + const pumpOil = computed(() => Decimal.pow(activePump.value, 2).mul(activeHeavy.value).mul(Decimal.add(activeHeavy2.value, 1)).mul(activeExtractor.value).mul(depth.value).div(1e5)); + const buildPump = createBuyable(() => ({ + resource: metal.metal, + cost() { + let v = new Decimal(this.amount.value); + let price = Decimal.pow(16, v).times(2e6); + if (row2Upgrades[4].bought.value) price = price.div(Decimal.add(totalOil.value, 1).root(6)); + return price; + }, + display: jsx(() => ( + <> +

Oil Pump

+
+ Pump those oil from the ground. +
Gain oil based on the number of Heavy stuff active and well depth, but with 5× more coal usage. +
+
+ Currently: +
×{format(pumpCoal.value)} coal usage +
+{format(pumpOil.value)} oil/sec +
+
+ Cost: {formatWhole(unref(buildPump.cost!))} {buildPump.resource!.displayName} + + )), + onPurchase() { + activePump.value = Decimal.add(activePump.value, 1); + }, + style: { + color: colorText, + width: "160px" + } + })) as GenericBuyable & { resource: Resource }; + const minPump = createClickable(() => ({ + display: "0", + style: { minHeight: "20px", width: "40px", color: colorText }, + canClick() { + return Decimal.gt(activePump.value, 0); + }, + onClick() { + activePump.value = 0; + } + })); + const removePump = createClickable(() => ({ + display: "-", + style: { minHeight: "20px", width: "40px", color: colorText }, + canClick() { + return Decimal.gt(activePump.value, 0); + }, + onClick() { + activePump.value = Decimal.sub(activePump.value, 1); + } + })); + const addPump = createClickable(() => ({ + display: "+", + style: { minHeight: "20px", width: "40px", color: colorText }, + canClick() { + return Decimal.lt(activePump.value, buildPump.amount.value); + }, + onClick() { + activePump.value = Decimal.add(activePump.value, 1); + } + })); + const maxPump = createClickable(() => ({ + display: "Max", + style: { minHeight: "20px", width: "40px", color: colorText }, + canClick() { + return Decimal.lt(activePump.value, buildPump.amount.value); + }, + onClick() { + activePump.value = buildPump.amount.value; + } + })); + + 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 buildBurner = createBuyable(() => ({ + resource: noPersist(oil), + cost() { + let v = new Decimal(this.amount.value); + return Decimal.pow(2, v).times(50); + }, + display: jsx(() => ( + <> +

Oil Burner

+
+ Burn oil as fuel. +
1x2 unit of oil can substitude 1e19x3 units of coal. +
+
+ Currently: +
-{format(burnerOil.value)} oil/sec +
-{format(burnerCoal.value)} coal consumption + { row2Upgrades[2].bought.value ? <>
×{format(burnerMetal.value)} auto smelting multi : "" } +
+
+ Cost: {formatWhole(unref(buildBurner.cost!))} {buildBurner.resource!.displayName} + + )), + onPurchase() { + activeBurner.value = Decimal.add(activeBurner.value, 1); + }, + style: { + color: colorText, + width: "160px" + } + })) as GenericBuyable & { resource: Resource }; + const minBurner = createClickable(() => ({ + display: "0", + style: { minHeight: "20px", width: "40px", color: colorText }, + canClick() { + return Decimal.gt(activeBurner.value, 0); + }, + onClick() { + activeBurner.value = 0; + } + })); + const removeBurner = createClickable(() => ({ + display: "-", + style: { minHeight: "20px", width: "40px", color: colorText }, + canClick() { + return Decimal.gt(activeBurner.value, 0); + }, + onClick() { + activeBurner.value = Decimal.sub(activeBurner.value, 1); + } + })); + const addBurner = createClickable(() => ({ + display: "+", + style: { minHeight: "20px", width: "40px", color: colorText }, + canClick() { + return Decimal.lt(activeBurner.value, buildBurner.amount.value); + }, + onClick() { + activeBurner.value = Decimal.add(activeBurner.value, 1); + } + })); + const maxBurner = createClickable(() => ({ + display: "Max", + style: { minHeight: "20px", width: "40px", color: colorText }, + canClick() { + return Decimal.lt(activeBurner.value, buildBurner.amount.value); + }, + onClick() { + activeBurner.value = buildBurner.amount.value; + } + })); + + + const activeSmelter = persistent(0); + const smelterOil = computed(() => Decimal.pow(activeSmelter.value, 2).mul(100)); + const smelterMetal = computed(() => Decimal.add(activeSmelter.value, 1)); + const buildSmelter = createBuyable(() => ({ + resource: metal.metal, + cost() { + let v = new Decimal(this.amount.value); + let price = Decimal.pow(10, v).times(1e7); + if (row2Upgrades[4].bought.value) price = price.div(Decimal.add(totalOil.value, 1).root(6)); + return price; + }, + display: jsx(() => ( + <> +

Oil Smelter

+
+ Use oil as a crucible fuel. +
Burn 100x2 oil to smelt +100% faster. +
+
+ Currently: +
-{format(smelterOil.value)} oil/sec +
×{format(smelterMetal.value)} smelting speed +
+
+ Cost: {formatWhole(unref(buildSmelter.cost!))} {buildSmelter.resource!.displayName} + + )), + onPurchase() { + activeSmelter.value = Decimal.add(activeSmelter.value, 1); + }, + style: { + color: colorText, + width: "160px" + } + })) as GenericBuyable & { resource: Resource }; + const minSmelter = createClickable(() => ({ + display: "0", + style: { minHeight: "20px", width: "40px", color: colorText }, + canClick() { + return Decimal.gt(activeSmelter.value, 0); + }, + onClick() { + activeSmelter.value = 0; + } + })); + const removeSmelter = createClickable(() => ({ + display: "-", + style: { minHeight: "20px", width: "40px", color: colorText }, + canClick() { + return Decimal.gt(activeSmelter.value, 0); + }, + onClick() { + activeSmelter.value = Decimal.sub(activeSmelter.value, 1); + } + })); + const addSmelter = createClickable(() => ({ + display: "+", + style: { minHeight: "20px", width: "40px", color: colorText }, + canClick() { + return Decimal.lt(activeSmelter.value, buildSmelter.amount.value); + }, + onClick() { + activeSmelter.value = Decimal.add(activeSmelter.value, 1); + } + })); + const maxSmelter = createClickable(() => ({ + display: "Max", + style: { minHeight: "20px", width: "40px", color: colorText }, + canClick() { + return Decimal.lt(activeSmelter.value, buildSmelter.amount.value); + }, + onClick() { + activeSmelter.value = buildSmelter.amount.value; + } + })); + + // --------------------------------------------------------------------------- Milestones + + const depthMilestones = [ + createMilestone(() => ({ + display: { + requirement: "5m Well Depth", + effectDisplay: "Gain 25% more coal for each metre of well depth (after the 3 elf milestone)." + }, + shouldEarn: () => Decimal.gte(depth.value, 5), + })), + createMilestone(() => ({ + display: { + requirement: "10m Well Depth", + effectDisplay: "Drill too slow? Unlock some drill upgrades!" + }, + shouldEarn: () => Decimal.gte(depth.value, 10), + visibility: () => showIf(depthMilestones[0].earned.value), + })), + createMilestone(() => ({ + display: { + requirement: "25m Well Depth", + effectDisplay: "Gain 5% more ore for each metre of well depth." + }, + shouldEarn: () => Decimal.gte(depth.value, 25), + visibility: () => showIf(depthMilestones[1].earned.value), + })), + createMilestone(() => ({ + display: { + requirement: "60m Well Depth", + effectDisplay: "Drill still too slow? Try unlocking another drill!" + }, + shouldEarn: () => Decimal.gte(depth.value, 60), + visibility: () => showIf(depthMilestones[2].earned.value), + })), + createMilestone(() => ({ + display: { + requirement: "150m Well Depth", + effectDisplay: "It appears that coal and metal appear a lot more when you go this deep! Unlock more coal and metal upgrades!" + }, + shouldEarn: () => Decimal.gte(depth.value, 150), + visibility: () => showIf(depthMilestones[3].earned.value), + })), + createMilestone(() => ({ + display: { + requirement: "350m Well Depth", + effectDisplay: "There are even more coal and metal than you thought. Why don't you utilize your heavy drill to mine them? Unlock a new drill upgrade!" + }, + shouldEarn: () => Decimal.gte(depth.value, 350), + visibility: () => showIf(depthMilestones[4].earned.value), + })), + createMilestone(() => ({ + display: { + requirement: "1,000m Well Depth", + effectDisplay: "You've finally found oil! Maybe it's time to get those oil pumps to the use! Unfortunately extracting them would use more coal than ever, also it's becoming much harder to mine deeper due to the thermal heat and pressure." + }, + shouldEarn: () => Decimal.gte(depth.value, 1000), + visibility: () => showIf(Decimal.gte(depth.value, 1000)), + })), + createMilestone(() => ({ + display: { + requirement: "3,000m Well Depth", + effectDisplay: "You found a large oil spot! Double oil gain!" + }, + shouldEarn: () => Decimal.gte(depth.value, 3000), + visibility: () => showIf(Decimal.gte(depth.value, 2000)), + })), + ] as Record; + + const { collapseMilestones: collapsedDepthMilestones, display: depthMilestonesDisplay } = + createCollapsibleMilestones(depthMilestones); + + + const oilMilestones = [ + createMilestone(() => ({ + display: { + requirement: "100 total oil", + effectDisplay: "Hmm, these oil pumps are really expensive. Maybe you should find a way to solve this problem. Maybe you can use oil as fuel instead of coal?" + }, + shouldEarn: () => Decimal.gte(totalOil.value, 100), + })), + createMilestone(() => ({ + display: { + requirement: "500 total oil", + effectDisplay: "Unlocks oil upgrades! These can be bought with oil." + }, + shouldEarn: () => Decimal.gte(totalOil.value, 500), + visibility: () => showIf(oilMilestones[0].earned.value), + })), + createMilestone(() => ({ + display: { + requirement: "10,000 total oil", + effectDisplay: "Wow, these are really bright when you burn it. Maybe it can be helpful to use them to smelt metal?" + }, + shouldEarn: () => Decimal.gte(totalOil.value, 10000), + visibility: () => showIf(oilMilestones[1].earned.value), + })), + ] as Record; + + const { collapseMilestones: collapsedOilMilestones, display: oilMilestonesDisplay } = + createCollapsibleMilestones(oilMilestones); + + // --------------------------------------------------------------------------- Upgrades + + const row1Upgrades = [ + createUpgrade(() => ({ + resource: coal.coal, + cost: 1e18, + display: { + title: "Coal Drill Synergy", + description: "Increase drill power by +4% per coal Mining Drill owned.", + effectDisplay: jsx(() => <>x{format(row1UpgradeEffects[0].value)}) + }, + style: { color: colorText } + })), + createUpgrade(() => ({ + resource: metal.metal, + cost: 150000, + display: { + title: "Metal Drill Synergy", + description: "Increase drill power by +4% per ore Mining Drill owned.", + effectDisplay: jsx(() => <>x{format(row1UpgradeEffects[1].value)}) + }, + style: { color: colorText } + })), + createUpgrade(() => ({ + resource: coal.coal, + cost: 1e20, + display: { + title: "Coal Drill Upgrade", + description: "Increase drill power by +6% per OoM of coal owned.", + effectDisplay: jsx(() => <>x{format(row1UpgradeEffects[2].value)}) + }, + style: { color: colorText } + })), + createUpgrade(() => ({ + resource: metal.metal, + cost: 1500000, + display: { + title: "Metal Drill Upgrade", + description: "Increase drill power by +10% per OoM of metal ingot owned.", + effectDisplay: jsx(() => <>x{format(row1UpgradeEffects[3].value)}) + }, + style: { color: colorText } + })), + createUpgrade(() => ({ + resource: noPersist(oil), + cost: 100, + display: { + title: "Drill Oil", + description: "Increase previous upgrades' effect by +0.1% per thing per Heavy Drill owned.", + effectDisplay: jsx(() => <>+{format(Decimal.mul(row1UpgradeEffects[4].value, 100))}%) + }, + style: { color: colorText } + })), + ]; + const row1UpgradeEffects: ComputedRef[] = [ + computed(() => Decimal.mul(coal.buildDrill.amount.value, Decimal.add(0.04, computedUpgradeBonus.value)).add(1)), + computed(() => Decimal.mul(metal.oreDrill.amount.value, Decimal.add(0.04, computedUpgradeBonus.value)).add(1)), + computed(() => Decimal.mul(Decimal.max(coal.coal.value, 1).log10().floor(), Decimal.add(0.06, computedUpgradeBonus.value)).add(1)), + computed(() => Decimal.mul(Decimal.max(metal.metal.value, 1).log10().floor(), Decimal.add(0.10, computedUpgradeBonus.value)).add(1)), + computed(() => Decimal.mul(buildHeavy.amount.value, 0.001)), + ]; + + + const row2Upgrades = [ + createUpgrade(() => ({ + resource: noPersist(oil), + cost: 100, + display: { + title: "Oil the Oil Pump", + description: "Double oil gain.", + }, + style: { color: colorText } + })), + createUpgrade(() => ({ + resource: noPersist(oil), + cost: 500, + display: { + title: "Oil the Mining Drills", + description: "Double ore mining speed and square the coal drill amount in its effect.", + }, + style: { color: colorText } + })), + createUpgrade(() => ({ + resource: noPersist(oil), + cost: 1500, + display: { + title: "Blaster Burner", + description: "The Oil Burner can now increase your metal gain.", + }, + style: { color: colorText } + })), + createUpgrade(() => ({ + resource: noPersist(oil), + cost: 25000, + display: { + title: "Oil Integration", + description: "Reduce Oil Well's oil consumption multipler from 5 to 4", + }, + style: { color: colorText } + })), + createUpgrade(() => ({ + resource: noPersist(oil), + cost: 50000, + display: { + title: "Be One with the Oil", + description: jsx(() => <>Divide metal ingot prices of oil buildings by 6total oil + 1), + }, + style: { color: colorText } + })), + ]; + + const coalConsumption = createSequentialModifier(() => [ + createAdditiveModifier(() => ({ + addend: () => Decimal.negate(heavyCoal.value), + description: "Heavy Drill", + enabled: () => Decimal.gt(activeHeavy.value, 0) + })), + createMultiplicativeModifier(() => ({ + multiplier: pumpCoal, + description: "Oil Pump", + enabled: () => Decimal.gt(activePump.value, 0) + })), + createAdditiveModifier(() => ({ + addend: computedOilSubstitution, + description: "Oil to Coal Substitution", + enabled: () => Decimal.gt(computedOilSubstitution.value, 0) + })), + ]); + const computedCoalConsumption = computed(() => coalConsumption.apply(0)); + const drillPower = createSequentialModifier(() => [ + createAdditiveModifier(() => ({ + addend: heavyPower, + description: "Heavy Drill", + enabled: () => Decimal.gt(activeHeavy.value, 0) + })), + createMultiplicativeModifier(() => ({ + multiplier: extractorPower, + description: "Heavy Extractor", + enabled: () => Decimal.gt(activeExtractor.value, 0) + })), + createMultiplicativeModifier(() => ({ + multiplier: row1UpgradeEffects[0], + description: "Coal Drill Synergy", + enabled: row1Upgrades[0].bought + })), + createMultiplicativeModifier(() => ({ + multiplier: row1UpgradeEffects[1], + description: "Metal Drill Synergy", + enabled: row1Upgrades[1].bought + })), + createMultiplicativeModifier(() => ({ + multiplier: row1UpgradeEffects[2], + description: "Coal Drill Upgrade", + enabled: row1Upgrades[2].bought + })), + createMultiplicativeModifier(() => ({ + multiplier: row1UpgradeEffects[3], + description: "Metal Drill Upgrade", + enabled: row1Upgrades[3].bought + })), + createMultiplicativeModifier(() => ({ + multiplier: () => coalEffectiveness.value, + description: "Effectiveness", + enabled: () => Decimal.lt(coalEffectiveness.value, 1) + })), + ]); + const computedDrillPower = computed(() => drillPower.apply(0)); + + const upgradeBonus = createSequentialModifier(() => [ + createAdditiveModifier(() => ({ + addend: row1UpgradeEffects[4], + description: "Drill Oil", + enabled: row1Upgrades[4].bought + })), + ]); + const computedUpgradeBonus = computed(() => upgradeBonus.apply(0)); + + const oilSpeed = createSequentialModifier(() => [ + createAdditiveModifier(() => ({ + addend: pumpOil, + description: "Oil Pump", + enabled: () => Decimal.gt(activePump.value, 0) + })), + createMultiplicativeModifier(() => ({ + multiplier: 2, + description: "Oil the Oil Pump", + enabled: row2Upgrades[0].bought + })), + createMultiplicativeModifier(() => ({ + multiplier: 2, + description: "3000m Well Depth", + enabled: depthMilestones[7].earned + })), + createMultiplicativeModifier(() => ({ + multiplier: () => coalEffectiveness.value, + description: "Effectiveness", + enabled: () => Decimal.lt(coalEffectiveness.value, 1) + })), + ]); + const computedOilSpeed = computed(() => oilSpeed.apply(0)); + + const oilConsumption = createSequentialModifier(() => [ + createAdditiveModifier(() => ({ + addend: () => Decimal.negate(burnerOil.value), + description: "Oil Burner", + enabled: () => Decimal.gt(activeBurner.value, 0) + })), + createAdditiveModifier(() => ({ + addend: () => Decimal.negate(smelterOil.value), + description: "Oil Smelter", + enabled: () => Decimal.gt(activeSmelter.value, 0) + })), + ]); + const computedOilConsumption = computed(() => oilConsumption.apply(0)); + + const oilSubstitution = createSequentialModifier(() => [ + createAdditiveModifier(() => ({ + addend: burnerCoal, + description: "Oil Burner", + enabled: () => Decimal.gt(activeBurner.value, 0) + })), + createMultiplicativeModifier(() => ({ + multiplier: () => oilEffectiveness.value, + description: "Effectiveness", + enabled: () => Decimal.lt(oilEffectiveness.value, 1) + })), + ]); + const computedOilSubstitution = computed(() => oilSubstitution.apply(0)); + + const [generalTab, generalTabCollapsed] = createCollapsibleModifierSections(() => [ + { + title: "Coal Consumption", + modifier: coalConsumption, + unit: "/s", + base: 0, + }, + { + title: "Drill Power", + modifier: drillPower, + base: 0, + }, + { + title: "Upgrade Bonus", + modifier: upgradeBonus, + base: 0, + visible() { + return Decimal.gt(computedUpgradeBonus.value, 0) + } + }, + { + title: "Oil Speed", + modifier: oilSpeed, + unit: "/s", + base: 0, + visible() { + return Decimal.gt(computedOilSpeed.value, 0) + } + }, + { + title: "Oil Consumption", + modifier: oilConsumption, + unit: "/s", + base: 0, + visible() { + return Decimal.lt(computedOilConsumption.value, 0) + } + }, + { + title: "Oil to Coal Substitution", + modifier: oilSubstitution, + unit: "/s", + base: 0, + visible() { + return Decimal.gt(computedOilSubstitution.value, 0) + } + }, + ]); + const showModifiersModal = ref(false); + const modifiersModal = jsx(() => ( + (showModifiersModal.value = value)} + v-slots={{ + header: () =>

{name} Modifiers

, + body: generalTab + }} + /> + )); + + const coalEffectiveness = ref(Decimal.dOne); + const oilEffectiveness = ref(Decimal.dOne); + globalBus.on("update", diff => { + if (Decimal.lt(main.day.value, day)) { + return; + } + + const coalCost = Decimal.negate(computedCoalConsumption.value); + if (Decimal.gt(coalCost, 0)) { + coalEffectiveness.value = Decimal.min(Decimal.div(coal.coal.value, coalCost), 1); + coal.coal.value = Decimal.sub(coal.coal.value, Decimal.mul(coalCost, coalEffectiveness.value).mul(diff)); + } else { + coalEffectiveness.value = Decimal.dOne; + } + drillProgress.value = Decimal.add(drillProgress.value, Decimal.mul(computedDrillPower.value, diff)); + oil.value = Decimal.add(oil.value, Decimal.mul(computedOilSpeed.value, diff)); + checkDrillProgress(); + + const oilCost = Decimal.negate(computedOilConsumption.value); + if (Decimal.gt(oilCost, 0)) { + oilEffectiveness.value = Decimal.min(Decimal.div(oil.value, oilCost), 1); + oil.value = Decimal.sub(oil.value, Decimal.mul(oilCost, oilEffectiveness.value).mul(diff)); + } else { + oilEffectiveness.value = Decimal.dOne; + } + }); + + const { total: totalOil, trackerDisplay } = setUpDailyProgressTracker({ + resource: oil, + goal: 250000, + name, + day, + color, + modal: { + show: showModifiersModal, + display: modifiersModal + } + }); + + return { + name, + day, + color, + + oil, + totalOil, + depth, + drillProgress, + + activeHeavy, + buildHeavy, + activeHeavy2, + buildHeavy2, + activeExtractor, + buildExtractor, + activePump, + buildPump, + activeBurner, + buildBurner, + activeSmelter, + buildSmelter, + + extractorCoal, + extractorOre, + + coalEffectiveness, + oilEffectiveness, + + depthMilestones, + collapsedDepthMilestones, + + row1Upgrades, + row2Upgrades, + + minWidth: 700, + + generalTabCollapsed, + display: jsx(() => ( + <> + {render(trackerDisplay)} + + { + Decimal.lt(coalEffectiveness.value, 1) ? + "Your drills are working at " + format(Decimal.mul(coalEffectiveness.value, 100)) + "% effectiveness due to lack of coal." + : null + } + ( + <> + {Decimal.lt(depth.value, 1000) ? "Reach 1000m to start gaining oil" : formatGain(Decimal.add(computedOilSpeed.value, computedOilConsumption.value))} + + ))} + /> + + { + depthMilestones[6].earned.value ? + + {render(buildPump)} +
+ {formatWhole(Decimal.floor(activePump.value))}/ + {formatWhole(Decimal.floor(buildPump.amount.value))} +
+ {renderRow(minPump, removePump, addPump, maxPump)} +
+ : null + } + { + oilMilestones[0].earned.value ? + + {render(buildBurner)} +
+ {formatWhole(Decimal.floor(activeBurner.value))}/ + {formatWhole(Decimal.floor(buildBurner.amount.value))} +
+ {renderRow(minBurner, removeBurner, addBurner, maxBurner)} +
+ : null + } + { + oilMilestones[2].earned.value ? + + {render(buildSmelter)} +
+ {formatWhole(Decimal.floor(activeSmelter.value))}/ + {formatWhole(Decimal.floor(buildSmelter.amount.value))} +
+ {renderRow(minSmelter, removeSmelter, addSmelter, maxSmelter)} +
+ : null + } +
+
+
+ The well is +

+ {formatWhole(depth.value)} +

+ m deep +
Next at {format(Decimal.sub(drillProgressReq.value, drillProgress.value))} drill power seconds +
+
+ Your drill power is +

+ {format(computedDrillPower.value)} +

+
+ + + + {render(buildHeavy)} +
+ {formatWhole(Decimal.floor(activeHeavy.value))}/ + {formatWhole(Decimal.floor(buildHeavy.amount.value))} +
+ {renderRow(minHeavy, removeHeavy, addHeavy, maxHeavy)} +
+ { + depthMilestones[3].earned.value ? + + {render(buildHeavy2)} +
+ {formatWhole(Decimal.floor(activeHeavy2.value))}/ + {formatWhole(Decimal.floor(buildHeavy2.amount.value))} +
+ {renderRow(minHeavy2, removeHeavy2, addHeavy2, maxHeavy2)} +
+ : null + } + { + depthMilestones[5].earned.value ? + + {render(buildExtractor)} +
+ {formatWhole(Decimal.floor(activeExtractor.value))}/ + {formatWhole(Decimal.floor(buildExtractor.amount.value))} +
+ {renderRow(minExtractor, removeExtractor, addExtractor, maxExtractor)} +
+ : null + } +
+ + {depthMilestones[1].earned.value ? renderRow(...row1Upgrades) : null} + {oilMilestones[1].earned.value ? renderRow(...row2Upgrades) : null} + + {depthMilestonesDisplay()} + {Decimal.gte(totalOil.value, 50) ? oilMilestonesDisplay() : ""} + + )) + } +}); + +export default layer; \ No newline at end of file diff --git a/src/data/projEntry.tsx b/src/data/projEntry.tsx index f8c65f0..586c069 100644 --- a/src/data/projEntry.tsx +++ b/src/data/projEntry.tsx @@ -34,6 +34,7 @@ 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"; export interface Day extends VueFeature { day: number; @@ -225,10 +226,10 @@ export const main = createLayer("main", function (this: BaseLayer) { createDay(() => ({ day: 9, shouldNotify: false, - layer: null, // "oil" + layer: "oil", symbol: "", - story: "", - completedStory: "" + story: "Looks like you just need one more thing before the toy factory can get running: plastic! Every toy nowadays is made with plastic! But wait, how are you going to get plastic? What can make plastic? Wait that's right, oil! You figured out you might as well repurpose your coal and ore drills into something that can get you oil, unfortunately you'll need to mine much deeper that you're currently doing before, so let's get to work!", + completedStory: "It took a while, but you finally got enough oil for the next step! You deserve a good rest after all these digging work - tomorrow will be a busy day! Good Job!" })), createDay(() => ({ day: 10, @@ -409,7 +410,7 @@ export const main = createLayer("main", function (this: BaseLayer) { export const getInitialLayers = ( /* eslint-disable-next-line @typescript-eslint/no-unused-vars */ player: Partial -): Array => [main, trees, workshop, coal, elves, paper, boxes, metal, cloth]; +): Array => [main, trees, workshop, coal, elves, paper, boxes, metal, cloth, oil]; /** * A computed ref whose value is true whenever the game is over.