Skip to content

Added Property-Parameter to SkillSelectOptionCategoryPrerequisite#175

Merged
elyukai merged 9 commits into
mainfrom
feature/select-option-property
Jun 27, 2026
Merged

Added Property-Parameter to SkillSelectOptionCategoryPrerequisite#175
elyukai merged 9 commits into
mainfrom
feature/select-option-property

Conversation

@Lector

@Lector Lector commented Jun 24, 2026

Copy link
Copy Markdown
Collaborator

Closes #174

Kann man das so machen? Ich bekomme auch hier Kompilierungsfehler und brauch ein wenig Hilfe

@Lector Lector requested a review from elyukai as a code owner June 24, 2026 12:21

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Eine Möglichkeit wäre, hier statt einem einfachen SpellIdentifier ein Enum zu übergeben, wo man entweder einen konkreten Zauber oder ein Merkmal auswählen muss. Und das dann auch analog für Rituale.

Comment on lines 343 to 361
const GenericSkillsSelectOptionCategoryCategory = DB.GenTypeAlias(import.meta.url, {
name: "GenericSkillsSelectOptionCategoryCategory",
parameters: [DB.Param("Ref")],
type: Ref =>
DB.Object({
specific: DB.Optional({
comment: "Only include (`Intersection`) or exclude (`Difference`) specific entries.",
type: DB.GenIncludeIdentifier(SpecificFromSkillSelectOptionCategoryCategory, [
DB.TypeArgument(Ref),
]),
}),
prerequisites: DB.Optional({
comment: "Generate prerequisites for each entry of the category.",
type: DB.Array(DB.IncludeIdentifier(SkillSelectOptionCategoryPrerequisite), {
minItems: 1,
}),
}),
}),
})

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Eine andere Möglichkeit wäre, diesen Typ zu duplizieren und einen neuen Key properties oder so einzufügen, wo man neben bestimmten Zaubern in specific auch bestimmte Merkmale auflisten kann.

values: () => ({
Self: DB.EnumCase({ type: DB.IncludeIdentifier(SelfPrerequisite) }),
SelectOption: DB.EnumCase({ type: DB.IncludeIdentifier(OptionPrerequisite) }),
Property: DB.EnumCase({ type: DB.IncludeIdentifier(PropertyPrerequisite) }),

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Das hier würde so nicht gehen, da das eine Voraussetzung für die jeweilige Auswahloption generieren würde. Also man bräuchte dann quasi ein Merkmal, um den Zauber wählen zu können. Aber was hieße „ein Merkmal brauchen“? Merkmalskenntnis? Also Voraussetzungen beziehen sich ja immer auf etwas, was ein Charakter hat, nicht auf etwas, was ein Eintrag im Buch hat.

@Lector

Lector commented Jun 25, 2026

Copy link
Copy Markdown
Collaborator Author

Variante 1 umgesetzt. Nochmal drüberschauen bitte.

@elyukai elyukai left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ansonsten finde ich es gut so!

Comment on lines +215 to +230
const SpellFilter = DB.Enum(import.meta.url, {
name: "SpellFilter",
values: () => ({
Identifier: DB.EnumCase({ type: SpellIdentifier() }),
Property: DB.EnumCase({ type: PropertyIdentifier() }),
}),
})

const RitualFilter = DB.Enum(import.meta.url, {
name: "RitualFilter",
values: () => ({
Identifier: DB.EnumCase({ type: RitualIdentifier() }),
Property: DB.EnumCase({ type: PropertyIdentifier() }),
}),
})

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ich würde Identifier vielleicht eher Single oder so nennen, da ja auch die Property ein Identifier ist.

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ist umgesetzt.

@Lector

Lector commented Jun 27, 2026

Copy link
Copy Markdown
Collaborator Author

Anmerkungen umgesetzt!

Comment on lines +5 to +18
export const PropertyPrerequisite = DB.TypeAlias(import.meta.url, {
name: "PropertyPrerequisite",
comment: "Requires a specific property or one of a specific set of properties.",
type: () =>
DB.Object({
id: DB.Required({
comment: "The property�s identifier.",
type: PropertyIdentifier(),
}),
display_option: DB.Optional({
type: DB.IncludeIdentifier(DisplayOption),
}),
}),
})

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ich schätze mal, dass hier die Einrückung nicht passt und er deswegen meckert.

@elyukai elyukai left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Cache kann ich anpassen.

@elyukai elyukai left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Danke!

@elyukai elyukai merged commit 9718f7d into main Jun 27, 2026
2 checks passed
@elyukai elyukai deleted the feature/select-option-property branch June 27, 2026 12:55
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

magic style: select option for N spells with spicific properties

2 participants