just_another_tree/js/levels.js

54 lines
No EOL
2.3 KiB
JavaScript

function getAlphaLevel(points = player.p.points) {
if (Decimal.eq(points, 0)) return new Decimal(0)
return Decimal.add(points, 10).div(11).log(1.1).add(1).floor().max(0)
}
function getAlphaCost(points = player.p.points) {
return getAlphaLevel(points).pow_base(1.1).mul(11).sub(10)
}
function getAlphaEffect(points = player.p.points) {
return getAlphaLevel(points).mul(getAlphaRankEffect(points).add(0.05))
}
function getBetaLevel(points = player.p.points) {
if (Decimal.eq(points, 0)) return new Decimal(0)
return Decimal.add(points, 20).div(25).log(1.25).add(1).floor().max(0)
}
function getBetaCost(points = player.p.points) {
return getBetaLevel(points).pow_base(1.25).mul(25).sub(20)
}
function getBetaEffect(points = player.p.points) {
return getBetaLevel(points).mul(getBetaRankEffect(points).add(0.05)).add(1)
}
function getGammaLevel(points = player.p.points) {
if (Decimal.eq(points, 0)) return new Decimal(0)
return Decimal.add(points, 30).div(45).log(1.5).add(1).floor().max(0)
}
function getGammaCost(points = player.p.points) {
return getGammaLevel(points).pow_base(1.5).mul(45).sub(30)
}
function getGammaEffect(points = player.p.points) {
return getGammaLevel(points).mul(getGammaRankEffect(points).add(1/15)).add(1)
}
function getDeltaLevel(points = player.p.points) {
if (Decimal.eq(points, 0)) return new Decimal(0)
return Decimal.add(points, 30).div(60).log(2).add(1).floor().max(0)
}
function getDeltaCost(points = player.p.points) {
return getDeltaLevel(points).pow_base(2).mul(60).sub(30)
}
function getDeltaEffect(points = player.p.points) {
return getDeltaLevel(points).mul(getDeltaRankEffect(points).add(0.1)).add(1)
}
function getEpsilonLevel(points = player.p.points) {
if (Decimal.eq(points, 0)) return new Decimal(0)
return Decimal.mul(points, 3).add(100).div(250).log(2.5).add(1).floor().max(0)
}
function getEpsilonCost(points = player.p.points) {
return getEpsilonLevel(points).pow_base(2.5).mul(250).sub(100).div(3)
}
function getEpsilonEffect(points = player.p.points) {
return getEpsilonLevel(points).mul(getEpsilonRankEffect(points).add(0.025)).add(1)
}
function getTotalLevel() {
return getAlphaLevel().add(getBetaLevel()).add(getGammaLevel()).add(getDeltaLevel()).add(getEpsilonLevel())
}