Class

YearZeroDie

YearZeroDie()

Custom Die class for Year Zero games.

Constructor

# new YearZeroDie()

View Source yzur.js, line 39

Extends

  • foundry.dice.terms.Die

Members

Array.<number>

# static constant LOCKED_VALUES

An array of values that disallow the die to be pushed.

View Source yzur.js, line 381

# static MODIFIERS

View Source yzur.js, line 394

string

# static constant TYPE

The type of the die.

View Source yzur.js, line 373

string

# readonly denomination

The denomination of the die.

View Source yzur.js, line 54

number

# readonly failure

Number of banes rolled.

View Source yzur.js, line 134

boolean

# readonly isYearZeroDie

Tells if it's a YearZero Die.

View Source yzur.js, line 106

boolean

# readonly pushable

Whether the die can be pushed (according to its type).

View Source yzur.js, line 72

number

# readonly pushCount

Number of times this die has been pushed.

View Source yzur.js, line 88

boolean

# readonly pushed

Whether this die has been pushed.

View Source yzur.js, line 97

number

# readonly success

Number of successes rolled.

View Source yzur.js, line 116

DieTypeString

# readonly type

The type of the die.

View Source yzur.js, line 63

Methods

# count(n) → {number}

Counts the number of times a single value appears.

Parameters:
Name Type Description
n number

The single value to count

View Source yzur.js, line 180

number

# getResultCSS(result) → {Array.<string>}

Gets the CSS classes that should be used to display each rolled result.

Parameters:
Name Type Description
result YearZeroDieTermResult

The rolled result

See:

View Source yzur.js, line 276

The desired classes

Array.<string>

# getResultLabel(result) → {string}

Returns a string used as the label for each rolled result.

Parameters:
Name Type Description
result YearZeroDieTermResult

The rolled result

See:

View Source yzur.js, line 260

The result label

string

# getTooltipData() → {Object}

Renders the tooltip HTML for a Roll instance.

See:

View Source yzur.js, line 326

The data object used to render the default tooltip template for this DiceTerm

Object

# nopush()

Roll Modifier method that blocks pushes.

View Source yzur.js, line 232

# push() → {YearZeroDie}

Pushes the dice.

View Source yzur.js, line 190

this dice, pushed

YearZeroDie

# async roll(optionsopt) → {Promise.<YearZeroDieTermResult>}

Rolls the DiceTerm by mapping a random uniform draw against the faces of the dice term.

Parameters:
Name Type Attributes Default Description
options Object <optional>
{}

Options which modify how a random result is produced

minimize boolean <optional>
false

Minimize the result, obtaining the smallest possible value

maximize boolean <optional>
false

Maximize the result, obtaining the smallest possible value

See:

View Source yzur.js, line 153

The produced result

Promise.<YearZeroDieTermResult>

# setpush(modifier)

Roll modifier method that sets the max number of pushes.

Parameters:
Name Type Description
modifier string

View Source yzur.js, line 240