Pathfinder 1e for Foundry VTT
    Preparing search index...

    Class CurrencyTransfer

    Hierarchy

    • FormApplication
      • CurrencyTransfer
    Index

    Constructors

    • Parameters

      • source: { actor: null; alt: boolean; amount: {}; container: null } = ...
      • dest: { actor: null; alt: boolean; amount: {}; container: null } = ...
      • options: {} = {}

      Returns CurrencyTransfer

    Properties

    dest: undefined | { actor: null; alt: boolean; amount: {}; container: null }
    source: undefined | { actor: null; alt: boolean; amount: {}; container: null }

    Accessors

    • get title(): string

      An Application window should define its own title definition logic which may be dynamic depending on its data

      Returns string

    • get defaultOptions(): InsertKeys<
          {},
          {
              classes: readonly ["pf1", "currency-transfer"];
              height: 235;
              template: "systems/pf1/templates/apps/currency-transfer.hbs";
              width: 380;
          },
      >

      Assign the default options which are supported by the entity edit sheet.

      Returns InsertKeys<
          {},
          {
              classes: readonly ["pf1", "currency-transfer"];
              height: 235;
              template: "systems/pf1/templates/apps/currency-transfer.hbs";
              width: 380;
          },
      >

      The default options for this FormApplication class

      Application.defaultOptions

      foundry.utils.mergeObject(super.defaultOptions, {
      classes: ["form"],
      closeOnSubmit: true,
      editable: true,
      sheetConfig: false,
      submitOnChange: false,
      submitOnClose: false
      });

    Methods

    • This method is called upon form submission after form data is validated

      Parameters

      • event: any

        The initial triggering submission event

      • formData: any

        The object of validated form data with which to update the object

      Returns void

      A Promise which resolves once the update operation has completed

    • Parameters

      • _options: {} = {}

      Returns {
          dest:
              | undefined
              | { actor: null; alt: boolean; amount: {}; container: null };
          options: Options;
          source:
              | undefined
              | { actor: null; alt: boolean; amount: {}; container: null };
          title: string;
          total: any;
      }

    • Convert totalAmount to a currency object containing

      Parameters

      • limit: object

        currency object containing max number of coins. Falsey values will assume infinity

      • totalAmount: number | object

        currency as gold pieces. If provided as a currency object, will convert to gold

      Returns boolean | object

      false if failed, currency object containing new amounts on conversion success

    • Transfer an amount of currency to a valid document

      Parameters

      • sourceDoc: Document

        ActorPF or ItemPF with currency

      • destDoc: Document

        ActorPF or ItemPF with currency

      • amount: number | object

        currency object containing transferred amount. Undefined keys will be assumed to be zero. Providing just a number will assume just gold

      • sourceAlt: boolean = false

        Use alt currency on source

      • destAlt: boolean = false

        Use alt currency on destination

      • OptionalallowConversion: number = false

        Attempts to make change with sourceDoc's currency limit

      Returns Promise<boolean | object>

      false if failed, object containing amount transferred on success