11.2.19 - Les hémorroïdes d'Akarlikarlikar #697

Merged
uberwald merged 2 commits from VincentVk/foundryvtt-reve-de-dragon:v11 into v11 2024-05-01 08:59:34 +02:00
2 changed files with 7 additions and 3 deletions
Showing only changes of commit fad894704d - Show all commits

View File

@ -421,6 +421,10 @@ export class RdDBaseActorReve extends RdDBaseActor {
/* -------------------------------------------- */ /* -------------------------------------------- */
async encaisser() { await RdDEncaisser.encaisser(this) } async encaisser() { await RdDEncaisser.encaisser(this) }
async encaisserDommagesRemote(rollData, attackerId, show) {
const attacker = game.actors.get(attackerId);
await this.encaisserDommages(rollData, attacker, show)
}
async encaisserDommages(rollData, attacker = undefined, show = undefined) { async encaisserDommages(rollData, attacker = undefined, show = undefined) {
if (attacker && !await attacker.accorder(this, 'avant-encaissement')) { if (attacker && !await attacker.accorder(this, 'avant-encaissement')) {
return; return;
@ -430,8 +434,8 @@ export class RdDBaseActorReve extends RdDBaseActor {
RdDBaseActor.remoteActorCall({ RdDBaseActor.remoteActorCall({
tokenId: this.token?.id, tokenId: this.token?.id,
actorId: this.id, actorId: this.id,
method: 'encaisserDommages', method: 'encaisserDommagesRemote',
args: [rollData, show, attackerId] args: [rollData, attackerId, show]
}); });
return; return;
} }

View File

@ -1282,7 +1282,7 @@ export class RdDCombat {
attackerRoll.defenderTokenId = defenderTokenId; attackerRoll.defenderTokenId = defenderTokenId;
await this.computeRecul(defenderRoll); await this.computeRecul(defenderRoll);
this.defender.encaisserDommages(attackerRoll, this.attacker, defenderRoll?.show); await this.defender.encaisserDommages(attackerRoll, this.attacker, defenderRoll?.show);
} }
else { // envoi à un GM: les joueurs n'ont pas le droit de modifier les personnages qu'ils ne possèdent pas else { // envoi à un GM: les joueurs n'ont pas le droit de modifier les personnages qu'ils ne possèdent pas
game.socket.emit(SYSTEM_SOCKET_ID, { game.socket.emit(SYSTEM_SOCKET_ID, {