@optolith/entity-descriptions 0.11.1 → 0.11.2
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 +8 -0
- package/lib/entities/activatable.js +11 -5
- package/lib/entities/elixir.js +9 -1
- package/lib/entities/influence.js +10 -1
- package/lib/entities/partial/activatableNameChunks.d.ts +2 -2
- package/lib/entities/partial/activatableNameChunks.js +18 -4
- package/lib/entities/partial/adventurePointsValue.js +19 -12
- package/lib/entities/partial/commonnessRatedAdvantagesAndDisadvantages.d.ts +1 -1
- package/lib/entities/partial/commonnessRatedAdvantagesAndDisadvantages.js +1 -1
- package/lib/entities/partial/enhancements.d.ts +1 -1
- package/lib/entities/partial/enhancements.js +13 -4
- package/lib/entities/partial/map.d.ts +1 -1
- package/lib/entities/partial/prerequisites/displayOption.d.ts +2 -7
- package/lib/entities/partial/prerequisites/displayOption.js +1 -18
- package/lib/entities/partial/prerequisites/index.d.ts +22 -20
- package/lib/entities/partial/prerequisites/index.js +68 -65
- package/lib/entities/partial/prerequisites/part.d.ts +3 -4
- package/lib/entities/partial/prerequisites/part.js +13 -11
- package/lib/entities/partial/prerequisites/prerequisiteGroups.d.ts +16 -18
- package/lib/entities/partial/prerequisites/prerequisiteGroups.js +90 -82
- package/lib/entities/partial/prerequisites/single/activatable.d.ts +4 -5
- package/lib/entities/partial/prerequisites/single/activatable.js +21 -29
- package/lib/entities/partial/prerequisites/single/animistPower.d.ts +2 -3
- package/lib/entities/partial/prerequisites/single/animistPower.js +6 -9
- package/lib/entities/partial/prerequisites/single/anySpecialAbilityOfGroup.d.ts +1 -1
- package/lib/entities/partial/prerequisites/single/anySpecialAbilityOfGroup.js +4 -7
- package/lib/entities/partial/prerequisites/single/blessedTradition.d.ts +2 -2
- package/lib/entities/partial/prerequisites/single/blessedTradition.js +15 -17
- package/lib/entities/partial/prerequisites/single/commonSuggestedByRCP.d.ts +2 -2
- package/lib/entities/partial/prerequisites/single/commonSuggestedByRCP.js +9 -6
- package/lib/entities/partial/prerequisites/single/culture.d.ts +2 -3
- package/lib/entities/partial/prerequisites/single/culture.js +8 -15
- package/lib/entities/partial/prerequisites/single/enhancement.d.ts +1 -1
- package/lib/entities/partial/prerequisites/single/enhancement.js +1 -1
- package/lib/entities/partial/prerequisites/single/influence.d.ts +2 -3
- package/lib/entities/partial/prerequisites/single/influence.js +7 -10
- package/lib/entities/partial/prerequisites/single/magicalTradition.d.ts +2 -2
- package/lib/entities/partial/prerequisites/single/magicalTradition.js +10 -12
- package/lib/entities/partial/prerequisites/single/noOtherAncestorBloodAdvantage.d.ts +2 -2
- package/lib/entities/partial/prerequisites/single/noOtherAncestorBloodAdvantage.js +4 -3
- package/lib/entities/partial/prerequisites/single/pact.d.ts +2 -3
- package/lib/entities/partial/prerequisites/single/pact.js +17 -18
- package/lib/entities/partial/prerequisites/single/personalityTrait.d.ts +2 -3
- package/lib/entities/partial/prerequisites/single/personalityTrait.js +21 -22
- package/lib/entities/partial/prerequisites/single/primaryAttribute.d.ts +2 -2
- package/lib/entities/partial/prerequisites/single/primaryAttribute.js +6 -8
- package/lib/entities/partial/prerequisites/single/profession.d.ts +2 -3
- package/lib/entities/partial/prerequisites/single/profession.js +11 -14
- package/lib/entities/partial/prerequisites/single/publication.d.ts +2 -3
- package/lib/entities/partial/prerequisites/single/publication.js +7 -13
- package/lib/entities/partial/prerequisites/single/race.d.ts +2 -3
- package/lib/entities/partial/prerequisites/single/race.js +8 -15
- package/lib/entities/partial/prerequisites/single/rated.d.ts +2 -3
- package/lib/entities/partial/prerequisites/single/rated.js +7 -9
- package/lib/entities/partial/prerequisites/single/ratedMinimumNumber.d.ts +2 -3
- package/lib/entities/partial/prerequisites/single/ratedMinimumNumber.js +52 -53
- package/lib/entities/partial/prerequisites/single/ratedSum.d.ts +2 -3
- package/lib/entities/partial/prerequisites/single/ratedSum.js +15 -15
- package/lib/entities/partial/prerequisites/single/rule.d.ts +2 -2
- package/lib/entities/partial/prerequisites/single/rule.js +2 -1
- package/lib/entities/partial/prerequisites/single/sex.d.ts +2 -2
- package/lib/entities/partial/prerequisites/single/sex.js +7 -6
- package/lib/entities/partial/prerequisites/single/sexualCharacteristic.d.ts +2 -2
- package/lib/entities/partial/prerequisites/single/sexualCharacteristic.js +11 -8
- package/lib/entities/partial/prerequisites/single/socialStatus.d.ts +2 -3
- package/lib/entities/partial/prerequisites/single/socialStatus.js +9 -15
- package/lib/entities/partial/prerequisites/single/state.d.ts +2 -3
- package/lib/entities/partial/prerequisites/single/state.js +8 -15
- package/lib/entities/partial/prerequisites/single/text.d.ts +2 -2
- package/lib/entities/partial/prerequisites/single/text.js +4 -3
- package/lib/entities/partial/prerequisites/single/tinyActivatable.d.ts +1 -1
- package/lib/entities/partial/prerequisites/single/tinyActivatable.js +5 -8
- package/lib/entities/partial/rated/activatable/castingTime.d.ts +1 -1
- package/lib/entities/partial/rated/activatable/checkResultBased.d.ts +1 -1
- package/lib/entities/partial/rated/activatable/cost.d.ts +3 -3
- package/lib/entities/partial/rated/activatable/duration.d.ts +1 -1
- package/lib/entities/partial/rated/activatable/duration.js +1 -1
- package/lib/entities/partial/rated/activatable/effect.d.ts +1 -1
- package/lib/entities/partial/rated/activatable/index.d.ts +1 -1
- package/lib/entities/partial/rated/activatable/isMinimumMaximum.d.ts +1 -1
- package/lib/entities/partial/rated/activatable/nonModifiableSuffix.d.ts +1 -1
- package/lib/entities/partial/rated/activatable/nonModifiableSuffix.js +1 -1
- package/lib/entities/partial/rated/activatable/range.d.ts +1 -1
- package/lib/entities/partial/rated/activatable/targetCategory.d.ts +1 -1
- package/lib/entities/partial/rated/improvementCost.d.ts +1 -1
- package/lib/entities/partial/rated/skillCheck.d.ts +1 -1
- package/lib/entities/partial/reader.d.ts +2 -57
- package/lib/entities/partial/responsiveText.d.ts +1 -1
- package/lib/entities/partial/units/length.d.ts +1 -1
- package/lib/entities/partial/units/timeSpan.d.ts +3 -4
- package/lib/entities/personalityTrait.js +8 -1
- package/lib/entities/poison.js +5 -1
- package/lib/entities/profession.js +9 -15
- package/lib/entities/race.d.ts +1 -1
- package/lib/entities/race.js +16 -12
- package/lib/entities/spell.js +5 -2
- package/lib/env.d.ts +66 -0
- package/lib/env.js +1 -0
- package/lib/references/publicationOptions.d.ts +1 -1
- package/lib/tsconfig.tsbuildinfo +1 -1
- package/package.json +1 -1
|
@@ -1,21 +1,14 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { attributedNameR, translateR } from "../../reader.js";
|
|
2
|
+
import { MISSING_VALUE } from "../../unknown.js";
|
|
2
3
|
import { printDisplayOption } from "../displayOption.js";
|
|
3
4
|
/**
|
|
4
5
|
* Get the translation of a culture prerequisite.
|
|
5
6
|
*/
|
|
6
|
-
export const printCulturePrerequisite = (
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
const cultureTranslation = locale.translateMap(culture?.translations);
|
|
12
|
-
if (cultureTranslation === undefined) {
|
|
13
|
-
return undefined;
|
|
14
|
-
}
|
|
15
|
-
return {
|
|
16
|
-
label: `${locale.translate("Culture")} `,
|
|
17
|
-
value: attributedNameFromSafeTranslation(cultureTranslation, "prerequisite", "Culture", prerequisite.id),
|
|
7
|
+
export const printCulturePrerequisite = (prerequisite) => prerequisite.display_option !== undefined
|
|
8
|
+
? printDisplayOption(prerequisite.display_option)
|
|
9
|
+
: attributedNameR("prerequisite", "Culture", prerequisite.id).thenW(name => translateR("Culture").map((label) => ({
|
|
10
|
+
label: `${label} `,
|
|
11
|
+
value: name ?? MISSING_VALUE,
|
|
18
12
|
sentenceType: undefined,
|
|
19
13
|
isMeta: false,
|
|
20
|
-
};
|
|
21
|
-
};
|
|
14
|
+
})));
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { Reader } from "@elyukai/utils/reader";
|
|
2
2
|
import type { EnhancementPrerequisite } from "@optolith/database-schema/gen";
|
|
3
|
-
import {
|
|
3
|
+
import type { StdEnv } from "../../../../env.js";
|
|
4
4
|
import type { PrerequisitePart } from "../part.js";
|
|
5
5
|
type EnvExtra = {
|
|
6
6
|
hideParent?: true;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { Reader } from "@elyukai/utils/reader";
|
|
2
2
|
import { assertExhaustive } from "@optolith/helpers/typeSafety";
|
|
3
3
|
import { fromUniformCase } from "tsondb/schema/gen";
|
|
4
|
-
import { attributedNameFromInstanceR, getInstanceByIdR, translateR
|
|
4
|
+
import { attributedNameFromInstanceR, getInstanceByIdR, translateR } from "../../reader.js";
|
|
5
5
|
import { MISSING_VALUE } from "../../unknown.js";
|
|
6
6
|
const printLabel = (skillId) => {
|
|
7
7
|
switch (skillId.kind) {
|
|
@@ -1,8 +1,7 @@
|
|
|
1
1
|
import type { InfluencePrerequisite } from "@optolith/database-schema/gen";
|
|
2
|
-
import type {
|
|
3
|
-
import type { LocaleEnvironment } from "../../../../helpers/locale.js";
|
|
2
|
+
import type { StdReader } from "../../../../env.js";
|
|
4
3
|
import type { PrerequisitePart } from "../part.js";
|
|
5
4
|
/**
|
|
6
5
|
* Get the translation of a culture prerequisite.
|
|
7
6
|
*/
|
|
8
|
-
export declare const printInfluencePrerequisite: (
|
|
7
|
+
export declare const printInfluencePrerequisite: (prerequisite: InfluencePrerequisite) => StdReader<PrerequisitePart | undefined, "t" | "tm" | "ibi", "Influence">;
|
|
@@ -1,17 +1,14 @@
|
|
|
1
|
+
import { attributedNameR, translateR } from "../../reader.js";
|
|
1
2
|
import { MISSING_VALUE } from "../../unknown.js";
|
|
2
3
|
import { printDisplayOption } from "../displayOption.js";
|
|
3
4
|
/**
|
|
4
5
|
* Get the translation of a culture prerequisite.
|
|
5
6
|
*/
|
|
6
|
-
export const printInfluencePrerequisite = (
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
MISSING_VALUE;
|
|
12
|
-
return {
|
|
13
|
-
value: `${locale.translate("no influence")} ${name}`,
|
|
7
|
+
export const printInfluencePrerequisite = (prerequisite) => prerequisite.display_option !== undefined
|
|
8
|
+
? printDisplayOption(prerequisite.display_option)
|
|
9
|
+
: attributedNameR("prerequisite", "Influence", prerequisite.id).thenW(name => translateR("no influence").map((label) => ({
|
|
10
|
+
label: `${label} `,
|
|
11
|
+
value: name ?? MISSING_VALUE,
|
|
14
12
|
sentenceType: undefined,
|
|
15
13
|
isMeta: false,
|
|
16
|
-
};
|
|
17
|
-
};
|
|
14
|
+
})));
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import type { MagicalTraditionPrerequisite } from "@optolith/database-schema/gen";
|
|
2
|
-
import type {
|
|
2
|
+
import type { StdReader } from "../../../../env.js";
|
|
3
3
|
import type { PrerequisitePart } from "../part.js";
|
|
4
4
|
/**
|
|
5
5
|
* Get the translation of a magical tradition prerequisite.
|
|
6
6
|
*/
|
|
7
|
-
export declare const printMagicalTraditionPrerequisite: (
|
|
7
|
+
export declare const printMagicalTraditionPrerequisite: (prerequisite: MagicalTraditionPrerequisite) => StdReader<PrerequisitePart | undefined, "t" | "tm">;
|
|
@@ -1,13 +1,14 @@
|
|
|
1
1
|
import { assertExhaustive } from "@optolith/helpers/typeSafety";
|
|
2
|
+
import { translateR } from "../../reader.js";
|
|
2
3
|
import { printDisplayOption } from "../displayOption.js";
|
|
3
|
-
const printValue = (
|
|
4
|
+
const printValue = (restriction) => {
|
|
4
5
|
switch (restriction?.kind) {
|
|
5
6
|
case "CanLearnRituals":
|
|
6
|
-
return
|
|
7
|
+
return translateR("Tradition must be able to use rituals");
|
|
7
8
|
case "CanBindFamiliars":
|
|
8
|
-
return
|
|
9
|
+
return translateR("Tradition must be able to bind familiars");
|
|
9
10
|
case undefined:
|
|
10
|
-
return
|
|
11
|
+
return translateR("Tradition");
|
|
11
12
|
default:
|
|
12
13
|
return assertExhaustive(restriction);
|
|
13
14
|
}
|
|
@@ -15,13 +16,10 @@ const printValue = (locale, restriction) => {
|
|
|
15
16
|
/**
|
|
16
17
|
* Get the translation of a magical tradition prerequisite.
|
|
17
18
|
*/
|
|
18
|
-
export const printMagicalTraditionPrerequisite = (
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
return {
|
|
23
|
-
value: printValue(locale, prerequisite.restriction),
|
|
19
|
+
export const printMagicalTraditionPrerequisite = (prerequisite) => prerequisite.display_option !== undefined
|
|
20
|
+
? printDisplayOption(prerequisite.display_option)
|
|
21
|
+
: printValue(prerequisite.restriction).map((value) => ({
|
|
22
|
+
value,
|
|
24
23
|
sentenceType: undefined,
|
|
25
24
|
isMeta: false,
|
|
26
|
-
};
|
|
27
|
-
};
|
|
25
|
+
}));
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import type {
|
|
1
|
+
import type { StdReader } from "../../../../env.js";
|
|
2
2
|
import type { PrerequisitePart } from "../part.js";
|
|
3
3
|
/**
|
|
4
4
|
* Get the translation of a culture prerequisite.
|
|
5
5
|
*/
|
|
6
|
-
export declare const printNoOtherAncestorBloodAdvantagePrerequisite:
|
|
6
|
+
export declare const printNoOtherAncestorBloodAdvantagePrerequisite: StdReader<PrerequisitePart | undefined, "t">;
|
|
@@ -1,8 +1,9 @@
|
|
|
1
|
+
import { translateR } from "../../reader.js";
|
|
1
2
|
/**
|
|
2
3
|
* Get the translation of a culture prerequisite.
|
|
3
4
|
*/
|
|
4
|
-
export const printNoOtherAncestorBloodAdvantagePrerequisite = (
|
|
5
|
-
value
|
|
5
|
+
export const printNoOtherAncestorBloodAdvantagePrerequisite = translateR("no other ancestor blood advantage").map(value => ({
|
|
6
|
+
value,
|
|
6
7
|
sentenceType: undefined,
|
|
7
8
|
isMeta: false,
|
|
8
|
-
});
|
|
9
|
+
}));
|
|
@@ -1,8 +1,7 @@
|
|
|
1
1
|
import type { PactPrerequisite } from "@optolith/database-schema/gen";
|
|
2
|
-
import type {
|
|
3
|
-
import type { LocaleEnvironment } from "../../../../helpers/locale.js";
|
|
2
|
+
import type { StdReader } from "../../../../env.js";
|
|
4
3
|
import type { PrerequisitePart } from "../part.js";
|
|
5
4
|
/**
|
|
6
5
|
* Get the translation of a culture prerequisite.
|
|
7
6
|
*/
|
|
8
|
-
export declare const printPactPrerequisite: (
|
|
7
|
+
export declare const printPactPrerequisite: (prerequisite: PactPrerequisite) => StdReader<PrerequisitePart | undefined, "t" | "tm" | "lc" | "lj" | "ibi", "PactCategory" | "PactDomain">;
|
|
@@ -1,30 +1,29 @@
|
|
|
1
|
+
import { Reader } from "@elyukai/utils/reader";
|
|
1
2
|
import { isNotNullish } from "@optolith/helpers/nullable";
|
|
2
3
|
import { romanize } from "@optolith/helpers/roman";
|
|
4
|
+
import { attributedNameR, localeJoinR, localeSortR, translateR } from "../../reader.js";
|
|
3
5
|
import { MISSING_VALUE } from "../../unknown.js";
|
|
4
6
|
import { printDisplayOption } from "../displayOption.js";
|
|
5
7
|
/**
|
|
6
8
|
* Get the translation of a culture prerequisite.
|
|
7
9
|
*/
|
|
8
|
-
export const printPactPrerequisite = (
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
const pactCategory = getInstanceById("PactCategory", prerequisite.category);
|
|
13
|
-
const parts = [
|
|
10
|
+
export const printPactPrerequisite = (prerequisite) => prerequisite.display_option !== undefined
|
|
11
|
+
? printDisplayOption(prerequisite.display_option)
|
|
12
|
+
: attributedNameR("prerequisite", "PactCategory", prerequisite.category)
|
|
13
|
+
.thenW(name => Reader.sequence([
|
|
14
14
|
prerequisite.domain === undefined
|
|
15
|
-
? undefined
|
|
16
|
-
:
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
pact:
|
|
15
|
+
? Reader.of(undefined)
|
|
16
|
+
: Reader.traverse(prerequisite.domain, id => attributedNameR("prerequisite", "PactDomain", id).map(domainName => domainName ?? MISSING_VALUE))
|
|
17
|
+
.thenW(localeSortR)
|
|
18
|
+
.thenW(domains => localeJoinR(domains, "disjunction"))
|
|
19
|
+
.thenW(domains => translateR("domain {$domain}", { domain: domains })),
|
|
20
|
+
translateR("{$pact} level {$pactLevel}", {
|
|
21
|
+
pact: name ?? MISSING_VALUE,
|
|
22
22
|
pactLevel: romanize(prerequisite.level ?? 1),
|
|
23
23
|
}),
|
|
24
|
-
]
|
|
25
|
-
|
|
26
|
-
value: parts.join(", "),
|
|
24
|
+
]))
|
|
25
|
+
.map(parts => ({
|
|
26
|
+
value: parts.filter(isNotNullish).join(", "),
|
|
27
27
|
sentenceType: undefined,
|
|
28
28
|
isMeta: false,
|
|
29
|
-
};
|
|
30
|
-
};
|
|
29
|
+
}));
|
|
@@ -1,8 +1,7 @@
|
|
|
1
1
|
import type { PersonalityTraitPrerequisite } from "@optolith/database-schema/gen";
|
|
2
|
-
import type {
|
|
3
|
-
import type { LocaleEnvironment } from "../../../../helpers/locale.js";
|
|
2
|
+
import type { StdReader } from "../../../../env.js";
|
|
4
3
|
import type { PrerequisitePart } from "../part.js";
|
|
5
4
|
/**
|
|
6
5
|
* Get the translation of a personality trait prerequisite.
|
|
7
6
|
*/
|
|
8
|
-
export declare const printPersonalityTraitPrerequisite: (
|
|
7
|
+
export declare const printPersonalityTraitPrerequisite: (prerequisite: PersonalityTraitPrerequisite) => StdReader<PrerequisitePart | undefined, "t" | "tm" | "ibi", "PersonalityTrait">;
|
|
@@ -1,29 +1,28 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { Reader } from "@elyukai/utils/reader";
|
|
2
|
+
import { attributedNameFromInstanceR, getInstanceByIdR, translateR } from "../../reader.js";
|
|
3
|
+
import { MISSING_VALUE } from "../../unknown.js";
|
|
2
4
|
import { printDisplayOption } from "../displayOption.js";
|
|
3
5
|
/**
|
|
4
6
|
* Get the translation of a personality trait prerequisite.
|
|
5
7
|
*/
|
|
6
|
-
export const printPersonalityTraitPrerequisite = (
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
})})`;
|
|
18
|
-
return {
|
|
19
|
-
value: prerequisite.active
|
|
20
|
-
? locale.translate("must have {$trait}", {
|
|
8
|
+
export const printPersonalityTraitPrerequisite = (prerequisite) => prerequisite.display_option !== undefined
|
|
9
|
+
? printDisplayOption(prerequisite.display_option)
|
|
10
|
+
: getInstanceByIdR("PersonalityTrait", prerequisite.id).thenW(personalityTrait => personalityTrait === undefined
|
|
11
|
+
? Reader.of(undefined)
|
|
12
|
+
: attributedNameFromInstanceR(personalityTrait, "prerequisite", "PersonalityTrait", prerequisite.id)
|
|
13
|
+
.map(name => name ?? MISSING_VALUE)
|
|
14
|
+
.thenW(name => translateR("Level {$level}", {
|
|
15
|
+
level: personalityTrait.level,
|
|
16
|
+
}).map(level => `${name} (${level})`))
|
|
17
|
+
.then(name => prerequisite.active
|
|
18
|
+
? translateR("must have {$trait}", {
|
|
21
19
|
trait: name,
|
|
22
20
|
})
|
|
23
|
-
:
|
|
21
|
+
: translateR("cannot be chosen at the same time as {$trait}", {
|
|
24
22
|
trait: name,
|
|
25
|
-
})
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
23
|
+
}))
|
|
24
|
+
.map(value => ({
|
|
25
|
+
value,
|
|
26
|
+
sentenceType: undefined,
|
|
27
|
+
isMeta: false,
|
|
28
|
+
})));
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import type { PrimaryAttributePrerequisite } from "@optolith/database-schema/gen";
|
|
2
|
-
import type {
|
|
2
|
+
import type { StdReader } from "../../../../env.js";
|
|
3
3
|
import type { PrerequisitePart } from "../part.js";
|
|
4
4
|
/**
|
|
5
5
|
* Get the translation of a state prerequisite.
|
|
6
6
|
*/
|
|
7
|
-
export declare const printPrimaryAttributePrerequisite: (
|
|
7
|
+
export declare const printPrimaryAttributePrerequisite: (prerequisite: PrimaryAttributePrerequisite) => StdReader<PrerequisitePart | undefined, "t" | "tm">;
|
|
@@ -1,15 +1,13 @@
|
|
|
1
|
+
import { translateR } from "../../reader.js";
|
|
1
2
|
import { printDisplayOption } from "../displayOption.js";
|
|
2
3
|
/**
|
|
3
4
|
* Get the translation of a state prerequisite.
|
|
4
5
|
*/
|
|
5
|
-
export const printPrimaryAttributePrerequisite = (
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
return {
|
|
10
|
-
label: `${locale.translate("Primary Attribute")} `,
|
|
6
|
+
export const printPrimaryAttributePrerequisite = (prerequisite) => prerequisite.display_option !== undefined
|
|
7
|
+
? printDisplayOption(prerequisite.display_option)
|
|
8
|
+
: translateR("Primary Attribute").map((label) => ({
|
|
9
|
+
label: `${label} `,
|
|
11
10
|
value: prerequisite.value.toFixed(),
|
|
12
11
|
sentenceType: undefined,
|
|
13
12
|
isMeta: false,
|
|
14
|
-
};
|
|
15
|
-
};
|
|
13
|
+
}));
|
|
@@ -1,8 +1,7 @@
|
|
|
1
1
|
import type { ProfessionPrerequisite } from "@optolith/database-schema/gen";
|
|
2
|
-
import type {
|
|
3
|
-
import type { LocaleEnvironment } from "../../../../helpers/locale.js";
|
|
2
|
+
import type { StdReader } from "../../../../env.js";
|
|
4
3
|
import type { PrerequisitePart } from "../part.js";
|
|
5
4
|
/**
|
|
6
5
|
* Get the translation of a profession prerequisite.
|
|
7
6
|
*/
|
|
8
|
-
export declare const printProfessionPrerequisite: (
|
|
7
|
+
export declare const printProfessionPrerequisite: (prerequisite: ProfessionPrerequisite) => StdReader<PrerequisitePart | undefined, "tm" | "acibp", never, never, "ProfessionVersion">;
|
|
@@ -1,22 +1,19 @@
|
|
|
1
|
+
import { Reader } from "@elyukai/utils/reader";
|
|
1
2
|
import { attributedInstance } from "../../markdown.js";
|
|
2
3
|
import { getProfessionName } from "../../professions.js";
|
|
4
|
+
import { MISSING_VALUE } from "../../unknown.js";
|
|
3
5
|
import { printDisplayOption } from "../displayOption.js";
|
|
4
6
|
/**
|
|
5
7
|
* Get the translation of a profession prerequisite.
|
|
6
8
|
*/
|
|
7
|
-
export const printProfessionPrerequisite = (
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
return {
|
|
16
|
-
value: attributedInstance(professionName, "Profession", prerequisite.id, {
|
|
17
|
-
context: '"prerequisite"',
|
|
18
|
-
}),
|
|
9
|
+
export const printProfessionPrerequisite = (prerequisite) => prerequisite.displayOption !== undefined
|
|
10
|
+
? printDisplayOption(prerequisite.displayOption)
|
|
11
|
+
: Reader.asks((env) => getProfessionName(env.translateMap, env.getChildInstancesForInstanceId, prerequisite.id)).map(name => ({
|
|
12
|
+
value: name === undefined
|
|
13
|
+
? MISSING_VALUE
|
|
14
|
+
: attributedInstance(name, "Profession", prerequisite.id, {
|
|
15
|
+
context: '"prerequisite"',
|
|
16
|
+
}),
|
|
19
17
|
sentenceType: undefined,
|
|
20
18
|
isMeta: false,
|
|
21
|
-
};
|
|
22
|
-
};
|
|
19
|
+
}));
|
|
@@ -1,8 +1,7 @@
|
|
|
1
1
|
import type { PublicationPrerequisite } from "@optolith/database-schema/gen";
|
|
2
|
-
import type {
|
|
3
|
-
import type { LocaleEnvironment } from "../../../../helpers/locale.js";
|
|
2
|
+
import type { StdReader } from "../../../../env.js";
|
|
4
3
|
import type { PrerequisitePart } from "../part.js";
|
|
5
4
|
/**
|
|
6
5
|
* Get the translation of a state prerequisite.
|
|
7
6
|
*/
|
|
8
|
-
export declare const printPublicationPrerequisite: (
|
|
7
|
+
export declare const printPublicationPrerequisite: (prerequisite: PublicationPrerequisite) => StdReader<PrerequisitePart | undefined, "t" | "tm" | "ibi", "Publication">;
|
|
@@ -1,19 +1,13 @@
|
|
|
1
|
+
import { attributedNameR } from "../../reader.js";
|
|
2
|
+
import { MISSING_VALUE } from "../../unknown.js";
|
|
1
3
|
import { printDisplayOption } from "../displayOption.js";
|
|
2
4
|
/**
|
|
3
5
|
* Get the translation of a state prerequisite.
|
|
4
6
|
*/
|
|
5
|
-
export const printPublicationPrerequisite = (
|
|
6
|
-
|
|
7
|
-
|
|
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,
|
|
7
|
+
export const printPublicationPrerequisite = (prerequisite) => prerequisite.display_option !== undefined
|
|
8
|
+
? printDisplayOption(prerequisite.display_option)
|
|
9
|
+
: attributedNameR("prerequisite", "Publication", prerequisite.id).map((name) => ({
|
|
10
|
+
value: name ?? MISSING_VALUE,
|
|
16
11
|
sentenceType: undefined,
|
|
17
12
|
isMeta: false,
|
|
18
|
-
};
|
|
19
|
-
};
|
|
13
|
+
}));
|
|
@@ -1,8 +1,7 @@
|
|
|
1
1
|
import type { RacePrerequisite } from "@optolith/database-schema/gen";
|
|
2
|
-
import type {
|
|
3
|
-
import type { LocaleEnvironment } from "../../../../helpers/locale.js";
|
|
2
|
+
import type { StdReader } from "../../../../env.js";
|
|
4
3
|
import type { PrerequisitePart } from "../part.js";
|
|
5
4
|
/**
|
|
6
5
|
* Get the translation of a race prerequisite.
|
|
7
6
|
*/
|
|
8
|
-
export declare const printRacePrerequisite: (
|
|
7
|
+
export declare const printRacePrerequisite: (prerequisite: RacePrerequisite) => StdReader<PrerequisitePart | undefined, "t" | "tm" | "ibi", "Race">;
|
|
@@ -1,21 +1,14 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { attributedNameR, translateR } from "../../reader.js";
|
|
2
|
+
import { MISSING_VALUE } from "../../unknown.js";
|
|
2
3
|
import { printDisplayOption } from "../displayOption.js";
|
|
3
4
|
/**
|
|
4
5
|
* Get the translation of a race prerequisite.
|
|
5
6
|
*/
|
|
6
|
-
export const printRacePrerequisite = (
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
const raceTranslation = locale.translateMap(race?.translations);
|
|
12
|
-
if (raceTranslation === undefined) {
|
|
13
|
-
return undefined;
|
|
14
|
-
}
|
|
15
|
-
return {
|
|
16
|
-
label: `${locale.translate("Race")} `,
|
|
17
|
-
value: attributedNameFromSafeTranslation(raceTranslation, "prerequisite", "Race", prerequisite.id),
|
|
7
|
+
export const printRacePrerequisite = (prerequisite) => prerequisite.display_option !== undefined
|
|
8
|
+
? printDisplayOption(prerequisite.display_option)
|
|
9
|
+
: attributedNameR("prerequisite", "Race", prerequisite.id).thenW(name => translateR("Race").map((label) => ({
|
|
10
|
+
label: `${label} `,
|
|
11
|
+
value: name ?? MISSING_VALUE,
|
|
18
12
|
sentenceType: undefined,
|
|
19
13
|
isMeta: false,
|
|
20
|
-
};
|
|
21
|
-
};
|
|
14
|
+
})));
|
|
@@ -1,8 +1,7 @@
|
|
|
1
1
|
import type { RatedPrerequisite } from "@optolith/database-schema/gen";
|
|
2
|
-
import {
|
|
3
|
-
import type { LocaleEnvironment } from "../../../../helpers/locale.js";
|
|
2
|
+
import type { StdReader } from "../../../../env.js";
|
|
4
3
|
import type { PrerequisitePart } from "../part.js";
|
|
5
4
|
/**
|
|
6
5
|
* Get the translation of a blessed tradition prerequisite.
|
|
7
6
|
*/
|
|
8
|
-
export declare const printRatedPrerequisite: (
|
|
7
|
+
export declare const printRatedPrerequisite: (prerequisite: RatedPrerequisite) => StdReader<PrerequisitePart | undefined, "t" | "tm" | "ibi", "Attribute" | "Skill" | "CloseCombatTechnique" | "RangedCombatTechnique" | "Spell" | "Ritual" | "LiturgicalChant" | "Ceremony">;
|
|
@@ -1,17 +1,15 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { attributedCustomNameR } from "../../reader.js";
|
|
2
2
|
import { MISSING_VALUE } from "../../unknown.js";
|
|
3
3
|
import { printDisplayOption } from "../displayOption.js";
|
|
4
4
|
/**
|
|
5
5
|
* Get the translation of a blessed tradition prerequisite.
|
|
6
6
|
*/
|
|
7
|
-
export const printRatedPrerequisite = (
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
return {
|
|
7
|
+
export const printRatedPrerequisite = (prerequisite) => prerequisite.display_option !== undefined
|
|
8
|
+
? printDisplayOption(prerequisite.display_option)
|
|
9
|
+
: attributedCustomNameR("prerequisite", (t) => t.abbreviation ?? t.name, prerequisite.id)
|
|
10
|
+
.map(name => name ?? MISSING_VALUE)
|
|
11
|
+
.map((name) => ({
|
|
13
12
|
value: prerequisite.value > 0 ? `${name} ${prerequisite.value.toFixed()}` : name,
|
|
14
13
|
sentenceType: undefined,
|
|
15
14
|
isMeta: false,
|
|
16
|
-
};
|
|
17
|
-
};
|
|
15
|
+
}));
|
|
@@ -1,8 +1,7 @@
|
|
|
1
1
|
import type { RatedMinimumNumberPrerequisite } from "@optolith/database-schema/gen";
|
|
2
|
-
import type {
|
|
3
|
-
import type { LocaleEnvironment } from "../../../../helpers/locale.js";
|
|
2
|
+
import type { StdReader } from "../../../../env.js";
|
|
4
3
|
import type { PrerequisitePart } from "../part.js";
|
|
5
4
|
/**
|
|
6
5
|
* Get the translation of a rated minimum number prerequisite.
|
|
7
6
|
*/
|
|
8
|
-
export declare const printRatedMinimumNumberPrerequisite: (
|
|
7
|
+
export declare const printRatedMinimumNumberPrerequisite: (prerequisite: RatedMinimumNumberPrerequisite) => StdReader<PrerequisitePart | undefined, "t" | "tm" | "lc" | "lj" | "ibi", "Skill" | "Property" | "Aspect">;
|