Utilisation Misc.data

This commit is contained in:
Vincent Vandemeulebrouck
2021-03-29 18:08:18 +02:00
parent 592f54af61
commit 31204cbf51
21 changed files with 254 additions and 237 deletions

View File

@ -165,13 +165,7 @@ export class RdDCombatManager extends Combat {
}
}
}
return armesEquipe.sort((a, b) => {
const nameA = a.name + (a.data.mainInfo ?? '');
const nameB = b.name + (b.data.mainInfo ?? '');
if (nameA > nameB) return 1;
if (nameA < nameB) return -1;
return 0;
});
return armesEquipe.sort(Misc.ascending(armeData => armeData.name + (armeData.data.mainInfo ?? '')));
}
/* -------------------------------------------- */
@ -808,8 +802,8 @@ export class RdDCombat {
const paramChatDefense = {
passeArme: attackerRoll.passeArme,
essais: attackerRoll.essais,
defender: this.defender,
attacker: this.attacker,
defender: Misc.data(this.defender),
attacker: Misc.data(this.attacker),
attackerId: this.attackerId,
esquiveUsage: esquiveUsage,
defenderTokenId: this.defenderTokenId,
@ -851,7 +845,7 @@ export class RdDCombat {
attackerId: this.attacker?.data._id,
defenderId: this.defender?.data._id,
defenderTokenId: this.defenderTokenId,
defenderRoll: duplicate(defenderRoll),
defenderRoll: defenderRoll,
paramChatDefense: paramChatDefense,
rollMode: true
}
@ -887,7 +881,7 @@ export class RdDCombat {
whisper: ChatUtility.getWhisperRecipientsAndGMs(this.attacker.name),
content: await renderTemplate('systems/foundryvtt-reve-de-dragon/templates/chat-demande-attaque-etotal.html', {
attackerId: this.attackerId,
attacker: this.attacker,
attacker: Misc.data(this.attacker),
defenderTokenId: this.defenderTokenId,
essais: attackerRoll.essais
})