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

Added directMult

This commit is contained in:
Harley White 2021-05-10 17:37:29 -04:00
parent 559f4dd622
commit 5febe0d4db
4 changed files with 7 additions and 3 deletions

View file

@ -15,7 +15,7 @@ challenges: {
11: {
name: "Ouch",
challengeDescription: "description of ouchie",
goal: new Decimal(100),
canComplete: function() {return player.points.gte(100)},
etc
},
etc

View file

@ -396,6 +396,7 @@ addLayer("f", {
base: 3,
roundUpCost: true,
canBuyMax() {return hasAchievement('a', 13)},
directMult() {return new Decimal(player.c.otherThingy)},
row: 1,
layerShown() {return true},

View file

@ -22,11 +22,13 @@ function getResetGain(layer, useType = null) {
if (type=="static") {
if ((!tmp[layer].canBuyMax) || tmp[layer].baseAmount.lt(tmp[layer].requires)) return new Decimal(1)
let gain = tmp[layer].baseAmount.div(tmp[layer].requires).div(tmp[layer].gainMult).max(1).log(tmp[layer].base).times(tmp[layer].gainExp).pow(Decimal.pow(tmp[layer].exponent, -1))
gain = gain.times(tmp[layer].directMult)
return gain.floor().sub(player[layer].points).add(1).max(1);
} else if (type=="normal"){
if (tmp[layer].baseAmount.lt(tmp[layer].requires)) return new Decimal(0)
let gain = tmp[layer].baseAmount.div(tmp[layer].requires).pow(tmp[layer].exponent).times(tmp[layer].gainMult).pow(tmp[layer].gainExp)
if (gain.gte(tmp[layer].softcap)) gain = gain.pow(tmp[layer].softcapPower).times(tmp[layer].softcap.pow(decimalOne.sub(tmp[layer].softcapPower)))
gain = gain.times(tmp[layer].directMult)
return gain.floor().max(0);
} else if (type=="custom"){
return layers[layer].getResetGain()
@ -52,13 +54,13 @@ function getNextAt(layer, canMax=false, useType = null) {
if (type=="static")
{
if (!tmp[layer].canBuyMax) canMax = false
let amt = player[layer].points.plus((canMax&&tmp[layer].baseAmount.gte(tmp[layer].nextAt))?tmp[layer].resetGain:0)
let amt = player[layer].points.plus((canMax&&tmp[layer].baseAmount.gte(tmp[layer].nextAt))?tmp[layer].resetGain:0).div(tmp[layer].directMult)
let extraCost = Decimal.pow(tmp[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 (tmp[layer].roundUpCost) cost = cost.ceil()
return cost;
} else if (type=="normal"){
let next = tmp[layer].resetGain.add(1)
let next = tmp[layer].resetGain.add(1).div(tmp[layer].directMult)
if (next.gte(tmp[layer].softcap)) next = next.div(tmp[layer].softcap.pow(decimalOne.sub(tmp[layer].softcapPower))).pow(decimalOne.div(tmp[layer].softcapPower))
next = next.root(tmp[layer].gainExp).div(tmp[layer].gainMult).root(tmp[layer].exponent).times(tmp[layer].requires).max(tmp[layer].requires)
if (tmp[layer].roundUpCost) next = next.ceil()

View file

@ -167,6 +167,7 @@ function setupLayer(layer){
if(layers[layer].unlockOrder === undefined) layers[layer].unlockOrder = []
if(layers[layer].gainMult === undefined) layers[layer].gainMult = new Decimal(1)
if(layers[layer].gainExp === undefined) layers[layer].gainExp = new Decimal(1)
if(layers[layer].directMult === undefined) layers[layer].directMult = new Decimal(1)
if(layers[layer].type === undefined) layers[layer].type = "none"
if(layers[layer].base === undefined || layers[layer].base <= 1) layers[layer].base = 2
if(layers[layer].softcap === undefined) layers[layer].softcap = new Decimal("e1e7")