Filesystem

Yay more stuff!
This commit is contained in:
Nif 2024-03-10 17:19:22 +00:00
parent dd5a98dcfa
commit 2835855ba5
5 changed files with 171 additions and 34 deletions

View file

@ -8,20 +8,27 @@ addLayer("f", {
total: new Decimal(0) total: new Decimal(0)
}}, }},
color: "#7f1bae", color: "#7f1bae",
requires: new Decimal(5000), // Can be a function that takes requirement increases into account requires() {
let req = new Decimal(5000)
if (hasUpgrade('f', 32)) { req = req.mul(0.75) }
return req
}, // Can be a function that takes requirement increases into account
resource: "files", // Name of prestige currency resource: "files", // Name of prestige currency
baseResource: "progress points", // Name of resource prestige is based on baseResource: "progress points", // Name of resource prestige is based on
baseAmount() {return player.p.points}, // Get the current amount of baseResource 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 type: "static", // normal: cost to gain currency depends on amount gained. static: cost depends on how much you already have
exponent: 0.7, // Prestige currency exponent exponent: 1, // Prestige currency exponent
base: 1.2,
gainMult() { // Calculate the multiplier for main currency from bonuses gainMult() { // Calculate the multiplier for main currency from bonuses
return new Decimal(1) return new Decimal(1)
}, },
gainExp() { // Calculate the exponent on main currency from bonuses gainExp() { // Calculate the exponent on main currency from bonuses
return new Decimal(1) return new Decimal(1)
}, },
canBuyMax() {
return hasMilestone(this.layer, 6)
},
row: 1, // Row the layer is in on the tree (0 is the first row) row: 1, // Row the layer is in on the tree (0 is the first row)
displayRow: 0,
hotkeys: [ hotkeys: [
{key: "f", description: "F: Reset for files", onPress(){if (canReset(this.layer)) doReset(this.layer)}}, {key: "f", description: "F: Reset for files", onPress(){if (canReset(this.layer)) doReset(this.layer)}},
], ],
@ -40,22 +47,135 @@ addLayer("f", {
}, },
2: { 2: {
requirementDescription: "3 total Files.", requirementDescription: "3 total Files.",
effectDescription: "Multiply PP requirement by 0.9x.", effectDescription: "Multiply PP requirement by 0.5x.",
done() { return player.f.total.gte(3) } done() { return player.f.total.gte(3) }
}, },
3: { 3: {
requirementDescription: "4 total Files.", requirementDescription: "4 total Files.",
effectDescription: "Square point gen. if over 1/s.", effectDescription: "Square point gen.",
done() { return player.f.total.gte(4) } done() { return player.f.total.gte(4) }
}, },
4: { 4: {
requirementDescription: "5 total Files.", requirementDescription: "5 total Files.",
effectDescription() { effectDescription: "Unlock the Directory.",
return "Total ranks boost point gen.<br>Effect: ^" + getTotalRank().div(2).add(1) + "."
},
done() { return player.f.total.gte(5) } done() { return player.f.total.gte(5) }
}, },
5: {
requirementDescription: "7 total Files.",
effectDescription() {
return "Total Files boost point gen.<br>Effect: x" + player[this.layer].total.div(2).add(1) + "."
},
done() { return player.f.total.gte(7) }
},
6: {
requirementDescription: "10 total Files.",
effectDescription: "You can buy max files.",
done() { return player.f.total.gte(10) }
},
},
upgrades: {
11: {
description: "Total rank boosts point gen.",
effect() { return getTotalRank().add(2) },
effectDisplay() { return "^" + this.effect() + "." },
cost: 1
},
21: {
description: "Start with 2 free <b>Rebased</b> levels.",
cost: 3,
unlocked() { return hasUpgrade(this.layer, 11) },
branches: [11]
},
22: {
description: "Start with 2 free <b>Shorter bars</b> levels.",
cost: 3,
unlocked() { return hasUpgrade(this.layer, 11) },
branches: [11]
},
31: {
description: "Make Gamma effect use total level as well.",
cost: 5,
unlocked() { return hasUpgrade(this.layer, 21) },
branches: [21]
},
32: {
description: "Multiply base File cost by 0.75.",
cost: 6,
unlocked() { return hasUpgrade(this.layer, 21) || hasUpgrade(this.layer, 22) },
branches: [21, 22]
},
33: {
description: "Multiply base PP cost by 0.75.",
cost: 5,
unlocked() { return hasUpgrade(this.layer, 22) },
branches: [22]
},
42: {
description: "Files divide PP cost.",
cost: 8,
unlocked() { return hasUpgrade(this.layer, 32) || hasUpgrade(this.layer, 33) },
effect() { return player[this.layer].points.add(3).log(2).add(1) },
effectDisplay() { return "/" + this.effect() + "." },
branches: [32, 33]
},
43: {
description: "Gain 5% of your PP gain every second.",
cost: 8,
unlocked() { return hasUpgrade(this.layer, 33) },
branches: [33]
}
},
clickables: {
21: {
display() { return "Reset directory" },
onClick() {
if (confirm("Are you sure you want to respec?")) {
for (let i of player[this.layer].upgrades) {
player[this.layer].points = player[this.layer].points.add(tmp[this.layer].upgrades[i].cost)
}
player[this.layer].upgrades = []
}
},
canClick() { return true },
style: {
width: "60px",
minHeight: "60px"
}
}
}, },
layerShown(){ return player.p.points.gte(4000) || player[this.layer].unlocked }, layerShown(){ return player.p.points.gte(4000) || player[this.layer].unlocked },
branches: ['p'] branches: ['p'],
tabFormat: {
filestones: {
content: [
"main-display",
["row", ["prestige-button", ["clickable", 11]]],
"resource-display",
"blank",
"blank",
["row", [
["milestones", [0, 2, 4, 6]],
["milestones", [1, 3, 5]]
]]
]
},
directory: {
content: [
"main-display",
["row", ["prestige-button", ["clickable", 11]]],
"resource-display",
"blank",
"blank",
["clickable", 21],
"blank",
["upgrade-tree", [
[11],
[21, 22],
[31, 32, 33],
[42, 43]
]]
],
unlocked() { return hasMilestone('f', 4) }
},
}
}) })

