Fix oil smelter's inverse cost

This commit is contained in:
ducdat0507 2022-12-15 11:57:33 +07:00
parent 63314c8f99
commit f1f43398a7

View file

@ -450,7 +450,9 @@ const layer = createLayer(id, function (this: BaseLayer) {
}
let v = Decimal.div(x, 1e7).log(10);
v = v.div(Decimal.pow(0.95, paper.books.oilBook.totalAmount.value));
if (Decimal.gte(v, 100)) v = Decimal.mul(v, 100).root(4);
if (Decimal.gte(v, 1e4)) v = Decimal.mul(v, 1e4).root(2);
if (Decimal.gte(v, 200)) v = Decimal.mul(v, 200).root(2);
if (Decimal.gte(v, 50)) v = Decimal.mul(v, 50).root(2);
return Decimal.isNaN(v) ? Decimal.dZero : v.floor().max(0);
},
display: jsx(() => (