2022-02-16 13:32:04 +01:00
|
|
|
// SPDX-FileCopyrightText: 2021 Johannes Loher
|
|
|
|
// SPDX-FileCopyrightText: 2021 Oliver Rümpelein
|
|
|
|
// SPDX-FileCopyrightText: 2021 Gesina Schwalbe
|
|
|
|
// SPDX-FileCopyrightText: 2021 Siegfried Krug
|
|
|
|
//
|
|
|
|
// SPDX-License-Identifier: MIT
|
|
|
|
|
2022-11-04 21:47:18 +01:00
|
|
|
import { DS4 } from "../../config";
|
2022-02-16 13:32:04 +01:00
|
|
|
|
2022-02-17 00:55:22 +01:00
|
|
|
import type { ModifiableDataBaseTotal, ResourceDataBaseTotalMax } from "../common/common-data";
|
|
|
|
|
2022-02-16 13:32:04 +01:00
|
|
|
export interface DS4ActorDataPropertiesDataBase {
|
|
|
|
attributes: DS4ActorDataPropertiesDataAttributes;
|
|
|
|
traits: DS4ActorDataPropertiesDataTraits;
|
|
|
|
combatValues: DS4ActorDataPropertiesDataCombatValues;
|
|
|
|
rolling: DS4ActorDataPropertiesDataRolling;
|
|
|
|
checks: DS4ActorDataPropertiesDataChecks;
|
|
|
|
}
|
|
|
|
|
|
|
|
type DS4ActorDataPropertiesDataAttributes = {
|
|
|
|
[Key in keyof typeof DS4.i18n.attributes]: ModifiableDataBaseTotal<number>;
|
|
|
|
};
|
|
|
|
|
|
|
|
type DS4ActorDataPropertiesDataTraits = { [Key in keyof typeof DS4.i18n.traits]: ModifiableDataBaseTotal<number> };
|
|
|
|
|
|
|
|
type DS4ActorDataPropertiesDataCombatValues = {
|
|
|
|
[Key in keyof typeof DS4.i18n.combatValues]: Key extends "hitPoints"
|
|
|
|
? ResourceDataBaseTotalMax<number>
|
|
|
|
: ModifiableDataBaseTotal<number>;
|
|
|
|
};
|
|
|
|
|
|
|
|
interface DS4ActorDataPropertiesDataRolling {
|
|
|
|
maximumCoupResult: number;
|
|
|
|
minimumFumbleResult: number;
|
|
|
|
}
|
|
|
|
|
|
|
|
type DS4ActorDataPropertiesDataChecks = {
|
|
|
|
[key in Check]: number;
|
|
|
|
};
|
|
|
|
|
|
|
|
export type Check = keyof typeof DS4.i18n.checks;
|
|
|
|
|
|
|
|
export function isCheck(value: string): value is Check {
|
|
|
|
return Object.keys(DS4.i18n.checks).includes(value);
|
|
|
|
}
|