Base item

From which all other item documents inherit from.

Hierarchy (view full)

Constructors

  • Parameters

    • Rest...args: [data?: ItemDataConstructorData, context?: Context<ActorPF>]

    Returns ItemBasePF

Accessors

  • get isActive(): boolean
  • Is the item is fully functional.

    This returns composite result of if the item is equipped, has quantity, is not disabled, is not out of charges, etc. and is not representative if the item can be set active or not via setActive.

    Returns boolean

Methods

  • Item name

    Parameters

    • OptionalforcePlayerPerspective: boolean = false

      If true, return value players see.

    Returns string

    • Item name
  • Set item's active state.

    Parameters

    • active: boolean

      Active state

    • Optionalcontext: object

      Optional update context

    Returns Promise<ItemBasePF>

    • Update promise if item type supports the operation.
    • If item does not support the operation.
  • Internal

    Collect Data on supplements

    Parameters

    • items: Item[]

      Array of items to draw supplemental data from

    • actor: Actor

      Owner

    Returns Promise<void>

  • On-Create Operation

    Post-create processing so awaiting the original operation has all secondary updates completed when it returns.

    Parameters

    • documents: Document[]

      Documents

    • operation: any

      Operations and context data

    • user: User

      Triggering user

    Returns Promise<void>

  • On-Delete Operation

    Post-delete processing so awaiting the original operation has all secondary updates completed when it returns.

    Parameters

    • documents: Document[]

      Documents

    • operation: any

      Operations and context data

    • user: User

      Triggering user

    Returns Promise<void>

  • On-Update Operation

    Post-update processing so awaiting the original operation has all secondary updates completed when it returns.

    Parameters

    • documents: Document[]

      Documents

    • operation: any

      Operations and context data

    • user: User

      Triggering user

    Returns Promise<void>

  • Item create dialog.

    Parameters

    • data: object = {}

      Initial form data

    • Optionalcontext: {
          options: undefined | object;
          pack: undefined | null | string;
          parent: undefined | null | Actor;
          types: undefined | string[];
      } = {}

      Additional options.

      • options: undefined | object

        Dialog context options.

      • pack: undefined | null | string

        Pack ID parameter passed to Item.create() options

      • parent: undefined | null | Actor

        Parent parameter passed to Item.create() options

      • types: undefined | string[]

        Item types to limit creation choices to.

    Returns Promise<null | Item>

    Synchronized with Foundry VTT v12.331

  • Override to provide naming by subType potential.

    Parameters

    • context: {
          pack: undefined | null | string;
          parent: undefined | null | Document;
          type: undefined | string;
      } = {}

      Context where the name would be used

      • pack: undefined | null | string

        Pack this would be within

      • parent: undefined | null | Document

        Parent document

      • type: undefined | string

        Type

    Returns string

    Synced with Foundry v12.331