Merge pull request #10031 from Zakarik/Knight
[Knight] Bugfix Roll NPC / Other Weapons
This commit is contained in:
+318
-414
File diff suppressed because it is too large
Load Diff
@@ -513,6 +513,8 @@ function getWeaponsEffectsPNJ(prefix, data, addChair, vChair, vMachine, vMachine
|
||||
let isMeurtrier = false;
|
||||
let isOrfevrerie = false;
|
||||
let isSilencieux = false;
|
||||
let isFureur = false;
|
||||
let isUltraviolence = false;
|
||||
|
||||
const eAnatheme = isApplied(data[`${prefix}anatheme`]);
|
||||
const eAntiAnatheme = isApplied(data[`${prefix}antiAnatheme`]);
|
||||
@@ -650,6 +652,7 @@ function getWeaponsEffectsPNJ(prefix, data, addChair, vChair, vMachine, vMachine
|
||||
|
||||
if (eFureur) {
|
||||
isConditionnelV = true;
|
||||
isFureur = true;
|
||||
|
||||
firstExec.push(`{{fureurValue=[[${eFureurV}D6]]}}`);
|
||||
|
||||
@@ -742,6 +745,7 @@ function getWeaponsEffectsPNJ(prefix, data, addChair, vChair, vMachine, vMachine
|
||||
|
||||
if (eUltraviolence) {
|
||||
isConditionnelV = true;
|
||||
isUltraviolence = true;
|
||||
|
||||
firstExec.push(`{{ultraviolenceValue=[[${eUltraviolenceV}D6]]}}`);
|
||||
|
||||
@@ -816,6 +820,8 @@ function getWeaponsEffectsPNJ(prefix, data, addChair, vChair, vMachine, vMachine
|
||||
result.isMeurtrier = isMeurtrier;
|
||||
result.isOrfevrerie = isOrfevrerie;
|
||||
result.isSilencieux = isSilencieux;
|
||||
result.isFureur = isFureur;
|
||||
result.isUltraviolence = isUltraviolence;
|
||||
|
||||
result.attaquesSurprises = attaquesSurprises;
|
||||
result.attaquesSurprisesValue = attaquesSurprisesValue;
|
||||
@@ -872,6 +878,8 @@ function getWeaponsEffectsAutre(prefix, effet) {
|
||||
let isSilencieux = false;
|
||||
let isTenebricide = false;
|
||||
let isTirRafale = false;
|
||||
let isFureur = false;
|
||||
let isUltraviolence = false;
|
||||
|
||||
const eAntiAnatheme = isApplied(effet[`${prefix}antiAnatheme`]);
|
||||
const eAntiVehicule = isApplied(effet[`${prefix}antiVehicule`]);
|
||||
@@ -1007,6 +1015,7 @@ function getWeaponsEffectsAutre(prefix, effet) {
|
||||
|
||||
if (eFureur) {
|
||||
isConditionnelV = true;
|
||||
isFureur = true;
|
||||
|
||||
firstExec.push(`{{fureurValue=[[${eFureurV}D6]]}}`);
|
||||
|
||||
@@ -1086,6 +1095,7 @@ function getWeaponsEffectsAutre(prefix, effet) {
|
||||
|
||||
if (eUltraviolence) {
|
||||
isConditionnelV = true;
|
||||
isUltraviolence = true;
|
||||
|
||||
firstExec.push(`{{ultraviolenceValue=[[${eUltraviolenceV}D6]]}}`);
|
||||
|
||||
@@ -1166,6 +1176,8 @@ function getWeaponsEffectsAutre(prefix, effet) {
|
||||
result.isAssistantAttaque = isAssistantAttaque;
|
||||
result.isAntiAnatheme = isAntiAnatheme;
|
||||
result.isTirRafale = isTirRafale;
|
||||
result.isFureur = isFureur;
|
||||
result.isUltraviolence = isUltraviolence;
|
||||
|
||||
result.eLumiere = eLumiere;
|
||||
result.isELumiere = isELumiere;
|
||||
@@ -1231,6 +1243,8 @@ function getWeaponsEffectsAutrePNJ(prefix, effet) {
|
||||
let isSilencieux = false;
|
||||
let isTenebricide = false;
|
||||
let isTirRafale = false;
|
||||
let isUltraviolence = false;
|
||||
let isFureur = false;
|
||||
|
||||
const eAnatheme = isApplied(effet[`${prefix}anatheme`]);
|
||||
const eAntiAnatheme = isApplied(effet[`${prefix}antiAnatheme`]);
|
||||
@@ -1367,6 +1381,7 @@ function getWeaponsEffectsAutrePNJ(prefix, effet) {
|
||||
|
||||
if (eFureur) {
|
||||
isConditionnelV = true;
|
||||
isFureur = true;
|
||||
|
||||
firstExec.push(`{{fureurValue=[[${eFureurV}D6]]}}`);
|
||||
|
||||
@@ -1446,6 +1461,7 @@ function getWeaponsEffectsAutrePNJ(prefix, effet) {
|
||||
|
||||
if (eUltraviolence) {
|
||||
isConditionnelV = true;
|
||||
isUltraviolence = true;
|
||||
|
||||
firstExec.push(`{{ultraviolenceValue=[[${eUltraviolenceV}D6]]}}`);
|
||||
|
||||
@@ -1528,6 +1544,8 @@ function getWeaponsEffectsAutrePNJ(prefix, effet) {
|
||||
result.isAssistantAttaque = isAssistantAttaque;
|
||||
result.isAntiAnatheme = isAntiAnatheme;
|
||||
result.isTirRafale = isTirRafale;
|
||||
result.isFureur = isFureur;
|
||||
result.isUltraviolence = isUltraviolence;
|
||||
|
||||
result.eLumiere = eLumiere;
|
||||
result.isELumiere = isELumiere;
|
||||
@@ -4001,6 +4019,8 @@ function updateRoll(roll, totalDegats, diceDegats, bonusDegats, totalViolence, d
|
||||
}
|
||||
}
|
||||
|
||||
log(vTDestructeur);
|
||||
|
||||
const computed = {
|
||||
degats: tDegats,
|
||||
violence: tViolence,
|
||||
|
||||
@@ -90,6 +90,7 @@ rollCombatAutre.forEach((button) => {
|
||||
let vCadence = 0;
|
||||
let isDestructeur = false;
|
||||
let vDestructeur = 0;
|
||||
let isFureur = false;
|
||||
let isMeurtrier = false;
|
||||
let vMeurtrier = 0;
|
||||
let nowSilencieux = false;
|
||||
@@ -97,6 +98,8 @@ rollCombatAutre.forEach((button) => {
|
||||
let isTenebricide = false;
|
||||
let isTirRafale = false;
|
||||
let isChambreDouble = false;
|
||||
let isUltraviolence = false;
|
||||
let isSurprise = false;
|
||||
|
||||
let isELumiere = false;
|
||||
let lumiereValue = 0;
|
||||
@@ -134,6 +137,10 @@ rollCombatAutre.forEach((button) => {
|
||||
isMeurtrier = effets.isMeurtrier;
|
||||
vMeurtrier = effets.vMeurtrier;
|
||||
|
||||
isFureur = effets.isFureur;
|
||||
|
||||
isUltraviolence = effets.isUltraviolence;
|
||||
|
||||
nowSilencieux = effets.nowSilencieux;
|
||||
|
||||
isTenebricide = effets.isTenebricide;
|
||||
@@ -249,47 +256,6 @@ rollCombatAutre.forEach((button) => {
|
||||
exec.push(`{{degats=[[${degats.join('+')}]]}}`);
|
||||
exec.push(`{{violence=[[${violence.join('+')}]]}}`);
|
||||
|
||||
if (isTenebricide) {
|
||||
let degatsTenebricide = [];
|
||||
let ASTenebricide = [];
|
||||
let ASValueTenebricide = [];
|
||||
|
||||
let violenceTenebricide = [];
|
||||
|
||||
const diceDegatsTenebricide = Math.floor(diceDegats / 2);
|
||||
const diceViolenceTenebricide = Math.floor(diceViolence / 2);
|
||||
|
||||
degatsTenebricide.push(`${diceDegatsTenebricide}D6`);
|
||||
degatsTenebricide = degatsTenebricide.concat(bDegats);
|
||||
|
||||
violenceTenebricide.push(`${diceViolenceTenebricide}D6`);
|
||||
violenceTenebricide = violenceTenebricide.concat(bViolence);
|
||||
|
||||
exec.push(`{{tenebricideValueD=[[${degatsTenebricide.join('+')}]]}}`);
|
||||
exec.push(`{{tenebricideValueV=[[${violenceTenebricide.join('+')}]]}}`);
|
||||
|
||||
if (eASAssassinValue > 0) {
|
||||
eAssassinTenebricideValue = Math.ceil(eASAssassinValue / 2);
|
||||
|
||||
ASTenebricide.unshift(eASAssassin);
|
||||
ASValueTenebricide.unshift(`${eAssassinTenebricideValue}D6`);
|
||||
|
||||
if (attaquesSurprises.length > 0) {
|
||||
ASTenebricide = ASTenebricide.concat(attaquesSurprises);
|
||||
ASValueTenebricide = ASValueTenebricide.concat(attaquesSurprisesValue);
|
||||
}
|
||||
|
||||
exec.push(`{{tenebricideAS=${ASTenebricide.join('\n+')}}}`);
|
||||
exec.push(`{{tenebricideASValue=[[${ASValueTenebricide.join('+')}]]}}`);
|
||||
} else if (attaquesSurprises.length > 0) {
|
||||
ASTenebricide = ASTenebricide.concat(attaquesSurprises);
|
||||
ASValueTenebricide = ASValueTenebricide.concat(attaquesSurprisesValue);
|
||||
|
||||
exec.push(`{{tenebricideAS=${ASTenebricide.join('\n+')}}}`);
|
||||
exec.push(`{{tenebricideASValue=[[${ASValueTenebricide.join('+')}]]}}`);
|
||||
}
|
||||
}
|
||||
|
||||
if (isObliteration) {
|
||||
let ASObliteration = [];
|
||||
let ASValueObliteration = [];
|
||||
@@ -347,6 +313,24 @@ rollCombatAutre.forEach((button) => {
|
||||
exec.push(`{{attaqueSurprise=${attaquesSurprises.join('\n+')}}}`);
|
||||
exec.push(`{{attaqueSurpriseValue=[[${attaquesSurprisesValue.join('+')}]]}}`);
|
||||
exec.push(attaquesSurprisesCondition);
|
||||
|
||||
isSurprise = true;
|
||||
}
|
||||
|
||||
if (isTenebricide) {
|
||||
exec.push(`{{tenebricide=${i18n_tenebricide}}} {{tenebricideConditionD=${i18n_tenebricideConditionD}}} {{tenebricideConditionV=${i18n_tenebricideConditionV}}}`);
|
||||
exec.push('{{tenebricideValueD=[[0]]}}');
|
||||
exec.push('{{tenebricideValueV=[[0]]}}');
|
||||
|
||||
if (attaquesSurprises.length > 0) {
|
||||
exec.push(`{{tenebricideAS=${attaquesSurprises.join('\n+')}}}`);
|
||||
exec.push('{{tenebricideASValue=[[0]]}}');
|
||||
}
|
||||
|
||||
if (isMeurtrier) { firstExec.push('{{tMeurtrierValue=[[0]]}}'); }
|
||||
if (isDestructeur) { firstExec.push('{{tDestructeurValue=[[0]]}}'); }
|
||||
if (isFureur) { firstExec.push('{{tFureurValue=[[0]]}}'); }
|
||||
if (isUltraviolence) { firstExec.push('{{tUltraviolenceValue=[[0]]}}'); }
|
||||
}
|
||||
|
||||
if (isELumiere) { autresEffets.push(`${i18n_lumiere} ${lumiereValue}`); }
|
||||
@@ -378,56 +362,46 @@ rollCombatAutre.forEach((button) => {
|
||||
|
||||
exec = firstExec.concat(exec);
|
||||
|
||||
startRoll(exec.join(' '), (results) => {
|
||||
const tJet = results.results.jet.result;
|
||||
// ROLL
|
||||
const finalRoll = await startRoll(exec.join(' '));
|
||||
const tJet = finalRoll.results.jet.result;
|
||||
|
||||
const tBonus = results.results.bonus.result;
|
||||
const tExploit = results.results.Exploit.result;
|
||||
const tBonus = finalRoll.results.bonus.result;
|
||||
const tExploit = finalRoll.results.Exploit.result;
|
||||
|
||||
const tMeurtrier = results.results.meurtrierValue;
|
||||
let vTMeurtrier = 0;
|
||||
const rDegats = finalRoll.results.degats.dice;
|
||||
const rViolence = finalRoll.results.violence.dice;
|
||||
|
||||
if (tMeurtrier !== undefined) { vTMeurtrier = tMeurtrier.dice[0]; }
|
||||
const tDegats = finalRoll.results.degats.result;
|
||||
const tViolence = finalRoll.results.violence.result;
|
||||
|
||||
const tDestructeur = results.results.destructeurValue;
|
||||
let vTDestructeur = 0;
|
||||
const conditions = {
|
||||
isTenebricide,
|
||||
isDestructeur,
|
||||
isFureur,
|
||||
isSurprise,
|
||||
isMeurtrier,
|
||||
isUltraviolence,
|
||||
};
|
||||
|
||||
if (tDestructeur !== undefined) { vTDestructeur = tDestructeur.dice[0]; }
|
||||
const computed = updateRoll(finalRoll, tDegats, rDegats, bDegats, tViolence, rViolence, bViolence, conditions);
|
||||
|
||||
const tFureur = results.results.fureurValue;
|
||||
let vTFureur = 0;
|
||||
const finalComputed = {
|
||||
jet: tJet + tBonus,
|
||||
};
|
||||
|
||||
if (tFureur !== undefined) { vTFureur = tFureur.dice[0] + tFureur.dice[1]; }
|
||||
Object.assign(finalComputed, computed);
|
||||
|
||||
const tUltraviolence = results.results.ultraviolenceValue;
|
||||
finishRoll(finalRoll.rollId, finalComputed);
|
||||
|
||||
let vTUltraviolence = 0;
|
||||
if (tJet !== 0 && tJet === tExploit) {
|
||||
const exploitRoll = await startRoll(`${roll}@{jetGM} &{template:simple} {{Nom=@{name}}} {{special1=${i18n_exploit}}}${jet}`);
|
||||
const tRExploit = exploitRoll.results.jet.result;
|
||||
const exploitComputed = {
|
||||
jet: tRExploit,
|
||||
};
|
||||
|
||||
if (tUltraviolence !== undefined) { vTUltraviolence = tUltraviolence.dice[0]; }
|
||||
|
||||
finishRoll(
|
||||
results.rollId,
|
||||
{
|
||||
jet: tJet + tBonus,
|
||||
meurtrierValue: vTMeurtrier,
|
||||
destructeurValue: vTDestructeur,
|
||||
fureurValue: vTFureur,
|
||||
ultraviolenceValue: vTUltraviolence,
|
||||
},
|
||||
);
|
||||
|
||||
if (tJet !== 0 && tJet === tExploit) {
|
||||
startRoll(`${roll}@{jetGM} &{template:simple} {{Nom=@{name}}} {{special1=${i18n_exploit}}}${jet}`, (exploit) => {
|
||||
const tExploit2 = exploit.results.jet.result;
|
||||
|
||||
finishRoll(
|
||||
exploit.rollId,
|
||||
{
|
||||
jet: tExploit2,
|
||||
},
|
||||
);
|
||||
});
|
||||
}
|
||||
});
|
||||
finishRoll(exploitRoll.rollId, exploitComputed);
|
||||
}
|
||||
});
|
||||
});
|
||||
|
||||
@@ -67,11 +67,11 @@ rollCombatAutrePNJ.forEach((button) => {
|
||||
let bDegats = [];
|
||||
const bViolence = [];
|
||||
|
||||
diceDegats += Number(attrs.armeAutreDegat) || 0;
|
||||
diceViolence += Number(attrs.armeAutreViolence) || 0;
|
||||
diceDegats += Number(attrs[`${prefix}armeAutreDegat`]) || 0;
|
||||
diceViolence += Number(attrs[`${prefix}armeAutreViolence`]) || 0;
|
||||
|
||||
bDegats.push(Number(attrs.armeAutreBDegat) || 0);
|
||||
bViolence.push(Number(attrs.armeAutreBViolence) || 0);
|
||||
bDegats.push(Number(attrs[`${prefix}armeAutreBDegat`]) || 0);
|
||||
bViolence.push(Number(attrs[`${prefix}armeAutreBViolence`]) || 0);
|
||||
|
||||
let degats = [];
|
||||
let violence = [];
|
||||
@@ -97,6 +97,9 @@ rollCombatAutrePNJ.forEach((button) => {
|
||||
let isTenebricide = false;
|
||||
let isTirRafale = false;
|
||||
let isChambreDouble = false;
|
||||
let isFureur = false;
|
||||
let isUltraviolence = false;
|
||||
let isSurprise = false;
|
||||
|
||||
let isELumiere = false;
|
||||
let lumiereValue = 0;
|
||||
@@ -142,6 +145,8 @@ rollCombatAutrePNJ.forEach((button) => {
|
||||
|
||||
isObliteration = effets.isObliteration;
|
||||
isTirRafale = effets.isTirRafale;
|
||||
isFureur = effets.isFureur;
|
||||
isUltraviolence = effets.isUltraviolence;
|
||||
|
||||
isELumiere = effets.isELumiere;
|
||||
lumiereValue = Number(effets.eLumiereValue);
|
||||
@@ -251,47 +256,6 @@ rollCombatAutrePNJ.forEach((button) => {
|
||||
exec.push(`{{degats=[[${degats.join('+')}]]}}`);
|
||||
exec.push(`{{violence=[[${violence.join('+')}]]}}`);
|
||||
|
||||
if (isTenebricide) {
|
||||
let degatsTenebricide = [];
|
||||
let ASTenebricide = [];
|
||||
let ASValueTenebricide = [];
|
||||
|
||||
let violenceTenebricide = [];
|
||||
|
||||
const diceDegatsTenebricide = Math.floor(diceDegats / 2);
|
||||
const diceViolenceTenebricide = Math.floor(diceViolence / 2);
|
||||
|
||||
degatsTenebricide.push(`${diceDegatsTenebricide}D6`);
|
||||
degatsTenebricide = degatsTenebricide.concat(bDegats);
|
||||
|
||||
violenceTenebricide.push(`${diceViolenceTenebricide}D6`);
|
||||
violenceTenebricide = violenceTenebricide.concat(bViolence);
|
||||
|
||||
exec.push(`{{tenebricideValueD=[[${degatsTenebricide.join('+')}]]}}`);
|
||||
exec.push(`{{tenebricideValueV=[[${violenceTenebricide.join('+')}]]}}`);
|
||||
|
||||
if (eASAssassinValue > 0) {
|
||||
eAssassinTenebricideValue = Math.ceil(eASAssassinValue / 2);
|
||||
|
||||
ASTenebricide.unshift(eASAssassin);
|
||||
ASValueTenebricide.unshift(`${eAssassinTenebricideValue}D6`);
|
||||
|
||||
if (attaquesSurprises.length > 0) {
|
||||
ASTenebricide = ASTenebricide.concat(attaquesSurprises);
|
||||
ASValueTenebricide = ASValueTenebricide.concat(attaquesSurprisesValue);
|
||||
}
|
||||
|
||||
exec.push(`{{tenebricideAS=${ASTenebricide.join('\n+')}}}`);
|
||||
exec.push(`{{tenebricideASValue=[[${ASValueTenebricide.join('+')}]]}}`);
|
||||
} else if (attaquesSurprises.length > 0) {
|
||||
ASTenebricide = ASTenebricide.concat(attaquesSurprises);
|
||||
ASValueTenebricide = ASValueTenebricide.concat(attaquesSurprisesValue);
|
||||
|
||||
exec.push(`{{tenebricideAS=${ASTenebricide.join('\n+')}}}`);
|
||||
exec.push(`{{tenebricideASValue=[[${ASValueTenebricide.join('+')}]]}}`);
|
||||
}
|
||||
}
|
||||
|
||||
if (isObliteration) {
|
||||
let ASObliteration = [];
|
||||
let ASValueObliteration = [];
|
||||
@@ -349,6 +313,24 @@ rollCombatAutrePNJ.forEach((button) => {
|
||||
exec.push(`{{attaqueSurprise=${attaquesSurprises.join('\n+')}}}`);
|
||||
exec.push(`{{attaqueSurpriseValue=[[${attaquesSurprisesValue.join('+')}]]}}`);
|
||||
exec.push(attaquesSurprisesCondition);
|
||||
|
||||
isSurprise = true;
|
||||
}
|
||||
|
||||
if (isTenebricide) {
|
||||
exec.push(`{{tenebricide=${i18n_tenebricide}}} {{tenebricideConditionD=${i18n_tenebricideConditionD}}} {{tenebricideConditionV=${i18n_tenebricideConditionV}}}`);
|
||||
exec.push('{{tenebricideValueD=[[0]]}}');
|
||||
exec.push('{{tenebricideValueV=[[0]]}}');
|
||||
|
||||
if (attaquesSurprises.length > 0) {
|
||||
exec.push(`{{tenebricideAS=${attaquesSurprises.join('\n+')}}}`);
|
||||
exec.push('{{tenebricideASValue=[[0]]}}');
|
||||
}
|
||||
|
||||
if (isMeurtrier) { firstExec.push('{{tMeurtrierValue=[[0]]}}'); }
|
||||
if (isDestructeur) { firstExec.push('{{tDestructeurValue=[[0]]}}'); }
|
||||
if (isFureur) { firstExec.push('{{tFureurValue=[[0]]}}'); }
|
||||
if (isUltraviolence) { firstExec.push('{{tUltraviolenceValue=[[0]]}}'); }
|
||||
}
|
||||
|
||||
if (isELumiere) { autresEffets.push(`${i18n_lumiere} ${lumiereValue}`); }
|
||||
@@ -380,56 +362,46 @@ rollCombatAutrePNJ.forEach((button) => {
|
||||
|
||||
exec = firstExec.concat(exec);
|
||||
|
||||
startRoll(exec.join(' '), (results) => {
|
||||
const tJet = results.results.jet.result;
|
||||
const finalRoll = await startRoll(exec.join(' '));
|
||||
|
||||
const tBonus = results.results.bonus.result;
|
||||
const tExploit = results.results.Exploit.result;
|
||||
const tJet = finalRoll.results.jet.result;
|
||||
|
||||
const tMeurtrier = results.results.meurtrierValue;
|
||||
let vTMeurtrier = 0;
|
||||
const tBonus = finalRoll.results.bonus.result;
|
||||
const tExploit = finalRoll.results.Exploit.result;
|
||||
|
||||
if (tMeurtrier !== undefined) { vTMeurtrier = tMeurtrier.dice[0]; }
|
||||
const rDegats = finalRoll.results.degats.dice;
|
||||
const rViolence = finalRoll.results.violence.dice;
|
||||
|
||||
const tDestructeur = results.results.destructeurValue;
|
||||
let vTDestructeur = 0;
|
||||
const tDegats = finalRoll.results.degats.result;
|
||||
const tViolence = finalRoll.results.violence.result;
|
||||
|
||||
if (tDestructeur !== undefined) { vTDestructeur = tDestructeur.dice[0]; }
|
||||
const conditions = {
|
||||
isTenebricide,
|
||||
isDestructeur,
|
||||
isFureur,
|
||||
isSurprise,
|
||||
isMeurtrier,
|
||||
isUltraviolence,
|
||||
};
|
||||
|
||||
const tFureur = results.results.fureurValue;
|
||||
let vTFureur = 0;
|
||||
const computed = updateRoll(finalRoll, tDegats, rDegats, bDegats, tViolence, rViolence, bViolence, conditions);
|
||||
|
||||
if (tFureur !== undefined) { vTFureur = tFureur.dice[0] + tFureur.dice[1]; }
|
||||
const finalComputed = {
|
||||
jet: tJet + tBonus,
|
||||
};
|
||||
|
||||
const tUltraviolence = results.results.ultraviolenceValue;
|
||||
Object.assign(finalComputed, computed);
|
||||
|
||||
let vTUltraviolence = 0;
|
||||
finishRoll(finalRoll.rollId, finalComputed);
|
||||
|
||||
if (tUltraviolence !== undefined) { vTUltraviolence = tUltraviolence.dice[0]; }
|
||||
if (tJet !== 0 && tJet === tExploit) {
|
||||
const exploitRoll = await startRoll(`${roll}@{jetGM} &{template:simple} {{Nom=@{name}}} {{special1=${i18n_exploit}}}${jet}`);
|
||||
const tRExploit = exploitRoll.results.jet.result;
|
||||
const exploitComputed = {
|
||||
jet: tRExploit,
|
||||
};
|
||||
|
||||
finishRoll(
|
||||
results.rollId,
|
||||
{
|
||||
jet: tJet + tBonus,
|
||||
meurtrierValue: vTMeurtrier,
|
||||
destructeurValue: vTDestructeur,
|
||||
fureurValue: vTFureur,
|
||||
ultraviolenceValue: vTUltraviolence,
|
||||
},
|
||||
);
|
||||
|
||||
if (tJet !== 0 && tJet === tExploit) {
|
||||
startRoll(`${roll}@{jetGM} &{template:simple} {{Nom=@{name}}} {{special1=${i18n_exploit}}}${jet}`, (exploit) => {
|
||||
const tExploit2 = exploit.results.jet.result;
|
||||
|
||||
finishRoll(
|
||||
exploit.rollId,
|
||||
{
|
||||
jet: tExploit2,
|
||||
},
|
||||
);
|
||||
});
|
||||
}
|
||||
});
|
||||
finishRoll(exploitRoll.rollId, exploitComputed);
|
||||
}
|
||||
});
|
||||
});
|
||||
|
||||
@@ -79,6 +79,10 @@ rollCombatPNJContact.forEach((button) => {
|
||||
let isOrfevrerie = false;
|
||||
let isSilencieux = false;
|
||||
|
||||
let isFureur = false;
|
||||
let isUltraviolence = false;
|
||||
let isSurprise = false;
|
||||
|
||||
let isCadence = false;
|
||||
let rCadence = '0';
|
||||
let vCadence = 0;
|
||||
@@ -313,6 +317,8 @@ rollCombatPNJContact.forEach((button) => {
|
||||
isMeurtrier = rEffets.isMeurtrier;
|
||||
isOrfevrerie = rEffets.isOrfevrerie;
|
||||
isSilencieux = rEffets.isSilencieux;
|
||||
isUltraviolence = rEffets.isUltraviolence;
|
||||
isFureur = rEffets.isFureur;
|
||||
|
||||
isCadence = rEffets.isCadence;
|
||||
rCadence = rEffets.rCadence || '0';
|
||||
@@ -492,47 +498,6 @@ rollCombatPNJContact.forEach((button) => {
|
||||
exec.push(`{{vCadence=${rCadence}D}}`);
|
||||
}
|
||||
|
||||
if (isTenebricide) {
|
||||
let degatsTenebricide = [];
|
||||
let ASTenebricide = [];
|
||||
let ASValueTenebricide = [];
|
||||
|
||||
let violenceTenebricide = [];
|
||||
|
||||
const diceDegatsTenebricide = Math.floor(diceDegats / 2);
|
||||
const diceViolenceTenebricide = Math.floor(diceViolence / 2);
|
||||
|
||||
degatsTenebricide.push(`${diceDegatsTenebricide}D6`);
|
||||
degatsTenebricide = degatsTenebricide.concat(bDegats);
|
||||
|
||||
violenceTenebricide.push(`${diceViolenceTenebricide}D6`);
|
||||
violenceTenebricide = violenceTenebricide.concat(bViolence);
|
||||
|
||||
exec.push(`{{tenebricideValueD=[[${degatsTenebricide.join('+')}]]}}`);
|
||||
exec.push(`{{tenebricideValueV=[[${violenceTenebricide.join('+')}]]}}`);
|
||||
|
||||
if (eASAssassinValue > 0) {
|
||||
eAssassinTenebricideValue = Math.ceil(eASAssassinValue / 2);
|
||||
|
||||
ASTenebricide.unshift(eASAssassin);
|
||||
ASValueTenebricide.unshift(`${eAssassinTenebricideValue}D6`);
|
||||
|
||||
if (attaquesSurprises.length > 0) {
|
||||
ASTenebricide = ASTenebricide.concat(attaquesSurprises);
|
||||
ASValueTenebricide = ASValueTenebricide.concat(attaquesSurprisesValue);
|
||||
}
|
||||
|
||||
exec.push(`{{tenebricideAS=${ASTenebricide.join('\n+')}}}`);
|
||||
exec.push(`{{tenebricideASValue=[[${ASValueTenebricide.join('+')}]]}}`);
|
||||
} else if (attaquesSurprises.length > 0) {
|
||||
ASTenebricide = ASTenebricide.concat(attaquesSurprises);
|
||||
ASValueTenebricide = ASValueTenebricide.concat(attaquesSurprisesValue);
|
||||
|
||||
exec.push(`{{tenebricideAS=${ASTenebricide.join('\n+')}}}`);
|
||||
exec.push(`{{tenebricideASValue=[[${ASValueTenebricide.join('+')}]]}}`);
|
||||
}
|
||||
}
|
||||
|
||||
if (isObliteration) {
|
||||
let ASObliteration = [];
|
||||
let ASValueObliteration = [];
|
||||
@@ -590,6 +555,25 @@ rollCombatPNJContact.forEach((button) => {
|
||||
exec.push(`{{attaqueSurprise=${attaquesSurprises.join('\n+')}}}`);
|
||||
exec.push(`{{attaqueSurpriseValue=[[${attaquesSurprisesValue.join('+')}]]}}`);
|
||||
exec.push(attaquesSurprisesCondition);
|
||||
|
||||
isSurprise = true;
|
||||
}
|
||||
|
||||
if (isTenebricide) {
|
||||
exec.push(`{{tenebricide=${i18n_tenebricide}}} {{tenebricideConditionD=${i18n_tenebricideConditionD}}} {{tenebricideConditionV=${i18n_tenebricideConditionV}}}`);
|
||||
exec.push('{{tenebricideValueD=[[0]]}}');
|
||||
exec.push('{{tenebricideValueV=[[0]]}}');
|
||||
|
||||
if (attaquesSurprises.length > 0) {
|
||||
exec.push(`{{tenebricideAS=${attaquesSurprises.join('\n+')}}}`);
|
||||
exec.push('{{tenebricideASValue=[[0]]}}');
|
||||
}
|
||||
|
||||
if (isMeurtrier) { firstExec.push('{{tMeurtrierValue=[[0]]}}'); }
|
||||
if (isDestructeur) { firstExec.push('{{tDestructeurValue=[[0]]}}'); }
|
||||
if (isFureur) { firstExec.push('{{tFureurValue=[[0]]}}'); }
|
||||
if (isUltraviolence) { firstExec.push('{{tUltraviolenceValue=[[0]]}}'); }
|
||||
if (isCheneSculpte) { firstExec.push('{{tCheneSculpteValue=[[0]]}}'); }
|
||||
}
|
||||
|
||||
if (autresEffets.length > 0) {
|
||||
@@ -620,90 +604,75 @@ rollCombatPNJContact.forEach((button) => {
|
||||
|
||||
firstExec = firstExec.concat(exec);
|
||||
|
||||
// ROLL
|
||||
let finalRoll;
|
||||
|
||||
if (pasEnergie === false) {
|
||||
startRoll(firstExec.join(' '), (results) => {
|
||||
const tJet = results.results.jet.result;
|
||||
finalRoll = await startRoll(firstExec.join(' '));
|
||||
|
||||
const tBonus = results.results.bonus.result;
|
||||
const tExploit = results.results.Exploit.result;
|
||||
const rDegats = finalRoll.results.degats.dice;
|
||||
const rViolence = finalRoll.results.violence.dice;
|
||||
|
||||
const tMeurtrier = results.results.meurtrierValue;
|
||||
let vTMeurtrier = 0;
|
||||
const tJet = finalRoll.results.jet.result;
|
||||
|
||||
if (tMeurtrier !== undefined) { vTMeurtrier = tMeurtrier.dice[0]; }
|
||||
const tBonus = finalRoll.results.bonus.result;
|
||||
const tExploit = finalRoll.results.Exploit.result;
|
||||
|
||||
const tDestructeur = results.results.destructeurValue;
|
||||
let vTDestructeur = 0;
|
||||
const tDegats = finalRoll.results.degats.result;
|
||||
const tViolence = finalRoll.results.violence.result;
|
||||
|
||||
if (tDestructeur !== undefined) { vTDestructeur = tDestructeur.dice[0]; }
|
||||
const conditions = {
|
||||
isTenebricide,
|
||||
isSurprise,
|
||||
isDestructeur,
|
||||
isFureur,
|
||||
isMeurtrier,
|
||||
isUltraviolence,
|
||||
isArmeAzurine,
|
||||
isArmeRougeSang,
|
||||
isCheneSculpte,
|
||||
isGriffureGravee,
|
||||
isMasqueBrise,
|
||||
isRouagesCasses,
|
||||
};
|
||||
|
||||
const tFureur = results.results.fureurValue;
|
||||
let vTFureur = 0;
|
||||
const computed = updateRoll(finalRoll, tDegats, rDegats, [bDegats], tViolence, rViolence, [bViolence], conditions);
|
||||
|
||||
if (tFureur !== undefined) { vTFureur = tFureur.dice[0] + tFureur.dice[1]; }
|
||||
const finalComputed = {
|
||||
jet: tJet + tBonus,
|
||||
};
|
||||
|
||||
const tUltraviolence = results.results.ultraviolenceValue;
|
||||
Object.assign(finalComputed, computed);
|
||||
|
||||
let vTUltraviolence = 0;
|
||||
finishRoll(finalRoll.rollId, finalComputed);
|
||||
|
||||
if (tUltraviolence !== undefined) { vTUltraviolence = tUltraviolence.dice[0]; }
|
||||
if (tJet !== 0 && tJet === tExploit) {
|
||||
const exploitRoll = await startRoll(`${roll}@{jetGM} &{template:simple} {{Nom=@{name}}} {{special1=${i18n_exploit}}}${jet}`);
|
||||
const tRExploit = exploitRoll.results.jet.result;
|
||||
|
||||
const tCheneSculpte = results.results.cheneSculpteValue;
|
||||
let vTCheneSculpte = 0;
|
||||
const exploitComputed = {
|
||||
jet: tRExploit,
|
||||
};
|
||||
|
||||
if (tCheneSculpte !== undefined) { vTCheneSculpte = tCheneSculpte.dice[0]; }
|
||||
finishRoll(exploitRoll.rollId, exploitComputed);
|
||||
}
|
||||
|
||||
finishRoll(
|
||||
results.rollId,
|
||||
{
|
||||
jet: tJet + tBonus,
|
||||
meurtrierValue: vTMeurtrier,
|
||||
destructeurValue: vTDestructeur,
|
||||
fureurValue: vTFureur,
|
||||
ultraviolenceValue: vTUltraviolence,
|
||||
cheneSculpteValue: vTCheneSculpte,
|
||||
},
|
||||
);
|
||||
if (sEnergie !== false) {
|
||||
setAttrs({
|
||||
energiePNJ: newEnergie,
|
||||
});
|
||||
|
||||
if (tJet !== 0 && tJet === tExploit) {
|
||||
startRoll(`${roll}@{jetGM} &{template:simple} {{Nom=@{name}}} {{special1=${i18n_exploit}}}${jet}`, (exploit) => {
|
||||
const tExploit2 = exploit.results.jet.result;
|
||||
|
||||
finishRoll(
|
||||
exploit.rollId,
|
||||
{
|
||||
jet: tExploit2,
|
||||
},
|
||||
);
|
||||
});
|
||||
if (newEnergie === 0) {
|
||||
const noEnergieRoll = await startRoll(`@{jetGM} &{template:simple} {{Nom=@{name}}} {{text=${sEnergieText}}}${name}`);
|
||||
finishRoll(noEnergieRoll.rollId, {});
|
||||
}
|
||||
|
||||
if (sEnergie !== false) {
|
||||
setAttrs({
|
||||
energiePNJ: newEnergie,
|
||||
});
|
||||
|
||||
if (newEnergie === 0) {
|
||||
startRoll(`@{jetGM} &{template:simple} {{Nom=@{name}}} {{text=${sEnergieText}}}${name}`, (exploit) => {
|
||||
finishRoll(
|
||||
exploit.rollId, {},
|
||||
);
|
||||
});
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
} else if (button === 'repeating_armeCaC:armecontactpnj') {
|
||||
startRoll(`@{jetGM} &{template:simple} {{Nom=@{name}}} {{text=${sEnergieText}}}${name}`, (text) => {
|
||||
finishRoll(
|
||||
text.rollId, {},
|
||||
);
|
||||
});
|
||||
finalRoll = await startRoll(`@{jetGM} &{template:simple} {{Nom=@{name}}} {{text=${sEnergieText}}}${name}`);
|
||||
finishRoll(finalRoll.rollId, {});
|
||||
} else {
|
||||
startRoll(`@{jetGM} &{template:simple} {{Nom=@{name}}} {{text=${sEnergieText}}}${name}`, (text) => {
|
||||
finishRoll(
|
||||
text.rollId, {},
|
||||
);
|
||||
});
|
||||
finalRoll = await startRoll(`@{jetGM} &{template:simple} {{Nom=@{name}}} {{text=${sEnergieText}}}${name}`);
|
||||
finishRoll(finalRoll.rollId, {});
|
||||
}
|
||||
});
|
||||
});
|
||||
|
||||
@@ -229,6 +229,9 @@ rollCombatDistancePNJ.forEach((button) => {
|
||||
let isTenebricide = false;
|
||||
let isTirRafale = false;
|
||||
let isChambreDouble = false;
|
||||
let isSurprise = false;
|
||||
let isUltraviolence = false;
|
||||
let isFureur = false;
|
||||
|
||||
let pasEnergie = false;
|
||||
let sEnergieText = '';
|
||||
@@ -299,6 +302,9 @@ rollCombatDistancePNJ.forEach((button) => {
|
||||
isObliteration = effets.isObliteration;
|
||||
isTirRafale = effets.isTirRafale;
|
||||
|
||||
isFureur = effets.isFureur;
|
||||
isUltraviolence = effets.isUltraviolence;
|
||||
|
||||
if (isLeste) {
|
||||
bDegats += Math.ceil(vChair / 2);
|
||||
exec.push(`{{vLeste=${vChair}}}`);
|
||||
@@ -426,47 +432,6 @@ rollCombatDistancePNJ.forEach((button) => {
|
||||
exec.push(`{{degats=[[${diceDegats}D6+${bDegats}]]}}`);
|
||||
exec.push(`{{violence=[[${diceViolence}D6+${bViolence}]]}}`);
|
||||
|
||||
if (isTenebricide) {
|
||||
let degatsTenebricide = [];
|
||||
let ASTenebricide = [];
|
||||
let ASValueTenebricide = [];
|
||||
|
||||
let violenceTenebricide = [];
|
||||
|
||||
const diceDegatsTenebricide = Math.floor(diceDegats / 2);
|
||||
const diceViolenceTenebricide = Math.floor(diceViolence / 2);
|
||||
|
||||
degatsTenebricide.push(`${diceDegatsTenebricide}D6`);
|
||||
degatsTenebricide = degatsTenebricide.concat(bDegats);
|
||||
|
||||
violenceTenebricide.push(`${diceViolenceTenebricide}D6`);
|
||||
violenceTenebricide = violenceTenebricide.concat(bViolence);
|
||||
|
||||
exec.push(`{{tenebricideValueD=[[${degatsTenebricide.join('+')}]]}}`);
|
||||
exec.push(`{{tenebricideValueV=[[${violenceTenebricide.join('+')}]]}}`);
|
||||
|
||||
if (eASAssassinValue > 0) {
|
||||
eAssassinTenebricideValue = Math.ceil(eASAssassinValue / 2);
|
||||
|
||||
ASTenebricide.unshift(eASAssassin);
|
||||
ASValueTenebricide.unshift(`${eAssassinTenebricideValue}D6`);
|
||||
|
||||
if (attaquesSurprises.length > 0) {
|
||||
ASTenebricide = ASTenebricide.concat(attaquesSurprises);
|
||||
ASValueTenebricide = ASValueTenebricide.concat(attaquesSurprisesValue);
|
||||
}
|
||||
|
||||
exec.push(`{{tenebricideAS=${ASTenebricide.join('\n+')}}}`);
|
||||
exec.push(`{{tenebricideASValue=[[${ASValueTenebricide.join('+')}]]}}`);
|
||||
} else if (attaquesSurprises.length > 0) {
|
||||
ASTenebricide = ASTenebricide.concat(attaquesSurprises);
|
||||
ASValueTenebricide = ASValueTenebricide.concat(attaquesSurprisesValue);
|
||||
|
||||
exec.push(`{{tenebricideAS=${ASTenebricide.join('\n+')}}}`);
|
||||
exec.push(`{{tenebricideASValue=[[${ASValueTenebricide.join('+')}]]}}`);
|
||||
}
|
||||
}
|
||||
|
||||
if (isObliteration) {
|
||||
let ASObliteration = [];
|
||||
let ASValueObliteration = [];
|
||||
@@ -521,11 +486,29 @@ rollCombatDistancePNJ.forEach((button) => {
|
||||
}
|
||||
|
||||
if (attaquesSurprises.length > 0) {
|
||||
isSurprise = true;
|
||||
|
||||
exec.push(`{{attaqueSurprise=${attaquesSurprises.join('\n+')}}}`);
|
||||
exec.push(`{{attaqueSurpriseValue=[[${attaquesSurprisesValue.join('+')}]]}}`);
|
||||
exec.push(attaquesSurprisesCondition);
|
||||
}
|
||||
|
||||
if (isTenebricide) {
|
||||
exec.push(`{{tenebricide=${i18n_tenebricide}}} {{tenebricideConditionD=${i18n_tenebricideConditionD}}} {{tenebricideConditionV=${i18n_tenebricideConditionV}}}`);
|
||||
exec.push('{{tenebricideValueD=[[0]]}}');
|
||||
exec.push('{{tenebricideValueV=[[0]]}}');
|
||||
|
||||
if (attaquesSurprises.length > 0) {
|
||||
exec.push(`{{tenebricideAS=${attaquesSurprises.join('\n+')}}}`);
|
||||
exec.push('{{tenebricideASValue=[[0]]}}');
|
||||
}
|
||||
|
||||
if (isMeurtrier) { firstExec.push('{{tMeurtrierValue=[[0]]}}'); }
|
||||
if (isDestructeur) { firstExec.push('{{tDestructeurValue=[[0]]}}'); }
|
||||
if (isFureur) { firstExec.push('{{tFureurValue=[[0]]}}'); }
|
||||
if (isUltraviolence) { firstExec.push('{{tUltraviolenceValue=[[0]]}}'); }
|
||||
}
|
||||
|
||||
if (autresEffets.length > 0) {
|
||||
autresEffets.sort();
|
||||
exec.push(`{{effets=${autresEffets.join(' / ')}}}`);
|
||||
@@ -553,84 +536,64 @@ rollCombatDistancePNJ.forEach((button) => {
|
||||
|
||||
exec = firstExec.concat(exec);
|
||||
|
||||
log(bonus);
|
||||
log(exec);
|
||||
// ROLL
|
||||
let finalRoll;
|
||||
|
||||
if (pasEnergie === false) {
|
||||
startRoll(exec.join(' '), (results) => {
|
||||
const tJet = results.results.jet.result;
|
||||
finalRoll = await startRoll(exec.join(' '));
|
||||
const tJet = finalRoll.results.jet.result;
|
||||
|
||||
const tBonus = results.results.bonus.result;
|
||||
const tExploit = results.results.Exploit.result;
|
||||
const tBonus = finalRoll.results.bonus.result;
|
||||
const tExploit = finalRoll.results.Exploit.result;
|
||||
|
||||
log(tJet);
|
||||
log(tBonus);
|
||||
const rDegats = finalRoll.results.degats.dice;
|
||||
const rViolence = finalRoll.results.violence.dice;
|
||||
|
||||
const tMeurtrier = results.results.meurtrierValue;
|
||||
let vTMeurtrier = 0;
|
||||
const tDegats = finalRoll.results.degats.result;
|
||||
const tViolence = finalRoll.results.violence.result;
|
||||
|
||||
if (tMeurtrier !== undefined) { vTMeurtrier = tMeurtrier.dice[0]; }
|
||||
const conditions = {
|
||||
isTenebricide,
|
||||
isSurprise,
|
||||
isDestructeur,
|
||||
isFureur,
|
||||
isMeurtrier,
|
||||
isUltraviolence,
|
||||
};
|
||||
|
||||
const tDestructeur = results.results.destructeurValue;
|
||||
let vTDestructeur = 0;
|
||||
const computed = updateRoll(finalRoll, tDegats, rDegats, [bDegats], tViolence, rViolence, [bViolence], conditions);
|
||||
|
||||
if (tDestructeur !== undefined) { vTDestructeur = tDestructeur.dice[0]; }
|
||||
const finalComputed = {
|
||||
jet: tJet + tBonus,
|
||||
};
|
||||
|
||||
const tFureur = results.results.fureurValue;
|
||||
let vTFureur = 0;
|
||||
Object.assign(finalComputed, computed);
|
||||
|
||||
if (tFureur !== undefined) { vTFureur = tFureur.dice[0] + tFureur.dice[1]; }
|
||||
finishRoll(finalRoll.rollId, finalComputed);
|
||||
|
||||
const tUltraviolence = results.results.ultraviolenceValue;
|
||||
if (tJet !== 0 && tJet === tExploit) {
|
||||
const exploitRoll = await startRoll(`${roll}@{jetGM} &{template:simple} {{Nom=@{name}}} {{special1=${i18n_exploit}}}${jet}`);
|
||||
const tRExploit = exploitRoll.results.jet.result;
|
||||
const exploitComputed = {
|
||||
jet: tRExploit,
|
||||
};
|
||||
|
||||
let vTUltraviolence = 0;
|
||||
finishRoll(exploitRoll.rollId, exploitComputed);
|
||||
}
|
||||
|
||||
if (tUltraviolence !== undefined) { vTUltraviolence = tUltraviolence.dice[0]; }
|
||||
if (sEnergie !== false) {
|
||||
setAttrs({
|
||||
energiePNJ: newEnergie,
|
||||
});
|
||||
|
||||
finishRoll(
|
||||
results.rollId,
|
||||
{
|
||||
jet: tJet + tBonus,
|
||||
meurtrierValue: vTMeurtrier,
|
||||
destructeurValue: vTDestructeur,
|
||||
fureurValue: vTFureur,
|
||||
ultraviolenceValue: vTUltraviolence,
|
||||
},
|
||||
);
|
||||
|
||||
if (tJet !== 0 && tJet === tExploit) {
|
||||
startRoll(`${roll}@{jetGM} &{template:simple} {{Nom=@{name}}} {{special1=${i18n_exploit}}}${jet}`, (exploit) => {
|
||||
const tExploit2 = exploit.results.jet.result;
|
||||
|
||||
finishRoll(
|
||||
exploit.rollId,
|
||||
{
|
||||
jet: tExploit2,
|
||||
},
|
||||
);
|
||||
});
|
||||
if (newEnergie === 0) {
|
||||
const noEnergieRoll = await startRoll(`@{jetGM} &{template:simple} {{Nom=@{name}}} {{special1=${name}}} {{text=${sEnergieText}}}`);
|
||||
finishRoll(noEnergieRoll.rollId, {});
|
||||
}
|
||||
|
||||
if (sEnergie !== false) {
|
||||
setAttrs({
|
||||
energiePNJ: newEnergie,
|
||||
});
|
||||
|
||||
if (newEnergie === 0) {
|
||||
startRoll(`@{jetGM} &{template:simple} {{Nom=@{name}}} {{special1=${name}}} {{text=${sEnergieText}}}`, (exploit) => {
|
||||
finishRoll(
|
||||
exploit.rollId, {},
|
||||
);
|
||||
});
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
} else {
|
||||
startRoll(`@{jetGM} &{template:simple} {{Nom=@{name}}} {{special1=${name}}} {{text=${sEnergieText}}}`, (text) => {
|
||||
finishRoll(
|
||||
text.rollId, {},
|
||||
);
|
||||
});
|
||||
finalRoll = await startRoll(`@{jetGM} &{template:simple} {{Nom=@{name}}} {{special1=${name}}} {{text=${sEnergieText}}}`);
|
||||
finishRoll(finalRoll.rollId, {});
|
||||
}
|
||||
});
|
||||
});
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
/* eslint-disable max-len */
|
||||
/* eslint-disable prefer-destructuring */
|
||||
/* eslint-disable camelcase */
|
||||
/* eslint-disable no-undef */
|
||||
@@ -27,6 +28,10 @@ rollCombatGrenadePNJ.forEach((button) => {
|
||||
let AE = 0;
|
||||
|
||||
let ameliorations = false;
|
||||
let isSurprise = false;
|
||||
let isDestructeur = false;
|
||||
let isMeurtrier = false;
|
||||
let isUltraviolence = false;
|
||||
|
||||
let diceDegats = 3;
|
||||
let diceViolence = 3;
|
||||
@@ -109,6 +114,9 @@ rollCombatGrenadePNJ.forEach((button) => {
|
||||
|
||||
exec.push(`{{ultraviolence=${i18n_ultraviolence}}} {{ultraviolenceCondition=${i18n_ultraviolenceCondition}}} {{meurtrier=${i18n_meurtrier}}} {{meurtrierCondition=${i18n_meurtrierCondition}}}`);
|
||||
autresEffets.push(`${i18n_dispersion} 6`);
|
||||
|
||||
isUltraviolence = true;
|
||||
isMeurtrier = true;
|
||||
break;
|
||||
case 'grenade2PNJ':
|
||||
isConditionnelA = true;
|
||||
@@ -127,6 +135,8 @@ rollCombatGrenadePNJ.forEach((button) => {
|
||||
autresEffets.push(`${i18n_perceArmure} 20`);
|
||||
autresEffets.push(`${i18n_penetrant} 6`);
|
||||
autresEffets.push(`${i18n_dispersion} 6`);
|
||||
|
||||
isDestructeur = true;
|
||||
break;
|
||||
case 'grenade4PNJ':
|
||||
isConditionnelA = true;
|
||||
@@ -185,6 +195,8 @@ rollCombatGrenadePNJ.forEach((button) => {
|
||||
exec.push(`{{attaqueSurprise=${attaquesSurprises.join('\n+')}}}`);
|
||||
exec.push(`{{attaqueSurpriseValue=[[${attaquesSurprisesValue.join('+')}]]}}`);
|
||||
exec.push(`${attaquesSurprisesCondition}`);
|
||||
|
||||
isSurprise = true;
|
||||
}
|
||||
|
||||
if (autresEffets.length > 0) {
|
||||
@@ -200,50 +212,44 @@ rollCombatGrenadePNJ.forEach((button) => {
|
||||
|
||||
exec = firstExec.concat(exec);
|
||||
|
||||
startRoll(exec.join(' '), (results) => {
|
||||
const tJet = results.results.jet.result;
|
||||
// ROLL
|
||||
const finalRoll = await startRoll(exec.join(' '));
|
||||
const tJet = finalRoll.results.jet.result;
|
||||
const tBonus = finalRoll.results.bonus.result;
|
||||
const tExploit = finalRoll.results.Exploit.result;
|
||||
|
||||
const tBonus = results.results.bonus.result;
|
||||
const tExploit = results.results.Exploit.result;
|
||||
const finalComputed = {
|
||||
jet: tJet + tBonus,
|
||||
};
|
||||
|
||||
const tMeurtrier = results.results.meurtrierValue;
|
||||
let vTMeurtrier = 0;
|
||||
if (hasDgts) {
|
||||
const rDegats = finalRoll.results.degats.dice;
|
||||
const rViolence = finalRoll.results.violence.dice;
|
||||
|
||||
if (tMeurtrier !== undefined) { vTMeurtrier = tMeurtrier.dice[0]; }
|
||||
const tDegats = finalRoll.results.degats.result;
|
||||
const tViolence = finalRoll.results.violence.result;
|
||||
|
||||
const tDestructeur = results.results.destructeurValue;
|
||||
let vTDestructeur = 0;
|
||||
const conditions = {
|
||||
isSurprise,
|
||||
isDestructeur,
|
||||
isMeurtrier,
|
||||
isUltraviolence,
|
||||
};
|
||||
|
||||
if (tDestructeur !== undefined) { vTDestructeur = tDestructeur.dice[0]; }
|
||||
const computed = updateRoll(finalRoll, tDegats, rDegats, bDegats, tViolence, rViolence, bViolence, conditions);
|
||||
Object.assign(finalComputed, computed);
|
||||
}
|
||||
|
||||
const tUltraviolence = results.results.ultraviolenceValue;
|
||||
finishRoll(finalRoll.rollId, finalComputed);
|
||||
|
||||
let vTUltraviolence = 0;
|
||||
if (tJet !== 0 && tJet === tExploit) {
|
||||
const exploitRoll = await startRoll(`${roll}@{jetGM} &{template:simple} {{Nom=@{name}}} {{special1=${i18n_exploit}}}${jet}`);
|
||||
const tRExploit = exploitRoll.results.jet.result;
|
||||
const exploitComputed = {
|
||||
jet: tRExploit,
|
||||
};
|
||||
|
||||
if (tUltraviolence !== undefined) { vTUltraviolence = tUltraviolence.dice[0]; }
|
||||
|
||||
finishRoll(
|
||||
results.rollId,
|
||||
{
|
||||
jet: tJet + tBonus,
|
||||
meurtrierValue: vTMeurtrier,
|
||||
destructeurValue: vTDestructeur,
|
||||
ultraviolenceValue: vTUltraviolence,
|
||||
},
|
||||
);
|
||||
|
||||
if (tJet !== 0 && tJet === tExploit) {
|
||||
startRoll(`${roll}@{jetGM} &{template:simple} {{Nom=@{name}}} {{special1=${i18n_exploit}}}${jet}`, (exploit) => {
|
||||
const tExploit2 = exploit.results.jet.result;
|
||||
|
||||
finishRoll(
|
||||
exploit.rollId,
|
||||
{
|
||||
jet: tExploit2,
|
||||
},
|
||||
);
|
||||
});
|
||||
}
|
||||
});
|
||||
finishRoll(exploitRoll.rollId, exploitComputed);
|
||||
}
|
||||
});
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user