From 899289cdeeda567747748ebd1799da19997dc096 Mon Sep 17 00:00:00 2001 From: thepaperpilot Date: Tue, 13 Dec 2022 20:42:32 -0600 Subject: [PATCH] Hook up new books --- src/data/layers/metal.tsx | 13 ++++++++++--- src/data/layers/oil.tsx | 18 ++++++++++++------ 2 files changed, 22 insertions(+), 9 deletions(-) diff --git a/src/data/layers/metal.tsx b/src/data/layers/metal.tsx index 52eb8b5..a3295ad 100644 --- a/src/data/layers/metal.tsx +++ b/src/data/layers/metal.tsx @@ -33,6 +33,7 @@ import plastic from "./plastic"; import dyes from "./dyes"; import management from "./management"; import workshop from "./workshop"; +import paper from "./paper"; const id = "metal"; const day = 7; @@ -378,7 +379,9 @@ const layer = createLayer(id, function (this: BaseLayer) { const oreDrill = createBuyable(() => ({ resource: noPersist(metal), cost() { - return Decimal.pow(1.15, this.amount.value).times(10); + let v = new Decimal(this.amount.value); + v = Decimal.pow(0.95, paper.books.metalBook.totalAmount.value).times(v); + return Decimal.pow(1.15, v).times(10); }, display: { title: "Metal Drill", @@ -402,7 +405,9 @@ const layer = createLayer(id, function (this: BaseLayer) { const industrialCrucible = createBuyable(() => ({ resource: noPersist(metal), cost() { - return Decimal.pow(1.15, Decimal.times(this.amount.value, 10)).times(10); + let v = new Decimal(this.amount.value); + v = Decimal.pow(0.95, paper.books.metalBook.totalAmount.value).times(v); + return Decimal.pow(1.15, Decimal.times(v, 10)).times(10); }, display: { title: "Industrial Crucible", @@ -426,7 +431,9 @@ const layer = createLayer(id, function (this: BaseLayer) { const hotterForge = createBuyable(() => ({ resource: coal.coal, cost() { - return Decimal.pow(10, this.amount.value).times(1e12); + let v = new Decimal(this.amount.value); + v = Decimal.pow(0.95, paper.books.metalBook.totalAmount.value).times(v); + return Decimal.pow(10, v).times(1e12); }, display: { title: "Hotter Forges", diff --git a/src/data/layers/oil.tsx b/src/data/layers/oil.tsx index 9e78016..1bbb05e 100644 --- a/src/data/layers/oil.tsx +++ b/src/data/layers/oil.tsx @@ -92,7 +92,8 @@ const layer = createLayer(id, function (this: BaseLayer) { const buildHeavy = createBuyable(() => ({ resource: metal.metal, cost() { - const v = new Decimal(this.amount.value); + let v = new Decimal(this.amount.value); + v = Decimal.pow(0.95, paper.books.heavyDrillBook.totalAmount.value).times(v); return Decimal.pow(1.3, v).times(2.5e4); }, display: jsx(() => ( @@ -135,7 +136,8 @@ const layer = createLayer(id, function (this: BaseLayer) { const buildHeavy2 = createBuyable(() => ({ resource: metal.metal, cost() { - const v = new Decimal(this.amount.value); + let v = new Decimal(this.amount.value); + v = Decimal.pow(0.95, paper.books.heavyDrillBook.totalAmount.value).times(v); return Decimal.pow(2, v).times(1e5); }, display: jsx(() => ( @@ -181,7 +183,8 @@ const layer = createLayer(id, function (this: BaseLayer) { const buildExtractor = createBuyable(() => ({ resource: metal.metal, cost() { - const v = new Decimal(this.amount.value); + let v = new Decimal(this.amount.value); + v = Decimal.pow(0.95, paper.books.heavyDrillBook.totalAmount.value).times(v); return Decimal.pow(8, v).times(2e5); }, display: jsx(() => ( @@ -237,7 +240,8 @@ const layer = createLayer(id, function (this: BaseLayer) { const buildPump = createBuyable(() => ({ resource: metal.metal, cost() { - const v = new Decimal(this.amount.value); + let v = new Decimal(this.amount.value); + v = Decimal.pow(0.95, paper.books.oilBook.totalAmount.value).times(v); let price = Decimal.pow(16, v).times(2e6); if (row2Upgrades[4].bought.value) price = price.div(Decimal.add(totalOil.value, 1).root(6)); @@ -286,7 +290,8 @@ const layer = createLayer(id, function (this: BaseLayer) { const buildBurner = createBuyable(() => ({ resource: noPersist(oil), cost() { - const v = new Decimal(this.amount.value); + let v = new Decimal(this.amount.value); + v = Decimal.pow(0.95, paper.books.oilBook.totalAmount.value).times(v); return Decimal.pow(2, v).times(50); }, display: jsx(() => ( @@ -338,7 +343,8 @@ const layer = createLayer(id, function (this: BaseLayer) { const buildSmelter = createBuyable(() => ({ resource: metal.metal, cost() { - const v = new Decimal(this.amount.value); + let v = new Decimal(this.amount.value); + v = Decimal.pow(0.95, paper.books.oilBook.totalAmount.value).times(v); let price = Decimal.pow(10, v).times(1e7); if (row2Upgrades[4].bought.value) price = price.div(Decimal.add(totalOil.value, 1).root(6));