mirror of
https://github.com/Nighthawk42/roll20-character-sheets.git
synced 2026-08-30 19:52:29 +00:00
679 lines
32 KiB
HTML
679 lines
32 KiB
HTML
<div class="wrapper">
|
|
<input type="hidden" class="tabstoggle" name="attr_sheetTab" value="pilot"/>
|
|
<div>
|
|
<button type="action" name="act_pilot" class="tabs">Character</button>
|
|
<button type="action" name="act_info" class="tabs">Info</button>
|
|
<button type="action" name="act_inv" class="tabs">Inventory</button>
|
|
<button type="action" name="act_grim" class="tabs">Spells</button>
|
|
</div>
|
|
<div class="info">
|
|
<h2>Information</h2>
|
|
<div class="grid">
|
|
<div class="col">
|
|
<label>Name </label>
|
|
<input class="colInput" type="text" name="attr_character_name">
|
|
</div>
|
|
<div class="col">
|
|
<label>Race </label>
|
|
<input class="colInput" type="text" name="attr_race">
|
|
</div>
|
|
<div class="col">
|
|
<label>Class </label>
|
|
<input class="colInput" type="text" name="attr_class">
|
|
</div>
|
|
<div class="col">
|
|
<label>City of Origin </label>
|
|
<input class="colInput" type="text" name="attr_coo">
|
|
</div>
|
|
<div class="col">
|
|
<label>Age </label>
|
|
<input class="colInput" type="text" name="attr_age">
|
|
</div>
|
|
<div class="col">
|
|
<label>Height </label>
|
|
<input class="colInput" type="text" name="attr_height">
|
|
</div>
|
|
<div class="col">
|
|
<label>Weight </label>
|
|
<input class="colInput" type="text" name="attr_weight">
|
|
</div>
|
|
<div class="col">
|
|
<label>Language </label>
|
|
<input class="colInput" type="text" name="attr_lang">
|
|
</div>
|
|
<div class="col">
|
|
<label>Notes </label>
|
|
<textarea class="colInput" name="attr_notes">
|
|
</div>
|
|
</div>
|
|
</div>
|
|
<div class="pilot">
|
|
<div class="tabstoggle">
|
|
<h2>High <button type="roll" value="&{template:rollhigh}{{name=@{character_name}}}{{roll=[[1d20]]}}"></button> or Low <button type="roll" value="&{template:rolllow}{{name=@{character_name}}}{{roll=[[1d20]]}}"></button> D20 <button type="roll" value="[[1d20]]"></button></h2>
|
|
</div>
|
|
<div class="twocolumns">
|
|
<div>
|
|
<h2 title="All stats cost 5 points. No need to roll if the difficulty is lower than the stat.">Stats</h2>
|
|
<div class="twocolumns">
|
|
<div class="labels">
|
|
<label title="Tuf. Rolled for life saving throws (poison, drowning, etc.), Strength throws, HPx2, and Inventory slots (if used)">Toughness </label>
|
|
<label title="Dex. Rolled for physical feats (attack, climbing/falling, picking locks, etc.)">Dexterity </label>
|
|
<label title="IQ. Rolled for magic and mental feats (perception, puzzles, knowledge, etc.)">Intelligence </label>
|
|
<label title="F. Rolled for breaking inanaimate objects. Adds to all damage dealt, and is the minimum damage you can do. 1 : d2 | 11 : 2d8 2 : d4 | 12 : d20 3 : d6 | 13 : 2d10 4 : d8 | 14 : 2d11 5 : 2d4 | 15 : 2d12 6 : d10 | 16 : 2d20 7 : 2d5 | | : '' 8 : d12 | | : '' 9 : 2d6 | v : '' 10 : 2d7 | 40 : ''">Ferocity </label>
|
|
</div>
|
|
<div class="valuecolumn">
|
|
<input type="number" min="0" max="40" name="attr_con" value="0">
|
|
<input type="number" min="0" max="40" name="attr_dx" value="0">
|
|
<input type="number" min="0" max="40" name="attr_iq" value="0">
|
|
<input type="number" min="0" max="40" name="attr_dmg" value="0">
|
|
</div>
|
|
<div class="valuecolumn">
|
|
<button style="height: 18px;" type="roll" title="Roll stat." value="&{template:roll}{{name=@{character_name}}}{{total=[[ [[1d20]] + @{con}[Tuf] ]]}}{{roll=$[[0]]}}{{target=[[@{targetr}]]}}{{stat='Toughness'}}"></button>
|
|
<button style="height: 18px;" type="roll" title="Roll stat." value="&{template:roll}{{name=@{character_name}}}{{total=[[ [[1d20]] + @{dx}[Dex] ]]}}{{roll=$[[0]]}}{{target=[[@{targetr}]]}}{{stat='Dexterity'}}"></button>
|
|
<button style="height: 18px;" type="roll" title="Roll stat." value="&{template:roll}{{name=@{character_name}}}{{total=[[ [[1d20]] + @{iq}[IQ] ]]}}{{roll=$[[0]]}}{{target=[[@{targetr}]]}}{{stat='Intelligence'}}"></button>
|
|
<button style="height: 18px;" type="roll" value="&{template:roll}{{name=@{character_name}}}{{total=[[ [[1d20]] + @{dmg}[F] ]]}}{{roll=$[[0]]}}{{target=[[@{targetr}]]}}{{stat='Ferocity'}}" title="Roll stat. (F Should only be used for breaking inanimate objects)"></button>
|
|
</div>
|
|
<div class="valuecolumn">
|
|
<button style="height: 18px; color: orange;" type="roll" title="Roll stat with mods." value="&{template:roll}{{name=@{character_name}}}{{total=[[ [[1d20]] + ?{Modifier?|0}[Mod] + @{con}[Tuf] ]]}}{{roll=$[[0]]}}{{target=[[@{targetr}]]}}{{stat='Toughness'}}"></button>
|
|
<button style="height: 18px; color: orange;" type="roll" title="Roll stat with mods." value="&{template:roll}{{name=@{character_name}}}{{total=[[ [[1d20]] + ?{Modifier?|0}[Mod] + @{dx}[Dex] ]]}}{{roll=$[[0]]}}{{target=[[@{targetr}]]}}{{stat='Dexterity'}}"></button>
|
|
<button style="height: 18px; color: orange;" type="roll" title="Roll stat with mods." value="&{template:roll}{{name=@{character_name}}}{{total=[[ [[1d20]] + ?{Modifier?|0}[Mod] + @{iq}[IQ] ]]}}{{roll=$[[0]]}}{{target=[[@{targetr}]]}}{{stat='Intelligence'}}"></button>
|
|
<button style="height: 18px; color: orange;" type="roll" value="&{template:roll}{{name=@{character_name}}}{{total=[[ [[1d20]] + ?{Modifier?|0}[Mod] + @{dmg}[F] ]]}}{{roll=$[[0]]}}{{target=[[@{targetr}]]}}{{stat='Ferocity'}}" title="Roll stat with mods. (F Should only be used for breaking inanimate objects)"></button>
|
|
</div>
|
|
</div>
|
|
<div class="twocolumns">
|
|
<div class="valuecolumn">
|
|
<input type="number" min="-60" max="60" name="attr_targetr" value="10">
|
|
</div>
|
|
<div class="labels">
|
|
<label style="float: left;" title="Target is used against stat checks">Target </label>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
<div style="margin-left: 50px;">
|
|
<h2>Utility</h2>
|
|
<div class="twocolumns">
|
|
<div class="labels">
|
|
<label title="HP. The hit points you have left.">Hit Points </label>
|
|
<label title="This cannot be lower than 5. Derived form Tuf*2">Max HP </label>
|
|
<label title="Def, total from Defensive Gear + Dex">Total Defense </label>
|
|
<label title="MR. Increases difficulty of Effects that target you (2 points)">Magic Resistance </label>
|
|
<label title="The amount of mana you have left. Also listed in your Effects page">Mana </label>
|
|
<label title="Used to cast spells. IQ + Bonus (1 point)">Max Mana </label>
|
|
<br>
|
|
<label>Silver </label>
|
|
</div>
|
|
<div class="valuecolumn">
|
|
<input type="number" name="attr_hp" value="5">
|
|
<input type="hidden" name="attr_foo_hpmax" value="5">
|
|
<input type="number" title="To increase, increase Tuf" disabled name="attr_hp_max" value="@{foo_hpmax}">
|
|
<input type="number" title="To increase, increase Dex or buy Defensive Gear" disabled name="attr_totalar" value="(@{foo_totalar} + @{dx})">
|
|
<input type="number" min="0" name="attr_mr" value="0">
|
|
<input type="number" min="0" name="attr_mana" value="0">
|
|
<input type="hidden" name="attr_mana_max" value="@{manamax}">
|
|
<input type="number" min="0" name="attr_manamax" value="0">
|
|
<br>
|
|
<input type="number" style="width: 80px;" step=".01" name="attr_gold" value="100">
|
|
</div>
|
|
</div>
|
|
</div>
|
|
<div style="margin-left: 50px;">
|
|
<h2>Points</h2>
|
|
<div class="twocolumns">
|
|
<div class="labels">
|
|
<label title="The points awarded to you by the gm">Total Worth </label>
|
|
<label title="The total points you have spent">Spent </label>
|
|
<label title="The remaining points" style="color: chartreuse;">Available </label>
|
|
<label title="The points you have spent on Stats">Stats </label>
|
|
<label title="The points you spent on Gear">Gear </label>
|
|
<label title="The points you have spent on abilites">Abilities </label>
|
|
<label title="Total number of spells. All spells cost 1">Spells </label>
|
|
</div>
|
|
<div class="valuecolumn">
|
|
<input type="number" name="attr_tw" value="100" style="width: 100px;">
|
|
<input type="number" disabled name="attr_totalspent" value="(@{stats} + @{gears} + @{abilities} + @{spells})" class="x">
|
|
<input type="number" disabled name="attr_avail" value="(@{tw}-@{totalspent})" class="x">
|
|
<input type="number" disabled name="attr_stats" title="5 points for each stat + 2 points for each MR + a point for each mana." value="((@{con})*5 + (@{dx})*5 + (@{iq})*5 + (@{dmg})*5 + (@{mr})*2 + @{manamax} - @{iq})" class="x">
|
|
<input type="hidden" name="attr_foo_wpns" value="0" />
|
|
<input type="hidden" name="attr_foo_armors" value="0" />
|
|
<input type="number" disabled name="attr_gears" value="(@{foo_wpns} + @{foo_armors})" class="x">
|
|
<input type="hidden" name="attr_foo_abils" value="0" />
|
|
<input type="number" disabled name="attr_abilities" value="@{foo_abils}" class="x">
|
|
<input type="hidden" name="attr_foo_spells" value="0" />
|
|
<input type="number" title="Total number of spells. All spells cost 1" disabled name="attr_spells" value="@{foo_spells}" class="x">
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
<div class="sheet-rolltemplate-spacer"></div>
|
|
<h2>Gear</h2>
|
|
<h3>Attacks</h3>
|
|
<div class="weapon">
|
|
<label title="Name of the Weapon">Name</label>
|
|
<label style="width: 63px;" title="Damage bonus this weapon gives (2 points) 1 : d2 | 11 : 2d8 2 : d4 | 12 : d20 3 : d6 | 13 : 2d10 4 : d8 | 14 : 2d11 5 : 2d4 | 15 : 2d12 6 : d10 | 16 : 2d20 7 : 2d5 | | : '' 8 : d12 | | : '' 9 : 2d6 | v : '' 10 : 2d7 | 40 : ''">Dmg</label>
|
|
<label style="width: 68px;" title="Bonus to hit (2 points)">Hit</label>
|
|
<label title="Point cost of this weapon">Cost</label>
|
|
</div>
|
|
<div>
|
|
<fieldset class="repeating_weapons">
|
|
<div class="weapon">
|
|
<input type="text" name="attr_weaponname">
|
|
<input type="number" name="attr_damage" min="0" value="0">
|
|
<button type="roll" style="color: red;" name="attr_dmgbtn" title="Damage after hit" value="[[1d2]]"></button>
|
|
<input type="number" name="attr_acc" value="0">
|
|
<button type="roll" title="Use the Weapon" value="&{template:weapon}{{name=@{character_name}}}{{weaponname=@{weaponname}}}{{total=[[ [[1d20]] + @{dx}[Dex] + @{acc}[Acc] ]]}}{{roll=$[[0]]}}"></button>
|
|
<button type="roll" style="color: orange;" title="Use the Weapon with mods" value="&{template:weapon}{{name=@{character_name}}}{{weaponname=@{weaponname}}}{{total=[[ [[1d20]] + ?{Modifiers?|0}[Mod] + @{dx}[Dex] + @{acc}[Acc] ]]}}{{roll=$[[0]]}}"></button>
|
|
<input type="number" disabled name="attr_wpncost" title="Point cost of this weapon" value="(@{damage}*2+ @{acc}*2)" >
|
|
</div>
|
|
</fieldset>
|
|
</div>
|
|
|
|
<h3>Defense</h3>
|
|
<div class="weapon">
|
|
<label>Name</label>
|
|
<label title="The place on the body the armor resides. The most important spot is the body, since that's the default hit location.">Location</label>
|
|
<label title="Defense Bonus (2 points)" style="width: 38px;">Def</label>
|
|
<label title="Damage Reduciton for this location only (5 points)." style="width: 35px;">DR</label>
|
|
<label>Cost</label>
|
|
</div>
|
|
<div>
|
|
<fieldset class="repeating_armors">
|
|
<div class="weapon">
|
|
<input type="text" name="attr_armorname" title="Name of the Armor">
|
|
<input type="text" name="attr_armorloc" title="location of the Armor">
|
|
<input type="number" min="0" name="attr_armar" value="0">
|
|
<input type="number" min="0" name="attr_armas" value="0">
|
|
<input type="number" disabled name="attr_armorcost" title="cost of this Armor" value="(@{armar}*2 + @{armas}*5)" >
|
|
</div>
|
|
</fieldset>
|
|
<input type="hidden" name="attr_foo_totalar" value="0" />
|
|
</div>
|
|
<br>
|
|
<div class="sheet-rolltemplate-spacer"></div>
|
|
|
|
<h3>Abilities</h3>
|
|
<div class="weapon">
|
|
<label style="width: 170px;">Name</label>
|
|
<label style="width: 190px;" title="Makes sure to put all details in this box (length, bonus, rolls, all of it)">Effect</label>
|
|
<label>Cost</label>
|
|
</div>
|
|
<fieldset class="repeating_abilities">
|
|
<div class="weapon">
|
|
<input type="text" name="attr_abilname" title="Name of the ability"><textarea name="attr_ability"></textarea> <input type="number" name="attr_abilcost" title="+ for advantage, - for disadvantage">
|
|
</div>
|
|
</fieldset>
|
|
</div>
|
|
|
|
<div class="grim">
|
|
<h2>Spells</h2>
|
|
<div class="weapon">
|
|
<label style="width: 170px">Name</label>
|
|
<label style="width: 190px" title="Makes ure to put all details in this box (length, bonus, rolls, multipliers, levels, all of it)">Effect</label>
|
|
<label style="width: 62px" title="Damage bonus (leave blank if the spell does no damage, put 0 for base damage)">Damage</label>
|
|
<label style="width: 63px" title="What you must roll (+ penalties) to use the spell">Difficulty</label>
|
|
<label style="width: 85px" title="Cost to cast the spell, derived from difficulty (5-9 = 0, 10-14 = 1, 15-19 = 2, 20-24 = 3, etc.).">Mana/Action Cost</label>
|
|
</div>
|
|
<div class="weapon">
|
|
<button title="This will set all uses to their max use" type="action" name="act_restoreall">Restore Mana</button>
|
|
<input type="number" name="attr_mana" title="The mana you have left until you rest." min="0" value="0">
|
|
</div>
|
|
<div>
|
|
<fieldset class="repeating_spells">
|
|
<div class="weapon">
|
|
<input type="text" name="attr_weaponname" title="Name of the Spell">
|
|
<textarea type="text" name="attr_spelleffect" title="Effect of the Spell"></textarea>
|
|
<input type="number" name="attr_damage" min="0" value="">
|
|
<button style="height: 24px; color: red;" type="roll" name="attr_dmgbtn" title="Damage after hit" value="[[1d2]]]"></button>
|
|
<button style="height: 24px;" type="roll" title="Use the Spell" value="&{template:spell}{{name=@{character_name}}}{{weaponname=@{weaponname}}}{{cost=@{cost}}}{{total=[[ [[1d20]] + ?{Modifiers?|0}[Mod] + @{iq}[IQ] ]]}}{{roll=$[[0]]}}{{diff=[[@{spelldiff}]]}}{{effect=@{spelleffect}}}"></button>
|
|
<input type="number" min="5" max="60" name="attr_spelldiff" value="5">
|
|
<input type="hidden" name="attr_foo_cost" value="0">
|
|
<input type="number" disabled name="attr_cost" title="Cost to cast the spell, derived from difficulty." value="@{foo_cost}">
|
|
</div>
|
|
</fieldset>
|
|
</div>
|
|
</div>
|
|
|
|
<div class="inv">
|
|
<h2>Inventory</h2>
|
|
<div class="weapon">
|
|
<label>Name</label>
|
|
<label>Description</label>
|
|
<label style="width: 35px;">#</label>
|
|
<label style="width: 35px;">Slots</label>
|
|
<label>Cost</label>
|
|
</div>
|
|
<div>
|
|
<fieldset class="repeating_items">
|
|
<div class="weapon">
|
|
<input type="text" name="attr_itemname" title="Name of the Item">
|
|
<input type="text" name="attr_itemeffect" title="Effect of the item">
|
|
<input type="number" name="attr_quantity" title="Number of this item you have. Most items can't have more than 10, and some can have fewer">
|
|
<input type="number" name="attr_slots" title="items don't have a weight, just a slot count. Most items take 1 slot">
|
|
<input type="number" name="attr_itemcost" title="The amount in silver the item costs">
|
|
</div>
|
|
</fieldset>
|
|
</div>
|
|
<div>
|
|
<input type="hidden" name="attr_foo_slotsused" value="0">
|
|
Slots used: <input name="attr_slotsused" type="number" disabled value="@{foo_slotsused}"> Slots available: <input type="number" name="attr_slotsavail" disabled value="(@{con}*2-@{foo_slotsused}+10)">
|
|
</div>
|
|
</div>
|
|
</div>
|
|
|
|
|
|
<script type="text/worker">
|
|
["pilot","info","grim","inv"].forEach(button => {
|
|
on(`clicked:${button}`, function() {
|
|
setAttrs({
|
|
"sheetTab": button
|
|
});
|
|
});
|
|
});
|
|
|
|
const dmgTable = ["1d2","1d4","1d6","1d8","2d4","1d10","2d5","1d12","2d6","2d7","2d8","1d20","2d10","2d11","2d12","2d20"];
|
|
|
|
//const spellCostTable = [.1, .2, .2, .333333, .333333, .333333, .5, .5, .5, .5, 1, 1, 1, 1, 1, 2, 3,3,3,3,3, 4,4,4,4,4, 5,5,5,5,5 ,6,6,6,6,6 ,7,7,7,7,7 ,8,8,8,8,8,8
|
|
//,9,9,9,9,9 ,10,10,10,10,10];
|
|
|
|
function getDamageRollStr(dmgAttr, callback){
|
|
getAttrs([
|
|
"dmg", dmgAttr
|
|
]
|
|
, function(values) {
|
|
const dmgV = Math.min(15, Math.max(0, sumFieldValues(values)-1));
|
|
callback(dmgTable[dmgV]);
|
|
});
|
|
}
|
|
|
|
function getCostOfSpell(spellDiff){
|
|
return Math.floor(parseInt(spellDiff)/5) - 1;
|
|
//const mult = spellCostTable[parseInt(spellDiff)-5];
|
|
//const fullCost = Math.ceil(mult*parseInt(maxUses))
|
|
//return [fullCost, Math.max(1,Math.round(fullCost*(1/mult)))];
|
|
|
|
}
|
|
|
|
on('change:manamax', function(eventInfo) {
|
|
getAttrs( ["mana", "iq", "manamax"]
|
|
, function(values) {
|
|
const minMana = Math.max(parseInt(values.iq), parseInt(eventInfo.newValue));
|
|
console.log(minMana);
|
|
console.log(parseInt(values.iq));
|
|
console.log(parseInt(values.manamax));
|
|
console.log(parseInt(values.mana));
|
|
setAttrs({"mana": (parseInt(values.mana) + (minMana - (parseInt(eventInfo.previousValue)||0))), "manamax":minMana}, {silent:true});
|
|
});
|
|
});
|
|
|
|
on('change:iq', function(eventInfo) {
|
|
getAttrs( ["manamax"]
|
|
, function(values) {
|
|
setAttrs({"manamax": (parseInt(values.manamax) + (parseInt(eventInfo.newValue) - (parseInt(eventInfo.previousValue)||0)))}, {silent:false});
|
|
});
|
|
});
|
|
|
|
on('clicked:restoreall', function() {
|
|
getAttrs( ["manamax"]
|
|
, function(values) {
|
|
setAttrs({"mana":values.manamax}
|
|
, {silent:true}
|
|
);
|
|
});
|
|
});
|
|
|
|
// Changing damage
|
|
on("change:repeating_weapons change:repeating_spells", function(eventInfo) {
|
|
const btndmgAttr = eventInfo.triggerName + "_dmgbtn";
|
|
//document.getElementsByName(btndmgAttr)[0].disabled = false;
|
|
// set the attribute to a template with the updated die roll
|
|
let templateStr = "&{template:weapondmg}{{weaponname=@{weaponname}}}{{mindmg=[[@{dmg}+?{Mod? (Applies to min & dmg)|0}]]}}{{damage=[[";
|
|
getDamageRollStr(eventInfo.triggerName + "_damage", function(dmgroll){
|
|
templateStr += dmgroll + "+?{Mod? (Applies to min & dmg)|0}]]}}";
|
|
setAttrs({
|
|
[btndmgAttr]: templateStr
|
|
}
|
|
, {silent:true}
|
|
);
|
|
});
|
|
});
|
|
|
|
function sumFieldValues(fieldValues){
|
|
let sum = 0;
|
|
Object.values(fieldValues).forEach(element => sum += parseInt(element)||0);
|
|
return sum;
|
|
}
|
|
|
|
on("change:repeating_weapons:damage change:repeating_weapons:acc", function(eventInfo) {
|
|
getRepeatingFields("repeating_weapons", ["damage","acc"], function(fieldValues){
|
|
setAttrs({
|
|
"foo_wpns": sumFieldValues(fieldValues)*2
|
|
}
|
|
, {silent:true}
|
|
);
|
|
});
|
|
});
|
|
|
|
on("change:repeating_items:slots", function(eventInfo) {
|
|
getRepeatingFields("repeating_items", ["slots"], function(fieldValues){
|
|
setAttrs({
|
|
"foo_slotsused": sumFieldValues(fieldValues)
|
|
});
|
|
});
|
|
});
|
|
|
|
//
|
|
on("change:repeating_spells", function(eventInfo) {
|
|
// get total spell count
|
|
getRepeatingFields("repeating_spells", ["spelldiff"], function(fieldValues){
|
|
let sendValues = {"foo_spells":0};
|
|
let idName = "";
|
|
for (const property in fieldValues) {
|
|
idName = property.substring(0, property.lastIndexOf("_"));
|
|
sendValues[idName + "_foo_cost"] = getCostOfSpell(fieldValues[property]);
|
|
sendValues["foo_spells"] += 1;
|
|
}
|
|
setAttrs( sendValues , {silent:true} );
|
|
});
|
|
});
|
|
|
|
on("change:repeating_armors:armar change:repeating_armors:armas", function(eventInfo) {
|
|
getRepeatingFields("repeating_armors", ["armar","armas"], function(fieldValues){
|
|
let arSum = 0;
|
|
let asSum = 0;
|
|
for (const property in fieldValues) {
|
|
if(property.indexOf("_armar") != -1){
|
|
arSum += parseInt(fieldValues[property]);
|
|
}else{
|
|
asSum += parseInt(fieldValues[property]);
|
|
}
|
|
}
|
|
setAttrs({
|
|
"foo_armors": asSum*5 + arSum*2
|
|
, "foo_totalar": arSum
|
|
});
|
|
});
|
|
});
|
|
|
|
on("change:repeating_abilities:abilcost", function(eventInfo) {
|
|
getRepeatingFields("repeating_abilities", ["abilcost"], function(fieldValues){
|
|
setAttrs({
|
|
"foo_abils": sumFieldValues(fieldValues)
|
|
});
|
|
});
|
|
});
|
|
|
|
// function to get fields from a repeating section
|
|
function getRepeatingFields(sectionName, fieldNames, callback) {
|
|
getSectionIDs(sectionName, function (ids) {
|
|
if (ids.length === 0) {
|
|
callback(0);
|
|
return;
|
|
}
|
|
let fieldArray = [];
|
|
for (let j = 0; j < fieldNames.length; j++) {
|
|
for (let i = 0; i < ids.length; i++) {
|
|
fieldArray.push(sectionName + '_' + ids[i] + '_' + fieldNames[j]);
|
|
}
|
|
}
|
|
getAttrs(fieldArray, function (fieldValues) {
|
|
callback(fieldValues);
|
|
});
|
|
});
|
|
}
|
|
|
|
on("sheet:opened", function(eventInfo){
|
|
getAttrs([
|
|
"first"
|
|
]
|
|
, function(values) {
|
|
if(values.first == undefined){
|
|
setAttrs({
|
|
"con": 0
|
|
,"dmg":0
|
|
,"iq":0
|
|
,"hp_max":5
|
|
,"foo_hpmax":5
|
|
,"hp":5
|
|
,"first":1
|
|
,"mana":0
|
|
,"manamax":0
|
|
,"gold":100
|
|
}
|
|
, {silent:true}
|
|
);
|
|
}
|
|
});
|
|
});
|
|
on("change:con", function(eventInfo) {
|
|
const newV = parseInt(eventInfo.newValue);
|
|
const oldV = parseInt(eventInfo.previousValue);
|
|
let diff4 = Math.max(5, newV*2) - Math.max(5, oldV*2);
|
|
getAttrs([
|
|
"hp",
|
|
"hp_max",
|
|
"foo_hpmax",
|
|
]
|
|
, function(values) {
|
|
setAttrs({
|
|
"hp": parseInt(values.hp) + diff4
|
|
, "hp_max": parseInt(values.hp_max) + diff4
|
|
, "foo_hpmax": parseInt(values.foo_hpmax) + diff4
|
|
}
|
|
, {silent:true}
|
|
);
|
|
});
|
|
});
|
|
//on("change:hp_max", function(eventInfo) {
|
|
// const newV = parseInt(eventInfo.newValue);
|
|
// const oldV = parseInt(eventInfo.previousValue);
|
|
// let diff = newV - oldV;
|
|
// getAttrs([
|
|
// "hp"
|
|
// ]
|
|
// , function(values) {
|
|
// setAttrs({
|
|
// "hp": parseInt(values.hp) + diff
|
|
// }
|
|
// , {silent:true}
|
|
// );
|
|
// });
|
|
// });
|
|
</script>
|
|
|
|
<rolltemplate class="sheet-rolltemplate-roll">
|
|
<table>
|
|
<tr>
|
|
<th>
|
|
{{name}} rolls {{stat}}:
|
|
</th>
|
|
</tr>
|
|
<tr>
|
|
<td>
|
|
<div class="sheet-rolltemplate-spacer"></div>
|
|
</td>
|
|
</tr>
|
|
<tr>
|
|
<td>
|
|
{{#rollTotal() roll 20}}
|
|
<strong style="color: green;">CRIT SUCCESS!</strong> ({{roll}}) <br>
|
|
You succeed, and get really lucky! Optionally you can gamble with a high or low. Success means you double the effect. Fail means you just succeed.
|
|
{{/rollTotal() roll 20}}
|
|
|
|
{{#rollBetween() roll 2 19}}
|
|
{{#rollGreater() total target}}
|
|
{{total}} is a <strong style="color: green;">Success</strong> against {{target}}
|
|
{{/rollGreater() total target}}
|
|
{{#rollTotal() total target}}
|
|
{{total}} is a <strong style="color: green;">Success</strong> against {{target}}
|
|
{{/rollTotal() total target}}
|
|
{{#rollLess() total target}}
|
|
{{total}} is a <strong style="color: red;">Fail</strong> against {{target}}
|
|
{{/rollLess() total target}}
|
|
{{/rollBetween() roll 2 19}}
|
|
|
|
{{#rollTotal() roll 1}}
|
|
<strong style="color: red;">CRIT FAIL!</strong> ({{roll}}) <br>
|
|
You auto fail. Succeed a "high or low" or something bad might happen to you
|
|
{{/rollTotal() roll 1}}
|
|
</td>
|
|
</tr>
|
|
</table>
|
|
</rolltemplate>
|
|
|
|
<rolltemplate class="sheet-rolltemplate-weapondmg">
|
|
<table>
|
|
<tr>
|
|
<th>
|
|
{{weaponname}} deals:
|
|
</th>
|
|
</tr>
|
|
<tr>
|
|
<td>
|
|
<div class="sheet-rolltemplate-spacer"></div>
|
|
</td>
|
|
</tr>
|
|
<tr>
|
|
<td>
|
|
{{damage}}
|
|
{{#rollLess() damage mindmg}}
|
|
Damage cannot be below Ferocity: {{mindmg}}
|
|
{{/rollLess() damage mindmg}}
|
|
- DR
|
|
</td>
|
|
</tr>
|
|
</table>
|
|
</rolltemplate>
|
|
|
|
<rolltemplate class="sheet-rolltemplate-weapon">
|
|
<table>
|
|
<tr>
|
|
<th>
|
|
{{name}} attacks with {{weaponname}}
|
|
</th>
|
|
</tr>
|
|
<tr>
|
|
<td>
|
|
<div class="sheet-rolltemplate-spacer"></div>
|
|
</td>
|
|
</tr>
|
|
<tr>
|
|
<td>
|
|
{{#rollTotal() roll 20}}
|
|
<strong style="color: green;">CRIT SUCCESS!</strong> ({{roll}}) <br>
|
|
Your attack auto hits, and double Dmg or Add stun. Optionally you can gamble with a high or low. Success means you double the effect. Fail means you just succeed.
|
|
{{/rollTotal() roll 20}}
|
|
|
|
{{#rollBetween() roll 2 19}}
|
|
Compare {{total}} to target Def
|
|
{{/rollBetween() roll 2 19}}
|
|
|
|
{{#rollTotal() roll 1}}
|
|
<strong style="color: red;">CRIT FAIL!</strong> ({{roll}}) <br>
|
|
Your attack auto fails, succeed a "high or low" or you dorp your weapon or fall to the floor
|
|
{{/rollTotal() roll 1}}
|
|
</td>
|
|
</tr>
|
|
</table>
|
|
</rolltemplate>
|
|
|
|
<rolltemplate class="sheet-rolltemplate-spell">
|
|
<table>
|
|
<tr>
|
|
<th>
|
|
{{name}} attempts to cast spell {{weaponname}} Difficulty: {{diff}}
|
|
</th>
|
|
</tr>
|
|
<tr>
|
|
<td>
|
|
<div class="sheet-rolltemplate-spacer"></div>
|
|
</td>
|
|
</tr>
|
|
<tr>
|
|
<td>
|
|
{{#rollTotal() roll 20}}
|
|
<strong style="color: green;">CRIT SUCCESS!</strong> ({{roll}}) <br>
|
|
Your attack auto hits, you can double dmg or add an additional effect (the GM approves), and mana is NOT consumed.
|
|
Optionally you can gamble with a high or low. Success means you double the effect. Fail means you just succeed.
|
|
<br>
|
|
{{effect}}
|
|
{{/rollTotal() roll 20}}
|
|
|
|
{{#rollTotal() roll 1}}
|
|
<strong style="color: red;">CRIT FAIL!</strong> ({{roll}}) <br>
|
|
Your attack auto fails, succeed a "high or low" or your spell backfires. This also wastes mana.
|
|
{{/rollTotal() roll 1}}
|
|
|
|
{{#rollBetween() roll 2 19}}
|
|
{{#rollLess() total diff}}
|
|
{{total}} <strong style="color: red;">Fails...</strong>. maneuver wasted. do NOT subtract mana.
|
|
{{/rollLess() total diff}}
|
|
{{#rollGreater() total diff}}
|
|
{{total}} <strong style="color: green;">Success</strong>, apply effect! Roll Dmg if necessary. Subtract {{cost}} mana.
|
|
<div class="sheet-rolltemplate-spacer"></div>
|
|
{{effect}}
|
|
{{/rollGreater() total diff}}
|
|
{{#rollTotal() total diff}}
|
|
{{total}} <strong style="color: green;">Success</strong>, apply effect! Roll Dmg if necessary. Subtract {{cost}} mana.
|
|
<div class="sheet-rolltemplate-spacer"></div>
|
|
{{effect}}
|
|
{{/rollTotal() total diff}}
|
|
{{/rollBetween() roll 2 19}}
|
|
</td>
|
|
</tr>
|
|
</table>
|
|
</rolltemplate>
|
|
|
|
<rolltemplate class="sheet-rolltemplate-rollhigh">
|
|
<table>
|
|
<tr>
|
|
<th>
|
|
{{name}} rolls for high!
|
|
</th>
|
|
</tr>
|
|
<tr>
|
|
<td>
|
|
<div class="sheet-rolltemplate-spacer"></div>
|
|
</td>
|
|
</tr>
|
|
<tr>
|
|
<td>
|
|
{{#rollBetween() roll 11 20}}
|
|
<strong style="color: green;">Nailed It!</strong> ({{roll}})
|
|
{{/rollBetween() roll 11 20}}
|
|
|
|
{{#rollBetween() roll 1 10}}
|
|
<strong style="color: red;">fail...</strong> ({{roll}})
|
|
{{/rollBetween() roll 1 10}}
|
|
<br>
|
|
p.s. high/lows cannot crit
|
|
</td>
|
|
</tr>
|
|
</table>
|
|
</rolltemplate>
|
|
|
|
<rolltemplate class="sheet-rolltemplate-rolllow">
|
|
<table>
|
|
<tr>
|
|
<th>
|
|
{{name}} rolls for low!
|
|
</th>
|
|
</tr>
|
|
<tr>
|
|
<td>
|
|
<div class="sheet-rolltemplate-spacer"></div>
|
|
</td>
|
|
</tr>
|
|
<tr>
|
|
<td>
|
|
{{#rollBetween() roll 11 20}}
|
|
<strong style="color: red;">fail...</strong> ({{roll}})
|
|
{{/rollBetween() roll 11 20}}
|
|
|
|
{{#rollBetween() roll 1 10}}
|
|
<strong style="color: green;">Nailed It!</strong> ({{roll}})
|
|
{{/rollBetween() roll 1 10}}
|
|
<br>
|
|
p.s. high/lows cannot crit
|
|
</td>
|
|
</tr>
|
|
</table>
|
|
</rolltemplate> |