@optolith/database-schema 0.74.0 → 0.75.1
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 +15 -0
- package/gen/types.d.ts +418 -93
- package/lib/cache/activatableSelectOptions.js +70 -32
- package/lib/cache/index.d.ts +1 -10
- package/lib/cache/index.js +10 -6
- package/lib/cache/internal.d.ts +2 -2
- package/lib/cache/magicalAndBlessedAdvantagesAndDisadvantages.js +14 -14
- package/lib/cache/tradeSecrets.js +3 -3
- package/lib/main.d.ts +3 -1
- package/lib/main.js +1 -0
- package/lib/types/Advantage.d.ts +116 -2
- package/lib/types/AnimalDisease.d.ts +6 -3
- package/lib/types/Ceremony.d.ts +9 -4
- package/lib/types/Disadvantage.d.ts +116 -2
- package/lib/types/Disease.d.ts +6 -3
- package/lib/types/LiturgicalChant.d.ts +9 -4
- package/lib/types/Locale.d.ts +2 -2
- package/lib/types/Locale.js +2 -2
- package/lib/types/Ritual.d.ts +9 -4
- package/lib/types/Settings.d.ts +123 -0
- package/lib/types/Settings.js +55 -0
- package/lib/types/Spell.d.ts +9 -4
- package/lib/types/_ActivatableSelectOptionCategory.d.ts +232 -4
- package/lib/types/_ActivatableSelectOptionCategory.js +7 -7
- package/lib/types/_ActivatableSelectOptions.d.ts +116 -2
- package/lib/types/_DiseasePoison.d.ts +12 -6
- package/lib/types/_DiseasePoison.js +40 -5
- package/lib/types/_SkillCheck.d.ts +9 -4
- package/lib/types/_SkillCheck.js +51 -5
- package/lib/types/equipment/item/Poison.d.ts +6 -3
- package/lib/types/index.d.ts +1 -0
- package/lib/types/index.js +1 -0
- package/lib/types/magicalActions/AnimistPower.d.ts +9 -4
- package/lib/types/magicalActions/Curse.d.ts +9 -4
- package/lib/types/magicalActions/DominationRitual.d.ts +9 -4
- package/lib/types/magicalActions/ElvenMagicalSong.d.ts +9 -4
- package/lib/types/magicalActions/GoblinRitual.d.ts +9 -4
- package/lib/types/magicalActions/JesterTrick.d.ts +9 -4
- package/lib/types/magicalActions/MagicalMelody.d.ts +9 -4
- package/lib/types/magicalActions/ZibiljaRitual.d.ts +9 -4
- package/lib/types/specialAbility/AdvancedCombatSpecialAbility.d.ts +116 -2
- package/lib/types/specialAbility/AdvancedKarmaSpecialAbility.d.ts +116 -2
- package/lib/types/specialAbility/AdvancedMagicalSpecialAbility.d.ts +116 -2
- package/lib/types/specialAbility/AdvancedSkillSpecialAbility.d.ts +116 -2
- package/lib/types/specialAbility/AncestorGlyph.d.ts +116 -2
- package/lib/types/specialAbility/BlessedTradition.d.ts +116 -2
- package/lib/types/specialAbility/BrawlingSpecialAbility.d.ts +116 -2
- package/lib/types/specialAbility/CeremonialItemSpecialAbility.d.ts +116 -2
- package/lib/types/specialAbility/CombatSpecialAbility.d.ts +116 -2
- package/lib/types/specialAbility/CombatStyleSpecialAbility.d.ts +116 -2
- package/lib/types/specialAbility/CommandSpecialAbility.d.ts +116 -2
- package/lib/types/specialAbility/FamiliarSpecialAbility.d.ts +116 -2
- package/lib/types/specialAbility/FatePointSexSpecialAbility.d.ts +116 -2
- package/lib/types/specialAbility/FatePointSpecialAbility.d.ts +116 -2
- package/lib/types/specialAbility/GeneralSpecialAbility.d.ts +116 -2
- package/lib/types/specialAbility/KarmaSpecialAbility.d.ts +116 -2
- package/lib/types/specialAbility/LiturgicalStyleSpecialAbility.d.ts +116 -2
- package/lib/types/specialAbility/LycantropicGift.d.ts +116 -2
- package/lib/types/specialAbility/MagicStyleSpecialAbility.d.ts +116 -2
- package/lib/types/specialAbility/MagicalSpecialAbility.d.ts +116 -2
- package/lib/types/specialAbility/MagicalTradition.d.ts +116 -2
- package/lib/types/specialAbility/PactGift.d.ts +116 -2
- package/lib/types/specialAbility/ProtectiveWardingCircleSpecialAbility.d.ts +116 -2
- package/lib/types/specialAbility/Sermon.d.ts +116 -2
- package/lib/types/specialAbility/SexSpecialAbility.d.ts +116 -2
- package/lib/types/specialAbility/SikaryanDrainSpecialAbility.d.ts +116 -2
- package/lib/types/specialAbility/SkillStyleSpecialAbility.d.ts +116 -2
- package/lib/types/specialAbility/VampiricGift.d.ts +116 -2
- package/lib/types/specialAbility/Vision.d.ts +116 -2
- package/lib/types/specialAbility/sub/TradeSecret.d.ts +116 -2
- package/lib/types/traditionArtifacts/ArcaneOrbEnchantment.d.ts +116 -2
- package/lib/types/traditionArtifacts/AttireEnchantment.d.ts +116 -2
- package/lib/types/traditionArtifacts/Beutelzauber.d.ts +116 -2
- package/lib/types/traditionArtifacts/BowlEnchantment.d.ts +116 -2
- package/lib/types/traditionArtifacts/CauldronEnchantment.d.ts +116 -2
- package/lib/types/traditionArtifacts/ChronicleEnchantment.d.ts +116 -2
- package/lib/types/traditionArtifacts/DaggerRitual.d.ts +116 -2
- package/lib/types/traditionArtifacts/FoolsHatEnchantment.d.ts +116 -2
- package/lib/types/traditionArtifacts/Haubenzauber.d.ts +116 -2
- package/lib/types/traditionArtifacts/InstrumentEnchantment.d.ts +116 -2
- package/lib/types/traditionArtifacts/Krallenkettenzauber.d.ts +116 -2
- package/lib/types/traditionArtifacts/Kristallkugelzauber.d.ts +116 -2
- package/lib/types/traditionArtifacts/OrbEnchantment.d.ts +116 -2
- package/lib/types/traditionArtifacts/RingEnchantment.d.ts +116 -2
- package/lib/types/traditionArtifacts/SickleRitual.d.ts +116 -2
- package/lib/types/traditionArtifacts/SpellSwordEnchantment.d.ts +116 -2
- package/lib/types/traditionArtifacts/StaffEnchantment.d.ts +116 -2
- package/lib/types/traditionArtifacts/ToyEnchantment.d.ts +116 -2
- package/lib/types/traditionArtifacts/Trinkhornzauber.d.ts +116 -2
- package/lib/types/traditionArtifacts/WandEnchantment.d.ts +116 -2
- package/lib/types/traditionArtifacts/WeaponEnchantment.d.ts +116 -2
- package/package.json +6 -3
|
@@ -155,10 +155,12 @@ const getDerivedSkillishSelectOptions = (database, entryId, entity, category, op
|
|
|
155
155
|
};
|
|
156
156
|
});
|
|
157
157
|
};
|
|
158
|
-
const getDerivedSelectOptions = (selectOptionCategory, entryId, database
|
|
158
|
+
const getDerivedSelectOptions = (selectOptionCategory, entryId, database) => {
|
|
159
159
|
switch (selectOptionCategory.kind) {
|
|
160
160
|
case "Blessings":
|
|
161
|
-
return database
|
|
161
|
+
return database
|
|
162
|
+
.getAllInstanceContainersOfEntity("Blessing")
|
|
163
|
+
.map(({ id, content }) => ({
|
|
162
164
|
id: Case("Blessing", id),
|
|
163
165
|
content: {
|
|
164
166
|
parent: entryId,
|
|
@@ -169,7 +171,9 @@ const getDerivedSelectOptions = (selectOptionCategory, entryId, database, idMap)
|
|
|
169
171
|
uses: [],
|
|
170
172
|
}));
|
|
171
173
|
case "Cantrips":
|
|
172
|
-
return database
|
|
174
|
+
return database
|
|
175
|
+
.getAllInstanceContainersOfEntity("Cantrip")
|
|
176
|
+
.map(({ id, content }) => ({
|
|
173
177
|
id: Case("Cantrip", id),
|
|
174
178
|
content: {
|
|
175
179
|
parent: entryId,
|
|
@@ -180,7 +184,9 @@ const getDerivedSelectOptions = (selectOptionCategory, entryId, database, idMap)
|
|
|
180
184
|
uses: [],
|
|
181
185
|
}));
|
|
182
186
|
case "TradeSecrets":
|
|
183
|
-
return database
|
|
187
|
+
return database
|
|
188
|
+
.getAllInstanceContainersOfEntity("TradeSecret")
|
|
189
|
+
.map(({ id, content }) => ({
|
|
184
190
|
id: Case("TradeSecret", id),
|
|
185
191
|
content: {
|
|
186
192
|
parent: entryId,
|
|
@@ -196,7 +202,9 @@ const getDerivedSelectOptions = (selectOptionCategory, entryId, database, idMap)
|
|
|
196
202
|
uses: [],
|
|
197
203
|
}));
|
|
198
204
|
case "Scripts":
|
|
199
|
-
return database
|
|
205
|
+
return database
|
|
206
|
+
.getAllInstanceContainersOfEntity("Script")
|
|
207
|
+
.map(({ id, content }) => ({
|
|
200
208
|
id: Case("Script", id),
|
|
201
209
|
content: {
|
|
202
210
|
parent: entryId,
|
|
@@ -268,7 +276,9 @@ const getDerivedSelectOptions = (selectOptionCategory, entryId, database, idMap)
|
|
|
268
276
|
});
|
|
269
277
|
}
|
|
270
278
|
case "ArcaneBardTraditions":
|
|
271
|
-
return database
|
|
279
|
+
return database
|
|
280
|
+
.getAllInstanceContainersOfEntity("ArcaneBardTradition")
|
|
281
|
+
.map(({ id, content }) => ({
|
|
272
282
|
id: Case("ArcaneBardTradition", id),
|
|
273
283
|
content: {
|
|
274
284
|
parent: entryId,
|
|
@@ -284,7 +294,9 @@ const getDerivedSelectOptions = (selectOptionCategory, entryId, database, idMap)
|
|
|
284
294
|
uses: [],
|
|
285
295
|
}));
|
|
286
296
|
case "ArcaneDancerTraditions":
|
|
287
|
-
return database
|
|
297
|
+
return database
|
|
298
|
+
.getAllInstanceContainersOfEntity("ArcaneDancerTradition")
|
|
299
|
+
.map(({ id, content }) => ({
|
|
288
300
|
id: Case("ArcaneDancerTradition", id),
|
|
289
301
|
content: {
|
|
290
302
|
parent: entryId,
|
|
@@ -300,7 +312,9 @@ const getDerivedSelectOptions = (selectOptionCategory, entryId, database, idMap)
|
|
|
300
312
|
uses: [],
|
|
301
313
|
}));
|
|
302
314
|
case "SexPractices":
|
|
303
|
-
return database
|
|
315
|
+
return database
|
|
316
|
+
.getAllInstanceContainersOfEntity("SexPractice")
|
|
317
|
+
.map(({ id, content }) => ({
|
|
304
318
|
id: Case("SexPractice", id),
|
|
305
319
|
content: {
|
|
306
320
|
parent: entryId,
|
|
@@ -313,7 +327,9 @@ const getDerivedSelectOptions = (selectOptionCategory, entryId, database, idMap)
|
|
|
313
327
|
uses: [],
|
|
314
328
|
}));
|
|
315
329
|
case "Races":
|
|
316
|
-
return database
|
|
330
|
+
return database
|
|
331
|
+
.getAllInstanceContainersOfEntity("Race")
|
|
332
|
+
.map(({ id, content }) => ({
|
|
317
333
|
id: Case("Race", id),
|
|
318
334
|
content: {
|
|
319
335
|
parent: entryId,
|
|
@@ -326,7 +342,9 @@ const getDerivedSelectOptions = (selectOptionCategory, entryId, database, idMap)
|
|
|
326
342
|
uses: [],
|
|
327
343
|
}));
|
|
328
344
|
case "Cultures":
|
|
329
|
-
return database
|
|
345
|
+
return database
|
|
346
|
+
.getAllInstanceContainersOfEntity("Culture")
|
|
347
|
+
.map(({ id, content }) => ({
|
|
330
348
|
id: Case("Culture", id),
|
|
331
349
|
content: {
|
|
332
350
|
parent: entryId,
|
|
@@ -340,7 +358,9 @@ const getDerivedSelectOptions = (selectOptionCategory, entryId, database, idMap)
|
|
|
340
358
|
}));
|
|
341
359
|
case "RacesAndCultures":
|
|
342
360
|
return [
|
|
343
|
-
...database
|
|
361
|
+
...database
|
|
362
|
+
.getAllInstanceContainersOfEntity("Race")
|
|
363
|
+
.map(({ id, content }) => ({
|
|
344
364
|
id: Case("Race", id),
|
|
345
365
|
content: {
|
|
346
366
|
parent: entryId,
|
|
@@ -352,7 +372,9 @@ const getDerivedSelectOptions = (selectOptionCategory, entryId, database, idMap)
|
|
|
352
372
|
newApplications: [],
|
|
353
373
|
uses: [],
|
|
354
374
|
})),
|
|
355
|
-
...database
|
|
375
|
+
...database
|
|
376
|
+
.getAllInstanceContainersOfEntity("Culture")
|
|
377
|
+
.map(({ id, content }) => ({
|
|
356
378
|
id: Case("Culture", id),
|
|
357
379
|
content: {
|
|
358
380
|
parent: entryId,
|
|
@@ -366,7 +388,9 @@ const getDerivedSelectOptions = (selectOptionCategory, entryId, database, idMap)
|
|
|
366
388
|
})),
|
|
367
389
|
];
|
|
368
390
|
case "HomunculusTypes":
|
|
369
|
-
return database
|
|
391
|
+
return database
|
|
392
|
+
.getAllInstanceContainersOfEntity("HomunculusType")
|
|
393
|
+
.map(({ id, content }) => ({
|
|
370
394
|
id: Case("HomunculusType", id),
|
|
371
395
|
content: {
|
|
372
396
|
parent: entryId,
|
|
@@ -398,7 +422,9 @@ const getDerivedSelectOptions = (selectOptionCategory, entryId, database, idMap)
|
|
|
398
422
|
}
|
|
399
423
|
return undefined;
|
|
400
424
|
};
|
|
401
|
-
return database
|
|
425
|
+
return database
|
|
426
|
+
.getAllInstanceContainersOfEntity("BlessedTradition")
|
|
427
|
+
.map(({ id, content }) => ({
|
|
402
428
|
id: Case("BlessedTradition", id),
|
|
403
429
|
content: {
|
|
404
430
|
parent: entryId,
|
|
@@ -435,13 +461,13 @@ const getDerivedSelectOptions = (selectOptionCategory, entryId, database, idMap)
|
|
|
435
461
|
}
|
|
436
462
|
case "Properties": {
|
|
437
463
|
const getPrerequisites = (id) => {
|
|
438
|
-
if (selectOptionCategory.Properties.
|
|
464
|
+
if (selectOptionCategory.Properties.requireActiveSelectionOnEntry !== undefined ||
|
|
439
465
|
selectOptionCategory.Properties.require_minimum_spellworks_on !== undefined) {
|
|
440
|
-
const knowledgePrerequisite = selectOptionCategory.Properties.
|
|
466
|
+
const knowledgePrerequisite = selectOptionCategory.Properties.requireActiveSelectionOnEntry !== undefined
|
|
441
467
|
? {
|
|
442
468
|
level: 1,
|
|
443
469
|
prerequisite: Case("Single", Case("Activatable", {
|
|
444
|
-
id:
|
|
470
|
+
id: selectOptionCategory.Properties.requireActiveSelectionOnEntry,
|
|
445
471
|
active: true,
|
|
446
472
|
options: [Case("Property", id)],
|
|
447
473
|
})),
|
|
@@ -463,7 +489,9 @@ const getDerivedSelectOptions = (selectOptionCategory, entryId, database, idMap)
|
|
|
463
489
|
}
|
|
464
490
|
return undefined;
|
|
465
491
|
};
|
|
466
|
-
return database
|
|
492
|
+
return database
|
|
493
|
+
.getAllInstanceContainersOfEntity("Property")
|
|
494
|
+
.map(({ id, content }) => ({
|
|
467
495
|
id: Case("Property", id),
|
|
468
496
|
content: {
|
|
469
497
|
parent: entryId,
|
|
@@ -478,13 +506,13 @@ const getDerivedSelectOptions = (selectOptionCategory, entryId, database, idMap)
|
|
|
478
506
|
}
|
|
479
507
|
case "Aspects": {
|
|
480
508
|
const getPrerequisites = (id) => {
|
|
481
|
-
if (selectOptionCategory.Aspects.
|
|
509
|
+
if (selectOptionCategory.Aspects.requireActiveSelectionOnEntry !== undefined ||
|
|
482
510
|
selectOptionCategory.Aspects.require_minimum_liturgies_on !== undefined) {
|
|
483
|
-
const knowledgePrerequisite = selectOptionCategory.Aspects.
|
|
511
|
+
const knowledgePrerequisite = selectOptionCategory.Aspects.requireActiveSelectionOnEntry !== undefined
|
|
484
512
|
? {
|
|
485
513
|
level: 1,
|
|
486
514
|
prerequisite: Case("Single", Case("Activatable", {
|
|
487
|
-
id:
|
|
515
|
+
id: selectOptionCategory.Aspects.requireActiveSelectionOnEntry,
|
|
488
516
|
active: true,
|
|
489
517
|
options: [Case("Aspect", id)],
|
|
490
518
|
})),
|
|
@@ -525,7 +553,9 @@ const getDerivedSelectOptions = (selectOptionCategory, entryId, database, idMap)
|
|
|
525
553
|
}))
|
|
526
554
|
.filter(value => Object.keys(value.content.translations).length > 0);
|
|
527
555
|
}
|
|
528
|
-
return database
|
|
556
|
+
return database
|
|
557
|
+
.getAllInstanceContainersOfEntity("Aspect")
|
|
558
|
+
.map(({ id, content }) => ({
|
|
529
559
|
id: Case("Aspect", id),
|
|
530
560
|
content: {
|
|
531
561
|
parent: entryId,
|
|
@@ -539,7 +569,9 @@ const getDerivedSelectOptions = (selectOptionCategory, entryId, database, idMap)
|
|
|
539
569
|
}));
|
|
540
570
|
}
|
|
541
571
|
case "Diseases":
|
|
542
|
-
return database
|
|
572
|
+
return database
|
|
573
|
+
.getAllInstanceContainersOfEntity("Disease")
|
|
574
|
+
.map(({ id, content }) => ({
|
|
543
575
|
id: Case("Disease", id),
|
|
544
576
|
content: {
|
|
545
577
|
parent: entryId,
|
|
@@ -588,7 +620,9 @@ const getDerivedSelectOptions = (selectOptionCategory, entryId, database, idMap)
|
|
|
588
620
|
return assertExhaustive(poison.source_type);
|
|
589
621
|
}
|
|
590
622
|
};
|
|
591
|
-
return database
|
|
623
|
+
return database
|
|
624
|
+
.getAllInstanceContainersOfEntity("Poison")
|
|
625
|
+
.map(({ id, content }) => ({
|
|
592
626
|
id: Case("Poison", id),
|
|
593
627
|
content: {
|
|
594
628
|
parent: entryId,
|
|
@@ -619,7 +653,9 @@ const getDerivedSelectOptions = (selectOptionCategory, entryId, database, idMap)
|
|
|
619
653
|
}
|
|
620
654
|
return undefined;
|
|
621
655
|
};
|
|
622
|
-
return database
|
|
656
|
+
return database
|
|
657
|
+
.getAllInstanceContainersOfEntity("Language")
|
|
658
|
+
.map(({ id, content }) => ({
|
|
623
659
|
id: Case("Language", id),
|
|
624
660
|
content: {
|
|
625
661
|
parent: entryId,
|
|
@@ -695,7 +731,9 @@ const getDerivedSelectOptions = (selectOptionCategory, entryId, database, idMap)
|
|
|
695
731
|
return assertExhaustive(selectOptionCategory);
|
|
696
732
|
}
|
|
697
733
|
};
|
|
698
|
-
const getExplicitSelectOptions = (id, database) => database
|
|
734
|
+
const getExplicitSelectOptions = (id, database) => database
|
|
735
|
+
.getAllChildInstanceContainersForParent("GeneralSelectOption", id)
|
|
736
|
+
.map(({ id, content }) => ({
|
|
699
737
|
id: Case("General", id),
|
|
700
738
|
content: {
|
|
701
739
|
...content,
|
|
@@ -704,14 +742,14 @@ const getExplicitSelectOptions = (id, database) => database.getAllChildInstanceC
|
|
|
704
742
|
newApplications: [], // database.getAllChildInstanceContainersForParent("NewSkillApplication", Case("GeneralSelectOption", id)), // prevent duplicates as these can already be queried from the database
|
|
705
743
|
uses: [], // database.getAllChildInstanceContainersForParent("SkillUse", Case("GeneralSelectOption", id)), // prevent duplicates as these can already be queried from the database
|
|
706
744
|
}));
|
|
707
|
-
const getSelectOptions = (selectOptions, id, database
|
|
745
|
+
const getSelectOptions = (selectOptions, id, database) => [
|
|
708
746
|
...(selectOptions.derived === undefined
|
|
709
747
|
? []
|
|
710
|
-
: getDerivedSelectOptions(selectOptions.derived, id, database
|
|
748
|
+
: getDerivedSelectOptions(selectOptions.derived, id, database)),
|
|
711
749
|
...getExplicitSelectOptions(id, database),
|
|
712
750
|
];
|
|
713
|
-
const getSelectOptionsForResults = (database,
|
|
714
|
-
const options = getSelectOptions(content.select_options ?? {}, Case(entity, id), database
|
|
751
|
+
const getSelectOptionsForResults = (database, entity, results) => results.reduce((acc, { id, content }) => {
|
|
752
|
+
const options = getSelectOptions(content.select_options ?? {}, Case(entity, id), database);
|
|
715
753
|
if (options.length > 0) {
|
|
716
754
|
acc[id] = options;
|
|
717
755
|
}
|
|
@@ -775,7 +813,7 @@ const cacheKeyBase = {
|
|
|
775
813
|
WandEnchantment: null,
|
|
776
814
|
WeaponEnchantment: null,
|
|
777
815
|
};
|
|
778
|
-
export const activatableSelectOptionsCacheBuilder =
|
|
816
|
+
export const activatableSelectOptionsCacheBuilder = database => Object.fromEntries(Object.keys(cacheKeyBase).map((entity) => [
|
|
779
817
|
entity,
|
|
780
|
-
getSelectOptionsForResults(database,
|
|
818
|
+
getSelectOptionsForResults(database, entity, database.getAllInstanceContainersOfEntity(entity)),
|
|
781
819
|
]));
|
package/lib/cache/index.d.ts
CHANGED
|
@@ -5,15 +5,6 @@ import { type AncestorBloodAdvantagesCache } from "./ancestorBloodAdvantages.ts"
|
|
|
5
5
|
import { type MagicalAndBlessedAdvantagesAndDisadvantagesCache } from "./magicalAndBlessedAdvantagesAndDisadvantages.ts";
|
|
6
6
|
import { type NewApplicationsAndUsesCache, type ResolvedNewSkillApplication, type ResolvedSkillUse } from "./newApplicationsAndUses.ts";
|
|
7
7
|
import { type DerivedTradeSecretsCache } from "./tradeSecrets.ts";
|
|
8
|
-
/**
|
|
9
|
-
* Identifiers of specific entries in the database that are used for creating the cache.
|
|
10
|
-
*/
|
|
11
|
-
export type IdMap = {
|
|
12
|
-
Advantage: Record<"Blessed" | "Spellcaster", string>;
|
|
13
|
-
GeneralSpecialAbility: Record<"Weaponsmith" | "Armorer", string>;
|
|
14
|
-
MagicalSpecialAbility: Record<"PropertyKnowledge", string>;
|
|
15
|
-
KarmaSpecialAbility: Record<"AspectKnowledge", string>;
|
|
16
|
-
};
|
|
17
8
|
/**
|
|
18
9
|
* The cache object containing all precomputed data.
|
|
19
10
|
*/
|
|
@@ -31,4 +22,4 @@ export type { ActivatableSelectOptionsCache, AncestorBloodAdvantagesCache, Magic
|
|
|
31
22
|
* @param idMap An object containing identifiers of specific entries in the database that are used for creating the cache.
|
|
32
23
|
* @returns The created cache object.
|
|
33
24
|
*/
|
|
34
|
-
export declare const createCache: (db: TSONDB<TSONDBTypes
|
|
25
|
+
export declare const createCache: (db: TSONDB<TSONDBTypes>) => Cache;
|
package/lib/cache/index.js
CHANGED
|
@@ -9,12 +9,16 @@ import { buildDerivedTradeSecretsCache } from "./tradeSecrets.js";
|
|
|
9
9
|
* @param idMap An object containing identifiers of specific entries in the database that are used for creating the cache.
|
|
10
10
|
* @returns The created cache object.
|
|
11
11
|
*/
|
|
12
|
-
export const createCache = (db
|
|
13
|
-
const
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
const
|
|
12
|
+
export const createCache = (db) => {
|
|
13
|
+
const settings = db.getSingletonInstanceOfEntity("Settings");
|
|
14
|
+
if (!settings) {
|
|
15
|
+
throw new Error("Settings not found in the database.");
|
|
16
|
+
}
|
|
17
|
+
const activatableSelectOptions = activatableSelectOptionsCacheBuilder(db, settings);
|
|
18
|
+
const ancestorBloodAdvantages = buildAncestorBloodAdvantagesCache(db, settings);
|
|
19
|
+
const derivedTradeSecrets = buildDerivedTradeSecretsCache(db, settings);
|
|
20
|
+
const magicalAndBlessedAdvantagesAndDisadvantages = buildMagicalAndBlessedAdvantagesAndDisadvantagesCache(db, settings);
|
|
21
|
+
const newApplicationsAndUses = buildNewApplicationsAndUsesCache(db, settings, activatableSelectOptions);
|
|
18
22
|
return {
|
|
19
23
|
activatableSelectOptions,
|
|
20
24
|
ancestorBloodAdvantages,
|
package/lib/cache/internal.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
import type { TSONDB } from "tsondb";
|
|
2
|
+
import type { Settings } from "../../gen/types.js";
|
|
2
3
|
import type { TSONDBTypes } from "../main.ts";
|
|
3
|
-
|
|
4
|
-
export type CacheBuilder<T = unknown, Args extends unknown[] = []> = (db: TSONDB<TSONDBTypes>, idMap: IdMap, ...args: Args) => T;
|
|
4
|
+
export type CacheBuilder<T = unknown, Args extends unknown[] = []> = (db: TSONDB<TSONDBTypes>, settings: Settings, ...args: Args) => T;
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import { assertExhaustive } from "@elyukai/utils/typeSafety";
|
|
2
|
-
const getAdvantageId = (
|
|
2
|
+
const getAdvantageId = (settings, type) => {
|
|
3
3
|
switch (type) {
|
|
4
4
|
case "Magical":
|
|
5
|
-
return
|
|
5
|
+
return settings.supernaturalBaseAdvantages.spellcasters;
|
|
6
6
|
case "Blessed":
|
|
7
|
-
return
|
|
7
|
+
return settings.supernaturalBaseAdvantages.blessed;
|
|
8
8
|
default:
|
|
9
9
|
return assertExhaustive(type);
|
|
10
10
|
}
|
|
@@ -26,16 +26,16 @@ const isRatedFor = (type, ratedId) => {
|
|
|
26
26
|
return assertExhaustive(ratedId);
|
|
27
27
|
}
|
|
28
28
|
};
|
|
29
|
-
const isPrerequisiteFor = (
|
|
29
|
+
const isPrerequisiteFor = (settings, type, prerequisite, getById, traversedIds) => {
|
|
30
30
|
switch (prerequisite.kind) {
|
|
31
31
|
case "Activatable": {
|
|
32
32
|
if (prerequisite.Activatable.id.kind === "Advantage" &&
|
|
33
|
-
prerequisite.Activatable.id.Advantage === getAdvantageId(
|
|
33
|
+
prerequisite.Activatable.id.Advantage === getAdvantageId(settings, type) &&
|
|
34
34
|
prerequisite.Activatable.active) {
|
|
35
35
|
return true;
|
|
36
36
|
}
|
|
37
37
|
const entry = getById(prerequisite.Activatable.id);
|
|
38
|
-
return entry !== undefined && is(
|
|
38
|
+
return entry !== undefined && is(settings, type, entry, getById, traversedIds);
|
|
39
39
|
}
|
|
40
40
|
case "Rated":
|
|
41
41
|
return isRatedFor(type, prerequisite.Rated.id);
|
|
@@ -64,7 +64,7 @@ const isPrerequisiteFor = (idMap, type, prerequisite, getById, traversedIds) =>
|
|
|
64
64
|
return assertExhaustive(prerequisite);
|
|
65
65
|
}
|
|
66
66
|
};
|
|
67
|
-
const is = (
|
|
67
|
+
const is = (settings, type, entry, getById, traversedIds) => {
|
|
68
68
|
if (!entry.content.prerequisites || traversedIds.includes(entry.id)) {
|
|
69
69
|
return false;
|
|
70
70
|
}
|
|
@@ -73,11 +73,11 @@ const is = (idMap, type, entry, getById, traversedIds) => {
|
|
|
73
73
|
entry.content.prerequisites.some(prerequisite => {
|
|
74
74
|
switch (prerequisite.prerequisite.kind) {
|
|
75
75
|
case "Single":
|
|
76
|
-
return isPrerequisiteFor(
|
|
76
|
+
return isPrerequisiteFor(settings, type, prerequisite.prerequisite.Single, getById, newTraversedIds);
|
|
77
77
|
case "Disjunction":
|
|
78
|
-
return prerequisite.prerequisite.Disjunction.list.some(p => isPrerequisiteFor(
|
|
78
|
+
return prerequisite.prerequisite.Disjunction.list.some(p => isPrerequisiteFor(settings, type, p, getById, newTraversedIds));
|
|
79
79
|
case "Group":
|
|
80
|
-
return prerequisite.prerequisite.Group.list.some(p => isPrerequisiteFor(
|
|
80
|
+
return prerequisite.prerequisite.Group.list.some(p => isPrerequisiteFor(settings, type, p, getById, newTraversedIds));
|
|
81
81
|
default:
|
|
82
82
|
return assertExhaustive(prerequisite.prerequisite);
|
|
83
83
|
}
|
|
@@ -91,16 +91,16 @@ const typeKeyMap = {
|
|
|
91
91
|
Magical: null,
|
|
92
92
|
Blessed: null,
|
|
93
93
|
};
|
|
94
|
-
const collectIds = (entity, type, database,
|
|
94
|
+
const collectIds = (entity, type, database, settings) => database
|
|
95
95
|
.getAllInstanceContainersOfEntity(entity)
|
|
96
|
-
.filter(entry => is(
|
|
96
|
+
.filter(entry => is(settings, type, entry, database.getInstanceContainerOfEntityById.bind(database), []))
|
|
97
97
|
.map(({ id }) => id);
|
|
98
|
-
export const buildMagicalAndBlessedAdvantagesAndDisadvantagesCache = (database,
|
|
98
|
+
export const buildMagicalAndBlessedAdvantagesAndDisadvantagesCache = (database, settings) => {
|
|
99
99
|
return Object.fromEntries(Object.keys(entityKeyMap).map((entity) => [
|
|
100
100
|
entity,
|
|
101
101
|
Object.fromEntries(Object.keys(typeKeyMap).map((type) => [
|
|
102
102
|
type,
|
|
103
|
-
collectIds(entity, type, database,
|
|
103
|
+
collectIds(entity, type, database, settings),
|
|
104
104
|
])),
|
|
105
105
|
]));
|
|
106
106
|
};
|
|
@@ -31,7 +31,7 @@ const emptyDerivedHerbaryTradeSecretsCache = {
|
|
|
31
31
|
HerbalAid: {},
|
|
32
32
|
Poison: {},
|
|
33
33
|
};
|
|
34
|
-
export const buildDerivedTradeSecretsCache = (database,
|
|
34
|
+
export const buildDerivedTradeSecretsCache = (database, settings) => {
|
|
35
35
|
const cache = {
|
|
36
36
|
equipment: emptyDerivedEquipmentTradeSecretsCache,
|
|
37
37
|
herbary: emptyDerivedHerbaryTradeSecretsCache,
|
|
@@ -49,14 +49,14 @@ export const buildDerivedTradeSecretsCache = (database, idMap) => {
|
|
|
49
49
|
prerequisites: entity === "Weapon"
|
|
50
50
|
? [
|
|
51
51
|
Case("Single", Case("Activatable", {
|
|
52
|
-
id:
|
|
52
|
+
id: settings.derivedTradeSecrets.requiredSpecialAbilityForWeapons,
|
|
53
53
|
active: true,
|
|
54
54
|
})),
|
|
55
55
|
]
|
|
56
56
|
: entity === "Armor"
|
|
57
57
|
? [
|
|
58
58
|
Case("Single", Case("Activatable", {
|
|
59
|
-
id:
|
|
59
|
+
id: settings.derivedTradeSecrets.requiredSpecialAbilityForArmor,
|
|
60
60
|
active: true,
|
|
61
61
|
})),
|
|
62
62
|
]
|
package/lib/main.d.ts
CHANGED
|
@@ -1,9 +1,10 @@
|
|
|
1
1
|
import { Schema } from "tsondb/schema";
|
|
2
|
-
import type { ChildEntityMap, EntityMap, EnumMap, TypeAliasMap } from "../gen/types.js";
|
|
2
|
+
import type { ChildEntityMap, EntityMap, EnumMap, SingletonEntityMap, TypeAliasMap } from "../gen/types.js";
|
|
3
3
|
declare module "tsondb/schema/gen" {
|
|
4
4
|
interface Register {
|
|
5
5
|
entityMap: EntityMap;
|
|
6
6
|
childEntityMap: ChildEntityMap;
|
|
7
|
+
singletonEntityMap: SingletonEntityMap;
|
|
7
8
|
enumMap: EnumMap;
|
|
8
9
|
typeAliasMap: TypeAliasMap;
|
|
9
10
|
}
|
|
@@ -11,6 +12,7 @@ declare module "tsondb/schema/gen" {
|
|
|
11
12
|
export interface TSONDBTypes {
|
|
12
13
|
entityMap: EntityMap;
|
|
13
14
|
childEntityMap: ChildEntityMap;
|
|
15
|
+
singletonEntityMap: SingletonEntityMap;
|
|
14
16
|
enumMap: EnumMap;
|
|
15
17
|
typeAliasMap: TypeAliasMap;
|
|
16
18
|
}
|
package/lib/main.js
CHANGED
package/lib/types/Advantage.d.ts
CHANGED
|
@@ -37,14 +37,128 @@ export declare const Advantage: DB.Entity<"Advantage", {
|
|
|
37
37
|
specific: DB.MemberDecl<DB.Array<DB.ReferenceIdentifier>, false>;
|
|
38
38
|
}>, []>>>;
|
|
39
39
|
Properties: DB.EnumCase<DB.IncludeIdentifier<[], DB.TypeAlias<"PropertiesSelectOptionCategory", DB.Object<{
|
|
40
|
-
|
|
40
|
+
requireActiveSelectionOnEntry: DB.MemberDecl<DB.IncludeIdentifier<[], DB.Enum<"ActivatableIdentifier", {
|
|
41
|
+
ArcaneOrbEnchantment: DB.EnumCase<DB.ReferenceIdentifier>;
|
|
42
|
+
AttireEnchantment: DB.EnumCase<DB.ReferenceIdentifier>;
|
|
43
|
+
Beutelzauber: DB.EnumCase<DB.ReferenceIdentifier>;
|
|
44
|
+
BowlEnchantment: DB.EnumCase<DB.ReferenceIdentifier>;
|
|
45
|
+
CauldronEnchantment: DB.EnumCase<DB.ReferenceIdentifier>;
|
|
46
|
+
ChronicleEnchantment: DB.EnumCase<DB.ReferenceIdentifier>;
|
|
47
|
+
DaggerRitual: DB.EnumCase<DB.ReferenceIdentifier>;
|
|
48
|
+
FoolsHatEnchantment: DB.EnumCase<DB.ReferenceIdentifier>;
|
|
49
|
+
Haubenzauber: DB.EnumCase<DB.ReferenceIdentifier>;
|
|
50
|
+
Hauerkettenzauber: DB.EnumCase<DB.ReferenceIdentifier>;
|
|
51
|
+
InstrumentEnchantment: DB.EnumCase<DB.ReferenceIdentifier>;
|
|
52
|
+
Keulenzauber: DB.EnumCase<DB.ReferenceIdentifier>;
|
|
53
|
+
Krallenkettenzauber: DB.EnumCase<DB.ReferenceIdentifier>;
|
|
54
|
+
Kristallkugelzauber: DB.EnumCase<DB.ReferenceIdentifier>;
|
|
55
|
+
OrbEnchantment: DB.EnumCase<DB.ReferenceIdentifier>;
|
|
56
|
+
RingEnchantment: DB.EnumCase<DB.ReferenceIdentifier>;
|
|
57
|
+
Schweinetrommelzauber: DB.EnumCase<DB.ReferenceIdentifier>;
|
|
58
|
+
SickleRitual: DB.EnumCase<DB.ReferenceIdentifier>;
|
|
59
|
+
SpellSwordEnchantment: DB.EnumCase<DB.ReferenceIdentifier>;
|
|
60
|
+
StaffEnchantment: DB.EnumCase<DB.ReferenceIdentifier>;
|
|
61
|
+
ToyEnchantment: DB.EnumCase<DB.ReferenceIdentifier>;
|
|
62
|
+
Trinkhornzauber: DB.EnumCase<DB.ReferenceIdentifier>;
|
|
63
|
+
WandEnchantment: DB.EnumCase<DB.ReferenceIdentifier>;
|
|
64
|
+
WeaponEnchantment: DB.EnumCase<DB.ReferenceIdentifier>;
|
|
65
|
+
AdvancedCombatSpecialAbility: DB.EnumCase<DB.ReferenceIdentifier>;
|
|
66
|
+
AdvancedKarmaSpecialAbility: DB.EnumCase<DB.ReferenceIdentifier>;
|
|
67
|
+
AdvancedMagicalSpecialAbility: DB.EnumCase<DB.ReferenceIdentifier>;
|
|
68
|
+
AdvancedSkillSpecialAbility: DB.EnumCase<DB.ReferenceIdentifier>;
|
|
69
|
+
AncestorGlyph: DB.EnumCase<DB.ReferenceIdentifier>;
|
|
70
|
+
BlessedTradition: DB.EnumCase<DB.ReferenceIdentifier>;
|
|
71
|
+
BrawlingSpecialAbility: DB.EnumCase<DB.ReferenceIdentifier>;
|
|
72
|
+
CeremonialItemSpecialAbility: DB.EnumCase<DB.ReferenceIdentifier>;
|
|
73
|
+
CombatSpecialAbility: DB.EnumCase<DB.ReferenceIdentifier>;
|
|
74
|
+
CombatStyleSpecialAbility: DB.EnumCase<DB.ReferenceIdentifier>;
|
|
75
|
+
CommandSpecialAbility: DB.EnumCase<DB.ReferenceIdentifier>;
|
|
76
|
+
FamiliarSpecialAbility: DB.EnumCase<DB.ReferenceIdentifier>;
|
|
77
|
+
FatePointSexSpecialAbility: DB.EnumCase<DB.ReferenceIdentifier>;
|
|
78
|
+
FatePointSpecialAbility: DB.EnumCase<DB.ReferenceIdentifier>;
|
|
79
|
+
GeneralSpecialAbility: DB.EnumCase<DB.ReferenceIdentifier>;
|
|
80
|
+
KarmaSpecialAbility: DB.EnumCase<DB.ReferenceIdentifier>;
|
|
81
|
+
LiturgicalStyleSpecialAbility: DB.EnumCase<DB.ReferenceIdentifier>;
|
|
82
|
+
LycantropicGift: DB.EnumCase<DB.ReferenceIdentifier>;
|
|
83
|
+
MagicalSign: DB.EnumCase<DB.ReferenceIdentifier>;
|
|
84
|
+
MagicalSpecialAbility: DB.EnumCase<DB.ReferenceIdentifier>;
|
|
85
|
+
MagicalTradition: DB.EnumCase<DB.ReferenceIdentifier>;
|
|
86
|
+
MagicStyleSpecialAbility: DB.EnumCase<DB.ReferenceIdentifier>;
|
|
87
|
+
PactGift: DB.EnumCase<DB.ReferenceIdentifier>;
|
|
88
|
+
ProtectiveWardingCircleSpecialAbility: DB.EnumCase<DB.ReferenceIdentifier>;
|
|
89
|
+
Sermon: DB.EnumCase<DB.ReferenceIdentifier>;
|
|
90
|
+
SexSpecialAbility: DB.EnumCase<DB.ReferenceIdentifier>;
|
|
91
|
+
SikaryanDrainSpecialAbility: DB.EnumCase<DB.ReferenceIdentifier>;
|
|
92
|
+
SkillStyleSpecialAbility: DB.EnumCase<DB.ReferenceIdentifier>;
|
|
93
|
+
VampiricGift: DB.EnumCase<DB.ReferenceIdentifier>;
|
|
94
|
+
Vision: DB.EnumCase<DB.ReferenceIdentifier>;
|
|
95
|
+
Advantage: DB.EnumCase<DB.ReferenceIdentifier>;
|
|
96
|
+
Disadvantage: DB.EnumCase<DB.ReferenceIdentifier>;
|
|
97
|
+
}, []>>, false>;
|
|
41
98
|
require_minimum_spellworks_on: DB.MemberDecl<DB.IncludeIdentifier<[], DB.TypeAlias<"RequiredMinimumSkillsToBeOnSkillRating", DB.Object<{
|
|
42
99
|
number: DB.MemberDecl<DB.Integer, true>;
|
|
43
100
|
rating: DB.MemberDecl<DB.Integer, true>;
|
|
44
101
|
}>, []>>, false>;
|
|
45
102
|
}>, []>>>;
|
|
46
103
|
Aspects: DB.EnumCase<DB.IncludeIdentifier<[], DB.TypeAlias<"AspectSelectOptionCategory", DB.Object<{
|
|
47
|
-
|
|
104
|
+
requireActiveSelectionOnEntry: DB.MemberDecl<DB.IncludeIdentifier<[], DB.Enum<"ActivatableIdentifier", {
|
|
105
|
+
ArcaneOrbEnchantment: DB.EnumCase<DB.ReferenceIdentifier>;
|
|
106
|
+
AttireEnchantment: DB.EnumCase<DB.ReferenceIdentifier>;
|
|
107
|
+
Beutelzauber: DB.EnumCase<DB.ReferenceIdentifier>;
|
|
108
|
+
BowlEnchantment: DB.EnumCase<DB.ReferenceIdentifier>;
|
|
109
|
+
CauldronEnchantment: DB.EnumCase<DB.ReferenceIdentifier>;
|
|
110
|
+
ChronicleEnchantment: DB.EnumCase<DB.ReferenceIdentifier>;
|
|
111
|
+
DaggerRitual: DB.EnumCase<DB.ReferenceIdentifier>;
|
|
112
|
+
FoolsHatEnchantment: DB.EnumCase<DB.ReferenceIdentifier>;
|
|
113
|
+
Haubenzauber: DB.EnumCase<DB.ReferenceIdentifier>;
|
|
114
|
+
Hauerkettenzauber: DB.EnumCase<DB.ReferenceIdentifier>;
|
|
115
|
+
InstrumentEnchantment: DB.EnumCase<DB.ReferenceIdentifier>;
|
|
116
|
+
Keulenzauber: DB.EnumCase<DB.ReferenceIdentifier>;
|
|
117
|
+
Krallenkettenzauber: DB.EnumCase<DB.ReferenceIdentifier>;
|
|
118
|
+
Kristallkugelzauber: DB.EnumCase<DB.ReferenceIdentifier>;
|
|
119
|
+
OrbEnchantment: DB.EnumCase<DB.ReferenceIdentifier>;
|
|
120
|
+
RingEnchantment: DB.EnumCase<DB.ReferenceIdentifier>;
|
|
121
|
+
Schweinetrommelzauber: DB.EnumCase<DB.ReferenceIdentifier>;
|
|
122
|
+
SickleRitual: DB.EnumCase<DB.ReferenceIdentifier>;
|
|
123
|
+
SpellSwordEnchantment: DB.EnumCase<DB.ReferenceIdentifier>;
|
|
124
|
+
StaffEnchantment: DB.EnumCase<DB.ReferenceIdentifier>;
|
|
125
|
+
ToyEnchantment: DB.EnumCase<DB.ReferenceIdentifier>;
|
|
126
|
+
Trinkhornzauber: DB.EnumCase<DB.ReferenceIdentifier>;
|
|
127
|
+
WandEnchantment: DB.EnumCase<DB.ReferenceIdentifier>;
|
|
128
|
+
WeaponEnchantment: DB.EnumCase<DB.ReferenceIdentifier>;
|
|
129
|
+
AdvancedCombatSpecialAbility: DB.EnumCase<DB.ReferenceIdentifier>;
|
|
130
|
+
AdvancedKarmaSpecialAbility: DB.EnumCase<DB.ReferenceIdentifier>;
|
|
131
|
+
AdvancedMagicalSpecialAbility: DB.EnumCase<DB.ReferenceIdentifier>;
|
|
132
|
+
AdvancedSkillSpecialAbility: DB.EnumCase<DB.ReferenceIdentifier>;
|
|
133
|
+
AncestorGlyph: DB.EnumCase<DB.ReferenceIdentifier>;
|
|
134
|
+
BlessedTradition: DB.EnumCase<DB.ReferenceIdentifier>;
|
|
135
|
+
BrawlingSpecialAbility: DB.EnumCase<DB.ReferenceIdentifier>;
|
|
136
|
+
CeremonialItemSpecialAbility: DB.EnumCase<DB.ReferenceIdentifier>;
|
|
137
|
+
CombatSpecialAbility: DB.EnumCase<DB.ReferenceIdentifier>;
|
|
138
|
+
CombatStyleSpecialAbility: DB.EnumCase<DB.ReferenceIdentifier>;
|
|
139
|
+
CommandSpecialAbility: DB.EnumCase<DB.ReferenceIdentifier>;
|
|
140
|
+
FamiliarSpecialAbility: DB.EnumCase<DB.ReferenceIdentifier>;
|
|
141
|
+
FatePointSexSpecialAbility: DB.EnumCase<DB.ReferenceIdentifier>;
|
|
142
|
+
FatePointSpecialAbility: DB.EnumCase<DB.ReferenceIdentifier>;
|
|
143
|
+
GeneralSpecialAbility: DB.EnumCase<DB.ReferenceIdentifier>;
|
|
144
|
+
KarmaSpecialAbility: DB.EnumCase<DB.ReferenceIdentifier>;
|
|
145
|
+
LiturgicalStyleSpecialAbility: DB.EnumCase<DB.ReferenceIdentifier>;
|
|
146
|
+
LycantropicGift: DB.EnumCase<DB.ReferenceIdentifier>;
|
|
147
|
+
MagicalSign: DB.EnumCase<DB.ReferenceIdentifier>;
|
|
148
|
+
MagicalSpecialAbility: DB.EnumCase<DB.ReferenceIdentifier>;
|
|
149
|
+
MagicalTradition: DB.EnumCase<DB.ReferenceIdentifier>;
|
|
150
|
+
MagicStyleSpecialAbility: DB.EnumCase<DB.ReferenceIdentifier>;
|
|
151
|
+
PactGift: DB.EnumCase<DB.ReferenceIdentifier>;
|
|
152
|
+
ProtectiveWardingCircleSpecialAbility: DB.EnumCase<DB.ReferenceIdentifier>;
|
|
153
|
+
Sermon: DB.EnumCase<DB.ReferenceIdentifier>;
|
|
154
|
+
SexSpecialAbility: DB.EnumCase<DB.ReferenceIdentifier>;
|
|
155
|
+
SikaryanDrainSpecialAbility: DB.EnumCase<DB.ReferenceIdentifier>;
|
|
156
|
+
SkillStyleSpecialAbility: DB.EnumCase<DB.ReferenceIdentifier>;
|
|
157
|
+
VampiricGift: DB.EnumCase<DB.ReferenceIdentifier>;
|
|
158
|
+
Vision: DB.EnumCase<DB.ReferenceIdentifier>;
|
|
159
|
+
Advantage: DB.EnumCase<DB.ReferenceIdentifier>;
|
|
160
|
+
Disadvantage: DB.EnumCase<DB.ReferenceIdentifier>;
|
|
161
|
+
}, []>>, false>;
|
|
48
162
|
use_master_of_suffix_as_name: DB.MemberDecl<DB.Boolean, false>;
|
|
49
163
|
require_minimum_liturgies_on: DB.MemberDecl<DB.IncludeIdentifier<[], DB.TypeAlias<"RequiredMinimumSkillsToBeOnSkillRating", DB.Object<{
|
|
50
164
|
number: DB.MemberDecl<DB.Integer, true>;
|
|
@@ -2,9 +2,12 @@ import * as DB from "tsondb/schema/dsl";
|
|
|
2
2
|
export declare const AnimalDisease: DB.Entity<"AnimalDisease", {
|
|
3
3
|
level: DB.MemberDecl<DB.Integer, true>;
|
|
4
4
|
resistance: DB.MemberDecl<DB.IncludeIdentifier<[], DB.Enum<"Resistance", {
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
5
|
+
Single: DB.EnumCase<DB.IncludeIdentifier<[], DB.TypeAlias<"SingleResistance", DB.Object<{
|
|
6
|
+
derivedCharacteristic: DB.MemberDecl<DB.ReferenceIdentifier, true>;
|
|
7
|
+
}>, []>>>;
|
|
8
|
+
Minimum: DB.EnumCase<DB.IncludeIdentifier<[], DB.TypeAlias<"MinimumResistance", DB.Object<{
|
|
9
|
+
derivedCharacteristics: DB.MemberDecl<DB.Array<DB.ReferenceIdentifier>, true>;
|
|
10
|
+
}>, []>>>;
|
|
8
11
|
}, []>>, true>;
|
|
9
12
|
cause: DB.MemberDecl<DB.Array<DB.IncludeIdentifier<[], DB.TypeAlias<"Cause", DB.Object<{
|
|
10
13
|
chance: DB.MemberDecl<DB.Integer, false>;
|
package/lib/types/Ceremony.d.ts
CHANGED
|
@@ -2,10 +2,15 @@ import * as DB from "tsondb/schema/dsl";
|
|
|
2
2
|
export declare const Ceremony: DB.Entity<"Ceremony", {
|
|
3
3
|
check: DB.MemberDecl<DB.IncludeIdentifier<[], DB.TypeAlias<"SkillCheck", DB.Array<DB.ReferenceIdentifier>, []>>, true>;
|
|
4
4
|
check_penalty: DB.MemberDecl<DB.IncludeIdentifier<[], DB.Enum<"SkillCheckPenalty", {
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
5
|
+
DerivedCharacteristic: DB.EnumCase<DB.IncludeIdentifier<[], DB.Enum<"DerivedCharacteristicSkillCheckPenalty", {
|
|
6
|
+
Single: DB.EnumCase<DB.IncludeIdentifier<[], DB.TypeAlias<"SingleDerivedCharacteristicSkillCheckPenalty", DB.Object<{
|
|
7
|
+
derivedCharacteristic: DB.MemberDecl<DB.ReferenceIdentifier, true>;
|
|
8
|
+
halved: DB.MemberDecl<DB.Boolean, true>;
|
|
9
|
+
}>, []>>>;
|
|
10
|
+
Maximum: DB.EnumCase<DB.IncludeIdentifier<[], DB.TypeAlias<"MaximumDerivedCharacteristicSkillCheckPenalty", DB.Object<{
|
|
11
|
+
derivedCharacteristics: DB.MemberDecl<DB.Array<DB.ReferenceIdentifier>, true>;
|
|
12
|
+
}>, []>>>;
|
|
13
|
+
}, []>>>;
|
|
9
14
|
SummoningDifficulty: DB.EnumCase<null>;
|
|
10
15
|
CreationDifficulty: DB.EnumCase<null>;
|
|
11
16
|
Object: DB.EnumCase<null>;
|