Masquer les dés détérioration/recul

This commit is contained in:
Vincent Vandemeulebrouck 2020-12-17 00:05:32 +01:00
parent 0fb9c8f334
commit afe5ddcb8d
3 changed files with 22 additions and 7 deletions

View File

@ -182,7 +182,10 @@ export class RdDActor extends Actor {
let resistance = Misc.toInt(rollData.arme.data.resistance);
let msg = "";
// Jet de résistance de l'arme de parade (p.132)
let resistRoll = await RdDResolutionTable.roll( resistance, - dmg );
let resistRoll = await RdDResolutionTable.rollData({
caracValue: resistance,
finalLevel: - dmg,
showDice: false});
if (resistRoll.isSuccess) { // Perte de résistance
msg = "Votre " + rollData.arme.name + " tient le choc de la parade. "
} else {
@ -197,7 +200,10 @@ export class RdDActor extends Actor {
}
// Jet de désarmement
if (resistance > 0 && !rollData.arme.name.toLowerCase().includes('bouclier') ) { // Si l'arme de parade n'est pas un bouclier, jet de désarmement (p.132)
let desarme = await RdDResolutionTable.roll( this.data.data.carac.force.value, Misc.toInt(rollData.competence.data.niveau) -dmg );
let desarme = await RdDResolutionTable.rollData({
caracValue: this.data.data.carac.force.value,
finalLevel: Misc.toInt(rollData.competence.data.niveau) - dmg,
showDice: false});
if ( desarme.isEchec) {
msg += "Vous ne parvenez pas à garder votre arme en main, elle tombe au sol à vos pieds";
}
@ -214,12 +220,19 @@ export class RdDActor extends Actor {
if ( rollData.arme || encaisser ) {
if ( (rollData.attackerRoll.particuliereAttaque && rollData.attackerRoll.particuliereAttaque == 'force') || rollData.attackerRoll.tactique == 'charge') {
let reculNiveau = Misc.toInt(this.data.data.carac.taille.value) - (rollData.attackerRoll.forceValue+rollData.attackerRoll.arme.data.dommagesReels);
let recul = await RdDResolutionTable.roll( 10, reculNiveau );
let recul = await RdDResolutionTable.rollData({
caracValue: 10,
finalLevel: reculNiveau,
showDice: false});
let msg = "";
if (recul.isSuccess) {
msg = " Vous ne reculez pas malgré la force du coup.";
} else {
let chute = await RdDResolutionTable.roll( this.data.data.carac.agilite.value, reculNiveau );
let chute = await RdDResolutionTable.rollData({
caracValue: this.data.data.carac.agilite.value,
finalLevel: reculNiveau,
showDice: false});
if ( !chute.isSuccess || recul.isETotal ) {
msg = "Sous la violence du coup, vous reculez et chutez au sol ! Vous ne pouvez plus attaquer ce round.";
} else {

View File

@ -234,8 +234,10 @@ export class RdDCalendrier extends Application {
console.log( request );
let jourDiff = this.getLectureAstrologieDifficulte( request.date);
let niveau = Number(request.astrologie.data.niveau) + Number(request.conditions) + Number(jourDiff) + Number(request.etat);
let rolled = await RdDResolutionTable.roll(request.carac_vue, niveau, undefined, false);
let rolled = await RdDResolutionTable.rollData({
caracValue: request.carac_vue,
finalLevel: niveau,
showDice: false});
let nbAstral = this.getNombreAstral( request.date );
let nbAstralFaux = nbAstral;
request.isValid = true;

View File

@ -91,7 +91,7 @@ export class RdDResolutionTable {
/* -------------------------------------------- */
static async rollData(rollData) {
rollData.rolled = await this.roll(rollData.caracValue, rollData.finalLevel, rollData.bonus, rollData.needSignificative);
rollData.rolled = await this.roll(rollData.caracValue, rollData.finalLevel, rollData.bonus, rollData.needSignificative, !rollData.showDice);
}
/* -------------------------------------------- */