just_another_tree/js/mod.js

164 lines
5.9 KiB
JavaScript
Raw Permalink Normal View History

2024-03-03 11:53:50 +00:00
let modInfo = {
2024-03-07 17:49:20 +00:00
name: "Progressbar Incremental",
id: "nif/pbic",
author: "Nif",
2024-03-03 11:53:50 +00:00
pointsName: "points",
modFiles: ["data/ranks.js", "data/levels.js", "data/progress.js", "data/super progress.js", "data/files.js", "data/integrals.js", "data/achievements.js", "data/tree.js"],
2024-03-03 11:53:50 +00:00
discordName: "",
discordLink: "",
2024-03-07 17:49:20 +00:00
initialStartPoints: new Decimal (1), // Used for hard resets and new players
2024-03-03 11:53:50 +00:00
offlineLimit: 1, // In hours
}
// Set your version in num and name
let VERSION = {
2024-04-09 15:19:14 +00:00
num: "2.0",
name: "Mathematicalization",
2024-03-03 11:53:50 +00:00
}
2024-03-07 18:38:17 +00:00
let changelog = `<h1>Changelog:</h1><br><br>
2024-04-09 15:19:14 +00:00
<h3>v2.0 Mathematicalization</h3><br>
- Clarified Kappa and 12th Filestone's effects.<br>
- Switched the positions of the 6th and 8th Filestone.<br>
- Reduced the 12 Filestone's requirement to 40 Files.<br>
- Made Directory upgrade [5,3] use total Files.<br>
- Fixed & adjusted <b>The finale of the intro</b>.<br>
- Added content to the Integral layer.<br>
- Added the Number.<br><br>
- Current endgame: 4 integrals.<br>
2024-03-27 19:28:39 +00:00
<h3>v1.6</h3><br>
- General bugfixing.<br>
- Made the tree manually generated.<br>
2024-04-09 15:19:14 +00:00
- Fixed the file prestige functions.<br><br>
<h3>v1.5 The great rebalancing</h3><br>
2024-03-24 19:57:05 +00:00
- Clarified some effects.<br>
2024-03-24 19:50:21 +00:00
- Decreased SPP requirement.<br>
2024-03-24 19:57:05 +00:00
- Made <b>Even more progress</b> affect SPP gain.<br>
- Made Files need SPP instead of PP.<br>
- Made File cost dependent on total and points.<br>
- Made other changes to File cost.<br>
2024-03-24 19:50:21 +00:00
- Reshuffled some Filestones.<br>
- Added a new softcap.<br>
2024-03-24 19:57:05 +00:00
- Made Directory upgrade [4,3] use total Files.<br>
2024-03-24 19:50:21 +00:00
- Added more Filestones and Directory upgrades.<br>
- Added a Directory buyable.<br>
2024-03-24 19:57:05 +00:00
- Slightly increased Integral cost.<br><br>
2024-03-19 08:21:20 +00:00
<h3>v1.2</h3><br>
- Added a few missing format() calls.<br>
- Added a note for the hardcap.<br>
- Decreased Integral requirement.<br><br>
<h3>v1.1</h3><br>
- Made all renders of Decimal objects use format().<br>
- Adjusted file costs and filestone 2 effect.<br><br>
2024-03-17 19:59:59 +00:00
<h3>v1.0 First Release</h3><br>
2024-03-15 18:06:40 +00:00
- Added Progress, Super Progress, and File layers.<br>
- Added bars Alpha to Lambda.<br>
- Added ranks Alpha to Zeta.<br>
- Added 3 buyables and 2 super buyables.<br>
- Added 10 Filestones.<br>
- Added 11 Directory upgrades.<br>
- Added Integral reset.<br>
2024-03-17 20:03:10 +00:00
- Added 29 achievements.<br>
2024-03-15 18:06:40 +00:00
- Current endgame: 1 integral.<br>`
2024-03-03 11:53:50 +00:00
let winText = `Download 100% complete.<br><br>You won! Congratulations!<br>More content coming soon...`
2024-03-03 11:53:50 +00:00
// If you add new functions anywhere inside of a layer, and those functions have an effect when called, add them here.
// (The ones here are examples, all official functions are already taken care of)
var doNotCallTheseFunctionsEveryTick = ["blowUpEverything"]
function getStartPoints(){
return new Decimal(modInfo.initialStartPoints)
}
// Determines if it should show points/sec
function canGenPoints(){
2024-03-07 17:49:20 +00:00
return getAlphaLevel().gte(0)
2024-03-03 11:53:50 +00:00
}
// Calculate points/sec!
function getPointGen() {
2024-03-07 17:49:20 +00:00
if(!canGenPoints()) return new Decimal(0)
2024-03-09 13:28:55 +00:00
// additive
let gain = getAlphaEffect()
2024-03-13 17:02:37 +00:00
gain = gain.add(getEtaEffect())
2024-03-09 13:28:55 +00:00
// multiplicative
gain = gain.mul(getBetaEffect())
gain = gain.mul(getGammaEffect())
gain = gain.mul(getDeltaEffect())
gain = gain.mul(getZetaEffect())
gain = gain.mul(getLambdaEffect())
gain = gain.mul(tmp.ach.effect)
2024-04-09 15:19:14 +00:00
gain = gain.mul(tmp.i.numberEffect)
2024-03-24 19:50:21 +00:00
if (hasMilestone('f', 1)) gain = gain.mul(getTotalLevel().add(7).log(2))
if (hasMilestone('f', 6)) gain = gain.mul(player.f.total.div(2).add(1))
2024-04-09 15:19:14 +00:00
if (hasMilestone('f', 12)) gain = gain.mul(player.sp.points.add(1).log(100).add(1))
2024-03-09 13:28:55 +00:00
// exponentiative
2024-03-10 17:19:22 +00:00
if (gain.gte(1)) {
gain = gain.pow(getEpsilonEffect())
2024-03-13 17:02:37 +00:00
gain = gain.pow(getIotaEffect())
gain = gain.pow(buyableEffect('sp', 12))
2024-03-10 17:19:22 +00:00
if (hasMilestone('f', 3)) gain = gain.pow(2)
if (hasUpgrade('f', 11)) gain = gain.pow(upgradeEffect('f', 11))
2024-03-24 19:50:21 +00:00
if (hasUpgrade('f', 53)) gain = gain.pow(upgradeEffect('f', 53))
2024-04-09 15:19:14 +00:00
if (hasMilestone('f', 13)) gain = gain.pow(player.p.points.sqrt())
2024-03-10 17:19:22 +00:00
}
2024-03-09 13:28:55 +00:00
// softcaps
2024-04-09 15:19:14 +00:00
gain = softcap(gain,
getKappaEffect().mul(250).mul(1e5**hasMilestone('f',15)),
d => d.add(1).log(Math.E).add(1).pow(2).sub(1).div(2)
)
gain = softcap(gain,
2024-03-24 19:50:21 +00:00
Decimal.pow(1e6, (hasMilestone('f', 11) ? getTotalSuperLevel().add(1).log(2).add(1).log(2).add(1) : 1)),
d => d.add(1).log(3 - hasUpgrade('f', 61)).add(1)
)
2024-04-09 15:19:14 +00:00
gain = gain.mul(buyableEffect('f', 11))
gain = softcap(gain, Decimal.pow(2, 128), _ => new Decimal(0), player.points)
2024-03-03 11:53:50 +00:00
return gain
}
// You can add non-layer related variables that should to into "player" and be saved here, along with default values
function addedPlayerData() { return {
}}
// Display extra things at the top of the page
var displayThings = [
2024-03-13 17:02:37 +00:00
"All exponentiative upgrades only take affect above 1.",
2024-03-17 20:12:08 +00:00
() => getPointGen().gte(getKappaEffect().mul(1000)) ? "Your points per second are being logarithmically softcapped over "
2024-04-09 15:19:14 +00:00
+ format(getKappaEffect().mul(250).mul(1e5**hasMilestone('f',15))) + "/s" : "",
() => getPointGen().gte(
2024-04-09 15:19:14 +00:00
Decimal.pow(1e6, hasMilestone('f', 11) ? getTotalSuperLevel().pow(1/10).add(1).log(10).add(1) : 1)
) ? "Your points per second are being logarithmically softcapped again over "
+ format(Decimal.pow(
2024-03-24 19:50:21 +00:00
1e6, hasMilestone('f', 11) ? getTotalSuperLevel().pow(1/10).add(1).log(10).add(1) : 1
)) + "/s"
: "",
2024-03-17 20:12:08 +00:00
() => getPointGen().add(player.points).gte(Decimal.pow(2, 128)) ? "Your points per second are being hardcapped over "
+ format(Decimal.pow(2, 128)) : ""
2024-03-03 11:53:50 +00:00
]
// Determines when the game "ends"
function isEndgame() {
return player.i.points.gt(0)
2024-03-03 11:53:50 +00:00
}
// Less important things beyond this point!
// Style for the background, can be a function
var backgroundStyle = {
}
// You can change this if you have things that can be messed up by long tick lengths
function maxTickLength() {
return(3600) // Default is 1 hour which is just arbitrarily large
}
// 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.
2024-03-13 17:02:37 +00:00
function fixOldSave(oldVersion) {
2024-03-03 11:53:50 +00:00
}