forked from public/foundryvtt-reve-de-dragon
Amélioration de la gestion de la surprise
This commit is contained in:
@@ -567,6 +567,9 @@ export class RdDCombat {
|
||||
|
||||
/* -------------------------------------------- */
|
||||
static isParticuliere(rollData) {
|
||||
if (rollData.ids) {
|
||||
return rollData.rolled.isPart
|
||||
}
|
||||
if (!rollData.attackerRoll && rollData.ajustements.surprise.used) {
|
||||
return false;
|
||||
}
|
||||
@@ -575,6 +578,9 @@ export class RdDCombat {
|
||||
|
||||
/* -------------------------------------------- */
|
||||
static isReussite(rollData) {
|
||||
if (rollData.ids) {
|
||||
return rollData.rolled.is
|
||||
}
|
||||
switch (rollData.ajustements.surprise.used) {
|
||||
case 'totale': return false;
|
||||
case 'demi': return rollData.rolled.isSign;
|
||||
@@ -971,14 +977,14 @@ export class RdDCombat {
|
||||
|
||||
await RollDialog.create(rollData, {
|
||||
onRoll: (dialog) => {
|
||||
this._onCloseRollDialog(),
|
||||
dialog.close()
|
||||
dialog.close()
|
||||
},
|
||||
customChatMessage: true,
|
||||
callbacks: [async (actor, rd) => {
|
||||
this.removeChatMessageActionsPasseArme(rd.passeArme)
|
||||
// defense: esquive / arme de parade / competence de défense
|
||||
await rd.active.actor.incDecItemUse(rd.current[PART_DEFENSE].defense?.id, !RdDCombat.isParticuliere(rd))
|
||||
if (!RdDCombat.isParticuliere(rd))
|
||||
await rd.active.actor.incDecItemUse(rd.current[PART_DEFENSE].defense?.id, )
|
||||
await this._onDefenseV2(rd)
|
||||
}]
|
||||
})
|
||||
|
Reference in New Issue
Block a user