Add creature actor to config, i18n, template.json, types

This commit is contained in:
Johannes Loher 2021-01-09 22:51:46 +01:00
parent 5d58803256
commit 6820ce7c00
9 changed files with 271 additions and 180 deletions

View file

@ -1,18 +1,4 @@
export interface DS4ActorDataType {
attributes: DS4ActorDataAttributes;
traits: DS4ActorDataTraits;
combatValues: DS4ActorDataCombatValues;
baseInfo: DS4ActorDataBaseInfo;
progression: DS4ActorDataProgression;
language: DS4ActorDataLanguage;
profile: DS4ActorDataProfile;
}
interface DS4ActorDataAttributes {
body: BodyAttribute;
mobility: ModifiableData<number>;
mind: ModifiableData<number>;
}
export type DS4ActorDataType = DS4ActorDataCharacter | DS4ActorDataCreature;
export interface ModifiableData<T> {
base: T;
@ -20,18 +6,27 @@ export interface ModifiableData<T> {
total?: T;
}
interface UsableResource<T> {
total: T;
used: T;
}
interface ResourceData<T> extends ModifiableData<T> {
value: T;
max?: T;
}
// Blueprint in case we need more detailed differentiation
type BodyAttribute = ModifiableData<number>;
interface UsableResource<T> {
total: T;
used: T;
}
interface DS4ActorDataBase {
attributes: DS4ActorDataAttributes;
traits: DS4ActorDataTraits;
combatValues: DS4ActorDataCombatValues;
}
interface DS4ActorDataAttributes {
body: ModifiableData<number>;
mobility: ModifiableData<number>;
mind: ModifiableData<number>;
}
interface DS4ActorDataTraits {
strength: ModifiableData<number>;
@ -53,26 +48,33 @@ interface DS4ActorDataCombatValues {
targetedSpellcasting: ModifiableData<number>;
}
interface DS4ActorDataBaseInfo {
interface DS4ActorDataCharacter extends DS4ActorDataBase {
baseInfo: DS4ActorDataCharacterBaseInfo;
progression: DS4ActorDataCharacterProgression;
language: DS4ActorDataCharacterLanguage;
profile: DS4ActorDataCharacterProfile;
}
interface DS4ActorDataCharacterBaseInfo {
race: string;
class: string;
heroClass: string;
culture: string;
}
interface DS4ActorDataProgression {
interface DS4ActorDataCharacterProgression {
level: number;
experiencePoints: number;
talentPoints: UsableResource<number>;
progressPoints: UsableResource<number>;
}
interface DS4ActorDataLanguage {
interface DS4ActorDataCharacterLanguage {
languages: string;
alphabets: string;
}
interface DS4ActorDataProfile {
interface DS4ActorDataCharacterProfile {
gender: string;
birthday: string;
birthplace: string;
@ -83,3 +85,19 @@ interface DS4ActorDataProfile {
eyeColor: string;
specialCharacteristics: string;
}
interface DS4ActorDataCreature extends DS4ActorDataBase {
baseInfo: DS4ActorDataCreatureBaseInfo;
}
type CreatureType = "animal" | "construct" | "humanoid" | "magicalEntity" | "plantBeing" | "undead";
type SizeCategory = "tiny" | "small" | "normal" | "large" | "huge" | "colossal";
interface DS4ActorDataCreatureBaseInfo {
loot: string;
foeFactor: number;
creatureType: CreatureType;
sizeCategory: SizeCategory;
experiencePoints: number;
}

View file

@ -97,7 +97,7 @@ export const DS4 = {
},
/**
* Define the set of attributes a character has
* Define the set of attributes an actor has
*/
attributes: {
body: "DS4.AttributeBody",
@ -106,7 +106,7 @@ export const DS4 = {
},
/**
* Define the set of traits a character has
* Define the set of traits an actor has
*/
traits: {
strength: "DS4.TraitStrength",
@ -118,7 +118,7 @@ export const DS4 = {
},
/**
* Define the set of combat values a character has
* Define the set of combat values an actor has
*/
combatValues: {
hitPoints: "DS4.CombatValuesHitPoints",
@ -134,50 +134,50 @@ export const DS4 = {
/**
* Define the base info of a character
*/
baseInfo: {
race: "DS4.BaseInfoRace",
class: "DS4.BaseInfoClass",
heroClass: "DS4.BaseInfoHeroClass",
culture: "DS4.BaseInfoCulture",
characterBaseInfo: {
race: "DS4.CharacterBaseInfoRace",
class: "DS4.CharacterBaseInfoClass",
heroClass: "DS4.CharacterBaseInfoHeroClass",
culture: "DS4.CharacterBaseInfoCulture",
},
/**
* Define the progression info of a character
*/
progression: {
level: "DS4.ProgressionLevel",
experiencePoints: "DS4.ProgressionExperiencePoints",
talentPoints: "DS4.ProgressionTalentPoints",
progressPoints: "DS4.ProgressionProgressPoints",
characterProgression: {
level: "DS4.CharacterProgressionLevel",
experiencePoints: "DS4.CharacterProgressionExperiencePoints",
talentPoints: "DS4.CharacterProgressionTalentPoints",
progressPoints: "DS4.CharacterProgressionProgressPoints",
},
/**
* Define the language info of a character
*/
language: {
languages: "DS4.LanguageLanguages",
alphabets: "DS4.LanguageAlphabets",
characterLanguage: {
languages: "DS4.CharacterLanguageLanguages",
alphabets: "DS4.CharacterLanguageAlphabets",
},
/**
* Define the profile info of a character
*/
profile: {
gender: "DS4.ProfileGender",
birthday: "DS4.ProfileBirthday",
birthplace: "DS4.ProfileBirthplace",
age: "DS4.ProfileAge",
height: "DS4.ProfileHeight",
characterProfile: {
gender: "DS4.CharacterProfileGender",
birthday: "DS4.CharacterProfileBirthday",
birthplace: "DS4.CharacterProfileBirthplace",
age: "DS4.CharacterProfileAge",
height: "DS4.CharacterProfileHeight",
hairColor: "DS4.ProfilHairColor",
weight: "DS4.ProfileWeight",
eyeColor: "DS4.ProfileEyeColor",
specialCharacteristics: "DS4.ProfileSpecialCharacteristics",
weight: "DS4.CharacterProfileWeight",
eyeColor: "DS4.CharacterProfileEyeColor",
specialCharacteristics: "DS4.CharacterProfileSpecialCharacteristics",
},
/**
* Define the profile info types for hanndlebars of a character
*/
profileDTypes: {
characterProfileDTypes: {
gender: "String",
birthday: "String",
birthplace: "String",
@ -188,4 +188,30 @@ export const DS4 = {
eyeColor: "String",
specialCharacteristics: "String",
},
creatureTypes: {
animal: "DS4.CreatureTypeAnimal",
construct: "DS4.CreatureTypeConstruct",
humanoid: "DS4.CreatureTypeHumanoid",
magicalEntity: "DS4.CreatureTypeMagicalEntity",
plantBeing: "DS4.CreatureTypePlantBeing",
undead: "DS4.CreatureTypeUndead",
},
creatureSizeCategories: {
tiny: "DS4.CreatureSizeCategoryTiny",
small: "DS4.CreatureSizeCategorySmall",
normal: "DS4.CreatureSizeCategoryNormal",
large: "DS4.CreatureSizeCategoryLarge",
huge: "DS4.CreatureSizeCategoryHuge",
colossal: "DS4.CreatureSizeCategoryColossal",
},
creatureBaseInfo: {
loot: "DS4.CreatureBaseInfoLoot",
foeFactor: "DS4.CreatureBaseInfoFoeFactor",
creatureType: "DS4.CreatureBaseInfoCreatureType",
sizeCategory: "DS4.CreatureBaseInfoSizeCategory",
experiencePoints: "DS4.CreatureBaseInfoExperiencePoints",
},
};

View file

@ -79,10 +79,10 @@ Hooks.once("setup", function () {
"attributes",
"traits",
"combatValues",
"baseInfo",
"progression",
"language",
"profile",
"characterBaseInfo",
"characterProgression",
"characterLanguage",
"characterProfile",
];
// Exclude some from sorting where the default order matters