[TheWitcher] auto fumble

This commit is contained in:
Stexinator
2021-08-13 16:58:06 +02:00
parent 2e04e3d682
commit e2289bf02f
4 changed files with 431 additions and 287 deletions
+54
View File
@@ -0,0 +1,54 @@
on('clicked:roll', (event) => {
startRoll(event.htmlAttributes.value + "{{fumble=[[1d10!]]}} {{fumble2=[[1d10!]]}}", (results) => {
var rollComputed = results.results.roll.result;
var roll2Computed = 0;
if(results.results.roll.dice[0] == 1) // We check if the first die is a fumble.
{
rollComputed = results.results.roll.result - 1 - results.results.fumble.result;
}
if(results.results.roll2 != null) {
roll2Computed = results.results.roll2.result;
if( results.results.roll2.dice[0] == 1) // We check if the first die is a fumble.
{
roll2Computed = results.results.roll2.result - 1 - results.results.fumble2.result;
}
}
finishRoll(
results.rollId,
{
roll: rollComputed,
roll2: roll2Computed
}
);
});
});
on('clicked:repeating_finearts:roll clicked:repeating_npcskill:roll', (event) => {
// prefix gets an empty string for normal attributes, and repeating_section_ID_ for repeating attributes
var trigger = event.triggerName.slice(8); // this always starts with 'clicked:'
var prefix = trigger.split('_').slice(0,3).join('_') + '_';
let rollPart = event.htmlAttributes.value.replaceAll('prefix-', `${prefix}`);
console.log(rollPart);
startRoll(rollPart + "{{fumble=[[1d10!]]}}", (results) => {
var rollComputed = results.results.roll.result;
if(results.results.roll.dice[0] == 1) // We check if the first die is a fumble.
{
rollComputed = results.results.roll.result - 1 - results.results.fumble.result;
}
finishRoll(
results.rollId,
{
roll: rollComputed,
}
);
});
});
+1 -1
View File
@@ -1,7 +1,7 @@
{
"html": "witchersheet.html",
"css": "witchersheet.css",
"authors": "Leothedino",
"authors": "Leothedino currently maintained by Stexinator",
"roll20userid": "2643470",
"preview": "witcherpreview.png",
"instructions": "A sheet to reflect the original for The Witcher TRPG created by R.Talsorian Games. It includes helpful navigation, quality of life additions such as an extended weapon rack, catologue spell list, NPC sheet and a host of auto-calculating stats and skills to string together a simple and straight-forward online experience.",
+84 -48
View File
@@ -5772,11 +5772,11 @@ textarea.sheet-campaign-text {
/* stats */
.charsheet button[type=roll].sheet-stat-roller::before {
.charsheet button[type=action].sheet-stat-roller::before {
content: " ";
}
button[type=roll].sheet-stat-roller {
button[type=action].sheet-stat-roller {
background: none;
margin-right: 5px;
width: 92px;
@@ -5791,21 +5791,21 @@ button[type=roll].sheet-stat-roller {
box-shadow: none;
}
button[type=roll].sheet-stat-roller:hover {
button[type=action].sheet-stat-roller:hover {
color: #5e0000;
box-shadow: none;
}
button[type=roll].sheet-stat-roller:active {
button[type=action].sheet-stat-roller:active {
color: #bc0000;
box-shadow: none;
}
.charsheet button[type=roll].sheet-stat-roller2::before {
.charsheet button[type=action].sheet-stat-roller2::before {
content: " ";
}
button[type=roll].sheet-stat-roller2 {
button[type=action].sheet-stat-roller2 {
background: none;
margin-right: 5px;
width: 50px;
@@ -5820,24 +5820,25 @@ button[type=roll].sheet-stat-roller2 {
box-shadow: none;
}
button[type=roll].sheet-stat-roller2:hover {
button[type=action].sheet-stat-roller2:hover {
color: #5e0000;
box-shadow: none;
}
button[type=roll].sheet-stat-roller2:active {
button[type=action].sheet-stat-roller2:active {
color: #bc0000;
box-shadow: none;
}
.charsheet button[type=roll].sheet-skill-roller2::before,
.charsheet button[type=roll].sheet-skill-roller::before {
.charsheet button[type=action].sheet-skill-roller2::before,
.charsheet button[type=action].sheet-skill-roller::before {
content: " ";
}
button[type=roll].sheet-skill-roller {
button[type=action].sheet-skill-roller {
background: none;
margin-right: 5px;
margin-left: 3px;
width: 120px;
text-shadow: none;
text-align: right;
@@ -5850,19 +5851,19 @@ button[type=roll].sheet-skill-roller {
box-shadow: none;
}
button[type=roll].sheet-skill-roller2:hover,
button[type=roll].sheet-skill-roller:hover {
button[type=action].sheet-skill-roller2:hover,
button[type=action].sheet-skill-roller:hover {
color: #5e0000;
box-shadow: none;
}
button[type=roll].sheet-skill-roller2:active,
button[type=roll].sheet-skill-roller:active {
button[type=action].sheet-skill-roller2:active,
button[type=action].sheet-skill-roller:active {
color: #bc0000;
box-shadow: none;
}
button[type=roll].sheet-skill-roller2 {
button[type=action].sheet-skill-roller2 {
background: none;
margin-right: 5px;
width: 90px;
@@ -5877,13 +5878,13 @@ button[type=roll].sheet-skill-roller2 {
box-shadow: none;
}
.charsheet button[type=roll].repeating_skill_roller_emp::before,
.charsheet button[type=roll].sheet-skill-roller-emp::before {
.charsheet button[type=action].repeating_skill_roller_emp::before,
.charsheet button[type=action].sheet-skill-roller-emp::before {
content: " ";
}
button[type=roll].repeating_skill_roller_emp,
button[type=roll].sheet-skill-roller-emp {
button[type=action].repeating_skill_roller_emp,
button[type=action].sheet-skill-roller-emp {
background: none;
margin-right: -1px;
width: 100px;
@@ -5898,25 +5899,25 @@ button[type=roll].sheet-skill-roller-emp {
box-shadow: none;
}
button[type=roll].repeating_skill_roller_emp:hover,
button[type=roll].sheet-skill-roller-emp:hover {
button[type=action].repeating_skill_roller_emp:hover,
button[type=action].sheet-skill-roller-emp:hover {
color: #5e0000;
box-shadow: none;
}
button[type=roll].repeating_skill_roller_emp:active,
button[type=roll].sheet-skill-roller-emp:active {
button[type=action].repeating_skill_roller_emp:active,
button[type=action].sheet-skill-roller-emp:active {
color: #bc0000;
box-shadow: none;
}
.charsheet button[type=roll].sheet-stat-roll::before {
.charsheet button[type=action].sheet-stat-roll::before {
font-family: "dicefontd10";
content: "0";
font-size: 16px;
}
button[type=roll].sheet-stat-roll {
button[type=action].sheet-stat-roll {
color: #000;
background-color: #e8e8e8;
text-align: center;
@@ -5929,26 +5930,26 @@ button[type=roll].sheet-stat-roll {
box-shadow: inset 1px 1px 1px 1px rgba(0,0,0,0.30);
}
button[type=roll].sheet-stat-roll:hover {
button[type=action].sheet-stat-roll:hover {
color: #5e0000;
border-color: #5e0000;
border: 1px solid;
}
button[type=roll].sheet-stat-roll:active {
button[type=action].sheet-stat-roll:active {
color: #bc0000;
border-color: #bc0000;
border: 1px solid;
box-shadow: inset 1px 1px 1px 1px #5e0000;
}
.charsheet button[type=roll].sheet-stat-roll2::before {
.charsheet button[type=action].sheet-stat-roll2::before {
font-family: "Pictos Custom";
content: "t";
font-size: 16px;
}
button[type=roll].sheet-stat-roll2 {
button[type=action].sheet-stat-roll2 {
color: #000;
background-color: #e8e8e8;
text-align: center;
@@ -5961,26 +5962,26 @@ button[type=roll].sheet-stat-roll2 {
box-shadow: inset 1px 1px 1px 1px rgba(0,0,0,0.30);
}
button[type=roll].sheet-stat-roll2:hover {
button[type=action].sheet-stat-roll2:hover {
color: #5e0000;
border-color: #5e0000;
border: 1px solid;
}
button[type=roll].sheet-stat-roll2:active {
button[type=action].sheet-stat-roll2:active {
color: #bc0000;
border-color: #bc0000;
border: 1px solid;
box-shadow: inset 1px 1px 1px 1px #5e0000;
}
.charsheet button[type=roll].sheet-stat-roll3::before {
.charsheet button[type=action].sheet-stat-roll3::before {
font-family: "Pictos Custom";
content: "e";
font-size: 16px;
}
button[type=roll].sheet-stat-roll3 {
button[type=action].sheet-stat-roll3 {
color: #000;
background-color: #e8e8e8;
text-align: center;
@@ -5993,13 +5994,13 @@ button[type=roll].sheet-stat-roll3 {
box-shadow: inset 1px 1px 1px 1px rgba(0,0,0,0.30);
}
button[type=roll].sheet-stat-roll3:hover {
button[type=action].sheet-stat-roll3:hover {
color: #5e0000;
border-color: #5e0000;
border: 1px solid;
}
button[type=roll].sheet-stat-roll3:active {
button[type=action].sheet-stat-roll3:active {
color: #bc0000;
border-color: #bc0000;
border: 1px solid;
@@ -6189,14 +6190,14 @@ button[type=roll].sheet-target-roll:active {
/* Profession Skill Button */
.charsheet button[type=roll].sheet-prof-skill-roll::before {
.charsheet button[type=action].sheet-prof-skill-roll::before {
font-family: "Helvetica";
content: "ROLL SKILL";
font-size: 9px;
display: block;
}
button[type=roll].sheet-prof-skill-roll {
button[type=action].sheet-prof-skill-roll {
color: #000;
background-color: #e8e8e8;
text-align: center;
@@ -6210,13 +6211,13 @@ button[type=roll].sheet-prof-skill-roll {
box-shadow: inset 1px 1px 1px 1px rgba(0,0,0,0.30);
}
button[type=roll].sheet-prof-skill-roll:hover {
button[type=action].sheet-prof-skill-roll:hover {
color: #828282;
border-color: #828282;
border: 1px solid;
}
button[type=roll].sheet-prof-skill-roll:active {
button[type=action].sheet-prof-skill-roll:active {
color: #afafaf;
border-color: #afafaf;
border: 1px solid;
@@ -6447,13 +6448,13 @@ button[type=roll].repeating_hex_damage_roll:active {
/* Reputation Roll */
.charsheet button[type=roll].sheet-rep-roll::before {
.charsheet button[type=action].sheet-rep-roll::before {
font-family: "Pictos";
content: "i";
font-size: 18px;
}
button[type=roll].sheet-rep-roll {
button[type=action].sheet-rep-roll {
color: #000;
background-color: #e8e8e8;
text-align: center;
@@ -6466,13 +6467,13 @@ button[type=roll].sheet-rep-roll {
box-shadow: inset 1px 1px 1px 1px rgba(0,0,0,0.30);
}
button[type=roll].sheet-rep-roll:hover {
button[type=action].sheet-rep-roll:hover {
color: #2a72a3;
border-color: #2a72a3;
border: 1px solid;
}
button[type=roll].sheet-rep-roll:active {
button[type=action].sheet-rep-roll:active {
color: #42b2ff;
border-color: #42b2ff;
border: 1px solid;
@@ -6481,13 +6482,13 @@ button[type=roll].sheet-rep-roll:active {
/* NPC Skill */
.charsheet button[type=roll].repeating_npc_skill_roll::before {
.charsheet button[type=action].repeating_npc_skill_roll::before {
font-family: "dicefontd10";
content: "0";
font-size: 17px;
}
button[type=roll].repeating_npc_skill_roll {
button[type=action].repeating_npc_skill_roll {
color: #000;
display: inline-block;
background-color: #e8e8e8;
@@ -6502,13 +6503,48 @@ button[type=roll].repeating_npc_skill_roll {
box-shadow: inset 1px 1px 1px 1px rgba(0,0,0,0.30);
}
button[type=roll].repeating_npc_skill_roll:hover {
button[type=action].repeating_npc_skill_roll:hover {
color: #878787;
border-color: #878787;
border: 1px solid;
}
button[type=roll].repeating_npc_skill_roll:active {
button[type=action].repeating_npc_skill_roll:active {
color: #d6d6d6;
border-color: #d6d6d6;
border: 1px solid;
box-shadow: inset 2px 1px 1px 1px #878787;
}
.charsheet button[type=roll].repeating_npc_weapon_roll::before {
font-family: "dicefontd10";
content: "0";
font-size: 17px;
}
button[type=roll].repeating_npc_weapon_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=roll].repeating_npc_weapon_roll:hover {
color: #878787;
border-color: #878787;
border: 1px solid;
}
button[type=roll].repeating_npc_weapon_roll:active {
color: #d6d6d6;
border-color: #d6d6d6;
border: 1px solid;
File diff suppressed because it is too large Load Diff