diff --git a/TheWitcher/witchersheet.css b/TheWitcher/witchersheet.css index b6e3341cef..2236962bd0 100644 --- a/TheWitcher/witchersheet.css +++ b/TheWitcher/witchersheet.css @@ -6927,7 +6927,7 @@ button[type=roll].repeating_npc_weapon_roll:active { } .sheet-rolltemplate-button a[href^="~"]{ - width: 30%; + width: 35%; margin-top: -10px; margin-left: 32%; text-align: center; diff --git a/TheWitcher/witchersheet.html b/TheWitcher/witchersheet.html index 7b53516ca2..c05aafadf4 100644 --- a/TheWitcher/witchersheet.html +++ b/TheWitcher/witchersheet.html @@ -1710,7 +1710,7 @@ value='@{whisper}&{template:singleroll} {{title=SPELL CASTING}} {{name=@{character_name}}} {{roll=[[1d10!+@{will}[STAT]+@{spell_casting_total}[SKILL]+?{ADDITIONAL MODS? (Bright Light, No Vision, Terrain etc)|0}[MOD]]]}}'> BASIC ROLL - @@ -4000,6 +4000,10 @@ on('clicked:roll', (event) => { { roll2Computed = results.results.roll2.result - results.results.fumble2.result-1; } + + if(results.results.roll2.expression.includes("0[LOCATION]")) { + rolllocation = 1 + } } if(results.results.roll.expression.includes("0[LOCATION]")) { @@ -4017,6 +4021,32 @@ on('clicked:roll', (event) => { }); }); +on('clicked:roll_spellcasting_detailed', (event) => { + startRoll("@{whisper}&{template:singleroll} {{title=SPELL CASTING}} {{name=@{character_name}}} {{roll=[[1d10!+@{will}[STAT]+@{spell_casting_total}[SKILL]?{EXTRA ACTION|No,+0|Yes,-3}[EXTRA ACTION]?{TARGET LOCATION |None/Random,+0|Head,-6|Torso,-1|Arm/Limb,-3|Leg/Tail/Wing,-2}[LOCATION]+?{ADDITIONAL MODS? (Bright Light, No Vision, Terrain etc)|0}[MOD]]]}}{{fumble=[[1d10!]]}}{{fumble2=[[1d10!]]}}{{rolllocation=[[0]]}}", (results) => { + var rollComputed = results.results.roll.result; + var roll2Computed = 0; + var rolllocation = 0; + + if(results.results.roll.dice[0] == 1) // We check if the first die is a fumble. + { + rollComputed = results.results.roll.result - results.results.fumble.result-1; + } + + if(results.results.roll.expression.includes("0[LOCATION]")) { + rolllocation = 1 + } + + finishRoll( + results.rollId, + { + roll: rollComputed, + rolllocation: rolllocation + } + ); + }); +}); + + on('clicked:repeating_finearts:roll clicked:repeating_performance:roll clicked:repeating_npcskill:roll', (event) => { // prefix gets an empty string for normal attributes, and repeating_section_ID_ for repeating attributes @@ -4295,6 +4325,9 @@ on('clicked:repeating_finearts:roll clicked:repeating_performance:roll clicked:r DMG: {{damage}}  | RANGE: {{range}} DEFENSE: {{defense}} +
+ [Spellcasting](~{{name}}|roll_spellcasting_detailed) +