Skip to content

Commit

Permalink
feat: Set minimum and verified pf2e version to 6.8.0. Update types.
Browse files Browse the repository at this point in the history
  • Loading branch information
xdy committed Dec 20, 2024
1 parent 68ba5d7 commit 0cb2722
Show file tree
Hide file tree
Showing 206 changed files with 2,611 additions and 3,214 deletions.
777 changes: 402 additions & 375 deletions package-lock.json

Large diffs are not rendered by default.

10 changes: 5 additions & 5 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@
"@semantic-release/exec": "^6.0.3",
"@semantic-release/git": "^10.0.1",
"@semantic-release/github": "^11.0.1",
"@semantic-release/release-notes-generator": "^14.0.1",
"@semantic-release/release-notes-generator": "^14.0.2",
"@types/eslint__js": "^8.42.3",
"@types/fs-extra": "^11.0.4",
"@types/glob": "^8.1.0",
Expand All @@ -51,8 +51,8 @@
"@types/tooltipster": "^0.0.35",
"@types/uuid": "^10.0.0",
"@types/yaireo__tagify": "^4.27.0",
"@typescript-eslint/eslint-plugin": "^8.18.0",
"@typescript-eslint/parser": "^8.18.0",
"@typescript-eslint/eslint-plugin": "^8.18.1",
"@typescript-eslint/parser": "^8.18.1",
"classic-level": "^1.4.1",
"es-jest": "^2.1.0",
"eslint": "^9.17.0",
Expand Down Expand Up @@ -88,14 +88,14 @@
"yargs": "^17.7.2"
},
"dependencies": {
"@codemirror/autocomplete": "^6.18.3",
"@codemirror/autocomplete": "^6.18.4",
"@codemirror/lang-json": "^6.0.1",
"@yaireo/tagify": "^4.32.2",
"codemirror": "^6.0.1",
"luxon": "^3.5.0",
"minisearch": "^7.1.1",
"nouislider": "^15.8.1",
"remeda": "^2.17.4",
"remeda": "^2.18.0",
"sortablejs": "^1.15.6",
"uuid": "^11.0.3"
},
Expand Down
4 changes: 2 additions & 2 deletions static/module.json
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,8 @@
"type": "system",
"manifest": "https://github.com/foundryvtt/pf2e/releases/download/latest/system.json",
"compatibility": {
"minimum": "6.5.0",
"verified": "6.5.0"
"minimum": "6.8.0",
"verified": "6.8.0"
}
}
]
Expand Down
5 changes: 3 additions & 2 deletions types/build/lib/compendium-pack.d.ts
Original file line number Diff line number Diff line change
@@ -1,10 +1,11 @@
import type { ActorSourcePF2e } from "@actor/data/index.ts";
import { ItemSourcePF2e } from "@item/base/data/index.ts";
import { RuleElementSource } from "@module/rules/index.ts";
import type { ItemSourcePF2e } from "@item/base/data/index.ts";
import type { RuleElementSource } from "@module/rules/index.ts";
import "./foundry-utils.ts";
import { PackError } from "./helpers.ts";
import { DBFolder } from "./level-database.ts";
import { PackEntry } from "./types.ts";

