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 d5686b81ed - Show all commits

View File

@ -110,7 +110,7 @@ export class RdDStatBlockParser {
name = name.replace("Voie d'", ""); name = name.replace("Voie d'", "");
name = name.replace("Voie de ", ""); name = name.replace("Voie de ", "");
return name return name
} }
static async parseStatBlock(statString) { static async parseStatBlock(statString) {
@ -211,16 +211,16 @@ export class RdDStatBlockParser {
} }
} }
// 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) {
let matchArmor = XRegExp.exec(statString, XRegExp(armor.name, 'giu')); let matchArmor = XRegExp.exec(statString, XRegExp(armor.name, 'giu'));
if (matchArmor) { if (matchArmor) {
armor = armor.toObject() armor = armor.toObject()
armor.system.equipe = true armor.system.equipe = true
items.push(armor); items.push(armor);
}
} }
}
if (type == "personnage") { if (type == "personnage") {
@ -322,7 +322,7 @@ export class RdDStatBlockParser {
actorData.taille = taille.value; actorData.taille = taille.value;
} }
// Get weight // Get weight
const poids = XRegExp.exec(statString, XRegExp("(?<value>\\d+) kg", 'giu')); const poids = XRegExp.exec(statString, XRegExp("(?<value>\\d+ kg)", 'giu'));
if (poids?.value) { if (poids?.value) {
actorData.poids = poids.value; actorData.poids = poids.value;
} }
@ -387,7 +387,7 @@ export class RdDStatBlockParser {
case "personnage": case "personnage":
// Check if ',né le' is present // Check if ',né le' is present
let namePersonnage = "Importé" let namePersonnage = "Importé"
if ( statString.includes(", né") ) { if (statString.includes(", né")) {
// Name is all string before first comma ',' // Name is all string before first comma ','
namePersonnage = XRegExp.exec(statString, XRegExp("(?<value>[\\p{Letter}\\s\\d]+),", 'giu')); namePersonnage = XRegExp.exec(statString, XRegExp("(?<value>[\\p{Letter}\\s\\d]+),", 'giu'));
} else { } else {