Class

YearZeroRollManager

(abstract) YearZeroRollManager()

Interface for registering Year Zero dice.

To register the game and its dice, call the static YearZeroRollManager.register() method at the start of the init Hooks.

Constructor

# abstract new YearZeroRollManager()

View Source yzur.js, line 1990

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>

View Source yzur.js, line 2294

GameTypeString

# static constant GAMES

List of identifiers for the games.

View Source yzur.js, line 2319

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

See:

View Source yzur.js, line 2223

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

See:

View Source yzur.js, line 2009

# 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

View Source yzur.js, line 2029

# 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

See:

View Source yzur.js, line 2118

# 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

See:

View Source yzur.js, line 2042

# static registerDie(term)

Registers a die in Foundry.

Parameters:
Name Type Description
term DieTermString

Class identifier of the die to register

View Source yzur.js, line 2087

# 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

View Source yzur.js, line 2072