ResourceSettings
A resource’s settings, as defineResource takes them: data the room
and the page share.
Properties
Section titled “Properties”| Property | Type | Default value | Description |
|---|---|---|---|
color? |
string |
undefined |
The fill every bar draws it in, such as "#4aa3ff": any CSS colour. One bar may draw it in another. Left out, a bar draws in Bar’s own fill. |
label? |
string |
undefined |
What a player reads for it, such as "Mana": a bar’s name and a refused cast’s line. Left out, it is the name as words: "Combo" for "combo", "Lantern charges" for "lanternCharges". |
maximum |
number |
undefined |
What it holds when full: the base of the character’s max<Name> stat, maxMana for "mana", which items and cards raise. |
regen? |
number |
0 |
What it gains a second, up to its maximum; a negative regen decays it toward 0, as rage does. A character’s <name>Regen stat, where she has one, takes its place. Left out, it never regenerates. |
regenDelaySeconds? |
number |
undefined |
Seconds it stops regenerating after a spend, as stamina does. Left out, it regenerates at once. |
saved? |
boolean |
undefined |
Whether a save keeps what a character has of it. False leaves it out, and a load starts it from start, as a game that refills it on each load wants. Left out, it is saved. |
start? |
number | "empty" | "full" | ResourceStart |
ResourceStart.Full |
Where it starts when a character is given it: full, empty, or a number, capped at maximum. Its text too, so "full" reads as the enum does. |