mirror of
https://github.com/Nighthawk42/roll20-character-sheets.git
synced 2026-08-30 11:42:29 +00:00
The code now detects double sixes(6) which are the condition for an Ultra Success. Additional translation work done on the roll templates.
250 lines
12 KiB
HTML
250 lines
12 KiB
HTML
|
|
<div class="sheet-container1">
|
|
<!-- Banner -->
|
|
<div class="sheet-logo">
|
|
<img
|
|
src="https://github.com/Roll20/roll20-character-sheets/blob/master/FIST/FIST_logo.png?raw=true"
|
|
style="width: 240px; height: 160px; max-height: 220px; margin: 0px 0px 0px 20px;">
|
|
|
|
<label class="sheet-profileLabel" style="width: 260px; margin: 24px 0px 4px 0px;" data-i18n="info-u">INFO</label>
|
|
<textarea name="attr_info" style="height: 478px;"></textarea>
|
|
|
|
<div style='display: inline-block; vertical-align: top; width: 260px; height: 388px; margin: 2px 0px 0px 0px; border: 1px solid LightGray;'>
|
|
<img name="attr_character_avatar" title="ID Photograph: 258w x 386h pixels" style="width: 258px; height: 386px; border: 0px solid black; background: white; margin: 0px 0px 0px 4px;">
|
|
</div>
|
|
|
|
</div>
|
|
|
|
<div class="sheet-profile">
|
|
<label class="sheet-profileTitle" data-i18n="operativeProfile-u">OPERATIVE PROFILE</label>
|
|
|
|
<label class="sheet-profileLabel" data-i18n="codename-u">CODENAME</label>
|
|
<input type="text" name="attr_codename" class="sheet-profileInput" value="">
|
|
|
|
<label class="sheet-profileLabel" data-i18n="pronouns-u">PRONOUNS</label>
|
|
<input type="text" name="attr_pronouns" class="sheet-profileInput" style="width: 126px;" value="">
|
|
|
|
<label class="sheet-profileLabel" style="width: 45px;" data-i18n="role-u">ROLE</label>
|
|
<input type="text" name="attr_role" class="sheet-profileInput" style="width: 494px;" value="">
|
|
|
|
<label class="sheet-profileLabel" style="width: 330px; height: 26px; padding: 6px 0px 4px 0px; margin: 0px 0px 8px 0px;" data-i18n="traits-u">TRAITS</label>
|
|
<textarea name="attr_traits" style="height: 220px; width: 99%;"></textarea>
|
|
|
|
<label class="sheet-profileLabel" style="width: 330px; height: 26px; border-top: 0px; padding-top: 0px;" data-i18n="inventory-u">INVENTORY</label>
|
|
<textarea name="attr_inventory" style="height: 220px; width: 99%;"></textarea>
|
|
|
|
<div style="color: White; background-color: Black; width=99%; margin-top: 4px; height: 192px">
|
|
<button class="btn sheet-skillName" type="action" name="act_forceful" title="Forceful Roll">
|
|
<label class="sheet-skillName" data-i18n="forceful-u">FORCEFUL</label></button>
|
|
<input type="text" name="attr_forceful" class="sheet-level" value="0" data-i18n-title="Forceful points">
|
|
|
|
<button class="btn sheet-skillName" type="action" name="act_tactical" title="Tactical Roll">
|
|
|
|
<label class="sheet-skillName" data-i18n="tactical-u">TACTICAL</label></button>
|
|
<input type="text" name="attr_tactical" class="sheet-level" value="0" data-i18n-title="Tactical points">
|
|
<label class="sheet-skillDefnLeft" data-i18n="forcefulDefn-c">Strength, brute force, intimidation</label>
|
|
<label class="sheet-skillDefnRight" data-i18n="tacticalDefn-c">Knowledge, skill, intellect</label>
|
|
|
|
<button class="btn sheet-skillName" type="action" name="act_creative" title="Creative Roll">
|
|
|
|
<label class="sheet-skillName" data-i18n="creative-u">CREATIVE</label></button>
|
|
<input type="text" name="attr_creative" class="sheet-level" value="0" data-i18n-title="Creative points">
|
|
|
|
<button class="btn sheet-skillName" type="action" name="act_reflexive" title="Reflexive Roll">
|
|
<label class="sheet-skillName" data-i18n="reflexive-u">REFLEXIVE</label></button>
|
|
<input type="text" name="attr_reflexive" class="sheet-level" value="0" data-i18n-title="Reflexive points">
|
|
<label class="sheet-skillDefnLeft" data-i18n="creativeDefn-c">Diplomacy, deceit, psionics</label>
|
|
<label class="sheet-skillDefnRight" data-i18n="reflexiveDefn-c">Precision, dexterity, aim</label>
|
|
</div>
|
|
<div style="color: White; background-color: Black; width=99%; margin-top: 10px; height: 192px">
|
|
<label class="sheet-AuxName" style="border-top: 12px solid Black; padding: 5px;" data-i18n="armor-u">ARMOR</label>
|
|
<input type="text" name="attr_armor" class="sheet-level" value="0" data-i18n-title="Armor value">
|
|
<label class="sheet-AuxName" style="border-top: 12px solid Black; padding: 5px;" data-i18n="maxHP-u">MAX HP</label>
|
|
<input type="text" name="attr_maxHP" class="sheet-level" value="6" data-i18n-title="Maximum Hit Points">
|
|
<label class="sheet-skillDefnLeft" data-i18n="armorDefn-c">Subtract from damage taken</label>
|
|
<label class="sheet-skillDefnRight" data-i18n="maxHPDefn-c">Capacity to take damage</label>
|
|
|
|
<label class="sheet-AuxName" style="border-top: 12px solid Black; padding: 5px;" data-i18n="warDice-u">WAR DICE</label>
|
|
<input type="text" name="attr_warDice" class="sheet-level" value="0" data-i18n-title="War Dice available">
|
|
<label class="sheet-AuxName" style="width: 190px; border-top: 12px solid Black; padding: 5px 15px 5px 5px;" data-i18n="HP-u">HP</label>
|
|
<input type="text" name="attr_HP" class="sheet-level" value="6" data-i18n-title="Hit Points">
|
|
<label class="sheet-skillDefnLeft" data-i18n="warDiceDefn-c">Luck and grit, spend for +1D6</label>
|
|
<label class="sheet-skillDefnRight" data-i18n="HPDefn-c">Operative death occurs at 0 HP</label>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
|
|
|
|
<!-- Roll Templates -->
|
|
<rolltemplate class="sheet-rolltemplate-initiative">
|
|
<div class="container">
|
|
<div><h1>Initiative *for* {{name}}</h1></div>
|
|
<div class="arrow-container"><div class="arrow-right"></div></div>
|
|
<div class="rowcolor"><span class="tcat">Rolled: </span>{{computed::roll1}}</div>
|
|
</div>
|
|
</rolltemplate>
|
|
|
|
<rolltemplate class="sheet-rolltemplate-warDie">
|
|
<div class="container">
|
|
<div><h1>War Die *for* {{name}}: {{Roll}}</h1></div>
|
|
</div>
|
|
</rolltemplate>
|
|
|
|
<rolltemplate class="sheet-rolltemplate-check">
|
|
<div class="container">
|
|
<!-- <div><h1>{{name}}{{#SkillName}} *for* {{SkillName}}{{/SkillName}}</h1></div> -->
|
|
<div><h1>{{name}}{{#SkillName}}<span class="tcat" data-i18n="for-l"> *for* </span> {{SkillName}}{{/SkillName}}</h1></div>
|
|
<div class="arrow-container"><div class="arrow-right"></div></div>
|
|
{{#Check}}
|
|
<div class="rowcolor"><span class="tcat" data-i18n="check-c">Check: </span>{{computed::Roll}}</div>
|
|
{{#rollLess() computed::Roll 7 }}
|
|
<div class="rowcolor"><span class="tcat" data-i18n="result-c">Result: </span><span data-i18n="failure-c">Failure</span></div>
|
|
{{/rollLess() computed::Roll 7 }}
|
|
{{#rollBetween() computed::Roll 7 9}}
|
|
<div class="rowcolor"><span class="tcat" data-i18n="result-c">Result: </span><span data-i18n="partial-success-c">Partial Success</span></div>
|
|
{{/rollBetween() computed::Roll 7 9}}
|
|
{{#rollBetween() computed::Roll 10 11}}
|
|
<div class="rowcolor"><span class="tcat" data-i18n="result-c">Result: </span><span data-i18n="success-c">Success!</span></div>
|
|
{{/rollBetween() computed::Roll 10 11}}
|
|
{{#rollGreater() computed::Roll 11}}
|
|
{{#rollGreater() computed::Doubles 0 }}
|
|
<div class="rowcolor"><span class="tcat" data-i18n="result-c">Result: </span><span style="color: Red; font-weight: bold;" data-i18n="ultra-success-c" >Ultra Success!</span></div>
|
|
{{/rollGreater() computed::Doubles 0 }}
|
|
{{#^rollGreater() computed::Doubles 0 }}
|
|
<div class="rowcolor"><span class="tcat" data-i18n="result-c">Result: </span><span data-i18n="success-c">Success!</span></div>
|
|
{{/^rollGreater() computed::Doubles 0 }}
|
|
{{/rollGreater() computed::Roll 11}}
|
|
{{/Check}}
|
|
{{#DL}}
|
|
<div class="rowcolor"><span class="tcat">DL: </span>{{DL}}</div>
|
|
{{#rollLess() computed::Roll DL }}
|
|
<div class="rowcolor"><span class="tcat" data-i18n="result-c">Result: </span><span data-i18n="failure-c">Failure</span></div>
|
|
{{/rollLess() computed::Roll DL }}
|
|
{{#^rollLess() computed::Roll DL }}
|
|
<div class="rowcolor"><span class="tcat" data-i18n="result-c">Result: </span><span data-i18n="success-c">Success!</span></div>
|
|
{{/^rollLess() computed::Roll DL }}
|
|
{{/DL}}
|
|
{{#Damage}}
|
|
<div class="rowcolor"><span class="tcat" data-i18n="damage-c">Damage: </span>{{Damage}}</div>
|
|
{{/Damage}}
|
|
</div>
|
|
</rolltemplate>
|
|
|
|
|
|
<script type="text/worker">
|
|
|
|
on("sheet:opened", function(eventInfo){
|
|
|
|
|
|
getAttrs(["setupDone"], function(pvalue) {
|
|
console.log("Hello there");
|
|
|
|
let SetupDone=parseInt(pvalue.setupDone);
|
|
console.log("setupdone: "+SetupDone );
|
|
|
|
if (SetupDone==0){
|
|
console.log("Do setup");
|
|
setAttrs({setupDone:1});
|
|
}
|
|
});
|
|
});
|
|
|
|
|
|
|
|
on("clicked:forceful clicked:tactical clicked:creative clicked:reflexive", function(eventInfo) {
|
|
let TriggerName = eventInfo.triggerName;
|
|
let Name = eventInfo.triggerName.substring(8);
|
|
|
|
//console.log(" TriggerName: " + TriggerName);
|
|
//console.log(" Name: " + Name);
|
|
//console.log(" eventInfo: " + JSON.stringify(eventInfo));
|
|
|
|
getAttrs(["warDice", "forceful","tactical","creative","reflexive"], function(values) {
|
|
let WarDie = parseInt(values.warDice)||0;
|
|
let Forceful = parseInt(values.forceful)||0;
|
|
let Tactical = parseInt(values.tactical)||0;
|
|
let Creative = parseInt(values.creative)||0;
|
|
let Reflexive = parseInt(values.reflexive)||0;
|
|
let WarDiceQuery = "";
|
|
let AttributeName = "No Name";
|
|
|
|
switch (Name) {
|
|
case "forceful": AttributeName = "Forceful"; break;
|
|
case "tactical": AttributeName = "Tactical"; break;
|
|
case "creative": AttributeName = "Creative"; break;
|
|
case "reflexive": AttributeName = "Reflexive"; break;
|
|
default:
|
|
AttributeName = "No Name";
|
|
}
|
|
|
|
//console.log(" Name: " + Name + " AttributeName " + AttributeName);
|
|
|
|
if (WarDie > 0) { WarDiceQuery = "?{WarDice|No, 0|Yes, 1}d6!!"; }
|
|
|
|
|
|
const rollBase = "&{template:check} {{name=@{character_name} *for* " + AttributeName + "}} {{Check=[[1]]}} {{Doubles=[[0]]}} {{Roll=[[2d6+@{"+Name+"}+"+WarDiceQuery+"]]}}";
|
|
//console.log(" rollBase = " + rollBase);
|
|
|
|
startRoll(rollBase, rollResult => {
|
|
|
|
//console.log(" Roll Dice " + rollResult.results.Roll.dice );
|
|
//console.log(" Roll Dice 1 " + rollResult.results.Roll.dice[0] );
|
|
//console.log(" Roll Dice 2 " + rollResult.results.Roll.dice[1] );
|
|
let Die1 = rollResult.results.Roll.dice[0];
|
|
let Die2 = rollResult.results.Roll.dice[1];
|
|
let computedDoubles = 0;
|
|
//console.log(" Die1 " + Die1 );
|
|
//console.log(" Die2 " + Die2 );
|
|
if ((Die1 === 6) && (Die2 === 6)) { computedDoubles = 1; console.log(" DOUBLES: 66 "); }
|
|
if ((Die1 === 5) && (Die2 === 5)) { computedDoubles = 0; console.log(" DOUBLES: 55 "); }
|
|
if ((Die1 === 4) && (Die2 === 4)) { computedDoubles = 0; console.log(" DOUBLES: 44 "); }
|
|
if ((Die1 === 3) && (Die2 === 3)) { computedDoubles = 0; console.log(" DOUBLES: 33 "); }
|
|
if ((Die1 === 2) && (Die2 === 2)) { computedDoubles = 0; console.log(" DOUBLES: 22 "); }
|
|
if ((Die1 === 1) && (Die2 === 1)) { computedDoubles = 0; console.log(" DOUBLES: 11 "); }
|
|
//console.log(" Roll Result " + rollResult.results.Roll.result );
|
|
//console.log(" Roll Expression " + rollResult.results.Roll.expression );
|
|
//console.log(" stringify: " + JSON.stringify(rollResult.results.Roll));
|
|
//console.log(" rollBase: " + rollBase);
|
|
let numDice = rollResult.results.Roll.dice.length;
|
|
//console.log(" numDice: " + numDice);
|
|
|
|
let computed = rollResult.results.Roll.result; // Not altering total, just want to check if War Dice were used
|
|
|
|
|
|
if ((WarDie > 0) && (numDice == 3)) {
|
|
WarDie -= 1;
|
|
|
|
setAttrs({
|
|
warDice: WarDie
|
|
});
|
|
}
|
|
|
|
finishRoll(
|
|
rollResult.rollId,
|
|
{
|
|
Doubles: computedDoubles
|
|
}
|
|
);
|
|
});
|
|
|
|
});
|
|
});
|
|
|
|
|
|
on('clicked:initiative', (info) => {
|
|
startRoll("&{template:initiative} {{name=@{character_name}}} {{roll1=[[2d10+@{prowess} &{tracker}]]}}", (results) => {
|
|
const total = results.results.roll1.result;
|
|
const computed = total;
|
|
|
|
setAttrs({ initiative: computed });
|
|
|
|
finishRoll(
|
|
results.rollId,
|
|
{
|
|
roll1: computed
|
|
}
|
|
);
|
|
});
|
|
});
|
|
</script>
|