Raspberry Heaven QOL, OneDice New Sheet (#4689)

* QoL improvements

Added placeholders with styling and removed crit/fail from roll template

* New Sheet: OneDice Universal

New Character Sheet for OneDice Universal.

* OneDice: Fixed Defence stat dropdown

* Translation.json fix

Removed blank strings and fixed a tag in the html.
This commit is contained in:
Stephanie Bryant
2019-02-11 17:43:47 -06:00
committed by Cassie Levett
parent 8bb4e84485
commit 1fff2bdcb5
7 changed files with 560 additions and 3 deletions
+316
View File
@@ -0,0 +1,316 @@
button[type=roll].sheet-spellroll::before {
content: 'f';
font-family:dicefontd6;
}
input[type=number].sheet-statfield {
font-size:20pt;
border-bottom:1px solid black;
height:50px;
width: 60px;
}
input[type=text], select {
border-bottom:1px solid;
border-top:0px;
border-left:0px;
border-right:0px;
}
input[type=number] {
border-bottom:1px solid;
border-top:0px;
border-left:0px;
border-right:0px;
}
input[type="text"].sheet-armor {
width:180px;
}
.sheet-armor,.sheet-armorbonus {
display:inline-block;
}
.sheet-armor {
width:180px;
}
.sheet-armorbonus {
width:40px;
}
div {
padding:2px;
font-family:Arial,sans-serif;
font-size:10pt;
}
.sheet-heading {
font-family:Candal;
font-weight:bold;
font-style:italic;
font-size:14pt;
text-align:center;
}
.sheet-label {
font-weight:bold;
font-family:Candal,sans-serif;
font-size:10pt;
}
.sheet-statlabel {
font-weight:bold;
font-style:italic;
font-family:Candal;
}
.sheet-sublabel {
font-style:italic;
font-weight:bold;
}
.sheet-descinput {
width: 90%;
height: 90%;
}
.sheet-spellname {
width:120px;
display:inline-block;
}
.sheet-spelldesc {
width:140px;
display:inline-block;
}
.sheet-spellrange {
width:45px;
display:inline-block;
}
.sheet-spelltarget {
width:50px;
display:inline-block;
}
.sheet-spelldamage {
width:40px;
display:inline-block
}
.sheet-spellroll {
width:40px;
display:inline-block;
}
.sheet-skillname {
width:180px;
display:inline-block;
}
.sheet-skillpoints {
width:50px;
display:inline-block;
}
.sheet-skillability{
width:70px;
display:inline-block;
}
.sheet-weaponname {
width:180px;
display:inline-block;
}
.sheet-weaponability {
width:70px;
display:inline-block;
}
.sheet-weaponskill {
width:70px;
display:inline-block;
}
.sheet-weapondamage {
width:100px;
display:inline-block;
}
.sheet-hideme {
display:none;
}
.sheet-equipmentname {
width:240px;
display:inline-block;
}
.sheet-equipmentlocation {
width:200px;
display:inline-block;
}
.sheet-footnote {
font-size:9pt;
color:#737373;
}
.sheet-rolltemplate-rolloutput .sheet-template-header {
font-weight:bold;
background-color:#D9A3E0;
min-height:20pt;
}
.sheet-rolltemplate-rolloutput .sheet-template-row {
background-color:#ffffff;
min-height: 14pt;
}
.sheet-rolltemplate-rolloutput .sheet-rolltemplate-container {
border: 1px solid #737373;
}
.sheet-rolltemplate-rolloutput .inlinerollresult {
background-color: #ffffff;
border: none;
font-weight:normal;
}
.sheet-rolltemplate-rolloutput .inlinerollresult.fullfail {
background-color: #ffffff;
border: none;
font-weight:normal;
}
.sheet-rolltemplate-rolloutput .inlinerollresult.fullcrit {
background-color: #ffffff;
border: none;
font-weight:normal;
}
.sheet-rolltemplate-spelloutput .sheet-template-header {
font-weight:bold;
background-color:#D9A3E0;
min-height:20pt;
}
.sheet-rolltemplate-spelloutput .sheet-template-row {
background-color:#ffffff;
min-height: 14pt;
}
.sheet-rolltemplate-spelloutput .sheet-rolltemplate-container {
border: 1px solid #737373;
}
.sheet-rolltemplate-spelloutput .inlinerollresult {
background-color: #ffffff;
border: none;
font-weight:normal;
}
.sheet-rolltemplate-spelloutput .inlinerollresult.fullfail {
background-color: #ffffff;
border: none;
font-weight:bold;
color: red;
}
.sheet-rolltemplate-spelloutput .inlinerollresult.fullcrit {
background-color: #ffffff;
border: none;
font-weight:normal;
}
.sheet-layout {
display:grid;
grid-template-columns: 32% 32% 32%;
grid-gap: 5px;
min-width:450px;
}
.sheet-layoutabilities {
grid-column-start:1;
grid-column-end:2;
background-color:#ffffff;
border: 1px solid #737373;
}
.sheet-layoutcells {
background-color:#ffffff;
border: 1px solid #737373;
grid-column-start:2;
grid-column-end:3;
}
.sheet-layoutbg {
background-color:#ffffff;
border: 1px solid #737373;
grid-column-start:3;
grid-column-end:4;
grid-row-start:1;
grid-row-end:4;
}
.sheet-layoutsan {
background-color:#ffffff;
border: 1px solid #737373;
grid-column-start:3;
grid-column-end:4;
grid-row-start:3;
grid-row-end:4;
}
.sheet-layoutmagic {
background-color:#ffffff;
border: 1px solid #737373;
grid-column-start:1;
grid-column-end:2;
}
.sheet-layoutspells {
grid-column-start:2;
grid-column-end:4;
background-color:#ffffff;
border: 1px solid #737373;
}
.sheet-layoutskills {
grid-column-start:1;
grid-column-end:3;
background-color:#ffffff;
border: 1px solid #737373;
}
.sheet-layoutweapons {
grid-column-start:1;
grid-column-end:3;
background-color:#ffffff;
border: 1px solid #737373;
}
.sheet-layoutequipment {
grid-column-start:1;
grid-column-end:3;
background-color:#ffffff;
border: 1px solid #737373;
}
.sheet-layoutextra {
grid-column-start:3;
grid-column-end:4;
grid-row-start:5;
grid-row-end:8;
background-color:#ffffff;
border: 1px solid #737373;
}
+191
View File
@@ -0,0 +1,191 @@
<div class="heading">OneDice Universal Character Sheet</div>
<span class="label" data-i18n="Name">Name</span>: <input type="text" name="attr_character_name" /> <span class="label" data-i18n="Level">Level</span>: <input type="number" name="attr_level" /> <span class="label" data-i18n="E/IP">E/IP</span>: <input type="number" name="attr_eip" /> <span class="label" data-i18n="Stunt Points">Stunt Points</span>: <input type="number" name="attr_stuntpoints" value="6" /><br /><br />
<div class="layout">
<div class="layoutabilities">
<span class="statlabel" data-i18n="Strong">Strong</span>: <input class="statfield" type="number" name="attr_strong" /> <br />
</div>
<div class="layoutcells">
<span class="statlabel" data-i18n="Health">Health</span>: <input type="number" name="attr_healthmax" value="(@{strong}*3)" disabled/><br /><br />
<span class="statlabel" data-i18n="Current">Current</span>: <input class="statfield" type="number" name="attr_healthcurrent" value="@{healthmax}" /><br />
</div>
<div class="layoutbg">
<span class="label" data-i18n="Background and Description">Background and Description</span>:</br />
<textarea class="descinput" name="attr_description"></textarea>
</div>
<div class="layoutabilities">
<span class="statlabel" data-i18n="Clever">Clever</span>: <input class="statfield" type="number" name="attr_clever" /><br />
</div>
<div class="layoutcells">
<span class="statlabel" data-i18n="Defence">Defence</span>: <input type="number" name="attr_defence" value="(@{defstat}*3)" disabled="false" /> <span class="sublabel" data-i18n="Use">Use</span>:
<select class="skillability" name="attr_defstat">
<option value='@{strong}' data-i18n="Strong">Strong</option>
<option value='@{quick}' data-i18n="Quick">Quick</option>
</select> <br />
<div class="statlabel armor" data-i18n="Armor">Armor</div> <div class="statlabel armorbonus" data-i18n="Bonus">Bonus</div><br />
<fieldset class="repeating_armor">
<input class="armor sublabel" type="text" name="attr_armortype">
<input type="number" class="armorbonus" name="attr_armorbonus" />
</fieldset><br /><br />
<span class="statlabel" data-i18n="Total Armor">Total Armor</span>:
<input class="statfield" type="number" name="attr_armortotal" value="(@{defence}+@{totalarmorbonus})" disabled /><br />
</div>
<div class="layoutabilities">
<span class="statlabel" data-i18n="Quick">Quick</span>: <input class="statfield" type="number" name="attr_quick" />
<span class="sublabel" data-i18n="Roll Initiative">Roll Initiative</span>:
<button type="roll" value='&{template:rolloutput} {{rollname=Initiative}} {{initiative=[[d6+@{quick}]]}}' class="spellroll" name="roll_initiative"></button><br />
</div>
<div class="layoutcells">
<span class="statlabel" data-i18n="Move">Move</span>: <input type="number" name="attr_move" class="statfield" value="(@{quick}*10)" disabled="true" /> <span class="text" data-i18n="meters">meters</span><br />
</div>
<div class="layoutmagic">
<span class="statlabel" data-i18n="Magic">Magic</span>: <input class="statfield" type="number" name="attr_magic" /> <br />
</div>
<div class="spells layoutspells">
<span class="statlabel" data-i18n="Spells">Spells</span>: <br />
<div class="spellname sublabel" data-i18n="Name">Name</div>
<div class="spelldesc sublabel" data-i18n="Description">Description</div>
<div class="spellrange sublabel" data-i18n="Range">Rng</div>
<div class="spelltarget sublabel" data-i18n="Target">Target</div>
<div class="spelldamage sublabel" data-i18n="Damage">Damage</div>
<div class="spellroll sublabel" data-i18n="Roll">Roll</div><br />
<fieldset class="repeating_spells">
<input class="spellname" type="text" name="attr_spellname">
<input class="spelldesc" type="text" name="attr_spelldesc" />
<input class="spellrange" type="number" name="attr_spellrange" />
<input class="spelltarget" type="text" name="attr_spelltarget" />
<input class="spelldamage" type="text" name="attr_spelldamage" />
<button class="spellroll" type='roll' name="roll_castspell" value='&{template:spelloutput} {{rollname=@{spellname}}} {{magic=[[d6+@{magic}]]}} {{spelldescoutput=@{spelldesc}}} {{damage=@{spelldamage}}} {{charname=@{character_name}}}'></button>
</fieldset>
</div>
<div class="layoutskills">
<span class="label" data-i18n="Skills">Skills</span>:<br />
<span class="skillname sublabel" data-i18n="Name">Name</span>
<span class="skillpoints sublabel" data-i18n="Points">Points</span>
<span class="skillability sublabel" data-i18n="Ability">Ability</span>
<span class="skilltotal sublabel" data-i18n="Total">Total</span><br />
<fieldset class="repeating_skill">
<input class="skillname" type="text" name="attr_skillname" />
<input class="skillpoints" type="number" name="attr_skillpoints" />
<select class="skillability" name="attr_skillstat">
<option value='@{strong}' data-i18n="Strong">Strong</option>
<option value='@{clever}' data-i18n="Clever">Clever</option>
<option value='@{quick}' data-i18n="Quick">Quick</option>
</select>
<input class="skilltotal" type="number" name="attr_skilltotal" value="@{skillpoints}+@{skillstat}" disabled="true" />
<button class="spellroll" type="roll" value='&{template:rolloutput} {{rollname=@{skillname}}} {{skill=[[1d6+@{skilltotal}]]}} {{charname=@{character_name}}}' name="roll_useskill"></button>
</fieldset>
</div>
<div class="layoutweapons">
<span class="label" data-i18n="Weapons">Weapons</span>:<br />
<span class="weaponname sublabel" data-i18n="Name">Name</span>
<span class="weaponability sublabel" data-i18n="Ability Used">Ability Used</span>
<span class="weaponskill sublabel" data-i18n="Skill Modifier">Skill</span>
<span class="weapondam sublabel" data-i18n="Damage">Damage</span><br />
<fieldset class="repeating_weapon">
<input class="weaponname" type="text" name="attr_weaponname" />
<select class="weaponability" name="attr_weaponstat">
<option value='@{strong}' data-i18n="Strong">Strong</option>
<option value='@{clever}' data-i18n="Clever">Clever</option>
<option value='@{quick}' data-i18n="Quick">Quick</option>
</select>
<input class="weaponskill" type="number" name="attr_weaponskill" />
<input type="number" name="attr_weapondamage" />
<input type="number" name="attr_totalweapon" class="hideme" value="@{weaponstat}+@{weaponskill}" disabled="true" />
<button class="spellroll" type="roll" name="roll_attack" value='&{template:rolloutput} {{rollname=@{weaponname}}} {{attack=[[1d6+@{totalweapon}]]}} {{damage=@{weapondamage}}} {{charname=@{character_name}}}'></button><br>
</fieldset><br />
*<span class="subtext" data-i18n="Manually enter the skill bonus.">Manually enter the skill bonus.</span>
</div>
<div class="layoutequipment">
<span class="label" data-i18n="Other Equipment">Other Equipment</span>:<br />
<span class="equipmentname sublabel" data-i18n="Name">Name</span><span class="equipmentlocation sublabel" data-i18n="Location">Location</span><br />
<fieldset class="repeating_equipment">
<input class="equipmentname" type="text" name="attr_equipmentname" /> <input class="equipmentlocation" type="text" name="attr_equipmentlocation" />
</fieldset>
</div>
<div class="layoutextra">
<span class="label" data-18n="Other Notes">Other Notes</span><br />
<textarea class="descinput" name="attr_otherdescription" placeholder="A good place to put rules reminders, custom rules, or other things you need to track"></textarea>
</div>
</div>
<hr>
<div class="footnote" data-i18n="OneDice is a simple universal d6 system by Cakebread & Walton, available on DriveThruRPG.">OneDice is a simple universal d6 system by Cakebread & Walton, available on DriveThruRPG.</div>
<script type="text/worker">
// Sheet Worker to Sum Armor
/* ===== PARAMETERS ==========
destination = the name of the attribute that stores the total quantity
section = name of repeating fieldset, without the repeating_
fields = the name of the attribute field to be summed
can be a single attribute: 'weight'
or an array of attributes: ['weight','number','equipped']
multiplier (optional) = a multiplier to to entire fieldset total. For instance, if summing coins of weight 0.02, might want to multiply the final total by 0.02.
*/
const repeatingSum = (destination, section, fields, multiplier = 1) => {
if (!Array.isArray(fields)) fields = [fields];
getSectionIDs(`repeating_${section}`, idArray => {
const attrArray = idArray.reduce( (m,id) => [...m, ...(fields.map(field => `repeating_${section}_${id}_${field}`))],[]);
getAttrs(attrArray, v => {
console.log("===== values of v: "+ JSON.stringify(v) +" =====");
const getValue = (section, id,field) => parseFloat(v[`repeating_${section}_${id}_${field}`], 10)||1; // default value of 1, so any faulty value inputs are ignored and the calculation still works.
const sumTotal = idArray.reduce((total, id) => total + fields.reduce((subtotal,field) => subtotal * getValue(section, id,field),1),0);
setAttrs({[destination]: sumTotal * multiplier});
});
});
};
on('change:repeating_armor remove:repeating_armor sheet:opened', function() {
repeatingSum("totalarmorbonus","armor","armorbonus");
});
</script>
<!-- Roll Template -->
<rolltemplate class="sheet-rolltemplate-rolloutput">
<div class="sheet-template-container">
<div class="sheet-template-header">{{rollname}}</div>
{{#initiative}}<div class="sheet-template-row">{{initiative}}</div>{{/initiative}}
{{#attack}}
<div class="sheet-template-row">{{charname}} <span data-i18n="attacks">attacks with a</span> {{attack}}!</div>
{{/attack}}
{{#damage}}<div class="sheet-template-row"><span data-i18n="Damage bonus">Damage bonus</span>: {{damage}} </div>{{/damage}}
{{#skill}}<div class="sheet-template-row">{{charname}} <span data-18n="uses">uses</span> {{rollname}}: {{skill}}</div> {{/skill}}
</div>
</rolltemplate>
<rolltemplate class="sheet-rolltemplate-spelloutput">
<div class="sheet-template-container">
<div class="sheet-template-header">{{rollname}}</div>
<div class="sheet-template-row">{{charname}} <span data-i18n="casts">casts</span> {{rollname}} <span data-i18n="and gets a">and gets a </span> {{magic}}</div>
{{#rollWasFumble() magic}}<div class="sheet-template-row"><span style="font-weight:bold;" data-i18n="Failed">This spell failed!</span></div>
{{/rollWasFumble() magic}}
{{#^rollWasFumble() magic}}
{{#spelldescoutput}}<div class="sheet-template-row"><span class="spelldescoutput">{{spelldescoutput}}</span></div>{{/spelldescoutput}}
{{#damage}}<div class="sheet-template-row"><span data-i18n="Damage">Damage</span>: {{damage}} </div>{{/damage}}
{{/^rollWasFumble() magic}}
</rolltemplate>
Binary file not shown.

After

Width:  |  Height:  |  Size: 74 KiB

+8
View File
@@ -0,0 +1,8 @@
{
"html": "onedice.html",
"css": "onedice.css",
"authors": "Stephanie Bryant",
"roll20userid": "314",
"preview": "onedice.png",
"instructions": "See the [the wiki](https://wiki.roll20.net/OneDice) for suggestions on setting up and running a OneDice game on Roll20. OneDice is is an easy, quick and flexible Roleplaying Game (RPG) system by Cakebread & Walton. It's available at [DriveThruRPG](https://www.drivethrurpg.com/product/208688/OneDice-Universal-Revised)"
}
+43
View File
@@ -0,0 +1,43 @@
{
"Name": "Name",
"Level": "Level",
"E/IP": "E/IP",
"Stunt Points": "Stunt Points",
"Strong": "Strong",
"Health": "Health",
"Current": "Current",
"Background and Description": "Background and Description",
"Clever": "Clever",
"Defence": "Defence",
"Use": "Use",
"Armor": "Armor",
"Bonus": "Bonus",
"Total Armor": "Total Armor",
"Quick": "Quick",
"Roll Initiative": "Roll Initiative",
"Move": "Move",
"meters": "meters",
"Magic": "Magic",
"Spells": "Spells",
"Description": "Description",
"Range": "Rng",
"Target": "Target",
"Damage": "Damage",
"Roll": "Roll",
"Skills": "Skills",
"Points": "Points",
"Ability": "Ability",
"Total": "Total",
"Weapons": "Weapons",
"Ability Used": "Ability Used",
"Skill Modifier": "Skill",
"Manually enter the skill bonus.": "Manually enter the skill bonus.",
"Other Equipment": "Other Equipment",
"Location": "Location",
"OneDice is a simple universal d6 system by Cakebread & Walton, available on DriveThruRPG.": "OneDice is a simple universal d6 system by Cakebread &amp; Walton, available on DriveThruRPG.",
"Damage bonus": "Damage bonus",
"attacks": "attacks with a",
"casts": "casts",
"and gets a": "and gets a ",
"Failed": "This spell failed!"
}
+1 -1
View File
@@ -1,5 +1,5 @@
<div class="heading">
<span data-i18n="name">Your Name</span>: <input type="text" class="name" placeholder="Character Name" value="" name="attr_character_name" /> (<input type="text" name="attr_archtype"placeholder="Archetype" value="" data-i18n="archetype" />)
<span data-i18n="name">Your Name</span>: <input type="text" class="name" placeholder="Character Name" value="" name="attr_character_name" /> (<input type="text" name="attr_archtype" placeholder="Archetype" value=""/>)
</div>
<div class="heading">
+1 -2
View File
@@ -1,9 +1,8 @@
{
"name": "Your Name",
"archtype": "Character Archetype",
"description": "Description",
"special": "Special Move",
"roll": "Roll",
"movehappens": "What Happens?",
"number": "Number"
}
}