v10 migration, ongoing WIP

This commit is contained in:
2022-05-03 09:01:10 +02:00
parent 4538439c02
commit a3fb328b7d
11 changed files with 60 additions and 65 deletions

View File

@ -845,6 +845,7 @@ export class RdDActor extends Actor {
/* -------------------------------------------- */
async updateCarac(caracName, caracValue) {
console.log("Carac change", caracName)
if (caracName == "force") {
if (Number(caracValue) > this.getTaille() + 4) {
ui.notifications.warn("Votre FORCE doit être au maximum de TAILLE+4");
@ -951,11 +952,11 @@ export class RdDActor extends Actor {
if (competence) {
const update = { _id: competence.id }
if (fieldName == "niveau")
update['data.niveau'] = compValue;
update['system.niveau'] = compValue;
else if (fieldName == "dommages")
update['data.dommages'] = compValue;
update['system.dommages'] = compValue;
else
update['data.carac_value'] = compValue;
update['system.carac_value'] = compValue;
await this.updateEmbeddedDocuments('Item', [update]); // updates one EmbeddedEntity
}
}