mirror of
https://github.com/Nighthawk42/roll20-character-sheets.git
synced 2026-08-30 03:40:32 +00:00
Added DCV badge to recovery messages.
This commit is contained in:
@@ -8324,7 +8324,8 @@ select:focus + .focus {
|
||||
.sheet-rolltemplate-custom-attack .sheet-header,
|
||||
.sheet-rolltemplate-custom-normal-attack .sheet-header,
|
||||
.sheet-rolltemplate-custom-power-attack .sheet-header,
|
||||
.sheet-rolltemplate-custom-contest .sheet-header {
|
||||
.sheet-rolltemplate-custom-contest .sheet-header,
|
||||
.sheet-rolltemplate-custom-activate .sheet-header {
|
||||
display: grid;
|
||||
width: 98%;
|
||||
grid-template-areas:
|
||||
@@ -8342,7 +8343,8 @@ select:focus + .focus {
|
||||
.sheet-rolltemplate-custom-attack .sheet-header .sheet-title,
|
||||
.sheet-rolltemplate-custom-normal-attack .sheet-header .sheet-title,
|
||||
.sheet-rolltemplate-custom-power-attack .sheet-header .sheet-title,
|
||||
.sheet-rolltemplate-custom-contest .sheet-header .sheet-title {
|
||||
.sheet-rolltemplate-custom-contest .sheet-header .sheet-title,
|
||||
.sheet-rolltemplate-custom-activate .sheet-header .sheet-title {
|
||||
grid-area: title;
|
||||
padding-right: 3px;
|
||||
}
|
||||
@@ -8351,7 +8353,8 @@ select:focus + .focus {
|
||||
.sheet-rolltemplate-custom-attack .sheet-header .sheet-subtitle,
|
||||
.sheet-rolltemplate-custom-normal-attack .sheet-header .sheet-subtitle,
|
||||
.sheet-rolltemplate-custom-power-attack .sheet-header .sheet-subtitle,
|
||||
.sheet-rolltemplate-custom-contest .sheet-header .sheet-subtitle {
|
||||
.sheet-rolltemplate-custom-contest .sheet-header .sheet-subtitle,
|
||||
.sheet-rolltemplate-custom-activate .sheet-header .sheet-subtitle {
|
||||
grid-area: subtitle;
|
||||
padding-right: 3px;
|
||||
}
|
||||
@@ -8381,11 +8384,17 @@ select:focus + .focus {
|
||||
border: 2px solid #f2cf7f;
|
||||
}
|
||||
|
||||
.sheet-rolltemplate-custom-activate .sheet-header .sheet-label,
|
||||
.sheet-rolltemplate-custom-activate .sheet-header .sheet-data {
|
||||
border: 2px solid #a0b4f0;
|
||||
}
|
||||
|
||||
.sheet-rolltemplate-custom-defense .sheet-header .sheet-label,
|
||||
.sheet-rolltemplate-custom-attack .sheet-header .sheet-label,
|
||||
.sheet-rolltemplate-custom-normal-attack .sheet-header .sheet-label,
|
||||
.sheet-rolltemplate-custom-power-attack .sheet-header .sheet-label,
|
||||
.sheet-rolltemplate-custom-contest .sheet-header .sheet-label {
|
||||
.sheet-rolltemplate-custom-contest .sheet-header .sheet-label,
|
||||
.sheet-rolltemplate-custom-activate .sheet-header .sheet-label {
|
||||
grid-area: label;
|
||||
text-align: center;
|
||||
font-size: 0.8em;
|
||||
@@ -8402,7 +8411,8 @@ select:focus + .focus {
|
||||
.sheet-rolltemplate-custom-attack .sheet-header .sheet-data,
|
||||
.sheet-rolltemplate-custom-normal-attack .sheet-header .sheet-data,
|
||||
.sheet-rolltemplate-custom-power-attack .sheet-header .sheet-data,
|
||||
.sheet-rolltemplate-custom-contest .sheet-header .sheet-data {
|
||||
.sheet-rolltemplate-custom-contest .sheet-header .sheet-data,
|
||||
.sheet-rolltemplate-custom-activate .sheet-header .sheet-data {
|
||||
grid-area: data;
|
||||
font-size: 2.2em;
|
||||
font-weight: bold;
|
||||
@@ -8593,12 +8603,17 @@ select:focus + .focus {
|
||||
.sheet-rolltemplate-custom-contest .inlinerollresult,
|
||||
.sheet-rolltemplate-custom-show .inlinerollresult {
|
||||
display: inline-block;
|
||||
min-width: 1.5em;
|
||||
/* min-width: 1.5em; */
|
||||
text-align: center;
|
||||
background: #fff990;
|
||||
border: 2px solid #d8cd3b;
|
||||
}
|
||||
|
||||
.sheet-rolltemplate-custom-activate .sheet-header .sheet-data .inlinerollresult {
|
||||
background-color: transparent;
|
||||
border: none;
|
||||
}
|
||||
|
||||
.sheet-rolltemplate-custom .sheet-template-wrapper .inlinerollresult,
|
||||
.sheet-rolltemplate-custom-success-roll .sheet-template-wrapper .inlinerollresult,
|
||||
.sheet-rolltemplate-custom-defense .sheet-template-wrapper .inlinerollresult,
|
||||
|
||||
@@ -16404,6 +16404,7 @@
|
||||
</div>
|
||||
</rolltemplate>
|
||||
|
||||
|
||||
<rolltemplate class="sheet-rolltemplate-custom-success-roll">
|
||||
<div class="template-wrapper">
|
||||
<div class="sheet-container sheet-color-{{color}}">
|
||||
@@ -16461,7 +16462,6 @@
|
||||
<div class="sheet-container sheet-color-{{color}}">
|
||||
<div class="sheet-header">
|
||||
{{#title}}<div class="sheet-title">{{title}}</div>{{/title}}
|
||||
{{#subtitle}}<div class="sheet-subtitle">{{subtitle}}</div>{{/subtitle}}
|
||||
{{#PHASE12}}
|
||||
{{#rollTotal() PHASE12 0}}
|
||||
<div class="sheet-subtitle">Recovery: Full Phase Action</div>
|
||||
@@ -16470,28 +16470,14 @@
|
||||
<div class="sheet-subtitle">Recovery: Post Segment 12</div>
|
||||
{{/^rollTotal() PHASE12 0}}
|
||||
{{/PHASE12}}
|
||||
{{#label}}<div class="sheet-label">{{label}}</div>{{/label}}
|
||||
{{#data}}<div class="sheet-data">{{data}}</div>{{/data}}
|
||||
</div>
|
||||
<div class="sheet-content">
|
||||
{{#SUCCESS}}
|
||||
{{#^rollLess() computed::SUCCESS 0}}
|
||||
<div class="sheet-key">Activate Armor</div>
|
||||
<div class="sheet-value">{{SUCCESS}}</div>
|
||||
{{/^rollLess() computed::SUCCESS 0}}
|
||||
{{#rollLess() computed::SUCCESS 0}}
|
||||
<div class="sheet-key">Failed to Activate</div>
|
||||
<div class="sheet-value">{{SUCCESS}}</div>
|
||||
{{/rollLess() computed::SUCCESS 0}}
|
||||
{{/SUCCESS}}
|
||||
{{#rollTotal() PHASE12 0}}
|
||||
<div class="sheet-key">Phase</div>
|
||||
<div class="sheet-value">Full</div>
|
||||
<div class="sheet-key">DCV</div>
|
||||
<div class="sheet-value">1/2</div>
|
||||
{{/rollTotal() PHASE12 0}}
|
||||
{{#allprops() title subtitle desc color SUCCESS PHASE12}}
|
||||
{{#allprops() title subtitle label data desc color PHASE12}}
|
||||
<div class="sheet-key">{{key}}</div>
|
||||
<div class="sheet-value">{{value}}</div>
|
||||
{{/allprops() title subtitle desc color SUCCESS PHASE12}}
|
||||
{{/allprops() title subtitle label data desc color PHASE12}}
|
||||
{{#desc}}<div class="sheet-desc">{{desc}}</div>{{/desc}}
|
||||
</div>
|
||||
</div>
|
||||
@@ -17375,8 +17361,9 @@
|
||||
});
|
||||
});
|
||||
|
||||
|
||||
function standardRecovery() {
|
||||
getAttrs(["whisperToGM", "character_title", "endurance", "stun", "CurrentEND", "CurrentSTUN", "weightEndPenalty", "recovery", "dingbat"], function(values) {
|
||||
getAttrs(["whisperToGM", "character_title", "endurance", "stun", "CurrentEND", "CurrentSTUN", "weightEndPenalty", "recovery", "currentDCV", "dingbat"], function(values) {
|
||||
var theRoll = values.whisperToGM||"";
|
||||
|
||||
const dingbat = ((values.character_title).replace(/\s/g, '') != '') ? (" "+values.dingbat+" ") : "";
|
||||
@@ -17387,12 +17374,18 @@
|
||||
const maxEND = Math.max(parseInt(values.endurance), currentEND);
|
||||
const maxSTUN = Math.max(parseInt(values.stun), currentSTUN);
|
||||
|
||||
// DCV for display.
|
||||
const fullDCV = parseInt(values["currentDCV"])||3;
|
||||
const halfDCV = heroRoundHigh( (parseInt(values["currentDCV"])||3)/2 );
|
||||
|
||||
theRoll += "&{template:custom-activate} ";
|
||||
theRoll += "{{title=@{character_name}" + dingbat + "@{character_title}}} ";
|
||||
theRoll += "{{PHASE12=[[?{Recovery Type|Post Segement 12 (includes END penalty),1|Recovery Action,0}]]}} ";
|
||||
theRoll += "{{label=DCV}}";
|
||||
theRoll += "{{data=[["+fullDCV+"*?{Recovery Type}+"+halfDCV+"*(1-?{Recovery Type})]]}}";
|
||||
|
||||
theRoll += "{{PHASE12=[[?{Recovery Type|Post Segement 12 (includes END penalty),1|Recovery Action,0}]]}} "
|
||||
+ "{{STUN Recovery=[[@{recoveryNet}[Recovery]]] (@{CurrentSTUN})}} "
|
||||
+ "{{END Recovery=[[@{recoveryNet}[Recovery]-[[@{weightEndPenalty}*?{Recovery Type}]][END/Turn Cost]]] (@{CurrentEND})}}";
|
||||
theRoll += "{{STUN Recovery=[[@{recoveryNet}[Recovery]]] (@{CurrentSTUN})}} ";
|
||||
theRoll += "{{END Recovery=[[@{recoveryNet}[Recovery]-[[@{weightEndPenalty}*?{Recovery Type}]][END/Turn Cost]]] (@{CurrentEND})}}";
|
||||
|
||||
startRoll(theRoll, (results) => {
|
||||
recoverSTUN = results.results["STUN Recovery"].result;
|
||||
@@ -17410,8 +17403,9 @@
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
function vehicleRecovery() {
|
||||
getAttrs(["whisperToGM", "character_title", "CurrentMainEND", "CurrentAuxiliaryEND", "mainReserveEND", "auxiliaryReserveEND", "dingbat"], function(values) {
|
||||
getAttrs(["whisperToGM", "character_title", "CurrentMainEND", "CurrentAuxiliaryEND", "mainReserveEND", "auxiliaryReserveEND", "currentDCV", "dingbat"], function(values){
|
||||
var theRoll = values.whisperToGM||"";
|
||||
|
||||
const dingbat = ((values.character_title).replace(/\s/g, '') != '') ? (" "+values.dingbat+" ") : "";
|
||||
@@ -17423,18 +17417,23 @@
|
||||
const maxPrimaryEND = Math.max(parseInt(values.mainReserveEND), CurrentMainEND);
|
||||
const maxAuxiliaryEND = Math.max(parseInt(values.auxiliaryReserveEND), currentAuxiliaryEND);
|
||||
|
||||
// DCV for display.
|
||||
const fullDCV = parseInt(values["currentDCV"])||3;
|
||||
|
||||
theRoll += "&{template:custom-activate} ";
|
||||
theRoll += "{{title=@{character_name}" + dingbat + "@{character_title}}} ";
|
||||
theRoll += "{{PHASE12=[[{1}]]}} ";
|
||||
theRoll += "{{label=DCV}}";
|
||||
theRoll += "{{data=[["+fullDCV+"]]}}";
|
||||
|
||||
theRoll += "{{MAIN Recovery=[[@{mainReserveREC}[MAIN]]] (@{CurrentMainEND})}} "
|
||||
+ "{{AUX Recovery=[[@{auxiliaryReserveREC}[AUX]]] (@{CurrentAuxiliaryEND})}}";
|
||||
theRoll += "{{MAIN Recovery=[[@{mainReserveREC}[MAIN]]] (@{CurrentMainEND})}} ";
|
||||
theRoll += "{{AUX Recovery=[[@{auxiliaryReserveREC}[AUX]]] (@{CurrentAuxiliaryEND})}}";
|
||||
|
||||
startRoll(theRoll, (results) => {
|
||||
recoverMAIN = results.results["MAIN Recovery"].result;
|
||||
recoverAUX = results.results["AUX Recovery"].result;
|
||||
|
||||
setAttrs({
|
||||
treasures: "hello",
|
||||
CurrentMainEND: Math.max(0, Math.min(CurrentMainEND + recoverMAIN, maxPrimaryEND)),
|
||||
CurrentAuxiliaryEND: Math.max(0, Math.min(currentAuxiliaryEND + recoverAUX, maxAuxiliaryEND))
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user