optolith-database-schema 0.4.1 → 0.5.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 +25 -0
- package/lib/config.d.ts +2 -0
- package/lib/config.js +2 -0
- package/lib/main.d.ts +6 -3
- package/lib/main.js +55 -28
- package/lib/types/Cantrip.d.ts +2 -3
- package/lib/types/Culture.d.ts +8 -11
- package/lib/types/Lessons_Curriculum.d.ts +5 -4
- package/lib/types/Lessons_Guideline.d.ts +1 -1
- package/lib/types/Patron.d.ts +28 -4
- package/lib/types/Profession.d.ts +7 -6
- package/lib/types/Race.d.ts +12 -14
- package/lib/types/TargetCategory.d.ts +2 -3
- package/lib/types/_Activatable.d.ts +21 -22
- package/lib/types/_ActivatableSelectOptionCategory.d.ts +1 -1
- package/lib/types/_ActivatableSkillCost.d.ts +28 -1
- package/lib/types/_ActivatableSkillDuration.d.ts +1 -1
- package/lib/types/_ActivatableSkillRange.d.ts +3 -0
- package/lib/types/_CommonnessRatedAdvantageDisadvantage.d.ts +2 -4
- package/lib/types/_DiseasePoison.d.ts +3 -3
- package/lib/types/_Identifier.d.ts +1175 -247
- package/lib/types/_Identifier.js +0 -228
- package/lib/types/_IdentifierGroup.d.ts +27 -0
- package/lib/types/_IdentifierGroup.js +1 -0
- package/lib/types/_Prerequisite.d.ts +38 -36
- package/lib/types/_ResponsiveText.d.ts +1 -1
- package/lib/types/_SimpleReferences.d.ts +50 -253
- package/lib/types/equipment/EquipmentPackage.d.ts +1 -1
- package/lib/types/equipment/item/Elixir.d.ts +75 -0
- package/lib/types/equipment/item/Elixir.js +5 -0
- package/lib/types/equipment/item/EquipmentOfBlessedOnes.d.ts +1 -1
- package/lib/types/equipment/item/Poison.d.ts +220 -47
- package/lib/types/equipment/item/Poison.js +10 -0
- package/lib/types/equipment/item/ToolOfTheTrade.d.ts +6 -2
- package/lib/types/equipment/item/_Herbary.d.ts +31 -0
- package/lib/types/equipment/item/_Herbary.js +22 -0
- package/lib/types/equipment/item/_MeleeWeapon.d.ts +2 -9
- package/lib/types/equipment/item/_RangedWeapon.d.ts +2 -3
- package/lib/types/magicalActions/AnimistPower.d.ts +0 -1
- package/lib/types/magicalActions/MagicalRune.d.ts +22 -3
- package/lib/types/magicalActions/_SkillReference.d.ts +3 -2
- package/lib/types/magicalActions/_SkillReference.js +5 -5
- package/lib/types/prerequisites/PrerequisiteGroups.d.ts +2 -20
- package/lib/types/prerequisites/single/ActivatablePrerequisite.d.ts +1 -62
- package/lib/types/prerequisites/single/AnimistPowerPrerequisite.d.ts +2 -3
- package/lib/types/prerequisites/single/CulturePrerequisite.d.ts +5 -2
- package/lib/types/prerequisites/single/EnhancementPrerequisite.d.ts +1 -1
- package/lib/types/prerequisites/single/InfluencePrerequisite.d.ts +2 -3
- package/lib/types/prerequisites/single/RacePrerequisite.d.ts +5 -2
- package/lib/types/prerequisites/single/RatedPrerequisite.d.ts +1 -18
- package/lib/types/prerequisites/single/RulePrerequisite.d.ts +1 -1
- package/lib/types/prerequisites/single/SocialStatusPrerequisite.d.ts +2 -4
- package/lib/types/prerequisites/single/StatePrerequisite.d.ts +2 -2
- package/lib/types/rule/CoreRule.d.ts +4 -7
- package/lib/types/source/_PublicationRef.d.ts +2 -3
- package/lib/types/specialAbility/BlessedTradition.d.ts +1 -1
- package/lib/types/specialAbility/CombatStyleSpecialAbility.d.ts +2 -1
- package/lib/types/specialAbility/LiturgicalStyleSpecialAbility.d.ts +2 -1
- package/lib/types/specialAbility/MagicStyleSpecialAbility.d.ts +2 -1
- package/lib/types/specialAbility/MagicalTradition.d.ts +2 -3
- package/lib/types/specialAbility/PactGift.d.ts +1 -1
- package/lib/types/specialAbility/SkillStyleSpecialAbility.d.ts +2 -1
- package/lib/types/specialAbility/sub/_LanguageScript.d.ts +2 -4
- package/lib/validation/schema.d.ts +5 -2
- package/lib/validation/schema.js +8 -6
- package/package.json +2 -2
- package/schema/Cantrip.schema.json +1 -2
- package/schema/Culture.schema.json +51 -10
- package/schema/Lessons_Curriculum.schema.json +8 -12
- package/schema/Lessons_Guideline.schema.json +1 -1
- package/schema/Patron.schema.json +24 -6
- package/schema/Profession.schema.json +57 -15
- package/schema/Race.schema.json +121 -13
- package/schema/TargetCategory.schema.json +1 -2
- package/schema/_Activatable.schema.json +5 -181
- package/schema/_ActivatableSelectOptionCategory.schema.json +4 -4
- package/schema/_ActivatableSkillCost.schema.json +61 -0
- package/schema/_ActivatableSkillDuration.schema.json +1 -3
- package/schema/_ActivatableSkillRange.schema.json +19 -0
- package/schema/_DiseasePoison.schema.json +0 -2
- package/schema/_Identifier.schema.json +2099 -347
- package/schema/_IdentifierGroup.schema.json +601 -0
- package/schema/_Prerequisite.schema.json +1284 -1049
- package/schema/_ResponsiveText.schema.json +2 -2
- package/schema/_SimpleReferences.schema.json +54 -130
- package/schema/equipment/EquipmentPackage.schema.json +1 -1
- package/schema/equipment/item/Elixir.schema.json +123 -0
- package/schema/equipment/item/EquipmentOfBlessedOnes.schema.json +4 -1
- package/schema/equipment/item/Poison.schema.json +431 -68
- package/schema/equipment/item/ToolOfTheTrade.schema.json +15 -4
- package/schema/equipment/item/_Herbary.schema.json +42 -0
- package/schema/equipment/item/_MeleeWeapon.schema.json +1 -13
- package/schema/equipment/item/_RangedWeapon.schema.json +1 -2
- package/schema/magicalActions/AnimistPower.schema.json +0 -1
- package/schema/magicalActions/MagicalRune.schema.json +38 -3
- package/schema/magicalActions/_SkillReference.schema.json +15 -3
- package/schema/prerequisites/PrerequisiteGroups.schema.json +0 -96
- package/schema/prerequisites/single/ActivatablePrerequisite.schema.json +2 -87
- package/schema/prerequisites/single/AnimistPowerPrerequisite.schema.json +1 -2
- package/schema/prerequisites/single/CulturePrerequisite.schema.json +2 -1
- package/schema/prerequisites/single/EnhancementPrerequisite.schema.json +1 -1
- package/schema/prerequisites/single/InfluencePrerequisite.schema.json +1 -2
- package/schema/prerequisites/single/RacePrerequisite.schema.json +2 -1
- package/schema/prerequisites/single/RatedPrerequisite.schema.json +1 -28
- package/schema/prerequisites/single/RulePrerequisite.schema.json +1 -1
- package/schema/prerequisites/single/SocialStatusPrerequisite.schema.json +1 -3
- package/schema/prerequisites/single/StatePrerequisite.schema.json +1 -1
- package/schema/rule/CoreRule.schema.json +3 -5
- package/schema/source/_PublicationRef.schema.json +1 -2
- package/schema/specialAbility/BlessedTradition.schema.json +2 -2
- package/schema/specialAbility/CombatStyleSpecialAbility.schema.json +511 -1
- package/schema/specialAbility/LiturgicalStyleSpecialAbility.schema.json +511 -1
- package/schema/specialAbility/MagicStyleSpecialAbility.schema.json +511 -1
- package/schema/specialAbility/MagicalTradition.schema.json +1 -2
- package/schema/specialAbility/PactGift.schema.json +1 -1
- package/schema/specialAbility/SkillStyleSpecialAbility.schema.json +511 -1
- package/schema/specialAbility/sub/_LanguageScript.schema.json +1 -3
- package/schema/_CommonnessRatedAdvantageDisadvantage.schema.json +0 -22
package/CHANGELOG.md
CHANGED
|
@@ -2,6 +2,31 @@
|
|
|
2
2
|
|
|
3
3
|
All notable changes to this project will be documented in this file. See [standard-version](https://github.com/conventional-changelog/standard-version) for commit guidelines.
|
|
4
4
|
|
|
5
|
+
### [0.5.1](https://github.com/elyukai/optolith-database-schema/compare/v0.5.0...v0.5.1) (2022-12-02)
|
|
6
|
+
|
|
7
|
+
|
|
8
|
+
### Features
|
|
9
|
+
|
|
10
|
+
* explicit verbose error-printing option ([ebf055c](https://github.com/elyukai/optolith-database-schema/commit/ebf055c92302c5cfd80493dff1fd38276d05aa30))
|
|
11
|
+
|
|
12
|
+
## [0.5.0](https://github.com/elyukai/optolith-database-schema/compare/v0.4.1...v0.5.0) (2022-12-01)
|
|
13
|
+
|
|
14
|
+
|
|
15
|
+
### ⚠ BREAKING CHANGES
|
|
16
|
+
|
|
17
|
+
* explicit identifier tags, simpler prerequisites, multiple small changes
|
|
18
|
+
|
|
19
|
+
### Features
|
|
20
|
+
|
|
21
|
+
* equipment of blessed ones may be for multiple traditions ([3ffbfa2](https://github.com/elyukai/optolith-database-schema/commit/3ffbfa20cd40279091c71e7ef22496f6eab0f501))
|
|
22
|
+
* explicit identifier tags, simpler prerequisites, multiple small changes ([89ab7dd](https://github.com/elyukai/optolith-database-schema/commit/89ab7dd343db1027672b24c63216aba44f2db855))
|
|
23
|
+
* poisons and elixirs ([2552156](https://github.com/elyukai/optolith-database-schema/commit/2552156860ec527b568621dffa9ad6ebef1ae3e3))
|
|
24
|
+
|
|
25
|
+
|
|
26
|
+
### Bug Fixes
|
|
27
|
+
|
|
28
|
+
* import specifiers ([fddea8b](https://github.com/elyukai/optolith-database-schema/commit/fddea8bc62a6ab4ddfef0fcea082a73749152ad4))
|
|
29
|
+
|
|
5
30
|
### [0.4.1](https://github.com/elyukai/optolith-database-schema/compare/v0.4.0...v0.4.1) (2022-08-01)
|
|
6
31
|
|
|
7
32
|
|
package/lib/config.d.ts
CHANGED
|
@@ -28,6 +28,7 @@ import * as Book from "./types/equipment/item/Book.js";
|
|
|
28
28
|
import * as CeremonialItem from "./types/equipment/item/CeremonialItem.js";
|
|
29
29
|
import * as Clothes from "./types/equipment/item/Clothes.js";
|
|
30
30
|
import * as Container from "./types/equipment/item/Container.js";
|
|
31
|
+
import * as Elixir from "./types/equipment/item/Elixir.js";
|
|
31
32
|
import * as EquipmentOfBlessedOnes from "./types/equipment/item/EquipmentOfBlessedOnes.js";
|
|
32
33
|
import * as GemOrPreciousStone from "./types/equipment/item/GemOrPreciousStone.js";
|
|
33
34
|
import * as IlluminationLightSource from "./types/equipment/item/IlluminationLightSource.js";
|
|
@@ -206,6 +207,7 @@ export declare type TypeMap = {
|
|
|
206
207
|
diseases: Disease.Disease;
|
|
207
208
|
dominationRituals: DominationRitual.DominationRitual;
|
|
208
209
|
elements: Element.Element;
|
|
210
|
+
elixirs: Elixir.Elixir;
|
|
209
211
|
elvenMagicalSongs: ElvenMagicalSong.ElvenMagicalSong;
|
|
210
212
|
equipmentOfBlessedOnes: EquipmentOfBlessedOnes.EquipmentOfBlessedOnes;
|
|
211
213
|
equipmentPackages: EquipmentPackage.EquipmentPackage;
|
package/lib/config.js
CHANGED
|
@@ -28,6 +28,7 @@ import * as Book from "./types/equipment/item/Book.js";
|
|
|
28
28
|
import * as CeremonialItem from "./types/equipment/item/CeremonialItem.js";
|
|
29
29
|
import * as Clothes from "./types/equipment/item/Clothes.js";
|
|
30
30
|
import * as Container from "./types/equipment/item/Container.js";
|
|
31
|
+
import * as Elixir from "./types/equipment/item/Elixir.js";
|
|
31
32
|
import * as EquipmentOfBlessedOnes from "./types/equipment/item/EquipmentOfBlessedOnes.js";
|
|
32
33
|
import * as GemOrPreciousStone from "./types/equipment/item/GemOrPreciousStone.js";
|
|
33
34
|
import * as IlluminationLightSource from "./types/equipment/item/IlluminationLightSource.js";
|
|
@@ -205,6 +206,7 @@ export const typeValidatorMap = {
|
|
|
205
206
|
diseases: Disease.validateSchema,
|
|
206
207
|
dominationRituals: DominationRitual.validateSchema,
|
|
207
208
|
elements: Element.validateSchema,
|
|
209
|
+
elixirs: Elixir.validateSchema,
|
|
208
210
|
elvenMagicalSongs: ElvenMagicalSong.validateSchema,
|
|
209
211
|
equipmentOfBlessedOnes: EquipmentOfBlessedOnes.validateSchema,
|
|
210
212
|
equipmentPackages: EquipmentPackage.validateSchema,
|
package/lib/main.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { DefinedError } from "ajv
|
|
1
|
+
import { DefinedError } from "ajv";
|
|
2
2
|
import { TypeMap } from "./config.js";
|
|
3
|
-
import {
|
|
3
|
+
import { TypeValidationResultErrors } from "./validation/schema.js";
|
|
4
4
|
declare type Result = {
|
|
5
5
|
tag: "Ok";
|
|
6
6
|
value: {
|
|
@@ -14,5 +14,8 @@ export declare type EntityDirectoryPaths = {
|
|
|
14
14
|
[K in keyof TypeMap]: string;
|
|
15
15
|
};
|
|
16
16
|
export declare const validate: (entityDirPaths: EntityDirectoryPaths, checkIntegrity: boolean) => Promise<Result>;
|
|
17
|
-
export declare const printErrors: (errorsByFile: Record<string,
|
|
17
|
+
export declare const printErrors: (errorsByFile: Record<string, TypeValidationResultErrors>, printOptions?: PrintOptions) => string;
|
|
18
|
+
export declare type PrintOptions = {
|
|
19
|
+
verbose?: boolean;
|
|
20
|
+
};
|
|
18
21
|
export {};
|
package/lib/main.js
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import addFormats from "ajv-formats";
|
|
2
|
-
import
|
|
2
|
+
import Ajv2019 from "ajv/dist/2019.js";
|
|
3
|
+
import Ajv2020 from "ajv/dist/2020.js";
|
|
3
4
|
import { lstat, readdir, readFile } from "fs/promises";
|
|
4
5
|
import { join } from "path";
|
|
5
6
|
import YAML from "yaml";
|
|
@@ -21,28 +22,37 @@ const readdirRecursive = async (dirPath) => {
|
|
|
21
22
|
}));
|
|
22
23
|
return flattenedRecursivePaths.flat();
|
|
23
24
|
};
|
|
24
|
-
const registerAllJsonSchemaDocuments = async (
|
|
25
|
+
const registerAllJsonSchemaDocuments = async (validatorOptions) => {
|
|
25
26
|
const readFileAsUtf8 = (path) => readFile(path, "utf-8");
|
|
26
27
|
const readFilesAsUtf8 = (paths) => Promise.all(paths.map(readFileAsUtf8));
|
|
27
28
|
const parseJson = (json) => JSON.parse(json);
|
|
29
|
+
const schemes = (await readFilesAsUtf8(await readdirRecursive(jsonSchemaDir))).map(parseJson);
|
|
30
|
+
const META_SCHEMA_ID_2020_12 = "https://json-schema.org/draft/2020-12/schema";
|
|
31
|
+
const validator = schemes[0]?.$schema === META_SCHEMA_ID_2020_12
|
|
32
|
+
? new Ajv2020(validatorOptions)
|
|
33
|
+
: new Ajv2019(validatorOptions);
|
|
28
34
|
const registerSchemaInValidator = (jsonSchema) => { validator.addSchema(jsonSchema); };
|
|
29
|
-
(
|
|
30
|
-
|
|
31
|
-
.forEach(registerSchemaInValidator);
|
|
35
|
+
schemes.forEach(registerSchemaInValidator);
|
|
36
|
+
return validator;
|
|
32
37
|
};
|
|
33
|
-
const
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
38
|
+
const collator = Intl.Collator(undefined, { numeric: true });
|
|
39
|
+
const readDataFileAssocsFromDirectory = async (dirPath) => {
|
|
40
|
+
const filenames = await readdir(dirPath);
|
|
41
|
+
filenames.sort(collator.compare);
|
|
42
|
+
return await Promise.all(filenames.map(async (fileName) => {
|
|
43
|
+
const filePath = join(dirPath, fileName);
|
|
44
|
+
try {
|
|
45
|
+
const fileContent = YAML.parse(await readFile(join(dirPath, fileName), "utf-8"));
|
|
46
|
+
return [filePath, fileContent];
|
|
42
47
|
}
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
}
|
|
48
|
+
catch (error) {
|
|
49
|
+
if (error instanceof Error) {
|
|
50
|
+
error.message = `in "${filePath}":\n ${error.message}`;
|
|
51
|
+
}
|
|
52
|
+
return [filePath, null];
|
|
53
|
+
}
|
|
54
|
+
}));
|
|
55
|
+
};
|
|
46
56
|
const validateAllFromType = async (validator, typeName, path) => {
|
|
47
57
|
const isFile = (await lstat(path)).isFile();
|
|
48
58
|
const typeValidator = typeValidatorMap[typeName];
|
|
@@ -89,9 +99,8 @@ const rawResultMapToResult = (rawResultMap) => Object.entries(rawResultMap).redu
|
|
|
89
99
|
value: {}
|
|
90
100
|
}));
|
|
91
101
|
export const validate = async (entityDirPaths, checkIntegrity) => {
|
|
92
|
-
const validator =
|
|
102
|
+
const validator = await registerAllJsonSchemaDocuments({});
|
|
93
103
|
addFormats(validator);
|
|
94
|
-
await registerAllJsonSchemaDocuments(validator);
|
|
95
104
|
const rawResultMap = Object.fromEntries((await Promise.all(Object.entries(entityDirPaths)
|
|
96
105
|
.map(async ([typeName, path]) => [
|
|
97
106
|
typeName,
|
|
@@ -99,12 +108,30 @@ export const validate = async (entityDirPaths, checkIntegrity) => {
|
|
|
99
108
|
]))));
|
|
100
109
|
return rawResultMapToResult(rawResultMap);
|
|
101
110
|
};
|
|
102
|
-
export const printErrors = (errorsByFile) =>
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
+
export const printErrors = (errorsByFile, printOptions = {}) => {
|
|
112
|
+
const { verbose = false } = printOptions;
|
|
113
|
+
return Object.entries(errorsByFile)
|
|
114
|
+
.flatMap(([filePath, errors]) => {
|
|
115
|
+
if (verbose) {
|
|
116
|
+
return filterNullable([
|
|
117
|
+
errors.fileNameError ? errorMessageBlock([filePath], errors.fileNameError.message) : undefined,
|
|
118
|
+
...errors.schemaErrors.map(error => {
|
|
119
|
+
const pathSegments = [filePath, ...error.instancePath.split("/").slice(1)];
|
|
120
|
+
return errorMessageBlock(pathSegments, error.message ?? "");
|
|
121
|
+
})
|
|
122
|
+
]);
|
|
123
|
+
}
|
|
124
|
+
else {
|
|
125
|
+
return filterNullable([
|
|
126
|
+
errors.fileNameError ? errorMessageBlock([filePath], errors.fileNameError.message) : undefined,
|
|
127
|
+
errors.schemaErrors.length > 0 ? errorMessageBlock([filePath], "does not match schema") : undefined
|
|
128
|
+
]);
|
|
129
|
+
}
|
|
130
|
+
})
|
|
131
|
+
.join("\n\n");
|
|
132
|
+
};
|
|
133
|
+
const errorMessageBlock = (path, message) => [
|
|
134
|
+
...path.map((segment, i) => `${" ".repeat(i * 2)}in "${segment}":`),
|
|
135
|
+
`${" ".repeat(path.length * 2)}${message}`
|
|
136
|
+
].join("\n");
|
|
137
|
+
const filterNullable = (arr) => arr.filter((x) => x != null);
|
package/lib/types/Cantrip.d.ts
CHANGED
|
@@ -8,6 +8,7 @@ import { DurationUnit } from "./_ActivatableSkillDuration.js";
|
|
|
8
8
|
import { FixedRange } from "./_ActivatableSkillRange.js";
|
|
9
9
|
import { TargetCategory } from "./_ActivatableSkillTargetCategory.js";
|
|
10
10
|
import { Enhancements } from "./_Enhancements.js";
|
|
11
|
+
import { MagicalTraditionIdentifier } from "./_Identifier.js";
|
|
11
12
|
import { LocaleMap } from "./_LocaleMap.js";
|
|
12
13
|
import { ResponsiveText } from "./_ResponsiveText.js";
|
|
13
14
|
import { CurriculumReference, MagicalTraditionReference, PropertyReference } from "./_SimpleReferences.js";
|
|
@@ -80,10 +81,8 @@ export declare type CommonCantripNote = {
|
|
|
80
81
|
export declare type CommonCantripTraditionNote = {
|
|
81
82
|
/**
|
|
82
83
|
* The magical tradition's identifier.
|
|
83
|
-
* @integer
|
|
84
|
-
* @minimum 1
|
|
85
84
|
*/
|
|
86
|
-
id:
|
|
85
|
+
id: MagicalTraditionIdentifier;
|
|
87
86
|
/**
|
|
88
87
|
* All translations for the entry, identified by IETF language tag (BCP47).
|
|
89
88
|
*/
|
package/lib/types/Culture.d.ts
CHANGED
|
@@ -4,6 +4,7 @@
|
|
|
4
4
|
import { Errata } from "./source/_Erratum.js";
|
|
5
5
|
import { PublicationRefs } from "./source/_PublicationRef.js";
|
|
6
6
|
import { CommonnessRatedAdvantageDisadvantage } from "./_CommonnessRatedAdvantageDisadvantage.js";
|
|
7
|
+
import { AdvantageIdentifier, DisadvantageIdentifier, MagicalTraditionIdentifier, ProfessionIdentifier, SkillIdentifier } from "./_Identifier.js";
|
|
7
8
|
import { LocaleMap } from "./_LocaleMap.js";
|
|
8
9
|
import { NonEmptyString } from "./_NonEmptyString.js";
|
|
9
10
|
import { BinarySex } from "./_Sex.js";
|
|
@@ -49,22 +50,22 @@ export declare type Culture = {
|
|
|
49
50
|
* A list of common advantages.
|
|
50
51
|
* @minItems 1
|
|
51
52
|
*/
|
|
52
|
-
common_advantages?: CommonnessRatedAdvantageDisadvantage[];
|
|
53
|
+
common_advantages?: CommonnessRatedAdvantageDisadvantage<AdvantageIdentifier>[];
|
|
53
54
|
/**
|
|
54
55
|
* A list of common disadvantages.
|
|
55
56
|
* @minItems 1
|
|
56
57
|
*/
|
|
57
|
-
common_disadvantages?: CommonnessRatedAdvantageDisadvantage[];
|
|
58
|
+
common_disadvantages?: CommonnessRatedAdvantageDisadvantage<DisadvantageIdentifier>[];
|
|
58
59
|
/**
|
|
59
60
|
* A list of uncommon advantages.
|
|
60
61
|
* @minItems 1
|
|
61
62
|
*/
|
|
62
|
-
uncommon_advantages?: CommonnessRatedAdvantageDisadvantage[];
|
|
63
|
+
uncommon_advantages?: CommonnessRatedAdvantageDisadvantage<AdvantageIdentifier>[];
|
|
63
64
|
/**
|
|
64
65
|
* A list of uncommon disadvantages.
|
|
65
66
|
* @minItems 1
|
|
66
67
|
*/
|
|
67
|
-
uncommon_disadvantages?: CommonnessRatedAdvantageDisadvantage[];
|
|
68
|
+
uncommon_disadvantages?: CommonnessRatedAdvantageDisadvantage<DisadvantageIdentifier>[];
|
|
68
69
|
/**
|
|
69
70
|
* A list of common skills.
|
|
70
71
|
* @minItems 1
|
|
@@ -161,10 +162,8 @@ export declare enum Rarity {
|
|
|
161
162
|
export declare type ProfessionConstraint = {
|
|
162
163
|
/**
|
|
163
164
|
* The profession's identifier.
|
|
164
|
-
* @integer
|
|
165
|
-
* @minimum 1
|
|
166
165
|
*/
|
|
167
|
-
id:
|
|
166
|
+
id: ProfessionIdentifier;
|
|
168
167
|
/**
|
|
169
168
|
* Some profession variants are more common than others. There may be
|
|
170
169
|
* cultures where some variants are not represented at all.
|
|
@@ -187,10 +186,8 @@ export declare enum MundaneProfessionSubgroupConstraint {
|
|
|
187
186
|
export declare type TraditionConstraint = {
|
|
188
187
|
/**
|
|
189
188
|
* The magical tradition's identifier.
|
|
190
|
-
* @integer
|
|
191
|
-
* @minimum 1
|
|
192
189
|
*/
|
|
193
|
-
id:
|
|
190
|
+
id: MagicalTraditionIdentifier;
|
|
194
191
|
/**
|
|
195
192
|
* Some professions are more common than others. There may be cultures
|
|
196
193
|
* where some professions are not represented at all.
|
|
@@ -252,7 +249,7 @@ export declare type CulturalPackageItem = {
|
|
|
252
249
|
* @integer
|
|
253
250
|
* @minimum 1
|
|
254
251
|
*/
|
|
255
|
-
id:
|
|
252
|
+
id: SkillIdentifier;
|
|
256
253
|
/**
|
|
257
254
|
* The skill points for the respective skill you get for buying the cultural
|
|
258
255
|
* package.
|
|
@@ -3,7 +3,8 @@
|
|
|
3
3
|
*/
|
|
4
4
|
import { Errata } from "./source/_Erratum.js";
|
|
5
5
|
import { PublicationRefs } from "./source/_PublicationRef.js";
|
|
6
|
-
import {
|
|
6
|
+
import { ElementIdentifier, MagicalTraditionIdentifier, PropertyIdentifier, SkillIdentifier } from "./_Identifier.js";
|
|
7
|
+
import { CombatTechniqueIdentifier, SpellworkIdentifier } from "./_IdentifierGroup.js";
|
|
7
8
|
import { LocaleMap } from "./_LocaleMap.js";
|
|
8
9
|
import { NonEmptyString } from "./_NonEmptyString.js";
|
|
9
10
|
import { GuidelineReference } from "./_SimpleReferences.js";
|
|
@@ -89,7 +90,7 @@ export declare type ElectiveSpellworkRestriction = {
|
|
|
89
90
|
* @minimum 1
|
|
90
91
|
* @maximum 6
|
|
91
92
|
*/
|
|
92
|
-
id:
|
|
93
|
+
id: ElementIdentifier;
|
|
93
94
|
};
|
|
94
95
|
/**
|
|
95
96
|
* The academy's restricted spellworks package.
|
|
@@ -121,7 +122,7 @@ export declare type RestrictedProperty = {
|
|
|
121
122
|
* @integer
|
|
122
123
|
* @minimum 1
|
|
123
124
|
*/
|
|
124
|
-
id:
|
|
125
|
+
id: PropertyIdentifier;
|
|
125
126
|
/**
|
|
126
127
|
* Exclude specific spellworks from the restriction.
|
|
127
128
|
* @minItems 1
|
|
@@ -207,7 +208,7 @@ export declare type SkillAdjustment = {
|
|
|
207
208
|
* @integer
|
|
208
209
|
* @minimum 1
|
|
209
210
|
*/
|
|
210
|
-
id:
|
|
211
|
+
id: SkillIdentifier;
|
|
211
212
|
/**
|
|
212
213
|
* The skill points that will be added to the current skill rating.
|
|
213
214
|
* @integer
|
package/lib/types/Patron.d.ts
CHANGED
|
@@ -1,10 +1,11 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* @main Patron
|
|
3
3
|
*/
|
|
4
|
+
import { AdvantageIdentifier, AttributeIdentifier, SkillIdentifier } from "./_Identifier.js";
|
|
4
5
|
import { ImprovementCost } from "./_ImprovementCost.js";
|
|
5
6
|
import { LocaleMap } from "./_LocaleMap.js";
|
|
6
7
|
import { NonEmptyString } from "./_NonEmptyString.js";
|
|
7
|
-
import { CultureReference, PatronCategoryReference, SkillReference } from "./_SimpleReferences.js";
|
|
8
|
+
import { AdvantageReference, CultureReference, DisadvantageReference, PatronCategoryReference, SkillReference, SpellworkReference } from "./_SimpleReferences.js";
|
|
8
9
|
/**
|
|
9
10
|
* @title Patron
|
|
10
11
|
*/
|
|
@@ -54,6 +55,29 @@ export declare type Patron = {
|
|
|
54
55
|
* animal patrons.
|
|
55
56
|
*/
|
|
56
57
|
improvement_cost?: ImprovementCost;
|
|
58
|
+
/**
|
|
59
|
+
* The patron may grant common advantages that are taken into account during
|
|
60
|
+
* character creation.
|
|
61
|
+
*
|
|
62
|
+
* *Source:* Geisterwald & Knochenklippen, p. 6-7
|
|
63
|
+
* @minLength 1
|
|
64
|
+
*/
|
|
65
|
+
common_advantages?: AdvantageReference[];
|
|
66
|
+
/**
|
|
67
|
+
* The patron may grant common disadvantages that are taken into account
|
|
68
|
+
* during character creation.
|
|
69
|
+
*
|
|
70
|
+
* *Source:* Geisterwald & Knochenklippen, p. 6-7
|
|
71
|
+
* @minLength 1
|
|
72
|
+
*/
|
|
73
|
+
common_disadvantages?: DisadvantageReference[];
|
|
74
|
+
/**
|
|
75
|
+
* The animist may learn spellworks common for this patron.
|
|
76
|
+
*
|
|
77
|
+
* *Source:* Geisterwald & Knochenklippen, p. 6-7
|
|
78
|
+
* @minLength 1
|
|
79
|
+
*/
|
|
80
|
+
common_spellworks?: SpellworkReference[];
|
|
57
81
|
/**
|
|
58
82
|
* All translations for the entry, identified by IETF language tag (BCP47).
|
|
59
83
|
*/
|
|
@@ -90,7 +114,7 @@ export declare type AdvantageAnimalPower = {
|
|
|
90
114
|
* @integer
|
|
91
115
|
* @minimum 1
|
|
92
116
|
*/
|
|
93
|
-
id:
|
|
117
|
+
id: AdvantageIdentifier;
|
|
94
118
|
/**
|
|
95
119
|
* It grants a higher level of the advantage.
|
|
96
120
|
* @integer
|
|
@@ -110,7 +134,7 @@ export declare type SkillAnimalPower = {
|
|
|
110
134
|
* @integer
|
|
111
135
|
* @minimum 1
|
|
112
136
|
*/
|
|
113
|
-
id:
|
|
137
|
+
id: SkillIdentifier;
|
|
114
138
|
/**
|
|
115
139
|
* The points that gets added to the skill's rating.
|
|
116
140
|
* @integer
|
|
@@ -163,7 +187,7 @@ export declare type AttributeAnimalPower = {
|
|
|
163
187
|
* @integer
|
|
164
188
|
* @minimum 1
|
|
165
189
|
*/
|
|
166
|
-
id:
|
|
190
|
+
id: AttributeIdentifier;
|
|
167
191
|
/**
|
|
168
192
|
* The value that gets added to the attribute.
|
|
169
193
|
* @integer
|
|
@@ -4,7 +4,8 @@
|
|
|
4
4
|
import { Errata } from "./source/_Erratum.js";
|
|
5
5
|
import { PublicationRefs } from "./source/_PublicationRef.js";
|
|
6
6
|
import { CommonnessRatedAdvantageDisadvantage } from "./_CommonnessRatedAdvantageDisadvantage.js";
|
|
7
|
-
import {
|
|
7
|
+
import { AdvantageIdentifier, DisadvantageIdentifier, SkillIdentifier } from "./_Identifier.js";
|
|
8
|
+
import { CombatTechniqueIdentifier, LiturgyIdentifier, MagicalActionIdentifier, RequirableSelectOptionIdentifier, SpecialAbilityIdentifier, SpellworkIdentifier } from "./_IdentifierGroup.js";
|
|
8
9
|
import { LocaleMap } from "./_LocaleMap.js";
|
|
9
10
|
import { NonEmptyString } from "./_NonEmptyString.js";
|
|
10
11
|
import { ProfessionPrerequisites } from "./_Prerequisite.js";
|
|
@@ -158,24 +159,24 @@ export declare type ProfessionPackage = {
|
|
|
158
159
|
* Typical advantages for the profession.
|
|
159
160
|
* @minItems 1
|
|
160
161
|
*/
|
|
161
|
-
suggested_advantages?: CommonnessRatedAdvantageDisadvantage[];
|
|
162
|
+
suggested_advantages?: CommonnessRatedAdvantageDisadvantage<AdvantageIdentifier>[];
|
|
162
163
|
/**
|
|
163
164
|
* Typical disadvantages for the profession.
|
|
164
165
|
* @minItems 1
|
|
165
166
|
*/
|
|
166
|
-
suggested_disadvantages?: CommonnessRatedAdvantageDisadvantage[];
|
|
167
|
+
suggested_disadvantages?: CommonnessRatedAdvantageDisadvantage<DisadvantageIdentifier>[];
|
|
167
168
|
/**
|
|
168
169
|
* These advantages do not fit well with this profession; to be checked with
|
|
169
170
|
* the GM before taking any of them.
|
|
170
171
|
* @minItems 1
|
|
171
172
|
*/
|
|
172
|
-
unsuitable_advantages?: CommonnessRatedAdvantageDisadvantage[];
|
|
173
|
+
unsuitable_advantages?: CommonnessRatedAdvantageDisadvantage<AdvantageIdentifier>[];
|
|
173
174
|
/**
|
|
174
175
|
* These disadvantages do not fit well with this profession; to be checked
|
|
175
176
|
* with the GM before taking any of them.
|
|
176
177
|
* @minItems 1
|
|
177
178
|
*/
|
|
178
|
-
unsuitable_disadvantages?: CommonnessRatedAdvantageDisadvantage[];
|
|
179
|
+
unsuitable_disadvantages?: CommonnessRatedAdvantageDisadvantage<DisadvantageIdentifier>[];
|
|
179
180
|
/**
|
|
180
181
|
* Provides examples of variants for the profession, which may include changes
|
|
181
182
|
* to AP values and additional or modified skill ratings, special abilities,
|
|
@@ -375,7 +376,7 @@ export declare type SkillRating = {
|
|
|
375
376
|
* @minimum 1
|
|
376
377
|
* @maximum 59
|
|
377
378
|
*/
|
|
378
|
-
id:
|
|
379
|
+
id: SkillIdentifier;
|
|
379
380
|
/**
|
|
380
381
|
* The rating bonus provided for the skill. If used in a profession variant,
|
|
381
382
|
* it can also be used to lower the bonus of the base profession
|
package/lib/types/Race.d.ts
CHANGED
|
@@ -5,6 +5,7 @@ import { Errata } from "./source/_Erratum.js";
|
|
|
5
5
|
import { PublicationRefs } from "./source/_PublicationRef.js";
|
|
6
6
|
import { CommonnessRatedAdvantageDisadvantage } from "./_CommonnessRatedAdvantageDisadvantage.js";
|
|
7
7
|
import { Dice } from "./_Dice.js";
|
|
8
|
+
import { AdvantageIdentifier, DisadvantageIdentifier, ExperienceLevelIdentifier } from "./_Identifier.js";
|
|
8
9
|
import { LocaleMap } from "./_LocaleMap.js";
|
|
9
10
|
import { NonEmptyString } from "./_NonEmptyString.js";
|
|
10
11
|
import { AdvantageReference, AttributeReference, CultureReference, EyeColorReference, HairColorReference } from "./_SimpleReferences.js";
|
|
@@ -45,40 +46,40 @@ export declare type Race = {
|
|
|
45
46
|
* A list of strongly recommended advantages.
|
|
46
47
|
* @minItems 1
|
|
47
48
|
*/
|
|
48
|
-
strongly_recommended_advantages?: CommonnessRatedAdvantageDisadvantage[];
|
|
49
|
+
strongly_recommended_advantages?: CommonnessRatedAdvantageDisadvantage<AdvantageIdentifier>[];
|
|
49
50
|
/**
|
|
50
51
|
* A list of strongly recommended disadvantages.
|
|
51
52
|
* @minItems 1
|
|
52
53
|
*/
|
|
53
|
-
strongly_recommended_disadvantages?: CommonnessRatedAdvantageDisadvantage[];
|
|
54
|
+
strongly_recommended_disadvantages?: CommonnessRatedAdvantageDisadvantage<DisadvantageIdentifier>[];
|
|
54
55
|
/**
|
|
55
56
|
* A list of common advantages. If common advantages are defined by race
|
|
56
57
|
* variants, leave this field empty. It is overridden by the same field in
|
|
57
58
|
* race variants.
|
|
58
59
|
* @minItems 1
|
|
59
60
|
*/
|
|
60
|
-
common_advantages?: CommonnessRatedAdvantageDisadvantage[];
|
|
61
|
+
common_advantages?: CommonnessRatedAdvantageDisadvantage<AdvantageIdentifier>[];
|
|
61
62
|
/**
|
|
62
63
|
* A list of common disadvantages. If common disadvantages are defined by race
|
|
63
64
|
* variants, leave this field empty. It is overridden by the same field in
|
|
64
65
|
* race variants.
|
|
65
66
|
* @minItems 1
|
|
66
67
|
*/
|
|
67
|
-
common_disadvantages?: CommonnessRatedAdvantageDisadvantage[];
|
|
68
|
+
common_disadvantages?: CommonnessRatedAdvantageDisadvantage<DisadvantageIdentifier>[];
|
|
68
69
|
/**
|
|
69
70
|
* A list of uncommon advantages. If uncommon advantages are defined by race
|
|
70
71
|
* variants, leave this field empty. It is overridden by the same field in
|
|
71
72
|
* race variants.
|
|
72
73
|
* @minItems 1
|
|
73
74
|
*/
|
|
74
|
-
uncommon_advantages?: CommonnessRatedAdvantageDisadvantage[];
|
|
75
|
+
uncommon_advantages?: CommonnessRatedAdvantageDisadvantage<AdvantageIdentifier>[];
|
|
75
76
|
/**
|
|
76
77
|
* A list of uncommon disadvantages. If uncommon disadvantages are defined by
|
|
77
78
|
* race variants, leave this field empty. It is overridden by the same field
|
|
78
79
|
* in race variants.
|
|
79
80
|
* @minItems 1
|
|
80
81
|
*/
|
|
81
|
-
uncommon_disadvantages?: CommonnessRatedAdvantageDisadvantage[];
|
|
82
|
+
uncommon_disadvantages?: CommonnessRatedAdvantageDisadvantage<DisadvantageIdentifier>[];
|
|
82
83
|
/**
|
|
83
84
|
* Configuration for random weight generation.
|
|
84
85
|
*/
|
|
@@ -193,11 +194,8 @@ export declare enum WeightDiceOffsetStrategy {
|
|
|
193
194
|
export declare type StartingAgeConfigForExperienceLevel = {
|
|
194
195
|
/**
|
|
195
196
|
* The selected experience level's identifier.
|
|
196
|
-
* @integer
|
|
197
|
-
* @minimum 1
|
|
198
|
-
* @maximum 7
|
|
199
197
|
*/
|
|
200
|
-
experience_level_id:
|
|
198
|
+
experience_level_id: ExperienceLevelIdentifier;
|
|
201
199
|
/**
|
|
202
200
|
* The base value for the selected experience level.
|
|
203
201
|
* @integer
|
|
@@ -271,22 +269,22 @@ export declare type RaceVariant = {
|
|
|
271
269
|
* A list of common advantages. If common advantages are defined by the base race, leave this field empty. This field overrides the same field of the base race, if both are defined.
|
|
272
270
|
* @minItems 1
|
|
273
271
|
*/
|
|
274
|
-
common_advantages?: CommonnessRatedAdvantageDisadvantage[];
|
|
272
|
+
common_advantages?: CommonnessRatedAdvantageDisadvantage<AdvantageIdentifier>[];
|
|
275
273
|
/**
|
|
276
274
|
* A list of common disadvantages. If common disadvantages are defined by the base race, leave this field empty. This field overrides the same field of the base race, if both are defined.
|
|
277
275
|
* @minItems 1
|
|
278
276
|
*/
|
|
279
|
-
common_disadvantages?: CommonnessRatedAdvantageDisadvantage[];
|
|
277
|
+
common_disadvantages?: CommonnessRatedAdvantageDisadvantage<DisadvantageIdentifier>[];
|
|
280
278
|
/**
|
|
281
279
|
* A list of uncommon advantages. If uncommon advantages are defined by the base race, leave this field empty. This field overrides the same field of the base race, if both are defined.
|
|
282
280
|
* @minItems 1
|
|
283
281
|
*/
|
|
284
|
-
uncommon_advantages?: CommonnessRatedAdvantageDisadvantage[];
|
|
282
|
+
uncommon_advantages?: CommonnessRatedAdvantageDisadvantage<AdvantageIdentifier>[];
|
|
285
283
|
/**
|
|
286
284
|
* A list of uncommon disadvantages. If uncommon disadvantages are defined by the base race, leave this field empty. This field overrides the same field of the base race, if both are defined.
|
|
287
285
|
* @minItems 1
|
|
288
286
|
*/
|
|
289
|
-
uncommon_disadvantages?: CommonnessRatedAdvantageDisadvantage[];
|
|
287
|
+
uncommon_disadvantages?: CommonnessRatedAdvantageDisadvantage<DisadvantageIdentifier>[];
|
|
290
288
|
/**
|
|
291
289
|
* An array containing 20 (numeric) hair color identifiers. The array also represents the 20-sided die for a random hair color.
|
|
292
290
|
* @minItems 20
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* @main TargetCategory
|
|
3
3
|
*/
|
|
4
|
+
import { TargetCategoryIdentifier } from "./_Identifier.js";
|
|
4
5
|
import { LocaleMap } from "./_LocaleMap.js";
|
|
5
6
|
import { NonEmptyString } from "./_NonEmptyString.js";
|
|
6
7
|
/**
|
|
@@ -28,10 +29,8 @@ export declare type TargetCategory = {
|
|
|
28
29
|
export declare type TargetCategoryParent = {
|
|
29
30
|
/**
|
|
30
31
|
* The identifier of the superordinate target category.
|
|
31
|
-
* @integer
|
|
32
|
-
* @minimum 1
|
|
33
32
|
*/
|
|
34
|
-
id:
|
|
33
|
+
id: TargetCategoryIdentifier;
|
|
35
34
|
};
|
|
36
35
|
export declare type TargetCategoryTranslation = {
|
|
37
36
|
/**
|