mirror of
https://github.com/thepaperpilot/Advent-Incremental.git
synced 2024-11-21 16:13:57 +00:00
Fix NaN after buying loaders
This commit is contained in:
parent
f4d89a5b17
commit
5d3860c63b
1 changed files with 8 additions and 3 deletions
|
@ -249,9 +249,14 @@ const layer = createLayer(id, function (this: BaseLayer) {
|
||||||
);
|
);
|
||||||
},
|
},
|
||||||
onPurchase() {
|
onPurchase() {
|
||||||
metal.metal.value = Decimal.sub(metal.metal.value, this.metalCost.value);
|
const metalCost = Decimal.pow(1.2, Decimal.sub(helpers.loader.amount.value, 1)).times(
|
||||||
oil.oil.value = Decimal.sub(oil.oil.value, this.oilCost.value);
|
1e70
|
||||||
this.amount.value = Decimal.add(this.amount.value, 1);
|
);
|
||||||
|
const oilCost = Decimal.pow(1.2, Decimal.sub(helpers.loader.amount.value, 1)).times(
|
||||||
|
1e25
|
||||||
|
);
|
||||||
|
metal.metal.value = Decimal.sub(metal.metal.value, metalCost);
|
||||||
|
oil.oil.value = Decimal.sub(oil.oil.value, oilCost);
|
||||||
},
|
},
|
||||||
inverseCost() {
|
inverseCost() {
|
||||||
const metalAmount = Decimal.div(metal.metal.value, 1e70).log(1.2);
|
const metalAmount = Decimal.div(metal.metal.value, 1e70).log(1.2);
|
||||||
|
|
Loading…
Reference in a new issue