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

Roll functions

Type declaration

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

        • Rest...args: any[]

        Returns 0 | 1

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

        • a: any
        • b: any

        Returns 0 | 1

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

        • a: any
        • b: any

        Returns 0 | 1

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

        • a: any
        • b: any

        Returns 0 | 1

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

        Alias for ifelse()

        Parameters

        • condition: any
        • ifTrue: any

        Returns any

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

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

        Parameters

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

        Returns any

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

        lookup(condition, fallback, ...results)

        Parameters

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

        Returns any

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

        • a: any
        • b: any

        Returns 0 | 1

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

        • a: any
        • b: any

        Returns 0 | 1

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

        • a: any
        • b: any

        Returns 0 | 1

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

        • a: any

        Returns boolean

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

        • Rest...args: any[]

        Returns 0 | 1

  • sizeReach: ((size??: string | number, reach??: boolean, stature??: "tall" | "long") => NumericTerm[])
      • (size?, reach?, stature?): NumericTerm[]
      • Return reach information for defined size and stature.

        Parameters

        • Optionalsize: string | number = "M"

          PF1.sizeChart key or offset

        • Optionalreach: boolean = false

          Reach weapon

        • Optionalstature: "tall" | "long" = "tall"

          Character stature

        Returns NumericTerm[]

  • sizeRoll: ((count: number, sides: number, target: string | number, initial: string | number) => 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: any[]) => 0 | 1)
      • (...args): 0 | 1
      • Parameters

        • Rest...args: any[]

        Returns 0 | 1

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)