1
0
mirror of https://github.com/osmarks/website synced 2025-09-02 02:37:55 +00:00

Patch achievement system

This commit is contained in:
2022-03-07 20:07:16 +00:00
parent bac2a75be6
commit ab801b8848
10 changed files with 166 additions and 71 deletions

View File

@@ -121,7 +121,16 @@ const doIns = (ins, state, handler) => {
}
}
let hasDoneAchievement = false
export const step = (state, handler, showIns, maxdepth) => {
if (!hasDoneAchievement && state.stacks.length > 100) {
if ("points" in window) {
points.then(points => points.unlockAchievement("rpnv4recursion"))
}
hasDoneAchievement = true
}
if (state.stacks.length > maxdepth) {
throw 'max recursion depth exceeded'
}