1
0
Fork 0
mirror of https://github.com/Acamaeda/The-Modding-Tree.git synced 2025-05-10 12:01:32 +00:00

Added Bars component

This commit is contained in:
Acamaeda 2020-10-12 18:28:12 -04:00
parent e9d0f17d41
commit 40bbf03668
8 changed files with 211 additions and 47 deletions

View file

@ -63,19 +63,21 @@ function getNextAt(layer, canMax=false, useType = null) {
let type = useType
if (!useType) type = layers[layer].type
if (tmp[layer].gainExp.eq(0)) return new Decimal(1/0)
if (tmp[layer].gainMult.lte(0)) return new Decimal(Infinity)
if (tmp[layer].gainExp.lte(0)) return new Decimal(Infinity)
if (type=="static")
{
if (!layers[layer].canBuyMax()) canMax = false
let amt = player[layer].points.plus((canMax&&tmp[layer].baseAmount.gte(tmp[layer].nextAt))?tmp[layer].resetGain:0)
let extraCost = Decimal.pow(layers[layer].base, amt.pow(layers[layer].exponent).div(tmp[layer].gainExp)).times(tmp[layer].gainMult)
let extraCost = Decimal.pow(layers[layer].base, amt.pow(tmp[layer].exponent).div(tmp[layer].gainExp)).times(tmp[layer].gainMult)
let cost = extraCost.times(tmp[layer].requires).max(tmp[layer].requires)
if (layers[layer].resCeil) cost = cost.ceil()
return cost;
} else if (type=="normal"){
let next = tmp[layer].resetGain.add(1)
if (next.gte("e1e7")) next = next.div("e5e6").pow(2)
next = next.root(tmp[layer].gainExp.div(tmp[layer].gainMult).root(layers[layer].exponent).times(tmp[layer].requires).max(tmp[layer].requires))
next=next.root(tmp[layer].gainExp.div(tmp[layer].gainMult)).root(tmp[layer].exponent).times(tmp[layer].requires).max(tmp[layer].requires)
if (layers[layer].resCeil) next = next.ceil()
return next;
} else if (type=="custom"){