mirror of
https://github.com/Nighthawk42/roll20-character-sheets.git
synced 2026-08-30 03:40:32 +00:00
Adding computation of roll result, small design additions
This commit is contained in:
+19
-4
@@ -52,11 +52,26 @@
|
||||
}
|
||||
|
||||
.sheet-rolltemplate-standard .sheet-rolltemplate-item-left {
|
||||
width: 90%;
|
||||
width: 80%;
|
||||
}
|
||||
|
||||
.sheet-rolltemplate-standard .sheet-rolltemplate-item-right {
|
||||
width: 10%;
|
||||
width: 20%;
|
||||
}
|
||||
|
||||
.sheet-rolltemplate-standard .rolltemplate-item-centered {
|
||||
width: 100%;
|
||||
font-weight: bold;
|
||||
}
|
||||
|
||||
.sheet-rolltemplate-standard .sheet-green {
|
||||
color: green;
|
||||
margin: 0 auto;
|
||||
}
|
||||
|
||||
.sheet-rolltemplate-standard .sheet-red {
|
||||
color: red;
|
||||
margin: 0 auto;
|
||||
}
|
||||
|
||||
.holder .curved-border {
|
||||
@@ -64,7 +79,7 @@
|
||||
border-radius: 5px;
|
||||
}
|
||||
|
||||
.holder button[type=roll].sheet-d6-dice::before {
|
||||
.holder button.sheet-d6-dice::before {
|
||||
font-family: 'dicefontd6';
|
||||
content: 'F ';
|
||||
}
|
||||
@@ -192,4 +207,4 @@ button {
|
||||
.holder .copyright {
|
||||
grid-column: 2 / 3;
|
||||
grid-row: 30 / 31;
|
||||
}
|
||||
}
|
||||
+163
-123
@@ -1,136 +1,176 @@
|
||||
<div class="holder">
|
||||
<span class="title">RATTEN!</span>
|
||||
<span class="author">Charakterbogen © Loki</span>
|
||||
<div class="basics curved-border">
|
||||
<span>Name:</span> <input type="text" name="attr_character_name" class="header-input" placeholder="Name">
|
||||
<span>Rotte:</span> <input type="text" name="attr_rotte" class="header-input" placeholder="Rotte">
|
||||
<span>Ich:</span> <input type="text" name="attr_rotte" class="header-input" placeholder="Ich">
|
||||
<span class="title">RATTEN!</span>
|
||||
<span class="author">Charakterbogen © Loki</span>
|
||||
<div class="basics curved-border">
|
||||
<span>Name:</span> <input type="text" name="attr_character_name" class="header-input" placeholder="Name">
|
||||
<span>Rotte:</span> <input type="text" name="attr_rotte" class="header-input" placeholder="Rotte">
|
||||
<span>Ich:</span> <input type="text" name="attr_rotte" class="header-input" placeholder="Ich">
|
||||
</div>
|
||||
<div class="small-title">
|
||||
<span class="big-font">EIGENSCHAFTEN</span>
|
||||
</div>
|
||||
<div class="clever">
|
||||
<span>Clever</span> <input type="number" name="attr_clever" value=1> <button type="action" name="act_clever" title="Clever-Wert zum Würfelpool hinzufügen">+</button>
|
||||
</div>
|
||||
<div class="sozial">
|
||||
<span>Sozial</span> <input type="number" name="attr_sozial" value=1> <button type="action" name="act_sozial" title="Sozial-Wert zum Würfelpool hinzufügen">+</button>
|
||||
</div>
|
||||
<div class="stark">
|
||||
<span>Stark</span> <input type="number" name="attr_stark" value=1> <button type="action" name="act_stark" title="Stark-Wert zum Würfelpool hinzufügen">+</button>
|
||||
</div>
|
||||
<div class="schnell">
|
||||
<span>Schnell</span> <input type="number" name="attr_schnell" value=1> <button type="action" name="act_schnell" title="Schnell-Wert zum Würfelpool hinzufügen">+</button>
|
||||
</div>
|
||||
<div class="zaeh">
|
||||
<span>Zäh</span> <input type="number" name="attr_zaeh" value=1> <button type="action" name="act_zaeh" title="Zäh-Wert zum Würfelpool hinzufügen">+</button>
|
||||
</div>
|
||||
<div class="wuerfelpool curved-border">
|
||||
<span class="middle-font">Würfelpool:</span> <input type="text" name="attr_wuerfelpool" placeholder="0"> <button type="action" name="act_delete" class="delete" title="Würfelpool zurücksetzen">X</button> <button type="action" name="act_rolldice" class="sheet-d6-dice"></button> <!--<button type="roll" title="Würfeln" value="&{template:standard} {{name=Prüfung: @{character_name}}} {{Probe=[[@{wuerfelpool}d6k2cs>6cf<1]]}} {{Schwierigkeit=?{Schwierigkeit|4}}}" class="sheet-d6-dice" name="roll_pruefung" ></button> -->
|
||||
</div>
|
||||
<div class="talente-schrift">
|
||||
<span class="big-font">TALENTE</span>
|
||||
</div>
|
||||
<div class="talente">
|
||||
<fieldset class="repeating_talente">
|
||||
<input type="text" placeholder="Talentname"></input>
|
||||
</fieldset>
|
||||
</div>
|
||||
<div class="tricks-schrift">
|
||||
<span class="big-font">TRICKS</span>
|
||||
</div>
|
||||
<div class="tricks">
|
||||
<fieldset class="repeating_tricks">
|
||||
<input type="text" placeholder="Trick"></input>
|
||||
</fieldset>
|
||||
</div>
|
||||
<div class="lieder-schrift">
|
||||
<span class="big-font">LIEDER</span>
|
||||
</div>
|
||||
<div class="lieder">
|
||||
<fieldset class="repeating_lieder">
|
||||
<input type="text" class="sechzig" placeholder="Lied"></input>
|
||||
<select name="attr_kategorie" class="dreissig">
|
||||
<option value="fang">Fang</option>
|
||||
<option value="auge">Auge</option>
|
||||
<option value="herz">Herz</option>
|
||||
</select>
|
||||
</fieldset>
|
||||
</div>
|
||||
<div class="rotten-schrift">
|
||||
<span class="big-font">ROTTENVOR- UND NACHTEILE</span>
|
||||
</div>
|
||||
<div class="rotten">
|
||||
<fieldset class="repeating_rottenvorundnachteile">
|
||||
<input type="text" placeholder="Rottenvor-/Nachteil"></input>
|
||||
</fieldset>
|
||||
</div>
|
||||
<div class="copyright">
|
||||
<span class="author">RATTEN! © Prometheus Verlag</span>
|
||||
</div>
|
||||
</div>
|
||||
<div class="small-title">
|
||||
<span class="big-font">EIGENSCHAFTEN</span>
|
||||
</div>
|
||||
<div class="clever">
|
||||
<span>Clever</span> <input type="number" name="attr_clever" value=1> <button type="action" name="act_clever" title="Clever-Wert zum Würfelpool hinzufügen">+</button>
|
||||
</div>
|
||||
<div class="sozial">
|
||||
<span>Sozial</span> <input type="number" name="attr_sozial" value=1> <button type="action" name="act_sozial" title="Sozial-Wert zum Würfelpool hinzufügen">+</button>
|
||||
</div>
|
||||
<div class="stark">
|
||||
<span>Stark</span> <input type="number" name="attr_stark" value=1> <button type="action" name="act_stark" title="Stark-Wert zum Würfelpool hinzufügen">+</button>
|
||||
</div>
|
||||
<div class="schnell">
|
||||
<span>Schnell</span> <input type="number" name="attr_schnell" value=1> <button type="action" name="act_schnell" title="Schnell-Wert zum Würfelpool hinzufügen">+</button>
|
||||
</div>
|
||||
<div class="zaeh">
|
||||
<span>Zäh</span> <input type="number" name="attr_zaeh" value=1> <button type="action" name="act_zaeh" title="Zäh-Wert zum Würfelpool hinzufügen">+</button>
|
||||
</div>
|
||||
<div class="wuerfelpool curved-border">
|
||||
<span class="middle-font">Würfelpool:</span> <input type="text" name="attr_wuerfelpool" placeholder="0"> <button type="action" name="act_delete" class="delete" title="Würfelpool zurücksetzen">X</button> <button type="roll" title="Würfeln" value="&{template:standard} {{name=Prüfung: @{character_name}}} {{Probe=[[@{wuerfelpool}d6k2cs>6cf<1]]}} {{Schwierigkeit=?{Schwierigkeit|4}}}" class="sheet-d6-dice" name="roll_pruefung" ></button>
|
||||
</div>
|
||||
<div class="talente-schrift">
|
||||
<span class="big-font">TALENTE</span>
|
||||
</div>
|
||||
<div class="talente">
|
||||
<fieldset class="repeating_talente">
|
||||
<input type="text" placeholder="Talentname"></input>
|
||||
</fieldset>
|
||||
</div>
|
||||
<div class="tricks-schrift">
|
||||
<span class="big-font">TRICKS</span>
|
||||
</div>
|
||||
<div class="tricks">
|
||||
<fieldset class="repeating_tricks">
|
||||
<input type="text" placeholder="Trick"></input>
|
||||
</fieldset>
|
||||
</div>
|
||||
<div class="lieder-schrift">
|
||||
<span class="big-font">LIEDER</span>
|
||||
</div>
|
||||
<div class="lieder">
|
||||
<fieldset class="repeating_lieder">
|
||||
<input type="text" class="sechzig" placeholder="Lied"></input>
|
||||
<select name="attr_kategorie" class="dreissig">
|
||||
<option value="fang">Fang</option>
|
||||
<option value="auge">Auge</option>
|
||||
<option value="herz">Herz</option>
|
||||
</select>
|
||||
</fieldset>
|
||||
</div>
|
||||
<div class="rotten-schrift">
|
||||
<span class="big-font">ROTTENVOR- UND NACHTEILE</span>
|
||||
</div>
|
||||
<div class="rotten">
|
||||
<fieldset class="repeating_rottenvorundnachteile">
|
||||
<input type="text" placeholder="Rottenvor-/Nachteil"></input>
|
||||
</fieldset>
|
||||
</div>
|
||||
<div class="copyright">
|
||||
<span class="author">RATTEN! © Prometheus Verlag</span>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- Rolltemplates -->
|
||||
<!-- Rolltemplates -->
|
||||
|
||||
<rolltemplate class="sheet-rolltemplate-standard">
|
||||
<div class="sheet-template-container">
|
||||
<div class="sheet-template-header">{{name}}</div>
|
||||
<div class="spacer"> </div>
|
||||
<div class="sheet-template-row">
|
||||
<div class="sheet-rolltemplate-item-left">Probe:</div>
|
||||
<div class="sheet-rolltemplate-item-right">{{Probe}}</div>
|
||||
<div class="sheet-template-container">
|
||||
<div class="sheet-template-header">{{name}}</div>
|
||||
<div class="spacer"> </div>
|
||||
<div class="sheet-template-row">
|
||||
<div class="sheet-rolltemplate-item-left">Probe:</div>
|
||||
<div class="sheet-rolltemplate-item-right">{{Probe}}</div>
|
||||
</div>
|
||||
<div class="sheet-template-row">
|
||||
<div class="sheet-rolltemplate-item-left">Schwierigkeit:</div>
|
||||
<div class="sheet-rolltemplate-item-right">{{Schwierigkeit}}</div>
|
||||
</div>
|
||||
{{#rollBetween() computed::Gluecksgriff 1 1}}
|
||||
<div class="spacer"> </div>
|
||||
<div class="sheet-template-row">
|
||||
<div class="sheet-rolltemplate-item-centered green">Glücksgriff!</div>
|
||||
</div>
|
||||
{{/rollBetween() computed::Gluecksgriff 1 1}}
|
||||
{{#rollBetween() computed::Patzer 1 1}}
|
||||
<div class="spacer"> </div>
|
||||
<div class="sheet-template-row">
|
||||
<div class="sheet-rolltemplate-item-centered red">Patzer!</div>
|
||||
</div>
|
||||
{{/rollBetween() computed::Patzer 1 1}}
|
||||
</div>
|
||||
<div class="sheet-template-row">
|
||||
<div class="sheet-rolltemplate-item-left">Schwierigkeit:</div>
|
||||
<div class="sheet-rolltemplate-item-right">{{Schwierigkeit}}</div>
|
||||
</div>
|
||||
</div>
|
||||
</rolltemplate>
|
||||
|
||||
<!-- Sheetworker scripts -->
|
||||
<!-- Sheetworker scripts -->
|
||||
|
||||
<script type="text/worker">
|
||||
on("clicked:clever", function() {
|
||||
getAttrs(["clever"], function(values) {
|
||||
calculateDicepool(values.clever);
|
||||
});
|
||||
});
|
||||
|
||||
on("clicked:sozial", function() {
|
||||
getAttrs(["sozial"], function(values) {
|
||||
calculateDicepool(values.sozial);
|
||||
});
|
||||
});
|
||||
|
||||
on("clicked:stark", function() {
|
||||
getAttrs(["stark"], function(values) {
|
||||
calculateDicepool(values.stark);
|
||||
});
|
||||
});
|
||||
|
||||
on("clicked:schnell", function() {
|
||||
getAttrs(["schnell"], function(values) {
|
||||
calculateDicepool(values.schnell);
|
||||
});
|
||||
});
|
||||
|
||||
on("clicked:zaeh", function() {
|
||||
getAttrs(["zaeh"], function(values) {
|
||||
calculateDicepool(values.zaeh);
|
||||
});
|
||||
});
|
||||
|
||||
on("clicked:delete", function() {
|
||||
setAttrs({
|
||||
wuerfelpool: 0
|
||||
});
|
||||
});
|
||||
|
||||
function calculateDicepool(value) {
|
||||
getAttrs(["wuerfelpool"], function(values) {
|
||||
setAttrs({
|
||||
wuerfelpool: (+values.wuerfelpool + +value)
|
||||
on('clicked:rolldice', (info) => {
|
||||
startRoll("&{template:standard} {{name=Prüfung: @{character_name}}} {{Probe=[[@{wuerfelpool}d6k2]]}} {{Gluecksgriff=[[0]]}} {{Patzer=[[0]]}} {{Schwierigkeit=?{Schwierigkeit|4}}}", (results) => {
|
||||
let total = results.results.Probe.result;
|
||||
let dice = results.results.Probe.dice;
|
||||
let computed_g = 0;
|
||||
let computed_p = 0;
|
||||
let einsen = dice.filter(die => die == 1);
|
||||
let sechsen = dice.filter(die => die == 6);
|
||||
|
||||
if (einsen.length >= Math.ceil(dice.length / 2)) {
|
||||
computed_p = 1;
|
||||
}
|
||||
|
||||
if (sechsen.length >= 2) {
|
||||
computed_g = 1;
|
||||
}
|
||||
|
||||
finishRoll(
|
||||
results.rollId,
|
||||
{
|
||||
Gluecksgriff: computed_g,
|
||||
Patzer: computed_p,
|
||||
}
|
||||
);
|
||||
});
|
||||
});
|
||||
});
|
||||
|
||||
}
|
||||
</script>
|
||||
on("clicked:clever", function() {
|
||||
getAttrs(["clever"], function(values) {
|
||||
calculateDicepool(values.clever);
|
||||
});
|
||||
});
|
||||
|
||||
on("clicked:sozial", function() {
|
||||
getAttrs(["sozial"], function(values) {
|
||||
calculateDicepool(values.sozial);
|
||||
});
|
||||
});
|
||||
|
||||
on("clicked:stark", function() {
|
||||
getAttrs(["stark"], function(values) {
|
||||
calculateDicepool(values.stark);
|
||||
});
|
||||
});
|
||||
|
||||
on("clicked:schnell", function() {
|
||||
getAttrs(["schnell"], function(values) {
|
||||
calculateDicepool(values.schnell);
|
||||
});
|
||||
});
|
||||
|
||||
on("clicked:zaeh", function() {
|
||||
getAttrs(["zaeh"], function(values) {
|
||||
calculateDicepool(values.zaeh);
|
||||
});
|
||||
});
|
||||
|
||||
on("clicked:delete", function() {
|
||||
setAttrs({
|
||||
wuerfelpool: 0
|
||||
});
|
||||
});
|
||||
|
||||
function calculateDicepool(value) {
|
||||
getAttrs(["wuerfelpool"], function(values) {
|
||||
setAttrs({
|
||||
wuerfelpool: (+values.wuerfelpool + +value)
|
||||
});
|
||||
});
|
||||
|
||||
}
|
||||
</script>
|
||||
Reference in New Issue
Block a user