forked from public/foundryvtt-reve-de-dragon
Fix: validation encaissement MJ
This commit is contained in:
@ -3204,25 +3204,31 @@ export class RdDActor extends RdDBaseActor {
|
||||
if (attacker && !await attacker.accorder(this, 'avant-encaissement')) {
|
||||
return;
|
||||
}
|
||||
const attackerId = attacker?.id;
|
||||
if (ReglesOptionelles.isUsing('validation-encaissement-gr') && !game.user.isGM) {
|
||||
RdDBaseActor.remoteActorCall({
|
||||
actorId: this.id,
|
||||
method: 'validerEncaissement',
|
||||
args: [rollData, show]
|
||||
method: 'appliquerEncaissement',
|
||||
args: [rollData, show, attackerId]
|
||||
});
|
||||
return;
|
||||
}
|
||||
await this.appliquerEncaissement(rollData, show, attackerId);
|
||||
}
|
||||
|
||||
async appliquerEncaissement(rollData, show, attackerId) {
|
||||
const armure = await this.computeArmure(rollData);
|
||||
if (ReglesOptionelles.isUsing('validation-encaissement-gr')) {
|
||||
DialogValidationEncaissement.validerEncaissement(this, rollData, armure, show, (encaissement, show) => this._appliquerEncaissement(encaissement, show, attacker));
|
||||
DialogValidationEncaissement.validerEncaissement(this, rollData, armure, show, attackerId, (encaissement, show, attackerId) => this._appliquerEncaissement(encaissement, show, attackerId));
|
||||
}
|
||||
else {
|
||||
let encaissement = await RdDUtility.jetEncaissement(rollData, armure, { showDice: SHOW_DICE });
|
||||
await this._appliquerEncaissement(encaissement, show, attacker)
|
||||
await this._appliquerEncaissement(encaissement, show, attackerId);
|
||||
}
|
||||
}
|
||||
|
||||
async _appliquerEncaissement(encaissement, show, attacker) {
|
||||
async _appliquerEncaissement(encaissement, show, attackedId) {
|
||||
const attacker = attackedId ? game.actors.get(attackedId) : undefined
|
||||
let santeOrig = duplicate(this.system.sante);
|
||||
|
||||
const blessure = await this.ajouterBlessure(encaissement, attacker); // Will update the result table
|
||||
|
Reference in New Issue
Block a user