319 lines
14 KiB
HTML
319 lines
14 KiB
HTML
<div class="centered">
|
|
<button type="action" name="act_roll">Roll!</button>
|
|
<input class="edit" type="checkbox" name="attr_edit"/>
|
|
|
|
<div class="columns">
|
|
<div class="column_left">
|
|
<div class="nickname border">
|
|
<input type="text" name="attr_nickname" placeholder="Nickname" />
|
|
</div>
|
|
|
|
<h3>Description</h3>
|
|
<textarea class="description border" name="attr_description"></textarea>
|
|
|
|
<h3>Trademarks</h3>
|
|
<ul class="trademarks border">
|
|
<li class="trademark_name">
|
|
<input type="text" name="attr_trademark_1"/>
|
|
</li>
|
|
<li class="edges">
|
|
<input type="text" name="attr_edge_1_1"/>
|
|
</li>
|
|
<li class="edges">
|
|
<input type="text" name="attr_edge_1_2"/>
|
|
</li>
|
|
<li class="edges">
|
|
<input type="text" name="attr_edge_1_3"/>
|
|
</li>
|
|
<li class="edges">
|
|
<input type="text" name="attr_edge_1_4"/>
|
|
</li>
|
|
<li class="edges">
|
|
<input type="text" name="attr_edge_1_5"/>
|
|
</li>
|
|
</ul>
|
|
<ul class="trademarks border">
|
|
<li class="trademark_name">
|
|
<input type="text" name="attr_trademark_2"/>
|
|
</li>
|
|
<li class="edges">
|
|
<input type="text" name="attr_edge_2_1"/>
|
|
</li>
|
|
<li class="edges">
|
|
<input type="text" name="attr_edge_2_2"/>
|
|
</li>
|
|
<li class="edges">
|
|
<input type="text" name="attr_edge_2_3"/>
|
|
</li>
|
|
<li class="edges">
|
|
<input type="text" name="attr_edge_2_4"/>
|
|
</li>
|
|
<li class="edges">
|
|
<input type="text" name="attr_edge_2_5"/>
|
|
</li>
|
|
</ul>
|
|
<ul class="trademarks border">
|
|
<li class="trademark_name">
|
|
<input type="text" name="attr_trademark_3"/>
|
|
</li>
|
|
<li class="edges">
|
|
<input type="text" name="attr_edge_3_1"/>
|
|
</li>
|
|
<li class="edges">
|
|
<input type="text" name="attr_edge_3_2"/>
|
|
</li>
|
|
<li class="edges">
|
|
<input type="text" name="attr_edge_3_3"/>
|
|
</li>
|
|
<li class="edges">
|
|
<input type="text" name="attr_edge_3_4"/>
|
|
</li>
|
|
<li class="edges">
|
|
<input type="text" name="attr_edge_3_5"/>
|
|
</li>
|
|
</ul>
|
|
<ul class="trademarks border">
|
|
<li class="trademark_name">
|
|
<input type="text" name="attr_trademark_4"/>
|
|
</li>
|
|
<li class="edges">
|
|
<input type="text" name="attr_edge_4_1"/>
|
|
</li>
|
|
<li class="edges">
|
|
<input type="text" name="attr_edge_4_2"/>
|
|
</li>
|
|
<li class="edges">
|
|
<input type="text" name="attr_edge_4_3"/>
|
|
</li>
|
|
<li class="edges">
|
|
<input type="text" name="attr_edge_4_4"/>
|
|
</li>
|
|
<li class="edges">
|
|
<input type="text" name="attr_edge_4_5"/>
|
|
</li>
|
|
</ul>
|
|
<ul class="trademarks border">
|
|
<li class="trademark_name">
|
|
<input type="text" name="attr_trademark_5"/>
|
|
</li>
|
|
<li class="edges">
|
|
<input type="text" name="attr_edge_5_1"/>
|
|
</li>
|
|
<li class="edges">
|
|
<input type="text" name="attr_edge_5_2"/>
|
|
</li>
|
|
<li class="edges">
|
|
<input type="text" name="attr_edge_5_3"/>
|
|
</li>
|
|
<li class="edges">
|
|
<input type="text" name="attr_edge_5_4"/>
|
|
</li>
|
|
<li class="edges">
|
|
<input type="text" name="attr_edge_5_5"/>
|
|
</li>
|
|
</ul>
|
|
</div>
|
|
|
|
<div class="column_right">
|
|
<div class="image">
|
|
<h1>NEON CITY</h1>
|
|
<h2>OVERDRIVE</h2>
|
|
</div>
|
|
<h3>Hits</h3>
|
|
<div class="hits">
|
|
<input type="checkbox" name="attr_hit_1"/>
|
|
<input type="checkbox" name="attr_hit_2"/>
|
|
<input type="checkbox" name="attr_hit_3"/>
|
|
<input type="checkbox" name="attr_hit_4"/>
|
|
</div>
|
|
<h3>Conditions</h3>
|
|
<div class="conditions">
|
|
<div>
|
|
<span><input type="checkbox" name="attr_angry"/><span>Angry</span></span>
|
|
<span><input type="checkbox" name="attr_dazed"/><span>Dazed</span></span>
|
|
<span><input type="checkbox" name="attr_exhausted"/><span>Exhausted</span></span>
|
|
</div>
|
|
<div>
|
|
<span><input type="checkbox" name="attr_scared"/><span>Scared</span></span>
|
|
<span><input type="checkbox" name="attr_restrained"/><span>Restrained</span></span>
|
|
<span><input type="checkbox" name="attr_weakened"/><span>Weakened</span></span>
|
|
</div>
|
|
<div class="free">
|
|
<span>
|
|
<input type="checkbox" name="attr_free_conditon_1"/>
|
|
<input type="text" name="attr_free_conditon_text_1"/>
|
|
</span>
|
|
</div>
|
|
<div class="free">
|
|
<span>
|
|
<input type="checkbox" name="attr_free_conditon_2"/>
|
|
<input type="text" name="attr_free_conditon_text_2"/>
|
|
</span>
|
|
</div>
|
|
</div>
|
|
<h3>Traumas</h3>
|
|
<ul class="traumas">
|
|
<li><i class="minus"></i><input type="text" name="attr_trauma1"/></li>
|
|
<li><i class="minus"></i><input type="text" name="attr_trauma2"/></li>
|
|
<li><i class="minus"></i><input type="text" name="attr_trauma3"/></li>
|
|
<li><i class="minus"></i><input type="text" name="attr_trauma4"/></li>
|
|
</ul>
|
|
<h3>Flaws</h3>
|
|
<ul class="flaws">
|
|
<li><i class="minus"></i><input type="text" name="attr_flaw1"/></li>
|
|
<li><i class="minus"></i><input type="text" name="attr_flaw1"/></li>
|
|
</ul>
|
|
<div class="stunts border">
|
|
<span>
|
|
<h3>Stunt Points</h3>
|
|
</span>
|
|
<span>
|
|
<input type="number" name="attr_stunt_base" min="0" max="3"> /
|
|
</span>
|
|
<span>
|
|
<input type="number" name="attr_stunt_current" min="0" max="3">
|
|
</span>
|
|
</div>
|
|
<h3 class="gears_h3">Gears</h3>
|
|
<i>Basic</i>
|
|
<textarea class="gears border" name="attr_basicGears"></textarea>
|
|
<i>Special</i>
|
|
<textarea class="gears border" name="attr_specialGears"></textarea>
|
|
<h3>Experience Points</h3>
|
|
<div class="experience">
|
|
<div class="center">
|
|
<input type="checkbox" name="attr_xp_1"/>
|
|
<input type="checkbox" name="attr_xp_2"/>
|
|
<input type="checkbox" name="attr_xp_3"/>
|
|
<input type="checkbox" name="attr_xp_4"/>
|
|
<input type="checkbox" name="attr_xp_5"/>
|
|
|
|
|
<input type="checkbox" name="attr_xp_6"/>
|
|
<input type="checkbox" name="attr_xp_7"/>
|
|
<input type="checkbox" name="attr_xp_8"/>
|
|
<input type="checkbox" name="attr_xp_9"/>
|
|
<input type="checkbox" name="attr_xp_10"/>
|
|
|
|
|
<input type="checkbox" name="attr_xp_11"/>
|
|
<input type="checkbox" name="attr_xp_12"/>
|
|
<input type="checkbox" name="attr_xp_13"/>
|
|
<input type="checkbox" name="attr_xp_14"/>
|
|
<input type="checkbox" name="attr_xp_15"/>
|
|
</div>
|
|
</div>
|
|
<h3>Drive</h3>
|
|
<div class="drive border">
|
|
<input type="text" name="attr_drive"/>
|
|
<div class="center">
|
|
<input type="checkbox" name="attr_drive_1"/>
|
|
<input type="checkbox" name="attr_drive_2"/>
|
|
<input type="checkbox" name="attr_drive_3"/>
|
|
<input type="checkbox" name="attr_drive_4"/>
|
|
<input type="checkbox" name="attr_drive_5"/>
|
|
<input type="checkbox" name="attr_drive_6"/>
|
|
<input type="checkbox" name="attr_drive_7"/>
|
|
<input type="checkbox" name="attr_drive_8"/>
|
|
<input type="checkbox" name="attr_drive_9"/>
|
|
<input type="checkbox" name="attr_drive_10"/>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
|
|
<rolltemplate class="sheet-rolltemplate-roll">
|
|
<div class="sheet-template-container">
|
|
<div class="resultat">
|
|
<h3>{{name}}</h3>
|
|
<div class="results">
|
|
<h4>Action dices = {{action}}</h4>
|
|
<h4>Danger dices = {{danger}}</h4>
|
|
<h4>Result = {{computed::roll1}}
|
|
{{#rollGreater() computed::roll1 6}}Success & Bounces{{/rollGreater() computed::roll1 6}}
|
|
{{#rollTotal() computed::roll1 6}}Success !!{{/rollTotal() computed::roll1 6}}
|
|
{{#rollBetween() computed::roll1 4 5}}Partial Success{{/rollBetween() computed::roll1 4 5}}
|
|
{{#rollBetween() computed::roll1 2 3}}Failed...{{/rollBetween() computed::roll1 2 3}}
|
|
{{#rollLess() computed::roll1 2}}Botch !!!{{/rollLess() computed::roll1 2}}
|
|
</h4>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</rolltemplate>
|
|
|
|
<script type="text/worker">
|
|
on('clicked:roll', (info) => {
|
|
startRoll("&{template:roll} {{name=@{character_name} Roll}} {{roll1=[[?{Action dices|1|2|3|4|5|6|7|8|9|10}d6+?{Danger dices|0|1|2|3|4|5|6|7|8|9|10}d6]]}} {{action=?{Action dices|1|2|3|4|5|6|7|8|9|10}}} {{danger=?{Danger dices|0|1|2|3|4|5|6|7|8|9|10}}}", (results) => {
|
|
console.log(results);
|
|
console.log(results.results.roll1.rolls[0].results);
|
|
|
|
var actions = results.results.roll1.rolls[0].results;
|
|
var banes = 0;
|
|
|
|
if (results.results.roll1.rolls.length > 1 ) {
|
|
banes = results.results.roll1.rolls[1].results;
|
|
banes.forEach(formatResult);
|
|
}
|
|
|
|
const actionDices = actions.length;
|
|
const baneDices = banes.length
|
|
|
|
var result;
|
|
var bounce = 0;
|
|
var message = 'Action dices : ' + actions.length + '\n';
|
|
message += 'Danger dices : ' + banes.length + '\n\n';
|
|
|
|
console.log(actions);
|
|
if (actions.length > 0) {
|
|
result = max(actions);
|
|
} else {
|
|
result = 0;
|
|
}
|
|
|
|
if (result > 1) {
|
|
if (result > 3) message += result + ' : Partial Success.'
|
|
else message += result + ' : Failed...';
|
|
} else {
|
|
message += result + ' : BOTCH !!!';
|
|
}
|
|
if (result == 6){
|
|
let count = 0;
|
|
for (let i = 0; i < actions.length; ++i) {
|
|
if (actions[i] == 6)
|
|
count++;
|
|
}
|
|
bounce = count - 1;
|
|
if (bounce > 0) {
|
|
message += result + ' : Success \nwith ' +bounce+ ' bounce(s) !';
|
|
} else {
|
|
message += result + ' : Success !';
|
|
}
|
|
}
|
|
|
|
function formatResult(item) {
|
|
if(actions.indexOf(item) != -1) {
|
|
actions.splice(actions.indexOf(item), 1);
|
|
}
|
|
}
|
|
|
|
function max(arr){
|
|
var max = arr[0];
|
|
for(var i=1; i<arr.length; i++){
|
|
if(arr[i] > max){
|
|
max = arr[i];
|
|
}
|
|
}
|
|
return max;
|
|
}
|
|
|
|
const computed = result + bounce;
|
|
|
|
finishRoll(
|
|
results.rollId,
|
|
{
|
|
roll1: computed,
|
|
}
|
|
);
|
|
});
|
|
});
|
|
</script>
|