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

    Class DamageTypes

    The singleton registry of damage types.

    At runtime this registry is accessible as pf1.registry.damageTypes.

    Hierarchy (View Summary)

    Index

    Constructors

    Properties

    model: DamageType

    The class each of this registry's content is expected to be an instance of.

    _defaultData: readonly [
        {
            _id: "untyped";
            category: "misc";
            icon: "ra ra-uncertainty";
            name: "Untyped";
            resist: false;
        },
        {
            _id: "slashing";
            abbr: "S";
            category: "physical";
            color: "yellow";
            icon: "ra ra-sword";
            name: "Slashing";
        },
        {
            _id: "piercing";
            abbr: "P";
            category: "physical";
            color: "blue";
            icon: "ra ra-spear-head";
            name: "Piercing";
        },
        {
            _id: "bludgeoning";
            abbr: "B";
            category: "physical";
            color: "red";
            icon: "ra ra-large-hammer";
            name: "Bludgeoning";
        },
        {
            _id: "fire";
            abbr: "F";
            category: "energy";
            color: "orange";
            diceSoNice: { colorset: "fire"; texture: "fire" };
            icon: "ra ra-fire";
            name: "Fire";
        },
        {
            _id: "cold";
            abbr: "C";
            category: "energy";
            color: "aqua";
            diceSoNice: { colorset: "ice"; texture: "ice" };
            icon: "ra ra-frost-emblem";
            name: "Cold";
        },
        {
            _id: "electric";
            abbr: "E";
            category: "energy";
            color: "yellow";
            diceSoNice: { colorset: "lightning"; texture: "ice" };
            icon: "ra ra-lightning-bolt";
            name: "Electricity";
        },
        {
            _id: "acid";
            category: "energy";
            color: "lime";
            diceSoNice: { colorset: "acid"; texture: "marble" };
            icon: "ra ra-acid";
            name: "Acid";
        },
        {
            _id: "sonic";
            category: "energy";
            color: "#00aedb";
            diceSoNice: { colorset: "astralsea"; texture: "astral" };
            icon: "ra ra-horn-call";
            name: "Sonic";
        },
        {
            _id: "force";
            category: "misc";
            color: "#a200ff";
            diceSoNice: { colorset: "force"; texture: "stars" };
            icon: "ra ra-doubled";
            name: "Force";
        },
        {
            _id: "negative";
            category: "misc";
            color: "#765898";
            diceSoNice: { colorset: "necrotic"; texture: "skulls" };
            icon: "ra ra-skull";
            name: "Negative";
        },
        {
            _id: "positive";
            category: "misc";
            color: "#f8ed62";
            diceSoNice: { colorset: "prism"; texture: "stainedglass" };
            icon: "ra ra-sunbeams";
            name: "Positive";
        },
        {
            _id: "precision";
            icon: "ra ra-archery-target";
            isModifier: true;
            name: "Precision";
        },
        {
            _id: "nonlethal";
            icon: "ra ra-hand";
            isModifier: true;
            name: "Nonlethal";
        },
        {
            _id: "areaOfEffect";
            icon: "ra ra-bomb-explosion";
            isModifier: true;
            name: "Area of Effect";
        },
    ] = ...

    An array of data used to initialize this registry.

    CATEGORIES: readonly ["physical", "energy", "misc"] = ...

    An array of allowed categories of damage types.

    model: typeof DamageType = DamageType

    The class each of this registry's content is expected to be an instance of.

    Accessors

    • get name(): string

      The name of the registry

      Returns string

    Methods

    • Returns an object of the registry's contents, with the id as key and the name as value.

      Parameters

      • Optionaloptions: { sort?: boolean } = {}

        Additional options

        • Optionalsort?: boolean

          Sort result

      Returns { [id: string]: string }

      The names of each value in the registry, by id

    • Protected

      Localize registry and all their entries.

      Called in i18nInit.

      Returns void

    • Registers a new instance of Model with the registry, using a partial of its data as the base.

      Parameters

      • namespace: string

        The namespace for which this value is registered.

      • id: string

        The unique key of the value.

      • value: object

        A Partial of the data to use as the base for the new value.

      Returns Registry<any>

      The registry itself, after the value has been registered.

      pf1.registry.damageTypes.register("my-module", "my-damage-type", {
      name: "My Damage Type",
      img: "icons/svg/damage.svg",
      category: "physical",
      });
    • Sets the value of a key in the registry.

      Parameters

      • id: string

        ID of the value to set.

      • content: DamageType

        The value to set.

      Returns Registry<any>

      The registry itself, after the value has been set.

    • Protected

      Post-registry initialization entry preparation

      Returns void

    • Returns the contents of this registry as object, using ids as keys.

      Parameters

      • Optionalsource: boolean = false

        Whether to include the source data instead of its prepared data for each value.

      Returns { [id: string]: object }

      The data of each value in the registry, by id

    • Unregisters a value from the registry, or if no id is provided, all values belonging to the namespace.

      Parameters

      • namespace: string

        The namespace for which this value is unregistered.

      • Optionalid: string

        The unique key of the value, or undefined to unregister all values belonging to the namespace.

      Returns void