Challenge Rating helper functions.

Constructors

  • Returns CR

Methods

  • Convert number to string representation.

    Parameters

    • value: number = 0

    Returns string

  • Parse CR string to produce a numeric representation

    Parses 1/8, 1/6, 1/4, 1/3, and 1/2 as exact decimals. Everything else is treated as regular number string and passed through parseFloat().

    Parameters

    • value: string

    Returns number

  • Return the amount of experience granted by killing a creature of a certain CR.

    Parameters

    • cr: number

      The creature's challenge rating

    Returns null | number

    • The amount of experience granted per kill. Or null if the CR was invalid.