Various fixes

This commit is contained in:
sladecraven 2022-05-14 20:39:01 +02:00
parent 6d00efa70e
commit 54d546b941
4 changed files with 11 additions and 9 deletions

View File

@ -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 }]);

View File

@ -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])
}
}
/* -------------------------------------------- */

View File

@ -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": [],

View File

@ -31,10 +31,10 @@
<br>Points de Possession: {{possession.ptsPossession}}
<br>Points de Conjuration: {{possession.ptsConjuration}}
{{#if isPosseder}}
<br><strong>Vous êtes été possédé par {{possesseur}} !</strong>
{{#if possession.isPosseder}}
<br><strong>Vous êtes été possédé par {{possession.data.typepossession}} ! La possession en cours a été supprimée.</strong>
{{/if}}
{{#if isConjurer}}
<br><strong>Vous avez conjuré {{possesseur}} !</strong>
{{#if possession.isConjurer}}
<br><strong>Vous avez conjuré {{possession.data.typepossession}} ! La possession en cours a été supprimée.</strong>
{{/if}}
</div>