-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdhpack.schema.json
More file actions
226 lines (226 loc) · 7.41 KB
/
dhpack.schema.json
File metadata and controls
226 lines (226 loc) · 7.41 KB
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
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
{
"$schema": "https://json-schema.org/draft/2020-12/schema",
"$id": "https://cdn.jsdelivr.net/gh/gwillish/DaggerheartModels@main/schemas/dhpack.schema.json",
"title": "DHPack",
"description": "A .dhpack content pack for the Encounter app. Accepts either a pack wrapper object (recommended) or a bare adversary array (seansbox/daggerheart-srd export format).",
"oneOf": [
{ "$ref": "#/$defs/PackWrapper" },
{
"type": "array",
"items": { "$ref": "#/$defs/Adversary" },
"description": "Bare adversary array — seansbox/daggerheart-srd direct export format."
}
],
"$defs": {
"PackWrapper": {
"type": "object",
"description": "Recommended top-level structure. Supports adversaries, environments, or both.",
"properties": {
"$schema": {
"type": "string",
"description": "Optional $schema reference for editor validation."
},
"adversaries": {
"type": "array",
"items": { "$ref": "#/$defs/Adversary" },
"description": "Array of adversary objects to import."
},
"environments": {
"type": "array",
"items": { "$ref": "#/$defs/Environment" },
"description": "Array of environment objects to import."
}
},
"additionalProperties": false
},
"Adversary": {
"type": "object",
"description": "A Daggerheart adversary definition.",
"required": [
"name",
"tier",
"type",
"description",
"difficulty",
"hp",
"stress",
"atk",
"attack",
"range",
"damage"
],
"properties": {
"id": {
"type": "string",
"pattern": "^[a-z0-9][a-z0-9-]*$",
"description": "URL-safe slug, e.g. 'iron-golem'. Auto-derived from name if absent."
},
"name": {
"type": "string",
"minLength": 1,
"description": "Display name."
},
"source": {
"type": "string",
"description": "Pack name, author, or 'homebrew'. Stored lowercase."
},
"tier": {
"$ref": "#/$defs/IntOrNumericString",
"description": "PC level tier 1–4 this adversary is designed for."
},
"type": {
"type": "string",
"enum": [
"Bruiser",
"Horde",
"Leader",
"Minion",
"Ranged",
"Skulk",
"Social",
"Solo",
"Standard",
"Support"
],
"description": "Adversary role. Horde variant strings like 'Horde (3/HP)' are normalized to 'Horde' on import."
},
"description": {
"type": "string",
"minLength": 1,
"description": "One-line appearance or demeanor."
},
"motives_and_tactics": {
"type": "string",
"description": "GM-facing guidance on how to run this adversary."
},
"difficulty": {
"$ref": "#/$defs/IntOrNumericString",
"description": "DC for all player rolls against this adversary."
},
"thresholds": {
"type": "string",
"pattern": "^(None|\\d+/\\d+|\\d+/None|None/\\d+)$",
"description": "Combined major/severe threshold string, e.g. '8/15'. Use 'None' for minions with no damage thresholds. Provide either this field or threshold_major + threshold_severe."
},
"threshold_major": {
"type": "integer",
"minimum": 0,
"description": "Pre-split alternative to thresholds. Damage required for a Major hit."
},
"threshold_severe": {
"type": "integer",
"minimum": 0,
"description": "Pre-split alternative to thresholds. Damage required for a Severe hit."
},
"hp": {
"$ref": "#/$defs/IntOrNumericString",
"description": "Hit points."
},
"stress": {
"$ref": "#/$defs/IntOrNumericString",
"description": "Stress capacity."
},
"atk": {
"type": "string",
"pattern": "^[+-]\\d+$",
"description": "Attack modifier string, e.g. '+3' or '-1'."
},
"attack": {
"type": "string",
"minLength": 1,
"description": "Name of the standard attack or weapon."
},
"range": {
"type": "string",
"enum": ["Melee", "Very Close", "Close", "Far", "Very Far"],
"description": "Attack range."
},
"damage": {
"type": "string",
"pattern": "^\\d+d\\d+(\\+\\d+)?\\s+(phy|mag)$",
"description": "Damage expression, e.g. '1d12+2 phy' or '2d6 mag'."
},
"experience": {
"type": "string",
"description": "Optional experience tag, e.g. 'Tremor Sense +2'."
},
"feature": {
"type": "array",
"items": { "$ref": "#/$defs/Feature" },
"description": "Actions, reactions, and passives."
}
},
"oneOf": [
{
"required": ["thresholds"],
"description": "Combined threshold string variant."
},
{
"required": ["threshold_major", "threshold_severe"],
"description": "Pre-split threshold keys variant."
}
],
"additionalProperties": false
},
"Environment": {
"type": "object",
"description": "A Daggerheart environment — a scene element with features but no HP or Stress.",
"required": ["name", "description"],
"properties": {
"id": {
"type": "string",
"pattern": "^[a-z0-9][a-z0-9-]*$",
"description": "URL-safe slug. Auto-derived from name if absent."
},
"name": {
"type": "string",
"minLength": 1
},
"source": {
"type": "string",
"description": "Pack name or author. Stored lowercase."
},
"description": {
"type": "string",
"minLength": 1
},
"feature": {
"type": "array",
"items": { "$ref": "#/$defs/Feature" },
"description": "Passives, reactions, and actions this environment contributes to the scene."
}
},
"additionalProperties": false
},
"Feature": {
"type": "object",
"description": "A named action, reaction, or passive on an adversary or environment.",
"required": ["name", "text"],
"properties": {
"name": {
"type": "string",
"minLength": 1,
"description": "Unique name within this adversary or environment. May include a ' - Type' suffix (e.g. 'Bite - Action') to allow feat_type to be inferred."
},
"text": {
"type": "string",
"minLength": 1,
"description": "Rules text."
},
"feat_type": {
"type": "string",
"enum": ["action", "reaction", "passive"],
"description": "Feature category. If absent, inferred from a ' - Action' or ' - Reaction' suffix in name; defaults to 'passive'."
}
},
"additionalProperties": false
},
"IntOrNumericString": {
"description": "Accepts either a JSON integer or a string containing an integer, for compatibility with SRD tooling that serializes all numeric fields as strings.",
"oneOf": [
{ "type": "integer" },
{ "type": "string", "pattern": "^\\d+$" }
]
}
}
}