#27 Gestion des rencontres

This commit is contained in:
2020-11-21 14:30:00 +01:00
parent 176e3b7916
commit 357e08758a
8 changed files with 66 additions and 22 deletions

View File

@ -121,6 +121,16 @@ export class RdDTMRDialog extends Dialog {
}
}
/* -------------------------------------------- */
async gererTourbillon( value ) {
this.nbFatigue += value;
await this.actor.updatePointsDeReve( -value );
if ( !this.currentRencontre.tourbillonDirection ) {
this.currentRencontre.tourbillonDirection = TMRUtility.getDirectionPattern();
}
}
/* -------------------------------------------- */
/** Gère les rencontres avec du post-processing graphique (passeur, messagers, tourbillons, ...) */
async rencontrePostProcess( rencontreData) {
@ -139,6 +149,12 @@ export class RdDTMRDialog extends Dialog {
} else if ( this.rencontreState == 'reflet' ) {
this.nbFatigue += 1;
} else if ( this.rencontreState == 'tourbillonblanc' ) {
this.gererTourbillon(1);
} else if ( this.rencontreState == 'tourbillonnoir' ) {
this.gererTourbillon(2);
} else {
this.currentRencontre = undefined; // Cleanup, not used anymore
}
@ -199,7 +215,7 @@ export class RdDTMRDialog extends Dialog {
this.updateValuesDisplay();
this.checkQuitterTMR();
if ( this.rencontreState == 'reflet')
if ( this.rencontreState == 'reflet' || this.rencontreState == 'tourbillonblanc' || this.rencontreState == 'tourbillonnoir' )
this.maitriser();
}
@ -222,7 +238,6 @@ export class RdDTMRDialog extends Dialog {
let rencontre = this.rencontresExistantes.find(prev => prev.coord == coordTMR);
if (rencontre == undefined) {
let myRoll = new Roll("d7").roll();
console.log("RLL RENC: ", myRoll.total, coordTMR, cellDescr);
if (myRoll.total == 7) {
rencontre = await TMRUtility.rencontreTMRRoll(coordTMR, cellDescr);
}