@optolith/database-schema 0.45.0 → 0.47.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 (79) hide show
  1. package/CHANGELOG.md +37 -0
  2. package/gen/types.d.ts +749 -288
  3. package/lib/cache/magicalAndBlessedAdvantagesAndDisadvantages.js +1 -0
  4. package/lib/main.js +3 -0
  5. package/lib/types/Advantage.js +2 -1
  6. package/lib/types/AnimalDisease.d.ts +1 -0
  7. package/lib/types/Ceremony.d.ts +15 -0
  8. package/lib/types/Culture.d.ts +4 -0
  9. package/lib/types/Culture.js +1 -0
  10. package/lib/types/Disadvantage.js +2 -1
  11. package/lib/types/Disease.d.ts +1 -0
  12. package/lib/types/LiturgicalChant.d.ts +15 -0
  13. package/lib/types/Profession.d.ts +11 -0
  14. package/lib/types/Profession.js +4 -0
  15. package/lib/types/Race.d.ts +12 -0
  16. package/lib/types/Ritual.d.ts +15 -0
  17. package/lib/types/Spell.d.ts +15 -0
  18. package/lib/types/_ActivatableNames.d.ts +14 -0
  19. package/lib/types/_ActivatableNames.js +12 -0
  20. package/lib/types/_ActivatableSkill.d.ts +30 -0
  21. package/lib/types/_ActivatableSkillCost.d.ts +30 -0
  22. package/lib/types/_ActivatableSkillCost.js +4 -0
  23. package/lib/types/_AlternativeNames.d.ts +1 -0
  24. package/lib/types/_AlternativeNames.js +5 -0
  25. package/lib/types/_CommonnessRatedAdvantageDisadvantage.d.ts +1 -0
  26. package/lib/types/_CommonnessRatedAdvantageDisadvantage.js +4 -0
  27. package/lib/types/_DiseasePoison.d.ts +1 -0
  28. package/lib/types/_Identifier.d.ts +3 -0
  29. package/lib/types/_Identifier.js +6 -0
  30. package/lib/types/_ResponsiveText.d.ts +17 -0
  31. package/lib/types/_ResponsiveText.js +17 -0
  32. package/lib/types/equipment/item/Elixir.d.ts +1 -0
  33. package/lib/types/equipment/item/HerbalAid.d.ts +64 -0
  34. package/lib/types/equipment/item/HerbalAid.js +56 -0
  35. package/lib/types/equipment/item/Plant.d.ts +183 -0
  36. package/lib/types/equipment/item/Plant.js +222 -0
  37. package/lib/types/equipment/item/Poison.d.ts +1 -0
  38. package/lib/types/equipment/item/_Herbary.d.ts +7 -0
  39. package/lib/types/equipment/item/_Herbary.js +11 -0
  40. package/lib/types/equipment/item/sub/Biome.d.ts +6 -0
  41. package/lib/types/equipment/item/sub/Biome.js +21 -0
  42. package/lib/types/index.d.ts +4 -1
  43. package/lib/types/index.js +3 -0
  44. package/lib/types/prerequisites/PrerequisiteGroups.d.ts +32 -0
  45. package/lib/types/prerequisites/PrerequisiteGroups.js +1 -0
  46. package/lib/types/specialAbility/AdvancedCombatSpecialAbility.js +2 -1
  47. package/lib/types/specialAbility/AdvancedKarmaSpecialAbility.js +2 -1
  48. package/lib/types/specialAbility/AdvancedMagicalSpecialAbility.js +2 -1
  49. package/lib/types/specialAbility/AdvancedSkillSpecialAbility.js +2 -1
  50. package/lib/types/specialAbility/AncestorGlyph.js +2 -1
  51. package/lib/types/specialAbility/BlessedTradition.js +2 -0
  52. package/lib/types/specialAbility/BrawlingSpecialAbility.js +2 -1
  53. package/lib/types/specialAbility/CeremonialItemSpecialAbility.js +2 -1
  54. package/lib/types/specialAbility/CombatSpecialAbility.js +2 -1
  55. package/lib/types/specialAbility/CombatStyleSpecialAbility.js +2 -1
  56. package/lib/types/specialAbility/CommandSpecialAbility.js +2 -1
  57. package/lib/types/specialAbility/FamiliarSpecialAbility.js +2 -1
  58. package/lib/types/specialAbility/FatePointSexSpecialAbility.js +2 -1
  59. package/lib/types/specialAbility/FatePointSpecialAbility.js +2 -1
  60. package/lib/types/specialAbility/GeneralSpecialAbility.js +2 -1
  61. package/lib/types/specialAbility/KarmaSpecialAbility.js +2 -1
  62. package/lib/types/specialAbility/LiturgicalStyleSpecialAbility.js +2 -1
  63. package/lib/types/specialAbility/LycantropicGift.js +2 -1
  64. package/lib/types/specialAbility/MagicStyleSpecialAbility.js +2 -1
  65. package/lib/types/specialAbility/MagicalSign.js +2 -0
  66. package/lib/types/specialAbility/MagicalSpecialAbility.js +2 -1
  67. package/lib/types/specialAbility/MagicalTradition.js +2 -1
  68. package/lib/types/specialAbility/PactGift.js +2 -1
  69. package/lib/types/specialAbility/ProtectiveWardingCircleSpecialAbility.js +2 -1
  70. package/lib/types/specialAbility/Sermon.js +2 -1
  71. package/lib/types/specialAbility/SexSpecialAbility.js +2 -1
  72. package/lib/types/specialAbility/SikaryanDrainSpecialAbility.js +2 -1
  73. package/lib/types/specialAbility/SkillStyleSpecialAbility.js +2 -1
  74. package/lib/types/specialAbility/VampiricGift.js +2 -1
  75. package/lib/types/specialAbility/Vision.js +2 -1
  76. package/lib/types/specialAbility/sub/Language.d.ts +2 -1
  77. package/lib/types/specialAbility/sub/Language.js +1 -1
  78. package/lib/types/specialAbility/sub/Script.d.ts +1 -0
  79. package/package.json +1 -1
