Hello Community !
I’m struggling with a problem with the roll template of a
custom character sheet I’m currently tweaking.
As per now, the rolls work like this :
Roll 1d100, apply modifiers from the sheet (like bonuses), apply
modifier input, then if it’s under the character attribute it’s a success, and
a failure if it’s over.
What I would like to achieve, is to introduce more ways to
display the result (changing color for example), according to the difference
between the roll and the target number. For example, if the traget number is 50
(=50% success rate) any roll of 30 or less would be a special success, and any
score above 70 would be a special failure. I think this is more or less the way CoC v7 works.
I guess this can be achieved by introducing a kind of threshold
in the rolltemplate, that will « trigger » special ways to display
the result in the CSS, but I don't know how to code it neither if it has to be in the roll button code or the sheet rolltemplate. I would be grateful if someone could held me with this.
Here’s the way the combat roll button is coded in the character sheet :
<button type="roll" class="atk" name="Attaque"
title="Jet d'attaque" value="&{template:tmpl}
{{pc=@{character_name}}} {{name=@{melee_nom} (COM)}} {{roll=[[1d100cs1cf100]]}}
{{target=[[@{COM}+(@{melee_mod})[Mod.]+(?{Bonus(+)/Malus(-)|0})[Bonus/Malus]]]}}
{{dmg=[[@{BF}[BF]+(@{melee_deg})[Arme]]]}}
{{dmgmin=[[1]]}}"></button></div>
Heres’s the rolltemplate at the end of the sheet :
<rolltemplate class="sheet-rolltemplate-tmpl">
<div
class="tplmain">
<div
class="pc">{{name}}</div>
<div
style="display: table;">
{{#target}}
<div style="display: table-row;">
<div class="jet"><span style="font-family:
dicefontd10;font-size: x-large;">t</span> {{roll}} &le;
{{target}} <span style="font-size:
larger;">&#9678;</span></div>
<div class="jet">
{{#rollGreater() roll target}}
<span class="failure">Échec</span>
{{/rollGreater() roll target}}
{{#rollTotal() roll target}}
<span class="success">Réussite</span>
{{/rollTotal() roll target}}
{{#rollLess() roll
target}}
<span class="success">Réussite</span>
{{/rollLess() roll target}}
</div>
</div>
{{/target}}
{{#dmg}}
{{#^rollGreater() roll target}}
<div style="display: table-row;">
<div class="jet bordtop"><span>Dégâts de
l'Arme</span></div>
<div class="jet bordtop">
{{dmg}}
</div>
</div>
{{/^rollGreater() roll target}}
{{/dmg}}
</div>
{{#desc}}
<div
class="desc bordtop">{{desc}}</div>
{{/desc}}
<div
class="jetnom">{{pc}}</div>
</div>
</rolltemplate>
Normal
0
21
false
false
false
FR
X-NONE
X-NONE
/* Style Definitions */
table.MsoNormalTable
{mso-style-name:"Tableau Normal";
mso-tstyle-rowband-size:0;
mso-tstyle-colband-size:0;
mso-style-noshow:yes;
mso-style-priority:99;
mso-style-parent:"";
mso-padding-alt:0cm 5.4pt 0cm 5.4pt;
mso-para-margin-top:0cm;
mso-para-margin-right:0cm;
mso-para-margin-bottom:8.0pt;
mso-para-margin-left:0cm;
line-height:107%;
mso-pagination:widow-orphan;
font-size:11.0pt;
font-family:"Calibri",sans-serif;
mso-ascii-font-family:Calibri;
mso-ascii-theme-font:minor-latin;
mso-hansi-font-family:Calibri;
mso-hansi-theme-font:minor-latin;
mso-bidi-font-family:"Times New Roman";
mso-bidi-theme-font:minor-bidi;
mso-fareast-language:EN-US;}