12.0.27 - Les vêtements d'Astrobazzarh #730

Merged
uberwald merged 23 commits from VincentVk/foundryvtt-reve-de-dragon:v11 into v11 2024-12-09 23:02:10 +01:00
Showing only changes of commit f7fc7fbefb - Show all commits

View File

@ -211,6 +211,7 @@ export class RdDStatBlockParser {
} }
} }
if (type == "personnage") {
// Now process armors // Now process armors
const armors = await SystemCompendiums.getWorldOrCompendiumItems("armure", "equipement") const armors = await SystemCompendiums.getWorldOrCompendiumItems("armure", "equipement")
for (let armor of armors) { for (let armor of armors) {
@ -223,21 +224,21 @@ export class RdDStatBlockParser {
} }
if (type == "personnage") {
await RdDStatBlockParser.parseHautReve(statString, actorData, items); await RdDStatBlockParser.parseHautReve(statString, actorData, items);
RdDStatBlockParser.parsePersonnage(statString, actorData); 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); 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 updates = {
} }
const endurance = XRegExp.exec(statString, XRegExp("endurance\\s+(?<value>\\d+)\\s+(\\(actuelle\\s*:\\s+(?<actuelle>\\d+)\\))?", 'giu')); const endurance = XRegExp.exec(statString, XRegExp("endurance\\s+(?<value>\\d+)\\s+(\\(actuelle\\s*:\\s+(?<actuelle>\\d+)\\))?", 'giu'));