diff --git a/module/config.mjs b/module/config.mjs index fc89999c20..e3427f972d 100644 --- a/module/config.mjs +++ b/module/config.mjs @@ -19,11 +19,12 @@ _______________________________`; * Configuration data for abilities. * * @typedef {object} AbilityConfiguration - * @property {string} label Localized label. - * @property {string} abbreviation Localized abbreviation. - * @property {Object} defaults Default values for this ability based on actor type. - * If a string is used, the system will attempt to fetch the value of the - * specified ability. + * @property {string} label Localized label. + * @property {string} abbreviation Localized abbreviation. + * @property {string} [type] Whether this is a "physical" or "mental" ability. + * @property {Object} [defaults] Default values for this ability based on actor type. + * If a string is used, the system will attempt to fetch. + * the value of the specified ability. */ /** @@ -33,39 +34,47 @@ _______________________________`; DND5E.abilities = { str: { label: "DND5E.AbilityStr", - abbreviation: "DND5E.AbilityStrAbbr" + abbreviation: "DND5E.AbilityStrAbbr", + type: "physical" }, dex: { label: "DND5E.AbilityDex", - abbreviation: "DND5E.AbilityDexAbbr" + abbreviation: "DND5E.AbilityDexAbbr", + type: "physical" }, con: { label: "DND5E.AbilityCon", - abbreviation: "DND5E.AbilityConAbbr" + abbreviation: "DND5E.AbilityConAbbr", + type: "physical" }, int: { label: "DND5E.AbilityInt", abbreviation: "DND5E.AbilityIntAbbr", + type: "mental", defaults: { vehicle: 0 } }, wis: { label: "DND5E.AbilityWis", abbreviation: "DND5E.AbilityWisAbbr", + type: "mental", defaults: { vehicle: 0 } }, cha: { label: "DND5E.AbilityCha", abbreviation: "DND5E.AbilityChaAbbr", + type: "mental", defaults: { vehicle: 0 } }, hon: { label: "DND5E.AbilityHon", abbreviation: "DND5E.AbilityHonAbbr", + type: "mental", defaults: { npc: "cha", vehicle: 0 } }, san: { label: "DND5E.AbilitySan", abbreviation: "DND5E.AbilitySanAbbr", + type: "mental", defaults: { npc: "wis", vehicle: 0 } } }; diff --git a/module/documents/actor/actor.mjs b/module/documents/actor/actor.mjs index bd198704fa..1ca648c777 100644 --- a/module/documents/actor/actor.mjs +++ b/module/documents/actor/actor.mjs @@ -1879,8 +1879,8 @@ export default class Actor5e extends Actor { for ( let k of Object.keys(abilities) ) { const oa = o.system.abilities[k]; const prof = abilities[k].proficient; - if ( keepPhysical && ["str", "dex", "con"].includes(k) ) abilities[k] = oa; - else if ( keepMental && ["int", "wis", "cha"].includes(k) ) abilities[k] = oa; + if ( keepPhysical && (CONFIG.DND5E.abilities[k]?.type === "physical") ) abilities[k] = oa; + else if ( keepMental && (CONFIG.DND5E.abilities[k]?.type === "mental") ) abilities[k] = oa; if ( keepSaves ) abilities[k].proficient = oa.proficient; else if ( mergeSaves ) abilities[k].proficient = Math.max(prof, oa.proficient); }