1
0
Fork 0
mirror of https://github.com/Acamaeda/The-Modding-Tree.git synced 2025-05-12 13:01:05 +00:00
This commit is contained in:
Acamaeda 2020-10-16 11:39:39 -04:00
parent 956f13370d
commit a3d65b72a7
12 changed files with 89 additions and 33 deletions

View file

@ -37,7 +37,10 @@ function getPointGen() {
return gain
}
// You can change this if you have things that can be messed up by long tick lengths
function maxTickLength() {
return(3600000) // Default is 1 hour which is just arbitrarily large
}
function getResetGain(layer, useType = null) {
let type = useType
@ -256,11 +259,14 @@ function canCompleteChallenge(layer, x)
{
if (x != player[layer].activeChallenge) return
let challenge = layers[layer].challenges[x]
let challenge = tmp[layer].challenges[x]
if (challenge.currencyInternalName){
let name = challenge.currencyInternalName
if (challenge.currencyLayer){
if (challenge.currencyLocation){
return !(challenge.currencyLocation[name].lt(challenge.goal))
}
else if (challenge.currencyLayer){
let lr = challenge.currencyLayer
return !(player[lr][name].lt(readData(challenge.goal)))
}
@ -306,6 +312,10 @@ function gameLoop(diff) {
}
if (player.devSpeed) diff *= player.devSpeed
let limit = maxTickLength()
if(diff > limit)
diff = limit
addTime(diff)
player.points = player.points.add(tmp.pointGen.times(diff)).max(0)
for (layer in layers){