From be4dd24db2f2e64147d140899cc29c60c5f92d34 Mon Sep 17 00:00:00 2001 From: Lector Date: Wed, 4 Nov 2026 15:08:49 +0100 Subject: [PATCH 1/6] Added Note to plant price --- src/types/equipment/item/Plant.ts | 133 +++++++++++++++++++++--------- 1 file changed, 92 insertions(+), 41 deletions(-) diff --git a/src/types/equipment/item/Plant.ts b/src/types/equipment/item/Plant.ts index 3b7b0c3f..83810adc 100644 --- a/src/types/equipment/item/Plant.ts +++ b/src/types/equipment/item/Plant.ts @@ -1,5 +1,5 @@ -import * as DB from "tsondb/schema/dsl" -import { AlternativeName } from "../../_AlternativeNames.js" +import * as DB from "tsondb/schema/dsl"; +import { AlternativeName } from "../../_AlternativeNames.js"; import { BiomeIdentifier, SubBiomeIdentifier, @@ -8,11 +8,14 @@ import { HerbalPreservationIdentifier, ElixirIdentifier, PoisonIdentifier, -} from "../../_Identifier.js" -import { ResponsiveTextOptional, ResponsiveTextReplace } from "../../_ResponsiveText.js" -import { NestedTranslationMap } from "../../Locale.js" -import { src } from "../../source/_PublicationRef.js" -import { EffectType, PlantRarity } from "./_Herbary.js" +} from "../../_Identifier.js"; +import { + ResponsiveTextOptional, + ResponsiveTextReplace, +} from "../../_ResponsiveText.js"; +import { NestedTranslationMap } from "../../Locale.js"; +import { src } from "../../source/_PublicationRef.js"; +import { EffectType, PlantRarity } from "./_Herbary.js"; export const Plant = DB.Entity(import.meta.url, { name: "Plant", @@ -21,10 +24,14 @@ export const Plant = DB.Entity(import.meta.url, { DB.Object({ types: DB.Required({ comment: "The plant types of this plant.", - type: DB.Array(DB.IncludeIdentifier(EffectType), { minItems: 1, uniqueItems: true }), + type: DB.Array(DB.IncludeIdentifier(EffectType), { + minItems: 1, + uniqueItems: true, + }), }), occurences: DB.Required({ - comment: "The biomes this plant occurs in and its rarity in those biomes.", + comment: + "The biomes this plant occurs in and its rarity in those biomes.", type: DB.IncludeIdentifier(PlantOccurences), }), search_difficulty: DB.Required({ @@ -56,7 +63,8 @@ export const Plant = DB.Entity(import.meta.url, { type: DB.IncludeIdentifier(PlantPrice), }), recipes: DB.Optional({ - comment: "The herbal aids and elixirs that can be crafted with this plant.", + comment: + "The herbal aids and elixirs that can be crafted with this plant.", type: DB.Array(DB.IncludeIdentifier(PlantRecipe), { minItems: 1 }), }), longevity: DB.Optional({ @@ -74,10 +82,13 @@ export const Plant = DB.Entity(import.meta.url, { }), alternative_names: DB.Optional({ comment: "A list of alternative names.", - type: DB.Array(DB.IncludeIdentifier(AlternativeName), { minItems: 1 }), + type: DB.Array(DB.IncludeIdentifier(AlternativeName), { + minItems: 1, + }), }), remedies_and_traditions: DB.Required({ - comment: "How this plant is used as a household remedy and in folk traditions.", + comment: + "How this plant is used as a household remedy and in folk traditions.", type: DB.String({ minLength: 1, markdown: "block" }), }), knowledge: DB.Required({ @@ -98,7 +109,7 @@ export const Plant = DB.Entity(import.meta.url, { keyPathInEntityMap: "name", }, ], -}) +}); const PlantOccurences = DB.TypeAlias(import.meta.url, { name: "PlantOccurences", @@ -106,8 +117,11 @@ const PlantOccurences = DB.TypeAlias(import.meta.url, { DB.Object( { items: DB.Optional({ - comment: "The biomes this plant occurs in and its rarity in those biomes.", - type: DB.Array(DB.IncludeIdentifier(PlantOccurrence), { minItems: 1 }), + comment: + "The biomes this plant occurs in and its rarity in those biomes.", + type: DB.Array(DB.IncludeIdentifier(PlantOccurrence), { + minItems: 1, + }), }), translation: NestedTranslationMap( DB.Optional, @@ -124,7 +138,7 @@ const PlantOccurences = DB.TypeAlias(import.meta.url, { minProperties: 1, }, ), -}) +}); const PlantOccurrence = DB.TypeAlias(import.meta.url, { name: "PlantOccurrence", @@ -149,7 +163,7 @@ const PlantOccurrence = DB.TypeAlias(import.meta.url, { }), ), }), -}) +}); const PlantOccurrenceTier = DB.Enum(import.meta.url, { name: "PlantOccurrenceTier", @@ -165,15 +179,17 @@ const PlantOccurrenceTier = DB.Enum(import.meta.url, { type: DB.Array(BotanicRegionIdentifier(), { minItems: 1 }), }), }), -}) +}); const PlantDifficulty = DB.Enum(import.meta.url, { name: "PlantDifficulty", values: () => ({ Constant: DB.EnumCase({ type: DB.Integer() }), - Indefinite: DB.EnumCase({ type: DB.IncludeIdentifier(IndefinitePlantDescription) }), + Indefinite: DB.EnumCase({ + type: DB.IncludeIdentifier(IndefinitePlantDescription), + }), }), -}) +}); const IndefinitePlantDescription = DB.TypeAlias(import.meta.url, { name: "IndefinitePlantDescription", @@ -190,15 +206,19 @@ const IndefinitePlantDescription = DB.TypeAlias(import.meta.url, { }), ), }), -}) +}); const PlantApplications = DB.Enum(import.meta.url, { name: "PlantApplications", values: () => ({ - Constant: DB.EnumCase({ type: DB.Array(DB.Integer(), { minItems: 6, maxItems: 6 }) }), - Indefinite: DB.EnumCase({ type: DB.IncludeIdentifier(IndefinitePlantDescription) }), + Constant: DB.EnumCase({ + type: DB.Array(DB.Integer(), { minItems: 6, maxItems: 6 }), + }), + Indefinite: DB.EnumCase({ + type: DB.IncludeIdentifier(IndefinitePlantDescription), + }), }), -}) +}); const PlantEffect = DB.TypeAlias(import.meta.url, { name: "PlantEffect", @@ -206,7 +226,10 @@ const PlantEffect = DB.TypeAlias(import.meta.url, { DB.Object({ types: DB.Optional({ comment: "The effect type of this plant effect.", - type: DB.Array(DB.IncludeIdentifier(EffectType), { minItems: 1, uniqueItems: true }), + type: DB.Array(DB.IncludeIdentifier(EffectType), { + minItems: 1, + uniqueItems: true, + }), }), translations: NestedTranslationMap( DB.Required, @@ -219,7 +242,7 @@ const PlantEffect = DB.TypeAlias(import.meta.url, { }), ), }), -}) +}); const PlantPrice = DB.Enum(import.meta.url, { name: "PlantPrice", @@ -234,11 +257,23 @@ const PlantPrice = DB.Enum(import.meta.url, { comment: "The cost of the plant in silver coins.", type: DB.Float({ minimum: 0 }), }), + translations: NestedTranslationMap( + DB.Optional, + "PlantPrice", + DB.Object({ + note: DB.Required({ + comment: "A note about the price.", + type: DB.String({ minLength: 1, markdown: "block" }), + }), + }), + ), }), }), - Indefinite: DB.EnumCase({ type: DB.IncludeIdentifier(IndefinitePlantPrice) }), + Indefinite: DB.EnumCase({ + type: DB.IncludeIdentifier(IndefinitePlantPrice), + }), }), -}) +}); const IndefinitePlantPrice = DB.TypeAlias(import.meta.url, { name: "IndefinitePlantPrice", @@ -255,7 +290,7 @@ const IndefinitePlantPrice = DB.TypeAlias(import.meta.url, { }), ), }), -}) +}); const PlantRecipe = DB.Enum(import.meta.url, { name: "PlantRecipe", @@ -265,7 +300,7 @@ const PlantRecipe = DB.Enum(import.meta.url, { Poison: DB.EnumCase({ type: DB.IncludeIdentifier(PoisonRecipe) }), Indefinite: DB.EnumCase({ type: DB.IncludeIdentifier(IndefiniteRecipe) }), }), -}) +}); const PlantProductTranslation = DB.Object( { @@ -281,7 +316,7 @@ const PlantProductTranslation = DB.Object( }), }, { minProperties: 1 }, -) +); const HerbalAidRecipe = DB.TypeAlias(import.meta.url, { name: "HerbalAidRecipe", @@ -291,9 +326,13 @@ const HerbalAidRecipe = DB.TypeAlias(import.meta.url, { comment: "The herbal aid this recipe results in.", type: HerbalAidIdentifier(), }), - translation: NestedTranslationMap(DB.Optional, "HerbalAidRecipe", PlantProductTranslation), + translation: NestedTranslationMap( + DB.Optional, + "HerbalAidRecipe", + PlantProductTranslation, + ), }), -}) +}); const ElixirRecipe = DB.TypeAlias(import.meta.url, { name: "ElixirRecipe", @@ -303,9 +342,13 @@ const ElixirRecipe = DB.TypeAlias(import.meta.url, { comment: "The elixir this recipe results in.", type: ElixirIdentifier(), }), - translation: NestedTranslationMap(DB.Optional, "ElixirRecipe", PlantProductTranslation), + translation: NestedTranslationMap( + DB.Optional, + "ElixirRecipe", + PlantProductTranslation, + ), }), -}) +}); const PoisonRecipe = DB.TypeAlias(import.meta.url, { name: "PoisonRecipe", @@ -315,9 +358,13 @@ const PoisonRecipe = DB.TypeAlias(import.meta.url, { comment: "The poison this recipe results in.", type: PoisonIdentifier(), }), - translation: NestedTranslationMap(DB.Optional, "PoisonRecipe", PlantProductTranslation), + translation: NestedTranslationMap( + DB.Optional, + "PoisonRecipe", + PlantProductTranslation, + ), }), -}) +}); const IndefiniteRecipe = DB.TypeAlias(import.meta.url, { name: "IndefiniteRecipe", @@ -334,7 +381,7 @@ const IndefiniteRecipe = DB.TypeAlias(import.meta.url, { }), ), }), -}) +}); const PlantLongevity = DB.TypeAlias(import.meta.url, { name: "PlantLongevity", @@ -342,8 +389,12 @@ const PlantLongevity = DB.TypeAlias(import.meta.url, { DB.Object( { preservations: DB.Optional({ - comment: "The preservations with alternative effect of this preserved plant", - type: DB.Array(HerbalPreservationIdentifier(), { minItems: 1, uniqueItems: true }), + comment: + "The preservations with alternative effect of this preserved plant", + type: DB.Array(HerbalPreservationIdentifier(), { + minItems: 1, + uniqueItems: true, + }), }), translations: NestedTranslationMap( DB.Optional, @@ -365,4 +416,4 @@ const PlantLongevity = DB.TypeAlias(import.meta.url, { }, { minProperties: 1 }, ), -}) +}); From 25621dffe7bab91d89a6a391736b49646a41c974 Mon Sep 17 00:00:00 2001 From: Lector Date: Wed, 4 Nov 2026 15:12:55 +0100 Subject: [PATCH 2/6] format Plant.ts --- src/types/equipment/item/Plant.ts | 84 ++++++++++++------------------- 1 file changed, 32 insertions(+), 52 deletions(-) diff --git a/src/types/equipment/item/Plant.ts b/src/types/equipment/item/Plant.ts index 83810adc..83e9448c 100644 --- a/src/types/equipment/item/Plant.ts +++ b/src/types/equipment/item/Plant.ts @@ -1,5 +1,5 @@ -import * as DB from "tsondb/schema/dsl"; -import { AlternativeName } from "../../_AlternativeNames.js"; +import * as DB from "tsondb/schema/dsl" +import { AlternativeName } from "../../_AlternativeNames.js" import { BiomeIdentifier, SubBiomeIdentifier, @@ -8,14 +8,11 @@ import { HerbalPreservationIdentifier, ElixirIdentifier, PoisonIdentifier, -} from "../../_Identifier.js"; -import { - ResponsiveTextOptional, - ResponsiveTextReplace, -} from "../../_ResponsiveText.js"; -import { NestedTranslationMap } from "../../Locale.js"; -import { src } from "../../source/_PublicationRef.js"; -import { EffectType, PlantRarity } from "./_Herbary.js"; +} from "../../_Identifier.js" +import { ResponsiveTextOptional, ResponsiveTextReplace } from "../../_ResponsiveText.js" +import { NestedTranslationMap } from "../../Locale.js" +import { src } from "../../source/_PublicationRef.js" +import { EffectType, PlantRarity } from "./_Herbary.js" export const Plant = DB.Entity(import.meta.url, { name: "Plant", @@ -30,8 +27,7 @@ export const Plant = DB.Entity(import.meta.url, { }), }), occurences: DB.Required({ - comment: - "The biomes this plant occurs in and its rarity in those biomes.", + comment: "The biomes this plant occurs in and its rarity in those biomes.", type: DB.IncludeIdentifier(PlantOccurences), }), search_difficulty: DB.Required({ @@ -63,8 +59,7 @@ export const Plant = DB.Entity(import.meta.url, { type: DB.IncludeIdentifier(PlantPrice), }), recipes: DB.Optional({ - comment: - "The herbal aids and elixirs that can be crafted with this plant.", + comment: "The herbal aids and elixirs that can be crafted with this plant.", type: DB.Array(DB.IncludeIdentifier(PlantRecipe), { minItems: 1 }), }), longevity: DB.Optional({ @@ -87,8 +82,7 @@ export const Plant = DB.Entity(import.meta.url, { }), }), remedies_and_traditions: DB.Required({ - comment: - "How this plant is used as a household remedy and in folk traditions.", + comment: "How this plant is used as a household remedy and in folk traditions.", type: DB.String({ minLength: 1, markdown: "block" }), }), knowledge: DB.Required({ @@ -109,7 +103,7 @@ export const Plant = DB.Entity(import.meta.url, { keyPathInEntityMap: "name", }, ], -}); +}) const PlantOccurences = DB.TypeAlias(import.meta.url, { name: "PlantOccurences", @@ -117,8 +111,7 @@ const PlantOccurences = DB.TypeAlias(import.meta.url, { DB.Object( { items: DB.Optional({ - comment: - "The biomes this plant occurs in and its rarity in those biomes.", + comment: "The biomes this plant occurs in and its rarity in those biomes.", type: DB.Array(DB.IncludeIdentifier(PlantOccurrence), { minItems: 1, }), @@ -138,7 +131,7 @@ const PlantOccurences = DB.TypeAlias(import.meta.url, { minProperties: 1, }, ), -}); +}) const PlantOccurrence = DB.TypeAlias(import.meta.url, { name: "PlantOccurrence", @@ -163,7 +156,7 @@ const PlantOccurrence = DB.TypeAlias(import.meta.url, { }), ), }), -}); +}) const PlantOccurrenceTier = DB.Enum(import.meta.url, { name: "PlantOccurrenceTier", @@ -179,7 +172,7 @@ const PlantOccurrenceTier = DB.Enum(import.meta.url, { type: DB.Array(BotanicRegionIdentifier(), { minItems: 1 }), }), }), -}); +}) const PlantDifficulty = DB.Enum(import.meta.url, { name: "PlantDifficulty", @@ -189,7 +182,7 @@ const PlantDifficulty = DB.Enum(import.meta.url, { type: DB.IncludeIdentifier(IndefinitePlantDescription), }), }), -}); +}) const IndefinitePlantDescription = DB.TypeAlias(import.meta.url, { name: "IndefinitePlantDescription", @@ -206,7 +199,7 @@ const IndefinitePlantDescription = DB.TypeAlias(import.meta.url, { }), ), }), -}); +}) const PlantApplications = DB.Enum(import.meta.url, { name: "PlantApplications", @@ -218,7 +211,7 @@ const PlantApplications = DB.Enum(import.meta.url, { type: DB.IncludeIdentifier(IndefinitePlantDescription), }), }), -}); +}) const PlantEffect = DB.TypeAlias(import.meta.url, { name: "PlantEffect", @@ -242,7 +235,7 @@ const PlantEffect = DB.TypeAlias(import.meta.url, { }), ), }), -}); +}) const PlantPrice = DB.Enum(import.meta.url, { name: "PlantPrice", @@ -273,7 +266,7 @@ const PlantPrice = DB.Enum(import.meta.url, { type: DB.IncludeIdentifier(IndefinitePlantPrice), }), }), -}); +}) const IndefinitePlantPrice = DB.TypeAlias(import.meta.url, { name: "IndefinitePlantPrice", @@ -290,7 +283,7 @@ const IndefinitePlantPrice = DB.TypeAlias(import.meta.url, { }), ), }), -}); +}) const PlantRecipe = DB.Enum(import.meta.url, { name: "PlantRecipe", @@ -300,7 +293,7 @@ const PlantRecipe = DB.Enum(import.meta.url, { Poison: DB.EnumCase({ type: DB.IncludeIdentifier(PoisonRecipe) }), Indefinite: DB.EnumCase({ type: DB.IncludeIdentifier(IndefiniteRecipe) }), }), -}); +}) const PlantProductTranslation = DB.Object( { @@ -316,7 +309,7 @@ const PlantProductTranslation = DB.Object( }), }, { minProperties: 1 }, -); +) const HerbalAidRecipe = DB.TypeAlias(import.meta.url, { name: "HerbalAidRecipe", @@ -326,13 +319,9 @@ const HerbalAidRecipe = DB.TypeAlias(import.meta.url, { comment: "The herbal aid this recipe results in.", type: HerbalAidIdentifier(), }), - translation: NestedTranslationMap( - DB.Optional, - "HerbalAidRecipe", - PlantProductTranslation, - ), + translation: NestedTranslationMap(DB.Optional, "HerbalAidRecipe", PlantProductTranslation), }), -}); +}) const ElixirRecipe = DB.TypeAlias(import.meta.url, { name: "ElixirRecipe", @@ -342,13 +331,9 @@ const ElixirRecipe = DB.TypeAlias(import.meta.url, { comment: "The elixir this recipe results in.", type: ElixirIdentifier(), }), - translation: NestedTranslationMap( - DB.Optional, - "ElixirRecipe", - PlantProductTranslation, - ), + translation: NestedTranslationMap(DB.Optional, "ElixirRecipe", PlantProductTranslation), }), -}); +}) const PoisonRecipe = DB.TypeAlias(import.meta.url, { name: "PoisonRecipe", @@ -358,13 +343,9 @@ const PoisonRecipe = DB.TypeAlias(import.meta.url, { comment: "The poison this recipe results in.", type: PoisonIdentifier(), }), - translation: NestedTranslationMap( - DB.Optional, - "PoisonRecipe", - PlantProductTranslation, - ), + translation: NestedTranslationMap(DB.Optional, "PoisonRecipe", PlantProductTranslation), }), -}); +}) const IndefiniteRecipe = DB.TypeAlias(import.meta.url, { name: "IndefiniteRecipe", @@ -381,7 +362,7 @@ const IndefiniteRecipe = DB.TypeAlias(import.meta.url, { }), ), }), -}); +}) const PlantLongevity = DB.TypeAlias(import.meta.url, { name: "PlantLongevity", @@ -389,8 +370,7 @@ const PlantLongevity = DB.TypeAlias(import.meta.url, { DB.Object( { preservations: DB.Optional({ - comment: - "The preservations with alternative effect of this preserved plant", + comment: "The preservations with alternative effect of this preserved plant", type: DB.Array(HerbalPreservationIdentifier(), { minItems: 1, uniqueItems: true, @@ -416,4 +396,4 @@ const PlantLongevity = DB.TypeAlias(import.meta.url, { }, { minProperties: 1 }, ), -}); +}) From 25d16b1ce9d85919ce37f849758f3be64e187102 Mon Sep 17 00:00:00 2001 From: Lector Date: Thu, 5 Nov 2026 16:53:52 +0100 Subject: [PATCH 3/6] Extended plant schema Added some text to Locale.ts --- src/types/Locale.ts | 37 +++++++++++++++++++++++++++++++ src/types/equipment/item/Plant.ts | 23 +++++++++++++++++++ 2 files changed, 60 insertions(+) diff --git a/src/types/Locale.ts b/src/types/Locale.ts index d3f52313..f0e3f2a7 100644 --- a/src/types/Locale.ts +++ b/src/types/Locale.ts @@ -1591,6 +1591,13 @@ export const Locale = DB.Entity(import.meta.url, { "Books": null, "Magical Artifacts": null, "Alchemicae": null, + "Elixirs": null, + "Herbal Aids": null, + "Alchemical Poisons": null, + "Alchemical Intoxicants": null, + "Plant Poisons": null, + "Plant Intoxicants": null, + "No recipes known": null, "Poisons": null, "Musical Instruments": null, "Luxury Goods": null, @@ -1649,10 +1656,40 @@ export const Locale = DB.Entity(import.meta.url, { "CoD": null, // plants + "Plant Alternative Names": null, + "Distribution": null, + "Ingredients": null, + "Typical Tools": null, + "Crafting Difficulty": null, + "Combat Use": null, + "Healing": null, + "Poison": null, + "Physical Effect": null, + "Psychic Effect": null, + "Beneficial": null, + "Defensive": null, + "Supernatural": null, "Search Difficulty": null, "Identification Difficulty": null, "Plant Applications": null, + "Recipes": null, + "Longevity": null, "Remedies and Traditions": null, + "Landscape Type": null, + "Regions": null, + "Raw": null, + "Processed": null, + "Plant Touch": null, + "Plant Inhalation": null, + "Plant Ingestion": null, + "No plant recipes known": null, + "See plant recipes": null, + "Raw plant longevity fallback": null, + "occurence common": null, + "occurence occasional": null, + "occurence rather rare": null, + "occurence rare": null, + "occurence very rare": null, // books "Romance Novel": null, diff --git a/src/types/equipment/item/Plant.ts b/src/types/equipment/item/Plant.ts index 83e9448c..a996be94 100644 --- a/src/types/equipment/item/Plant.ts +++ b/src/types/equipment/item/Plant.ts @@ -347,10 +347,33 @@ const PoisonRecipe = DB.TypeAlias(import.meta.url, { }), }) +const PlantRecipeGroup = DB.Enum(import.meta.url, { + name: "PlantRecipeGroup", + values: () => ({ + HerbalAid: DB.EnumCase({ type: null }), + Elixir: DB.EnumCase({ type: null }), + AlchemicalPoison: DB.EnumCase({ type: null }), + AlchemicalIntoxicant: DB.EnumCase({ type: null }), + PlantPoison: DB.EnumCase({ type: null }), + PlantIntoxicant: DB.EnumCase({ type: null }), + }), +}) + const IndefiniteRecipe = DB.TypeAlias(import.meta.url, { name: "IndefiniteRecipe", type: () => DB.Object({ + types: DB.Optional({ + comment: "The effect types of this recipe.", + type: DB.Array(DB.IncludeIdentifier(EffectType), { + minItems: 1, + uniqueItems: true, + }), + }), + group: DB.Optional({ + comment: "The group this recipe belongs to.", + type: DB.IncludeIdentifier(PlantRecipeGroup), + }), translations: NestedTranslationMap( DB.Required, "IndefiniteRecipe", From a493967a7ecf16a9309ff8b9cf75bfd62c86cb2f Mon Sep 17 00:00:00 2001 From: Lector Date: Thu, 5 Nov 2026 18:01:03 +0100 Subject: [PATCH 4/6] Added new texts --- src/types/Locale.ts | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/types/Locale.ts b/src/types/Locale.ts index f0e3f2a7..23582186 100644 --- a/src/types/Locale.ts +++ b/src/types/Locale.ts @@ -1657,6 +1657,8 @@ export const Locale = DB.Entity(import.meta.url, { // plants "Plant Alternative Names": null, + "Preparation": null, + "Alternative Effect": null, "Distribution": null, "Ingredients": null, "Typical Tools": null, From d7c9dba1dadf121c1af006a6bc66e0565814188e Mon Sep 17 00:00:00 2001 From: Lector Date: Tue, 10 Nov 2026 17:10:44 +0100 Subject: [PATCH 5/6] Removed duplicate text definition --- src/types/Locale.ts | 2 -- 1 file changed, 2 deletions(-) diff --git a/src/types/Locale.ts b/src/types/Locale.ts index f66a46fe..5b45584b 100644 --- a/src/types/Locale.ts +++ b/src/types/Locale.ts @@ -1672,8 +1672,6 @@ export const Locale = DB.Entity(import.meta.url, { "Combat Use": null, "Healing": null, "Poison": null, - "Physical Effect": null, - "Psychic Effect": null, "Beneficial": null, "Defensive": null, "Supernatural": null, From 8f43a9c57a4f44db0de7427399f09b4e754cc703 Mon Sep 17 00:00:00 2001 From: Lector Date: Tue, 17 Nov 2026 17:49:10 +0100 Subject: [PATCH 6/6] Update plant occurences. A rarity can now describe Biomes and Subbiomes --- src/types/equipment/item/Plant.ts | 56 ++++++++++++++++++++++++------- 1 file changed, 44 insertions(+), 12 deletions(-) diff --git a/src/types/equipment/item/Plant.ts b/src/types/equipment/item/Plant.ts index a996be94..ebb8e2e7 100644 --- a/src/types/equipment/item/Plant.ts +++ b/src/types/equipment/item/Plant.ts @@ -119,12 +119,23 @@ const PlantOccurences = DB.TypeAlias(import.meta.url, { translation: NestedTranslationMap( DB.Optional, "PlantOccurrences", - DB.Object({ - note: DB.Required({ - comment: "A note to all occurences of this plant", - type: DB.String({ minLength: 1, markdown: "block" }), - }), - }), + DB.Object( + { + note: DB.Optional({ + comment: + "A note to all occurences of this plant. This note is added after the generated string divided by ;", + type: DB.String({ minLength: 1, markdown: "block" }), + }), + replacement: DB.Optional({ + comment: + "A replacement string. This replaces the generated string. If `note` is provided, it is appended to the replaced string.", + type: DB.String({ minLength: 1, markdown: "inline" }), + }), + }, + { + minProperties: 1, + }, + ), ), }, { @@ -148,12 +159,22 @@ const PlantOccurrence = DB.TypeAlias(import.meta.url, { translation: NestedTranslationMap( DB.Optional, "PlantOccurrence", - DB.Object({ - note: DB.Required({ - comment: "A note added to this occurrence", - type: DB.String({ minLength: 1, markdown: "inline" }), - }), - }), + DB.Object( + { + note: DB.Optional({ + comment: "A note added to this occurrence", + type: DB.String({ minLength: 1, markdown: "inline" }), + }), + replacement: DB.Optional({ + comment: + "A replacement string. If `note` is provided, it is appended to the replaced string.", + type: DB.String({ minLength: 1, markdown: "inline" }), + }), + }, + { + minProperties: 1, + }, + ), ), }), }) @@ -162,6 +183,17 @@ const PlantOccurrenceTier = DB.Enum(import.meta.url, { name: "PlantOccurrenceTier", values: () => ({ AllBiomes: DB.EnumCase({ type: null }), + Specific: DB.EnumCase({ + type: DB.Array(DB.IncludeIdentifier(PlantOccurrenceSpecificRegion), { + minItems: 1, + }), + }), + }), +}) + +const PlantOccurrenceSpecificRegion = DB.Enum(import.meta.url, { + name: "PlantOccurrenceSpecificRegion", + values: () => ({ Biomes: DB.EnumCase({ type: DB.Array(BiomeIdentifier(), { minItems: 1 }), }),