# abstract new YearZeroRollManager()
When instanciated
SyntaxError
Example
import { YearZeroRollManager } from './lib/yzur.js';
Hooks.once('init', function() {
YearZeroRollManager.register('yourgame', config, options);
...
});
Members
Array.<DieTermString>
# static constant DIE_TERMS_MAP
Die Types mapped with Games. Used by the register method to choose which dice to activate.
Properties:
Name | Type | Description |
---|---|---|
myz |
Array.<DieTermString>
|
|
fbl |
Array.<DieTermString>
|
|
alien |
Array.<DieTermString>
|
|
tales |
Array.<DieTermString>
|
|
cor |
Array.<DieTermString>
|
|
vae |
Array.<DieTermString>
|
|
t2k |
Array.<DieTermString>
|
|
br |
Array.<DieTermString>
|
Methods
# static createDieClass(data) → {class}
Creates a new custom Die class that extends the YearZeroDie
class.
Parameters:
Name | Type | Description |
---|---|---|
data |
DieClassData
|
An object with |
class
Example
YZUR.YearZeroRollManager.createDieClass({
name: 'D6SpecialDie',
denomination: 's',
faces: 6,
type: 'gear',
lockedValues: [4, 5, 6],
});
# static register(yzGame, configopt, optionsopt)
Registers the Year Zero dice for the specified game.
You must call this method in Hooks.once('init')
.
Parameters:
Name | Type | Attributes | Description |
---|---|---|---|
yzGame |
GameTypeString
|
The game used (for the choice of die types to register) |
|
config |
Object
|
<optional> |
Custom config to merge with the initial config |
options |
Object
|
<optional> |
Additional options |
index |
number
|
<optional> |
Index of the registration |
# static registerConfig(configopt)
Registers the Year Zero Universal Roller config. (See the config details at the very bottom of this file.)
Parameters:
Name | Type | Attributes | Description |
---|---|---|---|
config |
string
|
<optional> |
Custom config to merge with the initial config |
# static registerCustomDie(term, data)
Registers a custom die in Foundry.
Parameters:
Name | Type | Description |
---|---|---|
term |
DieTermString
|
Class identifier of the die to register |
data |
DieClassData
|
Data for creating the custom die class |
# static registerDice(yzGameopt, iopt)
Registers all the Year Zero Dice of the chosen game.
Parameters:
Name | Type | Attributes | Default | Description |
---|---|---|---|---|
yzGame |
GameTypeString
|
<optional> |
The game used (for the choice of die types to register) |
|
i |
number
|
<optional> |
0 | Index of the registration |
# static registerDie(term)
Registers a die in Foundry.
Parameters:
Name | Type | Description |
---|---|---|
term |
DieTermString
|
Class identifier of the die to register |
# static registerRoll(clsopt, iopt)
Registers the roll.
Parameters:
Name | Type | Attributes | Default | Description |
---|---|---|---|---|
cls |
class
|
<optional> |
The roll class to register |
|
i |
number
|
<optional> |
0 | Index of the registration |