@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,28 +1,21 @@
|
|
|
1
|
+
import { Reader } from "@elyukai/utils/reader";
|
|
1
2
|
import { isNotNullish } from "@optolith/helpers/nullable";
|
|
2
3
|
import { assertExhaustive } from "@optolith/helpers/typeSafety";
|
|
3
|
-
import {
|
|
4
|
+
import { attributedNameR, localeJoinR, localeSortR, translateR } from "../../reader.js";
|
|
4
5
|
import { MISSING_VALUE } from "../../unknown.js";
|
|
5
6
|
import { printDisplayOption } from "../displayOption.js";
|
|
6
|
-
const printNumberOfTheFollowingSkills = (
|
|
7
|
-
|
|
8
|
-
});
|
|
9
|
-
const
|
|
10
|
-
|
|
11
|
-
});
|
|
12
|
-
const printNumberOfCloseCombatTechniques = (locale, number) => locale.translate(".input {$count :number} {{{$count} close combat techniques}}", {
|
|
13
|
-
count: number,
|
|
14
|
-
});
|
|
15
|
-
const printNumberOfRangedCombatTechniques = (locale, number) => locale.translate(".input {$count :number} {{{$count} ranged combat techniques}}", {
|
|
16
|
-
count: number,
|
|
17
|
-
});
|
|
18
|
-
const printNumberOfCombatTechniques = (locale, category, number) => {
|
|
7
|
+
const printNumberOfTheFollowingSkills = (count) => translateR(".input {$count :number} {{{$count} of the following skills}}", { count });
|
|
8
|
+
const printNumberOfAllCombatTechniques = (count) => translateR(".input {$count :number} {{{$count} combat techniques}}", { count });
|
|
9
|
+
const printNumberOfCloseCombatTechniques = (count) => translateR(".input {$count :number} {{{$count} close combat techniques}}", { count });
|
|
10
|
+
const printNumberOfRangedCombatTechniques = (count) => translateR(".input {$count :number} {{{$count} ranged combat techniques}}", { count });
|
|
11
|
+
const printNumberOfCombatTechniques = (category, number) => {
|
|
19
12
|
switch (category.kind) {
|
|
20
13
|
case "All":
|
|
21
|
-
return printNumberOfAllCombatTechniques(
|
|
14
|
+
return printNumberOfAllCombatTechniques(number);
|
|
22
15
|
case "Close":
|
|
23
|
-
return printNumberOfCloseCombatTechniques(
|
|
16
|
+
return printNumberOfCloseCombatTechniques(number);
|
|
24
17
|
case "Ranged":
|
|
25
|
-
return printNumberOfRangedCombatTechniques(
|
|
18
|
+
return printNumberOfRangedCombatTechniques(number);
|
|
26
19
|
default:
|
|
27
20
|
return assertExhaustive(category);
|
|
28
21
|
}
|
|
@@ -30,59 +23,65 @@ const printNumberOfCombatTechniques = (locale, category, number) => {
|
|
|
30
23
|
/**
|
|
31
24
|
* Get the translation of a rated minimum number prerequisite.
|
|
32
25
|
*/
|
|
33
|
-
export const printRatedMinimumNumberPrerequisite = (
|
|
26
|
+
export const printRatedMinimumNumberPrerequisite = (prerequisite) => {
|
|
34
27
|
if (prerequisite.display_option !== undefined) {
|
|
35
|
-
return printDisplayOption(
|
|
28
|
+
return printDisplayOption(prerequisite.display_option);
|
|
36
29
|
}
|
|
37
30
|
switch (prerequisite.targets.kind) {
|
|
38
|
-
case "Skills":
|
|
39
|
-
|
|
40
|
-
.map(
|
|
41
|
-
.
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
{
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
31
|
+
case "Skills":
|
|
32
|
+
return Reader.traverse(prerequisite.targets.Skills.targets, id => attributedNameR("prerequisite", "Skill", id))
|
|
33
|
+
.map(skills => skills.filter(isNotNullish))
|
|
34
|
+
.thenW(localeSortR)
|
|
35
|
+
.thenW(skills => localeJoinR(skills, "conjunction"))
|
|
36
|
+
.thenW(list => printNumberOfTheFollowingSkills(prerequisite.number)
|
|
37
|
+
.then(count => translateR(".input {$minRating :number} {{{$count} on at least SR {$minRating}: {$list}}}", // zwei der folgenden Talente mindestens FW 10:
|
|
38
|
+
{
|
|
39
|
+
count,
|
|
40
|
+
minRating: prerequisite.value,
|
|
41
|
+
list,
|
|
42
|
+
}))
|
|
43
|
+
.map(value => ({
|
|
44
|
+
value,
|
|
49
45
|
sentenceType: undefined,
|
|
50
46
|
isMeta: false,
|
|
51
|
-
};
|
|
52
|
-
|
|
53
|
-
case "CombatTechniques": {
|
|
47
|
+
})));
|
|
48
|
+
case "CombatTechniques":
|
|
54
49
|
// de-DE: "Fernkampfwert 10"
|
|
55
50
|
// en-US: "Ranged Combat 10"
|
|
56
51
|
// nl-BE: "Schiet/werpwaarde 10"
|
|
57
52
|
// fr-FR: "Ranged Combat 10"
|
|
58
53
|
// it-IT: "Una tecnica di combattimento a distanza 10"
|
|
59
|
-
return {
|
|
60
|
-
value: `${
|
|
54
|
+
return printNumberOfCombatTechniques(prerequisite.targets.CombatTechniques.group, prerequisite.number).map(count => ({
|
|
55
|
+
value: `${count} ${prerequisite.value.toFixed()}`,
|
|
61
56
|
sentenceType: undefined,
|
|
62
57
|
isMeta: false,
|
|
63
|
-
};
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
58
|
+
}));
|
|
59
|
+
case "Spellworks":
|
|
60
|
+
return attributedNameR("prerequisite", "Property", prerequisite.targets.Spellworks.property)
|
|
61
|
+
.map(name => name ?? MISSING_VALUE)
|
|
62
|
+
.thenW(property => translateR(".input {$count :number} .input {$minRating :number} {{{$count} arcane works with the property {$property} at SR {$minRating} or higher}}", {
|
|
63
|
+
count: prerequisite.number,
|
|
64
|
+
property,
|
|
65
|
+
minRating: prerequisite.value,
|
|
66
|
+
}))
|
|
67
|
+
.map((value) => ({
|
|
68
|
+
value,
|
|
72
69
|
sentenceType: undefined,
|
|
73
70
|
isMeta: false,
|
|
74
|
-
};
|
|
75
|
-
}
|
|
71
|
+
}));
|
|
76
72
|
case "Liturgies": {
|
|
77
|
-
return
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
73
|
+
return attributedNameR("prerequisite", "Aspect", prerequisite.targets.Liturgies.aspect)
|
|
74
|
+
.map(name => name ?? MISSING_VALUE)
|
|
75
|
+
.thenW(aspect => translateR(".input {$count :number} .input {$minRating :number} {{{$count} liturgical chants and ceremonies with the aspect {$aspect} at SR {$minRating} or higher}}", {
|
|
76
|
+
count: prerequisite.number,
|
|
77
|
+
aspect,
|
|
78
|
+
minRating: prerequisite.value,
|
|
79
|
+
}))
|
|
80
|
+
.map((value) => ({
|
|
81
|
+
value,
|
|
83
82
|
sentenceType: undefined,
|
|
84
83
|
isMeta: false,
|
|
85
|
-
};
|
|
84
|
+
}));
|
|
86
85
|
}
|
|
87
86
|
default:
|
|
88
87
|
return assertExhaustive(prerequisite.targets);
|
|
@@ -1,8 +1,7 @@
|
|
|
1
1
|
import type { RatedSumPrerequisite } 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 sum prerequisite.
|
|
7
6
|
*/
|
|
8
|
-
export declare const printRatedSumPrerequisite: (
|
|
7
|
+
export declare const printRatedSumPrerequisite: (prerequisite: RatedSumPrerequisite) => StdReader<PrerequisitePart | undefined, "t" | "tm" | "lc" | "lj" | "ibi", "Skill">;
|
|
@@ -1,22 +1,22 @@
|
|
|
1
|
+
import { Reader } from "@elyukai/utils/reader";
|
|
1
2
|
import { isNotNullish } from "@optolith/helpers/nullable";
|
|
2
|
-
import {
|
|
3
|
+
import { attributedNameR, localeJoinR, localeSortR, translateR } from "../../reader.js";
|
|
3
4
|
import { printDisplayOption } from "../displayOption.js";
|
|
4
5
|
/**
|
|
5
6
|
* Get the translation of a rated sum prerequisite.
|
|
6
7
|
*/
|
|
7
|
-
export const printRatedSumPrerequisite = (
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
.
|
|
13
|
-
.
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
8
|
+
export const printRatedSumPrerequisite = (prerequisite) => prerequisite.display_option !== undefined
|
|
9
|
+
? printDisplayOption(prerequisite.display_option)
|
|
10
|
+
: Reader.traverse(prerequisite.targets, id => attributedNameR("prerequisite", "Skill", id))
|
|
11
|
+
.map(skills => skills.filter(isNotNullish))
|
|
12
|
+
.thenW(localeSortR)
|
|
13
|
+
.thenW(skills => localeJoinR(skills, "conjunction"))
|
|
14
|
+
.thenW(skills => translateR("the SR for {$skill} combined must add up to at least {$minRating}", {
|
|
15
|
+
skill: skills,
|
|
16
|
+
minRating: prerequisite.sum,
|
|
17
|
+
}))
|
|
18
|
+
.map(value => ({
|
|
19
|
+
value,
|
|
19
20
|
sentenceType: undefined,
|
|
20
21
|
isMeta: false,
|
|
21
|
-
};
|
|
22
|
-
};
|
|
22
|
+
}));
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import type { RulePrerequisite } 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 rule prerequisite.
|
|
6
6
|
*/
|
|
7
|
-
export declare const printRulePrerequisite: (
|
|
7
|
+
export declare const printRulePrerequisite: (_prerequisite: RulePrerequisite) => StdReader<PrerequisitePart | undefined, never>;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import type { SexPrerequisite } 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 (binary) sex prerequisite.
|
|
6
6
|
*/
|
|
7
|
-
export declare const printBinarySexPrerequisite: (
|
|
7
|
+
export declare const printBinarySexPrerequisite: (prerequisite: SexPrerequisite) => StdReader<PrerequisitePart | undefined, "t">;
|
|
@@ -1,10 +1,11 @@
|
|
|
1
1
|
import { assertExhaustive } from "@optolith/helpers/typeSafety";
|
|
2
|
-
|
|
2
|
+
import { translateR } from "../../reader.js";
|
|
3
|
+
const printId = (id) => {
|
|
3
4
|
switch (id.kind) {
|
|
4
5
|
case "Male":
|
|
5
|
-
return
|
|
6
|
+
return translateR("Male");
|
|
6
7
|
case "Female":
|
|
7
|
-
return
|
|
8
|
+
return translateR("Female");
|
|
8
9
|
default:
|
|
9
10
|
return assertExhaustive(id);
|
|
10
11
|
}
|
|
@@ -12,8 +13,8 @@ const printId = (translate, id) => {
|
|
|
12
13
|
/**
|
|
13
14
|
* Get the translation of a (binary) sex prerequisite.
|
|
14
15
|
*/
|
|
15
|
-
export const printBinarySexPrerequisite = (
|
|
16
|
-
value
|
|
16
|
+
export const printBinarySexPrerequisite = (prerequisite) => printId(prerequisite.id).map(value => ({
|
|
17
|
+
value,
|
|
17
18
|
sentenceType: undefined,
|
|
18
19
|
isMeta: false,
|
|
19
|
-
});
|
|
20
|
+
}));
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import type { SexualCharacteristicPrerequisite } 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 sexual characteristic prerequisite.
|
|
6
6
|
*/
|
|
7
|
-
export declare const printSexualCharacteristicPrerequisite: (
|
|
7
|
+
export declare const printSexualCharacteristicPrerequisite: (prerequisite: SexualCharacteristicPrerequisite) => StdReader<PrerequisitePart | undefined, "t">;
|
|
@@ -1,10 +1,11 @@
|
|
|
1
1
|
import { assertExhaustive } from "@optolith/helpers/typeSafety";
|
|
2
|
-
|
|
2
|
+
import { translateR } from "../../reader.js";
|
|
3
|
+
const printId = (id) => {
|
|
3
4
|
switch (id.kind) {
|
|
4
5
|
case "Penis":
|
|
5
|
-
return
|
|
6
|
+
return translateR("Penis");
|
|
6
7
|
case "Vagina":
|
|
7
|
-
return
|
|
8
|
+
return translateR("Vagina");
|
|
8
9
|
default:
|
|
9
10
|
return assertExhaustive(id);
|
|
10
11
|
}
|
|
@@ -12,10 +13,12 @@ const printId = (locale, id) => {
|
|
|
12
13
|
/**
|
|
13
14
|
* Get the translation of a sexual characteristic prerequisite.
|
|
14
15
|
*/
|
|
15
|
-
export const printSexualCharacteristicPrerequisite = (
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
16
|
+
export const printSexualCharacteristicPrerequisite = (prerequisite) => printId(prerequisite.id)
|
|
17
|
+
.then(sexualCharacteristic => translateR("Person with {$sexualCharacteristic}", {
|
|
18
|
+
sexualCharacteristic,
|
|
19
|
+
}))
|
|
20
|
+
.map(value => ({
|
|
21
|
+
value,
|
|
19
22
|
sentenceType: undefined,
|
|
20
23
|
isMeta: false,
|
|
21
|
-
});
|
|
24
|
+
}));
|
|
@@ -1,8 +1,7 @@
|
|
|
1
1
|
import type { SocialStatusPrerequisite } 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 social status prerequisite.
|
|
7
6
|
*/
|
|
8
|
-
export declare const printSocialStatusPrerequisite: (
|
|
7
|
+
export declare const printSocialStatusPrerequisite: (prerequisite: SocialStatusPrerequisite) => StdReader<PrerequisitePart | undefined, "t" | "tm" | "ibi", "SocialStatus">;
|
|
@@ -1,21 +1,15 @@
|
|
|
1
|
+
import { attributedNameR, translateR } 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 social status prerequisite.
|
|
4
6
|
*/
|
|
5
|
-
export const printSocialStatusPrerequisite = (
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
if (socialStatusTranslation === undefined) {
|
|
12
|
-
return undefined;
|
|
13
|
-
}
|
|
14
|
-
return {
|
|
15
|
-
value: `${locale.translate("Social Status {$minStatus} or higher", {
|
|
16
|
-
minStatus: `*${socialStatusTranslation.name}*`,
|
|
17
|
-
})} `,
|
|
7
|
+
export const printSocialStatusPrerequisite = (prerequisite) => prerequisite.display_option !== undefined
|
|
8
|
+
? printDisplayOption(prerequisite.display_option)
|
|
9
|
+
: attributedNameR("prerequisite", "SocialStatus", prerequisite.id).thenW(name => translateR("Social Status {$minStatus} or higher", {
|
|
10
|
+
minStatus: name ?? MISSING_VALUE,
|
|
11
|
+
}).map((value) => ({
|
|
12
|
+
value,
|
|
18
13
|
sentenceType: undefined,
|
|
19
14
|
isMeta: false,
|
|
20
|
-
};
|
|
21
|
-
};
|
|
15
|
+
})));
|
|
@@ -1,8 +1,7 @@
|
|
|
1
1
|
import type { StatePrerequisite } 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 printStatePrerequisite: (
|
|
7
|
+
export declare const printStatePrerequisite: (prerequisite: StatePrerequisite) => StdReader<PrerequisitePart | undefined, "t" | "tm" | "ibi", "State">;
|
|
@@ -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 state prerequisite.
|
|
5
6
|
*/
|
|
6
|
-
export const printStatePrerequisite = (
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
const stateTranslation = locale.translateMap(state?.translations);
|
|
12
|
-
if (stateTranslation === undefined) {
|
|
13
|
-
return undefined;
|
|
14
|
-
}
|
|
15
|
-
return {
|
|
16
|
-
label: `${locale.translate("State")} `,
|
|
17
|
-
value: attributedNameFromSafeTranslation(stateTranslation, "prerequisite", "State", prerequisite.id),
|
|
7
|
+
export const printStatePrerequisite = (prerequisite) => prerequisite.display_option !== undefined
|
|
8
|
+
? printDisplayOption(prerequisite.display_option)
|
|
9
|
+
: attributedNameR("prerequisite", "State", prerequisite.id).thenW(name => translateR("State").map((label) => ({
|
|
10
|
+
label: `${label} `,
|
|
11
|
+
value: name ?? MISSING_VALUE,
|
|
18
12
|
sentenceType: undefined,
|
|
19
13
|
isMeta: false,
|
|
20
|
-
};
|
|
21
|
-
};
|
|
14
|
+
})));
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import type { TextPrerequisite } 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 text prerequisite.
|
|
6
6
|
*/
|
|
7
|
-
export declare const printTextPrerequisite: (
|
|
7
|
+
export declare const printTextPrerequisite: (prerequisite: TextPrerequisite) => StdReader<PrerequisitePart | undefined, "tm">;
|
|
@@ -1,9 +1,10 @@
|
|
|
1
|
+
import { Reader } from "@elyukai/utils/reader";
|
|
1
2
|
import { MISSING_VALUE } from "../../unknown.js";
|
|
2
3
|
/**
|
|
3
4
|
* Get the translation of a text prerequisite.
|
|
4
5
|
*/
|
|
5
|
-
export const printTextPrerequisite = (
|
|
6
|
-
value:
|
|
6
|
+
export const printTextPrerequisite = (prerequisite) => Reader.asks(env => ({
|
|
7
|
+
value: env.translateMap(prerequisite.translations)?.text ?? MISSING_VALUE,
|
|
7
8
|
sentenceType: prerequisite.sentence_type,
|
|
8
9
|
isMeta: prerequisite.is_meta ?? false,
|
|
9
|
-
});
|
|
10
|
+
}));
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import type { TinyActivatablePrerequisite } from "@optolith/database-schema/gen";
|
|
2
|
-
import {
|
|
2
|
+
import type { StdReader } from "../../../../env.js";
|
|
3
3
|
import type { PrerequisitePart } from "../part.js";
|
|
4
4
|
/**
|
|
5
5
|
* Get the translation of a tiny activatable prerequisite.
|
|
@@ -1,16 +1,13 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { attributedNameR } from "../../reader.js";
|
|
2
2
|
import { MISSING_VALUE } from "../../unknown.js";
|
|
3
|
-
import {
|
|
3
|
+
import { printDisplayOption } from "../displayOption.js";
|
|
4
4
|
/**
|
|
5
5
|
* Get the translation of a tiny activatable prerequisite.
|
|
6
6
|
*/
|
|
7
|
-
export const printTinyActivatablePrerequisite = (prerequisite) =>
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
}
|
|
11
|
-
return attributedCustomNameR("prerequisite", (t) => t.abbreviation ?? t.name, prerequisite.id).map(name => ({
|
|
7
|
+
export const printTinyActivatablePrerequisite = (prerequisite) => prerequisite.display_option !== undefined
|
|
8
|
+
? printDisplayOption(prerequisite.display_option)
|
|
9
|
+
: attributedNameR("prerequisite", prerequisite.id).map(name => ({
|
|
12
10
|
value: name ?? MISSING_VALUE,
|
|
13
11
|
sentenceType: undefined,
|
|
14
12
|
isMeta: false,
|
|
15
13
|
}));
|
|
16
|
-
};
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import type { CastingTime, FastCastingTime, FastSkillNonModifiableCastingTime, SlowCastingTime, SlowSkillNonModifiableCastingTime } from "@optolith/database-schema/gen";
|
|
2
|
-
import {
|
|
2
|
+
import type { StdReader } from "../../../../env.js";
|
|
3
3
|
/**
|
|
4
4
|
* Renders the text for a non-modifiable casting time of a fast activatable skill.
|
|
5
5
|
*/
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import type { CheckResultBasedModifier, ExpressionBasedParameterValue } from "@optolith/database-schema/gen";
|
|
2
|
-
import {
|
|
2
|
+
import type { StdReader } from "../../../../env.js";
|
|
3
3
|
/**
|
|
4
4
|
* Appends the modifier of a check-result-based parameter of an activatable skill to the base value, using the appropriate arithmetic formatter.
|
|
5
5
|
*/
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { Reader } from "@elyukai/utils/reader";
|
|
2
2
|
import type { CheckResultBasedModifier, DurationUnitValue, ElvenMagicalSongPermanentCost, FirstPersonMagicalMelodyCost, NonModifiableOneTimeCostPerCountable, NonModifiableSustainedCost, OneTimeCost, ResponsiveText, ResponsiveTextOptional, ResponsiveTextReplace, SkillModificationLevel_ID, StandaloneCostMap, SustainedCost } from "@optolith/database-schema/gen";
|
|
3
|
+
import type { StdEnv, StdReader } from "../../../../env.js";
|
|
3
4
|
import { type LocaleMap } from "../../../../helpers/translate.js";
|
|
4
|
-
import { type StdEnv, type StdReader } from "../../reader.js";
|
|
5
5
|
/**
|
|
6
6
|
* Returns the text for the modifiable one-time cost of an activatable skill.
|
|
7
7
|
*/
|
|
@@ -42,7 +42,7 @@ export declare const renderIndefiniteCost: (value: IndefiniteCost, shouldAppendN
|
|
|
42
42
|
/**
|
|
43
43
|
* Returns the text for a standalone one-time cost map of an activatable skill.
|
|
44
44
|
*/
|
|
45
|
-
export declare const renderStandaloneCostMap: (value: StandaloneCostMap) => Reader<StdEnv<"
|
|
45
|
+
export declare const renderStandaloneCostMap: (value: StandaloneCostMap) => Reader<StdEnv<"t" | "tm" | "rts"> & {
|
|
46
46
|
translate: import("../../../../helpers/translate.js").Translate;
|
|
47
47
|
energyUnit: import("../../units/energy.js").EnergyUnit;
|
|
48
48
|
}, string>;
|
|
@@ -63,7 +63,7 @@ export declare const renderNonModifiableSustainedCost: (value: NonModifiableSust
|
|
|
63
63
|
responsiveTextSize: import("../../responsiveText.js").ResponsiveTextSize;
|
|
64
64
|
} & {
|
|
65
65
|
translate: import("../../../../helpers/translate.js").Translate;
|
|
66
|
-
} & StdEnv<"f" | "
|
|
66
|
+
} & StdEnv<"f" | "t" | "tm" | "rts", never, never, never> & import("@elyukai/utils/nullable").AnyNonNullish & StdEnv<"t" | "tm" | "rts" | "eu", never, never, never>, string>;
|
|
67
67
|
/**
|
|
68
68
|
* Returns the text for the cost of a sustained activatable skill.
|
|
69
69
|
*/
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import type { CastingTimeDuringLovemaking, DurationForSustained, ExpressionBasedDuration, Immediate, MusicDuration, PermanentDuration, ResponsiveText } from "@optolith/database-schema/gen";
|
|
2
|
+
import type { StdReader } from "../../../../env.js";
|
|
2
3
|
import type { LocaleMap } from "../../../../helpers/translate.js";
|
|
3
|
-
import { type StdReader } from "../../reader.js";
|
|
4
4
|
/**
|
|
5
5
|
* Returns the text for a duration that is based on an expression.
|
|
6
6
|
*/
|
|
@@ -2,7 +2,7 @@ import { Reader } from "@elyukai/utils/reader";
|
|
|
2
2
|
import { mapNullable } from "@optolith/helpers/nullable";
|
|
3
3
|
import { assertExhaustive } from "@optolith/helpers/typeSafety";
|
|
4
4
|
import { Case } from "../../../../helpers/enums.js";
|
|
5
|
-
import { responsiveTextR, responsiveTranslateR, translateMapR, translateR
|
|
5
|
+
import { responsiveTextR, responsiveTranslateR, translateMapR, translateR } from "../../reader.js";
|
|
6
6
|
import { replaceTextIfNeeded } from "../../responsiveText.js";
|
|
7
7
|
import { formatCombinedTimeSpanR, formatTimeSpanR } from "../../units/timeSpan.js";
|
|
8
8
|
import { MISSING_VALUE } from "../../unknown.js";
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import type { ActivatableSkillEffect } from "@optolith/database-schema/gen";
|
|
2
|
+
import type { StdReader } from "../../../../env.js";
|
|
2
3
|
import type { RawDefinitionListEntityDescriptionSectionItem } from "../../../../index.js";
|
|
3
|
-
import { type StdReader } from "../../reader.js";
|
|
4
4
|
/**
|
|
5
5
|
* Gets the text for the effect of an activatable skill.
|
|
6
6
|
*/
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import type { FastOneTimePerformanceParameters, FastSustainedPerformanceParameters, OneTimePerformanceParameters, ResponsiveTextOptional, SlowOneTimePerformanceParameters, SlowSustainedPerformanceParameters } from "@optolith/database-schema/gen";
|
|
2
|
+
import type { StdReader } from "../../../../env.js";
|
|
2
3
|
import type { RawDefinitionListEntityDescriptionSectionItem } from "../../../../index.js";
|
|
3
|
-
import type { StdReader } from "../../reader.js";
|
|
4
4
|
type RenderedPerformanceParameters = {
|
|
5
5
|
castingTime: string;
|
|
6
6
|
cost: string;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import type { ExpressionBasedRange, Range, RangeValue } from "@optolith/database-schema/gen";
|
|
2
|
-
import {
|
|
2
|
+
import type { StdReader } from "../../../../env.js";
|
|
3
3
|
/**
|
|
4
4
|
* Returns the text for the non-modifiable range of an activatable skill.
|
|
5
5
|
*/
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import type { AffectedTargetCategories } from "@optolith/database-schema/gen";
|
|
2
|
+
import type { StdReader } from "../../../../env.js";
|
|
2
3
|
import { type RawDefinitionListEntityDescriptionSectionItem } from "../../../../index.js";
|
|
3
|
-
import { type StdReader } from "../../reader.js";
|
|
4
4
|
/**
|
|
5
5
|
* Get the text for the target category.
|
|
6
6
|
*/
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import type { ImprovementCost } from "@optolith/database-schema/gen";
|
|
2
|
+
import type { StdReader } from "../../../env.js";
|
|
2
3
|
import { type RawDefinitionListEntityDescriptionSectionItem } from "../../../index.js";
|
|
3
|
-
import { type StdReader } from "../reader.js";
|
|
4
4
|
/**
|
|
5
5
|
* Renders an improvement cost value as a string.
|
|
6
6
|
*/
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import type { SkillCheckPenalty as GeneralSkillCheckPenalty, MagicalRuneCombatTechniqueCheckPenalty, SkillCheck } from "@optolith/database-schema/gen";
|
|
2
|
+
import type { StdReader } from "../../../env.js";
|
|
2
3
|
import { type IdMap } from "../../../index.js";
|
|
3
|
-
import { type StdReader } from "../reader.js";
|
|
4
4
|
/**
|
|
5
5
|
* Renders a skill check.
|
|
6
6
|
*/
|