optolith-database-schema 0.12.0 → 0.13.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.
Files changed (255) hide show
  1. package/CHANGELOG.md +33 -0
  2. package/lib/cache/newApplicationsAndUses.d.ts +17 -0
  3. package/lib/cache/newApplicationsAndUses.js +67 -0
  4. package/lib/cacheConfig.d.ts +4 -0
  5. package/lib/cacheConfig.js +1 -0
  6. package/lib/config/cache.d.ts +7 -0
  7. package/lib/config/cache.js +4 -0
  8. package/lib/main.d.ts +42 -0
  9. package/lib/main.js +44 -0
  10. package/lib/typeConfig.d.ts +2 -0
  11. package/lib/types/Advantage.js +4 -2
  12. package/lib/types/AnimalDisease.js +4 -2
  13. package/lib/types/AnimalType.js +4 -2
  14. package/lib/types/ArcaneBardTradition.js +4 -2
  15. package/lib/types/ArcaneDancerTradition.js +4 -2
  16. package/lib/types/Aspect.js +4 -2
  17. package/lib/types/Attribute.js +5 -3
  18. package/lib/types/Blessing.js +4 -2
  19. package/lib/types/Cantrip.js +4 -2
  20. package/lib/types/Ceremony.js +4 -2
  21. package/lib/types/CombatTechnique_Close.js +4 -2
  22. package/lib/types/CombatTechnique_Ranged.js +4 -2
  23. package/lib/types/Condition.js +4 -2
  24. package/lib/types/Continent.js +4 -2
  25. package/lib/types/Culture.d.ts +4 -17
  26. package/lib/types/Culture.js +4 -40
  27. package/lib/types/DerivedCharacteristic.js +4 -2
  28. package/lib/types/Disadvantage.js +4 -2
  29. package/lib/types/Disease.js +4 -2
  30. package/lib/types/Element.js +4 -2
  31. package/lib/types/ExperienceLevel.js +4 -2
  32. package/lib/types/EyeColor.js +4 -2
  33. package/lib/types/FamiliarsTrick.js +4 -2
  34. package/lib/types/HairColor.js +4 -2
  35. package/lib/types/Kirchenpraegung.js +4 -2
  36. package/lib/types/Lessons_Curriculum.js +4 -2
  37. package/lib/types/Lessons_Guideline.js +4 -2
  38. package/lib/types/LiturgicalChant.js +4 -2
  39. package/lib/types/Locale.js +3 -1
  40. package/lib/types/MetaCondition.js +4 -2
  41. package/lib/types/PactCategory.js +4 -2
  42. package/lib/types/Patron.d.ts +2 -12
  43. package/lib/types/Patron.js +4 -22
  44. package/lib/types/PatronCategory.js +4 -2
  45. package/lib/types/PersonalityTrait.js +4 -2
  46. package/lib/types/Profession.d.ts +1 -5
  47. package/lib/types/Profession.js +4 -8
  48. package/lib/types/Property.js +4 -2
  49. package/lib/types/Race.d.ts +68 -134
  50. package/lib/types/Race.js +4 -13
  51. package/lib/types/Region.js +4 -2
  52. package/lib/types/Ritual.js +4 -2
  53. package/lib/types/Service.d.ts +1 -4
  54. package/lib/types/Service.js +4 -7
  55. package/lib/types/SexPractice.js +4 -2
  56. package/lib/types/Skill.d.ts +2 -10
  57. package/lib/types/Skill.js +4 -21
  58. package/lib/types/SkillGroup.js +4 -2
  59. package/lib/types/SkillModificationLevel.d.ts +1 -4
  60. package/lib/types/SkillModificationLevel.js +4 -7
  61. package/lib/types/SocialStatus.js +4 -2
  62. package/lib/types/Spell.js +4 -2
  63. package/lib/types/State.js +4 -2
  64. package/lib/types/Talisman.d.ts +1 -7
  65. package/lib/types/Talisman.js +4 -10
  66. package/lib/types/TargetCategory.js +4 -2
  67. package/lib/types/UI.d.ts +171 -128
  68. package/lib/types/UI.js +2 -0
  69. package/lib/types/_Activatable.d.ts +5 -19
  70. package/lib/types/_Activatable.js +1 -40
  71. package/lib/types/_ActivatableSelectOptionCategory.d.ts +1 -4
  72. package/lib/types/_ActivatableSelectOptionCategory.js +1 -8
  73. package/lib/types/_ActivatableSkillCastingTime.d.ts +1 -4
  74. package/lib/types/_ActivatableSkillCastingTime.js +1 -5
  75. package/lib/types/_ActivatableSkillCheckResultBased.d.ts +2 -8
  76. package/lib/types/_ActivatableSkillCheckResultBased.js +1 -16
  77. package/lib/types/_ActivatableSkillDuration.d.ts +1 -12
  78. package/lib/types/_ActivatableSkillDuration.js +1 -13
  79. package/lib/types/_ActivatableSkillRange.d.ts +1 -4
  80. package/lib/types/_ActivatableSkillRange.js +1 -5
  81. package/lib/types/_Dice.d.ts +1 -5
  82. package/lib/types/_Dice.js +1 -9
  83. package/lib/types/_DiseasePoison.d.ts +2 -6
  84. package/lib/types/_DiseasePoison.js +1 -11
  85. package/lib/types/_ImprovementCost.d.ts +1 -6
  86. package/lib/types/_ImprovementCost.js +1 -10
  87. package/lib/types/_Sex.d.ts +1 -4
  88. package/lib/types/_Sex.js +1 -8
  89. package/lib/types/_SkillCheck.d.ts +1 -8
  90. package/lib/types/_SkillCheck.js +1 -13
  91. package/lib/types/equipment/EquipmentPackage.js +4 -2
  92. package/lib/types/equipment/item/Alchemicum.js +4 -2
  93. package/lib/types/equipment/item/Ammunition.js +4 -2
  94. package/lib/types/equipment/item/Animal.js +4 -2
  95. package/lib/types/equipment/item/AnimalCare.js +4 -2
  96. package/lib/types/equipment/item/Armor.js +4 -2
  97. package/lib/types/equipment/item/BandageOrRemedy.js +4 -2
  98. package/lib/types/equipment/item/Book.js +4 -2
  99. package/lib/types/equipment/item/CeremonialItem.js +4 -2
  100. package/lib/types/equipment/item/Clothes.js +4 -2
  101. package/lib/types/equipment/item/Container.js +4 -2
  102. package/lib/types/equipment/item/Elixir.js +4 -2
  103. package/lib/types/equipment/item/EquipmentOfBlessedOnes.js +4 -2
  104. package/lib/types/equipment/item/GemOrPreciousStone.js +4 -2
  105. package/lib/types/equipment/item/IlluminationLightSource.d.ts +1 -3
  106. package/lib/types/equipment/item/IlluminationLightSource.js +4 -6
  107. package/lib/types/equipment/item/IlluminationRefillsOrSupplies.js +4 -2
  108. package/lib/types/equipment/item/Jewelry.js +4 -2
  109. package/lib/types/equipment/item/Liebesspielzeug.js +4 -2
  110. package/lib/types/equipment/item/LuxuryGood.js +4 -2
  111. package/lib/types/equipment/item/MagicalArtifact.js +4 -2
  112. package/lib/types/equipment/item/MusicalInstrument.js +4 -2
  113. package/lib/types/equipment/item/OrienteeringAid.js +4 -2
  114. package/lib/types/equipment/item/Poison.d.ts +3 -15
  115. package/lib/types/equipment/item/Poison.js +4 -20
  116. package/lib/types/equipment/item/RopeOrChain.js +4 -2
  117. package/lib/types/equipment/item/Stationary.js +4 -2
  118. package/lib/types/equipment/item/ThievesTool.js +4 -2
  119. package/lib/types/equipment/item/ToolOfTheTrade.js +4 -2
  120. package/lib/types/equipment/item/TravelGearOrTool.js +4 -2
  121. package/lib/types/equipment/item/Vehicle.js +4 -2
  122. package/lib/types/equipment/item/Weapon.js +4 -2
  123. package/lib/types/equipment/item/WeaponAccessory.js +4 -2
  124. package/lib/types/equipment/item/_Herbary.d.ts +2 -14
  125. package/lib/types/equipment/item/_Herbary.js +1 -19
  126. package/lib/types/equipment/item/sub/ArmorType.js +4 -2
  127. package/lib/types/equipment/item/sub/Reach.js +4 -2
  128. package/lib/types/magicalActions/AnimistPower.js +4 -2
  129. package/lib/types/magicalActions/AnimistPower_Tribe.js +4 -2
  130. package/lib/types/magicalActions/Curse.js +4 -2
  131. package/lib/types/magicalActions/DominationRitual.js +4 -2
  132. package/lib/types/magicalActions/ElvenMagicalSong.js +4 -2
  133. package/lib/types/magicalActions/GeodeRitual.js +4 -2
  134. package/lib/types/magicalActions/JesterTrick.js +4 -2
  135. package/lib/types/magicalActions/MagicalDance.js +4 -2
  136. package/lib/types/magicalActions/MagicalMelody.js +4 -2
  137. package/lib/types/magicalActions/MagicalRune.js +4 -2
  138. package/lib/types/magicalActions/ZibiljaRitual.js +4 -2
  139. package/lib/types/magicalActions/_MusicTradition.d.ts +2 -8
  140. package/lib/types/magicalActions/_MusicTradition.js +1 -10
  141. package/lib/types/magicalActions/_SkillReference.d.ts +1 -4
  142. package/lib/types/magicalActions/_SkillReference.js +1 -5
  143. package/lib/types/prerequisites/single/PrimaryAttributePrerequisite.d.ts +1 -4
  144. package/lib/types/prerequisites/single/PrimaryAttributePrerequisite.js +1 -5
  145. package/lib/types/prerequisites/single/RatedMinimumNumberPrerequisite.d.ts +1 -5
  146. package/lib/types/prerequisites/single/RatedMinimumNumberPrerequisite.js +1 -6
  147. package/lib/types/prerequisites/single/SexualCharacteristicPrerequisite.d.ts +1 -4
  148. package/lib/types/prerequisites/single/SexualCharacteristicPrerequisite.js +1 -5
  149. package/lib/types/prerequisites/single/TextPrerequisite.d.ts +2 -8
  150. package/lib/types/prerequisites/single/TextPrerequisite.js +1 -10
  151. package/lib/types/prerequisites/single/TraditionPrerequisite.d.ts +2 -8
  152. package/lib/types/prerequisites/single/TraditionPrerequisite.js +1 -18
  153. package/lib/types/rule/CoreRule.d.ts +1 -4
  154. package/lib/types/rule/CoreRule.js +4 -7
  155. package/lib/types/rule/FocusRule.js +4 -2
  156. package/lib/types/rule/FocusRule_Subject.js +4 -2
  157. package/lib/types/rule/OptionalRule.js +4 -2
  158. package/lib/types/source/Publication.d.ts +1 -6
  159. package/lib/types/source/Publication.js +4 -12
  160. package/lib/types/specialAbility/AdvancedCombatSpecialAbility.js +4 -2
  161. package/lib/types/specialAbility/AdvancedKarmaSpecialAbility.js +4 -2
  162. package/lib/types/specialAbility/AdvancedMagicalSpecialAbility.js +4 -2
  163. package/lib/types/specialAbility/AdvancedSkillSpecialAbility.js +4 -2
  164. package/lib/types/specialAbility/AncestorGlyph.js +4 -2
  165. package/lib/types/specialAbility/BlessedTradition.js +4 -2
  166. package/lib/types/specialAbility/BrawlingSpecialAbility.js +4 -2
  167. package/lib/types/specialAbility/CeremonialItemSpecialAbility.js +4 -2
  168. package/lib/types/specialAbility/CombatSpecialAbility.js +4 -2
  169. package/lib/types/specialAbility/CombatStyleSpecialAbility.js +4 -2
  170. package/lib/types/specialAbility/CommandSpecialAbility.js +4 -2
  171. package/lib/types/specialAbility/FamiliarSpecialAbility.js +4 -2
  172. package/lib/types/specialAbility/FatePointSexSpecialAbility.js +4 -2
  173. package/lib/types/specialAbility/FatePointSpecialAbility.js +4 -2
  174. package/lib/types/specialAbility/GeneralSpecialAbility.js +4 -2
  175. package/lib/types/specialAbility/KarmaSpecialAbility.js +4 -2
  176. package/lib/types/specialAbility/LiturgicalStyleSpecialAbility.js +4 -2
  177. package/lib/types/specialAbility/LycantropicGift.js +4 -2
  178. package/lib/types/specialAbility/MagicStyleSpecialAbility.js +4 -2
  179. package/lib/types/specialAbility/MagicalSign.js +4 -2
  180. package/lib/types/specialAbility/MagicalSpecialAbility.js +4 -2
  181. package/lib/types/specialAbility/MagicalTradition.js +4 -2
  182. package/lib/types/specialAbility/PactGift.d.ts +2 -8
  183. package/lib/types/specialAbility/PactGift.js +4 -12
  184. package/lib/types/specialAbility/ProtectiveWardingCircleSpecialAbility.js +4 -2
  185. package/lib/types/specialAbility/Sermon.js +4 -2
  186. package/lib/types/specialAbility/SexSpecialAbility.js +4 -2
  187. package/lib/types/specialAbility/SikaryanDrainSpecialAbility.js +4 -2
  188. package/lib/types/specialAbility/SkillStyleSpecialAbility.js +4 -2
  189. package/lib/types/specialAbility/VampiricGift.js +4 -2
  190. package/lib/types/specialAbility/Vision.js +4 -2
  191. package/lib/types/specialAbility/sub/Language.js +4 -2
  192. package/lib/types/specialAbility/sub/Script.js +4 -2
  193. package/lib/types/specialAbility/sub/TradeSecret.js +4 -2
  194. package/lib/types/traditionArtifacts/ArcaneOrbEnchantment.js +4 -2
  195. package/lib/types/traditionArtifacts/AttireEnchantment.js +4 -2
  196. package/lib/types/traditionArtifacts/BowlEnchantment.js +4 -2
  197. package/lib/types/traditionArtifacts/CauldronEnchantment.js +4 -2
  198. package/lib/types/traditionArtifacts/ChronicleEnchantment.js +4 -2
  199. package/lib/types/traditionArtifacts/DaggerRitual.js +4 -2
  200. package/lib/types/traditionArtifacts/FoolsHatEnchantment.js +4 -2
  201. package/lib/types/traditionArtifacts/InstrumentEnchantment.js +4 -2
  202. package/lib/types/traditionArtifacts/Krallenkettenzauber.js +4 -2
  203. package/lib/types/traditionArtifacts/OrbEnchantment.js +4 -2
  204. package/lib/types/traditionArtifacts/RingEnchantment.js +4 -2
  205. package/lib/types/traditionArtifacts/SickleRitual.js +4 -2
  206. package/lib/types/traditionArtifacts/SpellSwordEnchantment.js +4 -2
  207. package/lib/types/traditionArtifacts/StaffEnchantment.js +4 -2
  208. package/lib/types/traditionArtifacts/ToyEnchantment.js +4 -2
  209. package/lib/types/traditionArtifacts/Trinkhornzauber.js +4 -2
  210. package/lib/types/traditionArtifacts/WandEnchantment.js +4 -2
  211. package/lib/types/traditionArtifacts/WeaponEnchantment.js +4 -2
  212. package/lib/types/traditionArtifacts/sub/AnimalShape.js +4 -2
  213. package/lib/types/traditionArtifacts/sub/AnimalShapePath.js +4 -2
  214. package/lib/types/traditionArtifacts/sub/AnimalShapeSize.js +4 -2
  215. package/lib/types/traditionArtifacts/sub/Brew.js +4 -2
  216. package/lib/validation/builders/naming.d.ts +3 -1
  217. package/lib/validation/builders/naming.js +9 -6
  218. package/lib/validation/filename.d.ts +1 -1
  219. package/lib/validation/filename.js +1 -1
  220. package/lib/validation/raw.d.ts +1 -1
  221. package/lib/validation/raw.js +3 -4
  222. package/package.json +2 -2
  223. package/schema/Culture.schema.json +31 -13
  224. package/schema/Patron.schema.json +26 -10
  225. package/schema/Profession.schema.json +10 -4
  226. package/schema/Race.schema.json +79 -208
  227. package/schema/Service.schema.json +7 -3
  228. package/schema/Skill.schema.json +20 -8
  229. package/schema/SkillModificationLevel.schema.json +7 -3
  230. package/schema/Talisman.schema.json +16 -6
  231. package/schema/UI.schema.json +502 -304
  232. package/schema/_Activatable.schema.json +32 -14
  233. package/schema/_ActivatableSelectOptionCategory.schema.json +7 -3
  234. package/schema/_ActivatableSkillCastingTime.schema.json +7 -3
  235. package/schema/_ActivatableSkillCheckResultBased.schema.json +14 -6
  236. package/schema/_ActivatableSkillDuration.schema.json +31 -11
  237. package/schema/_ActivatableSkillRange.schema.json +7 -3
  238. package/schema/_Dice.schema.json +10 -4
  239. package/schema/_DiseasePoison.schema.json +10 -4
  240. package/schema/_ImprovementCost.schema.json +13 -5
  241. package/schema/_Sex.schema.json +7 -3
  242. package/schema/_SkillCheck.schema.json +19 -7
  243. package/schema/equipment/item/IlluminationLightSource.schema.json +4 -2
  244. package/schema/equipment/item/Poison.schema.json +30 -12
  245. package/schema/equipment/item/_Herbary.schema.json +32 -12
  246. package/schema/magicalActions/_MusicTradition.schema.json +14 -6
  247. package/schema/magicalActions/_SkillReference.schema.json +7 -3
  248. package/schema/prerequisites/single/PrimaryAttributePrerequisite.schema.json +7 -3
  249. package/schema/prerequisites/single/RatedMinimumNumberPrerequisite.schema.json +10 -4
  250. package/schema/prerequisites/single/SexualCharacteristicPrerequisite.schema.json +7 -3
  251. package/schema/prerequisites/single/TextPrerequisite.schema.json +14 -6
  252. package/schema/prerequisites/single/TraditionPrerequisite.schema.json +14 -6
  253. package/schema/rule/CoreRule.schema.json +7 -3
  254. package/schema/source/Publication.schema.json +13 -5
  255. package/schema/specialAbility/PactGift.schema.json +14 -6
