RPG Dice RollerRPG Dice Roller
Home
Guide
API
  • Contributing
  • Code of Conduct
GitHub
Home
Guide
API
  • Contributing
  • Code of Conduct
GitHub
  • API

    • Introduction
    • ComparePoint
    • Description
    • DiceRoll
    • DiceRoller
    • RollGroup
  • dice

    • FudgeDice
    • PercentileDice
    • StandardDice
  • exceptions

    • CompareOperatorError
    • DataFormatError
    • DieActionValueError
    • NotationError
    • RequiredArgumentError
  • modifiers

    • ComparisonModifier
    • CriticalFailureModifier
    • CriticalSuccessModifier
    • DropModifier
    • ExplodeModifier
    • KeepModifier
    • MaxModifier
    • MinModifier
    • Modifier
    • ReRollModifier
    • SortingModifier
    • TargetModifier
    • UniqueModifier
    • modifier-flags
  • parser

    • Parser
  • results

    • ResultGroup
    • RollResult
    • RollResults
  • traits

    • HasDescription
  • utilities

    • ExportFormats
    • NumberGenerator
    • math
    • utils

Modifier

Modifier

Abstract class

This is an abstract class and should not be used directly. You should use one of the extended classes, or extend the class yourself.

A Modifier is the base modifier class that all others extend from.

Kind: global abstract class

  • Modifier
    • new Modifier()
    • .order : number
    • .name ⇒ string
    • .notation ⇒ string
    • .maxIterations ⇒ number
    • .defaults(_context) ⇒ object
    • .useDefaultsIfNeeded(_context) ⇒ void
    • .run(results, _context) ⇒ RollResults
    • .toJSON() ⇒ Object
    • .toString() ⇒ string

new Modifier()

Create a Modifier instance.

modifier.order : number

The default modifier execution order.

Kind: instance property of Modifier

modifier.name ⇒ string

The name of the modifier.

Kind: instance property of Modifier
Returns: string - 'modifier'

modifier.notation ⇒ string

The modifier's notation.

Kind: instance property of Modifier

modifier.maxIterations ⇒ number

The maximum number of iterations that the modifier can apply to a single die roll

Kind: instance property of Modifier
Returns: number - 1000

modifier.defaults(_context) ⇒ object

No default values present

Kind: instance method of Modifier

ParamTypeDescription
_contextStandardDice | RollGroupThe object that the modifier is attached to

modifier.useDefaultsIfNeeded(_context) ⇒ void

Processing default values definitions

Kind: instance method of Modifier

ParamTypeDescription
_contextStandardDice | RollGroupThe object that the modifier is attached to

modifier.run(results, _context) ⇒ RollResults

Run the modifier on the results.

Kind: instance method of Modifier
Returns: RollResults - The modified results

ParamTypeDescription
resultsRollResultsThe results to run the modifier against
_contextStandardDice | RollGroupThe object that the modifier is attached to

modifier.toJSON() ⇒ Object

Return an object for JSON serialising.

This is called automatically when JSON encoding the object.

Kind: instance method of Modifier

modifier.toString() ⇒ string

Return the String representation of the object.

This is called automatically when casting the object to a string.

Kind: instance method of Modifier
See: notation

Edit this page
Last Updated: 07/02/2026, 21:45
Prev
MinModifier
Next
ReRollModifier