@optolith/database-schema 0.78.0 → 0.79.0

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