diff --git a/module/actor-sheet.js b/module/actor-sheet.js index bc955925..d87f3908 100644 --- a/module/actor-sheet.js +++ b/module/actor-sheet.js @@ -158,7 +158,7 @@ export class RdDActorSheet extends ActorSheet { async displayDialogEncaisser( ) { let data = { bonusmalusTable: CONFIG.RDD.bonusmalus }; let html = await renderTemplate('systems/foundryvtt-reve-de-dragon/templates/dialog-roll-encaisser.html', data ); - new RdDEncaisser(html, this.actor ).render(true); + new RdDEncaisser(html, this.actor ).render(true);enleverDeConteneur } /* -------------------------------------------- */ @@ -167,8 +167,10 @@ export class RdDActorSheet extends ActorSheet { let dropID = $(event.target).parents(".item").attr("data-item-id"); // Only relevant if container drop if ( dropID ) { // Dropped over an item !!! let objetId = dragData.id || dragData.data._id; - this.actor.enleverDeConteneur(objetId, this.objetVersConteneur[objetId]); - this.actor.ajouterAConteneur(objetId, dropID); + if ( this.objetVersConteneur[objetId] != dropID ) { + this.actor.enleverDeConteneur(objetId, this.objetVersConteneur[objetId]); + this.actor.ajouterAConteneur(objetId, dropID); + } } console.log("DATA !!!!", dragData, dropID ); super._onDrop(event) diff --git a/module/actor.js b/module/actor.js index 3e8dbbae..924e4ada 100644 --- a/module/actor.js +++ b/module/actor.js @@ -162,6 +162,9 @@ export class RdDActor extends Actor { } } else { // This is the attack roll! if (rolled.isSuccess) { + if (rolled.tache >= 3) { // Critique ! + console.log("TODO Gérer critique!"); + } rollData.domArmePlusDom = parseInt(rollData.arme.data.dommages); if (rollData.selectedCarac.label == "Mêlée") // +dom only for Melee rollData.domArmePlusDom += parseInt(this.data.data.attributs.plusdom.value); @@ -196,7 +199,7 @@ export class RdDActor extends Actor { lvl = rollData.selectedDraconic.name + "/" + rollData.selectedSort.name; let myReve = duplicate(this.data.data.reve.reve); if (rolled.isSuccess) { // Réussite du sort ! - if (rolled.tache >= 4) costReve = Math.ceil(costReve / 2); + if (rolled.tache >= 3) costReve = Math.ceil(costReve / 2); if (costReve < 1) costReve = 1; myReve.value = myReve.value - costReve; // Todo 0 pts de reve !!!! if (myReve.value < 0) myReve.value = 0; diff --git a/system.json b/system.json index 1aefb817..958f5b69 100644 --- a/system.json +++ b/system.json @@ -2,7 +2,7 @@ "name": "foundryvtt-reve-de-dragon", "title": "Rêve de Dragon", "description": "Rêve de Dragon RPG for FoundryVTT", - "version": "0.9.37", + "version": "0.9.38", "minimumCoreVersion": "0.7.5", "compatibleCoreVersion": "0.7.6", "templateVersion": 44,