diff --git a/src/assets/DS4-DEF.png b/src/assets/DS4-DEF.png new file mode 100644 index 00000000..40d8cdc0 Binary files /dev/null and b/src/assets/DS4-DEF.png differ diff --git a/src/assets/DS4-HP.png b/src/assets/DS4-HP.png new file mode 100644 index 00000000..afa45bf0 Binary files /dev/null and b/src/assets/DS4-HP.png differ diff --git a/src/assets/DS4-INI.png b/src/assets/DS4-INI.png new file mode 100644 index 00000000..5c90b2f1 Binary files /dev/null and b/src/assets/DS4-INI.png differ diff --git a/src/assets/DS4-MAT.png b/src/assets/DS4-MAT.png index 09e41dfc..52238d1b 100644 Binary files a/src/assets/DS4-MAT.png and b/src/assets/DS4-MAT.png differ diff --git a/src/assets/DS4-MR.png b/src/assets/DS4-MR.png new file mode 100644 index 00000000..da203ff2 Binary files /dev/null and b/src/assets/DS4-MR.png differ diff --git a/src/assets/DS4-MRA.png b/src/assets/DS4-MRA.png index 82e6501b..ae97840d 100644 Binary files a/src/assets/DS4-MRA.png and b/src/assets/DS4-MRA.png differ diff --git a/src/assets/DS4-MSC.png b/src/assets/DS4-MSC.png new file mode 100644 index 00000000..e13b19f5 Binary files /dev/null and b/src/assets/DS4-MSC.png differ diff --git a/src/assets/DS4-RAT.png b/src/assets/DS4-RAT.png index c292458d..3f34ca61 100644 Binary files a/src/assets/DS4-RAT.png and b/src/assets/DS4-RAT.png differ diff --git a/src/assets/DS4-SPC.png b/src/assets/DS4-SPC.png new file mode 100644 index 00000000..f46e35e9 Binary files /dev/null and b/src/assets/DS4-SPC.png differ diff --git a/src/assets/DS4-TSC.png b/src/assets/DS4-TSC.png new file mode 100644 index 00000000..e6244bfc Binary files /dev/null and b/src/assets/DS4-TSC.png differ diff --git a/src/ds4.scss b/src/ds4.scss index f91ff4ba..b2e83661 100644 --- a/src/ds4.scss +++ b/src/ds4.scss @@ -17,4 +17,5 @@ @import "scss/components/tabs"; @import "scss/components/items"; @import "scss/components/description"; + @import "scss/components/character_values"; } diff --git a/src/lang/en.json b/src/lang/en.json index 601ffc37..9da9f5ec 100644 --- a/src/lang/en.json +++ b/src/lang/en.json @@ -54,5 +54,30 @@ "DS4.ArmorMaterialTypeChain": "Chain", "DS4.ArmorMaterialTypeChainAbbr": "Chain", "DS4.ArmorMaterialTypePlate": "Plate", - "DS4.ArmorMaterialTypePlateAbbr": "Plate" + "DS4.ArmorMaterialTypePlateAbbr": "Plate", + "DS4.AttributeBody": "Body", + "DS4.AttributeMobility": "Mobility", + "DS4.AttributeMind": "Mind", + "DS4.TraitStrength": "Strength", + "DS4.TraitConstitution": "Constitution", + "DS4.TraitAgility": "Agility", + "DS4.TraitDexterity": "Dexterity", + "DS4.TraitIntellect": "Intellect", + "DS4.TraitAura": "Aura", + "DS4.CombatValuesHitPoints": "Hit Points", + "DS4.CombatValuesDefense": "Defense", + "DS4.CombatValuesInitiative": "Initiative", + "DS4.CombatValuesMovement": "Movement", + "DS4.CombatValuesMeleeAttack": "Melee Attack", + "DS4.CombatValuesRangedAttack": "Ranged Attack", + "DS4.CombatValuesSpellcasting": "Spellcasting", + "DS4.CombatValuesTargetedSpellcasting": "Targeted Spellcasting", + "DS4.BaseInfoRace": "Race", + "DS4.BaseInfoClass": "Class", + "DS4.BaseInfoHeroClass": "Hero Class", + "DS4.BaseInfoRacialAbilities": "Racial Abilites", + "DS4.ProgressionLevel": "Level", + "DS4.ProgressionExperiencePoints": "Experience Points", + "DS4.ProgressionTalentPoints": "Talent Points", + "DS4.ProgressionProgressPoints": "Progress Points" } diff --git a/src/module/actor/actor-data.ts b/src/module/actor/actor-data.ts index a202f15f..93385b65 100644 --- a/src/module/actor/actor-data.ts +++ b/src/module/actor/actor-data.ts @@ -1,26 +1,65 @@ export interface DS4ActorDataType { attributes: DS4ActorDataAttributes; traits: DS4ActorDataTraits; + combatValues: DS4ActorDataCombatValues; + baseInfo: DS4ActorDataBaseInfo; + progression: DS4ActorDataProgression; } interface DS4ActorDataAttributes { body: BodyAttribute; - mobility: ExtensibleData; - mind: ExtensibleData; + mobility: ModifiableData; + mind: ModifiableData; } -interface ExtensibleData { - initial: T; +export interface ModifiableData { + base: T; + mod: T; + total?: T; +} + +interface UsableResource { + total: T; + used: T; +} + +interface CurrentData extends ModifiableData { + current: T; } // Blueprint in case we need more detailed differentiation -type BodyAttribute = ExtensibleData; +type BodyAttribute = ModifiableData; interface DS4ActorDataTraits { - strength: ExtensibleData; - constitution: ExtensibleData; - agility: ExtensibleData; - dexterity: ExtensibleData; - intellect: ExtensibleData; - aura: ExtensibleData; + strength: ModifiableData; + constitution: ModifiableData; + agility: ModifiableData; + dexterity: ModifiableData; + intellect: ModifiableData; + aura: ModifiableData; +} + +interface DS4ActorDataCombatValues { + hitPoints: CurrentData; + defense: ModifiableData; + initiative: ModifiableData; + movement: ModifiableData; + meleeAttack: ModifiableData; + rangedAttack: ModifiableData; + spellcasting: ModifiableData; + targetedSpellcasting: ModifiableData; +} + +interface DS4ActorDataBaseInfo { + race: string; + class: string; + heroClass: string; + racialAbilities: string; +} + +interface DS4ActorDataProgression { + level: number; + experiencePoints: number; + talentPoints: UsableResource; + progressPoints: UsableResource; } diff --git a/src/module/actor/actor-sheet.ts b/src/module/actor/actor-sheet.ts index 5ca03bfe..d08e488f 100644 --- a/src/module/actor/actor-sheet.ts +++ b/src/module/actor/actor-sheet.ts @@ -30,7 +30,7 @@ export class DS4ActorSheet extends ActorSheet { /** @override */ prepareDerivedData(): void { const data = this.data; - this._prepareCombatValues(data); - } - - private _prepareCombatValues(data: ActorData): void { - const hitPointsModifier = getProperty(data, "data.combatValues.hitPoints.modifier") || 0; - const actorData = data.data; - setProperty( - data, - "data.combatValues.hitPoints.max", - actorData.attributes.body.initial + actorData.traits.constitution.initial + 10 + hitPointsModifier, + const attributes = data.data.attributes; + Object.values(attributes).forEach( + (attribute: ModifiableData) => (attribute.total = attribute.base + attribute.mod), ); - const defenseModifier = getProperty(data, "data.combatValues.defense.modifier") || 0; - setProperty( - data, - "data.combatValues.defense.value", - actorData.attributes.body.initial + - actorData.traits.constitution.initial + - this._getArmorValue() + - defenseModifier, - ); - } + const traits = data.data.traits; + Object.values(traits).forEach((trait: ModifiableData) => (trait.total = trait.base + trait.mod)); - private _getArmorValue(): number { - return this.data["items"] - .filter((item) => ["armor", "shield"].includes(item.type)) - .filter((item) => item.data.equipped) - .map((item) => item.data.armorValue) - .reduce((a, b) => a + b, 0); + const combatValues = data.data.combatValues; + Object.values(combatValues).forEach( + (combatValue: ModifiableData) => (combatValue.total = combatValue.base + combatValue.mod), + ); } } diff --git a/src/module/config.ts b/src/module/config.ts index 3ea52ba3..8b451e74 100644 --- a/src/module/config.ts +++ b/src/module/config.ts @@ -10,7 +10,6 @@ export const DS4 = { /** * Define the set of acttack types that can be performed with weapon items - * @type {Object} */ attackTypes: { melee: "DS4.AttackTypeMelee", @@ -19,8 +18,7 @@ export const DS4 = { }, /** - * * Define the file paths to icon images - * @type {Object} + * Define the file paths to icon images */ attackTypesIcons: { melee: "systems/ds4/assets/DS4-MAT.png", @@ -30,7 +28,6 @@ export const DS4 = { /** * Define the set of item availabilties - * @type {Object} */ itemAvailabilities: { unset: "DS4.ItemAvailabilityUnset", @@ -43,8 +40,7 @@ export const DS4 = { }, /** - * * Define the set of item types - * @type {Object} + * Define the set of item types */ itemTypes: { weapon: "DS4.ItemTypeWeapon", @@ -55,8 +51,7 @@ export const DS4 = { }, /** - * * Define the set of armor types, a character may only wear one item of each at any given time - * @type {Object} + * Define the set of armor types, a character may only wear one item of each at any given time */ armorTypes: { body: "DS4.ArmorTypeBody", @@ -67,8 +62,7 @@ export const DS4 = { }, /** - * * Define abbreviations for the armor types - * @type {Object} + * Define abbreviations for the armor types */ armorTypesAbbr: { body: "DS4.ArmorTypeBodyAbbr", @@ -79,8 +73,7 @@ export const DS4 = { }, /** - * * Define the set of armor materials, used to determine if a characer may wear the armor without additional penalties - * @type {Object} + * Define the set of armor materials, used to determine if a characer may wear the armor without additional penalties */ armorMaterialTypes: { cloth: "DS4.ArmorMaterialTypeCloth", @@ -90,8 +83,7 @@ export const DS4 = { }, /** - * * Define the abbreviations of armor materials - * @type {Object} + * Define the abbreviations of armor materials */ armorMaterialTypesAbbr: { cloth: "DS4.ArmorMaterialTypeClothAbbr", @@ -99,4 +91,59 @@ export const DS4 = { chain: "DS4.ArmorMaterialTypeChainAbbr", plate: "DS4.ArmorMaterialTypePlateAbbr", }, + + /** + * Define the set of attributes a character has + */ + attributes: { + body: "DS4.AttributeBody", + mobility: "DS4.AttributeMobility", + mind: "DS4.AttributeMind", + }, + + /** + * Define the set of traits a character has + */ + traits: { + strength: "DS4.TraitStrength", + constitution: "DS4.TraitConstitution", + agility: "DS4.TraitAgility", + dexterity: "DS4.TraitDexterity", + intellect: "DS4.TraitIntellect", + aura: "DS4.TraitAura", + }, + + /** + * Define the set of combat values a character has + */ + combatValues: { + hitPoints: "DS4.CombatValuesHitPoints", + defense: "DS4.CombatValuesDefense", + initiative: "DS4.CombatValuesInitiative", + movement: "DS4.CombatValuesMovement", + meleeAttack: "DS4.CombatValuesMeleeAttack", + rangedAttack: "DS4.CombatValuesRangedAttack", + spellcasting: "DS4.CombatValuesSpellcasting", + targetedSpellcasting: "DS4.CombatValuesTargetedSpellcasting", + }, + + /** + * Define the base info of a character + */ + baseInfo: { + race: "DS4.BaseInfoRace", + class: "DS4.BaseInfoClass", + heroClass: "DS4.BaseInfoHeroClass", + racialAbilities: "DS4.BaseInfoRacialAbilities", + }, + + /** + * Definme the progression info of a character + */ + progression: { + level: "DS4.ProgressionLevel", + experiencePoints: "DS4.ProgressionExperiencePoints", + talentPoints: "DS4.ProgressionTalentPoints", + progressPoints: "DS4.ProgressionProgressPoints", + }, }; diff --git a/src/module/ds4.ts b/src/module/ds4.ts index 5cf5d4a0..ba0d3017 100644 --- a/src/module/ds4.ts +++ b/src/module/ds4.ts @@ -58,6 +58,12 @@ Hooks.once("setup", function () { "armorTypesAbbr", "armorMaterialTypes", "armorMaterialTypesAbbr", + "armorMaterialTypes", + "attributes", + "traits", + "combatValues", + "baseInfo", + "progression", ]; // Exclude some from sorting where the default order matters diff --git a/src/scss/components/_character_values.scss b/src/scss/components/_character_values.scss new file mode 100644 index 00000000..6f2e1a2b --- /dev/null +++ b/src/scss/components/_character_values.scss @@ -0,0 +1,51 @@ +header.sheet-header { + .character-values { + flex: 0 0 100%; + .attributes-traits { + margin-top: 5px; + .attribute { + .attribute-label { + font-family: $font-heading; + font-size: 2em; + text-align: center; + } + .attribute-value { + border: 2px groove $c-border-groove; + line-height: 26px; + font-size: 1.5em; + text-align: center; + padding-left: 2px; + padding-right: 2px; + gap: 0; + input, + .attribute-value-total { + grid-column: span 2; + } + } + } + .trait { + .trait-label { + color: transparent; + font-family: $font-heading; + font-size: 2em; + text-align: center; + //text-shadow: -1px 1px 0 $c-black, 1px 1px 0 $c-black, 1px -1px 0 $c-black, -1px -1px 0 $c-black; + -webkit-text-stroke: 1px $c-black; + } + .trait-value { + border: 2px groove $c-border-groove; + font-size: 1.5em; + line-height: 26px; + text-align: center; + padding-left: 2px; + padding-right: 2px; + gap: 0; + input, + .trait-value-total { + grid-column: span 2; + } + } + } + } + } +} diff --git a/src/scss/components/_forms.scss b/src/scss/components/_forms.scss index acd5f812..2a992d7b 100644 --- a/src/scss/components/_forms.scss +++ b/src/scss/components/_forms.scss @@ -5,7 +5,7 @@ $header-top-margin: 5px; header.sheet-header { - flex: 0 0 210px; + flex: 0 0 auto; overflow: hidden; display: flex; flex-direction: row; diff --git a/src/template.json b/src/template.json index f25fe366..b78fd3e1 100644 --- a/src/template.json +++ b/src/template.json @@ -6,33 +6,95 @@ "templates": [], "attributes": { "body": { - "initial": 8 + "base": 0, + "mod": 0 }, "mobility": { - "initial": 0 + "base": 0, + "mod": 0 }, "mind": { - "initial": 0 + "base": 0, + "mod": 0 } }, "traits": { "strength": { - "initial": 4 + "base": 0, + "mod": 0 }, "constitution": { - "initial": 0 + "base": 0, + "mod": 0 }, "agility": { - "initial": 0 + "base": 0, + "mod": 0 }, "dexterity": { - "initial": 0 + "base": 0, + "mod": 0 }, "intellect": { - "initial": 0 + "base": 0, + "mod": 0 }, "aura": { - "initial": 0 + "base": 0, + "mod": 0 + } + }, + "combatValues": { + "hitPoints": { + "base": 0, + "mod": 0, + "current": 0 + }, + "defense": { + "base": 0, + "mod": 0 + }, + "initiative": { + "base": 0, + "mod": 0 + }, + "movement": { + "base": 0, + "mod": 0 + }, + "meleeAttack": { + "base": 0, + "mod": 0 + }, + "rangedAttack": { + "base": 0, + "mod": 0 + }, + "spellcasting": { + "base": 0, + "mod": 0 + }, + "targetedSpellcasting": { + "base": 0, + "mod": 0 + } + }, + "baseInfo": { + "race": "", + "class": "", + "heroClass": "", + "racialAbilities": "" + }, + "progression": { + "level": 0, + "experiencePoints": 0, + "talentPoints": { + "total": 0, + "used": 0 + }, + "progressPoints": { + "total": 0, + "used": 0 } } } diff --git a/src/templates/actor/actor-sheet.hbs b/src/templates/actor/actor-sheet.hbs index 4aa0540d..555412a8 100644 --- a/src/templates/actor/actor-sheet.hbs +++ b/src/templates/actor/actor-sheet.hbs @@ -4,45 +4,162 @@

+
+
{{!-- The grid classes are defined in scss/global/_grid.scss. To use, use both the "grid" and "grid-Ncol" class where "N" can be any number from 1 to 12 and will create that number of columns. --}} -
+
{{!-- "flex-group-center" is also defined in the _grid.scss file and it will add a small amount of padding, a border, and will center all of its child elements content and text. --}} -
- -
- - / - +
+ +
+
-
- -
- - / - +
+
+
+ +
+ +
+
+
+ +
+ / + +
+
+
+ +
+ / + +
+
+
+
+
+ +
+ +
+
+
+ +
+ +
+
+
+ +
+ +
+
+
+ +
+
- {{!-- The grid classes are defined in scss/global/_grid.scss. To use, use both the "grid" and "grid-Ncol" - class where "N" can be any number from 1 to 12 and will create that number of columns. --}} -
- {{#each data.abilities as |ability key|}} -
- - - {{numberFormat ability.mod decimals=0 sign=true}} +
+
+
+ + = + {{data.attributes.body.total}}
+
+
+
+ + = + {{data.attributes.mobility.total}}
+
+
+
+ + = + {{data.attributes.mind.total}}
+
+
+
+ + = + {{data.traits.strength.total}}
+
+
+
+ + = + {{data.traits.agility.total}}
+
+
+
+ + = + {{data.traits.intellect.total}}
+
+
+
+ + = + {{data.traits.constitution.total}}
+
+
+
+ + = + {{data.traits.dexterity.total}}
+
+
+
+ + = + {{data.traits.aura.total}}
- {{/each}}
@@ -63,4 +180,4 @@ {{!-- Items Tab --}} {{> systems/ds4/templates/actor/partials/items.hbs}} - + \ No newline at end of file