forked from foundryvtt/pf2e
-
Notifications
You must be signed in to change notification settings - Fork 0
/
data.ts
66 lines (57 loc) · 2.12 KB
/
data.ts
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
import { PhysicalItemSource } from "@item/base/data/index.ts";
import {
BasePhysicalItemSource,
Investable,
ItemMaterialSource,
PhysicalItemTraits,
PhysicalSystemData,
PhysicalSystemSource,
} from "@item/physical/data.ts";
import { WornUsage } from "@item/physical/usage.ts";
import { ZeroToFour, ZeroToThree } from "@module/data.ts";
import { ArmorCategory, ArmorGroup, ArmorPropertyRuneType, ArmorTrait, BaseArmorType, OtherArmorTag } from "./index.ts";
type ArmorSource = BasePhysicalItemSource<"armor", ArmorSystemSource>;
interface ArmorSystemSource extends Investable<PhysicalSystemSource> {
traits: ArmorTraits;
category: ArmorCategory;
group: ArmorGroup | null;
baseItem: BaseArmorType | null;
acBonus: number;
strength: number | null;
dexCap: number;
checkPenalty: number;
speedPenalty: number;
runes: ArmorRuneSource;
/** Details of specific magic armor, storing the material and rune state when toggled on */
specific: SpecificArmorData | null;
/** Doubly-embedded adjustments, attachments, talismans etc. */
subitems: PhysicalItemSource[];
/** Usage for armor isn't stored. */
readonly usage?: never;
}
type ArmorRuneSource = {
potency: ZeroToFour;
resilient: ZeroToThree;
property: ArmorPropertyRuneType[];
};
/** A weapon can either be unspecific or specific along with baseline material and runes */
type SpecificArmorData = {
material: ItemMaterialSource;
runes: ArmorRuneSource;
};
interface ArmorSystemData
extends Omit<ArmorSystemSource, SourceOmission>,
Omit<Investable<PhysicalSystemData>, "baseItem" | "traits"> {
runes: ArmorRuneData;
/** Armor is always worn in the "armor" slot. */
usage: WornUsage;
stackGroup: null;
}
type SourceOmission = "bulk" | "hp" | "identification" | "items" | "material" | "price" | "temporary" | "usage";
interface ArmorTraits extends PhysicalItemTraits<ArmorTrait> {
otherTags: OtherArmorTag[];
}
interface ArmorRuneData extends ArmorRuneSource {
effects: ArmorPropertyRuneType[];
}
export type { ArmorSource, ArmorSystemData, ArmorSystemSource, SpecificArmorData };