functions: {
    and: ((...args) => 0 | 1);
    eq: ((a, b) => 0 | 1);
    gt: ((a, b) => 0 | 1);
    gte: ((a, b) => 0 | 1);
    if: ((condition, ifTrue) => any);
    ifelse: ((condition, ifTrue, ifFalse) => any);
    lookup: ((condition, fallback, ...results) => any);
    lt: ((a, b) => 0 | 1);
    lte: ((a, b) => 0 | 1);
    ne: ((a, b) => 0 | 1);
    not: ((a) => boolean);
    or: ((...args) => 0 | 1);
    sizeReach: ((size?, reach?, stature?) => NumericTerm[]);
    sizeRoll: ((count, sides, target, initial) => number);
    xor: ((...args) => 0 | 1);
} = ...

Roll functions

Type declaration

  • and: ((...args) => 0 | 1)
      • (...args): 0 | 1
      • Parameters

        • Rest ...args: any[]

        Returns 0 | 1

  • eq: ((a, b) => 0 | 1)
      • (a, b): 0 | 1
      • Parameters

        • a: any
        • b: any

        Returns 0 | 1

  • gt: ((a, b) => 0 | 1)
      • (a, b): 0 | 1
      • Parameters

        • a: any
        • b: any

        Returns 0 | 1

  • gte: ((a, b) => 0 | 1)
      • (a, b): 0 | 1
      • Parameters

        • a: any
        • b: any

        Returns 0 | 1

  • if: ((condition, ifTrue) => any)
      • (condition, ifTrue): any
      • if roll function

        Alias for ifelse()

        Parameters

        • condition: any
        • ifTrue: any

        Returns any

  • ifelse: ((condition, ifTrue, ifFalse) => any)
      • (condition, ifTrue, ifFalse): any
      • if-else roll function

        ifelse(condition, if-true, if-else)

        Parameters

        • condition: any
        • ifTrue: any
        • ifFalse: any

        Returns any

        Example

        ifelse(@powerAttackPenalty, 4, 0)
        
  • lookup: ((condition, fallback, ...results) => any)
      • (condition, fallback, ...results): any
      • lookup roll function

        lookup(condition, fallback, ...results)

        Parameters

        • condition: number
        • fallback: number
        • Rest ...results: any[]

        Returns any

        Example

        lookup(1d4, 0, 4, 3, 2, 1)
        lookup(@cl, 0, 3, 2, 1)
        
  • lt: ((a, b) => 0 | 1)
      • (a, b): 0 | 1
      • Parameters

        • a: any
        • b: any

        Returns 0 | 1

  • lte: ((a, b) => 0 | 1)
      • (a, b): 0 | 1
      • Parameters

        • a: any
        • b: any

        Returns 0 | 1

  • ne: ((a, b) => 0 | 1)
      • (a, b): 0 | 1
      • Parameters

        • a: any
        • b: any

        Returns 0 | 1

  • not: ((a) => boolean)
      • (a): boolean
      • Parameters

        • a: any

        Returns boolean

  • or: ((...args) => 0 | 1)
      • (...args): 0 | 1
      • Parameters

        • Rest ...args: any[]

        Returns 0 | 1

  • sizeReach: ((size?, reach?, stature?) => NumericTerm[])
      • (size?, reach?, stature?): NumericTerm[]
      • Return reach information for defined size and stature.

        Parameters

        • Optional size: string | number = "M"

          PF1.sizeChart key or offset

        • Optional reach: boolean = false

          Reach weapon

        • Optional stature: "tall" | "long" = "tall"

          Character stature

        Returns NumericTerm[]

  • sizeRoll: ((count, sides, target, initial) => number)
      • (count, sides, target, initial): number
      • Internal

        For use with roll formulas.

        Parameters

        • count: number

          Number of dice

        • sides: number

          Number of sides

        • target: string | number

          Target size

        • initial: string | number

          Initial size

        Returns number

  • xor: ((...args) => 0 | 1)
      • (...args): 0 | 1
      • Parameters

        • Rest ...args: any[]

        Returns 0 | 1

Example

eq(a,b) // equal (a === b)
ne(a,b) // not equal (a !== b)
lt(a,b) // less than (a < b)
lte(a,b) // less than or equal (a <= b)
gt(a,b) // greater than (a > b)
gte(a,b) // greater than or equal (a >= b)
and(a, b, ...) // all true
or(a, b, ...) // some true
xor(a, b, ...) // one true
not(a) // not (!a)

Generated using TypeDoc