@@ -32,6 +32,7 @@ import { Container } from "./equipment/item/Container.js";
32
32
  import { Elixir } from "./equipment/item/Elixir.js";
33
33
  import { EquipmentOfBlessedOnes } from "./equipment/item/EquipmentOfBlessedOnes.js";
34
34
  import { GemOrPreciousStone } from "./equipment/item/GemOrPreciousStone.js";
35
+ import { HerbalAid } from "./equipment/item/HerbalAid.js";
35
36
  import { IlluminationLightSource } from "./equipment/item/IlluminationLightSource.js";
36
37
  import { IlluminationRefillOrSupply } from "./equipment/item/IlluminationRefillOrSupply.js";
37
38
  import { Jewelry } from "./equipment/item/Jewelry.js";
@@ -42,10 +43,12 @@ import { MagicalArtifact } from "./equipment/item/MagicalArtifact.js";
42
43
  import { MusicalInstrument } from "./equipment/item/MusicalInstrument.js";
43
44
  import { Newspaper } from "./equipment/item/Newspaper.js";
44
45
  import { OrienteeringAid } from "./equipment/item/OrienteeringAid.js";
46
+ import { Plant } from "./equipment/item/Plant.js";
45
47
  import { Poison } from "./equipment/item/Poison.js";
46
48
  import { RopeOrChain } from "./equipment/item/RopeOrChain.js";
47
49
  import { Stationery } from "./equipment/item/Stationery.js";
48
50
  import { ArmorType } from "./equipment/item/sub/ArmorType.js";
51
+ import { Biome } from "./equipment/item/sub/Biome.js";
49
52
  import { Reach } from "./equipment/item/sub/Reach.js";
50
53
  import { ThievesTool } from "./equipment/item/ThievesTool.js";
51
54
  import { ToolOfTheTrade } from "./equipment/item/ToolOfTheTrade.js";
@@ -180,6 +183,7 @@ export const AttributeIdentifier = () => R(Attribute);
180
183
  export const BandageOrRemedyIdentifier = () => R(BandageOrRemedy);
181
184
  export const BannzeichenIdentifier = () => R(Bannzeichen);
182
185
  export const BeutelzauberIdentifier = () => R(Beutelzauber);
186
+ export const BiomeIdentifier = () => R(Biome);
183
187
  export const BlessedTraditionIdentifier = () => R(BlessedTradition);
184
188
  export const BlessingIdentifier = () => R(Blessing);
185
189
  export const BookIdentifier = () => R(Book);
@@ -231,6 +235,7 @@ export const GoblinRitualIdentifier = () => R(GoblinRitual);
231
235
  export const GuidelineIdentifier = () => R(Guideline);
232
236
  export const HairColorIdentifier = () => R(HairColor);
233
237
  export const HaubenzauberIdentifier = () => R(Haubenzauber);
238
+ export const HerbalAidIdentifier = () => R(HerbalAid);
234
239
  export const IlluminationLightSourceIdentifier = () => R(IlluminationLightSource);
235
240
  export const IlluminationRefillOrSupplyIdentifier = () => R(IlluminationRefillOrSupply);
236
241
  export const InfluenceIdentifier = () => R(Influence);
@@ -270,6 +275,7 @@ export const PactTypeIdentifier = () => R(PactType);
270
275
  export const PatronCategoryIdentifier = () => R(PatronCategory);
271
276
  export const PatronIdentifier = () => R(Patron);
272
277
  export const PersonalityTraitIdentifier = () => R(PersonalityTrait);
278
+ export const PlantIdentifier = () => R(Plant);
273
279
  export const PlayerTypeIdentifier = () => R(PlayerType);
274
280
  export const PoisonIdentifier = () => R(Poison);
275
281
  export const ProfessionIdentifier = () => R(Profession);
@@ -1,3 +1,20 @@
1
+ /**
2
+ * Originally, this type was created to represent the text of a spell, which can
3
+ * be displayed in full on the spell card, but also in a compressed version on
4
+ * the character sheet. However, it can be used for any text that has a similar
5
+ * requirement.
6
+ *
7
+ * The `ResponsiveTextReplace` type is a special case where the full and
8
+ * compressed versions are not standalone texts, but rather templates that
9
+ * include a placeholder (`$1`) for a generated string. The generated string is
10
+ * expected to adapt to different size contexts as well.
11
+ *
12
+ * The `ResponsiveTextOptional` type allows for the possibility that a
13
+ * compressed version may not be provided. In such cases, the full text should
14
+ * be used in all contexts, and the absence of a compressed version indicates
15
+ * that no special formatting is needed for smaller areas.
16
+ * @module
17
+ */
1
18
  import * as DB from "tsondb/schema/dsl";
