mirror of
https://github.com/Acamaeda/The-Modding-Tree.git
synced 2025-04-06 15:41:08 +00:00
Added directMult
This commit is contained in:
parent
559f4dd622
commit
5febe0d4db
4 changed files with 7 additions and 3 deletions
|
@ -15,7 +15,7 @@ challenges: {
|
||||||
11: {
|
11: {
|
||||||
name: "Ouch",
|
name: "Ouch",
|
||||||
challengeDescription: "description of ouchie",
|
challengeDescription: "description of ouchie",
|
||||||
goal: new Decimal(100),
|
canComplete: function() {return player.points.gte(100)},
|
||||||
etc
|
etc
|
||||||
},
|
},
|
||||||
etc
|
etc
|
||||||
|
|
|
@ -396,6 +396,7 @@ addLayer("f", {
|
||||||
base: 3,
|
base: 3,
|
||||||
roundUpCost: true,
|
roundUpCost: true,
|
||||||
canBuyMax() {return hasAchievement('a', 13)},
|
canBuyMax() {return hasAchievement('a', 13)},
|
||||||
|
directMult() {return new Decimal(player.c.otherThingy)},
|
||||||
|
|
||||||
row: 1,
|
row: 1,
|
||||||
layerShown() {return true},
|
layerShown() {return true},
|
||||||
|
|
|
@ -22,11 +22,13 @@ function getResetGain(layer, useType = null) {
|
||||||
if (type=="static") {
|
if (type=="static") {
|
||||||
if ((!tmp[layer].canBuyMax) || tmp[layer].baseAmount.lt(tmp[layer].requires)) return new Decimal(1)
|
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))
|
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);
|
return gain.floor().sub(player[layer].points).add(1).max(1);
|
||||||
} else if (type=="normal"){
|
} else if (type=="normal"){
|
||||||
if (tmp[layer].baseAmount.lt(tmp[layer].requires)) return new Decimal(0)
|
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)
|
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)))
|
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);
|
return gain.floor().max(0);
|
||||||
} else if (type=="custom"){
|
} else if (type=="custom"){
|
||||||
return layers[layer].getResetGain()
|
return layers[layer].getResetGain()
|
||||||
|
@ -52,13 +54,13 @@ function getNextAt(layer, canMax=false, useType = null) {
|
||||||
if (type=="static")
|
if (type=="static")
|
||||||
{
|
{
|
||||||
if (!tmp[layer].canBuyMax) canMax = false
|
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 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)
|
let cost = extraCost.times(tmp[layer].requires).max(tmp[layer].requires)
|
||||||
if (tmp[layer].roundUpCost) cost = cost.ceil()
|
if (tmp[layer].roundUpCost) cost = cost.ceil()
|
||||||
return cost;
|
return cost;
|
||||||
} else if (type=="normal"){
|
} 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))
|
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)
|
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()
|
if (tmp[layer].roundUpCost) next = next.ceil()
|
||||||
|
|
|
@ -167,6 +167,7 @@ function setupLayer(layer){
|
||||||
if(layers[layer].unlockOrder === undefined) layers[layer].unlockOrder = []
|
if(layers[layer].unlockOrder === undefined) layers[layer].unlockOrder = []
|
||||||
if(layers[layer].gainMult === undefined) layers[layer].gainMult = new Decimal(1)
|
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].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].type === undefined) layers[layer].type = "none"
|
||||||
if(layers[layer].base === undefined || layers[layer].base <= 1) layers[layer].base = 2
|
if(layers[layer].base === undefined || layers[layer].base <= 1) layers[layer].base = 2
|
||||||
if(layers[layer].softcap === undefined) layers[layer].softcap = new Decimal("e1e7")
|
if(layers[layer].softcap === undefined) layers[layer].softcap = new Decimal("e1e7")
|
||||||
|
|
Loading…
Add table
Reference in a new issue