Echec total tâche augmente la difficulté

This commit is contained in:
Vincent Vandemeulebrouck 2020-12-18 00:45:20 +01:00
parent 1fb6dd8e96
commit da24ff7232

View File

@ -1133,7 +1133,7 @@ export class RdDActor extends Actor {
action: r => this._appliquerAjoutExperience(r) action: r => this._appliquerAjoutExperience(r)
}; };
} }
/* -------------------------------------------- */ /* -------------------------------------------- */
async _appliquerAjoutExperience(rollData) { async _appliquerAjoutExperience(rollData) {
let xpResult = this.appliquerExperience( rollData.rolled, rollData.selectedCarac.label, (rollData.competence) ? rollData.competence.data.name: undefined ); let xpResult = this.appliquerExperience( rollData.rolled, rollData.selectedCarac.label, (rollData.competence) ? rollData.competence.data.name: undefined );
@ -1389,6 +1389,7 @@ export class RdDActor extends Actor {
label: 'Jet de Tâche ' + tache.name, label: 'Jet de Tâche ' + tache.name,
callbacks: [ callbacks: [
this.createCallbackExperience(), this.createCallbackExperience(),
{ condition: r=> r.rolled.isETotal, action: r => this._tacheETotal(r)},
{ action: r => this._tacheResult(r) } { action: r => this._tacheResult(r) }
] ]
} ); } );
@ -1418,6 +1419,11 @@ export class RdDActor extends Actor {
}, this.name); }, this.name);
} }
_tacheETotal(rollData) {
rollData.tache.data.difficulte --;
this.updateEmbeddedEntity( "OwnedItem", rollData.tache);
}
/* -------------------------------------------- */ /* -------------------------------------------- */
_competenceResult(rollData) { _competenceResult(rollData) {
ChatUtility.chatWithRollMode({ ChatUtility.chatWithRollMode({