From 3abb20282a2b8ec505f03c64079dc63fa68375f7 Mon Sep 17 00:00:00 2001 From: Stexinator Date: Sun, 21 Aug 2022 18:10:18 +0200 Subject: [PATCH] [TheWitcher] add defense bases --- TheWitcher/translation.json | 7 +- TheWitcher/witchersheet.css | 112 +++++++- TheWitcher/witchersheet.html | 523 +++++++++++++++++++++-------------- 3 files changed, 429 insertions(+), 213 deletions(-) diff --git a/TheWitcher/translation.json b/TheWitcher/translation.json index 1f39ec3cdf..a33d68f224 100644 --- a/TheWitcher/translation.json +++ b/TheWitcher/translation.json @@ -296,6 +296,11 @@ "show-jointattacks-u": "Show joint attacks", "character-u": "CHARACTER", "show-magic-and-spells": "Show magic and spell tab", + "use-pc-defense-bases": "Show defense bases", "background-u": "BACKGROUND", - "show-multiple-reputations": "Show multiple reputations" + "show-multiple-reputations": "Show multiple reputations", + "defense-bases": "DEFENSE BASES", + "dodge-base": "DODGE BASE", + "reposition-base": "REPOSITION BASE", + "block-base": "BLOCK BASE" } diff --git a/TheWitcher/witchersheet.css b/TheWitcher/witchersheet.css index f61af391b6..85f8d0cc67 100644 --- a/TheWitcher/witchersheet.css +++ b/TheWitcher/witchersheet.css @@ -368,6 +368,35 @@ input.repeating_npcskill_score { box-shadow: inset 0px 0px 4px 0px #262626; } +/* Left Side */ + +.special-stack-grid { + margin-left: -10px; +} + +.npc-defenses { + width: 520px; +} + +.npc-defense-container { + display: flex; + justify-content: space-evenly; +} + +.npc-defenses .defense-title { + padding-right: 0px; +} + +.npc-defenses .defense-name { + padding-left: 0px; +} + +.npc-defense { + width: min-content; + display: block; + text-align: center; +} + /* ----------- */ .charsheet { @@ -4994,6 +5023,11 @@ textarea.armor-text { color: #ebebeb; } +/* -- PC Defense Bases */ +.pc-defense-base:not(:checked) ~ .pc-defense-base { + display: none; +} + /* Spells & Signs*/ span.repeating_spell_gradient { @@ -6622,6 +6656,66 @@ button[type=roll].repeating_npc_weapon_roll:active { vertical-align: middle; } +/* DEFENSE BASES */ + +label.defense-title { + display: inline-block; + margin-top: 10px; + margin-bottom: 10px; + padding-left: 12px; + padding-top: 4px; + padding-bottom: 4px; + font-weight: 1; + font-size: 12px; + color: #FFF; + margin-bottom: 2px; + border-radius: 15px; + background: #444444; +} + +span.defense-name { + display: inline-block; + line-height: 0.65; + padding-left: 15px; + width: 130px; + font-size: 14px; +} + +.charsheet button[type=action].defense_skill_roll::before { + font-family: "dicefontd10"; + content: "0"; + font-size: 17px; +} + +button[type=action].defense_skill_roll { + color: #000; + display: inline-block; + background-color: #e8e8e8; + text-align: center; + font-weight: bold; + margin-top: 5px; + width:18px; + height:18px; + border-radius: 100px; + border-color: #000; + border: 1px solid; + box-shadow: inset 1px 1px 1px 1px rgba(0,0,0,0.30); +} + +button[type=action].defense_skill_roll:hover { + color: #878787; + border-color: #878787; + border: 1px solid; +} + +button[type=action].defense_skill_roll:active { + color: #d6d6d6; + border-color: #d6d6d6; + border: 1px solid; + box-shadow: inset 2px 1px 1px 1px #878787; + +} + /* ROLL TEMPLATES */ .sheet-rolltemplate-npcweapon table, @@ -6642,7 +6736,8 @@ button[type=roll].repeating_npc_weapon_roll:active { .sheet-rolltemplate-target table, .sheet-rolltemplate-fumble table, .sheet-rolltemplate-save table, -.sheet-rolltemplate-initiative table { +.sheet-rolltemplate-initiative table, +.sheet-rolltemplate-npcdefense table { width: 95%; border: 1px solid; color: black; @@ -6668,7 +6763,8 @@ button[type=roll].repeating_npc_weapon_roll:active { .sheet-rolltemplate-target th, .sheet-rolltemplate-fumble th, .sheet-rolltemplate-save th, -.sheet-rolltemplate-initiative th { +.sheet-rolltemplate-initiative th, +.sheet-rolltemplate-npcdefense th { color: #ffffff; padding: 2px; text-align: center; @@ -6695,6 +6791,7 @@ button[type=roll].repeating_npc_weapon_roll:active { .sheet-rolltemplate-target .userscript-template-title, .sheet-rolltemplate-fumble .userscript-template-title, .sheet-rolltemplate-save .userscript-template-title, +.sheet-rolltemplate-npcdefense .userscript-template-title, .sheet-rolltemplate-initiative .userscript-template-title { font-weight: bold; } @@ -6717,6 +6814,7 @@ button[type=roll].repeating_npc_weapon_roll:active { .sheet-rolltemplate-target td, .sheet-rolltemplate-fumble td, .sheet-rolltemplate-save td, +.sheet-rolltemplate-npcdefense td, .sheet-rolltemplate-initiative td { padding: 8px; border-bottom: 1px solid black; @@ -6740,6 +6838,7 @@ button[type=roll].repeating_npc_weapon_roll:active { .sheet-rolltemplate-target .inlinerollresult, .sheet-rolltemplate-fumble .inlinerollresult, .sheet-rolltemplate-save .inlinerollresult, +.sheet-rolltemplate-npcdefense .inlinerollresult, .sheet-rolltemplate-initiative .inlinerollresult { display: inline-block; min-width: 1.5em; @@ -6821,15 +6920,18 @@ button[type=roll].repeating_npc_weapon_roll:active { /* singleroll */ -.sheet-rolltemplate-singleroll th { +.sheet-rolltemplate-singleroll th, +.sheet-rolltemplate-npcdefense th { background-color: #595959; } -.sheet-rolltemplate-singleroll tr:nth-child(odd) { +.sheet-rolltemplate-singleroll tr:nth-child(odd), +.sheet-rolltemplate-npcdefense tr:nth-child(odd) { background-color: #b7b7b7; } -.sheet-rolltemplate-singleroll tr:nth-child(even) { +.sheet-rolltemplate-singleroll tr:nth-child(even), +.sheet-rolltemplate-npcdefense tr:nth-child(even) { background-color: #e0e0e0; } diff --git a/TheWitcher/witchersheet.html b/TheWitcher/witchersheet.html index 4beef52e53..f225c5169c 100644 --- a/TheWitcher/witchersheet.html +++ b/TheWitcher/witchersheet.html @@ -2362,207 +2362,227 @@ | -
- - - - - - - - - - - - - - - - - - - - - - - - -
- -
- -
- -
- -
- -
- - -
-
-
- - - - - - -
-
-
-
- - - - - - -
-
-
-
- - - - - - -
-
-
-
- - - - - - -
-
-
-
- - - - - - -
-
-
-
- - - - - - -
-
+
+ + + + + + + + + + + + + + + + + + + + + + + + +
+ +
+ +
+ +
+ +
+ +
+ + +
+
+
+ + + + + + +
+
+
+
+ + + + + + +
+
+
+
+ + + + + + +
+
+
+
+ + + + + + +
+
+
+
+ + + + + + +
+
+
+
+ + + + + + +
+
+ +
+ +
+
+ Dodge Base + + +
+
+ Reposition Base + + +
+
+ Block Base + + +
+
@@ -3351,6 +3371,10 @@ Show Magic & Spells tab +

@@ -3440,6 +3464,26 @@

+
+ +
+
+ Dodge Base + + +
+
+ Reposition Base + + +
+
+ Block Base + + +
+
+
@@ -3582,7 +3626,27 @@

-
+
+ +
+
+ Dodge Base + + +
+
+ Reposition Base + + +
+
+ Block Base + + +
+
+
+
@@ -3606,7 +3670,7 @@
-
+
@@ -3620,7 +3684,7 @@
-
+
@@ -3642,7 +3706,7 @@
-
+
@@ -4381,8 +4445,6 @@ on('clicked:roll', async (event) => { let rollBase = event.htmlAttributes.value + "{{fumble=[[1d10!]]}}{{fumble2=[[1d10!]]}}{{rolllocation=[[0]]}}"; let rollResult = await startRoll(rollBase); - console.log(rollResult); - let computedValues = await resolveChecks( checkFumble(rollResult), checkLocation(rollResult) @@ -4447,6 +4509,24 @@ on('clicked:roll_spellcasting_detailed', async (event) => { ); }); +///////////////////////// +// Defense Base Rolls // +///////////////////////// +on('clicked:dodge_base clicked:reposition_base clicked:block_base', async (event) => { + + let rollBase = event.htmlAttributes.value + "{{fumble=[[1d10!]]}}"; + let rollResult = await startRoll(rollBase); + + let computedValues = await resolveChecks( + checkFumble(rollResult), + ); + + finishRoll( + rollResult.rollId, + computedValues + ); +}); + ////////////////////////////// // Weapon Template Attacks // ////////////////////////////// @@ -5015,6 +5095,35 @@ const asw = (() => { + + + + + + {{#rollWasFumble() roll}} + {{#^rollWasCrit() roll}} + + + + {{/^rollWasCrit() roll}} + {{/rollWasFumble() roll}} +
{{title}}
NAME: {{name}}
SKILL ROLL: {{computed::roll}}
+ FUMBLED BY: {{fumble}} +
+
+ {{#^rollTotal() computed::rolllocation 0}} +
+ [Location](~{{attacker}}|location) +
+ {{/^rollTotal() computed::rolllocation 0}} + {{#rollTotal() computed::rolllocation 0}} +
+ [Damage](~{{attacker}}|location) +
+ {{/rollTotal() computed::rolllocation 0}} +
+
+