From 42fd44f3e4fa6600a2beaea75ad0a5fc38f0262e Mon Sep 17 00:00:00 2001 From: TheLastScrub <67403321+TheLastScrub@users.noreply.github.com> Date: Sun, 14 Mar 2021 19:18:55 -0700 Subject: [PATCH] added 'ritual' skill --- lang/en.json | 3 ++- lang/es.json | 3 ++- lang/ja.json | 3 ++- module/actor/actor.js | 25 ++++++++++++++++++++++++- templates/actor/actor-sheet.html | 2 +- 5 files changed, 31 insertions(+), 5 deletions(-) diff --git a/lang/en.json b/lang/en.json index 5a46739..c96f9b8 100644 --- a/lang/en.json +++ b/lang/en.json @@ -216,5 +216,6 @@ "DG.Roll.Inhuman": "Inhuman", "DG.Tooltip.BreakPoint": "The current breaking point, reset when current sanity falls to or below this value. The starting breaking point is SAN - POW.", - "DG.Tooltip.BreakPointReset": "Reset breaking point to be current SAN - WP." + "DG.Tooltip.BreakPointReset": "Reset breaking point to be current SAN - WP.", + "DG.Skills.ritual": "Ritual" } \ No newline at end of file diff --git a/lang/es.json b/lang/es.json index 3bf16a1..fb0a73a 100644 --- a/lang/es.json +++ b/lang/es.json @@ -216,5 +216,6 @@ "DG.Roll.Inhuman": "Inhumano", "DG.Tooltip.BreakPoint": "The current breaking point, reset when current sanity falls to or below this value. The starting breaking point is SAN - POW.", - "DG.Tooltip.BreakPointReset": "Reset breaking point to be current SAN - WP." + "DG.Tooltip.BreakPointReset": "Reset breaking point to be current SAN - WP.", + "DG.Skills.ritual": "Ritual" } \ No newline at end of file diff --git a/lang/ja.json b/lang/ja.json index bf70607..e7e4a78 100644 --- a/lang/ja.json +++ b/lang/ja.json @@ -216,5 +216,6 @@ "DG.Roll.Inhuman": "人ならざるもの", "DG.Tooltip.BreakPoint": "現在のブレーキポイント。初めの数値は「正気 ー 判断力」。", - "DG.Tooltip.BreakPointReset": "ブレーキポイントをレセットする。新しい数値は「正気 ー 判断力」。" + "DG.Tooltip.BreakPointReset": "ブレーキポイントをレセットする。新しい数値は「正気 ー 判断力」。", + "DG.Skills.ritual": "秘儀" } \ No newline at end of file diff --git a/module/actor/actor.js b/module/actor/actor.js index a776119..2ccef31 100644 --- a/module/actor/actor.js +++ b/module/actor/actor.js @@ -34,6 +34,20 @@ export class DeltaGreenActor extends Actor { statistic.x5 = statistic.value * 5; } + actorData.data.skills.ritual = { + label: "Ritual", + proficiency: 99 - actorData.data.sanity.value, + cannotBeImprovedByFailure: true, + failure: false + }; + + if(actorData.data.skills.ritual.proficiency > 99){ + actorData.data.skills.ritual.proficiency = 99 + } + else if(actorData.data.skills.ritual.proficiency < 1){ + actorData.data.skills.ritual.proficiency = 1 + } + // The unnatural skill is sort of special // It cannot be improved via failure, so add in a special property to reflect this // Mostly to make it easy to deactivate the failure checkbox in the GUI @@ -41,13 +55,22 @@ export class DeltaGreenActor extends Actor { if(key === 'unnatural'){ skill.cannotBeImprovedByFailure = true; } - else if(key==='luck'){ + else if(key === 'luck'){ skill.cannotBeImprovedByFailure = true; } else{ skill.cannotBeImprovedByFailure = false; } + + // For ritual skill, it's calculated, so add some logic to turn off changing that entirely. + if(key === 'ritual'){ + skill.isCalculatedValue = true; + } + else{ + skill.isCalculatedValue = false; + } } + actorData.data.wp.max = actorData.data.statistics.pow.value; actorData.data.health.max = Math.ceil((actorData.data.statistics.con.value + actorData.data.statistics.str.value) / 2); diff --git a/templates/actor/actor-sheet.html b/templates/actor/actor-sheet.html index cd4ed46..4fbc7cf 100644 --- a/templates/actor/actor-sheet.html +++ b/templates/actor/actor-sheet.html @@ -84,7 +84,7 @@ > {{ localize (concat "DG.Skills." key) }} - +