This commit is contained in:
sladecraven 2020-09-05 22:56:33 +02:00
parent 4a5beeea36
commit b7471e0c97
4 changed files with 13 additions and 16 deletions

View File

@ -1,4 +1,10 @@
==================================================================
v0.9.2 - 05/09/2020
Erreur de calcul sur points de vie
Gestion différente des compétences "troncs"
==================================================================
v0.9.1 - 03/09/2020 v0.9.1 - 03/09/2020
Initial official release Initial official release
Z

View File

@ -298,21 +298,12 @@ export class RdDActor extends Actor {
let troncList = RdDUtility.isTronc( compName ); let troncList = RdDUtility.isTronc( compName );
let maxNiveau = compValue; let maxNiveau = compValue;
if ( troncList ) { if ( troncList ) {
let troncCompValue = (compValue > 0) ? 0 : compValue; // Clamp it to 0 let message = "Vous avez modifié une compétence 'tronc'. Vérifiez que les compétences suivantes évoluent ensemble jusqu'au niveau 0 : ";
for(let troncName of troncList) { for(let troncName of troncList) {
if ( troncName != compName) { message += "<br>" + troncName;
console.log("Update competence tronc", troncName, compValue);
let comp2 = RdDUtility.findCompetence( this.data.items, troncName);
if (comp2.data.niveau > maxNiveau) maxNiveau = comp2.data.niveau;
if ( comp2.data.niveau <= 0 && comp2.data.niveau < troncCompValue ) { // Update only of below 0
const update = {_id: comp2._id, 'data.niveau': compValue };
const updated = await this.updateEmbeddedEntity("OwnedItem", update); // Updates one EmbeddedEntity
}
}
}
if ( compValue < maxNiveau) { // Manage case when someone set a value below
compValue = (maxNiveau > 0) ? 0 : maxNiveau;
} }
ChatMessage.create( { title : "Compétence Tron",
content: message } );
} }
const update = {_id: comp._id, 'data.niveau': maxNiveau }; const update = {_id: comp._id, 'data.niveau': maxNiveau };
const updated = await this.updateEmbeddedEntity("OwnedItem", update); // Updates one EmbeddedEntity const updated = await this.updateEmbeddedEntity("OwnedItem", update); // Updates one EmbeddedEntity

View File

@ -295,7 +295,7 @@ export class RdDUtility {
data.carac.tir.value = Math.floor( (parseInt(data.carac.vue.value) + parseInt(data.carac.dexterite.value)) / 2); data.carac.tir.value = Math.floor( (parseInt(data.carac.vue.value) + parseInt(data.carac.dexterite.value)) / 2);
data.carac.lancer.value = Math.floor( (parseInt(data.carac.tir.value) + parseInt(data.carac.force.value)) / 2); data.carac.lancer.value = Math.floor( (parseInt(data.carac.tir.value) + parseInt(data.carac.force.value)) / 2);
data.sante.vie.max = Math.ceil( parseInt(data.carac.taille.value) + parseInt(data.carac.constitution.value) /2 ); data.sante.vie.max = Math.ceil( (parseInt(data.carac.taille.value) + parseInt(data.carac.constitution.value)) /2 );
if ( data.sante.vie.value > data.sante.vie.max) if ( data.sante.vie.value > data.sante.vie.max)
data.sante.vie.value = data.sante.vie.max; data.sante.vie.value = data.sante.vie.max;
let endurance = Math.max( parseInt(data.carac.taille.value) + parseInt(data.carac.constitution.value), parseInt(data.sante.vie.max) + parseInt(data.carac.volonte.value) ); let endurance = Math.max( parseInt(data.carac.taille.value) + parseInt(data.carac.constitution.value), parseInt(data.sante.vie.max) + parseInt(data.carac.volonte.value) );

View File

@ -2,7 +2,7 @@
"name": "foundryvtt-reve-de-dragon", "name": "foundryvtt-reve-de-dragon",
"title": "Rêve de Dragon", "title": "Rêve de Dragon",
"description": "Rêve de Dragon RPG for FoundryVTT", "description": "Rêve de Dragon RPG for FoundryVTT",
"version": "0.9.1", "version": "0.9.2",
"minimumCoreVersion": "0.6.0", "minimumCoreVersion": "0.6.0",
"compatibleCoreVersion": "0.6.2", "compatibleCoreVersion": "0.6.2",
"templateVersion": 28, "templateVersion": 28,