2
19
  export declare const ResponsiveText: DB.TypeAlias<"ResponsiveText", DB.Object<{
3
20
  full: DB.MemberDecl<DB.String, true>;
@@ -1,3 +1,20 @@
1
+ /**
2
+ * Originally, this type was created to represent the text of a spell, which can
3
+ * be displayed in full on the spell card, but also in a compressed version on
4
+ * the character sheet. However, it can be used for any text that has a similar
5
+ * requirement.
6
+ *
7
+ * The `ResponsiveTextReplace` type is a special case where the full and
8
+ * compressed versions are not standalone texts, but rather templates that
9
+ * include a placeholder (`$1`) for a generated string. The generated string is
10
+ * expected to adapt to different size contexts as well.
11
+ *
12
+ * The `ResponsiveTextOptional` type allows for the possibility that a
13
+ * compressed version may not be provided. In such cases, the full text should
14
+ * be used in all contexts, and the absence of a compressed version indicates
15
+ * that no special formatting is needed for smaller areas.
16
+ * @module
17
+ */
1
18
  import * as DB from "tsondb/schema/dsl";
2
19
  export const ResponsiveText = DB.TypeAlias(import.meta.url, {
3
20
  name: "ResponsiveText",
@@ -92,6 +92,7 @@ export declare const Elixir: DB.Entity<"Elixir", {
92
92
  alternative_names: DB.MemberDecl<DB.Array<DB.IncludeIdentifier<[], DB.TypeAlias<"AlternativeName", DB.Object<{
93
93
  name: DB.MemberDecl<DB.String, true>;
94
94
  region: DB.MemberDecl<DB.String, false>;
95
+ language: DB.MemberDecl<DB.ReferenceIdentifier, false>;
95
96
  }>, []>>>, false>;
96
97
  typical_ingredients: DB.MemberDecl<DB.Array<DB.String>, true>;
97
98
  brewing_process_prerequisites: DB.MemberDecl<DB.String, false>;
@@ -0,0 +1,64 @@
1
+ import * as DB from "tsondb/schema/dsl";
2
+ export declare const HerbalAid: DB.Entity<"HerbalAid", {
3
+ types: DB.MemberDecl<DB.Array<DB.IncludeIdentifier<[], DB.Enum<"EffectType", {
4
+ Healing: DB.EnumCase<null>;
5
+ Poison: DB.EnumCase<null>;
6
+ PhysicalEffect: DB.EnumCase<null>;
7
+ PsychicEffect: DB.EnumCase<null>;
8
+ Beneficial: DB.EnumCase<null>;
9
+ Defensive: DB.EnumCase<null>;
10
+ Supernatural: DB.EnumCase<null>;
11
+ }, []>>>, true>;
12
+ crafting_difficulty: DB.MemberDecl<DB.Integer, true>;
13
+ combatUse: DB.MemberDecl<DB.IncludeIdentifier<[], DB.Enum<"HerbalAidCombatUse", {
14
+ Weapon: DB.EnumCase<DB.ReferenceIdentifier>;
15
+ Armor: DB.EnumCase<DB.ReferenceIdentifier>;
16
+ }, []>>, false>;
17
+ src: DB.MemberDecl<DB.IncludeIdentifier<[], DB.TypeAlias<"PublicationRefs", DB.Array<DB.IncludeIdentifier<[], DB.TypeAlias<"PublicationRef", DB.Object<{
18
+ id: DB.MemberDecl<DB.ReferenceIdentifier, true>;
19
+ occurrences: DB.MemberDecl<DB.NestedEntityMap<string, {
20
+ initial: DB.MemberDecl<DB.IncludeIdentifier<[], DB.TypeAlias<"InitialOccurrence", DB.Object<{
21
+ printing: DB.MemberDecl<DB.Integer, false>;
22
+ pages: DB.MemberDecl<DB.Array<DB.IncludeIdentifier<[], DB.TypeAlias<"PageRange", DB.Object<{
23
+ first_page: DB.MemberDecl<DB.IncludeIdentifier<[], DB.Enum<"Page", {
24
+ InsideCoverFront: DB.EnumCase<null>;
25
+ InsideCoverBack: DB.EnumCase<null>;
26
+ Numbered: DB.EnumCase<DB.Integer>;
27
+ }, []>>, true>;
28
+ last_page: DB.MemberDecl<DB.IncludeIdentifier<[], DB.Enum<"Page", {
29
+ InsideCoverFront: DB.EnumCase<null>;
30
+ InsideCoverBack: DB.EnumCase<null>;
31
+ Numbered: DB.EnumCase<DB.Integer>;
32
+ }, []>>, false>;
33
+ }>, []>>>, true>;
34
+ isRemoved: DB.MemberDecl<DB.Boolean, false>;
35
+ }>, []>>, true>;
36
+ revisions: DB.MemberDecl<DB.Array<DB.IncludeIdentifier<[], DB.Enum<"Revision", {
37
+ Since: DB.EnumCase<DB.IncludeIdentifier<[], DB.TypeAlias<"Since", DB.Object<{
38
+ printing: DB.MemberDecl<DB.Integer, true>;
39
+ pages: DB.MemberDecl<DB.Array<DB.IncludeIdentifier<[], DB.TypeAlias<"PageRange", DB.Object<{
40
+ first_page: DB.MemberDecl<DB.IncludeIdentifier<[], DB.Enum<"Page", {
41
+ InsideCoverFront: DB.EnumCase<null>;
42
+ InsideCoverBack: DB.EnumCase<null>;
43
+ Numbered: DB.EnumCase<DB.Integer>;
44
+ }, []>>, true>;
45
+ last_page: DB.MemberDecl<DB.IncludeIdentifier<[], DB.Enum<"Page", {
46
+ InsideCoverFront: DB.EnumCase<null>;
47
+ InsideCoverBack: DB.EnumCase<null>;
48
+ Numbered: DB.EnumCase<DB.Integer>;
49
+ }, []>>, false>;
50
+ }>, []>>>, true>;
51
+ }>, []>>>;
52
+ Deprecated: DB.EnumCase<DB.IncludeIdentifier<[], DB.TypeAlias<"Deprecation", DB.Object<{
53
+ printing: DB.MemberDecl<DB.Integer, true>;
54
+ }>, []>>>;
55
+ }, []>>>, false>;
56
+ }>, true>;
57
+ }>, []>>>, []>>, true>;
58
+ translations: DB.MemberDecl<DB.NestedEntityMap<"HerbalAidTranslation", {
59
+ name: DB.MemberDecl<DB.String, true>;
60
+ description: DB.MemberDecl<DB.String, true>;
61
+ ingredients: DB.MemberDecl<DB.Array<DB.String>, true>;
62
+ typical_tools: DB.MemberDecl<DB.Array<DB.String>, false>;
63
+ }>, true>;
64
+ }, undefined>;
@@ -0,0 +1,56 @@
1
+ import * as DB from "tsondb/schema/dsl";
2
+ import { src } from "../../source/_PublicationRef.js";
3
+ import { NestedTranslationMap } from "../../Locale.js";
4
+ import { WeaponIdentifier, ArmorIdentifier } from "../../_Identifier.js";
5
+ import { EffectType } from "./_Herbary.js";
6
+ export const HerbalAid = DB.Entity(import.meta.url, {
7
+ name: "HerbalAid",
8
+ namePlural: "HerbalAids",
9
+ type: () => DB.Object({
10
+ types: DB.Required({
11
+ comment: "The plant types this aid belongs to.",
12
+ type: DB.Array(DB.IncludeIdentifier(EffectType), { minItems: 1, uniqueItems: true }),
13
+ }),
14
+ crafting_difficulty: DB.Required({
15
+ comment: "The difficulty for this aid to craft.",
16
+ type: DB.Integer(),
17
+ }),
18
+ combatUse: DB.Optional({
19
+ comment: "The armor or weapon this herbal aid represents.",
20
+ type: DB.IncludeIdentifier(HerbalAidCombatUse),
21
+ }),
22
+ src,
23
+ translations: NestedTranslationMap(DB.Required, "HerbalAid", DB.Object({
24
+ name: DB.Required({
25
+ comment: "The herbal aid's name.",
26
+ type: DB.String({ minLength: 1 }),
27
+ }),
28
+ description: DB.Required({
29
+ comment: "The herbal aid's description.",
30
+ type: DB.String({ minLength: 1, markdown: "block" }),
31
+ }),
32
+ ingredients: DB.Required({
33
+ comment: "The ingredients used to craft this herbal aid.",
34
+ type: DB.Array(DB.String({ minLength: 1, markdown: "inline" }), { minItems: 1 }),
35
+ }),
36
+ typical_tools: DB.Optional({
37
+ comment: "The typical tools used to craft this.",
38
+ type: DB.Array(DB.String({ minLength: 1, markdown: "inline" }), { minItems: 1 }),
39
+ }),
40
+ })),
41
+ }),
42
+ instanceDisplayName: {},
43
+ uniqueConstraints: [
44
+ {
45
+ entityMapKeyPath: "translations",
46
+ keyPathInEntityMap: "name",
47
+ },
48
+ ],
49
+ });
50
+ const HerbalAidCombatUse = DB.Enum(import.meta.url, {
51
+ name: "HerbalAidCombatUse",
52
+ values: () => ({
53
+ Weapon: DB.EnumCase({ type: WeaponIdentifier() }),
54
+ Armor: DB.EnumCase({ type: ArmorIdentifier() }),
55
+ }),
56
+ });
@@ -0,0 +1,183 @@
1
+ import * as DB from "tsondb/schema/dsl";
2
+ export declare const Plant: DB.Entity<"Plant", {
3
+ types: DB.MemberDecl<DB.Array<DB.IncludeIdentifier<[], DB.Enum<"EffectType", {
4
+ Healing: DB.EnumCase<null>;
5
+ Poison: DB.EnumCase<null>;
6
+ PhysicalEffect: DB.EnumCase<null>;
7
+ PsychicEffect: DB.EnumCase<null>;
8
+ Beneficial: DB.EnumCase<null>;
9
+ Defensive: DB.EnumCase<null>;
10
+ Supernatural: DB.EnumCase<null>;
11
+ }, []>>>, true>;
12
+ occurences: DB.MemberDecl<DB.IncludeIdentifier<[], DB.TypeAlias<"PlantOccurences", DB.Object<{
13
+ items: DB.MemberDecl<DB.Array<DB.IncludeIdentifier<[], DB.TypeAlias<"PlantOccurrence", DB.Object<{
14
+ biome: DB.MemberDecl<DB.ReferenceIdentifier, true>;
15
+ rarity: DB.MemberDecl<DB.IncludeIdentifier<[], DB.Enum<"PlantRarity", {
16
+ Common: DB.EnumCase<null>;
17
+ Occasional: DB.EnumCase<null>;
18
+ RatherRare: DB.EnumCase<null>;
19
+ Rare: DB.EnumCase<null>;
20
+ VeryRare: DB.EnumCase<null>;
21
+ }, []>>, true>;
22
+ translation: DB.MemberDecl<DB.NestedEntityMap<"PlantOccurrenceTranslation", {
23
+ note: DB.MemberDecl<DB.String, true>;
24
+ }>, false>;
25
+ }>, []>>>, false>;
26
+ translation: DB.MemberDecl<DB.NestedEntityMap<"PlantOccurrencesTranslation", {
27
+ note: DB.MemberDecl<DB.String, true>;
28
+ }>, false>;
29
+ }>, []>>, true>;
30
+ search_difficulty: DB.MemberDecl<DB.Integer, true>;
31
+ identification_difficulty: DB.MemberDecl<DB.Integer, true>;
32
+ applications: DB.MemberDecl<DB.Array<DB.Integer>, true>;
33
+ touch: DB.MemberDecl<DB.IncludeIdentifier<[], DB.TypeAlias<"PlantEffect", DB.Object<{
34
+ types: DB.MemberDecl<DB.Array<DB.IncludeIdentifier<[], DB.Enum<"EffectType", {
35
+ Healing: DB.EnumCase<null>;
36
+ Poison: DB.EnumCase<null>;
37
+ PhysicalEffect: DB.EnumCase<null>;
38
+ PsychicEffect: DB.EnumCase<null>;
39
+ Beneficial: DB.EnumCase<null>;
40
+ Defensive: DB.EnumCase<null>;
41
+ Supernatural: DB.EnumCase<null>;
42
+ }, []>>>, false>;
43
+ translations: DB.MemberDecl<DB.NestedEntityMap<"PlantEffectTranslationTranslation", {
44
+ description: DB.MemberDecl<DB.String, true>;
45
+ }>, true>;
46
+ }>, []>>, false>;
47
+ inhalation: DB.MemberDecl<DB.IncludeIdentifier<[], DB.TypeAlias<"PlantEffect", DB.Object<{
48
+ types: DB.MemberDecl<DB.Array<DB.IncludeIdentifier<[], DB.Enum<"EffectType", {
49
+ Healing: DB.EnumCase<null>;
50
+ Poison: DB.EnumCase<null>;
51
+ PhysicalEffect: DB.EnumCase<null>;
52
+ PsychicEffect: DB.EnumCase<null>;
53
+ Beneficial: DB.EnumCase<null>;
54
+ Defensive: DB.EnumCase<null>;
55
+ Supernatural: DB.EnumCase<null>;
56
+ }, []>>>, false>;
57
+ translations: DB.MemberDecl<DB.NestedEntityMap<"PlantEffectTranslationTranslation", {
58
+ description: DB.MemberDecl<DB.String, true>;
59
+ }>, true>;
60
+ }>, []>>, false>;
61
+ ingestion: DB.MemberDecl<DB.IncludeIdentifier<[], DB.TypeAlias<"PlantEffect", DB.Object<{
62
+ types: DB.MemberDecl<DB.Array<DB.IncludeIdentifier<[], DB.Enum<"EffectType", {
63
+ Healing: DB.EnumCase<null>;
64
+ Poison: DB.EnumCase<null>;
65
+ PhysicalEffect: DB.EnumCase<null>;
66
+ PsychicEffect: DB.EnumCase<null>;
67
+ Beneficial: DB.EnumCase<null>;
68
+ Defensive: DB.EnumCase<null>;
69
+ Supernatural: DB.EnumCase<null>;
70
+ }, []>>>, false>;
71
+ translations: DB.MemberDecl<DB.NestedEntityMap<"PlantEffectTranslationTranslation", {
72
+ description: DB.MemberDecl<DB.String, true>;
73
+ }>, true>;
74
+ }>, []>>, false>;
75
+ price: DB.MemberDecl<DB.IncludeIdentifier<[], DB.Enum<"PlantPrice", {
76
+ Constant: DB.EnumCase<DB.Object<{
77
+ value: DB.MemberDecl<DB.Float, true>;
78
+ cost: DB.MemberDecl<DB.Float, true>;
79
+ }>>;
80
+ Indefinite: DB.EnumCase<DB.IncludeIdentifier<[], DB.TypeAlias<"IndefinitePlantPrice", DB.Object<{
81
+ translations: DB.MemberDecl<DB.NestedEntityMap<"IndefinitePlantPriceTranslation", {
82
+ description: DB.MemberDecl<DB.String, true>;
83
+ }>, true>;
84
+ }>, []>>>;
85
+ }, []>>, true>;
86
+ recipes: DB.MemberDecl<DB.Array<DB.IncludeIdentifier<[], DB.Enum<"PlantRecipe", {
87
+ HerbalAid: DB.EnumCase<DB.IncludeIdentifier<[], DB.TypeAlias<"HerbalAidRecipe", DB.Object<{
88
+ herbal_aid: DB.MemberDecl<DB.ReferenceIdentifier, true>;
89
+ translation: DB.MemberDecl<DB.NestedEntityMap<"HerbalAidRecipeTranslation", {
90
+ note: DB.MemberDecl<DB.IncludeIdentifier<[], DB.TypeAlias<"ResponsiveTextOptional", DB.Object<{
91
+ full: DB.MemberDecl<DB.String, true>;
92
+ compressed: DB.MemberDecl<DB.String, false>;
93
+ }>, []>>, false>;
94
+ replacement: DB.MemberDecl<DB.IncludeIdentifier<[], DB.TypeAlias<"ResponsiveTextReplace", DB.Object<{
95
+ full: DB.MemberDecl<DB.String, true>;
96
+ compressed: DB.MemberDecl<DB.String, true>;
97
+ }>, []>>, false>;
98
+ }>, false>;
99
+ }>, []>>>;
100
+ Elixir: DB.EnumCase<DB.IncludeIdentifier<[], DB.TypeAlias<"ElixirRecipe", DB.Object<{
101
+ elixir: DB.MemberDecl<DB.ReferenceIdentifier, true>;
102
+ translation: DB.MemberDecl<DB.NestedEntityMap<"ElixirRecipeTranslation", {
103
+ note: DB.MemberDecl<DB.IncludeIdentifier<[], DB.TypeAlias<"ResponsiveTextOptional", DB.Object<{
104
+ full: DB.MemberDecl<DB.String, true>;
105
+ compressed: DB.MemberDecl<DB.String, false>;
106
+ }>, []>>, false>;
107
+ replacement: DB.MemberDecl<DB.IncludeIdentifier<[], DB.TypeAlias<"ResponsiveTextReplace", DB.Object<{
108
+ full: DB.MemberDecl<DB.String, true>;
109
+ compressed: DB.MemberDecl<DB.String, true>;
110
+ }>, []>>, false>;
111
+ }>, false>;
112
+ }>, []>>>;
113
+ Poison: DB.EnumCase<DB.IncludeIdentifier<[], DB.TypeAlias<"PoisonRecipe", DB.Object<{
114
+ poison: DB.MemberDecl<DB.ReferenceIdentifier, true>;
115
+ translation: DB.MemberDecl<DB.NestedEntityMap<"PoisonRecipeTranslation", {
116
+ note: DB.MemberDecl<DB.IncludeIdentifier<[], DB.TypeAlias<"ResponsiveTextOptional", DB.Object<{
117
+ full: DB.MemberDecl<DB.String, true>;
118
+ compressed: DB.MemberDecl<DB.String, false>;
119
+ }>, []>>, false>;
120
+ replacement: DB.MemberDecl<DB.IncludeIdentifier<[], DB.TypeAlias<"ResponsiveTextReplace", DB.Object<{
121
+ full: DB.MemberDecl<DB.String, true>;
122
+ compressed: DB.MemberDecl<DB.String, true>;
123
+ }>, []>>, false>;
124
+ }>, false>;
125
+ }>, []>>>;
126
+ Indefinite: DB.EnumCase<DB.IncludeIdentifier<[], DB.TypeAlias<"IndefiniteRecipe", DB.Object<{
127
+ translations: DB.MemberDecl<DB.NestedEntityMap<"IndefiniteRecipeTranslation", {
128
+ description: DB.MemberDecl<DB.String, true>;
129
+ }>, true>;
130
+ }>, []>>>;
131
+ }, []>>>, false>;
132
+ src: DB.MemberDecl<DB.IncludeIdentifier<[], DB.TypeAlias<"PublicationRefs", DB.Array<DB.IncludeIdentifier<[], DB.TypeAlias<"PublicationRef", DB.Object<{
133
+ id: DB.MemberDecl<DB.ReferenceIdentifier, true>;
134
+ occurrences: DB.MemberDecl<DB.NestedEntityMap<string, {
135
+ initial: DB.MemberDecl<DB.IncludeIdentifier<[], DB.TypeAlias<"InitialOccurrence", DB.Object<{
136
+ printing: DB.MemberDecl<DB.Integer, false>;
137
+ pages: DB.MemberDecl<DB.Array<DB.IncludeIdentifier<[], DB.TypeAlias<"PageRange", DB.Object<{
138
+ first_page: DB.MemberDecl<DB.IncludeIdentifier<[], DB.Enum<"Page", {
139
+ InsideCoverFront: DB.EnumCase<null>;
140
+ InsideCoverBack: DB.EnumCase<null>;
141
+ Numbered: DB.EnumCase<DB.Integer>;
142
+ }, []>>, true>;
143
+ last_page: DB.MemberDecl<DB.IncludeIdentifier<[], DB.Enum<"Page", {
144
+ InsideCoverFront: DB.EnumCase<null>;
145
+ InsideCoverBack: DB.EnumCase<null>;
146
+ Numbered: DB.EnumCase<DB.Integer>;
147
+ }, []>>, false>;
148
+ }>, []>>>, true>;
149
+ isRemoved: DB.MemberDecl<DB.Boolean, false>;
150
+ }>, []>>, true>;
151
+ revisions: DB.MemberDecl<DB.Array<DB.IncludeIdentifier<[], DB.Enum<"Revision", {
152
+ Since: DB.EnumCase<DB.IncludeIdentifier<[], DB.TypeAlias<"Since", DB.Object<{
153
+ printing: DB.MemberDecl<DB.Integer, true>;
154
+ pages: DB.MemberDecl<DB.Array<DB.IncludeIdentifier<[], DB.TypeAlias<"PageRange", DB.Object<{
155
+ first_page: DB.MemberDecl<DB.IncludeIdentifier<[], DB.Enum<"Page", {
156
+ InsideCoverFront: DB.EnumCase<null>;
157
+ InsideCoverBack: DB.EnumCase<null>;
158
+ Numbered: DB.EnumCase<DB.Integer>;
159
+ }, []>>, true>;
160
+ last_page: DB.MemberDecl<DB.IncludeIdentifier<[], DB.Enum<"Page", {
161
+ InsideCoverFront: DB.EnumCase<null>;
162
+ InsideCoverBack: DB.EnumCase<null>;
163
+ Numbered: DB.EnumCase<DB.Integer>;
164
+ }, []>>, false>;
165
+ }>, []>>>, true>;
166
+ }>, []>>>;
167
+ Deprecated: DB.EnumCase<DB.IncludeIdentifier<[], DB.TypeAlias<"Deprecation", DB.Object<{
168
+ printing: DB.MemberDecl<DB.Integer, true>;
169
+ }>, []>>>;
170
+ }, []>>>, false>;
171
+ }>, true>;
172
+ }>, []>>>, []>>, true>;
173
+ translations: DB.MemberDecl<DB.NestedEntityMap<"PlantTranslation", {
174
+ name: DB.MemberDecl<DB.String, true>;
175
+ alternative_names: DB.MemberDecl<DB.Array<DB.IncludeIdentifier<[], DB.TypeAlias<"AlternativeName", DB.Object<{
176
+ name: DB.MemberDecl<DB.String, true>;
177
+ region: DB.MemberDecl<DB.String, false>;
178
+ language: DB.MemberDecl<DB.ReferenceIdentifier, false>;
179
+ }>, []>>>, false>;
180
+ remedies_and_traditions: DB.MemberDecl<DB.String, true>;
181
+ knowledge: DB.MemberDecl<DB.Array<DB.String>, true>;
182
+ }>, true>;
183
+ }, undefined>;
@@ -0,0 +1,222 @@
1
+ import * as DB from "tsondb/schema/dsl";
2
+ import { src } from "../../source/_PublicationRef.js";
3
+ import { NestedTranslationMap } from "../../Locale.js";
4
+ import { AlternativeName } from "../../_AlternativeNames.js";
5
+ import { BiomeIdentifier, HerbalAidIdentifier, ElixirIdentifier, PoisonIdentifier, } from "../../_Identifier.js";
6
+ import { ResponsiveTextOptional, ResponsiveTextReplace } from "../../_ResponsiveText.js";
7
+ import { EffectType, PlantRarity } from "./_Herbary.js";
8
+ export const Plant = DB.Entity(import.meta.url, {
9
+ name: "Plant",
10
+ namePlural: "Plants",
11
+ type: () => DB.Object({
12
+ types: DB.Required({
13
+ comment: "The plant types of this plant.",
14
+ type: DB.Array(DB.IncludeIdentifier(EffectType), { minItems: 1, uniqueItems: true }),
15
+ }),
16
+ occurences: DB.Required({
17
+ comment: "The biomes this plant occurs in and its rarity in those biomes.",
18
+ type: DB.IncludeIdentifier(PlantOccurences),
19
+ }),
20
+ search_difficulty: DB.Required({
21
+ comment: "The search difficulty for this plant.",
22
+ type: DB.Integer(),
23
+ }),
24
+ identification_difficulty: DB.Required({
25
+ comment: "The identification difficulty for this plant.",
26
+ type: DB.Integer(),
27
+ }),
28
+ applications: DB.Required({
29
+ comment: "The applications of this plant per quality level.",
30
+ type: DB.Array(DB.Integer(), { minItems: 6, maxItems: 6 }),
31
+ }),
32
+ touch: DB.Optional({
33
+ comment: "The plant's touch effect.",
34
+ type: DB.IncludeIdentifier(PlantEffect),
35
+ }),
36
+ inhalation: DB.Optional({
37
+ comment: "The plant's inhalation effect.",
38
+ type: DB.IncludeIdentifier(PlantEffect),
39
+ }),
40
+ ingestion: DB.Optional({
41
+ comment: "The plant's ingestion effect.",
42
+ type: DB.IncludeIdentifier(PlantEffect),
43
+ }),
44
+ price: DB.Required({
45
+ comment: "The price of the plant.",
46
+ type: DB.IncludeIdentifier(PlantPrice),
47
+ }),
48
+ recipes: DB.Optional({
49
+ comment: "The herbal aids and elixirs that can be crafted with this plant.",
50
+ type: DB.Array(DB.IncludeIdentifier(PlantRecipe), { minItems: 1 }),
51
+ }),
52
+ src,
53
+ translations: NestedTranslationMap(DB.Required, "Plant", DB.Object({
54
+ name: DB.Required({
55
+ comment: "The plant's name.",
56
+ type: DB.String({ minLength: 1 }),
57
+ }),
58
+ alternative_names: DB.Optional({
59
+ comment: "A list of alternative names.",
60
+ type: DB.Array(DB.IncludeIdentifier(AlternativeName), { minItems: 1 }),
61
+ }),
62
+ remedies_and_traditions: DB.Required({
63
+ comment: "How this plant is used as a household remedy and in folk traditions.",
64
+ type: DB.String({ minLength: 1, markdown: "block" }),
65
+ }),
66
+ knowledge: DB.Required({
67
+ comment: "What one knows about this plant for each quality level. The first element represents QL 1, the second element QL 2, and so on.",
68
+ type: DB.Array(DB.String({ minLength: 1, markdown: "block" }), {
69
+ minItems: 3,
70
+ maxItems: 6,
71
+ }),
72
+ }),
73
+ })),
74
+ }),
75
+ instanceDisplayName: {},
76
+ uniqueConstraints: [
77
+ {
78
+ entityMapKeyPath: "translations",
79
+ keyPathInEntityMap: "name",
80
+ },
81
+ ],
82
+ });
83
+ const PlantOccurences = DB.TypeAlias(import.meta.url, {
84
+ name: "PlantOccurences",
85
+ type: () => DB.Object({
86
+ items: DB.Optional({
87
+ comment: "The biomes this plant occurs in and its rarity in those biomes.",
88
+ type: DB.Array(DB.IncludeIdentifier(PlantOccurrence), { minItems: 1 }),
89
+ }),
90
+ translation: NestedTranslationMap(DB.Optional, "PlantOccurrences", DB.Object({
91
+ note: DB.Required({
92
+ comment: "A note to all occurences of this plant",
93
+ type: DB.String({ minLength: 1, markdown: "block" }),
94
+ }),
95
+ })),
96
+ }, {
97
+ minProperties: 1,
98
+ }),
99
+ });
100
+ const PlantOccurrence = DB.TypeAlias(import.meta.url, {
101
+ name: "PlantOccurrence",
102
+ type: () => DB.Object({
103
+ biome: DB.Required({
104
+ comment: "The biome this plant occurs in.",
105
+ type: BiomeIdentifier(),
106
+ }),
107
+ rarity: DB.Required({
108
+ comment: "The rarity of this plant in the biome.",
109
+ type: DB.IncludeIdentifier(PlantRarity),
110
+ }),
111
+ translation: NestedTranslationMap(DB.Optional, "PlantOccurrence", DB.Object({
112
+ note: DB.Required({
113
+ comment: "A note added to this occurrence",
114
+ type: DB.String({ minLength: 1, markdown: "inline" }),
115
+ }),
116
+ })),
117
+ }),
118
+ });
119
+ const PlantEffect = DB.TypeAlias(import.meta.url, {
120
+ name: "PlantEffect",
121
+ type: () => DB.Object({
122
+ types: DB.Optional({
123
+ comment: "The effect type of this plant effect.",
124
+ type: DB.Array(DB.IncludeIdentifier(EffectType), { minItems: 1, uniqueItems: true }),
125
+ }),
126
+ translations: NestedTranslationMap(DB.Required, "PlantEffectTranslation", DB.Object({
127
+ description: DB.Required({
128
+ comment: "The effect of the plant.",
129
+ type: DB.String({ minLength: 1, markdown: "block" }),
130
+ }),
131
+ })),
132
+ }),
133
+ });
134
+ const PlantPrice = DB.Enum(import.meta.url, {
135
+ name: "PlantPrice",
136
+ values: () => ({
137
+ Constant: DB.EnumCase({
138
+ type: DB.Object({
139
+ value: DB.Required({
140
+ comment: "The value of the plant in silver coins.",
141
+ type: DB.Float({ minimum: 0 }),
142
+ }),
143
+ cost: DB.Required({
144
+ comment: "The cost of the plant in silver coins.",
145
+ type: DB.Float({ minimum: 0 }),
146
+ }),
147
+ }),
148
+ }),
149
+ Indefinite: DB.EnumCase({ type: DB.IncludeIdentifier(IndefinitePlantPrice) }),
150
+ }),
151
+ });
152
+ const IndefinitePlantPrice = DB.TypeAlias(import.meta.url, {
153
+ name: "IndefinitePlantPrice",
154
+ type: () => DB.Object({
155
+ translations: NestedTranslationMap(DB.Required, "IndefinitePlantPrice", DB.Object({
156
+ description: DB.Required({
157
+ comment: "A description of the price.",
158
+ type: DB.String({ minLength: 1, markdown: "block" }),
159
+ }),
160
+ })),
161
+ }),
162
+ });
163
+ const PlantRecipe = DB.Enum(import.meta.url, {
164
+ name: "PlantRecipe",
165
+ values: () => ({
166
+ HerbalAid: DB.EnumCase({ type: DB.IncludeIdentifier(HerbalAidRecipe) }),
167
+ Elixir: DB.EnumCase({ type: DB.IncludeIdentifier(ElixirRecipe) }),
168
+ Poison: DB.EnumCase({ type: DB.IncludeIdentifier(PoisonRecipe) }),
169
+ Indefinite: DB.EnumCase({ type: DB.IncludeIdentifier(IndefiniteRecipe) }),
170
+ }),
171
+ });
172
+ const PlantProductTranslation = DB.Object({
173
+ note: DB.Optional({
174
+ comment: "A note, appended to the generated string in parenthesis. If the generated is modified using `replacement`, the note is appended to the modifier string.",
175
+ type: DB.IncludeIdentifier(ResponsiveTextOptional),
176
+ }),
177
+ replacement: DB.Optional({
178
+ comment: "A replacement string. If `note` is provided, it is appended to the replaced string.",
179
+ type: DB.IncludeIdentifier(ResponsiveTextReplace),
180
+ }),
181
+ }, { minProperties: 1 });
182
+ const HerbalAidRecipe = DB.TypeAlias(import.meta.url, {
183
+ name: "HerbalAidRecipe",
184
+ type: () => DB.Object({
185
+ herbal_aid: DB.Required({
186
+ comment: "The herbal aid this recipe results in.",
187
+ type: HerbalAidIdentifier(),
188
+ }),
189
+ translation: NestedTranslationMap(DB.Optional, "HerbalAidRecipe", PlantProductTranslation),
190
+ }),
191
+ });
192
+ const ElixirRecipe = DB.TypeAlias(import.meta.url, {
193
+ name: "ElixirRecipe",
194
+ type: () => DB.Object({
195
+ elixir: DB.Required({
196
+ comment: "The elixir this recipe results in.",
197
+ type: ElixirIdentifier(),
198
+ }),
199
+ translation: NestedTranslationMap(DB.Optional, "ElixirRecipe", PlantProductTranslation),
200
+ }),
201
+ });
202
+ const PoisonRecipe = DB.TypeAlias(import.meta.url, {
203
+ name: "PoisonRecipe",
204
+ type: () => DB.Object({
205
+ poison: DB.Required({
206
+ comment: "The poison this recipe results in.",
207
+ type: PoisonIdentifier(),
208
+ }),
209
+ translation: NestedTranslationMap(DB.Optional, "PoisonRecipe", PlantProductTranslation),
210
+ }),
211
+ });
212
+ const IndefiniteRecipe = DB.TypeAlias(import.meta.url, {
213
+ name: "IndefiniteRecipe",
214
+ type: () => DB.Object({
215
+ translations: NestedTranslationMap(DB.Required, "IndefiniteRecipe", DB.Object({
216
+ description: DB.Required({
217
+ comment: "A description of the recipe.",
218
+ type: DB.String({ minLength: 1, markdown: "inline" }),
219
+ }),
220
+ })),
221
+ }),
222
+ });
@@ -297,6 +297,7 @@ export declare const Poison: DB.Entity<"Poison", {
297
297
  alternative_names: DB.MemberDecl<DB.Array<DB.IncludeIdentifier<[], DB.TypeAlias<"AlternativeName", DB.Object<{
298
298
  name: DB.MemberDecl<DB.String, true>;
299
299
  region: DB.MemberDecl<DB.String, false>;
300
+ language: DB.MemberDecl<DB.ReferenceIdentifier, false>;
300
301
  }>, []>>>, false>;
301
302
  effect: DB.MemberDecl<DB.IncludeIdentifier<DB.Param<string, DB.Type>[], DB.TypeAlias<"Reduceable", DB.Object<{
302
303
  default: DB.MemberDecl<DB.TypeArgument<DB.Param<"Content", DB.Type>>, true>;
@@ -11,6 +11,13 @@ export declare const EffectType: DB.Enum<"EffectType", {
11
11
  Defensive: DB.EnumCase<null>;
12
12
  Supernatural: DB.EnumCase<null>;
13
13
  }, []>;
14
+ export declare const PlantRarity: DB.Enum<"PlantRarity", {
15
+ Common: DB.EnumCase<null>;
16
+ Occasional: DB.EnumCase<null>;
17
+ RatherRare: DB.EnumCase<null>;
18
+ Rare: DB.EnumCase<null>;
19
+ VeryRare: DB.EnumCase<null>;
20
+ }, []>;
14
21
  export declare const LaboratoryLevel: DB.Enum<"LaboratoryLevel", {
15
22
  ArchaicLaboratory: DB.EnumCase<null>;
16
23
  WitchKitchen: DB.EnumCase<null>;