mirror of
https://github.com/thepaperpilot/Advent-Incremental.git
synced 2025-01-19 12:01:37 +00:00
Merge conflict moment (sorry)
This commit is contained in:
commit
93716fa4ff
4 changed files with 243 additions and 145 deletions
|
@ -332,9 +332,7 @@ export function createCollapsibleModifierSections(
|
||||||
{modifiers}
|
{modifiers}
|
||||||
<hr />
|
<hr />
|
||||||
<div class="modifier-container">
|
<div class="modifier-container">
|
||||||
<span class="modifier-description">
|
<span class="modifier-description">Total</span>
|
||||||
Total
|
|
||||||
</span>
|
|
||||||
<span class="modifier-amount">
|
<span class="modifier-amount">
|
||||||
{format(s.modifier.apply(unref(processed.base[i]) ?? 1))}
|
{format(s.modifier.apply(unref(processed.base[i]) ?? 1))}
|
||||||
{s.unit}
|
{s.unit}
|
||||||
|
@ -482,4 +480,4 @@ export function setUpDailyProgressTracker(options: {
|
||||||
total,
|
total,
|
||||||
trackerDisplay
|
trackerDisplay
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
|
@ -5,7 +5,12 @@ import Column from "components/layout/Column.vue";
|
||||||
import MainDisplay from "features/resources/MainDisplay.vue";
|
import MainDisplay from "features/resources/MainDisplay.vue";
|
||||||
import Sqrt from "components/math/Sqrt.vue";
|
import Sqrt from "components/math/Sqrt.vue";
|
||||||
|
|
||||||
import { colorText, createCollapsibleModifierSections, createCollapsibleMilestones, setUpDailyProgressTracker } from "data/common";
|
import {
|
||||||
|
colorText,
|
||||||
|
createCollapsibleModifierSections,
|
||||||
|
createCollapsibleMilestones,
|
||||||
|
setUpDailyProgressTracker
|
||||||
|
} from "data/common";
|
||||||
import { jsx, showIf } from "features/feature";
|
import { jsx, showIf } from "features/feature";
|
||||||
import { createResource, Resource, trackBest } from "features/resources/resource";
|
import { createResource, Resource, trackBest } from "features/resources/resource";
|
||||||
import { BaseLayer, createLayer } from "game/layers";
|
import { BaseLayer, createLayer } from "game/layers";
|
||||||
|
@ -17,7 +22,11 @@ import { createBuyable, GenericBuyable } from "features/buyable";
|
||||||
import { createClickable } from "features/clickables/clickable";
|
import { createClickable } from "features/clickables/clickable";
|
||||||
import { format, formatWhole } from "util/break_eternity";
|
import { format, formatWhole } from "util/break_eternity";
|
||||||
import metal from "./metal";
|
import metal from "./metal";
|
||||||
import { createSequentialModifier, createAdditiveModifier, createMultiplicativeModifier } from "game/modifiers";
|
import {
|
||||||
|
createSequentialModifier,
|
||||||
|
createAdditiveModifier,
|
||||||
|
createMultiplicativeModifier
|
||||||
|
} from "game/modifiers";
|
||||||
import { main } from "data/projEntry";
|
import { main } from "data/projEntry";
|
||||||
import { globalBus } from "game/events";
|
import { globalBus } from "game/events";
|
||||||
import coal from "./coal";
|
import coal from "./coal";
|
||||||
|
@ -25,11 +34,9 @@ import { createUpgrade, GenericUpgrade } from "features/upgrades/upgrade";
|
||||||
import { createMilestone, GenericMilestone, Milestone } from "features/milestones/milestone";
|
import { createMilestone, GenericMilestone, Milestone } from "features/milestones/milestone";
|
||||||
import { formatGain } from "util/bignum";
|
import { formatGain } from "util/bignum";
|
||||||
|
|
||||||
|
|
||||||
const id = "oil";
|
const id = "oil";
|
||||||
const day = 9;
|
const day = 9;
|
||||||
const layer = createLayer(id, function (this: BaseLayer) {
|
const layer = createLayer(id, function (this: BaseLayer) {
|
||||||
|
|
||||||
const name = "Oil";
|
const name = "Oil";
|
||||||
const color = "#000000";
|
const color = "#000000";
|
||||||
const colorText = "var(--foreground)";
|
const colorText = "var(--foreground)";
|
||||||
|
@ -37,30 +44,51 @@ const layer = createLayer(id, function (this: BaseLayer) {
|
||||||
const oil = createResource<DecimalSource>(0, "oil");
|
const oil = createResource<DecimalSource>(0, "oil");
|
||||||
const depth = createResource<DecimalSource>(0, "depth");
|
const depth = createResource<DecimalSource>(0, "depth");
|
||||||
const drillProgress = persistent<DecimalSource>(0);
|
const drillProgress = persistent<DecimalSource>(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));
|
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() {
|
function checkDrillProgress() {
|
||||||
if (Decimal.lt(depth.value, 990)) {
|
if (Decimal.lt(depth.value, 990)) {
|
||||||
const amt = Decimal.min(Decimal.affordArithmeticSeries(drillProgress.value, 10, 1, depth.value), Decimal.sub(990, depth.value));
|
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);
|
const cost = Decimal.sumArithmeticSeries(amt, 10, 1, depth.value);
|
||||||
drillProgress.value = Decimal.sub(drillProgress.value, cost);
|
drillProgress.value = Decimal.sub(drillProgress.value, cost);
|
||||||
depth.value = Decimal.add(depth.value, amt);
|
depth.value = Decimal.add(depth.value, amt);
|
||||||
}
|
}
|
||||||
if (Decimal.gte(depth.value, 990)) {
|
if (Decimal.gte(depth.value, 990)) {
|
||||||
const amt = Decimal.affordGeometricSeries(drillProgress.value, 1000, 1.001, Decimal.sub(depth.value, 990));
|
const amt = Decimal.affordGeometricSeries(
|
||||||
const cost = Decimal.sumGeometricSeries(amt, 1000, 1.001, Decimal.sub(depth.value, 990));
|
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);
|
drillProgress.value = Decimal.sub(drillProgress.value, cost);
|
||||||
depth.value = Decimal.add(depth.value, amt);
|
depth.value = Decimal.add(depth.value, amt);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
const activeHeavy = persistent<DecimalSource>(0);
|
const activeHeavy = persistent<DecimalSource>(0);
|
||||||
const heavyCoal = computed(() => Decimal.times(Decimal.pow(activeHeavy.value, heavy2Power.value).pow(2), 1e14));
|
const heavyCoal = computed(() =>
|
||||||
const heavyPower = computed(() => Decimal.times(Decimal.pow(activeHeavy.value, heavy2Power.value), 1));
|
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(() => ({
|
const buildHeavy = createBuyable(() => ({
|
||||||
resource: metal.metal,
|
resource: metal.metal,
|
||||||
cost() {
|
cost() {
|
||||||
let v = new Decimal(this.amount.value);
|
const v = new Decimal(this.amount.value);
|
||||||
return Decimal.pow(1.3, v).times(2.5e4);
|
return Decimal.pow(1.3, v).times(2.5e4);
|
||||||
},
|
},
|
||||||
display: jsx(() => (
|
display: jsx(() => (
|
||||||
|
@ -68,7 +96,9 @@ const layer = createLayer(id, function (this: BaseLayer) {
|
||||||
<h3>Heavy Drill</h3>
|
<h3>Heavy Drill</h3>
|
||||||
<br />
|
<br />
|
||||||
A large drill specialized at deep mining.
|
A large drill specialized at deep mining.
|
||||||
<br />Consumes 1e14x<sup>2</sup> coal/sec for 1x drill power.
|
<br />
|
||||||
|
Consumes 1e14*(Heavy Drills amount)<sup>2</sup> coal/sec for (Heavy Drills amount)
|
||||||
|
drill power.
|
||||||
<br />
|
<br />
|
||||||
<br />
|
<br />
|
||||||
Currently:
|
Currently:
|
||||||
|
@ -133,7 +163,7 @@ const layer = createLayer(id, function (this: BaseLayer) {
|
||||||
const buildHeavy2 = createBuyable(() => ({
|
const buildHeavy2 = createBuyable(() => ({
|
||||||
resource: metal.metal,
|
resource: metal.metal,
|
||||||
cost() {
|
cost() {
|
||||||
let v = new Decimal(this.amount.value);
|
const v = new Decimal(this.amount.value);
|
||||||
return Decimal.pow(2, v).times(1e5);
|
return Decimal.pow(2, v).times(1e5);
|
||||||
},
|
},
|
||||||
display: jsx(() => (
|
display: jsx(() => (
|
||||||
|
@ -141,8 +171,10 @@ const layer = createLayer(id, function (this: BaseLayer) {
|
||||||
<h3>Heavy Drill Drill</h3>
|
<h3>Heavy Drill Drill</h3>
|
||||||
<br />
|
<br />
|
||||||
Attach extra drills to Heavy Drills to make them faster
|
Attach extra drills to Heavy Drills to make them faster
|
||||||
<br />Raise amount of effective Heavy Drills by ^ln(x + e).
|
<br />
|
||||||
<br />(also affect coal consumption).
|
Raise amount of effective Heavy Drills by ^ln(Heavy Drill Drill amount + e).
|
||||||
|
<br />
|
||||||
|
(also affects coal consumption).
|
||||||
<br />
|
<br />
|
||||||
<br />
|
<br />
|
||||||
Currently:
|
Currently:
|
||||||
|
@ -200,7 +232,7 @@ const layer = createLayer(id, function (this: BaseLayer) {
|
||||||
activeHeavy2.value = buildHeavy2.amount.value;
|
activeHeavy2.value = buildHeavy2.amount.value;
|
||||||
}
|
}
|
||||||
}));
|
}));
|
||||||
|
|
||||||
const activeExtractor = persistent<DecimalSource>(0);
|
const activeExtractor = persistent<DecimalSource>(0);
|
||||||
const extractorPower = computed(() => Decimal.pow(1 / 3, activeExtractor.value));
|
const extractorPower = computed(() => Decimal.pow(1 / 3, activeExtractor.value));
|
||||||
const extractorCoal = computed(() => Decimal.pow(2, activeExtractor.value));
|
const extractorCoal = computed(() => Decimal.pow(2, activeExtractor.value));
|
||||||
|
@ -208,15 +240,16 @@ const layer = createLayer(id, function (this: BaseLayer) {
|
||||||
const buildExtractor = createBuyable(() => ({
|
const buildExtractor = createBuyable(() => ({
|
||||||
resource: metal.metal,
|
resource: metal.metal,
|
||||||
cost() {
|
cost() {
|
||||||
let v = new Decimal(this.amount.value);
|
const v = new Decimal(this.amount.value);
|
||||||
return Decimal.pow(8, v).times(2e5);
|
return Decimal.pow(8, v).times(2e5);
|
||||||
},
|
},
|
||||||
display: jsx(() => (
|
display: jsx(() => (
|
||||||
<>
|
<>
|
||||||
<h3>Heavy Extractor</h3>
|
<h3>Heavy Extractor</h3>
|
||||||
<br />
|
<br />
|
||||||
Attach extractors to the drill to mine coal and ore, with a price.
|
Attach extractors to the drill to mine coal and ore, but with a price.
|
||||||
<br />Sacrifice 3× drill power to get 2× coal/sec and 1.2× ore/sec.
|
<br />
|
||||||
|
Divides drill power by 3 to multiply coal gain by 2 and ore gain by 1.2.
|
||||||
<br />
|
<br />
|
||||||
<br />
|
<br />
|
||||||
Currently:
|
Currently:
|
||||||
|
@ -225,7 +258,8 @@ const layer = createLayer(id, function (this: BaseLayer) {
|
||||||
<br />×{format(extractorOre.value)} ore/sec
|
<br />×{format(extractorOre.value)} ore/sec
|
||||||
<br />
|
<br />
|
||||||
<br />
|
<br />
|
||||||
Cost: {formatWhole(unref(buildExtractor.cost!))} {buildExtractor.resource!.displayName}
|
Cost: {formatWhole(unref(buildExtractor.cost!))}{" "}
|
||||||
|
{buildExtractor.resource!.displayName}
|
||||||
</>
|
</>
|
||||||
)),
|
)),
|
||||||
onPurchase() {
|
onPurchase() {
|
||||||
|
@ -276,24 +310,36 @@ const layer = createLayer(id, function (this: BaseLayer) {
|
||||||
activeExtractor.value = buildExtractor.amount.value;
|
activeExtractor.value = buildExtractor.amount.value;
|
||||||
}
|
}
|
||||||
}));
|
}));
|
||||||
|
|
||||||
const activePump = persistent<DecimalSource>(0);
|
const activePump = persistent<DecimalSource>(0);
|
||||||
const pumpCoal = computed(() => Decimal.pow(row2Upgrades[3].bought.value ? 4 : 5, activePump.value));
|
const pumpCoal = computed(() =>
|
||||||
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));
|
Decimal.pow(row2Upgrades[3].bought.value ? 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(() => ({
|
const buildPump = createBuyable(() => ({
|
||||||
resource: metal.metal,
|
resource: metal.metal,
|
||||||
cost() {
|
cost() {
|
||||||
let v = new Decimal(this.amount.value);
|
const v = new Decimal(this.amount.value);
|
||||||
let price = Decimal.pow(16, v).times(2e6);
|
let price = Decimal.pow(16, v).times(2e6);
|
||||||
if (row2Upgrades[4].bought.value) price = price.div(Decimal.add(totalOil.value, 1).root(6));
|
if (row2Upgrades[4].bought.value)
|
||||||
|
price = price.div(Decimal.add(totalOil.value, 1).root(6));
|
||||||
return price;
|
return price;
|
||||||
},
|
},
|
||||||
display: jsx(() => (
|
display: jsx(() => (
|
||||||
<>
|
<>
|
||||||
<h3>Oil Pump</h3>
|
<h3>Oil Pump</h3>
|
||||||
<br />
|
<br />
|
||||||
Pump those oil from the ground.
|
Pump that oil from the ground.
|
||||||
<br />Gain oil based on the number of Heavy stuff active and well depth, but coal usage increases by {row2Upgrades[3].bought.value ? 4 : 5}×.
|
<br />
|
||||||
|
Gain oil based on the number of Heavy Drills and Heavy Drill Drills active and well
|
||||||
|
depth, but coal usage is multiplied by {row2Upgrades[3].bought.value ? 4 : 5}×.
|
||||||
<br />
|
<br />
|
||||||
<br />
|
<br />
|
||||||
Currently:
|
Currently:
|
||||||
|
@ -352,7 +398,7 @@ const layer = createLayer(id, function (this: BaseLayer) {
|
||||||
activePump.value = buildPump.amount.value;
|
activePump.value = buildPump.amount.value;
|
||||||
}
|
}
|
||||||
}));
|
}));
|
||||||
|
|
||||||
const activeBurner = persistent<DecimalSource>(0);
|
const activeBurner = persistent<DecimalSource>(0);
|
||||||
const burnerOil = computed(() => Decimal.pow(activeBurner.value, 2));
|
const burnerOil = computed(() => Decimal.pow(activeBurner.value, 2));
|
||||||
const burnerCoal = computed(() => Decimal.pow(activeBurner.value, 3).mul(1e19));
|
const burnerCoal = computed(() => Decimal.pow(activeBurner.value, 3).mul(1e19));
|
||||||
|
@ -360,7 +406,7 @@ const layer = createLayer(id, function (this: BaseLayer) {
|
||||||
const buildBurner = createBuyable(() => ({
|
const buildBurner = createBuyable(() => ({
|
||||||
resource: noPersist(oil),
|
resource: noPersist(oil),
|
||||||
cost() {
|
cost() {
|
||||||
let v = new Decimal(this.amount.value);
|
const v = new Decimal(this.amount.value);
|
||||||
return Decimal.pow(2, v).times(50);
|
return Decimal.pow(2, v).times(50);
|
||||||
},
|
},
|
||||||
display: jsx(() => (
|
display: jsx(() => (
|
||||||
|
@ -368,13 +414,21 @@ const layer = createLayer(id, function (this: BaseLayer) {
|
||||||
<h3>Oil Burner</h3>
|
<h3>Oil Burner</h3>
|
||||||
<br />
|
<br />
|
||||||
Burn oil as fuel.
|
Burn oil as fuel.
|
||||||
<br />1x<sup>2</sup> unit of oil can substitude 1e19x<sup>3</sup> units of coal.
|
<br />
|
||||||
|
(Oil Burner Amount)<sup>2</sup> unit of oil can give 1e19*(Oil Burner Amount)
|
||||||
|
<sup>3</sup> units of coal.
|
||||||
<br />
|
<br />
|
||||||
<br />
|
<br />
|
||||||
Currently:
|
Currently:
|
||||||
<br />-{format(burnerOil.value)} oil/sec
|
<br />-{format(burnerOil.value)} oil/sec
|
||||||
<br />-{format(burnerCoal.value)} coal consumption
|
<br />-{format(burnerCoal.value)} coal consumption
|
||||||
{ row2Upgrades[2].bought.value ? <><br />×{format(burnerMetal.value)} auto smelting multi</> : "" }
|
{row2Upgrades[2].bought.value ? (
|
||||||
|
<>
|
||||||
|
<br />×{format(burnerMetal.value)} to auto smelting multi
|
||||||
|
</>
|
||||||
|
) : (
|
||||||
|
""
|
||||||
|
)}
|
||||||
<br />
|
<br />
|
||||||
<br />
|
<br />
|
||||||
Cost: {formatWhole(unref(buildBurner.cost!))} {buildBurner.resource!.displayName}
|
Cost: {formatWhole(unref(buildBurner.cost!))} {buildBurner.resource!.displayName}
|
||||||
|
@ -428,17 +482,17 @@ const layer = createLayer(id, function (this: BaseLayer) {
|
||||||
activeBurner.value = buildBurner.amount.value;
|
activeBurner.value = buildBurner.amount.value;
|
||||||
}
|
}
|
||||||
}));
|
}));
|
||||||
|
|
||||||
|
|
||||||
const activeSmelter = persistent<DecimalSource>(0);
|
const activeSmelter = persistent<DecimalSource>(0);
|
||||||
const smelterOil = computed(() => Decimal.pow(activeSmelter.value, 2).mul(100));
|
const smelterOil = computed(() => Decimal.pow(activeSmelter.value, 2).mul(100));
|
||||||
const smelterMetal = computed(() => Decimal.add(activeSmelter.value, 1));
|
const smelterMetal = computed(() => Decimal.add(activeSmelter.value, 1));
|
||||||
const buildSmelter = createBuyable(() => ({
|
const buildSmelter = createBuyable(() => ({
|
||||||
resource: metal.metal,
|
resource: metal.metal,
|
||||||
cost() {
|
cost() {
|
||||||
let v = new Decimal(this.amount.value);
|
const v = new Decimal(this.amount.value);
|
||||||
let price = Decimal.pow(10, v).times(1e7);
|
let price = Decimal.pow(10, v).times(1e7);
|
||||||
if (row2Upgrades[4].bought.value) price = price.div(Decimal.add(totalOil.value, 1).root(6));
|
if (row2Upgrades[4].bought.value)
|
||||||
|
price = price.div(Decimal.add(totalOil.value, 1).root(6));
|
||||||
return price;
|
return price;
|
||||||
},
|
},
|
||||||
display: jsx(() => (
|
display: jsx(() => (
|
||||||
|
@ -446,7 +500,8 @@ const layer = createLayer(id, function (this: BaseLayer) {
|
||||||
<h3>Oil Smelter</h3>
|
<h3>Oil Smelter</h3>
|
||||||
<br />
|
<br />
|
||||||
Use oil as a crucible fuel.
|
Use oil as a crucible fuel.
|
||||||
<br />Burn 100x<sup>2</sup> oil to smelt +100% faster.
|
<br />
|
||||||
|
Burn 100x<sup>2</sup> oil to smelt +100% faster.
|
||||||
<br />
|
<br />
|
||||||
<br />
|
<br />
|
||||||
Currently:
|
Currently:
|
||||||
|
@ -507,14 +562,15 @@ const layer = createLayer(id, function (this: BaseLayer) {
|
||||||
}));
|
}));
|
||||||
|
|
||||||
// --------------------------------------------------------------------------- Milestones
|
// --------------------------------------------------------------------------- Milestones
|
||||||
|
|
||||||
const depthMilestones = [
|
const depthMilestones = [
|
||||||
createMilestone(() => ({
|
createMilestone(() => ({
|
||||||
display: {
|
display: {
|
||||||
requirement: "5m Well Depth",
|
requirement: "5m Well Depth",
|
||||||
effectDisplay: "Gain 25% more coal for each metre of well depth (after the 3 elf milestone)."
|
effectDisplay:
|
||||||
|
"Gain 25% more coal for each metre of well depth (after the 3 elf milestone)."
|
||||||
},
|
},
|
||||||
shouldEarn: () => Decimal.gte(depth.value, 5),
|
shouldEarn: () => Decimal.gte(depth.value, 5)
|
||||||
})),
|
})),
|
||||||
createMilestone(() => ({
|
createMilestone(() => ({
|
||||||
display: {
|
display: {
|
||||||
|
@ -522,7 +578,7 @@ const layer = createLayer(id, function (this: BaseLayer) {
|
||||||
effectDisplay: "Drill too slow? Unlock some drill upgrades!"
|
effectDisplay: "Drill too slow? Unlock some drill upgrades!"
|
||||||
},
|
},
|
||||||
shouldEarn: () => Decimal.gte(depth.value, 10),
|
shouldEarn: () => Decimal.gte(depth.value, 10),
|
||||||
visibility: () => showIf(depthMilestones[0].earned.value),
|
visibility: () => showIf(depthMilestones[0].earned.value)
|
||||||
})),
|
})),
|
||||||
createMilestone(() => ({
|
createMilestone(() => ({
|
||||||
display: {
|
display: {
|
||||||
|
@ -530,7 +586,7 @@ const layer = createLayer(id, function (this: BaseLayer) {
|
||||||
effectDisplay: "Gain 5% more ore for each metre of well depth."
|
effectDisplay: "Gain 5% more ore for each metre of well depth."
|
||||||
},
|
},
|
||||||
shouldEarn: () => Decimal.gte(depth.value, 25),
|
shouldEarn: () => Decimal.gte(depth.value, 25),
|
||||||
visibility: () => showIf(depthMilestones[1].earned.value),
|
visibility: () => showIf(depthMilestones[1].earned.value)
|
||||||
})),
|
})),
|
||||||
createMilestone(() => ({
|
createMilestone(() => ({
|
||||||
display: {
|
display: {
|
||||||
|
@ -538,31 +594,34 @@ const layer = createLayer(id, function (this: BaseLayer) {
|
||||||
effectDisplay: "Drill still too slow? Try unlocking another drill!"
|
effectDisplay: "Drill still too slow? Try unlocking another drill!"
|
||||||
},
|
},
|
||||||
shouldEarn: () => Decimal.gte(depth.value, 60),
|
shouldEarn: () => Decimal.gte(depth.value, 60),
|
||||||
visibility: () => showIf(depthMilestones[2].earned.value),
|
visibility: () => showIf(depthMilestones[2].earned.value)
|
||||||
})),
|
})),
|
||||||
createMilestone(() => ({
|
createMilestone(() => ({
|
||||||
display: {
|
display: {
|
||||||
requirement: "150m Well Depth",
|
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!"
|
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),
|
shouldEarn: () => Decimal.gte(depth.value, 150),
|
||||||
visibility: () => showIf(depthMilestones[3].earned.value),
|
visibility: () => showIf(depthMilestones[3].earned.value)
|
||||||
})),
|
})),
|
||||||
createMilestone(() => ({
|
createMilestone(() => ({
|
||||||
display: {
|
display: {
|
||||||
requirement: "350m Well Depth",
|
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!"
|
effectDisplay:
|
||||||
|
"There is 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),
|
shouldEarn: () => Decimal.gte(depth.value, 350),
|
||||||
visibility: () => showIf(depthMilestones[4].earned.value),
|
visibility: () => showIf(depthMilestones[4].earned.value)
|
||||||
})),
|
})),
|
||||||
createMilestone(() => ({
|
createMilestone(() => ({
|
||||||
display: {
|
display: {
|
||||||
requirement: "1,000m Well Depth",
|
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."
|
effectDisplay:
|
||||||
|
"You've finally found oil! Maybe it's time to make those oil useful! Unfortunately extracting them would use more coal, and also it's becoming much harder to mine deeper due to the thermal heat and pressure."
|
||||||
},
|
},
|
||||||
shouldEarn: () => Decimal.gte(depth.value, 1000),
|
shouldEarn: () => Decimal.gte(depth.value, 1000),
|
||||||
visibility: () => showIf(Decimal.gte(depth.value, 1000)),
|
visibility: () => showIf(Decimal.gte(depth.value, 1000))
|
||||||
})),
|
})),
|
||||||
createMilestone(() => ({
|
createMilestone(() => ({
|
||||||
display: {
|
display: {
|
||||||
|
@ -570,21 +629,21 @@ const layer = createLayer(id, function (this: BaseLayer) {
|
||||||
effectDisplay: "You found a large oil spot! Double oil gain!"
|
effectDisplay: "You found a large oil spot! Double oil gain!"
|
||||||
},
|
},
|
||||||
shouldEarn: () => Decimal.gte(depth.value, 3000),
|
shouldEarn: () => Decimal.gte(depth.value, 3000),
|
||||||
visibility: () => showIf(Decimal.gte(depth.value, 2000)),
|
visibility: () => showIf(Decimal.gte(depth.value, 2000))
|
||||||
})),
|
}))
|
||||||
] as Record<number, GenericMilestone>;
|
] as Record<number, GenericMilestone>;
|
||||||
|
|
||||||
const { collapseMilestones: collapsedDepthMilestones, display: depthMilestonesDisplay } =
|
const { collapseMilestones: collapsedDepthMilestones, display: depthMilestonesDisplay } =
|
||||||
createCollapsibleMilestones(depthMilestones);
|
createCollapsibleMilestones(depthMilestones);
|
||||||
|
|
||||||
|
|
||||||
const oilMilestones = [
|
const oilMilestones = [
|
||||||
createMilestone(() => ({
|
createMilestone(() => ({
|
||||||
display: {
|
display: {
|
||||||
requirement: "100 total oil",
|
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?"
|
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),
|
shouldEarn: () => Decimal.gte(totalOil.value, 100)
|
||||||
})),
|
})),
|
||||||
createMilestone(() => ({
|
createMilestone(() => ({
|
||||||
display: {
|
display: {
|
||||||
|
@ -592,18 +651,19 @@ const layer = createLayer(id, function (this: BaseLayer) {
|
||||||
effectDisplay: "Unlocks oil upgrades! These can be bought with oil."
|
effectDisplay: "Unlocks oil upgrades! These can be bought with oil."
|
||||||
},
|
},
|
||||||
shouldEarn: () => Decimal.gte(totalOil.value, 500),
|
shouldEarn: () => Decimal.gte(totalOil.value, 500),
|
||||||
visibility: () => showIf(oilMilestones[0].earned.value),
|
visibility: () => showIf(oilMilestones[0].earned.value)
|
||||||
})),
|
})),
|
||||||
createMilestone(() => ({
|
createMilestone(() => ({
|
||||||
display: {
|
display: {
|
||||||
requirement: "10,000 total oil",
|
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?"
|
effectDisplay:
|
||||||
|
"Wow, this is really bright when you burn it. Maybe it can be helpful to use them to smelt metal?"
|
||||||
},
|
},
|
||||||
shouldEarn: () => Decimal.gte(totalOil.value, 10000),
|
shouldEarn: () => Decimal.gte(totalOil.value, 10000),
|
||||||
visibility: () => showIf(oilMilestones[1].earned.value),
|
visibility: () => showIf(oilMilestones[1].earned.value)
|
||||||
})),
|
}))
|
||||||
] as Record<number, GenericMilestone>;
|
] as Record<number, GenericMilestone>;
|
||||||
|
|
||||||
const { collapseMilestones: collapsedOilMilestones, display: oilMilestonesDisplay } =
|
const { collapseMilestones: collapsedOilMilestones, display: oilMilestonesDisplay } =
|
||||||
createCollapsibleMilestones(oilMilestones);
|
createCollapsibleMilestones(oilMilestones);
|
||||||
|
|
||||||
|
@ -655,28 +715,49 @@ const layer = createLayer(id, function (this: BaseLayer) {
|
||||||
cost: 100,
|
cost: 100,
|
||||||
display: {
|
display: {
|
||||||
title: "Drill Oil",
|
title: "Drill Oil",
|
||||||
description: "Increase previous upgrades' effect by +0.1% per thing per Heavy Drill owned.",
|
description: "Increase previous upgrades' effect by +0.1% per Heavy Drill owned.",
|
||||||
effectDisplay: jsx(() => <>+{format(Decimal.mul(row1UpgradeEffects[4].value, 100))}%</>)
|
effectDisplay: jsx(() => (
|
||||||
|
<>+{format(Decimal.mul(row1UpgradeEffects[4].value, 100))}%</>
|
||||||
|
))
|
||||||
},
|
},
|
||||||
style: { color: colorText }
|
style: { color: colorText }
|
||||||
})),
|
}))
|
||||||
];
|
];
|
||||||
const row1UpgradeEffects: ComputedRef<DecimalSource>[] = [
|
const row1UpgradeEffects: ComputedRef<DecimalSource>[] = [
|
||||||
computed(() => Decimal.mul(coal.buildDrill.amount.value, Decimal.add(0.04, computedUpgradeBonus.value)).add(1)),
|
computed(() =>
|
||||||
computed(() => Decimal.mul(metal.oreDrill.amount.value, Decimal.add(0.04, computedUpgradeBonus.value)).add(1)),
|
Decimal.mul(
|
||||||
computed(() => Decimal.mul(Decimal.max(coal.coal.value, 1).log10().floor(), Decimal.add(0.06, computedUpgradeBonus.value)).add(1)),
|
coal.buildDrill.amount.value,
|
||||||
computed(() => Decimal.mul(Decimal.max(metal.metal.value, 1).log10().floor(), Decimal.add(0.10, computedUpgradeBonus.value)).add(1)),
|
Decimal.add(0.04, computedUpgradeBonus.value)
|
||||||
computed(() => Decimal.mul(buildHeavy.amount.value, 0.001)),
|
).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.1, computedUpgradeBonus.value)
|
||||||
|
).add(1)
|
||||||
|
),
|
||||||
|
computed(() => Decimal.mul(buildHeavy.amount.value, 0.001))
|
||||||
];
|
];
|
||||||
|
|
||||||
|
|
||||||
const row2Upgrades = [
|
const row2Upgrades = [
|
||||||
createUpgrade(() => ({
|
createUpgrade(() => ({
|
||||||
resource: noPersist(oil),
|
resource: noPersist(oil),
|
||||||
cost: 100,
|
cost: 100,
|
||||||
display: {
|
display: {
|
||||||
title: "Oil the Oil Pump",
|
title: "Oil the Oil Pump",
|
||||||
description: "Double oil gain.",
|
description: "Double oil gain."
|
||||||
},
|
},
|
||||||
style: { color: colorText }
|
style: { color: colorText }
|
||||||
})),
|
})),
|
||||||
|
@ -685,7 +766,8 @@ const layer = createLayer(id, function (this: BaseLayer) {
|
||||||
cost: 500,
|
cost: 500,
|
||||||
display: {
|
display: {
|
||||||
title: "Oil the Mining Drills",
|
title: "Oil the Mining Drills",
|
||||||
description: "Double ore mining speed and square the coal drill amount in its effect.",
|
description:
|
||||||
|
"Double ore mining speed and square the coal drill amount in its effect."
|
||||||
},
|
},
|
||||||
style: { color: colorText }
|
style: { color: colorText }
|
||||||
})),
|
})),
|
||||||
|
@ -694,7 +776,7 @@ const layer = createLayer(id, function (this: BaseLayer) {
|
||||||
cost: 1500,
|
cost: 1500,
|
||||||
display: {
|
display: {
|
||||||
title: "Blaster Burner",
|
title: "Blaster Burner",
|
||||||
description: "The Oil Burner can now increase your metal gain.",
|
description: "The Oil Burner can now increase your metal gain."
|
||||||
},
|
},
|
||||||
style: { color: colorText }
|
style: { color: colorText }
|
||||||
})),
|
})),
|
||||||
|
@ -703,7 +785,7 @@ const layer = createLayer(id, function (this: BaseLayer) {
|
||||||
cost: 25000,
|
cost: 25000,
|
||||||
display: {
|
display: {
|
||||||
title: "Oil Integration",
|
title: "Oil Integration",
|
||||||
description: "Reduce Oil Well's coal consumption multipler from 5 to 4",
|
description: "Reduce Oil Well's coal consumption multipler from 5 to 4"
|
||||||
},
|
},
|
||||||
style: { color: colorText }
|
style: { color: colorText }
|
||||||
})),
|
})),
|
||||||
|
@ -712,10 +794,15 @@ const layer = createLayer(id, function (this: BaseLayer) {
|
||||||
cost: 50000,
|
cost: 50000,
|
||||||
display: {
|
display: {
|
||||||
title: "Be One with the Oil",
|
title: "Be One with the Oil",
|
||||||
description: jsx(() => <>Divide metal ingot prices of oil buildings by <sup>6</sup><Sqrt>total oil + 1</Sqrt></>),
|
description: jsx(() => (
|
||||||
|
<>
|
||||||
|
Divide metal ingot prices of oil buildings by <sup>6</sup>
|
||||||
|
<Sqrt>total oil + 1</Sqrt>
|
||||||
|
</>
|
||||||
|
))
|
||||||
},
|
},
|
||||||
style: { color: colorText }
|
style: { color: colorText }
|
||||||
})),
|
}))
|
||||||
];
|
];
|
||||||
|
|
||||||
const coalConsumption = createSequentialModifier(() => [
|
const coalConsumption = createSequentialModifier(() => [
|
||||||
|
@ -733,7 +820,7 @@ const layer = createLayer(id, function (this: BaseLayer) {
|
||||||
addend: computedOilSubstitution,
|
addend: computedOilSubstitution,
|
||||||
description: "Oil to Coal Substitution",
|
description: "Oil to Coal Substitution",
|
||||||
enabled: () => Decimal.gt(computedOilSubstitution.value, 0)
|
enabled: () => Decimal.gt(computedOilSubstitution.value, 0)
|
||||||
})),
|
}))
|
||||||
]);
|
]);
|
||||||
const computedCoalConsumption = computed(() => coalConsumption.apply(0));
|
const computedCoalConsumption = computed(() => coalConsumption.apply(0));
|
||||||
const drillPower = createSequentialModifier(() => [
|
const drillPower = createSequentialModifier(() => [
|
||||||
|
@ -771,7 +858,7 @@ const layer = createLayer(id, function (this: BaseLayer) {
|
||||||
multiplier: () => coalEffectiveness.value,
|
multiplier: () => coalEffectiveness.value,
|
||||||
description: "Effectiveness",
|
description: "Effectiveness",
|
||||||
enabled: () => Decimal.lt(coalEffectiveness.value, 1)
|
enabled: () => Decimal.lt(coalEffectiveness.value, 1)
|
||||||
})),
|
}))
|
||||||
]);
|
]);
|
||||||
const computedDrillPower = computed(() => drillPower.apply(0));
|
const computedDrillPower = computed(() => drillPower.apply(0));
|
||||||
|
|
||||||
|
@ -780,10 +867,10 @@ const layer = createLayer(id, function (this: BaseLayer) {
|
||||||
addend: row1UpgradeEffects[4],
|
addend: row1UpgradeEffects[4],
|
||||||
description: "Drill Oil",
|
description: "Drill Oil",
|
||||||
enabled: row1Upgrades[4].bought
|
enabled: row1Upgrades[4].bought
|
||||||
})),
|
}))
|
||||||
]);
|
]);
|
||||||
const computedUpgradeBonus = computed(() => upgradeBonus.apply(0));
|
const computedUpgradeBonus = computed(() => upgradeBonus.apply(0));
|
||||||
|
|
||||||
const oilSpeed = createSequentialModifier(() => [
|
const oilSpeed = createSequentialModifier(() => [
|
||||||
createAdditiveModifier(() => ({
|
createAdditiveModifier(() => ({
|
||||||
addend: pumpOil,
|
addend: pumpOil,
|
||||||
|
@ -804,10 +891,10 @@ const layer = createLayer(id, function (this: BaseLayer) {
|
||||||
multiplier: () => coalEffectiveness.value,
|
multiplier: () => coalEffectiveness.value,
|
||||||
description: "Effectiveness",
|
description: "Effectiveness",
|
||||||
enabled: () => Decimal.lt(coalEffectiveness.value, 1)
|
enabled: () => Decimal.lt(coalEffectiveness.value, 1)
|
||||||
})),
|
}))
|
||||||
]);
|
]);
|
||||||
const computedOilSpeed = computed(() => oilSpeed.apply(0));
|
const computedOilSpeed = computed(() => oilSpeed.apply(0));
|
||||||
|
|
||||||
const oilConsumption = createSequentialModifier(() => [
|
const oilConsumption = createSequentialModifier(() => [
|
||||||
createAdditiveModifier(() => ({
|
createAdditiveModifier(() => ({
|
||||||
addend: () => Decimal.negate(burnerOil.value),
|
addend: () => Decimal.negate(burnerOil.value),
|
||||||
|
@ -818,10 +905,10 @@ const layer = createLayer(id, function (this: BaseLayer) {
|
||||||
addend: () => Decimal.negate(smelterOil.value),
|
addend: () => Decimal.negate(smelterOil.value),
|
||||||
description: "Oil Smelter",
|
description: "Oil Smelter",
|
||||||
enabled: () => Decimal.gt(activeSmelter.value, 0)
|
enabled: () => Decimal.gt(activeSmelter.value, 0)
|
||||||
})),
|
}))
|
||||||
]);
|
]);
|
||||||
const computedOilConsumption = computed(() => oilConsumption.apply(0));
|
const computedOilConsumption = computed(() => oilConsumption.apply(0));
|
||||||
|
|
||||||
const oilSubstitution = createSequentialModifier(() => [
|
const oilSubstitution = createSequentialModifier(() => [
|
||||||
createAdditiveModifier(() => ({
|
createAdditiveModifier(() => ({
|
||||||
addend: burnerCoal,
|
addend: burnerCoal,
|
||||||
|
@ -832,7 +919,7 @@ const layer = createLayer(id, function (this: BaseLayer) {
|
||||||
multiplier: () => oilEffectiveness.value,
|
multiplier: () => oilEffectiveness.value,
|
||||||
description: "Effectiveness",
|
description: "Effectiveness",
|
||||||
enabled: () => Decimal.lt(oilEffectiveness.value, 1)
|
enabled: () => Decimal.lt(oilEffectiveness.value, 1)
|
||||||
})),
|
}))
|
||||||
]);
|
]);
|
||||||
const computedOilSubstitution = computed(() => oilSubstitution.apply(0));
|
const computedOilSubstitution = computed(() => oilSubstitution.apply(0));
|
||||||
|
|
||||||
|
@ -841,19 +928,19 @@ const layer = createLayer(id, function (this: BaseLayer) {
|
||||||
title: "Coal Consumption",
|
title: "Coal Consumption",
|
||||||
modifier: coalConsumption,
|
modifier: coalConsumption,
|
||||||
unit: "/s",
|
unit: "/s",
|
||||||
base: 0,
|
base: 0
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
title: "Drill Power",
|
title: "Drill Power",
|
||||||
modifier: drillPower,
|
modifier: drillPower,
|
||||||
base: 0,
|
base: 0
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
title: "Upgrade Bonus",
|
title: "Upgrade Bonus",
|
||||||
modifier: upgradeBonus,
|
modifier: upgradeBonus,
|
||||||
base: 0,
|
base: 0,
|
||||||
visible() {
|
visible() {
|
||||||
return Decimal.gt(computedUpgradeBonus.value, 0)
|
return Decimal.gt(computedUpgradeBonus.value, 0);
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
|
@ -862,7 +949,7 @@ const layer = createLayer(id, function (this: BaseLayer) {
|
||||||
unit: "/s",
|
unit: "/s",
|
||||||
base: 0,
|
base: 0,
|
||||||
visible() {
|
visible() {
|
||||||
return Decimal.gt(computedOilSpeed.value, 0)
|
return Decimal.gt(computedOilSpeed.value, 0);
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
|
@ -871,7 +958,7 @@ const layer = createLayer(id, function (this: BaseLayer) {
|
||||||
unit: "/s",
|
unit: "/s",
|
||||||
base: 0,
|
base: 0,
|
||||||
visible() {
|
visible() {
|
||||||
return Decimal.lt(computedOilConsumption.value, 0)
|
return Decimal.lt(computedOilConsumption.value, 0);
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
|
@ -880,9 +967,9 @@ const layer = createLayer(id, function (this: BaseLayer) {
|
||||||
unit: "/s",
|
unit: "/s",
|
||||||
base: 0,
|
base: 0,
|
||||||
visible() {
|
visible() {
|
||||||
return Decimal.gt(computedOilSubstitution.value, 0)
|
return Decimal.gt(computedOilSubstitution.value, 0);
|
||||||
}
|
}
|
||||||
},
|
}
|
||||||
]);
|
]);
|
||||||
const showModifiersModal = ref(false);
|
const showModifiersModal = ref(false);
|
||||||
const modifiersModal = jsx(() => (
|
const modifiersModal = jsx(() => (
|
||||||
|
@ -895,34 +982,43 @@ const layer = createLayer(id, function (this: BaseLayer) {
|
||||||
}}
|
}}
|
||||||
/>
|
/>
|
||||||
));
|
));
|
||||||
|
|
||||||
const coalEffectiveness = ref<DecimalSource>(Decimal.dOne);
|
const coalEffectiveness = ref<DecimalSource>(Decimal.dOne);
|
||||||
const oilEffectiveness = ref<DecimalSource>(Decimal.dOne);
|
const oilEffectiveness = ref<DecimalSource>(Decimal.dOne);
|
||||||
globalBus.on("update", diff => {
|
globalBus.on("update", diff => {
|
||||||
if (Decimal.lt(main.day.value, day)) {
|
if (Decimal.lt(main.day.value, day)) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
const coalCost = Decimal.negate(computedCoalConsumption.value);
|
const coalCost = Decimal.negate(computedCoalConsumption.value);
|
||||||
if (Decimal.gt(coalCost, 0)) {
|
if (Decimal.gt(coalCost, 0)) {
|
||||||
coalEffectiveness.value = Decimal.min(Decimal.div(coal.coal.value, coalCost), 1);
|
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));
|
coal.coal.value = Decimal.sub(
|
||||||
|
coal.coal.value,
|
||||||
|
Decimal.mul(coalCost, coalEffectiveness.value).mul(diff)
|
||||||
|
);
|
||||||
} else {
|
} else {
|
||||||
coalEffectiveness.value = Decimal.dOne;
|
coalEffectiveness.value = Decimal.dOne;
|
||||||
}
|
}
|
||||||
drillProgress.value = Decimal.add(drillProgress.value, Decimal.mul(computedDrillPower.value, diff));
|
drillProgress.value = Decimal.add(
|
||||||
|
drillProgress.value,
|
||||||
|
Decimal.mul(computedDrillPower.value, diff)
|
||||||
|
);
|
||||||
oil.value = Decimal.add(oil.value, Decimal.mul(computedOilSpeed.value, diff));
|
oil.value = Decimal.add(oil.value, Decimal.mul(computedOilSpeed.value, diff));
|
||||||
checkDrillProgress();
|
checkDrillProgress();
|
||||||
|
|
||||||
const oilCost = Decimal.negate(computedOilConsumption.value);
|
const oilCost = Decimal.negate(computedOilConsumption.value);
|
||||||
if (Decimal.gt(oilCost, 0)) {
|
if (Decimal.gt(oilCost, 0)) {
|
||||||
oilEffectiveness.value = Decimal.min(Decimal.div(oil.value, oilCost), 1);
|
oilEffectiveness.value = Decimal.min(Decimal.div(oil.value, oilCost), 1);
|
||||||
oil.value = Decimal.sub(oil.value, Decimal.mul(oilCost, oilEffectiveness.value).mul(diff));
|
oil.value = Decimal.sub(
|
||||||
|
oil.value,
|
||||||
|
Decimal.mul(oilCost, oilEffectiveness.value).mul(diff)
|
||||||
|
);
|
||||||
} else {
|
} else {
|
||||||
oilEffectiveness.value = Decimal.dOne;
|
oilEffectiveness.value = Decimal.dOne;
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
const { total: totalOil, trackerDisplay } = setUpDailyProgressTracker({
|
const { total: totalOil, trackerDisplay } = setUpDailyProgressTracker({
|
||||||
resource: oil,
|
resource: oil,
|
||||||
goal: 250000,
|
goal: 250000,
|
||||||
|
@ -980,35 +1076,44 @@ const layer = createLayer(id, function (this: BaseLayer) {
|
||||||
<>
|
<>
|
||||||
{render(trackerDisplay)}
|
{render(trackerDisplay)}
|
||||||
<Spacer />
|
<Spacer />
|
||||||
{
|
{Decimal.lt(coalEffectiveness.value, 1)
|
||||||
Decimal.lt(coalEffectiveness.value, 1) ?
|
? "Coal efficiency: " + format(Decimal.mul(coalEffectiveness.value, 100)) + "%"
|
||||||
"Coal efficiency: " + format(Decimal.mul(coalEffectiveness.value, 100)) + "%"
|
: null}
|
||||||
: null
|
{Decimal.lt(oilEffectiveness.value, 1)
|
||||||
}
|
? "Oil efficiency: " + format(Decimal.mul(oilEffectiveness.value, 100)) + "%"
|
||||||
{
|
: null}
|
||||||
Decimal.lt(oilEffectiveness.value, 1) ?
|
|
||||||
"Oil efficiency: " + format(Decimal.mul(oilEffectiveness.value, 100)) + "%"
|
|
||||||
: null
|
|
||||||
}
|
|
||||||
<MainDisplay
|
<MainDisplay
|
||||||
resource={oil}
|
resource={oil}
|
||||||
color={color}
|
color={color}
|
||||||
sticky={true}
|
sticky={true}
|
||||||
productionDisplay={jsx(() => (
|
productionDisplay={jsx(() => (
|
||||||
<>
|
<>
|
||||||
{Decimal.lt(depth.value, 1000) ? "Reach 1000m to start gaining oil" :
|
{Decimal.lt(depth.value, 1000) ? (
|
||||||
<>{formatGain(Decimal.add(computedOilSpeed.value, computedOilConsumption.value))}
|
"Reach 1000m to start gaining oil"
|
||||||
|
) : (
|
||||||
|
<>
|
||||||
|
{formatGain(
|
||||||
|
Decimal.add(
|
||||||
|
computedOilSpeed.value,
|
||||||
|
computedOilConsumption.value
|
||||||
|
)
|
||||||
|
)}
|
||||||
</>
|
</>
|
||||||
}
|
)}
|
||||||
</>
|
</>
|
||||||
))}
|
))}
|
||||||
/>
|
/>
|
||||||
{Decimal.eq(computedOilSpeed.value, 0) ? <>
|
{Decimal.eq(computedOilSpeed.value, 0) ? (
|
||||||
(Need at least 1 Oil Pump, 1 Heavy Drill and 1 Heavy Extractor active to gain oil)
|
<>
|
||||||
<br/></> : ""}
|
(Need at least 1 Oil Pump, 1 Heavy Drill and 1 Heavy Extractor active to
|
||||||
|
gain oil)
|
||||||
|
<br />
|
||||||
|
</>
|
||||||
|
) : (
|
||||||
|
""
|
||||||
|
)}
|
||||||
<Row>
|
<Row>
|
||||||
{
|
{depthMilestones[6].earned.value ? (
|
||||||
depthMilestones[6].earned.value ?
|
|
||||||
<Column>
|
<Column>
|
||||||
{render(buildPump)}
|
{render(buildPump)}
|
||||||
<div>
|
<div>
|
||||||
|
@ -1017,10 +1122,8 @@ const layer = createLayer(id, function (this: BaseLayer) {
|
||||||
</div>
|
</div>
|
||||||
{renderRow(minPump, removePump, addPump, maxPump)}
|
{renderRow(minPump, removePump, addPump, maxPump)}
|
||||||
</Column>
|
</Column>
|
||||||
: null
|
) : null}
|
||||||
}
|
{oilMilestones[0].earned.value ? (
|
||||||
{
|
|
||||||
oilMilestones[0].earned.value ?
|
|
||||||
<Column>
|
<Column>
|
||||||
{render(buildBurner)}
|
{render(buildBurner)}
|
||||||
<div>
|
<div>
|
||||||
|
@ -1029,10 +1132,8 @@ const layer = createLayer(id, function (this: BaseLayer) {
|
||||||
</div>
|
</div>
|
||||||
{renderRow(minBurner, removeBurner, addBurner, maxBurner)}
|
{renderRow(minBurner, removeBurner, addBurner, maxBurner)}
|
||||||
</Column>
|
</Column>
|
||||||
: null
|
) : null}
|
||||||
}
|
{oilMilestones[2].earned.value ? (
|
||||||
{
|
|
||||||
oilMilestones[2].earned.value ?
|
|
||||||
<Column>
|
<Column>
|
||||||
{render(buildSmelter)}
|
{render(buildSmelter)}
|
||||||
<div>
|
<div>
|
||||||
|
@ -1041,8 +1142,7 @@ const layer = createLayer(id, function (this: BaseLayer) {
|
||||||
</div>
|
</div>
|
||||||
{renderRow(minSmelter, removeSmelter, addSmelter, maxSmelter)}
|
{renderRow(minSmelter, removeSmelter, addSmelter, maxSmelter)}
|
||||||
</Column>
|
</Column>
|
||||||
: null
|
) : null}
|
||||||
}
|
|
||||||
</Row>
|
</Row>
|
||||||
<br />
|
<br />
|
||||||
<div>
|
<div>
|
||||||
|
@ -1051,7 +1151,9 @@ const layer = createLayer(id, function (this: BaseLayer) {
|
||||||
{formatWhole(depth.value)}
|
{formatWhole(depth.value)}
|
||||||
</h2>
|
</h2>
|
||||||
m deep
|
m deep
|
||||||
<br/>Next at {format(Decimal.sub(drillProgressReq.value, drillProgress.value))} drill power seconds
|
<br />
|
||||||
|
Next at {format(Decimal.sub(drillProgressReq.value, drillProgress.value))} drill
|
||||||
|
power seconds
|
||||||
</div>
|
</div>
|
||||||
<div>
|
<div>
|
||||||
<span>Your drill power is </span>
|
<span>Your drill power is </span>
|
||||||
|
@ -1069,8 +1171,7 @@ const layer = createLayer(id, function (this: BaseLayer) {
|
||||||
</div>
|
</div>
|
||||||
{renderRow(minHeavy, removeHeavy, addHeavy, maxHeavy)}
|
{renderRow(minHeavy, removeHeavy, addHeavy, maxHeavy)}
|
||||||
</Column>
|
</Column>
|
||||||
{
|
{depthMilestones[3].earned.value ? (
|
||||||
depthMilestones[3].earned.value ?
|
|
||||||
<Column>
|
<Column>
|
||||||
{render(buildHeavy2)}
|
{render(buildHeavy2)}
|
||||||
<div>
|
<div>
|
||||||
|
@ -1079,10 +1180,8 @@ const layer = createLayer(id, function (this: BaseLayer) {
|
||||||
</div>
|
</div>
|
||||||
{renderRow(minHeavy2, removeHeavy2, addHeavy2, maxHeavy2)}
|
{renderRow(minHeavy2, removeHeavy2, addHeavy2, maxHeavy2)}
|
||||||
</Column>
|
</Column>
|
||||||
: null
|
) : null}
|
||||||
}
|
{depthMilestones[5].earned.value ? (
|
||||||
{
|
|
||||||
depthMilestones[5].earned.value ?
|
|
||||||
<Column>
|
<Column>
|
||||||
{render(buildExtractor)}
|
{render(buildExtractor)}
|
||||||
<div>
|
<div>
|
||||||
|
@ -1091,8 +1190,7 @@ const layer = createLayer(id, function (this: BaseLayer) {
|
||||||
</div>
|
</div>
|
||||||
{renderRow(minExtractor, removeExtractor, addExtractor, maxExtractor)}
|
{renderRow(minExtractor, removeExtractor, addExtractor, maxExtractor)}
|
||||||
</Column>
|
</Column>
|
||||||
: null
|
) : null}
|
||||||
}
|
|
||||||
</Row>
|
</Row>
|
||||||
<Spacer />
|
<Spacer />
|
||||||
{depthMilestones[1].earned.value ? renderRow(...row1Upgrades) : null}
|
{depthMilestones[1].earned.value ? renderRow(...row1Upgrades) : null}
|
||||||
|
@ -1102,7 +1200,7 @@ const layer = createLayer(id, function (this: BaseLayer) {
|
||||||
{Decimal.gte(totalOil.value, 50) ? oilMilestonesDisplay() : ""}
|
{Decimal.gte(totalOil.value, 50) ? oilMilestonesDisplay() : ""}
|
||||||
</>
|
</>
|
||||||
))
|
))
|
||||||
}
|
};
|
||||||
});
|
});
|
||||||
|
|
||||||
export default layer;
|
export default layer;
|
||||||
|
|
|
@ -216,7 +216,7 @@ export const main = createLayer("main", function (this: BaseLayer) {
|
||||||
"The sounds of drills and metal clanging join the already loud din as yet another piece of the puzzle fits into place. You're making solid progress, Good Job!"
|
"The sounds of drills and metal clanging join the already loud din as yet another piece of the puzzle fits into place. You're making solid progress, Good Job!"
|
||||||
})),
|
})),
|
||||||
createDay(() => ({
|
createDay(() => ({
|
||||||
day: 8,
|
day: 8,
|
||||||
shouldNotify: false,
|
shouldNotify: false,
|
||||||
layer: "cloth",
|
layer: "cloth",
|
||||||
symbol: clothSymbol,
|
symbol: clothSymbol,
|
||||||
|
@ -229,8 +229,9 @@ export const main = createLayer("main", function (this: BaseLayer) {
|
||||||
shouldNotify: false,
|
shouldNotify: false,
|
||||||
layer: "oil",
|
layer: "oil",
|
||||||
symbol: oilSymbol,
|
symbol: oilSymbol,
|
||||||
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!",
|
story: "Looks like you just need one more thing before the toy factory can start 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, but unfortunately you'll need to mine much deeper that you're currently doing, 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!"
|
completedStory:
|
||||||
|
"It took a while, but you finally got enough oil for the next step! You deserve a good rest after all this digging work - tomorrow will be a busy day! Good Job!"
|
||||||
})),
|
})),
|
||||||
createDay(() => ({
|
createDay(() => ({
|
||||||
day: 10,
|
day: 10,
|
||||||
|
|
|
@ -70,7 +70,8 @@ requestAnimationFrame(async () => {
|
||||||
onRegisterError: console.warn,
|
onRegisterError: console.warn,
|
||||||
onRegistered(r) {
|
onRegistered(r) {
|
||||||
if (r) {
|
if (r) {
|
||||||
setInterval(r.update, 60 * 1000);
|
// https://stackoverflow.com/questions/65500916/typeerror-failed-to-execute-update-on-serviceworkerregistration-illegal-in
|
||||||
|
setInterval(() => r.update(), 60 * 60 * 1000);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
Loading…
Add table
Reference in a new issue