interface PackMetadata {
system: string;
name: string;
Expand Down
46 changes: 41 additions & 5 deletions types/src/global.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,11 +8,20 @@ import type { ItemPF2e, PhysicalItemPF2e } from "@item";
import type { ConditionSource } from "@item/condition/data.ts";
import type { CoinsPF2e } from "@item/physical/helpers.ts";
import type { ActiveEffectPF2e } from "@module/active-effect.ts";
import type { CompendiumBrowser, CompendiumBrowserSettings, CompendiumBrowserSources } from "@module/apps/compendium-browser/index.ts";
import type {
CompendiumBrowser,
CompendiumBrowserSettings,
CompendiumBrowserSources,
} from "@module/apps/compendium-browser/browser.ts";
import type { EffectsPanel } from "@module/apps/effects-panel.ts";
import type { HotbarPF2e } from "@module/apps/hotbar.ts";
import type { LicenseViewer } from "@module/apps/license-viewer/app.ts";
import type { ActorDirectoryPF2e, ChatLogPF2e, CompendiumDirectoryPF2e, EncounterTrackerPF2e } from "@module/apps/sidebar/index.ts";
import type {
ActorDirectoryPF2e,
ChatLogPF2e,
CompendiumDirectoryPF2e,
EncounterTrackerPF2e,
} from "@module/apps/sidebar/index.ts";
import type { WorldClock } from "@module/apps/world-clock/app.ts";
import type { CanvasPF2e, EffectsCanvasGroupPF2e } from "@module/canvas/index.ts";
import type { StatusEffects } from "@module/canvas/status-effects.ts";
Expand All @@ -22,21 +31,45 @@ import type { CombatantPF2e, EncounterPF2e } from "@module/encounter/index.ts";
import type { MacroPF2e } from "@module/macro.ts";
import type { RuleElementPF2e, RuleElements } from "@module/rules/index.ts";
import type { UserPF2e } from "@module/user/index.ts";
import type { AmbientLightDocumentPF2e, MeasuredTemplateDocumentPF2e, RegionBehaviorPF2e, RegionDocumentPF2e, ScenePF2e, TileDocumentPF2e, TokenDocumentPF2e } from "@scene";
import type {
AmbientLightDocumentPF2e,
MeasuredTemplateDocumentPF2e,
RegionBehaviorPF2e,
RegionDocumentPF2e,
ScenePF2e,
TileDocumentPF2e,
TokenDocumentPF2e,
} from "@scene";
import type { ActorDeltaPF2e } from "@scene/token-document/actor-delta.ts";
import type { PF2ECONFIG, StatusEffectIconTheme } from "@scripts/config/index.ts";
import type { DicePF2e } from "@scripts/dice.ts";
import type { calculateXP, checkPrompt, editPersistent, launchTravelSheet, perceptionForSelected, rollActionMacro, rollItemMacro, stealthForSelected, xpFromEncounter } from "@scripts/macros/index.ts";
import type {
calculateXP,
checkPrompt,
editPersistent,
launchTravelSheet,
perceptionForSelected,
rollActionMacro,
rollItemMacro,
stealthForSelected,
xpFromEncounter,
} from "@scripts/macros/index.ts";
import type { remigrate } from "@scripts/system/remigrate.ts";
import type { CheckPF2e } from "@system/check/index.ts";
import type { ConditionManager } from "@system/conditions/manager.ts";
import type { EffectTracker } from "@system/effect-tracker.ts";
import type { ModuleArt } from "@system/module-art.ts";
import type { Predicate } from "@system/predication.ts";
import type { CustomDamageData, HomebrewTag, HomebrewTraitSettingsKey, LanguageSettings } from "@system/settings/homebrew/index.ts";
import type {
CustomDamageData,
HomebrewTag,
HomebrewTraitSettingsKey,
LanguageSettings,
} from "@system/settings/homebrew/index.ts";
import type { TextEditorPF2e } from "@system/text-editor.ts";
import type { sluggify } from "@util";
import type EnJSON from "static/lang/en.json";

interface GamePF2e extends Game<ActorPF2e<null>, ActorsPF2e<ActorPF2e<null>>, ChatMessagePF2e, EncounterPF2e, ItemPF2e<null>, MacroPF2e, ScenePF2e, UserPF2e> {
pf2e: {
actions: Record<string, Function> & Collection<Action>;
Expand Down Expand Up @@ -94,6 +127,8 @@ interface GamePF2e extends Game<ActorPF2e<null>, ActorsPF2e<ActorPF2e<null>>, Ch
sections: FeatGroupData[];
};
languages: LanguageSettings;
mythic: "disabled" | "enabled" | "variant-tiers";
type: string | null;
};
critFumble: {
buttons: boolean;
Expand Down Expand Up @@ -213,6 +248,7 @@ declare global {
get(module: "pf2e", setting: "campaignFeats"): boolean;
get(module: "pf2e", setting: "campaignFeatSections"): FeatGroupData[];
get(module: "pf2e", setting: "campaignType"): string;
get(module: "pf2e", setting: "mythic"): "disabled" | "enabled" | "variant-tiers";
get(module: "pf2e", setting: "activeParty"): string;
get(module: "pf2e", setting: "activePartyFolderState"): boolean;
get(module: "pf2e", setting: "createdFirstParty"): boolean;
Expand Down
191 changes: 103 additions & 88 deletions types/src/module/actor/army/data.d.ts
Original file line number Diff line number Diff line change
@@ -1,95 +1,110 @@
import {
ActorAttributes,
ActorAttributesSource,
ActorDetails,
ActorDetailsSource,
ActorHitPoints,
ActorSystemData,
ActorSystemSource,
ActorTraitsData,
ActorTraitsSource,
BaseActorSourcePF2e,
BaseHitPointsSource,
} from "@actor/data/base.ts";
import { ValueAndMax, ValueAndMaybeMax } from "@module/data.ts";
import { ActorSystemSource, BaseActorSourcePF2e } from "@actor/data/base.ts";
import { Immunity, ImmunitySource, Resistance, ResistanceSource, Weakness, WeaknessSource } from "@actor/data/iwr.ts";
import { ActorSystemModel, ActorSystemSchema } from "@actor/data/model.ts";
import { InitiativeTraceData } from "@actor/initiative.ts";
import { ActorAlliance } from "@actor/types.ts";
import { Rarity, ValueAndMax } from "@module/data.ts";
import { AutoChangeEntry } from "@module/rules/rule-element/ae-like.ts";
import { PerceptionTraceData } from "@system/statistic/perception.ts";
import { ARMY_TYPES } from "./values.ts";
import { ArmyPF2e } from "./document.ts";
import { ArmyType } from "./types.ts";
import fields = foundry.data.fields;

type ArmySource = BaseActorSourcePF2e<"army", ArmySystemSource>;
interface ArmySystemSource extends ActorSystemSource {
ac: ArmyArmorClass;
attributes: ArmyAttributesSource;
details: ArmyDetailsSource;
traits: ArmyTraitsSource;
consumption: number;
scouting: number;
recruitmentDC: number;
resources: ArmyResourcesSource;
saves: {
maneuver: number;
morale: number;
declare class ArmySystemData extends ActorSystemModel<ArmyPF2e, ArmySystemSchema> {
static defineSchema(): ArmySystemSchema;
}
interface ArmySystemData extends ActorSystemModel<ArmyPF2e, ArmySystemSchema>, ModelPropsFromSchema<ArmySystemSchema> {
attributes: ModelPropsFromSchema<ArmyAttributesSchema> & {
hp: {
max: number;
negativeHealing: boolean;
unrecoverable: number;
details: string;
};
immunities: Immunity[];
weaknesses: Weakness[];
resistances: Resistance[];
flanking: never;
};
weapons: {
ranged: ArmyWeaponData | null;
melee: ArmyWeaponData | null;
initiative: InitiativeTraceData;
details: ModelPropsFromSchema<ArmyDetailsSchema> & {
alliance: ActorAlliance;
};
}
interface ArmyWeaponData {
name: string;
potency: number;
}
interface ArmyArmorClass {
value: number;
potency: number;
}
interface ArmyTraitsSource extends Required<ActorTraitsSource<string>> {
languages?: never;
type: (typeof ARMY_TYPES)[number];
}
interface ArmyDetailsSource extends Required<ActorDetailsSource> {
strongSave: string;
weakSave: string;
description: string;
}
interface ArmySystemData extends Omit<ArmySystemSource, "attributes">, ActorSystemData {
attributes: ArmyAttributes;
traits: ArmyTraits;
perception: Pick<PerceptionTraceData, "senses">;
details: ArmyDetails;
resources: ArmyResourcesData;
saves: ArmySystemSource["saves"] & {
strongSave: "maneuver" | "morale";
traits: ModelPropsFromSchema<ArmyTraitsSchema> & {
size?: never;
};
resources: {
ammunition: ValueAndMax;
potions: ValueAndMax;
} & Record<string, never>;
/** An audit log of automatic, non-modifier changes applied to various actor data nodes */
autoChanges: Record<string, AutoChangeEntry[] | undefined>;
}
interface ArmyAttributesSource extends ActorAttributesSource {
immunities?: never;
weaknesses?: never;
resistances?: never;
hp: ArmyHitPointsSource;
ac: never;
}
interface ArmyAttributes extends Omit<ArmyAttributesSource, "immunities" | "weaknesses" | "resistances">, ActorAttributes {
ac: never;
hp: ArmyHitPoints;
}
interface ArmyHitPointsSource extends Required<BaseHitPointsSource> {
/** Typically half the army's hit points, armies that can't be feared have a threshold of 0 instead */
routThreshold: number;
}
interface ArmyHitPoints extends ArmyHitPointsSource, ActorHitPoints {
negativeHealing: boolean;
unrecoverable: number;
}
interface ArmyResourcesSource {
/** How often this army can use ranged attacks */
ammunition: ValueAndMax;
potions: ValueAndMaybeMax;
}
interface ArmyResourcesData extends ArmyResourcesSource {
potions: ValueAndMax;
}
interface ArmyTraits extends Omit<ArmyTraitsSource, "size">, Required<ActorTraitsData<string>> {
}
interface ArmyDetails extends ArmyDetailsSource, ActorDetails {
}
export type { ArmySource, ArmySystemData };
type ArmySystemSchema = Omit<ActorSystemSchema, "attributes" | "traits" | "resources"> & {
ac: fields.SchemaField<{
value: fields.NumberField<number, number, true, false, true>;
potency: fields.NumberField<number, number, true, false, true>;
}>;
attributes: fields.SchemaField<ArmyAttributesSchema>;
details: fields.SchemaField<ArmyDetailsSchema>;
consumption: fields.NumberField<number, number, true, false, true>;
scouting: fields.NumberField<number, number, true, false, true>;
recruitmentDC: fields.NumberField<number, number, true, false, true>;
saves: fields.SchemaField<{
maneuver: fields.NumberField<number, number, true, false, true>;
morale: fields.NumberField<number, number, true, false, true>;
}>;
weapons: fields.SchemaField<{
ranged: fields.SchemaField<ArmyWeaponSchema, SourceFromSchema<ArmyWeaponSchema>, ModelPropsFromSchema<ArmyWeaponSchema>, true, true, true>;
melee: fields.SchemaField<ArmyWeaponSchema, SourceFromSchema<ArmyWeaponSchema>, ModelPropsFromSchema<ArmyWeaponSchema>, true, true, true>;
}>;
resources: fields.SchemaField<{
/** How often this army can use ranged attacks */
ammunition: fields.SchemaField<{
value: fields.NumberField<number, number, true, false, true>;
}>;
potions: fields.SchemaField<{
value: fields.NumberField<number, number, true, false, true>;
}>;
}>;
traits: fields.SchemaField<ArmyTraitsSchema>;
};
type ArmyAttributesSchema = {
hp: fields.SchemaField<{
value: fields.NumberField<number, number, true, false, true>;
temp: fields.NumberField<number, number, true, false, true>;
max: fields.NumberField<number, number, true, false, true>;
routThreshold: fields.NumberField<number, number, true, false, true>;
}>;
};
type ArmyDetailsSchema = {
level: fields.SchemaField<{
value: fields.NumberField<number, number, true, false, true>;
}>;
};
type ArmyTraitsSchema = {
value: fields.ArrayField<fields.StringField<string, string, true, false>>;
rarity: fields.StringField<Rarity, Rarity, true, false>;
type: fields.StringField<ArmyType, ArmyType, true, false>;
};
type ArmyWeaponSchema = {
name: fields.StringField<string, string, true, false, false>;
potency: fields.NumberField<number, number, true, false, true>;
};
type ArmySystemSource = SourceFromSchema<ArmySystemSchema> & {
attributes: {
immunities?: ImmunitySource[];
weaknesses?: WeaknessSource[];
resistances?: ResistanceSource[];
flanking: never;
hp: {
details: string;
};
};
/** Legacy location of `MigrationRecord` */
schema?: ActorSystemSource["schema"];
};
type ArmySource = BaseActorSourcePF2e<"army", ArmySystemSource>;
export { ArmySystemData };
export type { ArmySource };
1 change: 1 addition & 0 deletions types/src/module/actor/army/document.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ declare class ArmyPF2e<TParent extends TokenDocumentPF2e | null = TokenDocumentP
/** Gets the active kingdom. Later this should be configurable based on alliance */
get kingdom(): Kingdom | null;
get maxTactics(): number;
get strongSave(): "maneuver" | "morale";
prepareData(): void;
prepareBaseData(): void;
/** Run rule elements */
Expand Down
4 changes: 3 additions & 1 deletion types/src/module/actor/army/types.d.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import { DamageRollFunction, RollFunction } from "@actor/data/base.ts";
import { AttackRollParams } from "@system/rolls.ts";
import { ARMY_TYPES } from "./values.ts";

/** Data for an army strike. Deals 1 damage on a hit, 2 on a crit (usually) */
interface ArmyStrike {
Expand All @@ -16,4 +17,5 @@ interface ArmyStrike {
damage: DamageRollFunction;
critical: DamageRollFunction;
}
export type { ArmyStrike };
type ArmyType = (typeof ARMY_TYPES)[number];
export type { ArmyStrike, ArmyType };
Loading

0 comments on commit 0cb2722

Please sign in to comment.