diff --git a/module/actor.js b/module/actor.js
index d0585047..5e97c81e 100644
--- a/module/actor.js
+++ b/module/actor.js
@@ -3748,7 +3748,7 @@ export class RdDActor extends Actor {
vendeur.ajouterDeniers(coutDeniers);
let resteQuantite = (itemVendu.data.quantite ?? 1) - achat.quantiteTotal;
if (resteQuantite == 0) {
- vendeur.deleteEmbeddedDocuments("Item", [itemId]);
+ vendeur.deleteEmbeddedDocuments("Item", [itemId])
}
else {
vendeur.updateEmbeddedDocuments("Item", [{ _id: itemId, 'data.quantite': resteQuantite }]);
diff --git a/module/rdd-possession.js b/module/rdd-possession.js
index 28b41e84..44a02423 100644
--- a/module/rdd-possession.js
+++ b/module/rdd-possession.js
@@ -42,27 +42,29 @@ export class RdDPossession {
if (possession.ptsPossession >= 2 ) {
possession.isPosseder = true
}
- if (possession.ptsConjuration <= -2 ) {
+ if (possession.ptsConjuration >= 2 ) {
possession.isConjurer = true
}
}
/* -------------------------------------------- */
static async resultConjuration( rollData) {
- console.log("RollData!!!", rollData)
+ let actor = game.actors.get(rollData.possession.data.possedeid)
if ( !rollData.rolled.isSuccess ) {
if( rollData.isECNIDefender) {
rollData.possession.data.compteur--
} else {
rollData.possession.data.compteur++
}
- let actor = game.actors.get(rollData.possession.data.possedeid)
let update = { _id: rollData.possession._id, "data.compteur": rollData.possession.data.compteur }
await actor.updateEmbeddedDocuments('Item', [update])
}
this.updateEtatPossession(rollData.possession)
await RdDResolutionTable.displayRollData(rollData, this, 'chat-resultat-possession.html')
+ if ( rollData.possession.isPosseder || rollData.possession.isConjurer) {
+ actor.deleteEmbeddedDocuments("Item", [rollData.possession._id])
+ }
}
/* -------------------------------------------- */
diff --git a/system.json b/system.json
index c7f87455..9b12c78d 100644
--- a/system.json
+++ b/system.json
@@ -29,7 +29,7 @@
"url": "https://gitlab.com/LeRatierBretonnien/foundryvtt-reve-de-dragon/",
"license": "LICENSE.txt",
"flags": {},
- "version": "1.5.73",
+ "version": "1.5.74",
"minimumCoreVersion": "0.8.0",
"compatibleCoreVersion": "9",
"scripts": [],
diff --git a/templates/chat-resultat-possession.html b/templates/chat-resultat-possession.html
index f67ee6da..025ba08a 100644
--- a/templates/chat-resultat-possession.html
+++ b/templates/chat-resultat-possession.html
@@ -31,10 +31,10 @@
Points de Possession: {{possession.ptsPossession}}
Points de Conjuration: {{possession.ptsConjuration}}
- {{#if isPosseder}}
-
Vous êtes été possédé par {{possesseur}} !
+ {{#if possession.isPosseder}}
+
Vous êtes été possédé par {{possession.data.typepossession}} ! La possession en cours a été supprimée.
{{/if}}
- {{#if isConjurer}}
-
Vous avez conjuré {{possesseur}} !
+ {{#if possession.isConjurer}}
+
Vous avez conjuré {{possession.data.typepossession}} ! La possession en cours a été supprimée.
{{/if}}