Localisation des blessures en regle optionnelle
This commit is contained in:
@ -415,41 +415,40 @@ export class RdDBaseActorReve extends RdDBaseActor {
|
||||
/* -------------------------------------------- */
|
||||
async encaisser() { await RdDEncaisser.encaisser(this) }
|
||||
|
||||
async encaisserDommages(rollData, attacker = undefined, show = undefined) {
|
||||
async encaisserDommages(rollData, attacker = undefined, attackerToken = undefined, show = undefined) {
|
||||
if (attacker && !await attacker.accorder(this, 'avant-encaissement')) {
|
||||
return;
|
||||
}
|
||||
const armure = await this.computeArmure(rollData);
|
||||
if (ReglesOptionnelles.isUsing('validation-encaissement-gr')) {
|
||||
await this.encaisserDommagesValidationGR(rollData, armure, attacker?.id, show);
|
||||
await this.encaisserDommagesValidationGR(rollData, armure, attackerToken, show);
|
||||
}
|
||||
else {
|
||||
const jet = await RdDUtility.jetEncaissement(rollData, armure, { showDice: SHOW_DICE });
|
||||
await this.$onEncaissement(jet, show, attacker);
|
||||
const jet = await RdDUtility.jetEncaissement(this, rollData, armure, { showDice: SHOW_DICE });
|
||||
await this.$onEncaissement(jet, show, attackerToken)
|
||||
}
|
||||
}
|
||||
|
||||
async encaisserDommagesValidationGR(rollData, armure, attackerId, show) {
|
||||
async encaisserDommagesValidationGR(rollData, armure, attackerToken, show) {
|
||||
if (!game.user.isGM) {
|
||||
RdDBaseActor.remoteActorCall({
|
||||
tokenId: this.token?.id,
|
||||
actorId: this.id,
|
||||
method: 'encaisserDommagesValidationGR',
|
||||
args: [rollData, armure, attackerId, show]
|
||||
});
|
||||
args: [rollData, armure, attackerToken, show]
|
||||
})
|
||||
} else {
|
||||
const attacker = game.actors.get(attackerId);
|
||||
DialogValidationEncaissement.validerEncaissement(this, rollData, armure,
|
||||
jet => this.$onEncaissement(jet, show, attacker));
|
||||
jet => this.$onEncaissement(jet, show, attackerToken));
|
||||
}
|
||||
}
|
||||
|
||||
async $onEncaissement(jet, show, attacker) {
|
||||
await this.onAppliquerJetEncaissement(jet, attacker);
|
||||
async $onEncaissement(jet, show, attackerToken) {
|
||||
await this.onAppliquerJetEncaissement(jet, attackerToken);
|
||||
await this.$afficherEncaissement(jet, show);
|
||||
}
|
||||
|
||||
async onAppliquerJetEncaissement(encaissement, attacker) { }
|
||||
async onAppliquerJetEncaissement(encaissement, attackerToken) { }
|
||||
|
||||
async $afficherEncaissement(encaissement, show) {
|
||||
foundry.utils.mergeObject(encaissement, {
|
||||
|
Reference in New Issue
Block a user