Pas mal de bugfixes

This commit is contained in:
sladecraven 2021-02-14 09:31:52 +01:00
parent d837c25468
commit 5e53dc5262
4 changed files with 13 additions and 8 deletions

View File

@ -702,7 +702,7 @@ export class RdDActor extends Actor {
/* -------------------------------------------- */ /* -------------------------------------------- */
async updateCreatureCompetence(compName, fieldName, compValue) { async updateCreatureCompetence(compName, fieldName, compValue) {
let comp = this.getCompetence(compName); let comp = this.getCompetence(compName);
console.log(comp); //console.log(comp);
if (comp) { if (comp) {
const update = { _id: comp._id } const update = { _id: comp._id }
if (fieldName == "niveau") if (fieldName == "niveau")
@ -711,7 +711,7 @@ export class RdDActor extends Actor {
update['data.dommages'] = compValue; update['data.dommages'] = compValue;
else else
update['data.carac_value'] = compValue; update['data.carac_value'] = compValue;
console.log(update); //console.log(update);
const updated = await this.updateEmbeddedEntity("OwnedItem", update); // Updates one EmbeddedEntity const updated = await this.updateEmbeddedEntity("OwnedItem", update); // Updates one EmbeddedEntity
} }
} }
@ -1991,8 +1991,8 @@ export class RdDActor extends Actor {
if (rollData.competence.type == 'competencecreature') { if (rollData.competence.type == 'competencecreature') {
if (rollData.competence.data.iscombat) { if (rollData.competence.data.iscombat) {
const arme = RdDItemCompetenceCreature.toArme(competence); const arme = RdDItemCompetenceCreature.toArme(rollData.competence);
RdDCombat.createUsingTarget(this).attaque(competence, arme); RdDCombat.createUsingTarget(this).attaque(rollData.competence, arme);
return; return;
} }
// Fake competence pour créature // Fake competence pour créature

View File

@ -33,10 +33,12 @@ export class RdDItemCompetenceCreature extends Item {
return undefined; return undefined;
} }
/* -------------------------------------------- */
static isCompetenceAttaque(item) { static isCompetenceAttaque(item) {
return item.type == 'competencecreature' && item.data.iscombat; return item.type == 'competencecreature' && item.data.iscombat;
} }
/* -------------------------------------------- */
static isCompetenceParade(item) { static isCompetenceParade(item) {
return item.type == 'competencecreature' && item.data.isparade; return item.type == 'competencecreature' && item.data.isparade;
} }

View File

@ -327,11 +327,11 @@ export class TMRRencontres {
if (!roll || roll <= 0 || roll > 100) { if (!roll || roll <= 0 || roll > 100) {
roll = new Roll("1d100").evaluate().total; roll = new Roll("1d100").evaluate().total;
} }
let rencontre = TMRRencontres.getRencontreAleatoire(terrain, roll); let rencontre = await TMRRencontres.getRencontreAleatoire(terrain, roll);
ChatMessage.create({ ChatMessage.create({
user: game.user._id, user: game.user._id,
whisper: [game.user._id], whisper: [game.user._id],
content: `Rencontre en ${terrain} (jet : ${roll}%)<br>Vous rencontrez un ${rencontre.name} de ${force} Points de Rêve` content: `Rencontre en ${terrain} (jet : ${roll}%)<br>Vous rencontrez un ${rencontre.name} de ${rencontre.force} Points de Rêve`
}); });
return false; return false;
} }
@ -360,11 +360,12 @@ export class TMRRencontres {
roll = new Roll("1d100").evaluate().total; roll = new Roll("1d100").evaluate().total;
} }
terrain = Grammar.toLowerCaseNoAccent(terrain); terrain = Grammar.toLowerCaseNoAccent(terrain);
console.log("getRencontreAleatoire", terrain, roll); //console.log("getRencontreAleatoire", terrain, roll);
const code = tableRencontres[terrain].find(it => it.range[0] <= roll && roll <= it.range[1]).code; const code = tableRencontres[terrain].find(it => it.range[0] <= roll && roll <= it.range[1]).code;
const rencontre = duplicate(rencontresStandard.find(it => it.code == code)); const rencontre = duplicate(rencontresStandard.find(it => it.code == code));
rencontre.roll = roll; rencontre.roll = roll;
await TMRRencontres.evaluerForceRencontre(rencontre); await TMRRencontres.evaluerForceRencontre(rencontre);
//console.log(rencontre);
return rencontre; return rencontre;
} }
@ -405,6 +406,7 @@ export class TMRRencontres {
return gestion; return gestion;
} }
/* -------------------------------------------- */
static async gererRencontre(tmrDialog, data) { static async gererRencontre(tmrDialog, data) {
let gestion = TMRRencontres.getGestionRencontre(data.rencontre.type); let gestion = TMRRencontres.getGestionRencontre(data.rencontre.type);
if (data.rolled.isSuccess) { if (data.rolled.isSuccess) {
@ -424,6 +426,7 @@ export class TMRRencontres {
return gestion.postEchec; return gestion.postEchec;
} }
/* -------------------------------------------- */
static msgEchecPasseurFou(data) { static msgEchecPasseurFou(data) {
data.sortReserve = data.actor.data.data.reve.reserve.list[0]; data.sortReserve = data.actor.data.data.reve.reserve.list[0];
if (data.sortReserve) { if (data.sortReserve) {

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": "1.3.20", "version": "1.3.21",
"manifestPlusVersion": "1.0.0", "manifestPlusVersion": "1.0.0",
"minimumCoreVersion": "0.7.5", "minimumCoreVersion": "0.7.5",
"compatibleCoreVersion": "0.7.9", "compatibleCoreVersion": "0.7.9",