Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

The challenge tree #64

Closed
wants to merge 114 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
114 commits
Select commit Hold shift + click to select a range
9e16c2e
thenonymous
THENONYMOUS Apr 29, 2023
29e8d80
thenonymous
THENONYMOUS Apr 29, 2023
cfba30f
wow
THENONYMOUS Apr 29, 2023
b36e463
y
THENONYMOUS Apr 29, 2023
05b3cbc
thenonymous
THENONYMOUS Apr 29, 2023
1017eee
thenonymous
THENONYMOUS Apr 29, 2023
eadfae6
t
THENONYMOUS Apr 29, 2023
b37febc
thenonymous
THENONYMOUS Apr 29, 2023
d3fdc74
thenonymous
THENONYMOUS Apr 29, 2023
a7787ab
thenonymous
THENONYMOUS Apr 29, 2023
9ac4591
thennnonnnymous
THENONYMOUS Apr 29, 2023
34df531
thenonymous
THENONYMOUS Apr 29, 2023
46aea85
changes
THENONYMOUS Apr 29, 2023
b480023
thennnnnnnnnnnonymous!
THENONYMOUS Apr 29, 2023
c1b3412
fixed bug lol
THENONYMOUS Apr 29, 2023
fd8083b
added upgrade
THENONYMOUS Apr 29, 2023
1bc375f
changed add -> times on upgrade 2
THENONYMOUS Apr 29, 2023
8238f7a
+"x"
THENONYMOUS Apr 29, 2023
20ef028
added UG14
THENONYMOUS Apr 29, 2023
5fa4116
added new layer
THENONYMOUS Apr 29, 2023
73d6222
fixed a hotkey
THENONYMOUS Apr 29, 2023
282efe1
hopefully fixed a thing
THENONYMOUS Apr 29, 2023
0ad26f9
added ug effect
THENONYMOUS Apr 29, 2023
e3716d4
hopefully fixed a bug
THENONYMOUS Apr 29, 2023
51c35e9
please fix bug
THENONYMOUS Apr 29, 2023
8dbc952
ples
THENONYMOUS Apr 29, 2023
df6b9a5
pleeees
THENONYMOUS Apr 29, 2023
837594d
nerf entanglement ug
THENONYMOUS Apr 29, 2023
7154a9b
added entanglement milestone
THENONYMOUS Apr 29, 2023
72b91c2
added challenge
THENONYMOUS Apr 29, 2023
471fbd8
added reward
THENONYMOUS Apr 29, 2023
c26491c
tweaked challenge req
THENONYMOUS Apr 29, 2023
3f04e95
nerfedchallenge reward
THENONYMOUS Apr 29, 2023
3a4923b
added p ug
THENONYMOUS Apr 29, 2023
4335a28
tweak challenge effect
THENONYMOUS Apr 29, 2023
19c0985
changed challenge reward
THENONYMOUS Apr 30, 2023
fea6d91
fixed formatting
THENONYMOUS Apr 30, 2023
0987f58
hopefully fixed bug
THENONYMOUS Apr 30, 2023
7c0509a
changed thing
THENONYMOUS Apr 30, 2023
5acf40c
please change the thing
THENONYMOUS Apr 30, 2023
6679665
fix effect?
THENONYMOUS Apr 30, 2023
d09c511
added challenge 2
THENONYMOUS Apr 30, 2023
2b44e93
fixed ÷0
THENONYMOUS Apr 30, 2023
5fbd7da
changed req
THENONYMOUS Apr 30, 2023
4a33d0c
made p12 better
THENONYMOUS Apr 30, 2023
ea2dac9
added p and e upgrade
THENONYMOUS Apr 30, 2023
8009b55
balancing
THENONYMOUS Apr 30, 2023
fefc4b9
balancing
THENONYMOUS Apr 30, 2023
8c8d3b6
big format change + challenge 2 reward change
THENONYMOUS Apr 30, 2023
d5015e5
I forgot
THENONYMOUS Apr 30, 2023
a814467
please help
THENONYMOUS Apr 30, 2023
cdca573
:)
THENONYMOUS Apr 30, 2023
8694eca
did what person told me to
THENONYMOUS Apr 30, 2023
7ab5da0
pray
THENONYMOUS Apr 30, 2023
4adcab6
ples
THENONYMOUS Apr 30, 2023
8a25830
format -> decimal
THENONYMOUS May 1, 2023
4657c55
realised what they meant
THENONYMOUS May 1, 2023
728e800
o
THENONYMOUS May 1, 2023
d661a9d
balancing
THENONYMOUS May 1, 2023
74679bb
changed
THENONYMOUS May 1, 2023
ce5a78e
woah new content
THENONYMOUS May 1, 2023
7eb8c53
agery
THENONYMOUS May 1, 2023
f5054c1
added effect
THENONYMOUS May 1, 2023
496520f
added base point gain raise
THENONYMOUS May 1, 2023
09289f0
added endgame
THENONYMOUS May 1, 2023
2c81b6e
added the final test
THENONYMOUS May 1, 2023
57573d6
changed the final test
THENONYMOUS May 1, 2023
4d363ac
changed final test req
THENONYMOUS May 1, 2023
faccfd1
reverted back to original form
THENONYMOUS May 2, 2023
0f96d34
added c1
THENONYMOUS May 2, 2023
32c2c63
changed layer color
THENONYMOUS May 2, 2023
5868474
added c2
THENONYMOUS May 2, 2023
b95e1d3
added c2 effect
THENONYMOUS May 2, 2023
b571bfa
unNaNned c2
THENONYMOUS May 2, 2023
ff84308
fixed c2 req
THENONYMOUS May 2, 2023
0e9ae86
made c2 reward worse
THENONYMOUS May 2, 2023
ed7491a
increased climit to 10
THENONYMOUS May 3, 2023
7a7b9c4
added c3
THENONYMOUS May 3, 2023
83745d1
added c4 but nervous about bugs
THENONYMOUS May 3, 2023
db3a539
fixed display
THENONYMOUS May 3, 2023
04e5c7a
fixed display v2
THENONYMOUS May 3, 2023
8a7de83
fixed display v3
THENONYMOUS May 3, 2023
6b321ac
added challenge, not implemented reward yet
THENONYMOUS May 3, 2023
82edcb0
fix?
THENONYMOUS May 3, 2023
3342518
added c5 and Power
THENONYMOUS May 3, 2023
d1a2ac4
changed req
THENONYMOUS May 3, 2023
295ce1a
changed "power" color
THENONYMOUS May 3, 2023
75647a0
nerfed "power"
THENONYMOUS May 3, 2023
8a8cada
tweaked Power reqs
THENONYMOUS May 4, 2023
58368f2
spent loads of time adding new milestone
THENONYMOUS May 4, 2023
49287f8
added milestone effect
THENONYMOUS May 4, 2023
2342274
add reset hopefulllllllllly
THENONYMOUS May 4, 2023
4a6d36a
hopefully fixed a bug.
THENONYMOUS May 4, 2023
a3bf43e
fixed an incorrect lte and changed to gte
THENONYMOUS May 5, 2023
652096f
kepw
THENONYMOUS May 5, 2023
cf3e3c6
added easy to implement milestones
THENONYMOUS May 5, 2023
e70bcf5
added [wip] sign
THENONYMOUS May 5, 2023
8e65663
fixed a few types
THENONYMOUS May 5, 2023
d8f052c
added Slowdown effect for balancing
THENONYMOUS May 5, 2023
c7c3741
maybe learnt some normal javascript and added a unique thing!
THENONYMOUS May 5, 2023
0ef30aa
improved milestone
THENONYMOUS May 5, 2023
42229f8
added milestones to help people unlock challenges
THENONYMOUS May 6, 2023
7233187
made 12 effect clearer
THENONYMOUS May 6, 2023
0b3e128
changed effect of cp12
THENONYMOUS May 6, 2023
fc31217
changed pointless requirement after buff to c12
THENONYMOUS May 6, 2023
ab8e8cc
added a questionable challenge
THENONYMOUS May 6, 2023
5d0ab7a
not wip anymore
THENONYMOUS May 6, 2023
bb450e5
balanced sd11
THENONYMOUS May 6, 2023
1f816c4
did... A thing!
THENONYMOUS May 6, 2023
370e87f
simplified code?
THENONYMOUS May 6, 2023
58f9607
added console logging
THENONYMOUS May 6, 2023
f1dc39d
fixde?
THENONYMOUS May 6, 2023
39fb8d9
oopsie
THENONYMOUS May 6, 2023
d805edf
msg
THENONYMOUS May 8, 2023
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
211 changes: 197 additions & 14 deletions js/layers.js
Original file line number Diff line number Diff line change
@@ -1,18 +1,137 @@
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
addLayer("cp", {
name: "Challenge Points", // This is optional, only used in a few places, If absent it just uses the layer id.
symbol: "CP", // 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
startData() {
return {
unlocked: true,
points: new Decimal(0),
}
},
color: "#D07A05",
requires: new Decimal(25), // Can be a function that takes requirement increases into account
resource: "Challenge Points", // Name of prestige currency
baseResource: "points", // Name of resource prestige is based on
baseAmount() {return player.points}, // Get the current amount of baseResource
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
doReset(resettingLayer) {
if (layers[resettingLayer].row <= layers[this.layer].row) return;
if(hasMilestone('sd', 3)) var x = new Decimal(player.cp.points.times(0.9));

let keptChallenges = {};
if (hasMilestone('sd', 0)) keptChallenges[11] = challengeCompletions(this.layer, 11);
if (hasMilestone('sd', 0)) keptChallenges[21] = challengeCompletions(this.layer, 21);
if (hasMilestone('sd', 1)) keptChallenges[12] = challengeCompletions(this.layer, 12);
if (hasMilestone('sd', 2)) keptChallenges[13] = challengeCompletions(this.layer, 13);
if (hasMilestone('sd', 3)) keptChallenges[14] = challengeCompletions(this.layer, 14);

let keep = [];
layerDataReset(this.layer, keep);

console.log("current challenge: "+format(player.sd.activeChallenge))
if(!new Decimal(player.sd.activeChallenge) == new Decimal(0.00)) {
if(hasMilestone('sd', 3)) player.cp.points=new Decimal(x);

for(const [id, completions] of Object.entries(keptChallenges)) {
player[this.layer].challenges[id] = completions;
}}
},
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: "c", description: "C: Reset for Challenge Points", onPress() { if (canReset(this.layer)) doReset(this.layer) } },
],
layerShown() { return true },
challenges: {
11: {
name: "The First Challenge",
challengeDescription: "No nerfs, just reach the goal",
completionLimit() {
if(hasChallenge('sd', 11)) return (100)
else return (10)
},
rewardDescription() {return "+5 to base point gain per completion ("+format(challengeCompletions('cp', 11))+"/10)"},
goalDescription() {return "Reach "+format (new Decimal(50).times(new Decimal(3).pow(new Decimal(challengeCompletions('cp', 11)))))+" points"},
canComplete() {return player.points.gte(new Decimal(50).times(new Decimal(3).pow(new Decimal(challengeCompletions('cp', 11)))))},
},
12: {
name: "The First Real Challenge",
challengeDescription: "Divide Point gain by points^0.5",
completionLimit: (10),
rewardDescription() {return "x"+format(player.cp.points.times(new Decimal(challengeCompletions('cp', 12))).add(1).pow(new Decimal(0.3).add(new Decimal(challengeCompletions('cp', 12)).times(0.02))))+" point gain, based on Challenge Points ("+format(challengeCompletions('cp', 12))+"/10)"},
goalDescription() {return "Reach "+format(new Decimal(25).times(new Decimal(2).pow(new Decimal(challengeCompletions('cp', 12)))))+" points"},
canComplete() {return player.points.gte(new Decimal(25).times(new Decimal(2).pow(new Decimal(challengeCompletions('cp', 12)))))},
},
13: {
name: "Strict",
challengeDescription: "Base Gain is always 1",
completionLimit: (10),
unlocked() {return new Decimal(challengeCompletions('cp', 11)+challengeCompletions('cp', 12)).gte(5)},
rewardDescription() {return "Gain multiplied based on points. Currently: x"+format(player.points.add(1).pow(new Decimal(challengeCompletions('cp', 13)).times(0.03)))+" ("+format(challengeCompletions('cp', 13))+"/10)"},
goalDescription() {return "reach "+format(new Decimal(3).pow(new Decimal(challengeCompletions('cp', 13))).times(50))+" points"},
canComplete() {return player.points.gte(new Decimal(3).pow(new Decimal(challengeCompletions('cp', 13))).times(50))},
},
14: {
name: "Nerfalo",
challengeDescription() {return "Gain Divided by "+format((challengeCompletions('cp', 14)+1)*2)},
completionLimit: (10),
unlocked() {return player.cp.points.gte(100)},
rewardDescription() {return "Multiply Point Gain by Challenge Completions. ("+format(challengeCompletions('cp', 14))+"/10)"},
goalDescription() {return "reach "+format(new Decimal(3).pow(new Decimal(challengeCompletions('cp', 14))).times(1000))+" points"},
canComplete() {return player.points.gte(new Decimal(3).pow(new Decimal(challengeCompletions('cp', 14))).times(1000))}
},
21: {
name: "Pointless",
challengeDescription: "Point gain ^0.1 then x0.1",
unlocked() {return new Decimal(challengeCompletions('cp', 11)).gte(10)},
rewardDescription: "Unlock 'Powers', an adjacent layer which multiplies point gain by 2^Power",
goalDescription: "Reach 0.30 Points/sec",
canComplete() {return new Decimal(tmp.pointGen).gte(0.295)},
},
},
milestones: {
0: {
requirementDescription: "5 Total Completions",
effectDescription: "Unlock Challenge 3: Strict",
done() {return new Decimal(challengeCompletions('cp', 11)+challengeCompletions('cp', 12)).gte(5)},
},
1: {
requirementDescription: "100 Challenge Points",
effectDescription: "Unlock Challenge 4: Nerfalo",
done() {return player.cp.points.gte(100)},
},
2: {
requirementDescription: "10 Completions of Challenge 1",
effectDescription: "Unlock Challenge 5: Pointless",
done() {return new Decimal(challengeCompletions('cp', 11)).gte(10)},
},
},
}),
addLayer("p", {
name: "Powers", // 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: 1, // 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: "#055FD0",
requires: new Decimal(1000), // Can be a function that takes requirement increases into account
resource: "Power", // Name of prestige currency
baseResource: "points", // Name of resource prestige is based on
baseAmount() { return player.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
base: (1000),
exponent: 1, // Prestige currency exponent
gainMult() { // Calculate the multiplier for main currency from bonuses
mult = new Decimal(1)
return mult
Expand All @@ -22,7 +141,71 @@ addLayer("p", {
},
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)}},
{ key: "p", description: "P: Reset for Power", onPress() { if (canReset(this.layer)) doReset(this.layer) } },
],
layerShown(){return true}
})
layerShown() { return hasChallenge('cp', 21) },
}),
addLayer("sd", {
name: "Slowdown", // This is optional, only used in a few places, If absent it just uses the layer id.
symbol: "SD", // 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: "#055FD0",
requires: new Decimal(3), // Can be a function that takes requirement increases into account
resource: "Slowdown", // Name of prestige currency
baseResource: "Power", // Name of resource prestige is based on
baseAmount() { return player.p.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: 2, // Prestige currency exponent
effect() {return player.sd.points.add(1).pow(0.5)},
effectDescription() {return "Slowdown is Multiplying point gain. Currently: "+format(player.sd.points.add(1).pow(0.5))},
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: 1, // Row the layer is in on the tree (0 is the first row)
hotkeys: [
{ key: "s", description: "S: Reset for Slowdown", onPress() { if (canReset(this.layer)) doReset(this.layer) } },
],
layerShown() { return new Decimal(challengeCompletions('cp', 11)).gte(1) },
milestones: {
0: {
requirementDescription: "1 Slowdown",
effectDescription: "Keep Challenge 1 and 'Pointless' completions on reset",
done() {return player.sd.points.gte(1)},
},
1: {
requirementDescription: "2 Slowdown",
effectDescription: "Keep Challenge 2 completions on reset",
done() {return player.sd.points.gte(2)},
},
2: {
requirementDescription: "3 Slowdown",
effectDescription: "Keep Challenge 3 completions on reset and unlock a Slowdown Challenge",
done() {return player.sd.points.gte(3)},
},
3: {
requirementDescription: "4 Slowdown",
effectDescription: "Keep Challenge 4 completions and 90% of challenge points on reset",
done() {return player.sd.points.gte(4)},
},
},
challenges: {
11: {
name: "Slowdown",
challengeDescription: "'Pointless' effect but using 0.5 instead of 0.1",
unlocked() {return hasMilestone('sd', 2)},
rewardDescription: "Increase Completion limit of Challenge 1 to 100",
goalDescription: "Reach 2 Power",
canComplete() {return player.p.points.gte(2)},
},
},
})
33 changes: 22 additions & 11 deletions js/mod.js
Original file line number Diff line number Diff line change
@@ -1,26 +1,26 @@
let modInfo = {
name: "The ??? Tree",
id: "mymod",
author: "nobody",
name: "The Challenge Tree",
id: "thechallengetree491501495",
author: "Thenonymous",
pointsName: "points",
modFiles: ["layers.js", "tree.js"],

discordName: "",
discordLink: "",
initialStartPoints: new Decimal (10), // Used for hard resets and new players
initialStartPoints: new Decimal (0), // 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.1",
name: "Challenges.",
}

let changelog = `<h1>Changelog:</h1><br>
<h3>v0.0</h3><br>
- Added things.<br>
- Added stuff.`
- Added cool stuff.`

let winText = `Congratulations! You have reached the end and beaten this game, but for now...`

Expand All @@ -42,8 +42,19 @@ function getPointGen() {
if(!canGenPoints())
return new Decimal(0)

let gain = new Decimal(1)
return gain
let gain = new Decimal(5)
gain = gain.add(new Decimal(challengeCompletions('cp', 11)).times(5))
if (inChallenge('cp', 13)) gain = new Decimal(1)
gain = gain.times(player.cp.points.times(new Decimal(challengeCompletions('cp', 12))).add(1).pow(new Decimal(0.3).add(new Decimal(challengeCompletions('cp', 12)).times(0.02))))
gain = gain.times(player.points.add(1).pow(new Decimal(challengeCompletions('cp', 13)).times(0.03)))
gain = gain.times(challengeCompletions('cp', 14)+1)
gain = gain.times(new Decimal(2).pow(player.p.points))
gain = gain.times(player.sd.points.add(1).pow(0.5))
if (inChallenge('cp', 14)) gain = gain.dividedBy((challengeCompletions('cp', 14)+1)*2)
if (inChallenge('cp', 12)) gain = gain.dividedBy(player.points.add(1).pow(0.5))
if (inChallenge('cp', 21)) gain = gain.pow(0.1).dividedBy(10)
if (inChallenge('sd', 11)) gain = gain.pow(0.5).dividedBy(2)
return new Decimal(gain)
}

// You can add non-layer related variables that should to into "player" and be saved here, along with default values
Expand All @@ -56,7 +67,7 @@ var displayThings = [

// Determines when the game "ends"
function isEndgame() {
return player.points.gte(new Decimal("e280000000"))
return false
}


Expand All @@ -70,7 +81,7 @@ 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
return(60) // 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,
Expand Down