Fix visual bug & roll bug

This commit is contained in:
Zakarik
2024-12-13 15:31:25 +01:00
parent 146fdb8be8
commit 2f12ad3095
21 changed files with 389 additions and 1106 deletions
-193
View File
File diff suppressed because it is too large Load Diff
+201 -462
View File
File diff suppressed because it is too large Load Diff
+2 -2
View File
@@ -4240,7 +4240,7 @@ function updateRoll(roll, diceJet, bonusJet, totalDegats, diceDegats, bonusDegat
let vTCheneSculpte = 0;
if (conditions.bourreau || conditions.equilibre) {
if (conditions.bourreau) {
tDegats = diceDegats.reduce((accumulateur, valeurCourante) => {
let newV = +valeurCourante;
if (newV <= 3) { newV = 4; }
@@ -4436,7 +4436,7 @@ function updateRoll(roll, diceJet, bonusJet, totalDegats, diceDegats, bonusDegat
}
}
if (conditions.devaste || conditions.equilibre) {
if (conditions.devaste) {
tViolence = diceViolence.reduce((accumulateur, valeurCourante) => {
let newV = valeurCourante;
if (newV <= 3) { newV = 4; }
+87
View File
@@ -860,6 +860,7 @@ const i18n_deplacement = getTranslationByKey("deplacement"),
i18n_devasterAnatheme = getTranslationByKey("devaster-anatheme"),
i18n_bourreauTenebres = getTranslationByKey("bourreau-tenebres"),
i18n_equilibrerBalance = getTranslationByKey("equilibrer-balance"),
i18n_equilibrerBalanceShort = getTranslationByKey("equilibrer-balance-short"),
i18n_bourreau = getTranslationByKey("bourreau"),
i18n_conviction = getTranslationByKey("conviction"),
i18n_devastation = getTranslationByKey("devastation"),
@@ -1061,6 +1062,92 @@ function isApplied(e) {
return result;
}
async function postRoll(computed, gmroll, stringRoll, mainRoll, conditions={}, startString=`&{template:simple} {{Nom=@{name}}}`) {
const isGuidage = conditions.isGuidage || false;
const results = mainRoll.results;
const pairOrImpair = isGuidage === true ? 'cs1cs3cs5cf2cf4cf6s' : 'cs2cs4cs6cf1cf3cf5s';
const dices = results.jet.dice;
let success = 0;
success += computed.basejet;
if(conditions.equilibre && dices.length !== success) {
const notSuccess = parseInt(dices.length)-parseInt(success);
const relance = await startRoll(`${gmroll} ${startString} {{special1=${i18n_equilibrerBalanceShort}}} {{jet=[[ ${notSuccess}d6${pairOrImpair}]]}}`);
const rRelance = relance.results.jet.dice;
const relancePairOrImpair = isGuidage === true ? 1 : 0;
const jetRelance = rRelance.reduce((accumulateur, valeurCourante) => {
const vC = valeurCourante;
let nV = 0;
if (vC % 2 === relancePairOrImpair) {
nV = 1;
}
return accumulateur + nV;
}, 0);
const relanceComputed = {
jet: jetRelance,
};
finishRoll(relance.rollId, relanceComputed);
success += relanceComputed.jet;
}
if (success !== 0 && success === dices.length) {
const isGuidage = conditions.isGuidage || false;
const exploitRoll = await startRoll(`${gmroll} ${startString} {{special1=${i18n_exploit}}}${stringRoll}`);
const rExploit = exploitRoll.results.jet.dice;
const exploitPairOrImpair = isGuidage === true ? 1 : 0;
const jetExploit = rExploit.reduce((accumulateur, valeurCourante) => {
const vC = valeurCourante;
let nV = 0;
if (vC % 2 === exploitPairOrImpair) {
nV = 1;
}
return accumulateur + nV;
}, 0);
const exploitComputed = {
jet: jetExploit,
};
finishRoll(exploitRoll.rollId, exploitComputed);
}
}
function computeSimpleRoll(mainRoll, bonus = 0, pairOrImpair = 0) {
const results = mainRoll.results;
console.warn(results);
let jet = 0;
let dices = results.jet.dice.reduce((accumulateur, valeurCourante) => {
const vC = valeurCourante;
let nV = 0;
if (vC % 2 === pairOrImpair) {
nV = 1;
}
return accumulateur + nV;
}, 0);
jet += dices;
jet += bonus;
return {
jet:jet,
basejet:dices,
}
}
var PI = {
"msgSlot":0,
"msgEnergie":0
+16 -31
View File
@@ -1,3 +1,6 @@
/* eslint-disable linebreak-style */
/* eslint-disable max-len */
/* eslint-disable linebreak-style */
/* eslint-disable camelcase */
/* eslint-disable no-undef */
on('clicked:domaineArtistique', (info) => {
@@ -10,9 +13,10 @@ on('clicked:domaineArtistique', (info) => {
'caracteristique2Art',
'caracteristique3Art',
'caracteristique4Art',
'equilibreBalance',
];
getAttrs(attributs, (value) => {
getAttrs(attributs, async (value) => {
const exec = [];
const mod = Number(value.jetModifDes);
@@ -22,6 +26,7 @@ on('clicked:domaineArtistique', (info) => {
const C2 = value.caracteristique2Art;
const C3 = value.caracteristique3Art;
const C4 = value.caracteristique4Art;
const equilibre = +value.equilibreBalance;
const C1Nom = C1.slice(2, -1);
const C2Nom = C2.slice(2, -1);
@@ -70,37 +75,17 @@ on('clicked:domaineArtistique', (info) => {
}
if (cRoll.length === 0) { cRoll.push(0); }
const bonusTotal = bonus.reduce((accumulateur, valeurCourante) => parseInt(accumulateur, 10) + parseInt(valeurCourante, 10), 0);
const stringRoll = `{{jet=[[ [[{${cRoll.join('+')}, 0}kh1]]d6cs2cs4cs6cf1cf3cf5s]]}}`;
exec.push(stringRoll);
exec.push('{{basejet=[[0]]}}');
exec.push(`{{tBonus=[[${bonusTotal}]]}}`);
const finalRoll = await startRoll(exec.join(' '));
const computed = computeSimpleRoll(finalRoll, bonusTotal);
exec.push(`{{jet=[[ {[[{${cRoll.join('+')}, 0}kh1]]d6cs2cs4cs6cf1cf3cf5s%2}=0]]}}`);
exec.push(`{{tBonus=[[${bonus.join('+')}+0]]}}`);
exec.push(`{{Exploit=[[${cRoll.join('+')}]]}}`);
startRoll(exec.join(' '), (results) => {
const tJet = results.results.jet.result;
const tBonus = results.results.tBonus.result;
const tExploit = results.results.Exploit.result;
const total = tJet + tBonus;
finishRoll(
results.rollId,
{
jet: total,
},
);
if (tJet !== 0 && tJet === tExploit) {
startRoll(`${roll}@{jetGM} &{template:simple} {{Nom=@{name}}} {{special1=${i18n_exploit}}}{{jet=[[ {[[{${cRoll.join('+')}, 0}kh1]]d6cs2cs4cs6cf1cf3cf5s%2}=0]]}}`, (exploit) => {
const tExploit2 = exploit.results.jet.result;
finishRoll(
exploit.rollId,
{
jet: tExploit2,
},
);
});
}
finishRoll(finalRoll.rollId, computed);
await postRoll(computed, roll, stringRoll, finalRoll, {
equilibre,
});
});
});
+1
View File
@@ -1,3 +1,4 @@
/* eslint-disable linebreak-style */
/* eslint-disable camelcase */
/* eslint-disable no-undef */
on('clicked:distanceBard', async (info) => {
+1
View File
@@ -1,3 +1,4 @@
/* eslint-disable linebreak-style */
/* eslint-disable camelcase */
/* eslint-disable no-undef */
const berserkIlluminationRoll = ['berserkIlluminationBlaze', 'berserkIlluminationLantern'];
+2 -24
View File
@@ -1,3 +1,4 @@
/* eslint-disable linebreak-style */
/* eslint-disable prefer-destructuring */
/* eslint-disable camelcase */
/* eslint-disable max-len */
@@ -413,11 +414,9 @@ rollCombatAutre.forEach((button) => {
if (pasEnergie === false) {
finalRoll = await startRoll(exec.join(' '));
const tJet = finalRoll.results.jet.result;
const rJet = finalRoll.results.jet.dice;
const tBonus = finalRoll.results.bonus.result;
const tExploit = finalRoll.results.Exploit.result;
const rDegats = finalRoll.results.degats.dice;
const rViolence = finalRoll.results.violence.dice;
@@ -447,28 +446,7 @@ rollCombatAutre.forEach((button) => {
finishRoll(finalRoll.rollId, computed);
if (tJet !== 0 && computed.basejet === tExploit) {
const exploitRoll = await startRoll(`${roll}@{jetGM} &{template:simple} {{Nom=@{name}}} {{special1=${i18n_exploit}}}${jet}`);
const rExploit = exploitRoll.results.jet.dice;
const exploitPairOrImpair = isGuidage === true ? 1 : 0;
const jetExploit = rExploit.reduce((accumulateur, valeurCourante) => {
const vC = valeurCourante;
let nV = 0;
if (vC % 2 === exploitPairOrImpair) {
nV = 1;
}
return accumulateur + nV;
}, 0);
const exploitComputed = {
jet: jetExploit,
};
finishRoll(exploitRoll.rollId, exploitComputed);
}
await postRoll(computed, roll, jet, finalRoll, conditions);
if (hasEnergieRetiree && button === 'repeating_armeautre:armeautrepjvehicule') {
setAttrs({ energieVehicule: newEnergie });
+1 -24
View File
@@ -974,14 +974,12 @@ rollCombatContact.forEach((button) => {
finalRoll = await startRoll(exec.join(' '));
const tJet = finalRoll.results.jet.result;
const rJet = finalRoll.results.jet.dice;
const rDegats = finalRoll.results.degats.dice;
const rViolence = finalRoll.results.violence.dice;
const tBonus = finalRoll.results.bonus.result;
const tExploit = finalRoll.results.Exploit.result;
const tDegats = finalRoll.results.degats.result;
const tViolence = finalRoll.results.violence.result;
@@ -1017,28 +1015,7 @@ rollCombatContact.forEach((button) => {
finishRoll(finalRoll.rollId, computed);
if (tJet !== 0 && computed.basejet === tExploit) {
const exploitRoll = await startRoll(`${roll}@{jetGM} &{template:simple} {{Nom=@{name}}} {{special1=${i18n_exploit}}}${jet}`);
const rExploit = exploitRoll.results.jet.dice;
const exploitPairOrImpair = isGuidage === true ? 1 : 0;
const jetExploit = rExploit.reduce((accumulateur, valeurCourante) => {
const vC = valeurCourante;
let nV = 0;
if (vC % 2 === exploitPairOrImpair) {
nV = 1;
}
return accumulateur + nV;
}, 0);
const exploitComputed = {
jet: jetExploit,
};
finishRoll(exploitRoll.rollId, exploitComputed);
}
await postRoll(computed, roll, jet, finalRoll, conditions);
if (hasEnergieRetiree) {
if (energieIsEspoir) {
+2 -24
View File
@@ -1,3 +1,4 @@
/* eslint-disable linebreak-style */
/* eslint-disable max-len */
/* eslint-disable prefer-destructuring */
/* eslint-disable camelcase */
@@ -806,11 +807,9 @@ rollCombatDistance.forEach((button) => {
if (isDevastation && !devaste && !equilibre) { exec.push(`{{vDevastation=${i18n_devastation} ${eDevastationValue} ${i18n_inclus}}}`); }
finalRoll = await startRoll(exec.join(' '));
const tJet = finalRoll.results.jet.result;
const rJet = finalRoll.results.jet.dice;
const tBonus = finalRoll.results.bonus.result;
const tExploit = finalRoll.results.Exploit.result;
const rDegats = finalRoll.results.degats.dice;
const rViolence = finalRoll.results.violence.dice;
@@ -843,28 +842,7 @@ rollCombatDistance.forEach((button) => {
finishRoll(finalRoll.rollId, computed);
if (tJet !== 0 && computed.basejet === tExploit) {
const exploitRoll = await startRoll(`${roll}@{jetGM} &{template:simple} {{Nom=@{name}}} {{special1=${i18n_exploit}}}${jet}`);
const rExploit = exploitRoll.results.jet.dice;
const exploitPairOrImpair = isGuidage === true ? 1 : 0;
const jetExploit = rExploit.reduce((accumulateur, valeurCourante) => {
const vC = valeurCourante;
let nV = 0;
if (vC % 2 === exploitPairOrImpair) {
nV = 1;
}
return accumulateur + nV;
}, 0);
const exploitComputed = {
jet: jetExploit,
};
finishRoll(exploitRoll.rollId, exploitComputed);
}
await postRoll(computed, roll, jet, finalRoll, conditions);
if (hasEnergieRetiree) {
if (energieIsEspoir) {
+2 -25
View File
@@ -1,3 +1,4 @@
/* eslint-disable linebreak-style */
/* eslint-disable max-len */
/* eslint-disable camelcase */
/* eslint-disable prefer-destructuring */
@@ -402,10 +403,8 @@ rollCombatGrenade.forEach((button) => {
exec = firstExec.concat(exec);
const finalRoll = await startRoll(exec.join(' '));
const tJet = finalRoll.results.jet.result;
const rJet = finalRoll.results.jet.dice;
const tBonus = finalRoll.results.bonus.result;
const tExploit = finalRoll.results.Exploit.result;
let rDegats = [];
let rViolence = [];
@@ -437,28 +436,6 @@ rollCombatGrenade.forEach((button) => {
const computed = updateRoll(finalRoll, rJet, tBonus, tDegats, rDegats, bDegats, tViolence, rViolence, bViolence, conditions);
finishRoll(finalRoll.rollId, computed);
if (tJet !== 0 && computed.basejet === tExploit) {
const exploitRoll = await startRoll(`${roll}@{jetGM} &{template:simple} {{Nom=@{name}}} {{special1=${i18n_exploit}}}${jet}`);
const rExploit = exploitRoll.results.jet.dice;
const exploitPairOrImpair = 0;
const jetExploit = rExploit.reduce((accumulateur, valeurCourante) => {
const vC = valeurCourante;
let nV = 0;
if (vC % 2 === exploitPairOrImpair) {
nV = 1;
}
return accumulateur + nV;
}, 0);
const exploitComputed = {
jet: jetExploit,
};
finishRoll(exploitRoll.rollId, exploitComputed);
}
await postRoll(computed, roll, jet, finalRoll, conditions);
});
});
+2 -24
View File
@@ -1,3 +1,4 @@
/* eslint-disable linebreak-style */
/* eslint-disable no-loop-func */
/* eslint-disable camelcase */
/* eslint-disable max-len */
@@ -417,11 +418,9 @@ for (let i = 0; i < rollCombatImprovise; i += 1) {
// ROLL
const finalRoll = await startRoll(exec.join(' '));
const tJet = finalRoll.results.jet.result;
const rJet = finalRoll.results.jet.dice;
const tBonus = finalRoll.results.bonus.result;
const tExploit = finalRoll.results.Exploit.result;
const rDegats = finalRoll.results.degats.dice;
const rViolence = finalRoll.results.violence.dice;
@@ -441,27 +440,6 @@ for (let i = 0; i < rollCombatImprovise; i += 1) {
finishRoll(finalRoll.rollId, computed);
if (tJet !== 0 && computed.basejet === tExploit) {
const exploitRoll = await startRoll(`${roll}@{jetGM} &{template:simple} {{Nom=@{name}}} {{special1=${i18n_exploit}}}${jet}`);
const rExploit = exploitRoll.results.jet.dice;
const exploitPairOrImpair = 0;
const jetExploit = rExploit.reduce((accumulateur, valeurCourante) => {
const vC = valeurCourante;
let nV = 0;
if (vC % 2 === exploitPairOrImpair) {
nV = 1;
}
return accumulateur + nV;
}, 0);
const exploitComputed = {
jet: jetExploit,
};
finishRoll(exploitRoll.rollId, exploitComputed);
}
await postRoll(computed, roll, jet, finalRoll, conditions);
});
}
+27 -159
View File
@@ -1,3 +1,4 @@
/* eslint-disable linebreak-style */
/* eslint-disable prefer-destructuring */
/* eslint-disable max-len */
/* eslint-disable camelcase */
@@ -15,9 +16,11 @@ druidRollSimple.forEach((button) => {
const attributs = [
'jetModifDesComp',
'equilibreBalance',
];
const attrs = await getAttrsAsync(attributs);
const equilibre = +attrs.equilibreBalance;
const exec = [];
const cRoll = [];
@@ -47,36 +50,17 @@ druidRollSimple.forEach((button) => {
exec.push(roll);
exec.push(`{{cBase=${aNom}}}`);
exec.push(`{{jet=[[ {{[[{${cRoll.join('+')}, 0}kh1]]d6cs2cs4cs6cf1cf3cf5s%2}=0}]]}}`);
exec.push(`{{Exploit=[[${cRoll.join('+')}]]}}`);
exec.push(`{{tBonus=[[${bonus.join('+')}]]}}`);
const bonusTotal = bonus.reduce((accumulateur, valeurCourante) => parseInt(accumulateur, 10) + parseInt(valeurCourante, 10), 0);
const stringRoll = `{{jet=[[ [[{${cRoll.join('+')}, 0}kh1]]d6cs2cs4cs6cf1cf3cf5s]]}}`;
exec.push(stringRoll);
exec.push('{{basejet=[[0]]}}');
exec.push(`{{tBonus=[[${bonusTotal}]]}}`);
const finalRoll = await startRoll(exec.join(' '));
const computed = computeSimpleRoll(finalRoll, bonusTotal);
startRoll(exec.join(' '), (results) => {
const tJet = results.results.jet.result;
const tBonus = results.results.tBonus.result;
const tExploit = results.results.Exploit.result;
const total = tJet + tBonus;
finishRoll(
results.rollId,
{
jet: total,
},
);
if (tJet !== 0 && tJet === tExploit) {
startRoll(`${roll}@{jetGM} &{template:simple} {{Nom=@{name}}} {{special1=${i18n_exploit}}}{{jet=[[ {[[{${cRoll.join('+')}, 0}kh1]]d6cs2cs4cs6cf1cf3cf5s%2}=0]]}}`, (exploit) => {
const tExploit2 = exploit.results.jet.result;
finishRoll(
exploit.rollId,
{
jet: tExploit2,
},
);
});
}
finishRoll(finalRoll.rollId, computed);
await postRoll(computed, roll, stringRoll, finalRoll, {
equilibre,
});
});
});
@@ -268,11 +252,9 @@ on('clicked:druidLionArmeBase', async (info) => {
const finalRoll = await startRoll(exec.join(' '));
const tJet = finalRoll.results.jet.result;
const rJet = finalRoll.results.jet.dice;
const tBonus = finalRoll.results.bonus.result;
const tExploit = finalRoll.results.Exploit.result;
const rDegats = finalRoll.results.degats.dice;
const rViolence = finalRoll.results.violence.dice;
@@ -289,29 +271,7 @@ on('clicked:druidLionArmeBase', async (info) => {
const computed = updateRoll(finalRoll, rJet, tBonus, tDegats, rDegats, bonusDegats, tViolence, rViolence, bonusViolence, conditions);
finishRoll(finalRoll.rollId, computed);
if (tJet !== 0 && computed.basejet === tExploit) {
const exploitRoll = await startRoll(`${roll}@{jetGM} &{template:simple} {{Nom=@{name}}} {{special1=${i18n_exploit}}}{{jet=[[ {[[{${cRoll.join('+')}, 0}kh1]]d6cs2cs4cs6cf1cf3cf5s%2}=0]]}}`);
const rExploit = exploitRoll.results.jet.dice;
const exploitPairOrImpair = 0;
const jetExploit = rExploit.reduce((accumulateur, valeurCourante) => {
const vC = valeurCourante;
let nV = 0;
if (vC % 2 === exploitPairOrImpair) {
nV = 1;
}
return accumulateur + nV;
}, 0);
const exploitComputed = {
jet: jetExploit,
};
finishRoll(exploitRoll.rollId, exploitComputed);
}
await postRoll(computed, roll, jet, finalRoll, conditions);
});
on('clicked:repeating_armeDruidLion:combatdruidroll', async (info) => {
@@ -1239,12 +1199,9 @@ on('clicked:repeating_armeDruidLion:combatdruidroll', async (info) => {
if (pasDEnergie === false) {
const finalRoll = await startRoll(exec.join(' '));
const tJet = finalRoll.results.jet.result;
const rJet = finalRoll.results.jet.dice;
const tBonus = finalRoll.results.bonus.result;
const tExploit = finalRoll.results.Exploit.result;
const rDegats = finalRoll.results.degats.dice;
const rViolence = finalRoll.results.violence.dice;
@@ -1276,29 +1233,7 @@ on('clicked:repeating_armeDruidLion:combatdruidroll', async (info) => {
const computed = updateRoll(finalRoll, rJet, tBonus, tDegats, rDegats, bonusDegats, tViolence, rViolence, bonusViolence, conditions, conditionsValues);
finishRoll(finalRoll.rollId, computed);
if (tJet !== 0 && computed.basejet === tExploit) {
const exploitRoll = await startRoll(`@{jetGM} &{template:simple} {{Nom=^{druid-companion-lion}}} {{special1=@{name}}} {{special1B=${i18n_exploit}}}${jet}`);
const rExploit = exploitRoll.results.jet.dice;
const exploitPairOrImpair = isGuidage === true ? 1 : 0;
const jetExploit = rExploit.reduce((accumulateur, valeurCourante) => {
const vC = valeurCourante;
let nV = 0;
if (vC % 2 === exploitPairOrImpair) {
nV = 1;
}
return accumulateur + nV;
}, 0);
const exploitComputed = {
jet: jetExploit,
};
finishRoll(exploitRoll.rollId, exploitComputed);
}
await postRoll(computed, roll, jet, finalRoll, conditions, '&{template:simple} {{Nom=^{druid-companion-lion}}} {{special1=@{name}}}');
if (hasEnergieRetiree) {
setAttrs({
@@ -1361,36 +1296,17 @@ MALDruidRollSimple.forEach((button) => {
exec.push(roll);
exec.push(`{{cBase=${aNom}}}`);
exec.push(`{{jet=[[ {{[[{${cRoll.join('+')}, 0}kh1]]d6cs2cs4cs6cf1cf3cf5s%2}=0}]]}}`);
exec.push(`{{Exploit=[[${cRoll.join('+')}]]}}`);
exec.push(`{{tBonus=[[${bonus.join('+')}]]}}`);
const bonusTotal = bonus.reduce((accumulateur, valeurCourante) => parseInt(accumulateur, 10) + parseInt(valeurCourante, 10), 0);
const stringRoll = `{{jet=[[ [[{${cRoll.join('+')}, 0}kh1]]d6cs2cs4cs6cf1cf3cf5s]]}}`;
exec.push(stringRoll);
exec.push('{{basejet=[[0]]}}');
exec.push(`{{tBonus=[[${bonusTotal}]]}}`);
const finalRoll = await startRoll(exec.join(' '));
const computed = computeSimpleRoll(finalRoll, bonusTotal);
startRoll(exec.join(' '), (results) => {
const tJet = results.results.jet.result;
const tBonus = results.results.tBonus.result;
const tExploit = results.results.Exploit.result;
const total = tJet + tBonus;
finishRoll(
results.rollId,
{
jet: total,
},
);
if (tJet !== 0 && tJet === tExploit) {
startRoll(`${roll}@{jetGM} &{template:simple} {{Nom=@{name}}} {{special1=${i18n_exploit}}}{{jet=[[ {[[{${cRoll.join('+')}, 0}kh1]]d6cs2cs4cs6cf1cf3cf5s%2}=0]]}}`, (exploit) => {
const tExploit2 = exploit.results.jet.result;
finishRoll(
exploit.rollId,
{
jet: tExploit2,
},
);
});
}
finishRoll(finalRoll.rollId, computed);
await postRoll(computed, roll, stringRoll, finalRoll, {
equilibre,
});
});
});
@@ -1582,11 +1498,9 @@ on('clicked:MALDruidLionArmeBase', async (info) => {
const finalRoll = await startRoll(exec.join(' '));
const tJet = finalRoll.results.jet.result;
const rJet = finalRoll.results.jet.dice;
const tBonus = finalRoll.results.bonus.result;
const tExploit = finalRoll.results.Exploit.result;
const tDegats = finalRoll.results.degats.result;
const tViolence = finalRoll.results.violence.result;
@@ -1603,29 +1517,7 @@ on('clicked:MALDruidLionArmeBase', async (info) => {
const computed = updateRoll(finalRoll, rJet, tBonus, tDegats, rDegats, bonusDegats, tViolence, rViolence, bonusViolence, conditions);
finishRoll(finalRoll.rollId, computed);
if (tJet !== 0 && computed.basejet === tExploit) {
const exploitRoll = await startRoll(`$${roll}@{jetGM} &{template:simple} {{Nom=@{name}}} {{special1=${i18n_exploit}}}{{jet=[[ {[[{${cRoll.join('+')}, 0}kh1]]d6cs2cs4cs6cf1cf3cf5s%2}=0]]}}`);
const rExploit = exploitRoll.results.jet.dice;
const exploitPairOrImpair = 0;
const jetExploit = rExploit.reduce((accumulateur, valeurCourante) => {
const vC = valeurCourante;
let nV = 0;
if (vC % 2 === exploitPairOrImpair) {
nV = 1;
}
return accumulateur + nV;
}, 0);
const exploitComputed = {
jet: jetExploit,
};
finishRoll(exploitRoll.rollId, exploitComputed);
}
await postRoll(computed, roll, jet, finalRoll, conditions);
});
on('clicked:repeating_armeMALDruidLion:combatdruidroll', async (info) => {
@@ -2536,11 +2428,9 @@ on('clicked:repeating_armeMALDruidLion:combatdruidroll', async (info) => {
if (pasDEnergie === false) {
const finalRoll = await startRoll(exec.join(' '));
const tJet = finalRoll.results.jet.result;
const rJet = finalRoll.results.jet.dice;
const tBonus = finalRoll.results.bonus.result;
const tExploit = finalRoll.results.Exploit.result;
const rDegats = finalRoll.results.degats.dice;
const rViolence = finalRoll.results.violence.dice;
@@ -2572,29 +2462,7 @@ on('clicked:repeating_armeMALDruidLion:combatdruidroll', async (info) => {
const computed = updateRoll(finalRoll, rJet, tBonus, tDegats, rDegats, bonusDegats, tViolence, rViolence, bonusViolence, conditions, conditionsValues);
finishRoll(finalRoll.rollId, computed);
if (tJet !== 0 && computed.basejet === tExploit) {
const exploitRoll = await startRoll(`@{jetGM} &{template:simple} {{Nom=^{druid-companion-lion}}} {{special1=@{name}}} {{special1B=${i18n_exploit}}} {{jet=[[ {[[{${tJetDice}, 0}kh1]]d6cs2cs4cs6cf1cf3cf5s%2}=0]]}}`);
const rExploit = exploitRoll.results.jet.dice;
const exploitPairOrImpair = isGuidage === true ? 1 : 0;
const jetExploit = rExploit.reduce((accumulateur, valeurCourante) => {
const vC = valeurCourante;
let nV = 0;
if (vC % 2 === exploitPairOrImpair) {
nV = 1;
}
return accumulateur + nV;
}, 0);
const exploitComputed = {
jet: jetExploit,
};
finishRoll(exploitRoll.rollId, exploitComputed);
}
await postRoll(computed, roll, jet, finalRoll, conditions, '&{template:simple} {{Nom=^{druid-companion-lion}}} {{special1=@{name}}}');
if (hasEnergieRetiree) {
setAttrs({
+13 -29
View File
@@ -1,3 +1,4 @@
/* eslint-disable linebreak-style */
/* eslint-disable default-case */
/* eslint-disable max-len */
/* eslint-disable prefer-destructuring */
@@ -17,9 +18,11 @@ monkZenRoll.forEach((button) => {
'MALWarriorScholarA',
'MALWarriorHeraldA',
'MALWarriorScoutA',
'equilibreBalance',
];
const attrs = await getAttrsAsync(attributs);
const equilibre = +attrs.equilibreBalance;
const armureL = attrs.armureLegende;
@@ -115,36 +118,17 @@ monkZenRoll.forEach((button) => {
bonus = bonus.concat(OD);
bonus = bonus.concat(ODMALWarrior);
exec.push(`{{jet=[[ {[[{${cRoll.join('+')}, 0}kh1]]d6cs2cs4cs6cf1cf3cf5s%2}=0]]}}`);
exec.push(`{{tBonus=[[${bonus.join('+')}+0]]}}`);
exec.push(`{{Exploit=[[${cRoll.join('+')}]]}}`);
const bonusTotal = bonus.reduce((accumulateur, valeurCourante) => parseInt(accumulateur, 10) + parseInt(valeurCourante, 10), 0);
const stringRoll = `{{jet=[[ [[{${cRoll.join('+')}, 0}kh1]]d6cs2cs4cs6cf1cf3cf5s]]}}`;
exec.push(stringRoll);
exec.push('{{basejet=[[0]]}}');
exec.push(`{{tBonus=[[${bonusTotal}]]}}`);
const finalRoll = await startRoll(exec.join(' '));
const computed = computeSimpleRoll(finalRoll, bonusTotal);
startRoll(exec.join(' '), (results) => {
const tJet = results.results.jet.result;
const tBonus = results.results.tBonus.result;
const tExploit = results.results.Exploit.result;
const total = tJet + tBonus;
finishRoll(
results.rollId,
{
jet: total,
},
);
if (tJet !== 0 && tJet === tExploit) {
startRoll(`${roll}@{jetGM} &{template:simple} {{Nom=@{name}}} {{special1=${i18n_exploit}}}{{jet=[[ {[[{${cRoll.join('+')}, 0}kh1]]d6cs2cs4cs6cf1cf3cf5s%2}=0]]}}`, (exploit) => {
const tExploit2 = exploit.results.jet.result;
finishRoll(
exploit.rollId,
{
jet: tExploit2,
},
);
});
}
finishRoll(finalRoll.rollId, computed);
await postRoll(computed, roll, stringRoll, finalRoll, {
equilibre,
});
});
});
+1
View File
@@ -1,3 +1,4 @@
/* eslint-disable linebreak-style */
/* eslint-disable no-undef */
const priestRollMechanic = ['priestJetMechanicContact', 'priestJetMechanicDistance', 'rollMALPriestJetMechanicContact', 'rollMALPriestJetMechanicDistance'];
+2 -25
View File
@@ -1,3 +1,4 @@
/* eslint-disable linebreak-style */
/* eslint-disable default-case */
/* eslint-disable camelcase */
/* eslint-disable prefer-destructuring */
@@ -795,11 +796,9 @@ on('clicked:distanceRangerLongbow', async (info) => {
if (!pasEnergie) {
finalRoll = await startRoll(exec.join(' '));
const tJet = finalRoll.results.jet.result;
const rJet = finalRoll.results.jet.dice;
const tBonus = finalRoll.results.bonus.result;
const tExploit = finalRoll.results.Exploit.result;
const rDegats = finalRoll.results.degats.dice;
const rViolence = finalRoll.results.violence.dice;
@@ -819,29 +818,7 @@ on('clicked:distanceRangerLongbow', async (info) => {
const computed = updateRoll(finalRoll, rJet, tBonus, tDegats, rDegats, bonusDegats, tViolence, rViolence, bonusViolence, conditions);
finishRoll(finalRoll.rollId, computed);
if (tJet !== 0 && computed.basejet === tExploit) {
const exploitRoll = await startRoll(`${roll}@{jetGM} &{template:simple} {{Nom=@{name}}} {{special1=${i18n_exploit}}}${jet}`);
const rExploit = exploitRoll.results.jet.dice;
const exploitPairOrImpair = 0;
const jetExploit = rExploit.reduce((accumulateur, valeurCourante) => {
const vC = valeurCourante;
let nV = 0;
if (vC % 2 === exploitPairOrImpair) {
nV = 1;
}
return accumulateur + nV;
}, 0);
const exploitComputed = {
jet: jetExploit,
};
finishRoll(exploitRoll.rollId, exploitComputed);
}
await postRoll(computed, roll, jet, finalRoll, conditions);
setAttrs({
energiePJ: resultatEnergie,
+1
View File
@@ -1,3 +1,4 @@
/* eslint-disable linebreak-style */
/* eslint-disable no-undef */
on('clicked:recuperation', (info) => {
const roll = info.htmlAttributes.value;
+25 -58
View File
@@ -1,3 +1,4 @@
/* eslint-disable linebreak-style */
/* eslint-disable default-case */
/* eslint-disable camelcase */
/* eslint-disable max-len */
@@ -15,11 +16,13 @@ on('clicked:simple clicked:simpleRogue', async (info) => {
'caracteristique4',
'discretion',
ODValue.discretion,
'equilibreBalance',
];
attributs = attributs.concat(listBase, listArmure, listArmureLegende);
const attrs = await getAttrsAsync(attributs);
const equilibre = +attrs.equilibreBalance;
const armure = attrs.armure;
const armureL = attrs.armureLegende;
@@ -159,38 +162,19 @@ on('clicked:simple clicked:simpleRogue', async (info) => {
bonus = bonus.concat(ODMALShaman);
bonus = bonus.concat(ODMALWarrior);
exec.push(`{{jet=[[ {[[{${cRoll.join('+')}, 0}kh1]]d6cs2cs4cs6cf1cf3cf5s%2}=0]]}}`);
exec.push(`{{tBonus=[[${bonus.join('+')}+0]]}}`);
exec.push(`{{Exploit=[[${cRoll.join('+')}]]}}`);
if (isConditionnel === true) { exec.push('{{conditionnel=true}}'); }
startRoll(exec.join(' '), (results) => {
const tJet = results.results.jet.result;
const tBonus = results.results.tBonus.result;
const tExploit = results.results.Exploit.result;
const bonusTotal = bonus.reduce((accumulateur, valeurCourante) => parseInt(accumulateur, 10) + parseInt(valeurCourante, 10), 0);
const stringRoll = `{{jet=[[ [[{${cRoll.join('+')}, 0}kh1]]d6cs2cs4cs6cf1cf3cf5s]]}}`;
exec.push(stringRoll);
exec.push('{{basejet=[[0]]}}');
exec.push(`{{tBonus=[[${bonusTotal}]]}}`);
const finalRoll = await startRoll(exec.join(' '));
const computed = computeSimpleRoll(finalRoll, bonusTotal);
const total = tJet + tBonus;
finishRoll(
results.rollId,
{
jet: total,
},
);
if (tJet !== 0 && tJet === tExploit) {
startRoll(`${roll}@{jetGM} &{template:simple} {{Nom=@{name}}} {{special1=${i18n_exploit}}}{{jet=[[ {[[{${cRoll.join('+')}, 0}kh1]]d6cs2cs4cs6cf1cf3cf5s%2}=0]]}}`, (exploit) => {
const tExploit2 = exploit.results.jet.result;
finishRoll(
exploit.rollId,
{
jet: tExploit2,
},
);
});
}
finishRoll(finalRoll.rollId, computed);
await postRoll(computed, roll, stringRoll, finalRoll, {
equilibre,
});
});
@@ -206,11 +190,13 @@ on('clicked:simplePriest', async (info) => {
'caracteristique4',
'discretion',
ODValue.discretion,
'equilibreBalance',
];
attributs = attributs.concat(listBase, listArmureLegende);
const attrs = await getAttrsAsync(attributs);
const equilibre = +attrs.equilibreBalance;
const armureL = attrs.armureLegende;
@@ -332,36 +318,17 @@ on('clicked:simplePriest', async (info) => {
if (isConditionnel === true) { exec.push('{{conditionnel=true}}'); }
exec.push(`{{jet=[[ {[[{${cRoll.join('+')}, 0}kh1]]d6cs2cs4cs6cf1cf3cf5s%2}=0]]}}`);
exec.push(`{{tBonus=[[${bonus.join('+')}+0]]}}`);
exec.push(`{{Exploit=[[${cRoll.join('+')}]]}}`);
const bonusTotal = bonus.reduce((accumulateur, valeurCourante) => parseInt(accumulateur, 10) + parseInt(valeurCourante, 10), 0);
const stringRoll = `{{jet=[[ [[{${cRoll.join('+')}, 0}kh1]]d6cs2cs4cs6cf1cf3cf5s]]}}`;
exec.push(stringRoll);
exec.push('{{basejet=[[0]]}}');
exec.push(`{{tBonus=[[${bonusTotal}]]}}`);
const finalRoll = await startRoll(exec.join(' '));
const computed = computeSimpleRoll(finalRoll, bonusTotal);
startRoll(exec.join(' '), (results) => {
const tJet = results.results.jet.result;
const tBonus = results.results.tBonus.result;
const tExploit = results.results.Exploit.result;
const total = tJet + tBonus;
finishRoll(
results.rollId,
{
jet: total,
},
);
if (tJet !== 0 && tJet === tExploit) {
startRoll(`${roll}@{jetGM} &{template:simple} {{Nom=@{name}}} {{special1=${i18n_exploit}}}{{jet=[[ {[[{${cRoll.join('+')}, 0}kh1]]d6cs2cs4cs6cf1cf3cf5s%2}=0]]}}`, (exploit) => {
const tExploit2 = exploit.results.jet.result;
finishRoll(
exploit.rollId,
{
jet: tExploit2,
},
);
});
}
finishRoll(finalRoll.rollId, computed);
await postRoll(computed, roll, stringRoll, finalRoll, {
equilibre,
});
});
+2 -25
View File
@@ -1,3 +1,4 @@
/* eslint-disable linebreak-style */
/* eslint-disable default-case */
/* eslint-disable camelcase */
/* eslint-disable max-len */
@@ -279,11 +280,9 @@ on('clicked:distanceWizardBorealis', async (info) => {
// ROLL
const finalRoll = await startRoll(exec.join(' '));
const tJet = finalRoll.results.jet.result;
const rJet = finalRoll.results.jet.dice;
const tBonus = finalRoll.results.tBonus.result;
const tExploit = finalRoll.results.Exploit.result;
const rDegats = finalRoll.results.degats.dice;
const rViolence = finalRoll.results.violence.dice;
@@ -300,29 +299,7 @@ on('clicked:distanceWizardBorealis', async (info) => {
const computed = updateRoll(finalRoll, rJet, tBonus, tDegats, rDegats, [], tViolence, rViolence, [], conditions);
finishRoll(finalRoll.rollId, computed);
if (tJet !== 0 && computed.basejet === tExploit) {
const exploitRoll = await startRoll(`${roll}@{jetGM} &{template:simple} {{Nom=@{name}}} {{special1=${i18n_exploit}}}${jet}`);
const rExploit = exploitRoll.results.jet.dice;
const exploitPairOrImpair = 0;
const jetExploit = rExploit.reduce((accumulateur, valeurCourante) => {
const vC = valeurCourante;
let nV = 0;
if (vC % 2 === exploitPairOrImpair) {
nV = 1;
}
return accumulateur + nV;
}, 0);
const exploitComputed = {
jet: jetExploit,
};
finishRoll(exploitRoll.rollId, exploitComputed);
}
await postRoll(computed, roll, jet, finalRoll, conditions);
});
on('clicked:distanceWizardOriflamme', async (info) => {
-1
View File
@@ -474,7 +474,6 @@
}
h1.titre {
display: flex;
width: 100%;
align-content: baseline;
background: $background;
+1
View File
@@ -1318,6 +1318,7 @@
"devaster-anatheme":"Dévaster l'Anathème actif",
"bourreau-tenebres":"Bourreau des ténèbres actif",
"equilibrer-balance":"Équilibrer la balance actif",
"equilibrer-balance-short":"Équilibrer la balance",
"membre-section-kraken":"Membre de la section Kraken.",
"codex-fm-4":"Ajouter les grenades / effets du codex FM 4.",
"guidage":"Guidage",