generated from incremental-social/The-Modding-Tree
v0/a1
Ask and you shall receive
This commit is contained in:
parent
3f8de45f2a
commit
f590171c4f
4 changed files with 159 additions and 43 deletions
28
js/layers.js
28
js/layers.js
|
@ -1,28 +0,0 @@
|
|||
addLayer("p", {
|
||||
name: "prestige", // This is optional, only used in a few places, If absent it just uses the layer id.
|
||||
symbol: "P", // 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: true,
|
||||
points: new Decimal(0),
|
||||
}},
|
||||
color: "#4BDC13",
|
||||
requires: new Decimal(10), // Can be a function that takes requirement increases into account
|
||||
resource: "prestige 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
|
||||
mult = new Decimal(1)
|
||||
return mult
|
||||
},
|
||||
gainExp() { // Calculate the exponent on main currency from bonuses
|
||||
return new Decimal(1)
|
||||
},
|
||||
row: 0, // Row the layer is in on the tree (0 is the first row)
|
||||
hotkeys: [
|
||||
{key: "p", description: "P: Reset for prestige points", onPress(){if (canReset(this.layer)) doReset(this.layer)}},
|
||||
],
|
||||
layerShown(){return true}
|
||||
})
|
35
js/levels.js
Normal file
35
js/levels.js
Normal file
|
@ -0,0 +1,35 @@
|
|||
function getAlphaLevel(points = player.p.points) {
|
||||
if (Decimal.eq(points, 0)) return new Decimal(0)
|
||||
return Decimal.add(points, 10).div(11).log(1.1).add(1).floor().max(0)
|
||||
}
|
||||
function getNextAlphaCost(points = player.p.points) {
|
||||
return getAlphaLevel(points).pow_base(1.1).mul(11).sub(10)
|
||||
}
|
||||
function getBetaLevel(points = player.p.points) {
|
||||
if (Decimal.eq(points, 0)) return new Decimal(0)
|
||||
return Decimal.add(points, 20).div(25).log(1.25).add(1).floor().max(0)
|
||||
}
|
||||
function getNextBetaCost(points = player.p.points) {
|
||||
return getBetaLevel(points).pow_base(1.25).mul(25).sub(20)
|
||||
}
|
||||
function getGammaLevel(points = player.p.points) {
|
||||
if (Decimal.eq(points, 0)) return new Decimal(0)
|
||||
return Decimal.add(points, 30).div(45).log(1.5).add(1).floor().max(0)
|
||||
}
|
||||
function getNextGammaCost(points = player.p.points) {
|
||||
return getGammaLevel(points).pow_base(1.5).mul(45).sub(30)
|
||||
}
|
||||
function getDeltaLevel(points = player.p.points) {
|
||||
if (Decimal.eq(points, 0)) return new Decimal(0)
|
||||
return Decimal.add(points, 30).div(60).log(2).add(1).floor().max(0)
|
||||
}
|
||||
function getNextDeltaCost(points = player.p.points) {
|
||||
return getDeltaLevel(points).pow_base(2).mul(60).sub(30)
|
||||
}
|
||||
function getEpsilonLevel(points = player.p.points) {
|
||||
if (Decimal.eq(points, 0)) return new Decimal(0)
|
||||
return Decimal.add(points, 25).div(75).log(3).add(1).floor().max(0)
|
||||
}
|
||||
function getNextEpsilonCost(points = player.p.points) {
|
||||
return getEpsilonLevel(points).pow_base(3).mul(75).sub(25)
|
||||
}
|
33
js/mod.js
33
js/mod.js
|
@ -1,28 +1,28 @@
|
|||
let modInfo = {
|
||||
name: "The ??? Tree",
|
||||
id: "mymod",
|
||||
author: "nobody",
|
||||
name: "Progressbar Incremental",
|
||||
id: "nif/pbic",
|
||||
author: "Nif",
|
||||
pointsName: "points",
|
||||
modFiles: ["layers.js", "tree.js"],
|
||||
modFiles: ["levels.js", "progress.js", "tree.js"],
|
||||
|
||||
discordName: "",
|
||||
discordLink: "",
|
||||
initialStartPoints: new Decimal (10), // Used for hard resets and new players
|
||||
initialStartPoints: new Decimal (1), // Used for hard resets and new players
|
||||
offlineLimit: 1, // In hours
|
||||
}
|
||||
|
||||
// Set your version in num and name
|
||||
let VERSION = {
|
||||
num: "0.0",
|
||||
name: "Literally nothing",
|
||||
num: "0/a1",
|
||||
name: "You guys wanted it.",
|
||||
}
|
||||
|
||||
let changelog = `<h1>Changelog:</h1><br>
|
||||
<h3>v0.0</h3><br>
|
||||
- Added things.<br>
|
||||
- Added stuff.`
|
||||
<h3>v0/a1</h3><br>
|
||||
- Added progress points.<br>
|
||||
- Added bars Alpha to Epsilon.<br>`
|
||||
|
||||
let winText = `Congratulations! You have reached the end and beaten this game, but for now...`
|
||||
let winText = `Download 100% complete.<br><br>You won! Congratulations!<br>Beyond this point may be unbalanced, proceed with caution!`
|
||||
|
||||
// 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)
|
||||
|
@ -34,15 +34,18 @@ function getStartPoints(){
|
|||
|
||||
// Determines if it should show points/sec
|
||||
function canGenPoints(){
|
||||
return true
|
||||
return getAlphaLevel().gte(0)
|
||||
}
|
||||
|
||||
// Calculate points/sec!
|
||||
function getPointGen() {
|
||||
if(!canGenPoints())
|
||||
return new Decimal(0)
|
||||
if(!canGenPoints()) return new Decimal(0)
|
||||
|
||||
let gain = new Decimal(1)
|
||||
let gain = getAlphaLevel().div(20)
|
||||
gain = gain.mul(getBetaLevel().div(20).add(1))
|
||||
gain = gain.mul(getGammaLevel().div(15).add(1))
|
||||
gain = gain.pow(getDeltaLevel().div(50).add(1))
|
||||
gain = gain.pow(getEpsilonLevel().div(10).add(1))
|
||||
return gain
|
||||
}
|
||||
|
||||
|
|
106
js/progress.js
Normal file
106
js/progress.js
Normal file
|
@ -0,0 +1,106 @@
|
|||
addLayer("p", {
|
||||
name: "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: 0, // Horizontal position within a row. By default it uses the layer id and sorts in alphabetical order
|
||||
startData() { return {
|
||||
unlocked: true,
|
||||
points: new Decimal(0),
|
||||
best: new Decimal(0),
|
||||
levels: {
|
||||
epsilon: new Decimal(0),
|
||||
}
|
||||
}},
|
||||
color: "#0c6949",
|
||||
requires: new Decimal(1), // Can be a function that takes requirement increases into account
|
||||
resource: "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
|
||||
mult = new Decimal(1)
|
||||
return mult
|
||||
},
|
||||
gainExp() { // Calculate the exponent on main currency from bonuses
|
||||
return new Decimal(1)
|
||||
},
|
||||
row: 0, // Row the layer is in on the tree (0 is the first row)
|
||||
hotkeys: [
|
||||
{key: "p", description: "P: Reset for progress points", onPress(){if (canReset(this.layer)) doReset(this.layer)}},
|
||||
],
|
||||
bars: {
|
||||
alpha: {
|
||||
direction: RIGHT,
|
||||
width: 300,
|
||||
height: 50,
|
||||
progress() { return player[this.layer].points.div(getNextAlphaCost()) },
|
||||
display() {
|
||||
return "Alpha - Level " + getAlphaLevel() + " (" + player[this.layer].points + "/" + getNextAlphaCost()
|
||||
+ ")<br>Effect: +" + getAlphaLevel().div(20) + " to point gen."
|
||||
},
|
||||
fillStyle: {backgroundColor: "#0c6949"}
|
||||
},
|
||||
beta: {
|
||||
direction: RIGHT,
|
||||
width: 300,
|
||||
height: 50,
|
||||
progress() { return player[this.layer].points.div(getNextBetaCost()) },
|
||||
display() {
|
||||
return "Beta - Level " + getBetaLevel() + " (" + player[this.layer].points + "/" + getNextBetaCost()
|
||||
+ ")<br>Effect: x" + getBetaLevel().div(20).add(1) + " to point gen."
|
||||
},
|
||||
fillStyle: {backgroundColor: "#0c6949"}
|
||||
},
|
||||
gamma: {
|
||||
direction: RIGHT,
|
||||
width: 300,
|
||||
height: 50,
|
||||
progress() { return player[this.layer].points.div(getNextGammaCost()) },
|
||||
display() {
|
||||
return "Gamma - Level " + getGammaLevel() + " (" + player[this.layer].points + "/" + getNextGammaCost()
|
||||
+ ")<br>Effect: x" + getGammaLevel().div(15).add(1) + " to point gen."
|
||||
},
|
||||
fillStyle: {backgroundColor: "#0c6949"}
|
||||
},
|
||||
delta: {
|
||||
direction: RIGHT,
|
||||
width: 300,
|
||||
height: 50,
|
||||
progress() { return player[this.layer].points.div(getNextDeltaCost()) },
|
||||
display() {
|
||||
return "Delta - Level " + getDeltaLevel() + " (" + player[this.layer].points + "/" + getNextDeltaCost()
|
||||
+ ")<br>Effect: ^" + getDeltaLevel().div(50).add(1) + " to point gen."
|
||||
},
|
||||
fillStyle: {backgroundColor: "#0c6949"}
|
||||
},
|
||||
epsilon: {
|
||||
direction: RIGHT,
|
||||
width: 300,
|
||||
height: 50,
|
||||
progress() { return player[this.layer].points.div(getNextEpsilonCost()) },
|
||||
display() {
|
||||
return "Epsilon - Level " + getEpsilonLevel() + " (" + player[this.layer].points + "/" + getNextEpsilonCost()
|
||||
+ ")<br>Effect: x" + getEpsilonLevel().div(10).add(1) + " to point gen."
|
||||
},
|
||||
fillStyle: {backgroundColor: "#0c6949"}
|
||||
},
|
||||
},
|
||||
update(diff) {
|
||||
if (player[this.layer].points.gte(player[this.layer].levels.epsilon.pow_base(5).mul(125/2))) {
|
||||
player[this.layer].levels.epsilon = player[this.layer].levels.epsilon.add(1)
|
||||
}
|
||||
},
|
||||
tabFormat: [
|
||||
"main-display",
|
||||
"prestige-button",
|
||||
"blank",
|
||||
"h-line",
|
||||
"blank",
|
||||
["bar", "alpha"],
|
||||
["bar", "beta"],
|
||||
["bar", "gamma"],
|
||||
["bar", "delta"],
|
||||
["bar", "epsilon"],
|
||||
],
|
||||
layerShown(){return true}
|
||||
})
|
Loading…
Reference in a new issue