From 53d113ad0ac4573e1d48855d1bed6818cc6c1ca4 Mon Sep 17 00:00:00 2001 From: Lector Date: Tue, 2 Jun 2026 16:32:22 +0200 Subject: [PATCH 01/10] First Sketch of Plants --- src/types/_AlternativeNames.ts | 5 ++ src/types/_Identifier.ts | 4 + src/types/equipment/item/Plant.ts | 93 +++++++++++++++++++++++ src/types/equipment/item/sub/PlantType.ts | 31 ++++++++ src/types/index.ts | 2 + 5 files changed, 135 insertions(+) create mode 100644 src/types/equipment/item/Plant.ts create mode 100644 src/types/equipment/item/sub/PlantType.ts diff --git a/src/types/_AlternativeNames.ts b/src/types/_AlternativeNames.ts index 490da90f..eceda4ae 100644 --- a/src/types/_AlternativeNames.ts +++ b/src/types/_AlternativeNames.ts @@ -1,4 +1,5 @@ import * as DB from "tsondb/schema/dsl" +//import { Language } from "./specialAbility/sub/Language.js" export const AlternativeName = DB.TypeAlias(import.meta.url, { name: "AlternativeName", @@ -12,5 +13,9 @@ export const AlternativeName = DB.TypeAlias(import.meta.url, { comment: "The region where this alternative name is used.", type: DB.String({ minLength: 1 }), }), + //language: DB.Optional({ + // comment: "The language of that alternative name if any.", + // type: DB.IncludeIdentifier(Language), + //}), }), }) diff --git a/src/types/_Identifier.ts b/src/types/_Identifier.ts index 57c37090..9591bdd4 100644 --- a/src/types/_Identifier.ts +++ b/src/types/_Identifier.ts @@ -42,10 +42,12 @@ import { MagicalArtifact } from "./equipment/item/MagicalArtifact.js" import { MusicalInstrument } from "./equipment/item/MusicalInstrument.js" import { Newspaper } from "./equipment/item/Newspaper.js" import { OrienteeringAid } from "./equipment/item/OrienteeringAid.js" +import { Plant } from "./equipment/item/Plant.js" import { Poison } from "./equipment/item/Poison.js" import { RopeOrChain } from "./equipment/item/RopeOrChain.js" import { Stationery } from "./equipment/item/Stationery.js" import { ArmorType } from "./equipment/item/sub/ArmorType.js" +import { PlantType } from "./equipment/item/sub/PlantType.js" import { Reach } from "./equipment/item/sub/Reach.js" import { ThievesTool } from "./equipment/item/ThievesTool.js" import { ToolOfTheTrade } from "./equipment/item/ToolOfTheTrade.js" @@ -278,6 +280,8 @@ export const PactTypeIdentifier: () => R = () => R(PactType) export const PatronCategoryIdentifier: () => R = () => R(PatronCategory) export const PatronIdentifier: () => R = () => R(Patron) export const PersonalityTraitIdentifier: () => R = () => R(PersonalityTrait) +export const PlantIdentifier: () => R = () => R(Plant) +export const PlantTypeIdentifier: () => R = () => R(PlantType) export const PlayerTypeIdentifier: () => R = () => R(PlayerType) export const PoisonIdentifier: () => R = () => R(Poison) export const ProfessionIdentifier: () => R = () => R(Profession) diff --git a/src/types/equipment/item/Plant.ts b/src/types/equipment/item/Plant.ts new file mode 100644 index 00000000..75f10774 --- /dev/null +++ b/src/types/equipment/item/Plant.ts @@ -0,0 +1,93 @@ +import * as DB from "tsondb/schema/dsl" +import { NestedTranslationMap } from "../../Locale.js" +import { AlternativeName } from "../../_AlternativeNames.js" +import { PlantTypeIdentifier } from "../../_Identifier.js" + +export const Plant = DB.Entity(import.meta.url, { + name: "Plant", + namePlural: "Plants", + type: () => + DB.Object({ + types: DB.Required({ + comment: "The plant types this plant belongs to.", + type: DB.Array(PlantTypeIdentifier(), { minItems: 1, uniqueItems: true }), + }), + search_difficulty: DB.Required({ + comment: "The search difficulty for this plant.", + type: DB.Integer(), + }), + identification_difficulty: DB.Required({ + comment: "The identification difficulty for this plant.", + type: DB.Integer(), + }), + applications: DB.Required({ + comment: "The applications of this plant as array of 6 integers.", + type: DB.Array(DB.Integer(), { minItems: 6, maxItems: 6 }), + }), + price: DB.Required({ + comment: "The price of the plant.", + type: DB.IncludeIdentifier(PlantPrice), + }), + translations: NestedTranslationMap( + DB.Required, + "Plant", + DB.Object({ + name: DB.Required({ + comment: "The plant's name.", + type: DB.String({ minLength: 1 }), + }), + alternative_names: DB.Optional({ + comment: "A list of alternative names.", + 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.", + type: DB.String({ minLength: 1, markdown: "block" }), + }), + }), + ), + }), + instanceDisplayName: {}, + uniqueConstraints: [ + { + entityMapKeyPath: "translations", + keyPathInEntityMap: "name", + }, + ], +}) + +const PlantPrice = DB.Enum(import.meta.url, { + name: "PlantPrice", + values: () => ({ + Constant: DB.EnumCase({ + type: DB.Object({ + value: DB.Required({ + comment: "The value of the plant in silver coins.", + type: DB.Float({ minimum: 0 }), + }), + cost: DB.Required({ + comment: "The cost of the plant in silver coins.", + type: DB.Float({ minimum: 0 }), + }), + }), + }), + Indefinite: DB.EnumCase({ type: DB.IncludeIdentifier(IndefinitePlantPrice) }), + }), +}) + +export const IndefinitePlantPrice = DB.TypeAlias(import.meta.url, { + name: "IndefinitePlantPrice", + type: () => + DB.Object({ + translations: NestedTranslationMap( + DB.Required, + "IndefinitePlantPrice", + DB.Object({ + description: DB.Required({ + comment: "A description of the price.", + type: DB.String({ minLength: 1, markdown: "block" }), + }), + }), + ), + }), +}) diff --git a/src/types/equipment/item/sub/PlantType.ts b/src/types/equipment/item/sub/PlantType.ts new file mode 100644 index 00000000..2ae98f89 --- /dev/null +++ b/src/types/equipment/item/sub/PlantType.ts @@ -0,0 +1,31 @@ +import * as DB from "tsondb/schema/dsl" +import { NestedTranslationMap } from "../../../Locale.js" + +export const PlantType = DB.Entity(import.meta.url, { + name: "PlantType", + namePlural: "PlantTypes", + type: () => + DB.Object({ + translations: NestedTranslationMap( + DB.Required, + "PlantType", + DB.Object({ + name: DB.Required({ + comment: "The plant type�s name.", + type: DB.String({ minLength: 1 }), + }), + description: DB.Required({ + comment: "The plant type�s description.", + type: DB.String({ minLength: 1, markdown: "block" }), + }), + }), + ), + }), + instanceDisplayName: {}, + uniqueConstraints: [ + { + entityMapKeyPath: "translations", + keyPathInEntityMap: "name", + }, + ], +}) diff --git a/src/types/index.ts b/src/types/index.ts index c38ece4e..872b7a58 100644 --- a/src/types/index.ts +++ b/src/types/index.ts @@ -40,10 +40,12 @@ export { MagicalArtifact } from "./equipment/item/MagicalArtifact.js" export { MusicalInstrument } from "./equipment/item/MusicalInstrument.js" export { Newspaper } from "./equipment/item/Newspaper.js" export { OrienteeringAid } from "./equipment/item/OrienteeringAid.js" +export { Plant } from "./equipment/item/Plant.js" export { Poison } from "./equipment/item/Poison.js" export { RopeOrChain } from "./equipment/item/RopeOrChain.js" export { Stationery } from "./equipment/item/Stationery.js" export { ArmorType } from "./equipment/item/sub/ArmorType.js" +export { PlantType } from "./equipment/item/sub/PlantType.js" export { Reach } from "./equipment/item/sub/Reach.js" export { ThievesTool } from "./equipment/item/ThievesTool.js" export { ToolOfTheTrade } from "./equipment/item/ToolOfTheTrade.js" From bc412567dcdc2df34b6228ae7a8132d920ce90e2 Mon Sep 17 00:00:00 2001 From: Lector Date: Wed, 3 Jun 2026 01:49:32 +0200 Subject: [PATCH 02/10] Added Biome and Rarity for plants. First sketch for HerbalAid.ts AlternativeNames now has an optional language field. --- src/main.ts | 5 +++ src/types/_AlternativeNames.ts | 10 ++--- src/types/_Identifier.ts | 12 +++-- src/types/equipment/item/HerbalAid.ts | 50 +++++++++++++++++++++ src/types/equipment/item/Plant.ts | 47 +++++++++++++++++-- src/types/equipment/item/sub/Biome.ts | 27 +++++++++++ src/types/equipment/item/sub/PlantRarity.ts | 31 +++++++++++++ src/types/equipment/item/sub/PlantType.ts | 4 +- src/types/index.ts | 5 ++- 9 files changed, 177 insertions(+), 14 deletions(-) create mode 100644 src/types/equipment/item/HerbalAid.ts create mode 100644 src/types/equipment/item/sub/Biome.ts create mode 100644 src/types/equipment/item/sub/PlantRarity.ts diff --git a/src/main.ts b/src/main.ts index 6156ded2..7e47310e 100644 --- a/src/main.ts +++ b/src/main.ts @@ -47,6 +47,7 @@ export const schema = new Schema( Types.BandageOrRemedy, Types.Bannzeichen, Types.Beutelzauber, + Types.Biome, Types.BlessedTradition, Types.Blessing, Types.Book, @@ -97,6 +98,7 @@ export const schema = new Schema( Types.Guideline, Types.HairColor, Types.Haubenzauber, + Types.HerbalAid, Types.HomunculusType, Types.IlluminationLightSource, Types.IlluminationRefillOrSupply, @@ -133,6 +135,9 @@ export const schema = new Schema( Types.PatronCategory, Types.PersonalityTrait, Types.PlayerType, + Types.Plant, + Types.PlantRarity, + Types.PlantType, Types.Poison, Types.Profession, Types.Property, diff --git a/src/types/_AlternativeNames.ts b/src/types/_AlternativeNames.ts index eceda4ae..03c365e9 100644 --- a/src/types/_AlternativeNames.ts +++ b/src/types/_AlternativeNames.ts @@ -1,5 +1,5 @@ import * as DB from "tsondb/schema/dsl" -//import { Language } from "./specialAbility/sub/Language.js" +import { LanguageIdentifier } from "./_Identifier.js" export const AlternativeName = DB.TypeAlias(import.meta.url, { name: "AlternativeName", @@ -13,9 +13,9 @@ export const AlternativeName = DB.TypeAlias(import.meta.url, { comment: "The region where this alternative name is used.", type: DB.String({ minLength: 1 }), }), - //language: DB.Optional({ - // comment: "The language of that alternative name if any.", - // type: DB.IncludeIdentifier(Language), - //}), + language: DB.Optional({ + comment: "The language of that alternative name if any.", + type: LanguageIdentifier(), + }), }), }) diff --git a/src/types/_Identifier.ts b/src/types/_Identifier.ts index 9591bdd4..6ec17494 100644 --- a/src/types/_Identifier.ts +++ b/src/types/_Identifier.ts @@ -15,7 +15,7 @@ import { CloseCombatTechnique, RangedCombatTechnique } from "./CombatTechnique.j import { Condition } from "./Condition.js" import { Continent } from "./Continent.js" import { Culture } from "./Culture.js" -import { DerivedCharacteristic } from "./DerivedCharacteristic.ts" +import { DerivedCharacteristic } from "./DerivedCharacteristic.js" import { Disadvantage } from "./Disadvantage.js" import { Disease } from "./Disease.js" import { Element } from "./Element.js" @@ -32,6 +32,7 @@ import { Container } from "./equipment/item/Container.js" import { Elixir } from "./equipment/item/Elixir.js" import { EquipmentOfBlessedOnes } from "./equipment/item/EquipmentOfBlessedOnes.js" import { GemOrPreciousStone } from "./equipment/item/GemOrPreciousStone.js" +import { HerbalAid } from "./equipment/item/HerbalAid.js" import { IlluminationLightSource } from "./equipment/item/IlluminationLightSource.js" import { IlluminationRefillOrSupply } from "./equipment/item/IlluminationRefillOrSupply.js" import { Jewelry } from "./equipment/item/Jewelry.js" @@ -47,6 +48,8 @@ import { Poison } from "./equipment/item/Poison.js" import { RopeOrChain } from "./equipment/item/RopeOrChain.js" import { Stationery } from "./equipment/item/Stationery.js" import { ArmorType } from "./equipment/item/sub/ArmorType.js" +import { Biome } from "./equipment/item/sub/Biome.js" +import { PlantRarity } from "./equipment/item/sub/PlantRarity.js" import { PlantType } from "./equipment/item/sub/PlantType.js" import { Reach } from "./equipment/item/sub/Reach.js" import { ThievesTool } from "./equipment/item/ThievesTool.js" @@ -55,11 +58,11 @@ import { TravelGearOrTool } from "./equipment/item/TravelGearOrTool.js" import { Vehicle } from "./equipment/item/Vehicle.js" import { Weapon } from "./equipment/item/Weapon.js" import { WeaponAccessory } from "./equipment/item/WeaponAccessory.js" -import { WorkingSupernaturalCreature } from "./equipment/item/WorkingSupernaturalCreature.ts" +import { WorkingSupernaturalCreature } from "./equipment/item/WorkingSupernaturalCreature.js" import { ExperienceLevel } from "./ExperienceLevel.js" import { EyeColor } from "./EyeColor.js" import { HairColor } from "./HairColor.js" -import { Influence } from "./Influence.ts" +import { Influence } from "./Influence.js" import { Curriculum, Guideline, LessonPackage } from "./Lessons.js" import { LiturgicalChant } from "./LiturgicalChant.js" import { AnimistPower } from "./magicalActions/AnimistPower.js" @@ -189,6 +192,7 @@ export const AttributeIdentifier: () => R = () => R(Attribute) export const BandageOrRemedyIdentifier: () => R = () => R(BandageOrRemedy) export const BannzeichenIdentifier: () => R = () => R(Bannzeichen) export const BeutelzauberIdentifier: () => R = () => R(Beutelzauber) +export const BiomeIdentifier: () => R = () => R(Biome) export const BlessedTraditionIdentifier: () => R = () => R(BlessedTradition) export const BlessingIdentifier: () => R = () => R(Blessing) export const BookIdentifier: () => R = () => R(Book) @@ -240,6 +244,7 @@ export const GoblinRitualIdentifier: () => R = () => R(GoblinRitual) export const GuidelineIdentifier: () => R = () => R(Guideline) export const HairColorIdentifier: () => R = () => R(HairColor) export const HaubenzauberIdentifier: () => R = () => R(Haubenzauber) +export const HerbalAidIdentifier: () => R = () => R(HerbalAid) export const IlluminationLightSourceIdentifier: () => R = () => R(IlluminationLightSource) export const IlluminationRefillOrSupplyIdentifier: () => R = () => R(IlluminationRefillOrSupply) export const InfluenceIdentifier: () => R = () => R(Influence) @@ -281,6 +286,7 @@ export const PatronCategoryIdentifier: () => R = () => R(PatronCategory) export const PatronIdentifier: () => R = () => R(Patron) export const PersonalityTraitIdentifier: () => R = () => R(PersonalityTrait) export const PlantIdentifier: () => R = () => R(Plant) +export const PlantRarityIdentifier: () => R = () => R(PlantRarity) export const PlantTypeIdentifier: () => R = () => R(PlantType) export const PlayerTypeIdentifier: () => R = () => R(PlayerType) export const PoisonIdentifier: () => R = () => R(Poison) diff --git a/src/types/equipment/item/HerbalAid.ts b/src/types/equipment/item/HerbalAid.ts new file mode 100644 index 00000000..50895c64 --- /dev/null +++ b/src/types/equipment/item/HerbalAid.ts @@ -0,0 +1,50 @@ +import * as DB from "tsondb/schema/dsl" +import { src } from "../../source/_PublicationRef.js" +import { NestedTranslationMap } from "../../Locale.js" +import { PlantTypeIdentifier } from "../../_Identifier.js" + +export const HerbalAid = DB.Entity(import.meta.url, { + name: "HerbalAid", + namePlural: "HerbalAids", + type: () => + DB.Object({ + types: DB.Required({ + comment: "The plant types this plant belongs to.", + type: DB.Array(PlantTypeIdentifier(), { minItems: 1, uniqueItems: true }), + }), + crafting_difficulty: DB.Required({ + comment: "The difficulty for this aid to craft.", + type: DB.Integer(), + }), + src, + translations: NestedTranslationMap( + DB.Required, + "HerbalAid", + DB.Object({ + name: DB.Required({ + comment: "The herbal aid's name.", + type: DB.String({ minLength: 1 }), + }), + description: DB.Required({ + comment: "The herbal aid's description.", + type: DB.String({ minLength: 1, markdown: "block" }), + }), + ingredients: DB.Required({ + comment: "The ingredients used to craft this herbal aid.", + type: DB.String({ minLength: 1, markdown: "inline" }), + }), + typical_tools: DB.Optional({ + comment: "The typical tools used to craft this.", + type: DB.String({ minLength: 1, markdown: "inline" }), + }), + }), + ), + }), + instanceDisplayName: {}, + uniqueConstraints: [ + { + entityMapKeyPath: "translations", + keyPathInEntityMap: "name", + }, + ], +}) diff --git a/src/types/equipment/item/Plant.ts b/src/types/equipment/item/Plant.ts index 75f10774..f4252c83 100644 --- a/src/types/equipment/item/Plant.ts +++ b/src/types/equipment/item/Plant.ts @@ -1,7 +1,8 @@ import * as DB from "tsondb/schema/dsl" +import { src } from "../../source/_PublicationRef.js" import { NestedTranslationMap } from "../../Locale.js" import { AlternativeName } from "../../_AlternativeNames.js" -import { PlantTypeIdentifier } from "../../_Identifier.js" +import { BiomeIdentifier, PlantRarityIdentifier, PlantTypeIdentifier } from "../../_Identifier.js" export const Plant = DB.Entity(import.meta.url, { name: "Plant", @@ -12,6 +13,10 @@ export const Plant = DB.Entity(import.meta.url, { comment: "The plant types this plant belongs to.", type: DB.Array(PlantTypeIdentifier(), { minItems: 1, uniqueItems: true }), }), + occurences: DB.Optional({ + comment: "The biomes this plant occurs in and its rarity in those biomes.", + type: DB.Array(DB.IncludeIdentifier(PlantOccurrence), { minItems: 1 }), + }), search_difficulty: DB.Required({ comment: "The search difficulty for this plant.", type: DB.Integer(), @@ -21,13 +26,14 @@ export const Plant = DB.Entity(import.meta.url, { type: DB.Integer(), }), applications: DB.Required({ - comment: "The applications of this plant as array of 6 integers.", + comment: "The applications of this plant per quality level.", type: DB.Array(DB.Integer(), { minItems: 6, maxItems: 6 }), }), price: DB.Required({ comment: "The price of the plant.", type: DB.IncludeIdentifier(PlantPrice), }), + src, translations: NestedTranslationMap( DB.Required, "Plant", @@ -40,10 +46,30 @@ export const Plant = DB.Entity(import.meta.url, { comment: "A list of alternative names.", type: DB.Array(DB.IncludeIdentifier(AlternativeName), { minItems: 1 }), }), + touch: DB.Optional({ + comment: "The plant's touch effect.", + type: DB.String({ minLength: 1, markdown: "block" }), + }), + breathe: DB.Optional({ + comment: "The plant's breathe effect.", + type: DB.String({ minLength: 1, markdown: "block" }), + }), + consume: DB.Optional({ + comment: "The plant's consume effect.", + type: DB.String({ minLength: 1, markdown: "block" }), + }), remedies_and_traditions: DB.Required({ comment: "How this plant is used as a household remedy and in folk traditions.", type: DB.String({ minLength: 1, markdown: "block" }), }), + knowledge: DB.Required({ + 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.", + type: DB.Array(DB.String({ minLength: 1, markdown: "block" }), { + minItems: 3, + maxItems: 6, + }), + }), }), ), }), @@ -56,6 +82,21 @@ export const Plant = DB.Entity(import.meta.url, { ], }) +const PlantOccurrence = DB.TypeAlias(import.meta.url, { + name: "PlantOccurrence", + type: () => + DB.Object({ + biome: DB.Required({ + comment: "The biome this plant occurs in.", + type: BiomeIdentifier(), + }), + rarity: DB.Required({ + comment: "The rarity of this plant in the biome.", + type: PlantRarityIdentifier(), + }), + }), +}) + const PlantPrice = DB.Enum(import.meta.url, { name: "PlantPrice", values: () => ({ @@ -75,7 +116,7 @@ const PlantPrice = DB.Enum(import.meta.url, { }), }) -export const IndefinitePlantPrice = DB.TypeAlias(import.meta.url, { +const IndefinitePlantPrice = DB.TypeAlias(import.meta.url, { name: "IndefinitePlantPrice", type: () => DB.Object({ diff --git a/src/types/equipment/item/sub/Biome.ts b/src/types/equipment/item/sub/Biome.ts new file mode 100644 index 00000000..23b228af --- /dev/null +++ b/src/types/equipment/item/sub/Biome.ts @@ -0,0 +1,27 @@ +import * as DB from "tsondb/schema/dsl" +import { NestedTranslationMap } from "../../../Locale.js" + +export const Biome = DB.Entity(import.meta.url, { + name: "Biome", + namePlural: "Biome", + type: () => + DB.Object({ + translations: NestedTranslationMap( + DB.Required, + "Biome", + DB.Object({ + name: DB.Required({ + comment: "The biome's name.", + type: DB.String({ minLength: 1 }), + }), + }), + ), + }), + instanceDisplayName: {}, + uniqueConstraints: [ + { + entityMapKeyPath: "translations", + keyPathInEntityMap: "name", + }, + ], +}) diff --git a/src/types/equipment/item/sub/PlantRarity.ts b/src/types/equipment/item/sub/PlantRarity.ts new file mode 100644 index 00000000..208b7e00 --- /dev/null +++ b/src/types/equipment/item/sub/PlantRarity.ts @@ -0,0 +1,31 @@ +import * as DB from "tsondb/schema/dsl" +import { NestedTranslationMap } from "../../../Locale.js" + +export const PlantRarity = DB.Entity(import.meta.url, { + name: "PlantRarity", + namePlural: "PlantRarity", + type: () => + DB.Object({ + translations: NestedTranslationMap( + DB.Required, + "PlantRarity", + DB.Object({ + name: DB.Required({ + comment: "The plant rarity's name.", + type: DB.String({ minLength: 1 }), + }), + description: DB.Required({ + comment: "The plant rarity's description.", + type: DB.String({ minLength: 1, markdown: "block" }), + }), + }), + ), + }), + instanceDisplayName: {}, + uniqueConstraints: [ + { + entityMapKeyPath: "translations", + keyPathInEntityMap: "name", + }, + ], +}) diff --git a/src/types/equipment/item/sub/PlantType.ts b/src/types/equipment/item/sub/PlantType.ts index 2ae98f89..38b2f43e 100644 --- a/src/types/equipment/item/sub/PlantType.ts +++ b/src/types/equipment/item/sub/PlantType.ts @@ -11,11 +11,11 @@ export const PlantType = DB.Entity(import.meta.url, { "PlantType", DB.Object({ name: DB.Required({ - comment: "The plant type�s name.", + comment: "The plant type's name.", type: DB.String({ minLength: 1 }), }), description: DB.Required({ - comment: "The plant type�s description.", + comment: "The plant type's description.", type: DB.String({ minLength: 1, markdown: "block" }), }), }), diff --git a/src/types/index.ts b/src/types/index.ts index 872b7a58..6e00587e 100644 --- a/src/types/index.ts +++ b/src/types/index.ts @@ -30,6 +30,7 @@ export { Container } from "./equipment/item/Container.js" export { Elixir } from "./equipment/item/Elixir.js" export { EquipmentOfBlessedOnes } from "./equipment/item/EquipmentOfBlessedOnes.js" export { GemOrPreciousStone } from "./equipment/item/GemOrPreciousStone.js" +export { HerbalAid } from "./equipment/item/HerbalAid.js" export { IlluminationLightSource } from "./equipment/item/IlluminationLightSource.js" export { IlluminationRefillOrSupply } from "./equipment/item/IlluminationRefillOrSupply.js" export { Jewelry } from "./equipment/item/Jewelry.js" @@ -45,6 +46,8 @@ export { Poison } from "./equipment/item/Poison.js" export { RopeOrChain } from "./equipment/item/RopeOrChain.js" export { Stationery } from "./equipment/item/Stationery.js" export { ArmorType } from "./equipment/item/sub/ArmorType.js" +export { Biome } from "./equipment/item/sub/Biome.js" +export { PlantRarity } from "./equipment/item/sub/PlantRarity.js" export { PlantType } from "./equipment/item/sub/PlantType.js" export { Reach } from "./equipment/item/sub/Reach.js" export { ThievesTool } from "./equipment/item/ThievesTool.js" @@ -53,7 +56,7 @@ export { TravelGearOrTool } from "./equipment/item/TravelGearOrTool.js" export { Vehicle } from "./equipment/item/Vehicle.js" export { Weapon } from "./equipment/item/Weapon.js" export { WeaponAccessory } from "./equipment/item/WeaponAccessory.js" -export { WorkingSupernaturalCreature } from "./equipment/item/WorkingSupernaturalCreature.ts" +export { WorkingSupernaturalCreature } from "./equipment/item/WorkingSupernaturalCreature.js" export { ExperienceLevel } from "./ExperienceLevel.js" export { EyeColor } from "./EyeColor.js" export { FamiliarsTrick } from "./FamiliarsTrick.js" From d8680b8a7fa98ed6a23112546f59a2f8f2cb62e6 Mon Sep 17 00:00:00 2001 From: Lector Date: Wed, 3 Jun 2026 12:44:05 +0200 Subject: [PATCH 03/10] Added Combat uses to HerbalAid.ts Added Recipes to Plant.ts --- src/types/equipment/item/HerbalAid.ts | 16 +++- src/types/equipment/item/Plant.ts | 113 +++++++++++++++++++++++++- 2 files changed, 126 insertions(+), 3 deletions(-) diff --git a/src/types/equipment/item/HerbalAid.ts b/src/types/equipment/item/HerbalAid.ts index 50895c64..e4bb0ef5 100644 --- a/src/types/equipment/item/HerbalAid.ts +++ b/src/types/equipment/item/HerbalAid.ts @@ -1,7 +1,7 @@ import * as DB from "tsondb/schema/dsl" import { src } from "../../source/_PublicationRef.js" import { NestedTranslationMap } from "../../Locale.js" -import { PlantTypeIdentifier } from "../../_Identifier.js" +import { PlantTypeIdentifier, WeaponIdentifier, ArmorIdentifier } from "../../_Identifier.js" export const HerbalAid = DB.Entity(import.meta.url, { name: "HerbalAid", @@ -9,13 +9,17 @@ export const HerbalAid = DB.Entity(import.meta.url, { type: () => DB.Object({ types: DB.Required({ - comment: "The plant types this plant belongs to.", + comment: "The plant types this aid belongs to.", type: DB.Array(PlantTypeIdentifier(), { minItems: 1, uniqueItems: true }), }), crafting_difficulty: DB.Required({ comment: "The difficulty for this aid to craft.", type: DB.Integer(), }), + combatUse: DB.Optional({ + comment: "The armor or weapon this herbal aid represents.", + type: DB.IncludeIdentifier(HerbalAidCombatUse), + }), src, translations: NestedTranslationMap( DB.Required, @@ -48,3 +52,11 @@ export const HerbalAid = DB.Entity(import.meta.url, { }, ], }) + +const HerbalAidCombatUse = DB.Enum(import.meta.url, { + name: "HerbalAidCombatUse", + values: () => ({ + Weapon: DB.EnumCase({ type: WeaponIdentifier() }), + Armor: DB.EnumCase({ type: ArmorIdentifier() }), + }), +}) diff --git a/src/types/equipment/item/Plant.ts b/src/types/equipment/item/Plant.ts index f4252c83..552287e8 100644 --- a/src/types/equipment/item/Plant.ts +++ b/src/types/equipment/item/Plant.ts @@ -2,7 +2,15 @@ import * as DB from "tsondb/schema/dsl" import { src } from "../../source/_PublicationRef.js" import { NestedTranslationMap } from "../../Locale.js" import { AlternativeName } from "../../_AlternativeNames.js" -import { BiomeIdentifier, PlantRarityIdentifier, PlantTypeIdentifier } from "../../_Identifier.js" +import { + BiomeIdentifier, + PlantRarityIdentifier, + PlantTypeIdentifier, + HerbalAidIdentifier, + ElixirIdentifier, + PoisonIdentifier, +} from "../../_Identifier.js" +import { ResponsiveTextOptional, ResponsiveTextReplace } from "../../_ResponsiveText.js" export const Plant = DB.Entity(import.meta.url, { name: "Plant", @@ -33,6 +41,10 @@ export const Plant = DB.Entity(import.meta.url, { comment: "The price of the plant.", type: DB.IncludeIdentifier(PlantPrice), }), + recipes: DB.Optional({ + comment: "The herbal aids and elixirs that can be crafted with this plant.", + type: DB.Array(DB.IncludeIdentifier(PlantRecipe), { minItems: 1 }), + }), src, translations: NestedTranslationMap( DB.Required, @@ -132,3 +144,102 @@ const IndefinitePlantPrice = DB.TypeAlias(import.meta.url, { ), }), }) + +const PlantRecipe = DB.Enum(import.meta.url, { + name: "PlantRecipe", + values: () => ({ + HerbalAid: DB.EnumCase({ + type: DB.IncludeIdentifier(HerbalAidRecipe), + }), + Elixir: DB.EnumCase({ + type: DB.IncludeIdentifier(ElixirRecipe), + }), + PoisonIdentifier: DB.EnumCase({ + type: DB.IncludeIdentifier(PoisonRecipe), + }), + Indefinite: DB.EnumCase({ + type: DB.IncludeIdentifier(IndefiniteRecipe), + }), + }), +}) + +const PlantProductTranslation = DB.Object( + { + note: DB.Optional({ + 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.", + type: DB.IncludeIdentifier(ResponsiveTextOptional), + }), + replacement: DB.Optional({ + comment: + "A replacement string. If `note` is provided, it is appended to the replaced string.", + type: DB.IncludeIdentifier(ResponsiveTextReplace), + }), + }, + { minProperties: 1 }, +) + +const HerbalAidRecipe = DB.TypeAlias(import.meta.url, { + name: "HerbalAidRecipe", + type: () => + DB.Object({ + herbal_aid: DB.Required({ + comment: "The herbal aid this recipe results in.", + type: HerbalAidIdentifier(), + }), + translation: NestedTranslationMap( + DB.Optional, + "HerbalAidRecipeTranslation", + PlantProductTranslation, + ), + }), +}) + +const ElixirRecipe = DB.TypeAlias(import.meta.url, { + name: "ElixirRecipe", + type: () => + DB.Object({ + elixir: DB.Required({ + comment: "The elixir this recipe results in.", + type: ElixirIdentifier(), + }), + translation: NestedTranslationMap( + DB.Optional, + "ElixirRecipeTranslation", + PlantProductTranslation, + ), + }), +}) + +const PoisonRecipe = DB.TypeAlias(import.meta.url, { + name: "PoisonRecipe", + type: () => + DB.Object({ + poison: DB.Required({ + comment: "The poison this recipe results in.", + type: PoisonIdentifier(), + }), + translation: NestedTranslationMap( + DB.Optional, + "PoisonRecipeTranslation", + PlantProductTranslation, + ), + }), +}) + +const IndefiniteRecipe = DB.TypeAlias(import.meta.url, { + name: "IndefiniteRecipe", + type: () => + DB.Object({ + translations: NestedTranslationMap( + DB.Required, + "IndefiniteRecipe", + DB.Object({ + description: DB.Required({ + comment: "A description of the recipe.", + type: DB.String({ minLength: 1, markdown: "inline" }), + }), + }), + ), + }), +}) From 5b32bc57110d8852778153bf213584035413c643 Mon Sep 17 00:00:00 2001 From: Lector Date: Wed, 3 Jun 2026 13:27:59 +0200 Subject: [PATCH 04/10] Replaced some Entities with simpler enums --- src/main.ts | 2 -- src/types/_Identifier.ts | 4 --- src/types/equipment/item/HerbalAid.ts | 5 ++-- src/types/equipment/item/Plant.ts | 9 +++--- src/types/equipment/item/_Herbary.ts | 12 ++++++++ src/types/equipment/item/sub/PlantRarity.ts | 31 --------------------- src/types/equipment/item/sub/PlantType.ts | 31 --------------------- src/types/index.ts | 2 -- 8 files changed, 19 insertions(+), 77 deletions(-) delete mode 100644 src/types/equipment/item/sub/PlantRarity.ts delete mode 100644 src/types/equipment/item/sub/PlantType.ts diff --git a/src/main.ts b/src/main.ts index 7e47310e..dc7c9e53 100644 --- a/src/main.ts +++ b/src/main.ts @@ -136,8 +136,6 @@ export const schema = new Schema( Types.PersonalityTrait, Types.PlayerType, Types.Plant, - Types.PlantRarity, - Types.PlantType, Types.Poison, Types.Profession, Types.Property, diff --git a/src/types/_Identifier.ts b/src/types/_Identifier.ts index 6ec17494..db15652d 100644 --- a/src/types/_Identifier.ts +++ b/src/types/_Identifier.ts @@ -49,8 +49,6 @@ import { RopeOrChain } from "./equipment/item/RopeOrChain.js" import { Stationery } from "./equipment/item/Stationery.js" import { ArmorType } from "./equipment/item/sub/ArmorType.js" import { Biome } from "./equipment/item/sub/Biome.js" -import { PlantRarity } from "./equipment/item/sub/PlantRarity.js" -import { PlantType } from "./equipment/item/sub/PlantType.js" import { Reach } from "./equipment/item/sub/Reach.js" import { ThievesTool } from "./equipment/item/ThievesTool.js" import { ToolOfTheTrade } from "./equipment/item/ToolOfTheTrade.js" @@ -286,8 +284,6 @@ export const PatronCategoryIdentifier: () => R = () => R(PatronCategory) export const PatronIdentifier: () => R = () => R(Patron) export const PersonalityTraitIdentifier: () => R = () => R(PersonalityTrait) export const PlantIdentifier: () => R = () => R(Plant) -export const PlantRarityIdentifier: () => R = () => R(PlantRarity) -export const PlantTypeIdentifier: () => R = () => R(PlantType) export const PlayerTypeIdentifier: () => R = () => R(PlayerType) export const PoisonIdentifier: () => R = () => R(Poison) export const ProfessionIdentifier: () => R = () => R(Profession) diff --git a/src/types/equipment/item/HerbalAid.ts b/src/types/equipment/item/HerbalAid.ts index e4bb0ef5..bf9665c5 100644 --- a/src/types/equipment/item/HerbalAid.ts +++ b/src/types/equipment/item/HerbalAid.ts @@ -1,7 +1,8 @@ import * as DB from "tsondb/schema/dsl" import { src } from "../../source/_PublicationRef.js" import { NestedTranslationMap } from "../../Locale.js" -import { PlantTypeIdentifier, WeaponIdentifier, ArmorIdentifier } from "../../_Identifier.js" +import { WeaponIdentifier, ArmorIdentifier } from "../../_Identifier.js" +import { EffectType } from "./_Herbary.js" export const HerbalAid = DB.Entity(import.meta.url, { name: "HerbalAid", @@ -10,7 +11,7 @@ export const HerbalAid = DB.Entity(import.meta.url, { DB.Object({ types: DB.Required({ comment: "The plant types this aid belongs to.", - type: DB.Array(PlantTypeIdentifier(), { minItems: 1, uniqueItems: true }), + type: DB.Array(DB.IncludeIdentifier(EffectType), { minItems: 1, uniqueItems: true }), }), crafting_difficulty: DB.Required({ comment: "The difficulty for this aid to craft.", diff --git a/src/types/equipment/item/Plant.ts b/src/types/equipment/item/Plant.ts index 552287e8..655570fe 100644 --- a/src/types/equipment/item/Plant.ts +++ b/src/types/equipment/item/Plant.ts @@ -4,13 +4,12 @@ import { NestedTranslationMap } from "../../Locale.js" import { AlternativeName } from "../../_AlternativeNames.js" import { BiomeIdentifier, - PlantRarityIdentifier, - PlantTypeIdentifier, HerbalAidIdentifier, ElixirIdentifier, PoisonIdentifier, } from "../../_Identifier.js" import { ResponsiveTextOptional, ResponsiveTextReplace } from "../../_ResponsiveText.js" +import { EffectType, PlantRarity } from "./_Herbary.js" export const Plant = DB.Entity(import.meta.url, { name: "Plant", @@ -18,8 +17,8 @@ export const Plant = DB.Entity(import.meta.url, { type: () => DB.Object({ types: DB.Required({ - comment: "The plant types this plant belongs to.", - type: DB.Array(PlantTypeIdentifier(), { minItems: 1, uniqueItems: true }), + comment: "The plant types of this plant.", + type: DB.Array(DB.IncludeIdentifier(EffectType), { minItems: 1, uniqueItems: true }), }), occurences: DB.Optional({ comment: "The biomes this plant occurs in and its rarity in those biomes.", @@ -104,7 +103,7 @@ const PlantOccurrence = DB.TypeAlias(import.meta.url, { }), rarity: DB.Required({ comment: "The rarity of this plant in the biome.", - type: PlantRarityIdentifier(), + type: DB.IncludeIdentifier(PlantRarity), }), }), }) diff --git a/src/types/equipment/item/_Herbary.ts b/src/types/equipment/item/_Herbary.ts index 610574a6..d4b38f6c 100644 --- a/src/types/equipment/item/_Herbary.ts +++ b/src/types/equipment/item/_Herbary.ts @@ -19,6 +19,18 @@ export const EffectType = DB.Enum(import.meta.url, { }), }) +export const PlantRarity = DB.Enum(import.meta.url, { + name: "PlantRarity", + comment: "The rarity of a plant in a biome.", + values: () => ({ + Common: DB.EnumCase({ type: null }), + Occasional: DB.EnumCase({ type: null }), + RatherRare: DB.EnumCase({ type: null }), + Rare: DB.EnumCase({ type: null }), + VeryRare: DB.EnumCase({ type: null }), + }), +}) + export const LaboratoryLevel = DB.Enum(import.meta.url, { name: "LaboratoryLevel", values: () => ({ diff --git a/src/types/equipment/item/sub/PlantRarity.ts b/src/types/equipment/item/sub/PlantRarity.ts deleted file mode 100644 index 208b7e00..00000000 --- a/src/types/equipment/item/sub/PlantRarity.ts +++ /dev/null @@ -1,31 +0,0 @@ -import * as DB from "tsondb/schema/dsl" -import { NestedTranslationMap } from "../../../Locale.js" - -export const PlantRarity = DB.Entity(import.meta.url, { - name: "PlantRarity", - namePlural: "PlantRarity", - type: () => - DB.Object({ - translations: NestedTranslationMap( - DB.Required, - "PlantRarity", - DB.Object({ - name: DB.Required({ - comment: "The plant rarity's name.", - type: DB.String({ minLength: 1 }), - }), - description: DB.Required({ - comment: "The plant rarity's description.", - type: DB.String({ minLength: 1, markdown: "block" }), - }), - }), - ), - }), - instanceDisplayName: {}, - uniqueConstraints: [ - { - entityMapKeyPath: "translations", - keyPathInEntityMap: "name", - }, - ], -}) diff --git a/src/types/equipment/item/sub/PlantType.ts b/src/types/equipment/item/sub/PlantType.ts deleted file mode 100644 index 38b2f43e..00000000 --- a/src/types/equipment/item/sub/PlantType.ts +++ /dev/null @@ -1,31 +0,0 @@ -import * as DB from "tsondb/schema/dsl" -import { NestedTranslationMap } from "../../../Locale.js" - -export const PlantType = DB.Entity(import.meta.url, { - name: "PlantType", - namePlural: "PlantTypes", - type: () => - DB.Object({ - translations: NestedTranslationMap( - DB.Required, - "PlantType", - DB.Object({ - name: DB.Required({ - comment: "The plant type's name.", - type: DB.String({ minLength: 1 }), - }), - description: DB.Required({ - comment: "The plant type's description.", - type: DB.String({ minLength: 1, markdown: "block" }), - }), - }), - ), - }), - instanceDisplayName: {}, - uniqueConstraints: [ - { - entityMapKeyPath: "translations", - keyPathInEntityMap: "name", - }, - ], -}) diff --git a/src/types/index.ts b/src/types/index.ts index 6e00587e..1e735191 100644 --- a/src/types/index.ts +++ b/src/types/index.ts @@ -47,8 +47,6 @@ export { RopeOrChain } from "./equipment/item/RopeOrChain.js" export { Stationery } from "./equipment/item/Stationery.js" export { ArmorType } from "./equipment/item/sub/ArmorType.js" export { Biome } from "./equipment/item/sub/Biome.js" -export { PlantRarity } from "./equipment/item/sub/PlantRarity.js" -export { PlantType } from "./equipment/item/sub/PlantType.js" export { Reach } from "./equipment/item/sub/Reach.js" export { ThievesTool } from "./equipment/item/ThievesTool.js" export { ToolOfTheTrade } from "./equipment/item/ToolOfTheTrade.js" From 54ba25eff41a90dcf837f8bad4300905cbf73579 Mon Sep 17 00:00:00 2001 From: Lector Date: Wed, 3 Jun 2026 15:07:12 +0200 Subject: [PATCH 05/10] Occurences in Plant.ts can now have translations --- src/types/equipment/item/Plant.ts | 38 ++++++++++++++++++++++++++++--- 1 file changed, 35 insertions(+), 3 deletions(-) diff --git a/src/types/equipment/item/Plant.ts b/src/types/equipment/item/Plant.ts index 655570fe..ebc32e23 100644 --- a/src/types/equipment/item/Plant.ts +++ b/src/types/equipment/item/Plant.ts @@ -17,12 +17,12 @@ export const Plant = DB.Entity(import.meta.url, { type: () => DB.Object({ types: DB.Required({ - comment: "The plant types of this plant.", - type: DB.Array(DB.IncludeIdentifier(EffectType), { minItems: 1, uniqueItems: true }), + comment: "The plant types of this plant.", + type: DB.Array(DB.IncludeIdentifier(EffectType), { minItems: 1, uniqueItems: true }), }), occurences: DB.Optional({ comment: "The biomes this plant occurs in and its rarity in those biomes.", - type: DB.Array(DB.IncludeIdentifier(PlantOccurrence), { minItems: 1 }), + type: DB.IncludeIdentifier(PlantOccurences), }), search_difficulty: DB.Required({ comment: "The search difficulty for this plant.", @@ -93,6 +93,27 @@ export const Plant = DB.Entity(import.meta.url, { ], }) +const PlantOccurences = DB.TypeAlias(import.meta.url, { + name: "PlantOccurences", + type: () => + 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 }), + }), + 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" }), + }), + }), + ), + }), +}) + const PlantOccurrence = DB.TypeAlias(import.meta.url, { name: "PlantOccurrence", type: () => @@ -105,6 +126,17 @@ const PlantOccurrence = DB.TypeAlias(import.meta.url, { comment: "The rarity of this plant in the biome.", type: DB.IncludeIdentifier(PlantRarity), }), + translation: NestedTranslationMap( + DB.Optional, + "PlantOccurrence", + DB.Object({ + note: DB.Required({ + 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.", + type: DB.String({ minLength: 1, markdown: "inline" }), + }), + }), + ), }), }) From ab87ca8ee9f58cc66335ca1ccdbf2038b5bbc48c Mon Sep 17 00:00:00 2001 From: Lector Date: Wed, 3 Jun 2026 15:25:22 +0200 Subject: [PATCH 06/10] Prettier --- src/types/equipment/item/_Herbary.ts | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/src/types/equipment/item/_Herbary.ts b/src/types/equipment/item/_Herbary.ts index d4b38f6c..3bfbec6b 100644 --- a/src/types/equipment/item/_Herbary.ts +++ b/src/types/equipment/item/_Herbary.ts @@ -20,15 +20,15 @@ export const EffectType = DB.Enum(import.meta.url, { }) export const PlantRarity = DB.Enum(import.meta.url, { - name: "PlantRarity", - comment: "The rarity of a plant in a biome.", - values: () => ({ - Common: DB.EnumCase({ type: null }), - Occasional: DB.EnumCase({ type: null }), - RatherRare: DB.EnumCase({ type: null }), - Rare: DB.EnumCase({ type: null }), - VeryRare: DB.EnumCase({ type: null }), - }), + name: "PlantRarity", + comment: "The rarity of a plant in a biome.", + values: () => ({ + Common: DB.EnumCase({ type: null }), + Occasional: DB.EnumCase({ type: null }), + RatherRare: DB.EnumCase({ type: null }), + Rare: DB.EnumCase({ type: null }), + VeryRare: DB.EnumCase({ type: null }), + }), }) export const LaboratoryLevel = DB.Enum(import.meta.url, { From 61cdc969c2205d775993e3927d79def738710ce6 Mon Sep 17 00:00:00 2001 From: Lector Date: Wed, 3 Jun 2026 15:47:22 +0200 Subject: [PATCH 07/10] Added EffectTypes to consumptions of Plant.ts --- src/types/equipment/item/Plant.ts | 45 ++++++++++++++++++++++--------- 1 file changed, 33 insertions(+), 12 deletions(-) diff --git a/src/types/equipment/item/Plant.ts b/src/types/equipment/item/Plant.ts index ebc32e23..1139505e 100644 --- a/src/types/equipment/item/Plant.ts +++ b/src/types/equipment/item/Plant.ts @@ -36,6 +36,18 @@ export const Plant = DB.Entity(import.meta.url, { comment: "The applications of this plant per quality level.", type: DB.Array(DB.Integer(), { minItems: 6, maxItems: 6 }), }), + touch: DB.Optional({ + comment: "The plant's touch effect.", + type: DB.IncludeIdentifier(PlantEffect), + }), + breathe: DB.Optional({ + comment: "The plant's breathe effect.", + type: DB.IncludeIdentifier(PlantEffect), + }), + consume: DB.Optional({ + comment: "The plant's consume effect.", + type: DB.IncludeIdentifier(PlantEffect), + }), price: DB.Required({ comment: "The price of the plant.", type: DB.IncludeIdentifier(PlantPrice), @@ -57,18 +69,6 @@ export const Plant = DB.Entity(import.meta.url, { comment: "A list of alternative names.", type: DB.Array(DB.IncludeIdentifier(AlternativeName), { minItems: 1 }), }), - touch: DB.Optional({ - comment: "The plant's touch effect.", - type: DB.String({ minLength: 1, markdown: "block" }), - }), - breathe: DB.Optional({ - comment: "The plant's breathe effect.", - type: DB.String({ minLength: 1, markdown: "block" }), - }), - consume: DB.Optional({ - comment: "The plant's consume effect.", - type: DB.String({ minLength: 1, markdown: "block" }), - }), remedies_and_traditions: DB.Required({ comment: "How this plant is used as a household remedy and in folk traditions.", type: DB.String({ minLength: 1, markdown: "block" }), @@ -140,6 +140,27 @@ const PlantOccurrence = DB.TypeAlias(import.meta.url, { }), }) +const PlantEffect = DB.TypeAlias(import.meta.url, { + name: "PlantEffect", + type: () => + DB.Object({ + types: DB.Optional({ + comment: "The effect type of this plant effect.", + type: DB.Array(DB.IncludeIdentifier(EffectType), { minItems: 1, uniqueItems: true }), + }), + translations: NestedTranslationMap( + DB.Required, + "PlantEffectTranslation", + DB.Object({ + description: DB.Required({ + comment: "The effect of the plant.", + type: DB.String({ minLength: 1, markdown: "block" }), + }), + }), + ), + }), +}) + const PlantPrice = DB.Enum(import.meta.url, { name: "PlantPrice", values: () => ({ From 83686a483707d722c36e358523fbf548003e8da4 Mon Sep 17 00:00:00 2001 From: Lector Date: Wed, 3 Jun 2026 16:30:09 +0200 Subject: [PATCH 08/10] Corrected Feedback --- src/types/equipment/item/HerbalAid.ts | 4 ++-- src/types/equipment/item/Plant.ts | 33 ++++++++------------------- 2 files changed, 12 insertions(+), 25 deletions(-) diff --git a/src/types/equipment/item/HerbalAid.ts b/src/types/equipment/item/HerbalAid.ts index bf9665c5..791089b3 100644 --- a/src/types/equipment/item/HerbalAid.ts +++ b/src/types/equipment/item/HerbalAid.ts @@ -36,11 +36,11 @@ export const HerbalAid = DB.Entity(import.meta.url, { }), ingredients: DB.Required({ comment: "The ingredients used to craft this herbal aid.", - type: DB.String({ minLength: 1, markdown: "inline" }), + type: DB.Array(DB.String({ minLength: 1, markdown: "inline" }), { minItems: 1 }), }), typical_tools: DB.Optional({ comment: "The typical tools used to craft this.", - type: DB.String({ minLength: 1, markdown: "inline" }), + type: DB.Array(DB.String({ minLength: 1, markdown: "inline" }), { minItems: 1 }), }), }), ), diff --git a/src/types/equipment/item/Plant.ts b/src/types/equipment/item/Plant.ts index 1139505e..7972e85f 100644 --- a/src/types/equipment/item/Plant.ts +++ b/src/types/equipment/item/Plant.ts @@ -20,7 +20,7 @@ export const Plant = DB.Entity(import.meta.url, { comment: "The plant types of this plant.", type: DB.Array(DB.IncludeIdentifier(EffectType), { minItems: 1, uniqueItems: true }), }), - occurences: DB.Optional({ + occurences: DB.Required({ comment: "The biomes this plant occurs in and its rarity in those biomes.", type: DB.IncludeIdentifier(PlantOccurences), }), @@ -40,12 +40,12 @@ export const Plant = DB.Entity(import.meta.url, { comment: "The plant's touch effect.", type: DB.IncludeIdentifier(PlantEffect), }), - breathe: DB.Optional({ - comment: "The plant's breathe effect.", + inhalation: DB.Optional({ + comment: "The plant's inhalation effect.", type: DB.IncludeIdentifier(PlantEffect), }), - consume: DB.Optional({ - comment: "The plant's consume effect.", + ingestion: DB.Optional({ + comment: "The plant's ingestion effect.", type: DB.IncludeIdentifier(PlantEffect), }), price: DB.Required({ @@ -131,8 +131,7 @@ const PlantOccurrence = DB.TypeAlias(import.meta.url, { "PlantOccurrence", DB.Object({ note: DB.Required({ - 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.", + comment: "A note added to this occurrence", type: DB.String({ minLength: 1, markdown: "inline" }), }), }), @@ -206,7 +205,7 @@ const PlantRecipe = DB.Enum(import.meta.url, { Elixir: DB.EnumCase({ type: DB.IncludeIdentifier(ElixirRecipe), }), - PoisonIdentifier: DB.EnumCase({ + Poison: DB.EnumCase({ type: DB.IncludeIdentifier(PoisonRecipe), }), Indefinite: DB.EnumCase({ @@ -239,11 +238,7 @@ const HerbalAidRecipe = DB.TypeAlias(import.meta.url, { comment: "The herbal aid this recipe results in.", type: HerbalAidIdentifier(), }), - translation: NestedTranslationMap( - DB.Optional, - "HerbalAidRecipeTranslation", - PlantProductTranslation, - ), + translation: NestedTranslationMap(DB.Optional, "HerbalAidRecipe", PlantProductTranslation), }), }) @@ -255,11 +250,7 @@ const ElixirRecipe = DB.TypeAlias(import.meta.url, { comment: "The elixir this recipe results in.", type: ElixirIdentifier(), }), - translation: NestedTranslationMap( - DB.Optional, - "ElixirRecipeTranslation", - PlantProductTranslation, - ), + translation: NestedTranslationMap(DB.Optional, "ElixirRecipe", PlantProductTranslation), }), }) @@ -271,11 +262,7 @@ const PoisonRecipe = DB.TypeAlias(import.meta.url, { comment: "The poison this recipe results in.", type: PoisonIdentifier(), }), - translation: NestedTranslationMap( - DB.Optional, - "PoisonRecipeTranslation", - PlantProductTranslation, - ), + translation: NestedTranslationMap(DB.Optional, "PoisonRecipe", PlantProductTranslation), }), }) From 444b2a2bb4f086ea024204b2e2d37e646278e1a6 Mon Sep 17 00:00:00 2001 From: Lector Date: Wed, 3 Jun 2026 23:30:59 +0200 Subject: [PATCH 09/10] Formatting and minor change --- src/types/equipment/item/Plant.ts | 19 +++++++------------ 1 file changed, 7 insertions(+), 12 deletions(-) diff --git a/src/types/equipment/item/Plant.ts b/src/types/equipment/item/Plant.ts index 7972e85f..4c1ba65b 100644 --- a/src/types/equipment/item/Plant.ts +++ b/src/types/equipment/item/Plant.ts @@ -111,6 +111,9 @@ const PlantOccurences = DB.TypeAlias(import.meta.url, { }), }), ), + }, + { + minProperties: 1, }), }) @@ -199,18 +202,10 @@ const IndefinitePlantPrice = DB.TypeAlias(import.meta.url, { const PlantRecipe = DB.Enum(import.meta.url, { name: "PlantRecipe", values: () => ({ - HerbalAid: DB.EnumCase({ - type: DB.IncludeIdentifier(HerbalAidRecipe), - }), - Elixir: DB.EnumCase({ - type: DB.IncludeIdentifier(ElixirRecipe), - }), - Poison: DB.EnumCase({ - type: DB.IncludeIdentifier(PoisonRecipe), - }), - Indefinite: DB.EnumCase({ - type: DB.IncludeIdentifier(IndefiniteRecipe), - }), + HerbalAid: DB.EnumCase({ type: DB.IncludeIdentifier(HerbalAidRecipe) }), + Elixir: DB.EnumCase({ type: DB.IncludeIdentifier(ElixirRecipe) }), + Poison: DB.EnumCase({ type: DB.IncludeIdentifier(PoisonRecipe) }), + Indefinite: DB.EnumCase({ type: DB.IncludeIdentifier(IndefiniteRecipe) }), }), }) From 7d475e8765e00c85b6cd41c2ef3261a1ed2f4ab3 Mon Sep 17 00:00:00 2001 From: Lector Date: Wed, 3 Jun 2026 23:53:21 +0200 Subject: [PATCH 10/10] Prettier --- src/types/equipment/item/Plant.ts | 38 ++++++++++++++++--------------- 1 file changed, 20 insertions(+), 18 deletions(-) diff --git a/src/types/equipment/item/Plant.ts b/src/types/equipment/item/Plant.ts index 4c1ba65b..33a0439d 100644 --- a/src/types/equipment/item/Plant.ts +++ b/src/types/equipment/item/Plant.ts @@ -96,25 +96,27 @@ export const Plant = DB.Entity(import.meta.url, { const PlantOccurences = DB.TypeAlias(import.meta.url, { name: "PlantOccurences", type: () => - 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 }), - }), - 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( + { + items: DB.Optional({ + comment: "The biomes this plant occurs in and its rarity in those biomes.", + type: DB.Array(DB.IncludeIdentifier(PlantOccurrence), { minItems: 1 }), }), - ), - }, - { - minProperties: 1, - }), + 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" }), + }), + }), + ), + }, + { + minProperties: 1, + }, + ), }) const PlantOccurrence = DB.TypeAlias(import.meta.url, {