From 5ac8632d7472818c8a8aadc014e132b46e8b5301 Mon Sep 17 00:00:00 2001 From: Paul Date: Wed, 17 Jan 2024 20:12:04 +0100 Subject: [PATCH 01/31] chore: parser update GeneralIdentifier -> GenericIdentifier --- docs/reference/_Identifier.md | 22 ---------------------- docs/reference/_IdentifierGroup.md | 6 +++--- schema/_Identifier.schema.json | 18 ------------------ schema/_IdentifierGroup.schema.json | 2 +- 4 files changed, 4 insertions(+), 44 deletions(-) diff --git a/docs/reference/_Identifier.md b/docs/reference/_Identifier.md index 59cede24..74892214 100644 --- a/docs/reference/_Identifier.md +++ b/docs/reference/_Identifier.md @@ -2976,28 +2976,6 @@ The sex practice’s identifier. --- -### `GenericIdentifier` - -- **Type:** Object - -Key | Description | Details -:-- | :-- | :-- -`tag` | | See details -`generic` | The generic entry‘s identifier. | See details - -#### `tag` - -- **Constant:** `"Generic"` - -#### `generic` - -The generic entry‘s identifier. - -- **Type:** Integer -- **Minimum:** `1` - ---- - ### `TradeSecretIdentifier` - **Type:** Object diff --git a/docs/reference/_IdentifierGroup.md b/docs/reference/_IdentifierGroup.md index b9a66d12..a23543b9 100644 --- a/docs/reference/_IdentifierGroup.md +++ b/docs/reference/_IdentifierGroup.md @@ -949,13 +949,13 @@ ### `SelectOptionIdentifier` - **Type:** Union -- **Cases:** SelectOptionIdentifier'GenericIdentifier | SelectOptionIdentifier'BlessingIdentifier | SelectOptionIdentifier'CantripIdentifier | SelectOptionIdentifier'TradeSecretIdentifier | SelectOptionIdentifier'ScriptIdentifier | SelectOptionIdentifier'AnimalShapeIdentifier | SelectOptionIdentifier'ArcaneBardTraditionIdentifier | SelectOptionIdentifier'ArcaneDancerTraditionIdentifier | SelectOptionIdentifier'SexPracticeIdentifier | SelectOptionIdentifier'RaceIdentifier | SelectOptionIdentifier'CultureIdentifier | SelectOptionIdentifier'BlessedTraditionIdentifier | SelectOptionIdentifier'ElementIdentifier | SelectOptionIdentifier'PropertyIdentifier | SelectOptionIdentifier'AspectIdentifier | SelectOptionIdentifier'DiseaseIdentifier | SelectOptionIdentifier'PoisonIdentifier | SelectOptionIdentifier'LanguageIdentifier | SelectOptionIdentifier'SkillIdentifier | SelectOptionIdentifier'CloseCombatTechniqueIdentifier | SelectOptionIdentifier'RangedCombatTechniqueIdentifier | SelectOptionIdentifier'LiturgicalChantIdentifier | SelectOptionIdentifier'CeremonyIdentifier | SelectOptionIdentifier'SpellIdentifier | SelectOptionIdentifier'RitualIdentifier | SelectOptionIdentifier'TargetCategoryIdentifier +- **Cases:** SelectOptionIdentifier'GeneralIdentifier | SelectOptionIdentifier'BlessingIdentifier | SelectOptionIdentifier'CantripIdentifier | SelectOptionIdentifier'TradeSecretIdentifier | SelectOptionIdentifier'ScriptIdentifier | SelectOptionIdentifier'AnimalShapeIdentifier | SelectOptionIdentifier'ArcaneBardTraditionIdentifier | SelectOptionIdentifier'ArcaneDancerTraditionIdentifier | SelectOptionIdentifier'SexPracticeIdentifier | SelectOptionIdentifier'RaceIdentifier | SelectOptionIdentifier'CultureIdentifier | SelectOptionIdentifier'BlessedTraditionIdentifier | SelectOptionIdentifier'ElementIdentifier | SelectOptionIdentifier'PropertyIdentifier | SelectOptionIdentifier'AspectIdentifier | SelectOptionIdentifier'DiseaseIdentifier | SelectOptionIdentifier'PoisonIdentifier | SelectOptionIdentifier'LanguageIdentifier | SelectOptionIdentifier'SkillIdentifier | SelectOptionIdentifier'CloseCombatTechniqueIdentifier | SelectOptionIdentifier'RangedCombatTechniqueIdentifier | SelectOptionIdentifier'LiturgicalChantIdentifier | SelectOptionIdentifier'CeremonyIdentifier | SelectOptionIdentifier'SpellIdentifier | SelectOptionIdentifier'RitualIdentifier | SelectOptionIdentifier'TargetCategoryIdentifier --- -### `SelectOptionIdentifier'GenericIdentifier` +### `SelectOptionIdentifier'GeneralIdentifier` -- **Type:** GenericIdentifier +- **Type:** GeneralIdentifier --- diff --git a/schema/_Identifier.schema.json b/schema/_Identifier.schema.json index 3794d1b7..aaa87499 100644 --- a/schema/_Identifier.schema.json +++ b/schema/_Identifier.schema.json @@ -2435,24 +2435,6 @@ ], "additionalProperties": false }, - "GenericIdentifier": { - "type": "object", - "properties": { - "tag": { - "const": "Generic" - }, - "generic": { - "description": "The generic entry‘s identifier.", - "type": "integer", - "minimum": 1 - } - }, - "required": [ - "tag", - "generic" - ], - "additionalProperties": false - }, "TradeSecretIdentifier": { "type": "object", "properties": { diff --git a/schema/_IdentifierGroup.schema.json b/schema/_IdentifierGroup.schema.json index 6373d3c4..c10d06a3 100644 --- a/schema/_IdentifierGroup.schema.json +++ b/schema/_IdentifierGroup.schema.json @@ -484,7 +484,7 @@ "SelectOptionIdentifier": { "oneOf": [ { - "$ref": "./_Identifier.schema.json#/$defs/GenericIdentifier" + "$ref": "./_Identifier.schema.json#/$defs/GeneralIdentifier" }, { "$ref": "./_Identifier.schema.json#/$defs/BlessingIdentifier" From 6aa834fcc1931331c6103325e0e5eb76ca8c07a4 Mon Sep 17 00:00:00 2001 From: Paul Date: Wed, 17 Jan 2024 21:00:20 +0100 Subject: [PATCH 02/31] fix: rename `stationary` to `stationery` --- docs/reference/_Identifier.md | 14 +++++++------- docs/reference/_IdentifierGroup.md | 6 +++--- .../item/{Stationary.md => Stationery.md} | 2 +- schema/_Identifier.schema.json | 10 +++++----- schema/_IdentifierGroup.schema.json | 2 +- ...ationary.schema.json => Stationery.schema.json} | 6 +++--- src/config/types.ts | 6 +++--- src/types/_Identifier.ts | 8 ++++---- src/types/_IdentifierGroup.ts | 2 +- .../item/{Stationary.ts => Stationery.ts} | 10 +++++----- 10 files changed, 33 insertions(+), 33 deletions(-) rename docs/reference/equipment/item/{Stationary.md => Stationery.md} (69%) rename schema/equipment/item/{Stationary.schema.json => Stationery.schema.json} (58%) rename src/types/equipment/item/{Stationary.ts => Stationery.ts} (75%) diff --git a/docs/reference/_Identifier.md b/docs/reference/_Identifier.md index 74892214..d81ff4dc 100644 --- a/docs/reference/_Identifier.md +++ b/docs/reference/_Identifier.md @@ -2535,22 +2535,22 @@ The rope or chain’s identifier. --- -### `StationaryIdentifier` +### `StationeryIdentifier` - **Type:** Object Key | Description | Details :-- | :-- | :-- -`tag` | | See details -`stationary` | The stationary’s identifier. | See details +`tag` | | See details +`stationery` | The stationery’s identifier. | See details -#### `tag` +#### `tag` -- **Constant:** `"Stationary"` +- **Constant:** `"Stationery"` -#### `stationary` +#### `stationery` -The stationary’s identifier. +The stationery’s identifier. - **Type:** Integer - **Minimum:** `1` diff --git a/docs/reference/_IdentifierGroup.md b/docs/reference/_IdentifierGroup.md index a23543b9..f07359c2 100644 --- a/docs/reference/_IdentifierGroup.md +++ b/docs/reference/_IdentifierGroup.md @@ -1222,7 +1222,7 @@ ### `EquipmentIdentifier` - **Type:** Union -- **Cases:** EquipmentIdentifier'AmmunitionIdentifier | EquipmentIdentifier'AnimalIdentifier | EquipmentIdentifier'AnimalCareIdentifier | EquipmentIdentifier'ArmorIdentifier | EquipmentIdentifier'BandageOrRemedyIdentifier | EquipmentIdentifier'BookIdentifier | EquipmentIdentifier'CeremonialItemIdentifier | EquipmentIdentifier'ClothesIdentifier | EquipmentIdentifier'ContainerIdentifier | EquipmentIdentifier'ElixirIdentifier | EquipmentIdentifier'EquipmentOfBlessedOnesIdentifier | EquipmentIdentifier'GemOrPreciousStoneIdentifier | EquipmentIdentifier'IlluminationLightSourceIdentifier | EquipmentIdentifier'IlluminationRefillsOrSuppliesIdentifier | EquipmentIdentifier'JewelryIdentifier | EquipmentIdentifier'LiebesspielzeugIdentifier | EquipmentIdentifier'LuxuryGoodIdentifier | EquipmentIdentifier'MagicalArtifactIdentifier | EquipmentIdentifier'MusicalInstrumentIdentifier | EquipmentIdentifier'OrienteeringAidIdentifier | EquipmentIdentifier'PoisonIdentifier | EquipmentIdentifier'RopeOrChainIdentifier | EquipmentIdentifier'StationaryIdentifier | EquipmentIdentifier'ThievesToolIdentifier | EquipmentIdentifier'ToolOfTheTradeIdentifier | EquipmentIdentifier'TravelGearOrToolIdentifier | EquipmentIdentifier'VehicleIdentifier | EquipmentIdentifier'WeaponIdentifier | EquipmentIdentifier'WeaponAccessoryIdentifier +- **Cases:** EquipmentIdentifier'AmmunitionIdentifier | EquipmentIdentifier'AnimalIdentifier | EquipmentIdentifier'AnimalCareIdentifier | EquipmentIdentifier'ArmorIdentifier | EquipmentIdentifier'BandageOrRemedyIdentifier | EquipmentIdentifier'BookIdentifier | EquipmentIdentifier'CeremonialItemIdentifier | EquipmentIdentifier'ClothesIdentifier | EquipmentIdentifier'ContainerIdentifier | EquipmentIdentifier'ElixirIdentifier | EquipmentIdentifier'EquipmentOfBlessedOnesIdentifier | EquipmentIdentifier'GemOrPreciousStoneIdentifier | EquipmentIdentifier'IlluminationLightSourceIdentifier | EquipmentIdentifier'IlluminationRefillsOrSuppliesIdentifier | EquipmentIdentifier'JewelryIdentifier | EquipmentIdentifier'LiebesspielzeugIdentifier | EquipmentIdentifier'LuxuryGoodIdentifier | EquipmentIdentifier'MagicalArtifactIdentifier | EquipmentIdentifier'MusicalInstrumentIdentifier | EquipmentIdentifier'OrienteeringAidIdentifier | EquipmentIdentifier'PoisonIdentifier | EquipmentIdentifier'RopeOrChainIdentifier | EquipmentIdentifier'StationeryIdentifier | EquipmentIdentifier'ThievesToolIdentifier | EquipmentIdentifier'ToolOfTheTradeIdentifier | EquipmentIdentifier'TravelGearOrToolIdentifier | EquipmentIdentifier'VehicleIdentifier | EquipmentIdentifier'WeaponIdentifier | EquipmentIdentifier'WeaponAccessoryIdentifier --- @@ -1358,9 +1358,9 @@ --- -### `EquipmentIdentifier'StationaryIdentifier` +### `EquipmentIdentifier'StationeryIdentifier` -- **Type:** StationaryIdentifier +- **Type:** StationeryIdentifier --- diff --git a/docs/reference/equipment/item/Stationary.md b/docs/reference/equipment/item/Stationery.md similarity index 69% rename from docs/reference/equipment/item/Stationary.md rename to docs/reference/equipment/item/Stationery.md index fb22f4ff..89bfb9ab 100644 --- a/docs/reference/equipment/item/Stationary.md +++ b/docs/reference/equipment/item/Stationery.md @@ -2,6 +2,6 @@ ## Definitions -### `Stationary` +### `Stationery` - **Type:** DefaultItem diff --git a/schema/_Identifier.schema.json b/schema/_Identifier.schema.json index aaa87499..ede8c045 100644 --- a/schema/_Identifier.schema.json +++ b/schema/_Identifier.schema.json @@ -2074,21 +2074,21 @@ ], "additionalProperties": false }, - "StationaryIdentifier": { + "StationeryIdentifier": { "type": "object", "properties": { "tag": { - "const": "Stationary" + "const": "Stationery" }, - "stationary": { - "description": "The stationary’s identifier.", + "stationery": { + "description": "The stationery’s identifier.", "type": "integer", "minimum": 1 } }, "required": [ "tag", - "stationary" + "stationery" ], "additionalProperties": false }, diff --git a/schema/_IdentifierGroup.schema.json b/schema/_IdentifierGroup.schema.json index c10d06a3..009e13af 100644 --- a/schema/_IdentifierGroup.schema.json +++ b/schema/_IdentifierGroup.schema.json @@ -688,7 +688,7 @@ "$ref": "./_Identifier.schema.json#/$defs/RopeOrChainIdentifier" }, { - "$ref": "./_Identifier.schema.json#/$defs/StationaryIdentifier" + "$ref": "./_Identifier.schema.json#/$defs/StationeryIdentifier" }, { "$ref": "./_Identifier.schema.json#/$defs/ThievesToolIdentifier" diff --git a/schema/equipment/item/Stationary.schema.json b/schema/equipment/item/Stationery.schema.json similarity index 58% rename from schema/equipment/item/Stationary.schema.json rename to schema/equipment/item/Stationery.schema.json index bdbcb641..0803d167 100644 --- a/schema/equipment/item/Stationary.schema.json +++ b/schema/equipment/item/Stationery.schema.json @@ -1,9 +1,9 @@ { "$schema": "https://json-schema.org/draft/2019-09/schema", - "$id": "/equipment/item/Stationary.schema.json", - "$ref": "#/$defs/Stationary", + "$id": "/equipment/item/Stationery.schema.json", + "$ref": "#/$defs/Stationery", "$defs": { - "Stationary": { + "Stationery": { "$ref": "./_Item.schema.json#/$defs/DefaultItem" } } diff --git a/src/config/types.ts b/src/config/types.ts index cb9e929f..f6fb950d 100644 --- a/src/config/types.ts +++ b/src/config/types.ts @@ -70,7 +70,7 @@ import * as MusicalInstrument from "../types/equipment/item/MusicalInstrument.js import * as OrienteeringAid from "../types/equipment/item/OrienteeringAid.js" import * as Poison from "../types/equipment/item/Poison.js" import * as RopeOrChain from "../types/equipment/item/RopeOrChain.js" -import * as Stationary from "../types/equipment/item/Stationary.js" +import * as Stationery from "../types/equipment/item/Stationery.js" import * as ThievesTool from "../types/equipment/item/ThievesTool.js" import * as ToolOfTheTrade from "../types/equipment/item/ToolOfTheTrade.js" import * as TravelGearOrTool from "../types/equipment/item/TravelGearOrTool.js" @@ -286,7 +286,7 @@ export type TypeMap = { spellSwordEnchantments: SpellSwordEnchantment.SpellSwordEnchantment staffEnchantments: StaffEnchantment.StaffEnchantment states: State.State - stationary: Stationary.Stationary + stationery: Stationery.Stationery talismans: Talisman.Talisman targetCategories: TargetCategory.TargetCategory thievesTools: ThievesTool.ThievesTool @@ -441,7 +441,7 @@ export const configMap = { spellSwordEnchantments: SpellSwordEnchantment.config, staffEnchantments: StaffEnchantment.config, states: State.config, - stationary: Stationary.config, + stationery: Stationery.config, talismans: Talisman.config, targetCategories: TargetCategory.config, thievesTools: ThievesTool.config, diff --git a/src/types/_Identifier.ts b/src/types/_Identifier.ts index be1ac83c..2f13065a 100644 --- a/src/types/_Identifier.ts +++ b/src/types/_Identifier.ts @@ -1267,15 +1267,15 @@ export type RopeOrChainIdentifier = { rope_or_chain: number } -export type StationaryIdentifier = { - tag: "Stationary" +export type StationeryIdentifier = { + tag: "Stationery" /** - * The stationary’s identifier. + * The stationery’s identifier. * @integer * @minimum 1 */ - stationary: number + stationery: number } export type ThievesToolIdentifier = { diff --git a/src/types/_IdentifierGroup.ts b/src/types/_IdentifierGroup.ts index 1f340baf..0cb2d4ce 100644 --- a/src/types/_IdentifierGroup.ts +++ b/src/types/_IdentifierGroup.ts @@ -240,7 +240,7 @@ export type EquipmentIdentifier = | Identifier.OrienteeringAidIdentifier | Identifier.PoisonIdentifier | Identifier.RopeOrChainIdentifier - | Identifier.StationaryIdentifier + | Identifier.StationeryIdentifier | Identifier.ThievesToolIdentifier | Identifier.ToolOfTheTradeIdentifier | Identifier.TravelGearOrToolIdentifier diff --git a/src/types/equipment/item/Stationary.ts b/src/types/equipment/item/Stationery.ts similarity index 75% rename from src/types/equipment/item/Stationary.ts rename to src/types/equipment/item/Stationery.ts index 90bc4def..a62c9248 100644 --- a/src/types/equipment/item/Stationary.ts +++ b/src/types/equipment/item/Stationery.ts @@ -1,5 +1,5 @@ /** - * @main Stationary + * @main Stationery */ import { TypeConfig } from "../../../typeConfig.js" @@ -9,12 +9,12 @@ import { createSchemaValidator } from "../../../validation/builders/schema.js" import { getFilenamePrefixAsNumericId } from "../../../validation/filename.js" import { DefaultItem } from "./_Item.js" -export type Stationary = DefaultItem +export type Stationery = DefaultItem -export const config: TypeConfig = { - name: "Stationary", +export const config: TypeConfig = { + name: "Stationery", id: getFilenamePrefixAsNumericId, - integrityValidator: todo("Stationary"), + integrityValidator: todo("Stationery"), schemaValidator: createSchemaValidator(import.meta.url), fileNameValidator: validateEntityFileName, } From bc89a8867f92ffa42742f7c82f4ffcd018328c1b Mon Sep 17 00:00:00 2001 From: Paul Date: Thu, 18 Jan 2024 16:11:48 +0100 Subject: [PATCH 03/31] feat: herbs inital --- schema/equipment/item/Herb.schema.json | 113 +++++++++++++++++++++++++ 1 file changed, 113 insertions(+) create mode 100644 schema/equipment/item/Herb.schema.json diff --git a/schema/equipment/item/Herb.schema.json b/schema/equipment/item/Herb.schema.json new file mode 100644 index 00000000..4445a156 --- /dev/null +++ b/schema/equipment/item/Herb.schema.json @@ -0,0 +1,113 @@ +{ + "$schema": "https://json-schema.org/draft/2019-09/schema", + "$id": "/equipment/item/Herb.schema.json", + "$ref": "#/$defs/Herb", + "$defs": { + "Herb": { + "type": "object", + "properties": { + "effect_types": { + "description": "Effect type(s) of the plant's usage(s).", + "type": "array", + "items": { + "$ref": "./_Herbary.schema.json#/$defs/EffectType" + }, + "minItems": 1, + "uniqueItems": true + }, + "landscape_type": { + "description": "The landscape type where the plant can be found.", + "type": "array", + "items": { + "$ref": "#/$defs/DistributionLandscapeType" + } + }, + "search_difficulty": { + "description": "Modifier for plant lore check when searching for the plant.", + "type": "integer" + }, + "identification_difficulty": { + "description": "Modifier for plant lore check when identifying the plant.", + "type": "integer" + }, + "uses": { + "description": "Doses of plant material found with a search check.", + "type": "integer" + }, + "src": { + "$ref": "../../source/_PublicationRef.schema.json#/$defs/PublicationRefs" + }, + "translations": { + "description": "All translations for the entry, identified by IETF language tag (BCP47).", + "type": "object", + "patternProperties": { + "^[a-z]{2}-[A-Z]{2}$": { + "$ref": "#/$defs/HerbTranslation" + } + }, + "minProperties": 1, + "additionalProperties": false + } + }, + "required": [ + "src", + "translations" + ], + "additionalProperties": false + }, + "HerbTranslation": { + "type": "object", + "properties": { + "name": { + "description": "The name of the poison.", + "$ref": "../../_NonEmptyString.schema.json#/$defs/NonEmptyString" + }, + "alternative_names": { + "description": "A list of alternative names.", + "type": "array", + "items": { + "$ref": "../../_AlternativeNames.schema.json#/$defs/AlternativeName" + }, + "minItems": 1 + }, + "effect_raw": { + "description": "The plant's effect(s) when .", + "$ref": "../../_NonEmptyString.schema.json#/$defs/NonEmptyString" + }, + "description": { + "description": "The plant's description.", + "$ref": "../../_NonEmptyString.schema.json#/$defs/NonEmptyString" + }, + "errata": { + "$ref": "../../source/_Erratum.schema.json#/$defs/Errata" + } + }, + "required": [ + "name" + ], + "additionalProperties": false + }, + "DistributionLandscapeType": { + "oneOf": [ + { + "const": "FarNorth" + }, + { + "const": "Veld" + }, + { + "const": "Swamp" + }, + { + "const": "Woods" + }, + { + "const": "RainForest" + }, + { + "const": "Swamp" + }, + ] + } + } +} From 547466c81d8cbe3dadd644307e8c558df0047004 Mon Sep 17 00:00:00 2001 From: Paul Panther Date: Thu, 18 Jan 2024 17:50:26 +0100 Subject: [PATCH 04/31] feat: herbs -prevalence, difficulty, uses, translation --- schema/equipment/item/Herb.schema.json | 190 ++++++++++++++++++++++--- 1 file changed, 174 insertions(+), 16 deletions(-) diff --git a/schema/equipment/item/Herb.schema.json b/schema/equipment/item/Herb.schema.json index 4445a156..a48702e2 100644 --- a/schema/equipment/item/Herb.schema.json +++ b/schema/equipment/item/Herb.schema.json @@ -7,7 +7,7 @@ "type": "object", "properties": { "effect_types": { - "description": "Effect type(s) of the plant's usage(s).", + "description": "Effect type(s) of the plant's effect(s) and usage(s).", "type": "array", "items": { "$ref": "./_Herbary.schema.json#/$defs/EffectType" @@ -15,12 +15,14 @@ "minItems": 1, "uniqueItems": true }, - "landscape_type": { - "description": "The landscape type where the plant can be found.", + "prevalence": { + "description": "The herb's prevalence per landscape type.", "type": "array", "items": { - "$ref": "#/$defs/DistributionLandscapeType" - } + "$ref": "./_Herbary.schema.json#/$defs/LandscapeTypePrevalence" + }, + "minItems": 1, + "uniqueItems": true }, "search_difficulty": { "description": "Modifier for plant lore check when searching for the plant.", @@ -32,7 +34,13 @@ }, "uses": { "description": "Doses of plant material found with a search check.", - "type": "integer" + "type": "array", + "items": { + "type": "integer", + "minimum": 1 + }, + "minItems": 6, + "maxItems": 6 }, "src": { "$ref": "../../source/_PublicationRef.schema.json#/$defs/PublicationRefs" @@ -70,43 +78,193 @@ }, "minItems": 1 }, - "effect_raw": { - "description": "The plant's effect(s) when .", + "effect_touch": { + "description": "The raw plant's effect(s) when touched.", + "$ref": "../../_NonEmptyString.schema.json#/$defs/NonEmptyString" + }, + "effect_inhale": { + "description": "The raw plant's effect(s) when inhaled.", + "$ref": "../../_NonEmptyString.schema.json#/$defs/NonEmptyString" + }, + "effect_ingest": { + "description": "The raw plant's effect(s) when ingested.", "$ref": "../../_NonEmptyString.schema.json#/$defs/NonEmptyString" }, "description": { "description": "The plant's description.", "$ref": "../../_NonEmptyString.schema.json#/$defs/NonEmptyString" }, + "prevalence_remarks":{ + "description": "Additional remarks on the prevalence per landscape type of the herb.", + "$ref": "../../_NonEmptyString.schema.json#/$defs/NonEmptyString" + }, + "prevalence_regions":{ + "description": "Description of the plant's regional prevalence.", + "$ref": "../../_NonEmptyString.schema.json#/$defs/NonEmptyString" + }, "errata": { "$ref": "../../source/_Erratum.schema.json#/$defs/Errata" } }, "required": [ - "name" + "name", + "prevalence_regions", + "effect_touch", + "effect_inhale", + "effect_ingest" ], "additionalProperties": false }, - "DistributionLandscapeType": { + "LandscapeTypePrevalence": { + "description": "Prevalence of a herb in a certain landscape type.", "oneOf": [ { - "const": "FarNorth" + "type": "object", + "properties": { + "tag": { + "const": "PrevalenceFarNorth" + }, + "prevalence_far_north": { + "$ref": "#/$defs/PrevalenceClass" + } + }, + "required": [ + "tag", + "prevalence_far_north" + ], + "additionalProperties": false + }, + { + "type": "object", + "properties": { + "tag": { + "const": "PevalenceVeld" + }, + "prevalence_veld": { + "$ref": "#/$defs/PrevalenceClass" + } + }, + "required": [ + "tag", + "prevalence_veld" + ], + "additionalProperties": false + }, + { + "type": "object", + "properties": { + "tag": { + "const": "PevalenceMarsh" + }, + "prevalence_marsh": { + "$ref": "#/$defs/PrevalenceClass" + } + }, + "required": [ + "tag", + "prevalence_marsh" + ], + "additionalProperties": false + }, + { + "type": "object", + "properties": { + "tag": { + "const": "PevalenceWoods" + }, + "prevalence_woods": { + "$ref": "#/$defs/PrevalenceClass" + } + }, + "required": [ + "tag", + "prevalence_woods" + ], + "additionalProperties": false + }, + { + "type": "object", + "properties": { + "tag": { + "const": "PevalenceRainForest" + }, + "prevalence_rain_forest": { + "$ref": "#/$defs/PrevalenceClass" + } + }, + "required": [ + "tag", + "prevalence_rain_forest" + ], + "additionalProperties": false + }, + { + "type": "object", + "properties": { + "tag": { + "const": "PevalenceMountains" + }, + "prevalence_mountains": { + "$ref": "#/$defs/PrevalenceClass" + } + }, + "required": [ + "tag", + "prevalence_mountains" + ], + "additionalProperties": false }, { - "const": "Veld" + "type": "object", + "properties": { + "tag": { + "const": "PevalenceDesert" + }, + "prevalence_desert": { + "$ref": "#/$defs/PrevalenceClass" + } + }, + "required": [ + "tag", + "prevalence_desert" + ], + "additionalProperties": false }, { - "const": "Swamp" + "type": "object", + "properties": { + "tag": { + "const": "PevalenceMaraskan" + }, + "prevalence_maraskan": { + "$ref": "#/$defs/PrevalenceClass" + } + }, + "required": [ + "tag", + "prevalence_maraskan" + ], + "additionalProperties": false + } + ] + }, + "PrevalenceClass": { + "oneOf": [ + { + "const": "Common" }, { - "const": "Woods" + "const": "Occasional" }, { - "const": "RainForest" + "const": "NowAndThen" }, { - "const": "Swamp" + "const": "Rare" }, + { + "const": "VeryRare" + } ] } } From b3b659a94f9e8cd2453e7997b2a0009c1882cf3d Mon Sep 17 00:00:00 2001 From: Paul Date: Fri, 19 Jan 2024 12:38:40 +0100 Subject: [PATCH 05/31] fix: delete Herb.schema.json --- schema/equipment/item/Herb.schema.json | 271 ------------------------- 1 file changed, 271 deletions(-) delete mode 100644 schema/equipment/item/Herb.schema.json diff --git a/schema/equipment/item/Herb.schema.json b/schema/equipment/item/Herb.schema.json deleted file mode 100644 index a48702e2..00000000 --- a/schema/equipment/item/Herb.schema.json +++ /dev/null @@ -1,271 +0,0 @@ -{ - "$schema": "https://json-schema.org/draft/2019-09/schema", - "$id": "/equipment/item/Herb.schema.json", - "$ref": "#/$defs/Herb", - "$defs": { - "Herb": { - "type": "object", - "properties": { - "effect_types": { - "description": "Effect type(s) of the plant's effect(s) and usage(s).", - "type": "array", - "items": { - "$ref": "./_Herbary.schema.json#/$defs/EffectType" - }, - "minItems": 1, - "uniqueItems": true - }, - "prevalence": { - "description": "The herb's prevalence per landscape type.", - "type": "array", - "items": { - "$ref": "./_Herbary.schema.json#/$defs/LandscapeTypePrevalence" - }, - "minItems": 1, - "uniqueItems": true - }, - "search_difficulty": { - "description": "Modifier for plant lore check when searching for the plant.", - "type": "integer" - }, - "identification_difficulty": { - "description": "Modifier for plant lore check when identifying the plant.", - "type": "integer" - }, - "uses": { - "description": "Doses of plant material found with a search check.", - "type": "array", - "items": { - "type": "integer", - "minimum": 1 - }, - "minItems": 6, - "maxItems": 6 - }, - "src": { - "$ref": "../../source/_PublicationRef.schema.json#/$defs/PublicationRefs" - }, - "translations": { - "description": "All translations for the entry, identified by IETF language tag (BCP47).", - "type": "object", - "patternProperties": { - "^[a-z]{2}-[A-Z]{2}$": { - "$ref": "#/$defs/HerbTranslation" - } - }, - "minProperties": 1, - "additionalProperties": false - } - }, - "required": [ - "src", - "translations" - ], - "additionalProperties": false - }, - "HerbTranslation": { - "type": "object", - "properties": { - "name": { - "description": "The name of the poison.", - "$ref": "../../_NonEmptyString.schema.json#/$defs/NonEmptyString" - }, - "alternative_names": { - "description": "A list of alternative names.", - "type": "array", - "items": { - "$ref": "../../_AlternativeNames.schema.json#/$defs/AlternativeName" - }, - "minItems": 1 - }, - "effect_touch": { - "description": "The raw plant's effect(s) when touched.", - "$ref": "../../_NonEmptyString.schema.json#/$defs/NonEmptyString" - }, - "effect_inhale": { - "description": "The raw plant's effect(s) when inhaled.", - "$ref": "../../_NonEmptyString.schema.json#/$defs/NonEmptyString" - }, - "effect_ingest": { - "description": "The raw plant's effect(s) when ingested.", - "$ref": "../../_NonEmptyString.schema.json#/$defs/NonEmptyString" - }, - "description": { - "description": "The plant's description.", - "$ref": "../../_NonEmptyString.schema.json#/$defs/NonEmptyString" - }, - "prevalence_remarks":{ - "description": "Additional remarks on the prevalence per landscape type of the herb.", - "$ref": "../../_NonEmptyString.schema.json#/$defs/NonEmptyString" - }, - "prevalence_regions":{ - "description": "Description of the plant's regional prevalence.", - "$ref": "../../_NonEmptyString.schema.json#/$defs/NonEmptyString" - }, - "errata": { - "$ref": "../../source/_Erratum.schema.json#/$defs/Errata" - } - }, - "required": [ - "name", - "prevalence_regions", - "effect_touch", - "effect_inhale", - "effect_ingest" - ], - "additionalProperties": false - }, - "LandscapeTypePrevalence": { - "description": "Prevalence of a herb in a certain landscape type.", - "oneOf": [ - { - "type": "object", - "properties": { - "tag": { - "const": "PrevalenceFarNorth" - }, - "prevalence_far_north": { - "$ref": "#/$defs/PrevalenceClass" - } - }, - "required": [ - "tag", - "prevalence_far_north" - ], - "additionalProperties": false - }, - { - "type": "object", - "properties": { - "tag": { - "const": "PevalenceVeld" - }, - "prevalence_veld": { - "$ref": "#/$defs/PrevalenceClass" - } - }, - "required": [ - "tag", - "prevalence_veld" - ], - "additionalProperties": false - }, - { - "type": "object", - "properties": { - "tag": { - "const": "PevalenceMarsh" - }, - "prevalence_marsh": { - "$ref": "#/$defs/PrevalenceClass" - } - }, - "required": [ - "tag", - "prevalence_marsh" - ], - "additionalProperties": false - }, - { - "type": "object", - "properties": { - "tag": { - "const": "PevalenceWoods" - }, - "prevalence_woods": { - "$ref": "#/$defs/PrevalenceClass" - } - }, - "required": [ - "tag", - "prevalence_woods" - ], - "additionalProperties": false - }, - { - "type": "object", - "properties": { - "tag": { - "const": "PevalenceRainForest" - }, - "prevalence_rain_forest": { - "$ref": "#/$defs/PrevalenceClass" - } - }, - "required": [ - "tag", - "prevalence_rain_forest" - ], - "additionalProperties": false - }, - { - "type": "object", - "properties": { - "tag": { - "const": "PevalenceMountains" - }, - "prevalence_mountains": { - "$ref": "#/$defs/PrevalenceClass" - } - }, - "required": [ - "tag", - "prevalence_mountains" - ], - "additionalProperties": false - }, - { - "type": "object", - "properties": { - "tag": { - "const": "PevalenceDesert" - }, - "prevalence_desert": { - "$ref": "#/$defs/PrevalenceClass" - } - }, - "required": [ - "tag", - "prevalence_desert" - ], - "additionalProperties": false - }, - { - "type": "object", - "properties": { - "tag": { - "const": "PevalenceMaraskan" - }, - "prevalence_maraskan": { - "$ref": "#/$defs/PrevalenceClass" - } - }, - "required": [ - "tag", - "prevalence_maraskan" - ], - "additionalProperties": false - } - ] - }, - "PrevalenceClass": { - "oneOf": [ - { - "const": "Common" - }, - { - "const": "Occasional" - }, - { - "const": "NowAndThen" - }, - { - "const": "Rare" - }, - { - "const": "VeryRare" - } - ] - } - } -} From 7259733b7e85e62b621bb64dcf1843c8df2c947a Mon Sep 17 00:00:00 2001 From: Paul Panther Date: Fri, 19 Jan 2024 12:45:05 +0100 Subject: [PATCH 06/31] feat(item): add herb schema --- src/types/_IdentifierGroup.ts | 4 + src/types/_SimpleReferences.ts | 6 +- src/types/equipment/item/Herb.ts | 163 +++++++++++++++++++++++++++++++ 3 files changed, 172 insertions(+), 1 deletion(-) create mode 100644 src/types/equipment/item/Herb.ts diff --git a/src/types/_IdentifierGroup.ts b/src/types/_IdentifierGroup.ts index 0cb2d4ce..cbf48c86 100644 --- a/src/types/_IdentifierGroup.ts +++ b/src/types/_IdentifierGroup.ts @@ -250,6 +250,10 @@ export type EquipmentIdentifier = export type OneOrManyNumericIdentifiers = OneNumericIdentifier | ManyNumericIdentifiers +export type RecipeIdentifier = + | Identifier.ElixirIdentifier + | Identifier.PoisonIdentifier + /** * @minimum 1 */ diff --git a/src/types/_SimpleReferences.ts b/src/types/_SimpleReferences.ts index 3bad257d..9e15f2e5 100644 --- a/src/types/_SimpleReferences.ts +++ b/src/types/_SimpleReferences.ts @@ -1,5 +1,5 @@ import { AdvantageIdentifier, AnimalTypeIdentifier, AnimistTribeIdentifier, ArmorIdentifier, AspectIdentifier, AttributeIdentifier, BlessedTraditionIdentifier, BlessingIdentifier, CantripIdentifier, CeremonyIdentifier, CloseCombatTechniqueIdentifier, CultureIdentifier, CurriculumIdentifier, DisadvantageIdentifier, ElementIdentifier, EyeColorIdentifier, GuidelineIdentifier, HairColorIdentifier, LanguageIdentifier, LiturgicalChantIdentifier, MagicalTraditionIdentifier, PactCategoryIdentifier, PactDomainIdentifier, PatronCategoryIdentifier, PatronIdentifier, PersonalityTraitIdentifier, ProfessionIdentifier, ProfessionVariantIdentifier, PropertyIdentifier, RaceIdentifier, RangedCombatTechniqueIdentifier, RitualIdentifier, ScriptIdentifier, SkillGroupIdentifier, SkillIdentifier, SocialStatusIdentifier, SpellIdentifier, SubjectIdentifier, TargetCategoryIdentifier, WeaponIdentifier } from "./_Identifier.js" -import { CombatTechniqueIdentifier, SpellworkIdentifier, TraditionIdentifier } from "./_IdentifierGroup.js" +import { CombatTechniqueIdentifier, SpellworkIdentifier, TraditionIdentifier, RecipeIdentifier } from "./_IdentifierGroup.js" export type FocusRuleSubjectReference = { id: SubjectIdentifier @@ -176,3 +176,7 @@ export type ArmorReference = { export type TraditionReference = { id: TraditionIdentifier } + +export type RecipeReference = { + id: RecipeIdentifier +} diff --git a/src/types/equipment/item/Herb.ts b/src/types/equipment/item/Herb.ts new file mode 100644 index 00000000..370cd38a --- /dev/null +++ b/src/types/equipment/item/Herb.ts @@ -0,0 +1,163 @@ +/** + * @main Herb + */ + +import { TypeConfig } from "../../../typeConfig.js" +import { todo } from "../../../validation/builders/integrity.js" +import { validateEntityFileName } from "../../../validation/builders/naming.js" +import { createSchemaValidator } from "../../../validation/builders/schema.js" +import { getFilenamePrefixAsNumericId } from "../../../validation/filename.js" +import { AlternativeName } from "../../_AlternativeNames.js" +import { LocaleMap } from "../../_LocaleMap.js" +import { NonEmptyMarkdown, NonEmptyString } from "../../_NonEmptyString.js" +import { Errata } from "../../source/_Erratum.js" +import { PublicationRefs } from "../../source/_PublicationRef.js" +import { EffectType } from "./_Herbary.js" +import { RecipeReference } from "../../_SimpleReferences.js" + +/** + * @title Herb + */ +export type Herb = { + /** + * The herb's identifier. An unique, increasing integer. + * @integer + * @minimum 1 + */ + id: number + + /** + * Effect type(s) of the plant's effect(s) and usage(s). + * @minItems 1 + * @uniqueItems + */ + effect_types: EffectType[] + + /** + * The herb's prevalence per landscape type. + * @minItems 1 + * @uniqueItems + */ + prevalence: LandscapeTypePrevalence[] + + /** + * Modifier for plant lore check when searching for the plant. + * @integer + */ + search_difficulty: number + + /** + * Modifier for plant lore check when identifying the plant. + * @integer + */ + identification_difficulty: number + + /** + * Doses of plant material found with a search check per quality level. + * @minItems 6 + * @maxItems 6 + */ + uses: number[] + + /** + * Value per dose, in silverthalers. + * @integer + * @minimum 1 + */ + value: number + + /** + * Price per dose, in silverthalers. + * @integer + * @minimum 1 + */ + cost: number + + /** + * The recipes the herb is used in. + * @uniqueItems + */ + list: RecipeReference[] + + src: PublicationRefs + + /** + * All translations for the entry, identified by IETF language tag (BCP47). + */ + translations: LocaleMap +} + +export type LandscapeTypePrevalence = + | { tag: "PrevalenceFarNorth", prevalence_far_north: PrevalenceClass } + | { tag: "PevalenceVeld", prevalence_veld: PrevalenceClass } + | { tag: "PevalenceMarsh", prevalence_marsh: PrevalenceClass } + | { tag: "PevalenceWoods", prevalence_woods: PrevalenceClass } + | { tag: "PevalenceRainForest", prevalence_rain_forest: PrevalenceClass } + | { tag: "PevalenceMountains", prevalence_mountains: PrevalenceClass } + | { tag: "PevalenceDesert", prevalence_desert: PrevalenceClass } + | { tag: "PevalenceMaraskan", prevalence_maraskan: PrevalenceClass } + +export type PrevalenceClass = + | "Common" + | "Occasional" + | "NowAndThen" + | "Rare" + | "VeryRare" + +export type HerbTranslation = { + /** + * The name of the herb. + */ + name: NonEmptyString + + /** + * A list of alternative names. + * @minItems 1 + */ + alternative_names?: AlternativeName[] + + /** + * The plant's description. + */ + description?: NonEmptyString + + /** + * The raw plant's effect(s) when touched. + */ + effect_touch?: NonEmptyString + + /** + * The raw plant's effect(s) when inhaled. + */ + effect_inhale?: NonEmptyString + + /** + * The raw plant's effect(s) when ingested. + */ + effect_ingest?: NonEmptyString + + /** + * Additional remarks on the prevalence per landscape type of the herb. + */ + prevalence_remarks?: NonEmptyString + + /** + * Description of the plant's regional prevalence. + */ + prevalence_regions: NonEmptyString + + /** + * Description of traditonal use of and legends about the herb. + */ + legend_tradition: NonEmptyString + + errata?: Errata +} + +export const config: TypeConfig = { + name: "Herb", + id: getFilenamePrefixAsNumericId, + integrityValidator: todo("Herb"), + schemaValidator: createSchemaValidator(import.meta.url), + fileNameValidator: validateEntityFileName, +} From 0894d3f487b37355011f60cb0ddb285e0bba9c72 Mon Sep 17 00:00:00 2001 From: Paul Date: Fri, 19 Jan 2024 12:54:54 +0100 Subject: [PATCH 07/31] chore(item): generate herb schemes --- docs/reference/_IdentifierGroup.md | 19 ++ docs/reference/_SimpleReferences.md | 14 + docs/reference/equipment/item/Herb.md | 404 +++++++++++++++++++++++++ schema/_IdentifierGroup.schema.json | 10 + schema/_SimpleReferences.schema.json | 12 + schema/equipment/item/Herb.schema.json | 304 +++++++++++++++++++ 6 files changed, 763 insertions(+) create mode 100644 docs/reference/equipment/item/Herb.md create mode 100644 schema/equipment/item/Herb.schema.json diff --git a/docs/reference/_IdentifierGroup.md b/docs/reference/_IdentifierGroup.md index f07359c2..25a7b1eb 100644 --- a/docs/reference/_IdentifierGroup.md +++ b/docs/reference/_IdentifierGroup.md @@ -1419,6 +1419,25 @@ --- +### `RecipeIdentifier` + +- **Type:** Union +- **Cases:** RecipeIdentifier'ElixirIdentifier | RecipeIdentifier'PoisonIdentifier + +--- + +### `RecipeIdentifier'ElixirIdentifier` + +- **Type:** ElixirIdentifier + +--- + +### `RecipeIdentifier'PoisonIdentifier` + +- **Type:** PoisonIdentifier + +--- + ### `OneNumericIdentifier` - **Type:** Number diff --git a/docs/reference/_SimpleReferences.md b/docs/reference/_SimpleReferences.md index f7fa452d..b1816769 100644 --- a/docs/reference/_SimpleReferences.md +++ b/docs/reference/_SimpleReferences.md @@ -615,3 +615,17 @@ Key | Description | Details #### `id` - **Type:** TraditionIdentifier + +--- + +### `RecipeReference` + +- **Type:** Object + +Key | Description | Details +:-- | :-- | :-- +`id` | | See details + +#### `id` + +- **Type:** RecipeIdentifier diff --git a/docs/reference/equipment/item/Herb.md b/docs/reference/equipment/item/Herb.md new file mode 100644 index 00000000..28b62232 --- /dev/null +++ b/docs/reference/equipment/item/Herb.md @@ -0,0 +1,404 @@ +# Herb + +## Definitions + +### Herb (`Herb`) + +- **Type:** Object + +Key | Description | Details +:-- | :-- | :-- +`id` | The herb's identifier. An unique, increasing integer. | See details +`effect_types` | Effect type(s) of the plant's effect(s) and usage(s). | See details +`prevalence` | The herb's prevalence per landscape type. | See details +`search_difficulty` | Modifier for plant lore check when searching for the plant. | See details +`identification_difficulty` | Modifier for plant lore check when identifying the plant. | See details +`uses` | Doses of plant material found with a search check per quality level. | See details +`value` | Value per dose, in silverthalers. | See details +`cost` | Price per dose, in silverthalers. | See details +`list` | The recipes the herb is used in. | See details +`src` | | See details +`translations` | All translations for the entry, identified by IETF language tag (BCP47). | See details + +#### `id` + +The herb's identifier. An unique, increasing integer. + +- **Type:** Integer +- **Minimum:** `1` + +#### `effect_types` + +Effect type(s) of the plant's effect(s) and usage(s). + +- **Type:** List +- **Items:** Herb/effect_types[] +- **Minimum Items:** `1` +- **Unique Items:** Yes + +#### `prevalence` + +The herb's prevalence per landscape type. + +- **Type:** List +- **Items:** Herb/prevalence[] +- **Minimum Items:** `1` +- **Unique Items:** Yes + +#### `search_difficulty` + +Modifier for plant lore check when searching for the plant. + +- **Type:** Integer + +#### `identification_difficulty` + +Modifier for plant lore check when identifying the plant. + +- **Type:** Integer + +#### `uses` + +Doses of plant material found with a search check per quality level. + +- **Type:** List +- **Items:** Herb/uses[] +- **Minimum Items:** `6` +- **Maximum Items:** `6` + +#### `value` + +Value per dose, in silverthalers. + +- **Type:** Integer +- **Minimum:** `1` + +#### `cost` + +Price per dose, in silverthalers. + +- **Type:** Integer +- **Minimum:** `1` + +#### `list` + +The recipes the herb is used in. + +- **Type:** List +- **Items:** Herb/list[] +- **Unique Items:** Yes + +#### `src` + +- **Type:** PublicationRefs + +#### `translations` + +All translations for the entry, identified by IETF language tag (BCP47). + +- **Type:** LocaleMap<HerbTranslation> + +--- + +### `Herb/effect_types[]` + +- **Type:** EffectType + +--- + +### `Herb/prevalence[]` + +- **Type:** LandscapeTypePrevalence + +--- + +### `Herb/uses[]` + +- **Type:** Number + +--- + +### `Herb/list[]` + +- **Type:** RecipeReference + +--- + +### `LandscapeTypePrevalence` + +- **Type:** Union +- **Cases:** LandscapeTypePrevalence'PrevalenceFarNorth | LandscapeTypePrevalence'PevalenceVeld | LandscapeTypePrevalence'PevalenceMarsh | LandscapeTypePrevalence'PevalenceWoods | LandscapeTypePrevalence'PevalenceRainForest | LandscapeTypePrevalence'PevalenceMountains | LandscapeTypePrevalence'PevalenceDesert | LandscapeTypePrevalence'PevalenceMaraskan + +--- + +### `LandscapeTypePrevalence'PrevalenceFarNorth` + +- **Type:** Object + +Key | Description | Details +:-- | :-- | :-- +`tag` | | See details +`prevalence_far_north` | | See details + +#### `tag` + +- **Constant:** `"PrevalenceFarNorth"` + +#### `prevalence_far_north` + +- **Type:** PrevalenceClass + +--- + +### `LandscapeTypePrevalence'PevalenceVeld` + +- **Type:** Object + +Key | Description | Details +:-- | :-- | :-- +`tag` | | See details +`prevalence_veld` | | See details + +#### `tag` + +- **Constant:** `"PevalenceVeld"` + +#### `prevalence_veld` + +- **Type:** PrevalenceClass + +--- + +### `LandscapeTypePrevalence'PevalenceMarsh` + +- **Type:** Object + +Key | Description | Details +:-- | :-- | :-- +`tag` | | See details +`prevalence_marsh` | | See details + +#### `tag` + +- **Constant:** `"PevalenceMarsh"` + +#### `prevalence_marsh` + +- **Type:** PrevalenceClass + +--- + +### `LandscapeTypePrevalence'PevalenceWoods` + +- **Type:** Object + +Key | Description | Details +:-- | :-- | :-- +`tag` | | See details +`prevalence_woods` | | See details + +#### `tag` + +- **Constant:** `"PevalenceWoods"` + +#### `prevalence_woods` + +- **Type:** PrevalenceClass + +--- + +### `LandscapeTypePrevalence'PevalenceRainForest` + +- **Type:** Object + +Key | Description | Details +:-- | :-- | :-- +`tag` | | See details +`prevalence_rain_forest` | | See details + +#### `tag` + +- **Constant:** `"PevalenceRainForest"` + +#### `prevalence_rain_forest` + +- **Type:** PrevalenceClass + +--- + +### `LandscapeTypePrevalence'PevalenceMountains` + +- **Type:** Object + +Key | Description | Details +:-- | :-- | :-- +`tag` | | See details +`prevalence_mountains` | | See details + +#### `tag` + +- **Constant:** `"PevalenceMountains"` + +#### `prevalence_mountains` + +- **Type:** PrevalenceClass + +--- + +### `LandscapeTypePrevalence'PevalenceDesert` + +- **Type:** Object + +Key | Description | Details +:-- | :-- | :-- +`tag` | | See details +`prevalence_desert` | | See details + +#### `tag` + +- **Constant:** `"PevalenceDesert"` + +#### `prevalence_desert` + +- **Type:** PrevalenceClass + +--- + +### `LandscapeTypePrevalence'PevalenceMaraskan` + +- **Type:** Object + +Key | Description | Details +:-- | :-- | :-- +`tag` | | See details +`prevalence_maraskan` | | See details + +#### `tag` + +- **Constant:** `"PevalenceMaraskan"` + +#### `prevalence_maraskan` + +- **Type:** PrevalenceClass + +--- + +### `PrevalenceClass` + +- **Type:** Union +- **Cases:** PrevalenceClass'0 | PrevalenceClass'1 | PrevalenceClass'2 | PrevalenceClass'3 | PrevalenceClass'4 + +--- + +### `PrevalenceClass'0` + +- **Constant:** `"Common"` + +--- + +### `PrevalenceClass'1` + +- **Constant:** `"Occasional"` + +--- + +### `PrevalenceClass'2` + +- **Constant:** `"NowAndThen"` + +--- + +### `PrevalenceClass'3` + +- **Constant:** `"Rare"` + +--- + +### `PrevalenceClass'4` + +- **Constant:** `"VeryRare"` + +--- + +### `HerbTranslation` + +- **Type:** Object + +Key | Description | Details +:-- | :-- | :-- +`name` | The name of the herb. | See details +`alternative_names?` | A list of alternative names. | See details +`description?` | The plant's description. | See details +`effect_touch?` | The raw plant's effect(s) when touched. | See details +`effect_inhale?` | The raw plant's effect(s) when inhaled. | See details +`effect_ingest?` | The raw plant's effect(s) when ingested. | See details +`prevalence_remarks?` | Additional remarks on the prevalence per landscape type of the herb. | See details +`prevalence_regions` | Description of the plant's regional prevalence. | See details +`legend_tradition` | Description of traditonal use of and legends about the herb. | See details +`errata?` | | See details + +#### `name` + +The name of the herb. + +- **Type:** NonEmptyString + +#### `alternative_names?` + +A list of alternative names. + +- **Type:** List +- **Items:** HerbTranslation/alternative_names[] +- **Minimum Items:** `1` + +#### `description?` + +The plant's description. + +- **Type:** NonEmptyString + +#### `effect_touch?` + +The raw plant's effect(s) when touched. + +- **Type:** NonEmptyString + +#### `effect_inhale?` + +The raw plant's effect(s) when inhaled. + +- **Type:** NonEmptyString + +#### `effect_ingest?` + +The raw plant's effect(s) when ingested. + +- **Type:** NonEmptyString + +#### `prevalence_remarks?` + +Additional remarks on the prevalence per landscape type of the herb. + +- **Type:** NonEmptyString + +#### `prevalence_regions` + +Description of the plant's regional prevalence. + +- **Type:** NonEmptyString + +#### `legend_tradition` + +Description of traditonal use of and legends about the herb. + +- **Type:** NonEmptyString + +#### `errata?` + +- **Type:** Errata + +--- + +### `HerbTranslation/alternative_names[]` + +- **Type:** AlternativeName diff --git a/schema/_IdentifierGroup.schema.json b/schema/_IdentifierGroup.schema.json index 009e13af..72edf27e 100644 --- a/schema/_IdentifierGroup.schema.json +++ b/schema/_IdentifierGroup.schema.json @@ -720,6 +720,16 @@ } ] }, + "RecipeIdentifier": { + "oneOf": [ + { + "$ref": "./_Identifier.schema.json#/$defs/ElixirIdentifier" + }, + { + "$ref": "./_Identifier.schema.json#/$defs/PoisonIdentifier" + } + ] + }, "OneNumericIdentifier": { "type": "number", "minimum": 1 diff --git a/schema/_SimpleReferences.schema.json b/schema/_SimpleReferences.schema.json index b7ca6d53..c44ebcb8 100644 --- a/schema/_SimpleReferences.schema.json +++ b/schema/_SimpleReferences.schema.json @@ -517,6 +517,18 @@ "id" ], "additionalProperties": false + }, + "RecipeReference": { + "type": "object", + "properties": { + "id": { + "$ref": "./_IdentifierGroup.schema.json#/$defs/RecipeIdentifier" + } + }, + "required": [ + "id" + ], + "additionalProperties": false } } } diff --git a/schema/equipment/item/Herb.schema.json b/schema/equipment/item/Herb.schema.json new file mode 100644 index 00000000..0e310937 --- /dev/null +++ b/schema/equipment/item/Herb.schema.json @@ -0,0 +1,304 @@ +{ + "$schema": "https://json-schema.org/draft/2019-09/schema", + "$id": "/equipment/item/Herb.schema.json", + "$ref": "#/$defs/Herb", + "$defs": { + "Herb": { + "title": "Herb", + "type": "object", + "properties": { + "id": { + "description": "The herb's identifier. An unique, increasing integer.", + "type": "integer", + "minimum": 1 + }, + "effect_types": { + "description": "Effect type(s) of the plant's effect(s) and usage(s).", + "type": "array", + "items": { + "$ref": "./_Herbary.schema.json#/$defs/EffectType" + }, + "minItems": 1, + "uniqueItems": true + }, + "prevalence": { + "description": "The herb's prevalence per landscape type.", + "type": "array", + "items": { + "$ref": "#/$defs/LandscapeTypePrevalence" + }, + "minItems": 1, + "uniqueItems": true + }, + "search_difficulty": { + "description": "Modifier for plant lore check when searching for the plant.", + "type": "integer" + }, + "identification_difficulty": { + "description": "Modifier for plant lore check when identifying the plant.", + "type": "integer" + }, + "uses": { + "description": "Doses of plant material found with a search check per quality level.", + "type": "array", + "items": { + "type": "number" + }, + "minItems": 6, + "maxItems": 6 + }, + "value": { + "description": "Value per dose, in silverthalers.", + "type": "integer", + "minimum": 1 + }, + "cost": { + "description": "Price per dose, in silverthalers.", + "type": "integer", + "minimum": 1 + }, + "list": { + "description": "The recipes the herb is used in.", + "type": "array", + "items": { + "$ref": "../../_SimpleReferences.schema.json#/$defs/RecipeReference" + }, + "uniqueItems": true + }, + "src": { + "$ref": "../../source/_PublicationRef.schema.json#/$defs/PublicationRefs" + }, + "translations": { + "description": "All translations for the entry, identified by IETF language tag (BCP47).", + "type": "object", + "patternProperties": { + "^[a-z]{2}-[A-Z]{2}$": { + "$ref": "#/$defs/HerbTranslation" + } + }, + "minProperties": 1, + "additionalProperties": false + } + }, + "required": [ + "id", + "effect_types", + "prevalence", + "search_difficulty", + "identification_difficulty", + "uses", + "value", + "cost", + "list", + "src", + "translations" + ], + "additionalProperties": false + }, + "LandscapeTypePrevalence": { + "oneOf": [ + { + "type": "object", + "properties": { + "tag": { + "const": "PrevalenceFarNorth" + }, + "prevalence_far_north": { + "$ref": "#/$defs/PrevalenceClass" + } + }, + "required": [ + "tag", + "prevalence_far_north" + ], + "additionalProperties": false + }, + { + "type": "object", + "properties": { + "tag": { + "const": "PevalenceVeld" + }, + "prevalence_veld": { + "$ref": "#/$defs/PrevalenceClass" + } + }, + "required": [ + "tag", + "prevalence_veld" + ], + "additionalProperties": false + }, + { + "type": "object", + "properties": { + "tag": { + "const": "PevalenceMarsh" + }, + "prevalence_marsh": { + "$ref": "#/$defs/PrevalenceClass" + } + }, + "required": [ + "tag", + "prevalence_marsh" + ], + "additionalProperties": false + }, + { + "type": "object", + "properties": { + "tag": { + "const": "PevalenceWoods" + }, + "prevalence_woods": { + "$ref": "#/$defs/PrevalenceClass" + } + }, + "required": [ + "tag", + "prevalence_woods" + ], + "additionalProperties": false + }, + { + "type": "object", + "properties": { + "tag": { + "const": "PevalenceRainForest" + }, + "prevalence_rain_forest": { + "$ref": "#/$defs/PrevalenceClass" + } + }, + "required": [ + "tag", + "prevalence_rain_forest" + ], + "additionalProperties": false + }, + { + "type": "object", + "properties": { + "tag": { + "const": "PevalenceMountains" + }, + "prevalence_mountains": { + "$ref": "#/$defs/PrevalenceClass" + } + }, + "required": [ + "tag", + "prevalence_mountains" + ], + "additionalProperties": false + }, + { + "type": "object", + "properties": { + "tag": { + "const": "PevalenceDesert" + }, + "prevalence_desert": { + "$ref": "#/$defs/PrevalenceClass" + } + }, + "required": [ + "tag", + "prevalence_desert" + ], + "additionalProperties": false + }, + { + "type": "object", + "properties": { + "tag": { + "const": "PevalenceMaraskan" + }, + "prevalence_maraskan": { + "$ref": "#/$defs/PrevalenceClass" + } + }, + "required": [ + "tag", + "prevalence_maraskan" + ], + "additionalProperties": false + } + ] + }, + "PrevalenceClass": { + "oneOf": [ + { + "const": "Common" + }, + { + "const": "Occasional" + }, + { + "const": "NowAndThen" + }, + { + "const": "Rare" + }, + { + "const": "VeryRare" + } + ] + }, + "HerbTranslation": { + "type": "object", + "properties": { + "name": { + "description": "The name of the herb.", + "$ref": "../../_NonEmptyString.schema.json#/$defs/NonEmptyString" + }, + "alternative_names": { + "description": "A list of alternative names.", + "type": "array", + "items": { + "$ref": "../../_AlternativeNames.schema.json#/$defs/AlternativeName" + }, + "minItems": 1 + }, + "description": { + "description": "The plant's description.", + "$ref": "../../_NonEmptyString.schema.json#/$defs/NonEmptyString" + }, + "effect_touch": { + "description": "The raw plant's effect(s) when touched.", + "$ref": "../../_NonEmptyString.schema.json#/$defs/NonEmptyString" + }, + "effect_inhale": { + "description": "The raw plant's effect(s) when inhaled.", + "$ref": "../../_NonEmptyString.schema.json#/$defs/NonEmptyString" + }, + "effect_ingest": { + "description": "The raw plant's effect(s) when ingested.", + "$ref": "../../_NonEmptyString.schema.json#/$defs/NonEmptyString" + }, + "prevalence_remarks": { + "description": "Additional remarks on the prevalence per landscape type of the herb.", + "$ref": "../../_NonEmptyString.schema.json#/$defs/NonEmptyString" + }, + "prevalence_regions": { + "description": "Description of the plant's regional prevalence.", + "$ref": "../../_NonEmptyString.schema.json#/$defs/NonEmptyString" + }, + "legend_tradition": { + "description": "Description of traditonal use of and legends about the herb.", + "$ref": "../../_NonEmptyString.schema.json#/$defs/NonEmptyString" + }, + "errata": { + "$ref": "../../source/_Erratum.schema.json#/$defs/Errata" + } + }, + "required": [ + "name", + "prevalence_regions", + "legend_tradition" + ], + "additionalProperties": false + } + } +} From 116d9254aa49a5aac644dd6a82ebbe4dc60961c1 Mon Sep 17 00:00:00 2001 From: Paul Panther Date: Fri, 19 Jan 2024 14:12:38 +0100 Subject: [PATCH 08/31] feat(items): herb schema - extend prevalences --- src/types/equipment/item/Herb.ts | 39 +++++++++++++++++++++++--------- 1 file changed, 28 insertions(+), 11 deletions(-) diff --git a/src/types/equipment/item/Herb.ts b/src/types/equipment/item/Herb.ts index 370cd38a..6e7603fc 100644 --- a/src/types/equipment/item/Herb.ts +++ b/src/types/equipment/item/Herb.ts @@ -38,7 +38,7 @@ export type Herb = { * @minItems 1 * @uniqueItems */ - prevalence: LandscapeTypePrevalence[] + prevalence: LandscapeTypePrevalences[] /** * Modifier for plant lore check when searching for the plant. @@ -77,7 +77,7 @@ export type Herb = { * The recipes the herb is used in. * @uniqueItems */ - list: RecipeReference[] + recipes: RecipeReference[] src: PublicationRefs @@ -87,15 +87,32 @@ export type Herb = { translations: LocaleMap } -export type LandscapeTypePrevalence = - | { tag: "PrevalenceFarNorth", prevalence_far_north: PrevalenceClass } - | { tag: "PevalenceVeld", prevalence_veld: PrevalenceClass } - | { tag: "PevalenceMarsh", prevalence_marsh: PrevalenceClass } - | { tag: "PevalenceWoods", prevalence_woods: PrevalenceClass } - | { tag: "PevalenceRainForest", prevalence_rain_forest: PrevalenceClass } - | { tag: "PevalenceMountains", prevalence_mountains: PrevalenceClass } - | { tag: "PevalenceDesert", prevalence_desert: PrevalenceClass } - | { tag: "PevalenceMaraskan", prevalence_maraskan: PrevalenceClass } +export type LandscapeTypePrevalences = + | { tag: "PrevalenceFarNorth", prevalence_far_north: LandscapeTypePrevalence } + | { tag: "PevalenceVeld", prevalence_veld: LandscapeTypePrevalence } + | { tag: "PevalenceMarsh", prevalence_marsh: LandscapeTypePrevalence } + | { tag: "PevalenceWoods", prevalence_woods: LandscapeTypePrevalence } + | { tag: "PevalenceRainForest", prevalence_rain_forest: LandscapeTypePrevalence } + | { tag: "PevalenceMountains", prevalence_mountains: LandscapeTypePrevalence } + | { tag: "PevalenceDesert", prevalence_desert: LandscapeTypePrevalence } + | { tag: "PevalenceMaraskan", prevalence_maraskan: LandscapeTypePrevalence } + +export type LandscapeTypePrevalence = { + /** + * Prevalence(s) in a certain landscape. + * @minItems 1 + */ + prevalences: Prevalence[] +} + +export type Prevalence = { + /** + * Simple or conditional prevalence. + * @minItems 1 + */ + preval: PrevalenceClass + condition?: NonEmptyString +} export type PrevalenceClass = | "Common" From c6db801ab520cd107f64fff41dac4714864894ca Mon Sep 17 00:00:00 2001 From: Paul Date: Fri, 19 Jan 2024 14:13:38 +0100 Subject: [PATCH 09/31] chore(items): herb schema - extend prevalence --- docs/reference/equipment/item/Herb.md | 153 ++++++++++++++++--------- schema/equipment/item/Herb.schema.json | 57 +++++++-- 2 files changed, 144 insertions(+), 66 deletions(-) diff --git a/docs/reference/equipment/item/Herb.md b/docs/reference/equipment/item/Herb.md index 28b62232..d4516782 100644 --- a/docs/reference/equipment/item/Herb.md +++ b/docs/reference/equipment/item/Herb.md @@ -16,7 +16,7 @@ Key | Description | Details `uses` | Doses of plant material found with a search check per quality level. | See details `value` | Value per dose, in silverthalers. | See details `cost` | Price per dose, in silverthalers. | See details -`list` | The recipes the herb is used in. | See details +`recipes` | The recipes the herb is used in. | See details `src` | | See details `translations` | All translations for the entry, identified by IETF language tag (BCP47). | See details @@ -80,12 +80,12 @@ Price per dose, in silverthalers. - **Type:** Integer - **Minimum:** `1` -#### `list` +#### `recipes` The recipes the herb is used in. - **Type:** List -- **Items:** Herb/list[] +- **Items:** Herb/recipes[] - **Unique Items:** Yes #### `src` @@ -108,7 +108,7 @@ All translations for the entry, identified by IETF language tag (BCP47). ### `Herb/prevalence[]` -- **Type:** LandscapeTypePrevalence +- **Type:** LandscapeTypePrevalences --- @@ -118,169 +118,214 @@ All translations for the entry, identified by IETF language tag (BCP47). --- -### `Herb/list[]` +### `Herb/recipes[]` - **Type:** RecipeReference --- -### `LandscapeTypePrevalence` +### `LandscapeTypePrevalences` - **Type:** Union -- **Cases:** LandscapeTypePrevalence'PrevalenceFarNorth | LandscapeTypePrevalence'PevalenceVeld | LandscapeTypePrevalence'PevalenceMarsh | LandscapeTypePrevalence'PevalenceWoods | LandscapeTypePrevalence'PevalenceRainForest | LandscapeTypePrevalence'PevalenceMountains | LandscapeTypePrevalence'PevalenceDesert | LandscapeTypePrevalence'PevalenceMaraskan +- **Cases:** LandscapeTypePrevalences'PrevalenceFarNorth | LandscapeTypePrevalences'PevalenceVeld | LandscapeTypePrevalences'PevalenceMarsh | LandscapeTypePrevalences'PevalenceWoods | LandscapeTypePrevalences'PevalenceRainForest | LandscapeTypePrevalences'PevalenceMountains | LandscapeTypePrevalences'PevalenceDesert | LandscapeTypePrevalences'PevalenceMaraskan --- -### `LandscapeTypePrevalence'PrevalenceFarNorth` +### `LandscapeTypePrevalences'PrevalenceFarNorth` - **Type:** Object Key | Description | Details :-- | :-- | :-- -`tag` | | See details -`prevalence_far_north` | | See details +`tag` | | See details +`prevalence_far_north` | | See details -#### `tag` +#### `tag` - **Constant:** `"PrevalenceFarNorth"` -#### `prevalence_far_north` +#### `prevalence_far_north` -- **Type:** PrevalenceClass +- **Type:** LandscapeTypePrevalence --- -### `LandscapeTypePrevalence'PevalenceVeld` +### `LandscapeTypePrevalences'PevalenceVeld` - **Type:** Object Key | Description | Details :-- | :-- | :-- -`tag` | | See details -`prevalence_veld` | | See details +`tag` | | See details +`prevalence_veld` | | See details -#### `tag` +#### `tag` - **Constant:** `"PevalenceVeld"` -#### `prevalence_veld` +#### `prevalence_veld` -- **Type:** PrevalenceClass +- **Type:** LandscapeTypePrevalence --- -### `LandscapeTypePrevalence'PevalenceMarsh` +### `LandscapeTypePrevalences'PevalenceMarsh` - **Type:** Object Key | Description | Details :-- | :-- | :-- -`tag` | | See details -`prevalence_marsh` | | See details +`tag` | | See details +`prevalence_marsh` | | See details -#### `tag` +#### `tag` - **Constant:** `"PevalenceMarsh"` -#### `prevalence_marsh` +#### `prevalence_marsh` -- **Type:** PrevalenceClass +- **Type:** LandscapeTypePrevalence --- -### `LandscapeTypePrevalence'PevalenceWoods` +### `LandscapeTypePrevalences'PevalenceWoods` - **Type:** Object Key | Description | Details :-- | :-- | :-- -`tag` | | See details -`prevalence_woods` | | See details +`tag` | | See details +`prevalence_woods` | | See details -#### `tag` +#### `tag` - **Constant:** `"PevalenceWoods"` -#### `prevalence_woods` +#### `prevalence_woods` -- **Type:** PrevalenceClass +- **Type:** LandscapeTypePrevalence --- -### `LandscapeTypePrevalence'PevalenceRainForest` +### `LandscapeTypePrevalences'PevalenceRainForest` - **Type:** Object Key | Description | Details :-- | :-- | :-- -`tag` | | See details -`prevalence_rain_forest` | | See details +`tag` | | See details +`prevalence_rain_forest` | | See details -#### `tag` +#### `tag` - **Constant:** `"PevalenceRainForest"` -#### `prevalence_rain_forest` +#### `prevalence_rain_forest` -- **Type:** PrevalenceClass +- **Type:** LandscapeTypePrevalence --- -### `LandscapeTypePrevalence'PevalenceMountains` +### `LandscapeTypePrevalences'PevalenceMountains` - **Type:** Object Key | Description | Details :-- | :-- | :-- -`tag` | | See details -`prevalence_mountains` | | See details +`tag` | | See details +`prevalence_mountains` | | See details -#### `tag` +#### `tag` - **Constant:** `"PevalenceMountains"` -#### `prevalence_mountains` +#### `prevalence_mountains` -- **Type:** PrevalenceClass +- **Type:** LandscapeTypePrevalence --- -### `LandscapeTypePrevalence'PevalenceDesert` +### `LandscapeTypePrevalences'PevalenceDesert` - **Type:** Object Key | Description | Details :-- | :-- | :-- -`tag` | | See details -`prevalence_desert` | | See details +`tag` | | See details +`prevalence_desert` | | See details -#### `tag` +#### `tag` - **Constant:** `"PevalenceDesert"` -#### `prevalence_desert` +#### `prevalence_desert` -- **Type:** PrevalenceClass +- **Type:** LandscapeTypePrevalence --- -### `LandscapeTypePrevalence'PevalenceMaraskan` +### `LandscapeTypePrevalences'PevalenceMaraskan` - **Type:** Object Key | Description | Details :-- | :-- | :-- -`tag` | | See details -`prevalence_maraskan` | | See details +`tag` | | See details +`prevalence_maraskan` | | See details -#### `tag` +#### `tag` - **Constant:** `"PevalenceMaraskan"` -#### `prevalence_maraskan` +#### `prevalence_maraskan` + +- **Type:** LandscapeTypePrevalence + +--- + +### `LandscapeTypePrevalence` + +- **Type:** Object + +Key | Description | Details +:-- | :-- | :-- +`prevalences` | Prevalence(s) in a certain landscape. | See details + +#### `prevalences` + +Prevalence(s) in a certain landscape. + +- **Type:** List +- **Items:** LandscapeTypePrevalence/prevalences[] +- **Minimum Items:** `1` + +--- + +### `LandscapeTypePrevalence/prevalences[]` + +- **Type:** Prevalence + +--- + +### `Prevalence` + +- **Type:** Object + +Key | Description | Details +:-- | :-- | :-- +`preval` | Simple or conditional prevalence. | See details +`condition?` | | See details + +#### `preval` + +Simple or conditional prevalence. - **Type:** PrevalenceClass +#### `condition?` + +- **Type:** NonEmptyString + --- ### `PrevalenceClass` diff --git a/schema/equipment/item/Herb.schema.json b/schema/equipment/item/Herb.schema.json index 0e310937..02794abe 100644 --- a/schema/equipment/item/Herb.schema.json +++ b/schema/equipment/item/Herb.schema.json @@ -25,7 +25,7 @@ "description": "The herb's prevalence per landscape type.", "type": "array", "items": { - "$ref": "#/$defs/LandscapeTypePrevalence" + "$ref": "#/$defs/LandscapeTypePrevalences" }, "minItems": 1, "uniqueItems": true @@ -57,7 +57,7 @@ "type": "integer", "minimum": 1 }, - "list": { + "recipes": { "description": "The recipes the herb is used in.", "type": "array", "items": { @@ -89,13 +89,13 @@ "uses", "value", "cost", - "list", + "recipes", "src", "translations" ], "additionalProperties": false }, - "LandscapeTypePrevalence": { + "LandscapeTypePrevalences": { "oneOf": [ { "type": "object", @@ -104,7 +104,7 @@ "const": "PrevalenceFarNorth" }, "prevalence_far_north": { - "$ref": "#/$defs/PrevalenceClass" + "$ref": "#/$defs/LandscapeTypePrevalence" } }, "required": [ @@ -120,7 +120,7 @@ "const": "PevalenceVeld" }, "prevalence_veld": { - "$ref": "#/$defs/PrevalenceClass" + "$ref": "#/$defs/LandscapeTypePrevalence" } }, "required": [ @@ -136,7 +136,7 @@ "const": "PevalenceMarsh" }, "prevalence_marsh": { - "$ref": "#/$defs/PrevalenceClass" + "$ref": "#/$defs/LandscapeTypePrevalence" } }, "required": [ @@ -152,7 +152,7 @@ "const": "PevalenceWoods" }, "prevalence_woods": { - "$ref": "#/$defs/PrevalenceClass" + "$ref": "#/$defs/LandscapeTypePrevalence" } }, "required": [ @@ -168,7 +168,7 @@ "const": "PevalenceRainForest" }, "prevalence_rain_forest": { - "$ref": "#/$defs/PrevalenceClass" + "$ref": "#/$defs/LandscapeTypePrevalence" } }, "required": [ @@ -184,7 +184,7 @@ "const": "PevalenceMountains" }, "prevalence_mountains": { - "$ref": "#/$defs/PrevalenceClass" + "$ref": "#/$defs/LandscapeTypePrevalence" } }, "required": [ @@ -200,7 +200,7 @@ "const": "PevalenceDesert" }, "prevalence_desert": { - "$ref": "#/$defs/PrevalenceClass" + "$ref": "#/$defs/LandscapeTypePrevalence" } }, "required": [ @@ -216,7 +216,7 @@ "const": "PevalenceMaraskan" }, "prevalence_maraskan": { - "$ref": "#/$defs/PrevalenceClass" + "$ref": "#/$defs/LandscapeTypePrevalence" } }, "required": [ @@ -227,6 +227,39 @@ } ] }, + "LandscapeTypePrevalence": { + "type": "object", + "properties": { + "prevalences": { + "description": "Prevalence(s) in a certain landscape.", + "type": "array", + "items": { + "$ref": "#/$defs/Prevalence" + }, + "minItems": 1 + } + }, + "required": [ + "prevalences" + ], + "additionalProperties": false + }, + "Prevalence": { + "type": "object", + "properties": { + "preval": { + "description": "Simple or conditional prevalence.", + "$ref": "#/$defs/PrevalenceClass" + }, + "condition": { + "$ref": "../../_NonEmptyString.schema.json#/$defs/NonEmptyString" + } + }, + "required": [ + "preval" + ], + "additionalProperties": false + }, "PrevalenceClass": { "oneOf": [ { From 006407397db833a94e5c68ae1e1d8d87e28714ab Mon Sep 17 00:00:00 2001 From: Paul Panther Date: Fri, 19 Jan 2024 14:25:10 +0100 Subject: [PATCH 10/31] fix(items): herb schema - fine tune prevalence --- src/types/equipment/item/Herb.ts | 28 ++++++++++------------------ 1 file changed, 10 insertions(+), 18 deletions(-) diff --git a/src/types/equipment/item/Herb.ts b/src/types/equipment/item/Herb.ts index 6e7603fc..387cb328 100644 --- a/src/types/equipment/item/Herb.ts +++ b/src/types/equipment/item/Herb.ts @@ -88,29 +88,21 @@ export type Herb = { } export type LandscapeTypePrevalences = - | { tag: "PrevalenceFarNorth", prevalence_far_north: LandscapeTypePrevalence } - | { tag: "PevalenceVeld", prevalence_veld: LandscapeTypePrevalence } - | { tag: "PevalenceMarsh", prevalence_marsh: LandscapeTypePrevalence } - | { tag: "PevalenceWoods", prevalence_woods: LandscapeTypePrevalence } - | { tag: "PevalenceRainForest", prevalence_rain_forest: LandscapeTypePrevalence } - | { tag: "PevalenceMountains", prevalence_mountains: LandscapeTypePrevalence } - | { tag: "PevalenceDesert", prevalence_desert: LandscapeTypePrevalence } - | { tag: "PevalenceMaraskan", prevalence_maraskan: LandscapeTypePrevalence } + | { tag: "PrevalenceFarNorth", prevalence_far_north: LandscapeTypePrevalence[] } + | { tag: "PevalenceVeld", prevalence_veld: LandscapeTypePrevalence[] } + | { tag: "PevalenceMarsh", prevalence_marsh: LandscapeTypePrevalence[] } + | { tag: "PevalenceWoods", prevalence_woods: LandscapeTypePrevalence[] } + | { tag: "PevalenceRainForest", prevalence_rain_forest: LandscapeTypePrevalence[] } + | { tag: "PevalenceMountains", prevalence_mountains: LandscapeTypePrevalence[] } + | { tag: "PevalenceDesert", prevalence_desert: LandscapeTypePrevalence[] } + | { tag: "PevalenceMaraskan", prevalence_maraskan: LandscapeTypePrevalence[] } export type LandscapeTypePrevalence = { /** - * Prevalence(s) in a certain landscape. + * Simple or conditional prevalence(s) in a certain landscape. * @minItems 1 */ - prevalences: Prevalence[] -} - -export type Prevalence = { - /** - * Simple or conditional prevalence. - * @minItems 1 - */ - preval: PrevalenceClass + prevalence: PrevalenceClass condition?: NonEmptyString } From b06937ed203137eabadbc1e89288104b773f932a Mon Sep 17 00:00:00 2001 From: Paul Date: Fri, 19 Jan 2024 14:26:59 +0100 Subject: [PATCH 11/31] chore(items): herb schema - landscape prevalence --- docs/reference/equipment/item/Herb.md | 84 ++++++++++++++++++-------- schema/equipment/item/Herb.schema.json | 63 ++++++++++--------- 2 files changed, 93 insertions(+), 54 deletions(-) diff --git a/docs/reference/equipment/item/Herb.md b/docs/reference/equipment/item/Herb.md index d4516782..3e52661e 100644 --- a/docs/reference/equipment/item/Herb.md +++ b/docs/reference/equipment/item/Herb.md @@ -146,6 +146,13 @@ Key | Description | Details #### `prevalence_far_north` +- **Type:** List +- **Items:** LandscapeTypePrevalences'PrevalenceFarNorth/prevalence_far_north[] + +--- + +### `LandscapeTypePrevalences'PrevalenceFarNorth/prevalence_far_north[]` + - **Type:** LandscapeTypePrevalence --- @@ -165,6 +172,13 @@ Key | Description | Details #### `prevalence_veld` +- **Type:** List +- **Items:** LandscapeTypePrevalences'PevalenceVeld/prevalence_veld[] + +--- + +### `LandscapeTypePrevalences'PevalenceVeld/prevalence_veld[]` + - **Type:** LandscapeTypePrevalence --- @@ -184,6 +198,13 @@ Key | Description | Details #### `prevalence_marsh` +- **Type:** List +- **Items:** LandscapeTypePrevalences'PevalenceMarsh/prevalence_marsh[] + +--- + +### `LandscapeTypePrevalences'PevalenceMarsh/prevalence_marsh[]` + - **Type:** LandscapeTypePrevalence --- @@ -203,6 +224,13 @@ Key | Description | Details #### `prevalence_woods` +- **Type:** List +- **Items:** LandscapeTypePrevalences'PevalenceWoods/prevalence_woods[] + +--- + +### `LandscapeTypePrevalences'PevalenceWoods/prevalence_woods[]` + - **Type:** LandscapeTypePrevalence --- @@ -222,6 +250,13 @@ Key | Description | Details #### `prevalence_rain_forest` +- **Type:** List +- **Items:** LandscapeTypePrevalences'PevalenceRainForest/prevalence_rain_forest[] + +--- + +### `LandscapeTypePrevalences'PevalenceRainForest/prevalence_rain_forest[]` + - **Type:** LandscapeTypePrevalence --- @@ -241,6 +276,13 @@ Key | Description | Details #### `prevalence_mountains` +- **Type:** List +- **Items:** LandscapeTypePrevalences'PevalenceMountains/prevalence_mountains[] + +--- + +### `LandscapeTypePrevalences'PevalenceMountains/prevalence_mountains[]` + - **Type:** LandscapeTypePrevalence --- @@ -260,6 +302,13 @@ Key | Description | Details #### `prevalence_desert` +- **Type:** List +- **Items:** LandscapeTypePrevalences'PevalenceDesert/prevalence_desert[] + +--- + +### `LandscapeTypePrevalences'PevalenceDesert/prevalence_desert[]` + - **Type:** LandscapeTypePrevalence --- @@ -279,50 +328,33 @@ Key | Description | Details #### `prevalence_maraskan` -- **Type:** LandscapeTypePrevalence - ---- - -### `LandscapeTypePrevalence` - -- **Type:** Object - -Key | Description | Details -:-- | :-- | :-- -`prevalences` | Prevalence(s) in a certain landscape. | See details - -#### `prevalences` - -Prevalence(s) in a certain landscape. - - **Type:** List -- **Items:** LandscapeTypePrevalence/prevalences[] -- **Minimum Items:** `1` +- **Items:** LandscapeTypePrevalences'PevalenceMaraskan/prevalence_maraskan[] --- -### `LandscapeTypePrevalence/prevalences[]` +### `LandscapeTypePrevalences'PevalenceMaraskan/prevalence_maraskan[]` -- **Type:** Prevalence +- **Type:** LandscapeTypePrevalence --- -### `Prevalence` +### `LandscapeTypePrevalence` - **Type:** Object Key | Description | Details :-- | :-- | :-- -`preval` | Simple or conditional prevalence. | See details -`condition?` | | See details +`prevalence` | Simple or conditional prevalence(s) in a certain landscape. | See details +`condition?` | | See details -#### `preval` +#### `prevalence` -Simple or conditional prevalence. +Simple or conditional prevalence(s) in a certain landscape. - **Type:** PrevalenceClass -#### `condition?` +#### `condition?` - **Type:** NonEmptyString diff --git a/schema/equipment/item/Herb.schema.json b/schema/equipment/item/Herb.schema.json index 02794abe..627d72ef 100644 --- a/schema/equipment/item/Herb.schema.json +++ b/schema/equipment/item/Herb.schema.json @@ -104,7 +104,10 @@ "const": "PrevalenceFarNorth" }, "prevalence_far_north": { - "$ref": "#/$defs/LandscapeTypePrevalence" + "type": "array", + "items": { + "$ref": "#/$defs/LandscapeTypePrevalence" + } } }, "required": [ @@ -120,7 +123,10 @@ "const": "PevalenceVeld" }, "prevalence_veld": { - "$ref": "#/$defs/LandscapeTypePrevalence" + "type": "array", + "items": { + "$ref": "#/$defs/LandscapeTypePrevalence" + } } }, "required": [ @@ -136,7 +142,10 @@ "const": "PevalenceMarsh" }, "prevalence_marsh": { - "$ref": "#/$defs/LandscapeTypePrevalence" + "type": "array", + "items": { + "$ref": "#/$defs/LandscapeTypePrevalence" + } } }, "required": [ @@ -152,7 +161,10 @@ "const": "PevalenceWoods" }, "prevalence_woods": { - "$ref": "#/$defs/LandscapeTypePrevalence" + "type": "array", + "items": { + "$ref": "#/$defs/LandscapeTypePrevalence" + } } }, "required": [ @@ -168,7 +180,10 @@ "const": "PevalenceRainForest" }, "prevalence_rain_forest": { - "$ref": "#/$defs/LandscapeTypePrevalence" + "type": "array", + "items": { + "$ref": "#/$defs/LandscapeTypePrevalence" + } } }, "required": [ @@ -184,7 +199,10 @@ "const": "PevalenceMountains" }, "prevalence_mountains": { - "$ref": "#/$defs/LandscapeTypePrevalence" + "type": "array", + "items": { + "$ref": "#/$defs/LandscapeTypePrevalence" + } } }, "required": [ @@ -200,7 +218,10 @@ "const": "PevalenceDesert" }, "prevalence_desert": { - "$ref": "#/$defs/LandscapeTypePrevalence" + "type": "array", + "items": { + "$ref": "#/$defs/LandscapeTypePrevalence" + } } }, "required": [ @@ -216,7 +237,10 @@ "const": "PevalenceMaraskan" }, "prevalence_maraskan": { - "$ref": "#/$defs/LandscapeTypePrevalence" + "type": "array", + "items": { + "$ref": "#/$defs/LandscapeTypePrevalence" + } } }, "required": [ @@ -230,25 +254,8 @@ "LandscapeTypePrevalence": { "type": "object", "properties": { - "prevalences": { - "description": "Prevalence(s) in a certain landscape.", - "type": "array", - "items": { - "$ref": "#/$defs/Prevalence" - }, - "minItems": 1 - } - }, - "required": [ - "prevalences" - ], - "additionalProperties": false - }, - "Prevalence": { - "type": "object", - "properties": { - "preval": { - "description": "Simple or conditional prevalence.", + "prevalence": { + "description": "Simple or conditional prevalence(s) in a certain landscape.", "$ref": "#/$defs/PrevalenceClass" }, "condition": { @@ -256,7 +263,7 @@ } }, "required": [ - "preval" + "prevalence" ], "additionalProperties": false }, From 74140340fabffdf4cd829cf0fe0a521df9b7299d Mon Sep 17 00:00:00 2001 From: Paul Panther Date: Fri, 19 Jan 2024 14:42:43 +0100 Subject: [PATCH 12/31] fix(items): herb schema - change prevalence condition to locale map --- src/types/equipment/item/Herb.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/types/equipment/item/Herb.ts b/src/types/equipment/item/Herb.ts index 387cb328..5a3d6aed 100644 --- a/src/types/equipment/item/Herb.ts +++ b/src/types/equipment/item/Herb.ts @@ -103,7 +103,7 @@ export type LandscapeTypePrevalence = { * @minItems 1 */ prevalence: PrevalenceClass - condition?: NonEmptyString + condition?: LocaleMap } export type PrevalenceClass = From 7d8e866a5fdf1c8f1013ddc3f242d14ea089b6dd Mon Sep 17 00:00:00 2001 From: Paul Date: Fri, 19 Jan 2024 14:44:06 +0100 Subject: [PATCH 13/31] chore(items): herb schema --- docs/reference/equipment/item/Herb.md | 2 +- schema/equipment/item/Herb.schema.json | 10 +++++++++- 2 files changed, 10 insertions(+), 2 deletions(-) diff --git a/docs/reference/equipment/item/Herb.md b/docs/reference/equipment/item/Herb.md index 3e52661e..cfe7a120 100644 --- a/docs/reference/equipment/item/Herb.md +++ b/docs/reference/equipment/item/Herb.md @@ -356,7 +356,7 @@ Simple or conditional prevalence(s) in a certain landscape. #### `condition?` -- **Type:** NonEmptyString +- **Type:** LocaleMap<NonEmptyString> --- diff --git a/schema/equipment/item/Herb.schema.json b/schema/equipment/item/Herb.schema.json index 627d72ef..f5a8498c 100644 --- a/schema/equipment/item/Herb.schema.json +++ b/schema/equipment/item/Herb.schema.json @@ -259,7 +259,15 @@ "$ref": "#/$defs/PrevalenceClass" }, "condition": { - "$ref": "../../_NonEmptyString.schema.json#/$defs/NonEmptyString" + "description": "All translations for the entry, identified by IETF language tag (BCP47).", + "type": "object", + "patternProperties": { + "^[a-z]{2}-[A-Z]{2}$": { + "$ref": "../../_NonEmptyString.schema.json#/$defs/NonEmptyString" + } + }, + "minProperties": 1, + "additionalProperties": false } }, "required": [ From e03c88b47517e804b8f8d54be4c3859070af76a4 Mon Sep 17 00:00:00 2001 From: Paul Panther Date: Fri, 19 Jan 2024 16:06:25 +0100 Subject: [PATCH 14/31] feat(items): herb schema - storage life and preservation --- src/types/equipment/item/Herb.ts | 52 +++++++++++++++++++++++++++- src/types/equipment/item/Poison.ts | 12 ++----- src/types/equipment/item/_Herbary.ts | 10 ++++++ 3 files changed, 64 insertions(+), 10 deletions(-) diff --git a/src/types/equipment/item/Herb.ts b/src/types/equipment/item/Herb.ts index 5a3d6aed..0643a5d1 100644 --- a/src/types/equipment/item/Herb.ts +++ b/src/types/equipment/item/Herb.ts @@ -12,7 +12,7 @@ import { LocaleMap } from "../../_LocaleMap.js" import { NonEmptyMarkdown, NonEmptyString } from "../../_NonEmptyString.js" import { Errata } from "../../source/_Erratum.js" import { PublicationRefs } from "../../source/_PublicationRef.js" -import { EffectType } from "./_Herbary.js" +import { EffectType, TimeUnit } from "./_Herbary.js" import { RecipeReference } from "../../_SimpleReferences.js" /** @@ -79,6 +79,16 @@ export type Herb = { */ recipes: RecipeReference[] + /** + * The Storage life of the raw herb. + */ + storage_life: StorageLifeRaw + + /** + * The preservation options, identified by IETF language tag (BCP47). + */ + preservation_methods: PreservationMethod[] + src: PublicationRefs /** @@ -113,6 +123,46 @@ export type PrevalenceClass = | "Rare" | "VeryRare" +export type StorageLifeRaw = + | { tag: "Default", default: {} } + | { tag: "Special", special: LocaleMap } + +export type PreservationMethod = { + /** + * All translations for the entry, identified by IETF language tag (BCP47). + */ + translation: LocaleMap + /** + * The storage life of the product. + */ + storage_life: StorageLife +} + +export type StorageLife = { + /** + * The storage life of a (processed) herb. + * @integer + * @minmum 1 + */ + value: number + unit: TimeUnit +} + +export type PreservationMethodTranslation = { + /** + * Name of the preservation method. + */ + name: NonEmptyString + /** + * Description of the preservation method. + */ + preparation: NonEmptyString + /** + * Alternative effect of the product. + */ + alternative_effect: NonEmptyString +} + export type HerbTranslation = { /** * The name of the herb. diff --git a/src/types/equipment/item/Poison.ts b/src/types/equipment/item/Poison.ts index 8380497e..2b0fbcc4 100644 --- a/src/types/equipment/item/Poison.ts +++ b/src/types/equipment/item/Poison.ts @@ -14,7 +14,7 @@ import { LocaleMap } from "../../_LocaleMap.js" import { NonEmptyMarkdown, NonEmptyString } from "../../_NonEmptyString.js" import { Errata } from "../../source/_Erratum.js" import { PublicationRefs } from "../../source/_PublicationRef.js" -import { EffectType, LaboratoryLevel, RecipeTradeSecret } from "./_Herbary.js" +import { EffectType, LaboratoryLevel, RecipeTradeSecret, TimeUnit } from "./_Herbary.js" /** * @title Poison @@ -95,20 +95,14 @@ export type PoisonDuration = export type ConstantPoisonTime = { value: number - unit: PoisonTimeUnit + unit: TimeUnit } export type DiceBasedPoisonTime = { dice: Dice - unit: PoisonTimeUnit + unit: TimeUnit } -export type PoisonTimeUnit = - | "CombatRounds" - | "Minutes" - | "Hours" - | "Days" - export type IndefinitePoisonTime = { /** * All translations for the entry, identified by IETF language tag (BCP47). diff --git a/src/types/equipment/item/_Herbary.ts b/src/types/equipment/item/_Herbary.ts index 35c8ded2..1a4fd756 100644 --- a/src/types/equipment/item/_Herbary.ts +++ b/src/types/equipment/item/_Herbary.ts @@ -21,6 +21,16 @@ export type LaboratoryLevel = | "WitchKitchen" | "AlchemistsLaboratory" + +export type TimeUnit = + | "CombatRounds" + | "Minutes" + | "Hours" + | "Days" + | "Weeks" + | "Months" + | "Years" + export type RecipeTradeSecret = { /** * The AP value of the trade secret. From acd3167d7661699bd9090e4d8234a96e58dd0e9b Mon Sep 17 00:00:00 2001 From: Paul Date: Fri, 19 Jan 2024 16:06:58 +0100 Subject: [PATCH 15/31] chore(items): herb schema - storage life --- docs/reference/equipment/item/Herb.md | 146 +++++++++++++++++++++ docs/reference/equipment/item/Poison.md | 35 +---- docs/reference/equipment/item/_Herbary.md | 49 +++++++ schema/equipment/item/Herb.schema.json | 125 ++++++++++++++++++ schema/equipment/item/Poison.schema.json | 20 +-- schema/equipment/item/_Herbary.schema.json | 25 ++++ 6 files changed, 349 insertions(+), 51 deletions(-) diff --git a/docs/reference/equipment/item/Herb.md b/docs/reference/equipment/item/Herb.md index cfe7a120..6475b37d 100644 --- a/docs/reference/equipment/item/Herb.md +++ b/docs/reference/equipment/item/Herb.md @@ -17,6 +17,8 @@ Key | Description | Details `value` | Value per dose, in silverthalers. | See details `cost` | Price per dose, in silverthalers. | See details `recipes` | The recipes the herb is used in. | See details +`storage_life` | The Storage life of the raw herb. | See details +`preservation_methods` | The preservation options, identified by IETF language tag (BCP47). | See details `src` | | See details `translations` | All translations for the entry, identified by IETF language tag (BCP47). | See details @@ -88,6 +90,19 @@ The recipes the herb is used in. - **Items:** Herb/recipes[] - **Unique Items:** Yes +#### `storage_life` + +The Storage life of the raw herb. + +- **Type:** StorageLifeRaw + +#### `preservation_methods` + +The preservation options, identified by IETF language tag (BCP47). + +- **Type:** List +- **Items:** Herb/preservation_methods[] + #### `src` - **Type:** PublicationRefs @@ -124,6 +139,12 @@ All translations for the entry, identified by IETF language tag (BCP47). --- +### `Herb/preservation_methods[]` + +- **Type:** PreservationMethod + +--- + ### `LandscapeTypePrevalences` - **Type:** Union @@ -397,6 +418,131 @@ Simple or conditional prevalence(s) in a certain landscape. --- +### `StorageLifeRaw` + +- **Type:** Union +- **Cases:** StorageLifeRaw'Default | StorageLifeRaw'Special + +--- + +### `StorageLifeRaw'Default` + +- **Type:** Object + +Key | Description | Details +:-- | :-- | :-- +`tag` | | See details +`default` | | See details + +#### `tag` + +- **Constant:** `"Default"` + +#### `default` + +- **Type:** Object + +--- + +### `StorageLifeRaw'Default/default` + +- **Type:** Empty Object + +--- + +### `StorageLifeRaw'Special` + +- **Type:** Object + +Key | Description | Details +:-- | :-- | :-- +`tag` | | See details +`special` | | See details + +#### `tag` + +- **Constant:** `"Special"` + +#### `special` + +- **Type:** LocaleMap<NonEmptyString> + +--- + +### `PreservationMethod` + +- **Type:** Object + +Key | Description | Details +:-- | :-- | :-- +`translation` | All translations for the entry, identified by IETF language tag (BCP47). | See details +`storage_life` | The storage life of the product. | See details + +#### `translation` + +All translations for the entry, identified by IETF language tag (BCP47). + +- **Type:** LocaleMap<PreservationMethodTranslation> + +#### `storage_life` + +The storage life of the product. + +- **Type:** StorageLife + +--- + +### `StorageLife` + +- **Type:** Object + +Key | Description | Details +:-- | :-- | :-- +`value` | The storage life of a (processed) herb. | See details +`unit` | | See details + +#### `value` + +The storage life of a (processed) herb. + +- **Type:** Integer + +#### `unit` + +- **Type:** TimeUnit + +--- + +### `PreservationMethodTranslation` + +- **Type:** Object + +Key | Description | Details +:-- | :-- | :-- +`name` | Name of the preservation method. | See details +`preparation` | Description of the preservation method. | See details +`alternative_effect` | Alternative effect of the product. | See details + +#### `name` + +Name of the preservation method. + +- **Type:** NonEmptyString + +#### `preparation` + +Description of the preservation method. + +- **Type:** NonEmptyString + +#### `alternative_effect` + +Alternative effect of the product. + +- **Type:** NonEmptyString + +--- + ### `HerbTranslation` - **Type:** Object diff --git a/docs/reference/equipment/item/Poison.md b/docs/reference/equipment/item/Poison.md index db885c42..d8f0a3c6 100644 --- a/docs/reference/equipment/item/Poison.md +++ b/docs/reference/equipment/item/Poison.md @@ -296,7 +296,7 @@ Key | Description | Details #### `unit` -- **Type:** PoisonTimeUnit +- **Type:** TimeUnit --- @@ -315,38 +315,7 @@ Key | Description | Details #### `unit` -- **Type:** PoisonTimeUnit - ---- - -### `PoisonTimeUnit` - -- **Type:** Union -- **Cases:** PoisonTimeUnit'0 | PoisonTimeUnit'1 | PoisonTimeUnit'2 | PoisonTimeUnit'3 - ---- - -### `PoisonTimeUnit'0` - -- **Constant:** `"CombatRounds"` - ---- - -### `PoisonTimeUnit'1` - -- **Constant:** `"Minutes"` - ---- - -### `PoisonTimeUnit'2` - -- **Constant:** `"Hours"` - ---- - -### `PoisonTimeUnit'3` - -- **Constant:** `"Days"` +- **Type:** TimeUnit --- diff --git a/docs/reference/equipment/item/_Herbary.md b/docs/reference/equipment/item/_Herbary.md index 2de0dc28..62276283 100644 --- a/docs/reference/equipment/item/_Herbary.md +++ b/docs/reference/equipment/item/_Herbary.md @@ -80,6 +80,55 @@ Effect type categories of a plant or recipe. --- +### `TimeUnit` + +- **Type:** Union +- **Cases:** TimeUnit'0 | TimeUnit'1 | TimeUnit'2 | TimeUnit'3 | TimeUnit'4 | TimeUnit'5 | TimeUnit'6 + +--- + +### `TimeUnit'0` + +- **Constant:** `"CombatRounds"` + +--- + +### `TimeUnit'1` + +- **Constant:** `"Minutes"` + +--- + +### `TimeUnit'2` + +- **Constant:** `"Hours"` + +--- + +### `TimeUnit'3` + +- **Constant:** `"Days"` + +--- + +### `TimeUnit'4` + +- **Constant:** `"Weeks"` + +--- + +### `TimeUnit'5` + +- **Constant:** `"Months"` + +--- + +### `TimeUnit'6` + +- **Constant:** `"Years"` + +--- + ### `RecipeTradeSecret` - **Type:** Object diff --git a/schema/equipment/item/Herb.schema.json b/schema/equipment/item/Herb.schema.json index f5a8498c..98d8b3b8 100644 --- a/schema/equipment/item/Herb.schema.json +++ b/schema/equipment/item/Herb.schema.json @@ -65,6 +65,17 @@ }, "uniqueItems": true }, + "storage_life": { + "description": "The Storage life of the raw herb.", + "$ref": "#/$defs/StorageLifeRaw" + }, + "preservation_methods": { + "description": "The preservation options, identified by IETF language tag (BCP47).", + "type": "array", + "items": { + "$ref": "#/$defs/PreservationMethod" + } + }, "src": { "$ref": "../../source/_PublicationRef.schema.json#/$defs/PublicationRefs" }, @@ -90,6 +101,8 @@ "value", "cost", "recipes", + "storage_life", + "preservation_methods", "src", "translations" ], @@ -294,6 +307,118 @@ } ] }, + "StorageLifeRaw": { + "oneOf": [ + { + "type": "object", + "properties": { + "tag": { + "const": "Default" + }, + "default": { + "type": "object", + "properties": {}, + "required": [], + "additionalProperties": false + } + }, + "required": [ + "tag", + "default" + ], + "additionalProperties": false + }, + { + "type": "object", + "properties": { + "tag": { + "const": "Special" + }, + "special": { + "description": "All translations for the entry, identified by IETF language tag (BCP47).", + "type": "object", + "patternProperties": { + "^[a-z]{2}-[A-Z]{2}$": { + "$ref": "../../_NonEmptyString.schema.json#/$defs/NonEmptyString" + } + }, + "minProperties": 1, + "additionalProperties": false + } + }, + "required": [ + "tag", + "special" + ], + "additionalProperties": false + } + ] + }, + "PreservationMethod": { + "type": "object", + "properties": { + "translation": { + "description": "All translations for the entry, identified by IETF language tag (BCP47).", + "type": "object", + "patternProperties": { + "^[a-z]{2}-[A-Z]{2}$": { + "$ref": "#/$defs/PreservationMethodTranslation" + } + }, + "minProperties": 1, + "additionalProperties": false + }, + "storage_life": { + "description": "The storage life of the product.", + "$ref": "#/$defs/StorageLife" + } + }, + "required": [ + "translation", + "storage_life" + ], + "additionalProperties": false + }, + "StorageLife": { + "type": "object", + "properties": { + "value": { + "description": "The storage life of a (processed) herb.", + "type": "integer" + }, + "unit": { + "$ref": "./_Herbary.schema.json#/$defs/TimeUnit" + } + }, + "required": [ + "value", + "unit" + ], + "additionalProperties": false + }, + "PreservationMethodTranslation": { + "type": "object", + "properties": { + "name": { + "description": "Name of the preservation method.", + "$ref": "../../_NonEmptyString.schema.json#/$defs/NonEmptyString" + }, + "preparation": { + "description": "Description of the preservation method.", + "$ref": "../../_NonEmptyString.schema.json#/$defs/NonEmptyString" + }, + "alternative_effect": { + "description": "Alternative effect of the product.", + "$ref": "../../_NonEmptyString.schema.json#/$defs/NonEmptyString" + } + }, + "required": [ + "name", + "preparation", + "alternative_effect" + ], + "additionalProperties": false + }, "HerbTranslation": { "type": "object", "properties": { diff --git a/schema/equipment/item/Poison.schema.json b/schema/equipment/item/Poison.schema.json index 81d6a9eb..3bc5b0f8 100644 --- a/schema/equipment/item/Poison.schema.json +++ b/schema/equipment/item/Poison.schema.json @@ -237,7 +237,7 @@ "type": "number" }, "unit": { - "$ref": "#/$defs/PoisonTimeUnit" + "$ref": "./_Herbary.schema.json#/$defs/TimeUnit" } }, "required": [ @@ -253,7 +253,7 @@ "$ref": "../../_Dice.schema.json#/$defs/Dice" }, "unit": { - "$ref": "#/$defs/PoisonTimeUnit" + "$ref": "./_Herbary.schema.json#/$defs/TimeUnit" } }, "required": [ @@ -262,22 +262,6 @@ ], "additionalProperties": false }, - "PoisonTimeUnit": { - "oneOf": [ - { - "const": "CombatRounds" - }, - { - "const": "Minutes" - }, - { - "const": "Hours" - }, - { - "const": "Days" - } - ] - }, "IndefinitePoisonTime": { "type": "object", "properties": { diff --git a/schema/equipment/item/_Herbary.schema.json b/schema/equipment/item/_Herbary.schema.json index 2368dc9e..288254c5 100644 --- a/schema/equipment/item/_Herbary.schema.json +++ b/schema/equipment/item/_Herbary.schema.json @@ -41,6 +41,31 @@ } ] }, + "TimeUnit": { + "oneOf": [ + { + "const": "CombatRounds" + }, + { + "const": "Minutes" + }, + { + "const": "Hours" + }, + { + "const": "Days" + }, + { + "const": "Weeks" + }, + { + "const": "Months" + }, + { + "const": "Years" + } + ] + }, "RecipeTradeSecret": { "type": "object", "properties": { From 6040434eaa9ddf938a08393a3fc6328056bb26f1 Mon Sep 17 00:00:00 2001 From: Paul Panther Date: Fri, 19 Jan 2024 19:05:44 +0100 Subject: [PATCH 16/31] fix(items): herb schema - fix typos --- src/types/equipment/item/Herb.ts | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/src/types/equipment/item/Herb.ts b/src/types/equipment/item/Herb.ts index 0643a5d1..afd46ff9 100644 --- a/src/types/equipment/item/Herb.ts +++ b/src/types/equipment/item/Herb.ts @@ -77,7 +77,7 @@ export type Herb = { * The recipes the herb is used in. * @uniqueItems */ - recipes: RecipeReference[] + recipes?: RecipeReference[] /** * The Storage life of the raw herb. @@ -99,13 +99,13 @@ export type Herb = { export type LandscapeTypePrevalences = | { tag: "PrevalenceFarNorth", prevalence_far_north: LandscapeTypePrevalence[] } - | { tag: "PevalenceVeld", prevalence_veld: LandscapeTypePrevalence[] } - | { tag: "PevalenceMarsh", prevalence_marsh: LandscapeTypePrevalence[] } - | { tag: "PevalenceWoods", prevalence_woods: LandscapeTypePrevalence[] } - | { tag: "PevalenceRainForest", prevalence_rain_forest: LandscapeTypePrevalence[] } - | { tag: "PevalenceMountains", prevalence_mountains: LandscapeTypePrevalence[] } - | { tag: "PevalenceDesert", prevalence_desert: LandscapeTypePrevalence[] } - | { tag: "PevalenceMaraskan", prevalence_maraskan: LandscapeTypePrevalence[] } + | { tag: "PrevalenceVeld", prevalence_veld: LandscapeTypePrevalence[] } + | { tag: "PrevalenceMarsh", prevalence_marsh: LandscapeTypePrevalence[] } + | { tag: "PrevalenceWoods", prevalence_woods: LandscapeTypePrevalence[] } + | { tag: "PrevalenceRainForest", prevalence_rain_forest: LandscapeTypePrevalence[] } + | { tag: "PrevalenceMountains", prevalence_mountains: LandscapeTypePrevalence[] } + | { tag: "PrevalenceDesert", prevalence_desert: LandscapeTypePrevalence[] } + | { tag: "PrevalenceMaraskan", prevalence_maraskan: LandscapeTypePrevalence[] } export type LandscapeTypePrevalence = { /** From bb7d5bb6c025349fb268f0fdb109cde04bfe6fb9 Mon Sep 17 00:00:00 2001 From: Paul Panther Date: Fri, 19 Jan 2024 20:24:29 +0100 Subject: [PATCH 17/31] feat(items): herb schema - extended preservation --- src/types/_Identifier.ts | 34 +++++++++ src/types/_IdentifierGroup.ts | 13 ++-- src/types/_SimpleReferences.ts | 12 +++- src/types/equipment/item/Herb.ts | 62 +++++++---------- src/types/equipment/item/HerbalAid.ts | 81 ++++++++++++++++++++++ src/types/equipment/item/HerbalPreserve.ts | 71 +++++++++++++++++++ src/types/equipment/item/_Herbary.ts | 31 ++++++--- 7 files changed, 252 insertions(+), 52 deletions(-) create mode 100644 src/types/equipment/item/HerbalAid.ts create mode 100644 src/types/equipment/item/HerbalPreserve.ts diff --git a/src/types/_Identifier.ts b/src/types/_Identifier.ts index 2f13065a..6e035ffd 100644 --- a/src/types/_Identifier.ts +++ b/src/types/_Identifier.ts @@ -1157,6 +1157,40 @@ export type GemOrPreciousStoneIdentifier = { gem_or_precious_stone: number } + +export type HerbIdentifier = { + tag: "Herb" + + /** + * The herb’s identifier. + * @integer + * @minimum 1 + */ + herb: number +} + +export type HerbalAidIdentifier = { + tag: "HerbalAid" + + /** + * The herbal aid’s identifier. + * @integer + * @minimum 1 + */ + herbal_aid: number +} + +export type HerbalPreserveIdentifier = { + tag: "HerbalPreserve" + + /** + * The herbal preserve’s identifier. + * @integer + * @minimum 1 + */ + herbal_preserve: number +} + export type IlluminationLightSourceIdentifier = { tag: "IlluminationLightSource" diff --git a/src/types/_IdentifierGroup.ts b/src/types/_IdentifierGroup.ts index cbf48c86..8c1aa3dc 100644 --- a/src/types/_IdentifierGroup.ts +++ b/src/types/_IdentifierGroup.ts @@ -250,10 +250,6 @@ export type EquipmentIdentifier = export type OneOrManyNumericIdentifiers = OneNumericIdentifier | ManyNumericIdentifiers -export type RecipeIdentifier = - | Identifier.ElixirIdentifier - | Identifier.PoisonIdentifier - /** * @minimum 1 */ @@ -263,3 +259,12 @@ type OneNumericIdentifier = number * @minItems 2 */ type ManyNumericIdentifiers = OneNumericIdentifier[] + +export type RecipeIdentifier = + | Identifier.ElixirIdentifier + | Identifier.PoisonIdentifier + +export type HerbalAidOrPreserveIdentifier = + | Identifier.HerbalAidIdentifier + | Identifier.HerbalPreserveIdentifier + \ No newline at end of file diff --git a/src/types/_SimpleReferences.ts b/src/types/_SimpleReferences.ts index 9e15f2e5..2d9c25cf 100644 --- a/src/types/_SimpleReferences.ts +++ b/src/types/_SimpleReferences.ts @@ -1,5 +1,5 @@ -import { AdvantageIdentifier, AnimalTypeIdentifier, AnimistTribeIdentifier, ArmorIdentifier, AspectIdentifier, AttributeIdentifier, BlessedTraditionIdentifier, BlessingIdentifier, CantripIdentifier, CeremonyIdentifier, CloseCombatTechniqueIdentifier, CultureIdentifier, CurriculumIdentifier, DisadvantageIdentifier, ElementIdentifier, EyeColorIdentifier, GuidelineIdentifier, HairColorIdentifier, LanguageIdentifier, LiturgicalChantIdentifier, MagicalTraditionIdentifier, PactCategoryIdentifier, PactDomainIdentifier, PatronCategoryIdentifier, PatronIdentifier, PersonalityTraitIdentifier, ProfessionIdentifier, ProfessionVariantIdentifier, PropertyIdentifier, RaceIdentifier, RangedCombatTechniqueIdentifier, RitualIdentifier, ScriptIdentifier, SkillGroupIdentifier, SkillIdentifier, SocialStatusIdentifier, SpellIdentifier, SubjectIdentifier, TargetCategoryIdentifier, WeaponIdentifier } from "./_Identifier.js" -import { CombatTechniqueIdentifier, SpellworkIdentifier, TraditionIdentifier, RecipeIdentifier } from "./_IdentifierGroup.js" +import { AdvantageIdentifier, AnimalTypeIdentifier, AnimistTribeIdentifier, ArmorIdentifier, AspectIdentifier, AttributeIdentifier, BlessedTraditionIdentifier, BlessingIdentifier, CantripIdentifier, CeremonyIdentifier, CloseCombatTechniqueIdentifier, CultureIdentifier, CurriculumIdentifier, DisadvantageIdentifier, ElementIdentifier, EyeColorIdentifier, GuidelineIdentifier, HairColorIdentifier, HerbIdentifier, LanguageIdentifier, LiturgicalChantIdentifier, MagicalTraditionIdentifier, PactCategoryIdentifier, PactDomainIdentifier, PatronCategoryIdentifier, PatronIdentifier, PersonalityTraitIdentifier, ProfessionIdentifier, ProfessionVariantIdentifier, PropertyIdentifier, RaceIdentifier, RangedCombatTechniqueIdentifier, RitualIdentifier, ScriptIdentifier, SkillGroupIdentifier, SkillIdentifier, SocialStatusIdentifier, SpellIdentifier, SubjectIdentifier, TargetCategoryIdentifier, WeaponIdentifier } from "./_Identifier.js" +import { CombatTechniqueIdentifier, HerbalAidOrPreserveIdentifier, SpellworkIdentifier, TraditionIdentifier, RecipeIdentifier } from "./_IdentifierGroup.js" export type FocusRuleSubjectReference = { id: SubjectIdentifier @@ -180,3 +180,11 @@ export type TraditionReference = { export type RecipeReference = { id: RecipeIdentifier } + +export type HerbReference = { + id: HerbIdentifier +} + +export type HerbalAidOrPreserveReference = { + id: HerbalAidOrPreserveIdentifier +} \ No newline at end of file diff --git a/src/types/equipment/item/Herb.ts b/src/types/equipment/item/Herb.ts index afd46ff9..d5a6f315 100644 --- a/src/types/equipment/item/Herb.ts +++ b/src/types/equipment/item/Herb.ts @@ -12,8 +12,8 @@ import { LocaleMap } from "../../_LocaleMap.js" import { NonEmptyMarkdown, NonEmptyString } from "../../_NonEmptyString.js" import { Errata } from "../../source/_Erratum.js" import { PublicationRefs } from "../../source/_PublicationRef.js" -import { EffectType, TimeUnit } from "./_Herbary.js" -import { RecipeReference } from "../../_SimpleReferences.js" +import { EffectType, StorageLife } from "./_Herbary.js" +import { RecipeReference, HerbalAidOrPreserveReference } from "../../_SimpleReferences.js" /** * @title Herb @@ -85,7 +85,7 @@ export type Herb = { storage_life: StorageLifeRaw /** - * The preservation options, identified by IETF language tag (BCP47). + * The preservation options and respective storage life. */ preservation_methods: PreservationMethod[] @@ -97,6 +97,9 @@ export type Herb = { translations: LocaleMap } +/** + * Prevalence and/or conditional prevalence(s) per landscape type. + */ export type LandscapeTypePrevalences = | { tag: "PrevalenceFarNorth", prevalence_far_north: LandscapeTypePrevalence[] } | { tag: "PrevalenceVeld", prevalence_veld: LandscapeTypePrevalence[] } @@ -109,13 +112,18 @@ export type LandscapeTypePrevalences = export type LandscapeTypePrevalence = { /** - * Simple or conditional prevalence(s) in a certain landscape. - * @minItems 1 + * Prevalence class. */ prevalence: PrevalenceClass + /** + * Condition or restrictions concerning the prevalence. + */ condition?: LocaleMap } +/** + * Prevalence class from 5 (common) down to 1 (very rare) + */ export type PrevalenceClass = | "Common" | "Occasional" @@ -123,45 +131,27 @@ export type PrevalenceClass = | "Rare" | "VeryRare" +/** + * The Storage life of a raw herb. + */ export type StorageLifeRaw = | { tag: "Default", default: {} } | { tag: "Special", special: LocaleMap } +/** + * The preservation options of a herb and respective storage life. + */ export type PreservationMethod = { - /** - * All translations for the entry, identified by IETF language tag (BCP47). - */ - translation: LocaleMap - /** - * The storage life of the product. - */ + method: PreservationMethodDescription storage_life: StorageLife } -export type StorageLife = { - /** - * The storage life of a (processed) herb. - * @integer - * @minmum 1 - */ - value: number - unit: TimeUnit -} - -export type PreservationMethodTranslation = { - /** - * Name of the preservation method. - */ - name: NonEmptyString - /** - * Description of the preservation method. - */ - preparation: NonEmptyString - /** - * Alternative effect of the product. - */ - alternative_effect: NonEmptyString -} +/** + * Details on the preservation method of a herb. + */ +export type PreservationMethodDescription = +| { tag: "HerbalAidOrPreserve", herbal_aid_or_preserve: HerbalAidOrPreserveReference } +| { tag: "Special", special: LocaleMap } export type HerbTranslation = { /** diff --git a/src/types/equipment/item/HerbalAid.ts b/src/types/equipment/item/HerbalAid.ts new file mode 100644 index 00000000..a4903ccf --- /dev/null +++ b/src/types/equipment/item/HerbalAid.ts @@ -0,0 +1,81 @@ +/** + * @main HerbalAid + */ + +import { TypeConfig } from "../../../typeConfig.js" +import { todo } from "../../../validation/builders/integrity.js" +import { validateEntityFileName } from "../../../validation/builders/naming.js" +import { createSchemaValidator } from "../../../validation/builders/schema.js" +import { getFilenamePrefixAsNumericId } from "../../../validation/filename.js" +import { LocaleMap } from "../../_LocaleMap.js" +import { NonEmptyString } from "../../_NonEmptyString.js" +import { Errata } from "../../source/_Erratum.js" +import { PublicationRefs } from "../../source/_PublicationRef.js" +import { HerbReference } from "../../_SimpleReferences.js" + +/** + * @title HerbalAid + */ +export type HerbalAid = { + /** + * The aid's identifier. An unique, increasing integer. + * @integer + * @minimum 1 + */ + id: number + + /** + * The main ingredient, a herb. + */ + main_ingredient: HerbReference + + /** + * An alternative main ingredient, a herb. + */ + alternative_main_ingredient?: HerbReference + + /** + * Modifier for plant lore check when making the aid. + * @integer + */ + production_difficulty: number + + /** + * All translations for the entry, identified by IETF language tag (BCP47). + */ + translation: LocaleMap +} + +export type HerbalAidTranslation = { + /** + * Name of the preservation method. + */ + name: NonEmptyString + /** + * Description of the production method and/or effect. + */ + description: NonEmptyString + + /** + * Ingredients beside the main ingredient. + * @minItems 1 + */ + additional_ingredients?: NonEmptyString[] + + /** + * Tools and aids used in the production process. + */ + typical_tools: NonEmptyString[] + + errata?: Errata + + src: PublicationRefs +} + +export const config: TypeConfig = { + name: "HerbalAid", + id: getFilenamePrefixAsNumericId, + integrityValidator: todo("HerbalAid"), + schemaValidator: createSchemaValidator(import.meta.url), + fileNameValidator: validateEntityFileName, +} \ No newline at end of file diff --git a/src/types/equipment/item/HerbalPreserve.ts b/src/types/equipment/item/HerbalPreserve.ts new file mode 100644 index 00000000..00b2592c --- /dev/null +++ b/src/types/equipment/item/HerbalPreserve.ts @@ -0,0 +1,71 @@ +/** + * @main HerbalPreserve + */ + +import { TypeConfig } from "../../../typeConfig.js" +import { todo } from "../../../validation/builders/integrity.js" +import { validateEntityFileName } from "../../../validation/builders/naming.js" +import { createSchemaValidator } from "../../../validation/builders/schema.js" +import { getFilenamePrefixAsNumericId } from "../../../validation/filename.js" +import { LocaleMap } from "../../_LocaleMap.js" +import { NonEmptyString } from "../../_NonEmptyString.js" +import { Errata } from "../../source/_Erratum.js" +import { PublicationRefs } from "../../source/_PublicationRef.js" +import { StorageLife } from "./_Herbary.js" +import { HerbReference } from "../../_SimpleReferences.js" + +/** + * @title HerbalPreserve + */ +export type HerbalPreserve = { + /** + * The preserve's identifier. An unique, increasing integer. + * @integer + * @minimum 1 + */ + id: number + + /** + * The main ingredient, a herb. + */ + main_ingredient: HerbReference + + /** + * The storage life of the product. + */ + storage_life: StorageLife + + /** + * All translations for the entry, identified by IETF language tag (BCP47). + */ + translation: LocaleMap +} + +export type HerbalPreserveTranslation = { + /** + * Name of the preservation method. + */ + name: NonEmptyString + + /** + * Description of the preservation method. + */ + preparation: NonEmptyString + + /** + * Alternative effect of the product. + */ + alternative_effect: NonEmptyString + + errata?: Errata + + src: PublicationRefs +} + +export const config: TypeConfig = { + name: "HerbalPreserve", + id: getFilenamePrefixAsNumericId, + integrityValidator: todo("HerbalPreserve"), + schemaValidator: createSchemaValidator(import.meta.url), + fileNameValidator: validateEntityFileName, +} \ No newline at end of file diff --git a/src/types/equipment/item/_Herbary.ts b/src/types/equipment/item/_Herbary.ts index 1a4fd756..a35738a9 100644 --- a/src/types/equipment/item/_Herbary.ts +++ b/src/types/equipment/item/_Herbary.ts @@ -21,16 +21,6 @@ export type LaboratoryLevel = | "WitchKitchen" | "AlchemistsLaboratory" - -export type TimeUnit = - | "CombatRounds" - | "Minutes" - | "Hours" - | "Days" - | "Weeks" - | "Months" - | "Years" - export type RecipeTradeSecret = { /** * The AP value of the trade secret. @@ -42,3 +32,24 @@ export type RecipeTradeSecret = { */ prerequisites?: PlainGeneralPrerequisites } + +export type StorageLife = { + /** + * The storage life of a (processed) herb. + * @integer + * @minmum 1 + */ + value: number + unit: TimeUnit +} + +export type TimeUnit = + | "CombatRounds" + | "Minutes" + | "Hours" + | "Days" + | "Weeks" + | "Months" + | "Years" + + From 93d6112df3b5d7d43e190b5f043d3b4a83f90864 Mon Sep 17 00:00:00 2001 From: Paul Date: Fri, 19 Jan 2024 20:25:07 +0100 Subject: [PATCH 18/31] chore(items): herb schema - extended preservation --- docs/reference/_Identifier.md | 66 ++++++ docs/reference/_IdentifierGroup.md | 37 +++- docs/reference/_SimpleReferences.md | 28 +++ docs/reference/equipment/item/Herb.md | 200 +++++++++--------- docs/reference/equipment/item/HerbalAid.md | 108 ++++++++++ .../equipment/item/HerbalPreserve.md | 79 +++++++ docs/reference/equipment/item/_Herbary.md | 67 ++++-- schema/_Identifier.schema.json | 54 +++++ schema/_IdentifierGroup.schema.json | 30 ++- schema/_SimpleReferences.schema.json | 24 +++ schema/equipment/item/Herb.schema.json | 119 ++++++----- schema/equipment/item/HerbalAid.schema.json | 89 ++++++++ .../equipment/item/HerbalPreserve.schema.json | 74 +++++++ schema/equipment/item/_Herbary.schema.json | 51 +++-- 14 files changed, 808 insertions(+), 218 deletions(-) create mode 100644 docs/reference/equipment/item/HerbalAid.md create mode 100644 docs/reference/equipment/item/HerbalPreserve.md create mode 100644 schema/equipment/item/HerbalAid.schema.json create mode 100644 schema/equipment/item/HerbalPreserve.schema.json diff --git a/docs/reference/_Identifier.md b/docs/reference/_Identifier.md index d81ff4dc..afad034d 100644 --- a/docs/reference/_Identifier.md +++ b/docs/reference/_Identifier.md @@ -2315,6 +2315,72 @@ The gem or precious stone’s identifier. --- +### `HerbIdentifier` + +- **Type:** Object + +Key | Description | Details +:-- | :-- | :-- +`tag` | | See details +`herb` | The herb’s identifier. | See details + +#### `tag` + +- **Constant:** `"Herb"` + +#### `herb` + +The herb’s identifier. + +- **Type:** Integer +- **Minimum:** `1` + +--- + +### `HerbalAidIdentifier` + +- **Type:** Object + +Key | Description | Details +:-- | :-- | :-- +`tag` | | See details +`herbal_aid` | The herbal aid’s identifier. | See details + +#### `tag` + +- **Constant:** `"HerbalAid"` + +#### `herbal_aid` + +The herbal aid’s identifier. + +- **Type:** Integer +- **Minimum:** `1` + +--- + +### `HerbalPreserveIdentifier` + +- **Type:** Object + +Key | Description | Details +:-- | :-- | :-- +`tag` | | See details +`herbal_preserve` | The herbal preserve’s identifier. | See details + +#### `tag` + +- **Constant:** `"HerbalPreserve"` + +#### `herbal_preserve` + +The herbal preserve’s identifier. + +- **Type:** Integer +- **Minimum:** `1` + +--- + ### `IlluminationLightSourceIdentifier` - **Type:** Object diff --git a/docs/reference/_IdentifierGroup.md b/docs/reference/_IdentifierGroup.md index 25a7b1eb..c4e2791c 100644 --- a/docs/reference/_IdentifierGroup.md +++ b/docs/reference/_IdentifierGroup.md @@ -1419,6 +1419,27 @@ --- +### `OneNumericIdentifier` + +- **Type:** Number +- **Minimum:** `1` + +--- + +### `ManyNumericIdentifiers` + +- **Type:** List +- **Items:** ManyNumericIdentifiers[] +- **Minimum Items:** `2` + +--- + +### `ManyNumericIdentifiers[]` + +- **Type:** OneNumericIdentifier + +--- + ### `RecipeIdentifier` - **Type:** Union @@ -1438,21 +1459,19 @@ --- -### `OneNumericIdentifier` +### `HerbalAidOrPreserveIdentifier` -- **Type:** Number -- **Minimum:** `1` +- **Type:** Union +- **Cases:** HerbalAidOrPreserveIdentifier'HerbalAidIdentifier | HerbalAidOrPreserveIdentifier'HerbalPreserveIdentifier --- -### `ManyNumericIdentifiers` +### `HerbalAidOrPreserveIdentifier'HerbalAidIdentifier` -- **Type:** List -- **Items:** ManyNumericIdentifiers[] -- **Minimum Items:** `2` +- **Type:** HerbalAidIdentifier --- -### `ManyNumericIdentifiers[]` +### `HerbalAidOrPreserveIdentifier'HerbalPreserveIdentifier` -- **Type:** OneNumericIdentifier +- **Type:** HerbalPreserveIdentifier diff --git a/docs/reference/_SimpleReferences.md b/docs/reference/_SimpleReferences.md index b1816769..3141349d 100644 --- a/docs/reference/_SimpleReferences.md +++ b/docs/reference/_SimpleReferences.md @@ -629,3 +629,31 @@ Key | Description | Details #### `id` - **Type:** RecipeIdentifier + +--- + +### `HerbReference` + +- **Type:** Object + +Key | Description | Details +:-- | :-- | :-- +`id` | | See details + +#### `id` + +- **Type:** HerbIdentifier + +--- + +### `HerbalAidOrPreserveReference` + +- **Type:** Object + +Key | Description | Details +:-- | :-- | :-- +`id` | | See details + +#### `id` + +- **Type:** HerbalAidOrPreserveIdentifier diff --git a/docs/reference/equipment/item/Herb.md b/docs/reference/equipment/item/Herb.md index 6475b37d..35c0a8a4 100644 --- a/docs/reference/equipment/item/Herb.md +++ b/docs/reference/equipment/item/Herb.md @@ -16,9 +16,9 @@ Key | Description | Details `uses` | Doses of plant material found with a search check per quality level. | See details `value` | Value per dose, in silverthalers. | See details `cost` | Price per dose, in silverthalers. | See details -`recipes` | The recipes the herb is used in. | See details +`recipes?` | The recipes the herb is used in. | See details `storage_life` | The Storage life of the raw herb. | See details -`preservation_methods` | The preservation options, identified by IETF language tag (BCP47). | See details +`preservation_methods` | The preservation options and respective storage life. | See details `src` | | See details `translations` | All translations for the entry, identified by IETF language tag (BCP47). | See details @@ -82,7 +82,7 @@ Price per dose, in silverthalers. - **Type:** Integer - **Minimum:** `1` -#### `recipes` +#### `recipes?` The recipes the herb is used in. @@ -98,7 +98,7 @@ The Storage life of the raw herb. #### `preservation_methods` -The preservation options, identified by IETF language tag (BCP47). +The preservation options and respective storage life. - **Type:** List - **Items:** Herb/preservation_methods[] @@ -147,8 +147,10 @@ All translations for the entry, identified by IETF language tag (BCP47). ### `LandscapeTypePrevalences` +Prevalence and/or conditional prevalence(s) per landscape type. + - **Type:** Union -- **Cases:** LandscapeTypePrevalences'PrevalenceFarNorth | LandscapeTypePrevalences'PevalenceVeld | LandscapeTypePrevalences'PevalenceMarsh | LandscapeTypePrevalences'PevalenceWoods | LandscapeTypePrevalences'PevalenceRainForest | LandscapeTypePrevalences'PevalenceMountains | LandscapeTypePrevalences'PevalenceDesert | LandscapeTypePrevalences'PevalenceMaraskan +- **Cases:** LandscapeTypePrevalences'PrevalenceFarNorth | LandscapeTypePrevalences'PrevalenceVeld | LandscapeTypePrevalences'PrevalenceMarsh | LandscapeTypePrevalences'PrevalenceWoods | LandscapeTypePrevalences'PrevalenceRainForest | LandscapeTypePrevalences'PrevalenceMountains | LandscapeTypePrevalences'PrevalenceDesert | LandscapeTypePrevalences'PrevalenceMaraskan --- @@ -178,183 +180,183 @@ Key | Description | Details --- -### `LandscapeTypePrevalences'PevalenceVeld` +### `LandscapeTypePrevalences'PrevalenceVeld` - **Type:** Object Key | Description | Details :-- | :-- | :-- -`tag` | | See details -`prevalence_veld` | | See details +`tag` | | See details +`prevalence_veld` | | See details -#### `tag` +#### `tag` -- **Constant:** `"PevalenceVeld"` +- **Constant:** `"PrevalenceVeld"` -#### `prevalence_veld` +#### `prevalence_veld` - **Type:** List -- **Items:** LandscapeTypePrevalences'PevalenceVeld/prevalence_veld[] +- **Items:** LandscapeTypePrevalences'PrevalenceVeld/prevalence_veld[] --- -### `LandscapeTypePrevalences'PevalenceVeld/prevalence_veld[]` +### `LandscapeTypePrevalences'PrevalenceVeld/prevalence_veld[]` - **Type:** LandscapeTypePrevalence --- -### `LandscapeTypePrevalences'PevalenceMarsh` +### `LandscapeTypePrevalences'PrevalenceMarsh` - **Type:** Object Key | Description | Details :-- | :-- | :-- -`tag` | | See details -`prevalence_marsh` | | See details +`tag` | | See details +`prevalence_marsh` | | See details -#### `tag` +#### `tag` -- **Constant:** `"PevalenceMarsh"` +- **Constant:** `"PrevalenceMarsh"` -#### `prevalence_marsh` +#### `prevalence_marsh` - **Type:** List -- **Items:** LandscapeTypePrevalences'PevalenceMarsh/prevalence_marsh[] +- **Items:** LandscapeTypePrevalences'PrevalenceMarsh/prevalence_marsh[] --- -### `LandscapeTypePrevalences'PevalenceMarsh/prevalence_marsh[]` +### `LandscapeTypePrevalences'PrevalenceMarsh/prevalence_marsh[]` - **Type:** LandscapeTypePrevalence --- -### `LandscapeTypePrevalences'PevalenceWoods` +### `LandscapeTypePrevalences'PrevalenceWoods` - **Type:** Object Key | Description | Details :-- | :-- | :-- -`tag` | | See details -`prevalence_woods` | | See details +`tag` | | See details +`prevalence_woods` | | See details -#### `tag` +#### `tag` -- **Constant:** `"PevalenceWoods"` +- **Constant:** `"PrevalenceWoods"` -#### `prevalence_woods` +#### `prevalence_woods` - **Type:** List -- **Items:** LandscapeTypePrevalences'PevalenceWoods/prevalence_woods[] +- **Items:** LandscapeTypePrevalences'PrevalenceWoods/prevalence_woods[] --- -### `LandscapeTypePrevalences'PevalenceWoods/prevalence_woods[]` +### `LandscapeTypePrevalences'PrevalenceWoods/prevalence_woods[]` - **Type:** LandscapeTypePrevalence --- -### `LandscapeTypePrevalences'PevalenceRainForest` +### `LandscapeTypePrevalences'PrevalenceRainForest` - **Type:** Object Key | Description | Details :-- | :-- | :-- -`tag` | | See details -`prevalence_rain_forest` | | See details +`tag` | | See details +`prevalence_rain_forest` | | See details -#### `tag` +#### `tag` -- **Constant:** `"PevalenceRainForest"` +- **Constant:** `"PrevalenceRainForest"` -#### `prevalence_rain_forest` +#### `prevalence_rain_forest` - **Type:** List -- **Items:** LandscapeTypePrevalences'PevalenceRainForest/prevalence_rain_forest[] +- **Items:** LandscapeTypePrevalences'PrevalenceRainForest/prevalence_rain_forest[] --- -### `LandscapeTypePrevalences'PevalenceRainForest/prevalence_rain_forest[]` +### `LandscapeTypePrevalences'PrevalenceRainForest/prevalence_rain_forest[]` - **Type:** LandscapeTypePrevalence --- -### `LandscapeTypePrevalences'PevalenceMountains` +### `LandscapeTypePrevalences'PrevalenceMountains` - **Type:** Object Key | Description | Details :-- | :-- | :-- -`tag` | | See details -`prevalence_mountains` | | See details +`tag` | | See details +`prevalence_mountains` | | See details -#### `tag` +#### `tag` -- **Constant:** `"PevalenceMountains"` +- **Constant:** `"PrevalenceMountains"` -#### `prevalence_mountains` +#### `prevalence_mountains` - **Type:** List -- **Items:** LandscapeTypePrevalences'PevalenceMountains/prevalence_mountains[] +- **Items:** LandscapeTypePrevalences'PrevalenceMountains/prevalence_mountains[] --- -### `LandscapeTypePrevalences'PevalenceMountains/prevalence_mountains[]` +### `LandscapeTypePrevalences'PrevalenceMountains/prevalence_mountains[]` - **Type:** LandscapeTypePrevalence --- -### `LandscapeTypePrevalences'PevalenceDesert` +### `LandscapeTypePrevalences'PrevalenceDesert` - **Type:** Object Key | Description | Details :-- | :-- | :-- -`tag` | | See details -`prevalence_desert` | | See details +`tag` | | See details +`prevalence_desert` | | See details -#### `tag` +#### `tag` -- **Constant:** `"PevalenceDesert"` +- **Constant:** `"PrevalenceDesert"` -#### `prevalence_desert` +#### `prevalence_desert` - **Type:** List -- **Items:** LandscapeTypePrevalences'PevalenceDesert/prevalence_desert[] +- **Items:** LandscapeTypePrevalences'PrevalenceDesert/prevalence_desert[] --- -### `LandscapeTypePrevalences'PevalenceDesert/prevalence_desert[]` +### `LandscapeTypePrevalences'PrevalenceDesert/prevalence_desert[]` - **Type:** LandscapeTypePrevalence --- -### `LandscapeTypePrevalences'PevalenceMaraskan` +### `LandscapeTypePrevalences'PrevalenceMaraskan` - **Type:** Object Key | Description | Details :-- | :-- | :-- -`tag` | | See details -`prevalence_maraskan` | | See details +`tag` | | See details +`prevalence_maraskan` | | See details -#### `tag` +#### `tag` -- **Constant:** `"PevalenceMaraskan"` +- **Constant:** `"PrevalenceMaraskan"` -#### `prevalence_maraskan` +#### `prevalence_maraskan` - **Type:** List -- **Items:** LandscapeTypePrevalences'PevalenceMaraskan/prevalence_maraskan[] +- **Items:** LandscapeTypePrevalences'PrevalenceMaraskan/prevalence_maraskan[] --- -### `LandscapeTypePrevalences'PevalenceMaraskan/prevalence_maraskan[]` +### `LandscapeTypePrevalences'PrevalenceMaraskan/prevalence_maraskan[]` - **Type:** LandscapeTypePrevalence @@ -366,23 +368,27 @@ Key | Description | Details Key | Description | Details :-- | :-- | :-- -`prevalence` | Simple or conditional prevalence(s) in a certain landscape. | See details -`condition?` | | See details +`prevalence` | Prevalence class. | See details +`condition?` | Condition or restrictions concerning the prevalence. | See details #### `prevalence` -Simple or conditional prevalence(s) in a certain landscape. +Prevalence class. - **Type:** PrevalenceClass #### `condition?` +Condition or restrictions concerning the prevalence. + - **Type:** LocaleMap<NonEmptyString> --- ### `PrevalenceClass` +Prevalence class from 5 (common) down to 1 (very rare) + - **Type:** Union - **Cases:** PrevalenceClass'0 | PrevalenceClass'1 | PrevalenceClass'2 | PrevalenceClass'3 | PrevalenceClass'4 @@ -420,6 +426,8 @@ Simple or conditional prevalence(s) in a certain landscape. ### `StorageLifeRaw` +The Storage life of a raw herb. + - **Type:** Union - **Cases:** StorageLifeRaw'Default | StorageLifeRaw'Special @@ -471,75 +479,69 @@ Key | Description | Details ### `PreservationMethod` +The preservation options of a herb and respective storage life. + - **Type:** Object Key | Description | Details :-- | :-- | :-- -`translation` | All translations for the entry, identified by IETF language tag (BCP47). | See details -`storage_life` | The storage life of the product. | See details - -#### `translation` +`method` | | See details +`storage_life` | | See details -All translations for the entry, identified by IETF language tag (BCP47). +#### `method` -- **Type:** LocaleMap<PreservationMethodTranslation> +- **Type:** PreservationMethodDescription #### `storage_life` -The storage life of the product. +- **Type:** StorageLife + +--- + +### `PreservationMethodDescription` + +Details on the preservation method of a herb. -- **Type:** StorageLife +- **Type:** Union +- **Cases:** PreservationMethodDescription'HerbalAidOrPreserve | PreservationMethodDescription'Special --- -### `StorageLife` +### `PreservationMethodDescription'HerbalAidOrPreserve` - **Type:** Object Key | Description | Details :-- | :-- | :-- -`value` | The storage life of a (processed) herb. | See details -`unit` | | See details +`tag` | | See details +`herbal_aid_or_preserve` | | See details -#### `value` +#### `tag` -The storage life of a (processed) herb. +- **Constant:** `"HerbalAidOrPreserve"` -- **Type:** Integer - -#### `unit` +#### `herbal_aid_or_preserve` -- **Type:** TimeUnit +- **Type:** HerbalAidOrPreserveReference --- -### `PreservationMethodTranslation` +### `PreservationMethodDescription'Special` - **Type:** Object Key | Description | Details :-- | :-- | :-- -`name` | Name of the preservation method. | See details -`preparation` | Description of the preservation method. | See details -`alternative_effect` | Alternative effect of the product. | See details - -#### `name` - -Name of the preservation method. - -- **Type:** NonEmptyString +`tag` | | See details +`special` | | See details -#### `preparation` +#### `tag` -Description of the preservation method. - -- **Type:** NonEmptyString - -#### `alternative_effect` +- **Constant:** `"Special"` -Alternative effect of the product. +#### `special` -- **Type:** NonEmptyString +- **Type:** LocaleMap<NonEmptyString> --- diff --git a/docs/reference/equipment/item/HerbalAid.md b/docs/reference/equipment/item/HerbalAid.md new file mode 100644 index 00000000..038949e5 --- /dev/null +++ b/docs/reference/equipment/item/HerbalAid.md @@ -0,0 +1,108 @@ +# HerbalAid + +## Definitions + +### HerbalAid (`HerbalAid`) + +- **Type:** Object + +Key | Description | Details +:-- | :-- | :-- +`id` | The aid's identifier. An unique, increasing integer. | See details +`main_ingredient` | The main ingredient, a herb. | See details +`alternative_main_ingredient?` | An alternative main ingredient, a herb. | See details +`production_difficulty` | Modifier for plant lore check when making the aid. | See details +`translation` | All translations for the entry, identified by IETF language tag (BCP47). | See details + +#### `id` + +The aid's identifier. An unique, increasing integer. + +- **Type:** Integer +- **Minimum:** `1` + +#### `main_ingredient` + +The main ingredient, a herb. + +- **Type:** HerbReference + +#### `alternative_main_ingredient?` + +An alternative main ingredient, a herb. + +- **Type:** HerbReference + +#### `production_difficulty` + +Modifier for plant lore check when making the aid. + +- **Type:** Integer + +#### `translation` + +All translations for the entry, identified by IETF language tag (BCP47). + +- **Type:** LocaleMap<HerbalAidTranslation> + +--- + +### `HerbalAidTranslation` + +- **Type:** Object + +Key | Description | Details +:-- | :-- | :-- +`name` | Name of the preservation method. | See details +`description` | Description of the production method and/or effect. | See details +`additional_ingredients?` | Ingredients beside the main ingredient. | See details +`typical_tools` | Tools and aids used in the production process. | See details +`errata?` | | See details +`src` | | See details + +#### `name` + +Name of the preservation method. + +- **Type:** NonEmptyString + +#### `description` + +Description of the production method and/or effect. + +- **Type:** NonEmptyString + +#### `additional_ingredients?` + +Ingredients beside the main ingredient. + +- **Type:** List +- **Items:** HerbalAidTranslation/additional_ingredients[] +- **Minimum Items:** `1` + +#### `typical_tools` + +Tools and aids used in the production process. + +- **Type:** List +- **Items:** HerbalAidTranslation/typical_tools[] + +#### `errata?` + +- **Type:** Errata + +#### `src` + +- **Type:** PublicationRefs + +--- + +### `HerbalAidTranslation/additional_ingredients[]` + +- **Type:** NonEmptyString + +--- + +### `HerbalAidTranslation/typical_tools[]` + +- **Type:** NonEmptyString diff --git a/docs/reference/equipment/item/HerbalPreserve.md b/docs/reference/equipment/item/HerbalPreserve.md new file mode 100644 index 00000000..dd8f0a62 --- /dev/null +++ b/docs/reference/equipment/item/HerbalPreserve.md @@ -0,0 +1,79 @@ +# HerbalPreserve + +## Definitions + +### HerbalPreserve (`HerbalPreserve`) + +- **Type:** Object + +Key | Description | Details +:-- | :-- | :-- +`id` | The preserve's identifier. An unique, increasing integer. | See details +`main_ingredient` | The main ingredient, a herb. | See details +`storage_life` | The storage life of the product. | See details +`translation` | All translations for the entry, identified by IETF language tag (BCP47). | See details + +#### `id` + +The preserve's identifier. An unique, increasing integer. + +- **Type:** Integer +- **Minimum:** `1` + +#### `main_ingredient` + +The main ingredient, a herb. + +- **Type:** HerbReference + +#### `storage_life` + +The storage life of the product. + +- **Type:** StorageLife + +#### `translation` + +All translations for the entry, identified by IETF language tag (BCP47). + +- **Type:** LocaleMap<HerbalPreserveTranslation> + +--- + +### `HerbalPreserveTranslation` + +- **Type:** Object + +Key | Description | Details +:-- | :-- | :-- +`name` | Name of the preservation method. | See details +`preparation` | Description of the preservation method. | See details +`alternative_effect` | Alternative effect of the product. | See details +`errata?` | | See details +`src` | | See details + +#### `name` + +Name of the preservation method. + +- **Type:** NonEmptyString + +#### `preparation` + +Description of the preservation method. + +- **Type:** NonEmptyString + +#### `alternative_effect` + +Alternative effect of the product. + +- **Type:** NonEmptyString + +#### `errata?` + +- **Type:** Errata + +#### `src` + +- **Type:** PublicationRefs diff --git a/docs/reference/equipment/item/_Herbary.md b/docs/reference/equipment/item/_Herbary.md index 62276283..3b8b910c 100644 --- a/docs/reference/equipment/item/_Herbary.md +++ b/docs/reference/equipment/item/_Herbary.md @@ -80,6 +80,50 @@ Effect type categories of a plant or recipe. --- +### `RecipeTradeSecret` + +- **Type:** Object + +Key | Description | Details +:-- | :-- | :-- +`ap_value` | The AP value of the trade secret. | See details +`prerequisites?` | The prerequisites of the trade secret, if any. | See details + +#### `ap_value` + +The AP value of the trade secret. + +- **Type:** Number + +#### `prerequisites?` + +The prerequisites of the trade secret, if any. + +- **Type:** PlainGeneralPrerequisites + +--- + +### `StorageLife` + +- **Type:** Object + +Key | Description | Details +:-- | :-- | :-- +`value` | The storage life of a (processed) herb. | See details +`unit` | | See details + +#### `value` + +The storage life of a (processed) herb. + +- **Type:** Integer + +#### `unit` + +- **Type:** TimeUnit + +--- + ### `TimeUnit` - **Type:** Union @@ -126,26 +170,3 @@ Effect type categories of a plant or recipe. ### `TimeUnit'6` - **Constant:** `"Years"` - ---- - -### `RecipeTradeSecret` - -- **Type:** Object - -Key | Description | Details -:-- | :-- | :-- -`ap_value` | The AP value of the trade secret. | See details -`prerequisites?` | The prerequisites of the trade secret, if any. | See details - -#### `ap_value` - -The AP value of the trade secret. - -- **Type:** Number - -#### `prerequisites?` - -The prerequisites of the trade secret, if any. - -- **Type:** PlainGeneralPrerequisites diff --git a/schema/_Identifier.schema.json b/schema/_Identifier.schema.json index ede8c045..5d11e804 100644 --- a/schema/_Identifier.schema.json +++ b/schema/_Identifier.schema.json @@ -1894,6 +1894,60 @@ ], "additionalProperties": false }, + "HerbIdentifier": { + "type": "object", + "properties": { + "tag": { + "const": "Herb" + }, + "herb": { + "description": "The herb’s identifier.", + "type": "integer", + "minimum": 1 + } + }, + "required": [ + "tag", + "herb" + ], + "additionalProperties": false + }, + "HerbalAidIdentifier": { + "type": "object", + "properties": { + "tag": { + "const": "HerbalAid" + }, + "herbal_aid": { + "description": "The herbal aid’s identifier.", + "type": "integer", + "minimum": 1 + } + }, + "required": [ + "tag", + "herbal_aid" + ], + "additionalProperties": false + }, + "HerbalPreserveIdentifier": { + "type": "object", + "properties": { + "tag": { + "const": "HerbalPreserve" + }, + "herbal_preserve": { + "description": "The herbal preserve’s identifier.", + "type": "integer", + "minimum": 1 + } + }, + "required": [ + "tag", + "herbal_preserve" + ], + "additionalProperties": false + }, "IlluminationLightSourceIdentifier": { "type": "object", "properties": { diff --git a/schema/_IdentifierGroup.schema.json b/schema/_IdentifierGroup.schema.json index 72edf27e..9cebda6e 100644 --- a/schema/_IdentifierGroup.schema.json +++ b/schema/_IdentifierGroup.schema.json @@ -720,16 +720,6 @@ } ] }, - "RecipeIdentifier": { - "oneOf": [ - { - "$ref": "./_Identifier.schema.json#/$defs/ElixirIdentifier" - }, - { - "$ref": "./_Identifier.schema.json#/$defs/PoisonIdentifier" - } - ] - }, "OneNumericIdentifier": { "type": "number", "minimum": 1 @@ -740,6 +730,26 @@ "$ref": "#/$defs/OneNumericIdentifier" }, "minItems": 2 + }, + "RecipeIdentifier": { + "oneOf": [ + { + "$ref": "./_Identifier.schema.json#/$defs/ElixirIdentifier" + }, + { + "$ref": "./_Identifier.schema.json#/$defs/PoisonIdentifier" + } + ] + }, + "HerbalAidOrPreserveIdentifier": { + "oneOf": [ + { + "$ref": "./_Identifier.schema.json#/$defs/HerbalAidIdentifier" + }, + { + "$ref": "./_Identifier.schema.json#/$defs/HerbalPreserveIdentifier" + } + ] } } } diff --git a/schema/_SimpleReferences.schema.json b/schema/_SimpleReferences.schema.json index c44ebcb8..e86a4b28 100644 --- a/schema/_SimpleReferences.schema.json +++ b/schema/_SimpleReferences.schema.json @@ -529,6 +529,30 @@ "id" ], "additionalProperties": false + }, + "HerbReference": { + "type": "object", + "properties": { + "id": { + "$ref": "./_Identifier.schema.json#/$defs/HerbIdentifier" + } + }, + "required": [ + "id" + ], + "additionalProperties": false + }, + "HerbalAidOrPreserveReference": { + "type": "object", + "properties": { + "id": { + "$ref": "./_IdentifierGroup.schema.json#/$defs/HerbalAidOrPreserveIdentifier" + } + }, + "required": [ + "id" + ], + "additionalProperties": false } } } diff --git a/schema/equipment/item/Herb.schema.json b/schema/equipment/item/Herb.schema.json index 98d8b3b8..ac52428a 100644 --- a/schema/equipment/item/Herb.schema.json +++ b/schema/equipment/item/Herb.schema.json @@ -70,7 +70,7 @@ "$ref": "#/$defs/StorageLifeRaw" }, "preservation_methods": { - "description": "The preservation options, identified by IETF language tag (BCP47).", + "description": "The preservation options and respective storage life.", "type": "array", "items": { "$ref": "#/$defs/PreservationMethod" @@ -100,7 +100,6 @@ "uses", "value", "cost", - "recipes", "storage_life", "preservation_methods", "src", @@ -109,6 +108,7 @@ "additionalProperties": false }, "LandscapeTypePrevalences": { + "description": "Prevalence and/or conditional prevalence(s) per landscape type.", "oneOf": [ { "type": "object", @@ -133,7 +133,7 @@ "type": "object", "properties": { "tag": { - "const": "PevalenceVeld" + "const": "PrevalenceVeld" }, "prevalence_veld": { "type": "array", @@ -152,7 +152,7 @@ "type": "object", "properties": { "tag": { - "const": "PevalenceMarsh" + "const": "PrevalenceMarsh" }, "prevalence_marsh": { "type": "array", @@ -171,7 +171,7 @@ "type": "object", "properties": { "tag": { - "const": "PevalenceWoods" + "const": "PrevalenceWoods" }, "prevalence_woods": { "type": "array", @@ -190,7 +190,7 @@ "type": "object", "properties": { "tag": { - "const": "PevalenceRainForest" + "const": "PrevalenceRainForest" }, "prevalence_rain_forest": { "type": "array", @@ -209,7 +209,7 @@ "type": "object", "properties": { "tag": { - "const": "PevalenceMountains" + "const": "PrevalenceMountains" }, "prevalence_mountains": { "type": "array", @@ -228,7 +228,7 @@ "type": "object", "properties": { "tag": { - "const": "PevalenceDesert" + "const": "PrevalenceDesert" }, "prevalence_desert": { "type": "array", @@ -247,7 +247,7 @@ "type": "object", "properties": { "tag": { - "const": "PevalenceMaraskan" + "const": "PrevalenceMaraskan" }, "prevalence_maraskan": { "type": "array", @@ -268,7 +268,7 @@ "type": "object", "properties": { "prevalence": { - "description": "Simple or conditional prevalence(s) in a certain landscape.", + "description": "Prevalence class.", "$ref": "#/$defs/PrevalenceClass" }, "condition": { @@ -289,6 +289,7 @@ "additionalProperties": false }, "PrevalenceClass": { + "description": "Prevalence class from 5 (common) down to 1 (very rare)", "oneOf": [ { "const": "Common" @@ -308,6 +309,7 @@ ] }, "StorageLifeRaw": { + "description": "The Storage life of a raw herb.", "oneOf": [ { "type": "object", @@ -355,69 +357,66 @@ ] }, "PreservationMethod": { + "description": "The preservation options of a herb and respective storage life.", "type": "object", "properties": { - "translation": { - "description": "All translations for the entry, identified by IETF language tag (BCP47).", - "type": "object", - "patternProperties": { - "^[a-z]{2}-[A-Z]{2}$": { - "$ref": "#/$defs/PreservationMethodTranslation" - } - }, - "minProperties": 1, - "additionalProperties": false + "method": { + "$ref": "#/$defs/PreservationMethodDescription" }, "storage_life": { - "description": "The storage life of the product.", - "$ref": "#/$defs/StorageLife" + "$ref": "./_Herbary.schema.json#/$defs/StorageLife" } }, "required": [ - "translation", + "method", "storage_life" ], "additionalProperties": false }, - "StorageLife": { - "type": "object", - "properties": { - "value": { - "description": "The storage life of a (processed) herb.", - "type": "integer" - }, - "unit": { - "$ref": "./_Herbary.schema.json#/$defs/TimeUnit" - } - }, - "required": [ - "value", - "unit" - ], - "additionalProperties": false - }, - "PreservationMethodTranslation": { - "type": "object", - "properties": { - "name": { - "description": "Name of the preservation method.", - "$ref": "../../_NonEmptyString.schema.json#/$defs/NonEmptyString" - }, - "preparation": { - "description": "Description of the preservation method.", - "$ref": "../../_NonEmptyString.schema.json#/$defs/NonEmptyString" + "PreservationMethodDescription": { + "description": "Details on the preservation method of a herb.", + "oneOf": [ + { + "type": "object", + "properties": { + "tag": { + "const": "HerbalAidOrPreserve" + }, + "herbal_aid_or_preserve": { + "$ref": "../../_SimpleReferences.schema.json#/$defs/HerbalAidOrPreserveReference" + } + }, + "required": [ + "tag", + "herbal_aid_or_preserve" + ], + "additionalProperties": false }, - "alternative_effect": { - "description": "Alternative effect of the product.", - "$ref": "../../_NonEmptyString.schema.json#/$defs/NonEmptyString" + { + "type": "object", + "properties": { + "tag": { + "const": "Special" + }, + "special": { + "description": "All translations for the entry, identified by IETF language tag (BCP47).", + "type": "object", + "patternProperties": { + "^[a-z]{2}-[A-Z]{2}$": { + "$ref": "../../_NonEmptyString.schema.json#/$defs/NonEmptyString" + } + }, + "minProperties": 1, + "additionalProperties": false + } + }, + "required": [ + "tag", + "special" + ], + "additionalProperties": false } - }, - "required": [ - "name", - "preparation", - "alternative_effect" - ], - "additionalProperties": false + ] }, "HerbTranslation": { "type": "object", diff --git a/schema/equipment/item/HerbalAid.schema.json b/schema/equipment/item/HerbalAid.schema.json new file mode 100644 index 00000000..a11ccd31 --- /dev/null +++ b/schema/equipment/item/HerbalAid.schema.json @@ -0,0 +1,89 @@ +{ + "$schema": "https://json-schema.org/draft/2019-09/schema", + "$id": "/equipment/item/HerbalAid.schema.json", + "$ref": "#/$defs/HerbalAid", + "$defs": { + "HerbalAid": { + "title": "HerbalAid", + "type": "object", + "properties": { + "id": { + "description": "The aid's identifier. An unique, increasing integer.", + "type": "integer", + "minimum": 1 + }, + "main_ingredient": { + "description": "The main ingredient, a herb.", + "$ref": "../../_SimpleReferences.schema.json#/$defs/HerbReference" + }, + "alternative_main_ingredient": { + "description": "An alternative main ingredient, a herb.", + "$ref": "../../_SimpleReferences.schema.json#/$defs/HerbReference" + }, + "production_difficulty": { + "description": "Modifier for plant lore check when making the aid.", + "type": "integer" + }, + "translation": { + "description": "All translations for the entry, identified by IETF language tag (BCP47).", + "type": "object", + "patternProperties": { + "^[a-z]{2}-[A-Z]{2}$": { + "$ref": "#/$defs/HerbalAidTranslation" + } + }, + "minProperties": 1, + "additionalProperties": false + } + }, + "required": [ + "id", + "main_ingredient", + "production_difficulty", + "translation" + ], + "additionalProperties": false + }, + "HerbalAidTranslation": { + "type": "object", + "properties": { + "name": { + "description": "Name of the preservation method.", + "$ref": "../../_NonEmptyString.schema.json#/$defs/NonEmptyString" + }, + "description": { + "description": "Description of the production method and/or effect.", + "$ref": "../../_NonEmptyString.schema.json#/$defs/NonEmptyString" + }, + "additional_ingredients": { + "description": "Ingredients beside the main ingredient.", + "type": "array", + "items": { + "$ref": "../../_NonEmptyString.schema.json#/$defs/NonEmptyString" + }, + "minItems": 1 + }, + "typical_tools": { + "description": "Tools and aids used in the production process.", + "type": "array", + "items": { + "$ref": "../../_NonEmptyString.schema.json#/$defs/NonEmptyString" + } + }, + "errata": { + "$ref": "../../source/_Erratum.schema.json#/$defs/Errata" + }, + "src": { + "$ref": "../../source/_PublicationRef.schema.json#/$defs/PublicationRefs" + } + }, + "required": [ + "name", + "description", + "typical_tools", + "src" + ], + "additionalProperties": false + } + } +} diff --git a/schema/equipment/item/HerbalPreserve.schema.json b/schema/equipment/item/HerbalPreserve.schema.json new file mode 100644 index 00000000..ea5d9d7f --- /dev/null +++ b/schema/equipment/item/HerbalPreserve.schema.json @@ -0,0 +1,74 @@ +{ + "$schema": "https://json-schema.org/draft/2019-09/schema", + "$id": "/equipment/item/HerbalPreserve.schema.json", + "$ref": "#/$defs/HerbalPreserve", + "$defs": { + "HerbalPreserve": { + "title": "HerbalPreserve", + "type": "object", + "properties": { + "id": { + "description": "The preserve's identifier. An unique, increasing integer.", + "type": "integer", + "minimum": 1 + }, + "main_ingredient": { + "description": "The main ingredient, a herb.", + "$ref": "../../_SimpleReferences.schema.json#/$defs/HerbReference" + }, + "storage_life": { + "description": "The storage life of the product.", + "$ref": "./_Herbary.schema.json#/$defs/StorageLife" + }, + "translation": { + "description": "All translations for the entry, identified by IETF language tag (BCP47).", + "type": "object", + "patternProperties": { + "^[a-z]{2}-[A-Z]{2}$": { + "$ref": "#/$defs/HerbalPreserveTranslation" + } + }, + "minProperties": 1, + "additionalProperties": false + } + }, + "required": [ + "id", + "main_ingredient", + "storage_life", + "translation" + ], + "additionalProperties": false + }, + "HerbalPreserveTranslation": { + "type": "object", + "properties": { + "name": { + "description": "Name of the preservation method.", + "$ref": "../../_NonEmptyString.schema.json#/$defs/NonEmptyString" + }, + "preparation": { + "description": "Description of the preservation method.", + "$ref": "../../_NonEmptyString.schema.json#/$defs/NonEmptyString" + }, + "alternative_effect": { + "description": "Alternative effect of the product.", + "$ref": "../../_NonEmptyString.schema.json#/$defs/NonEmptyString" + }, + "errata": { + "$ref": "../../source/_Erratum.schema.json#/$defs/Errata" + }, + "src": { + "$ref": "../../source/_PublicationRef.schema.json#/$defs/PublicationRefs" + } + }, + "required": [ + "name", + "preparation", + "alternative_effect", + "src" + ], + "additionalProperties": false + } + } +} diff --git a/schema/equipment/item/_Herbary.schema.json b/schema/equipment/item/_Herbary.schema.json index 288254c5..2c90c067 100644 --- a/schema/equipment/item/_Herbary.schema.json +++ b/schema/equipment/item/_Herbary.schema.json @@ -41,6 +41,40 @@ } ] }, + "RecipeTradeSecret": { + "type": "object", + "properties": { + "ap_value": { + "description": "The AP value of the trade secret.", + "type": "number" + }, + "prerequisites": { + "description": "The prerequisites of the trade secret, if any.", + "$ref": "../../_Prerequisite.schema.json#/$defs/PlainGeneralPrerequisites" + } + }, + "required": [ + "ap_value" + ], + "additionalProperties": false + }, + "StorageLife": { + "type": "object", + "properties": { + "value": { + "description": "The storage life of a (processed) herb.", + "type": "integer" + }, + "unit": { + "$ref": "#/$defs/TimeUnit" + } + }, + "required": [ + "value", + "unit" + ], + "additionalProperties": false + }, "TimeUnit": { "oneOf": [ { @@ -65,23 +99,6 @@ "const": "Years" } ] - }, - "RecipeTradeSecret": { - "type": "object", - "properties": { - "ap_value": { - "description": "The AP value of the trade secret.", - "type": "number" - }, - "prerequisites": { - "description": "The prerequisites of the trade secret, if any.", - "$ref": "../../_Prerequisite.schema.json#/$defs/PlainGeneralPrerequisites" - } - }, - "required": [ - "ap_value" - ], - "additionalProperties": false } } } From 873dfbdbc8b7d7fce3e58836f15858dd45c881dd Mon Sep 17 00:00:00 2001 From: Paul Panther Date: Fri, 19 Jan 2024 20:38:53 +0100 Subject: [PATCH 19/31] tweak(items): herb schema - preservation references --- src/types/_SimpleReferences.ts | 14 +++++++++----- src/types/equipment/item/Herb.ts | 5 +++-- 2 files changed, 12 insertions(+), 7 deletions(-) diff --git a/src/types/_SimpleReferences.ts b/src/types/_SimpleReferences.ts index 2d9c25cf..9b6839b7 100644 --- a/src/types/_SimpleReferences.ts +++ b/src/types/_SimpleReferences.ts @@ -1,4 +1,4 @@ -import { AdvantageIdentifier, AnimalTypeIdentifier, AnimistTribeIdentifier, ArmorIdentifier, AspectIdentifier, AttributeIdentifier, BlessedTraditionIdentifier, BlessingIdentifier, CantripIdentifier, CeremonyIdentifier, CloseCombatTechniqueIdentifier, CultureIdentifier, CurriculumIdentifier, DisadvantageIdentifier, ElementIdentifier, EyeColorIdentifier, GuidelineIdentifier, HairColorIdentifier, HerbIdentifier, LanguageIdentifier, LiturgicalChantIdentifier, MagicalTraditionIdentifier, PactCategoryIdentifier, PactDomainIdentifier, PatronCategoryIdentifier, PatronIdentifier, PersonalityTraitIdentifier, ProfessionIdentifier, ProfessionVariantIdentifier, PropertyIdentifier, RaceIdentifier, RangedCombatTechniqueIdentifier, RitualIdentifier, ScriptIdentifier, SkillGroupIdentifier, SkillIdentifier, SocialStatusIdentifier, SpellIdentifier, SubjectIdentifier, TargetCategoryIdentifier, WeaponIdentifier } from "./_Identifier.js" +import { AdvantageIdentifier, AnimalTypeIdentifier, AnimistTribeIdentifier, ArmorIdentifier, AspectIdentifier, AttributeIdentifier, BlessedTraditionIdentifier, BlessingIdentifier, CantripIdentifier, CeremonyIdentifier, CloseCombatTechniqueIdentifier, CultureIdentifier, CurriculumIdentifier, DisadvantageIdentifier, ElementIdentifier, EyeColorIdentifier, GuidelineIdentifier, HairColorIdentifier, HerbalAidIdentifier, HerbalPreserveIdentifier, HerbIdentifier, LanguageIdentifier, LiturgicalChantIdentifier, MagicalTraditionIdentifier, PactCategoryIdentifier, PactDomainIdentifier, PatronCategoryIdentifier, PatronIdentifier, PersonalityTraitIdentifier, ProfessionIdentifier, ProfessionVariantIdentifier, PropertyIdentifier, RaceIdentifier, RangedCombatTechniqueIdentifier, RitualIdentifier, ScriptIdentifier, SkillGroupIdentifier, SkillIdentifier, SocialStatusIdentifier, SpellIdentifier, SubjectIdentifier, TargetCategoryIdentifier, WeaponIdentifier } from "./_Identifier.js" import { CombatTechniqueIdentifier, HerbalAidOrPreserveIdentifier, SpellworkIdentifier, TraditionIdentifier, RecipeIdentifier } from "./_IdentifierGroup.js" export type FocusRuleSubjectReference = { @@ -181,10 +181,14 @@ export type RecipeReference = { id: RecipeIdentifier } +export type HerbalAidReference = { + id: HerbalAidIdentifier +} + +export type HerbalPreserveReference = { + id: HerbalPreserveIdentifier +} + export type HerbReference = { id: HerbIdentifier } - -export type HerbalAidOrPreserveReference = { - id: HerbalAidOrPreserveIdentifier -} \ No newline at end of file diff --git a/src/types/equipment/item/Herb.ts b/src/types/equipment/item/Herb.ts index d5a6f315..3adcca0f 100644 --- a/src/types/equipment/item/Herb.ts +++ b/src/types/equipment/item/Herb.ts @@ -13,7 +13,7 @@ import { NonEmptyMarkdown, NonEmptyString } from "../../_NonEmptyString.js" import { Errata } from "../../source/_Erratum.js" import { PublicationRefs } from "../../source/_PublicationRef.js" import { EffectType, StorageLife } from "./_Herbary.js" -import { RecipeReference, HerbalAidOrPreserveReference } from "../../_SimpleReferences.js" +import { RecipeReference, HerbalAidReference, HerbalPreserveReference } from "../../_SimpleReferences.js" /** * @title Herb @@ -150,7 +150,8 @@ export type PreservationMethod = { * Details on the preservation method of a herb. */ export type PreservationMethodDescription = -| { tag: "HerbalAidOrPreserve", herbal_aid_or_preserve: HerbalAidOrPreserveReference } +| { tag: "HerbalAid", herbal_aid: HerbalAidReference } +| { tag: "HerbalPreserve", herbal_preserve: HerbalPreserveReference} | { tag: "Special", special: LocaleMap } export type HerbTranslation = { From 85967d74beca6b681732fc42607eaee09e8a1f87 Mon Sep 17 00:00:00 2001 From: Paul Date: Fri, 19 Jan 2024 20:39:42 +0100 Subject: [PATCH 20/31] chore(items): herb schema tweaks --- docs/reference/_SimpleReferences.md | 30 ++++++++++++++++------ docs/reference/equipment/item/Herb.md | 35 ++++++++++++++++++++------ schema/_SimpleReferences.schema.json | 20 ++++++++++++--- schema/equipment/item/Herb.schema.json | 24 +++++++++++++++--- 4 files changed, 85 insertions(+), 24 deletions(-) diff --git a/docs/reference/_SimpleReferences.md b/docs/reference/_SimpleReferences.md index 3141349d..de775e74 100644 --- a/docs/reference/_SimpleReferences.md +++ b/docs/reference/_SimpleReferences.md @@ -632,28 +632,42 @@ Key | Description | Details --- -### `HerbReference` +### `HerbalAidReference` - **Type:** Object Key | Description | Details :-- | :-- | :-- -`id` | | See details +`id` | | See details -#### `id` +#### `id` -- **Type:** HerbIdentifier +- **Type:** HerbalAidIdentifier + +--- + +### `HerbalPreserveReference` + +- **Type:** Object + +Key | Description | Details +:-- | :-- | :-- +`id` | | See details + +#### `id` + +- **Type:** HerbalPreserveIdentifier --- -### `HerbalAidOrPreserveReference` +### `HerbReference` - **Type:** Object Key | Description | Details :-- | :-- | :-- -`id` | | See details +`id` | | See details -#### `id` +#### `id` -- **Type:** HerbalAidOrPreserveIdentifier +- **Type:** HerbIdentifier diff --git a/docs/reference/equipment/item/Herb.md b/docs/reference/equipment/item/Herb.md index 35c0a8a4..bcd5aefc 100644 --- a/docs/reference/equipment/item/Herb.md +++ b/docs/reference/equipment/item/Herb.md @@ -503,26 +503,45 @@ Key | Description | Details Details on the preservation method of a herb. - **Type:** Union -- **Cases:** PreservationMethodDescription'HerbalAidOrPreserve | PreservationMethodDescription'Special +- **Cases:** PreservationMethodDescription'HerbalAid | PreservationMethodDescription'HerbalPreserve | PreservationMethodDescription'Special --- -### `PreservationMethodDescription'HerbalAidOrPreserve` +### `PreservationMethodDescription'HerbalAid` - **Type:** Object Key | Description | Details :-- | :-- | :-- -`tag` | | See details -`herbal_aid_or_preserve` | | See details +`tag` | | See details +`herbal_aid` | | See details -#### `tag` +#### `tag` -- **Constant:** `"HerbalAidOrPreserve"` +- **Constant:** `"HerbalAid"` -#### `herbal_aid_or_preserve` +#### `herbal_aid` -- **Type:** HerbalAidOrPreserveReference +- **Type:** HerbalAidReference + +--- + +### `PreservationMethodDescription'HerbalPreserve` + +- **Type:** Object + +Key | Description | Details +:-- | :-- | :-- +`tag` | | See details +`herbal_preserve` | | See details + +#### `tag` + +- **Constant:** `"HerbalPreserve"` + +#### `herbal_preserve` + +- **Type:** HerbalPreserveReference --- diff --git a/schema/_SimpleReferences.schema.json b/schema/_SimpleReferences.schema.json index e86a4b28..200d95cd 100644 --- a/schema/_SimpleReferences.schema.json +++ b/schema/_SimpleReferences.schema.json @@ -530,11 +530,23 @@ ], "additionalProperties": false }, - "HerbReference": { + "HerbalAidReference": { "type": "object", "properties": { "id": { - "$ref": "./_Identifier.schema.json#/$defs/HerbIdentifier" + "$ref": "./_Identifier.schema.json#/$defs/HerbalAidIdentifier" + } + }, + "required": [ + "id" + ], + "additionalProperties": false + }, + "HerbalPreserveReference": { + "type": "object", + "properties": { + "id": { + "$ref": "./_Identifier.schema.json#/$defs/HerbalPreserveIdentifier" } }, "required": [ @@ -542,11 +554,11 @@ ], "additionalProperties": false }, - "HerbalAidOrPreserveReference": { + "HerbReference": { "type": "object", "properties": { "id": { - "$ref": "./_IdentifierGroup.schema.json#/$defs/HerbalAidOrPreserveIdentifier" + "$ref": "./_Identifier.schema.json#/$defs/HerbIdentifier" } }, "required": [ diff --git a/schema/equipment/item/Herb.schema.json b/schema/equipment/item/Herb.schema.json index ac52428a..34ca4ceb 100644 --- a/schema/equipment/item/Herb.schema.json +++ b/schema/equipment/item/Herb.schema.json @@ -380,15 +380,31 @@ "type": "object", "properties": { "tag": { - "const": "HerbalAidOrPreserve" + "const": "HerbalAid" }, - "herbal_aid_or_preserve": { - "$ref": "../../_SimpleReferences.schema.json#/$defs/HerbalAidOrPreserveReference" + "herbal_aid": { + "$ref": "../../_SimpleReferences.schema.json#/$defs/HerbalAidReference" } }, "required": [ "tag", - "herbal_aid_or_preserve" + "herbal_aid" + ], + "additionalProperties": false + }, + { + "type": "object", + "properties": { + "tag": { + "const": "HerbalPreserve" + }, + "herbal_preserve": { + "$ref": "../../_SimpleReferences.schema.json#/$defs/HerbalPreserveReference" + } + }, + "required": [ + "tag", + "herbal_preserve" ], "additionalProperties": false }, From 5c7f67a64f523475eaa5c49da3d38bded75c6212 Mon Sep 17 00:00:00 2001 From: Paul Panther Date: Fri, 19 Jan 2024 20:49:56 +0100 Subject: [PATCH 21/31] tweak(items): herb schema --- src/types/equipment/item/Herb.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/types/equipment/item/Herb.ts b/src/types/equipment/item/Herb.ts index 3adcca0f..5ea00465 100644 --- a/src/types/equipment/item/Herb.ts +++ b/src/types/equipment/item/Herb.ts @@ -150,8 +150,8 @@ export type PreservationMethod = { * Details on the preservation method of a herb. */ export type PreservationMethodDescription = -| { tag: "HerbalAid", herbal_aid: HerbalAidReference } -| { tag: "HerbalPreserve", herbal_preserve: HerbalPreserveReference} +| HerbalAidReference +| HerbalPreserveReference | { tag: "Special", special: LocaleMap } export type HerbTranslation = { From 34caf303a687cd126160b4b050e0ac319a2386a8 Mon Sep 17 00:00:00 2001 From: Paul Date: Fri, 19 Jan 2024 20:50:25 +0100 Subject: [PATCH 22/31] chore(items): herb schema --- docs/reference/equipment/item/Herb.md | 32 +++----------------------- schema/equipment/item/Herb.schema.json | 30 ++---------------------- 2 files changed, 5 insertions(+), 57 deletions(-) diff --git a/docs/reference/equipment/item/Herb.md b/docs/reference/equipment/item/Herb.md index bcd5aefc..f76e8e14 100644 --- a/docs/reference/equipment/item/Herb.md +++ b/docs/reference/equipment/item/Herb.md @@ -503,43 +503,17 @@ Key | Description | Details Details on the preservation method of a herb. - **Type:** Union -- **Cases:** PreservationMethodDescription'HerbalAid | PreservationMethodDescription'HerbalPreserve | PreservationMethodDescription'Special +- **Cases:** PreservationMethodDescription'HerbalAidReference | PreservationMethodDescription'HerbalPreserveReference | PreservationMethodDescription'Special --- -### `PreservationMethodDescription'HerbalAid` - -- **Type:** Object - -Key | Description | Details -:-- | :-- | :-- -`tag` | | See details -`herbal_aid` | | See details - -#### `tag` - -- **Constant:** `"HerbalAid"` - -#### `herbal_aid` +### `PreservationMethodDescription'HerbalAidReference` - **Type:** HerbalAidReference --- -### `PreservationMethodDescription'HerbalPreserve` - -- **Type:** Object - -Key | Description | Details -:-- | :-- | :-- -`tag` | | See details -`herbal_preserve` | | See details - -#### `tag` - -- **Constant:** `"HerbalPreserve"` - -#### `herbal_preserve` +### `PreservationMethodDescription'HerbalPreserveReference` - **Type:** HerbalPreserveReference diff --git a/schema/equipment/item/Herb.schema.json b/schema/equipment/item/Herb.schema.json index 34ca4ceb..586f546b 100644 --- a/schema/equipment/item/Herb.schema.json +++ b/schema/equipment/item/Herb.schema.json @@ -377,36 +377,10 @@ "description": "Details on the preservation method of a herb.", "oneOf": [ { - "type": "object", - "properties": { - "tag": { - "const": "HerbalAid" - }, - "herbal_aid": { - "$ref": "../../_SimpleReferences.schema.json#/$defs/HerbalAidReference" - } - }, - "required": [ - "tag", - "herbal_aid" - ], - "additionalProperties": false + "$ref": "../../_SimpleReferences.schema.json#/$defs/HerbalAidReference" }, { - "type": "object", - "properties": { - "tag": { - "const": "HerbalPreserve" - }, - "herbal_preserve": { - "$ref": "../../_SimpleReferences.schema.json#/$defs/HerbalPreserveReference" - } - }, - "required": [ - "tag", - "herbal_preserve" - ], - "additionalProperties": false + "$ref": "../../_SimpleReferences.schema.json#/$defs/HerbalPreserveReference" }, { "type": "object", From 8bce1087a784a19c5b54108d3242153476a2e11e Mon Sep 17 00:00:00 2001 From: Paul Panther Date: Fri, 19 Jan 2024 20:56:15 +0100 Subject: [PATCH 23/31] tweak(items): herb schema --- src/types/equipment/item/Herb.ts | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/src/types/equipment/item/Herb.ts b/src/types/equipment/item/Herb.ts index 5ea00465..8b9641f0 100644 --- a/src/types/equipment/item/Herb.ts +++ b/src/types/equipment/item/Herb.ts @@ -13,7 +13,8 @@ import { NonEmptyMarkdown, NonEmptyString } from "../../_NonEmptyString.js" import { Errata } from "../../source/_Erratum.js" import { PublicationRefs } from "../../source/_PublicationRef.js" import { EffectType, StorageLife } from "./_Herbary.js" -import { RecipeReference, HerbalAidReference, HerbalPreserveReference } from "../../_SimpleReferences.js" +import { RecipeReference } from "../../_SimpleReferences.js" +import { HerbalAidIdentifier, HerbalPreserveIdentifier } from "../../_Identifier.js" /** * @title Herb @@ -150,8 +151,8 @@ export type PreservationMethod = { * Details on the preservation method of a herb. */ export type PreservationMethodDescription = -| HerbalAidReference -| HerbalPreserveReference +| HerbalAidIdentifier +| HerbalPreserveIdentifier | { tag: "Special", special: LocaleMap } export type HerbTranslation = { From 8203ff9d6e70d84f08689ec4594705c55982c532 Mon Sep 17 00:00:00 2001 From: Paul Date: Fri, 19 Jan 2024 20:56:52 +0100 Subject: [PATCH 24/31] chore(items): herb schema tweak --- docs/reference/equipment/item/Herb.md | 10 +++++----- schema/equipment/item/Herb.schema.json | 4 ++-- 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/docs/reference/equipment/item/Herb.md b/docs/reference/equipment/item/Herb.md index f76e8e14..5b785c5a 100644 --- a/docs/reference/equipment/item/Herb.md +++ b/docs/reference/equipment/item/Herb.md @@ -503,19 +503,19 @@ Key | Description | Details Details on the preservation method of a herb. - **Type:** Union -- **Cases:** PreservationMethodDescription'HerbalAidReference | PreservationMethodDescription'HerbalPreserveReference | PreservationMethodDescription'Special +- **Cases:** PreservationMethodDescription'HerbalAidIdentifier | PreservationMethodDescription'HerbalPreserveIdentifier | PreservationMethodDescription'Special --- -### `PreservationMethodDescription'HerbalAidReference` +### `PreservationMethodDescription'HerbalAidIdentifier` -- **Type:** HerbalAidReference +- **Type:** HerbalAidIdentifier --- -### `PreservationMethodDescription'HerbalPreserveReference` +### `PreservationMethodDescription'HerbalPreserveIdentifier` -- **Type:** HerbalPreserveReference +- **Type:** HerbalPreserveIdentifier --- diff --git a/schema/equipment/item/Herb.schema.json b/schema/equipment/item/Herb.schema.json index 586f546b..43a09ddc 100644 --- a/schema/equipment/item/Herb.schema.json +++ b/schema/equipment/item/Herb.schema.json @@ -377,10 +377,10 @@ "description": "Details on the preservation method of a herb.", "oneOf": [ { - "$ref": "../../_SimpleReferences.schema.json#/$defs/HerbalAidReference" + "$ref": "../../_Identifier.schema.json#/$defs/HerbalAidIdentifier" }, { - "$ref": "../../_SimpleReferences.schema.json#/$defs/HerbalPreserveReference" + "$ref": "../../_Identifier.schema.json#/$defs/HerbalPreserveIdentifier" }, { "type": "object", From 2af6faec0170bdb12934c7aa4c6786e078a7d0f7 Mon Sep 17 00:00:00 2001 From: Paul Panther Date: Fri, 19 Jan 2024 21:12:13 +0100 Subject: [PATCH 25/31] fix(items) herb schema - refs --- src/types/equipment/item/HerbalAid.ts | 4 ++-- src/types/equipment/item/HerbalPreserve.ts | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/src/types/equipment/item/HerbalAid.ts b/src/types/equipment/item/HerbalAid.ts index a4903ccf..f8dac8f1 100644 --- a/src/types/equipment/item/HerbalAid.ts +++ b/src/types/equipment/item/HerbalAid.ts @@ -44,6 +44,8 @@ export type HerbalAid = { * All translations for the entry, identified by IETF language tag (BCP47). */ translation: LocaleMap + + src: PublicationRefs } export type HerbalAidTranslation = { @@ -68,8 +70,6 @@ export type HerbalAidTranslation = { typical_tools: NonEmptyString[] errata?: Errata - - src: PublicationRefs } export const config: TypeConfig = { diff --git a/src/types/equipment/item/HerbalPreserve.ts b/src/types/equipment/item/HerbalPreserve.ts index 00b2592c..c0efdd1d 100644 --- a/src/types/equipment/item/HerbalPreserve.ts +++ b/src/types/equipment/item/HerbalPreserve.ts @@ -39,6 +39,8 @@ export type HerbalPreserve = { * All translations for the entry, identified by IETF language tag (BCP47). */ translation: LocaleMap + + src: PublicationRefs } export type HerbalPreserveTranslation = { @@ -58,8 +60,6 @@ export type HerbalPreserveTranslation = { alternative_effect: NonEmptyString errata?: Errata - - src: PublicationRefs } export const config: TypeConfig = { From 3ad92fa3a3baeeace50eaf7462923eddaf8846d7 Mon Sep 17 00:00:00 2001 From: Paul Date: Fri, 19 Jan 2024 21:12:59 +0100 Subject: [PATCH 26/31] chore(items): herb schema - ref fix --- docs/reference/equipment/item/HerbalAid.md | 10 +++++----- docs/reference/equipment/item/HerbalPreserve.md | 10 +++++----- schema/equipment/item/HerbalAid.schema.json | 12 ++++++------ schema/equipment/item/HerbalPreserve.schema.json | 12 ++++++------ 4 files changed, 22 insertions(+), 22 deletions(-) diff --git a/docs/reference/equipment/item/HerbalAid.md b/docs/reference/equipment/item/HerbalAid.md index 038949e5..2b26aa0e 100644 --- a/docs/reference/equipment/item/HerbalAid.md +++ b/docs/reference/equipment/item/HerbalAid.md @@ -13,6 +13,7 @@ Key | Description | Details `alternative_main_ingredient?` | An alternative main ingredient, a herb. | See details `production_difficulty` | Modifier for plant lore check when making the aid. | See details `translation` | All translations for the entry, identified by IETF language tag (BCP47). | See details +`src` | | See details #### `id` @@ -45,6 +46,10 @@ All translations for the entry, identified by IETF language tag (BCP47). - **Type:** LocaleMap<HerbalAidTranslation> +#### `src` + +- **Type:** PublicationRefs + --- ### `HerbalAidTranslation` @@ -58,7 +63,6 @@ Key | Description | Details `additional_ingredients?` | Ingredients beside the main ingredient. | See details `typical_tools` | Tools and aids used in the production process. | See details `errata?` | | See details -`src` | | See details #### `name` @@ -91,10 +95,6 @@ Tools and aids used in the production process. - **Type:** Errata -#### `src` - -- **Type:** PublicationRefs - --- ### `HerbalAidTranslation/additional_ingredients[]` diff --git a/docs/reference/equipment/item/HerbalPreserve.md b/docs/reference/equipment/item/HerbalPreserve.md index dd8f0a62..ac0232f5 100644 --- a/docs/reference/equipment/item/HerbalPreserve.md +++ b/docs/reference/equipment/item/HerbalPreserve.md @@ -12,6 +12,7 @@ Key | Description | Details `main_ingredient` | The main ingredient, a herb. | See details `storage_life` | The storage life of the product. | See details `translation` | All translations for the entry, identified by IETF language tag (BCP47). | See details +`src` | | See details #### `id` @@ -38,6 +39,10 @@ All translations for the entry, identified by IETF language tag (BCP47). - **Type:** LocaleMap<HerbalPreserveTranslation> +#### `src` + +- **Type:** PublicationRefs + --- ### `HerbalPreserveTranslation` @@ -50,7 +55,6 @@ Key | Description | Details `preparation` | Description of the preservation method. | See details `alternative_effect` | Alternative effect of the product. | See details `errata?` | | See details -`src` | | See details #### `name` @@ -73,7 +77,3 @@ Alternative effect of the product. #### `errata?` - **Type:** Errata - -#### `src` - -- **Type:** PublicationRefs diff --git a/schema/equipment/item/HerbalAid.schema.json b/schema/equipment/item/HerbalAid.schema.json index a11ccd31..7510a2d4 100644 --- a/schema/equipment/item/HerbalAid.schema.json +++ b/schema/equipment/item/HerbalAid.schema.json @@ -34,13 +34,17 @@ }, "minProperties": 1, "additionalProperties": false + }, + "src": { + "$ref": "../../source/_PublicationRef.schema.json#/$defs/PublicationRefs" } }, "required": [ "id", "main_ingredient", "production_difficulty", - "translation" + "translation", + "src" ], "additionalProperties": false }, @@ -72,16 +76,12 @@ }, "errata": { "$ref": "../../source/_Erratum.schema.json#/$defs/Errata" - }, - "src": { - "$ref": "../../source/_PublicationRef.schema.json#/$defs/PublicationRefs" } }, "required": [ "name", "description", - "typical_tools", - "src" + "typical_tools" ], "additionalProperties": false } diff --git a/schema/equipment/item/HerbalPreserve.schema.json b/schema/equipment/item/HerbalPreserve.schema.json index ea5d9d7f..50feddac 100644 --- a/schema/equipment/item/HerbalPreserve.schema.json +++ b/schema/equipment/item/HerbalPreserve.schema.json @@ -30,13 +30,17 @@ }, "minProperties": 1, "additionalProperties": false + }, + "src": { + "$ref": "../../source/_PublicationRef.schema.json#/$defs/PublicationRefs" } }, "required": [ "id", "main_ingredient", "storage_life", - "translation" + "translation", + "src" ], "additionalProperties": false }, @@ -57,16 +61,12 @@ }, "errata": { "$ref": "../../source/_Erratum.schema.json#/$defs/Errata" - }, - "src": { - "$ref": "../../source/_PublicationRef.schema.json#/$defs/PublicationRefs" } }, "required": [ "name", "preparation", - "alternative_effect", - "src" + "alternative_effect" ], "additionalProperties": false } From 4ab764ad60117498f81191bd9afc54dae3f8cc29 Mon Sep 17 00:00:00 2001 From: Paul Panther Date: Fri, 19 Jan 2024 21:36:33 +0100 Subject: [PATCH 27/31] teak(items): herb schema --- src/types/_IdentifierGroup.ts | 2 ++ src/types/equipment/item/Herb.ts | 9 +++++++-- 2 files changed, 9 insertions(+), 2 deletions(-) diff --git a/src/types/_IdentifierGroup.ts b/src/types/_IdentifierGroup.ts index 8c1aa3dc..5b895b81 100644 --- a/src/types/_IdentifierGroup.ts +++ b/src/types/_IdentifierGroup.ts @@ -263,6 +263,8 @@ type ManyNumericIdentifiers = OneNumericIdentifier[] export type RecipeIdentifier = | Identifier.ElixirIdentifier | Identifier.PoisonIdentifier + | Identifier.HerbalAidIdentifier + | Identifier.HerbalPreserveIdentifier export type HerbalAidOrPreserveIdentifier = | Identifier.HerbalAidIdentifier diff --git a/src/types/equipment/item/Herb.ts b/src/types/equipment/item/Herb.ts index 8b9641f0..6ea335e1 100644 --- a/src/types/equipment/item/Herb.ts +++ b/src/types/equipment/item/Herb.ts @@ -62,14 +62,14 @@ export type Herb = { /** * Value per dose, in silverthalers. - * @integer + * @float * @minimum 1 */ value: number /** * Price per dose, in silverthalers. - * @integer + * @float * @minimum 1 */ cost: number @@ -187,6 +187,11 @@ export type HerbTranslation = { */ effect_ingest?: NonEmptyString + /** + * Simple recipes the herb is used in. + */ + simple_recipe?: NonEmptyString[] + /** * Additional remarks on the prevalence per landscape type of the herb. */ From 16cc7915f0cedf6cae00e20ec24ef16d25b3dd1e Mon Sep 17 00:00:00 2001 From: Paul Date: Fri, 19 Jan 2024 21:37:06 +0100 Subject: [PATCH 28/31] chore(items): herb schema --- docs/reference/_IdentifierGroup.md | 14 +++++++++++++- docs/reference/equipment/item/Herb.md | 18 ++++++++++++++++-- schema/_IdentifierGroup.schema.json | 6 ++++++ schema/equipment/item/Herb.schema.json | 11 +++++++++-- 4 files changed, 44 insertions(+), 5 deletions(-) diff --git a/docs/reference/_IdentifierGroup.md b/docs/reference/_IdentifierGroup.md index c4e2791c..af4a7a53 100644 --- a/docs/reference/_IdentifierGroup.md +++ b/docs/reference/_IdentifierGroup.md @@ -1443,7 +1443,7 @@ ### `RecipeIdentifier` - **Type:** Union -- **Cases:** RecipeIdentifier'ElixirIdentifier | RecipeIdentifier'PoisonIdentifier +- **Cases:** RecipeIdentifier'ElixirIdentifier | RecipeIdentifier'PoisonIdentifier | RecipeIdentifier'HerbalAidIdentifier | RecipeIdentifier'HerbalPreserveIdentifier --- @@ -1459,6 +1459,18 @@ --- +### `RecipeIdentifier'HerbalAidIdentifier` + +- **Type:** HerbalAidIdentifier + +--- + +### `RecipeIdentifier'HerbalPreserveIdentifier` + +- **Type:** HerbalPreserveIdentifier + +--- + ### `HerbalAidOrPreserveIdentifier` - **Type:** Union diff --git a/docs/reference/equipment/item/Herb.md b/docs/reference/equipment/item/Herb.md index 5b785c5a..2a5412dd 100644 --- a/docs/reference/equipment/item/Herb.md +++ b/docs/reference/equipment/item/Herb.md @@ -72,14 +72,14 @@ Doses of plant material found with a search check per quality level. Value per dose, in silverthalers. -- **Type:** Integer +- **Type:** Number - **Minimum:** `1` #### `cost` Price per dose, in silverthalers. -- **Type:** Integer +- **Type:** Number - **Minimum:** `1` #### `recipes?` @@ -550,6 +550,7 @@ Key | Description | Details `effect_touch?` | The raw plant's effect(s) when touched. | See details `effect_inhale?` | The raw plant's effect(s) when inhaled. | See details `effect_ingest?` | The raw plant's effect(s) when ingested. | See details +`simple_recipe?` | Simple recipes the herb is used in. | See details `prevalence_remarks?` | Additional remarks on the prevalence per landscape type of the herb. | See details `prevalence_regions` | Description of the plant's regional prevalence. | See details `legend_tradition` | Description of traditonal use of and legends about the herb. | See details @@ -593,6 +594,13 @@ The raw plant's effect(s) when ingested. - **Type:** NonEmptyString +#### `simple_recipe?` + +Simple recipes the herb is used in. + +- **Type:** List +- **Items:** HerbTranslation/simple_recipe[] + #### `prevalence_remarks?` Additional remarks on the prevalence per landscape type of the herb. @@ -620,3 +628,9 @@ Description of traditonal use of and legends about the herb. ### `HerbTranslation/alternative_names[]` - **Type:** AlternativeName + +--- + +### `HerbTranslation/simple_recipe[]` + +- **Type:** NonEmptyString diff --git a/schema/_IdentifierGroup.schema.json b/schema/_IdentifierGroup.schema.json index 9cebda6e..2fedc620 100644 --- a/schema/_IdentifierGroup.schema.json +++ b/schema/_IdentifierGroup.schema.json @@ -738,6 +738,12 @@ }, { "$ref": "./_Identifier.schema.json#/$defs/PoisonIdentifier" + }, + { + "$ref": "./_Identifier.schema.json#/$defs/HerbalAidIdentifier" + }, + { + "$ref": "./_Identifier.schema.json#/$defs/HerbalPreserveIdentifier" } ] }, diff --git a/schema/equipment/item/Herb.schema.json b/schema/equipment/item/Herb.schema.json index 43a09ddc..68f279eb 100644 --- a/schema/equipment/item/Herb.schema.json +++ b/schema/equipment/item/Herb.schema.json @@ -49,12 +49,12 @@ }, "value": { "description": "Value per dose, in silverthalers.", - "type": "integer", + "type": "number", "minimum": 1 }, "cost": { "description": "Price per dose, in silverthalers.", - "type": "integer", + "type": "number", "minimum": 1 }, "recipes": { @@ -439,6 +439,13 @@ "description": "The raw plant's effect(s) when ingested.", "$ref": "../../_NonEmptyString.schema.json#/$defs/NonEmptyString" }, + "simple_recipe": { + "description": "Simple recipes the herb is used in.", + "type": "array", + "items": { + "$ref": "../../_NonEmptyString.schema.json#/$defs/NonEmptyString" + } + }, "prevalence_remarks": { "description": "Additional remarks on the prevalence per landscape type of the herb.", "$ref": "../../_NonEmptyString.schema.json#/$defs/NonEmptyString" From 9693fca8c37de186349a8c95eea33b6700fe24bf Mon Sep 17 00:00:00 2001 From: Paul Panther Date: Tue, 2 Jul 2024 14:38:13 +0200 Subject: [PATCH 29/31] fix: min val -> 0 for float --- src/types/equipment/item/Herb.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/types/equipment/item/Herb.ts b/src/types/equipment/item/Herb.ts index 6ea335e1..ba7161db 100644 --- a/src/types/equipment/item/Herb.ts +++ b/src/types/equipment/item/Herb.ts @@ -63,14 +63,14 @@ export type Herb = { /** * Value per dose, in silverthalers. * @float - * @minimum 1 + * @minimum 0 */ value: number /** * Price per dose, in silverthalers. * @float - * @minimum 1 + * @minimum 0 */ cost: number From 2f053ce3805c719be9a3df813d12492a17e7068f Mon Sep 17 00:00:00 2001 From: Paul Panther Date: Tue, 2 Jul 2024 14:41:50 +0200 Subject: [PATCH 30/31] fix: min value 1 -> 0 for float --- docs/reference/equipment/item/Herb.md | 4 ++-- schema/equipment/item/Herb.schema.json | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/docs/reference/equipment/item/Herb.md b/docs/reference/equipment/item/Herb.md index 2a5412dd..8f90ae51 100644 --- a/docs/reference/equipment/item/Herb.md +++ b/docs/reference/equipment/item/Herb.md @@ -73,14 +73,14 @@ Doses of plant material found with a search check per quality level. Value per dose, in silverthalers. - **Type:** Number -- **Minimum:** `1` +- **Minimum:** `0` #### `cost` Price per dose, in silverthalers. - **Type:** Number -- **Minimum:** `1` +- **Minimum:** `0` #### `recipes?` diff --git a/schema/equipment/item/Herb.schema.json b/schema/equipment/item/Herb.schema.json index 68f279eb..5747deca 100644 --- a/schema/equipment/item/Herb.schema.json +++ b/schema/equipment/item/Herb.schema.json @@ -50,12 +50,12 @@ "value": { "description": "Value per dose, in silverthalers.", "type": "number", - "minimum": 1 + "minimum": 0 }, "cost": { "description": "Price per dose, in silverthalers.", "type": "number", - "minimum": 1 + "minimum": 0 }, "recipes": { "description": "The recipes the herb is used in.", From f9cf8259843d2d0bfdc15233896c276a6fa2e181 Mon Sep 17 00:00:00 2001 From: Paul Panther Date: Fri, 11 Oct 2024 21:02:02 +0200 Subject: [PATCH 31/31] fix: remove fluff, redo conditions --- src/types/equipment/item/Herb.ts | 21 +++++---------------- 1 file changed, 5 insertions(+), 16 deletions(-) diff --git a/src/types/equipment/item/Herb.ts b/src/types/equipment/item/Herb.ts index ba7161db..cd02da5c 100644 --- a/src/types/equipment/item/Herb.ts +++ b/src/types/equipment/item/Herb.ts @@ -14,7 +14,7 @@ import { Errata } from "../../source/_Erratum.js" import { PublicationRefs } from "../../source/_PublicationRef.js" import { EffectType, StorageLife } from "./_Herbary.js" import { RecipeReference } from "../../_SimpleReferences.js" -import { HerbalAidIdentifier, HerbalPreserveIdentifier } from "../../_Identifier.js" +import { ElixirIdentifier, HerbalAidIdentifier, HerbalPreserveIdentifier, PoisonIdentifier } from "../../_Identifier.js" /** * @title Herb @@ -110,6 +110,7 @@ export type LandscapeTypePrevalences = | { tag: "PrevalenceMountains", prevalence_mountains: LandscapeTypePrevalence[] } | { tag: "PrevalenceDesert", prevalence_desert: LandscapeTypePrevalence[] } | { tag: "PrevalenceMaraskan", prevalence_maraskan: LandscapeTypePrevalence[] } + | { tag: "PrevalenceAny", prevalence_any: LandscapeTypePrevalence[] } export type LandscapeTypePrevalence = { /** @@ -137,6 +138,7 @@ export type PrevalenceClass = */ export type StorageLifeRaw = | { tag: "Default", default: {} } + | { tag: "Custom", custom: StorageLife } | { tag: "Special", special: LocaleMap } /** @@ -153,6 +155,8 @@ export type PreservationMethod = { export type PreservationMethodDescription = | HerbalAidIdentifier | HerbalPreserveIdentifier +| PoisonIdentifier +| ElixirIdentifier | { tag: "Special", special: LocaleMap } export type HerbTranslation = { @@ -192,21 +196,6 @@ export type HerbTranslation = { */ simple_recipe?: NonEmptyString[] - /** - * Additional remarks on the prevalence per landscape type of the herb. - */ - prevalence_remarks?: NonEmptyString - - /** - * Description of the plant's regional prevalence. - */ - prevalence_regions: NonEmptyString - - /** - * Description of traditonal use of and legends about the herb. - */ - legend_tradition: NonEmptyString - errata?: Errata }