From 6bad00c227c55c881fecc894b5e9baf50c944757 Mon Sep 17 00:00:00 2001 From: TheLastScrub <67403321+TheLastScrub@users.noreply.github.com> Date: Fri, 28 Jun 2024 20:00:28 -0700 Subject: [PATCH 1/4] Added checkbox for exhaustion to sheet --- lang/ca.json | 2 ++ lang/de.json | 2 ++ lang/en.json | 2 ++ lang/es.json | 2 ++ lang/fr.json | 2 ++ lang/ja.json | 2 ++ lang/pt-BR.json | 2 ++ template.json | 3 ++- templates/actor/actor-sheet.html | 6 ++++++ 9 files changed, 22 insertions(+), 1 deletion(-) diff --git a/lang/ca.json b/lang/ca.json index 6552316..b58c8d9 100644 --- a/lang/ca.json +++ b/lang/ca.json @@ -96,6 +96,7 @@ "DG.Physical.Wounds": "Ferides", "DG.Physical.FirstAidLabel": "Primers auxilis ja aplicats: ", + "DG.Physical.Exhausted": "Exhausted:", "DG.Generic.AddButtonLabel": "Afegir", @@ -151,6 +152,7 @@ "DG.Tooltip.AdaptedToViolence": "Adaptar-se a la violència significa que l'empatia de l'agent rep al ser testimoni de tanta violència. Perd permanentment 1d6 CAR i la mateixa quantitat de cadascún dels seus vincles.", "DG.Tooltip.AdaptedToHelplessness": "Estar adaptat a la impotència significa que l'impuls personal de l'agent s'allunya del món que el rodeja. Perd permanentement 1D6 POD. ", "DG.Tooltip.ToggleEquippedState": "Fes click per alternar si aquest item està equipat o no. ", + "DG.Tooltip.Exhaustion": "An Agent who works too long or faces extreme danger and injury without resting becomes exhausted. When this comes into play is up to the Handler, but a good rule of thumb is that going a night without sleep or refusing to rest after losing SAN or Hit Points leads to exhaustion.", "DG.Gear.Expense.NA": "N/A", "DG.Gear.Expense.Incidental": "Accidental", diff --git a/lang/de.json b/lang/de.json index ca8c35e..c44a334 100644 --- a/lang/de.json +++ b/lang/de.json @@ -111,6 +111,7 @@ "DG.Physical.Wounds": "Verletzungen", "DG.Physical.FirstAidLabel": "Erste Hilfe bereits geleistet: ", + "DG.Physical.Exhausted": "Exhausted:", "DG.Generic.AddButtonLabel": "Hinzufügen", @@ -166,6 +167,7 @@ "DG.Tooltip.AdaptedToViolence": "Die 'Gewöhnung an Gewalt' ('Adapted to Violence') bedeutet, dass das Einfühlungsvermögen deines Agenten leidet, da er Gewalt nur als ein weiteres Werkzeug ansieht, das er einsetzen kann. Der Agent verliert dauerhaft 1D6 CHA und den gleichen Betrag von jedem seiner Bindungen.", "DG.Tooltip.AdaptedToHelplessness": "Die 'Gewöhnung an Hilflosigkeit' ('Adapted to Helplessness') bedeutet, dass der persönliche Antrieb deines Agenten leidet, da er sich von der Welt um ihn herum zurückzieht. Sobald dein Agent an die Hilflosigkeit gewöhnt ist, verliert er dauerhaft 1D6 MANA.", "DG.Tooltip.ToggleEquippedState": "Klicke hier, um umzuschalten, ob dieser Gegenstand ausgerüstet ist oder nicht.", + "DG.Tooltip.Exhaustion": "An Agent who works too long or faces extreme danger and injury without resting becomes exhausted. When this comes into play is up to the Handler, but a good rule of thumb is that going a night without sleep or refusing to rest after losing SAN or Hit Points leads to exhaustion.", "DG.Gear.Expense.NA": "N/A bzw Keine", "DG.Gear.Expense.Incidental": "Zufällig", diff --git a/lang/en.json b/lang/en.json index 20544c6..44eb616 100644 --- a/lang/en.json +++ b/lang/en.json @@ -112,6 +112,7 @@ "DG.Physical.Wounds": "Wounds", "DG.Physical.FirstAidLabel": "First Aid Has Already Been Attempted: ", + "DG.Physical.Exhausted": "Exhausted:", "DG.Generic.AddButtonLabel": "Add", @@ -167,6 +168,7 @@ "DG.Tooltip.AdaptedToViolence": "Being adapted to violence means your Agent’s empathy suffers as they come to view violence as nothing but another tool to be wielded. Agent permanently loses 1D6 CHA and the same amount from each of their Bonds.", "DG.Tooltip.AdaptedToHelplessness": "Being adapted to helplessness means your Agent’s personal drive suffers as they pull back from the world around them. As soon as your Agent becomes adapted to helplessness, agent permanently loses 1D6 POW.", "DG.Tooltip.ToggleEquippedState": "Click to toggle whether this item is equipped or not.", + "DG.Tooltip.Exhaustion": "An Agent who works too long or faces extreme danger and injury without resting becomes exhausted. When this comes into play is up to the Handler, but a good rule of thumb is that going a night without sleep or refusing to rest after losing SAN or Hit Points leads to exhaustion.", "DG.Gear.Expense.NA": "N/A or None", "DG.Gear.Expense.Incidental": "Incidental", diff --git a/lang/es.json b/lang/es.json index e0c4994..3aa0bf1 100644 --- a/lang/es.json +++ b/lang/es.json @@ -96,6 +96,7 @@ "DG.Physical.Wounds": "Heridas", "DG.Physical.FirstAidLabel": "Los Primeros Auxilios ya han sido aplicados: ", + "DG.Physical.Exhausted": "Exhausted:", "DG.Generic.AddButtonLabel": "Añadir", @@ -151,6 +152,7 @@ "DG.Tooltip.AdaptedToViolence": "Adaptarse a la violencia significa que la empatía de su agente sufre al ser testigo de tanta violencia. Pierde permanentemente 1D6 CAR y la misma cantidad de cada uno de sus vínculos.", "DG.Tooltip.AdaptedToHelplessness": "Estar adaptado a la impotencia significa que el impulso personal de su Agente sufre cuando se aleja del mundo que lo rodea. Tan pronto como su Agente se adapte a la indefensión, perderá permanentemente 1D6 POD. ", "DG.Tooltip.ToggleEquippedState": "Haga clic para alternar si este artículo está equipado o no. ", + "DG.Tooltip.Exhaustion": "An Agent who works too long or faces extreme danger and injury without resting becomes exhausted. When this comes into play is up to the Handler, but a good rule of thumb is that going a night without sleep or refusing to rest after losing SAN or Hit Points leads to exhaustion.", "DG.Gear.Expense.NA": "N/A", "DG.Gear.Expense.Incidental": "Incidental", diff --git a/lang/fr.json b/lang/fr.json index 9f8cb62..2cd0029 100644 --- a/lang/fr.json +++ b/lang/fr.json @@ -102,6 +102,7 @@ "DG.Physical.Wounds": "Blessures", "DG.Physical.FirstAidLabel": "Les premiers secours ont déjà été tentés: ", + "DG.Physical.Exhausted": "Exhausted:", "DG.Generic.AddButtonLabel": "Ajout", @@ -157,6 +158,7 @@ "DG.Tooltip.AdaptedToViolence": "Être adapté à la violence signifie que l'empathie de votre Agent souffre lorsqu'il en vient à considérer la violence comme un outil de plus à manier. Il ou elle perd définitivement 1D6 CHA et le même montant dans chacun de ses Liens.", "DG.Tooltip.AdaptedToHelplessness": "Être adapté à l'impuissance signifie que la motivation personnelle de votre agent souffre lorsqu'il se retire du monde qui l'entoure. Dès que votre agent s'adapte à l'impuissance, il ou elle perd définitivement 1D6 POU.", "DG.Tooltip.ToggleEquippedState": "Cliquez pour indiquer si cet élément est équipé ou non.", + "DG.Tooltip.Exhaustion": "An Agent who works too long or faces extreme danger and injury without resting becomes exhausted. When this comes into play is up to the Handler, but a good rule of thumb is that going a night without sleep or refusing to rest after losing SAN or Hit Points leads to exhaustion.", "DG.Gear.Expense.NA": "N/A ou Aucun", "DG.Gear.Expense.Incidental": "Courant", diff --git a/lang/ja.json b/lang/ja.json index b70d154..352c052 100644 --- a/lang/ja.json +++ b/lang/ja.json @@ -96,6 +96,7 @@ "DG.Physical.Wounds": "傷", "DG.Physical.FirstAidLabel": "応急処置は既に施された", + "DG.Physical.Exhausted": "疲れ果てた:", "DG.Generic.AddButtonLabel": "加える", @@ -151,6 +152,7 @@ "DG.Tooltip.AdaptedToViolence": "暴力を道具としかみえない、暴力を見たり、使ったりするのをなんとも思えなくなって、もう精神ダメージは受けないが、永遠に1D6魅力とそれぞれの絆のスコアを失ってしまう。", "DG.Tooltip.AdaptedToHelplessness": "すべてが無意味と理解し、もう無力の精神ダメージはうけないが、執行するドライブが下がって、永遠に1D6判断力を失ってしまう。", "DG.Tooltip.ToggleEquippedState": "クリックすると、この装備を着るる/外す。", + "DG.Tooltip.Exhaustion": "An Agent who works too long or faces extreme danger and injury without resting becomes exhausted. When this comes into play is up to the Handler, but a good rule of thumb is that going a night without sleep or refusing to rest after losing SAN or Hit Points leads to exhaustion.", "DG.Gear.Expense.NA": "N/A", "DG.Gear.Expense.Incidental": "付帯費用", diff --git a/lang/pt-BR.json b/lang/pt-BR.json index 1d99f49..cbc7673 100644 --- a/lang/pt-BR.json +++ b/lang/pt-BR.json @@ -87,6 +87,7 @@ "DG.Roll.Roll": "Rolar", "DG.Physical.Wounds": "Ferimentos", "DG.Physical.FirstAidLabel": "Primeiros socorros já foi tentado: ", + "DG.Physical.Exhausted": "Exhausted:", "DG.Generic.AddButtonLabel": "Adicionar", "DG.Mental.BreakingPoint": "Ponto de Ruptura: ", "DG.Mental.Reset": "Resetar", @@ -137,6 +138,7 @@ "DG.Tooltip.AdaptedToViolence": "Estar adaptado à violência significa que a empatia do seu agente sofre quando eles veem a violência como nada além de outra ferramenta a ser usada. O agente perde permanentemente 1D6 CAR e a mesma quantia de cada um de seus vínculos.", "DG.Tooltip.AdaptedToHelplessness": "Estar adaptado ao desamparo significa que a motivação pessoal do seu agente sofre à medida que ele se afasta do mundo ao seu redor. Assim que seu Agente se adaptar ao desamparo, o agente perde permanentemente 1D6 de POD.", "DG.Tooltip.ToggleEquippedState": "Clique para alternar se este item está equipado ou não.", + "DG.Tooltip.Exhaustion": "An Agent who works too long or faces extreme danger and injury without resting becomes exhausted. When this comes into play is up to the Handler, but a good rule of thumb is that going a night without sleep or refusing to rest after losing SAN or Hit Points leads to exhaustion.", "DG.Gear.Expense.NA": "N/A", "DG.Gear.Expense.Incidental": "Incidental", "DG.Gear.Expense.Standard": "Padrão", diff --git a/template.json b/template.json index 7b52b6d..eb12c1c 100644 --- a/template.json +++ b/template.json @@ -486,7 +486,8 @@ "physical": { "description": "(Physical description of agent)", "wounds": "", - "firstAidAttempted": false + "firstAidAttempted": false, + "exhausted": false }, "biography": { "profession": "", diff --git a/templates/actor/actor-sheet.html b/templates/actor/actor-sheet.html index cc49c2d..09a4b1d 100644 --- a/templates/actor/actor-sheet.html +++ b/templates/actor/actor-sheet.html @@ -171,6 +171,12 @@ >{{localize 'DG.Physical.FirstAidLabel'}} +
+ + +
From c3fa3c36017af248a45d21a6141b7b193b080fcb Mon Sep 17 00:00:00 2001 From: TheLastScrub <67403321+TheLastScrub@users.noreply.github.com> Date: Fri, 28 Jun 2024 20:04:10 -0700 Subject: [PATCH 2/4] added separate css for exhaustion section --- css/deltagreen.css | 10 +++++++--- templates/actor/actor-sheet.html | 2 +- 2 files changed, 8 insertions(+), 4 deletions(-) diff --git a/css/deltagreen.css b/css/deltagreen.css index 3c6cf23..b3d4d3a 100644 --- a/css/deltagreen.css +++ b/css/deltagreen.css @@ -666,6 +666,11 @@ div .first-aid-received-section { margin-bottom: 10px; } +div .exhausted-section { + border-bottom: 1px solid #aaa; + margin-bottom: 10px; +} + .bonds-section-header { /* border-top: 1px solid #AAA; */ width: 100%; @@ -1107,8 +1112,7 @@ input.item-sheet-short-input { padding-top: 10px; } - -.stat-block-input{ +.stat-block-input { min-height: 300px; resize: none; -} \ No newline at end of file +} diff --git a/templates/actor/actor-sheet.html b/templates/actor/actor-sheet.html index 09a4b1d..844ab09 100644 --- a/templates/actor/actor-sheet.html +++ b/templates/actor/actor-sheet.html @@ -171,7 +171,7 @@ >{{localize 'DG.Physical.FirstAidLabel'}}
-
+
From 7cc777d7a372c7c0500f05e842e697fcb9e82505 Mon Sep 17 00:00:00 2001 From: TheLastScrub <67403321+TheLastScrub@users.noreply.github.com> Date: Fri, 28 Jun 2024 21:51:52 -0700 Subject: [PATCH 3/4] add automation for exhaustion penalty to skill, stat, and san tests --- css/deltagreen.css | 16 ++++++++++ lang/ca.json | 1 + lang/de.json | 1 + lang/en.json | 1 + lang/es.json | 1 + lang/fr.json | 1 + lang/ja.json | 1 + lang/pt-BR.json | 1 + module/actor/actor.js | 5 +++ module/roll/roll.js | 55 +++++++++++++++++++++++++++++--- template.json | 3 +- templates/actor/actor-sheet.html | 14 +++++--- 12 files changed, 91 insertions(+), 9 deletions(-) diff --git a/css/deltagreen.css b/css/deltagreen.css index b3d4d3a..eb34b14 100644 --- a/css/deltagreen.css +++ b/css/deltagreen.css @@ -671,6 +671,22 @@ div .exhausted-section { margin-bottom: 10px; } +.exhausted-section input { + width: 75px; + text-align: center; + border: 1px solid rgb(122, 121, 113); + border-radius: 3px; + height: 100%; + margin-left: 10px; + min-height: 23px; + color: rgb(139, 0, 0); + background-color: rgba(0, 0, 0, 0.05); +} + +.resource .exhaustion-label { + vertical-align: middle; +} + .bonds-section-header { /* border-top: 1px solid #AAA; */ width: 100%; diff --git a/lang/ca.json b/lang/ca.json index b58c8d9..972eee1 100644 --- a/lang/ca.json +++ b/lang/ca.json @@ -97,6 +97,7 @@ "DG.Physical.Wounds": "Ferides", "DG.Physical.FirstAidLabel": "Primers auxilis ja aplicats: ", "DG.Physical.Exhausted": "Exhausted:", + "DG.Physical.ExhaustionPenalty": "Penalty:", "DG.Generic.AddButtonLabel": "Afegir", diff --git a/lang/de.json b/lang/de.json index c44a334..d1a77e6 100644 --- a/lang/de.json +++ b/lang/de.json @@ -112,6 +112,7 @@ "DG.Physical.Wounds": "Verletzungen", "DG.Physical.FirstAidLabel": "Erste Hilfe bereits geleistet: ", "DG.Physical.Exhausted": "Exhausted:", + "DG.Physical.ExhaustionPenalty": "Penalty:", "DG.Generic.AddButtonLabel": "Hinzufügen", diff --git a/lang/en.json b/lang/en.json index 44eb616..7241a58 100644 --- a/lang/en.json +++ b/lang/en.json @@ -113,6 +113,7 @@ "DG.Physical.Wounds": "Wounds", "DG.Physical.FirstAidLabel": "First Aid Has Already Been Attempted: ", "DG.Physical.Exhausted": "Exhausted:", + "DG.Physical.ExhaustionPenalty": "Penalty:", "DG.Generic.AddButtonLabel": "Add", diff --git a/lang/es.json b/lang/es.json index 3aa0bf1..78c50e8 100644 --- a/lang/es.json +++ b/lang/es.json @@ -97,6 +97,7 @@ "DG.Physical.Wounds": "Heridas", "DG.Physical.FirstAidLabel": "Los Primeros Auxilios ya han sido aplicados: ", "DG.Physical.Exhausted": "Exhausted:", + "DG.Physical.ExhaustionPenalty": "Penalty:", "DG.Generic.AddButtonLabel": "Añadir", diff --git a/lang/fr.json b/lang/fr.json index 2cd0029..da3aa1e 100644 --- a/lang/fr.json +++ b/lang/fr.json @@ -103,6 +103,7 @@ "DG.Physical.Wounds": "Blessures", "DG.Physical.FirstAidLabel": "Les premiers secours ont déjà été tentés: ", "DG.Physical.Exhausted": "Exhausted:", + "DG.Physical.ExhaustionPenalty": "Penalty:", "DG.Generic.AddButtonLabel": "Ajout", diff --git a/lang/ja.json b/lang/ja.json index 352c052..020a5e8 100644 --- a/lang/ja.json +++ b/lang/ja.json @@ -97,6 +97,7 @@ "DG.Physical.Wounds": "傷", "DG.Physical.FirstAidLabel": "応急処置は既に施された", "DG.Physical.Exhausted": "疲れ果てた:", + "DG.Physical.ExhaustionPenalty": "Penalty:", "DG.Generic.AddButtonLabel": "加える", diff --git a/lang/pt-BR.json b/lang/pt-BR.json index cbc7673..8da5a8b 100644 --- a/lang/pt-BR.json +++ b/lang/pt-BR.json @@ -88,6 +88,7 @@ "DG.Physical.Wounds": "Ferimentos", "DG.Physical.FirstAidLabel": "Primeiros socorros já foi tentado: ", "DG.Physical.Exhausted": "Exhausted:", + "DG.Physical.ExhaustionPenalty": "Penalty:", "DG.Generic.AddButtonLabel": "Adicionar", "DG.Mental.BreakingPoint": "Ponto de Ruptura: ", "DG.Mental.Reset": "Resetar", diff --git a/module/actor/actor.js b/module/actor/actor.js index bf96c97..6c44405 100644 --- a/module/actor/actor.js +++ b/module/actor/actor.js @@ -265,6 +265,11 @@ export default class DeltaGreenActor extends Actor { system.statistics.str.meleeDamageBonus = bonus; system.statistics.str.meleeDamageBonusFormula = sbonus; + if (system.physical.exhaustedPenalty > 0) { + system.physical.exhaustedPenalty = + -1 * Math.abs(system.physical.exhaustedPenalty); + } + console.log(agent); } diff --git a/module/roll/roll.js b/module/roll/roll.js index 597e3de..7072fa2 100644 --- a/module/roll/roll.js +++ b/module/roll/roll.js @@ -267,10 +267,36 @@ export class DGPercentileRoll extends DGRoll { this.effectiveTarget }`; } - if (this.modifier) { - label += ` (${this.target}${DGUtils.formatStringWithLeadingPlus( - this.modifier, - )}%)`; + + let isExhausted = false; + let exhaustedCheckPenalty = -20; + + try { + // I suspect (but am not entirely certain) that being tired doesn't make you less lucky) + if (this.type !== "luck") { + isExhausted = this.actor.system.physical.exhausted; + exhaustedCheckPenalty = this.actor.system.physical.exhaustedPenalty; + exhaustedCheckPenalty = -1 * Math.abs(exhaustedCheckPenalty); + } + } catch { + isExhausted = false; + exhaustedCheckPenalty = -20; + } + + if (this.modifier || isExhausted) { + label += ` (${this.target}`; + + if (this.modifier) { + label += ` ${DGUtils.formatStringWithLeadingPlus(this.modifier)}%`; + } + + if (isExhausted) { + label += ` ${DGUtils.formatStringWithLeadingPlus( + exhaustedCheckPenalty, + )}%`; + } + + label += `)`; } let resultString = ""; @@ -425,18 +451,39 @@ export class DGPercentileRoll extends DGRoll { * Actual target for the roll accounting for modifier if present. * Floored to 1 if a negative modifier would bring it below 1. * Capped at 99 unless it is an inhuman stat test. + * Also worth noting, per page 47 of the Agent's Handbook, Exhaustion penalties + * affect not only skill and stat tests, but SAN tests as well... * * @returns {null|integer} */ get effectiveTarget() { let target = 1; + let isExhausted = false; + let exhaustedCheckPenalty = -20; + + try { + // I suspect (but am not entirely certain) that being tired doesn't make you less lucky) + if (this.type !== "luck") { + isExhausted = this.actor.system.physical.exhausted; + exhaustedCheckPenalty = this.actor.system.physical.exhaustedPenalty; + exhaustedCheckPenalty = -1 * Math.abs(exhaustedCheckPenalty); + } + } catch { + isExhausted = false; + exhaustedCheckPenalty = -20; + } + if (!this.target || Number.isNaN(this.target)) { return null; } target = parseInt(this.target); + if (isExhausted) { + target += exhaustedCheckPenalty; + } + if (this.modifier && !Number.isNaN(this.modifier)) { const modifier = parseInt(this.modifier); diff --git a/template.json b/template.json index eb12c1c..611042d 100644 --- a/template.json +++ b/template.json @@ -487,7 +487,8 @@ "description": "(Physical description of agent)", "wounds": "", "firstAidAttempted": false, - "exhausted": false + "exhausted": false, + "exhaustedPenalty": -20 }, "biography": { "profession": "", diff --git a/templates/actor/actor-sheet.html b/templates/actor/actor-sheet.html index 844ab09..c482281 100644 --- a/templates/actor/actor-sheet.html +++ b/templates/actor/actor-sheet.html @@ -172,10 +172,16 @@
- - + + + + + {{#if actor.system.physical.exhausted }} + + + + + {{/if}}
From ecfb355dbca706f781f329a854dad0d40243517e Mon Sep 17 00:00:00 2001 From: TheLastScrub <67403321+TheLastScrub@users.noreply.github.com> Date: Fri, 28 Jun 2024 22:04:17 -0700 Subject: [PATCH 4/4] tweaked exhaustion sizing a bit --- css/deltagreen.css | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/css/deltagreen.css b/css/deltagreen.css index eb34b14..9aed516 100644 --- a/css/deltagreen.css +++ b/css/deltagreen.css @@ -671,14 +671,15 @@ div .exhausted-section { margin-bottom: 10px; } -.exhausted-section input { +.exhausted-section input[type="number"] { width: 75px; text-align: center; border: 1px solid rgb(122, 121, 113); border-radius: 3px; height: 100%; margin-left: 10px; - min-height: 23px; + margin-bottom: 5px; + min-height: 25px; color: rgb(139, 0, 0); background-color: rgba(0, 0, 0, 0.05); }