Empoignade V2

This commit is contained in:
2025-10-21 02:26:44 +02:00
parent c47fc4f5b6
commit 02cea84ebb
29 changed files with 423 additions and 122 deletions

View File

@@ -54,13 +54,27 @@ export class RollBasicParts {
}
}
static prepareDefense(attackerRoll) {
if (!attackerRoll.passeArme) {
attackerRoll.passeArme = foundry.utils.randomID(16);
}
return {
ids: RollBasicParts.reverseIds(attackerRoll),
active: attackerRoll.opponent,
opponent: attackerRoll.active,
attackerRoll: attackerRoll,
passeArme: attackerRoll.passeArme,
show: { encaissement: true }
}
}
static reverseIds(rollData) {
return {
sceneId: rollData.ids.sceneId,
actorId: rollData.ids.opponentId,
actorTokenId: rollData.ids.opponentTokenId,
opponentId: rollData.ids.actorId,
opponentTokenId: rollData.actorTokenId
opponentTokenId: rollData.ids.actorTokenId
}
}