1
0
Fork 0
mirror of https://github.com/Acamaeda/The-Modding-Tree.git synced 2024-11-22 00:21:32 +00:00
This commit is contained in:
Acamaeda 2020-12-21 22:09:33 -05:00
parent 6ed4f91cd4
commit 4414580408
6 changed files with 43 additions and 12 deletions

View file

@ -1,7 +1,14 @@
# The Modding Tree changelog: # The Modding Tree changelog:
## v2.3.5 - 12/21/20
- Added resetTime, which tracks the time since a layer prestiged or was reset.
- A layer node will be highlighted red if one of its subtabs is highlighted red.
- Fixed issues with keeping challenges, buyables, and clickables on reset.
- Improved the unlocking of custom layers.
- Other minor fixes.
## v2.3.4 - 12/16/20 ## v2.3.4 - 12/16/20
- Added an image feature, which puts an image on a node. - Added an node image feature.
- Resource display now always shows the amount of the currency the layer's gain is based on. - Resource display now always shows the amount of the currency the layer's gain is based on.
- Added spacing between tree nodes. - Added spacing between tree nodes.
- Another attempt to fix tooltip flickering. - Another attempt to fix tooltip flickering.

View file

@ -20,6 +20,7 @@ You can make almost any value dynamic by using a function in its place, includin
- total: A Decimal, tracks total amount of main prestige currency. Always tracked, but only shown if you add it here. - total: A Decimal, tracks total amount of main prestige currency. Always tracked, but only shown if you add it here.
- best: A Decimal, tracks highest amount of main prestige currency. Always tracked, but only shown if you add it here. - best: A Decimal, tracks highest amount of main prestige currency. Always tracked, but only shown if you add it here.
- unlockOrder: used to keep track of relevant layers unlocked before this one. - unlockOrder: used to keep track of relevant layers unlocked before this one.
- resetTime: A number, time since this layer was last prestiged (or reset by another layer)
- color: A color associated with this layer, used in many places. (A string in hex format with a #) - color: A color associated with this layer, used in many places. (A string in hex format with a #)
@ -44,7 +45,7 @@ You can make almost any value dynamic by using a function in its place, includin
hotkeys: [ hotkeys: [
{ {
key: "p", // What the hotkey button is. Use uppercase if it's combined with shift, or "ctrl+x" for holding down ctrl. key: "p", // What the hotkey button is. Use uppercase if it's combined with shift, or "ctrl+x" for holding down ctrl.
desc: "p: reset your points for prestige points", // The description of the hotkey that is displayed in the game's How To Play tab description: "p: reset your points for prestige points", // The description of the hotkey that is displayed in the game's How To Play tab
onPress() { if (player.p.unlocked) doReset("p") } onPress() { if (player.p.unlocked) doReset("p") }
} }
] ]
@ -110,7 +111,7 @@ You can make almost any value dynamic by using a function in its place, includin
- onPrestige(gain): **optional**. A function that triggers when this layer prestiges, just before you gain the currency. Can be used to have secondary resource gain on prestige, or to recalculate things or whatnot. - onPrestige(gain): **optional**. A function that triggers when this layer prestiges, just before you gain the currency. Can be used to have secondary resource gain on prestige, or to recalculate things or whatnot.
- resetDesc: **optional**. Use this to replace "Reset for " on the Prestige button with something else. - resetDescription: **optional**. Use this to replace "Reset for " on the Prestige button with something else.
- prestigeButtonText(): **sometimes required**. Use this to make the entirety of the text a Prestige button contains. Only required for custom layers, but usable by all types. - prestigeButtonText(): **sometimes required**. Use this to make the entirety of the text a Prestige button contains. Only required for custom layers, but usable by all types.

View file

@ -11,7 +11,7 @@ let modInfo = {
// Set your version in num and name // Set your version in num and name
let VERSION = { let VERSION = {
num: "2.3.4", num: "2.3.5",
name: "Cooler and Newer Edition", name: "Cooler and Newer Edition",
} }

View file

@ -4,7 +4,7 @@ var gameEnded = false;
// Don't change this // Don't change this
const TMT_VERSION = { const TMT_VERSION = {
tmtNum: "2.3.4", tmtNum: "2.3.5",
tmtName: "Cooler and Newer Edition" tmtName: "Cooler and Newer Edition"
} }
@ -87,6 +87,20 @@ function shouldNotify(layer){
if (player[layer].activeChallenge && canCompleteChallenge(layer, player[layer].activeChallenge)) { if (player[layer].activeChallenge && canCompleteChallenge(layer, player[layer].activeChallenge)) {
return true return true
} }
if (isPlainObject(tmp[layer].tabFormat)) {
for (subtab in tmp[layer].tabFormat){
if (subtabShouldNotify(layer, 'mainTabs', subtab))
return true
}
}
for (family in tmp[layer].microtabs) {
for (subtab in tmp[layer].microtabs[family]){
if (subtabShouldNotify(layer, family, subtab))
return true
}
}
if (tmp[layer].shouldNotify){ if (tmp[layer].shouldNotify){
return tmp[layer].shouldNotify return tmp[layer].shouldNotify
} }
@ -125,15 +139,19 @@ function layerDataReset(layer, keep = []) {
if (player[layer][keep[thing]] !== undefined) if (player[layer][keep[thing]] !== undefined)
storedData[keep[thing]] = player[layer][keep[thing]] storedData[keep[thing]] = player[layer][keep[thing]]
} }
Vue.set(player[layer], "buyables", getStartBuyables(layer))
Vue.set(player[layer], "clickables", getStartClickables(layer))
Vue.set(player[layer], "challenges", getStartChallenges(layer))
layOver(player[layer], getStartLayerData(layer)) layOver(player[layer], getStartLayerData(layer))
player[layer].upgrades = [] player[layer].upgrades = []
player[layer].milestones = [] player[layer].milestones = []
player[layer].achievements = []
player[layer].challenges = getStartChallenges(layer) player[layer].challenges = getStartChallenges(layer)
resetBuyables(layer) resetBuyables(layer)
if (layers[layer].clickables && !player[layer].clickables) if (layers[layer].clickables && !player[layer].clickables)
player[layer].clickables = getStartClickables(layer) player[layer].clickables = getStartClickables(layer)
for (thing in storedData) { for (thing in storedData) {
player[layer][thing] =storedData[thing] player[layer][thing] =storedData[thing]
} }
@ -207,6 +225,8 @@ function doReset(layer, force=false) {
rowReset("side", layer) rowReset("side", layer)
prevOnReset = undefined prevOnReset = undefined
player[layer].resetTime = 0
updateTemp() updateTemp()
updateTemp() updateTemp()
} }
@ -315,6 +335,7 @@ function gameLoop(diff) {
for (x = 0; x <= maxRow; x++){ for (x = 0; x <= maxRow; x++){
for (item in TREE_LAYERS[x]) { for (item in TREE_LAYERS[x]) {
let layer = TREE_LAYERS[x][item] let layer = TREE_LAYERS[x][item]
player[layer].resetTime += diff
if (tmp[layer].passiveGeneration) generatePoints(layer, diff*tmp[layer].passiveGeneration); if (tmp[layer].passiveGeneration) generatePoints(layer, diff*tmp[layer].passiveGeneration);
if (layers[layer].update) layers[layer].update(diff); if (layers[layer].update) layers[layer].update(diff);
} }
@ -323,6 +344,7 @@ function gameLoop(diff) {
for (row in OTHER_LAYERS){ for (row in OTHER_LAYERS){
for (item in OTHER_LAYERS[row]) { for (item in OTHER_LAYERS[row]) {
let layer = OTHER_LAYERS[row][item] let layer = OTHER_LAYERS[row][item]
player[layer].resetTime += diff
if (tmp[layer].passiveGeneration) generatePoints(layer, diff*tmp[layer].passiveGeneration); if (tmp[layer].passiveGeneration) generatePoints(layer, diff*tmp[layer].passiveGeneration);
if (layers[layer].update) layers[layer].update(diff); if (layers[layer].update) layers[layer].update(diff);
} }

View file

@ -148,6 +148,7 @@ function getStartLayerData(layer){
if (layerdata.unlocked === undefined) layerdata.unlocked = true if (layerdata.unlocked === undefined) layerdata.unlocked = true
if (layerdata.total === undefined) layerdata.total = new Decimal(0) if (layerdata.total === undefined) layerdata.total = new Decimal(0)
if (layerdata.best === undefined) layerdata.best = new Decimal(0) if (layerdata.best === undefined) layerdata.best = new Decimal(0)
if (layerdata.resetTime === undefined) layerdata.resetTime = 0
layerdata.buyables = getStartBuyables(layer) layerdata.buyables = getStartBuyables(layer)
if(layerdata.clickables == undefined) layerdata.clickables = getStartClickables(layer) if(layerdata.clickables == undefined) layerdata.clickables = getStartClickables(layer)
@ -684,8 +685,8 @@ function subtabShouldNotify(layer, family, id){
let subtab = {} let subtab = {}
if (family == "mainTabs") subtab = tmp[layer].tabFormat[id] if (family == "mainTabs") subtab = tmp[layer].tabFormat[id]
else subtab = tmp[layer].microtabs[family][id] else subtab = tmp[layer].microtabs[family][id]
if (player.subtabs[layer][family] === id) return false
else if (subtab.embedLayer) return tmp[subtab.embedLayer].notify if (subtab.embedLayer) return tmp[subtab.embedLayer].notify
else return subtab.shouldNotify else return subtab.shouldNotify
} }
@ -709,7 +710,7 @@ function nodeShown(layer) {
function layerunlocked(layer) { function layerunlocked(layer) {
if (tmp[layer] && tmp[layer].type == "none") return (player[layer].unlocked) if (tmp[layer] && tmp[layer].type == "none") return (player[layer].unlocked)
return LAYERS.includes(layer) && (player[layer].unlocked || (tmp[layer].baseAmount.gte(tmp[layer].requires) && tmp[layer].layerShown)) return LAYERS.includes(layer) && (player[layer].unlocked || (tmp[layer].canReset && tmp[layer].layerShown))
} }
function keepGoing() { function keepGoing() {
@ -725,7 +726,7 @@ function toNumber(x) {
function updateMilestones(layer){ function updateMilestones(layer){
for (id in layers[layer].milestones){ for (id in layers[layer].milestones){
if (!(player[layer].milestones.includes(id)) && layers[layer].milestones[id].done()){ if (!(hasMilestone(layer, id)) && layers[layer].milestones[id].done()){
player[layer].milestones.push(id) player[layer].milestones.push(id)
if (tmp[layer].milestonePopups || tmp[layer].milestonePopups === undefined) doPopup("milestone", tmp[layer].milestones[id].requirementDescription, "Milestone Gotten!", 3, tmp[layer].color); if (tmp[layer].milestonePopups || tmp[layer].milestonePopups === undefined) doPopup("milestone", tmp[layer].milestones[id].requirementDescription, "Milestone Gotten!", 3, tmp[layer].color);
} }
@ -734,7 +735,7 @@ function updateMilestones(layer){
function updateAchievements(layer){ function updateAchievements(layer){
for (id in layers[layer].achievements){ for (id in layers[layer].achievements){
if (isPlainObject(layers[layer].achievements[id]) && !(player[layer].achievements.includes(id)) && layers[layer].achievements[id].done()) { if (isPlainObject(layers[layer].achievements[id]) && !(hasAchievement(layer, id)) && layers[layer].achievements[id].done()) {
player[layer].achievements.push(id) player[layer].achievements.push(id)
if (layers[layer].achievements[id].onComplete) layers[layer].achievements[id].onComplete() if (layers[layer].achievements[id].onComplete) layers[layer].achievements[id].onComplete()
if (tmp[layer].achievementPopups || tmp[layer].achievementPopups === undefined) doPopup("achievement", tmp[layer].achievements[id].name, "Achievement Gotten!", 3, tmp[layer].color); if (tmp[layer].achievementPopups || tmp[layer].achievementPopups === undefined) doPopup("achievement", tmp[layer].achievements[id].name, "Achievement Gotten!", 3, tmp[layer].color);

View file

@ -214,7 +214,7 @@ h1, h2, h3, b, input {
margin: 5px; margin: 5px;
border-radius: 10px; border-radius: 10px;
border: 2px solid; border: 2px solid;
border-color: rgba(0, 0, 0, 0.125); color: var(--color);
} }