1
0
Fork 0
mirror of https://github.com/Acamaeda/The-Modding-Tree.git synced 2024-11-24 17:31:50 +00:00

Fixed a bug with static layers

This commit is contained in:
Acamaeda 2020-09-29 22:32:08 -04:00
parent b353693c89
commit 37286ac520

View file

@ -228,7 +228,7 @@ function notifyLayer(name) {
function getResetGain(layer) { function getResetGain(layer) {
if (tmp.gainExp[layer].eq(0)) return new Decimal(0) if (tmp.gainExp[layer].eq(0)) return new Decimal(0)
if (layers[layer].type=="static") { if (layers[layer].type=="static") {
if ((!canBuyMax(layer)) || tmp.layerAmt[layer].lt(tmp.layerReqs[layer])) return new Decimal(1) if ((!layers[layer].canBuyMax()) || tmp.layerAmt[layer].lt(tmp.layerReqs[layer])) return new Decimal(1)
let gain = tmp.layerAmt[layer].div(tmp.layerReqs[layer]).div(tmp.gainMults[layer]).max(1).log(layers[layer].base).times(tmp.gainExp[layer]).pow(Decimal.pow(layers[layer].exponent, -1)) let gain = tmp.layerAmt[layer].div(tmp.layerReqs[layer]).div(tmp.gainMults[layer]).max(1).log(layers[layer].base).times(tmp.gainExp[layer]).pow(Decimal.pow(layers[layer].exponent, -1))
return gain.floor().sub(player[layer].points).add(1).max(1); return gain.floor().sub(player[layer].points).add(1).max(1);
} else { } else {
@ -301,7 +301,7 @@ function doReset(layer, force=false) {
let gain = tmp.resetGain[layer] let gain = tmp.resetGain[layer]
if (layers[layer].type=="static") { if (layers[layer].type=="static") {
if (tmp.layerAmt[layer].lt(tmp.nextAt[layer])) return; if (tmp.layerAmt[layer].lt(tmp.nextAt[layer])) return;
gain =(canBuyMax(layer) ? gain : 1) gain =(layers[layer].canBuyMax() ? gain : 1)
} }
if (layers[layer].onPrestige) if (layers[layer].onPrestige)