1
0
Fork 0
mirror of https://github.com/Acamaeda/The-Modding-Tree.git synced 2024-11-28 02:51:55 +00:00

Updated documentation for the Tempocalypse

This commit is contained in:
Acamaeda 2020-10-09 23:26:27 -04:00
parent 6268caea20
commit a7623e3180
7 changed files with 25 additions and 22 deletions

View file

@ -1,8 +1,7 @@
# Basic layer breakdown # Basic layer breakdown
This is a very minimal layer with minimal features. Most things will require additional features. This is a very minimal layer with minimal features. Most things will require additional features.
If you're curious about "() =>", it's a weird notation that lets you use either a value or function in the same slot,
and treats it like a function. You can use it to make actual functions, but it breaks things then.
```js ```js
p: { p: {
@ -12,14 +11,14 @@ and treats it like a function. You can use it to make actual functions, but it b
// If you add non-standard Decimal variables, look at convertToDecimal // If you add non-standard Decimal variables, look at convertToDecimal
}}, }},
color:() => "#FE0102", // The color for this layer, which affects many elements color: "#FE0102", // The color for this layer, which affects many elements
resource: "prestige points", // The name of this layer's main prestige resource resource: "prestige points", // The name of this layer's main prestige resource
row: 0, // The row this layer is on (0 is the first row) row: 0, // The row this layer is on (0 is the first row)
baseResource: "points", // The name of the resource your prestige gain is based on baseResource: "points", // The name of the resource your prestige gain is based on
baseAmount() {return player.points}, // A function to return the current value of that resource baseAmount() {return player.points}, // A function to return the current value of that resource
requires:() => new Decimal(200)}, // The amount of the base needed to gain 1 of the prestige currency. requires: new Decimal(200)}, // The amount of the base needed to gain 1 of the prestige currency.
// Also the amount required to unlock the layer. // Also the amount required to unlock the layer.
type: "normal", // Determines the formula used for calculating prestige currency. type: "normal", // Determines the formula used for calculating prestige currency.

View file

@ -45,7 +45,7 @@ Features:
- buyMax(): **optional**, A function that implements buying as many of the buyable as possible. - buyMax(): **optional**, A function that implements buying as many of the buyable as possible.
- style(): **Optional**, A function returning a CSS object, which affects this buyable. - style: **Optional**, A CSS object, which affects this buyable.
- layer: **Assigned automagically**. It's the same value as the name of this layer, so you can do player[this.layer].points or similar - layer: **Assigned automagically**. It's the same value as the name of this layer, so you can do player[this.layer].points or similar

View file

@ -54,7 +54,7 @@ By default, challenges use basic Points for the goal. You can change that using
- currencyLayer: **optional**, the internal name of the layer that currency is stored in. - currencyLayer: **optional**, the internal name of the layer that currency is stored in.
If it's part of a layer, omit. If it's part of a layer, omit.
- style(): **Optional**, A function returning a CSS object, which affects this challenge. - style: **Optional**, A CSS object, which affects this challenge.
- layer: **Assigned automagically**. It's the same value as the name of this layer, so you can do player[this.layer].points or similar - layer: **Assigned automagically**. It's the same value as the name of this layer, so you can do player[this.layer].points or similar

View file

