Skip to content

Commit

Permalink
Add system property to ActorSource and ItemSource
Browse files Browse the repository at this point in the history
  • Loading branch information
In3luki committed Aug 1, 2022
1 parent d583088 commit 8e72a41
Show file tree
Hide file tree
Showing 11 changed files with 11 additions and 8 deletions.
2 changes: 1 addition & 1 deletion src/module/actor/character/data/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ interface CharacterSource extends BaseCreatureSource<"character", CharacterSyste
}

interface CharacterData
extends Omit<CharacterSource, "data" | "effects" | "items" | "token" | "type">,
extends Omit<CharacterSource, "data" | "system" | "effects" | "items" | "token" | "type">,
BaseCreatureData<CharacterPF2e, "character", CharacterSystemData, CharacterSource> {
flags: CharacterFlags;
}
Expand Down
2 changes: 1 addition & 1 deletion src/module/actor/creature/data.ts
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ interface BaseCreatureData<
TType extends CreatureType = CreatureType,
TSystemData extends CreatureSystemData = CreatureSystemData,
TSource extends BaseCreatureSource<TType> = BaseCreatureSource<TType>
> extends Omit<BaseCreatureSource<TType>, "data" | "effects" | "flags" | "items" | "token" | "type">,
> extends Omit<BaseCreatureSource<TType>, "data" | "system" | "effects" | "flags" | "items" | "token" | "type">,
BaseActorDataPF2e<TItem, TType, TSystemData, TSource> {}

/** Skill and Lore statistics for rolling. Both short and longform are supported, but eventually only long form will be */
Expand Down
1 change: 1 addition & 0 deletions src/module/actor/data/base.ts
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@ interface BaseActorDataPF2e<
foundry.data.ActorData<TActor, ActiveEffectPF2e, ItemPF2e> {
readonly type: TType;
readonly data: TSystemData;
readonly system: TSystemData;
token: PrototypeTokenDataPF2e;
flags: ActorFlagsPF2e;

Expand Down
2 changes: 1 addition & 1 deletion src/module/actor/familiar/data.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ import type { FamiliarPF2e } from ".";
type FamiliarSource = BaseCreatureSource<"familiar", FamiliarSystemSource>;

interface FamiliarData
extends Omit<FamiliarSource, "data" | "effects" | "flags" | "items" | "token" | "type">,
extends Omit<FamiliarSource, "data" | "system" | "effects" | "flags" | "items" | "token" | "type">,
BaseCreatureData<FamiliarPF2e, "familiar", FamiliarSystemData, FamiliarSource> {}

interface FamiliarSystemSource extends Pick<CreatureSystemSource, "schema"> {
Expand Down
2 changes: 1 addition & 1 deletion src/module/actor/hazard/data.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ import { HazardPF2e } from ".";
type HazardSource = BaseActorSourcePF2e<"hazard", HazardSystemData>;

interface HazardData
extends Omit<HazardSource, "data" | "effects" | "flags" | "items" | "token" | "type">,
extends Omit<HazardSource, "data" | "system" | "effects" | "flags" | "items" | "token" | "type">,
BaseActorDataPF2e<HazardPF2e, "hazard", HazardSystemData, HazardSource> {}

/** The raw information contained within the actor data object for hazards. */
Expand Down
2 changes: 1 addition & 1 deletion src/module/actor/loot/data.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ import { LootPF2e } from ".";
type LootSource = BaseActorSourcePF2e<"loot", LootSystemSource>;

interface LootData
extends Omit<LootSource, "data" | "effects" | "flags" | "items" | "token" | "type">,
extends Omit<LootSource, "data" | "system" | "effects" | "flags" | "items" | "token" | "type">,
BaseActorDataPF2e<LootPF2e, "loot", LootSystemData, LootSource> {}

/** The system-level data of loot actors. */
Expand Down
2 changes: 1 addition & 1 deletion src/module/actor/npc/data.ts
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ interface NPCSource extends BaseCreatureSource<"npc", NPCSystemSource> {
}

interface NPCData
extends Omit<NPCSource, "data" | "effects" | "items" | "token" | "type">,
extends Omit<NPCSource, "data" | "system" | "effects" | "items" | "token" | "type">,
BaseCreatureData<NPCPF2e, "npc", NPCSystemData, NPCSource> {
flags: NPCFlags;
}
Expand Down
2 changes: 1 addition & 1 deletion src/module/item/data/base.ts
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ interface BaseItemDataPF2e<
TType extends ItemType = ItemType,
TSystemData extends ItemSystemData = ItemSystemData,
TSource extends BaseItemSourcePF2e<TType> = BaseItemSourcePF2e<TType>
> extends Omit<BaseItemSourcePF2e<TType, ItemSystemSource>, "data" | "effects">,
> extends Omit<BaseItemSourcePF2e<TType, ItemSystemSource>, "data" | "system" | "effects">,
foundry.data.ItemData<TItem, ActiveEffectPF2e> {
readonly type: TType;
readonly data: TSystemData;
Expand Down
2 changes: 1 addition & 1 deletion src/module/migration/migrations/711-heritage-items.ts
Original file line number Diff line number Diff line change
Expand Up @@ -164,7 +164,7 @@ export class Migration711HeritageItems extends MigrationBase {

private ancestrySlugs = Object.keys(this.officialAncestries);

private heritageFromFeat(feature: FeatSource): HeritageSource {
private heritageFromFeat(feature: FeatSource): Omit<HeritageSource, "system"> {
const featureSlug = feature.data.slug ?? "";
const ancestrySlug =
this.heritagesWithoutAncestryInName[featureSlug] ?? this.ancestrySlugs.find((s) => featureSlug.includes(s));
Expand Down
1 change: 1 addition & 0 deletions types/foundry/common/data/data/actor-data.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@ declare module foundry {
type: TType;
img: ImagePath;
data: TSystemSource;
system: TSystemSource;
token: PrototypeTokenSource;
items: TItemSource[];
effects: ActiveEffectSource[];
Expand Down
1 change: 1 addition & 0 deletions types/foundry/common/data/data/item-data.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ declare module foundry {
type: TType;
img: ImagePath;
data: TSystemSource;
system: TSystemSource;
effects: ActiveEffectSource[];
folder?: string | null;
sort: number;
Expand Down

0 comments on commit 8e72a41

Please sign in to comment.