diff --git a/Shadowrun5th/Shadowrun5th.css b/Shadowrun5th/Shadowrun5th.css
index 1413549326..70be0347fa 100644
--- a/Shadowrun5th/Shadowrun5th.css
+++ b/Shadowrun5th/Shadowrun5th.css
@@ -55,7 +55,7 @@ input[type=radio].tabs{
.tab1:checked + div.tablabel,
.tab1:checked ~ div.gmroll,
-.content1{
+.content1Main{
color:#aaaaee;
}
@@ -101,7 +101,7 @@ input[type=radio].tabs{
color:#aaaaee;
}
-.content1,
+.content1Main,
.content2,
.contentMagic,
.content4,
@@ -112,7 +112,7 @@ input[type=radio].tabs{
display:none;
}
-input[type=radio].tab1:checked ~ div.content1,
+input[type=radio].tab1:checked ~ div.content1Main,
input[type=radio].tab2:checked ~ div.content2,
input[type=radio].tab3:checked ~ div.contentMagic,
input[type=radio].tab4:checked ~ div.content4,
@@ -767,7 +767,7 @@ div .limitlabels label{
.spiritelabel,
.limitmodifier{
display:inline-block;
- width:30%;
+ width:20%;
}
.limitdisplay{
@@ -1634,6 +1634,7 @@ div.spacer {
.sheet-rolltemplate-reactdodge table,
.sheet-rolltemplate-reactsoak table,
.sheet-rolltemplate-hitsToDrain table,
+.sheet-rolltemplate-extendedRoll table,
.sheet-rolltemplate-shadowrun table{
background-color:#111111;
border:4px solid #550000;
@@ -1647,6 +1648,7 @@ div.spacer {
.sheet-rolltemplate-reactdodge img,
.sheet-rolltemplate-reactsoak img,
.sheet-rolltemplate-hitsToDrain img,
+.sheet-rolltemplate-extendedRoll img,
.sheet-rolltemplate-shadowrun img{
float:left;
width:auto;
@@ -1656,6 +1658,7 @@ div.spacer {
.sheet-rolltemplate-reactdodge table th,
.sheet-rolltemplate-reactsoak table th,
.sheet-rolltemplate-hitsToDrain table th,
+.sheet-rolltemplate-extendedRoll table th,
.sheet-rolltemplate-shadowrun table th{
background-color:#444444;
text-align:center;
@@ -1667,6 +1670,7 @@ div.spacer {
.sheet-rolltemplate-reactdodge table .inlinerollresult,
.sheet-rolltemplate-reactsoak table .inlinerollresult,
.sheet-rolltemplate-hitsToDrain table .inlinerollresult,
+.sheet-rolltemplate-extendedRoll table .inlinerollresult,
.sheet-rolltemplate-shadowrun table .inlinerollresult{
border:none !important;
background-color:inherit;
diff --git a/Shadowrun5th/Shadowrun5th.html b/Shadowrun5th/Shadowrun5th.html
index 6ebf4439ff..b61b86e37c 100644
--- a/Shadowrun5th/Shadowrun5th.html
+++ b/Shadowrun5th/Shadowrun5th.html
@@ -38,7 +38,7 @@
-
+
Attributes
@@ -267,6 +267,7 @@ Can lift overhead (Strength + Nethits) x 5kg}}">
+
@@ -276,6 +277,9 @@ Can lift overhead (Strength + Nethits) x 5kg}}">
+
+
+
@@ -285,6 +289,9 @@ Can lift overhead (Strength + Nethits) x 5kg}}">
+
+
+
@@ -10399,6 +10406,7 @@ Click again to switch to Manual and Remote">
+
@@ -13235,7 +13243,7 @@ on('change:repeating_armors remove:repeating_armors', function(){
///////////////////////////
on('clicked:roll', async (event) => {
- await startRoll(event.htmlAttributes.value + "{{glitch=[[0]]}}", (results) => {
+ await startRoll("{{glitch=[[0]]}}" + event.htmlAttributes.value, (results) => {
var glitchComputed = 0;
var amount = results.results.result.dice.filter(x => x == 1).length;
@@ -13290,7 +13298,9 @@ on('clicked:repeating_knowledge:roll clicked:repeating_alchemy:roll clicked:repe
});
});
+/////////////////////////////////
// Things with Hits => drain //
+/////////////////////////////////
on('clicked:repeating_rituals:roll clicked:rollSummoning',
async (event) => {
@@ -13329,7 +13339,76 @@ on('clicked:repeating_rituals:roll clicked:rollSummoning',
});
});
+/////////////////////
+// Extended Rolls //
+/////////////////////
+
+on('clicked:extendedroll', async (event) => {
+ let results = await startRoll( "{{passthrough=[[0]]}}{{glitch=[[0]]}} {{sumhits=[[0]]}}" + event.htmlAttributes.value);
+
+ var glitchComputed = 0;
+ var amount = results.results.result.dice.filter(x => x == 1).length;
+
+ if(amount > results.results.result.dice.length/2) {
+ glitchComputed = 1;
+
+ if(results.results.result.dice.filter(x => x >= 6).length == 0) {
+ glitchComputed = 2;
+ }
+ }
+
+ // Storing all the passthrough data required for the next roll in an Object helps for larger rolls
+ let rollData = {
+ dice: results.results.dice_num.result,
+ limit: results.results.limit_num.result,
+ totalhits: results.results.result.result,
+ wounds: results.results.wounds_num != null ? results.results.wounds_num.result : 0,
+ sustainedspells: results.results.sustainedspells != null ? results.results.sustainedspells.result : 0,
+ }
+
+ finishRoll(
+ results.rollId,
+ {
+ glitch: glitchComputed,
+ passthrough: rollEscape.escape(rollData),
+ sumhits: results.results.result.result,
+ }
+ );
+});
+
+on('clicked:rollextended', async (ev) => {
+ await rollExtended(ev);
+});
+
+const rollExtended = async (ev) => {
+ // The data we passed into the button will be stored in the originalRollId key
+ let previousRoll = rollEscape.unescape(ev.originalRollId);
+ let attrs = await asw.getAttrs(['character_name', 'gmroll', 'edgeroll','edg_total','edgn','standardroll']);
+
+ let rollBase = `${attrs.gmroll}&{template:extendedRoll}{{passthrough=[[0]]}}{{glitch=[[0]]}}{{sumhits=[[0]]}}{{tries=[[0]]}}{{name=${attrs.character_name}}}{{roll_name=again}}{{limit_num=${previousRoll.limit}}}{{edge=${attrs.edgeroll}}}{{edge_num=[[${attrs.edg_total}]]}}{{wounds_num=[[${previousRoll.wounds}]]}}{{sustainedspells=[[${previousRoll.sustainedspells}]]}}{{dice_num=[[${previousRoll.dice}-1]]}}{{result=[[(${previousRoll.dice}-1-[[${previousRoll.wounds}]]-[[${previousRoll.sustainedspells}]]+[[${attrs.edgn}*${attrs.edg_total}]])${attrs.standardroll}${attrs.edgeroll}kh${previousRoll.limit}]]}}`;
+ let results = await startRoll(rollBase);
+
+ let sumHits = previousRoll.totalhits + results.results.result.result;
+
+ let rollData = {
+ dice: results.results.dice_num.result,
+ limit: previousRoll.limit,
+ totalhits: sumHits,
+ wounds: previousRoll.wounds,
+ sustainedspells: previousRoll.sustainedspells,
+ }
+
+
+ finishRoll(results.rollId, {
+ sumhits: sumHits,
+ passthrough: rollEscape.escape(rollData),
+ });
+}
+
+
+//////////////////////////////
// Dogable weapon attacks //
+//////////////////////////////
on('clicked:rollWeapon', async (event) => {
let rollPart = event.htmlAttributes.value;
@@ -13720,6 +13799,103 @@ const asw = (() => {
+
+
+
+ |
+ {{#name}}{{name}} rolls{{#roll_name}} {{roll_name}}{{/roll_name}}{{/name}}
+ |
+
+ {{#subheader}}
+ |
+ {{subheader}} |
+ {{/subheader}}
+ |
+ Dicepool |
+
+ | > Dice Pool({{dice_num}}) |
+
+
+ {{#tries}}
+ {{#^rollTotal() tries 0}}
+
+ | > Tries({{tries}}) |
+
+ {{/^rollTotal() tries 0}}
+ {{/tries}}
+ {{#sustainedspells}}
+ {{#^rollTotal() sustainedspells 0}}
+
+ | > Sustained spells({{sustainedspells}}) |
+
+ {{/^rollTotal() sustainedspells 0}}
+ {{/sustainedspells}}
+ {{#wounds_num}}
+ {{#^rollTotal() wounds_num 0}}
+
+ | > Woundpenalty({{wounds_num}}) |
+
+ {{/^rollTotal() wounds_num 0}}
+ {{/wounds_num}}
+ {{#edge}}
+ |
+ Edge |
+
+ > Edge({{edge_num}}) |
+
+ {{/edge}}
+ {{^edge}}
+ |
+ Limit |
+
+ > Limit({{limit_num}}) |
+
+ {{/edge}}
+
+ {{#result}}
+ |
+ Result |
+ {{#rollGreater() result 1}}
+
+ | {{result}} Successes |
+
+ {{/rollGreater() result 1}}
+ {{#rollTotal() result 1}}
+
+ | {{result}} Success |
+
+ {{/rollTotal() result 1}}
+ {{#rollTotal() result 0}}
+
+ | {{result}} Successes |
+
+ {{/rollTotal() result 0}}
+ {{#rollBetween() computed::glitch 1 1}}
+ |
+
+ | Glitch! |
+
+ {{/rollBetween() computed::glitch 1 1}}
+ {{#rollBetween() computed::glitch 2 2}}
+ |
+
+ | Critical Glitch! |
+
+ {{/rollBetween() computed::glitch 2 2}}
+ {{/result}}
+
+
+
+ | Sum hits({{computed::sumhits}}) |
+
+
+ {{#^rollTotal() computed::passthrough 0}}
+
+ [Next Roll](~{{name}}|rollextended||{{computed::passthrough}})
+
+ {{/^rollTotal() computed::passthrough 0}}
+
+