@optolith/entity-descriptions 0.2.0 → 0.3.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +65 -0
- package/lib/creator.d.ts +32 -0
- package/lib/creator.js +72 -0
- package/lib/entities/activatable.d.ts +52 -0
- package/lib/entities/activatable.js +609 -0
- package/lib/entities/alternativeRule.d.ts +7 -0
- package/lib/entities/alternativeRule.js +21 -0
- package/lib/entities/attribute.d.ts +6 -0
- package/lib/entities/attribute.js +15 -0
- package/lib/entities/combatTechnique.d.ts +5 -7
- package/lib/entities/combatTechnique.js +34 -24
- package/lib/entities/condition.d.ts +12 -0
- package/lib/entities/condition.js +63 -0
- package/lib/entities/culture.d.ts +8 -0
- package/lib/entities/culture.js +309 -0
- package/lib/entities/curriculum.d.ts +11 -0
- package/lib/entities/curriculum.js +266 -0
- package/lib/entities/derivedCharacteristic.d.ts +9 -0
- package/lib/entities/derivedCharacteristic.js +91 -0
- package/lib/entities/disease.d.ts +9 -0
- package/lib/entities/disease.js +88 -0
- package/lib/entities/elixir.d.ts +10 -0
- package/lib/entities/elixir.js +76 -0
- package/lib/entities/equipment.d.ts +24 -0
- package/lib/entities/equipment.js +613 -0
- package/lib/entities/equipmentPackage.d.ts +8 -0
- package/lib/entities/equipmentPackage.js +301 -0
- package/lib/entities/experienceLevel.d.ts +3 -2
- package/lib/entities/experienceLevel.js +33 -28
- package/lib/entities/focusRule.d.ts +3 -4
- package/lib/entities/focusRule.js +13 -5
- package/lib/entities/influence.d.ts +7 -0
- package/lib/entities/influence.js +35 -0
- package/lib/entities/liturgicalChant.d.ts +10 -23
- package/lib/entities/liturgicalChant.js +169 -131
- package/lib/entities/optionalRule.d.ts +3 -2
- package/lib/entities/optionalRule.js +4 -3
- package/lib/entities/partial/activatableNameChunks.d.ts +58 -0
- package/lib/entities/partial/activatableNameChunks.js +356 -0
- package/lib/entities/partial/adventurePointsValue.d.ts +9 -0
- package/lib/entities/partial/adventurePointsValue.js +243 -0
- package/lib/entities/partial/animalTypes.d.ts +11 -0
- package/lib/entities/partial/animalTypes.js +13 -0
- package/lib/entities/partial/commonnessRatedAdvantagesAndDisadvantages.d.ts +16 -0
- package/lib/entities/partial/commonnessRatedAdvantagesAndDisadvantages.js +40 -0
- package/lib/entities/partial/dice.d.ts +10 -0
- package/lib/entities/partial/dice.js +13 -0
- package/lib/entities/partial/herbary.d.ts +28 -0
- package/lib/entities/partial/herbary.js +65 -0
- package/lib/entities/partial/map.d.ts +49 -0
- package/lib/entities/partial/map.js +43 -0
- package/lib/entities/partial/mathOperation.d.ts +36 -0
- package/lib/entities/partial/mathOperation.js +107 -0
- package/lib/entities/partial/prerequisites/displayOption.d.ts +7 -0
- package/lib/entities/partial/prerequisites/displayOption.js +19 -0
- package/lib/entities/partial/prerequisites/index.d.ts +67 -0
- package/lib/entities/partial/prerequisites/index.js +189 -0
- package/lib/entities/partial/prerequisites/part.d.ts +26 -0
- package/lib/entities/partial/prerequisites/part.js +88 -0
- package/lib/entities/partial/prerequisites/prerequisiteGroups.d.ts +65 -0
- package/lib/entities/partial/prerequisites/prerequisiteGroups.js +269 -0
- package/lib/entities/partial/prerequisites/single/activatable.d.ts +18 -0
- package/lib/entities/partial/prerequisites/single/activatable.js +40 -0
- package/lib/entities/partial/prerequisites/single/animistPower.d.ts +8 -0
- package/lib/entities/partial/prerequisites/single/animistPower.js +23 -0
- package/lib/entities/partial/prerequisites/single/blessedTradition.d.ts +7 -0
- package/lib/entities/partial/prerequisites/single/blessedTradition.js +32 -0
- package/lib/entities/partial/prerequisites/single/commonSuggestedByRCP.d.ts +6 -0
- package/lib/entities/partial/prerequisites/single/commonSuggestedByRCP.js +19 -0
- package/lib/entities/partial/prerequisites/single/culture.d.ts +8 -0
- package/lib/entities/partial/prerequisites/single/culture.js +20 -0
- package/lib/entities/partial/prerequisites/single/enhancement.d.ts +8 -0
- package/lib/entities/partial/prerequisites/single/enhancement.js +41 -0
- package/lib/entities/partial/prerequisites/single/influence.d.ts +8 -0
- package/lib/entities/partial/prerequisites/single/influence.js +17 -0
- package/lib/entities/partial/prerequisites/single/magicalTradition.d.ts +7 -0
- package/lib/entities/partial/prerequisites/single/magicalTradition.js +27 -0
- package/lib/entities/partial/prerequisites/single/noOtherAncestorBloodAdvantage.d.ts +6 -0
- package/lib/entities/partial/prerequisites/single/noOtherAncestorBloodAdvantage.js +8 -0
- package/lib/entities/partial/prerequisites/single/pact.d.ts +8 -0
- package/lib/entities/partial/prerequisites/single/pact.js +30 -0
- package/lib/entities/partial/prerequisites/single/personalityTrait.d.ts +8 -0
- package/lib/entities/partial/prerequisites/single/personalityTrait.js +28 -0
- package/lib/entities/partial/prerequisites/single/primaryAttribute.d.ts +7 -0
- package/lib/entities/partial/prerequisites/single/primaryAttribute.js +15 -0
- package/lib/entities/partial/prerequisites/single/publication.d.ts +8 -0
- package/lib/entities/partial/prerequisites/single/publication.js +19 -0
- package/lib/entities/partial/prerequisites/single/race.d.ts +8 -0
- package/lib/entities/partial/prerequisites/single/race.js +20 -0
- package/lib/entities/partial/prerequisites/single/rated.d.ts +8 -0
- package/lib/entities/partial/prerequisites/single/rated.js +41 -0
- package/lib/entities/partial/prerequisites/single/ratedMinimumNumber.d.ts +8 -0
- package/lib/entities/partial/prerequisites/single/ratedMinimumNumber.js +89 -0
- package/lib/entities/partial/prerequisites/single/ratedSum.d.ts +8 -0
- package/lib/entities/partial/prerequisites/single/ratedSum.js +21 -0
- package/lib/entities/partial/prerequisites/single/rule.d.ts +7 -0
- package/lib/entities/partial/prerequisites/single/rule.js +4 -0
- package/lib/entities/partial/prerequisites/single/sex.d.ts +7 -0
- package/lib/entities/partial/prerequisites/single/sex.js +19 -0
- package/lib/entities/partial/prerequisites/single/sexualCharacteristic.d.ts +7 -0
- package/lib/entities/partial/prerequisites/single/sexualCharacteristic.js +21 -0
- package/lib/entities/partial/prerequisites/single/socialStatus.d.ts +8 -0
- package/lib/entities/partial/prerequisites/single/socialStatus.js +21 -0
- package/lib/entities/partial/prerequisites/single/state.d.ts +8 -0
- package/lib/entities/partial/prerequisites/single/state.js +20 -0
- package/lib/entities/partial/prerequisites/single/text.d.ts +7 -0
- package/lib/entities/partial/prerequisites/single/text.js +9 -0
- package/lib/entities/partial/professions.d.ts +15 -0
- package/lib/entities/partial/professions.js +19 -0
- package/lib/entities/partial/rated/activatable/castingTime.d.ts +16 -7
- package/lib/entities/partial/rated/activatable/castingTime.js +35 -20
- package/lib/entities/partial/rated/activatable/checkResultBased.d.ts +18 -3
- package/lib/entities/partial/rated/activatable/checkResultBased.js +18 -10
- package/lib/entities/partial/rated/activatable/cost.d.ts +88 -8
- package/lib/entities/partial/rated/activatable/cost.js +183 -115
- package/lib/entities/partial/rated/activatable/duration.d.ts +36 -13
- package/lib/entities/partial/rated/activatable/duration.js +72 -61
- package/lib/entities/partial/rated/activatable/effect.d.ts +4 -4
- package/lib/entities/partial/rated/activatable/effect.js +32 -25
- package/lib/entities/partial/rated/activatable/index.d.ts +31 -27
- package/lib/entities/partial/rated/activatable/index.js +63 -28
- package/lib/entities/partial/rated/activatable/isMinimumMaximum.d.ts +5 -6
- package/lib/entities/partial/rated/activatable/isMinimumMaximum.js +8 -5
- package/lib/entities/partial/rated/activatable/nonModifiableSuffix.d.ts +2 -4
- package/lib/entities/partial/rated/activatable/nonModifiableSuffix.js +7 -42
- package/lib/entities/partial/rated/activatable/range.d.ts +22 -14
- package/lib/entities/partial/rated/activatable/range.js +54 -54
- package/lib/entities/partial/rated/activatable/speed.d.ts +11 -2
- package/lib/entities/partial/rated/activatable/speed.js +14 -1
- package/lib/entities/partial/rated/activatable/targetCategory.d.ts +4 -5
- package/lib/entities/partial/rated/activatable/targetCategory.js +19 -24
- package/lib/entities/partial/rated/improvementCost.d.ts +16 -4
- package/lib/entities/partial/rated/improvementCost.js +63 -4
- package/lib/entities/partial/rated/skillCheck.d.ts +20 -17
- package/lib/entities/partial/rated/skillCheck.js +56 -54
- package/lib/entities/partial/reader.d.ts +266 -0
- package/lib/entities/partial/reader.js +175 -0
- package/lib/entities/partial/responsiveText.d.ts +10 -5
- package/lib/entities/partial/responsiveText.js +19 -3
- package/lib/entities/partial/units/energy.d.ts +5 -8
- package/lib/entities/partial/units/energy.js +5 -23
- package/lib/entities/partial/units/length.d.ts +20 -2
- package/lib/entities/partial/units/length.js +24 -5
- package/lib/entities/partial/units/timeSpan.d.ts +25 -4
- package/lib/entities/partial/units/timeSpan.js +27 -15
- package/lib/entities/partial/unknown.d.ts +5 -1
- package/lib/entities/partial/unknown.js +5 -1
- package/lib/entities/personalityTrait.d.ts +7 -0
- package/lib/entities/personalityTrait.js +56 -0
- package/lib/entities/poison.d.ts +12 -0
- package/lib/entities/poison.js +356 -0
- package/lib/entities/profession.d.ts +12 -0
- package/lib/entities/profession.js +585 -0
- package/lib/entities/race.d.ts +9 -0
- package/lib/entities/race.js +146 -0
- package/lib/entities/sexPractice.d.ts +6 -0
- package/lib/entities/sexPractice.js +33 -0
- package/lib/entities/skill.d.ts +9 -9
- package/lib/entities/skill.js +124 -91
- package/lib/entities/spell.d.ts +83 -26
- package/lib/entities/spell.js +835 -147
- package/lib/entities/state.d.ts +6 -0
- package/lib/entities/state.js +17 -0
- package/lib/helpers/enums.d.ts +11 -0
- package/lib/helpers/enums.js +6 -0
- package/lib/helpers/getTypes.d.ts +12 -482
- package/lib/helpers/getTypes.js +1 -0
- package/lib/helpers/identifiers.d.ts +314 -0
- package/lib/helpers/identifiers.js +333 -0
- package/lib/helpers/locale.d.ts +21 -2
- package/lib/helpers/translate.d.ts +47 -5
- package/lib/helpers/translate.js +13 -6
- package/lib/index.d.ts +848 -21
- package/lib/index.js +182 -17
- package/lib/references/index.d.ts +6 -3
- package/lib/references/index.js +25 -33
- package/lib/references/page.d.ts +1 -1
- package/lib/references/page.js +14 -14
- package/lib/references/pageRange.d.ts +1 -5
- package/lib/references/pageRange.js +7 -16
- package/lib/tsconfig.tsbuildinfo +1 -0
- package/package.json +30 -10
- package/.prettierrc.yml +0 -1
- package/lib/entities/partial/rated/activatable/entity.d.ts +0 -11
- package/lib/entities/partial/rated/activatable/entity.js +0 -12
- package/lib/references/occurrence.d.ts +0 -4
- package/lib/references/occurrence.js +0 -3
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
import { getNameComponents } from "../../activatableNameChunks.js";
|
|
2
|
+
import { printDisplayOption } from "../displayOption.js";
|
|
3
|
+
/**
|
|
4
|
+
* Get the name components of an activatable.
|
|
5
|
+
*/
|
|
6
|
+
export const printActivatableName = (getInstanceById, translate, id, options, level, getResolvedSelectOptionById, displayedInProfession) => {
|
|
7
|
+
const entry = getInstanceById(id);
|
|
8
|
+
if (entry === undefined) {
|
|
9
|
+
return undefined;
|
|
10
|
+
}
|
|
11
|
+
return getNameComponents(translate, id, options, level, entry.nameBuilderRules, entry.translations, t => t.name, getResolvedSelectOptionById, displayedInProfession);
|
|
12
|
+
};
|
|
13
|
+
/**
|
|
14
|
+
* Get the translation of a blessed tradition prerequisite.
|
|
15
|
+
*/
|
|
16
|
+
export const printActivatablePrerequisite = (getInstanceById, getResolvedSelectOptionById, locale, prerequisite, displayedInProfession) => {
|
|
17
|
+
if (prerequisite.display_option !== undefined) {
|
|
18
|
+
return printDisplayOption(locale.translateMap, prerequisite.display_option);
|
|
19
|
+
}
|
|
20
|
+
const nameComponents = printActivatableName(getInstanceById, locale.translate, prerequisite.id, prerequisite.options, prerequisite.level, getResolvedSelectOptionById, displayedInProfession);
|
|
21
|
+
if (nameComponents === undefined) {
|
|
22
|
+
return undefined;
|
|
23
|
+
}
|
|
24
|
+
return {
|
|
25
|
+
label: `${prerequisite.id.kind === "Advantage"
|
|
26
|
+
? prerequisite.active
|
|
27
|
+
? locale.translate("advantage")
|
|
28
|
+
: locale.translate("no advantage")
|
|
29
|
+
: prerequisite.id.kind === "Disadvantage"
|
|
30
|
+
? prerequisite.active
|
|
31
|
+
? locale.translate("disadvantage")
|
|
32
|
+
: locale.translate("no disadvantage")
|
|
33
|
+
: prerequisite.active
|
|
34
|
+
? locale.translate("special ability")
|
|
35
|
+
: locale.translate("no special ability")} `,
|
|
36
|
+
value: nameComponents,
|
|
37
|
+
sentenceType: undefined,
|
|
38
|
+
isMeta: false,
|
|
39
|
+
};
|
|
40
|
+
};
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import type { AnimistPowerPrerequisite } from "optolith-database-schema/gen";
|
|
2
|
+
import { type GetInstanceById } from "../../../../helpers/getTypes.js";
|
|
3
|
+
import { LocaleEnvironment } from "../../../../helpers/locale.js";
|
|
4
|
+
import { PrerequisitePart } from "../part.js";
|
|
5
|
+
/**
|
|
6
|
+
* Get the translation of a culture prerequisite.
|
|
7
|
+
*/
|
|
8
|
+
export declare const printAnimistPowerPrerequisite: (getInstanceById: GetInstanceById<"AnimistPower">, locale: LocaleEnvironment, prerequisite: AnimistPowerPrerequisite) => PrerequisitePart | undefined;
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import { isNotNullish } from "@optolith/helpers/nullable";
|
|
2
|
+
import { romanize } from "@optolith/helpers/roman";
|
|
3
|
+
import { printDisplayOption } from "../displayOption.js";
|
|
4
|
+
/**
|
|
5
|
+
* Get the translation of a culture prerequisite.
|
|
6
|
+
*/
|
|
7
|
+
export const printAnimistPowerPrerequisite = (getInstanceById, locale, prerequisite) => {
|
|
8
|
+
if (prerequisite.display_option !== undefined) {
|
|
9
|
+
return printDisplayOption(locale.translateMap, prerequisite.display_option);
|
|
10
|
+
}
|
|
11
|
+
const animistPower = getInstanceById("AnimistPower", prerequisite.id);
|
|
12
|
+
return {
|
|
13
|
+
value: [
|
|
14
|
+
locale.translateMap(animistPower?.translations)?.name ?? "MISSING_VALUE",
|
|
15
|
+
prerequisite.level === undefined ? undefined : romanize(prerequisite.level),
|
|
16
|
+
prerequisite.value.toString(),
|
|
17
|
+
]
|
|
18
|
+
.filter(isNotNullish)
|
|
19
|
+
.join(" "),
|
|
20
|
+
sentenceType: undefined,
|
|
21
|
+
isMeta: false,
|
|
22
|
+
};
|
|
23
|
+
};
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import type { BlessedTraditionPrerequisite } from "optolith-database-schema/gen";
|
|
2
|
+
import { LocaleEnvironment } from "../../../../helpers/locale.js";
|
|
3
|
+
import { PrerequisitePart } from "../part.js";
|
|
4
|
+
/**
|
|
5
|
+
* Get the translation of a blessed tradition prerequisite.
|
|
6
|
+
*/
|
|
7
|
+
export declare const printBlessedTraditionPrerequisite: (locale: LocaleEnvironment, prerequisite: BlessedTraditionPrerequisite) => PrerequisitePart | undefined;
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
import { assertExhaustive } from "@optolith/helpers/typeSafety";
|
|
2
|
+
import { printDisplayOption } from "../displayOption.js";
|
|
3
|
+
const printValue = (locale, restriction) => {
|
|
4
|
+
switch (restriction?.kind) {
|
|
5
|
+
case "Church":
|
|
6
|
+
return locale.translate("Tradition ({$tradition})", {
|
|
7
|
+
tradition: locale.translate("Church"),
|
|
8
|
+
});
|
|
9
|
+
case "Shamanistic":
|
|
10
|
+
return locale.translate("Tradition ({$tradition})", {
|
|
11
|
+
tradition: locale.translate("Shaman"),
|
|
12
|
+
});
|
|
13
|
+
case undefined:
|
|
14
|
+
return locale.translate("Tradition");
|
|
15
|
+
default:
|
|
16
|
+
return assertExhaustive(restriction);
|
|
17
|
+
}
|
|
18
|
+
};
|
|
19
|
+
/**
|
|
20
|
+
* Get the translation of a blessed tradition prerequisite.
|
|
21
|
+
*/
|
|
22
|
+
export const printBlessedTraditionPrerequisite = (locale, prerequisite) => {
|
|
23
|
+
if (prerequisite.display_option !== undefined) {
|
|
24
|
+
return printDisplayOption(locale.translateMap, prerequisite.display_option);
|
|
25
|
+
}
|
|
26
|
+
return {
|
|
27
|
+
label: `${locale.translate("special ability")} `,
|
|
28
|
+
value: printValue(locale, prerequisite.restriction),
|
|
29
|
+
sentenceType: undefined,
|
|
30
|
+
isMeta: false,
|
|
31
|
+
};
|
|
32
|
+
};
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import { LocaleEnvironment } from "../../../../helpers/locale.js";
|
|
2
|
+
import { PrerequisitePart } from "../part.js";
|
|
3
|
+
/**
|
|
4
|
+
* Get the translation of a culture prerequisite.
|
|
5
|
+
*/
|
|
6
|
+
export declare const printCommonSuggestedByRCPPrerequisite: (locale: LocaleEnvironment, name: string, type: "Advantage" | "Disadvantage") => PrerequisitePart | undefined;
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import { assertExhaustive } from "@optolith/helpers/typeSafety";
|
|
2
|
+
const printType = (locale, type) => {
|
|
3
|
+
switch (type) {
|
|
4
|
+
case "Advantage":
|
|
5
|
+
return locale.translate("advantage");
|
|
6
|
+
case "Disadvantage":
|
|
7
|
+
return locale.translate("disadvantage");
|
|
8
|
+
default:
|
|
9
|
+
return assertExhaustive(type);
|
|
10
|
+
}
|
|
11
|
+
};
|
|
12
|
+
/**
|
|
13
|
+
* Get the translation of a culture prerequisite.
|
|
14
|
+
*/
|
|
15
|
+
export const printCommonSuggestedByRCPPrerequisite = (locale, name, type) => ({
|
|
16
|
+
value: locale.translate("Race, culture, or profession must have {$entry} as an automatic or suggested {$itemOfCategory}", { entry: name, itemOfCategory: printType(locale, type) }),
|
|
17
|
+
sentenceType: undefined,
|
|
18
|
+
isMeta: false,
|
|
19
|
+
});
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { CulturePrerequisite } from "optolith-database-schema/gen";
|
|
2
|
+
import { type GetInstanceById } from "../../../../helpers/getTypes.js";
|
|
3
|
+
import { LocaleEnvironment } from "../../../../helpers/locale.js";
|
|
4
|
+
import { PrerequisitePart } from "../part.js";
|
|
5
|
+
/**
|
|
6
|
+
* Get the translation of a culture prerequisite.
|
|
7
|
+
*/
|
|
8
|
+
export declare const printCulturePrerequisite: (getInstanceById: GetInstanceById<"Culture">, locale: Pick<LocaleEnvironment, "translate" | "translateMap">, prerequisite: CulturePrerequisite) => PrerequisitePart | undefined;
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import { printDisplayOption } from "../displayOption.js";
|
|
2
|
+
/**
|
|
3
|
+
* Get the translation of a culture prerequisite.
|
|
4
|
+
*/
|
|
5
|
+
export const printCulturePrerequisite = (getInstanceById, locale, prerequisite) => {
|
|
6
|
+
if (prerequisite.display_option !== undefined) {
|
|
7
|
+
return printDisplayOption(locale.translateMap, prerequisite.display_option);
|
|
8
|
+
}
|
|
9
|
+
const culture = getInstanceById("Culture", prerequisite.id);
|
|
10
|
+
const cultureTranslation = locale.translateMap(culture?.translations);
|
|
11
|
+
if (cultureTranslation === undefined) {
|
|
12
|
+
return undefined;
|
|
13
|
+
}
|
|
14
|
+
return {
|
|
15
|
+
label: `${locale.translate("Culture")} `,
|
|
16
|
+
value: cultureTranslation.name,
|
|
17
|
+
sentenceType: undefined,
|
|
18
|
+
isMeta: false,
|
|
19
|
+
};
|
|
20
|
+
};
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { type EnhancementPrerequisite } from "optolith-database-schema/gen";
|
|
2
|
+
import { type GetInstanceById } from "../../../../helpers/getTypes.js";
|
|
3
|
+
import { LocaleEnvironment } from "../../../../helpers/locale.js";
|
|
4
|
+
import { PrerequisitePart } from "../part.js";
|
|
5
|
+
/**
|
|
6
|
+
* Get the translation of an external enhancement prerequisite.
|
|
7
|
+
*/
|
|
8
|
+
export declare const printEnhancementPrerequisite: (getInstanceById: GetInstanceById<"Spell" | "Ritual" | "LiturgicalChant" | "Ceremony" | "Enhancement">, locale: LocaleEnvironment, prerequisite: EnhancementPrerequisite) => PrerequisitePart | undefined;
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
import { assertExhaustive } from "@optolith/helpers/typeSafety";
|
|
2
|
+
import { MISSING_VALUE } from "../../unknown.js";
|
|
3
|
+
const printLabel = (locale, skillId) => {
|
|
4
|
+
switch (skillId.kind) {
|
|
5
|
+
case "Spell":
|
|
6
|
+
case "Ritual":
|
|
7
|
+
return locale.translate("spell enhancement");
|
|
8
|
+
case "LiturgicalChant":
|
|
9
|
+
case "Ceremony":
|
|
10
|
+
return locale.translate("liturgical enhancement");
|
|
11
|
+
default:
|
|
12
|
+
return assertExhaustive(skillId);
|
|
13
|
+
}
|
|
14
|
+
};
|
|
15
|
+
const getSkill = (getInstanceById, parentId) => {
|
|
16
|
+
switch (parentId.kind) {
|
|
17
|
+
case "Spell":
|
|
18
|
+
return getInstanceById("Spell", parentId.Spell);
|
|
19
|
+
case "Ritual":
|
|
20
|
+
return getInstanceById("Ritual", parentId.Ritual);
|
|
21
|
+
case "LiturgicalChant":
|
|
22
|
+
return getInstanceById("LiturgicalChant", parentId.LiturgicalChant);
|
|
23
|
+
case "Ceremony":
|
|
24
|
+
return getInstanceById("Ceremony", parentId.Ceremony);
|
|
25
|
+
default:
|
|
26
|
+
return assertExhaustive(parentId);
|
|
27
|
+
}
|
|
28
|
+
};
|
|
29
|
+
/**
|
|
30
|
+
* Get the translation of an external enhancement prerequisite.
|
|
31
|
+
*/
|
|
32
|
+
export const printEnhancementPrerequisite = (getInstanceById, locale, prerequisite) => {
|
|
33
|
+
const enhancement = getInstanceById("Enhancement", prerequisite.id);
|
|
34
|
+
const skill = enhancement && getSkill(getInstanceById, enhancement.parent);
|
|
35
|
+
return {
|
|
36
|
+
label: `${enhancement ? printLabel(locale, enhancement.parent) : MISSING_VALUE} `,
|
|
37
|
+
value: `*${locale.translateMap(enhancement?.translations)?.name ?? MISSING_VALUE}* ${locale.translate("for")} ${locale.translateMap(skill?.translations)?.name ?? MISSING_VALUE}`,
|
|
38
|
+
sentenceType: undefined,
|
|
39
|
+
isMeta: false,
|
|
40
|
+
};
|
|
41
|
+
};
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { InfluencePrerequisite } from "optolith-database-schema/gen";
|
|
2
|
+
import type { GetInstanceById } from "../../../../helpers/getTypes.js";
|
|
3
|
+
import { LocaleEnvironment } from "../../../../helpers/locale.js";
|
|
4
|
+
import { PrerequisitePart } from "../part.js";
|
|
5
|
+
/**
|
|
6
|
+
* Get the translation of a culture prerequisite.
|
|
7
|
+
*/
|
|
8
|
+
export declare const printInfluencePrerequisite: (getInstanceById: GetInstanceById<"Influence">, locale: Pick<LocaleEnvironment, "translate" | "translateMap">, prerequisite: InfluencePrerequisite) => PrerequisitePart | undefined;
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { MISSING_VALUE } from "../../unknown.js";
|
|
2
|
+
import { printDisplayOption } from "../displayOption.js";
|
|
3
|
+
/**
|
|
4
|
+
* Get the translation of a culture prerequisite.
|
|
5
|
+
*/
|
|
6
|
+
export const printInfluencePrerequisite = (getInstanceById, locale, prerequisite) => {
|
|
7
|
+
if (prerequisite.display_option !== undefined) {
|
|
8
|
+
return printDisplayOption(locale.translateMap, prerequisite.display_option);
|
|
9
|
+
}
|
|
10
|
+
const name = locale.translateMap(getInstanceById("Influence", prerequisite.id)?.translations)?.name ??
|
|
11
|
+
MISSING_VALUE;
|
|
12
|
+
return {
|
|
13
|
+
value: `${locale.translate("no influence")} ${name}`,
|
|
14
|
+
sentenceType: undefined,
|
|
15
|
+
isMeta: false,
|
|
16
|
+
};
|
|
17
|
+
};
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import type { MagicalTraditionPrerequisite } from "optolith-database-schema/gen";
|
|
2
|
+
import { LocaleEnvironment } from "../../../../helpers/locale.js";
|
|
3
|
+
import { PrerequisitePart } from "../part.js";
|
|
4
|
+
/**
|
|
5
|
+
* Get the translation of a magical tradition prerequisite.
|
|
6
|
+
*/
|
|
7
|
+
export declare const printMagicalTraditionPrerequisite: (locale: LocaleEnvironment, prerequisite: MagicalTraditionPrerequisite) => PrerequisitePart | undefined;
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import { assertExhaustive } from "@optolith/helpers/typeSafety";
|
|
2
|
+
import { printDisplayOption } from "../displayOption.js";
|
|
3
|
+
const printValue = (locale, restriction) => {
|
|
4
|
+
switch (restriction?.kind) {
|
|
5
|
+
case "CanLearnRituals":
|
|
6
|
+
return locale.translate("Tradition must be able to use rituals");
|
|
7
|
+
case "CanBindFamiliars":
|
|
8
|
+
return locale.translate("Tradition must be able to bind familiars");
|
|
9
|
+
case undefined:
|
|
10
|
+
return locale.translate("Tradition");
|
|
11
|
+
default:
|
|
12
|
+
return assertExhaustive(restriction);
|
|
13
|
+
}
|
|
14
|
+
};
|
|
15
|
+
/**
|
|
16
|
+
* Get the translation of a magical tradition prerequisite.
|
|
17
|
+
*/
|
|
18
|
+
export const printMagicalTraditionPrerequisite = (locale, prerequisite) => {
|
|
19
|
+
if (prerequisite.display_option !== undefined) {
|
|
20
|
+
return printDisplayOption(locale.translateMap, prerequisite.display_option);
|
|
21
|
+
}
|
|
22
|
+
return {
|
|
23
|
+
value: printValue(locale, prerequisite.restriction),
|
|
24
|
+
sentenceType: undefined,
|
|
25
|
+
isMeta: false,
|
|
26
|
+
};
|
|
27
|
+
};
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import { LocaleEnvironment } from "../../../../helpers/locale.js";
|
|
2
|
+
import { PrerequisitePart } from "../part.js";
|
|
3
|
+
/**
|
|
4
|
+
* Get the translation of a culture prerequisite.
|
|
5
|
+
*/
|
|
6
|
+
export declare const printNoOtherAncestorBloodAdvantagePrerequisite: (locale: LocaleEnvironment) => PrerequisitePart | undefined;
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import type { PactPrerequisite } from "optolith-database-schema/gen";
|
|
2
|
+
import { type GetInstanceById } from "../../../../helpers/getTypes.js";
|
|
3
|
+
import { LocaleEnvironment } from "../../../../helpers/locale.js";
|
|
4
|
+
import { PrerequisitePart } from "../part.js";
|
|
5
|
+
/**
|
|
6
|
+
* Get the translation of a culture prerequisite.
|
|
7
|
+
*/
|
|
8
|
+
export declare const printPactPrerequisite: (getInstanceById: GetInstanceById<"PactCategory" | "PactDomain">, locale: LocaleEnvironment, prerequisite: PactPrerequisite) => PrerequisitePart | undefined;
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
import { isNotNullish } from "@optolith/helpers/nullable";
|
|
2
|
+
import { romanize } from "@optolith/helpers/roman";
|
|
3
|
+
import { MISSING_VALUE } from "../../unknown.js";
|
|
4
|
+
import { printDisplayOption } from "../displayOption.js";
|
|
5
|
+
/**
|
|
6
|
+
* Get the translation of a culture prerequisite.
|
|
7
|
+
*/
|
|
8
|
+
export const printPactPrerequisite = (getInstanceById, locale, prerequisite) => {
|
|
9
|
+
if (prerequisite.display_option !== undefined) {
|
|
10
|
+
return printDisplayOption(locale.translateMap, prerequisite.display_option);
|
|
11
|
+
}
|
|
12
|
+
const pactCategory = getInstanceById("PactCategory", prerequisite.category);
|
|
13
|
+
const parts = [
|
|
14
|
+
prerequisite.domain === undefined
|
|
15
|
+
? undefined
|
|
16
|
+
: locale.translate("domain {$domain}", {
|
|
17
|
+
domain: locale.join(prerequisite.domain.map(id => locale.translateMap(getInstanceById("PactDomain", id)?.translations)?.name ??
|
|
18
|
+
MISSING_VALUE), "disjunction"),
|
|
19
|
+
}),
|
|
20
|
+
locale.translate("{$pact} level {$pactLevel}", {
|
|
21
|
+
pact: locale.translateMap(pactCategory?.translations)?.name ?? MISSING_VALUE,
|
|
22
|
+
pactLevel: romanize(prerequisite.level ?? 1),
|
|
23
|
+
}),
|
|
24
|
+
].filter(isNotNullish);
|
|
25
|
+
return {
|
|
26
|
+
value: parts.join(", "),
|
|
27
|
+
sentenceType: undefined,
|
|
28
|
+
isMeta: false,
|
|
29
|
+
};
|
|
30
|
+
};
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { type PersonalityTraitPrerequisite } from "optolith-database-schema/gen";
|
|
2
|
+
import { type GetInstanceById } from "../../../../helpers/getTypes.js";
|
|
3
|
+
import { LocaleEnvironment } from "../../../../helpers/locale.js";
|
|
4
|
+
import { PrerequisitePart } from "../part.js";
|
|
5
|
+
/**
|
|
6
|
+
* Get the translation of a personality trait prerequisite.
|
|
7
|
+
*/
|
|
8
|
+
export declare const printPersonalityTraitPrerequisite: (getInstanceById: GetInstanceById<"PersonalityTrait">, locale: LocaleEnvironment, prerequisite: PersonalityTraitPrerequisite) => PrerequisitePart | undefined;
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import { printDisplayOption } from "../displayOption.js";
|
|
2
|
+
/**
|
|
3
|
+
* Get the translation of a personality trait prerequisite.
|
|
4
|
+
*/
|
|
5
|
+
export const printPersonalityTraitPrerequisite = (getInstanceById, locale, prerequisite) => {
|
|
6
|
+
if (prerequisite.display_option !== undefined) {
|
|
7
|
+
return printDisplayOption(locale.translateMap, prerequisite.display_option);
|
|
8
|
+
}
|
|
9
|
+
const personalityTrait = getInstanceById("PersonalityTrait", prerequisite.id);
|
|
10
|
+
const personalityTraitTranslation = locale.translateMap(personalityTrait?.translations);
|
|
11
|
+
if (personalityTrait === undefined || personalityTraitTranslation === undefined) {
|
|
12
|
+
return undefined;
|
|
13
|
+
}
|
|
14
|
+
const name = `${personalityTraitTranslation.name} (${locale.translate("Level {$level}", {
|
|
15
|
+
level: personalityTrait.level,
|
|
16
|
+
})})`;
|
|
17
|
+
return {
|
|
18
|
+
value: prerequisite.active
|
|
19
|
+
? locale.translate("cannot be chosen at the same time as {$trait}", {
|
|
20
|
+
trait: name,
|
|
21
|
+
})
|
|
22
|
+
: locale.translate("must have {$trait}", {
|
|
23
|
+
trait: name,
|
|
24
|
+
}),
|
|
25
|
+
sentenceType: undefined,
|
|
26
|
+
isMeta: false,
|
|
27
|
+
};
|
|
28
|
+
};
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { PrimaryAttributePrerequisite } from "optolith-database-schema/gen";
|
|
2
|
+
import { LocaleEnvironment } from "../../../../helpers/locale.js";
|
|
3
|
+
import { PrerequisitePart } from "../part.js";
|
|
4
|
+
/**
|
|
5
|
+
* Get the translation of a state prerequisite.
|
|
6
|
+
*/
|
|
7
|
+
export declare const printPrimaryAttributePrerequisite: (locale: LocaleEnvironment, prerequisite: PrimaryAttributePrerequisite) => PrerequisitePart | undefined;
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { printDisplayOption } from "../displayOption.js";
|
|
2
|
+
/**
|
|
3
|
+
* Get the translation of a state prerequisite.
|
|
4
|
+
*/
|
|
5
|
+
export const printPrimaryAttributePrerequisite = (locale, prerequisite) => {
|
|
6
|
+
if (prerequisite.display_option !== undefined) {
|
|
7
|
+
return printDisplayOption(locale.translateMap, prerequisite.display_option);
|
|
8
|
+
}
|
|
9
|
+
return {
|
|
10
|
+
label: `${locale.translate("Primary Attribute")} `,
|
|
11
|
+
value: prerequisite.value.toString(),
|
|
12
|
+
sentenceType: undefined,
|
|
13
|
+
isMeta: false,
|
|
14
|
+
};
|
|
15
|
+
};
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { PublicationPrerequisite } from "optolith-database-schema/gen";
|
|
2
|
+
import { type GetInstanceById } from "../../../../helpers/getTypes.js";
|
|
3
|
+
import { LocaleEnvironment } from "../../../../helpers/locale.js";
|
|
4
|
+
import { PrerequisitePart } from "../part.js";
|
|
5
|
+
/**
|
|
6
|
+
* Get the translation of a state prerequisite.
|
|
7
|
+
*/
|
|
8
|
+
export declare const printPublicationPrerequisite: (getInstanceById: GetInstanceById<"Publication">, locale: LocaleEnvironment, prerequisite: PublicationPrerequisite) => PrerequisitePart | undefined;
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import { printDisplayOption } from "../displayOption.js";
|
|
2
|
+
/**
|
|
3
|
+
* Get the translation of a state prerequisite.
|
|
4
|
+
*/
|
|
5
|
+
export const printPublicationPrerequisite = (getInstanceById, locale, prerequisite) => {
|
|
6
|
+
if (prerequisite.display_option !== undefined) {
|
|
7
|
+
return printDisplayOption(locale.translateMap, prerequisite.display_option);
|
|
8
|
+
}
|
|
9
|
+
const publication = getInstanceById("Publication", prerequisite.id);
|
|
10
|
+
const publicationTranslation = locale.translateMap(publication?.translations);
|
|
11
|
+
if (publicationTranslation === undefined) {
|
|
12
|
+
return undefined;
|
|
13
|
+
}
|
|
14
|
+
return {
|
|
15
|
+
value: publicationTranslation.name,
|
|
16
|
+
sentenceType: undefined,
|
|
17
|
+
isMeta: false,
|
|
18
|
+
};
|
|
19
|
+
};
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { RacePrerequisite } from "optolith-database-schema/gen";
|
|
2
|
+
import { type GetInstanceById } from "../../../../helpers/getTypes.js";
|
|
3
|
+
import { LocaleEnvironment } from "../../../../helpers/locale.js";
|
|
4
|
+
import { PrerequisitePart } from "../part.js";
|
|
5
|
+
/**
|
|
6
|
+
* Get the translation of a race prerequisite.
|
|
7
|
+
*/
|
|
8
|
+
export declare const printRacePrerequisite: (getInstanceById: GetInstanceById<"Race">, locale: Pick<LocaleEnvironment, "translate" | "translateMap">, prerequisite: RacePrerequisite) => PrerequisitePart | undefined;
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import { printDisplayOption } from "../displayOption.js";
|
|
2
|
+
/**
|
|
3
|
+
* Get the translation of a race prerequisite.
|
|
4
|
+
*/
|
|
5
|
+
export const printRacePrerequisite = (getInstanceById, locale, prerequisite) => {
|
|
6
|
+
if (prerequisite.display_option !== undefined) {
|
|
7
|
+
return printDisplayOption(locale.translateMap, prerequisite.display_option);
|
|
8
|
+
}
|
|
9
|
+
const race = getInstanceById("Race", prerequisite.id);
|
|
10
|
+
const raceTranslation = locale.translateMap(race?.translations);
|
|
11
|
+
if (raceTranslation === undefined) {
|
|
12
|
+
return undefined;
|
|
13
|
+
}
|
|
14
|
+
return {
|
|
15
|
+
label: `${locale.translate("Race")} `,
|
|
16
|
+
value: raceTranslation.name,
|
|
17
|
+
sentenceType: undefined,
|
|
18
|
+
isMeta: false,
|
|
19
|
+
};
|
|
20
|
+
};
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import type { RatedPrerequisite } from "optolith-database-schema/gen";
|
|
2
|
+
import { type GetInstanceById } from "../../../../helpers/getTypes.js";
|
|
3
|
+
import { LocaleEnvironment } from "../../../../helpers/locale.js";
|
|
4
|
+
import { PrerequisitePart } from "../part.js";
|
|
5
|
+
/**
|
|
6
|
+
* Get the translation of a blessed tradition prerequisite.
|
|
7
|
+
*/
|
|
8
|
+
export declare const printRatedPrerequisite: (getInstanceById: GetInstanceById<"Attribute" | "Skill" | "CloseCombatTechnique" | "RangedCombatTechnique" | "Spell" | "Ritual" | "LiturgicalChant" | "Ceremony">, locale: Pick<LocaleEnvironment, "translateMap">, prerequisite: RatedPrerequisite) => PrerequisitePart | undefined;
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
import { assertExhaustive } from "@optolith/helpers/typeSafety";
|
|
2
|
+
import { MISSING_VALUE } from "../../unknown.js";
|
|
3
|
+
import { printDisplayOption } from "../displayOption.js";
|
|
4
|
+
const printRatedName = (getInstanceById, translateMap, id) => {
|
|
5
|
+
switch (id.kind) {
|
|
6
|
+
case "Attribute":
|
|
7
|
+
return (translateMap(getInstanceById("Attribute", id.Attribute)?.translations)?.name ??
|
|
8
|
+
MISSING_VALUE);
|
|
9
|
+
case "Skill":
|
|
10
|
+
return translateMap(getInstanceById("Skill", id.Skill)?.translations)?.name ?? MISSING_VALUE;
|
|
11
|
+
case "CloseCombatTechnique":
|
|
12
|
+
return (translateMap(getInstanceById("CloseCombatTechnique", id.CloseCombatTechnique)?.translations)
|
|
13
|
+
?.name ?? MISSING_VALUE);
|
|
14
|
+
case "RangedCombatTechnique":
|
|
15
|
+
return (translateMap(getInstanceById("RangedCombatTechnique", id.RangedCombatTechnique)?.translations)?.name ?? MISSING_VALUE);
|
|
16
|
+
case "Spell":
|
|
17
|
+
return translateMap(getInstanceById("Spell", id.Spell)?.translations)?.name ?? MISSING_VALUE;
|
|
18
|
+
case "Ritual":
|
|
19
|
+
return translateMap(getInstanceById("Ritual", id.Ritual)?.translations)?.name ?? MISSING_VALUE;
|
|
20
|
+
case "LiturgicalChant":
|
|
21
|
+
return (translateMap(getInstanceById("LiturgicalChant", id.LiturgicalChant)?.translations)?.name ??
|
|
22
|
+
MISSING_VALUE);
|
|
23
|
+
case "Ceremony":
|
|
24
|
+
return (translateMap(getInstanceById("Ceremony", id.Ceremony)?.translations)?.name ?? MISSING_VALUE);
|
|
25
|
+
default:
|
|
26
|
+
return assertExhaustive(id);
|
|
27
|
+
}
|
|
28
|
+
};
|
|
29
|
+
/**
|
|
30
|
+
* Get the translation of a blessed tradition prerequisite.
|
|
31
|
+
*/
|
|
32
|
+
export const printRatedPrerequisite = (getInstanceById, locale, prerequisite) => {
|
|
33
|
+
if (prerequisite.display_option !== undefined) {
|
|
34
|
+
return printDisplayOption(locale.translateMap, prerequisite.display_option);
|
|
35
|
+
}
|
|
36
|
+
return {
|
|
37
|
+
value: `${printRatedName(getInstanceById, locale.translateMap, prerequisite.id)} ${prerequisite.value}`,
|
|
38
|
+
sentenceType: undefined,
|
|
39
|
+
isMeta: false,
|
|
40
|
+
};
|
|
41
|
+
};
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import type { RatedMinimumNumberPrerequisite } from "optolith-database-schema/gen";
|
|
2
|
+
import { type GetInstanceById } from "../../../../helpers/getTypes.js";
|
|
3
|
+
import { LocaleEnvironment } from "../../../../helpers/locale.js";
|
|
4
|
+
import { PrerequisitePart } from "../part.js";
|
|
5
|
+
/**
|
|
6
|
+
* Get the translation of a rated minimum number prerequisite.
|
|
7
|
+
*/
|
|
8
|
+
export declare const printRatedMinimumNumberPrerequisite: (getInstanceById: GetInstanceById<"Skill" | "Property" | "Aspect">, locale: LocaleEnvironment, prerequisite: RatedMinimumNumberPrerequisite) => PrerequisitePart | undefined;
|
|
@@ -0,0 +1,89 @@
|
|
|
1
|
+
import { isNotNullish } from "@optolith/helpers/nullable";
|
|
2
|
+
import { assertExhaustive } from "@optolith/helpers/typeSafety";
|
|
3
|
+
import { MISSING_VALUE } from "../../unknown.js";
|
|
4
|
+
import { printDisplayOption } from "../displayOption.js";
|
|
5
|
+
const printNumberOfTheFollowingSkills = (locale, number) => locale.translate(".input {$count :number} {{{$count} of the following skills}}", {
|
|
6
|
+
count: number,
|
|
7
|
+
});
|
|
8
|
+
const printNumberOfAllCombatTechniques = (locale, number) => locale.translate(".input {$count :number} {{{$count} combat techniques}}", {
|
|
9
|
+
count: number,
|
|
10
|
+
});
|
|
11
|
+
const printNumberOfCloseCombatTechniques = (locale, number) => locale.translate(".input {$count :number} {{{$count} close combat techniques}}", {
|
|
12
|
+
count: number,
|
|
13
|
+
});
|
|
14
|
+
const printNumberOfRangedCombatTechniques = (locale, number) => locale.translate(".input {$count :number} {{{$count} ranged combat techniques}}", {
|
|
15
|
+
count: number,
|
|
16
|
+
});
|
|
17
|
+
const printNumberOfCombatTechniques = (locale, category, number) => {
|
|
18
|
+
switch (category.kind) {
|
|
19
|
+
case "All":
|
|
20
|
+
return printNumberOfAllCombatTechniques(locale, number);
|
|
21
|
+
case "Close":
|
|
22
|
+
return printNumberOfCloseCombatTechniques(locale, number);
|
|
23
|
+
case "Ranged":
|
|
24
|
+
return printNumberOfRangedCombatTechniques(locale, number);
|
|
25
|
+
default:
|
|
26
|
+
return assertExhaustive(category);
|
|
27
|
+
}
|
|
28
|
+
};
|
|
29
|
+
/**
|
|
30
|
+
* Get the translation of a rated minimum number prerequisite.
|
|
31
|
+
*/
|
|
32
|
+
export const printRatedMinimumNumberPrerequisite = (getInstanceById, locale, prerequisite) => {
|
|
33
|
+
if (prerequisite.display_option !== undefined) {
|
|
34
|
+
return printDisplayOption(locale.translateMap, prerequisite.display_option);
|
|
35
|
+
}
|
|
36
|
+
switch (prerequisite.targets.kind) {
|
|
37
|
+
case "Skills": {
|
|
38
|
+
const skills = prerequisite.targets.Skills.targets
|
|
39
|
+
.map(id => locale.translateMap(getInstanceById("Skill", id)?.translations)?.name)
|
|
40
|
+
.filter(isNotNullish);
|
|
41
|
+
return {
|
|
42
|
+
value: locale.translate(".input {$minRating :number} {{{$count} on at least SR {$minRating}: {$list}}}", // zwei der folgenden Talente mindestens FW 10:
|
|
43
|
+
{
|
|
44
|
+
count: printNumberOfTheFollowingSkills(locale, prerequisite.number),
|
|
45
|
+
minRating: prerequisite.value,
|
|
46
|
+
list: locale.join(skills, "conjunction"),
|
|
47
|
+
}),
|
|
48
|
+
sentenceType: undefined,
|
|
49
|
+
isMeta: false,
|
|
50
|
+
};
|
|
51
|
+
}
|
|
52
|
+
case "CombatTechniques": {
|
|
53
|
+
// de-DE: "Fernkampfwert 10"
|
|
54
|
+
// en-US: "Ranged Combat 10"
|
|
55
|
+
// nl-BE: "Schiet/werpwaarde 10"
|
|
56
|
+
// fr-FR: "Ranged Combat 10"
|
|
57
|
+
// it-IT: "Una tecnica di combattimento a distanza 10"
|
|
58
|
+
return {
|
|
59
|
+
value: `${printNumberOfCombatTechniques(locale, prerequisite.targets.CombatTechniques.group, prerequisite.number)} ${prerequisite.value}`,
|
|
60
|
+
sentenceType: undefined,
|
|
61
|
+
isMeta: false,
|
|
62
|
+
};
|
|
63
|
+
}
|
|
64
|
+
case "Spellworks": {
|
|
65
|
+
return {
|
|
66
|
+
value: locale.translate(".input {$count :number} .input {$minRating :number} {{{$count} arcane works with the property {$property} at SR {$minRating} or higher}}", {
|
|
67
|
+
count: prerequisite.number,
|
|
68
|
+
property: locale.translateMap(getInstanceById("Property", prerequisite.targets.Spellworks.property)?.translations)?.name ?? MISSING_VALUE,
|
|
69
|
+
minRating: prerequisite.value,
|
|
70
|
+
}),
|
|
71
|
+
sentenceType: undefined,
|
|
72
|
+
isMeta: false,
|
|
73
|
+
};
|
|
74
|
+
}
|
|
75
|
+
case "Liturgies": {
|
|
76
|
+
return {
|
|
77
|
+
value: locale.translate(".input {$count :number} .input {$minRating :number} {{{$count} liturgical chants and ceremonies with the aspect {$aspect} at SR {$minRating} or higher}}", {
|
|
78
|
+
count: prerequisite.number,
|
|
79
|
+
aspect: locale.translateMap(getInstanceById("Aspect", prerequisite.targets.Liturgies.aspect)?.translations)?.name ?? MISSING_VALUE,
|
|
80
|
+
minRating: prerequisite.value,
|
|
81
|
+
}),
|
|
82
|
+
sentenceType: undefined,
|
|
83
|
+
isMeta: false,
|
|
84
|
+
};
|
|
85
|
+
}
|
|
86
|
+
default:
|
|
87
|
+
return assertExhaustive(prerequisite.targets);
|
|
88
|
+
}
|
|
89
|
+
};
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { RatedSumPrerequisite } from "optolith-database-schema/gen";
|
|
2
|
+
import { type GetInstanceById } from "../../../../helpers/getTypes.js";
|
|
3
|
+
import { LocaleEnvironment } from "../../../../helpers/locale.js";
|
|
4
|
+
import { PrerequisitePart } from "../part.js";
|
|
5
|
+
/**
|
|
6
|
+
* Get the translation of a rated sum prerequisite.
|
|
7
|
+
*/
|
|
8
|
+
export declare const printRatedSumPrerequisite: (getInstanceById: GetInstanceById<"Skill">, locale: LocaleEnvironment, prerequisite: RatedSumPrerequisite) => PrerequisitePart | undefined;
|