@optolith/database-schema 0.52.2 → 0.54.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 +39 -0
- package/gen/types.d.ts +265 -203
- package/lib/cache/activatableSelectOptions.js +28 -12
- package/lib/types/Advantage.d.ts +253 -253
- package/lib/types/Blessing.d.ts +10 -0
- package/lib/types/Cantrip.d.ts +10 -0
- package/lib/types/Ceremony.d.ts +294 -125
- package/lib/types/DerivedCharacteristic.d.ts +23 -23
- package/lib/types/Disadvantage.d.ts +230 -230
- package/lib/types/FamiliarsTrick.d.ts +40 -0
- package/lib/types/LiturgicalChant.d.ts +294 -125
- package/lib/types/Locale.d.ts +1 -0
- package/lib/types/Locale.js +1 -0
- package/lib/types/Profession.d.ts +330 -330
- package/lib/types/Ritual.d.ts +294 -125
- package/lib/types/Spell.d.ts +294 -125
- package/lib/types/Talisman.d.ts +10 -0
- package/lib/types/_Activatable.d.ts +1 -0
- package/lib/types/_Activatable.js +4 -0
- package/lib/types/_ActivatableAdventurePointsValue.d.ts +46 -46
- package/lib/types/_ActivatableAutomatic.d.ts +23 -23
- package/lib/types/_ActivatableCombat.d.ts +5 -1
- package/lib/types/_ActivatableCombat.js +13 -1
- package/lib/types/_ActivatableNonMundane.d.ts +128 -64
- package/lib/types/_ActivatableNonMundane.js +10 -67
- package/lib/types/_ActivatableSelectOptionCategory.d.ts +368 -368
- package/lib/types/_ActivatableSelectOptionCategory.js +19 -3
- package/lib/types/_ActivatableSelectOptions.d.ts +230 -230
- package/lib/types/_ActivatableSkill.d.ts +680 -284
- package/lib/types/_ActivatableSkillCastingTime.d.ts +30 -0
- package/lib/types/_ActivatableSkillCastingTime.js +20 -0
- package/lib/types/_ActivatableSkillCost.d.ts +288 -186
- package/lib/types/_ActivatableSkillCost.js +109 -110
- package/lib/types/_ActivatableSkillDuration.d.ts +70 -0
- package/lib/types/_ActivatableSkillDuration.js +44 -0
- package/lib/types/_ActivatableSkillParameterMap.d.ts +34 -0
- package/lib/types/_ActivatableSkillParameterMap.js +64 -0
- package/lib/types/_IdentifierGroup.d.ts +117 -92
- package/lib/types/_IdentifierGroup.js +37 -26
- package/lib/types/equipment/item/HerbalPreservation.d.ts +20 -0
- package/lib/types/magicalActions/AnimistPower.d.ts +50 -0
- package/lib/types/magicalActions/Bannzeichen.d.ts +53 -2
- package/lib/types/magicalActions/Bannzeichen.js +2 -4
- package/lib/types/magicalActions/Curse.d.ts +20 -0
- package/lib/types/magicalActions/DominationRitual.d.ts +20 -0
- package/lib/types/magicalActions/ElvenMagicalSong.d.ts +10 -0
- package/lib/types/magicalActions/GeodeRitual.d.ts +28 -13
- package/lib/types/magicalActions/GeodeRitual.js +2 -2
- package/lib/types/magicalActions/GoblinRitual.d.ts +20 -0
- package/lib/types/magicalActions/JesterTrick.d.ts +30 -0
- package/lib/types/magicalActions/MagicalMelody.d.ts +10 -0
- package/lib/types/magicalActions/MagicalRune.d.ts +20 -0
- package/lib/types/magicalActions/ZibiljaRitual.d.ts +92 -34
- package/lib/types/prerequisites/PrerequisiteGroups.d.ts +161 -161
- package/lib/types/prerequisites/single/ActivatablePrerequisite.d.ts +23 -23
- package/lib/types/prerequisites/single/PropertyPrerequisite.d.ts +16 -0
- package/lib/types/prerequisites/single/PropertyPrerequisite.js +16 -0
- package/lib/types/specialAbility/AdvancedCombatSpecialAbility.d.ts +230 -230
- package/lib/types/specialAbility/AdvancedCombatSpecialAbility.js +2 -2
- package/lib/types/specialAbility/AdvancedKarmaSpecialAbility.d.ts +230 -230
- package/lib/types/specialAbility/AdvancedMagicalSpecialAbility.d.ts +230 -230
- package/lib/types/specialAbility/AdvancedSkillSpecialAbility.d.ts +230 -230
- package/lib/types/specialAbility/AncestorGlyph.d.ts +230 -230
- package/lib/types/specialAbility/BlessedTradition.d.ts +230 -230
- package/lib/types/specialAbility/BrawlingSpecialAbility.d.ts +230 -230
- package/lib/types/specialAbility/BrawlingSpecialAbility.js +2 -2
- package/lib/types/specialAbility/CeremonialItemSpecialAbility.d.ts +230 -230
- package/lib/types/specialAbility/CombatSpecialAbility.d.ts +230 -230
- package/lib/types/specialAbility/CombatSpecialAbility.js +2 -2
- package/lib/types/specialAbility/CombatStyleSpecialAbility.d.ts +232 -233
- package/lib/types/specialAbility/CombatStyleSpecialAbility.js +2 -2
- package/lib/types/specialAbility/CommandSpecialAbility.d.ts +230 -230
- package/lib/types/specialAbility/CommandSpecialAbility.js +2 -2
- package/lib/types/specialAbility/FamiliarSpecialAbility.d.ts +230 -230
- package/lib/types/specialAbility/FatePointSexSpecialAbility.d.ts +230 -230
- package/lib/types/specialAbility/FatePointSpecialAbility.d.ts +230 -230
- package/lib/types/specialAbility/GeneralSpecialAbility.d.ts +230 -230
- package/lib/types/specialAbility/KarmaSpecialAbility.d.ts +230 -230
- package/lib/types/specialAbility/LiturgicalStyleSpecialAbility.d.ts +230 -230
- package/lib/types/specialAbility/LycantropicGift.d.ts +230 -230
- package/lib/types/specialAbility/MagicStyleSpecialAbility.d.ts +231 -230
- package/lib/types/specialAbility/MagicStyleSpecialAbility.js +2 -1
- package/lib/types/specialAbility/MagicalSign.d.ts +12 -13
- package/lib/types/specialAbility/MagicalSign.js +2 -2
- package/lib/types/specialAbility/MagicalSpecialAbility.d.ts +230 -230
- package/lib/types/specialAbility/MagicalTradition.d.ts +230 -230
- package/lib/types/specialAbility/PactGift.d.ts +253 -253
- package/lib/types/specialAbility/ProtectiveWardingCircleSpecialAbility.d.ts +230 -230
- package/lib/types/specialAbility/Sermon.d.ts +230 -230
- package/lib/types/specialAbility/SexSpecialAbility.d.ts +230 -230
- package/lib/types/specialAbility/SikaryanDrainSpecialAbility.d.ts +230 -230
- package/lib/types/specialAbility/SkillStyleSpecialAbility.d.ts +230 -230
- package/lib/types/specialAbility/VampiricGift.d.ts +230 -230
- package/lib/types/specialAbility/Vision.d.ts +230 -230
- package/lib/types/specialAbility/sub/TradeSecret.d.ts +207 -207
- package/lib/types/traditionArtifacts/ArcaneOrbEnchantment.d.ts +301 -270
- package/lib/types/traditionArtifacts/AttireEnchantment.d.ts +301 -270
- package/lib/types/traditionArtifacts/Beutelzauber.d.ts +301 -270
- package/lib/types/traditionArtifacts/BowlEnchantment.d.ts +301 -270
- package/lib/types/traditionArtifacts/CauldronEnchantment.d.ts +301 -270
- package/lib/types/traditionArtifacts/ChronicleEnchantment.d.ts +301 -270
- package/lib/types/traditionArtifacts/DaggerRitual.d.ts +301 -270
- package/lib/types/traditionArtifacts/FoolsHatEnchantment.d.ts +301 -270
- package/lib/types/traditionArtifacts/Haubenzauber.d.ts +301 -270
- package/lib/types/traditionArtifacts/Hauerkettenzauber.d.ts +94 -63
- package/lib/types/traditionArtifacts/InstrumentEnchantment.d.ts +301 -270
- package/lib/types/traditionArtifacts/Keulenzauber.d.ts +94 -63
- package/lib/types/traditionArtifacts/Krallenkettenzauber.d.ts +301 -270
- package/lib/types/traditionArtifacts/Kristallkugelzauber.d.ts +301 -270
- package/lib/types/traditionArtifacts/OrbEnchantment.d.ts +301 -270
- package/lib/types/traditionArtifacts/RingEnchantment.d.ts +301 -270
- package/lib/types/traditionArtifacts/Schweinetrommelzauber.d.ts +94 -63
- package/lib/types/traditionArtifacts/SickleRitual.d.ts +301 -270
- package/lib/types/traditionArtifacts/SpellSwordEnchantment.d.ts +301 -270
- package/lib/types/traditionArtifacts/StaffEnchantment.d.ts +301 -270
- package/lib/types/traditionArtifacts/ToyEnchantment.d.ts +301 -270
- package/lib/types/traditionArtifacts/Trinkhornzauber.d.ts +301 -270
- package/lib/types/traditionArtifacts/WandEnchantment.d.ts +287 -254
- package/lib/types/traditionArtifacts/WeaponEnchantment.d.ts +301 -270
- package/package.json +9 -9
|
@@ -5,12 +5,13 @@ import { compareNullish, compareNumber } from "@elyukai/utils/ordering";
|
|
|
5
5
|
import { assertExhaustive } from "@elyukai/utils/typeSafety";
|
|
6
6
|
import { Case, fromUniformCase } from "tsondb/schema/gen";
|
|
7
7
|
const wrapPlainApValue = (apValue) => apValue === undefined ? undefined : Case("Fixed", apValue);
|
|
8
|
-
const matchesSpecificSkillishIdList = (
|
|
8
|
+
const matchesSpecificSkillishIdList = (config, matches) => {
|
|
9
|
+
const isInList = config.list.some(matches);
|
|
9
10
|
switch (config.operation.kind) {
|
|
10
11
|
case "Intersection":
|
|
11
|
-
return
|
|
12
|
+
return isInList;
|
|
12
13
|
case "Difference":
|
|
13
|
-
return !
|
|
14
|
+
return !isInList;
|
|
14
15
|
default:
|
|
15
16
|
return assertExhaustive(config.operation);
|
|
16
17
|
}
|
|
@@ -112,9 +113,24 @@ const getDefaultSkillishFilter = (category) => {
|
|
|
112
113
|
const { specific } = category;
|
|
113
114
|
return specific === undefined
|
|
114
115
|
? undefined
|
|
115
|
-
: ({ id }) => matchesSpecificSkillishIdList(
|
|
116
|
+
: ({ id }) => matchesSpecificSkillishIdList(specific, required => required === id);
|
|
116
117
|
};
|
|
117
|
-
const
|
|
118
|
+
const getSpellworkFilter = (category) => {
|
|
119
|
+
const { specific } = category;
|
|
120
|
+
return specific === undefined
|
|
121
|
+
? undefined
|
|
122
|
+
: ({ id, content: { property } }) => matchesSpecificSkillishIdList(specific, required => {
|
|
123
|
+
switch (required.kind) {
|
|
124
|
+
case "Single":
|
|
125
|
+
return required.Single === id;
|
|
126
|
+
case "Property":
|
|
127
|
+
return property === required.Property;
|
|
128
|
+
default:
|
|
129
|
+
return assertExhaustive(required);
|
|
130
|
+
}
|
|
131
|
+
});
|
|
132
|
+
};
|
|
133
|
+
const getDerivedSkillishSelectOptions = (database, entryId, entity, category, options, filter) => {
|
|
118
134
|
const { prerequisites } = category;
|
|
119
135
|
const { bindingCost, ap_value } = options;
|
|
120
136
|
const instances = database.getAllInstanceContainersOfEntity(entity);
|
|
@@ -625,17 +641,17 @@ const getDerivedSelectOptions = (selectOptionCategory, entryId, database, idMap)
|
|
|
625
641
|
const matchesGroupRequirement = category.Skills.groups === undefined ||
|
|
626
642
|
category.Skills.groups.some(ref => ref === content.group);
|
|
627
643
|
const matchesIdRequirement = category.Skills.specific === undefined ||
|
|
628
|
-
matchesSpecificSkillishIdList(
|
|
644
|
+
matchesSpecificSkillishIdList(category.Skills.specific, required => required === id);
|
|
629
645
|
return matchesGroupRequirement && matchesIdRequirement;
|
|
630
646
|
});
|
|
631
647
|
case "Spells":
|
|
632
|
-
return getDerivedSkillishSelectOptions(database, entryId, "Spell", category.Spells, selectOptionCategory.Skills);
|
|
648
|
+
return getDerivedSkillishSelectOptions(database, entryId, "Spell", category.Spells, selectOptionCategory.Skills, getSpellworkFilter(category.Spells));
|
|
633
649
|
case "Rituals":
|
|
634
|
-
return getDerivedSkillishSelectOptions(database, entryId, "Ritual", category.Rituals, selectOptionCategory.Skills);
|
|
650
|
+
return getDerivedSkillishSelectOptions(database, entryId, "Ritual", category.Rituals, selectOptionCategory.Skills, getSpellworkFilter(category.Rituals));
|
|
635
651
|
case "LiturgicalChants":
|
|
636
|
-
return getDerivedSkillishSelectOptions(database, entryId, "LiturgicalChant", category.LiturgicalChants, selectOptionCategory.Skills);
|
|
652
|
+
return getDerivedSkillishSelectOptions(database, entryId, "LiturgicalChant", category.LiturgicalChants, selectOptionCategory.Skills, getDefaultSkillishFilter(category.LiturgicalChants));
|
|
637
653
|
case "Ceremonies":
|
|
638
|
-
return getDerivedSkillishSelectOptions(database, entryId, "Ceremony", category.Ceremonies, selectOptionCategory.Skills);
|
|
654
|
+
return getDerivedSkillishSelectOptions(database, entryId, "Ceremony", category.Ceremonies, selectOptionCategory.Skills, getDefaultSkillishFilter(category.Ceremonies));
|
|
639
655
|
default:
|
|
640
656
|
return assertExhaustive(category);
|
|
641
657
|
}
|
|
@@ -644,9 +660,9 @@ const getDerivedSelectOptions = (selectOptionCategory, entryId, database, idMap)
|
|
|
644
660
|
return selectOptionCategory.CombatTechniques.categories.flatMap(category => {
|
|
645
661
|
switch (category.kind) {
|
|
646
662
|
case "CloseCombatTechniques":
|
|
647
|
-
return getDerivedSkillishSelectOptions(database, entryId, "CloseCombatTechnique", category.CloseCombatTechniques, selectOptionCategory.CombatTechniques);
|
|
663
|
+
return getDerivedSkillishSelectOptions(database, entryId, "CloseCombatTechnique", category.CloseCombatTechniques, selectOptionCategory.CombatTechniques, getDefaultSkillishFilter(category.CloseCombatTechniques));
|
|
648
664
|
case "RangedCombatTechniques":
|
|
649
|
-
return getDerivedSkillishSelectOptions(database, entryId, "RangedCombatTechnique", category.RangedCombatTechniques, selectOptionCategory.CombatTechniques);
|
|
665
|
+
return getDerivedSkillishSelectOptions(database, entryId, "RangedCombatTechnique", category.RangedCombatTechniques, selectOptionCategory.CombatTechniques, getDefaultSkillishFilter(category.RangedCombatTechniques));
|
|
650
666
|
default:
|
|
651
667
|
return assertExhaustive(category);
|
|
652
668
|
}
|