1
0
Fork 0
mirror of https://github.com/Acamaeda/The-Modding-Tree.git synced 2025-05-12 13:01:05 +00:00

Put an end to convertToDecimal

This commit is contained in:
Acamaeda 2020-10-08 19:42:26 -04:00
parent 1ae02a4328
commit 199485a87a
5 changed files with 54 additions and 28 deletions

View file

@ -5,7 +5,7 @@ var NaNalert = false;
var gameEnded = false;
let VERSION = {
num: "1.3.4",
num: "1.3.5 maybe",
name: "Tabception... ception!"
}
@ -35,24 +35,6 @@ function inChallenge(layer, id){
return layers[layer].challs[id].countsAs.includes(id)
}
function convertToDecimal() {
player.points = new Decimal(player.points)
for (layer in layers) {
player[layer].points = new Decimal(player[layer].points)
if (player[layer].best != undefined) player[layer].best = new Decimal(player[layer].best)
if (player[layer].total !== undefined) player[layer].total = new Decimal(player[layer].total)
player[layer].spentOnBuyables = new Decimal(player[layer].spentOnBuyables)
if (player[layer].buyables != undefined) {
for (id in player[layer].buyables)
player[layer].buyables[id] = new Decimal(player[layer].buyables[id])
}
player[layer].best = new Decimal(player[layer].best)
if (layers[layer].convertToDecimal) layers[layer].convertToDecimal();
}
}
function getResetGain(layer, useType = null) {
let type = useType
if (!useType) type = layers[layer].type