Bug fixing and Summary rolls improved

This commit is contained in:
Jean-Philippe Ghibaudo
2024-04-28 16:47:46 +02:00
parent 5ae9f986a0
commit 3ca8ca5254
4 changed files with 201 additions and 137 deletions
+19 -11
View File
@@ -1,11 +1,5 @@
/* General */
@import url('https://fonts.googleapis.com/css?family=Merienda+One&display=swap');
.sheetform { width: 870px; }
.sheet-darkmode .sheetform { background: none; }
.charsheet, .charsheet p {
font-family: 'Merienda One', cursive;
margin-left: -10px;
}
:root {
--background-img: url('https://imgsrv.roll20.net/?src=http%3A//legdf.free.fr/src/img/roll20-2/background.png');
@@ -21,6 +15,14 @@
--wood-shadow: 0 0 4px 0 black;
}
.sheetform { width: 870px; }
.sheet-darkmode .sheetform { background: none; }
.charsheet, .charsheet p {
font-family: 'Merienda One', cursive;
margin-left: -10px;
overflow: hidden;
}
.grid {
display: grid;
grid-auto-rows: minmax(30px, auto);
@@ -297,12 +299,20 @@ input[type="checkbox"].switch {
position: absolute;
left: 761px;
}
.summary-weapon {
opacity: 0;
z-index: -1000;
}
.summary-weapon.active {
opacity: 1;
z-index: 1;
}
.help-menu {
position: absolute;
left: 832px;
}
.lang-en .summary-menu { left: 756px; }
.lang-en .help-menu { left: 841px; }
.lang-en .summary-menu { left: 743px; }
.lang-en .help-menu { left: 829px; }
button.pc-sub-menu {
cursor: pointer;
@@ -370,14 +380,12 @@ button.pc-sub-menu.active { box-shadow: inset 1px 1px 2px 2px rgba(0, 0, 0, 0.65
}
.pc-summary {
justify-items: center;
grid-template-columns: 4fr repeat(4, 0.5fr) 4fr repeat(4, 0.5fr);
grid-template-columns: 2fr repeat(4, 0.5fr) repeat(3, 1.6fr 0.4fr);
}
.pc-summary-state-lbl { grid-column: 1/6; }
.pc-summary-rolls-lbl { grid-column: 6/-1; }
.pc-summary-state-first-full { grid-column: 2/4; }
.pc-summary-state-second-full { grid-column: 4/6; }
.pc-summary-rolls-first-full { grid-column: 7/9; }
.pc-summary-rolls-second-full { grid-column: 9/-1; }
.pc-summary-weapons {
justify-items: center;
grid-template-columns: repeat(5, 1fr);
+174 -119
View File
@@ -1,6 +1,6 @@
<!-- Agone Character Sheet -->
<!-- Version 1 -->
<!-- Version 1.1 -->
<!-- Author: Le Grand Dragon de la Foudre -->
<!-- Website: http://legdf.free.fr-->
@@ -21,60 +21,73 @@
<span data-i18n="hp-header">Points de Vie</span>
<input type="number" class="pc-summary-state-first-full number" name="attr_pcHP" title="Point(s) de Vie actuel(s)" data-i18n-title="current-hp-title">
<input type="number" class="pc-summary-state-second-full number" name="attr_pcHP_max" title="Voir Livre des Règles" data-i18n-title="core-book-title" readonly>
<span data-i18n="generic-roll-header">Jet générique (ouvert/fermé)</span>
<button class="dice pc-summary-rolls-first-full" type="roll" value="&{template:agone-generic} {{name=@{character_name}}} {{Roll=@{genericRoll} : [[[[1d10!]]+[[?{@{baseRoll}|0}]]+[[?{@{bonusPenaltyRoll}|0}]]]]}} {{Dice=@{rollRoll}: $[[0]]}} {{Base=@{baseRoll}: $[[1]]}} {{BonPen=@{bonusPenaltyRoll}: $[[2]]}}" name="roll_pc-generic-open" title="Jet ouvert" data-i18n-title="open-roll-title"></button>
<button class="dice pc-summary-rolls-second-full" type="roll" value="&{template:agone-generic} {{name=@{character_name}}} {{Roll=@{genericRoll} : [[[[1d10]]+[[?{@{baseRoll}|0}]]+[[?{@{bonusPenaltyRoll}|0}]]]]}} {{Dice=@{rollRoll}: $[[0]]}} {{Base=@{baseRoll}: $[[1]]}} {{BonPen=@{bonusPenaltyRoll}: $[[2]]}}" name="roll_pc-generic-open" title="Jet fermé" data-i18n-title="closed-roll-title"></button>
<span data-i18n="open-roll-header">Ouvert</span>
<button class="dice" type="roll" value="&{template:agone-generic} {{name=@{character_name}}} {{Roll=@{genericRoll} : [[[[1d10!]]+[[?{@{baseRoll}|0}]]+[[?{@{bonusPenaltyRoll}|0}]]]]}} {{Dice=@{rollRoll}: $[[0]]}} {{Base=@{baseRoll}: $[[1]]}} {{BonPen=@{bonusPenaltyRoll}: $[[2]]}}" name="roll_pc-generic-open" title="Jet ouvert" data-i18n-title="open-roll-title"></button>
<span data-i18n="closed-roll-header">Fermé</span>
<button class="dice" type="roll" value="&{template:agone-generic} {{name=@{character_name}}} {{Roll=@{genericRoll} : [[[[1d10]]+[[?{@{baseRoll}|0}]]+[[?{@{bonusPenaltyRoll}|0}]]]]}} {{Dice=@{rollRoll}: $[[0]]}} {{Base=@{baseRoll}: $[[1]]}} {{BonPen=@{bonusPenaltyRoll}: $[[2]]}}" name="roll_pc-generic-open" title="Jet fermé" data-i18n-title="closed-roll-title"></button>
<span></span>
<span></span>
<span data-i18n="fp-header">Points d'Héroïsme</span>
<input type="number" class="pc-summary-state-first-full number" name="attr_pcFP" title="Point(s) d'Héroïsme actuel(s)" data-i18n-title="current-fp-title">
<input type="number" class="pc-summary-state-second-full number" name="attr_pcFP_max" title="Score de Flamme x 2" data-i18n-title="max-fp-title" readonly>
<span data-i18n="attributes-fumble-header">Caractéristiques / Fumble</span>
<button class="dice pc-summary-rolls-first-full" type="roll" value="@{pcAttributeRoll}" name="roll_pc-attributes" title="Jet de Caractéristique" data-i18n-title="attribute-roll-title"></button>
<button class="dice pc-summary-rolls-second-full" type="roll" value="@{fumbleRollButton}" name="roll_pc-fumble" title="Fumble" data-i18n-title="fumble-title"></button>
<span data-i18n="attributes-summary-header">Caractéristiques</span>
<button class="dice" type="roll" value="@{pcAttributeRoll}" name="roll_pc-attributes" title="Jet de Caractéristique" data-i18n-title="attribute-roll-title"></button>
<span data-i18n="fumble-header"></span>
<button class="dice" type="roll" value="@{fumbleRollButton}" name="roll_pc-fumble" title="Fumble" data-i18n-title="fumble-title"></button>
<span></span>
<span></span>
<span data-i18n="stuff-header">Équipement</span>
<input type="number" class="pc-summary-state-first-full number" name="attr_pcLoad" title="Charge actuelle" data-i18n-title="current-load-title" readonly>
<input type="number" class="pc-summary-state-second-full number" name="attr_pcLoadPenalty" title="Malus dû à la surcharge" data-i18n-title="load-penalty-title" readonly>
<span data-i18n="skills-invoking-header">Compétences / Conjuration</span>
<button class="dice pc-summary-rolls-first-full" type="roll" value="@{pcSkillsSelection}" name="roll_pc-skills" title="Jet de Compétence" name="roll_pc-skills" data-i18n-title="skill-roll-title"></button>
<button class="dice pc-summary-rolls-second-full" type="roll" value="&{template:agone-invoking} {{name=@{character_name}}}{{Invoking=@{invokingRoll} : [[[[1d10!]]+[[@{pcInvokingAptitute}]]+[[?{@{bonusPenaltyRoll}|0}]]]]}} {{Dice=@{rollRoll}: $[[0]]}} {{Base=@{baseRoll}: $[[1]]}} {{BonPen=@{bonusPenaltyRoll}: $[[2]]}}" name="roll_pc-invoking" title="Jet de Conjuration" data-i18n-title="invoking-roll-title"></button>
<span data-i18n="skills-header">Compétences</span>
<button class="dice" type="roll" value="@{pcSkillsSelection}" name="roll_pc-skills" title="Jet de Compétence" name="roll_pc-skills" data-i18n-title="skill-roll-title"></button>
<span data-i18n="invoking-header"></span>
<button class="dice" type="roll" value="&{template:agone-invoking} {{name=@{character_name}}}{{Invoking=@{invokingRoll} : [[[[1d10!]]+[[@{pcInvokingAptitute}]]+[[?{@{bonusPenaltyRoll}|0}]]]]}} {{Dice=@{rollRoll}: $[[0]]}} {{Base=@{baseRoll}: $[[1]]}} {{BonPen=@{bonusPenaltyRoll}: $[[2]]}}" name="roll_pc-invoking" title="Jet de Conjuration" data-i18n-title="invoking-roll-title"></button>
<span></span>
<span></span>
<span data-i18n="armor-header">Armure</span>
<input type="checkbox" name="attr_pcArmorWorn" value="1" title="Armure portée" data-i18n-title="armor-worn-title">
<input type="number" class="number half-number item-left" name="attr_pcArmorProtection" title="Protection de l'armure" data-i18n-title="armor-protection-title">
<input type="number" class="number half-number item-right" name="attr_pcArmorAgilityPenalty" title="Malus de l'armure" data-i18n-title="armor-penalty-title">
<input type="number" class="number half-number item-left" name="attr_pcArmorPerceptionPenalty" title="Malus de perception de l'armure" data-i18n-title="armor-perception-penalty-title" readonly>
<span data-i18n="initiative-dodge-natural-defense-header">Initiative / Esquive / Défense Naturelle</span>
<button class="dice pc-summary-rolls-first-full" type="roll" value="&{template:agone-initiative} {{name=@{selected|character_name}}} {{Initiative=@{initiativeRoll}[[[[1d10]]+[[@{pcInit}]]+[[?{@{bonusPenaltyRoll}|@{pcLoadPenalty}}]] &{tracker}]]}} {{Dice=@{rollRoll}: $[[0]]}} {{Base=@{baseRoll}: $[[1]]}} {{BonPen=@{bonusPenaltyRoll}: $[[2]]}}" name="roll_pc-init" title="Jet d'Initiative" data-i18n-title="initiative-roll-title"></button>
<button class="dice item-right" type="roll" value="&{template:agone-dodge} {{name=@{character_name}}} {{Dodge=@{dodgeRoll} : [[[[1d10!]]+[[@{pcDodgeTotal}]]+[[?{@{bonusPenaltyRoll}|@{pcArmorAGIPenalty}+@{pcLoadPenalty}}]]]]}} {{Dice=@{rollRoll}: $[[0]]}} {{Base=@{baseRoll}: $[[1]]}} {{BonPen=@{bonusPenaltyRoll}: $[[2]]}}" name="roll_pc-dodge" title="Jet d'Esquive" data-i18n-title="dodge-roll-title"></button>
<button class="dice item-left" type="roll" value="&{template:agone-natural-defense} {{name=@{character_name}}} {{NaturalDefense=@{naturalDefenseRoll}: [[[[1d10!]]+[[@{pcNaturalDefense}]]+[[?{@{bonusPenaltyRoll}|@{pcArmorAGIPenalty}+@{pcLoadPenalty}}]]]]}} {{Dice=@{rollRoll}: $[[0]]}} {{Base=@{baseRoll}: $[[1]]}} {{BonPen=@{bonusPenaltyRoll}: $[[2]]}}" name="roll_pc-natural-defense" title="Jet de Défense Naturelle" data-i18n-title="natural-defense-roll-title"></button>
<span data-i18n="initiative-header">Initiative</span>
<button class="dice" type="roll" value="&{template:agone-initiative} {{name=@{selected|character_name}}} {{Initiative=@{initiativeRoll}[[[[1d10]]+[[@{pcInit}]]+[[?{@{bonusPenaltyRoll}|@{pcLoadPenalty}}]] &{tracker}]]}} {{Dice=@{rollRoll}: $[[0]]}} {{Base=@{baseRoll}: $[[1]]}} {{BonPen=@{bonusPenaltyRoll}: $[[2]]}}" name="roll_pc-init" title="Jet d'Initiative" data-i18n-title="initiative-roll-title"></button>
<span data-i18n="dodge-header">Esquive</span>
<button class="dice" type="roll" value="&{template:agone-dodge} {{name=@{character_name}}} {{Dodge=@{dodgeRoll} : [[[[1d10!]]+[[@{pcDodgeTotal}]]+[[?{@{bonusPenaltyRoll}|@{pcArmorAGIPenalty}+@{pcLoadPenalty}}]]]]}} {{Dice=@{rollRoll}: $[[0]]}} {{Base=@{baseRoll}: $[[1]]}} {{BonPen=@{bonusPenaltyRoll}: $[[2]]}}" name="roll_pc-dodge" title="Jet d'Esquive" data-i18n-title="dodge-roll-title"></button>
<span data-i18n="natural-defense-header">Défense Naturelle</span>
<button class="dice" type="roll" value="&{template:agone-natural-defense} {{name=@{character_name}}} {{NaturalDefense=@{naturalDefenseRoll}: [[[[1d10!]]+[[@{pcNaturalDefense}]]+[[?{@{bonusPenaltyRoll}|@{pcArmorAGIPenalty}+@{pcLoadPenalty}}]]]]}} {{Dice=@{rollRoll}: $[[0]]}} {{Base=@{baseRoll}: $[[1]]}} {{BonPen=@{bonusPenaltyRoll}: $[[2]]}}" name="roll_pc-natural-defense" title="Jet de Défense Naturelle" data-i18n-title="natural-defense-roll-title"></button>
<span data-i18n="serious-wound(s)-header">Blessure(s) Grave(s)</span>
<input type="number" name="attr_pcSeriousWound" class="pc-summary-state-first-full number" title="Blessure(s) Grave(s) encaissée(s)" data-i18n-title="serious-wound(s)-received-title" value="0">
<input type="number" name="attr_pcSeriousWoundPenalty" class="pc-summary-state-second-full number" title="Malus dû à la ou les Blessure(s) Grave(s)" data-i18n-title="serious-wound(s)-penalty-title" readonly>
<span data-i18n="initiative-ascendancy-magical-arts-header">Initiative / Emprise / Arts Magiques</span>
<button class="dice pc-summary-rolls-first-full" type="roll" value="&{template:agone-initiative} {{name=@{selected|character_name}}} {{Initiative=@{initiativeRoll}[[[[1d10]]+[[@{pcMagicInit}]]+[[?{@{bonusPenaltyRoll}|0}]] &{tracker}]]}} {{Dice=@{rollRoll}: $[[0]]}} {{Base=@{baseRoll}: $[[1]]}} {{BonPen=@{bonusPenaltyRoll}: $[[2]]}}" name="roll_pc-magic-init" title="Jet d'Initiative" data-i18n-title="initiative-roll-title"></button>
<button class="dice item-right" type="roll" value="@{pcAscendancySelection}" name="roll_pc-ascendancy-global" title="Jet d'Emprise" data-i18n-title="ascendancy-roll-title"></button>
<button class="dice item-left" type="roll" value="@{pcArtSelection}" name="roll_pc-art-global" title="Jet d'Art Magique" data-i18n-title="magical-arts-roll-title"></button>
<span data-i18n="spells-initiative-header">Initiative (Sorts)</span>
<button class="dice" type="roll" value="&{template:agone-initiative} {{name=@{selected|character_name}}} {{Initiative=@{initiativeRoll}[[[[1d10]]+[[@{pcMagicInit}]]+[[?{@{bonusPenaltyRoll}|0}]] &{tracker}]]}} {{Dice=@{rollRoll}: $[[0]]}} {{Base=@{baseRoll}: $[[1]]}} {{BonPen=@{bonusPenaltyRoll}: $[[2]]}}" name="roll_pc-magic-init" title="Jet d'Initiative" data-i18n-title="initiative-roll-title"></button>
<span data-i18n="ascendancy-header">Emprise</span>
<button class="dice" type="roll" value="@{pcAscendancySelection}" name="roll_pc-ascendancy-global" title="Jet d'Emprise" data-i18n-title="ascendancy-roll-title"></button>
<span data-i18n="magical-arts-header"></span>
<button class="dice" type="roll" value="@{pcArtSelection}" name="roll_pc-art-global" title="Jet d'Art Magique" data-i18n-title="magical-arts-roll-title"></button>
</div>
<hr class="separator">
<div class="pc-summary-weapons grid">
<span class="bold" name="attr_pcWeapon1"></span>
<span class="bold" name="attr_pcWeapon2"></span>
<span class="bold" name="attr_pcWeapon3"></span>
<span class="bold" name="attr_pcWeapon4"></span>
<span class="bold" name="attr_pcWeapon5"></span>
<button class="dice item-center" type="roll" value="@{pcWeapon1Roll}" name="roll_pc-fight1" title="Jet de combat" data-i18n-title="fight-roll-title"></button>
<button class="dice item-center" type="roll" value="@{pcWeapon2Roll}" name="roll_pc-fight2" title="Jet de combat" data-i18n-title="fight-roll-title"></button>
<button class="dice item-center" type="roll" value="@{pcWeapon3Roll}" name="roll_pc-fight3" title="Jet de combat" data-i18n-title="fight-roll-title"></button>
<button class="dice item-center" type="roll" value="@{pcWeapon4Roll}" name="roll_pc-fight4" title="Jet de combat" data-i18n-title="fight-roll-title"></button>
<button class="dice item-center" type="roll" value="@{pcWeapon5Roll}" name="roll_pc-fight5" title="Jet de combat" data-i18n-title="fight-roll-title"></button>
<span class="bold" name="attr_pcWeapon6"></span>
<span class="bold" name="attr_pcWeapon7"></span>
<span class="bold" name="attr_pcWeapon8"></span>
<span class="bold" name="attr_pcWeapon9"></span>
<span class="bold" name="attr_pcWeapon10"></span>
<button class="dice item-center" type="roll" value="@{pcWeapon6Roll}" name="roll_pc-fight6" title="Jet de combat" data-i18n-title="fight-roll-title"></button>
<button class="dice item-center" type="roll" value="@{pcWeapon7Roll}" name="roll_pc-fight7" title="Jet de combat" data-i18n-title="fight-roll-title"></button>
<button class="dice item-center" type="roll" value="@{pcWeapon8Roll}" name="roll_pc-fight8" title="Jet de combat" data-i18n-title="fight-roll-title"></button>
<button class="dice item-center" type="roll" value="@{pcWeapon9Roll}" name="roll_pc-fight9" title="Jet de combat" data-i18n-title="fight-roll-title"></button>
<button class="dice item-center" type="roll" value="@{pcWeapon10Roll}" name="roll_pc-fight10" title="Jet de combat" data-i18n-title="fight-roll-title"></button>
<span class="summary-weapon bold" name="attr_pcWeapon1" data-summary="pcWeapon1"></span>
<span class="summary-weapon bold" name="attr_pcWeapon2" data-summary="pcWeapon2"></span>
<span class="summary-weapon bold" name="attr_pcWeapon3" data-summary="pcWeapon3"></span>
<span class="summary-weapon bold" name="attr_pcWeapon4" data-summary="pcWeapon4"></span>
<span class="summary-weapon bold" name="attr_pcWeapon5" data-summary="pcWeapon5"></span>
<button class="summary-weapon dice item-center" type="roll" value="@{pcWeapon1Roll}" name="roll_pc-fight1" title="Jet de combat" data-i18n-title="fight-roll-title" data-summary="pcWeapon1"></button>
<button class="summary-weapon dice item-center" type="roll" value="@{pcWeapon2Roll}" name="roll_pc-fight2" title="Jet de combat" data-i18n-title="fight-roll-title" data-summary="pcWeapon2"></button>
<button class="summary-weapon dice item-center" type="roll" value="@{pcWeapon3Roll}" name="roll_pc-fight3" title="Jet de combat" data-i18n-title="fight-roll-title" data-summary="pcWeapon3"></button>
<button class="summary-weapon dice item-center" type="roll" value="@{pcWeapon4Roll}" name="roll_pc-fight4" title="Jet de combat" data-i18n-title="fight-roll-title" data-summary="pcWeapon4"></button>
<button class="summary-weapon dice item-center" type="roll" value="@{pcWeapon5Roll}" name="roll_pc-fight5" title="Jet de combat" data-i18n-title="fight-roll-title" data-summary="pcWeapon5"></button>
<span class="summary-weapon bold" name="attr_pcWeapon6" data-summary="pcWeapon6"></span>
<span class="summary-weapon bold" name="attr_pcWeapon7" data-summary="pcWeapon7"></span>
<span class="summary-weapon bold" name="attr_pcWeapon8" data-summary="pcWeapon8"></span>
<span class="summary-weapon bold" name="attr_pcWeapon9" data-summary="pcWeapon9"></span>
<span class="summary-weapon bold" name="attr_pcWeapon10" data-summary="pcWeapon10"></span>
<button class="summary-weapon dice item-center" type="roll" value="@{pcWeapon6Roll}" name="roll_pc-fight6" title="Jet de combat" data-i18n-title="fight-roll-title" data-summary="pcWeapon6"></button>
<button class="summary-weapon dice item-center" type="roll" value="@{pcWeapon7Roll}" name="roll_pc-fight7" title="Jet de combat" data-i18n-title="fight-roll-title" data-summary="pcWeapon7"></button>
<button class="summary-weapon dice item-center" type="roll" value="@{pcWeapon8Roll}" name="roll_pc-fight8" title="Jet de combat" data-i18n-title="fight-roll-title" data-summary="pcWeapon8"></button>
<button class="summary-weapon dice item-center" type="roll" value="@{pcWeapon9Roll}" name="roll_pc-fight9" title="Jet de combat" data-i18n-title="fight-roll-title" data-summary="pcWeapon9"></button>
<button class="summary-weapon dice item-center" type="roll" value="@{pcWeapon10Roll}" name="roll_pc-fight10" title="Jet de combat" data-i18n-title="fight-roll-title" data-summary="pcWeapon10"></button>
</div>
</div>
</div>
@@ -1928,6 +1941,20 @@
}
});
}
if (tab === 'summary') {
getAttrs(['pcWeapon1', 'pcWeapon2', 'pcWeapon3', 'pcWeapon4', 'pcWeapon5', 'pcWeapon6', 'pcWeapon7', 'pcWeapon8', 'pcWeapon9', 'pcWeapon10'], function(v) {
let regex = new RegExp('^'+getTranslationByKey('weapons-option').split(' ')[0]+'.*$', '');
for (var i = 1; i < 11; i++) {
if (!regex.test(parseV(v, 'pcWeapon'+i, 'str'))) {
$20(`span[data-summary=pcWeapon${i}]`).addClass('active');
$20(`button[data-summary=pcWeapon${i}]`).addClass('active');
} else {
$20(`span[data-summary=pcWeapon${i}]`).removeClass('active');
$20(`button[data-summary=pcWeapon${i}]`).removeClass('active');
}
}
});
}
});
$20('.pc-sub-menu').on('click', (e) => {
let tab = e.htmlAttributes['data-tab'];
@@ -1944,7 +1971,7 @@
// Global
on('sheet:opened', function() {
// PC
let weaponsOptions = [];
let pcWeaponsOptions = [];
let z = 1;
let regex = new RegExp('^'+getTranslationByKey('weapons-option').split(' ')[0]+'.*$', '');
getSectionIDs('repeating_pc-skills', function(r) {
@@ -1952,25 +1979,33 @@
_.each(r, function(id, i) {
getAttrs(['repeating_pc-skills_'+id+'_pcSkillName', 'repeating_pc-skills_'+id+'_pcSkillBranch'], function(v) {
if (regex.test(v['repeating_pc-skills_'+id+'_pcSkillName'])) {
weaponsOptions.push({label: v['repeating_pc-skills_'+id+'_pcSkillBranch'] || getTranslationByKey('weapons'+z+'-option'), value: '@{pcWeaponSkill-'+z+'}'});
pcWeaponsOptions.push({label: v['repeating_pc-skills_'+id+'_pcSkillBranch'] || getTranslationByKey('weapons'+z+'-option'), value: '@{pcWeaponSkill-'+z+'}'});
z += 1;
}
if (i == r.length - 1) {
pcWeaponsOptions.push({label: getTranslationByKey('unknown-roll'), value: '@{pcWeaponSkill-'+z+'}'});
populateListOptions({
elemSelector: '.pcWeaponSkill',
optionsArray: weaponsOptions
optionsArray: pcWeaponsOptions
});
}
});
});
} else {
setAttrs({'pcWeaponSkill-1': -3});
pcWeaponsOptions.push({label: getTranslationByKey('unknown-roll'), value: '@{pcWeaponSkill-1}'});
populateListOptions({
elemSelector: '.pcWeaponSkill',
optionsArray: pcWeaponsOptions
});
}
});
dancersOptions = [];
dancersOptions = [{label: 'N/A', value: 'Dancer-0'}];
getSectionIDs('repeating_pc-ascendancies', function(r) {
if (r.length > 0) {
_.each(r, function(id, i) {
getAttrs(['repeating_pc-ascendancies_'+id+'_pcDancer'], function(v) {
dancersOptions.push({label: v['repeating_pc-ascendancies_'+id+'_pcDancer'], value: v['repeating_pc-ascendancies_'+id+'_pcDancer']});
dancersOptions.push({label: v['repeating_pc-ascendancies_'+id+'_pcDancer'], value: 'Dancer-'+parseInt(i+1)});
if (i == r.length -1) {
populateListOptions({
elemSelector: '.pcSpellDancer',
@@ -1983,68 +2018,92 @@
});
// Companion
weaponsOptions = [];
companionWeaponsOptions = [];
z = 1;
getSectionIDs('repeating_companion-skills', function(r) {
if (r.length > 0) {
_.each(r, function(id, i) {
getAttrs(['repeating_companion-skills_'+id+'_companionSkillName', 'repeating_companion-skills_'+id+'_companionSkillBranch'], function(v) {
if (regex.test(v['repeating_companion-skills_'+id+'_companionSkillName'])) {
weaponsOptions.push({label: v['repeating_companion-skills_'+id+'_companionSkillBranch'] || getTranslationByKey('weapons'+z+'-option'), value: '@{companionWeaponSkill-'+z+'}'});
companionWeaponsOptions.push({label: v['repeating_companion-skills_'+id+'_companionSkillBranch'] || getTranslationByKey('weapons'+z+'-option'), value: '@{companionWeaponSkill-'+z+'}'});
z += 1;
}
if (i == r.length - 1) {
companionWeaponsOptions.push({label: getTranslationByKey('unknown-roll'), value: '@{companionWeaponSkill-'+z+'}'});
populateListOptions({
elemSelector: '.companionWeaponSkill',
optionsArray: weaponsOptions
optionsArray: companionWeaponsOptions
});
}
});
});
} else {
setAttrs({'companionWeaponSkill-1': -3});
companionWeaponsOptions.push({label: getTranslationByKey('unknown-roll'), value: '@{companionWeaponSkill-1}'});
populateListOptions({
elemSelector: '.companionWeaponSkill',
optionsArray: companionWeaponsOptions
});
}
});
// Demon
weaponsOptions = [];
demonWeaponsOptions = [];
z = 1;
getSectionIDs('repeating_demon-skills', function(r) {
if (r.length > 0) {
_.each(r, function(id, i) {
getAttrs(['repeating_demon-skills_'+id+'_demonSkillName', 'repeating_demon-skills_'+id+'_demonSkillBranch'], function(v) {
if (regex.test(v['repeating_demon-skills_'+id+'_demonSkillName'])) {
weaponsOptions.push({label: v['repeating_demon-skills_'+id+'_demonSkillBranch'] || getTranslationByKey('weapons'+z+'-option'), value: '@{demonWeaponSkill-'+z+'}'});
demonWeaponsOptions.push({label: v['repeating_demon-skills_'+id+'_demonSkillBranch'] || getTranslationByKey('weapons'+z+'-option'), value: '@{demonWeaponSkill-'+z+'}'});
z += 1;
}
if (i == r.length - 1) {
demonWeaponsOptions.push({label: getTranslationByKey('unknown-roll'), value: '@{demonWeaponSkill-'+z+'}'});
populateListOptions({
elemSelector: '.demonWeaponSkill',
optionsArray: weaponsOptions
optionsArray: demonWeaponsOptions
});
}
});
});
} else {
setAttrs({'demonWeaponSkill-1': -3});
demonWeaponsOptions.push({label: getTranslationByKey('unknown-roll'), value: '@{demonWeaponSkill-1}'});
populateListOptions({
elemSelector: '.demonWeaponSkill',
optionsArray: demonWeaponsOptions
});
}
});
// NPC
weaponsOptions = [];
npcWeaponsOptions = [];
z = 1;
getSectionIDs('repeating_npc-skills', function(r) {
if (r.length > 0) {
_.each(r, function(id, i) {
getAttrs(['repeating_npc-skills_'+id+'_npcSkillName', 'repeating_npc-skills_'+id+'_npcSkillBranch'], function(v) {
if (regex.test(v['repeating_npc-skills_'+id+'_npcSkillName'])) {
weaponsOptions.push({label: v['repeating_npc-skills_'+id+'_npcSkillBranch'] || getTranslationByKey('weapons'+z+'-option'), value: '@{npcWeaponSkill-'+z+'}'});
npcWeaponsOptions.push({label: v['repeating_npc-skills_'+id+'_npcSkillBranch'] || getTranslationByKey('weapons'+z+'-option'), value: '@{npcWeaponSkill-'+z+'}'});
z += 1;
}
if (i == r.length - 1) {
npcWeaponsOptions.push({label: getTranslationByKey('unknown-roll'), value: '@{npcWeaponSkill-'+z+'}'});
populateListOptions({
elemSelector: '.npcWeaponSkill',
optionsArray: weaponsOptions
optionsArray: npcWeaponsOptions
});
}
});
});
} else {
setAttrs({'npcWeaponSkill-1': -3});
npcWeaponsOptions.push({label: getTranslationByKey('unknown-roll'), value: '@{npcWeaponSkill-1}'});
populateListOptions({
elemSelector: '.npcWeaponSkill',
optionsArray: npcWeaponsOptions
});
}
});
@@ -2064,6 +2123,20 @@
let tab = parseV(v, 'Menu', 'str');
$20('div[data-tab]').removeClass('active');
$20(`div[data-tab=${tab}]`).addClass('active');
if (tab === 'summary') {
getAttrs(['pcWeapon1', 'pcWeapon2', 'pcWeapon3', 'pcWeapon4', 'pcWeapon5', 'pcWeapon6', 'pcWeapon7', 'pcWeapon8', 'pcWeapon9', 'pcWeapon10'], function(v) {
let regex = new RegExp('^'+getTranslationByKey('weapons-option').split(' ')[0]+'.*$', '');
for (var i = 1; i < 11; i++) {
if (!regex.test(parseV(v, 'pcWeapon'+i, 'str'))) {
$20(`span[data-summary=pcWeapon${i}]`).addClass('active');
$20(`button[data-summary=pcWeapon${i}]`).addClass('active');
} else {
$20(`span[data-summary=pcWeapon${i}]`).removeClass('active');
$20(`button[data-summary=pcWeapon${i}]`).removeClass('active');
}
}
});
}
});
getAttrs(['pcAttributesCheck', 'pcSecondaryAttributesCheck', 'pcSkillsCheck', 'pcAssetsFaultsCheck', 'pcDarknessPerfidyCheck', 'pcFlameSeasonCurrencyCheck', 'pcStuffCheck', 'pcCombatCheck', 'pcWeaponsCheck', 'pcAscendancyCheck', 'pcArtCheck', 'pcSpellsCheck', 'pcInvokingCheck', 'pcNotesCheck'], function(v) {
@@ -2246,8 +2319,7 @@
if (r.length > 0) {
_.each(r, function(id) {
getAttrs(['repeating_pc-weapons_'+id+'_pcWeaponInit', 'repeating_pc-weapons_'+id+'_pcAimOrNot', 'repeating_pc-weapons_'+id+'_pcWeaponSkill', 'repeating_pc-weapons_'+id+'_pcWeaponAttack', 'repeating_pc-weapons_'+id+'_pcWeaponDefense', 'repeating_pc-weapons_'+id+'_pcWeaponStyle', 'pcAgility', 'pcPerception', 'pcBodyBonus', 'pcMelee', 'pcAim', 'pcWeaponSkill-1', 'pcWeaponSkill-2', 'pcWeaponSkill-3', 'pcWeaponSkill-4', 'pcWeaponSkill-5', 'pcWeaponSkill-6', 'pcWeaponSkill-7', 'pcWeaponSkill-8', 'pcWeaponSkill-9', 'pcWeaponSkill-10'], function(v) {
let s = parseV(v, 'repeating_pc-weapons_'+id+'_pcWeaponSkill', 'str').replace('@', '').replace('{', '').replace('}', '').split('-');
s = s[1];
let s = parseV(v, 'repeating_pc-weapons_'+id+'_pcWeaponSkill', 'str').replace(/^@{(.*)}$/, "$1").split('-')[1];
let ws = parseV(v, 'pcWeaponSkill-'+s);
setAttrs({['repeating_pc-weapons_'+id+'_pcWeaponInitTotal']: weaponInit(parseV(v, 'repeating_pc-weapons_'+id+'_pcWeaponInit'), parseV(v, 'pcAgility'), parseV(v, 'pcPerception'), parseV(v, 'pcBodyBonus'))});
setAttrs({['repeating_pc-weapons_'+id+'_pcWeaponAttackTotal']: weaponScore(ws, parseV(v, 'repeating_pc-weapons_'+id+'_pcWeaponStyle', 'str'), parseV(v, 'repeating_pc-weapons_'+id+'_pcAimOrNot'), parseV(v, 'pcMelee'), parseV(v, 'pcAim'), parseV(v, 'repeating_pc-weapons_'+id+'_pcWeaponAttack'), parseV(v, 'pcBodyBonus'))});
@@ -2262,8 +2334,7 @@
if (r.length > 0) {
_.each(r, function(id) {
getAttrs(['repeating_pc-weapons_'+id+'_pcWeaponSkill', 'repeating_pc-weapons_'+id+'_pcAimOrNot', 'repeating_pc-weapons_'+id+'_pcWeaponAttack', 'repeating_pc-weapons_'+id+'_pcWeaponDefense', 'repeating_pc-weapons_'+id+'_pcWeaponStyle', 'pcBodyBonus', 'pcMelee', 'pcWeaponSkill-1', 'pcWeaponSkill-2', 'pcWeaponSkill-3', 'pcWeaponSkill-4', 'pcWeaponSkill-5', 'pcWeaponSkill-6', 'pcWeaponSkill-7', 'pcWeaponSkill-8', 'pcWeaponSkill-9', 'pcWeaponSkill-10'], function(v) {
let s = parseV(v, 'repeating_pc-weapons_'+id+'_pcWeaponSkill', 'str').replace('@', '').replace('{', '').replace('}', '').split('-');
s = s[1];
let s = parseV(v, 'repeating_pc-weapons_'+id+'_pcWeaponSkill', 'str').replace(/^@{(.*)}$/, "$1").split('-')[1];
let ws = parseV(v, 'pcWeaponSkill-'+s);
if (parseV(v, 'repeating_pc-weapons_'+id+'_pcAimOrNot') >= 0) {
setAttrs({['repeating_pc-weapons_'+id+'_pcWeaponAttackTotal']: weaponScore(ws, parseV(v, 'repeating_pc-weapons_'+id+'_pcWeaponStyle', 'str'), 0, parseV(v, 'pcMelee'), 0, parseV(v, 'repeating_pc-weapons_'+id+'_pcWeaponAttack'), parseV(v, 'pcBodyBonus'))});
@@ -2279,8 +2350,7 @@
if (r.length > 0) {
_.each(r, function(id) {
getAttrs(['repeating_pc-weapons_'+id+'_pcWeaponSkill', 'repeating_pc-weapons_'+id+'_pcAimOrNot', 'repeating_pc-weapons_'+id+'_pcWeaponAttack', 'pcBodyBonus', 'pcAim', 'pcWeaponSkill-1', 'pcWeaponSkill-2', 'pcWeaponSkill-3', 'pcWeaponSkill-4', 'pcWeaponSkill-5', 'pcWeaponSkill-6', 'pcWeaponSkill-7', 'pcWeaponSkill-8', 'pcWeaponSkill-9', 'pcWeaponSkill-10'], function(v) {
let s = parseV(v, 'repeating_pc-weapons_'+id+'_pcWeaponSkill', 'str').replace('@', '').replace('{', '').replace('}', '').split('-');
s = s[1];
let s = parseV(v, 'repeating_pc-weapons_'+id+'_pcWeaponSkill', 'str').replace(/^@{(.*)}$/, "$1").split('-')[1];
let ws = parseV(v, 'pcWeaponSkill-'+s);
if (parseV(v, 'repeating_pc-weapons_'+id+'_pcAimOrNot') < 0) setAttrs({['repeating_pc-weapons_'+id+'_pcWeaponAttackTotal']: weaponScore(ws, 'missile', -1, 0, parseV(v, 'pcAim'), parseV(v, 'repeating_pc-weapons_'+id+'_pcWeaponAttack'), parseV(v, 'pcBodyBonus'))});
});
@@ -2309,8 +2379,7 @@
if (r.length > 0) {
_.each(r, function(id) {
getAttrs(['repeating_pc-weapons_'+id+'_pcWeaponSkill', 'repeating_pc-weapons_'+id+'_pcAimOrNot', 'repeating_pc-weapons_'+id+'_pcWeaponAttack', 'repeating_pc-weapons_'+id+'_pcWeaponDefense', 'repeating_pc-weapons_'+id+'_pcWeaponStyle', 'pcMelee', 'pcAim', 'pcBodyBonus', 'pcWeaponSkill-1', 'pcWeaponSkill-2', 'pcWeaponSkill-3', 'pcWeaponSkill-4', 'pcWeaponSkill-5', 'pcWeaponSkill-6', 'pcWeaponSkill-7', 'pcWeaponSkill-8', 'pcWeaponSkill-9', 'pcWeaponSkill-10'], function(v) {
let s = parseV(v, 'repeating_pc-weapons_'+id+'_pcWeaponSkill', 'str').replace('@', '').replace('{', '').replace('}', '').split('-');
s = s[1];
let s = parseV(v, 'repeating_pc-weapons_'+id+'_pcWeaponSkill', 'str').replace(/^@{(.*)}$/, "$1").split('-')[1];
let ws = parseV(v, 'pcWeaponSkill-'+s);
setAttrs({['repeating_pc-weapons_'+id+'_pcWeaponAttackTotal']: weaponScore(ws, parseV(v, 'repeating_pc-weapons_'+id+'_pcWeaponStyle', 'str'), parseV(v, 'repeating_pc-weapons_'+id+'_pcAimOrNot'), parseV(v, 'pcMelee'), parseV(v, 'pcAim'), parseV(v, 'repeating_pc-weapons_'+id+'_pcWeaponAttack'), parseV(v, 'pcBodyBonus'))});
setAttrs({['repeating_pc-weapons_'+id+'_pcWeaponDefenseTotal']: weaponScore(ws, parseV(v, 'repeating_pc-weapons_'+id+'_pcWeaponStyle', 'str'), 0, parseV(v, 'pcMelee'), 0, parseV(v, 'repeating_pc-weapons_'+id+'_pcWeaponDefense'), parseV(v, 'pcBodyBonus'))});
@@ -2321,16 +2390,14 @@
});
on('change:repeating_pc-weapons:pcWeaponAttack change:repeating_pc-weapons:pcWeaponSkill change:repeating_pc-weapons:pcAimOrNot', function() {
getAttrs(['repeating_pc-weapons_pcWeaponSkill', 'repeating_pc-weapons_pcAimOrNot', 'repeating_pc-weapons_pcWeaponAttack', 'repeating_pc-weapons_pcWeaponStyle', 'pcMelee', 'pcAim', 'pcBodyBonus', 'pcWeaponSkill-1', 'pcWeaponSkill-2', 'pcWeaponSkill-3', 'pcWeaponSkill-4', 'pcWeaponSkill-5', 'pcWeaponSkill-6', 'pcWeaponSkill-7', 'pcWeaponSkill-8', 'pcWeaponSkill-9', 'pcWeaponSkill-10'], function(v) {
let s = parseV(v, 'repeating_pc-weapons_pcWeaponSkill', 'str').replace('@', '').replace('{', '').replace('}', '').split('-');
s = s[1];
let s = parseV(v, 'repeating_pc-weapons_pcWeaponSkill', 'str').replace(/^@{(.*)}$/, "$1").split('-')[1];
let ws = parseV(v, 'pcWeaponSkill-'+s);
setAttrs({'repeating_pc-weapons_pcWeaponAttackTotal': weaponScore(ws, parseV(v, 'repeating_pc-weapons_pcWeaponStyle', 'str'), parseV(v, 'repeating_pc-weapons_pcAimOrNot'), parseV(v, 'pcMelee'), parseV(v, 'pcAim'), parseV(v, 'repeating_pc-weapons_pcWeaponAttack'), parseV(v, 'pcBodyBonus'))});
});
});
on('change:repeating_pc-weapons:pcWeaponDefense change:repeating_pc-weapons:pcWeaponSkill', function() {
getAttrs(['repeating_pc-weapons_pcWeaponDefense', 'repeating_pc-weapons_pcWeaponSkill', 'repeating_pc-weapons_pcWeaponStyle', 'pcMelee', 'pcBodyBonus', 'pcWeaponSkill-1', 'pcWeaponSkill-2', 'pcWeaponSkill-3', 'pcWeaponSkill-4', 'pcWeaponSkill-5', 'pcWeaponSkill-6', 'pcWeaponSkill-7', 'pcWeaponSkill-8', 'pcWeaponSkill-9', 'pcWeaponSkill-10'], function(v) {
let s = parseV(v, 'repeating_pc-weapons_pcWeaponSkill', 'str').replace('@', '').replace('{', '').replace('}', '').split('-');
s = s[1];
let s = parseV(v, 'repeating_pc-weapons_pcWeaponSkill', 'str').replace(/^@{(.*)}$/, "$1").split('-')[1];
let ws = parseV(v, 'pcWeaponSkill-'+s);
setAttrs({'repeating_pc-weapons_pcWeaponDefenseTotal': weaponScore(ws, parseV(v, 'repeating_pc-weapons_pcWeaponStyle', 'str'), 0, parseV(v, 'pcMelee'), 0, parseV(v, 'repeating_pc-weapons_pcWeaponDefense'), parseV(v, 'pcBodyBonus'))});
});
@@ -2451,7 +2518,7 @@
'@{aimRoll}&#44;[[@{pcAim}]]+[[@{pcBodyBonus}]]+[[?{@{bonusPenaltyRoll}&amp;#124;@{pcLoadPenalty}&amp;#125;]]&#125;]]&#125;&#125; '+
'{{Dice=@{rollRoll}: $[[0]]&#125;&#125; {{Sk=@{skillRoll}: $[[1]]&#125;&#125; {{Attr=@{attributeRoll} : $[[2]]&#125;&#125; {{AspBonus=@{aspectBonusRoll}: $[[3]]&#125;&#125; {{BonPen=@{bonusPenaltyRoll}: $[[4]]&#125;&#125;|';
if (weaponsRegExp.test(name)) {
weaponsOptions.push({label: v['repeating_pc-skills_'+id+'_pcSkillBranch'] || getTranslationByKey('weapons'+z+'-option'), value: '@{pcWeaponSkill-'+z+'}'});
weaponsOptions.push({label: branch || getTranslationByKey('weapons'+z+'-option'), value: '@{pcWeaponSkill-'+z+'}'});
let a = 'pcWeaponSkill-'+z;
let j = {};
j[a] = skill;
@@ -2473,11 +2540,12 @@
'@{aimRoll}&#44;[[@{pcAim}]]+[[@{pcBodyBonus}]]+[[?{@{bonusPenaltyRoll}&amp;#124;@{pcLoadPenalty}&amp;#125;]]&#125;]]&#125;&#125; '+
'{Dice=@{rollRoll}: $[[0]]&#125;&#125; {{Sk=@{skillRoll}: $[[1]]&#125;&#125; {{Attr=@{attributeRoll} : $[[2]]&#125;&#125; {{AspBonus=@{aspectBonusRoll}: $[[3]]&#125;&#125; {{BonPen=@{bonusPenaltyRoll}: $[[4]]&#125;&#125;}';
setAttrs({'pcSkillsSelection': s});
weaponsOptions.push({label: getTranslationByKey('unknown-roll'), value: '@{pcWeaponSkill-'+z+'}'});
populateListOptions({
elemSelector: '.pcWeaponSkill',
optionsArray: weaponsOptions
});
for (z ; z < 11 ; z++) {
populateListOptions({
elemSelector: '.pcWeaponSkill',
optionsArray: weaponsOptions
});
let a = 'pcWeaponSkill-'+z;
let j = {};
j[a] = -3;
@@ -2543,7 +2611,7 @@
on('change:repeating_pc-ascendancies remove:repeating_pc-ascendancies', function() {
getSectionIDs('repeating_pc-ascendancies', function(r) {
let s = '?{@{dancerRoll}|';
let dancersOptions = [];
let dancersOptions = [{label: 'N/A', value: 'Dancer-0'}];
if (r.length > 0) {
_.each(r, function(id, i) {
getAttrs(['repeating_pc-ascendancies_'+id+'_pcDancer', 'repeating_pc-ascendancies_'+id+'_pcAscendancyAptitude', 'repeating_pc-ascendancies_'+id+'_pcASCImproAptitude'], function(v) {
@@ -2552,7 +2620,7 @@
let imp = parseV(v, 'repeating_pc-ascendancies_'+id+'_pcASCImproAptitude');
s += dan+', '+'&{template:agone-ascendancy&#125; {{name=@{character_name}&#125;&#125; {{dancer='+dan+'&#125;&#125; {{Ascendancy=@{ascendancyRoll} : [[[[1d10!]]+[['+apt+']]+[[?{@{bonusPenaltyRoll}&#124;0&#125;]]]]&#125;&#125; {{Dice=@{rollRoll}: $[[0]]&#125;&#125; {{Base=@{baseRoll}: $[[1]]&#125;&#125; {{BonPen=@{bonusPenaltyRoll}: $[[2]]&#125;&#125;|';
s += dan+' @{intuitiveRoll}, '+'&{template:agone-ascendancy-intuitive&#125; {{name=@{character_name}&#125;&#125; {{dancer='+dan+'&#125;&#125; {{Ascendancy (intuitive)=@{intuitiveAscendancyRoll} : [[[[1d10!]]+[['+imp+']]+[[?{@{bonusPenaltyRoll}&#124;0&#125;]]]]&#125;&#125; {{Dice=@{rollRoll}: $[[0]]&#125;&#125; {{Base=@{baseRoll}: $[[1]]&#125;&#125; {{BonPen=@{bonusPenaltyRoll}: $[[2]]&#125;&#125;|';
dancersOptions.push({label: v['repeating_pc-ascendancies_'+id+'_pcDancer'], value: v['repeating_pc-ascendancies_'+id+'_pcDancer']});
dancersOptions.push({label: v['repeating_pc-ascendancies_'+id+'_pcDancer'], value: 'Dancer-'+parseInt(i+1)});
if (i == r.length - 1) {
s = s.slice(0, -1);
s += '}';
@@ -2646,8 +2714,7 @@
if (r.length > 0) {
_.each(r, function(id) {
getAttrs(['repeating_companion-weapons_'+id+'_companionWeaponSkill', 'repeating_companion-weapons_'+id+'_companionAimOrNot', 'repeating_companion-weapons_'+id+'_companionWeaponAttack', 'repeating_companion-weapons_'+id+'_companionWeaponDefense', 'repeating_companion-weapons_'+id+'_companionWeaponStyle', 'companionMelee', 'companionAim', 'companionWeaponSkill-1', 'companionWeaponSkill-2', 'companionWeaponSkill-3', 'companionWeaponSkill-4', 'companionWeaponSkill-5', 'companionWeaponSkill-6', 'companionWeaponSkill-7', 'companionWeaponSkill-8', 'companionWeaponSkill-9', 'companionWeaponSkill-10'], function(v) {
let s = parseV(v, 'repeating_companion-weapons_'+id+'_companionWeaponSkill', 'str').replace('@', '').replace('{', '').replace('}', '').split('-');
s = s[1];
let s = parseV(v, 'repeating_companion-weapons_'+id+'_companionWeaponSkill', 'str').replace(/^@{(.*)}$/, "$1").split('-')[1];
let ws = parseV(v, 'companionWeaponSkill-'+s);
setAttrs({['repeating_companion-weapons_'+id+'_companionWeaponAttackTotal']: weaponScore(ws, parseV(v, 'repeating_companion-weapons_'+id+'_companionWeaponStyle', 'str'), parseV(v, 'repeating_companion-weapons_'+id+'_companionAimOrNot'), parseV(v, 'companionMelee'), parseV(v, 'companionAim'), parseV(v, 'repeating_companion-weapons_'+id+'_companionWeaponAttack'), 0)});
setAttrs({['repeating_companion-weapons_'+id+'_companionWeaponDefenseTotal']: weaponScore(ws, parseV(v, 'repeating_companion-weapons_'+id+'_companionWeaponStyle', 'str'), 0, parseV(v, 'companionMelee'), 0, parseV(v, 'repeating_companion-weapons_'+id+'_companionWeaponDefense'), 0)});
@@ -2658,16 +2725,14 @@
});
on('change:repeating_companion-weapons:companionWeaponAttack change:repeating_companion-weapons:companionWeaponSkill change:repeating_companion-weapons:companionAimOrNot', function() {
getAttrs(['repeating_companion-weapons_companionWeaponSkill', 'repeating_companion-weapons_companionAimOrNot', 'repeating_companion-weapons_companionWeaponAttack', 'companionWeaponStyle', 'companionMelee', 'companionAim', 'companionWeaponSkill-1', 'companionWeaponSkill-2', 'companionWeaponSkill-3', 'companionWeaponSkill-4', 'companionWeaponSkill-5', 'companionWeaponSkill-6', 'companionWeaponSkill-7', 'companionWeaponSkill-8', 'companionWeaponSkill-9', 'companionWeaponSkill-10'], function(v) {
let s = parseV(v, 'repeating_companion-weapons_companionWeaponSkill', 'str').replace('@', '').replace('{', '').replace('}', '').split('-');
s = s[1];
let s = parseV(v, 'repeating_companion-weapons_companionWeaponSkill', 'str').replace(/^@{(.*)}$/, "$1").split('-')[1];
let ws = parseV(v, 'companionWeaponSkill-'+s);
setAttrs({'repeating_companion-weapons_companionWeaponAttackTotal': weaponScore(ws, parseV(v, 'repeating_companion-weapons_companionWeaponStyle', 'str'), parseV(v, 'repeating_companion-weapons_companionAimOrNot'), parseV(v, 'companionMelee'), parseV(v, 'companionAim'), parseV(v, 'repeating_companion-weapons_companionWeaponAttack'), 0)});
});
});
on('change:repeating_companion-weapons:companionWeaponDefense change:repeating_companion-weapons:companionWeaponSkill', function() {
getAttrs(['repeating_companion-weapons_companionWeaponDefense', 'repeating_companion-weapons_companionWeaponSkill', 'repeating_companion-weapons_companionWeaponStyle', 'companionMelee', 'companionWeaponSkill-1', 'companionWeaponSkill-2', 'companionWeaponSkill-3', 'companionWeaponSkill-4', 'companionWeaponSkill-5', 'companionWeaponSkill-6', 'companionWeaponSkill-7', 'companionWeaponSkill-8', 'companionWeaponSkill-9', 'companionWeaponSkill-10'], function(v) {
let s = parseV(v, 'repeating_companion-weapons_companionWeaponSkill', 'str').replace('@', '').replace('{', '').replace('}', '').split('-');
s = s[1];
let s = parseV(v, 'repeating_companion-weapons_companionWeaponSkill', 'str').replace(/^@{(.*)}$/, "$1").split('-')[1];
let ws = parseV(v, 'companionWeaponSkill-'+s);
setAttrs({'repeating_companion-weapons_companionWeaponDefenseTotal': weaponScore(ws, parseV(v, 'repeating_companion-weapons_companionWeaponStyle', 'str'), 0, parseV(v, 'companionMelee'), 0, parseV(v, 'repeating_companion-weapons_companionWeaponDefense'), 0)});
});
@@ -2677,8 +2742,7 @@
if (r.length > 0) {
_.each(r, function(id) {
getAttrs(['repeating_companion-weapons_'+id+'_companionWeaponSkill', 'repeating_companion-weapons_'+id+'_companionAimOrNot', 'repeating_companion-weapons_'+id+'_companionWeaponAttack', 'repeating_companion-weapons_'+id+'_companionWeaponDefense', 'repeating_companion-weapons_'+id+'_companionWeaponStyle', 'companionMelee', 'companionWeaponSkill-1', 'companionWeaponSkill-2', 'companionWeaponSkill-3', 'companionWeaponSkill-4', 'companionWeaponSkill-5', 'companionWeaponSkill-6', 'companionWeaponSkill-7', 'companionWeaponSkill-8', 'companionWeaponSkill-9', 'companionWeaponSkill-10'], function(v) {
let s = parseV(v, 'repeating_companion-weapons_'+id+'_companionWeaponSkill', 'str').replace('@', '').replace('{', '').replace('}', '').split('-');
s = s[1];
let s = parseV(v, 'repeating_companion-weapons_'+id+'_companionWeaponSkill', 'str').replace(/^@{(.*)}$/, "$1").split('-')[1];
let ws = parseV(v, 'companionWeaponSkill-'+s);
if (parseV(v, 'repeating_companion-weapons_'+id+'_companionAimOrNot') >= 0) {
setAttrs({['repeating_companion-weapons_'+id+'_companionWeaponAttackTotal']: weaponScore(ws, parseV(v, 'repeating_companion-weapons_'+id+'_companionWeaponStyle', 'str'), 0, parseV(v, 'companionMelee'), 0, parseV(v, 'repeating_companion-weapons_'+id+'_companionWeaponAttack'), 0)});
@@ -2694,8 +2758,7 @@
if (r.length > 0) {
_.each(r, function(id) {
getAttrs(['repeating_companion-weapons_'+id+'_companionWeaponSkill', 'repeating_companion-weapons_'+id+'_companionAimOrNot', 'repeating_companion-weapons_'+id+'_companionWeaponAttack', 'companionAim', 'companionWeaponSkill-1', 'companionWeaponSkill-2', 'companionWeaponSkill-3', 'companionWeaponSkill-4', 'companionWeaponSkill-5', 'companionWeaponSkill-6', 'companionWeaponSkill-7', 'companionWeaponSkill-8', 'companionWeaponSkill-9', 'companionWeaponSkill-10'], function(v) {
let s = parseV(v, 'repeating_companion-weapons_'+id+'_companionWeaponSkill', 'str').replace('@', '').replace('{', '').replace('}', '').split('-');
s = s[1];
let s = parseV(v, 'repeating_companion-weapons_'+id+'_companionWeaponSkill', 'str').replace(/^@{(.*)}$/, "$1").split('-')[1];
let ws = parseV(v, 'companionWeaponSkill-'+s);
if (parseV(v, 'repeating_companion-weapons_'+id+'_companionAimOrNot') < 0) setAttrs({['repeating_companion-weapons_'+id+'_companionWeaponAttackTotal']: weaponScore(ws, 'missile', -1, 0, parseV(v, 'companionAim'), parseV(v, 'repeating_companion-weapons_'+id+'_companionWeaponAttack'), 0)});
});
@@ -2777,7 +2840,7 @@
'@{aimRoll}&#44;[[@{companionAim}]]+[[?{@{bonusPenaltyRoll}&amp;#124;0&amp;#125;]]&#125;]]&#125;&#125; '+
'{{Dice=@{rollRoll}: $[[0]]&#125;&#125; {{Sk=@{skillRoll}: $[[1]]&#125;&#125; {{Attr=@{attributeRoll} : $[[2]]&#125;&#125; {{AspBonus=@{aspectBonusRoll}: N/A&#125;&#125; {{BonPen=@{bonusPenaltyRoll}: $[[3]]&#125;&#125;|';
if (weaponsRegExp.test(name)) {
weaponsOptions.push({label: v['repeating_companion-skills_'+id+'_companionSkillBranch'] || getTranslationByKey('weapons'+z+'-option'), value: '@{companionWeaponSkill-'+z+'}'});
weaponsOptions.push({label: branch || getTranslationByKey('weapons'+z+'-option'), value: '@{companionWeaponSkill-'+z+'}'});
let a = 'companionWeaponSkill-'+z;
let j = {};
j[a] = skill;
@@ -2799,11 +2862,12 @@
'@{aimRoll}&#44;[[@{companionAim}]]+[[?{@{bonusPenaltyRoll}&amp;#124;0&amp;#125;]]&#125;]]&#125;&#125; '+
'{{Dice=@{rollRoll}: $[[0]]&#125;&#125; {{Sk=@{skillRoll}: $[[1]]&#125;&#125; {{Attr=@{attributeRoll} : $[[2]]&#125;&#125; {{AspBonus=@{aspectBonusRoll}: N/A&#125;&#125; {{BonPen=@{bonusPenaltyRoll}: $[[3]]&#125;&#125;}';
setAttrs({'companionSkillsSelection': s});
weaponsOptions.push({label: getTranslationByKey('unknown-roll'), value: '@{companionWeaponSkill-'+z+'}'});
populateListOptions({
elemSelector: '.companionWeaponSkill',
optionsArray: weaponsOptions
});
for (z ; z < 11 ; z++) {
populateListOptions({
elemSelector: '.companionWeaponSkill',
optionsArray: weaponsOptions
});
let a = 'companionWeaponSkill-'+z;
let j = {};
j[a] = -3;
@@ -2900,8 +2964,7 @@
if (r.length > 0) {
_.each(r, function(id) {
getAttrs(['repeating_demon-weapons_'+id+'_demonWeaponSkill', 'repeating_demon-weapons_'+id+'_demonAimOrNot', 'repeating_demon-weapons_'+id+'_demonWeaponAttack', 'repeating_demon-weapons_'+id+'_demonWeaponDefense', 'repeating_demon-weapons_'+id+'_demonWeaponStyle', 'demonMelee', 'demonAim', 'demonWeaponSkill-1', 'demonWeaponSkill-2', 'demonWeaponSkill-3', 'demonWeaponSkill-4', 'demonWeaponSkill-5', 'demonWeaponSkill-6', 'demonWeaponSkill-7', 'demonWeaponSkill-8', 'demonWeaponSkill-9', 'demonWeaponSkill-10'], function(v) {
let s = parseV(v, 'repeating_demon-weapons_'+id+'_demonWeaponSkill', 'str').replace('@', '').replace('{', '').replace('}', '').split('-');
s = s[1];
let s = parseV(v, 'repeating_demon-weapons_'+id+'_demonWeaponSkill', 'str').replace(/^@{(.*)}$/, "$1").split('-')[1];
let ws = parseV(v, 'demonWeaponSkill-'+s);
setAttrs({['repeating_demon-weapons_'+id+'_demonWeaponAttackTotal']: weaponScore(ws, parseV(v, 'repeating_demon-weapons_'+id+'_demonWeaponStyle', 'str'), parseV(v, 'repeating_demon-weapons_'+id+'_demonAimOrNot'), parseV(v, 'demonMelee'), parseV(v, 'demonAim'), parseV(v, 'repeating_demon-weapons_'+id+'_demonWeaponAttack'), 0)});
setAttrs({['repeating_demon-weapons_'+id+'_demonWeaponDefenseTotal']: weaponScore(ws, parseV(v, 'repeating_demon-weapons_'+id+'_demonWeaponStyle', 'str'), 0, parseV(v, 'demonMelee'), 0, parseV(v, 'repeating_demon-weapons_'+id+'_demonWeaponDefense'), 0)});
@@ -2912,16 +2975,14 @@
});
on('change:repeating_demon-weapons:demonWeaponAttack change:repeating_demon-weapons:demonWeaponSkill change:repeating_demon-weapons:demonAimOrNot', function() {
getAttrs(['repeating_demon-weapons_demonWeaponSkill', 'repeating_demon-weapons_demonAimOrNot', 'repeating_demon-weapons_demonWeaponAttack', 'demonWeaponStyle', 'demonMelee', 'demonAim', 'demonWeaponSkill-1', 'demonWeaponSkill-2', 'demonWeaponSkill-3', 'demonWeaponSkill-4', 'demonWeaponSkill-5', 'demonWeaponSkill-6', 'demonWeaponSkill-7', 'demonWeaponSkill-8', 'demonWeaponSkill-9', 'demonWeaponSkill-10'], function(v) {
let s = parseV(v, 'repeating_demon-weapons_demonWeaponSkill', 'str').replace('@', '').replace('{', '').replace('}', '').split('-');
s = s[1];
let s = parseV(v, 'repeating_demon-weapons_demonWeaponSkill', 'str').replace(/^@{(.*)}$/, "$1").split('-')[1];
let ws = parseV(v, 'demonWeaponSkill-'+s);
setAttrs({'repeating_demon-weapons_demonWeaponAttackTotal': weaponScore(ws, parseV(v, 'repeating_demon-weapons_demonWeaponStyle', 'str'), parseV(v, 'repeating_demon-weapons_demonAimOrNot'), parseV(v, 'demonMelee'), parseV(v, 'demonAim'), parseV(v, 'repeating_demon-weapons_demonWeaponAttack'), 0)});
});
});
on('change:repeating_demon-weapons:demonWeaponDefense change:repeating_demon-weapons:demonWeaponSkill', function() {
getAttrs(['repeating_demon-weapons_demonWeaponDefense', 'repeating_demon-weapons_demonWeaponSkill', 'repeating_demon-weapons_demonWeaponStyle', 'demonMelee', 'demonWeaponSkill-1', 'demonWeaponSkill-2', 'demonWeaponSkill-3', 'demonWeaponSkill-4', 'demonWeaponSkill-5', 'demonWeaponSkill-6', 'demonWeaponSkill-7', 'demonWeaponSkill-8', 'demonWeaponSkill-9', 'demonWeaponSkill-10'], function(v) {
let s = parseV(v, 'repeating_demon-weapons_demonWeaponSkill', 'str').replace('@', '').replace('{', '').replace('}', '').split('-');
s = s[1];
let s = parseV(v, 'repeating_demon-weapons_demonWeaponSkill', 'str').replace(/^@{(.*)}$/, "$1").split('-')[1];
let ws = parseV(v, 'demonWeaponSkill-'+s);
setAttrs({'repeating_demon-weapons_demonWeaponDefenseTotal': weaponScore(ws, parseV(v, 'repeating_demon-weapons_demonWeaponStyle', 'str'), 0, parseV(v, 'demonMelee'), 0, parseV(v, 'repeating_demon-weapons_demonWeaponDefense'), 0)});
});
@@ -2931,8 +2992,7 @@
if (r.length > 0) {
_.each(r, function(id) {
getAttrs(['repeating_demon-weapons_'+id+'_demonWeaponSkill', 'repeating_demon-weapons_'+id+'_demonAimOrNot', 'repeating_demon-weapons_'+id+'_demonWeaponAttack', 'repeating_demon-weapons_'+id+'_demonWeaponDefense', 'repeating_demon-weapons_'+id+'_demonWeaponStyle', 'demonMelee', 'demonWeaponSkill-1', 'demonWeaponSkill-2', 'demonWeaponSkill-3', 'demonWeaponSkill-4', 'demonWeaponSkill-5', 'demonWeaponSkill-6', 'demonWeaponSkill-7', 'demonWeaponSkill-8', 'demonWeaponSkill-9', 'demonWeaponSkill-10'], function(v) {
let s = parseV(v, 'repeating_demon-weapons_'+id+'_demonWeaponSkill', 'str').replace('@', '').replace('{', '').replace('}', '').split('-');
s = s[1];
let s = parseV(v, 'repeating_demon-weapons_'+id+'_demonWeaponSkill', 'str').replace(/^@{(.*)}$/, "$1").split('-')[1];
let ws = parseV(v, 'demonWeaponSkill-'+s);
if (parseV(v, 'repeating_demon-weapons_'+id+'_demonAimOrNot') >= 0) {
setAttrs({['repeating_demon-weapons_'+id+'_demonWeaponAttackTotal']: weaponScore(ws, parseV(v, 'repeating_demon-weapons_'+id+'_demonWeaponStyle', 'str'), 0, parseV(v, 'demonMelee'), 0, parseV(v, 'repeating_demon-weapons_'+id+'_demonWeaponAttack'), 0)});
@@ -2948,8 +3008,7 @@
if (r.length > 0) {
_.each(r, function(id) {
getAttrs(['repeating_demon-weapons_'+id+'_demonWeaponSkill', 'repeating_demon-weapons_'+id+'_demonAimOrNot', 'repeating_demon-weapons_'+id+'_demonWeaponAttack', 'demonAim', 'demonWeaponSkill-1', 'demonWeaponSkill-2', 'demonWeaponSkill-3', 'demonWeaponSkill-4', 'demonWeaponSkill-5', 'demonWeaponSkill-6', 'demonWeaponSkill-7', 'demonWeaponSkill-8', 'demonWeaponSkill-9', 'demonWeaponSkill-10'], function(v) {
let s = parseV(v, 'repeating_demon-weapons_'+id+'_demonWeaponSkill', 'str').replace('@', '').replace('{', '').replace('}', '').split('-');
s = s[1];
let s = parseV(v, 'repeating_demon-weapons_'+id+'_demonWeaponSkill', 'str').replace(/^@{(.*)}$/, "$1").split('-')[1];
let ws = parseV(v, 'demonWeaponSkill-'+s);
if (parseV(v, 'repeating_demon-weapons_'+id+'_demonAimOrNot') < 0) setAttrs({['repeating_demon-weapons_'+id+'_demonWeaponAttackTotal']: weaponScore(ws, 'missile', -1, 0, parseV(v, 'demonAim'), parseV(v, 'repeating_demon-weapons_'+id+'_demonWeaponAttack'), 0)});
});
@@ -3032,7 +3091,7 @@
'@{aimRoll}&#44;[[@{demonAim}]]+[[?{@{bonusPenaltyRoll}&amp;#124;0&amp;#125;]]&#125;]]&#125;&#125; '+
'{{Dice=@{rollRoll}: $[[0]]&#125;&#125; {{Sk=@{skillRoll}: $[[1]]&#125;&#125; {{Attr=@{attributeRoll} : $[[2]]&#125;&#125; {{AspBonus=@{aspectBonusRoll}: N/A&#125;&#125; {{BonPen=@{bonusPenaltyRoll}: $[[3]]&#125;&#125;|';
if (weaponsRegExp.test(name)) {
weaponsOptions.push({label: v['repeating_demon-skills_'+id+'_demonSkillBranch'] || getTranslationByKey('weapons'+z+'-option'), value: '@{demonWeaponSkill-'+z+'}'});
weaponsOptions.push({label: branch || getTranslationByKey('weapons'+z+'-option'), value: '@{demonWeaponSkill-'+z+'}'});
let a = 'demonWeaponSkill-'+z;
let j = {};
j[a] = skill;
@@ -3054,11 +3113,12 @@
'@{aimRoll}&#44;[[@{demonAim}]]+[[?{@{bonusPenaltyRoll}&amp;#124;0&amp;#125;]]&#125;]]&#125;&#125; '+
'{{Dice=@{rollRoll}: $[[0]]&#125;&#125; {{Sk=@{skillRoll}: $[[1]]&#125;&#125; {{Attr=@{attributeRoll} : $[[2]]&#125;&#125; {{AspBonus=@{aspectBonusRoll}: N/A&#125;&#125; {{BonPen=@{bonusPenaltyRoll}: $[[3]]&#125;&#125;}';
setAttrs({'demonSkillsSelection': s});
weaponsOptions.push({label: getTranslationByKey('unknown-roll'), value: '@{demonWeaponSkill-'+z+'}'});
populateListOptions({
elemSelector: '.demonWeaponSkill',
optionsArray: weaponsOptions
});
for (z ; z < 11 ; z++) {
populateListOptions({
elemSelector: '.demonWeaponSkill',
optionsArray: weaponsOptions
});
let a = 'demonWeaponSkill-'+z;
let j = {};
j[a] = -3;
@@ -3214,8 +3274,7 @@
if (r.length > 0) {
_.each(r, function(id) {
getAttrs(['repeating_npc-weapons_'+id+'_npcWeaponInit', 'repeating_npc-weapons_'+id+'_npcAimOrNot', 'repeating_npc-weapons_'+id+'_npcWeaponSkill', 'repeating_npc-weapons_'+id+'_npcWeaponAttack', 'repeating_npc-weapons_'+id+'_npcWeaponDefense', 'repeating_npc-weapons_'+id+'_npcWeaponStyle', 'npcAgility', 'npcPerception', 'npcBodyBonus', 'npcMelee', 'npcAim', 'npcWeaponSkill-1', 'npcWeaponSkill-2', 'npcWeaponSkill-3', 'npcWeaponSkill-4', 'npcWeaponSkill-5', 'npcWeaponSkill-6', 'npcWeaponSkill-7', 'npcWeaponSkill-8', 'npcWeaponSkill-9', 'npcWeaponSkill-10'], function(v) {
let s = parseV(v, 'repeating_npc-weapons_'+id+'_npcWeaponSkill', 'str').replace('@', '').replace('{', '').replace('}', '').split('-');
s = s[1];
let s = parseV(v, 'repeating_npc-weapons_'+id+'_npcWeaponSkill', 'str').replace(/^@{(.*)}$/, "$1").split('-')[1];
let ws = parseV(v, 'npcWeaponSkill-'+s);
setAttrs({['repeating_npc-weapons_'+id+'_npcWeaponInitTotal']: weaponInit(parseV(v, 'repeating_npc-weapons_'+id+'_npcWeaponInit'), parseV(v, 'npcAgility'), parseV(v, 'npcPerception'), parseV(v, 'npcBodyBonus'))});
setAttrs({['repeating_npc-weapons_'+id+'_npcWeaponAttackTotal']: weaponScore(ws, parseV(v, 'repeating_npc-weapons_'+id+'_npcWeaponStyle', 'str'), parseV(v, 'repeating_npc-weapons_'+id+'_npcAimOrNot'), parseV(v, 'npcMelee'), parseV(v, 'npcAim'), parseV(v, 'repeating_npc-weapons_'+id+'_npcWeaponAttack'), parseV(v, 'npcBodyBonus'))});
@@ -3230,8 +3289,7 @@
if (r.length > 0) {
_.each(r, function(id) {
getAttrs(['repeating_npc-weapons_'+id+'_npcWeaponSkill', 'repeating_npc-weapons_'+id+'_npcAimOrNot', 'repeating_npc-weapons_'+id+'_npcWeaponAttack', 'repeating_npc-weapons_'+id+'_npcWeaponDefense', 'repeating_npc-weapons_'+id+'_npcWeaponStyle', 'npcBodyBonus', 'npcMelee', 'npcWeaponSkill-1', 'npcWeaponSkill-2', 'npcWeaponSkill-3', 'npcWeaponSkill-4', 'npcWeaponSkill-5', 'npcWeaponSkill-6', 'npcWeaponSkill-7', 'npcWeaponSkill-8', 'npcWeaponSkill-9', 'npcWeaponSkill-10'], function(v) {
let s = parseV(v, 'repeating_npc-weapons_'+id+'_npcWeaponSkill', 'str').replace('@', '').replace('{', '').replace('}', '').split('-');
s = s[1];
let s = parseV(v, 'repeating_npc-weapons_'+id+'_npcWeaponSkill', 'str').replace(/^@{(.*)}$/, "$1").split('-')[1];
let ws = parseV(v, 'npcWeaponSkill-'+s);
if (parseV(v, 'repeating_npc-weapons_'+id+'_npcAimOrNot') >= 0) {
setAttrs({['repeating_npc-weapons_'+id+'_npcWeaponAttackTotal']: weaponScore(ws, parseV(v, 'repeating_npc-weapons_'+id+'_npcWeaponStyle', 'str'), 0, parseV(v, 'npcMelee'), 0, parseV(v, 'repeating_npc-weapons_'+id+'_npcWeaponAttack'), parseV(v, 'npcBodyBonus'))});
@@ -3247,8 +3305,7 @@
if (r.length > 0) {
_.each(r, function(id) {
getAttrs(['repeating_npc-weapons_'+id+'_npcWeaponSkill', 'repeating_npc-weapons_'+id+'_npcAimOrNot', 'repeating_npc-weapons_'+id+'_npcWeaponAttack', 'npcBodyBonus', 'npcAim', 'npcWeaponSkill-1', 'npcWeaponSkill-2', 'npcWeaponSkill-3', 'npcWeaponSkill-4', 'npcWeaponSkill-5', 'npcWeaponSkill-6', 'npcWeaponSkill-7', 'npcWeaponSkill-8', 'npcWeaponSkill-9', 'npcWeaponSkill-10'], function(v) {
let s = parseV(v, 'repeating_npc-weapons_'+id+'_npcWeaponSkill', 'str').replace('@', '').replace('{', '').replace('}', '').split('-');
s = s[1];
let s = parseV(v, 'repeating_npc-weapons_'+id+'_npcWeaponSkill', 'str').replace(/^@{(.*)}$/, "$1").split('-')[1];
let ws = parseV(v, 'npcWeaponSkill-'+s);
if (parseV(v, 'repeating_npc-weapons_'+id+'_npcAimOrNot') < 0) setAttrs({['repeating_npc-weapons_'+id+'_npcWeaponAttackTotal']: weaponScore(ws, 'missile', -1, 0, parseV(v, 'npcAim'), parseV(v, 'repeating_npc-weapons_'+id+'_npcWeaponAttack'), parseV(v, 'npcBodyBonus'))});
});
@@ -3277,8 +3334,7 @@
if (r.length > 0) {
_.each(r, function(id) {
getAttrs(['repeating_npc-weapons_'+id+'_npcWeaponSkill', 'repeating_npc-weapons_'+id+'_npcAimOrNot', 'repeating_npc-weapons_'+id+'_npcWeaponAttack', 'repeating_npc-weapons_'+id+'_npcWeaponDefense', 'repeating_npc-weapons_'+id+'_npcWeaponStyle', 'npcMelee', 'npcAim', 'npcBodyBonus', 'npcWeaponSkill-1', 'npcWeaponSkill-2', 'npcWeaponSkill-3', 'npcWeaponSkill-4', 'npcWeaponSkill-5', 'npcWeaponSkill-6', 'npcWeaponSkill-7', 'npcWeaponSkill-8', 'npcWeaponSkill-9', 'npcWeaponSkill-10'], function(v) {
let s = parseV(v, 'repeating_npc-weapons_'+id+'_npcWeaponSkill', 'str').replace('@', '').replace('{', '').replace('}', '').split('-');
s = s[1];
let s = parseV(v, 'repeating_npc-weapons_'+id+'_npcWeaponSkill', 'str').replace(/^@{(.*)}$/, "$1").split('-')[1];
let ws = parseV(v, 'npcWeaponSkill-'+s);
setAttrs({['repeating_npc-weapons_'+id+'_npcWeaponAttackTotal']: weaponScore(ws, parseV(v, 'repeating_npc-weapons_'+id+'_npcWeaponStyle', 'str'), parseV(v, 'repeating_npc-weapons_'+id+'_npcAimOrNot'), parseV(v, 'npcMelee'), parseV(v, 'npcAim'), parseV(v, 'repeating_npc-weapons_'+id+'_npcWeaponAttack'), parseV(v, 'npcBodyBonus'))});
setAttrs({['repeating_npc-weapons_'+id+'_npcWeaponDefenseTotal']: weaponScore(ws, parseV(v, 'repeating_npc-weapons_'+id+'_npcWeaponStyle', 'str'), 0, parseV(v, 'npcMelee'), 0, parseV(v, 'repeating_npc-weapons_'+id+'_npcWeaponDefense'), parseV(v, 'npcBodyBonus'))});
@@ -3289,16 +3345,14 @@
});
on('change:repeating_npc-weapons:npcWeaponAttack change:repeating_npc-weapons:npcWeaponSkill change:repeating_npc-weapons:npcAimOrNot', function() {
getAttrs(['repeating_npc-weapons_npcWeaponSkill', 'repeating_npc-weapons_npcAimOrNot', 'repeating_npc-weapons_npcWeaponAttack', 'repeating_npc-weapons_npcWeaponStyle', 'npcMelee', 'npcAim', 'npcBodyBonus', 'npcWeaponSkill-1', 'npcWeaponSkill-2', 'npcWeaponSkill-3', 'npcWeaponSkill-4', 'npcWeaponSkill-5', 'npcWeaponSkill-6', 'npcWeaponSkill-7', 'npcWeaponSkill-8', 'npcWeaponSkill-9', 'npcWeaponSkill-10'], function(v) {
let s = parseV(v, 'repeating_npc-weapons_npcWeaponSkill', 'str').replace('@', '').replace('{', '').replace('}', '').split('-');
s = s[1];
let s = parseV(v, 'repeating_npc-weapons_npcWeaponSkill', 'str').replace(/^@{(.*)}$/, "$1").split('-')[1];
let ws = parseV(v, 'npcWeaponSkill-'+s);
setAttrs({'repeating_npc-weapons_npcWeaponAttackTotal': weaponScore(ws, parseV(v, 'repeating_npc-weapons_npcWeaponStyle', 'str'), parseV(v, 'repeating_npc-weapons_npcAimOrNot'), parseV(v, 'npcMelee'), parseV(v, 'npcAim'), parseV(v, 'repeating_npc-weapons_npcWeaponAttack'), parseV(v, 'npcBodyBonus'))});
});
});
on('change:repeating_npc-weapons:npcWeaponDefense change:repeating_npc-weapons:npcWeaponSkill', function() {
getAttrs(['repeating_npc-weapons_npcWeaponDefense', 'repeating_npc-weapons_npcWeaponSkill', 'repeating_npc-weapons_npcWeaponStyle', 'npcMelee', 'npcBodyBonus', 'npcWeaponSkill-1', 'npcWeaponSkill-2', 'npcWeaponSkill-3', 'npcWeaponSkill-4', 'npcWeaponSkill-5', 'npcWeaponSkill-6', 'npcWeaponSkill-7', 'npcWeaponSkill-8', 'npcWeaponSkill-9', 'npcWeaponSkill-10'], function(v) {
let s = parseV(v, 'repeating_npc-weapons_npcWeaponSkill', 'str').replace('@', '').replace('{', '').replace('}', '').split('-');
s = s[1];
let s = parseV(v, 'repeating_npc-weapons_npcWeaponSkill', 'str').replace(/^@{(.*)}$/, "$1").split('-')[1];
let ws = parseV(v, 'npcWeaponSkill-'+s);
setAttrs({'repeating_npc-weapons_npcWeaponDefenseTotal': weaponScore(ws, parseV(v, 'repeating_npc-weapons_npcWeaponStyle', 'str'), 0, parseV(v, 'npcMelee'), 0, parseV(v, 'repeating_npc-weapons_npcWeaponDefense'), parseV(v, 'npcBodyBonus'))});
});
@@ -3367,7 +3421,7 @@
'@{aimRoll}&#44;[[@{npcAim}]]+[[@{npcBodyBonus}]]+[[?{@{bonusPenaltyRoll}&amp;#124;0&amp;#125;]]&#125;]]&#125;&#125; '+
'{{Dice=@{rollRoll}: $[[0]]&#125;&#125; {{Sk=@{skillRoll}: $[[1]]&#125;&#125; {{Attr=@{attributeRoll} : $[[2]]&#125;&#125; {{AspBonus=@{aspectBonusRoll}: $[[3]]&#125;&#125; {{BonPen=@{bonusPenaltyRoll}: $[[4]]&#125;&#125;|';
if (weaponsRegExp.test(name)) {
weaponsOptions.push({label: v['repeating_npc-skills_'+id+'_npcSkillBranch'] || getTranslationByKey('weapons'+z+'-option'), value: '@{npcWeaponSkill-'+z+'}'});
weaponsOptions.push({label: branch || getTranslationByKey('weapons'+z+'-option'), value: '@{npcWeaponSkill-'+z+'}'});
let a = 'npcWeaponSkill-'+z;
let j = {};
j[a] = skill;
@@ -3389,11 +3443,12 @@
'@{aimRoll}&#44;[[@{npcAim}]]+[[@{npcBodyBonus}]]+[[?{@{bonusPenaltyRoll}&amp;#124;0&amp;#125;]]&#125;]]&#125;&#125; '+
'{{Dice=@{rollRoll}: $[[0]]&#125;&#125; {{Sk=@{skillRoll}: $[[1]]&#125;&#125; {{Attr=@{attributeRoll} : $[[2]]&#125;&#125; {{AspBonus=@{aspectBonusRoll}: $[[3]]&#125;&#125; {{BonPen=@{bonusPenaltyRoll}: $[[4]]&#125;&#125;}';
setAttrs({'npcSkillsSelection': s});
weaponsOptions.push({label: getTranslationByKey('unknown-roll'), value: '@{npcWeaponSkill-'+z+'}'});
populateListOptions({
elemSelector: '.npcWeaponSkill',
optionsArray: weaponsOptions
});
for (z ; z < 11 ; z++) {
populateListOptions({
elemSelector: '.npcWeaponSkill',
optionsArray: weaponsOptions
});
let a = 'npcWeaponSkill-'+z;
let j = {};
j[a] = -3;
@@ -3421,4 +3476,4 @@
}
});
});
</script>
</script>
+1 -1
View File
@@ -4,5 +4,5 @@
"authors": "Le GDF (Logo : Maud Chalmel)",
"preview": "agone-sheet.png",
"roll20userid": "1686183",
"instructions": "New version v1. Use AgoneDice v0.4 with it."
"instructions": "New version v1.1. Use AgoneDice v0.4 with it."
}
+7 -6
View File
@@ -35,6 +35,7 @@
"ASCendancy-apt-header": "Pot. d'EMPrise",
"ascendancy-bonus-title": "Bonus d'Emprise du Danseur",
"ASCENDANCY-header": "EMPRISE",
"ascendancy-header": "Emprise",
"ASCendancy-header": "EMPrise",
"ascendancy-magical-arts-header": "Emprise &amp; Arts Magiques",
"ascendancy-magical-arts-item1-line": "Le bouton dans la barre de titre regroupe tous les jets de magie en un.",
@@ -51,9 +52,9 @@
"attack-roll": "Attaque",
"attack-roll-title": "Jet d'attaque",
"attribute-roll-title": "Jet de Caractéristique",
"attributes-fumble-header": "Caractéristiques / Fumble",
"attributes-header": "Caractéristiques primaires",
"ATTRIBUTES-header": "CARACTÉRISTIQUES PRIMAIRES",
"attributes-summary-header": "Caractéristiques",
"attributes-item1-line": "Le bouton dans la barre de titre regroupe tous les jets de caractéristique en un.",
"attributes-item2-line": "Pour les doubles cases, celle de gauche correspond à la caractéristique ou l'aspect, celle de droite à l'expérience dépenséee.",
"attribute-roll": "Caractéristique ",
@@ -211,7 +212,8 @@
"general-use-item8-line": "Tous les jets demanderont le cumul d'éventuels bonus et malus via l'interface du jeu, comme les malus dus aux blessures graves par exemple.",
"general-use-item9-line": "Le bouton à droite de <strong>Fumble</strong> permet de relancer un 1 sur 1d10 et soustraire le résultat.",
"generic-roll": "Générique",
"generic-roll-header": "Jet générique (ouvert/fermé)",
"open-roll-header": "Ouvert",
"closed-roll-header": "Fermé",
"geography-option": "Géographie (Savoir)",
"giant-option": "Géant",
"gift-placeholder": "Bienfait",
@@ -234,8 +236,6 @@
"I-option": "P",
"impaling-option": "Perforant",
"impaling-slashing-option": "Perforant/Tranchant",
"initiative-ascendancy-magical-arts-header": "Initiative / Emprise / Arts Magiques",
"initiative-dodge-natural-defense-header": "Initiative / Esquive / Défense Naturelle",
"initiative-header": "Initiative",
"initiative-roll": "Initiative : ",
"initiative-roll-title": "Jet d'Initiative",
@@ -255,6 +255,7 @@
"intuitive-roll": "(impro)",
"invoking-aptitude-header": "Pot. de conjuration",
"invoking-aptitude-title": "Potentiel de conjuration (Noirceur+Démonologie+Bonus d'Âme)",
"invoking-header": "Conjuration",
"invoking-DIF-title": "DIFficulté de conjuration du Démon",
"invoking-roll": "Conjuration",
"invoking-roll-title": "Jet de Conjuration",
@@ -397,9 +398,8 @@
"skill-roll-title": "Jet de Compétence",
"skill-roll": "Compétence ",
"skill-title": "Score de la compétence",
"skills-header": "Compétence",
"skills-header": "Compétences",
"SKILLS-header": "COMPÉTENCES",
"skills-invoking-header": "Compétence / Conjuration",
"skills-item1-line": "Le bouton dans la barre de titre regroupe tous les jets de compétence en un.",
"skills-item2-line": "Pour les doubles cases, celle de gauche correspond à la compétence, celle de droite à l'expérience dépensée.",
"skills-item3-line": "Seules 10 compétences d'armes seront prises en compte dynamiquement pour les jets globaux.",
@@ -421,6 +421,7 @@
"specialty-placeholder": "spécialité",
"specialty-title": "Spécialité de la compétence",
"SPELLS-OPUS-MISCELLANEOUS-MAGICS-header": "SORTS, ŒUVRES &amp; MAGIES DIVERSES",
"spells-initiative-header": "Initiative (Sorts)",
"spirit-bonus-header": "Bonus d'Esprit",
"spirit-bonus-roll": "Bonus d'Esprit",
"spirit-bonus-title": "Différence entre Esprit et Esprit Noir",