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

@ -89,30 +89,47 @@
"DS4.CombatValuesRangedAttack": "Schießen",
"DS4.CombatValuesSpellcasting": "Zaubern",
"DS4.CombatValuesTargetedSpellcasting": "Zielzaubern",
"DS4.BaseInfoRace": "Volk",
"DS4.BaseInfoClass": "Klasse",
"DS4.BaseInfoHeroClass": "Helden Klasse",
"DS4.BaseInfoCulture": "Kultur",
"DS4.ProgressionLevel": "Stufe",
"DS4.ProgressionExperiencePoints": "Erfahrungspunkte",
"DS4.ProgressionTalentPoints": "Talentpunkte",
"DS4.ProgressionProgressPoints": "Lernpunkte",
"DS4.CharacterBaseInfoRace": "Volk",
"DS4.CharacterBaseInfoClass": "Klasse",
"DS4.CharacterBaseInfoHeroClass": "Helden Klasse",
"DS4.CharacterBaseInfoCulture": "Kultur",
"DS4.CharacterProgressionLevel": "Stufe",
"DS4.CharacterProgressionExperiencePoints": "Erfahrungspunkte",
"DS4.CharacterProgressionTalentPoints": "Talentpunkte",
"DS4.CharacterProgressionProgressPoints": "Lernpunkte",
"DS4.TalentRank": "Rang",
"DS4.TalentRankBase": "Erworbener Rang",
"DS4.TalentRankMax": "Maximaler Rang",
"DS4.TalentRankMod": "Zusätzlicher Rang",
"DS4.TalentRankTotal": "Gesamter Rang",
"DS4.LanguageLanguages": "Sprachen",
"DS4.LanguageAlphabets": "Schriftzeichen",
"DS4.ProfileGender": "Geschlecht",
"DS4.ProfileBirthday": "Geburtstag",
"DS4.ProfileBirthplace": "Geburtsort",
"DS4.ProfileAge": "Alter",
"DS4.ProfileHeight": "Größe",
"DS4.CharacterLanguageLanguages": "Sprachen",
"DS4.CharacterLanguageAlphabets": "Schriftzeichen",
"DS4.CharacterProfileGender": "Geschlecht",
"DS4.CharacterProfileBirthday": "Geburtstag",
"DS4.CharacterProfileBirthplace": "Geburtsort",
"DS4.CharacterProfileAge": "Alter",
"DS4.CharacterProfileHeight": "Größe",
"DS4.ProfilHairColor": "Haarfarbe",
"DS4.ProfileWeight": "Gewicht",
"DS4.ProfileEyeColor": "Augenfarbe",
"DS4.ProfileSpecialCharacteristics": "Besondere Eigenschaften",
"DS4.CharacterProfileWeight": "Gewicht",
"DS4.CharacterProfileEyeColor": "Augenfarbe",
"DS4.CharacterProfileSpecialCharacteristics": "Besondere Eigenschaften",
"DS4.CreatureTypeAnimal": "Tier",
"DS4.CreatureTypeConstruct": "Konstrukt",
"DS4.CreatureTypeHumanoid": "Humanoid",
"DS4.CreatureTypeMagicalEntity": "Magisches Wesen",
"DS4.CreatureTypePlantBeing": "Pflanzenwesen",
"DS4.CreatureTypeUndead": "Untot",
"DS4.CreatureSizeCategoryTiny": "Winzig",
"DS4.CreatureSizeCategorySmall": "Klein",
"DS4.CreatureSizeCategoryNormal": "Normal",
"DS4.CreatureSizeCategoryLarge": "Groß",
"DS4.CreatureSizeCategoryHuge": "Riesig",
"DS4.CreatureSizeCategoryColossal": "Gewaltig",
"DS4.CreatureBaseInfoLoot": "Beute",
"DS4.CreatureBaseInfoFoeFactor": "Gegnerhärte",
"DS4.CreatureBaseInfoCreatureType": "Kreaturengruppe",
"DS4.CreatureBaseInfoSizeCategory": "Größenkategorie",
"DS4.CreatureBaseInfoExperiencePoints": "Erfahrungspunkte",
"DS4.WarningManageActiveEffectOnOwnedItem": "Das Verwalten von aktiven Effekten innerhalb eines besessen Items wird derzeit nicht unterstützt und wird in einem nachfolgenden Update hinzugefügt.",
"DS4.ErrorDiceCritOverlap": "Es gibt eine Überlappung zwischen Patzern und Immersiegen.",
"DS4.ErrorExplodingRecursionLimitExceeded": "Die maximale Rekursionstiefe für slayende Würfelwürfe wurde überschritten."

