forked from public/foundryvtt-reve-de-dragon
Ajout de confirmation pour refoulement
This commit is contained in:
@ -1426,9 +1426,21 @@ export class RdDActor extends Actor {
|
||||
/* -------------------------------------------- */
|
||||
async actionRefoulement(item) {
|
||||
const refoulement = item?.system.refoulement ?? 0;
|
||||
if (refoulement>0){
|
||||
await this.ajouterRefoulement(refoulement);
|
||||
await item.delete();
|
||||
if (refoulement>0) {
|
||||
RdDConfirm.confirmer({
|
||||
settingConfirmer: "confirmation-refouler",
|
||||
content: `<p>Prennez-vous le risque de refouler ${item.name} pour ${refoulement} points de refoulement ?</p>`,
|
||||
title: 'Confirmer la refoulement',
|
||||
buttonLabel: 'Refouler',
|
||||
onAction: async () => {
|
||||
ChatMessage.create({
|
||||
whisper: ChatUtility.getWhisperRecipientsAndGMs(this.name),
|
||||
content: `${this.name} a refoulé une queue ${item.nname} pour ${refoulement} points de refoulement`
|
||||
});
|
||||
await this.ajouterRefoulement(refoulement);
|
||||
await item.delete();
|
||||
}
|
||||
})
|
||||
}
|
||||
}
|
||||
|
||||
@ -3703,7 +3715,7 @@ export class RdDActor extends Actor {
|
||||
system: mergeObject(vente.item.system, { quantite: isItemEmpilable ? achat.quantiteTotal : undefined }),
|
||||
}
|
||||
let listeAchat = isItemEmpilable ? [achatData] : Array.from({ length: achat.quantiteTotal }, (_, i) => achatData)
|
||||
let items = await acheteur.createEmbeddedDocuments("Item", listeAchat)
|
||||
let items = await acheteur.createEmbeddedDocuments("Item", listeAchat);
|
||||
if (achat.choix.consommer && vente.item.type == 'nourritureboisson') {
|
||||
achat.choix.doses = achat.choix.nombreLots;
|
||||
await acheteur.consommerNourritureboisson(items[0], achat.choix);
|
||||
|
Reference in New Issue
Block a user