Skip to content
3 changes: 3 additions & 0 deletions src/main.ts
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,7 @@ export const schema = new Schema<TSONDBTypes>(
Types.BandageOrRemedy,
Types.Bannzeichen,
Types.Beutelzauber,
Types.Biome,
Types.BlessedTradition,
Types.Blessing,
Types.Book,
Expand Down Expand Up @@ -97,6 +98,7 @@ export const schema = new Schema<TSONDBTypes>(
Types.Guideline,
Types.HairColor,
Types.Haubenzauber,
Types.HerbalAid,
Types.HomunculusType,
Types.IlluminationLightSource,
Types.IlluminationRefillOrSupply,
Expand Down Expand Up @@ -133,6 +135,7 @@ export const schema = new Schema<TSONDBTypes>(
Types.PatronCategory,
Types.PersonalityTrait,
Types.PlayerType,
Types.Plant,
Types.Poison,
Types.Profession,
Types.Property,
Expand Down
5 changes: 5 additions & 0 deletions src/types/_AlternativeNames.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import * as DB from "tsondb/schema/dsl"
import { LanguageIdentifier } from "./_Identifier.js"

export const AlternativeName = DB.TypeAlias(import.meta.url, {
name: "AlternativeName",
Expand All @@ -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: LanguageIdentifier(),
}),
}),
})
12 changes: 9 additions & 3 deletions src/types/_Identifier.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand All @@ -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"
Expand All @@ -42,22 +43,24 @@ 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 { Biome } from "./equipment/item/sub/Biome.js"
import { Reach } from "./equipment/item/sub/Reach.js"
import { ThievesTool } from "./equipment/item/ThievesTool.js"
import { ToolOfTheTrade } from "./equipment/item/ToolOfTheTrade.js"
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"
Expand Down Expand Up @@ -187,6 +190,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)
Expand Down Expand Up @@ -238,6 +242,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)
Expand Down Expand Up @@ -278,6 +283,7 @@ 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 PlayerTypeIdentifier: () => R = () => R(PlayerType)
export const PoisonIdentifier: () => R = () => R(Poison)
export const ProfessionIdentifier: () => R = () => R(Profession)
Expand Down
63 changes: 63 additions & 0 deletions src/types/equipment/item/HerbalAid.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,63 @@
import * as DB from "tsondb/schema/dsl"
import { src } from "../../source/_PublicationRef.js"
import { NestedTranslationMap } from "../../Locale.js"
import { WeaponIdentifier, ArmorIdentifier } from "../../_Identifier.js"
import { EffectType } from "./_Herbary.js"

export const HerbalAid = DB.Entity(import.meta.url, {
name: "HerbalAid",
namePlural: "HerbalAids",
type: () =>
DB.Object({
types: DB.Required({
comment: "The plant types this aid belongs to.",
type: DB.Array(DB.IncludeIdentifier(EffectType), { 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,
"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.Array(DB.String({ minLength: 1, markdown: "inline" }), { minItems: 1 }),
}),
typical_tools: DB.Optional({
comment: "The typical tools used to craft this.",
type: DB.Array(DB.String({ minLength: 1, markdown: "inline" }), { minItems: 1 }),
}),
Comment thread
elyukai marked this conversation as resolved.
}),
),
}),
instanceDisplayName: {},
uniqueConstraints: [
{
entityMapKeyPath: "translations",
keyPathInEntityMap: "name",
},
],
})

const HerbalAidCombatUse = DB.Enum(import.meta.url, {
name: "HerbalAidCombatUse",
values: () => ({
Weapon: DB.EnumCase({ type: WeaponIdentifier() }),
Armor: DB.EnumCase({ type: ArmorIdentifier() }),
}),
})
Loading
Loading