@optolith/database-schema 0.42.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/AUTHORS +1 -0
- package/CHANGELOG.md +1789 -0
- package/LICENSE +378 -0
- package/README.md +34 -0
- package/gen/types.d.ts +24682 -0
- package/lib/cache/activatableSelectOptions.d.ts +18 -0
- package/lib/cache/activatableSelectOptions.js +762 -0
- package/lib/cache/ancestorBloodAdvantages.d.ts +4 -0
- package/lib/cache/ancestorBloodAdvantages.js +13 -0
- package/lib/cache/index.d.ts +31 -0
- package/lib/cache/index.js +22 -0
- package/lib/cache/internal.d.ts +4 -0
- package/lib/cache/internal.js +1 -0
- package/lib/cache/magicalAndBlessedAdvantagesAndDisadvantages.d.ts +3 -0
- package/lib/cache/magicalAndBlessedAdvantagesAndDisadvantages.js +103 -0
- package/lib/cache/newApplicationsAndUses.d.ts +22 -0
- package/lib/cache/newApplicationsAndUses.js +12 -0
- package/lib/main.d.ts +17 -0
- package/lib/main.js +226 -0
- package/lib/test.d.ts +1 -0
- package/lib/test.js +11 -0
- package/lib/types/Advantage.d.ts +1193 -0
- package/lib/types/Advantage.js +58 -0
- package/lib/types/AnimalDisease.d.ts +91 -0
- package/lib/types/AnimalDisease.js +35 -0
- package/lib/types/AnimalType.d.ts +6 -0
- package/lib/types/AnimalType.js +21 -0
- package/lib/types/ArcaneBardTradition.d.ts +30 -0
- package/lib/types/ArcaneBardTradition.js +14 -0
- package/lib/types/ArcaneDancerTradition.d.ts +30 -0
- package/lib/types/ArcaneDancerTradition.js +14 -0
- package/lib/types/Aspect.d.ts +7 -0
- package/lib/types/Aspect.js +27 -0
- package/lib/types/Attribute.d.ts +19 -0
- package/lib/types/Attribute.js +49 -0
- package/lib/types/Blessing.d.ts +106 -0
- package/lib/types/Blessing.js +102 -0
- package/lib/types/Cantrip.d.ts +134 -0
- package/lib/types/Cantrip.js +166 -0
- package/lib/types/Ceremony.d.ts +685 -0
- package/lib/types/Ceremony.js +94 -0
- package/lib/types/CombatTechnique.d.ts +153 -0
- package/lib/types/CombatTechnique.js +133 -0
- package/lib/types/Condition.d.ts +53 -0
- package/lib/types/Condition.js +38 -0
- package/lib/types/Continent.d.ts +6 -0
- package/lib/types/Continent.js +22 -0
- package/lib/types/Culture.d.ts +158 -0
- package/lib/types/Culture.js +374 -0
- package/lib/types/DerivedCharacteristic.d.ts +267 -0
- package/lib/types/DerivedCharacteristic.js +227 -0
- package/lib/types/Disadvantage.d.ts +1120 -0
- package/lib/types/Disadvantage.js +59 -0
- package/lib/types/Disease.d.ts +111 -0
- package/lib/types/Disease.js +35 -0
- package/lib/types/Element.d.ts +6 -0
- package/lib/types/Element.js +21 -0
- package/lib/types/ExperienceLevel.d.ts +13 -0
- package/lib/types/ExperienceLevel.js +56 -0
- package/lib/types/EyeColor.d.ts +6 -0
- package/lib/types/EyeColor.js +21 -0
- package/lib/types/FamiliarsTrick.d.ts +192 -0
- package/lib/types/FamiliarsTrick.js +202 -0
- package/lib/types/HairColor.d.ts +6 -0
- package/lib/types/HairColor.js +21 -0
- package/lib/types/HomunculusType.d.ts +6 -0
- package/lib/types/HomunculusType.js +15 -0
- package/lib/types/Influence.d.ts +80 -0
- package/lib/types/Influence.js +52 -0
- package/lib/types/Lessons.d.ts +181 -0
- package/lib/types/Lessons.js +230 -0
- package/lib/types/LiturgicalChant.d.ts +685 -0
- package/lib/types/LiturgicalChant.js +94 -0
- package/lib/types/Locale.d.ts +1607 -0
- package/lib/types/Locale.js +1747 -0
- package/lib/types/MetaCondition.d.ts +53 -0
- package/lib/types/MetaCondition.js +39 -0
- package/lib/types/PactCategory.d.ts +75 -0
- package/lib/types/PactCategory.js +102 -0
- package/lib/types/Patron.d.ts +101 -0
- package/lib/types/Patron.js +203 -0
- package/lib/types/PatronCategory.d.ts +7 -0
- package/lib/types/PatronCategory.js +26 -0
- package/lib/types/PersonalityTrait.d.ts +81 -0
- package/lib/types/PersonalityTrait.js +58 -0
- package/lib/types/Profession.d.ts +2120 -0
- package/lib/types/Profession.js +631 -0
- package/lib/types/Property.d.ts +7 -0
- package/lib/types/Property.js +26 -0
- package/lib/types/Race.d.ts +207 -0
- package/lib/types/Race.js +332 -0
- package/lib/types/Region.d.ts +6 -0
- package/lib/types/Region.js +21 -0
- package/lib/types/Ritual.d.ts +688 -0
- package/lib/types/Ritual.js +96 -0
- package/lib/types/Service.d.ts +56 -0
- package/lib/types/Service.js +45 -0
- package/lib/types/SexPractice.d.ts +51 -0
- package/lib/types/SexPractice.js +39 -0
- package/lib/types/Skill.d.ts +116 -0
- package/lib/types/Skill.js +139 -0
- package/lib/types/SkillGroup.d.ts +17 -0
- package/lib/types/SkillGroup.js +45 -0
- package/lib/types/SkillModificationLevel.d.ts +34 -0
- package/lib/types/SkillModificationLevel.js +116 -0
- package/lib/types/SocialStatus.d.ts +7 -0
- package/lib/types/SocialStatus.js +26 -0
- package/lib/types/Spell.d.ts +688 -0
- package/lib/types/Spell.js +96 -0
- package/lib/types/State.d.ts +52 -0
- package/lib/types/State.js +31 -0
- package/lib/types/Talisman.d.ts +135 -0
- package/lib/types/Talisman.js +168 -0
- package/lib/types/TargetCategory.d.ts +7 -0
- package/lib/types/TargetCategory.js +26 -0
- package/lib/types/_Activatable.d.ts +12 -0
- package/lib/types/_Activatable.js +43 -0
- package/lib/types/_ActivatableAdvanced.d.ts +50 -0
- package/lib/types/_ActivatableAdvanced.js +101 -0
- package/lib/types/_ActivatableAdventurePointsValue.d.ts +159 -0
- package/lib/types/_ActivatableAdventurePointsValue.js +148 -0
- package/lib/types/_ActivatableAutomatic.d.ts +74 -0
- package/lib/types/_ActivatableAutomatic.js +64 -0
- package/lib/types/_ActivatableCombat.d.ts +123 -0
- package/lib/types/_ActivatableCombat.js +350 -0
- package/lib/types/_ActivatableNames.d.ts +15 -0
- package/lib/types/_ActivatableNames.js +26 -0
- package/lib/types/_ActivatableNonMundane.d.ts +387 -0
- package/lib/types/_ActivatableNonMundane.js +536 -0
- package/lib/types/_ActivatableSelectOptionCategory.d.ts +1380 -0
- package/lib/types/_ActivatableSelectOptionCategory.js +478 -0
- package/lib/types/_ActivatableSelectOptions.d.ts +1077 -0
- package/lib/types/_ActivatableSelectOptions.js +218 -0
- package/lib/types/_ActivatableSkill.d.ts +1231 -0
- package/lib/types/_ActivatableSkill.js +89 -0
- package/lib/types/_ActivatableSkillApplicationsAndUses.d.ts +109 -0
- package/lib/types/_ActivatableSkillApplicationsAndUses.js +80 -0
- package/lib/types/_ActivatableSkillCastingTime.d.ts +66 -0
- package/lib/types/_ActivatableSkillCastingTime.js +92 -0
- package/lib/types/_ActivatableSkillCheckResultBased.d.ts +27 -0
- package/lib/types/_ActivatableSkillCheckResultBased.js +45 -0
- package/lib/types/_ActivatableSkillCost.d.ts +366 -0
- package/lib/types/_ActivatableSkillCost.js +280 -0
- package/lib/types/_ActivatableSkillDuration.d.ts +204 -0
- package/lib/types/_ActivatableSkillDuration.js +138 -0
- package/lib/types/_ActivatableSkillEffect.d.ts +16 -0
- package/lib/types/_ActivatableSkillEffect.js +65 -0
- package/lib/types/_ActivatableSkillRange.d.ts +62 -0
- package/lib/types/_ActivatableSkillRange.js +106 -0
- package/lib/types/_ActivatableSkillTargetCategory.d.ts +14 -0
- package/lib/types/_ActivatableSkillTargetCategory.js +30 -0
- package/lib/types/_AlternativeNames.d.ts +5 -0
- package/lib/types/_AlternativeNames.js +14 -0
- package/lib/types/_ArcaneTradition.d.ts +30 -0
- package/lib/types/_ArcaneTradition.js +14 -0
- package/lib/types/_Blessed.d.ts +8 -0
- package/lib/types/_Blessed.js +22 -0
- package/lib/types/_Color.d.ts +19 -0
- package/lib/types/_Color.js +27 -0
- package/lib/types/_CommonnessRatedAdvantageDisadvantage.d.ts +7 -0
- package/lib/types/_CommonnessRatedAdvantageDisadvantage.js +19 -0
- package/lib/types/_Dice.d.ts +6 -0
- package/lib/types/_Dice.js +23 -0
- package/lib/types/_DiseasePoison.d.ts +59 -0
- package/lib/types/_DiseasePoison.js +110 -0
- package/lib/types/_Enhancements.d.ts +170 -0
- package/lib/types/_Enhancements.js +80 -0
- package/lib/types/_Identifier.d.ts +170 -0
- package/lib/types/_Identifier.js +325 -0
- package/lib/types/_IdentifierGroup.d.ts +413 -0
- package/lib/types/_IdentifierGroup.js +333 -0
- package/lib/types/_ImprovementCost.d.ts +7 -0
- package/lib/types/_ImprovementCost.js +10 -0
- package/lib/types/_MathExpression.d.ts +12 -0
- package/lib/types/_MathExpression.js +36 -0
- package/lib/types/_Prerequisite.d.ts +421 -0
- package/lib/types/_Prerequisite.js +163 -0
- package/lib/types/_ResponsiveText.d.ts +13 -0
- package/lib/types/_ResponsiveText.js +43 -0
- package/lib/types/_Sex.d.ts +5 -0
- package/lib/types/_Sex.js +8 -0
- package/lib/types/_SizeCategory.d.ts +15 -0
- package/lib/types/_SizeCategory.js +24 -0
- package/lib/types/_SkillCheck.d.ts +11 -0
- package/lib/types/_SkillCheck.js +23 -0
- package/lib/types/_Spellwork.d.ts +17 -0
- package/lib/types/_Spellwork.js +39 -0
- package/lib/types/equipment/EquipmentPackage.d.ts +85 -0
- package/lib/types/equipment/EquipmentPackage.js +41 -0
- package/lib/types/equipment/item/Ammunition.d.ts +72 -0
- package/lib/types/equipment/item/Ammunition.js +44 -0
- package/lib/types/equipment/item/Animal.d.ts +72 -0
- package/lib/types/equipment/item/Animal.js +22 -0
- package/lib/types/equipment/item/AnimalCare.d.ts +87 -0
- package/lib/types/equipment/item/AnimalCare.js +58 -0
- package/lib/types/equipment/item/Armor.d.ts +166 -0
- package/lib/types/equipment/item/Armor.js +181 -0
- package/lib/types/equipment/item/BandageOrRemedy.d.ts +201 -0
- package/lib/types/equipment/item/BandageOrRemedy.js +48 -0
- package/lib/types/equipment/item/Book.d.ts +169 -0
- package/lib/types/equipment/item/Book.js +271 -0
- package/lib/types/equipment/item/CeremonialItem.d.ts +202 -0
- package/lib/types/equipment/item/CeremonialItem.js +53 -0
- package/lib/types/equipment/item/Clothes.d.ts +201 -0
- package/lib/types/equipment/item/Clothes.js +48 -0
- package/lib/types/equipment/item/ClothingPackage.d.ts +63 -0
- package/lib/types/equipment/item/ClothingPackage.js +21 -0
- package/lib/types/equipment/item/Container.d.ts +201 -0
- package/lib/types/equipment/item/Container.js +48 -0
- package/lib/types/equipment/item/Elixir.d.ts +119 -0
- package/lib/types/equipment/item/Elixir.js +110 -0
- package/lib/types/equipment/item/EquipmentOfBlessedOnes.d.ts +215 -0
- package/lib/types/equipment/item/EquipmentOfBlessedOnes.js +44 -0
- package/lib/types/equipment/item/GemOrPreciousStone.d.ts +74 -0
- package/lib/types/equipment/item/GemOrPreciousStone.js +52 -0
- package/lib/types/equipment/item/IlluminationLightSource.d.ts +210 -0
- package/lib/types/equipment/item/IlluminationLightSource.js +78 -0
- package/lib/types/equipment/item/IlluminationRefillOrSupply.d.ts +201 -0
- package/lib/types/equipment/item/IlluminationRefillOrSupply.js +48 -0
- package/lib/types/equipment/item/Jewelry.d.ts +74 -0
- package/lib/types/equipment/item/Jewelry.js +46 -0
- package/lib/types/equipment/item/Laboratory.d.ts +81 -0
- package/lib/types/equipment/item/Laboratory.js +34 -0
- package/lib/types/equipment/item/Liebesspielzeug.d.ts +201 -0
- package/lib/types/equipment/item/Liebesspielzeug.js +48 -0
- package/lib/types/equipment/item/LuxuryGood.d.ts +201 -0
- package/lib/types/equipment/item/LuxuryGood.js +48 -0
- package/lib/types/equipment/item/MagicalArtifact.d.ts +204 -0
- package/lib/types/equipment/item/MagicalArtifact.js +82 -0
- package/lib/types/equipment/item/MusicalInstrument.d.ts +201 -0
- package/lib/types/equipment/item/MusicalInstrument.js +48 -0
- package/lib/types/equipment/item/Newspaper.d.ts +67 -0
- package/lib/types/equipment/item/Newspaper.js +36 -0
- package/lib/types/equipment/item/OrienteeringAid.d.ts +200 -0
- package/lib/types/equipment/item/OrienteeringAid.js +2 -0
- package/lib/types/equipment/item/Poison.d.ts +621 -0
- package/lib/types/equipment/item/Poison.js +486 -0
- package/lib/types/equipment/item/RopeOrChain.d.ts +200 -0
- package/lib/types/equipment/item/RopeOrChain.js +2 -0
- package/lib/types/equipment/item/Stationery.d.ts +200 -0
- package/lib/types/equipment/item/Stationery.js +2 -0
- package/lib/types/equipment/item/ThievesTool.d.ts +200 -0
- package/lib/types/equipment/item/ThievesTool.js +2 -0
- package/lib/types/equipment/item/ToolOfTheTrade.d.ts +83 -0
- package/lib/types/equipment/item/ToolOfTheTrade.js +34 -0
- package/lib/types/equipment/item/TravelGearOrTool.d.ts +201 -0
- package/lib/types/equipment/item/TravelGearOrTool.js +48 -0
- package/lib/types/equipment/item/Vehicle.d.ts +80 -0
- package/lib/types/equipment/item/Vehicle.js +30 -0
- package/lib/types/equipment/item/Weapon.d.ts +225 -0
- package/lib/types/equipment/item/Weapon.js +132 -0
- package/lib/types/equipment/item/WeaponAccessory.d.ts +201 -0
- package/lib/types/equipment/item/WeaponAccessory.js +48 -0
- package/lib/types/equipment/item/WorkingSupernaturalCreature.d.ts +72 -0
- package/lib/types/equipment/item/WorkingSupernaturalCreature.js +44 -0
- package/lib/types/equipment/item/_Herbary.d.ts +76 -0
- package/lib/types/equipment/item/_Herbary.js +48 -0
- package/lib/types/equipment/item/_Item.d.ts +414 -0
- package/lib/types/equipment/item/_Item.js +254 -0
- package/lib/types/equipment/item/_MeleeWeapon.d.ts +62 -0
- package/lib/types/equipment/item/_MeleeWeapon.js +100 -0
- package/lib/types/equipment/item/_RangedWeapon.d.ts +38 -0
- package/lib/types/equipment/item/_RangedWeapon.js +93 -0
- package/lib/types/equipment/item/_Weapon.d.ts +25 -0
- package/lib/types/equipment/item/_Weapon.js +77 -0
- package/lib/types/equipment/item/sub/ArmorType.d.ts +7 -0
- package/lib/types/equipment/item/sub/ArmorType.js +25 -0
- package/lib/types/equipment/item/sub/Reach.d.ts +7 -0
- package/lib/types/equipment/item/sub/Reach.js +28 -0
- package/lib/types/index.d.ts +160 -0
- package/lib/types/index.js +160 -0
- package/lib/types/magicalActions/AnimistPower.d.ts +302 -0
- package/lib/types/magicalActions/AnimistPower.js +204 -0
- package/lib/types/magicalActions/AnimistPower_Tribe.d.ts +30 -0
- package/lib/types/magicalActions/AnimistPower_Tribe.js +26 -0
- package/lib/types/magicalActions/Bannzeichen.d.ts +244 -0
- package/lib/types/magicalActions/Bannzeichen.js +231 -0
- package/lib/types/magicalActions/Curse.d.ts +219 -0
- package/lib/types/magicalActions/Curse.js +133 -0
- package/lib/types/magicalActions/DominationRitual.d.ts +204 -0
- package/lib/types/magicalActions/DominationRitual.js +133 -0
- package/lib/types/magicalActions/ElvenMagicalSong.d.ts +126 -0
- package/lib/types/magicalActions/ElvenMagicalSong.js +117 -0
- package/lib/types/magicalActions/GeodeRitual.d.ts +227 -0
- package/lib/types/magicalActions/GeodeRitual.js +142 -0
- package/lib/types/magicalActions/GoblinRitual.d.ts +286 -0
- package/lib/types/magicalActions/GoblinRitual.js +196 -0
- package/lib/types/magicalActions/JesterTrick.d.ts +305 -0
- package/lib/types/magicalActions/JesterTrick.js +160 -0
- package/lib/types/magicalActions/MagicalDance.d.ts +129 -0
- package/lib/types/magicalActions/MagicalDance.js +119 -0
- package/lib/types/magicalActions/MagicalMelody.d.ts +133 -0
- package/lib/types/magicalActions/MagicalMelody.js +123 -0
- package/lib/types/magicalActions/MagicalRune.d.ts +279 -0
- package/lib/types/magicalActions/MagicalRune.js +292 -0
- package/lib/types/magicalActions/ZibiljaRitual.d.ts +420 -0
- package/lib/types/magicalActions/ZibiljaRitual.js +90 -0
- package/lib/types/magicalActions/_MusicTradition.d.ts +17 -0
- package/lib/types/magicalActions/_MusicTradition.js +43 -0
- package/lib/types/prerequisites/ConditionalPrerequisites.d.ts +42 -0
- package/lib/types/prerequisites/ConditionalPrerequisites.js +9 -0
- package/lib/types/prerequisites/DisplayOption.d.ts +13 -0
- package/lib/types/prerequisites/DisplayOption.js +27 -0
- package/lib/types/prerequisites/PrerequisiteGroups.d.ts +2053 -0
- package/lib/types/prerequisites/PrerequisiteGroups.js +180 -0
- package/lib/types/prerequisites/single/ActivatablePrerequisite.d.ts +133 -0
- package/lib/types/prerequisites/single/ActivatablePrerequisite.js +32 -0
- package/lib/types/prerequisites/single/AncestorBloodPrerequisite.d.ts +4 -0
- package/lib/types/prerequisites/single/AncestorBloodPrerequisite.js +4 -0
- package/lib/types/prerequisites/single/AnimistPowerPrerequisite.d.ts +18 -0
- package/lib/types/prerequisites/single/AnimistPowerPrerequisite.js +24 -0
- package/lib/types/prerequisites/single/CulturePrerequisite.d.ts +16 -0
- package/lib/types/prerequisites/single/CulturePrerequisite.js +16 -0
- package/lib/types/prerequisites/single/EnhancementPrerequisite.d.ts +4 -0
- package/lib/types/prerequisites/single/EnhancementPrerequisite.js +12 -0
- package/lib/types/prerequisites/single/InfluencePrerequisite.d.ts +17 -0
- package/lib/types/prerequisites/single/InfluencePrerequisite.js +19 -0
- package/lib/types/prerequisites/single/PactPrerequisite.d.ts +18 -0
- package/lib/types/prerequisites/single/PactPrerequisite.js +24 -0
- package/lib/types/prerequisites/single/PersonalityTraitPrerequisite.d.ts +17 -0
- package/lib/types/prerequisites/single/PersonalityTraitPrerequisite.js +19 -0
- package/lib/types/prerequisites/single/PrimaryAttributePrerequisite.d.ts +20 -0
- package/lib/types/prerequisites/single/PrimaryAttributePrerequisite.js +25 -0
- package/lib/types/prerequisites/single/ProfessionPrerequisite.d.ts +16 -0
- package/lib/types/prerequisites/single/ProfessionPrerequisite.js +16 -0
- package/lib/types/prerequisites/single/PublicationPrerequisite.d.ts +16 -0
- package/lib/types/prerequisites/single/PublicationPrerequisite.js +15 -0
- package/lib/types/prerequisites/single/RacePrerequisite.d.ts +17 -0
- package/lib/types/prerequisites/single/RacePrerequisite.js +19 -0
- package/lib/types/prerequisites/single/RatedMinimumNumberPrerequisite.d.ts +51 -0
- package/lib/types/prerequisites/single/RatedMinimumNumberPrerequisite.js +82 -0
- package/lib/types/prerequisites/single/RatedPrerequisite.d.ts +26 -0
- package/lib/types/prerequisites/single/RatedPrerequisite.js +19 -0
- package/lib/types/prerequisites/single/RatedSumPrerequisite.d.ts +17 -0
- package/lib/types/prerequisites/single/RatedSumPrerequisite.js +19 -0
- package/lib/types/prerequisites/single/RulePrerequisite.d.ts +19 -0
- package/lib/types/prerequisites/single/RulePrerequisite.js +15 -0
- package/lib/types/prerequisites/single/SexPrerequisite.d.ts +19 -0
- package/lib/types/prerequisites/single/SexPrerequisite.js +15 -0
- package/lib/types/prerequisites/single/SexualCharacteristicPrerequisite.d.ts +7 -0
- package/lib/types/prerequisites/single/SexualCharacteristicPrerequisite.js +17 -0
- package/lib/types/prerequisites/single/SocialStatusPrerequisite.d.ts +16 -0
- package/lib/types/prerequisites/single/SocialStatusPrerequisite.js +16 -0
- package/lib/types/prerequisites/single/StatePrerequisite.d.ts +16 -0
- package/lib/types/prerequisites/single/StatePrerequisite.js +15 -0
- package/lib/types/prerequisites/single/TextPrerequisite.d.ts +19 -0
- package/lib/types/prerequisites/single/TextPrerequisite.js +53 -0
- package/lib/types/prerequisites/single/TraditionPrerequisite.d.ts +37 -0
- package/lib/types/prerequisites/single/TraditionPrerequisite.js +42 -0
- package/lib/types/rule/AlternativeRule.d.ts +54 -0
- package/lib/types/rule/AlternativeRule.js +40 -0
- package/lib/types/rule/AlternativeRule_PlayerType.d.ts +6 -0
- package/lib/types/rule/AlternativeRule_PlayerType.js +16 -0
- package/lib/types/rule/CoreRule.d.ts +143 -0
- package/lib/types/rule/CoreRule.js +181 -0
- package/lib/types/rule/FocusRule.d.ts +79 -0
- package/lib/types/rule/FocusRule.js +48 -0
- package/lib/types/rule/FocusRule_Subject.d.ts +6 -0
- package/lib/types/rule/FocusRule_Subject.js +22 -0
- package/lib/types/rule/OptionalRule.d.ts +83 -0
- package/lib/types/rule/OptionalRule.js +59 -0
- package/lib/types/source/Publication.d.ts +50 -0
- package/lib/types/source/Publication.js +64 -0
- package/lib/types/source/_Erratum.d.ts +12 -0
- package/lib/types/source/_Erratum.js +22 -0
- package/lib/types/source/_PublicationRef.d.ts +168 -0
- package/lib/types/source/_PublicationRef.js +164 -0
- package/lib/types/specialAbility/AdvancedCombatSpecialAbility.d.ts +1234 -0
- package/lib/types/specialAbility/AdvancedCombatSpecialAbility.js +52 -0
- package/lib/types/specialAbility/AdvancedKarmaSpecialAbility.d.ts +1116 -0
- package/lib/types/specialAbility/AdvancedKarmaSpecialAbility.js +47 -0
- package/lib/types/specialAbility/AdvancedMagicalSpecialAbility.d.ts +1116 -0
- package/lib/types/specialAbility/AdvancedMagicalSpecialAbility.js +47 -0
- package/lib/types/specialAbility/AdvancedSkillSpecialAbility.d.ts +1116 -0
- package/lib/types/specialAbility/AdvancedSkillSpecialAbility.js +47 -0
- package/lib/types/specialAbility/AncestorGlyph.d.ts +1063 -0
- package/lib/types/specialAbility/AncestorGlyph.js +48 -0
- package/lib/types/specialAbility/BlessedTradition.d.ts +1141 -0
- package/lib/types/specialAbility/BlessedTradition.js +147 -0
- package/lib/types/specialAbility/BrawlingSpecialAbility.d.ts +1127 -0
- package/lib/types/specialAbility/BrawlingSpecialAbility.js +46 -0
- package/lib/types/specialAbility/CeremonialItemSpecialAbility.d.ts +1117 -0
- package/lib/types/specialAbility/CeremonialItemSpecialAbility.js +53 -0
- package/lib/types/specialAbility/CombatSpecialAbility.d.ts +1235 -0
- package/lib/types/specialAbility/CombatSpecialAbility.js +52 -0
- package/lib/types/specialAbility/CombatStyleSpecialAbility.d.ts +1286 -0
- package/lib/types/specialAbility/CombatStyleSpecialAbility.js +54 -0
- package/lib/types/specialAbility/CommandSpecialAbility.d.ts +1127 -0
- package/lib/types/specialAbility/CommandSpecialAbility.js +46 -0
- package/lib/types/specialAbility/FamiliarSpecialAbility.d.ts +1062 -0
- package/lib/types/specialAbility/FamiliarSpecialAbility.js +43 -0
- package/lib/types/specialAbility/FatePointSexSpecialAbility.d.ts +1062 -0
- package/lib/types/specialAbility/FatePointSexSpecialAbility.js +43 -0
- package/lib/types/specialAbility/FatePointSpecialAbility.d.ts +1116 -0
- package/lib/types/specialAbility/FatePointSpecialAbility.js +46 -0
- package/lib/types/specialAbility/GeneralSpecialAbility.d.ts +1117 -0
- package/lib/types/specialAbility/GeneralSpecialAbility.js +47 -0
- package/lib/types/specialAbility/KarmaSpecialAbility.d.ts +1062 -0
- package/lib/types/specialAbility/KarmaSpecialAbility.js +43 -0
- package/lib/types/specialAbility/LiturgicalStyleSpecialAbility.d.ts +1165 -0
- package/lib/types/specialAbility/LiturgicalStyleSpecialAbility.js +49 -0
- package/lib/types/specialAbility/LycantropicGift.d.ts +1062 -0
- package/lib/types/specialAbility/LycantropicGift.js +43 -0
- package/lib/types/specialAbility/MagicStyleSpecialAbility.d.ts +1165 -0
- package/lib/types/specialAbility/MagicStyleSpecialAbility.js +49 -0
- package/lib/types/specialAbility/MagicalSign.d.ts +127 -0
- package/lib/types/specialAbility/MagicalSign.js +66 -0
- package/lib/types/specialAbility/MagicalSpecialAbility.d.ts +1117 -0
- package/lib/types/specialAbility/MagicalSpecialAbility.js +47 -0
- package/lib/types/specialAbility/MagicalTradition.d.ts +1138 -0
- package/lib/types/specialAbility/MagicalTradition.js +115 -0
- package/lib/types/specialAbility/PactGift.d.ts +1143 -0
- package/lib/types/specialAbility/PactGift.js +76 -0
- package/lib/types/specialAbility/ProtectiveWardingCircleSpecialAbility.d.ts +1064 -0
- package/lib/types/specialAbility/ProtectiveWardingCircleSpecialAbility.js +54 -0
- package/lib/types/specialAbility/Sermon.d.ts +1062 -0
- package/lib/types/specialAbility/Sermon.js +43 -0
- package/lib/types/specialAbility/SexSpecialAbility.d.ts +1116 -0
- package/lib/types/specialAbility/SexSpecialAbility.js +46 -0
- package/lib/types/specialAbility/SikaryanDrainSpecialAbility.d.ts +1062 -0
- package/lib/types/specialAbility/SikaryanDrainSpecialAbility.js +43 -0
- package/lib/types/specialAbility/SkillStyleSpecialAbility.d.ts +1111 -0
- package/lib/types/specialAbility/SkillStyleSpecialAbility.js +46 -0
- package/lib/types/specialAbility/VampiricGift.d.ts +1062 -0
- package/lib/types/specialAbility/VampiricGift.js +43 -0
- package/lib/types/specialAbility/Vision.d.ts +1062 -0
- package/lib/types/specialAbility/Vision.js +43 -0
- package/lib/types/specialAbility/_Tradition.d.ts +5 -0
- package/lib/types/specialAbility/_Tradition.js +14 -0
- package/lib/types/specialAbility/sub/Language.d.ts +108 -0
- package/lib/types/specialAbility/sub/Language.js +98 -0
- package/lib/types/specialAbility/sub/Script.d.ts +62 -0
- package/lib/types/specialAbility/sub/Script.js +50 -0
- package/lib/types/specialAbility/sub/TradeSecret.d.ts +972 -0
- package/lib/types/specialAbility/sub/TradeSecret.js +76 -0
- package/lib/types/specialAbility/sub/_LanguageScript.d.ts +5 -0
- package/lib/types/specialAbility/sub/_LanguageScript.js +15 -0
- package/lib/types/traditionArtifacts/ArcaneOrbEnchantment.d.ts +1282 -0
- package/lib/types/traditionArtifacts/ArcaneOrbEnchantment.js +50 -0
- package/lib/types/traditionArtifacts/AttireEnchantment.d.ts +1282 -0
- package/lib/types/traditionArtifacts/AttireEnchantment.js +50 -0
- package/lib/types/traditionArtifacts/Beutelzauber.d.ts +1282 -0
- package/lib/types/traditionArtifacts/Beutelzauber.js +50 -0
- package/lib/types/traditionArtifacts/BowlEnchantment.d.ts +1282 -0
- package/lib/types/traditionArtifacts/BowlEnchantment.js +50 -0
- package/lib/types/traditionArtifacts/CauldronEnchantment.d.ts +1283 -0
- package/lib/types/traditionArtifacts/CauldronEnchantment.js +55 -0
- package/lib/types/traditionArtifacts/ChronicleEnchantment.d.ts +1282 -0
- package/lib/types/traditionArtifacts/ChronicleEnchantment.js +50 -0
- package/lib/types/traditionArtifacts/DaggerRitual.d.ts +1294 -0
- package/lib/types/traditionArtifacts/DaggerRitual.js +85 -0
- package/lib/types/traditionArtifacts/FoolsHatEnchantment.d.ts +1282 -0
- package/lib/types/traditionArtifacts/FoolsHatEnchantment.js +52 -0
- package/lib/types/traditionArtifacts/Haubenzauber.d.ts +1282 -0
- package/lib/types/traditionArtifacts/Haubenzauber.js +50 -0
- package/lib/types/traditionArtifacts/InstrumentEnchantment.d.ts +1282 -0
- package/lib/types/traditionArtifacts/InstrumentEnchantment.js +50 -0
- package/lib/types/traditionArtifacts/Krallenkettenzauber.d.ts +1282 -0
- package/lib/types/traditionArtifacts/Krallenkettenzauber.js +50 -0
- package/lib/types/traditionArtifacts/Kristallkugelzauber.d.ts +1282 -0
- package/lib/types/traditionArtifacts/Kristallkugelzauber.js +50 -0
- package/lib/types/traditionArtifacts/OrbEnchantment.d.ts +1282 -0
- package/lib/types/traditionArtifacts/OrbEnchantment.js +50 -0
- package/lib/types/traditionArtifacts/RingEnchantment.d.ts +1282 -0
- package/lib/types/traditionArtifacts/RingEnchantment.js +50 -0
- package/lib/types/traditionArtifacts/SickleRitual.d.ts +1282 -0
- package/lib/types/traditionArtifacts/SickleRitual.js +50 -0
- package/lib/types/traditionArtifacts/SpellSwordEnchantment.d.ts +1282 -0
- package/lib/types/traditionArtifacts/SpellSwordEnchantment.js +50 -0
- package/lib/types/traditionArtifacts/StaffEnchantment.d.ts +1286 -0
- package/lib/types/traditionArtifacts/StaffEnchantment.js +55 -0
- package/lib/types/traditionArtifacts/ToyEnchantment.d.ts +1282 -0
- package/lib/types/traditionArtifacts/ToyEnchantment.js +50 -0
- package/lib/types/traditionArtifacts/Trinkhornzauber.d.ts +1282 -0
- package/lib/types/traditionArtifacts/Trinkhornzauber.js +50 -0
- package/lib/types/traditionArtifacts/WandEnchantment.d.ts +1231 -0
- package/lib/types/traditionArtifacts/WandEnchantment.js +49 -0
- package/lib/types/traditionArtifacts/WeaponEnchantment.d.ts +1282 -0
- package/lib/types/traditionArtifacts/WeaponEnchantment.js +50 -0
- package/lib/types/traditionArtifacts/sub/AnimalShape.d.ts +8 -0
- package/lib/types/traditionArtifacts/sub/AnimalShape.js +24 -0
- package/lib/types/traditionArtifacts/sub/AnimalShapePath.d.ts +6 -0
- package/lib/types/traditionArtifacts/sub/AnimalShapePath.js +15 -0
- package/lib/types/traditionArtifacts/sub/AnimalShapeSize.d.ts +8 -0
- package/lib/types/traditionArtifacts/sub/AnimalShapeSize.js +23 -0
- package/lib/types/traditionArtifacts/sub/Brew.d.ts +6 -0
- package/lib/types/traditionArtifacts/sub/Brew.js +15 -0
- package/package.json +61 -0
|
@@ -0,0 +1,254 @@
|
|
|
1
|
+
import * as DB from "tsondb/schema/dsl";
|
|
2
|
+
import { BlessedTraditionIdentifier, CultureIdentifier, MagicalTraditionIdentifier, ProfessionIdentifier, RaceIdentifier, } from "../../_Identifier.js";
|
|
3
|
+
import { NestedTranslationMap } from "../../Locale.js";
|
|
4
|
+
import { Errata } from "../../source/_Erratum.js";
|
|
5
|
+
import { src } from "../../source/_PublicationRef.js";
|
|
6
|
+
import { checkWeaponCombatTechniqueIntegrity } from "./_Weapon.js";
|
|
7
|
+
import { SecondaryArmor } from "./Armor.js";
|
|
8
|
+
import { ImprovisedWeapon } from "./Weapon.js";
|
|
9
|
+
const COMBAT_USE = "combat_use";
|
|
10
|
+
export const DefaultItem = (sourceUrl, singularName, pluralName) => DB.Entity(sourceUrl, {
|
|
11
|
+
name: singularName,
|
|
12
|
+
namePlural: pluralName ?? `${singularName}s`,
|
|
13
|
+
type: () => DB.Object({
|
|
14
|
+
cost: DB.Required({
|
|
15
|
+
comment: "The cost in silverthalers.",
|
|
16
|
+
type: DB.IncludeIdentifier(Cost),
|
|
17
|
+
}),
|
|
18
|
+
weight: DB.Required({
|
|
19
|
+
comment: "The weight in kg.",
|
|
20
|
+
type: DB.IncludeIdentifier(Weight),
|
|
21
|
+
}),
|
|
22
|
+
complexity: DB.Optional({
|
|
23
|
+
comment: "The complexity of crafting the item.",
|
|
24
|
+
type: DB.IncludeIdentifier(Complexity),
|
|
25
|
+
}),
|
|
26
|
+
structure_points: DB.Required({
|
|
27
|
+
comment: "The structure points of the item. Use an array if the item consists of multiple components that have individual structure points.",
|
|
28
|
+
type: DB.IncludeIdentifier(StructurePoints),
|
|
29
|
+
}),
|
|
30
|
+
[COMBAT_USE]: DB.Optional({
|
|
31
|
+
comment: "The item can also be used either as an improvised weapon or as an armor, although this is not the primary use case of the item.",
|
|
32
|
+
type: DB.IncludeIdentifier(CombatUse),
|
|
33
|
+
}),
|
|
34
|
+
src,
|
|
35
|
+
translations: DefaultItemTranslations(singularName),
|
|
36
|
+
}),
|
|
37
|
+
instanceDisplayName: {},
|
|
38
|
+
uniqueConstraints: [
|
|
39
|
+
{
|
|
40
|
+
entityMapKeyPath: "translations",
|
|
41
|
+
keyPathInEntityMap: "name",
|
|
42
|
+
},
|
|
43
|
+
],
|
|
44
|
+
customConstraints: ({ instanceContent, ...rest }) => {
|
|
45
|
+
const combatUse = instanceContent.combat_use;
|
|
46
|
+
if (combatUse && combatUse.kind === "Weapon") {
|
|
47
|
+
return checkWeaponCombatTechniqueIntegrity({
|
|
48
|
+
...rest,
|
|
49
|
+
instanceContent: combatUse.Weapon,
|
|
50
|
+
}, { secondary: true });
|
|
51
|
+
}
|
|
52
|
+
return [];
|
|
53
|
+
},
|
|
54
|
+
});
|
|
55
|
+
export const DefaultItemTranslations = (singularName) => NestedTranslationMap(DB.Required, singularName, DB.Object({
|
|
56
|
+
name: DB.Required({
|
|
57
|
+
comment: "The item’s name.",
|
|
58
|
+
type: DB.String({ minLength: 1 }),
|
|
59
|
+
}),
|
|
60
|
+
secondary_name: DB.Optional({
|
|
61
|
+
comment: "An auxiliary name or label of the item, if available.",
|
|
62
|
+
type: DB.String({ minLength: 1 }),
|
|
63
|
+
}),
|
|
64
|
+
note: DB.Optional({
|
|
65
|
+
comment: "Note text.",
|
|
66
|
+
type: DB.String({ minLength: 1, markdown: "block" }),
|
|
67
|
+
}),
|
|
68
|
+
rules: DB.Optional({
|
|
69
|
+
comment: "Special rules text.",
|
|
70
|
+
type: DB.String({ minLength: 1, markdown: "block" }),
|
|
71
|
+
}),
|
|
72
|
+
errata: DB.Optional({
|
|
73
|
+
type: DB.IncludeIdentifier(Errata),
|
|
74
|
+
}),
|
|
75
|
+
}));
|
|
76
|
+
export const CombatUse = DB.Enum(import.meta.url, {
|
|
77
|
+
name: "CombatUse",
|
|
78
|
+
comment: "The item can also be used either as an improvised weapon or as an armor, although this is not the primary use case of the item.",
|
|
79
|
+
values: () => ({
|
|
80
|
+
Weapon: DB.EnumCase({ type: DB.IncludeIdentifier(ImprovisedWeapon) }),
|
|
81
|
+
Armor: DB.EnumCase({ type: DB.IncludeIdentifier(SecondaryArmor) }),
|
|
82
|
+
}),
|
|
83
|
+
});
|
|
84
|
+
export const StructurePoints = DB.TypeAlias(import.meta.url, {
|
|
85
|
+
name: "StructurePoints",
|
|
86
|
+
comment: "The structure points of the item. Use an array if the item consists of multiple components that have individual structure points.",
|
|
87
|
+
type: () => DB.Array(DB.IncludeIdentifier(StructurePointsComponent), { minItems: 1 }),
|
|
88
|
+
});
|
|
89
|
+
const StructurePointsComponent = DB.TypeAlias(import.meta.url, {
|
|
90
|
+
name: "StructurePointsComponent",
|
|
91
|
+
type: () => DB.Object({
|
|
92
|
+
points: DB.Required({
|
|
93
|
+
comment: "The structure points.",
|
|
94
|
+
type: DB.Integer({ minimum: 1 }),
|
|
95
|
+
}),
|
|
96
|
+
}),
|
|
97
|
+
});
|
|
98
|
+
export const Cost = DB.Enum(import.meta.url, {
|
|
99
|
+
name: "Cost",
|
|
100
|
+
comment: "The cost in silverthalers.",
|
|
101
|
+
values: () => ({
|
|
102
|
+
Free: DB.EnumCase({ type: null }),
|
|
103
|
+
Various: DB.EnumCase({ type: null }),
|
|
104
|
+
Invaluable: DB.EnumCase({ type: null }),
|
|
105
|
+
Fixed: DB.EnumCase({ type: DB.IncludeIdentifier(FixedCost) }),
|
|
106
|
+
Range: DB.EnumCase({ type: DB.IncludeIdentifier(CostRange) }),
|
|
107
|
+
}),
|
|
108
|
+
});
|
|
109
|
+
const wrap_in_text = DB.Required({
|
|
110
|
+
comment: "The cost get wrapped by this text using a placeholder in the text.",
|
|
111
|
+
type: DB.String({ minLength: 1, pattern: /\{0\}/ }),
|
|
112
|
+
});
|
|
113
|
+
export const FixedCost = DB.TypeAlias(import.meta.url, {
|
|
114
|
+
name: "FixedCost",
|
|
115
|
+
type: () => DB.Object({
|
|
116
|
+
value: DB.Required({
|
|
117
|
+
comment: "The cost in silverthalers.",
|
|
118
|
+
type: DB.Float({ minimum: { value: 0, isExclusive: true } }),
|
|
119
|
+
}),
|
|
120
|
+
translations: NestedTranslationMap(DB.Optional, "FixedCost", DB.Object({
|
|
121
|
+
wrap_in_text,
|
|
122
|
+
})),
|
|
123
|
+
}),
|
|
124
|
+
});
|
|
125
|
+
const CostRange = DB.TypeAlias(import.meta.url, {
|
|
126
|
+
name: "CostRange",
|
|
127
|
+
type: () => DB.Object({
|
|
128
|
+
from: DB.Required({
|
|
129
|
+
comment: "The lower bound of the cost in silverthalers.",
|
|
130
|
+
type: DB.Float({ minimum: { value: 0, isExclusive: true } }),
|
|
131
|
+
}),
|
|
132
|
+
to: DB.Required({
|
|
133
|
+
comment: "The upper bound of the cost in silverthalers.",
|
|
134
|
+
type: DB.Float({ minimum: { value: 0, isExclusive: true } }),
|
|
135
|
+
}),
|
|
136
|
+
translations: NestedTranslationMap(DB.Optional, "CostRange", DB.Object({
|
|
137
|
+
wrap_in_text,
|
|
138
|
+
})),
|
|
139
|
+
}),
|
|
140
|
+
});
|
|
141
|
+
export const Weight = DB.TypeAlias(import.meta.url, {
|
|
142
|
+
name: "Weight",
|
|
143
|
+
comment: "The weight in kg.",
|
|
144
|
+
type: () => DB.Float({ minimum: { value: 0, isExclusive: true }, fractionDigits: 3 }),
|
|
145
|
+
});
|
|
146
|
+
export const Complexity = DB.Enum(import.meta.url, {
|
|
147
|
+
name: "Complexity",
|
|
148
|
+
comment: "The complexity of crafting the item.",
|
|
149
|
+
values: () => ({
|
|
150
|
+
Primitive: DB.EnumCase({ type: null }),
|
|
151
|
+
Simple: DB.EnumCase({ type: null }),
|
|
152
|
+
Complex: DB.EnumCase({ type: DB.IncludeIdentifier(ComplexComplexity) }),
|
|
153
|
+
}),
|
|
154
|
+
});
|
|
155
|
+
export const ComplexComplexity = DB.TypeAlias(import.meta.url, {
|
|
156
|
+
name: "ComplexComplexity",
|
|
157
|
+
type: () => DB.Object({
|
|
158
|
+
ap_value: DB.Required({
|
|
159
|
+
comment: "The AP value for the trade secret.",
|
|
160
|
+
type: DB.Integer({ minimum: 1 }),
|
|
161
|
+
}),
|
|
162
|
+
}),
|
|
163
|
+
});
|
|
164
|
+
export const RestrictedTo = DB.TypeAlias(import.meta.url, {
|
|
165
|
+
name: "RestrictedTo",
|
|
166
|
+
comment: "If the item is in any case restricted to a subset of characters. The differenciating aspect may be tradition, race, culture, or a profession. Each element must be applicable to a character. ",
|
|
167
|
+
type: () => DB.Object({
|
|
168
|
+
races: DB.Optional({
|
|
169
|
+
comment: "The item is restricted to one of a list of races. If only one race is allowed, the list may only have a single element.",
|
|
170
|
+
type: DB.IncludeIdentifier(RestrictedToRaces),
|
|
171
|
+
}),
|
|
172
|
+
cultures: DB.Optional({
|
|
173
|
+
comment: "The item is restricted to one of a list of cultures. If only one culture is allowed, the list may only have a single element.",
|
|
174
|
+
type: DB.IncludeIdentifier(RestrictedToCultures),
|
|
175
|
+
}),
|
|
176
|
+
professions: DB.Optional({
|
|
177
|
+
comment: "The item is restricted to one of a list of professions. If only one profession is allowed, the list may only have a single element.",
|
|
178
|
+
type: DB.IncludeIdentifier(RestrictedToProfessions),
|
|
179
|
+
}),
|
|
180
|
+
magicalTraditions: DB.Optional({
|
|
181
|
+
comment: "The item is restricted to one of a list of magical traditions. If only one magical tradition is allowed, the list may only have a single element.",
|
|
182
|
+
type: DB.IncludeIdentifier(RestrictedToMagicalTraditions),
|
|
183
|
+
}),
|
|
184
|
+
blessedTraditions: DB.Optional({
|
|
185
|
+
comment: "The item is restricted to one of a list of blessed traditions. If only one blessed tradition is allowed, the list may only have a single element.",
|
|
186
|
+
type: DB.IncludeIdentifier(RestrictedToBlessedTraditions),
|
|
187
|
+
}),
|
|
188
|
+
}, { minProperties: 1 }),
|
|
189
|
+
});
|
|
190
|
+
export const RestrictedToRaces = DB.TypeAlias(import.meta.url, {
|
|
191
|
+
name: "RestrictedToRaces",
|
|
192
|
+
comment: "The item is restricted to one of a list of races. If only one race is allowed, the list may only have a single element.",
|
|
193
|
+
type: () => DB.Object({
|
|
194
|
+
scope: DB.Required({
|
|
195
|
+
comment: "The item is restricted to one of a list of races. If only one race is allowed, the list may only have a single element.",
|
|
196
|
+
type: DB.Array(RaceIdentifier(), { minItems: 1, uniqueItems: true }),
|
|
197
|
+
}),
|
|
198
|
+
}),
|
|
199
|
+
});
|
|
200
|
+
export const RestrictedToCultures = DB.TypeAlias(import.meta.url, {
|
|
201
|
+
name: "RestrictedToCultures",
|
|
202
|
+
comment: "The item is restricted to one of a list of cultures. If only one culture is allowed, the list may only have a single element.",
|
|
203
|
+
type: () => DB.Object({
|
|
204
|
+
scope: DB.Required({
|
|
205
|
+
comment: "The item is restricted to one of a list of cultures. If only one culture is allowed, the list may only have a single element.",
|
|
206
|
+
type: DB.Array(CultureIdentifier(), { minItems: 1, uniqueItems: true }),
|
|
207
|
+
}),
|
|
208
|
+
}),
|
|
209
|
+
});
|
|
210
|
+
export const RestrictedToProfessions = DB.TypeAlias(import.meta.url, {
|
|
211
|
+
name: "RestrictedToProfessions",
|
|
212
|
+
comment: "The item is restricted to one of a list of professions. If only one profession is allowed, the list may only have a single element.",
|
|
213
|
+
type: () => DB.Object({
|
|
214
|
+
scope: DB.Required({
|
|
215
|
+
comment: "The item is restricted to one of a list of professions. If only one profession is allowed, the list may only have a single element.",
|
|
216
|
+
type: DB.Array(ProfessionIdentifier(), { minItems: 1, uniqueItems: true }),
|
|
217
|
+
}),
|
|
218
|
+
}),
|
|
219
|
+
});
|
|
220
|
+
export const RestrictedToMagicalTraditions = DB.TypeAlias(import.meta.url, {
|
|
221
|
+
name: "RestrictedToMagicalTraditions",
|
|
222
|
+
comment: "The item is restricted to one of a list of magical traditions. If only one magical tradition is allowed, the list may only have a single element.",
|
|
223
|
+
type: () => DB.Object({
|
|
224
|
+
scope: DB.Required({
|
|
225
|
+
comment: "The item is restricted to one of a list of magical traditions. If only one magical tradition is allowed, the list may only have a single element.",
|
|
226
|
+
type: DB.Array(MagicalTraditionIdentifier(), { minItems: 1, uniqueItems: true }),
|
|
227
|
+
}),
|
|
228
|
+
}),
|
|
229
|
+
});
|
|
230
|
+
export const RestrictedToBlessedTraditions = DB.TypeAlias(import.meta.url, {
|
|
231
|
+
name: "RestrictedToBlessedTraditions",
|
|
232
|
+
comment: "The item is restricted to one of a list of blessed traditions. If only one blessed tradition is allowed, the list may only have a single element. The item may also be declared as sanctified.",
|
|
233
|
+
type: () => DB.Object({
|
|
234
|
+
scope: DB.Required({
|
|
235
|
+
comment: "The item is restricted to one of a list of blessed traditions. If only one blessed tradition is allowed, the list may only have a single element.",
|
|
236
|
+
type: DB.IncludeIdentifier(RestrictedToBlessedTraditionsScope),
|
|
237
|
+
}),
|
|
238
|
+
isSanctifiedBy: DB.Required({
|
|
239
|
+
comment: "The item is sanctified by the applicable listed tradition.",
|
|
240
|
+
type: DB.Boolean(),
|
|
241
|
+
}),
|
|
242
|
+
}),
|
|
243
|
+
});
|
|
244
|
+
export const RestrictedToBlessedTraditionsScope = DB.Enum(import.meta.url, {
|
|
245
|
+
name: "RestrictedToBlessedTraditionsScope",
|
|
246
|
+
comment: "The item is restricted to one of a list of blessed traditions. If only one blessed tradition is allowed, the list may only have a single element. Instead of providing an specific set of traditions, the restriction may also cover a category of blessed traditions.",
|
|
247
|
+
values: () => ({
|
|
248
|
+
Specific: DB.EnumCase({
|
|
249
|
+
type: DB.Array(BlessedTraditionIdentifier(), { minItems: 1, uniqueItems: true }),
|
|
250
|
+
}),
|
|
251
|
+
Church: DB.EnumCase({ type: null }),
|
|
252
|
+
Shamanistic: DB.EnumCase({ type: null }),
|
|
253
|
+
}),
|
|
254
|
+
});
|
|
@@ -0,0 +1,62 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Auxiliary types for melee weapons.
|
|
3
|
+
*/
|
|
4
|
+
import * as DB from "tsondb/schema/dsl";
|
|
5
|
+
export declare const AttackModifier: DB.TypeAlias<"AttackModifier", DB.Integer, []>;
|
|
6
|
+
export declare const ParryModifier: DB.TypeAlias<"ParryModifier", DB.Integer, []>;
|
|
7
|
+
export declare const MeleeWeapon: DB.TypeAlias<"MeleeWeapon", DB.IncludeIdentifier<DB.Param<string, DB.Type>[], DB.TypeAlias<"GenMeleeWeapon", DB.Object<{
|
|
8
|
+
damage: DB.MemberDecl<DB.TypeArgument<DB.Param<"Damage", DB.Type>>, true>;
|
|
9
|
+
damage_threshold: DB.MemberDecl<DB.IncludeIdentifier<[], DB.Enum<"PrimaryAttributeDamageThreshold", {
|
|
10
|
+
Default: DB.EnumCase<DB.IncludeIdentifier<[], DB.TypeAlias<"DefaultPrimaryAttributeDamageThreshold", DB.Object<{
|
|
11
|
+
threshold: DB.MemberDecl<DB.Integer, true>;
|
|
12
|
+
}>, []>>>;
|
|
13
|
+
List: DB.EnumCase<DB.IncludeIdentifier<[], DB.TypeAlias<"PrimaryAttributeDamageThresholdList", DB.Object<{
|
|
14
|
+
list: DB.MemberDecl<DB.Array<DB.IncludeIdentifier<[], DB.TypeAlias<"SinglePrimaryAttributeDamageThreshold", DB.Object<{
|
|
15
|
+
attribute: DB.MemberDecl<DB.ReferenceIdentifier, true>;
|
|
16
|
+
threshold: DB.MemberDecl<DB.Integer, true>;
|
|
17
|
+
}>, []>>>, true>;
|
|
18
|
+
}>, []>>>;
|
|
19
|
+
}, []>>, false>;
|
|
20
|
+
attackModifier: DB.MemberDecl<DB.IncludeIdentifier<[], DB.TypeAlias<"AttackModifier", DB.Integer, []>>, false>;
|
|
21
|
+
parryModifier: DB.MemberDecl<DB.IncludeIdentifier<[], DB.TypeAlias<"ParryModifier", DB.Integer, []>>, false>;
|
|
22
|
+
reach: DB.MemberDecl<DB.Array<DB.ReferenceIdentifier>, false>;
|
|
23
|
+
length: DB.MemberDecl<DB.IncludeIdentifier<[], DB.TypeAlias<"Length", DB.Integer, []>>, false>;
|
|
24
|
+
size: DB.MemberDecl<DB.IncludeIdentifier<[], DB.Enum<"ShieldSize", {
|
|
25
|
+
Small: DB.EnumCase<null>;
|
|
26
|
+
Medium: DB.EnumCase<null>;
|
|
27
|
+
Large: DB.EnumCase<DB.IncludeIdentifier<[], DB.TypeAlias<"LargeShieldSize", DB.Object<{
|
|
28
|
+
attack_penalty: DB.MemberDecl<DB.Integer, false>;
|
|
29
|
+
}>, []>>>;
|
|
30
|
+
}, []>>, false>;
|
|
31
|
+
is_parrying_weapon: DB.MemberDecl<DB.Boolean, true>;
|
|
32
|
+
is_two_handed_weapon: DB.MemberDecl<DB.Boolean, true>;
|
|
33
|
+
is_improvised_weapon: DB.MemberDecl<DB.Boolean, true>;
|
|
34
|
+
}>, [Damage: DB.Param<"Damage", DB.Type>]>>, []>;
|
|
35
|
+
export declare const GenMeleeWeapon: DB.TypeAlias<"GenMeleeWeapon", DB.Object<{
|
|
36
|
+
damage: DB.MemberDecl<DB.TypeArgument<DB.Param<"Damage", DB.Type>>, true>;
|
|
37
|
+
damage_threshold: DB.MemberDecl<DB.IncludeIdentifier<[], DB.Enum<"PrimaryAttributeDamageThreshold", {
|
|
38
|
+
Default: DB.EnumCase<DB.IncludeIdentifier<[], DB.TypeAlias<"DefaultPrimaryAttributeDamageThreshold", DB.Object<{
|
|
39
|
+
threshold: DB.MemberDecl<DB.Integer, true>;
|
|
40
|
+
}>, []>>>;
|
|
41
|
+
List: DB.EnumCase<DB.IncludeIdentifier<[], DB.TypeAlias<"PrimaryAttributeDamageThresholdList", DB.Object<{
|
|
42
|
+
list: DB.MemberDecl<DB.Array<DB.IncludeIdentifier<[], DB.TypeAlias<"SinglePrimaryAttributeDamageThreshold", DB.Object<{
|
|
43
|
+
attribute: DB.MemberDecl<DB.ReferenceIdentifier, true>;
|
|
44
|
+
threshold: DB.MemberDecl<DB.Integer, true>;
|
|
45
|
+
}>, []>>>, true>;
|
|
46
|
+
}>, []>>>;
|
|
47
|
+
}, []>>, false>;
|
|
48
|
+
attackModifier: DB.MemberDecl<DB.IncludeIdentifier<[], DB.TypeAlias<"AttackModifier", DB.Integer, []>>, false>;
|
|
49
|
+
parryModifier: DB.MemberDecl<DB.IncludeIdentifier<[], DB.TypeAlias<"ParryModifier", DB.Integer, []>>, false>;
|
|
50
|
+
reach: DB.MemberDecl<DB.Array<DB.ReferenceIdentifier>, false>;
|
|
51
|
+
length: DB.MemberDecl<DB.IncludeIdentifier<[], DB.TypeAlias<"Length", DB.Integer, []>>, false>;
|
|
52
|
+
size: DB.MemberDecl<DB.IncludeIdentifier<[], DB.Enum<"ShieldSize", {
|
|
53
|
+
Small: DB.EnumCase<null>;
|
|
54
|
+
Medium: DB.EnumCase<null>;
|
|
55
|
+
Large: DB.EnumCase<DB.IncludeIdentifier<[], DB.TypeAlias<"LargeShieldSize", DB.Object<{
|
|
56
|
+
attack_penalty: DB.MemberDecl<DB.Integer, false>;
|
|
57
|
+
}>, []>>>;
|
|
58
|
+
}, []>>, false>;
|
|
59
|
+
is_parrying_weapon: DB.MemberDecl<DB.Boolean, true>;
|
|
60
|
+
is_two_handed_weapon: DB.MemberDecl<DB.Boolean, true>;
|
|
61
|
+
is_improvised_weapon: DB.MemberDecl<DB.Boolean, true>;
|
|
62
|
+
}>, [Damage: DB.Param<"Damage", DB.Type>]>;
|
|
@@ -0,0 +1,100 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Auxiliary types for melee weapons.
|
|
3
|
+
*/
|
|
4
|
+
import * as DB from "tsondb/schema/dsl";
|
|
5
|
+
import { Dice } from "../../_Dice.js";
|
|
6
|
+
import { ReachIdentifier } from "../../_Identifier.js";
|
|
7
|
+
import { Length, PrimaryAttributeDamageThreshold } from "./_Weapon.js";
|
|
8
|
+
export const AttackModifier = DB.TypeAlias(import.meta.url, {
|
|
9
|
+
name: "AttackModifier",
|
|
10
|
+
comment: "The AT modifier.",
|
|
11
|
+
type: () => DB.Integer(),
|
|
12
|
+
});
|
|
13
|
+
export const ParryModifier = DB.TypeAlias(import.meta.url, {
|
|
14
|
+
name: "ParryModifier",
|
|
15
|
+
comment: "The PA modifier.",
|
|
16
|
+
type: () => DB.Integer(),
|
|
17
|
+
});
|
|
18
|
+
const MeleeDamage = DB.TypeAlias(import.meta.url, {
|
|
19
|
+
name: "MeleeDamage",
|
|
20
|
+
comment: "The damage of a weapon consists of a random part using dice and an optional flat part.",
|
|
21
|
+
type: () => DB.Object({
|
|
22
|
+
dice: DB.Required({
|
|
23
|
+
comment: "How many dice of which type are rolled to get the damage.",
|
|
24
|
+
type: DB.IncludeIdentifier(Dice),
|
|
25
|
+
}),
|
|
26
|
+
flat: DB.Optional({
|
|
27
|
+
comment: "Flat damage, if any. It gets added to the result of the dice rolls.",
|
|
28
|
+
type: DB.Integer(),
|
|
29
|
+
}),
|
|
30
|
+
}),
|
|
31
|
+
});
|
|
32
|
+
const ShieldSize = DB.Enum(import.meta.url, {
|
|
33
|
+
name: "ShieldSize",
|
|
34
|
+
comment: "The shield size and potential size-depending values.",
|
|
35
|
+
values: () => ({
|
|
36
|
+
Small: DB.EnumCase({ type: null }),
|
|
37
|
+
Medium: DB.EnumCase({ type: null }),
|
|
38
|
+
Large: DB.EnumCase({ type: DB.IncludeIdentifier(LargeShieldSize) }),
|
|
39
|
+
}),
|
|
40
|
+
});
|
|
41
|
+
const LargeShieldSize = DB.TypeAlias(import.meta.url, {
|
|
42
|
+
name: "LargeShieldSize",
|
|
43
|
+
comment: "The damage of a weapon consists of a random part using dice and an optional flat part.",
|
|
44
|
+
type: () => DB.Object({
|
|
45
|
+
attack_penalty: DB.Optional({
|
|
46
|
+
comment: "The attack penalty from the shield, if any.",
|
|
47
|
+
type: DB.Integer(),
|
|
48
|
+
}),
|
|
49
|
+
}),
|
|
50
|
+
});
|
|
51
|
+
export const MeleeWeapon = DB.TypeAlias(import.meta.url, {
|
|
52
|
+
name: "MeleeWeapon",
|
|
53
|
+
type: () => DB.GenIncludeIdentifier(GenMeleeWeapon, [DB.IncludeIdentifier(MeleeDamage)]),
|
|
54
|
+
});
|
|
55
|
+
export const GenMeleeWeapon = DB.GenTypeAlias(import.meta.url, {
|
|
56
|
+
name: "GenMeleeWeapon",
|
|
57
|
+
parameters: [DB.Param("Damage")],
|
|
58
|
+
type: Damage => DB.Object({
|
|
59
|
+
damage: DB.Required({
|
|
60
|
+
comment: "The damage of a weapon can consist of random dice rolls and flat damage.",
|
|
61
|
+
type: DB.TypeArgument(Damage),
|
|
62
|
+
}),
|
|
63
|
+
damage_threshold: DB.Optional({
|
|
64
|
+
comment: "The primary attribute damage and threshold value.",
|
|
65
|
+
type: DB.IncludeIdentifier(PrimaryAttributeDamageThreshold),
|
|
66
|
+
}),
|
|
67
|
+
attackModifier: DB.Optional({
|
|
68
|
+
comment: "The AT modifier.",
|
|
69
|
+
type: DB.IncludeIdentifier(AttackModifier),
|
|
70
|
+
}),
|
|
71
|
+
parryModifier: DB.Optional({
|
|
72
|
+
comment: "The PA modifier.",
|
|
73
|
+
type: DB.IncludeIdentifier(ParryModifier),
|
|
74
|
+
}),
|
|
75
|
+
reach: DB.Optional({
|
|
76
|
+
comment: "The reach of the weapon.",
|
|
77
|
+
type: DB.Array(ReachIdentifier(), { minItems: 1, uniqueItems: true }),
|
|
78
|
+
}),
|
|
79
|
+
length: DB.Optional({
|
|
80
|
+
comment: "The length of the weapon in cm/halffingers.",
|
|
81
|
+
type: DB.IncludeIdentifier(Length),
|
|
82
|
+
}),
|
|
83
|
+
size: DB.Optional({
|
|
84
|
+
comment: "The shield size and potential size-depending values.",
|
|
85
|
+
type: DB.IncludeIdentifier(ShieldSize),
|
|
86
|
+
}),
|
|
87
|
+
is_parrying_weapon: DB.Required({
|
|
88
|
+
comment: "Is the weapon a parrying weapon?",
|
|
89
|
+
type: DB.Boolean(),
|
|
90
|
+
}),
|
|
91
|
+
is_two_handed_weapon: DB.Required({
|
|
92
|
+
comment: "Is the weapon a two-handed weapon?",
|
|
93
|
+
type: DB.Boolean(),
|
|
94
|
+
}),
|
|
95
|
+
is_improvised_weapon: DB.Required({
|
|
96
|
+
comment: "Is the weapon an improvised weapon?",
|
|
97
|
+
type: DB.Boolean(),
|
|
98
|
+
}),
|
|
99
|
+
}),
|
|
100
|
+
});
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Auxiliary types for ranged weapons.
|
|
3
|
+
*/
|
|
4
|
+
import * as DB from "tsondb/schema/dsl";
|
|
5
|
+
export declare const RangedWeapon: DB.TypeAlias<"RangedWeapon", DB.IncludeIdentifier<DB.Param<string, DB.Type>[], DB.TypeAlias<"GenRangedWeapon", DB.Object<{
|
|
6
|
+
damage: DB.MemberDecl<DB.TypeArgument<DB.Param<"Damage", DB.Type>>, true>;
|
|
7
|
+
reload_time: DB.MemberDecl<DB.Array<DB.IncludeIdentifier<[], DB.TypeAlias<"ReloadTime", DB.Object<{
|
|
8
|
+
value: DB.MemberDecl<DB.Integer, true>;
|
|
9
|
+
}>, []>>>, true>;
|
|
10
|
+
range: DB.MemberDecl<DB.IncludeIdentifier<[], DB.TypeAlias<"RangeBrackets", DB.Object<{
|
|
11
|
+
close: DB.MemberDecl<DB.Integer, true>;
|
|
12
|
+
medium: DB.MemberDecl<DB.Integer, true>;
|
|
13
|
+
far: DB.MemberDecl<DB.Integer, true>;
|
|
14
|
+
}>, []>>, true>;
|
|
15
|
+
ammunition: DB.MemberDecl<DB.IncludeIdentifier<[], DB.Enum<"AmmunitionishIdentifier", {
|
|
16
|
+
Ammunition: DB.EnumCase<DB.ReferenceIdentifier>;
|
|
17
|
+
Weapon: DB.EnumCase<DB.ReferenceIdentifier>;
|
|
18
|
+
}, []>>, false>;
|
|
19
|
+
length: DB.MemberDecl<DB.IncludeIdentifier<[], DB.TypeAlias<"Length", DB.Integer, []>>, false>;
|
|
20
|
+
is_improvised_weapon: DB.MemberDecl<DB.Boolean, true>;
|
|
21
|
+
}>, [Damage: DB.Param<"Damage", DB.Type>]>>, []>;
|
|
22
|
+
export declare const GenRangedWeapon: DB.TypeAlias<"GenRangedWeapon", DB.Object<{
|
|
23
|
+
damage: DB.MemberDecl<DB.TypeArgument<DB.Param<"Damage", DB.Type>>, true>;
|
|
24
|
+
reload_time: DB.MemberDecl<DB.Array<DB.IncludeIdentifier<[], DB.TypeAlias<"ReloadTime", DB.Object<{
|
|
25
|
+
value: DB.MemberDecl<DB.Integer, true>;
|
|
26
|
+
}>, []>>>, true>;
|
|
27
|
+
range: DB.MemberDecl<DB.IncludeIdentifier<[], DB.TypeAlias<"RangeBrackets", DB.Object<{
|
|
28
|
+
close: DB.MemberDecl<DB.Integer, true>;
|
|
29
|
+
medium: DB.MemberDecl<DB.Integer, true>;
|
|
30
|
+
far: DB.MemberDecl<DB.Integer, true>;
|
|
31
|
+
}>, []>>, true>;
|
|
32
|
+
ammunition: DB.MemberDecl<DB.IncludeIdentifier<[], DB.Enum<"AmmunitionishIdentifier", {
|
|
33
|
+
Ammunition: DB.EnumCase<DB.ReferenceIdentifier>;
|
|
34
|
+
Weapon: DB.EnumCase<DB.ReferenceIdentifier>;
|
|
35
|
+
}, []>>, false>;
|
|
36
|
+
length: DB.MemberDecl<DB.IncludeIdentifier<[], DB.TypeAlias<"Length", DB.Integer, []>>, false>;
|
|
37
|
+
is_improvised_weapon: DB.MemberDecl<DB.Boolean, true>;
|
|
38
|
+
}>, [Damage: DB.Param<"Damage", DB.Type>]>;
|
|
@@ -0,0 +1,93 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Auxiliary types for ranged weapons.
|
|
3
|
+
*/
|
|
4
|
+
import * as DB from "tsondb/schema/dsl";
|
|
5
|
+
import { Dice } from "../../_Dice.js";
|
|
6
|
+
import { AmmunitionishIdentifier } from "../../_IdentifierGroup.js";
|
|
7
|
+
import { Length } from "./_Weapon.js";
|
|
8
|
+
const RangedDamage = DB.Enum(import.meta.url, {
|
|
9
|
+
name: "RangedDamage",
|
|
10
|
+
comment: "The damage of a ranged weapon. It consists of a random part using dice and an optional flat part ny default. Some ranged weapons may work different so that damage is either not applicable at all or it is outlined as *Special* and further defined in a description.",
|
|
11
|
+
values: () => ({
|
|
12
|
+
Default: DB.EnumCase({ type: DB.IncludeIdentifier(DefaultRangedDamage) }),
|
|
13
|
+
NotApplicable: DB.EnumCase({ type: null }),
|
|
14
|
+
Special: DB.EnumCase({ type: null }),
|
|
15
|
+
}),
|
|
16
|
+
});
|
|
17
|
+
const DefaultRangedDamage = DB.TypeAlias(import.meta.url, {
|
|
18
|
+
name: "DefaultRangedDamage",
|
|
19
|
+
comment: "The damage of a weapon consists of a random part using dice and an optional flat part.",
|
|
20
|
+
type: () => DB.Object({
|
|
21
|
+
dice: DB.Required({
|
|
22
|
+
comment: "How many dice of which type are rolled to get the damage.",
|
|
23
|
+
type: DB.IncludeIdentifier(Dice),
|
|
24
|
+
}),
|
|
25
|
+
flat: DB.Optional({
|
|
26
|
+
comment: "Flat damage, if any. It gets added to the result of the dice rolls.",
|
|
27
|
+
type: DB.Integer(),
|
|
28
|
+
}),
|
|
29
|
+
}),
|
|
30
|
+
});
|
|
31
|
+
export const RangedWeapon = DB.TypeAlias(import.meta.url, {
|
|
32
|
+
name: "RangedWeapon",
|
|
33
|
+
type: () => DB.GenIncludeIdentifier(GenRangedWeapon, [DB.IncludeIdentifier(RangedDamage)]),
|
|
34
|
+
});
|
|
35
|
+
export const GenRangedWeapon = DB.GenTypeAlias(import.meta.url, {
|
|
36
|
+
name: "GenRangedWeapon",
|
|
37
|
+
parameters: [DB.Param("Damage")],
|
|
38
|
+
type: Damage => DB.Object({
|
|
39
|
+
damage: DB.Required({
|
|
40
|
+
comment: "The damage of a weapon can consist of random dice rolls and flat damage.",
|
|
41
|
+
type: DB.TypeArgument(Damage),
|
|
42
|
+
}),
|
|
43
|
+
reload_time: DB.Required({
|
|
44
|
+
comment: "One or multiple reload times.",
|
|
45
|
+
type: DB.Array(DB.IncludeIdentifier(ReloadTime), {
|
|
46
|
+
minItems: 1,
|
|
47
|
+
uniqueItems: true,
|
|
48
|
+
}),
|
|
49
|
+
}),
|
|
50
|
+
range: DB.Required({
|
|
51
|
+
comment: "The range brackets for the weapon: close, medium, far. Distances in m.",
|
|
52
|
+
type: DB.IncludeIdentifier(RangeBrackets),
|
|
53
|
+
}),
|
|
54
|
+
ammunition: DB.Optional({
|
|
55
|
+
comment: "The needed ammunition.",
|
|
56
|
+
type: DB.IncludeIdentifier(AmmunitionishIdentifier),
|
|
57
|
+
}),
|
|
58
|
+
length: DB.Optional({
|
|
59
|
+
comment: "The length of the weapon in cm/halffingers.",
|
|
60
|
+
type: DB.IncludeIdentifier(Length),
|
|
61
|
+
}),
|
|
62
|
+
is_improvised_weapon: DB.Required({
|
|
63
|
+
comment: "Is the weapon an improvised weapon?",
|
|
64
|
+
type: DB.Boolean(),
|
|
65
|
+
}),
|
|
66
|
+
}),
|
|
67
|
+
});
|
|
68
|
+
const RangeBrackets = DB.TypeAlias(import.meta.url, {
|
|
69
|
+
name: "RangeBrackets",
|
|
70
|
+
type: () => DB.Object({
|
|
71
|
+
close: DB.Required({
|
|
72
|
+
comment: "The close range bracket for the weapon. Distance in m.",
|
|
73
|
+
type: DB.Integer({ minimum: 0 }),
|
|
74
|
+
}),
|
|
75
|
+
medium: DB.Required({
|
|
76
|
+
comment: "The medium range bracket for the weapon. Distance in m.",
|
|
77
|
+
type: DB.Integer({ minimum: 0 }),
|
|
78
|
+
}),
|
|
79
|
+
far: DB.Required({
|
|
80
|
+
comment: "The far range bracket for the weapon. Distance in m.",
|
|
81
|
+
type: DB.Integer({ minimum: 0 }),
|
|
82
|
+
}),
|
|
83
|
+
}),
|
|
84
|
+
});
|
|
85
|
+
const ReloadTime = DB.TypeAlias(import.meta.url, {
|
|
86
|
+
name: "ReloadTime",
|
|
87
|
+
type: () => DB.Object({
|
|
88
|
+
value: DB.Required({
|
|
89
|
+
comment: "A reload time value in actions.",
|
|
90
|
+
type: DB.Integer({ minimum: 1 }),
|
|
91
|
+
}),
|
|
92
|
+
}),
|
|
93
|
+
});
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import * as DB from "tsondb/schema/dsl";
|
|
2
|
+
import type { GetDisplayNameAndId, GetInstanceById } from "tsondb/schema/gen";
|
|
3
|
+
import type { GenMeleeWeapon, GenRangedWeapon } from "../../../../gen/types.js";
|
|
4
|
+
export declare const PrimaryAttributeDamageThreshold: DB.Enum<"PrimaryAttributeDamageThreshold", {
|
|
5
|
+
Default: DB.EnumCase<DB.IncludeIdentifier<[], DB.TypeAlias<"DefaultPrimaryAttributeDamageThreshold", DB.Object<{
|
|
6
|
+
threshold: DB.MemberDecl<DB.Integer, true>;
|
|
7
|
+
}>, []>>>;
|
|
8
|
+
List: DB.EnumCase<DB.IncludeIdentifier<[], DB.TypeAlias<"PrimaryAttributeDamageThresholdList", DB.Object<{
|
|
9
|
+
list: DB.MemberDecl<DB.Array<DB.IncludeIdentifier<[], DB.TypeAlias<"SinglePrimaryAttributeDamageThreshold", DB.Object<{
|
|
10
|
+
attribute: DB.MemberDecl<DB.ReferenceIdentifier, true>;
|
|
11
|
+
threshold: DB.MemberDecl<DB.Integer, true>;
|
|
12
|
+
}>, []>>>, true>;
|
|
13
|
+
}>, []>>>;
|
|
14
|
+
}, []>;
|
|
15
|
+
export declare const Length: DB.TypeAlias<"Length", DB.Integer, []>;
|
|
16
|
+
export declare const checkWeaponCombatTechniqueIntegrity: ({ instanceContent, getInstanceById, getDisplayNameAndId, }: {
|
|
17
|
+
instanceContent: {
|
|
18
|
+
melee_uses?: Record<string, GenMeleeWeapon<unknown>>;
|
|
19
|
+
ranged_uses?: Record<string, GenRangedWeapon<unknown>>;
|
|
20
|
+
};
|
|
21
|
+
getInstanceById: GetInstanceById;
|
|
22
|
+
getDisplayNameAndId: GetDisplayNameAndId;
|
|
23
|
+
}, { secondary: _secondary }: {
|
|
24
|
+
secondary: boolean;
|
|
25
|
+
}) => string[];
|
|
@@ -0,0 +1,77 @@
|
|
|
1
|
+
import * as DB from "tsondb/schema/dsl";
|
|
2
|
+
import { AttributeIdentifier } from "../../_Identifier.js";
|
|
3
|
+
export const PrimaryAttributeDamageThreshold = DB.Enum(import.meta.url, {
|
|
4
|
+
name: "PrimaryAttributeDamageThreshold",
|
|
5
|
+
comment: "The primary attribute damage and threshold value. You can either use an integer, an object or a pair. Use an integer if you just have to define a single threshold value for the default primary attribute of the combat technique. Use an object if you need to define the value only or if you need to define the value as well as a single different primary attribute than which the combat technique uses. Use the pair if you need to set the primary attributes to AGI and STR (the combat technique has AGI but this item has AGI/STR) and/or if you need to set different thresholds for AGI and STR (e.g. AGI 14/STR 15). If the same values are in the pair, they will be merged (AGI 14/STR 14 will be AGI/STR 14).",
|
|
6
|
+
values: () => ({
|
|
7
|
+
Default: DB.EnumCase({ type: DB.IncludeIdentifier(DefaultPrimaryAttributeDamageThreshold) }),
|
|
8
|
+
List: DB.EnumCase({ type: DB.IncludeIdentifier(PrimaryAttributeDamageThresholdList) }),
|
|
9
|
+
}),
|
|
10
|
+
});
|
|
11
|
+
const DefaultPrimaryAttributeDamageThreshold = DB.TypeAlias(import.meta.url, {
|
|
12
|
+
name: "DefaultPrimaryAttributeDamageThreshold",
|
|
13
|
+
type: () => DB.Object({
|
|
14
|
+
threshold: DB.Required({
|
|
15
|
+
comment: "The attribute value representing the damage threshold for the primary attribute of the item's combat technique.",
|
|
16
|
+
type: DB.Integer({ minimum: 1 }),
|
|
17
|
+
}),
|
|
18
|
+
}),
|
|
19
|
+
});
|
|
20
|
+
const PrimaryAttributeDamageThresholdList = DB.TypeAlias(import.meta.url, {
|
|
21
|
+
name: "PrimaryAttributeDamageThresholdList",
|
|
22
|
+
type: () => DB.Object({
|
|
23
|
+
list: DB.Required({
|
|
24
|
+
comment: "A list of primary attributes with their associated threshold.",
|
|
25
|
+
type: DB.Array(DB.IncludeIdentifier(SinglePrimaryAttributeDamageThreshold), {
|
|
26
|
+
minItems: 1,
|
|
27
|
+
uniqueItems: true,
|
|
28
|
+
}),
|
|
29
|
+
}),
|
|
30
|
+
}),
|
|
31
|
+
});
|
|
32
|
+
const SinglePrimaryAttributeDamageThreshold = DB.TypeAlias(import.meta.url, {
|
|
33
|
+
name: "SinglePrimaryAttributeDamageThreshold",
|
|
34
|
+
type: () => DB.Object({
|
|
35
|
+
attribute: DB.Required({
|
|
36
|
+
comment: "The primary attribute.",
|
|
37
|
+
type: AttributeIdentifier(),
|
|
38
|
+
}),
|
|
39
|
+
threshold: DB.Required({
|
|
40
|
+
comment: "The attribute value representing the damage threshold.",
|
|
41
|
+
type: DB.Integer({ minimum: 1 }),
|
|
42
|
+
}),
|
|
43
|
+
}),
|
|
44
|
+
});
|
|
45
|
+
export const Length = DB.TypeAlias(import.meta.url, {
|
|
46
|
+
name: "Length",
|
|
47
|
+
comment: "The length of the weapon in cm/halffingers.",
|
|
48
|
+
type: () => DB.Integer({ minimum: 1 }),
|
|
49
|
+
});
|
|
50
|
+
export const checkWeaponCombatTechniqueIntegrity = ({ instanceContent, getInstanceById, getDisplayNameAndId, }, { secondary: _secondary }) => {
|
|
51
|
+
const checkPart = (rule, value, name, type, id) => (rule.kind === "Prohibited") === (value === undefined) || rule.kind === "Optional"
|
|
52
|
+
? undefined
|
|
53
|
+
: `${name} must${rule.kind === "Required" ? "" : " not"} be provided for ${type} combat technique ${getDisplayNameAndId(type === "close" ? "CloseCombatTechnique" : "RangedCombatTechnique", id)}`;
|
|
54
|
+
return [
|
|
55
|
+
instanceContent.melee_uses === undefined && instanceContent.ranged_uses === undefined
|
|
56
|
+
? "either melee uses or ranged uses have to be provided"
|
|
57
|
+
: undefined,
|
|
58
|
+
...Object.entries(instanceContent.melee_uses ?? {}).flatMap(([ctId, meleeUse]) => {
|
|
59
|
+
// eslint-disable-next-line @typescript-eslint/no-non-null-assertion -- integrity has been checked, it must be present
|
|
60
|
+
const ct = getInstanceById("CloseCombatTechnique", ctId);
|
|
61
|
+
return [
|
|
62
|
+
checkPart(ct.special.can_parry, meleeUse.parryModifier, "a parry modifier", "close", ctId),
|
|
63
|
+
checkPart(ct.special.has_damage_threshold, meleeUse.damage_threshold, "a damage threshold", "close", ctId),
|
|
64
|
+
checkPart(ct.special.has_length, meleeUse.length, "a length", "close", ctId),
|
|
65
|
+
checkPart(ct.special.has_reach, meleeUse.reach, "a reach", "close", ctId),
|
|
66
|
+
checkPart(ct.special.has_shield_size, meleeUse.size, "a shield size", "close", ctId),
|
|
67
|
+
].filter(v => v !== undefined);
|
|
68
|
+
}),
|
|
69
|
+
...Object.entries(instanceContent.ranged_uses ?? {}).flatMap(([ctId, rangedUse]) => {
|
|
70
|
+
// eslint-disable-next-line @typescript-eslint/no-non-null-assertion -- integrity has been checked, it must be present
|
|
71
|
+
const ct = getInstanceById("RangedCombatTechnique", ctId);
|
|
72
|
+
return [
|
|
73
|
+
checkPart(ct.special.has_ammunition, rangedUse.ammunition, "an ammunition", "ranged", ctId),
|
|
74
|
+
].filter(v => v !== undefined);
|
|
75
|
+
}),
|
|
76
|
+
].filter(v => v !== undefined);
|
|
77
|
+
};
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import * as DB from "tsondb/schema/dsl";
|
|
2
|
+
export declare const ArmorType: DB.Entity<"ArmorType", {
|
|
3
|
+
sturdiness_rating: DB.MemberDecl<DB.Integer, false>;
|
|
4
|
+
translations: DB.MemberDecl<DB.NestedEntityMap<"ArmorTypeTranslation", {
|
|
5
|
+
name: DB.MemberDecl<DB.String, true>;
|
|
6
|
+
}>, true>;
|
|
7
|
+
}, undefined>;
|