coin conv

This commit is contained in:
Djjus
2021-02-02 01:28:51 +00:00
parent 9e486d237e
commit cc7797c1f0
3 changed files with 135 additions and 16 deletions
@@ -233,8 +233,8 @@ input[name*=check][value="1"] ~ div > .sheet-talsetshow {
input[type=checkbox][name=attr_npc-box-hide]{
outline: 1px solid #47443b;
position: absolute;
width: 12px; /*Desired width*/
height: 12px; /*Desired height*/
width: 12px; /*Desired width*/
height: 12px; /*Desired height*/
white-space: nowrap;
background-size: contain;
margin-top:4px;
@@ -252,8 +252,8 @@ input[type=checkbox][name=attr_npc-box-hide]:checked{
input[type=checkbox][name*=attr_container-minimize]{
outline: 1px solid #47443b;
position: absolute;
width: 12px; /*Desired width*/
height: 12px; /*Desired height*/
width: 12px; /*Desired width*/
height: 12px; /*Desired height*/
white-space: nowrap;
background-size: contain;
margin-top:4px;
@@ -269,6 +269,23 @@ input[type=checkbox][name*=attr_container-minimize]:checked{
/* === BUTTONS === */
button[type=action] {
position: relative;
background-color: #e3e1e1;
border: 1px solid black;
border-color: #423d32;
color: black;
background-image: linear-gradient(rgba(255,255,255,.3), rgba(255,255,255,0));
width: 16px; /*Desired width*/
height: 18px; /*Desired height*/
padding: 0px 0px 0px 0px;
font-size: 8px;
line-height: 100%;
}
button[type=action]:focus {
outline: 0 !important;
}
button[type=roll] {
background-color: var(--bgc);
border-radius: 4px;
@@ -348,7 +365,7 @@ button[type=roll].sheet-adv-button {
border-color: #b8b8b8;
text-align: center;
color: black;
font-weight:bold;
font-weight: bold;
text-shadow: none;
}
@@ -4674,6 +4691,10 @@ input[disabled].sheet-passive-skill-score {
.sheet-rolltemplate-whfrp2e .sheet-col-535 {
width: 53.5%;
}
.sheet-col-1-100,
.sheet-rolltemplate-whfrp2e .sheet-col-1-100 {
width: 1%;
}
.sheet-col-3-100,
.sheet-rolltemplate-whfrp2e .sheet-col-3-100 {
width: 3%;
@@ -4774,7 +4795,10 @@ input[disabled].sheet-passive-skill-score {
.sheet-rolltemplate-whfrp2e .sheet-col-37-100 {
width: 37%;
}
.sheet-col-1-150,
.sheet-rolltemplate-whfrp2e .sheet-col-1-150 {
width: 1.5%;
}
.sheet-col-63-200,
.sheet-rolltemplate-whfrp2e .sheet-col-63-200 {
width: 31.5%;
@@ -16919,29 +16919,41 @@
</div>
</div>
<div class="sheet-row sheet-sub-header">
<div class="sheet-col-1-7 sheet-center sheet-small-label sheet-pad-r-sm">
<div class="sheet-col-1-7 sheet-center sheet-small-label">
<span data-i18n="BRASS-PENNIES-BP">Brass Pennies (BP)</span>
</div>
<div class="sheet-col-1-7 sheet-center sheet-small-label sheet-pad-r-sm">
<div class="sheet-col-25-2 sheet-center sheet-small-label sheet-pad-r-sm">
</div>
<div class="sheet-col-25-2 sheet-center sheet-small-label sheet-pad-r-sm">
</div>
<div class="sheet-col-1-7 sheet-center sheet-small-label">
<span data-i18n="SILVER-SHILLINGS-SS">Silver Shillings (SS)</span>
</div>
<div class="sheet-col-25-2 sheet-center sheet-small-label sheet-pad-r-sm">
</div>
<div class="sheet-col-25-2 sheet-center sheet-small-label sheet-pad-r-sm">
</div>
<div class="sheet-col-1-7 sheet-center sheet-small-label sheet-pad-r-sm">
<span data-i18n="GOLD-CROWNS-GC">Gold Crowns (GC)</span>
</div>
<div class="sheet-col-1-7 sheet-center sheet-small-label sheet-pad-r-sm">
<span data-i18n="TOTAL-GC-VALUE">Total GC Value</span>
</div>
<div class="sheet-col-3-7 sheet-center sheet-small-label sheet-pad-r-sm">
<div class="sheet-col-1-3 sheet-center sheet-small-label sheet-pad-r-sm">
<span data-i18n="EXCHANGE-RATE">Exchange Rate</span>
</div>
</div>
<div class="sheet-row sheet-mar-b-md">
<div class="sheet-col-1-7 sheet-pad-r-sm" title="Brass Pennies"><input type="number" name="attr_bp" value="0" /></div>
<div class="sheet-col-1-7 sheet-pad-r-sm" title="Silver Shillings"><input type="number" name="attr_ss" value="0" /></div>
<div class="sheet-col-1-7 sheet-pad-r-sm" title="Gold Crowns"><input type="number" name="attr_gc" value="0" /></div>
<div class="sheet-col-1-7 sheet-pad-r-lg" title="Total (in Gold Crowns)"><input type="number" name="attr_money_total_gc" value="round(((@{BP} / 240) + (@{SS} / 20) + @{GC})*1000)/1000" disabled="true" /></div>
<div class="sheet-col-3-7 sheet-pad-t-sm sheet-pad-r-sm">
<span data-i18n="EXCHANGE-RATE-DESCRIPTION">240 brass pennies = 20 silver shilling = 1 gold crown</span>
<div class="sheet-col-1-7"><input type="number" name="attr_bp" value="0" /></div>
<div class="sheet-col-25-2 sheet-pad-r-sm" data-i18n-title="SILVER-TO-BRASS" title="Silver to Brass"><button type="action" name="act_sstobp" ><span><</span></button></div>
<div class="sheet-col-25-2 sheet-pad-r-sm" data-i18n-title="BRASS-TO-SILVER" title="Brass to Silver"><button type="action" name="act_bptoss" ><span>></span></button></div>
<div class="sheet-col-1-7"><input type="number" name="attr_ss" value="0" /></div>
<div class="sheet-col-25-2 sheet-pad-r-sm" data-i18n-title="GOLD-TO-SILVER" title="Gold to Silver"><button type="action" name="act_gctoss" ><span><</span></button></div>
<div class="sheet-col-25-2 sheet-pad-r-sm" data-i18n-title="SILVER-TO-GOLD" title="Silver to Gold"><button type="action" name="act_sstogc" ><span>></span></button></div>
<div class="sheet-col-1-7 sheet-pad-r-sm"><input type="number" name="attr_gc" value="0" /></div>
<div class="sheet-col-1-7 sheet-pad-r-sm"><input type="number" name="attr_money_total_gc" value="round(((@{BP} / 240) + (@{SS} / 20) + @{GC})*1000)/1000" disabled="true" /></div>
<div class="sheet-col-1-3 sheet-pad-t-sm sheet-pad-r-sm sheet-center">
<span style="font-size: 11px" data-i18n="EXCHANGE-RATE-DESCRIPTION">240 brass pennies = 20 silver shilling = 1 gold crown</span>
</div>
</div>
<!-- ENCUMBRANCE -->
@@ -26017,7 +26029,86 @@ on('change:repeating_advancements', function(){
});
});
on("clicked:gctoss", function() {
getAttrs(['gc', 'ss'], function(values) {
const currgc = +values.gc || 0;
const currss = +values.ss || 0;
let newgc = currgc;
let newss = currss;
if(values.gc > 0) {
newgc -=1;
newss +=20;
}
setAttrs({
gc: newgc,
ss: newss
});
});
});
on("clicked:sstogc", function() {
getAttrs(['gc', 'ss'], function(values) {
const currgc = +values.gc || 0;
const currss = +values.ss || 0;
let newgc = currgc;
let newss = currss;
if(values.ss > 19) {
newgc +=1;
newss -=20;
}
setAttrs({
gc: newgc,
ss: newss
});
});
});
on("clicked:bptoss", function() {
getAttrs(['bp', 'ss'], function(values) {
const currbp = +values.bp || 0;
const currss = +values.ss || 0;
let newbp = currbp;
let newss = currss;
if(values.bp > 11) {
newbp -=12;
newss +=1;
}
setAttrs({
bp: newbp,
ss: newss
});
});
});
on("clicked:sstobp", function() {
getAttrs(['bp', 'ss'], function(values) {
const currbp = +values.bp || 0;
const currss = +values.ss || 0;
let newbp = currbp;
let newss = currss;
if(values.ss > 0) {
newbp +=12;
newss -=1;
}
setAttrs({
bp: newbp,
ss: newss
});
});
});
/* STAT MODIFIERS
This sheet worker loop calculates the values of all the 10 core attributes from their constituent parts, and their modifiers.
TotalWounds was dependent on a bunch of stats that were autocalc, so they needed to be replaced with sheet workers for it to work.
@@ -1145,5 +1145,9 @@
"OVERBURDENED-PENALTY2": "-2 movement, -20 Agi (Min 10)",
"SPELL-ADVANTAGE": "Spell Advantage no/off (for custom houserules)",
"SPELL-ADVANTAGE-ON": "On - Advantage for arcane spell casting is enabled -- *Core Book Default*",
"SPELL-ADVANTAGE-OFF": "Off - Advantage for arcane spell casting is disabled."
"SPELL-ADVANTAGE-OFF": "Off - Advantage for arcane spell casting is disabled.",
"BRASS-TO-SILVER": "Change 12 Brass to 1 Silver",
"SILVER-TO-BRASS": "Change 1 Silver to 12 Brass",
"SILVER-TO-GOLD": "Change 20 Silver to 1 Gold",
"GOLD-TO-SILVER": "Change 1 Gold to 20 Silver"
}