Skip to content

Commit a423375

Browse files
Merge pull request #13705 from Wagii/fix/break-rolls
[BREAK!!] Feature fixing the attribute rolls hover informations
2 parents 7e08edd + aaac71a commit a423375

File tree

1 file changed

+10
-29
lines changed

1 file changed

+10
-29
lines changed

BREAK!!/BREAK.html

Lines changed: 10 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -977,14 +977,8 @@ <h1>Notes</h1>
977977
<div class="sheet-template-container">
978978
<div class="sheet-template-header"><h1>{{charName}} {{rollName}}</h1></div>
979979
<div class="sheet-template-contents">
980-
<div class="sheet-template-row"><span>Total = </span>{{computed::total}} / {{computed::attribute}}</div>
980+
<div class="sheet-template-row"><span>Total = </span>{{computed::roll1}} / {{computed::attribute}}</div>
981981
<div class="sheet-template-row"><span></span>{{computed::result}}</div>
982-
<div class="sheet-template-row"><span>Dice = </span>{{computed::firstDie}}, {{computed::secondDie}}</div>
983-
<div class="sheet-rolls">
984-
<div class="sheet-template-row"><span>Modifier = </span>{{computed::modifier}}</div>
985-
<div class="sheet-template-row"><span>Roll Type = </span>{{computed::rollType}}</div>
986-
<div class="sheet-template-row">{{#attribute}}<span>Target = </span>{{computed::attribute}}{{/attribute}}</div>
987-
</div>
988982
</div>
989983
</div>
990984
</rolltemplate>
@@ -1370,11 +1364,12 @@ <h1>Notes</h1>
13701364
}
13711365
var attribute = eventInfo.triggerName.replace("clicked:", "").replace("square", "").replace(squareNumber, "");
13721366
attribute = attribute.charAt(0).toUpperCase() + attribute.slice(1);
1367+
const attributeName = attribute;
13731368

13741369
getAttrs(["character_name"], function(values) {
13751370
var character_name = values["character_name"]||"";
13761371

1377-
const rollString = "@{rollWhisperType} &{template:carac} {{charName=" + character_name + "}} {{rollName=" + attribute + " " + squareNumber + "}} {{modifier=[[?{Modifiers|0}]]}} {{rollType=[[?{Roll Type|Basic, 0|Edge, 1|Snag, -1}]]}} {{roll1=[[[[1+abs(?{Roll Type})]]d20]]}} {{total=[[0]]}} {{attribute=[[0]]}} {{result=[[0]]}} {{firstDie=[[0]]}} {{secondDie=[[0]]}}";
1372+
const rollString = `@{rollWhisperType} &{template:carac} {{charName=${character_name}}} {{rollName=${attributeName} ${squareNumber}}} {{roll1=[[[[1+abs(?{Roll Type|Basic, 0|Edge, 1|Snag, -1})]]d20cs${squareNumber}cf20 +?{Modifiers|0}]]}} {{rollType=[[?{Roll Type|Basic, 0|Edge, 1|Snag, -1}]]}} {{modifier=[[?{Modifiers|0}]]}} {{attribute=[[${squareNumber}]]}} {{result=[[0]]}}`;
13781373

13791374
startRoll(rollString, function(results) {
13801375
const l_roll1 = results.results.roll1;
@@ -1399,17 +1394,10 @@ <h1>Notes</h1>
13991394
l_rollType = "Snag";
14001395
}
14011396

1402-
const firstDieValue = `${l_roll1.dice[0]}`;
1403-
const secondDieValue = l_roll1.dice[1] ? `${l_roll1.dice[1]}` : "/";
1404-
14051397
const computed = {
1406-
total: l_selectedDie.total,
1398+
roll1: l_selectedDie.total,
14071399
result: l_selectedDie.result,
1408-
modifier: modifier,
1409-
rollType: l_rollType,
1410-
attribute: squareNumber,
1411-
firstDie: firstDieValue,
1412-
secondDie: secondDieValue
1400+
attribute: squareNumber
14131401
};
14141402

14151403
finishRoll(results.rollId, computed);
@@ -1421,10 +1409,10 @@ <h1>Notes</h1>
14211409
on(`${rollAttributes}`, function(eventInfo) {
14221410
const attributeName = eventInfo.triggerName.replace("clicked:", "");
14231411
getAttrs([`${attributeName}_total`, "character_name"], function(values) {
1424-
var attribute = parseInt(values[`${attributeName}_total`])||0;
1425-
var character_name = values["character_name"]||"";
1412+
const attribute = parseInt(values[`${attributeName}_total`])||0;
1413+
const character_name = values["character_name"]||"";
14261414

1427-
const rollString = "@{rollWhisperType} &{template:carac} {{charName=" + character_name + "}} {{rollName=" + attributeName + "}} {{modifier=[[?{Modifiers|0}]]}} {{attribute=[[0]]}} {{rollType=[[?{Roll Type|Basic, 0|Edge, 1|Snag, -1}]]}} {{roll1=[[[[1+abs(?{Roll Type})]]d20]]}} {{total=[[0]]}} {{result=[[0]]}} {{firstDie=[[0]]}} {{secondDie=[[0]]}}";
1415+
const rollString = `@{rollWhisperType} &{template:carac} {{charName=${character_name}}} {{rollName=${attributeName}}} {{roll1=[[[[1+abs(?{Roll Type|Basic, 0|Edge, 1|Snag, -1})]]d20cs${attribute}cf20 +?{Modifiers|0}]]}} {{rollType=[[?{Roll Type|Basic, 0|Edge, 1|Snag, -1}]]}} {{modifier=[[?{Modifiers|0}]]}} {{attribute=[[${attribute}]]}} {{result=[[0]]}}`;
14281416

14291417
startRoll(rollString, function(results) {
14301418
const l_roll1 = results.results.roll1;
@@ -1449,17 +1437,10 @@ <h1>Notes</h1>
14491437
l_rollType = "Snag";
14501438
}
14511439

1452-
const firstDieValue = `${l_roll1.dice[0]}`;
1453-
const secondDieValue = l_roll1.dice[1] ? `${l_roll1.dice[1]}` : "/";
1454-
14551440
const computed = {
1456-
total: l_selectedDie.total,
1441+
roll1: l_selectedDie.total,
14571442
result: l_selectedDie.result,
1458-
modifier: modifier,
1459-
rollType: l_rollType,
1460-
attribute: attribute,
1461-
firstDie: firstDieValue,
1462-
secondDie: secondDieValue
1443+
attribute: attribute
14631444
};
14641445

14651446
finishRoll(results.rollId, computed);

0 commit comments

Comments
 (0)