From 707d9f3e73eafaccdaa30f9c98b35e49b0828e27 Mon Sep 17 00:00:00 2001 From: TJCgames Date: Wed, 13 Mar 2024 17:02:37 +0000 Subject: [PATCH] Hell yeah super progress --- js/files.js | 23 +++++++--- js/levels.js | 81 +++++++++++++++++++++++++++------- js/mod.js | 16 ++++--- js/progress.js | 34 +++++++++------ js/super progress.js | 102 +++++++++++++++++++++++++++++++++++++++++++ 5 files changed, 215 insertions(+), 41 deletions(-) create mode 100644 js/super progress.js diff --git a/js/files.js b/js/files.js index 7211291..c104d16 100644 --- a/js/files.js +++ b/js/files.js @@ -1,7 +1,7 @@ addLayer("f", { name: "files", // This is optional, only used in a few places, If absent it just uses the layer id. - symbol: "🗎", // This appears on the layer's node. Default is the id with the first letter capitalized - position: 1, // Horizontal position within a row. By default it uses the layer id and sorts in alphabetical order + symbol: "🗎", // This appears on the layer's node. Default is the id with the first letter capitalized + position: 0, // Horizontal position within a row. By default it uses the layer id and sorts in alphabetical order startData() { return { unlocked: false, points: new Decimal(0), @@ -18,7 +18,7 @@ addLayer("f", { baseResource: "progress points", // Name of resource prestige is based on baseAmount() {return player.p.points}, // Get the current amount of baseResource type: "static", // normal: cost to gain currency depends on amount gained. static: cost depends on how much you already have - exponent: 1, // Prestige currency exponent + exponent: 1.1, // Prestige currency exponent base() { let base = 1.2 if (hasUpgrade(this.layer, 41)) base **= 0.95 @@ -82,13 +82,24 @@ addLayer("f", { effectDescription: "Multiply file cost by x0.8.", done() { return player.f.total.gte(15) } }, + 8: { + requirementDescription: "20 total Files.", + effectDescription: "Autobuy all PP buyables.", + done() { return player.f.total.gte(20) } + }, + 9: { + requirementDescription: "30 total Files.", + effectDescription: "You can now get fractional levels.", + done() { return player.f.total.gte(30) } + }, }, upgrades: { 11: { description: "Total rank boosts point gen.", effect() { return getTotalRank().add(2) }, effectDisplay() { return "^" + this.effect() + "." }, - cost: 1 + cost: 1, + unlocked() { return hasMilestone(this.layer, 4) }, }, 21: { description: "Start with 2 free Rebased levels.", @@ -182,8 +193,8 @@ addLayer("f", { "blank", "blank", ["row", [ - ["milestones", [0, 2, 4, 6]], - ["milestones", [1, 3, 5, 7]] + ["milestones", [0, 2, 4, 6, 8]], + ["milestones", [1, 3, 5, 7, 9]] ]] ] }, diff --git a/js/levels.js b/js/levels.js index c7e7bd0..c79eb59 100644 --- a/js/levels.js +++ b/js/levels.js @@ -7,30 +7,33 @@ function inverseCumulativeExponential(base, levels) { function getAlphaLevel(points = player.p.points) { if (Decimal.eq(points, 0)) return new Decimal(0) - return inverseCumulativeExponential(1.1, Decimal.pow(points, buyableEffect('p', 13).pow(-1))).floor() + const level = inverseCumulativeExponential(1.1, Decimal.pow(points, buyableEffect('p', 13).pow(-1))) + return hasMilestone('f', 9) ? level : level.floor() } function getAlphaCost(points = player.p.points) { - return cumulativeExponential(1.1, getAlphaLevel(points)).pow(buyableEffect('p', 13)) + return cumulativeExponential(1.1, getAlphaLevel(points).floor()).pow(buyableEffect('p', 13)) } function getAlphaEffect(points = player.p.points) { return getAlphaLevel(points).mul(getAlphaRankEffect(points).add(1/20)) } function getBetaLevel(points = player.p.points) { if (Decimal.eq(points, 0)) return new Decimal(0) - return inverseCumulativeExponential(1.25, Decimal.div(Decimal.pow(points, buyableEffect('p', 13).pow(-1)), 5)).floor() + const level = inverseCumulativeExponential(1.25, Decimal.div(Decimal.pow(points, buyableEffect('p', 13).pow(-1)), 5)) + return hasMilestone('f', 9) ? level : level.floor() } function getBetaCost(points = player.p.points) { - return cumulativeExponential(1.25, getBetaLevel(points)).mul(5).pow(buyableEffect('p', 13)) + return cumulativeExponential(1.25, getBetaLevel(points).floor()).mul(5).pow(buyableEffect('p', 13)) } function getBetaEffect(points = player.p.points) { return getBetaLevel(points).mul(getBetaRankEffect(points).add(1/20)).add(1).pow(hasUpgrade('f', 41) ? 1.2 : 1) } function getGammaLevel(points = player.p.points) { if (Decimal.eq(points, 0)) return new Decimal(0) - return inverseCumulativeExponential(1.5, Decimal.div(Decimal.pow(points, buyableEffect('p', 13).pow(-1)), 15)).floor() + const level = inverseCumulativeExponential(1.5, Decimal.div(Decimal.pow(points, buyableEffect('p', 13).pow(-1)), 15)) + return hasMilestone('f', 9) ? level : level.floor() } function getGammaCost(points = player.p.points) { - return cumulativeExponential(1.5, getGammaLevel(points)).mul(15).pow(buyableEffect('p', 13)) + return cumulativeExponential(1.5, getGammaLevel(points).floor()).mul(15).pow(buyableEffect('p', 13)) } function getGammaEffect(points = player.p.points) { return Decimal.add(points, 1).add(hasUpgrade('f', 31) ? getTotalLevel() : 0).log(Decimal.pow(50, buyableEffect('p', 12))) @@ -38,36 +41,84 @@ function getGammaEffect(points = player.p.points) { } function getDeltaLevel(points = player.p.points) { if (Decimal.eq(points, 0)) return new Decimal(0) - return inverseCumulativeExponential(2, Decimal.div(Decimal.pow(points, buyableEffect('p', 13).pow(-1)), 30)).floor() + const level = inverseCumulativeExponential(2, Decimal.div(Decimal.pow(points, buyableEffect('p', 13).pow(-1)), 30)) + return hasMilestone('f', 9) ? level : level.floor() } function getDeltaCost(points = player.p.points) { - return cumulativeExponential(2, getDeltaLevel(points)).mul(30).pow(buyableEffect('p', 13)) + return cumulativeExponential(2, getDeltaLevel(points).floor()).mul(30).pow(buyableEffect('p', 13)) } function getDeltaEffect(points = player.p.points) { return getDeltaLevel(points).mul(getDeltaRankEffect(points).add(1/5)).add(1).pow(hasUpgrade('f', 41) ? 1.2 : 1) } function getEpsilonLevel(points = player.p.points) { if (Decimal.eq(points, 0)) return new Decimal(0) - return inverseCumulativeExponential(2.5, Decimal.div(Decimal.pow(points, buyableEffect('p', 13).pow(-1)), 50)).floor() + const level = inverseCumulativeExponential(2.5, Decimal.div(Decimal.pow(points, buyableEffect('p', 13).pow(-1)), 50)) + return hasMilestone('f', 9) ? level : level.floor() } function getEpsilonCost(points = player.p.points) { - return cumulativeExponential(2.5, getEpsilonLevel(points)).mul(50).pow(buyableEffect('p', 13)) + return cumulativeExponential(2.5, getEpsilonLevel(points).floor()).mul(50).pow(buyableEffect('p', 13)) } function getEpsilonEffect(points = player.p.points) { return getEpsilonLevel(points).mul(getEpsilonRankEffect(points).add(1/10)).add(1) } function getZetaLevel(points = player.p.points) { if (Decimal.eq(points, 0)) return new Decimal(0) - return inverseCumulativeExponential(3, Decimal.div(Decimal.pow(points, buyableEffect('p', 13).pow(-1)), 80)).floor() + const level = inverseCumulativeExponential(3, Decimal.div(Decimal.pow(points, buyableEffect('p', 13).pow(-1)), 80)) + return hasMilestone('f', 9) ? level : level.floor() } function getZetaCost(points = player.p.points) { - return cumulativeExponential(3, getZetaLevel(points)).mul(80).pow(buyableEffect('p', 13)) + return cumulativeExponential(3, getZetaLevel(points).floor()).mul(80).pow(buyableEffect('p', 13)) } function getZetaEffect(points = player.p.points) { return getZetaLevel(points).mul(getZetaRankEffect().add(1/3)).add(1).pow(hasUpgrade('f', 41) ? 1.2 : 1) } -function getTotalLevel() { - return getAlphaLevel().add(getBetaLevel()).add(getGammaLevel()).add(getDeltaLevel()).add(getEpsilonLevel()) - .add(getZetaLevel()) +function getTotalLevel(points = player.p.points) { + return getAlphaLevel(points).add(getBetaLevel(points)).add(getGammaLevel(points)).add(getDeltaLevel(points)) + .add(getEpsilonLevel(points)).add(getZetaLevel(points)) +} + +function getEtaLevel(points = player.sp.points) { + if (Decimal.eq(points, 0)) return new Decimal(0) + return inverseCumulativeExponential(1.2, Decimal.mul(points, 2)).floor() +} +function getEtaCost(points = player.sp.points) { + return cumulativeExponential(1.2, getEtaLevel(points)).div(2) +} +function getEtaEffect(points = player.sp.points) { + return getEtaLevel(points).sqrt() +} +function getThetaLevel(points = player.sp.points) { + if (Decimal.eq(points, 0)) return new Decimal(0) + return inverseCumulativeExponential(1.5, Decimal.div(points, 3)).floor() +} +function getThetaCost(points = player.sp.points) { + return cumulativeExponential(1.5, getThetaLevel(points)).mul(3) +} +function getThetaEffect(points = player.sp.points) { + return getThetaLevel(points).pow(1/4).add(1) +} +function getIotaLevel(points = player.sp.points) { + if (Decimal.eq(points, 0)) return new Decimal(0) + return inverseCumulativeExponential(1.7, Decimal.div(points, 5)).floor() +} +function getIotaCost(points = player.sp.points) { + return cumulativeExponential(1.7, getIotaLevel(points)).mul(5) +} +function getIotaEffect(points = player.sp.points) { + return getIotaLevel(points).pow(1/3).add(1) +} +function getKappaLevel(points = player.sp.points) { + if (Decimal.eq(points, 0)) return new Decimal(0) + return inverseCumulativeExponential(2, Decimal.div(points, 8)).floor() +} +function getKappaCost(points = player.sp.points) { + return cumulativeExponential(2, getKappaLevel(points)).mul(8) +} +function getKappaEffect(points = player.sp.points) { + return getKappaLevel(points).pow(2/3).add(1) +} + +function getTotalSuperLevel(points = player.sp.points) { + return getEtaLevel(points).add(getThetaLevel(points)).add(getIotaLevel(points)).add(getKappaLevel(points)) } \ No newline at end of file diff --git a/js/mod.js b/js/mod.js index d634e8c..64f4d6c 100644 --- a/js/mod.js +++ b/js/mod.js @@ -3,7 +3,7 @@ let modInfo = { id: "nif/pbic", author: "Nif", pointsName: "points", - modFiles: ["ranks.js", "levels.js", "progress.js", "files.js", "tree.js"], + modFiles: ["ranks.js", "levels.js", "progress.js", "super progress.js", "files.js", "tree.js"], discordName: "", discordLink: "", @@ -41,21 +41,24 @@ function getPointGen() { if(!canGenPoints()) return new Decimal(0) // additive let gain = getAlphaEffect() + gain = gain.add(getEtaEffect()) // multiplicative gain = gain.mul(getBetaEffect()) gain = gain.mul(getGammaEffect()) gain = gain.mul(getDeltaEffect()) gain = gain.mul(getZetaEffect()) + gain = gain.mul(getKappaEffect()) if (hasMilestone('f', 0)) gain = gain.mul(getTotalLevel().add(1).log(5).add(1)) if (hasMilestone('f', 1)) gain = gain.mul(3) // exponentiative if (gain.gte(1)) { gain = gain.pow(getEpsilonEffect()) + gain = gain.pow(getIotaEffect()) if (hasMilestone('f', 3)) gain = gain.pow(2) if (hasUpgrade('f', 11)) gain = gain.pow(upgradeEffect('f', 11)) } // softcaps - gain = softcap(gain, 1000, d => d.add(1).log(1.1)) + gain = softcap(gain, 1000, d => d.add(1).log(1.01)) return gain } @@ -65,10 +68,8 @@ function addedPlayerData() { return { // Display extra things at the top of the page var displayThings = [ - "All exponentiative upgrades to point gen. only take affect above 1/s.", - function() { - return getPointGen().gte(1000) ? "Your points per second are being logarithmically softcapped over 1000/s" : "" - } + "All exponentiative upgrades only take affect above 1.", + () => getPointGen().gte(1000) ? "Your points per second are being logarithmically softcapped over 1000/s" : "" ] // Determines when the game "ends" @@ -92,5 +93,6 @@ function maxTickLength() { // Use this if you need to undo inflation from an older version. If the version is older than the version that fixed the issue, // you can cap their current resources with this. -function fixOldSave(oldVersion){ +function fixOldSave(oldVersion) { + } \ No newline at end of file diff --git a/js/progress.js b/js/progress.js index 6c11582..eccc901 100644 --- a/js/progress.js +++ b/js/progress.js @@ -20,7 +20,10 @@ addLayer("p", { type: "normal", // normal: cost to gain currency depends on amount gained. static: cost depends on how much you already have exponent: 0.3, // Prestige currency exponent gainMult() { // Calculate the multiplier for main currency from bonuses - return buyableEffect(this.layer, 11) + let mult = new Decimal(1) + mult = mult.mul(buyableEffect(this.layer, 11)) + mult = mult.mul(getThetaEffect()) + return mult }, gainExp() { // Calculate the exponent on main currency from bonuses return new Decimal(1) @@ -35,6 +38,11 @@ addLayer("p", { if (hasUpgrade('f', 23)) gain += 0.05 return gain }, + automate() { + if (hasMilestone('f', 8)) { + Object.values(tmp[this.layer].buyables).forEach(i => { if (i.canAfford) i.buy() }) + } + }, bars: { alpha: { direction: RIGHT, @@ -68,7 +76,7 @@ addLayer("p", { + ")
Effect: x" + getBetaEffect() + " to point gen." }, fillStyle: {backgroundColor: "#0c6949"}, - unlocked() { return getAlphaLevel().gte(1) } + unlocked() { return getAlphaLevel().gt(0) } }, betaRank: { direction: RIGHT, @@ -80,7 +88,7 @@ addLayer("p", { + ")
Effect: +" + getBetaRankEffect() + " to Beta effect base." }, fillStyle: {backgroundColor: "#0c6949"}, - unlocked() { return getAlphaLevel().gte(1) } + unlocked() { return getAlphaLevel().gt(0) } }, gamma: { direction: RIGHT, @@ -92,7 +100,7 @@ addLayer("p", { + ")
Effect: x" + getGammaEffect() + " to point gen." }, fillStyle: {backgroundColor: "#0c6949"}, - unlocked() { return getBetaLevel().gte(1) } + unlocked() { return getBetaLevel().gt(0) } }, gammaRank: { direction: RIGHT, @@ -104,7 +112,7 @@ addLayer("p", { + ")
Effect: +" + getGammaRankEffect() + " to Gamma effect exponent." }, fillStyle: {backgroundColor: "#0c6949"}, - unlocked() { return getBetaLevel().gte(1) } + unlocked() { return getBetaLevel().gt(0) } }, delta: { direction: RIGHT, @@ -116,7 +124,7 @@ addLayer("p", { + ")
Effect: x" + getDeltaEffect() + " to point gen." }, fillStyle: {backgroundColor: "#0c6949"}, - unlocked() { return getGammaLevel().gte(1) } + unlocked() { return getGammaLevel().gt(0) } }, deltaRank: { direction: RIGHT, @@ -128,7 +136,7 @@ addLayer("p", { + ")
Effect: +" + getDeltaRankEffect() + " to Delta effect base." }, fillStyle: {backgroundColor: "#0c6949"}, - unlocked() { return getGammaLevel().gte(1) } + unlocked() { return getGammaLevel().gt(0) } }, epsilon: { direction: RIGHT, @@ -140,7 +148,7 @@ addLayer("p", { + ")
Effect: ^" + getEpsilonEffect() + " to point gen." }, fillStyle: {backgroundColor: "#0c6949"}, - unlocked() { return getDeltaLevel().gte(1) } + unlocked() { return getDeltaLevel().gt(0) } }, epsilonRank: { direction: RIGHT, @@ -152,7 +160,7 @@ addLayer("p", { + ")
Effect: +" + getEpsilonRankEffect() + " to Epsilon effect base." }, fillStyle: {backgroundColor: "#0c6949"}, - unlocked() { return getDeltaLevel().gte(1) } + unlocked() { return getDeltaLevel().gt(0) } }, zeta: { direction: RIGHT, @@ -164,7 +172,7 @@ addLayer("p", { + ")
Effect: x" + getZetaEffect() + " to point gen." }, fillStyle: {backgroundColor: "#0c6949"}, - unlocked() { return getEpsilonLevel().gte(1) } + unlocked() { return getEpsilonLevel().gt(0) } }, zetaRank: { direction: RIGHT, @@ -176,7 +184,7 @@ addLayer("p", { + ")
Effect: +" + getZetaRankEffect() + " to Zeta effect base." }, fillStyle: {backgroundColor: "#0c6949"}, - unlocked() { return getEpsilonLevel().gte(1) } + unlocked() { return getEpsilonLevel().gt(0) } }, }, buyables: { @@ -235,8 +243,8 @@ addLayer("p", { "main-display", ["row", ["prestige-button", ["clickable", 11]]], "resource-display", - ["raw-html", () => "You have " + getTotalLevel() + " levels."], - ["raw-html", () => "You have " + getTotalRank() + " ranks."], + ["raw-html", () => "You have " + getTotalLevel() + " level" + (getTotalLevel().eq(1) ? "" : "s") + "."], + ["raw-html", () => "You have " + getTotalRank() + " rank" + (getTotalRank().eq(1) ? "" : "s") + "."], "blank", "blank", ["bar", "alpha"], diff --git a/js/super progress.js b/js/super progress.js new file mode 100644 index 0000000..946a5aa --- /dev/null +++ b/js/super progress.js @@ -0,0 +1,102 @@ +addLayer("sp", { + name: "super progress", // This is optional, only used in a few places, If absent it just uses the layer id. + symbol: "‰", // This appears on the layer's node. Default is the id with the first letter capitalized + position: 1, // Horizontal position within a row. By default it uses the layer id and sorts in alphabetical order + startData() { return { + unlocked: false, + points: new Decimal(0) + }}, + color: "#107f76", + requires: 15000, // Can be a function that takes requirement increases into account + resource: "super progress points", // Name of prestige currency + baseResource: "points", // Name of resource prestige is based on + baseAmount() {return player.points}, // Get the current amount of baseResource + type: "normal", // normal: cost to gain currency depends on amount gained. static: cost depends on how much you already have + exponent: 0.5, // Prestige currency exponent + gainMult() { // Calculate the multiplier for main currency from bonuses + return new Decimal(1) + }, + gainExp() { // Calculate the exponent on main currency from bonuses + return new Decimal(1) + }, + row: 1, // Row the layer is in on the tree (0 is the first row) + hotkeys: [ + {key: "s", description: "S: Reset for super progress points", onPress(){if (canReset(this.layer)) doReset(this.layer)}}, + ], + bars: { + eta: { + direction: RIGHT, + width: 300, + height: 50, + progress() { return player[this.layer].points.div(getEtaCost()) }, + display() { + return "Eta - Level " + getEtaLevel() + " (" + player[this.layer].points + "/" + getEtaCost() + + ")
Effect: +" + getEtaEffect() + " to point gen." + }, + fillStyle: {backgroundColor: "#107f76"} + }, + theta: { + direction: RIGHT, + width: 300, + height: 50, + progress() { return player[this.layer].points.div(getThetaCost()) }, + display() { + return "Theta - Level " + getThetaLevel() + " (" + player[this.layer].points + "/" + getThetaCost() + + ")
Effect: x" + getThetaEffect() + " to PP." + }, + fillStyle: {backgroundColor: "#107f76"}, + unlocked() { return getEtaLevel().gt(0) } + }, + iota: { + direction: RIGHT, + width: 300, + height: 50, + progress() { return player[this.layer].points.div(getIotaCost()) }, + display() { + return "Iota - Level " + getIotaLevel() + " (" + player[this.layer].points + "/" + getIotaCost() + + ")
Effect: ^" + getIotaEffect() + " to point gen." + }, + fillStyle: {backgroundColor: "#107f76"}, + unlocked() { return getThetaLevel().gt(0) } + }, + kappa: { + direction: RIGHT, + width: 300, + height: 50, + progress() { return player[this.layer].points.div(getKappaCost()) }, + display() { + return "Kappa - Level " + getKappaLevel() + " (" + player[this.layer].points + "/" + getKappaCost() + + ")
Effect: x" + getKappaEffect() + " to point gen." + }, + fillStyle: {backgroundColor: "#107f76"}, + unlocked() { return getIotaLevel().gt(0) } + }, + }, + clickables: { + 11: { + display() { return "Hold to gain SPP" }, + canClick() { return true }, + onClick() { if (canReset(this.layer)) doReset(this.layer) }, + onHold() { if (canReset(this.layer)) doReset(this.layer) } + } + }, + tabFormat: { + "super levels": { + content: [ + "main-display", + ["row", ["prestige-button", ["clickable", 11]]], + "resource-display", + ["raw-html", () => + "You have " + getTotalSuperLevel() + " super level" + (getTotalSuperLevel().eq(1) ? "" : "s") + "." + ], + "blank", + "blank", + ["bar", "eta"], + ["bar", "theta"], + ["bar", "iota"], + ] + }, + }, + layerShown(){ return player.points.gte(10000) || player[this.layer].unlocked }, + branches: ['p'], +})