From ac78e09c6facf19ad2aee635242c31a473167167 Mon Sep 17 00:00:00 2001 From: drdwing <66671688+drdwing@users.noreply.github.com> Date: Sat, 18 Jul 2020 19:01:15 +0900 Subject: [PATCH 1/6] v0.3.2 ko.json Korean translation by KLO ( Discord : KLO#1490) --- lang/ko.json | 19 +++++++++++++++++-- 1 file changed, 17 insertions(+), 2 deletions(-) diff --git a/lang/ko.json b/lang/ko.json index 32905ce..6abef71 100644 --- a/lang/ko.json +++ b/lang/ko.json @@ -1,21 +1,32 @@ { + "C5ETRAINING.AbilityCha": "매력", + "C5ETRAINING.AbilityCheck": "능력 판정", + "C5ETRAINING.AbilityCon": "건강", + "C5ETRAINING.AbilityDex": "민첩", + "C5ETRAINING.AbilityInt": "지능", + "C5ETRAINING.AbilityStr": "근력", + "C5ETRAINING.AbilityWis": "지혜", "C5ETRAINING.Action": "액션", "C5ETRAINING.Activity": "활동", "C5ETRAINING.ActivityProgress": "활동 진행률", - "C5ETRAINING.AdjustProgressValue": "진행률 조정", + "C5ETRAINING.Add": "추가", + "C5ETRAINING.Advantage": "유리함", + "C5ETRAINING.AdjustProgressValue": "진행률 조정", "C5ETRAINING.AdvanceActivityProgress": "고급 활동 진행률", "C5ETRAINING.AnnounceActivityCompletionFor": "활동 완료 알림 : ", "C5ETRAINING.AnnounceActivityCompletionForHint": "활동 완료 시 채팅 메시지를 작동 시킬 액터 유형을 선택한다", "C5ETRAINING.Apply": "적용", + "C5ETRAINING.AttemptsToComplete": "완료 시도", "C5ETRAINING.AuditLog": "기록 변경", "C5ETRAINING.AuditLogDeleteNote": "참고:변경을 취소해도 변경사항은 복구되지 않는다. 여기에 표시된 변경사항을 되돌리려면 수동으로 변경해야 하지만 기록을 사용하여 변경사항을 파악하는데 도움을 줄 수 있다.", "C5ETRAINING.AuditLogInstructionsGm": "이 기록은 이 캐릭터의 여가 활동의 진행 상황에 대한 모든 변경 내역을 보여준다. 취소 열의 상자를 선택하고 창 하단의 버튼을 눌러 확인 후 항목을 제거할 수 있다. 이렇게 할 경우 다시 볼 수 없다.", "C5ETRAINING.AuditLogInstructionsPlayer": "이 기록은 GM이 아직 확인하지 않은 각 여가 활동의 진행률에 대한 변경사항 목록을 보여준다. 확인 될 경우 더 이상 보이지 않게 된다.", "C5ETRAINING.Cancel": "취소", - "C5ETRAINING.Completed": "완료 :", + "C5ETRAINING.Completed": "완료됨", "C5ETRAINING.CompletedADowntimeActivity": "완료된 여가 활동", + "C5ETRAINING.CompletionTarget": "완료 목표", "C5ETRAINING.Create": "생성", "C5ETRAINING.CreateNewDowntimeActivity": "새 여가 활동 생성", "C5ETRAINING.CurrentProgress": "현재 진행률", @@ -31,6 +42,7 @@ "C5ETRAINING.Delete": "삭제", "C5ETRAINING.DeleteConfirmation": "이 항목을 정말로 삭제하시겠습니까?", "C5ETRAINING.DeleteDowntimeActivity": "여가 활동 삭제", + "C5ETRAINING.Disadvantage": "불리함", "C5ETRAINING.Dismiss": "삭제", "C5ETRAINING.DismissSelected": "선택 대상 삭제", "C5ETRAINING.DowntimeActivityComplete": "여가 활동 완료", @@ -46,6 +58,8 @@ "C5ETRAINING.Name": "이름", "C5ETRAINING.NewDowntimeActivity": "새 여가 활동", + "C5ETRAINING.None": "없음", + "C5ETRAINING.Normal": "보통", "C5ETRAINING.NpcsOnly": "NPC만", "C5ETRAINING.PcsAndNpcs": "PC와 NPC", @@ -55,6 +69,7 @@ "C5ETRAINING.ReviewChanges": "변경 내용 확인", + "C5ETRAINING.SelectAnAbility": "진행해 사용할 능력치를 선택하십시오", "C5ETRAINING.ShowDowntimeTab": "여가시간 탭 표시", "C5ETRAINING.ShowDowntimeTabHint": "이것을 활성화 하면 모든 플레이어 시트에 훈련 탭이 표시된다. 이를 적용하려면 시트를 다시 열어야 한다.", "C5ETRAINING.Simple": "심플", From 6bfc3edc8aa045ca9b01c21e539f6ddb1f0895bf Mon Sep 17 00:00:00 2001 From: Chelsea Ash Date: Sat, 18 Jul 2020 12:02:04 -0400 Subject: [PATCH 2/6] Update Korean translations and 0.7.0 compatability --- changelog.md | 4 ++++ lang/ko.json | 2 +- lang/missing/ko.json | 18 ------------------ module.json | 6 +++--- 4 files changed, 8 insertions(+), 22 deletions(-) diff --git a/changelog.md b/changelog.md index 73b7431..3e13557 100644 --- a/changelog.md +++ b/changelog.md @@ -1,5 +1,9 @@ # Change Log +## Version 0.3.2 +Improvements: +- Added some missing Korean language translation keys, courtesy of KLO#1490 + ## Version 0.3.2 Improvements: - Increased width of progress adjustment column to allow for larger values diff --git a/lang/ko.json b/lang/ko.json index 6abef71..12e0586 100644 --- a/lang/ko.json +++ b/lang/ko.json @@ -12,7 +12,7 @@ "C5ETRAINING.ActivityProgress": "활동 진행률", "C5ETRAINING.Add": "추가", "C5ETRAINING.Advantage": "유리함", - "C5ETRAINING.AdjustProgressValue": "진행률 조정", + "C5ETRAINING.AdjustProgressValue": "진행률 조정", "C5ETRAINING.AdvanceActivityProgress": "고급 활동 진행률", "C5ETRAINING.AnnounceActivityCompletionFor": "활동 완료 알림 : ", "C5ETRAINING.AnnounceActivityCompletionForHint": "활동 완료 시 채팅 메시지를 작동 시킬 액터 유형을 선택한다", diff --git a/lang/missing/ko.json b/lang/missing/ko.json index 1426668..604dc9d 100644 --- a/lang/missing/ko.json +++ b/lang/missing/ko.json @@ -1,22 +1,4 @@ { - "C5ETRAINING.AbilityCha": "Charisma", - "C5ETRAINING.AbilityCheck": "Ability Check", - "C5ETRAINING.AbilityCon": "Constitution", - "C5ETRAINING.AbilityDex": "Dexterity", - "C5ETRAINING.AbilityInt": "Intelligence", - "C5ETRAINING.AbilityStr": "Strength", - "C5ETRAINING.AbilityWis": "Wisdom", - "C5ETRAINING.Add": "Add", - "C5ETRAINING.Advantage": "Advantage", - "C5ETRAINING.AttemptsToComplete": "Attempts to complete", - "C5ETRAINING.CompletionTarget": "Completion Target", - - "C5ETRAINING.Disadvantage": "Disadvantage", - - "C5ETRAINING.None": "None", - "C5ETRAINING.Normal": "Normal", - - "C5ETRAINING.SelectAnAbility": "Select an ability to use for progression", } diff --git a/module.json b/module.json index a8837be..9d9ac71 100644 --- a/module.json +++ b/module.json @@ -2,10 +2,10 @@ "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.2", + "version": "0.3.3", "author": "CRASH1115#2944", "minimumCoreVersion": "0.6.0", - "compatibleCoreVersion": "0.6.5", + "compatibleCoreVersion": "0.7.0", "systems": ["dnd5e"], "esmodules": ["training.js"], "styles": ["styles/training.css"], @@ -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.2/5e-training.zip" + "download": "https://github.com/crash1115/5e-training/releases/download/v0.3.3/5e-training.zip" } From a21772cab58171def5bfeeefee4dcd83f552a7b9 Mon Sep 17 00:00:00 2001 From: Chelsea Ash Date: Sat, 18 Jul 2020 16:07:48 -0400 Subject: [PATCH 3/6] Allow use of skills for ability checks --- lang/en.json | 24 ++++++++++ lang/missing/ko.json | 25 +++++++++- styles/training.css | 6 ++- templates/partials/ability.html | 30 +++++++++--- templates/training-section.html | 2 +- training.js | 84 +++++++++++++++++++++++++++++---- 6 files changed, 154 insertions(+), 17 deletions(-) diff --git a/lang/en.json b/lang/en.json index 8ac5b36..2c903bc 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.", @@ -30,6 +32,8 @@ "C5ETRAINING.Create": "Create", "C5ETRAINING.CreateNewDowntimeActivity": "Create New Downtime Activity", "C5ETRAINING.CurrentProgress": "Current Progress", + "C5ETRAINING.Custom": "Custom", + "C5ETRAINING.CustomRoll": "Custom Roll", "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.", @@ -68,11 +72,31 @@ "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.Time": "Time (UTC)", diff --git a/lang/missing/ko.json b/lang/missing/ko.json index 604dc9d..077e2ac 100644 --- a/lang/missing/ko.json +++ b/lang/missing/ko.json @@ -1,4 +1,27 @@ { - + "C5ETRAINING.Ability": "Ability", + "C5ETRAINING.Attempt": "Attempt", + "C5ETRAINING.Custom": "Custom", + "C5ETRAINING.CustomRoll": "Custom Roll", + "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" } diff --git a/styles/training.css b/styles/training.css index 6d84d8e..0be8d42 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 110px; } /* 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/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/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..5323b81 100644 --- a/training.js +++ b/training.js @@ -8,6 +8,16 @@ 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); + } + return progressionTypeString; +}); + // Register Game Settings Hooks.once("init", () => { preloadTemplates(); @@ -42,7 +52,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", }); @@ -279,14 +307,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 +339,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 - ABILITY + if (activity.progressionStyle == 'ability' && !skillRoll){ + let abilityName = getAbilityName(activity.ability); // Roll to increase progress actor.rollAbilityTest(activity.ability).then(function(result){ let rollMode = getRollMode(result.formula); + let attemptName = game.i18n.localize("C5ETRAINING.Roll") + " " + abilityName + " (" + rollMode + ")"; + // Increase progress + activity = calculateNewProgress(activity, attemptName, result.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 - SKILL + else if (activity.progressionStyle == 'ability' && skillRoll){ + let abilityName = getAbilityName(activity.ability); + // Roll to increase progress + actor.rollSkill(activity.ability).then(function(result){ + let rollMode = getRollMode(result.formula); + let attemptName = game.i18n.localize("C5ETRAINING.Roll") + " " + abilityName + " (" + rollMode + ")"; // Increase progress - activity = calculateNewProgress(activity, "Roll, " + rollMode + " (Ability)", result.total); + activity = calculateNewProgress(activity, attemptName, result.total); // Log activity completion checkCompletion(actor, activity); // Update flags and actor @@ -325,10 +378,12 @@ 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 @@ -439,6 +494,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) { From f514510c536c82bb05f4912e5f7ffb9f3d16523c Mon Sep 17 00:00:00 2001 From: Chelsea Ash Date: Sat, 18 Jul 2020 19:47:07 -0400 Subject: [PATCH 4/6] Add new DC progression type --- lang/en.json | 13 ++++-- lang/missing/ko.json | 13 +++++- load-templates.js | 3 +- styles/training.css | 2 +- templates/add-training-dialog.html | 1 + templates/partials/dc.html | 39 ++++++++++++++++ templates/training-details-dialog.html | 4 ++ training.js | 65 ++++++++++++++++++++------ 8 files changed, 121 insertions(+), 19 deletions(-) create mode 100644 templates/partials/dc.html diff --git a/lang/en.json b/lang/en.json index 2c903bc..755bfd7 100644 --- a/lang/en.json +++ b/lang/en.json @@ -26,6 +26,7 @@ "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", @@ -35,13 +36,18 @@ "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?", @@ -97,6 +103,7 @@ "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 077e2ac..cd05a48 100644 --- a/lang/missing/ko.json +++ b/lang/missing/ko.json @@ -2,9 +2,19 @@ { "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", @@ -23,5 +33,6 @@ "C5ETRAINING.SkillRel": "Religion", "C5ETRAINING.SkillSlt": "Sleight of Hand", "C5ETRAINING.SkillSte": "Stealth", - "C5ETRAINING.SkillSur": "Survival" + "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/styles/training.css b/styles/training.css index 0be8d42..4405ad8 100644 --- a/styles/training.css +++ b/styles/training.css @@ -18,7 +18,7 @@ /* Type Column */ .dnd5e.sheet.actor .training .inventory-list .item-detail.type { text-transform: capitalize; - flex: 0 0 110px; + flex: 0 0 140px; } /* Override Column */ 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/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/training.js b/training.js index 5323b81..70429b1 100644 --- a/training.js +++ b/training.js @@ -14,8 +14,10 @@ Handlebars.registerHelper("progressionStyle", function(trainingItem) { 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; + return progressionTypeString; }); // Register Game Settings @@ -93,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"), @@ -204,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(){ @@ -281,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(){ @@ -342,15 +374,15 @@ async function addTrainingTab(app, html, data) { let abilities = ['str','dex','con','int','wis','con']; let skillRoll = !abilities.includes(activity.ability); - // Progression Type: Ability Check - ABILITY - if (activity.progressionStyle == 'ability' && !skillRoll){ + // 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(result){ - let rollMode = getRollMode(result.formula); + 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, result.total); + activity = calculateNewProgress(activity, attemptName, r._total); // Log activity completion checkCompletion(actor, activity); // Update flags and actor @@ -360,15 +392,15 @@ async function addTrainingTab(app, html, data) { }); }); } - // Progression Type: Ability Check - SKILL - else if (activity.progressionStyle == 'ability' && skillRoll){ + // Progression Type: Ability Check or DC - SKILL + else if (activity.ability && skillRoll){ let abilityName = getAbilityName(activity.ability); // Roll to increase progress - actor.rollSkill(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, attemptName, result.total); + activity = calculateNewProgress(activity, attemptName, r._total); // Log activity completion checkCompletion(actor, activity); // Update flags and actor @@ -378,7 +410,6 @@ 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") + ")"; @@ -424,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){ From 4e843a5088970fd2c62e4017b72b9d05538bed1d Mon Sep 17 00:00:00 2001 From: Chelsea Ash Date: Sat, 18 Jul 2020 19:47:31 -0400 Subject: [PATCH 5/6] Documentation updates --- README.md | 10 ++++++---- changelog.md | 7 +++++++ 2 files changed, 13 insertions(+), 4 deletions(-) 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..bfef934 100644 --- a/changelog.md +++ b/changelog.md @@ -1,5 +1,12 @@ # 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 From 1be74446eb112d41a7c9edb2fb5b00faeb262350 Mon Sep 17 00:00:00 2001 From: Chelsea Ash Date: Sat, 18 Jul 2020 19:59:37 -0400 Subject: [PATCH 6/6] v0.4.0 manifest --- module.json | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) 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" }