From f7fc7fbefb8bb4e6c56af624d3c68944619e5cd6 Mon Sep 17 00:00:00 2001 From: Vincent Vandemeulebrouck Date: Fri, 6 Dec 2024 22:59:03 +0100 Subject: [PATCH] =?UTF-8?q?Ouverture=20de=20l'acteur=20apr=C3=A8s=20import?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- module/apps/rdd-import-stats.js | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) diff --git a/module/apps/rdd-import-stats.js b/module/apps/rdd-import-stats.js index cd05e1e8..c7fb0ab9 100644 --- a/module/apps/rdd-import-stats.js +++ b/module/apps/rdd-import-stats.js @@ -211,6 +211,7 @@ export class RdDStatBlockParser { } } + if (type == "personnage") { // Now process armors const armors = await SystemCompendiums.getWorldOrCompendiumItems("armure", "equipement") for (let armor of armors) { @@ -223,21 +224,21 @@ export class RdDStatBlockParser { } - if (type == "personnage") { await RdDStatBlockParser.parseHautReve(statString, actorData, items); RdDStatBlockParser.parsePersonnage(statString, actorData); } - let name = RdDStatBlockParser.extractName(type, statString); + const name = RdDStatBlockParser.extractName(type, statString); - let newActor = await RdDBaseActorReve.create({ name, type: type, system: actorData, items }); - await newActor.remiseANeuf() - await RdDStatBlockParser.setValActuelle(newActor, statString) - // DUmp.... console.log(actorData); + + let newActor = await RdDBaseActorReve.create({ name, type, system: actorData, items }); + await newActor.remiseANeuf() + await RdDStatBlockParser.setValeursActuelles(newActor, statString) + await newActor?.sheet.render(true) } - static async setValActuelle(newActor, statString) { + static async setValeursActuelles(newActor, statString) { const updates = { } const endurance = XRegExp.exec(statString, XRegExp("endurance\\s+(?\\d+)\\s+(\\(actuelle\\s*:\\s+(?\\d+)\\))?", 'giu'));