diff --git a/changelog.md b/changelog.md index e0891f3..580f962 100644 --- a/changelog.md +++ b/changelog.md @@ -1,6 +1,9 @@ #The Modding Tree changelog: +##v1.3.5? +- Completely automated convertToDecimal, now you never have to worry about it again. + ##v1.3.4: 10/8/20 - Added "midsection" feature to add things to a tab's layout while still keeping the standard layout. - Fix for being able to buy more buyables than you should. diff --git a/docs/!general-info.md b/docs/!general-info.md index 96f8e9f..c83adbf 100644 --- a/docs/!general-info.md +++ b/docs/!general-info.md @@ -24,7 +24,7 @@ plain number, and perform operations on them by calling functions. e.g, instead - [Milestones](milestones.md): How to create milestones for a layer. - [Challenges](challenges.md): How to create challenges for a layer. - [Buyables](buyables.md): Create rebuyable upgrades for your layer (with the option to make them respec-able). - Can be used to make Enhancers or Space Buildings. + Can be used to make Enhancers or Space Buildings, but they're flexible enough to do anything. - [Custom Tab Layouts](custom-tab-layouts.md): An optional way to give your tabs a different layout. You can even create entirely new components to use. - [Subtabs and Microtabs](subtabs-and-microtabs.md): Create subtabs for your tabs, as well as "microtab" components that you can put inside the tabs. diff --git a/docs/buyables.md b/docs/buyables.md index a39d2f6..69b2ccb 100644 --- a/docs/buyables.md +++ b/docs/buyables.md @@ -1,8 +1,10 @@ # Buyables -Buyables are things that can be bought multiple times with scaling costs. If you set a respec function, +Buyables are usually things that can be bought multiple times with scaling costs. If you set a respec function, the player can reset the purchases to get their currency back. +However, if you're creative, you can use them for basically anything. "canAfford()" is effectively "canClick()" and "buy()" is effectively "onClick()". + You can use buyableEffect(layer, id) to get the current effects of a buyable. Buyables should be formatted like this: diff --git a/js/utils.js b/js/utils.js index 05f899b..787b11a 100644 --- a/js/utils.js +++ b/js/utils.js @@ -148,56 +148,6 @@ function fixData(defaultData, newData) { } } -function hecj() { - defaultData = startPlayerBase() - for (datum in defaultData){ - if (player[datum] == undefined){ - player[datum] = defaultData[datum] - } - } - for (layer in layers) { - defaultData = layers[layer].startData() - if (player[layer].upgrades == undefined) - player[layer].upgrades = [] - if (player[layer].milestones == undefined) - player[layer].milestones = [] - if (player[layer].challs == undefined) - player[layer].challs = [] - - for (datum in defaultData){ - if (player[layer][datum] == undefined){ - player[layer][datum] = defaultData[datum] - } - } - - if (player[layer].spentOnBuyables == undefined) - player[layer].spentOnBuyables = new Decimal(0) - - if (layers[layer].buyables) { - if (player[layer].buyables == undefined) player[layer].buyables = {} - - for (id in layers[layer].buyables){ - if (player[layer].buyables[id] == undefined && !isNaN(id)) - player[layer].buyables[id] = new Decimal(0) - } - } - - if (layers[layer].tabFormat && !Array.isArray(layers[layer].tabFormat)) { - if (player.subtabs[layer] == undefined) player.subtabs[layer] = {} - if (player.subtabs[layer].mainTabs == undefined) player.subtabs[layer].mainTabs = Object.keys(layers[layer].tabFormat)[0] - } - - if (layers[layer].microtabs) { - if (player.subtabs[layer] == undefined) player.subtabs[layer] = {} - for (item in layers[layer].microtabs) - if (player.subtabs[layer][item] == undefined) player.subtabs[layer][item] = Object.keys(layers[layer].microtabs[item])[0] - } - - } -} - - - function load() { let get = localStorage.getItem(modInfo.id); if (get===null || get===undefined) player = getStartPlayer()