View file

@ -33,9 +33,8 @@ function getGammaCost(points = player.p.points) {
return cumulativeExponential(1.5, getGammaLevel(points)).mul(15).pow(buyableEffect('p', 13)) return cumulativeExponential(1.5, getGammaLevel(points)).mul(15).pow(buyableEffect('p', 13))
} }
function getGammaEffect(points = player.p.points) { function getGammaEffect(points = player.p.points) {
return Decimal.add(player.p.points, 1).log(Decimal.pow(50, buyableEffect('p', 12))).add(1).pow( return Decimal.add(points, 1).add(hasUpgrade('f', 31) ? getTotalLevel() : 0).log(Decimal.pow(50, buyableEffect('p', 12)))
getGammaLevel(points).mul(getGammaRankEffect(points).add(1/10)) .add(1).pow(getGammaLevel(points).mul(getGammaRankEffect(points).add(1/10)))
)
} }
function getDeltaLevel(points = player.p.points) { function getDeltaLevel(points = player.p.points) {
if (Decimal.eq(points, 0)) return new Decimal(0) if (Decimal.eq(points, 0)) return new Decimal(0)

View file

@ -13,19 +13,13 @@ let modInfo = {
// Set your version in num and name // Set your version in num and name
let VERSION = { let VERSION = {
num: "1", num: "1.0",
name: "The first release.", name: "The first release.",
} }
let changelog = `<h1>Changelog:</h1><br><br> let changelog = `<h1>Changelog:</h1><br><br>
<h3>v1</h3><br> <h3>v1.0</h3><br>
- Added progress points.<br> - I've given up trying to log all of the changes I'm making.`
- Added bars Alpha to Zeta.<br>
- Added Ranks.<br>
- Added Buyables.<br>
- Added Files.<br>
- Added 5 File milestones.<br>
- Endgame: 6 Files.<br>`
let winText = `Download 100% complete.<br><br>You won! Congratulations!<br>Beyond this point may be unbalanced / incomplete, proceed with caution!` let winText = `Download 100% complete.<br><br>You won! Congratulations!<br>Beyond this point may be unbalanced / incomplete, proceed with caution!`
@ -54,12 +48,14 @@ function getPointGen() {
gain = gain.mul(getZetaEffect()) gain = gain.mul(getZetaEffect())
if (hasMilestone('f', 0)) gain = gain.mul(getTotalLevel().add(1).log(5).add(1)) if (hasMilestone('f', 0)) gain = gain.mul(getTotalLevel().add(1).log(5).add(1))
if (hasMilestone('f', 1)) gain = gain.mul(3) if (hasMilestone('f', 1)) gain = gain.mul(3)
if (hasMilestone('f', 3) && gain.gte(1)) gain = gain.pow(2)
// exponentiative // exponentiative
gain = gain.pow(getEpsilonEffect()) if (gain.gte(1)) {
if (hasMilestone('f', 4)) gain = gain.pow(getTotalRank().div(2).add(1)) gain = gain.pow(getEpsilonEffect())
if (hasMilestone('f', 3)) gain = gain.pow(2)
if (hasUpgrade('f', 11)) gain = gain.pow(upgradeEffect('f', 11))
}
// softcaps // softcaps
gain = softcap(gain, 1000, d => d.add(1).log(2)) gain = softcap(gain, 1000, d => d.add(1).log(1.1))
return gain return gain
} }
@ -69,6 +65,10 @@ function addedPlayerData() { return {
// Display extra things at the top of the page // Display extra things at the top of the page
var displayThings = [ 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" : ""
}
] ]
// Determines when the game "ends" // Determines when the game "ends"

View file

@ -9,7 +9,9 @@ addLayer("p", {
color: "#0c6949", color: "#0c6949",
requires() { requires() {
let req = new Decimal(1) let req = new Decimal(1)
if (hasMilestone('f', 2)) { req = req.mul(0.9) } if (hasMilestone('f', 2)) { req = req.mul(0.5) }
if (hasUpgrade('f', 33)) { req = req.mul(0.75) }
if (hasUpgrade('f', 42)) { req = req.div(upgradeEffect('f', 42)) }
return req return req
}, // Can be a function that takes requirement increases into account }, // Can be a function that takes requirement increases into account
resource: "progress points", // Name of prestige currency resource: "progress points", // Name of prestige currency
@ -27,6 +29,10 @@ addLayer("p", {
hotkeys: [ hotkeys: [
{key: "p", description: "P: Reset for progress points", onPress(){if (canReset(this.layer)) doReset(this.layer)}}, {key: "p", description: "P: Reset for progress points", onPress(){if (canReset(this.layer)) doReset(this.layer)}},
], ],
passiveGeneration() {
if (hasUpgrade('f', 43)) return 0.05
return 0
},
bars: { bars: {
alpha: { alpha: {
direction: RIGHT, direction: RIGHT,
@ -186,7 +192,9 @@ addLayer("p", {
}, },
12: { 12: {
title: "Rebased", title: "Rebased",
effect() { return Decimal.pow(0.95, getBuyableAmount(this.layer, this.id)) }, effect() { return Decimal.add(
getBuyableAmount(this.layer, this.id), hasUpgrade('f', 21) ? 2 : 0
).pow_base(0.95) },
cost() { return Decimal.pow(getBuyableAmount(this.layer, this.id), 1.4).mul(7).add(80) }, cost() { return Decimal.pow(getBuyableAmount(this.layer, this.id), 1.4).mul(7).add(80) },
display() { display() {
return "Decrease Gamma effect base.<br><br>Amount: " + getBuyableAmount(this.layer, this.id) return "Decrease Gamma effect base.<br><br>Amount: " + getBuyableAmount(this.layer, this.id)
@ -198,7 +206,9 @@ addLayer("p", {
}, },
13: { 13: {
title: "Shorter bars", title: "Shorter bars",
effect() { return Decimal.pow(0.98, getBuyableAmount(this.layer, this.id)) }, effect() { return Decimal.add(
getBuyableAmount(this.layer, this.id), hasUpgrade('f', 22) ? 2 : 0
).pow_base(0.98) },
cost() { return Decimal.pow(getBuyableAmount(this.layer, this.id), 1.6).mul(10).add(100) }, cost() { return Decimal.pow(getBuyableAmount(this.layer, this.id), 1.6).mul(10).add(100) },
display() { display() {
return "Decrease all level costs.<br><br>Amount: " + getBuyableAmount(this.layer, this.id) return "Decrease all level costs.<br><br>Amount: " + getBuyableAmount(this.layer, this.id)
@ -209,11 +219,19 @@ addLayer("p", {
buy() { addBuyables(this.layer, this.id, 1) } buy() { addBuyables(this.layer, this.id, 1) }
} }
}, },
clickables: {
11: {
display() { return "Hold to gain PP" },
canClick() { return true },
onClick() { if (canReset(this.layer)) doReset(this.layer) },
onHold() { if (canReset(this.layer)) doReset(this.layer) }
}
},
tabFormat: { tabFormat: {
levels: { levels: {
content: [ content: [
"main-display", "main-display",
"prestige-button", ["row", ["prestige-button", ["clickable", 11]]],
"resource-display", "resource-display",
["raw-html", () => "You have " + getTotalLevel() + " levels."], ["raw-html", () => "You have " + getTotalLevel() + " levels."],
["raw-html", () => "You have " + getTotalRank() + " ranks."], ["raw-html", () => "You have " + getTotalRank() + " ranks."],
@ -230,7 +248,7 @@ addLayer("p", {
ranks: { ranks: {
content: [ content: [
"main-display", "main-display",
"prestige-button", ["row", ["prestige-button", ["clickable", 11]]],
"resource-display", "resource-display",
["raw-html", () => "You have " + getTotalLevel() + " levels."], ["raw-html", () => "You have " + getTotalLevel() + " levels."],
["raw-html", () => "You have " + getTotalRank() + " ranks."], ["raw-html", () => "You have " + getTotalRank() + " ranks."],
@ -248,7 +266,7 @@ addLayer("p", {
buyables: { buyables: {
content: [ content: [
"main-display", "main-display",
"prestige-button", ["row", ["prestige-button", ["clickable", 11]]],
"resource-display", "resource-display",
["raw-html", () => "You have " + getTotalLevel() + " levels."], ["raw-html", () => "You have " + getTotalLevel() + " levels."],
["raw-html", () => "You have " + getTotalRank() + " ranks."], ["raw-html", () => "You have " + getTotalRank() + " ranks."],

View file

@ -412,7 +412,7 @@ function gridRun(layer, func, data, id) {
} }
// Small functions // Small functions
function softcap(number, after, method) { function softcap(number, after, method, delta = new Decimal(0)) {
if (Decimal.lt(number, after)) { return new Decimal(number) } if (Decimal.add(number, delta).lt(after)) { return new Decimal(number) }
else { return method(Decimal.sub(number, after)).add(after) } else { return method(Decimal.add(number, delta).sub(after)).add(after).sub(delta) }
} }