diff --git a/README.md b/README.md index 9245641..09496e9 100644 --- a/README.md +++ b/README.md @@ -9,16 +9,20 @@ Downtime Tracking is a module for Foundry VTT that adds a tab to all actor sheet Check out some examples for how to use the module [here](/examples.md). ## Multiple Progression Systems -There are two core ways to track activities in this module: +There are three core ways to track activities in this module: **Simple Progression** is exactly what it says on the tin. Every attempt to progress the activity adds one to the progress score. Just set the completion threshold based on the number of attempts you'd like the activity to take. This is handy for things with static requirements like scribing spells, or anything you just need a simple way to track. Hence the name, Simple Mode. [![Image from Gyazo](https://i.gyazo.com/5f7d0c52b2e1632dceebe94f5de842d4.gif)](https://gyazo.com/5f7d0c52b2e1632dceebe94f5de842d4) -**Ability Check Progression** is the fun stuff. When you set up an activity that uses this mode, you also select an associated ability score to go along with it. Every attempt to progress the activity prompts the player for an ability check. Currently, this uses the core 5e roll system and prompts for advantage/disadvantage, and modifiers. The check is rolled, and the total gets added to the progress score. Use this one for training skill or tool proficiencies. +**Ability Check Progression** is the fun stuff. When you set up an activity that uses this mode, you also select an associated ability or skill to go along with it. Every attempt to progress the activity prompts the player for an ability/skill check. Currently, this uses the core 5e roll system and prompts for advantage/disadvantage, and modifiers. The check is rolled, and the total gets added to the progress score. Use this one for training skill or tool proficiencies. [![Image from Gyazo](https://i.gyazo.com/83287fa524afe4fc618d0c9014b66bff.gif)](https://gyazo.com/83287fa524afe4fc618d0c9014b66bff) +**DC Progression (v0.4.0+)** is a hybrid of the first two modes. This progression mode prompts the player to make a skill or ability check against a set DC. If the roll is successful, the progression score increases by one. If the roll fails, no progress is gained. Currently, this uses the core 5e roll system and prompts for advantage/disadvantage, and modifiers. + +[![Image from Gyazo](https://i.gyazo.com/75ff889b77d7a3e1aced719503cf3eeb.gif)](https://gyazo.com/75ff889b77d7a3e1aced719503cf3eeb) + ## Customizable Several settings allow you to get the functionality you want out of the module. Current settings allow you to: - Enable and disable the tab on actor sheets. @@ -26,8 +30,6 @@ Several settings allow you to get the functionality you want out of the module. - Set defaults for each type of downtime activity progression. If you want really slow progression, you can make it happen. If you want to really reward your players for taking the time to train stuff by letting them do it quickly, you can do that, too. Go wild. Find whatever works for you. - Choose which types of actors display activity completion notifications. -[![Image from Gyazo](https://i.gyazo.com/7b34743aab42fba1af69ea60582dc0b8.png)](https://gyazo.com/7b34743aab42fba1af69ea60582dc0b8) - ## Speedy Progress Updates You know what sucks? Accidentally rolling with disadvantage when you didn't mean to. If something gets messed up, or if you need to adjust a progress value quickly, we got you covered. You can edit progress values right from the activity's entry! The input accepts relative and absolute values, so entering "-15" will subtract 15 from the progress total, and entering "57" will set it to 57. diff --git a/changelog.md b/changelog.md index 3e13557..f94bb4d 100644 --- a/changelog.md +++ b/changelog.md @@ -1,5 +1,16 @@ # Change Log +## Version 0.4.0 +New Features: +- Added a DC progression type. This is a hybrid between Simple and Ability Check types. When you create a downtime item of this type, you can select the number of successes required to complete the activity, a skill or ability associated with it, and the DC of the check. Passing the check will increase the success count by one. Failing the check will not increase it. + +Improvements: +- You can now select skills when selecting what kind of ability check to roll for Ability Check progression + +## Version 0.3.2 +Improvements: +- Added some missing Korean language translation keys, courtesy of KLO#1490 + ## Version 0.3.2 Improvements: - Added some missing Korean language translation keys, courtesy of KLO#1490 diff --git a/lang/en.json b/lang/en.json index 8ac5b36..755bfd7 100644 --- a/lang/en.json +++ b/lang/en.json @@ -1,5 +1,6 @@ { + "C5ETRAINING.Ability": "Ability", "C5ETRAINING.AbilityCha": "Charisma", "C5ETRAINING.AbilityCheck": "Ability Check", "C5ETRAINING.AbilityCon": "Constitution", @@ -17,6 +18,7 @@ "C5ETRAINING.AnnounceActivityCompletionFor": "Announce Activity Completion For:", "C5ETRAINING.AnnounceActivityCompletionForHint": "Choose which actor types you would like to have trigger chat messages upon activity completion.", "C5ETRAINING.Apply": "Apply", + "C5ETRAINING.Attempt": "Attempt", "C5ETRAINING.AttemptsToComplete": "Attempts to complete", "C5ETRAINING.AuditLog": "Change Log", "C5ETRAINING.AuditLogDeleteNote": "Note: Dismissing changes does NOT revert them. If you'd like to revert changes you see here, you must do so manually, but this log can serve as a guide to help you figure out what changes to make if required.", @@ -24,20 +26,28 @@ "C5ETRAINING.AuditLogInstructionsPlayer": "This log shows a list of changes made to the progress of each of your downtime activities that have not yet been reviewed by your GM. Once they are reviewed, they will no longer be visible here.", "C5ETRAINING.Cancel": "Cancel", + "C5ETRAINING.CheckDC": "Check DC", "C5ETRAINING.Completed": "completed", "C5ETRAINING.CompletedADowntimeActivity": "completed a downtime activity.", "C5ETRAINING.CompletionTarget": "Completion Target", "C5ETRAINING.Create": "Create", "C5ETRAINING.CreateNewDowntimeActivity": "Create New Downtime Activity", "C5ETRAINING.CurrentProgress": "Current Progress", + "C5ETRAINING.Custom": "Custom", + "C5ETRAINING.CustomRoll": "Custom Roll", + "C5ETRAINING.DC": "DC", "C5ETRAINING.DefaultAbility": "Default Attribute for Ability Check Progression", "C5ETRAINING.DefaultAbilityHint": "Sets the default attribute assigned to a downtime activity upon creation. This can be edited after activity creation.", "C5ETRAINING.DefaultAbilityCompletion": "Default Activity Completion Target (Ability Checks)", - "C5ETRAINING.DefaultAbilityCompletionHint": "Sets the default target number required to reach 100% activity completion for downtime activities using ability check progression. A good rule of thumb is that the average individual will be able to contribute about 10 points to their total per check to progress the activity. The default is 300 (or 30 days for the average individual training once a day).", - "C5ETRAINING.DefaultSimpleCompletion": "Default Activity Completion Target (Simple)", + "C5ETRAINING.DefaultAbilityCompletionHint": "Sets the default target number required to reach 100% activity completion for downtime activities using ability check progression. A good rule of thumb is that the average individual will be able to contribute about 10 points to their total per check to progress the activity. The default is 300 (or 30 days for the average individual training once a day).", + "C5ETRAINING.DefaultDcDifficulty": "Default Check Difficulty (DC)", + "C5ETRAINING.DefaultDcDifficultyHint": "Sets the default DC for ability checks used by downtime activities using the DC progression system. Defaults to 10.", + "C5ETRAINING.DefaultDcSuccesses": "Default Activity Completion Target (DC)", + "C5ETRAINING.DefaultDcSuccessesHint": "Sets the default target number of check successes required to reach 100% activity completion for downtime activities using the DC progression system. The default is 5 successes.", + "C5ETRAINING.DefaultSimpleCompletion": "Default Activity Completion Target (Simple)", "C5ETRAINING.DefaultSimpleCompletionHint": "Sets the default target number of attempts required to reach 100% activity completion for downtime activities using simple progression. The default is 10 attempts.", - "C5ETRAINING.DefaultTimeCompletion": "Default Activity Completion Target (Time)", + "C5ETRAINING.DefaultTimeCompletion": "Default Activity Completion Target (Time)", "C5ETRAINING.DefaultTimeCompletionHint": "Sets the default target number of DAYS required to reach 100% activity completion for downtime activities using time-based progression. The default is 30 days. (Requires About Time)", "C5ETRAINING.Delete": "Delete", "C5ETRAINING.DeleteConfirmation": "Are you sure you want to delete this item?", @@ -68,11 +78,32 @@ "C5ETRAINING.ProgressionType": "Progression Type", "C5ETRAINING.ReviewChanges": "Review Changes", + "C5ETRAINING.Roll": "Roll", "C5ETRAINING.SelectAnAbility": "Select an ability to use for progression", "C5ETRAINING.ShowDowntimeTab": "Show Downtime Tab", "C5ETRAINING.ShowDowntimeTabHint": "Toggling this on will display the training tab on all player character sheets. You will need to close and reopen sheets for this to take effect.", "C5ETRAINING.Simple": "Simple", + "C5ETRAINING.Skill": "Skill", + "C5ETRAINING.SkillAcr": "Acrobatics", + "C5ETRAINING.SkillAni": "Animal Handling", + "C5ETRAINING.SkillArc": "Arcana", + "C5ETRAINING.SkillAth": "Athletics", + "C5ETRAINING.SkillDec": "Deception", + "C5ETRAINING.SkillHis": "History", + "C5ETRAINING.SkillIns": "Insight", + "C5ETRAINING.SkillInv": "Investigation", + "C5ETRAINING.SkillItm": "Intimidation", + "C5ETRAINING.SkillMed": "Medicine", + "C5ETRAINING.SkillNat": "Nature", + "C5ETRAINING.SkillPer": "Persuasion", + "C5ETRAINING.SkillPrc": "Perception", + "C5ETRAINING.SkillPrf": "Performance", + "C5ETRAINING.SkillRel": "Religion", + "C5ETRAINING.SkillSlt": "Sleight of Hand", + "C5ETRAINING.SkillSte": "Stealth", + "C5ETRAINING.SkillSur": "Survival", + "C5ETRAINING.SuccessesRequired": "Successes Required", "C5ETRAINING.Time": "Time (UTC)", diff --git a/lang/missing/ko.json b/lang/missing/ko.json index 604dc9d..cd05a48 100644 --- a/lang/missing/ko.json +++ b/lang/missing/ko.json @@ -1,4 +1,38 @@ { + "C5ETRAINING.Ability": "Ability", + "C5ETRAINING.Attempt": "Attempt", + "C5ETRAINING.CheckDC": "Check DC", + "C5ETRAINING.Custom": "Custom", + "C5ETRAINING.CustomRoll": "Custom Roll", + + "C5ETRAINING.DC": "DC", + "C5ETRAINING.DefaultDcDifficulty": "Default Check Difficulty (DC)", + "C5ETRAINING.DefaultDcDifficultyHint": "Sets the default DC for ability checks used by downtime activities using the DC progression system. Defaults to 10.", + "C5ETRAINING.DefaultDcSuccesses": "Default Activity Completion Target (DC)", + "C5ETRAINING.DefaultDcSuccessesHint": "Sets the default target number of check successes required to reach 100% activity completion for downtime activities using the DC progression system. The default is 5 successes.", + + "C5ETRAINING.Roll": "Roll", + + "C5ETRAINING.Skill": "Skill", + "C5ETRAINING.SkillAcr": "Acrobatics", + "C5ETRAINING.SkillAni": "Animal Handling", + "C5ETRAINING.SkillArc": "Arcana", + "C5ETRAINING.SkillAth": "Athletics", + "C5ETRAINING.SkillDec": "Deception", + "C5ETRAINING.SkillHis": "History", + "C5ETRAINING.SkillIns": "Insight", + "C5ETRAINING.SkillInv": "Investigation", + "C5ETRAINING.SkillItm": "Intimidation", + "C5ETRAINING.SkillMed": "Medicine", + "C5ETRAINING.SkillNat": "Nature", + "C5ETRAINING.SkillPer": "Persuasion", + "C5ETRAINING.SkillPrc": "Perception", + "C5ETRAINING.SkillPrf": "Performance", + "C5ETRAINING.SkillRel": "Religion", + "C5ETRAINING.SkillSlt": "Sleight of Hand", + "C5ETRAINING.SkillSte": "Stealth", + "C5ETRAINING.SkillSur": "Survival", + "C5ETRAINING.SuccessesRequired": "Successes Required" } diff --git a/load-templates.js b/load-templates.js index d374dd9..990e9f4 100644 --- a/load-templates.js +++ b/load-templates.js @@ -1,7 +1,8 @@ export const preloadTemplates = async function() { const templatePaths = [ "modules/5e-training/templates/partials/ability.html", - "modules/5e-training/templates/partials/simple.html" + "modules/5e-training/templates/partials/simple.html", + "modules/5e-training/templates/partials/dc.html" ]; return loadTemplates(templatePaths); }; diff --git a/module.json b/module.json index 9d9ac71..08848d2 100644 --- a/module.json +++ b/module.json @@ -2,7 +2,7 @@ "name": "5e-training", "title": "Crash's 5e Downtime Tracking", "description": "Adds a section to the character sheet to keep track of downtime activity progression. Track proficiency training, spell scribing, and anything else you can think of.", - "version": "0.3.3", + "version": "0.4.0", "author": "CRASH1115#2944", "minimumCoreVersion": "0.6.0", "compatibleCoreVersion": "0.7.0", @@ -23,5 +23,5 @@ ], "url": "https://github.com/crash1115/5e-training", "manifest": "https://raw.githubusercontent.com/crash1115/5e-training/master/module.json", - "download": "https://github.com/crash1115/5e-training/releases/download/v0.3.3/5e-training.zip" + "download": "https://github.com/crash1115/5e-training/releases/download/v0.4.0/5e-training.zip" } diff --git a/styles/training.css b/styles/training.css index 6d84d8e..4405ad8 100644 --- a/styles/training.css +++ b/styles/training.css @@ -16,8 +16,9 @@ } /* Type Column */ -.training .item-detail.type { +.dnd5e.sheet.actor .training .inventory-list .item-detail.type { text-transform: capitalize; + flex: 0 0 140px; } /* Override Column */ @@ -98,8 +99,11 @@ .audit-log .action-table table tr td { padding-top: 5px; padding-bottom: 5px; + text-transform: capitalize; } + + .audit-log .action-table table tr:nth-of-type(even) td { background-color: rgba(0,0,0,0.2); } diff --git a/templates/add-training-dialog.html b/templates/add-training-dialog.html index 7032738..a0229f1 100644 --- a/templates/add-training-dialog.html +++ b/templates/add-training-dialog.html @@ -9,6 +9,7 @@ diff --git a/templates/partials/ability.html b/templates/partials/ability.html index 727910a..6b6322f 100644 --- a/templates/partials/ability.html +++ b/templates/partials/ability.html @@ -1,12 +1,30 @@
diff --git a/templates/partials/dc.html b/templates/partials/dc.html new file mode 100644 index 0000000..b51dfed --- /dev/null +++ b/templates/partials/dc.html @@ -0,0 +1,39 @@ +
+ + +
+ +
+ + +
+ +
+ + +
diff --git a/templates/training-details-dialog.html b/templates/training-details-dialog.html index 880b101..c1241b7 100644 --- a/templates/training-details-dialog.html +++ b/templates/training-details-dialog.html @@ -11,4 +11,8 @@ {{#if (eq training.progressionStyle "simple")}} {{> "modules/5e-training/templates/partials/simple.html" training=training}} {{/if}} + + {{#if (eq training.progressionStyle "dc")}} + {{> "modules/5e-training/templates/partials/dc.html" training=training}} + {{/if}} diff --git a/templates/training-section.html b/templates/training-section.html index 578bace..cb3af42 100644 --- a/templates/training-section.html +++ b/templates/training-section.html @@ -19,7 +19,7 @@

{{ localize 'C5ETRAINING.ActivityProgress' }}

{{training.name}}

- {{training.progressionStyle}} {{#if (eq training.progressionStyle "ability")}}({{training.ability}}){{/if}} + {{progressionStyle training}}
diff --git a/training.js b/training.js index 9b65a49..70429b1 100644 --- a/training.js +++ b/training.js @@ -8,6 +8,18 @@ Handlebars.registerHelper("trainingCompletion", function(trainingItem) { return percentComplete; }); +Handlebars.registerHelper("progressionStyle", function(trainingItem) { + let progressionTypeString = ""; + if(trainingItem.progressionStyle === "simple"){ + progressionTypeString = game.i18n.localize("C5ETRAINING.Simple"); + } else if(trainingItem.progressionStyle === "ability"){ + progressionTypeString = getAbilityName(trainingItem.ability); + } else if(trainingItem.progressionStyle === "dc"){ + progressionTypeString = getAbilityName(trainingItem.ability)+" (" + game.i18n.localize("C5ETRAINING.DC") + trainingItem.dc + ")"; + } + return progressionTypeString; +}); + // Register Game Settings Hooks.once("init", () => { preloadTemplates(); @@ -42,7 +54,25 @@ Hooks.once("init", () => { "con": game.i18n.localize("C5ETRAINING.AbilityCon"), "int": game.i18n.localize("C5ETRAINING.AbilityInt"), "wis": game.i18n.localize("C5ETRAINING.AbilityWis"), - "cha":game.i18n.localize("C5ETRAINING.AbilityCha"), + "cha": game.i18n.localize("C5ETRAINING.AbilityCha"), + "acr": game.i18n.localize("C5ETRAINING.SkillAcr"), + "ani": game.i18n.localize("C5ETRAINING.SkillAni"), + "arc": game.i18n.localize("C5ETRAINING.SkillArc"), + "ath": game.i18n.localize("C5ETRAINING.SkillAth"), + "dec": game.i18n.localize("C5ETRAINING.SkillDec"), + "his": game.i18n.localize("C5ETRAINING.SkillHis"), + "ins": game.i18n.localize("C5ETRAINING.SkillIns"), + "inv": game.i18n.localize("C5ETRAINING.SkillInv"), + "itm": game.i18n.localize("C5ETRAINING.SkillItm"), + "med": game.i18n.localize("C5ETRAINING.SkillMed"), + "nat": game.i18n.localize("C5ETRAINING.SkillNat"), + "per": game.i18n.localize("C5ETRAINING.SkillPer"), + "prc": game.i18n.localize("C5ETRAINING.SkillPrc"), + "prf": game.i18n.localize("C5ETRAINING.SkillPrf"), + "rel": game.i18n.localize("C5ETRAINING.SkillRel"), + "slt": game.i18n.localize("C5ETRAINING.SkillSlt"), + "ste": game.i18n.localize("C5ETRAINING.SkillSte"), + "sur": game.i18n.localize("C5ETRAINING.SkillSur") }, default: "int", }); @@ -65,6 +95,24 @@ Hooks.once("init", () => { type: Number }); + game.settings.register("5e-training", "defaultDcDifficulty", { + name: game.i18n.localize("C5ETRAINING.DefaultDcDifficulty"), + hint: game.i18n.localize("C5ETRAINING.DefaultDcDifficultyHint"), + scope: "world", + config: true, + default: 10, + type: Number + }); + + game.settings.register("5e-training", "defaultDcSuccesses", { + name: game.i18n.localize("C5ETRAINING.DefaultDcSuccesses"), + hint: game.i18n.localize("C5ETRAINING.DefaultDcSuccessesHint"), + scope: "world", + config: true, + default: 5, + type: Number + }); + // IF ABOUT TIME IS ENABLED // game.settings.register("5e-training", "timeToComplete", { // name: game.i18n.localize("C5ETRAINING.DefaultTimeCompletion"), @@ -176,6 +224,12 @@ async function addTrainingTab(app, html, data) { else if (newActivity.progressionStyle == 'simple'){ newActivity.completionAt = game.settings.get("5e-training", "attemptsToComplete"); } + // Progression Type: DC + else if (newActivity.progressionStyle == 'dc'){ + newActivity.completionAt = game.settings.get("5e-training", "defaultDcSuccesses"); + newActivity.ability = game.settings.get("5e-training", "defaultAbility"); + newActivity.dc = game.settings.get("5e-training", "defaultDcDifficulty"); + } // Update flags and actor flags.trainingItems.push(newActivity); actor.update({'flags.5e-training': null}).then(function(){ @@ -253,6 +307,12 @@ async function addTrainingTab(app, html, data) { else if (activity.progressionStyle == 'simple'){ activity.completionAt = parseInt(html.find('#completionAtInput').val()); } + // Progression Style: DC + else if (activity.progressionStyle == 'dc'){ + activity.completionAt = parseInt(html.find('#completionAtInput').val()); + activity.ability = html.find('#abilityInput').val(); + activity.dc = html.find('#dcInput').val(); + } // Update flags and actor flags.trainingItems[trainingIdx] = activity; actor.update({'flags.5e-training': null}).then(function(){ @@ -279,14 +339,17 @@ async function addTrainingTab(app, html, data) { if(isNaN(field.value)){ ui.notifications.warn("Downtime Tracking: " + game.i18n.localize("C5ETRAINING.InvalidNumberWarning")); } else if(field.value.charAt(0)=="+"){ + let changeName = game.i18n.localize("C5ETRAINING.AdjustProgressValue") + " (+)"; adjustment = parseInt(field.value.substr(1).trim()); - activity = calculateNewProgress(activity, "Adjust Progress (+)", adjustment); + activity = calculateNewProgress(activity, changeName, adjustment); } else if (field.value.charAt(0)=="-"){ + let changeName = game.i18n.localize("C5ETRAINING.AdjustProgressValue") + " (-)"; adjustment = 0 - parseInt(field.value.substr(1).trim()); - activity = calculateNewProgress(activity, "Adjust Progress (-)", adjustment); + activity = calculateNewProgress(activity, changeName, adjustment); } else { + let changeName = game.i18n.localize("C5ETRAINING.AdjustProgressValue") + " (=)"; adjustment = parseInt(field.value); - activity = calculateNewProgress(activity, "Set Progress (=)", adjustment, true); + activity = calculateNewProgress(activity, changeName, adjustment, true); } // Log completion @@ -308,14 +371,36 @@ async function addTrainingTab(app, html, data) { let fieldId = event.currentTarget.id; let trainingIdx = parseInt(fieldId.replace('roll-','')); let activity = flags.trainingItems[trainingIdx]; + let abilities = ['str','dex','con','int','wis','con']; + let skillRoll = !abilities.includes(activity.ability); - // Progression Type: Ability Check - if (activity.progressionStyle == 'ability'){ + // Progression Type: Ability Check or DC - ABILITY + if (activity.ability && !skillRoll){ + let abilityName = getAbilityName(activity.ability); + // Roll to increase progress + actor.rollAbilityTest(activity.ability).then(function(r){ + let rollMode = getRollMode(r._formula); + let attemptName = game.i18n.localize("C5ETRAINING.Roll") + " " + abilityName + " (" + rollMode + ")"; + // Increase progress + activity = calculateNewProgress(activity, attemptName, r._total); + // Log activity completion + checkCompletion(actor, activity); + // Update flags and actor + flags.trainingItems[trainingIdx] = activity; + actor.update({'flags.5e-training': null}).then(function(){ + actor.update({'flags.5e-training': flags}); + }); + }); + } + // Progression Type: Ability Check or DC - SKILL + else if (activity.ability && skillRoll){ + let abilityName = getAbilityName(activity.ability); // Roll to increase progress - actor.rollAbilityTest(activity.ability).then(function(result){ - let rollMode = getRollMode(result.formula); + actor.rollSkill(activity.ability).then(function(r){ + let rollMode = getRollMode(r._formula); + let attemptName = game.i18n.localize("C5ETRAINING.Roll") + " " + abilityName + " (" + rollMode + ")"; // Increase progress - activity = calculateNewProgress(activity, "Roll, " + rollMode + " (Ability)", result.total); + activity = calculateNewProgress(activity, attemptName, r._total); // Log activity completion checkCompletion(actor, activity); // Update flags and actor @@ -327,8 +412,9 @@ async function addTrainingTab(app, html, data) { } // Progression Type: Simple else if (activity.progressionStyle == 'simple'){ + let activityName = game.i18n.localize("C5ETRAINING.Attempt") + " (" + game.i18n.localize("C5ETRAINING.Simple") + ")"; // Increase progress - activity = calculateNewProgress(activity, "Attempt (Simple)", 1); + activity = calculateNewProgress(activity, activityName, 1); // Log activity completion checkCompletion(actor, activity); // Update flags and actor @@ -369,7 +455,15 @@ function calculateNewProgress(activity, actionName, change, absolute = false){ if(absolute){ newProgress = change; } else { - newProgress = activity.progress + change; + if(activity.dc){ //if there's a dc set + if(change >= activity.dc){ //if the check beat the dc + newProgress = activity.progress += 1; //increase the progress + } else { //check didnt beat dc + newProgress = activity.progress; //add nothing + } + } else { //if no dc set + newProgress = activity.progress + change; + } } if(newProgress > activity.completionAt){ @@ -439,6 +533,19 @@ function getRollMode(formula){ else { return game.i18n.localize("C5ETRAINING.Normal"); } } +function getAbilityName(ability){ + let capitalized = ability.charAt(0).toUpperCase() + ability.slice(1); + let abilities = ['str','dex','con','int','wis','con']; + let isSkill = !abilities.includes(ability); + let localizationKey = "C5ETRAINING."; + if(isSkill){ + localizationKey = localizationKey + "Skill" + capitalized; + } else { + localizationKey = localizationKey + "Ability" + capitalized; + } + return game.i18n.localize(localizationKey); +} + Hooks.on(`renderActorSheet`, (app, html, data) => { addTrainingTab(app, html, data).then(function(){ if (app.activateTrainingTab) {