-
Notifications
You must be signed in to change notification settings - Fork 37
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: Set minimum and verified pf2e version to 6.8.0. Update types.
- Loading branch information
Showing
206 changed files
with
2,611 additions
and
3,214 deletions.
There are no files selected for viewing
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 }; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.