Options
All
  • Public
  • Public/Protected
  • All
Menu

The client-side ActiveEffect document which extends the common BaseActiveEffect model. Each ActiveEffect belongs to the effects collection of its parent Document. Each ActiveEffect contains a ActiveEffectData object which provides its source data.

mixes

ClientDocumentMixin

see

{@link documents.Actor} The Actor document which contains ActiveEffect embedded documents

see

{@link documents.Item} The Item document which contains ActiveEffect embedded documents

Hierarchy

  • any
    • ActiveEffect

Index

Constructors

  • Returns ActiveEffect

Properties

_sourceName: string = null

A cached reference to the source name to avoid recurring database lookups

_statusId: string = null

Does this ActiveEffect correspond to a significant status effect ID?

Accessors

  • get isSuppressed(): boolean
  • Is there some system logic that makes this active effect ineligible for application?

    Returns boolean

  • get modifiesActor(): boolean
  • Does this Active Effect currently modify an Actor?

    Returns boolean

  • get isTemporary(): boolean
  • Describe whether the ActiveEffect has a temporary duration based on combat turns or rounds.

    Returns boolean

  • get sourceName(): string
  • A cached property for obtaining the source name

    Returns string

Methods

  • prepareDerivedData(): void
  • inheritdoc

    Returns void

  • _prepareDuration(): any
  • Prepare derived data related to active effect duration

    internal

    Returns any

  • apply(actor: Actor, change: EffectChangeData): any
  • Apply this ActiveEffect to a provided Actor. TODO: This method is poorly conceived. Its functionality is static, applying a provided change to an Actor TODO: When we revisit this in Active Effects V2 this should become an Actor method, or a static method

    Parameters

    • actor: Actor

      The Actor to whom this effect should be applied

    • change: EffectChangeData

      The change data being applied

    Returns any

    The resulting applied value

  • _getSourceName(): Promise<any>
  • Get the name of the source of the Active Effect

    Returns Promise<any>

  • _preCreate(data: any, options: any, user: any): Promise<void>
  • inheritdoc

    Parameters

    • data: any
    • options: any
    • user: any

    Returns Promise<void>

  • _onCreate(data: any, options: any, userId: any): void
  • inheritdoc

    Parameters

    • data: any
    • options: any
    • userId: any

    Returns void

  • _onUpdate(data: any, options: any, userId: any): void
  • inheritdoc

    Parameters

    • data: any
    • options: any
    • userId: any

    Returns void

  • _onDelete(options: any, userId: any): void
  • inheritdoc

    Parameters

    • options: any
    • userId: any

    Returns void

  • _getCombatTime(round: number, turn: number, nTurns: number): number
  • Format a round+turn combination as a decimal

    Parameters

    • round: number

      The round number

    • turn: number

      The turn number

    • nTurns: number

    Returns number

    The decimal representation

  • _getDurationLabel(rounds: number, turns: number): string
  • Format a number of rounds and turns into a human-readable duration label

    Parameters

    • rounds: number

      The number of rounds

    • turns: number

      The number of turns

    Returns string

    The formatted label

  • _castDelta(raw: string, type: string): any
  • Cast a raw EffectChangeData change string to the desired data type.

    Parameters

    • raw: string

      The raw string value

    • type: string

      The target data type that the raw value should be cast to match

    Returns any

    The parsed delta cast to the target data type

  • _castArray(raw: string, type: string): any[]
  • Cast a raw EffectChangeData change string to an Array of an inner type.

    Parameters

    • raw: string

      The raw string value

    • type: string

      The target data type of inner array elements

    Returns any[]

    The parsed delta cast as a typed array

  • _parseOrString(raw: string): any
  • Parse serialized JSON, or retain the raw string.

    Parameters

    • raw: string

      A raw serialized string

    Returns any

    The parsed value, or the original value if parsing failed

  • _applyAdd(actor: Actor, change: EffectChangeData, current: any, delta: any, changes: any): void
  • Apply an ActiveEffect that uses an ADD application mode. The way that effects are added depends on the data type of the current value.

    If the current value is null, the change value is assigned directly. If the current type is a string, the change value is concatenated. If the current type is a number, the change value is cast to numeric and added. If the current type is an array, the change value is appended to the existing array if it matches in type.

    Parameters

    • actor: Actor

      The Actor to whom this effect should be applied

    • change: EffectChangeData

      The change data being applied

    • current: any

      The current value being modified

    • delta: any

      The parsed value of the change object

    • changes: any

      An object which accumulates changes to be applied

    Returns void

  • _applyMultiply(actor: Actor, change: EffectChangeData, current: any, delta: any, changes: any): void
  • Apply an ActiveEffect that uses a MULTIPLY application mode. Changes which MULTIPLY must be numeric to allow for multiplication.

    Parameters

    • actor: Actor

      The Actor to whom this effect should be applied

    • change: EffectChangeData

      The change data being applied

    • current: any

      The current value being modified

    • delta: any

      The parsed value of the change object

    • changes: any

      An object which accumulates changes to be applied

    Returns void

  • _applyOverride(actor: Actor, change: EffectChangeData, current: any, delta: any, changes: any): any
  • Apply an ActiveEffect that uses an OVERRIDE application mode. Numeric data is overridden by numbers, while other data types are overridden by any value

    Parameters

    • actor: Actor

      The Actor to whom this effect should be applied

    • change: EffectChangeData

      The change data being applied

    • current: any

      The current value being modified

    • delta: any

      The parsed value of the change object

    • changes: any

      An object which accumulates changes to be applied

    Returns any

  • _applyUpgrade(actor: Actor, change: EffectChangeData, current: any, delta: any, changes: any): void
  • Apply an ActiveEffect that uses an UPGRADE, or DOWNGRADE application mode. Changes which UPGRADE or DOWNGRADE must be numeric to allow for comparison.

    Parameters

    • actor: Actor

      The Actor to whom this effect should be applied

    • change: EffectChangeData

      The change data being applied

    • current: any

      The current value being modified

    • delta: any

      The parsed value of the change object

    • changes: any

      An object which accumulates changes to be applied

    Returns void

  • _applyCustom(actor: Actor, change: EffectChangeData, current: any, delta: any, changes: any): void
  • Apply an ActiveEffect that uses a CUSTOM application mode.

    Parameters

    • actor: Actor

      The Actor to whom this effect should be applied

    • change: EffectChangeData

      The change data being applied

    • current: any

      The current value being modified

    • delta: any

      The parsed value of the change object

    • changes: any

      An object which accumulates changes to be applied

    Returns void

  • #dispatchTokenStatusChange(statusId: string, active: boolean): void
  • Dispatch changes to a significant status effect to active Tokens on the Scene.

    Parameters

    • statusId: string

      The status effect ID being applied, from CONFIG.specialStatusEffects

    • active: boolean

      Is the special status effect now active?

    Returns void

  • _displayScrollingStatus(enabled: boolean): void
  • Display changes to active effects as scrolling Token status text.

    Parameters

    • enabled: boolean

      Is the active effect currently enabled?

    Returns void