@archivist-gg/dnd5e 0.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +21 -0
- package/LICENSES/SRD.md +37 -0
- package/README.md +65 -0
- package/dist/armor/armor.codec.d.ts +10 -0
- package/dist/armor/armor.codec.js +8 -0
- package/dist/armor/armor.entity-type.d.ts +2 -0
- package/dist/armor/armor.parser.d.ts +3 -0
- package/dist/armor/armor.parser.js +7 -0
- package/dist/armor/armor.schema.d.ts +25 -0
- package/dist/armor/armor.schema.js +6 -0
- package/dist/armor/armor.types.d.ts +26 -0
- package/dist/armor/armor.types.js +0 -0
- package/dist/background/background.codec.d.ts +9 -0
- package/dist/background/background.codec.js +11 -0
- package/dist/background/background.entity-type.d.ts +2 -0
- package/dist/background/background.parser.d.ts +3 -0
- package/dist/background/background.parser.js +10 -0
- package/dist/background/background.schema.d.ts +74 -0
- package/dist/background/background.schema.js +9 -0
- package/dist/background/background.types.d.ts +52 -0
- package/dist/background/background.types.js +0 -0
- package/dist/chunk-24GFQU7T.js +18 -0
- package/dist/chunk-3DZ74AKK.js +28 -0
- package/dist/chunk-3TM34RSJ.js +23 -0
- package/dist/chunk-3TRGRSCH.js +8 -0
- package/dist/chunk-4C2KOKLF.js +185 -0
- package/dist/chunk-4F6AIZ36.js +19 -0
- package/dist/chunk-4SSDYJS2.js +86 -0
- package/dist/chunk-4TIJKN6O.js +37 -0
- package/dist/chunk-537BHVSH.js +18 -0
- package/dist/chunk-5INR4NSL.js +18 -0
- package/dist/chunk-5XUXXAQJ.js +30 -0
- package/dist/chunk-656QCX4U.js +22 -0
- package/dist/chunk-66XXW2Z2.js +133 -0
- package/dist/chunk-6NK2MUD3.js +114 -0
- package/dist/chunk-6PXE7T7C.js +79 -0
- package/dist/chunk-7P65Q426.js +158 -0
- package/dist/chunk-A7T5L7SS.js +83 -0
- package/dist/chunk-AFKTJXRA.js +39 -0
- package/dist/chunk-B7UXKNLD.js +46 -0
- package/dist/chunk-BAXWWGFJ.js +45 -0
- package/dist/chunk-BH6AMZVY.js +25 -0
- package/dist/chunk-CDW7R2QT.js +62 -0
- package/dist/chunk-DABBCYTT.js +68 -0
- package/dist/chunk-DC74TZNA.js +46 -0
- package/dist/chunk-DNAJRMNN.js +68 -0
- package/dist/chunk-DRNZJNJP.js +19 -0
- package/dist/chunk-FEOB24KP.js +18 -0
- package/dist/chunk-FFULAF2P.js +63 -0
- package/dist/chunk-FUK7QSN5.js +19 -0
- package/dist/chunk-GIOH5JB5.js +19 -0
- package/dist/chunk-GJOI2GHP.js +25 -0
- package/dist/chunk-GZ46OVGZ.js +31 -0
- package/dist/chunk-HCP3GMHS.js +44 -0
- package/dist/chunk-IDTDACM6.js +19 -0
- package/dist/chunk-IKSMX4TN.js +0 -0
- package/dist/chunk-IXZXFFFW.js +269 -0
- package/dist/chunk-J2RYSZMQ.js +16 -0
- package/dist/chunk-JEYQU3JT.js +36 -0
- package/dist/chunk-LSLSG67V.js +31 -0
- package/dist/chunk-LWFTHJIE.js +24 -0
- package/dist/chunk-MDEJHMKK.js +52 -0
- package/dist/chunk-N2JE7BWL.js +81 -0
- package/dist/chunk-NAEPSZAM.js +88 -0
- package/dist/chunk-NXR3BD2V.js +90 -0
- package/dist/chunk-PKC77VZP.js +18 -0
- package/dist/chunk-PMADYMUI.js +19 -0
- package/dist/chunk-PTXBIDG7.js +63 -0
- package/dist/chunk-PZOWBI3B.js +49 -0
- package/dist/chunk-QQ5W2AZP.js +515 -0
- package/dist/chunk-QS5L5YTJ.js +24 -0
- package/dist/chunk-QYZV2MQA.js +97 -0
- package/dist/chunk-R2ZV233X.js +233 -0
- package/dist/chunk-RAWJTA45.js +271 -0
- package/dist/chunk-RSDRMH54.js +18 -0
- package/dist/chunk-RVYYKYFL.js +18 -0
- package/dist/chunk-SSXBYF3P.js +18 -0
- package/dist/chunk-TJCNX6UZ.js +521 -0
- package/dist/chunk-TZK36BU7.js +38 -0
- package/dist/chunk-UC4FE5X3.js +65 -0
- package/dist/chunk-WP2CX2JO.js +235 -0
- package/dist/chunk-WYGD2UGN.js +14 -0
- package/dist/chunk-XJNECUPT.js +31 -0
- package/dist/chunk-XURS6Q6Q.js +127 -0
- package/dist/chunk-Y4I74YEG.js +33 -0
- package/dist/chunk-Z4TL2V7S.js +18 -0
- package/dist/chunk-Z6GXV2GO.js +121 -0
- package/dist/chunk-ZLG6FQFB.js +237 -0
- package/dist/chunk-ZMR77DDL.js +18 -0
- package/dist/class/class.codec.d.ts +10 -0
- package/dist/class/class.codec.js +15 -0
- package/dist/class/class.entity-type.d.ts +2 -0
- package/dist/class/class.parser.d.ts +3 -0
- package/dist/class/class.parser.js +14 -0
- package/dist/class/class.schema.d.ts +202 -0
- package/dist/class/class.schema.js +13 -0
- package/dist/class/class.slug.d.ts +11 -0
- package/dist/class/class.slug.js +8 -0
- package/dist/class/class.types.d.ts +74 -0
- package/dist/class/class.types.js +0 -0
- package/dist/data-srd/index.generated.d.ts +7 -0
- package/dist/data-srd/index.generated.js +146 -0
- package/dist/dnd/constants.d.ts +16 -0
- package/dist/dnd/constants.js +36 -0
- package/dist/dnd/formula-tags.d.ts +16 -0
- package/dist/dnd/formula-tags.js +119 -0
- package/dist/dnd/math.d.ts +24 -0
- package/dist/dnd/math.js +35 -0
- package/dist/dnd/prose-tags.d.ts +16 -0
- package/dist/dnd/prose-tags.js +18 -0
- package/dist/dnd/resource-die.d.ts +6 -0
- package/dist/dnd/resource-die.js +17 -0
- package/dist/dnd/resource-formula.d.ts +41 -0
- package/dist/dnd/resource-formula.js +159 -0
- package/dist/dnd/srd-tag-converter.d.ts +44 -0
- package/dist/dnd/srd-tag-converter.js +12 -0
- package/dist/dnd/tag-grammar.d.ts +19 -0
- package/dist/dnd/tag-grammar.js +12 -0
- package/dist/encounter/encounter.ai-schema.d.ts +29 -0
- package/dist/encounter/encounter.ai-schema.js +8 -0
- package/dist/encounter/encounter.entity-type.d.ts +2 -0
- package/dist/encounter/encounter.generatable.d.ts +2 -0
- package/dist/entities/base-item-resolver.d.ts +21 -0
- package/dist/entities/base-item-resolver.js +9 -0
- package/dist/entities/slug.d.ts +5 -0
- package/dist/entities/slug.js +6 -0
- package/dist/feat/feat.codec.d.ts +9 -0
- package/dist/feat/feat.codec.js +10 -0
- package/dist/feat/feat.entity-type.d.ts +2 -0
- package/dist/feat/feat.parser.d.ts +3 -0
- package/dist/feat/feat.parser.js +9 -0
- package/dist/feat/feat.schema.d.ts +194 -0
- package/dist/feat/feat.schema.js +8 -0
- package/dist/feat/feat.types.d.ts +42 -0
- package/dist/feat/feat.types.js +0 -0
- package/dist/index.d.ts +12 -0
- package/dist/index.js +139149 -0
- package/dist/inline-tag-parser.d.ts +11 -0
- package/dist/inline-tag-parser.js +6 -0
- package/dist/item/item.actions-map.d.ts +41 -0
- package/dist/item/item.actions-map.js +85 -0
- package/dist/item/item.ai-schema.d.ts +35 -0
- package/dist/item/item.ai-schema.js +6 -0
- package/dist/item/item.attunement.d.ts +18 -0
- package/dist/item/item.attunement.js +12 -0
- package/dist/item/item.bonuses.d.ts +2 -0
- package/dist/item/item.bonuses.js +7 -0
- package/dist/item/item.codec.d.ts +3 -0
- package/dist/item/item.codec.js +8 -0
- package/dist/item/item.conditions.d.ts +10 -0
- package/dist/item/item.conditions.js +8 -0
- package/dist/item/item.conditions.types.d.ts +28 -0
- package/dist/item/item.conditions.types.js +0 -0
- package/dist/item/item.enrichment.d.ts +4 -0
- package/dist/item/item.enrichment.js +9 -0
- package/dist/item/item.entity-type.d.ts +2 -0
- package/dist/item/item.generatable.d.ts +2 -0
- package/dist/item/item.parser.d.ts +3 -0
- package/dist/item/item.parser.js +7 -0
- package/dist/item/item.schema.d.ts +174 -0
- package/dist/item/item.schema.js +8 -0
- package/dist/item/item.types.d.ts +108 -0
- package/dist/item/item.types.js +0 -0
- package/dist/monster/monster.ai-schema.d.ts +67 -0
- package/dist/monster/monster.ai-schema.js +6 -0
- package/dist/monster/monster.codec.d.ts +13 -0
- package/dist/monster/monster.enrichment.d.ts +10 -0
- package/dist/monster/monster.enrichment.js +19 -0
- package/dist/monster/monster.entity-type.d.ts +2 -0
- package/dist/monster/monster.generatable.d.ts +2 -0
- package/dist/monster/monster.parser.d.ts +3 -0
- package/dist/monster/monster.parser.js +6 -0
- package/dist/monster/monster.resolve.d.ts +10 -0
- package/dist/monster/monster.types.d.ts +29 -0
- package/dist/monster/monster.types.js +1 -0
- package/dist/npc/npc.ai-schema.d.ts +6 -0
- package/dist/npc/npc.entity-type.d.ts +2 -0
- package/dist/npc/npc.generatable.d.ts +2 -0
- package/dist/optional-feature/optional-feature.codec.d.ts +14 -0
- package/dist/optional-feature/optional-feature.codec.js +11 -0
- package/dist/optional-feature/optional-feature.entity-type.d.ts +2 -0
- package/dist/optional-feature/optional-feature.parser.d.ts +3 -0
- package/dist/optional-feature/optional-feature.parser.js +10 -0
- package/dist/optional-feature/optional-feature.schema.d.ts +236 -0
- package/dist/optional-feature/optional-feature.schema.js +9 -0
- package/dist/pack.d.ts +11 -0
- package/dist/pc/conditions.constants.d.ts +3 -0
- package/dist/pc/conditions.constants.js +8 -0
- package/dist/pc/decision-recognizer.d.ts +4 -0
- package/dist/pc/decision-recognizer.js +8 -0
- package/dist/pc/pc.conditions.d.ts +3 -0
- package/dist/pc/pc.conditions.js +6 -0
- package/dist/pc/pc.decision-engine.d.ts +97 -0
- package/dist/pc/pc.decision-engine.js +19 -0
- package/dist/pc/pc.equipment.d.ts +12 -0
- package/dist/pc/pc.equipment.js +15 -0
- package/dist/pc/pc.feature-effects.d.ts +95 -0
- package/dist/pc/pc.feature-effects.js +9 -0
- package/dist/pc/pc.formula-context.d.ts +4 -0
- package/dist/pc/pc.formula-context.js +11 -0
- package/dist/pc/pc.parser.d.ts +3 -0
- package/dist/pc/pc.parser.js +41 -0
- package/dist/pc/pc.pools.d.ts +12 -0
- package/dist/pc/pc.pools.js +15 -0
- package/dist/pc/pc.proficiencies.d.ts +8 -0
- package/dist/pc/pc.proficiencies.js +47 -0
- package/dist/pc/pc.proficiency-query.d.ts +11 -0
- package/dist/pc/pc.proficiency-query.js +17 -0
- package/dist/pc/pc.recalc.d.ts +105 -0
- package/dist/pc/pc.recalc.js +662 -0
- package/dist/pc/pc.resolver.d.ts +34 -0
- package/dist/pc/pc.resolver.js +267 -0
- package/dist/pc/pc.resource-seed.d.ts +10 -0
- package/dist/pc/pc.resource-seed.js +40 -0
- package/dist/pc/pc.rest.d.ts +23 -0
- package/dist/pc/pc.rest.js +128 -0
- package/dist/pc/pc.schema.d.ts +294 -0
- package/dist/pc/pc.schema.js +7 -0
- package/dist/pc/pc.slotting.d.ts +22 -0
- package/dist/pc/pc.slotting.js +20 -0
- package/dist/pc/pc.spellcasting.d.ts +56 -0
- package/dist/pc/pc.spellcasting.js +16 -0
- package/dist/pc/pc.table-column.d.ts +12 -0
- package/dist/pc/pc.table-column.js +8 -0
- package/dist/pc/pc.types.d.ts +514 -0
- package/dist/pc/pc.types.js +0 -0
- package/dist/race/race.codec.d.ts +9 -0
- package/dist/race/race.codec.js +13 -0
- package/dist/race/race.entity-type.d.ts +2 -0
- package/dist/race/race.parser.d.ts +3 -0
- package/dist/race/race.parser.js +12 -0
- package/dist/race/race.schema.d.ts +67 -0
- package/dist/race/race.schema.js +11 -0
- package/dist/race/race.types.d.ts +44 -0
- package/dist/race/race.types.js +0 -0
- package/dist/schemas/attack-schema.d.ts +38 -0
- package/dist/schemas/choice-schema.d.ts +5 -0
- package/dist/schemas/choice-schema.js +7 -0
- package/dist/schemas/duration-schema.d.ts +13 -0
- package/dist/schemas/duration-schema.js +6 -0
- package/dist/schemas/equipment-grant-schema.d.ts +6 -0
- package/dist/schemas/equipment-grant-schema.js +12 -0
- package/dist/schemas/feature-effect-schema.d.ts +131 -0
- package/dist/schemas/feature-effect-schema.js +6 -0
- package/dist/schemas/feature-schema.d.ts +2 -0
- package/dist/schemas/feature-schema.js +10 -0
- package/dist/schemas/index.d.ts +6 -0
- package/dist/schemas/resource-schema.d.ts +95 -0
- package/dist/schemas/resource-schema.js +12 -0
- package/dist/schemas/selection-pool-schema.d.ts +34 -0
- package/dist/schemas/selection-pool-schema.js +10 -0
- package/dist/spell/spell.access.d.ts +15 -0
- package/dist/spell/spell.access.js +25 -0
- package/dist/spell/spell.ai-schema.d.ts +24 -0
- package/dist/spell/spell.ai-schema.js +6 -0
- package/dist/spell/spell.codec.d.ts +3 -0
- package/dist/spell/spell.codec.js +8 -0
- package/dist/spell/spell.enrichment.d.ts +2 -0
- package/dist/spell/spell.enrichment.js +9 -0
- package/dist/spell/spell.entity-type.d.ts +2 -0
- package/dist/spell/spell.filter.d.ts +15 -0
- package/dist/spell/spell.filter.js +87 -0
- package/dist/spell/spell.generatable.d.ts +2 -0
- package/dist/spell/spell.parser.d.ts +3 -0
- package/dist/spell/spell.parser.js +7 -0
- package/dist/spell/spell.scaling.d.ts +14 -0
- package/dist/spell/spell.scaling.js +28 -0
- package/dist/spell/spell.schema.d.ts +31 -0
- package/dist/spell/spell.schema.js +6 -0
- package/dist/spell/spell.types.d.ts +25 -0
- package/dist/spell/spell.types.js +0 -0
- package/dist/srd-store.d.ts +53 -0
- package/dist/subclass/subclass.codec.d.ts +11 -0
- package/dist/subclass/subclass.codec.js +14 -0
- package/dist/subclass/subclass.entity-type.d.ts +2 -0
- package/dist/subclass/subclass.parser.d.ts +3 -0
- package/dist/subclass/subclass.parser.js +13 -0
- package/dist/subclass/subclass.schema.d.ts +118 -0
- package/dist/subclass/subclass.schema.js +12 -0
- package/dist/subclass/subclass.types.d.ts +20 -0
- package/dist/subclass/subclass.types.js +0 -0
- package/dist/types/abilities.d.ts +8 -0
- package/dist/types/abilities.js +0 -0
- package/dist/types/ac.d.ts +5 -0
- package/dist/types/attack.d.ts +22 -0
- package/dist/types/attack.js +0 -0
- package/dist/types/casting-option.d.ts +14 -0
- package/dist/types/casting-option.js +0 -0
- package/dist/types/choice.d.ts +66 -0
- package/dist/types/choice.js +6 -0
- package/dist/types/edition.d.ts +4 -0
- package/dist/types/edition.js +0 -0
- package/dist/types/equipment-grant.d.ts +41 -0
- package/dist/types/equipment-grant.js +0 -0
- package/dist/types/feature-effect.d.ts +79 -0
- package/dist/types/feature-effect.js +0 -0
- package/dist/types/feature.d.ts +41 -0
- package/dist/types/feature.js +0 -0
- package/dist/types/formula-context.d.ts +7 -0
- package/dist/types/formula-context.js +0 -0
- package/dist/types/hp.d.ts +4 -0
- package/dist/types/index.d.ts +10 -0
- package/dist/types/item-conditions.types.d.ts +63 -0
- package/dist/types/item-conditions.types.js +0 -0
- package/dist/types/optional-feature.types.d.ts +60 -0
- package/dist/types/optional-feature.types.js +0 -0
- package/dist/types/resource.d.ts +44 -0
- package/dist/types/resource.js +0 -0
- package/dist/types/selection-pool.d.ts +37 -0
- package/dist/types/selection-pool.js +0 -0
- package/dist/types/speed.d.ts +8 -0
- package/dist/weapon/weapon.codec.d.ts +12 -0
- package/dist/weapon/weapon.codec.js +8 -0
- package/dist/weapon/weapon.entity-type.d.ts +2 -0
- package/dist/weapon/weapon.parser.d.ts +3 -0
- package/dist/weapon/weapon.parser.js +7 -0
- package/dist/weapon/weapon.schema.d.ts +34 -0
- package/dist/weapon/weapon.schema.js +6 -0
- package/dist/weapon/weapon.types.d.ts +36 -0
- package/dist/weapon/weapon.types.js +0 -0
- package/package.json +32 -0
- package/src/data-srd/ATTRIBUTION.md +2 -0
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
import type { Choice } from "./choice.js";
|
|
2
|
+
import type { Resource, ResourceConsumption } from "./resource.js";
|
|
3
|
+
import type { Attack } from "./attack.js";
|
|
4
|
+
import type { FeatureEffect } from "./feature-effect.js";
|
|
5
|
+
import type { Duration } from "../schemas/duration-schema.js";
|
|
6
|
+
/**
|
|
7
|
+
* Recharge / per-day usage limits on a Feature (e.g. monster action).
|
|
8
|
+
*
|
|
9
|
+
* - `recharge_on_roll`: at the start of each turn, recharges on a d6 roll
|
|
10
|
+
* ≥ `param`. Renders as "Recharge {param}-6" (or "Recharge 6" when param=6).
|
|
11
|
+
* - `per_day`: usable `param` times per day. Renders as "{param}/Day".
|
|
12
|
+
* - `per_short_rest` / `per_long_rest`: usable `param` times per rest.
|
|
13
|
+
*/
|
|
14
|
+
export interface FeatureRecharge {
|
|
15
|
+
type: "recharge_on_roll" | "per_day" | "per_short_rest" | "per_long_rest";
|
|
16
|
+
param: number;
|
|
17
|
+
}
|
|
18
|
+
export interface Feature {
|
|
19
|
+
id?: string;
|
|
20
|
+
name: string;
|
|
21
|
+
description?: string;
|
|
22
|
+
entries?: string[];
|
|
23
|
+
choices?: Choice[];
|
|
24
|
+
grants_resource?: string;
|
|
25
|
+
consumes?: ResourceConsumption;
|
|
26
|
+
attacks?: Attack[];
|
|
27
|
+
action?: "action" | "bonus-action" | "reaction" | "free" | "special";
|
|
28
|
+
trigger?: string;
|
|
29
|
+
dc_formula?: string;
|
|
30
|
+
effects?: FeatureEffect[];
|
|
31
|
+
sub_features?: Feature[];
|
|
32
|
+
resources?: Resource[];
|
|
33
|
+
recharge?: FeatureRecharge;
|
|
34
|
+
/** Phase 3 activatable buffs: when true, the feature's effects fold only while
|
|
35
|
+
* its `id` is present in `Character.state.active_buffs` (toggled in the UI). */
|
|
36
|
+
activatable?: boolean;
|
|
37
|
+
/** Always-on marker; renders a "Passive" tag. */
|
|
38
|
+
passive?: boolean;
|
|
39
|
+
/** How long the buff lasts; rendered as a static label (no live countdown). */
|
|
40
|
+
duration?: Duration;
|
|
41
|
+
}
|
|
File without changes
|
|
File without changes
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
export type { Abilities } from "./abilities.js";
|
|
2
|
+
export type { FormulaContext } from "./formula-context.js";
|
|
3
|
+
export type { AC } from "./ac.js";
|
|
4
|
+
export type { HP } from "./hp.js";
|
|
5
|
+
export type { Speed } from "./speed.js";
|
|
6
|
+
export type { Feature, FeatureRecharge } from "./feature.js";
|
|
7
|
+
export type { Choice, Ability, SkillSlug, FeatCategory } from "./choice.js";
|
|
8
|
+
export type { Resource, ResourceDie, ResourceRecovery, ResourceConsumption, ResetTrigger, ActionCost } from "./resource.js";
|
|
9
|
+
export type { Attack, AttackRange } from "./attack.js";
|
|
10
|
+
export type { FeatureEffect } from "./feature-effect.js";
|
|
@@ -0,0 +1,63 @@
|
|
|
1
|
+
import type { Ability } from "./choice.js";
|
|
2
|
+
export type Tier1Condition = {
|
|
3
|
+
kind: "no_armor";
|
|
4
|
+
} | {
|
|
5
|
+
kind: "no_shield";
|
|
6
|
+
} | {
|
|
7
|
+
kind: "wielding_two_handed";
|
|
8
|
+
} | {
|
|
9
|
+
kind: "is_class";
|
|
10
|
+
value: string;
|
|
11
|
+
} | {
|
|
12
|
+
kind: "is_race";
|
|
13
|
+
value: string;
|
|
14
|
+
} | {
|
|
15
|
+
kind: "is_subclass";
|
|
16
|
+
value: string;
|
|
17
|
+
};
|
|
18
|
+
export type Tier2Condition = {
|
|
19
|
+
kind: "vs_creature_type";
|
|
20
|
+
value: string;
|
|
21
|
+
} | {
|
|
22
|
+
kind: "vs_attack_type";
|
|
23
|
+
value: "ranged" | "melee";
|
|
24
|
+
} | {
|
|
25
|
+
kind: "on_attack_type";
|
|
26
|
+
value: "ranged" | "melee";
|
|
27
|
+
} | {
|
|
28
|
+
kind: "with_weapon_property";
|
|
29
|
+
value: string;
|
|
30
|
+
} | {
|
|
31
|
+
kind: "vs_spell_save";
|
|
32
|
+
};
|
|
33
|
+
export type Tier3Condition = {
|
|
34
|
+
kind: "lighting";
|
|
35
|
+
value: "dim" | "bright" | "daylight" | "darkness";
|
|
36
|
+
} | {
|
|
37
|
+
kind: "underwater";
|
|
38
|
+
} | {
|
|
39
|
+
kind: "movement_state";
|
|
40
|
+
value: "flying" | "swimming" | "climbing" | "mounted";
|
|
41
|
+
};
|
|
42
|
+
export type Tier4Condition = {
|
|
43
|
+
kind: "has_condition";
|
|
44
|
+
value: string;
|
|
45
|
+
} | {
|
|
46
|
+
kind: "is_concentrating";
|
|
47
|
+
} | {
|
|
48
|
+
kind: "bloodied";
|
|
49
|
+
};
|
|
50
|
+
export type FreeTextCondition = {
|
|
51
|
+
kind: "raw";
|
|
52
|
+
text: string;
|
|
53
|
+
};
|
|
54
|
+
export type AnyOfCondition = {
|
|
55
|
+
kind: "any_of";
|
|
56
|
+
conditions: Condition[];
|
|
57
|
+
};
|
|
58
|
+
export type Condition = Tier1Condition | Tier2Condition | Tier3Condition | Tier4Condition | FreeTextCondition | AnyOfCondition;
|
|
59
|
+
export interface ConditionalBonus {
|
|
60
|
+
value: number;
|
|
61
|
+
when: Condition[];
|
|
62
|
+
}
|
|
63
|
+
export type BonusFieldPath = "ac" | "saving_throws" | "spell_attack" | "spell_save_dc" | "weapon_attack" | "weapon_damage" | `ability_scores.bonus.${Ability}` | "speed.walk" | "speed.fly" | "speed.swim" | "speed.climb";
|
|
File without changes
|
|
@@ -0,0 +1,60 @@
|
|
|
1
|
+
import type { FeatureEffect } from "./feature-effect.js";
|
|
2
|
+
import type { ActionCost, ResetTrigger, ResourceConsumption } from "./resource.js";
|
|
3
|
+
import type { Duration } from "../schemas/duration-schema.js";
|
|
4
|
+
import type { Edition } from "./edition.js";
|
|
5
|
+
/**
|
|
6
|
+
* Documentation-only union of the canonical SRD feature types. The
|
|
7
|
+
* `feature_type` field is now an open string (see {@link OptionalFeatureEntity})
|
|
8
|
+
* so homebrew categories parse; this union is kept purely as a reference list.
|
|
9
|
+
*/
|
|
10
|
+
export type OptionalFeatureKind = "invocation" | "fighting_style" | "metamagic" | "maneuver" | "infusion";
|
|
11
|
+
export type OptionalFeaturePrerequisite = {
|
|
12
|
+
kind: "level";
|
|
13
|
+
min: number;
|
|
14
|
+
} | {
|
|
15
|
+
kind: "spell-known";
|
|
16
|
+
spell: string;
|
|
17
|
+
} | {
|
|
18
|
+
kind: "pact";
|
|
19
|
+
pact: "tome" | "blade" | "chain" | "talisman";
|
|
20
|
+
} | {
|
|
21
|
+
kind: "class";
|
|
22
|
+
class: string;
|
|
23
|
+
} | {
|
|
24
|
+
kind: "ability";
|
|
25
|
+
ability: "str" | "dex" | "con" | "int" | "wis" | "cha";
|
|
26
|
+
min: number;
|
|
27
|
+
} | {
|
|
28
|
+
kind: "other";
|
|
29
|
+
detail: string;
|
|
30
|
+
};
|
|
31
|
+
export interface OptionalFeatureEntity {
|
|
32
|
+
slug: string;
|
|
33
|
+
name: string;
|
|
34
|
+
edition: Edition;
|
|
35
|
+
source: string;
|
|
36
|
+
/** Open string category (e.g. "invocation"); see {@link OptionalFeatureKind} for canonical SRD values. */
|
|
37
|
+
feature_type: string;
|
|
38
|
+
description: string;
|
|
39
|
+
prerequisites: OptionalFeaturePrerequisite[];
|
|
40
|
+
/** Wikilinks to classes/subclasses that can pick this option. */
|
|
41
|
+
available_to: string[];
|
|
42
|
+
/** Mechanical effects mirrored on Feat — same shape. */
|
|
43
|
+
effects: FeatureEffect[];
|
|
44
|
+
/** Optional action economy when the option grants an active ability. */
|
|
45
|
+
action_cost?: ActionCost | null;
|
|
46
|
+
/** Optional uses tracker. */
|
|
47
|
+
uses?: {
|
|
48
|
+
max: number | string;
|
|
49
|
+
recharge: ResetTrigger;
|
|
50
|
+
} | null;
|
|
51
|
+
/** Resource cost to use this option (e.g. burn a Seal). */
|
|
52
|
+
consumes?: ResourceConsumption | null;
|
|
53
|
+
/** How long the granted effect lasts (rendered as a label in Phase 2). */
|
|
54
|
+
duration?: Duration | null;
|
|
55
|
+
/** Always-on marker; renders a "Passive" tag. */
|
|
56
|
+
passive?: boolean;
|
|
57
|
+
/** Phase 3 activatable buffs: when true, the boon's effects fold only while its
|
|
58
|
+
* slug is present in `Character.state.active_buffs` (toggled in the PoolTab). */
|
|
59
|
+
activatable?: boolean;
|
|
60
|
+
}
|
|
File without changes
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
export type ResetTrigger = "short-rest" | "long-rest" | "dawn" | "dusk" | "turn" | "round" | "custom";
|
|
2
|
+
export type ActionCost = "action" | "bonus-action" | "reaction" | "free" | "special";
|
|
3
|
+
export interface ResourceDie {
|
|
4
|
+
base: string;
|
|
5
|
+
scaling?: Record<string, string>;
|
|
6
|
+
}
|
|
7
|
+
export interface ResourceRecovery {
|
|
8
|
+
id: string;
|
|
9
|
+
name: string;
|
|
10
|
+
amount: number | string;
|
|
11
|
+
action?: ActionCost;
|
|
12
|
+
uses?: number;
|
|
13
|
+
reset: ResetTrigger;
|
|
14
|
+
}
|
|
15
|
+
export interface ResourceScaleStep {
|
|
16
|
+
level: number;
|
|
17
|
+
max: string;
|
|
18
|
+
}
|
|
19
|
+
export interface ResourceConsumesLink {
|
|
20
|
+
resource: string;
|
|
21
|
+
amount: number;
|
|
22
|
+
}
|
|
23
|
+
export interface Resource {
|
|
24
|
+
id: string;
|
|
25
|
+
name: string;
|
|
26
|
+
max_formula: string;
|
|
27
|
+
scales_at?: ResourceScaleStep[];
|
|
28
|
+
die?: ResourceDie;
|
|
29
|
+
reset: ResetTrigger;
|
|
30
|
+
consumes?: ResourceConsumesLink;
|
|
31
|
+
recovery?: ResourceRecovery[];
|
|
32
|
+
}
|
|
33
|
+
export interface ResourceConsumption {
|
|
34
|
+
source?: "resource" | "class-column" | "attack-dice";
|
|
35
|
+
resource?: string;
|
|
36
|
+
column?: string;
|
|
37
|
+
amount: number;
|
|
38
|
+
expend_condition?: "roll_succeeds" | "roll_fails" | "target_takes_damage" | "always";
|
|
39
|
+
free_uses?: {
|
|
40
|
+
amount: number;
|
|
41
|
+
reset: ResetTrigger;
|
|
42
|
+
state_key?: string;
|
|
43
|
+
};
|
|
44
|
+
}
|
|
File without changes
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
/** A (sub)class-declared selectable pool (e.g. Interdict Boons). The engine is
|
|
2
|
+
* generic: every game-specific string lives here in data, never in code. */
|
|
3
|
+
export interface SelectionPool {
|
|
4
|
+
id: string;
|
|
5
|
+
label: string;
|
|
6
|
+
source: {
|
|
7
|
+
entity_type: "optional-feature";
|
|
8
|
+
where: {
|
|
9
|
+
feature_type: string;
|
|
10
|
+
available_to: "self";
|
|
11
|
+
};
|
|
12
|
+
};
|
|
13
|
+
/** Pick count read from the owning class table column at the current level. */
|
|
14
|
+
count: {
|
|
15
|
+
column: string;
|
|
16
|
+
};
|
|
17
|
+
replaceable?: boolean;
|
|
18
|
+
}
|
|
19
|
+
/** Subclass auto-grants that extend a named pool and do NOT count toward picks. */
|
|
20
|
+
export interface PoolGrant {
|
|
21
|
+
pool: string;
|
|
22
|
+
grants: Array<{
|
|
23
|
+
feature: string;
|
|
24
|
+
at_level: number;
|
|
25
|
+
}>;
|
|
26
|
+
}
|
|
27
|
+
/** Presentation hint for a data-declared tab. "text" reserved for later. */
|
|
28
|
+
export type PoolLayout = "spell-like" | "blocks";
|
|
29
|
+
/** A data-declared tab that renders a pool (one generic pool-tab per declaration). */
|
|
30
|
+
export interface TabDecl {
|
|
31
|
+
id: string;
|
|
32
|
+
label: string;
|
|
33
|
+
renders: {
|
|
34
|
+
pool: string;
|
|
35
|
+
layout?: PoolLayout;
|
|
36
|
+
};
|
|
37
|
+
}
|
|
File without changes
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import type { DocCodec } from "@archivist-gg/core";
|
|
2
|
+
import type { WeaponEntity } from "./weapon.types.js";
|
|
3
|
+
/**
|
|
4
|
+
* Normalizing codec (0c.1a). `parse` delegates to `parseWeapon`, which lifts
|
|
5
|
+
* embedded-string `properties` (e.g. `versatile (1d10)`, `thrown (range
|
|
6
|
+
* 20/60)`) into structured fields, validates against `weaponEntitySchema`
|
|
7
|
+
* (injecting the `properties: []` default), and captures any unknown top-level
|
|
8
|
+
* keys into `entity.raw`. `serialize` stays `yaml.dump` (the edit-save path
|
|
9
|
+
* uses obsidian's separate serializer; gate (d) verifies `yaml.dump`
|
|
10
|
+
* round-trips through `parseWeapon`).
|
|
11
|
+
*/
|
|
12
|
+
export declare const weaponCodec: DocCodec<WeaponEntity>;
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
import { z } from "zod";
|
|
2
|
+
export declare const weaponEntitySchema: z.ZodObject<{
|
|
3
|
+
name: z.ZodString;
|
|
4
|
+
slug: z.ZodString;
|
|
5
|
+
category: z.ZodString;
|
|
6
|
+
damage: z.ZodObject<{
|
|
7
|
+
dice: z.ZodString;
|
|
8
|
+
type: z.ZodString;
|
|
9
|
+
versatile_dice: z.ZodOptional<z.ZodString>;
|
|
10
|
+
}, z.core.$strip>;
|
|
11
|
+
properties: z.ZodDefault<z.ZodArray<z.ZodUnion<readonly [z.ZodString, z.ZodObject<{
|
|
12
|
+
kind: z.ZodLiteral<"conditional">;
|
|
13
|
+
uid: z.ZodString;
|
|
14
|
+
note: z.ZodString;
|
|
15
|
+
}, z.core.$strip>]>>>;
|
|
16
|
+
range: z.ZodOptional<z.ZodObject<{
|
|
17
|
+
normal: z.ZodNumber;
|
|
18
|
+
long: z.ZodNumber;
|
|
19
|
+
}, z.core.$strip>>;
|
|
20
|
+
reload: z.ZodOptional<z.ZodNumber>;
|
|
21
|
+
mastery: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
22
|
+
type_tags: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
23
|
+
ammo_type: z.ZodOptional<z.ZodString>;
|
|
24
|
+
weight: z.ZodOptional<z.ZodUnion<readonly [z.ZodNumber, z.ZodString]>>;
|
|
25
|
+
cost: z.ZodOptional<z.ZodString>;
|
|
26
|
+
source: z.ZodOptional<z.ZodString>;
|
|
27
|
+
page: z.ZodOptional<z.ZodNumber>;
|
|
28
|
+
edition: z.ZodEnum<{
|
|
29
|
+
2014: "2014";
|
|
30
|
+
2024: "2024";
|
|
31
|
+
}>;
|
|
32
|
+
entries: z.ZodOptional<z.ZodArray<z.ZodUnknown>>;
|
|
33
|
+
raw: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
|
|
34
|
+
}, z.core.$loose>;
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
import type { Edition } from "@archivist-gg/dnd5e/types/edition";
|
|
2
|
+
export type WeaponCategory = "simple-melee" | "simple-ranged" | "martial-melee" | "martial-ranged" | "natural" | string;
|
|
3
|
+
export type DamageType = "acid" | "bludgeoning" | "cold" | "fire" | "force" | "lightning" | "necrotic" | "piercing" | "poison" | "psychic" | "radiant" | "slashing" | "thunder";
|
|
4
|
+
export type ConditionalProperty = {
|
|
5
|
+
kind: "conditional";
|
|
6
|
+
uid: string;
|
|
7
|
+
note: string;
|
|
8
|
+
};
|
|
9
|
+
export type WeaponProperty = "finesse" | "light" | "heavy" | "two_handed" | "reach" | "special" | "thrown" | "ammunition" | "versatile" | "loading" | "range" | ConditionalProperty;
|
|
10
|
+
export type WeaponTypeTag = "sword" | "axe" | "bow" | "crossbow" | "club" | "dagger" | "firearm" | "hammer" | "lance" | "mace" | "net" | "polearm" | "rapier" | "spear" | "staff" | string;
|
|
11
|
+
export interface WeaponEntity {
|
|
12
|
+
name: string;
|
|
13
|
+
slug: string;
|
|
14
|
+
category: WeaponCategory;
|
|
15
|
+
damage: {
|
|
16
|
+
dice: string;
|
|
17
|
+
type: DamageType | string;
|
|
18
|
+
versatile_dice?: string;
|
|
19
|
+
};
|
|
20
|
+
properties: WeaponProperty[];
|
|
21
|
+
range?: {
|
|
22
|
+
normal: number;
|
|
23
|
+
long: number;
|
|
24
|
+
};
|
|
25
|
+
reload?: number;
|
|
26
|
+
mastery?: string[];
|
|
27
|
+
type_tags?: WeaponTypeTag[];
|
|
28
|
+
ammo_type?: string;
|
|
29
|
+
weight?: number | string;
|
|
30
|
+
cost?: string;
|
|
31
|
+
source?: string;
|
|
32
|
+
page?: number;
|
|
33
|
+
edition: Edition;
|
|
34
|
+
entries?: unknown[];
|
|
35
|
+
raw?: Record<string, unknown>;
|
|
36
|
+
}
|
|
File without changes
|
package/package.json
ADDED
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@archivist-gg/dnd5e",
|
|
3
|
+
"version": "0.1.0",
|
|
4
|
+
"license": "MIT",
|
|
5
|
+
"type": "module",
|
|
6
|
+
"publishConfig": {
|
|
7
|
+
"access": "public"
|
|
8
|
+
},
|
|
9
|
+
"types": "./dist/index.d.ts",
|
|
10
|
+
"exports": {
|
|
11
|
+
".": {
|
|
12
|
+
"types": "./dist/index.d.ts",
|
|
13
|
+
"default": "./dist/index.js"
|
|
14
|
+
},
|
|
15
|
+
"./*": {
|
|
16
|
+
"types": "./dist/*.d.ts",
|
|
17
|
+
"default": "./dist/*.js"
|
|
18
|
+
}
|
|
19
|
+
},
|
|
20
|
+
"dependencies": {
|
|
21
|
+
"@archivist-gg/core": "^0.1.0",
|
|
22
|
+
"js-yaml": "^4.1.0",
|
|
23
|
+
"zod": "^4.3.6"
|
|
24
|
+
},
|
|
25
|
+
"files": [
|
|
26
|
+
"dist",
|
|
27
|
+
"LICENSE",
|
|
28
|
+
"README.md",
|
|
29
|
+
"LICENSES/SRD.md",
|
|
30
|
+
"src/data-srd/ATTRIBUTION.md"
|
|
31
|
+
]
|
|
32
|
+
}
|