@@ -4,7 +4,7 @@
4
4
  import { TypeConfig } from "../typeConfig.js";
5
5
  import { CommonnessRatedAdvantageDisadvantage } from "./_CommonnessRatedAdvantageDisadvantage.js";
6
6
  import { Dice } from "./_Dice.js";
7
- import { AdvantageIdentifier, DisadvantageIdentifier, ExperienceLevelIdentifier } from "./_Identifier.js";
7
+ import { AdvantageIdentifier, AttributeIdentifier, DisadvantageIdentifier, ExperienceLevelIdentifier } from "./_Identifier.js";
8
8
  import { LocaleMap } from "./_LocaleMap.js";
9
9
  import { NonEmptyString } from "./_NonEmptyString.js";
10
10
  import { AdvantageReference, AttributeReference, CultureReference, EyeColorReference, HairColorReference } from "./_SimpleReferences.js";
@@ -53,34 +53,6 @@ export type Race = {
53
53
  * @minItems 1
54
54
  */
55
55
  strongly_recommended_disadvantages?: CommonnessRatedAdvantageDisadvantage<DisadvantageIdentifier>[];
56
- /**
57
- * A list of common advantages. If common advantages are defined by race
58
- * variants, leave this field empty. It is overridden by the same field in
59
- * race variants.
60
- * @minItems 1
61
- */
62
- common_advantages?: CommonnessRatedAdvantageDisadvantage<AdvantageIdentifier>[];
63
- /**
64
- * A list of common disadvantages. If common disadvantages are defined by race
65
- * variants, leave this field empty. It is overridden by the same field in
66
- * race variants.
67
- * @minItems 1
68
- */
69
- common_disadvantages?: CommonnessRatedAdvantageDisadvantage<DisadvantageIdentifier>[];
70
- /**
71
- * A list of uncommon advantages. If uncommon advantages are defined by race
72
- * variants, leave this field empty. It is overridden by the same field in
73
- * race variants.
74
- * @minItems 1
75
- */
76
- uncommon_advantages?: CommonnessRatedAdvantageDisadvantage<AdvantageIdentifier>[];
77
- /**
78
- * A list of uncommon disadvantages. If uncommon disadvantages are defined by
79
- * race variants, leave this field empty. It is overridden by the same field
80
- * in race variants.
81
- * @minItems 1
82
- */
83
- uncommon_disadvantages?: CommonnessRatedAdvantageDisadvantage<DisadvantageIdentifier>[];
84
56
  /**
85
57
  * Configuration for random weight generation.
86
58
  */
@@ -93,13 +65,11 @@ export type Race = {
93
65
  */
94
66
  starting_age: StartingAgeConfigForExperienceLevel[];
95
67
  /**
96
- * The race may have variants and associated configuration for each variant.
97
- * If the race is plain (has no variants), the values that would otherwise be
98
- * defined in the variant configuration need to be set for the whole race.
99
- * This excludes common and uncommon advantages and disadvantages, since they
100
- * may be defined for the whole race even if variants exist.
68
+ * A list of available race variants where one has to be selected. If no
69
+ * variants are to be selected, a single variant with no name has to be provided
70
+ * which will be used as the missing values for the base race.
101
71
  */
102
- variant_dependent: RaceVariantDependent;
72
+ variants: RaceVariants;
103
73
  src: PublicationRefs;
104
74
  /**
105
75
  * All translations for the entry, identified by IETF language tag (BCP47).
@@ -135,27 +105,59 @@ export type BaseValues = {
135
105
  /**
136
106
  * Describes how to raise or lower maximum attribute values during character
137
107
  * creation.
108
+ * @minProperties 1
138
109
  */
139
- export type AttributeAdjustments = AttributeAdjustment[];
110
+ export type AttributeAdjustments = {
111
+ /**
112
+ * The values by which the maximum of the respective attribute is modified.
113
+ * @minItems 1
114
+ */
115
+ fixed?: FixedAttributeAdjustment[];
116
+ /**
117
+ * An array of attribute maximum modifiers, where the attribute they apply to
118
+ * is selected from a list of options.
119
+ *
120
+ * The array only permits a single entry because no race specified more than
121
+ * one selectable attribute adjustment so far. But the schema allows for
122
+ * multiple entries to be future-proof.
123
+ * @minItems 1
124
+ * @maxItems 1
125
+ */
126
+ selectable?: SelectableAttributeAdjustment[];
127
+ };
140
128
  /**
141
- * An array of attribute maximum modifiers. The value will be added to the
142
- * current maximum of the selected attribute that has been chosen from the
143
- * listed attributes (negative values will lower the maximum).
144
- * @minItems 1
129
+ * A value by which the maximum of the respective attribute is modified.
145
130
  */
146
- export type AttributeAdjustment = {
131
+ export type FixedAttributeAdjustment = {
147
132
  /**
148
- * The value by which the selected attribute's maximum is modified
133
+ * The attribute the modifier applies to.
134
+ */
135
+ id: AttributeIdentifier;
136
+ /**
137
+ * The value by which the specified attribute's maximum is modified
149
138
  * (negative values will lower the maximum).
150
139
  * @integer
151
140
  */
152
141
  value: number;
142
+ };
143
+ /**
144
+ * A value that will be added to the current maximum of the selected attribute
145
+ * that has been chosen from the listed attributes (negative values will lower
146
+ * the maximum).
147
+ * @minItems 1
148
+ */
149
+ export type SelectableAttributeAdjustment = {
153
150
  /**
154
- * A list of attributes the player has to choose from. If only one attribute
155
- * is listed, no attribute has to be chosen.
156
- * @minItems 1
151
+ * A list of attributes the player has to choose from.
152
+ * @minItems 2
157
153
  */
158
154
  list: AttributeReference[];
155
+ /**
156
+ * The value by which the selected attribute's maximum is modified
157
+ * (negative values will lower the maximum).
158
+ * @integer
159
+ */
160
+ value: number;
159
161
  };
160
162
  /**
161
163
  * Configuration for random weight generation.
@@ -187,16 +189,12 @@ export type WeightDice = Dice & {
187
189
  * base value. Either they are all added or subtracted or even results are
188
190
  * added and odd results are subtracted.
189
191
  */
190
- export declare enum WeightDiceOffsetStrategy {
191
- Add = "Add",
192
- Subtract = "Subtract",
193
- AddEvenSubtractOdd = "AddEvenSubtractOdd"
194
- }
192
+ export type WeightDiceOffsetStrategy = "Add" | "Subtract" | "AddEvenSubtractOdd";
195
193
  export type StartingAgeConfigForExperienceLevel = {
196
194
  /**
197
195
  * The selected experience level's identifier.
198
196
  */
199
- experience_level_id: ExperienceLevelIdentifier;
197
+ id: ExperienceLevelIdentifier;
200
198
  /**
201
199
  * The base value for the selected experience level.
202
200
  * @integer
@@ -210,47 +208,12 @@ export type StartingAgeConfigForExperienceLevel = {
210
208
  random: Dice;
211
209
  };
212
210
  /**
213
- * The race may have variants and associated configuration for each variant.
214
- * If the race is plain (has no variants), the values that would otherwise be
215
- * defined in the variant configuration need to be set for the whole race.
216
- * This excludes common and uncommon advantages and disadvantages, since they
217
- * may be defined for the whole race even if variants exist.
218
- */
219
- export type RaceVariantDependent = {
220
- tag: "HasVariants";
221
- has_variants: RaceVariants;
222
- } | {
223
- tag: "Plain";
224
- plain: ValuesForRaceWithoutVariants;
225
- };
226
- /**
227
- * A list of available race variants.
211
+ * A list of available race variants where one has to be selected. If no
212
+ * variants are to be selected, a single variant with no name has to be provided
213
+ * which will be used as the missing values for the base race.
228
214
  * @minItems 1
229
215
  */
230
216
  export type RaceVariants = RaceVariant[];
231
- export type ValuesForRaceWithoutVariants = {
232
- /**
233
- * The list of common cultures.
234
- * @minItems 1
235
- */
236
- common_cultures: CultureReference[];
237
- /**
238
- * An array containing 20 (numeric) hair color identifiers. The array also represents the 20-sided die for a random hair color.
239
- * @minItems 20
240
- * @maxItems 20
241
- */
242
- hair_color: HairColorReference[];
243
- /**
244
- * An array containing 20 (numeric) eye color identifiers. The array also represents the 20-sided die for a random eye color.
245
- * @minItems 20
246
- * @maxItems 20
247
- */
248
- eye_color: EyeColorReference[];
249
- /**
250
- * Configuration for random height generation.
251
- */
252
- height: Height;
253
- };
254
217
  /**
255
218
  * @title Race Variant
256
219
  */
@@ -267,33 +230,35 @@ export type RaceVariant = {
267
230
  */
268
231
  common_cultures: CultureReference[];
269
232
  /**
270
- * A list of common advantages. If common advantages are defined by the base race, leave this field empty. This field overrides the same field of the base race, if both are defined.
233
+ * A list of common advantages.
271
234
  * @minItems 1
272
235
  */
273
236
  common_advantages?: CommonnessRatedAdvantageDisadvantage<AdvantageIdentifier>[];
274
237
  /**
275
- * A list of common disadvantages. If common disadvantages are defined by the base race, leave this field empty. This field overrides the same field of the base race, if both are defined.
238
+ * A list of common disadvantages.
276
239
  * @minItems 1
277
240
  */
278
241
  common_disadvantages?: CommonnessRatedAdvantageDisadvantage<DisadvantageIdentifier>[];
279
242
  /**
280
- * A list of uncommon advantages. If uncommon advantages are defined by the base race, leave this field empty. This field overrides the same field of the base race, if both are defined.
243
+ * A list of uncommon advantages.
281
244
  * @minItems 1
282
245
  */
283
246
  uncommon_advantages?: CommonnessRatedAdvantageDisadvantage<AdvantageIdentifier>[];
284
247
  /**
285
- * A list of uncommon disadvantages. If uncommon disadvantages are defined by the base race, leave this field empty. This field overrides the same field of the base race, if both are defined.
248
+ * A list of uncommon disadvantages.
286
249
  * @minItems 1
287
250
  */
288
251
  uncommon_disadvantages?: CommonnessRatedAdvantageDisadvantage<DisadvantageIdentifier>[];
289
252
  /**
290
- * An array containing 20 (numeric) hair color identifiers. The array also represents the 20-sided die for a random hair color.
253
+ * An array containing 20 (numeric) hair color identifiers. The array also
254
+ * represents the 20-sided die for a random hair color.
291
255
  * @minItems 20
292
256
  * @maxItems 20
293
257
  */
294
258
  hair_color: HairColorReference[];
295
259
  /**
296
- * An array containing 20 (numeric) eye color identifiers. The array also represents the 20-sided die for a random eye color.
260
+ * An array containing 20 (numeric) eye color identifiers. The array also
261
+ * represents the 20-sided die for a random eye color.
297
262
  * @minItems 20
298
263
  * @maxItems 20
299
264
  */
@@ -325,32 +290,25 @@ export type Height = {
325
290
  };
326
291
  export type RaceVariantTranslation = {
327
292
  /**
328
- * The race variant's name.
293
+ * The race variant's name. If left empty, it defaults to the base race name.
294
+ * This can be used if the race has no (visible) variants so that a single
295
+ * variant has to be provided.
329
296
  */
330
- name: NonEmptyString;
297
+ name?: NonEmptyString;
331
298
  /**
332
- * The respective common advantages text from the source book. If common
333
- * advantages are defined by the base race, leave this field empty. This field
334
- * overrides the same field of the base race, if both are defined.
299
+ * The respective common advantages text from the source book.
335
300
  */
336
301
  common_advantages?: NonEmptyString;
337
302
  /**
338
- * The respective common disadvantages text from the source book. If common
339
- * disadvantages are defined by the base race, leave this field empty. This
340
- * field overrides the same field of the base race, if both are defined.
303
+ * The respective common disadvantages text from the source book.
341
304
  */
342
305
  common_disadvantages?: NonEmptyString;
343
306
  /**
344
- * The respective uncommon advantages text from the source book. If uncommon
345
- * advantages are defined by the base race, leave this field empty. This field
346
- * overrides the same field of the base race, if both are defined.
307
+ * The respective uncommon advantages text from the source book.
347
308
  */
348
309
  uncommon_advantages?: NonEmptyString;
349
310
  /**
350
- * The respective uncommon disadvantages text from the source book. If
351
- * uncommon disadvantages are defined by the base race, leave this field
352
- * empty. This field overrides the same field of the base race, if both are
353
- * defined.
311
+ * The respective uncommon disadvantages text from the source book.
354
312
  */
355
313
  uncommon_disadvantages?: NonEmptyString;
356
314
  };
@@ -376,30 +334,6 @@ export type RaceTranslation = {
376
334
  * book.
377
335
  */
378
336
  strongly_recommended_disadvantages?: NonEmptyString;
379
- /**
380
- * The respective common advantages text from the source book. If common
381
- * advantages are defined by race variants, leave this field empty. It is
382
- * overridden by the same field in race variants.
383
- */
384
- common_advantages?: NonEmptyString;
385
- /**
386
- * The respective common disadvantages text from the source book. If common
387
- * disadvantages are defined by race variants, leave this field empty. It is
388
- * overridden by the same field in race variants.
389
- */
390
- common_disadvantages?: NonEmptyString;
391
- /**
392
- * The respective uncommon advantages text from the source book. If uncommon
393
- * advantages are defined by race variants, leave this field empty. It is
394
- * overridden by the same field in race variants.
395
- */
396
- uncommon_advantages?: NonEmptyString;
397
- /**
398
- * The respective uncommon disadvantages text from the source book. If
399
- * uncommon disadvantages are defined by race variants, leave this field
400
- * empty. It is overridden by the same field in race variants.
401
- */
402
- uncommon_disadvantages?: NonEmptyString;
403
337
  errata?: Errata;
404
338
  };
405
339
  export declare const config: TypeConfig<Race>;
package/lib/types/Race.js CHANGED
@@ -2,22 +2,13 @@
2
2
  * @main Race
3
3
  */
4
4
  import { todo } from "../validation/builders/integrity.js";
5
+ import { validateEntityFileName } from "../validation/builders/naming.js";
5
6
  import { createSchemaValidator } from "../validation/builders/schema.js";
6
- import { getFIlenamePrefixAsNumericId } from "../validation/filename.js";
7
- /**
8
- * The strategy how to offset the randomly generated values against the
9
- * base value. Either they are all added or subtracted or even results are
10
- * added and odd results are subtracted.
11
- */
12
- export var WeightDiceOffsetStrategy;
13
- (function (WeightDiceOffsetStrategy) {
14
- WeightDiceOffsetStrategy["Add"] = "Add";
15
- WeightDiceOffsetStrategy["Subtract"] = "Subtract";
16
- WeightDiceOffsetStrategy["AddEvenSubtractOdd"] = "AddEvenSubtractOdd";
17
- })(WeightDiceOffsetStrategy = WeightDiceOffsetStrategy || (WeightDiceOffsetStrategy = {}));
7
+ import { getFilenamePrefixAsNumericId } from "../validation/filename.js";
18
8
  export const config = {
19
9
  name: "Race",
20
- id: getFIlenamePrefixAsNumericId,
10
+ id: getFilenamePrefixAsNumericId,
21
11
  integrityValidator: todo("Race"),
22
12
  schemaValidator: createSchemaValidator(import.meta.url),
13
+ fileNameValidator: validateEntityFileName,
23
14
  };
@@ -2,11 +2,13 @@
2
2
  * @main Region
3
3
  */
4
4
  import { todo } from "../validation/builders/integrity.js";
5
+ import { validateEntityFileName } from "../validation/builders/naming.js";
5
6
  import { createSchemaValidator } from "../validation/builders/schema.js";
6
- import { getFIlenamePrefixAsNumericId } from "../validation/filename.js";
7
+ import { getFilenamePrefixAsNumericId } from "../validation/filename.js";
7
8
  export const config = {
8
9
  name: "Region",
9
- id: getFIlenamePrefixAsNumericId,
10
+ id: getFilenamePrefixAsNumericId,
10
11
  integrityValidator: todo("Region"),
11
12
  schemaValidator: createSchemaValidator(import.meta.url),
13
+ fileNameValidator: validateEntityFileName,
12
14
  };
@@ -2,11 +2,13 @@
2
2
  * @main Ritual
3
3
  */
4
4
  import { todo } from "../validation/builders/integrity.js";
5
+ import { validateEntityFileName } from "../validation/builders/naming.js";
5
6
  import { createSchemaValidator } from "../validation/builders/schema.js";
6
- import { getFIlenamePrefixAsNumericId } from "../validation/filename.js";
7
+ import { getFilenamePrefixAsNumericId } from "../validation/filename.js";
7
8
  export const config = {
8
9
  name: "Ritual",
9
- id: getFIlenamePrefixAsNumericId,
10
+ id: getFilenamePrefixAsNumericId,
10
11
  integrityValidator: todo("Ritual"),
11
12
  schemaValidator: createSchemaValidator(import.meta.url),
13
+ fileNameValidator: validateEntityFileName,
12
14
  };
@@ -28,10 +28,7 @@ export type Service = {
28
28
  */
29
29
  translations: LocaleMap<ServiceTranslation>;
30
30
  };
31
- export declare enum ServiceAvailability {
32
- SummonedCreatures = "SummonedCreatures",
33
- Monstrosities = "Monstrosities"
34
- }
31
+ export type ServiceAvailability = "SummonedCreatures" | "Monstrosities";
35
32
  export type ServiceTranslation = {
36
33
  /**
37
34
  * The name of the service.
@@ -2,16 +2,13 @@
2
2
  * @main Service
3
3
  */
4
4
  import { todo } from "../validation/builders/integrity.js";
5
+ import { validateEntityFileName } from "../validation/builders/naming.js";
5
6
  import { createSchemaValidator } from "../validation/builders/schema.js";
6
- import { getFIlenamePrefixAsNumericId } from "../validation/filename.js";
7
- export var ServiceAvailability;
8
- (function (ServiceAvailability) {
9
- ServiceAvailability["SummonedCreatures"] = "SummonedCreatures";
10
- ServiceAvailability["Monstrosities"] = "Monstrosities";
11
- })(ServiceAvailability = ServiceAvailability || (ServiceAvailability = {}));
7
+ import { getFilenamePrefixAsNumericId } from "../validation/filename.js";
12
8
  export const config = {
13
9
  name: "Service",
14
- id: getFIlenamePrefixAsNumericId,
10
+ id: getFilenamePrefixAsNumericId,
15
11
  integrityValidator: todo("Service"),
16
12
  schemaValidator: createSchemaValidator(import.meta.url),
13
+ fileNameValidator: validateEntityFileName,
17
14
  };
@@ -2,11 +2,13 @@
2
2
  * @main SexPractice
3
3
  */
4
4
  import { todo } from "../validation/builders/integrity.js";
5
+ import { validateEntityFileName } from "../validation/builders/naming.js";
5
6
  import { createSchemaValidator } from "../validation/builders/schema.js";
6
- import { getFIlenamePrefixAsNumericId } from "../validation/filename.js";
7
+ import { getFilenamePrefixAsNumericId } from "../validation/filename.js";
7
8
  export const config = {
8
9
  name: "SexPractice",
9
- id: getFIlenamePrefixAsNumericId,
10
+ id: getFilenamePrefixAsNumericId,
10
11
  integrityValidator: todo("SexPractice"),
11
12
  schemaValidator: createSchemaValidator(import.meta.url),
13
+ fileNameValidator: validateEntityFileName,
12
14
  };
@@ -91,11 +91,7 @@ export type SkillTranslation = {
91
91
  * A category. All available entries from the specified category will be
92
92
  * included as separate applications.
93
93
  */
94
- export declare enum ApplicationCategory {
95
- BlessedTraditions = "BlessedTraditions",
96
- Diseases = "Diseases",
97
- Regions = "Regions"
98
- }
94
+ export type ApplicationCategory = "BlessedTraditions" | "Diseases" | "Regions";
99
95
  /**
100
96
  * The skill's applications.
101
97
  */
@@ -134,9 +130,5 @@ export type ApplicationTranslation = {
134
130
  /**
135
131
  * Indicates whether encumbrance gives a penalty for checks with the skill.
136
132
  */
137
- export declare enum Encumbrance {
138
- True = "True",
139
- False = "False",
140
- Maybe = "Maybe"
141
- }
133
+ export type Encumbrance = "True" | "False" | "Maybe";
142
134
  export declare const config: TypeConfig<Skill>;
@@ -2,30 +2,13 @@
2
2
  * @main Skill
3
3
  */
4
4
  import { todo } from "../validation/builders/integrity.js";
5
+ import { validateEntityFileName } from "../validation/builders/naming.js";
5
6
  import { createSchemaValidator } from "../validation/builders/schema.js";
6
- import { getFIlenamePrefixAsNumericId } from "../validation/filename.js";
7
- /**
8
- * A category. All available entries from the specified category will be
9
- * included as separate applications.
10
- */
11
- export var ApplicationCategory;
12
- (function (ApplicationCategory) {
13
- ApplicationCategory["BlessedTraditions"] = "BlessedTraditions";
14
- ApplicationCategory["Diseases"] = "Diseases";
15
- ApplicationCategory["Regions"] = "Regions";
16
- })(ApplicationCategory = ApplicationCategory || (ApplicationCategory = {}));
17
- /**
18
- * Indicates whether encumbrance gives a penalty for checks with the skill.
19
- */
20
- export var Encumbrance;
21
- (function (Encumbrance) {
22
- Encumbrance["True"] = "True";
23
- Encumbrance["False"] = "False";
24
- Encumbrance["Maybe"] = "Maybe";
25
- })(Encumbrance = Encumbrance || (Encumbrance = {}));
7
+ import { getFilenamePrefixAsNumericId } from "../validation/filename.js";
26
8
  export const config = {
27
9
  name: "Skill",
28
- id: getFIlenamePrefixAsNumericId,
10
+ id: getFilenamePrefixAsNumericId,
29
11
  integrityValidator: todo("Skill"),
30
12
  schemaValidator: createSchemaValidator(import.meta.url),
13
+ fileNameValidator: validateEntityFileName,
31
14
  };
@@ -2,11 +2,13 @@
2
2
  * @main SkillGroup
3
3
  */
4
4
  import { todo } from "../validation/builders/integrity.js";
5
+ import { validateEntityFileName } from "../validation/builders/naming.js";
5
6
  import { createSchemaValidator } from "../validation/builders/schema.js";
6
- import { getFIlenamePrefixAsNumericId } from "../validation/filename.js";
7
+ import { getFilenamePrefixAsNumericId } from "../validation/filename.js";
7
8
  export const config = {
8
9
  name: "SkillGroup",
9
- id: getFIlenamePrefixAsNumericId,
10
+ id: getFilenamePrefixAsNumericId,
10
11
  integrityValidator: todo("SkillGroup"),
11
12
  schemaValidator: createSchemaValidator(import.meta.url),
13
+ fileNameValidator: validateEntityFileName,
12
14
  };
@@ -78,10 +78,7 @@ export type SlowSkillCastingTime = {
78
78
  */
79
79
  unit: SlowSkillCastingTimeUnit;
80
80
  };
81
- export declare enum SlowSkillCastingTimeUnit {
82
- Minutes = "Minutes",
83
- Hours = "Hours"
84
- }
81
+ export type SlowSkillCastingTimeUnit = "Minutes" | "Hours";
85
82
  /**
86
83
  * @minProperties 1
87
84
  */
@@ -2,16 +2,13 @@
2
2
  * @main SkillModificationLevel
3
3
  */
4
4
  import { todo } from "../validation/builders/integrity.js";
5
+ import { validateEntityFileName } from "../validation/builders/naming.js";
5
6
  import { createSchemaValidator } from "../validation/builders/schema.js";
6
- import { getFIlenamePrefixAsNumericId } from "../validation/filename.js";
7
- export var SlowSkillCastingTimeUnit;
8
- (function (SlowSkillCastingTimeUnit) {
9
- SlowSkillCastingTimeUnit["Minutes"] = "Minutes";
10
- SlowSkillCastingTimeUnit["Hours"] = "Hours";
11
- })(SlowSkillCastingTimeUnit = SlowSkillCastingTimeUnit || (SlowSkillCastingTimeUnit = {}));
7
+ import { getFilenamePrefixAsNumericId } from "../validation/filename.js";
12
8
  export const config = {
13
9
  name: "SkillModificationLevel",
14
- id: getFIlenamePrefixAsNumericId,
10
+ id: getFilenamePrefixAsNumericId,
15
11
  integrityValidator: todo("SkillModificationLevel"),
16
12
  schemaValidator: createSchemaValidator(import.meta.url),
13
+ fileNameValidator: validateEntityFileName,
17
14
  };
@@ -2,11 +2,13 @@
2
2
  * @main SocialStatus
3
3
  */
4
4
  import { todo } from "../validation/builders/integrity.js";
5
+ import { validateEntityFileName } from "../validation/builders/naming.js";
5
6
  import { createSchemaValidator } from "../validation/builders/schema.js";
6
- import { getFIlenamePrefixAsNumericId } from "../validation/filename.js";
7
+ import { getFilenamePrefixAsNumericId } from "../validation/filename.js";
7
8
  export const config = {
8
9
  name: "SocialStatus",
9
- id: getFIlenamePrefixAsNumericId,
10
+ id: getFilenamePrefixAsNumericId,
10
11
  integrityValidator: todo("SocialStatus"),
11
12
  schemaValidator: createSchemaValidator(import.meta.url),
13
+ fileNameValidator: validateEntityFileName,
12
14
  };
@@ -2,11 +2,13 @@
2
2
  * @main Spell
3
3
  */
4
4
  import { todo } from "../validation/builders/integrity.js";
5
+ import { validateEntityFileName } from "../validation/builders/naming.js";
5
6
  import { createSchemaValidator } from "../validation/builders/schema.js";
6
- import { getFIlenamePrefixAsNumericId } from "../validation/filename.js";
7
+ import { getFilenamePrefixAsNumericId } from "../validation/filename.js";
7
8
  export const config = {
8
9
  name: "Spell",
9
- id: getFIlenamePrefixAsNumericId,
10
+ id: getFilenamePrefixAsNumericId,
10
11
  integrityValidator: todo("Spell"),
11
12
  schemaValidator: createSchemaValidator(import.meta.url),
13
+ fileNameValidator: validateEntityFileName,
12
14
  };
@@ -2,11 +2,13 @@
2
2
  * @main State
3
3
  */
4
4
  import { todo } from "../validation/builders/integrity.js";
5
+ import { validateEntityFileName } from "../validation/builders/naming.js";
5
6
  import { createSchemaValidator } from "../validation/builders/schema.js";
6
- import { getFIlenamePrefixAsNumericId } from "../validation/filename.js";
7
+ import { getFilenamePrefixAsNumericId } from "../validation/filename.js";
7
8
  export const config = {
8
9
  name: "State",
9
- id: getFIlenamePrefixAsNumericId,
10
+ id: getFilenamePrefixAsNumericId,
10
11
  integrityValidator: todo("State"),
11
12
  schemaValidator: createSchemaValidator(import.meta.url),
13
+ fileNameValidator: validateEntityFileName,
12
14
  };
@@ -39,13 +39,7 @@ export type Talisman = {
39
39
  */
40
40
  translations: LocaleMap<TalismanTranslation>;
41
41
  };
42
- export declare enum TalismanType {
43
- MainTalisman = "MainTalisman",
44
- Talisman = "Talisman",
45
- MinorTalisman = "MinorTalisman",
46
- Regalia = "Regalia",
47
- PowerfulTalisman = "PowerfulTalisman"
48
- }
42
+ export type TalismanType = "MainTalisman" | "Talisman" | "MinorTalisman" | "Regalia" | "PowerfulTalisman";
49
43
  export type TalismanTranslation = {
50
44
  /**
51
45
  * The name of the talisman.
@@ -2,19 +2,13 @@
2
2
  * @main Talisman
3
3
  */
4
4
  import { todo } from "../validation/builders/integrity.js";
5
+ import { validateEntityFileName } from "../validation/builders/naming.js";
5
6
  import { createSchemaValidator } from "../validation/builders/schema.js";
6
- import { getFIlenamePrefixAsNumericId } from "../validation/filename.js";
7
- export var TalismanType;
8
- (function (TalismanType) {
9
- TalismanType["MainTalisman"] = "MainTalisman";
10
- TalismanType["Talisman"] = "Talisman";
11
- TalismanType["MinorTalisman"] = "MinorTalisman";
12
- TalismanType["Regalia"] = "Regalia";
13
- TalismanType["PowerfulTalisman"] = "PowerfulTalisman";
14
- })(TalismanType = TalismanType || (TalismanType = {}));
7
+ import { getFilenamePrefixAsNumericId } from "../validation/filename.js";
15
8
  export const config = {
16
9
  name: "Talisman",
17
- id: getFIlenamePrefixAsNumericId,
10
+ id: getFilenamePrefixAsNumericId,
18
11
  integrityValidator: todo("Talisman"),
19
12
  schemaValidator: createSchemaValidator(import.meta.url),
13
+ fileNameValidator: validateEntityFileName,
20
14
  };
@@ -2,11 +2,13 @@
2
2
  * @main TargetCategory
3
3
  */
4
4
  import { todo } from "../validation/builders/integrity.js";
5
+ import { validateEntityFileName } from "../validation/builders/naming.js";
5
6
  import { createSchemaValidator } from "../validation/builders/schema.js";
6
- import { getFIlenamePrefixAsNumericId } from "../validation/filename.js";
7
+ import { getFilenamePrefixAsNumericId } from "../validation/filename.js";
7
8
  export const config = {
8
9
  name: "TargetCategory",
9
- id: getFIlenamePrefixAsNumericId,
10
+ id: getFilenamePrefixAsNumericId,
10
11
  integrityValidator: todo("TargetCategory"),
11
12
  schemaValidator: createSchemaValidator(import.meta.url),
13
+ fileNameValidator: validateEntityFileName,
12
14
  };