Options
All
  • Public
  • Public/Protected
  • All
Menu

Class TokenEffects

A immutable mapping of token effects.

Hierarchy

  • TokenEffects

Index

Constructors

constructor

Methods

getEffect

getTokenModifier

  • getTokenModifier(token: Token): number
  • Get the modifier value of the specified token for this bag.

    method

    getTokenModifier

    throws

    {TypeError} if the specified token is an autosuccess or an autofail.

    Parameters

    • token: Token

      The token.

    Returns number

    The modifier value.

isSuccess

  • isSuccess(tokens: Token[], skillMinusDifficulty: number): boolean
  • Return wether or not pulling these tokens result in a success given the difference between to total skill value and the test difficulty. If several tokens are provided and none of them are autosuccess or autofails, their modifier values are added.

    method

    isSuccess

    Parameters

    • tokens: Token[]

      The tokens pulled from the bag.

    • skillMinusDifficulty: number

      The difference between the total skill value and the difficulty fo the test.

    Returns boolean

isTokenAutoFail

  • isTokenAutoFail(token: Token): boolean
  • Indicate of the specified token is autofail for this bag.

    method

    isTokenAutoFail

    Parameters

    • token: Token

      The token.

    Returns boolean

    true if the token is autofail, false otherwise.

isTokenAutoSuccess

  • isTokenAutoSuccess(token: Token): boolean
  • Indicate of the specified token is autosuccess for this bag.

    method

    isTokenAutoSuccess

    Parameters

    • token: Token

      The token.

    Returns boolean

    true if the token is autosuccess, false otherwise.

merge

separateRedrawTokens

  • separateRedrawTokens(tokens: Token[]): object
  • Separate redraw tokens from non-redraw tokens in the supplied array of tokens.

    Parameters

    • tokens: Token[]

      The tokens to separate.

    Returns object

    An object with redrawTokens containing the redraw tokens and nonRedrawTokens containing non-redraw tokens.

setEffect

  • Sets the effect for the specified token and returns a new mapping (the original mapping is untouched).

    Parameters

    Returns TokenEffects

    The whole mapping.

setEffects

sortByBestOutcomeDesc

  • Sort provided tokens from best outcome to worse.

    method

    sortByBestOutcomeDesc

    Parameters

    • tokens: Token[]

      The tokens to sort.

    Returns Token[]

    Sorted tokens.

Generated using TypeDoc