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

ReRollModifier

ReRollModifier ⇐ ComparisonModifier

A ReRollModifier re-rolls dice that match a given test, and replaces the new value with the old one.

Kind: global class
Extends: ComparisonModifier
See: ExplodeModifier if you want to keep the old value as well

  • ReRollModifier ⇐ ComparisonModifier
    • new ReRollModifier([once], [comparePoint])
    • .order : number
    • .name ⇒ string
    • .notation ⇒ string
    • .once ⇒ boolean
    • .once
    • .defaultComparePoint(_context) ⇒ array
    • .run(results, _context) ⇒ RollResults
    • .toJSON() ⇒ Object

new ReRollModifier([once], [comparePoint])

Create a ReRollModifier instance.

ParamTypeDefaultDescription
[once]booleanfalseWhether to only re-roll once or not
[comparePoint]ComparePointThe comparison object

reRollModifier.order : number

The default modifier execution order.

Kind: instance property of ReRollModifier

reRollModifier.name ⇒ string

The name of the modifier.

Kind: instance property of ReRollModifier
Returns: string - 're-roll'

reRollModifier.notation ⇒ string

The modifier's notation.

Kind: instance property of ReRollModifier

reRollModifier.once ⇒ boolean

Whether the modifier should only re-roll once or not.

Kind: instance property of ReRollModifier
Returns: boolean - true if it should re-roll once, false otherwise

reRollModifier.once

Set whether the modifier should only re-roll once or not.

Kind: instance property of ReRollModifier

ParamType
valueboolean

reRollModifier.defaultComparePoint(_context) ⇒ array

The default compare point definition

Kind: instance method of ReRollModifier

ParamTypeDescription
_contextStandardDice | RollGroupThe object that the modifier is attached to

reRollModifier.run(results, _context) ⇒ RollResults

Run the modifier on the results.

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

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

reRollModifier.toJSON() ⇒ Object

Return an object for JSON serialising.

This is called automatically when JSON encoding the object.

Kind: instance method of ReRollModifier

Edit this page
Last Updated: 07/02/2026, 21:45
Prev
Modifier
Next
SortingModifier