@optolith/database-schema 0.77.1 → 0.79.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/CHANGELOG.md +34 -0
- package/gen/types.d.ts +217 -3
- package/lib/cache/activatableSelectOptions.d.ts +2 -2
- package/lib/cache/activatableSelectOptions.js +2 -58
- package/lib/types/Advantage.d.ts +29 -0
- package/lib/types/Advantage.js +2 -1
- package/lib/types/Culture.d.ts +1 -0
- package/lib/types/Culture.js +5 -1
- package/lib/types/Disadvantage.d.ts +29 -0
- package/lib/types/Disadvantage.js +2 -1
- package/lib/types/Locale.d.ts +10 -0
- package/lib/types/Locale.js +11 -0
- package/lib/types/Profession.d.ts +178 -154
- package/lib/types/Profession.js +40 -1
- package/lib/types/Race.d.ts +1 -0
- package/lib/types/Race.js +10 -0
- package/lib/types/_ActivatableSelectOptions.d.ts +939 -0
- package/lib/types/_ActivatableSelectOptions.js +178 -117
- package/lib/types/equipment/item/EquipmentCategory.d.ts +15 -0
- package/lib/types/equipment/item/EquipmentCategory.js +5 -0
- package/lib/types/equipment/item/IlluminationLightSource.d.ts +9 -0
- package/lib/types/equipment/item/IlluminationLightSource.js +1 -1
- package/lib/types/equipment/item/Item.d.ts +9 -0
- package/lib/types/equipment/item/Item.js +6 -0
- package/lib/types/prerequisites/single/ActivatablePrerequisite.js +2 -0
- package/lib/types/specialAbility/AdvancedCombatSpecialAbility.d.ts +29 -0
- package/lib/types/specialAbility/AdvancedCombatSpecialAbility.js +2 -1
- package/lib/types/specialAbility/AdvancedKarmaSpecialAbility.d.ts +29 -0
- package/lib/types/specialAbility/AdvancedKarmaSpecialAbility.js +2 -1
- package/lib/types/specialAbility/AdvancedMagicalSpecialAbility.d.ts +29 -0
- package/lib/types/specialAbility/AdvancedMagicalSpecialAbility.js +2 -1
- package/lib/types/specialAbility/AdvancedSkillSpecialAbility.d.ts +29 -0
- package/lib/types/specialAbility/AdvancedSkillSpecialAbility.js +2 -1
- package/lib/types/specialAbility/AncestorGlyph.d.ts +29 -0
- package/lib/types/specialAbility/AncestorGlyph.js +2 -1
- package/lib/types/specialAbility/BlessedTradition.d.ts +29 -0
- package/lib/types/specialAbility/BlessedTradition.js +2 -1
- package/lib/types/specialAbility/BrawlingSpecialAbility.d.ts +29 -0
- package/lib/types/specialAbility/BrawlingSpecialAbility.js +2 -1
- package/lib/types/specialAbility/CeremonialItemSpecialAbility.d.ts +29 -0
- package/lib/types/specialAbility/CeremonialItemSpecialAbility.js +2 -1
- package/lib/types/specialAbility/CombatSpecialAbility.d.ts +29 -0
- package/lib/types/specialAbility/CombatSpecialAbility.js +2 -1
- package/lib/types/specialAbility/CombatStyleSpecialAbility.d.ts +29 -0
- package/lib/types/specialAbility/CombatStyleSpecialAbility.js +3 -2
- package/lib/types/specialAbility/CommandSpecialAbility.d.ts +29 -0
- package/lib/types/specialAbility/CommandSpecialAbility.js +2 -1
- package/lib/types/specialAbility/FamiliarSpecialAbility.d.ts +29 -0
- package/lib/types/specialAbility/FamiliarSpecialAbility.js +2 -1
- package/lib/types/specialAbility/FatePointSexSpecialAbility.d.ts +29 -0
- package/lib/types/specialAbility/FatePointSexSpecialAbility.js +2 -1
- package/lib/types/specialAbility/FatePointSpecialAbility.d.ts +29 -0
- package/lib/types/specialAbility/FatePointSpecialAbility.js +2 -1
- package/lib/types/specialAbility/GeneralSpecialAbility.d.ts +29 -0
- package/lib/types/specialAbility/GeneralSpecialAbility.js +2 -1
- package/lib/types/specialAbility/KarmaSpecialAbility.d.ts +29 -0
- package/lib/types/specialAbility/KarmaSpecialAbility.js +2 -1
- package/lib/types/specialAbility/LiturgicalStyleSpecialAbility.d.ts +29 -0
- package/lib/types/specialAbility/LiturgicalStyleSpecialAbility.js +2 -1
- package/lib/types/specialAbility/LycantropicGift.d.ts +29 -0
- package/lib/types/specialAbility/LycantropicGift.js +2 -1
- package/lib/types/specialAbility/MagicStyleSpecialAbility.d.ts +29 -0
- package/lib/types/specialAbility/MagicStyleSpecialAbility.js +2 -1
- package/lib/types/specialAbility/MagicalSpecialAbility.d.ts +29 -0
- package/lib/types/specialAbility/MagicalSpecialAbility.js +2 -1
- package/lib/types/specialAbility/MagicalTradition.d.ts +29 -0
- package/lib/types/specialAbility/MagicalTradition.js +2 -1
- package/lib/types/specialAbility/PactGift.d.ts +29 -0
- package/lib/types/specialAbility/PactGift.js +2 -1
- package/lib/types/specialAbility/ProtectiveWardingCircleSpecialAbility.d.ts +29 -0
- package/lib/types/specialAbility/ProtectiveWardingCircleSpecialAbility.js +2 -1
- package/lib/types/specialAbility/Sermon.d.ts +29 -0
- package/lib/types/specialAbility/Sermon.js +2 -1
- package/lib/types/specialAbility/SexSpecialAbility.d.ts +29 -0
- package/lib/types/specialAbility/SexSpecialAbility.js +2 -1
- package/lib/types/specialAbility/SikaryanDrainSpecialAbility.d.ts +29 -0
- package/lib/types/specialAbility/SikaryanDrainSpecialAbility.js +2 -1
- package/lib/types/specialAbility/SkillStyleSpecialAbility.d.ts +29 -0
- package/lib/types/specialAbility/SkillStyleSpecialAbility.js +2 -1
- package/lib/types/specialAbility/VampiricGift.d.ts +29 -0
- package/lib/types/specialAbility/VampiricGift.js +2 -1
- package/lib/types/specialAbility/Vision.d.ts +29 -0
- package/lib/types/specialAbility/Vision.js +2 -1
- package/lib/types/traditionArtifacts/ArcaneOrbEnchantment.d.ts +1 -1493
- package/lib/types/traditionArtifacts/ArcaneOrbEnchantment.js +2 -34
- package/lib/types/traditionArtifacts/AttireEnchantment.d.ts +1 -1493
- package/lib/types/traditionArtifacts/AttireEnchantment.js +2 -34
- package/lib/types/traditionArtifacts/Beutelzauber.d.ts +1 -1493
- package/lib/types/traditionArtifacts/Beutelzauber.js +2 -34
- package/lib/types/traditionArtifacts/BowlEnchantment.d.ts +1 -1493
- package/lib/types/traditionArtifacts/BowlEnchantment.js +2 -34
- package/lib/types/traditionArtifacts/CauldronEnchantment.d.ts +1 -1493
- package/lib/types/traditionArtifacts/CauldronEnchantment.js +5 -36
- package/lib/types/traditionArtifacts/ChronicleEnchantment.d.ts +1 -1493
- package/lib/types/traditionArtifacts/ChronicleEnchantment.js +2 -34
- package/lib/types/traditionArtifacts/DaggerRitual.d.ts +1 -1499
- package/lib/types/traditionArtifacts/DaggerRitual.js +5 -34
- package/lib/types/traditionArtifacts/FoolsHatEnchantment.d.ts +1 -1493
- package/lib/types/traditionArtifacts/FoolsHatEnchantment.js +2 -34
- package/lib/types/traditionArtifacts/Haubenzauber.d.ts +1 -1493
- package/lib/types/traditionArtifacts/Haubenzauber.js +2 -34
- package/lib/types/traditionArtifacts/Hauerkettenzauber.d.ts +1 -464
- package/lib/types/traditionArtifacts/Hauerkettenzauber.js +2 -31
- package/lib/types/traditionArtifacts/InstrumentEnchantment.d.ts +1 -1493
- package/lib/types/traditionArtifacts/InstrumentEnchantment.js +2 -34
- package/lib/types/traditionArtifacts/Keulenzauber.d.ts +1 -464
- package/lib/types/traditionArtifacts/Keulenzauber.js +2 -31
- package/lib/types/traditionArtifacts/Krallenkettenzauber.d.ts +1 -1493
- package/lib/types/traditionArtifacts/Krallenkettenzauber.js +2 -34
- package/lib/types/traditionArtifacts/Kristallkugelzauber.d.ts +1 -1493
- package/lib/types/traditionArtifacts/Kristallkugelzauber.js +2 -34
- package/lib/types/traditionArtifacts/OrbEnchantment.d.ts +1 -1493
- package/lib/types/traditionArtifacts/OrbEnchantment.js +2 -34
- package/lib/types/traditionArtifacts/RingEnchantment.d.ts +1 -1493
- package/lib/types/traditionArtifacts/RingEnchantment.js +2 -34
- package/lib/types/traditionArtifacts/Schweinetrommelzauber.d.ts +1 -464
- package/lib/types/traditionArtifacts/Schweinetrommelzauber.js +2 -31
- package/lib/types/traditionArtifacts/SickleRitual.d.ts +1 -1493
- package/lib/types/traditionArtifacts/SickleRitual.js +2 -34
- package/lib/types/traditionArtifacts/SpellSwordEnchantment.d.ts +1 -1493
- package/lib/types/traditionArtifacts/SpellSwordEnchantment.js +2 -34
- package/lib/types/traditionArtifacts/StaffEnchantment.d.ts +1 -1493
- package/lib/types/traditionArtifacts/StaffEnchantment.js +2 -34
- package/lib/types/traditionArtifacts/ToyEnchantment.d.ts +1 -1493
- package/lib/types/traditionArtifacts/ToyEnchantment.js +2 -34
- package/lib/types/traditionArtifacts/Trinkhornzauber.d.ts +1 -1493
- package/lib/types/traditionArtifacts/Trinkhornzauber.js +2 -34
- package/lib/types/traditionArtifacts/WandEnchantment.d.ts +1 -1455
- package/lib/types/traditionArtifacts/WandEnchantment.js +3 -33
- package/lib/types/traditionArtifacts/WeaponEnchantment.d.ts +1 -1493
- package/lib/types/traditionArtifacts/WeaponEnchantment.js +2 -34
- package/lib/types/traditionArtifacts/_shared.d.ts +10 -0
- package/lib/types/traditionArtifacts/_shared.js +40 -3
- package/package.json +1 -1
|
@@ -1,4 +1,6 @@
|
|
|
1
|
+
import { isEmpty, isNotEmpty } from "@elyukai/utils/array/nonEmpty";
|
|
1
2
|
import * as DB from "tsondb/schema/dsl";
|
|
3
|
+
import { Case, fromUniformCase, } from "tsondb/schema/gen";
|
|
2
4
|
import { NestedTranslationMap } from "./Locale.js";
|
|
3
5
|
import { SelectOptionCategory } from "./_ActivatableSelectOptionCategory.js";
|
|
4
6
|
import { NewSkillApplication, SkillUse } from "./_ActivatableSkillApplicationsAndUses.js";
|
|
@@ -16,6 +18,10 @@ Note that this is only a full definition of options for simple logic that can be
|
|
|
16
18
|
comment: `An entry category with optional further configuration. All available entries from the specified categories will be included as separate select options. You can also specify a set of groups that should only be included. Groups not mentioned will be excluded then.`,
|
|
17
19
|
type: DB.IncludeIdentifier(SelectOptionCategory),
|
|
18
20
|
}),
|
|
21
|
+
rules: DB.Optional({
|
|
22
|
+
comment: `Rules for how options can be selected and relate to each other. Defaults to a single predefined option if the entry has select options defined, otherwise undefined.`,
|
|
23
|
+
type: DB.IncludeIdentifier(SelectOptionRules),
|
|
24
|
+
}),
|
|
19
25
|
}, { minProperties: 1 }),
|
|
20
26
|
});
|
|
21
27
|
export const select_options = DB.Optional({
|
|
@@ -99,120 +105,175 @@ export const explicit_select_options = DB.Required({
|
|
|
99
105
|
Note that this is only a full definition of options for simple logic that can be made explicit using the more detailed configuration for both derived categories and explicit options. There are quite a few entries whose option logic cannot be fully represented here, so that it needs to be implemented manually.`,
|
|
100
106
|
type: DB.ChildEntities(GeneralSelectOption),
|
|
101
107
|
});
|
|
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
|
-
|
|
108
|
+
const ChildEntityForSelectOption = DB.Enum(import.meta.url, {
|
|
109
|
+
name: "ChildEntityForSelectOption",
|
|
110
|
+
comment: `The possible child entities for select options.`,
|
|
111
|
+
values: () => ({
|
|
112
|
+
SkillApplication: DB.EnumCase({ type: null }),
|
|
113
|
+
}),
|
|
114
|
+
});
|
|
115
|
+
const ChildSelectOptionRuleValue = DB.TypeAlias(import.meta.url, {
|
|
116
|
+
name: "ChildSelectOptionRuleValue",
|
|
117
|
+
type: () => DB.Object({
|
|
118
|
+
parentIndex: DB.Required({
|
|
119
|
+
comment: "The index of the parent select option in the list of selected options.",
|
|
120
|
+
type: DB.Integer({ minimum: 0 }),
|
|
121
|
+
}),
|
|
122
|
+
entity: DB.Required({
|
|
123
|
+
comment: "The entity you can choose from.",
|
|
124
|
+
type: DB.IncludeIdentifier(ChildEntityForSelectOption),
|
|
125
|
+
}),
|
|
126
|
+
}),
|
|
127
|
+
});
|
|
128
|
+
const PredefinedOrTextInputSelectOptionRuleValue = DB.TypeAlias(import.meta.url, {
|
|
129
|
+
name: "PredefinedOrTextInputSelectOptionRuleValue",
|
|
130
|
+
type: () => DB.Object({
|
|
131
|
+
translations: NestedTranslationMap(DB.Required, "PredefinedOrTextInputSelectOptionRuleValue", DB.Object({
|
|
132
|
+
inputLabel: DB.Required({
|
|
133
|
+
comment: "The label for the text input field.",
|
|
134
|
+
type: DB.String({ minLength: 1 }),
|
|
135
|
+
}),
|
|
136
|
+
optionLabel: DB.Required({
|
|
137
|
+
comment: "The label for the extra option in the list of select options that unlocks the text input field.",
|
|
138
|
+
type: DB.String({ minLength: 1 }),
|
|
139
|
+
}),
|
|
140
|
+
})),
|
|
141
|
+
}),
|
|
142
|
+
});
|
|
143
|
+
const TextInputSelectOptionRuleValue = DB.TypeAlias(import.meta.url, {
|
|
144
|
+
name: "TextInputSelectOptionRuleValue",
|
|
145
|
+
type: () => DB.Object({
|
|
146
|
+
translations: NestedTranslationMap(DB.Required, "TextInputSelectOptionRuleValue", DB.Object({
|
|
147
|
+
inputLabel: DB.Required({
|
|
148
|
+
comment: "The label for the text input field.",
|
|
149
|
+
type: DB.String({ minLength: 1 }),
|
|
150
|
+
}),
|
|
151
|
+
})),
|
|
152
|
+
}),
|
|
153
|
+
});
|
|
154
|
+
const SelectOptionRuleValue = DB.Enum(import.meta.url, {
|
|
155
|
+
name: "SelectOptionRuleValue",
|
|
156
|
+
comment: `The possible values for select option rules.`,
|
|
157
|
+
values: () => ({
|
|
158
|
+
Predefined: DB.EnumCase({
|
|
159
|
+
comment: "An entry that has been defined explicitly or derived from a category.",
|
|
160
|
+
type: null,
|
|
161
|
+
}),
|
|
162
|
+
PredefinedOrTextInput: DB.EnumCase({
|
|
163
|
+
comment: "An entry that has been defined explicitly or derived from a category, or a text input if the user sees none of the predefined options fit.",
|
|
164
|
+
type: DB.IncludeIdentifier(PredefinedOrTextInputSelectOptionRuleValue),
|
|
165
|
+
}),
|
|
166
|
+
Child: DB.EnumCase({
|
|
167
|
+
comment: "A child instance of a selected entry, e.g. a skill application for a skill.",
|
|
168
|
+
type: DB.IncludeIdentifier(ChildSelectOptionRuleValue),
|
|
169
|
+
}),
|
|
170
|
+
TextInput: DB.EnumCase({
|
|
171
|
+
comment: "A text input field that can be filled in by the user.",
|
|
172
|
+
type: DB.IncludeIdentifier(TextInputSelectOptionRuleValue),
|
|
173
|
+
}),
|
|
174
|
+
}),
|
|
175
|
+
});
|
|
176
|
+
const SelectOptionRuleMultiple = DB.Enum(import.meta.url, {
|
|
177
|
+
name: "SelectOptionRuleMultiple",
|
|
178
|
+
values: () => ({
|
|
179
|
+
Constant: DB.EnumCase({
|
|
180
|
+
comment: "A fixed number of options that have to be selected.",
|
|
181
|
+
type: DB.Integer({ minimum: 2 }),
|
|
182
|
+
}),
|
|
183
|
+
Range: DB.EnumCase({
|
|
184
|
+
comment: "A range of numbers of options that can be selected.",
|
|
185
|
+
type: DB.Object({
|
|
186
|
+
min: DB.Optional({
|
|
187
|
+
comment: "The minimum number of options that need to be selected. If left empty it defaults to 1.",
|
|
188
|
+
type: DB.Integer({ minimum: 2 }),
|
|
189
|
+
}),
|
|
190
|
+
max: DB.Required({
|
|
191
|
+
comment: "The maximum number of options that need to be selected.",
|
|
192
|
+
type: DB.Integer({ minimum: 2 }),
|
|
193
|
+
}),
|
|
194
|
+
}),
|
|
195
|
+
}),
|
|
196
|
+
}),
|
|
197
|
+
});
|
|
198
|
+
const SelectOptionRule = DB.TypeAlias(import.meta.url, {
|
|
199
|
+
name: "SelectOptionRule",
|
|
200
|
+
comment: `A rule for how options can be selected and relate to each other.`,
|
|
201
|
+
type: () => DB.Object({
|
|
202
|
+
value: DB.Required({
|
|
203
|
+
comment: "The value of the rule.",
|
|
204
|
+
type: DB.IncludeIdentifier(SelectOptionRuleValue),
|
|
205
|
+
}),
|
|
206
|
+
multiple: DB.Optional({
|
|
207
|
+
comment: "Sometimes, multiple options from a single list have to or can be chosen.",
|
|
208
|
+
type: DB.IncludeIdentifier(SelectOptionRuleMultiple),
|
|
209
|
+
}),
|
|
210
|
+
}),
|
|
211
|
+
});
|
|
212
|
+
export const SelectOptionRules = DB.TypeAlias(import.meta.url, {
|
|
213
|
+
name: "SelectOptionRules",
|
|
214
|
+
comment: `Rules for how options can be selected and relate to each other. Defaults to a single predefined option if the entry has select options defined, otherwise undefined.`,
|
|
215
|
+
type: () => DB.Array(DB.IncludeIdentifier(SelectOptionRule), { minItems: 1 }),
|
|
216
|
+
});
|
|
217
|
+
export const verifySelectOptionRules = (_entity, deps) => {
|
|
218
|
+
const errorMessages = [];
|
|
219
|
+
const rules = deps.instanceContent.select_options?.rules;
|
|
220
|
+
if (rules) {
|
|
221
|
+
const normalizedRules = rules.flatMap(rule => rule.multiple
|
|
222
|
+
? Array.from({
|
|
223
|
+
length: rule.multiple.kind === "Constant"
|
|
224
|
+
? rule.multiple.Constant
|
|
225
|
+
: rule.multiple.Range.max,
|
|
226
|
+
}, () => rule)
|
|
227
|
+
: [rule]);
|
|
228
|
+
for (const [ruleIndex, rule] of rules.entries()) {
|
|
229
|
+
if (rule.multiple?.kind === "Range" && ruleIndex !== rules.length - 1) {
|
|
230
|
+
errorMessages.push("A select option rule with a range of multiple options can only be the last rule in the list.");
|
|
231
|
+
}
|
|
232
|
+
if (rule.value.kind === "Child") {
|
|
233
|
+
const parentRule = normalizedRules[rule.value.Child.parentIndex];
|
|
234
|
+
if (!parentRule || parentRule.value.kind !== "Predefined") {
|
|
235
|
+
errorMessages.push("A child select option rule must reference a predefined select option rule as its parent.");
|
|
236
|
+
}
|
|
237
|
+
}
|
|
238
|
+
}
|
|
239
|
+
}
|
|
240
|
+
return errorMessages;
|
|
241
|
+
};
|
|
242
|
+
/**
|
|
243
|
+
* Stub for once option rules are formalized in the database schema.
|
|
244
|
+
*/
|
|
245
|
+
export const verifyOptionsForActivatableEntry = (value, getInstanceById, getAllChildInstancesForParent) => {
|
|
246
|
+
if (value.id.kind === "Enhancement") {
|
|
247
|
+
return [];
|
|
248
|
+
}
|
|
249
|
+
const referencedInstance = getInstanceById(value.id);
|
|
250
|
+
if (!referencedInstance) {
|
|
251
|
+
return [
|
|
252
|
+
`Referenced instance of entity ${value.id.kind} with id ${fromUniformCase(value.id)} not found.`,
|
|
253
|
+
];
|
|
254
|
+
}
|
|
255
|
+
const generalSelectOptions = getAllChildInstancesForParent("GeneralSelectOption", value.id);
|
|
256
|
+
const errorMessages = [];
|
|
257
|
+
if (!("levels" in referencedInstance && typeof referencedInstance.levels === "number") &&
|
|
258
|
+
value.level !== undefined) {
|
|
259
|
+
errorMessages.push(`The referenced instance of entity ${value.id.kind} with id ${fromUniformCase(value.id)} does not have levels, but a level was specified in the prerequisite.`);
|
|
260
|
+
}
|
|
261
|
+
if ((("select_options" in referencedInstance &&
|
|
262
|
+
referencedInstance.select_options?.derived !== undefined) ||
|
|
263
|
+
isNotEmpty(generalSelectOptions)) &&
|
|
264
|
+
(value.options === undefined || isEmpty(value.options))) {
|
|
265
|
+
errorMessages.push(`The referenced instance of entity ${value.id.kind} with id ${fromUniformCase(value.id)} has select options, but no options were specified in the prerequisite.`);
|
|
266
|
+
}
|
|
267
|
+
for (const option of value.options ?? []) {
|
|
268
|
+
if (option.kind === "General") {
|
|
269
|
+
const referencedOption = getInstanceById(Case("GeneralSelectOption", option.General));
|
|
270
|
+
if (!referencedOption) {
|
|
271
|
+
errorMessages.push(`Referenced select option of entity GeneralSelectOption with id ${fromUniformCase(option)} not found.`);
|
|
272
|
+
}
|
|
273
|
+
if (referencedOption?.parent !== value.id) {
|
|
274
|
+
errorMessages.push(`Referenced select option of entity GeneralSelectOption with id ${fromUniformCase(option)} does not belong to the instance of entity ${value.id.kind} with id ${fromUniformCase(value.id)}.`);
|
|
275
|
+
}
|
|
276
|
+
}
|
|
277
|
+
}
|
|
278
|
+
return [];
|
|
279
|
+
};
|
|
@@ -33,6 +33,11 @@ declare const EquipmentCategoryType: DB.Enum<"EquipmentCategoryType", {
|
|
|
33
33
|
Optional: DB.EnumCase<null>;
|
|
34
34
|
Prohibited: DB.EnumCase<null>;
|
|
35
35
|
}, []>>, true>;
|
|
36
|
+
burningTime: DB.MemberDecl<DB.IncludeIdentifier<[], DB.Enum<"ValueRule", {
|
|
37
|
+
Required: DB.EnumCase<null>;
|
|
38
|
+
Optional: DB.EnumCase<null>;
|
|
39
|
+
Prohibited: DB.EnumCase<null>;
|
|
40
|
+
}, []>>, true>;
|
|
36
41
|
}>, []>>>;
|
|
37
42
|
Special: DB.EnumCase<DB.IncludeIdentifier<[], DB.Enum<"SpecialEquipmentCategoryEntity", {
|
|
38
43
|
AnimalCare: DB.EnumCase<null>;
|
|
@@ -69,6 +74,11 @@ declare const DefaultEquipmentCategoryTypeRules: DB.TypeAlias<"DefaultEquipmentC
|
|
|
69
74
|
Optional: DB.EnumCase<null>;
|
|
70
75
|
Prohibited: DB.EnumCase<null>;
|
|
71
76
|
}, []>>, true>;
|
|
77
|
+
burningTime: DB.MemberDecl<DB.IncludeIdentifier<[], DB.Enum<"ValueRule", {
|
|
78
|
+
Required: DB.EnumCase<null>;
|
|
79
|
+
Optional: DB.EnumCase<null>;
|
|
80
|
+
Prohibited: DB.EnumCase<null>;
|
|
81
|
+
}, []>>, true>;
|
|
72
82
|
}>, []>;
|
|
73
83
|
export declare const EquipmentCategory: DB.Entity<"EquipmentCategory", {
|
|
74
84
|
position: DB.MemberDecl<DB.Integer, true>;
|
|
@@ -98,6 +108,11 @@ export declare const EquipmentCategory: DB.Entity<"EquipmentCategory", {
|
|
|
98
108
|
Optional: DB.EnumCase<null>;
|
|
99
109
|
Prohibited: DB.EnumCase<null>;
|
|
100
110
|
}, []>>, true>;
|
|
111
|
+
burningTime: DB.MemberDecl<DB.IncludeIdentifier<[], DB.Enum<"ValueRule", {
|
|
112
|
+
Required: DB.EnumCase<null>;
|
|
113
|
+
Optional: DB.EnumCase<null>;
|
|
114
|
+
Prohibited: DB.EnumCase<null>;
|
|
115
|
+
}, []>>, true>;
|
|
101
116
|
}>, []>>>;
|
|
102
117
|
Special: DB.EnumCase<DB.IncludeIdentifier<[], DB.Enum<"SpecialEquipmentCategoryEntity", {
|
|
103
118
|
AnimalCare: DB.EnumCase<null>;
|
|
@@ -68,6 +68,10 @@ const DefaultEquipmentCategoryTypeRules = DB.TypeAlias(import.meta.url, {
|
|
|
68
68
|
comment: "Presence of complexity to certain groups for items in this category.",
|
|
69
69
|
type: DB.IncludeIdentifier(ValueRule),
|
|
70
70
|
}),
|
|
71
|
+
burningTime: DB.Required({
|
|
72
|
+
comment: "Presence of burning time to certain groups for items in this category.",
|
|
73
|
+
type: DB.IncludeIdentifier(ValueRule),
|
|
74
|
+
}),
|
|
71
75
|
}),
|
|
72
76
|
});
|
|
73
77
|
const SpecialEquipmentCategoryEntity = DB.Enum(import.meta.url, {
|
|
@@ -128,4 +132,5 @@ export const mergeAllValueRules = (categories) => ({
|
|
|
128
132
|
structurePoints: { kind: mergeValueRules(categories.map(category => category.structurePoints)) },
|
|
129
133
|
weight: { kind: mergeValueRules(categories.map(category => category.weight)) },
|
|
130
134
|
complexity: { kind: mergeValueRules(categories.map(category => category.complexity)) },
|
|
135
|
+
burningTime: { kind: mergeValueRules(categories.map(category => category.burningTime)) },
|
|
131
136
|
});
|
|
@@ -249,3 +249,12 @@ export declare const IlluminationLightSource: DB.Entity<"IlluminationLightSource
|
|
|
249
249
|
}>, []>>>, []>>, false>;
|
|
250
250
|
}>, true>;
|
|
251
251
|
}, undefined>;
|
|
252
|
+
export declare const BurningTime: DB.Enum<"BurningTime", {
|
|
253
|
+
Unlimited: DB.EnumCase<null>;
|
|
254
|
+
Limited: DB.EnumCase<DB.IncludeIdentifier<[], DB.TypeAlias<"LimitedBurningTime", DB.Object<{
|
|
255
|
+
value: DB.MemberDecl<DB.Float, true>;
|
|
256
|
+
unit: DB.MemberDecl<DB.IncludeIdentifier<[], DB.Enum<"LimitedBurningTimeUnit", {
|
|
257
|
+
Hours: DB.EnumCase<null>;
|
|
258
|
+
}, []>>, true>;
|
|
259
|
+
}>, []>>>;
|
|
260
|
+
}, []>;
|
|
@@ -50,7 +50,7 @@ export const IlluminationLightSource = DB.Entity(import.meta.url, {
|
|
|
50
50
|
return [];
|
|
51
51
|
},
|
|
52
52
|
});
|
|
53
|
-
const BurningTime = DB.Enum(import.meta.url, {
|
|
53
|
+
export const BurningTime = DB.Enum(import.meta.url, {
|
|
54
54
|
name: "BurningTime",
|
|
55
55
|
values: () => ({
|
|
56
56
|
Unlimited: DB.EnumCase({ type: null }),
|
|
@@ -71,6 +71,15 @@ export declare const Item: DB.Entity<"Item", {
|
|
|
71
71
|
structurePoints: DB.MemberDecl<DB.IncludeIdentifier<[], DB.TypeAlias<"StructurePoints", DB.Array<DB.IncludeIdentifier<[], DB.TypeAlias<"StructurePointsComponent", DB.Object<{
|
|
72
72
|
points: DB.MemberDecl<DB.Integer, true>;
|
|
73
73
|
}>, []>>>, []>>, true>;
|
|
74
|
+
burningTime: DB.MemberDecl<DB.IncludeIdentifier<[], DB.Enum<"BurningTime", {
|
|
75
|
+
Unlimited: DB.EnumCase<null>;
|
|
76
|
+
Limited: DB.EnumCase<DB.IncludeIdentifier<[], DB.TypeAlias<"LimitedBurningTime", DB.Object<{
|
|
77
|
+
value: DB.MemberDecl<DB.Float, true>;
|
|
78
|
+
unit: DB.MemberDecl<DB.IncludeIdentifier<[], DB.Enum<"LimitedBurningTimeUnit", {
|
|
79
|
+
Hours: DB.EnumCase<null>;
|
|
80
|
+
}, []>>, true>;
|
|
81
|
+
}>, []>>>;
|
|
82
|
+
}, []>>, false>;
|
|
74
83
|
meleeUses: DB.MemberDecl<DB.NestedEntityMap<string, {
|
|
75
84
|
damage: DB.MemberDecl<DB.TypeArgument<DB.Param<"Damage", DB.Type>>, true>;
|
|
76
85
|
damage_threshold: DB.MemberDecl<DB.IncludeIdentifier<[], DB.Enum<"PrimaryAttributeDamageThreshold", {
|
|
@@ -12,6 +12,7 @@ import { RangedWeapon } from "./_RangedWeapon.js";
|
|
|
12
12
|
import { checkWeaponCombatTechniqueIntegrity } from "./_Weapon.js";
|
|
13
13
|
import { SecondaryArmor } from "./Armor.js";
|
|
14
14
|
import { isEquipmentCategoryOfDefaultType, mergeAllValueRules } from "./EquipmentCategory.js";
|
|
15
|
+
import { BurningTime } from "./IlluminationLightSource.js";
|
|
15
16
|
export const Item = DB.Entity(import.meta.url, {
|
|
16
17
|
name: "Item",
|
|
17
18
|
namePlural: "Items",
|
|
@@ -36,6 +37,10 @@ export const Item = DB.Entity(import.meta.url, {
|
|
|
36
37
|
comment: "The structure points of the item. Use an array if the item consists of multiple components that have individual structure points.",
|
|
37
38
|
type: DB.IncludeIdentifier(StructurePoints),
|
|
38
39
|
}),
|
|
40
|
+
burningTime: DB.Optional({
|
|
41
|
+
comment: "The burning time is the time how long the light source can be lit. After that time you have to use a new light source.",
|
|
42
|
+
type: DB.IncludeIdentifier(BurningTime),
|
|
43
|
+
}),
|
|
39
44
|
meleeUses: DB.Optional({
|
|
40
45
|
comment: "A list of stat blocks for each close combat technique this weapon can be used with.",
|
|
41
46
|
type: DB.NestedEntityMap({
|
|
@@ -149,6 +154,7 @@ const checkEquipmentCategoryConstraintsWithItem = (item, getInstanceById) => {
|
|
|
149
154
|
applyValueRule(mergedRules.restrictedTo, item.restrictedTo, "Restriction are");
|
|
150
155
|
applyValueRule(mergedRules.structurePoints, item.structurePoints, "Structure points are");
|
|
151
156
|
applyValueRule(mergedRules.weight, item.weight, "A weight is");
|
|
157
|
+
applyValueRule(mergedRules.burningTime, item.burningTime, "A burning time is");
|
|
152
158
|
return errors;
|
|
153
159
|
}
|
|
154
160
|
else {
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import * as DB from "tsondb/schema/dsl";
|
|
2
|
+
import { verifyOptionsForActivatableEntry } from "../../_ActivatableSelectOptions.js";
|
|
2
3
|
import { ActivatableIdentifier, RequirableSelectOptionIdentifier } from "../../_IdentifierGroup.js";
|
|
3
4
|
import { Preconditions } from "../ConditionalPrerequisites.js";
|
|
4
5
|
import { DisplayOption } from "../DisplayOption.js";
|
|
@@ -29,4 +30,5 @@ export const ActivatablePrerequisite = DB.TypeAlias(import.meta.url, {
|
|
|
29
30
|
type: DB.IncludeIdentifier(Preconditions),
|
|
30
31
|
}),
|
|
31
32
|
}),
|
|
33
|
+
customConstraints: ({ instanceContent, getInstanceById, getAllChildInstancesForParent }) => verifyOptionsForActivatableEntry(instanceContent, getInstanceById, getAllChildInstancesForParent),
|
|
32
34
|
});
|
|
@@ -850,6 +850,35 @@ export declare const AdvancedCombatSpecialAbility: DB.Entity<"AdvancedCombatSpec
|
|
|
850
850
|
}>, []>>>, true>;
|
|
851
851
|
}>, []>>>;
|
|
852
852
|
}, []>>, false>;
|
|
853
|
+
rules: DB.MemberDecl<DB.IncludeIdentifier<[], DB.TypeAlias<"SelectOptionRules", DB.Array<DB.IncludeIdentifier<[], DB.TypeAlias<"SelectOptionRule", DB.Object<{
|
|
854
|
+
value: DB.MemberDecl<DB.IncludeIdentifier<[], DB.Enum<"SelectOptionRuleValue", {
|
|
855
|
+
Predefined: DB.EnumCase<null>;
|
|
856
|
+
PredefinedOrTextInput: DB.EnumCase<DB.IncludeIdentifier<[], DB.TypeAlias<"PredefinedOrTextInputSelectOptionRuleValue", DB.Object<{
|
|
857
|
+
translations: DB.MemberDecl<DB.NestedEntityMap<"PredefinedOrTextInputSelectOptionRuleValueTranslation", {
|
|
858
|
+
inputLabel: DB.MemberDecl<DB.String, true>;
|
|
859
|
+
optionLabel: DB.MemberDecl<DB.String, true>;
|
|
860
|
+
}>, true>;
|
|
861
|
+
}>, []>>>;
|
|
862
|
+
Child: DB.EnumCase<DB.IncludeIdentifier<[], DB.TypeAlias<"ChildSelectOptionRuleValue", DB.Object<{
|
|
863
|
+
parentIndex: DB.MemberDecl<DB.Integer, true>;
|
|
864
|
+
entity: DB.MemberDecl<DB.IncludeIdentifier<[], DB.Enum<"ChildEntityForSelectOption", {
|
|
865
|
+
SkillApplication: DB.EnumCase<null>;
|
|
866
|
+
}, []>>, true>;
|
|
867
|
+
}>, []>>>;
|
|
868
|
+
TextInput: DB.EnumCase<DB.IncludeIdentifier<[], DB.TypeAlias<"TextInputSelectOptionRuleValue", DB.Object<{
|
|
869
|
+
translations: DB.MemberDecl<DB.NestedEntityMap<"TextInputSelectOptionRuleValueTranslation", {
|
|
870
|
+
inputLabel: DB.MemberDecl<DB.String, true>;
|
|
871
|
+
}>, true>;
|
|
872
|
+
}>, []>>>;
|
|
873
|
+
}, []>>, true>;
|
|
874
|
+
multiple: DB.MemberDecl<DB.IncludeIdentifier<[], DB.Enum<"SelectOptionRuleMultiple", {
|
|
875
|
+
Constant: DB.EnumCase<DB.Integer>;
|
|
876
|
+
Range: DB.EnumCase<DB.Object<{
|
|
877
|
+
min: DB.MemberDecl<DB.Integer, false>;
|
|
878
|
+
max: DB.MemberDecl<DB.Integer, true>;
|
|
879
|
+
}>>;
|
|
880
|
+
}, []>>, false>;
|
|
881
|
+
}>, []>>>, []>>, false>;
|
|
853
882
|
}>, []>>, false>;
|
|
854
883
|
explicit_select_options: DB.MemberDecl<DB.ChildEntities<DB.Entity<"GeneralSelectOption", {
|
|
855
884
|
parent: DB.MemberDecl<DB.IncludeIdentifier<[], DB.Enum<"SelectOptionParentIdentifier", {
|
|
@@ -3,7 +3,7 @@ import { input, levels, maximum, name, name_in_library, rules } from "../_Activa
|
|
|
3
3
|
import { ap_value, ap_value_append, ap_value_l10n } from "../_ActivatableAdventurePointsValue.js";
|
|
4
4
|
import { combat_techniques, penalty, special_ability_usage_type, type, } from "../_ActivatableCombat.js";
|
|
5
5
|
import { activatableDisplayNameCustomizer, nameBuilderRules } from "../_ActivatableNames.js";
|
|
6
|
-
import { explicit_select_options, select_options } from "../_ActivatableSelectOptions.js";
|
|
6
|
+
import { explicit_select_options, select_options, verifySelectOptionRules, } from "../_ActivatableSelectOptions.js";
|
|
7
7
|
import { skill_applications, skill_uses } from "../_ActivatableSkillApplicationsAndUses.js";
|
|
8
8
|
import { GeneralPrerequisites } from "../_Prerequisite.js";
|
|
9
9
|
import { NestedTranslationMap } from "../Locale.js";
|
|
@@ -51,4 +51,5 @@ export const AdvancedCombatSpecialAbility = DB.Entity(import.meta.url, {
|
|
|
51
51
|
keyPathInEntityMapFallback: "name",
|
|
52
52
|
},
|
|
53
53
|
],
|
|
54
|
+
customConstraints: deps => verifySelectOptionRules("AdvancedCombatSpecialAbility", deps),
|
|
54
55
|
});
|
|
@@ -841,6 +841,35 @@ export declare const AdvancedKarmaSpecialAbility: DB.Entity<"AdvancedKarmaSpecia
|
|
|
841
841
|
}>, []>>>, true>;
|
|
842
842
|
}>, []>>>;
|
|
843
843
|
}, []>>, false>;
|
|
844
|
+
rules: DB.MemberDecl<DB.IncludeIdentifier<[], DB.TypeAlias<"SelectOptionRules", DB.Array<DB.IncludeIdentifier<[], DB.TypeAlias<"SelectOptionRule", DB.Object<{
|
|
845
|
+
value: DB.MemberDecl<DB.IncludeIdentifier<[], DB.Enum<"SelectOptionRuleValue", {
|
|
846
|
+
Predefined: DB.EnumCase<null>;
|
|
847
|
+
PredefinedOrTextInput: DB.EnumCase<DB.IncludeIdentifier<[], DB.TypeAlias<"PredefinedOrTextInputSelectOptionRuleValue", DB.Object<{
|
|
848
|
+
translations: DB.MemberDecl<DB.NestedEntityMap<"PredefinedOrTextInputSelectOptionRuleValueTranslation", {
|
|
849
|
+
inputLabel: DB.MemberDecl<DB.String, true>;
|
|
850
|
+
optionLabel: DB.MemberDecl<DB.String, true>;
|
|
851
|
+
}>, true>;
|
|
852
|
+
}>, []>>>;
|
|
853
|
+
Child: DB.EnumCase<DB.IncludeIdentifier<[], DB.TypeAlias<"ChildSelectOptionRuleValue", DB.Object<{
|
|
854
|
+
parentIndex: DB.MemberDecl<DB.Integer, true>;
|
|
855
|
+
entity: DB.MemberDecl<DB.IncludeIdentifier<[], DB.Enum<"ChildEntityForSelectOption", {
|
|
856
|
+
SkillApplication: DB.EnumCase<null>;
|
|
857
|
+
}, []>>, true>;
|
|
858
|
+
}>, []>>>;
|
|
859
|
+
TextInput: DB.EnumCase<DB.IncludeIdentifier<[], DB.TypeAlias<"TextInputSelectOptionRuleValue", DB.Object<{
|
|
860
|
+
translations: DB.MemberDecl<DB.NestedEntityMap<"TextInputSelectOptionRuleValueTranslation", {
|
|
861
|
+
inputLabel: DB.MemberDecl<DB.String, true>;
|
|
862
|
+
}>, true>;
|
|
863
|
+
}>, []>>>;
|
|
864
|
+
}, []>>, true>;
|
|
865
|
+
multiple: DB.MemberDecl<DB.IncludeIdentifier<[], DB.Enum<"SelectOptionRuleMultiple", {
|
|
866
|
+
Constant: DB.EnumCase<DB.Integer>;
|
|
867
|
+
Range: DB.EnumCase<DB.Object<{
|
|
868
|
+
min: DB.MemberDecl<DB.Integer, false>;
|
|
869
|
+
max: DB.MemberDecl<DB.Integer, true>;
|
|
870
|
+
}>>;
|
|
871
|
+
}, []>>, false>;
|
|
872
|
+
}>, []>>>, []>>, false>;
|
|
844
873
|
}>, []>>, false>;
|
|
845
874
|
explicit_select_options: DB.MemberDecl<DB.ChildEntities<DB.Entity<"GeneralSelectOption", {
|
|
846
875
|
parent: DB.MemberDecl<DB.IncludeIdentifier<[], DB.Enum<"SelectOptionParentIdentifier", {
|
|
@@ -2,7 +2,7 @@ import * as DB from "tsondb/schema/dsl";
|
|
|
2
2
|
import { levels, maximum, name, name_in_library, rules } from "../_Activatable.js";
|
|
3
3
|
import { ap_value, ap_value_append, ap_value_l10n } from "../_ActivatableAdventurePointsValue.js";
|
|
4
4
|
import { activatableDisplayNameCustomizer, nameBuilderRules } from "../_ActivatableNames.js";
|
|
5
|
-
import { explicit_select_options, select_options } from "../_ActivatableSelectOptions.js";
|
|
5
|
+
import { explicit_select_options, select_options, verifySelectOptionRules, } from "../_ActivatableSelectOptions.js";
|
|
6
6
|
import { skill_applications, skill_uses } from "../_ActivatableSkillApplicationsAndUses.js";
|
|
7
7
|
import { GeneralPrerequisites } from "../_Prerequisite.js";
|
|
8
8
|
import { NestedTranslationMap } from "../Locale.js";
|
|
@@ -45,4 +45,5 @@ export const AdvancedKarmaSpecialAbility = DB.Entity(import.meta.url, {
|
|
|
45
45
|
keyPathInEntityMapFallback: "name",
|
|
46
46
|
},
|
|
47
47
|
],
|
|
48
|
+
customConstraints: deps => verifySelectOptionRules("AdvancedKarmaSpecialAbility", deps),
|
|
48
49
|
});
|
|
@@ -841,6 +841,35 @@ export declare const AdvancedMagicalSpecialAbility: DB.Entity<"AdvancedMagicalSp
|
|
|
841
841
|
}>, []>>>, true>;
|
|
842
842
|
}>, []>>>;
|
|
843
843
|
}, []>>, false>;
|
|
844
|
+
rules: DB.MemberDecl<DB.IncludeIdentifier<[], DB.TypeAlias<"SelectOptionRules", DB.Array<DB.IncludeIdentifier<[], DB.TypeAlias<"SelectOptionRule", DB.Object<{
|
|
845
|
+
value: DB.MemberDecl<DB.IncludeIdentifier<[], DB.Enum<"SelectOptionRuleValue", {
|
|
846
|
+
Predefined: DB.EnumCase<null>;
|
|
847
|
+
PredefinedOrTextInput: DB.EnumCase<DB.IncludeIdentifier<[], DB.TypeAlias<"PredefinedOrTextInputSelectOptionRuleValue", DB.Object<{
|
|
848
|
+
translations: DB.MemberDecl<DB.NestedEntityMap<"PredefinedOrTextInputSelectOptionRuleValueTranslation", {
|
|
849
|
+
inputLabel: DB.MemberDecl<DB.String, true>;
|
|
850
|
+
optionLabel: DB.MemberDecl<DB.String, true>;
|
|
851
|
+
}>, true>;
|
|
852
|
+
}>, []>>>;
|
|
853
|
+
Child: DB.EnumCase<DB.IncludeIdentifier<[], DB.TypeAlias<"ChildSelectOptionRuleValue", DB.Object<{
|
|
854
|
+
parentIndex: DB.MemberDecl<DB.Integer, true>;
|
|
855
|
+
entity: DB.MemberDecl<DB.IncludeIdentifier<[], DB.Enum<"ChildEntityForSelectOption", {
|
|
856
|
+
SkillApplication: DB.EnumCase<null>;
|
|
857
|
+
}, []>>, true>;
|
|
858
|
+
}>, []>>>;
|
|
859
|
+
TextInput: DB.EnumCase<DB.IncludeIdentifier<[], DB.TypeAlias<"TextInputSelectOptionRuleValue", DB.Object<{
|
|
860
|
+
translations: DB.MemberDecl<DB.NestedEntityMap<"TextInputSelectOptionRuleValueTranslation", {
|
|
861
|
+
inputLabel: DB.MemberDecl<DB.String, true>;
|
|
862
|
+
}>, true>;
|
|
863
|
+
}>, []>>>;
|
|
864
|
+
}, []>>, true>;
|
|
865
|
+
multiple: DB.MemberDecl<DB.IncludeIdentifier<[], DB.Enum<"SelectOptionRuleMultiple", {
|
|
866
|
+
Constant: DB.EnumCase<DB.Integer>;
|
|
867
|
+
Range: DB.EnumCase<DB.Object<{
|
|
868
|
+
min: DB.MemberDecl<DB.Integer, false>;
|
|
869
|
+
max: DB.MemberDecl<DB.Integer, true>;
|
|
870
|
+
}>>;
|
|
871
|
+
}, []>>, false>;
|
|
872
|
+
}>, []>>>, []>>, false>;
|
|
844
873
|
}>, []>>, false>;
|
|
845
874
|
explicit_select_options: DB.MemberDecl<DB.ChildEntities<DB.Entity<"GeneralSelectOption", {
|
|
846
875
|
parent: DB.MemberDecl<DB.IncludeIdentifier<[], DB.Enum<"SelectOptionParentIdentifier", {
|
|
@@ -2,7 +2,7 @@ import * as DB from "tsondb/schema/dsl";
|
|
|
2
2
|
import { levels, maximum, name, name_in_library, rules } from "../_Activatable.js";
|
|
3
3
|
import { ap_value, ap_value_append, ap_value_l10n } from "../_ActivatableAdventurePointsValue.js";
|
|
4
4
|
import { activatableDisplayNameCustomizer, nameBuilderRules } from "../_ActivatableNames.js";
|
|
5
|
-
import { explicit_select_options, select_options } from "../_ActivatableSelectOptions.js";
|
|
5
|
+
import { explicit_select_options, select_options, verifySelectOptionRules, } from "../_ActivatableSelectOptions.js";
|
|
6
6
|
import { skill_applications, skill_uses } from "../_ActivatableSkillApplicationsAndUses.js";
|
|
7
7
|
import { GeneralPrerequisites } from "../_Prerequisite.js";
|
|
8
8
|
import { NestedTranslationMap } from "../Locale.js";
|
|
@@ -45,4 +45,5 @@ export const AdvancedMagicalSpecialAbility = DB.Entity(import.meta.url, {
|
|
|
45
45
|
keyPathInEntityMapFallback: "name",
|
|
46
46
|
},
|
|
47
47
|
],
|
|
48
|
+
customConstraints: deps => verifySelectOptionRules("AdvancedMagicalSpecialAbility", deps),
|
|
48
49
|
});
|