View file

@ -89,30 +89,47 @@
"DS4.CombatValuesRangedAttack": "Ranged Attack",
"DS4.CombatValuesSpellcasting": "Spellcasting",
"DS4.CombatValuesTargetedSpellcasting": "Targeted Spellcasting",
"DS4.BaseInfoRace": "Race",
"DS4.BaseInfoClass": "Class",
"DS4.BaseInfoHeroClass": "Hero Class",
"DS4.BaseInfoCulture": "Culture",
"DS4.ProgressionLevel": "Level",
"DS4.ProgressionExperiencePoints": "Experience Points",
"DS4.ProgressionTalentPoints": "Talent Points",
"DS4.ProgressionProgressPoints": "Progress Points",
"DS4.CharacterBaseInfoRace": "Race",
"DS4.CharacterBaseInfoClass": "Class",
"DS4.CharacterBaseInfoHeroClass": "Hero Class",
"DS4.CharacterBaseInfoCulture": "Culture",
"DS4.CharacterProgressionLevel": "Level",
"DS4.CharacterProgressionExperiencePoints": "Experience Points",
"DS4.CharacterProgressionTalentPoints": "Talent Points",
"DS4.CharacterProgressionProgressPoints": "Progress Points",
"DS4.TalentRank": "Rank",
"DS4.TalentRankBase": "Acquired Ranks",
"DS4.TalentRankMax": "Maximum Ranks",
"DS4.TalentRankMod": "Additional Ranks",
"DS4.TalentRankTotal": "Total Ranks",
"DS4.LanguageLanguages": "Languages",
"DS4.LanguageAlphabets": "Alphabets",
"DS4.ProfileGender": "Gender",
"DS4.ProfileBirthday": "Birthday",
"DS4.ProfileBirthplace": "Birthplace",
"DS4.ProfileAge": "Age",
"DS4.ProfileHeight": "Height",
"DS4.CharacterLanguageLanguages": "Languages",
"DS4.CharacterLanguageAlphabets": "Alphabets",
"DS4.CharacterProfileGender": "Gender",
"DS4.CharacterProfileBirthday": "Birthday",
"DS4.CharacterProfileBirthplace": "Birthplace",
"DS4.CharacterProfileAge": "Age",
"DS4.CharacterProfileHeight": "Height",
"DS4.ProfilHairColor": "Hair Color",
"DS4.ProfileWeight": "Weight",
"DS4.ProfileEyeColor": "Eye Color",
"DS4.ProfileSpecialCharacteristics": "Special Characteristics",
"DS4.CharacterProfileWeight": "Weight",
"DS4.CharacterProfileEyeColor": "Eye Color",
"DS4.CharacterProfileSpecialCharacteristics": "Special Characteristics",
"DS4.CreatureTypeAnimal": "Animal",
"DS4.CreatureTypeConstruct": "Construct",
"DS4.CreatureTypeHumanoid": "Humanoid",
"DS4.CreatureTypeMagicalEntity": "Magical Entity",
"DS4.CreatureTypePlantBeing": "Plant Being",
"DS4.CreatureTypeUndead": "Undead",
"DS4.CreatureSizeCategoryTiny": "Tiny",
"DS4.CreatureSizeCategorySmall": "Small",
"DS4.CreatureSizeCategoryNormal": "Normal",
"DS4.CreatureSizeCategoryLarge": "Large",
"DS4.CreatureSizeCategoryHuge": "Huge",
"DS4.CreatureSizeCategoryColossal": "Colossal",
"DS4.CreatureBaseInfoLoot": "Loot",
"DS4.CreatureBaseInfoFoeFactor": "Foe Factor",
"DS4.CreatureBaseInfoCreatureType": "Creature Type",
"DS4.CreatureBaseInfoSizeCategory": "Size Category",
"DS4.CreatureBaseInfoExperiencePoints": "Experience Points",
"DS4.WarningManageActiveEffectOnOwnedItem": "Managing Active Effects within an Owned Item is not currently supported and will be added in a subsequent update.",
"DS4.ErrorDiceCritOverlap": "There's an overlap between Fumbles and Coups",
"DS4.ErrorExplodingRecursionLimitExceeded": "Maximum recursion depth for exploding dice roll exceeded"

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

View file

