2021-03-22 10:18:43 +01:00
|
|
|
import { ModifiableData, ModifiableDataBase, ResourceData, UsableResource } from "../common/common-data";
|
2021-02-05 03:42:42 +01:00
|
|
|
import { DS4 } from "../config";
|
2021-01-26 03:55:18 +01:00
|
|
|
import { DS4ItemData } from "../item/item-data";
|
2021-01-09 22:51:46 +01:00
|
|
|
|
2021-02-05 03:42:42 +01:00
|
|
|
export type DS4ActorData = DS4CharacterData | DS4CreatureData;
|
2021-01-26 03:55:18 +01:00
|
|
|
|
2021-02-05 03:42:42 +01:00
|
|
|
type ActorType = keyof typeof DS4.i18n.actorTypes;
|
2020-12-29 22:44:56 +01:00
|
|
|
|
2021-03-22 10:18:43 +01:00
|
|
|
export interface DS4ActorDataHelper<T, U extends ActorType> extends Actor.Data<T, DS4ItemData> {
|
2021-02-05 03:42:42 +01:00
|
|
|
type: U;
|
2020-12-28 15:51:00 +01:00
|
|
|
}
|
|
|
|
|
2021-02-05 03:42:42 +01:00
|
|
|
type DS4CharacterData = DS4ActorDataHelper<DS4CharacterDataData, "character">;
|
|
|
|
type DS4CreatureData = DS4ActorDataHelper<DS4CreatureDataData, "creature">;
|
|
|
|
|
2021-03-22 10:18:43 +01:00
|
|
|
// templates
|
|
|
|
|
2021-02-05 03:42:42 +01:00
|
|
|
interface DS4ActorDataDataBase {
|
|
|
|
attributes: DS4ActorDataDataAttributes;
|
|
|
|
traits: DS4ActorDataDataTraits;
|
|
|
|
combatValues: DS4ActorDataDataCombatValues;
|
|
|
|
}
|
|
|
|
|
|
|
|
interface DS4ActorDataDataAttributes {
|
2021-03-22 10:18:43 +01:00
|
|
|
body: ModifiableDataBase<number>;
|
|
|
|
mobility: ModifiableDataBase<number>;
|
|
|
|
mind: ModifiableDataBase<number>;
|
2020-12-28 15:51:00 +01:00
|
|
|
}
|
|
|
|
|
2021-02-05 03:42:42 +01:00
|
|
|
interface DS4ActorDataDataTraits {
|
2021-03-22 10:18:43 +01:00
|
|
|
strength: ModifiableDataBase<number>;
|
|
|
|
constitution: ModifiableDataBase<number>;
|
|
|
|
agility: ModifiableDataBase<number>;
|
|
|
|
dexterity: ModifiableDataBase<number>;
|
|
|
|
intellect: ModifiableDataBase<number>;
|
|
|
|
aura: ModifiableDataBase<number>;
|
2020-12-29 22:44:56 +01:00
|
|
|
}
|
|
|
|
|
2021-02-05 03:42:42 +01:00
|
|
|
interface DS4ActorDataDataCombatValues {
|
2021-01-07 12:47:38 +01:00
|
|
|
hitPoints: ResourceData<number>;
|
2021-03-22 10:18:43 +01:00
|
|
|
defense: ModifiableData<number>;
|
|
|
|
initiative: ModifiableData<number>;
|
|
|
|
movement: ModifiableData<number>;
|
|
|
|
meleeAttack: ModifiableData<number>;
|
|
|
|
rangedAttack: ModifiableData<number>;
|
|
|
|
spellcasting: ModifiableData<number>;
|
|
|
|
targetedSpellcasting: ModifiableData<number>;
|
2020-12-29 22:44:56 +01:00
|
|
|
}
|
|
|
|
|
2021-03-22 10:18:43 +01:00
|
|
|
// types
|
2021-03-04 00:41:57 +01:00
|
|
|
|
2021-02-05 03:42:42 +01:00
|
|
|
interface DS4CharacterDataData extends DS4ActorDataDataBase {
|
|
|
|
baseInfo: DS4CharacterDataDataBaseInfo;
|
|
|
|
progression: DS4CharacterDataDataProgression;
|
|
|
|
language: DS4CharacterDataDataLanguage;
|
|
|
|
profile: DS4CharacterDataDataProfile;
|
|
|
|
currency: DS4CharacterDataDataCurrency;
|
2021-05-13 15:41:00 +02:00
|
|
|
slayerPoints: DS4CharacterDataDataSlayerPoints;
|
2021-01-09 22:51:46 +01:00
|
|
|
}
|
2021-03-22 10:18:43 +01:00
|
|
|
export interface DS4CharacterDataDataBaseInfo {
|
2020-12-29 22:44:56 +01:00
|
|
|
race: string;
|
|
|
|
class: string;
|
|
|
|
heroClass: string;
|
2021-01-03 20:37:30 +01:00
|
|
|
culture: string;
|
2020-12-29 22:44:56 +01:00
|
|
|
}
|
2021-03-22 10:18:43 +01:00
|
|
|
export interface DS4CharacterDataDataProgression {
|
2020-12-29 22:44:56 +01:00
|
|
|
level: number;
|
|
|
|
experiencePoints: number;
|
2020-12-30 21:34:12 +01:00
|
|
|
talentPoints: UsableResource<number>;
|
2020-12-29 22:44:56 +01:00
|
|
|
progressPoints: UsableResource<number>;
|
2020-12-28 15:51:00 +01:00
|
|
|
}
|
2021-01-03 20:37:30 +01:00
|
|
|
|
2021-03-22 10:18:43 +01:00
|
|
|
export interface DS4CharacterDataDataLanguage {
|
2021-01-03 20:37:30 +01:00
|
|
|
languages: string;
|
|
|
|
alphabets: string;
|
|
|
|
}
|
|
|
|
|
2021-03-22 10:18:43 +01:00
|
|
|
export interface DS4CharacterDataDataProfile {
|
2021-01-10 02:05:30 +01:00
|
|
|
biography: string;
|
2021-01-03 20:37:30 +01:00
|
|
|
gender: string;
|
|
|
|
birthday: string;
|
|
|
|
birthplace: string;
|
|
|
|
age: number;
|
|
|
|
height: number;
|
|
|
|
hairColor: string;
|
|
|
|
weight: number;
|
|
|
|
eyeColor: string;
|
|
|
|
specialCharacteristics: string;
|
|
|
|
}
|
2021-01-10 19:32:10 +01:00
|
|
|
|
2021-03-22 10:18:43 +01:00
|
|
|
export interface DS4CharacterDataDataCurrency {
|
2021-01-10 19:32:10 +01:00
|
|
|
gold: number;
|
|
|
|
silver: number;
|
|
|
|
copper: number;
|
|
|
|
}
|
2021-01-18 19:48:07 +01:00
|
|
|
|
2021-05-13 15:41:00 +02:00
|
|
|
export interface DS4CharacterDataDataSlayerPoints {
|
|
|
|
value: number;
|
|
|
|
}
|
|
|
|
|
2021-02-05 03:42:42 +01:00
|
|
|
interface DS4CreatureDataData extends DS4ActorDataDataBase {
|
|
|
|
baseInfo: DS4CreatureDataDataBaseInfo;
|
2021-01-09 22:51:46 +01:00
|
|
|
}
|
|
|
|
|
2021-03-22 10:18:43 +01:00
|
|
|
export interface DS4CreatureDataDataBaseInfo {
|
2021-01-09 22:51:46 +01:00
|
|
|
loot: string;
|
|
|
|
foeFactor: number;
|
|
|
|
creatureType: CreatureType;
|
|
|
|
sizeCategory: SizeCategory;
|
|
|
|
experiencePoints: number;
|
2021-01-10 02:05:30 +01:00
|
|
|
description: string;
|
2021-01-09 22:51:46 +01:00
|
|
|
}
|
2021-03-22 10:18:43 +01:00
|
|
|
|
2021-05-13 19:59:44 +02:00
|
|
|
type CreatureType = keyof typeof DS4.i18n.creatureTypes;
|
2021-03-22 10:18:43 +01:00
|
|
|
|
2021-05-13 19:59:44 +02:00
|
|
|
type SizeCategory = keyof typeof DS4.i18n.creatureSizeCategories;
|