1
0
Fork 0
mirror of https://github.com/Acamaeda/The-Modding-Tree.git synced 2024-11-24 17:31:50 +00:00

Added deactivated feature

This commit is contained in:
Harley White 2021-05-15 12:31:58 -04:00
parent 8bf681f41c
commit 368a89452c
5 changed files with 15 additions and 11 deletions

View file

@ -1,8 +1,9 @@
# The Modding Tree changelog:
# v2.5.7 -
# v2.5.7 - 5/15/21
- Added a particle system! Not only can it be used for visual effects, but particles can interact with the mouse. They could be used to create golden cookies or collectables, for example.
- Added marked feature to buyables, clickables, and challenges. By default, stars multi-completion challenges when maxed.
- Added 'deactivated' feature to layers, which disables many features.
- Improved number formatting slightly.
# v2.5.6 - 5/14/21

View file

@ -173,6 +173,8 @@ componentStyles: {
}
```
- deactivated: **optional**, if this is true, hasUpgrade, hasChallenge, hasAchievement, and hasMilestone will return false for things in the layer, and you will be unable to buy or click things on the layer. You will have to disable effects of buyables, the innate layer effect, and possibly other things yourself.
## Custom Prestige type
(All of these can also be used by other prestige types)

View file

@ -2,7 +2,7 @@
Particles are free-floating elements that can move and have many different behaviors. They can also interact with the mouse.
To create particles, use `createParticles(particle, amount)`. `particle` is a particle-defining object, with features as explained below. There are also a few useful functions listed at the end.
To create particles, use `createParticles(particle, amount)`. `particle` is a particle-defining object, with features as explained below. There are also a few other useful things listed at the end.
```js

View file

@ -11,6 +11,7 @@ function respecBuyables(layer) {
function canAffordUpgrade(layer, id) {
let upg = tmp[layer].upgrades[id]
if(tmp[layer].deactivated) return false
if (tmp[layer].upgrades[id].canAfford !== undefined) return tmp[layer].upgrades[id].canAfford
let cost = tmp[layer].upgrades[id].cost
return canAffordPurchase(layer, upg, cost)
@ -18,7 +19,7 @@ function canAffordUpgrade(layer, id) {
function canBuyBuyable(layer, id) {
let b = temp[layer].buyables[id]
return (b.unlocked && run(b.canAfford, b) && player[layer].buyables[id].lt(b.purchaseLimit))
return (b.unlocked && run(b.canAfford, b) && player[layer].buyables[id].lt(b.purchaseLimit) && !tmp[layer].deactivated)
}
@ -89,7 +90,7 @@ function buyUpg(layer, id) {
function buyMaxBuyable(layer, id) {
if (!player[layer].unlocked) return
if (!tmp[layer].buyables[id].unlocked) return
if (!tmp[layer].buyables[id].canAfford) return
if (!tmp[layer].buyables[id].canBuy) return
if (!layers[layer].buyables[id].buyMax) return
run(layers[layer].buyables[id].buyMax, layers[layer].buyables[id])
@ -106,7 +107,7 @@ function buyBuyable(layer, id) {
}
function clickClickable(layer, id) {
if (!player[layer].unlocked) return
if (!player[layer].unlocked || tmp[layer].deactivated) return
if (!tmp[layer].clickables[id].unlocked) return
if (!tmp[layer].clickables[id].canClick) return
@ -115,7 +116,7 @@ function clickClickable(layer, id) {
}
function clickGrid(layer, id) {
if (!player[layer].unlocked) return
if (!player[layer].unlocked || tmp[layer].deactivated) return
if (!run(layers[layer].grid.getUnlocked, layers[layer].grid, id)) return
if (!gridRun(layer, 'getCanClick', player[layer].grid[id], id)) return

View file

@ -1,21 +1,21 @@
function hasUpgrade(layer, id) {
return (player[layer].upgrades.includes(toNumber(id)) || player[layer].upgrades.includes(id.toString()))
return ((player[layer].upgrades.includes(toNumber(id)) || player[layer].upgrades.includes(id.toString())) && !tmp[layer].deactivated)
}
function hasMilestone(layer, id) {
return (player[layer].milestones.includes(toNumber(id)) || player[layer].milestones.includes(id.toString()))
return ((player[layer].milestones.includes(toNumber(id)) || player[layer].milestones.includes(id.toString())) && !tmp[layer].deactivated)
}
function hasAchievement(layer, id) {
return (player[layer].achievements.includes(toNumber(id)) || player[layer].achievements.includes(id.toString()))
return ((player[layer].achievements.includes(toNumber(id)) || player[layer].achievements.includes(id.toString())) && !tmp[layer].deactivated)
}
function hasChallenge(layer, id) {
return (player[layer].challenges[id])
return ((player[layer].challenges[id]) && !tmp[layer].deactivated)
}
function maxedChallenge(layer, id) {
return (player[layer].challenges[id] >= tmp[layer].challenges[id].completionLimit)
return ((player[layer].challenges[id] >= tmp[layer].challenges[id].completionLimit) && !tmp[layer].deactivated)
}
function challengeCompletions(layer, id) {