From c7b7ddb316e3aa92cf69df9b6bc5856e22fb1820 Mon Sep 17 00:00:00 2001 From: Lector Date: Mon, 8 Jun 2026 13:00:31 +0200 Subject: [PATCH 1/3] Changed automatic dis/advantages in the Subrace so they take the same parameters as the other dis/advantages --- src/types/Race.ts | 22 ++++------------------ 1 file changed, 4 insertions(+), 18 deletions(-) diff --git a/src/types/Race.ts b/src/types/Race.ts index 3046fceb..cff5465b 100644 --- a/src/types/Race.ts +++ b/src/types/Race.ts @@ -184,20 +184,6 @@ const SelectableAttributeAdjustment = DB.TypeAlias(import.meta.url, { }), }) -const AutomaticAdvantageDisadvantage = DB.GenTypeAlias(import.meta.url, { - name: "AutomaticAdvantageDisadvantage", - comment: - "An advantage or disadvantage that is automatically applied to the character after selecting the race. This does only work for advantages or disadvantages with no further configuration such as level or special selection.", - parameters: [DB.Param("Identifier")], - type: Identifier => - DB.Object({ - id: DB.Required({ - comment: "The automatic advantage or disadvantage.", - type: DB.TypeArgument(Identifier), - }), - }), -}) - const RandomWeightGeneration = DB.TypeAlias(import.meta.url, { name: "RandomWeightGeneration", comment: "Configuration for random weight generation.", @@ -266,9 +252,9 @@ export const RaceVariant = DB.Entity(import.meta.url, { }), automatic_advantages: DB.Optional({ comment: - "A list of automatically applied advantages. This does only work for advantages with no further configuration such as level or special selection.", + "A list of automatically applied advantages.", type: DB.Array( - DB.GenIncludeIdentifier(AutomaticAdvantageDisadvantage, [AdvantageIdentifier()]), + DB.GenIncludeIdentifier(CommonnessRatedAdvantageDisadvantage, [AdvantageIdentifier()]), { minItems: 1, }, @@ -276,9 +262,9 @@ export const RaceVariant = DB.Entity(import.meta.url, { }), automatic_disadvantages: DB.Optional({ comment: - "A list of automatically applied disadvantages. This does only work for disadvantages with no further configuration such as level or special selection.", + "A list of automatically applied disadvantages.", type: DB.Array( - DB.GenIncludeIdentifier(AutomaticAdvantageDisadvantage, [DisadvantageIdentifier()]), + DB.GenIncludeIdentifier(CommonnessRatedAdvantageDisadvantage, [DisadvantageIdentifier()]), { minItems: 1 }, ), }), From ba5608e442246bbbecd89c3fb01485166603b119 Mon Sep 17 00:00:00 2001 From: Lector Date: Mon, 8 Jun 2026 13:04:03 +0200 Subject: [PATCH 2/3] Prettier --- src/types/Race.ts | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/src/types/Race.ts b/src/types/Race.ts index cff5465b..87a6da0d 100644 --- a/src/types/Race.ts +++ b/src/types/Race.ts @@ -251,20 +251,18 @@ export const RaceVariant = DB.Entity(import.meta.url, { type: DB.Array(CultureIdentifier(), { minItems: 1 }), }), automatic_advantages: DB.Optional({ - comment: - "A list of automatically applied advantages.", + comment: "A list of automatically applied advantages.", type: DB.Array( - DB.GenIncludeIdentifier(CommonnessRatedAdvantageDisadvantage, [AdvantageIdentifier()]), + DB.GenIncludeIdentifier(CommonnessRatedAdvantageDisadvantage, [AdvantageIdentifier()]), { minItems: 1, }, ), }), automatic_disadvantages: DB.Optional({ - comment: - "A list of automatically applied disadvantages.", + comment: "A list of automatically applied disadvantages.", type: DB.Array( - DB.GenIncludeIdentifier(CommonnessRatedAdvantageDisadvantage, [DisadvantageIdentifier()]), + DB.GenIncludeIdentifier(CommonnessRatedAdvantageDisadvantage, [DisadvantageIdentifier()]), { minItems: 1 }, ), }), From 92190555d6bbb2ba7c38667cc09b6cc2dc5b2372 Mon Sep 17 00:00:00 2001 From: Lector Date: Mon, 8 Jun 2026 14:43:20 +0200 Subject: [PATCH 3/3] Changed strongly recommended dis/advantages according to the automatic ones --- src/types/Race.ts | 32 ++++++++++++++++++++++++++++---- 1 file changed, 28 insertions(+), 4 deletions(-) diff --git a/src/types/Race.ts b/src/types/Race.ts index 87a6da0d..f64a8915 100644 --- a/src/types/Race.ts +++ b/src/types/Race.ts @@ -11,6 +11,7 @@ import { HairColorIdentifier, RaceIdentifier, } from "./_Identifier.js" +import { RequirableSelectOptionIdentifier } from "./_IdentifierGroup.js" import { calculationContainsRaceBase, DerivedCharacteristic } from "./DerivedCharacteristic.ts" import { ExperienceLevel } from "./ExperienceLevel.js" import { NestedTranslationMap } from "./Locale.js" @@ -184,6 +185,29 @@ const SelectableAttributeAdjustment = DB.TypeAlias(import.meta.url, { }), }) +const AutomaticAdvantageDisadvantage = DB.GenTypeAlias(import.meta.url, { + name: "AutomaticAdvantageDisadvantage", + comment: + "An advantage or disadvantage that is automatically applied to the character after selecting the race. This does only work for advantages or disadvantages with no further configuration such as level or special selection.", + parameters: [DB.Param("Identifier")], + type: Identifier => + DB.Object({ + id: DB.Required({ + comment: "The automatic advantage or disadvantage.", + type: DB.TypeArgument(Identifier), + }), + level: DB.Optional({ + comment: "The level of the entry.", + type: DB.Integer({ minimum: 1 }), + }), + options: DB.Optional({ + comment: + "Required select options. Order is important. Typically, you only need the first array index, though.", + type: DB.Array(DB.IncludeIdentifier(RequirableSelectOptionIdentifier), { minItems: 1 }), + }), + }), +}) + const RandomWeightGeneration = DB.TypeAlias(import.meta.url, { name: "RandomWeightGeneration", comment: "Configuration for random weight generation.", @@ -253,7 +277,7 @@ export const RaceVariant = DB.Entity(import.meta.url, { automatic_advantages: DB.Optional({ comment: "A list of automatically applied advantages.", type: DB.Array( - DB.GenIncludeIdentifier(CommonnessRatedAdvantageDisadvantage, [AdvantageIdentifier()]), + DB.GenIncludeIdentifier(AutomaticAdvantageDisadvantage, [AdvantageIdentifier()]), { minItems: 1, }, @@ -262,21 +286,21 @@ export const RaceVariant = DB.Entity(import.meta.url, { automatic_disadvantages: DB.Optional({ comment: "A list of automatically applied disadvantages.", type: DB.Array( - DB.GenIncludeIdentifier(CommonnessRatedAdvantageDisadvantage, [DisadvantageIdentifier()]), + DB.GenIncludeIdentifier(AutomaticAdvantageDisadvantage, [DisadvantageIdentifier()]), { minItems: 1 }, ), }), strongly_recommended_advantages: DB.Optional({ comment: "A list of strongly recommended advantages.", type: DB.Array( - DB.GenIncludeIdentifier(CommonnessRatedAdvantageDisadvantage, [AdvantageIdentifier()]), + DB.GenIncludeIdentifier(AutomaticAdvantageDisadvantage, [AdvantageIdentifier()]), { minItems: 1 }, ), }), strongly_recommended_disadvantages: DB.Optional({ comment: "A list of strongly recommended disadvantages.", type: DB.Array( - DB.GenIncludeIdentifier(CommonnessRatedAdvantageDisadvantage, [DisadvantageIdentifier()]), + DB.GenIncludeIdentifier(AutomaticAdvantageDisadvantage, [DisadvantageIdentifier()]), { minItems: 1 }, ), }),