@ -3,6 +3,8 @@
This is a more comprehensive list of established features to add to layers. This is a more comprehensive list of established features to add to layers.
You can add more freely, if you want to have other functions or values associated with your layer. These have special functionality, though. You can add more freely, if you want to have other functions or values associated with your layer. These have special functionality, though.
You can make almost any value dynamic by using a function in its place, including all display strings and styling/color features.
Key: Key:
- No label: This is required and the game will crash if it isn't included. - No label: This is required and the game will crash if it isn't included.
- **sometimes required**: This is may be required, depending on other things in the layer. - **sometimes required**: This is may be required, depending on other things in the layer.
@ -51,7 +53,7 @@ Key:
], ],
``` ```
- style(): **optional**, a function returning a CSS object containing any CSS that should affect this layer's whole tab. - style: **optional**, a CSS object containing any CSS that should affect this layer's whole tab.
- tabFormat: **optional**, use this if you want to add extra things to your tab or change the layout. [See here for more info.](custom-tab-layouts.md) - tabFormat: **optional**, use this if you want to add extra things to your tab or change the layout. [See here for more info.](custom-tab-layouts.md)
@ -110,6 +112,12 @@ Key:
- onPrestige(gain): **optional**, A function that triggers when this layer prestiges, just before you gain the currency. - 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. 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.
- 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.
# Tree/node features # Tree/node features
@ -117,7 +125,7 @@ Key:
in the list. Alternatively, an entry in the array can be a pair consisting of the layer id and a color in the list. Alternatively, an entry in the array can be a pair consisting of the layer id and a color
value. The color value can either be a string with a hex color code, or a number from 1-3 (theme-affected colors) value. The color value can either be a string with a hex color code, or a number from 1-3 (theme-affected colors)
- nodeStyle(): **optional**, a function returning a CSS object, styles this layer's node on the tree - nodeStyle: **optional**, a CSS object, styles this layer's node on the tree
- tooltip() / tooltipLocked(): **optional** Functions that return text, which is the tooltip for the node when the layer - tooltip() / tooltipLocked(): **optional** Functions that return text, which is the tooltip for the node when the layer
is unlocked or locked, respectively. By default the tooltips behave the same as in the original Prestige Tree. is unlocked or locked, respectively. By default the tooltips behave the same as in the original Prestige Tree.
@ -138,7 +146,7 @@ Key:
- automate(): **optional**, this function is called every game tick, after production. Use it to activate any - automate(): **optional**, this function is called every game tick, after production. Use it to activate any
autobuyers or auto-resets or similar on this layer, if appropriate. autobuyers or auto-resets or similar on this layer, if appropriate.
- resetsNothing(): **optional**, returns true if this layer shouldn't trigger any resets when you prestige. - resetsNothing: **optional**, returns true if this layer shouldn't trigger any resets when you prestige.
- incr_order: **optional**, an array of layer ids. When this layer is unlocked for the first time, the "order" value - incr_order: **optional**, an array of layer ids. When this layer is unlocked for the first time, the "order" value
for any not-yet-unlocked layers in this list increases. This can be used to make them harder to unlock. for any not-yet-unlocked layers in this list increases. This can be used to make them harder to unlock.
@ -157,21 +165,17 @@ Key:
``` ```
# Custom Prestige type only # Custom Prestige type
(No effect otherwise)
- prestigeButtonText(): **Only for custom prestige type**, Function that returns the entirety of the text that should - getResetGain(): **For custom prestige type**, Returns how many points you should get if you reset now. You can call
be displayed on the prestige button.You can use HTML as well!
- getResetGain(): **Only for custom prestige type**, Returns how many points you should get if you reset now. You can call
getResetGain(this.layer, useType = "static") or similar to calculate what your gain would be under another getResetGain(this.layer, useType = "static") or similar to calculate what your gain would be under another
prestige type (provided you have all of the required features in the layer.) prestige type (provided you have all of the required features in the layer.)
- getNextAt(canMax=false): **Only for custom prestige type**, Returns how many of the base currency you need to get to - getNextAt(canMax=false): **For custom prestige type**, Returns how many of the base currency you need to get to
the next point. canMax is an optional variable used with Static-ish layers to differentiate between if the next point. canMax is an optional variable used with Static-ish layers to differentiate between if
it's looking for the first point you can reset at, or the requirement for any gain at all. it's looking for the first point you can reset at, or the requirement for any gain at all.
(Supporting both is good). You can also call getNextAt(this.layer, canMax=false, useType = "static") (Supporting both is good). You can also call getNextAt(this.layer, canMax=false, useType = "static")
or similar to calculate what your next at would be under another prestige type (provided you have or similar to calculate what your next at would be under another prestige type (provided you have
all of the required features in the layer.) all of the required features in the layer.)
- canReset(): **Only for custom prestige type**, return true only if you have the resources required to do a prestige here. - canReset(): **For custom prestige type**, return true only if you have the resources required to do a prestige here.

View file

@ -31,7 +31,7 @@ Milestone features:
**Tip:** Toggles are not de-set if the milestone becomes locked! In this case, you should also check if the player has the milestone. **Tip:** Toggles are not de-set if the milestone becomes locked! In this case, you should also check if the player has the milestone.
- style(): **Optional**, A function returning a CSS object, which affects this milestone. - style: **Optional**, A CSS object, which affects this milestone.
- unl(): A function returning a boolean to determine if the milestone should be shown. If absent, it is always shown. - unl(): A function returning a boolean to determine if the milestone should be shown. If absent, it is always shown.

View file

@ -44,9 +44,9 @@ Normal subtabs and microtab subtabs both use the same features:
- content: The tab layout code for the subtab, in [the tab layout format](custom-tab-layouts.md) - content: The tab layout code for the subtab, in [the tab layout format](custom-tab-layouts.md)
- style(): **Optional**, A function returning a CSS object, which affects the CSS when in that subtab. - style: **Optional**, A CSS object, which affects the CSS when in that subtab.
- buttonStyle(): **Optional**, A function returning a CSS object, which affects the appearance of the button for that subtab. - buttonStyle: **Optional**, A CSS object, which affects the appearance of the button for that subtab.
- unl(): **Optional**, a function to determine if the button for this subtab should be visible. By default, a subtab is always unlocked. - unl(): **Optional**, a function to determine if the button for this subtab should be visible. By default, a subtab is always unlocked.
(You can't use the "this" keyword in this function.) (You can't use the "this" keyword in this function.)

View file

@ -5,7 +5,7 @@ Upgrades are stored in the following format:
Useful functions for dealing with Upgrades and implementing their effects: Useful functions for dealing with Upgrades and implementing their effects:
- hasUpg(layer, id): determine if the player has the upgrade - hasUpg(layer, id): determine if the player has the upgrade
- ugpEffect(layer, id): Returns the current effects of the upgrade, if any - upgEffect(layer, id): Returns the current effects of the upgrade, if any
Hint: Basic point gain is calculated in game.js's "getPointGain". Hint: Basic point gain is calculated in game.js's "getPointGain".
@ -50,7 +50,7 @@ By default, upgrades use the main prestige currency for the layer. You can inclu
- currencyLayer: **optional**, the internal name of the layer that currency is stored in. - currencyLayer: **optional**, the internal name of the layer that currency is stored in.
If it's not in a layer (like Points), omit. If it's not in a layer (like Points), omit.
- style(): **Optional**, A function returning a CSS object, which affects this upgrade. - style: **Optional**, A a CSS object, which affects this upgrade.
- layer: **Assigned automagically**. It's the same value as the name of this layer, so you can do player[this.layer].points or similar - layer: **Assigned automagically**. It's the same value as the name of this layer, so you can do player[this.layer].points or similar