Corrections v10

Il y en avait partout dans des dialogues, des options,
le drag&drop d'acteur sur acteur, l'empilage d'objet...
This commit is contained in:
Vincent Vandemeulebrouck
2022-09-07 00:09:17 +02:00
parent 59613c3bf8
commit 67b0555b11
28 changed files with 107 additions and 105 deletions

View File

@ -9,7 +9,7 @@ export class DialogFabriquerPotion extends Dialog {
let potionData = DialogFabriquerPotion.prepareData(actor, item);
let conf = {
title: `Fabriquer une potion de ${potionData.data.categorie}`,
title: `Fabriquer une potion de ${potionData.system.categorie}`,
content: await renderTemplate(dialogConfig.html, potionData),
default: potionData.buttonName,
};
@ -25,8 +25,8 @@ export class DialogFabriquerPotion extends Dialog {
/* -------------------------------------------- */
static prepareData(actor, item) {
let potionData = duplicate(item)
potionData.nbBrinsSelect = RdDUtility.buildListOptions(1, potionData.data.quantite);
potionData.nbBrins = Math.min(potionData.data.quantite, DialogFabriquerPotion.getNombreBrinOptimal(potionData));
potionData.nbBrinsSelect = RdDUtility.buildListOptions(1, potionData.system.quantite);
potionData.nbBrins = Math.min(potionData.system.quantite, DialogFabriquerPotion.getNombreBrinOptimal(potionData));
potionData.buttonName = "Fabriquer";
return potionData;
}
@ -46,9 +46,9 @@ export class DialogFabriquerPotion extends Dialog {
}
static getNombreBrinOptimal(herbeData) {
switch (herbeData.data.categorie ?? '') {
case "Soin": return 12 - herbeData.data.niveau;
case "Repos": return 7 - herbeData.data.niveau;
switch (herbeData.system.categorie ?? '') {
case "Soin": return 12 - herbeData.system.niveau;
case "Repos": return 7 - herbeData.system.niveau;
}
return 1;
}