The singleton registry of condition types. At runtime this registry is accessible as pf1.registry.conditions.

Hierarchy (View Summary)

Constructors

Properties

model: Condition

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

_defaultData: (
    | {
        _id: string;
        hud: { exclude: readonly ["haunt", "trap", "vehicle"] };
        journal: string;
        mechanics?: undefined;
        name: string;
        showInAction: boolean;
        showInBuffsTab?: undefined;
        showInDefense: boolean;
        texture: string;
        track?: undefined;
    }
    | {
        _id: string;
        hud: { exclude: readonly ["haunt", "trap", "vehicle"] };
        journal: string;
        mechanics: {
            changes: { formula: number; target: string; type: string }[];
            contexts: string[];
            flags: string[];
        };
        name: string;
        showInAction?: undefined;
        showInBuffsTab?: undefined;
        showInDefense?: undefined;
        texture: string;
        track?: undefined;
    }
    | {
        _id: string;
        hud: { exclude: readonly ["haunt", "trap", "vehicle"] };
        journal: string;
        mechanics?: undefined;
        name: string;
        showInAction?: undefined;
        showInBuffsTab?: undefined;
        showInDefense: boolean;
        texture: string;
        track?: undefined;
    }
    | {
        _id: string;
        hud: { exclude: readonly ["haunt", "trap", "vehicle"] };
        journal: string;
        mechanics?: undefined;
        name: string;
        showInAction: boolean;
        showInBuffsTab?: undefined;
        showInDefense?: undefined;
        texture: string;
        track?: undefined;
    }
    | {
        _id: string;
        hud: { exclude: readonly ["haunt", "trap", "vehicle"] };
        journal: string;
        mechanics: {
            changes: { formula: number; target: string; type: string }[];
            contexts: string[];
            flags?: undefined;
        };
        name: string;
        showInAction: boolean;
        showInBuffsTab?: undefined;
        showInDefense: boolean;
        texture: string;
        track?: undefined;
    }
    | {
        _id: string;
        hud?: undefined;
        journal: string;
        mechanics?: undefined;
        name: string;
        showInAction?: undefined;
        showInBuffsTab: boolean;
        showInDefense?: undefined;
        texture: string;
        track: string;
    }
    | {
        _id: string;
        hud: { exclude: readonly ["haunt", "trap", "vehicle"] };
        journal: string;
        mechanics: {
            changes: { formula: number; target: string; type: string }[];
            contexts: string[];
            flags?: undefined;
        };
        name: string;
        showInAction: boolean;
        showInBuffsTab?: undefined;
        showInDefense?: undefined;
        texture: string;
        track?: undefined;
    }
    | {
        _id: string;
        hud?: undefined;
        journal: string;
        mechanics?: undefined;
        name: string;
        showInAction?: undefined;
        showInBuffsTab?: undefined;
        showInDefense: boolean;
        texture: string;
        track: string;
    }
    | {
        _id: string;
        hud: { exclude: readonly ["haunt", "trap", "vehicle"] };
        journal: string;
        mechanics: {
            changes: {
                continuous: true;
                formula: 0;
                operator: "set";
                priority: 1001;
                target: string;
                type: "untypedPerm";
            }[];
            contexts?: undefined;
            flags: string[];
        };
        name: string;
        showInAction?: undefined;
        showInBuffsTab?: undefined;
        showInDefense: boolean;
        texture: string;
        track: string;
    }
    | {
        _id: string;
        hud?: undefined;
        journal: string;
        mechanics: {
            changes: { formula: number; target: string; type: string }[];
            contexts?: undefined;
            flags?: undefined;
        };
        name: string;
        showInAction?: undefined;
        showInBuffsTab?: undefined;
        showInDefense?: undefined;
        texture: string;
        track?: undefined;
    }
    | {
        _id: string;
        hud: { exclude: readonly ["haunt", "trap", "vehicle"] };
        journal: string;
        mechanics: {
            changes: { formula: number; target: string; type: string }[];
            contexts?: undefined;
            flags?: undefined;
        };
        name: string;
        showInAction?: undefined;
        showInBuffsTab?: undefined;
        showInDefense: boolean;
        texture: string;
        track: string;
    }
    | {
        _id: string;
        hud: { exclude: readonly ["haunt", "trap", "vehicle"] };
        journal: string;
        mechanics: { changes?: undefined; contexts?: undefined; flags: string[] };
        name: string;
        showInAction: boolean;
        showInBuffsTab?: undefined;
        showInDefense?: undefined;
        texture: string;
        track?: undefined;
    }
    | {
        _id: string;
        hud: { exclude: readonly ["haunt", "trap", "vehicle"] };
        journal: string;
        mechanics: {
            changes: { formula: number; target: string; type: string }[];
            contexts?: undefined;
            flags?: undefined;
        };
        name: string;
        showInAction: boolean;
        showInBuffsTab?: undefined;
        showInDefense?: undefined;
        texture: string;
        track: string;
    }
    | {
        _id: string;
        hud: { exclude: readonly ["haunt", "trap", "vehicle"] };
        journal: string;
        mechanics: {
            changes: { formula: number; target: string; type: string }[];
            contexts?: undefined;
            flags?: undefined;
        };
        name: string;
        showInAction?: undefined;
        showInBuffsTab?: undefined;
        showInDefense?: undefined;
        texture: string;
        track?: undefined;
    }
    | {
        _id: string;
        hud: { exclude: readonly ["haunt", "trap", "vehicle"] };
        journal: string;
        mechanics: {
            changes: {
                continuous: true;
                formula: 0;
                operator: "set";
                priority: 1001;
                target: string;
                type: "untypedPerm";
            }[];
            contexts?: undefined;
            flags: string[];
        };
        name: string;
        showInAction: boolean;
        showInBuffsTab?: undefined;
        showInDefense?: undefined;
        texture: string;
        track?: undefined;
    }
    | {
        _id: string;
        hud?: undefined;
        journal: string;
        mechanics: {
            changes: (
                | {
                    formula: number;
                    operator: string;
                    priority: number;
                    target: string;
                    type: string;
                }
                | {
                    formula: string;
                    operator: string;
                    priority?: undefined;
                    target: string;
                    type: string;
                }
            )[];
            contexts?: undefined;
            flags?: undefined;
        };
        name: string;
        showInAction: boolean;
        showInBuffsTab?: undefined;
        showInDefense: boolean;
        texture: string;
        track?: undefined;
    }
    | {
        _id: string;
        hud?: undefined;
        journal: string;
        mechanics?: undefined;
        name: string;
        showInAction?: undefined;
        showInBuffsTab?: undefined;
        showInDefense: boolean;
        texture: string;
        track?: undefined;
    }
    | {
        _id: string;
        hud: { exclude: readonly ["haunt", "trap", "vehicle"] };
        journal: string;
        mechanics?: undefined;
        name: string;
        showInAction?: undefined;
        showInBuffsTab?: undefined;
        showInDefense?: undefined;
        texture: string;
        track?: undefined;
    }
    | {
        _id: string;
        hud: { exclude: readonly ["haunt", "trap", "vehicle"] };
        journal: string;
        mechanics: {
            changes: { formula: number; target: string; type: string }[];
            contexts?: undefined;
            flags?: undefined;
        };
        name: string;
        showInAction?: undefined;
        showInBuffsTab?: undefined;
        showInDefense?: undefined;
        texture: string;
        track: string;
    }
    | {
        _id: string;
        hud?: undefined;
        journal: string;
        mechanics: {
            changes: {
                continuous: true;
                formula: 0;
                operator: "set";
                priority: 1001;
                target: string;
                type: "untypedPerm";
            }[];
            contexts?: undefined;
            flags: string[];
        };
        name: string;
        showInAction: boolean;
        showInBuffsTab?: undefined;
        showInDefense: boolean;
        texture: string;
        track?: undefined;
    }
    | {
        _id: string;
        hud: { exclude: readonly ["haunt", "trap", "vehicle"] };
        journal: string;
        mechanics: {
            changes: (
                | {
                    continuous: boolean;
                    formula: string;
                    operator: string;
                    priority: number;
                    target: string;
                    type: string;
                }
                | {
                    continuous?: undefined;
                    formula: number;
                    operator?: undefined;
                    priority?: undefined;
                    target: string;
                    type: string;
                }
            )[];
            contexts?: undefined;
            flags: string[];
        };
        name: string;
        showInAction: boolean;
        showInBuffsTab?: undefined;
        showInDefense?: undefined;
        texture: string;
        track?: undefined;
    }
    | {
        _id: string;
        hud: { exclude: readonly ["haunt", "trap", "vehicle"] };
        journal: string;
        mechanics: {
            changes: { formula: number; target: string; type: string }[];
            contexts?: undefined;
            flags?: undefined;
        };
        name: string;
        showInAction: boolean;
        showInBuffsTab?: undefined;
        showInDefense: boolean;
        texture: string;
        track: string;
    }
    | {
        _id: string;
        hud: { exclude: readonly ["haunt", "trap", "vehicle"] };
        journal: string;
        mechanics: {
            changes: { formula: number; target: string; type: string }[];
            contexts?: undefined;
            flags?: undefined;
        };
        name: string;
        showInAction: boolean;
        showInBuffsTab?: undefined;
        showInDefense: boolean;
        texture: string;
        track?: undefined;
    }
    | {
        _id: string;
        hud: { exclude: readonly ["haunt", "trap", "vehicle"] };
        journal: null;
        mechanics: {
            changes: {
                continuous: true;
                formula: 0;
                operator: "set";
                priority: 1001;
                target: string;
                type: "untypedPerm";
            }[];
            contexts?: undefined;
            flags: string[];
        };
        name: string;
        showInAction: boolean;
        showInBuffsTab?: undefined;
        showInDefense?: undefined;
        texture: string;
        track?: undefined;
    }
    | {
        _id: string;
        hud: { exclude: readonly ["haunt", "trap", "vehicle"] };
        journal: string;
        mechanics: {
            changes: {
                continuous: true;
                formula: 0;
                operator: "set";
                priority: 1001;
                target: string;
                type: "untypedPerm";
            }[];
            contexts?: undefined;
            flags: string[];
        };
        name: string;
        showInAction: boolean;
        showInBuffsTab?: undefined;
        showInDefense: boolean;
        texture: string;
        track: string;
    }
    | {
        _id: string;
        hud: { exclude: readonly ["haunt", "trap", "vehicle"] };
        journal: string;
        mechanics: {
            changes: {
                continuous: true;
                formula: 0;
                operator: "set";
                priority: 1001;
                target: string;
                type: "untypedPerm";
            }[];
            contexts?: undefined;
            flags: string[];
        };
        name: string;
        showInAction?: undefined;
        showInBuffsTab?: undefined;
        showInDefense?: undefined;
        texture: string;
        track?: undefined;
    }
    | {
        _id: string;
        hud?: undefined;
        journal?: undefined;
        mechanics?: undefined;
        name: string;
        showInAction?: undefined;
        showInBuffsTab?: undefined;
        showInDefense?: undefined;
        texture: string;
        track: string;
    }
)[] = ...

An array of data used to initialize this registry.

HUD_EXCLUDE_INANIMATE: { exclude: readonly ["haunt", "trap", "vehicle"] } = ...
model: typeof Condition = Condition

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

SET_TO_ZERO: {
    continuous: true;
    formula: 0;
    operator: "set";
    priority: 1001;
    type: "untypedPerm";
} = ...
TRACKS: readonly ["dying", "fear", "lethargy", "movement"] = ...

An array of allowed tracks of condition advancement.

Accessors

Methods

  • Get all conditions that have belong to a given track

    Parameters

    • track: string

      The given track to check for

    Returns string[]

    • An array of all conditions in the given track
  • Returns an object of the registry's contents, with the id as key and the name as value.

    Returns { [id: string]: string }

    The names of each value in the registry, by id

  • 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",
    });
  • 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