@ -1,9 +1,8 @@
{
"Actor": {
"types": ["character"],
"templates": {},
"character": {
"templates": [],
"types": ["character", "creature"],
"templates": {
"base": {
"attributes": {
"body": {
"base": 0,
@ -78,7 +77,21 @@
"base": 0,
"mod": 0
}
}
}
},
"creature": {
"templates": ["base"],
"baseInfo": {
"loot": "",
"foeFactor": 1,
"creatureType": "humanoid",
"sizeCategory": "normal",
"experiencePoints": 0
}
},
"character": {
"templates": ["base"],
"baseInfo": {
"race": "",
"class": "",

View file

@ -8,17 +8,17 @@
<div class="flexrow basic-properties">
<div class="basic-property">
<label class="basic-property-label" for="data.baseInfo.race">{{config.baseInfo.race}}</label>
<label class="basic-property-label" for="data.baseInfo.race">{{config.characterBaseInfo.race}}</label>
<input type="text" name="data.baseInfo.race" value="{{data.baseInfo.race}}" data-dtype="String" />
</div>
<div class="basic-property">
<label class="basic-property-label" for="data.baseInfo.culture">{{config.baseInfo.culture}}</label>
<label class="basic-property-label" for="data.baseInfo.culture">{{config.characterBaseInfo.culture}}</label>
<input type="text" name="data.baseInfo.culture" value="{{data.baseInfo.culture}}"
data-dtype="String" />
</div>
<div class="basic-property flex125">
<label class="basic-property-label"
for="data.progression.progressPoints.used">{{config.progression.progressPoints}}</label>
for="data.progression.progressPoints.used">{{config.characterProgression.progressPoints}}</label>
<div class="flexrow">
<input type="number" name="data.progression.progressPoints.used"
value="{{data.progression.progressPoints.used}}" data-dtype="Number" /><span
@ -29,7 +29,7 @@
</div>
<div class="basic-property flex125">
<label class="basic-property-label"
for="data.progression.talentPoints.used">{{config.progression.talentPoints}}</label>
for="data.progression.talentPoints.used">{{config.characterProgression.talentPoints}}</label>
<div class="flexrow">
<input type="number" name="data.progression.talentPoints.used"
value="{{data.progression.talentPoints.used}}" data-dtype="Number" /><span
@ -39,12 +39,12 @@
</div>
</div>
<div class="basic-property">
<label class="basic-property-label" for="data.baseInfo.class">{{config.baseInfo.class}}</label>
<label class="basic-property-label" for="data.baseInfo.class">{{config.characterBaseInfo.class}}</label>
<input type="text" name="data.baseInfo.class" value="{{data.baseInfo.class}}" data-dtype="String" />
</div>
<div class="basic-property">
<label class="basic-property-label"
for="data.baseInfo.heroClass">{{config.baseInfo.heroClass}}</label>
for="data.baseInfo.heroClass">{{config.characterBaseInfo.heroClass}}</label>
<input type="text" name="data.baseInfo.heroClass" value="{{data.baseInfo.heroClass}}"
data-dtype="String" />
</div>

View file

@ -1,13 +1,13 @@
<div class="progression flexrow">
<div class="progression-entry">
<h2 class="progression-label"><label for="data.progression.level">{{config.progression.level}}</label>
<h2 class="progression-label"><label for="data.progression.level">{{config.characterProgression.level}}</label>
</h2>
<input class="progression-value" type="number" name="data.progression.level" value="{{data.progression.level}}"
data-dtype="Number" />
</div>
<div class="progression-entry">
<h2 class="progression-label"><label
for="data.progression.experiencePoints">{{config.progression.experiencePoints}}</label>
for="data.progression.experiencePoints">{{config.characterProgression.experiencePoints}}</label>
</h2>
<input class="progression-value" type="number" name="data.progression.experiencePoints"
value="{{data.progression.experiencePoints}}" data-dtype="Number" />

View file

@ -3,10 +3,10 @@
{{#each data.profile as |profile-data-value profile-data-key|}}
<div class="profile-entry">
<label for="data.profile.{{profile-data-key}}">
{{lookup ../config.profile profile-data-key}}
{{lookup ../config.characterProfile profile-data-key}}
</label>
<input type="text" name="data.profile.{{profile-data-key}}" value="{{profile-data-value}}"
data-dtype="{{lookup ../config/profileDTypes profile-data-key}}" />
data-dtype="{{lookup ../config/characterProfileDTypes profile-data-key}}" />
</div>
{{/each}}
</div>