@optolith/entity-descriptions 0.4.0 → 0.4.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 +20 -0
- package/lib/creator.d.ts +2 -2
- package/lib/entities/activatable.js +35 -64
- package/lib/entities/culture.js +18 -26
- package/lib/entities/curriculum.js +30 -33
- package/lib/entities/derivedCharacteristic.js +1 -1
- package/lib/entities/disease.js +3 -6
- package/lib/entities/elixir.js +6 -4
- package/lib/entities/equipment.js +17 -17
- package/lib/entities/equipmentPackage.js +4 -3
- package/lib/entities/experienceLevel.js +7 -7
- package/lib/entities/focusRule.js +2 -2
- package/lib/entities/influence.js +2 -2
- package/lib/entities/liturgicalChant.d.ts +1 -1
- package/lib/entities/partial/adventurePointsValue.js +14 -19
- package/lib/entities/partial/enhancements.d.ts +1 -1
- package/lib/entities/partial/enhancements.js +1 -1
- package/lib/entities/partial/herbary.js +13 -9
- package/lib/entities/partial/map.d.ts +3 -1
- package/lib/entities/partial/map.js +21 -8
- package/lib/entities/partial/mathOperation.js +12 -17
- package/lib/entities/partial/prerequisites/displayOption.d.ts +2 -2
- package/lib/entities/partial/prerequisites/index.d.ts +3 -3
- package/lib/entities/partial/prerequisites/index.js +10 -4
- package/lib/entities/partial/prerequisites/part.d.ts +1 -1
- package/lib/entities/partial/prerequisites/prerequisiteGroups.d.ts +4 -4
- package/lib/entities/partial/prerequisites/prerequisiteGroups.js +1 -1
- package/lib/entities/partial/prerequisites/single/activatable.d.ts +3 -3
- package/lib/entities/partial/prerequisites/single/animistPower.d.ts +2 -2
- package/lib/entities/partial/prerequisites/single/animistPower.js +1 -1
- package/lib/entities/partial/prerequisites/single/blessedTradition.d.ts +2 -2
- package/lib/entities/partial/prerequisites/single/commonSuggestedByRCP.d.ts +2 -2
- package/lib/entities/partial/prerequisites/single/culture.d.ts +4 -4
- package/lib/entities/partial/prerequisites/single/enhancement.d.ts +4 -4
- package/lib/entities/partial/prerequisites/single/influence.d.ts +3 -3
- package/lib/entities/partial/prerequisites/single/magicalTradition.d.ts +2 -2
- package/lib/entities/partial/prerequisites/single/noOtherAncestorBloodAdvantage.d.ts +2 -2
- package/lib/entities/partial/prerequisites/single/pact.d.ts +3 -3
- package/lib/entities/partial/prerequisites/single/personalityTrait.d.ts +4 -4
- package/lib/entities/partial/prerequisites/single/primaryAttribute.d.ts +3 -3
- package/lib/entities/partial/prerequisites/single/primaryAttribute.js +1 -1
- package/lib/entities/partial/prerequisites/single/profession.d.ts +4 -4
- package/lib/entities/partial/prerequisites/single/publication.d.ts +4 -4
- package/lib/entities/partial/prerequisites/single/race.d.ts +4 -4
- package/lib/entities/partial/prerequisites/single/rated.d.ts +2 -2
- package/lib/entities/partial/prerequisites/single/rated.js +2 -2
- package/lib/entities/partial/prerequisites/single/ratedMinimumNumber.d.ts +3 -3
- package/lib/entities/partial/prerequisites/single/ratedMinimumNumber.js +1 -1
- package/lib/entities/partial/prerequisites/single/ratedSum.d.ts +4 -4
- package/lib/entities/partial/prerequisites/single/rule.d.ts +3 -3
- package/lib/entities/partial/prerequisites/single/sex.d.ts +1 -1
- package/lib/entities/partial/prerequisites/single/sexualCharacteristic.d.ts +3 -3
- package/lib/entities/partial/prerequisites/single/socialStatus.d.ts +3 -3
- package/lib/entities/partial/prerequisites/single/state.d.ts +4 -4
- package/lib/entities/partial/prerequisites/single/text.d.ts +3 -3
- package/lib/entities/partial/rated/activatable/castingTime.d.ts +1 -1
- package/lib/entities/partial/rated/activatable/castingTime.js +6 -8
- package/lib/entities/partial/rated/activatable/cost.d.ts +1 -1
- package/lib/entities/partial/rated/activatable/cost.js +17 -14
- package/lib/entities/partial/rated/activatable/duration.js +4 -4
- package/lib/entities/partial/rated/activatable/effect.js +1 -1
- package/lib/entities/partial/rated/activatable/isMinimumMaximum.js +2 -2
- package/lib/entities/partial/rated/activatable/range.js +6 -6
- package/lib/entities/partial/rated/activatable/speed.d.ts +1 -1
- package/lib/entities/partial/rated/activatable/targetCategory.js +2 -2
- package/lib/entities/partial/reader.d.ts +4 -2
- package/lib/entities/partial/responsiveText.d.ts +5 -1
- package/lib/entities/partial/responsiveText.js +3 -5
- package/lib/entities/partial/units/length.d.ts +1 -1
- package/lib/entities/partial/units/length.js +2 -10
- package/lib/entities/partial/units/timeSpan.d.ts +4 -4
- package/lib/entities/partial/units/timeSpan.js +21 -17
- package/lib/entities/personalityTrait.js +3 -4
- package/lib/entities/poison.js +4 -4
- package/lib/entities/profession.d.ts +1 -1
- package/lib/entities/profession.js +19 -14
- package/lib/entities/race.js +11 -13
- package/lib/entities/sexPractice.js +1 -3
- package/lib/entities/skill.js +2 -3
- package/lib/entities/spell.js +14 -4
- package/lib/helpers/getTypes.d.ts +2 -2
- package/lib/helpers/locale.d.ts +7 -2
- package/lib/helpers/translate.d.ts +1 -1
- package/lib/index.d.ts +3 -1
- package/lib/index.js +1 -0
- package/lib/references/index.d.ts +1 -1
- package/lib/references/index.js +1 -1
- package/lib/references/page.d.ts +3 -3
- package/lib/references/page.js +1 -1
- package/lib/references/pageRange.d.ts +2 -2
- package/lib/tsconfig.tsbuildinfo +1 -1
- package/package.json +4 -3
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import { AdvantageDisadvantagePrerequisiteGroup, AnimistPowerPrerequisiteGroup, ArcaneTraditionPrerequisiteGroup, DerivedCharacteristicPrerequisiteGroup, EnhancementPrerequisiteGroup, GeneralPrerequisiteGroup, GeodeRitualPrerequisiteGroup, InfluencePrerequisiteGroup, LanguagePrerequisiteGroup, LiturgyPrerequisiteGroup, PersonalityTraitPrerequisiteGroup, PreconditionGroup, ProfessionPrerequisiteGroup, PublicationPrerequisiteGroup,
|
|
1
|
+
import type { ActivatableIdentifier, AdvantageDisadvantagePrerequisiteGroup, AnimistPowerPrerequisiteGroup, ArcaneTraditionPrerequisiteGroup, DerivedCharacteristicPrerequisiteGroup, EnhancementPrerequisiteGroup, GeneralPrerequisiteGroup, GeodeRitualPrerequisiteGroup, InfluencePrerequisiteGroup, LanguagePrerequisiteGroup, LiturgyPrerequisiteGroup, PersonalityTraitPrerequisiteGroup, PreconditionGroup, ProfessionPrerequisiteGroup, PublicationPrerequisiteGroup, RatedIdentifier, SpellworkPrerequisiteGroup } from "optolith-database-schema/gen";
|
|
2
2
|
import type { GetAllChildInstancesForParent, GetInstanceById } from "../../../helpers/getTypes.js";
|
|
3
|
-
import { LocaleEnvironment } from "../../../helpers/locale.js";
|
|
4
|
-
import { PrerequisitePart } from "./part.js";
|
|
5
|
-
import { GetResolvedSelectOptionById } from "./single/activatable.js";
|
|
3
|
+
import type { LocaleEnvironment } from "../../../helpers/locale.js";
|
|
4
|
+
import type { PrerequisitePart } from "./part.js";
|
|
5
|
+
import { type GetResolvedSelectOptionById } from "./single/activatable.js";
|
|
6
6
|
/**
|
|
7
7
|
* Print the translation of a derived characteristic prerequisite group.
|
|
8
8
|
*/
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { assertExhaustive } from "@optolith/helpers/typeSafety";
|
|
2
|
-
import { printActivatablePrerequisite } from "./single/activatable.js";
|
|
2
|
+
import { printActivatablePrerequisite, } from "./single/activatable.js";
|
|
3
3
|
import { printAnimistPowerPrerequisite } from "./single/animistPower.js";
|
|
4
4
|
import { printBlessedTraditionPrerequisite } from "./single/blessedTradition.js";
|
|
5
5
|
import { printCommonSuggestedByRCPPrerequisite } from "./single/commonSuggestedByRCP.js";
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import type { ResolvedSelectOption, ResolvedSelectOptionIdentifier } from "optolith-database-schema/cache";
|
|
2
2
|
import type { ActivatableIdentifier, ActivatablePrerequisite, RequirableSelectOptionIdentifier } from "optolith-database-schema/gen";
|
|
3
|
-
import {
|
|
4
|
-
import { LocaleEnvironment } from "../../../../helpers/locale.js";
|
|
3
|
+
import type { GetInstanceById } from "../../../../helpers/getTypes.js";
|
|
4
|
+
import type { LocaleEnvironment } from "../../../../helpers/locale.js";
|
|
5
5
|
import type { Translate } from "../../../../helpers/translate.js";
|
|
6
|
-
import { PrerequisitePart } from "../part.js";
|
|
6
|
+
import type { PrerequisitePart } from "../part.js";
|
|
7
7
|
/**
|
|
8
8
|
* Gets a resolved select option by its identifier.
|
|
9
9
|
*/
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import type { AnimistPowerPrerequisite } from "optolith-database-schema/gen";
|
|
2
2
|
import { type GetInstanceById } from "../../../../helpers/getTypes.js";
|
|
3
|
-
import { LocaleEnvironment } from "../../../../helpers/locale.js";
|
|
4
|
-
import { PrerequisitePart } from "../part.js";
|
|
3
|
+
import type { LocaleEnvironment } from "../../../../helpers/locale.js";
|
|
4
|
+
import type { PrerequisitePart } from "../part.js";
|
|
5
5
|
/**
|
|
6
6
|
* Get the translation of a culture prerequisite.
|
|
7
7
|
*/
|
|
@@ -13,7 +13,7 @@ export const printAnimistPowerPrerequisite = (getInstanceById, locale, prerequis
|
|
|
13
13
|
value: [
|
|
14
14
|
locale.translateMap(animistPower?.translations)?.name ?? "MISSING_VALUE",
|
|
15
15
|
prerequisite.level === undefined ? undefined : romanize(prerequisite.level),
|
|
16
|
-
prerequisite.value.
|
|
16
|
+
prerequisite.value.toFixed(),
|
|
17
17
|
]
|
|
18
18
|
.filter(isNotNullish)
|
|
19
19
|
.join(" "),
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import type { BlessedTraditionPrerequisite } from "optolith-database-schema/gen";
|
|
2
|
-
import { LocaleEnvironment } from "../../../../helpers/locale.js";
|
|
3
|
-
import { PrerequisitePart } from "../part.js";
|
|
2
|
+
import type { LocaleEnvironment } from "../../../../helpers/locale.js";
|
|
3
|
+
import type { PrerequisitePart } from "../part.js";
|
|
4
4
|
/**
|
|
5
5
|
* Get the translation of a blessed tradition prerequisite.
|
|
6
6
|
*/
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { LocaleEnvironment } from "../../../../helpers/locale.js";
|
|
2
|
-
import { PrerequisitePart } from "../part.js";
|
|
1
|
+
import type { LocaleEnvironment } from "../../../../helpers/locale.js";
|
|
2
|
+
import type { PrerequisitePart } from "../part.js";
|
|
3
3
|
/**
|
|
4
4
|
* Get the translation of a culture prerequisite.
|
|
5
5
|
*/
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { CulturePrerequisite } from "optolith-database-schema/gen";
|
|
2
|
-
import {
|
|
3
|
-
import { LocaleEnvironment } from "../../../../helpers/locale.js";
|
|
4
|
-
import { PrerequisitePart } from "../part.js";
|
|
1
|
+
import type { CulturePrerequisite } from "optolith-database-schema/gen";
|
|
2
|
+
import type { GetInstanceById } from "../../../../helpers/getTypes.js";
|
|
3
|
+
import type { LocaleEnvironment } from "../../../../helpers/locale.js";
|
|
4
|
+
import type { PrerequisitePart } from "../part.js";
|
|
5
5
|
/**
|
|
6
6
|
* Get the translation of a culture prerequisite.
|
|
7
7
|
*/
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
import { LocaleEnvironment } from "../../../../helpers/locale.js";
|
|
4
|
-
import { PrerequisitePart } from "../part.js";
|
|
1
|
+
import type { EnhancementPrerequisite } from "optolith-database-schema/gen";
|
|
2
|
+
import type { GetInstanceById } from "../../../../helpers/getTypes.js";
|
|
3
|
+
import type { LocaleEnvironment } from "../../../../helpers/locale.js";
|
|
4
|
+
import type { PrerequisitePart } from "../part.js";
|
|
5
5
|
/**
|
|
6
6
|
* Get the translation of an external enhancement prerequisite.
|
|
7
7
|
*/
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { InfluencePrerequisite } from "optolith-database-schema/gen";
|
|
1
|
+
import type { InfluencePrerequisite } from "optolith-database-schema/gen";
|
|
2
2
|
import type { GetInstanceById } from "../../../../helpers/getTypes.js";
|
|
3
|
-
import { LocaleEnvironment } from "../../../../helpers/locale.js";
|
|
4
|
-
import { PrerequisitePart } from "../part.js";
|
|
3
|
+
import type { LocaleEnvironment } from "../../../../helpers/locale.js";
|
|
4
|
+
import type { PrerequisitePart } from "../part.js";
|
|
5
5
|
/**
|
|
6
6
|
* Get the translation of a culture prerequisite.
|
|
7
7
|
*/
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import type { MagicalTraditionPrerequisite } from "optolith-database-schema/gen";
|
|
2
|
-
import { LocaleEnvironment } from "../../../../helpers/locale.js";
|
|
3
|
-
import { PrerequisitePart } from "../part.js";
|
|
2
|
+
import type { LocaleEnvironment } from "../../../../helpers/locale.js";
|
|
3
|
+
import type { PrerequisitePart } from "../part.js";
|
|
4
4
|
/**
|
|
5
5
|
* Get the translation of a magical tradition prerequisite.
|
|
6
6
|
*/
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { LocaleEnvironment } from "../../../../helpers/locale.js";
|
|
2
|
-
import { PrerequisitePart } from "../part.js";
|
|
1
|
+
import type { LocaleEnvironment } from "../../../../helpers/locale.js";
|
|
2
|
+
import type { PrerequisitePart } from "../part.js";
|
|
3
3
|
/**
|
|
4
4
|
* Get the translation of a culture prerequisite.
|
|
5
5
|
*/
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import type { PactPrerequisite } from "optolith-database-schema/gen";
|
|
2
|
-
import {
|
|
3
|
-
import { LocaleEnvironment } from "../../../../helpers/locale.js";
|
|
4
|
-
import { PrerequisitePart } from "../part.js";
|
|
2
|
+
import type { GetInstanceById } from "../../../../helpers/getTypes.js";
|
|
3
|
+
import type { LocaleEnvironment } from "../../../../helpers/locale.js";
|
|
4
|
+
import type { PrerequisitePart } from "../part.js";
|
|
5
5
|
/**
|
|
6
6
|
* Get the translation of a culture prerequisite.
|
|
7
7
|
*/
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
import { LocaleEnvironment } from "../../../../helpers/locale.js";
|
|
4
|
-
import { PrerequisitePart } from "../part.js";
|
|
1
|
+
import type { PersonalityTraitPrerequisite } from "optolith-database-schema/gen";
|
|
2
|
+
import type { GetInstanceById } from "../../../../helpers/getTypes.js";
|
|
3
|
+
import type { LocaleEnvironment } from "../../../../helpers/locale.js";
|
|
4
|
+
import type { PrerequisitePart } from "../part.js";
|
|
5
5
|
/**
|
|
6
6
|
* Get the translation of a personality trait prerequisite.
|
|
7
7
|
*/
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { PrimaryAttributePrerequisite } from "optolith-database-schema/gen";
|
|
2
|
-
import { LocaleEnvironment } from "../../../../helpers/locale.js";
|
|
3
|
-
import { PrerequisitePart } from "../part.js";
|
|
1
|
+
import type { PrimaryAttributePrerequisite } from "optolith-database-schema/gen";
|
|
2
|
+
import type { LocaleEnvironment } from "../../../../helpers/locale.js";
|
|
3
|
+
import type { PrerequisitePart } from "../part.js";
|
|
4
4
|
/**
|
|
5
5
|
* Get the translation of a state prerequisite.
|
|
6
6
|
*/
|
|
@@ -8,7 +8,7 @@ export const printPrimaryAttributePrerequisite = (locale, prerequisite) => {
|
|
|
8
8
|
}
|
|
9
9
|
return {
|
|
10
10
|
label: `${locale.translate("Primary Attribute")} `,
|
|
11
|
-
value: prerequisite.value.
|
|
11
|
+
value: prerequisite.value.toFixed(),
|
|
12
12
|
sentenceType: undefined,
|
|
13
13
|
isMeta: false,
|
|
14
14
|
};
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
import { LocaleEnvironment } from "../../../../helpers/locale.js";
|
|
4
|
-
import { PrerequisitePart } from "../part.js";
|
|
1
|
+
import type { ProfessionPrerequisite } from "optolith-database-schema/gen";
|
|
2
|
+
import type { GetAllChildInstancesForParent } from "../../../../helpers/getTypes.js";
|
|
3
|
+
import type { LocaleEnvironment } from "../../../../helpers/locale.js";
|
|
4
|
+
import type { PrerequisitePart } from "../part.js";
|
|
5
5
|
/**
|
|
6
6
|
* Get the translation of a profession prerequisite.
|
|
7
7
|
*/
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { PublicationPrerequisite } from "optolith-database-schema/gen";
|
|
2
|
-
import {
|
|
3
|
-
import { LocaleEnvironment } from "../../../../helpers/locale.js";
|
|
4
|
-
import { PrerequisitePart } from "../part.js";
|
|
1
|
+
import type { PublicationPrerequisite } from "optolith-database-schema/gen";
|
|
2
|
+
import type { GetInstanceById } from "../../../../helpers/getTypes.js";
|
|
3
|
+
import type { LocaleEnvironment } from "../../../../helpers/locale.js";
|
|
4
|
+
import type { PrerequisitePart } from "../part.js";
|
|
5
5
|
/**
|
|
6
6
|
* Get the translation of a state prerequisite.
|
|
7
7
|
*/
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { RacePrerequisite } from "optolith-database-schema/gen";
|
|
2
|
-
import {
|
|
3
|
-
import { LocaleEnvironment } from "../../../../helpers/locale.js";
|
|
4
|
-
import { PrerequisitePart } from "../part.js";
|
|
1
|
+
import type { RacePrerequisite } from "optolith-database-schema/gen";
|
|
2
|
+
import type { GetInstanceById } from "../../../../helpers/getTypes.js";
|
|
3
|
+
import type { LocaleEnvironment } from "../../../../helpers/locale.js";
|
|
4
|
+
import type { PrerequisitePart } from "../part.js";
|
|
5
5
|
/**
|
|
6
6
|
* Get the translation of a race prerequisite.
|
|
7
7
|
*/
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import type { RatedPrerequisite } from "optolith-database-schema/gen";
|
|
2
2
|
import { type GetInstanceById } from "../../../../helpers/getTypes.js";
|
|
3
|
-
import { LocaleEnvironment } from "../../../../helpers/locale.js";
|
|
4
|
-
import { PrerequisitePart } from "../part.js";
|
|
3
|
+
import type { LocaleEnvironment } from "../../../../helpers/locale.js";
|
|
4
|
+
import type { PrerequisitePart } from "../part.js";
|
|
5
5
|
/**
|
|
6
6
|
* Get the translation of a blessed tradition prerequisite.
|
|
7
7
|
*/
|
|
@@ -4,7 +4,7 @@ import { printDisplayOption } from "../displayOption.js";
|
|
|
4
4
|
const printRatedName = (getInstanceById, translateMap, id) => {
|
|
5
5
|
switch (id.kind) {
|
|
6
6
|
case "Attribute":
|
|
7
|
-
return (translateMap(getInstanceById("Attribute", id.Attribute)?.translations)?.
|
|
7
|
+
return (translateMap(getInstanceById("Attribute", id.Attribute)?.translations)?.abbreviation ??
|
|
8
8
|
MISSING_VALUE);
|
|
9
9
|
case "Skill":
|
|
10
10
|
return translateMap(getInstanceById("Skill", id.Skill)?.translations)?.name ?? MISSING_VALUE;
|
|
@@ -34,7 +34,7 @@ export const printRatedPrerequisite = (getInstanceById, locale, prerequisite) =>
|
|
|
34
34
|
return printDisplayOption(locale.translateMap, prerequisite.display_option);
|
|
35
35
|
}
|
|
36
36
|
return {
|
|
37
|
-
value: `${printRatedName(getInstanceById, locale.translateMap, prerequisite.id)} ${prerequisite.value}`,
|
|
37
|
+
value: `${printRatedName(getInstanceById, locale.translateMap, prerequisite.id)} ${prerequisite.value.toFixed()}`,
|
|
38
38
|
sentenceType: undefined,
|
|
39
39
|
isMeta: false,
|
|
40
40
|
};
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import type { RatedMinimumNumberPrerequisite } from "optolith-database-schema/gen";
|
|
2
|
-
import {
|
|
3
|
-
import { LocaleEnvironment } from "../../../../helpers/locale.js";
|
|
4
|
-
import { PrerequisitePart } from "../part.js";
|
|
2
|
+
import type { GetInstanceById } from "../../../../helpers/getTypes.js";
|
|
3
|
+
import type { LocaleEnvironment } from "../../../../helpers/locale.js";
|
|
4
|
+
import type { PrerequisitePart } from "../part.js";
|
|
5
5
|
/**
|
|
6
6
|
* Get the translation of a rated minimum number prerequisite.
|
|
7
7
|
*/
|
|
@@ -56,7 +56,7 @@ export const printRatedMinimumNumberPrerequisite = (getInstanceById, locale, pre
|
|
|
56
56
|
// fr-FR: "Ranged Combat 10"
|
|
57
57
|
// it-IT: "Una tecnica di combattimento a distanza 10"
|
|
58
58
|
return {
|
|
59
|
-
value: `${printNumberOfCombatTechniques(locale, prerequisite.targets.CombatTechniques.group, prerequisite.number)} ${prerequisite.value}`,
|
|
59
|
+
value: `${printNumberOfCombatTechniques(locale, prerequisite.targets.CombatTechniques.group, prerequisite.number)} ${prerequisite.value.toFixed()}`,
|
|
60
60
|
sentenceType: undefined,
|
|
61
61
|
isMeta: false,
|
|
62
62
|
};
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { RatedSumPrerequisite } from "optolith-database-schema/gen";
|
|
2
|
-
import {
|
|
3
|
-
import { LocaleEnvironment } from "../../../../helpers/locale.js";
|
|
4
|
-
import { PrerequisitePart } from "../part.js";
|
|
1
|
+
import type { RatedSumPrerequisite } from "optolith-database-schema/gen";
|
|
2
|
+
import type { GetInstanceById } from "../../../../helpers/getTypes.js";
|
|
3
|
+
import type { LocaleEnvironment } from "../../../../helpers/locale.js";
|
|
4
|
+
import type { PrerequisitePart } from "../part.js";
|
|
5
5
|
/**
|
|
6
6
|
* Get the translation of a rated sum prerequisite.
|
|
7
7
|
*/
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { RulePrerequisite } from "optolith-database-schema/gen";
|
|
2
|
-
import { LocaleEnvironment } from "../../../../helpers/locale.js";
|
|
3
|
-
import { PrerequisitePart } from "../part.js";
|
|
1
|
+
import type { RulePrerequisite } from "optolith-database-schema/gen";
|
|
2
|
+
import type { LocaleEnvironment } from "../../../../helpers/locale.js";
|
|
3
|
+
import type { PrerequisitePart } from "../part.js";
|
|
4
4
|
/**
|
|
5
5
|
* Get the translation of a rule prerequisite.
|
|
6
6
|
*/
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import type { SexPrerequisite } from "optolith-database-schema/gen";
|
|
2
2
|
import type { Translate } from "../../../../helpers/translate.js";
|
|
3
|
-
import { PrerequisitePart } from "../part.js";
|
|
3
|
+
import type { PrerequisitePart } from "../part.js";
|
|
4
4
|
/**
|
|
5
5
|
* Get the translation of a (binary) sex prerequisite.
|
|
6
6
|
*/
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { SexualCharacteristicPrerequisite } from "optolith-database-schema/gen";
|
|
2
|
-
import { LocaleEnvironment } from "../../../../helpers/locale.js";
|
|
3
|
-
import { PrerequisitePart } from "../part.js";
|
|
1
|
+
import type { SexualCharacteristicPrerequisite } from "optolith-database-schema/gen";
|
|
2
|
+
import type { LocaleEnvironment } from "../../../../helpers/locale.js";
|
|
3
|
+
import type { PrerequisitePart } from "../part.js";
|
|
4
4
|
/**
|
|
5
5
|
* Get the translation of a sexual characteristic prerequisite.
|
|
6
6
|
*/
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import type { SocialStatusPrerequisite } from "optolith-database-schema/gen";
|
|
2
|
-
import {
|
|
3
|
-
import { LocaleEnvironment } from "../../../../helpers/locale.js";
|
|
4
|
-
import { PrerequisitePart } from "../part.js";
|
|
2
|
+
import type { GetInstanceById } from "../../../../helpers/getTypes.js";
|
|
3
|
+
import type { LocaleEnvironment } from "../../../../helpers/locale.js";
|
|
4
|
+
import type { PrerequisitePart } from "../part.js";
|
|
5
5
|
/**
|
|
6
6
|
* Get the translation of a social status prerequisite.
|
|
7
7
|
*/
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { StatePrerequisite } from "optolith-database-schema/gen";
|
|
2
|
-
import {
|
|
3
|
-
import { LocaleEnvironment } from "../../../../helpers/locale.js";
|
|
4
|
-
import { PrerequisitePart } from "../part.js";
|
|
1
|
+
import type { StatePrerequisite } from "optolith-database-schema/gen";
|
|
2
|
+
import type { GetInstanceById } from "../../../../helpers/getTypes.js";
|
|
3
|
+
import type { LocaleEnvironment } from "../../../../helpers/locale.js";
|
|
4
|
+
import type { PrerequisitePart } from "../part.js";
|
|
5
5
|
/**
|
|
6
6
|
* Get the translation of a state prerequisite.
|
|
7
7
|
*/
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { TextPrerequisite } from "optolith-database-schema/gen";
|
|
2
|
-
import { LocaleEnvironment } from "../../../../helpers/locale.js";
|
|
3
|
-
import { PrerequisitePart } from "../part.js";
|
|
1
|
+
import type { TextPrerequisite } from "optolith-database-schema/gen";
|
|
2
|
+
import type { LocaleEnvironment } from "../../../../helpers/locale.js";
|
|
3
|
+
import type { PrerequisitePart } from "../part.js";
|
|
4
4
|
/**
|
|
5
5
|
* Get the translation of a text prerequisite.
|
|
6
6
|
*/
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { CastingTime, FastCastingTime, FastSkillNonModifiableCastingTime, SlowCastingTime, SlowSkillNonModifiableCastingTime } from "optolith-database-schema/gen";
|
|
1
|
+
import type { CastingTime, FastCastingTime, FastSkillNonModifiableCastingTime, SlowCastingTime, SlowSkillNonModifiableCastingTime } from "optolith-database-schema/gen";
|
|
2
2
|
import { type StdReader } from "../../reader.js";
|
|
3
3
|
/**
|
|
4
4
|
* Renders the text for a non-modifiable casting time of a fast activatable skill.
|
|
@@ -2,17 +2,15 @@ import { Reader } from "@elyukai/utils/reader";
|
|
|
2
2
|
import { isNotNullish, mapNullable } from "@optolith/helpers/nullable";
|
|
3
3
|
import { assertExhaustive } from "@optolith/helpers/typeSafety";
|
|
4
4
|
import { Case } from "../../../../helpers/enums.js";
|
|
5
|
-
import { getInstanceByIdFnR, modifiableBySpeedR
|
|
6
|
-
import { formatCombinedTimeSpanR, formatTimeSpanR
|
|
5
|
+
import { getInstanceByIdFnR, modifiableBySpeedR } from "../../reader.js";
|
|
6
|
+
import { formatCombinedTimeSpanR, formatTimeSpanR } from "../../units/timeSpan.js";
|
|
7
7
|
import { MISSING_VALUE } from "../../unknown.js";
|
|
8
|
-
import { appendNonModifiableSuffix, ModifiableParameter
|
|
8
|
+
import { appendNonModifiableSuffix, ModifiableParameter } from "./nonModifiableSuffix.js";
|
|
9
9
|
import { Speed } from "./speed.js";
|
|
10
10
|
const deriveModifiableCastingTime = (modificationLevelId) => getInstanceByIdFnR().thenW(getInstanceById => mapNullable(getInstanceById("SkillModificationLevel", modificationLevelId), modificationLevel => modifiableBySpeedR("casting_time", modificationLevel).map(castingTime => typeof castingTime === "number"
|
|
11
11
|
? { value: castingTime, unit: Case("Actions") }
|
|
12
12
|
: castingTime)) ?? Reader.of(undefined));
|
|
13
|
-
const renderModifiableCastingTime = (value) => deriveModifiableCastingTime(value.initial_modification_level).thenW(castingTime => castingTime === undefined
|
|
14
|
-
? Reader.of(MISSING_VALUE)
|
|
15
|
-
: formatCombinedTimeSpanR(castingTime));
|
|
13
|
+
const renderModifiableCastingTime = (value) => deriveModifiableCastingTime(value.initial_modification_level).thenW(castingTime => castingTime === undefined ? Reader.of(MISSING_VALUE) : formatCombinedTimeSpanR(castingTime));
|
|
16
14
|
const renderCastingTimeDuringLovemaking = (value) => formatCombinedTimeSpanR(value);
|
|
17
15
|
/**
|
|
18
16
|
* Renders the text for a non-modifiable casting time of a fast activatable skill.
|
|
@@ -36,9 +34,9 @@ export const renderCastingTime = (renderNonModifiableCastingTime, value) => {
|
|
|
36
34
|
}
|
|
37
35
|
};
|
|
38
36
|
const renderCastingTimeIncludingLovemaking = (renderNonModifiableCastingTime, value) => Reader.sequence([
|
|
39
|
-
mapNullable(value.default, def => renderCastingTime(renderNonModifiableCastingTime, def)) ??
|
|
40
|
-
mapNullable(value.during_lovemaking, renderCastingTimeDuringLovemaking) ??
|
|
37
|
+
mapNullable(value.default, def => renderCastingTime(renderNonModifiableCastingTime, def)) ??
|
|
41
38
|
Reader.of(undefined),
|
|
39
|
+
mapNullable(value.during_lovemaking, renderCastingTimeDuringLovemaking) ?? Reader.of(undefined),
|
|
42
40
|
]).map(texts => texts.filter(isNotNullish).join(" / "));
|
|
43
41
|
/**
|
|
44
42
|
* Get the text for the casting time of a fast activatable skill.
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { Reader } from "@elyukai/utils/reader";
|
|
2
|
-
import {
|
|
2
|
+
import type { CheckResultBasedModifier, DurationUnitValue, ElvenMagicalSongPermanentCost, FirstPersonMagicalMelodyCost, NonModifiableOneTimeCostPerCountable, NonModifiableSustainedCost, OneTimeCost, OneTimeCostMap, ResponsiveText, ResponsiveTextOptional, ResponsiveTextReplace, SkillModificationLevel_ID, SustainedCost } from "optolith-database-schema/gen";
|
|
3
3
|
import { type LocaleMap } from "../../../../helpers/translate.js";
|
|
4
4
|
import { type StdEnv, type StdReader } from "../../reader.js";
|
|
5
5
|
/**
|
|
@@ -3,14 +3,13 @@ import { Reader } from "@elyukai/utils/reader";
|
|
|
3
3
|
import { mapNullable } from "@optolith/helpers/nullable";
|
|
4
4
|
import { assertExhaustive } from "@optolith/helpers/typeSafety";
|
|
5
5
|
import { renderResponsiveMap } from "../../map.js";
|
|
6
|
-
import { additionFormatter } from "../../mathOperation.js";
|
|
7
6
|
import { formatEnergyFnR, formatEnergyR, getInstanceByIdFnR, modifiableBySpeedR, responsiveLocaleJoinR, responsiveR, responsiveTextR, responsiveTranslateR, translateMapR, translateR, } from "../../reader.js";
|
|
8
|
-
import { appendNoteIfNeeded, replaceTextIfNeeded
|
|
7
|
+
import { appendNoteIfNeeded, replaceTextIfNeeded } from "../../responsiveText.js";
|
|
9
8
|
import { formatCombinedTimeSpanR } from "../../units/timeSpan.js";
|
|
10
9
|
import { MISSING_VALUE } from "../../unknown.js";
|
|
11
10
|
import { appendCheckResultModifier } from "./checkResultBased.js";
|
|
12
11
|
import { wrapIfMinimum } from "./isMinimumMaximum.js";
|
|
13
|
-
import { appendNonModifiableSuffix, ModifiableParameter
|
|
12
|
+
import { appendNonModifiableSuffix, ModifiableParameter } from "./nonModifiableSuffix.js";
|
|
14
13
|
const deriveModifiableCost = (modificationLevelId) => getInstanceByIdFnR().thenW(getInstanceById => mapNullable(getInstanceById("SkillModificationLevel", modificationLevelId), modificationLevel => modifiableBySpeedR("cost", modificationLevel)) ?? Reader.of(undefined));
|
|
15
14
|
const appendPerCountableToCostIfNeeded = (value, baseCost) => {
|
|
16
15
|
if (value === undefined) {
|
|
@@ -22,7 +21,10 @@ const appendPerCountableToCostIfNeeded = (value, baseCost) => {
|
|
|
22
21
|
return Reader.of(baseCost);
|
|
23
22
|
}
|
|
24
23
|
return responsiveTextR(translation.countable)
|
|
25
|
-
.thenW(countable => responsiveTranslateR("{$cost} per {$countable}", "{$cost}/{$countable}", {
|
|
24
|
+
.thenW(countable => responsiveTranslateR("{$cost} per {$countable}", "{$cost}/{$countable}", {
|
|
25
|
+
cost: baseCost,
|
|
26
|
+
countable,
|
|
27
|
+
}))
|
|
26
28
|
.thenW(text => minimum_total === undefined
|
|
27
29
|
? Reader.of(text)
|
|
28
30
|
: formatEnergyR(minimum_total).then(cost => translateR("{$baseCost}, minimum of {$value}", {
|
|
@@ -32,7 +34,9 @@ const appendPerCountableToCostIfNeeded = (value, baseCost) => {
|
|
|
32
34
|
});
|
|
33
35
|
};
|
|
34
36
|
const appendPermanentCostIfNeeded = (permanentValue, baseCost) => mapNullable(permanentValue, value => responsiveTranslateR(".input {$value :number} {{, {$value} of which are permanent}}", " ({$value} perm.)", { value }).map(text => baseCost + text)) ?? Reader.of(baseCost);
|
|
35
|
-
const appendElvenPermanentCostIfNeeded = (permanent, baseCost) => mapNullable(permanent, value => responsiveTranslateR(".input {$value :number} {{{$value} permanent AE}}", "{$value} pAE", {
|
|
37
|
+
const appendElvenPermanentCostIfNeeded = (permanent, baseCost) => mapNullable(permanent, value => responsiveTranslateR(".input {$value :number} {{{$value} permanent AE}}", "{$value} pAE", {
|
|
38
|
+
value: value.value,
|
|
39
|
+
})
|
|
36
40
|
.thenW(text => replaceTextIfNeeded(value.translations, text))
|
|
37
41
|
.map(text => baseCost + text)) ?? Reader.of(baseCost);
|
|
38
42
|
const appendFamiliarsTrickLPCostIfNeeded = (lpValue, baseCost) => lpValue === undefined
|
|
@@ -51,11 +55,11 @@ export const renderModifiableOneTimeCost = (value) => deriveModifiableCost(value
|
|
|
51
55
|
if (translation?.additional === undefined) {
|
|
52
56
|
return Reader.of(text);
|
|
53
57
|
}
|
|
54
|
-
return responsiveTextR(translation.additional).map(additional =>
|
|
58
|
+
return responsiveTextR(translation.additional).map(additional => `${text} + ${additional}`);
|
|
55
59
|
})));
|
|
56
60
|
const appendIntervalToCost = (interval, baseCost) => interval === undefined
|
|
57
61
|
? Reader.of(baseCost)
|
|
58
|
-
: formatCombinedTimeSpanR(interval).then(formattedInterval => responsiveTranslateR("{$cost} per {$interval}", "{$cost}/{$interval}", {
|
|
62
|
+
: formatCombinedTimeSpanR(interval, true).then(formattedInterval => responsiveTranslateR("{$cost} per {$interval}", "{$cost}/{$interval}", {
|
|
59
63
|
cost: baseCost,
|
|
60
64
|
interval: formattedInterval,
|
|
61
65
|
}));
|
|
@@ -72,7 +76,7 @@ export const renderNonModifiableOneTimeCost = (value, shouldAppendNonModifiableS
|
|
|
72
76
|
.then(base => appendNoteIfNeeded(value.translations, base))
|
|
73
77
|
.then(shouldAppendNonModifiableSuffix
|
|
74
78
|
? base => appendNonModifiableSuffix(ModifiableParameter.Cost, base)
|
|
75
|
-
: Reader.of);
|
|
79
|
+
: base => Reader.of(base));
|
|
76
80
|
/**
|
|
77
81
|
* Returns the text for the indefinite cost of an activatable skill.
|
|
78
82
|
*/
|
|
@@ -82,12 +86,10 @@ export const renderIndefiniteCost = (value, shouldAppendNonModifiableSuffix) =>
|
|
|
82
86
|
.thenW(translation => translation === undefined
|
|
83
87
|
? Reader.of(MISSING_VALUE)
|
|
84
88
|
: responsiveTextR(translation.description))
|
|
85
|
-
.map(modifier === undefined
|
|
86
|
-
? identity
|
|
87
|
-
: base => appendCheckResultModifier(base, modifier))
|
|
89
|
+
.map(modifier === undefined ? identity : base => appendCheckResultModifier(base, modifier))
|
|
88
90
|
.thenW(shouldAppendNonModifiableSuffix
|
|
89
91
|
? base => appendNonModifiableSuffix(ModifiableParameter.Cost, base)
|
|
90
|
-
: Reader.of);
|
|
92
|
+
: base => Reader.of(base));
|
|
91
93
|
};
|
|
92
94
|
const renderSingleOneTimeCost = (value) => {
|
|
93
95
|
switch (value.kind) {
|
|
@@ -104,7 +106,7 @@ const renderSingleOneTimeCost = (value) => {
|
|
|
104
106
|
const renderMultipleOneTimeCosts = (type, value) => {
|
|
105
107
|
const appendNonModifiableIfRequested = !value.every(part => part.kind === "Modifiable")
|
|
106
108
|
? (text) => appendNonModifiableSuffix(ModifiableParameter.Cost, text)
|
|
107
|
-
: Reader.of;
|
|
109
|
+
: (text) => Reader.of(text);
|
|
108
110
|
return Reader.sequence(value.map(renderSingleOneTimeCost))
|
|
109
111
|
.thenW(list => responsiveLocaleJoinR(list, type))
|
|
110
112
|
.then(text => appendNonModifiableIfRequested(text));
|
|
@@ -118,6 +120,7 @@ export const renderOneTimeCostMap = (value) => Reader.asks(({ translate }) => tr
|
|
|
118
120
|
surround: values => translate(", {$value} of which are permanent", {
|
|
119
121
|
value: values,
|
|
120
122
|
}),
|
|
123
|
+
// eslint-disable-next-line @typescript-eslint/no-non-null-assertion -- is checked beforehand
|
|
121
124
|
getAdditionalValue: option => option.permanent_value,
|
|
122
125
|
}
|
|
123
126
|
: undefined))
|
|
@@ -145,7 +148,7 @@ export const renderOneTimeCost = (value) => {
|
|
|
145
148
|
const buildSustainedCost = (activationCost, intervalCost, interval) => {
|
|
146
149
|
const activationCostWithLabel = responsiveR(() => translateR("activation").map(label => `${activationCost} (${label})`), () => Reader.of(activationCost)).thenW(identity);
|
|
147
150
|
const intervalCostWithLabel = appendIntervalToCost(interval, intervalCost);
|
|
148
|
-
return activationCostWithLabel.map2(intervalCostWithLabel,
|
|
151
|
+
return activationCostWithLabel.map2(intervalCostWithLabel, (activationStr, intervalStr) => `${activationStr} + ${intervalStr}`);
|
|
149
152
|
};
|
|
150
153
|
const renderModifiableSustainedCost = (value) => deriveModifiableCost(value.initial_modification_level).thenW(cost => cost === undefined
|
|
151
154
|
? Reader.of(MISSING_VALUE)
|
|
@@ -3,7 +3,7 @@ import { mapNullable } from "@optolith/helpers/nullable";
|
|
|
3
3
|
import { assertExhaustive } from "@optolith/helpers/typeSafety";
|
|
4
4
|
import { responsiveTextR, responsiveTranslateR, translateMapR, translateR, } from "../../reader.js";
|
|
5
5
|
import { replaceTextIfNeeded } from "../../responsiveText.js";
|
|
6
|
-
import { formatCombinedTimeSpanR, formatTimeSpanR
|
|
6
|
+
import { formatCombinedTimeSpanR, formatTimeSpanR } from "../../units/timeSpan.js";
|
|
7
7
|
import { MISSING_VALUE } from "../../unknown.js";
|
|
8
8
|
import { renderCheckResultBasedValue } from "./checkResultBased.js";
|
|
9
9
|
import { wrapAsMaximum, wrapIfMaximum } from "./isMinimumMaximum.js";
|
|
@@ -15,8 +15,8 @@ const renderImmediateDuration = (value) => translateR("Immediate")
|
|
|
15
15
|
.thenW(text => replaceTextIfNeeded(value?.translations, text));
|
|
16
16
|
const renderPermanentDuration = (value) => translateR("Permanent").thenW(text => replaceTextIfNeeded(value.translations, text));
|
|
17
17
|
const renderFixedDuration = (value) => formatCombinedTimeSpanR(value)
|
|
18
|
-
.then(text => wrapIfMaximum(value.is_maximum, text))
|
|
19
|
-
.thenW(text => replaceTextIfNeeded(value.translations, text));
|
|
18
|
+
.then(text => wrapIfMaximum(value.is_maximum, text).map(wrapped => [wrapped, text]))
|
|
19
|
+
.thenW(([wrapped, text]) => replaceTextIfNeeded(value.translations, wrapped, text));
|
|
20
20
|
/**
|
|
21
21
|
* Renders a duration that is based on the result of the skill check.
|
|
22
22
|
*/
|
|
@@ -30,7 +30,7 @@ const renderIndefiniteDuration = (value) => {
|
|
|
30
30
|
? responsiveTextR(translation.description)
|
|
31
31
|
: Reader.of(translation?.description ?? MISSING_VALUE))
|
|
32
32
|
.thenW(maximum === undefined
|
|
33
|
-
? Reader.of
|
|
33
|
+
? text => Reader.of(text)
|
|
34
34
|
: text =>
|
|
35
35
|
// eslint-disable-next-line @typescript-eslint/no-use-before-define
|
|
36
36
|
renderOneTimeDuration(maximum).then(maximumText => translateR("{$defaultDuration}, but no more than {$maximumDuration}", {
|
|
@@ -37,7 +37,7 @@ export const renderEffect = (effect) => {
|
|
|
37
37
|
case "ForEachQualityLevel":
|
|
38
38
|
return getContentPartsForQualityLevels(index => index + 1, effect.ForEachQualityLevel);
|
|
39
39
|
case "ForEachTwoQualityLevels":
|
|
40
|
-
return getContentPartsForQualityLevels(index => `${index * 2 + 1}–${index * 2 + 2}`, effect.ForEachTwoQualityLevels);
|
|
40
|
+
return getContentPartsForQualityLevels(index => `${(index * 2 + 1).toFixed()}–${(index * 2 + 2).toFixed()}`, effect.ForEachTwoQualityLevels);
|
|
41
41
|
default:
|
|
42
42
|
return assertExhaustive(effect);
|
|
43
43
|
}
|
|
@@ -8,7 +8,7 @@ export const wrapAsMinimum = (text) => responsiveTranslateR("at least {$value}",
|
|
|
8
8
|
* Wraps the text in a translation that indicates it’s a minimum value if the
|
|
9
9
|
* `is_minimum` property says it’s a minimum value.
|
|
10
10
|
*/
|
|
11
|
-
export const wrapIfMinimum = (is_minimum, text) => is_minimum === true ? wrapAsMinimum(text) : Reader.of(
|
|
11
|
+
export const wrapIfMinimum = (is_minimum, text) => (is_minimum === true ? wrapAsMinimum(text) : Reader.of(text));
|
|
12
12
|
/**
|
|
13
13
|
* Wraps the text in a translation that indicates it’s a maximum value.
|
|
14
14
|
*/
|
|
@@ -19,4 +19,4 @@ export const wrapAsMaximum = (text) => responsiveTranslateR("no more than {$valu
|
|
|
19
19
|
* Wraps the text in a translation that indicates it’s a maximum value if the
|
|
20
20
|
* `is_maximum` property says it’s a maximum value.
|
|
21
21
|
*/
|
|
22
|
-
export const wrapIfMaximum = (is_maximum, text) => is_maximum === true ? wrapAsMaximum(text) : Reader.of(
|
|
22
|
+
export const wrapIfMaximum = (is_maximum, text) => (is_maximum === true ? wrapAsMaximum(text) : Reader.of(text));
|