Options
All
  • Public
  • Public/Protected
  • All
Menu

The client-side RollTable document which extends the common BaseRollTable model.

mixes

ClientDocumentMixin

see

RollTables The world-level collection of RollTable documents

see

TableResult The embedded TableResult document

see

RollTableConfig The RollTable configuration application

Hierarchy

  • any
    • RollTable

Index

Constructors

  • Returns RollTable

Accessors

  • get thumbnail(): string
  • Provide a thumbnail image path used to represent this document.

    Returns string

Methods

  • toMessage(results: TableResult[], [options={}]?: { roll: Roll; messageData: any; messageOptions: any }): Promise<any>
  • Display a result drawn from a RollTable in the Chat Log along. Optionally also display the Roll which produced the result and configure aspects of the displayed messages.

    Parameters

    • results: TableResult[]

      An Array of one or more TableResult Documents which were drawn and should be displayed.

    • [options={}]: { roll: Roll; messageData: any; messageOptions: any } = {}

      Additional options which modify message creation

      • roll: Roll
      • messageData: any
      • messageOptions: any

    Returns Promise<any>

  • draw([options={}]?: { roll: Roll; recursive: boolean; results: TableResult[]; displayChat: boolean; rollMode: string }): Promise<{ RollTableDraw: any }>
  • Draw a result from the RollTable based on the table formula or a provided Roll instance

    Parameters

    • [options={}]: { roll: Roll; recursive: boolean; results: TableResult[]; displayChat: boolean; rollMode: string } = {}

      Optional arguments which customize the draw behavior

      • roll: Roll
      • recursive: boolean
      • results: TableResult[]
      • displayChat: boolean
      • rollMode: string

    Returns Promise<{ RollTableDraw: any }>

    } A Promise which resolves to an object containing the executed roll and the produced results.

  • drawMany(number: number, [options={}]?: { roll: Roll; recursive: boolean; displayChat: boolean; rollMode: string }): Promise<{ RollTableDraw: any }>
  • Draw multiple results from a RollTable, constructing a final synthetic Roll as a dice pool of inner rolls.

    Parameters

    • number: number

      The number of results to draw

    • [options={}]: { roll: Roll; recursive: boolean; displayChat: boolean; rollMode: string } = {}

      Optional arguments which customize the draw

      • roll: Roll
      • recursive: boolean
      • displayChat: boolean
      • rollMode: string

    Returns Promise<{ RollTableDraw: any }>

    } The drawn results

  • Normalize the probabilities of rolling each item in the RollTable based on their assigned weights

    Returns Promise<RollTable>

  • Reset the state of the RollTable to return any drawn items to the table

    Returns Promise<RollTable>

  • roll([options={}]?: { roll: Roll; recursive: boolean; _depth: number }): Promise<RollTableDraw>
  • Evaluate a RollTable by rolling its formula and retrieving a drawn result.

    Note that this function only performs the roll and identifies the result, the RollTable#draw function should be called to formalize the draw from the table.

    example

    Draw results using the default table formula

    const defaultResults = await table.roll();
    
    example

    Draw results using a custom roll formula

    const roll = new Roll("1d20 + @abilities.wis.mod", actor.getRollData());
    const customResults = await table.roll({roll});

    Parameters

    • [options={}]: { roll: Roll; recursive: boolean; _depth: number } = {}

      Options which modify rolling behavior

      • roll: Roll
      • recursive: boolean
      • _depth: number

    Returns Promise<RollTableDraw>

    The Roll and results drawn by that Roll

  • Get an Array of valid results for a given rolled total

    Parameters

    • value: number

      The rolled value

    Returns TableResult[]

    An Array of results

  • _onCreateDescendantDocuments(parent: any, collection: any, documents: any, data: any, options: any, userId: any): void
  • inheritdoc

    Parameters

    • parent: any
    • collection: any
    • documents: any
    • data: any
    • options: any
    • userId: any

    Returns void

  • _onDeleteDescendantDocuments(parent: any, collection: any, documents: any, ids: any, options: any, userId: any): void
  • inheritdoc

    Parameters

    • parent: any
    • collection: any
    • documents: any
    • ids: any
    • options: any
    • userId: any

    Returns void

  • toCompendium(pack: any, options?: {}): any
  • override

    Parameters

    • pack: any
    • options: {} = {}

      Returns any

    • Create a new RollTable document using all of the Documents from a specific Folder as new results.

      Parameters

      • folder: Folder

        The Folder document from which to create a roll table

      • options: any = {}

        Additional options passed to the RollTable.create method

      Returns Promise<RollTable>