Compare commits
5 Commits
b377739481
...
970008d3ae
Author | SHA1 | Date | |
---|---|---|---|
970008d3ae | |||
81d826ee2e | |||
2a164f6a32 | |||
6479f00642 | |||
3cbd777e6a |
@ -3,7 +3,7 @@
|
|||||||
- bouton pour le don de haut-rêve en un clic
|
- bouton pour le don de haut-rêve en un clic
|
||||||
- les compétences de draconic ne sont plus précédées de "Voie de"
|
- les compétences de draconic ne sont plus précédées de "Voie de"
|
||||||
- migration des compétences & compendiums
|
- migration des compétences & compendiums
|
||||||
- Correction feuille simplifiée qui ne s'affichait pas en ccas de sort variable
|
- Correction feuille simplifiée qui ne s'affichait pas en cas de sort variable
|
||||||
|
|
||||||
## 12.0.24 - Les ajustements d'Astrobazzarh
|
## 12.0.24 - Les ajustements d'Astrobazzarh
|
||||||
- amélioration
|
- amélioration
|
||||||
|
@ -17,7 +17,8 @@ const XREGEXP_COMP_CREATURE = WHITESPACES + "(?<carac>\\d+)"
|
|||||||
|
|
||||||
// Skill parser depending on the type of actor
|
// Skill parser depending on the type of actor
|
||||||
const compParser = {
|
const compParser = {
|
||||||
personnage: "(\\D+)*" + WHITESPACES + NUMERIC_VALUE,
|
//personnage: "(\\D+)*" + WHITESPACES + NUMERIC_VALUE,
|
||||||
|
personnage: WHITESPACES + NUMERIC_VALUE,
|
||||||
creature: XREGEXP_COMP_CREATURE,
|
creature: XREGEXP_COMP_CREATURE,
|
||||||
entite: XREGEXP_COMP_CREATURE
|
entite: XREGEXP_COMP_CREATURE
|
||||||
}
|
}
|
||||||
@ -105,6 +106,12 @@ export class RdDStatBlockParser {
|
|||||||
return "vaisseau";
|
return "vaisseau";
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static fixCompName(name) {
|
||||||
|
name = name.replace("Voie d'", "");
|
||||||
|
name = name.replace("Voie de ", "");
|
||||||
|
return name
|
||||||
|
}
|
||||||
|
|
||||||
static async parseStatBlock(statString) {
|
static async parseStatBlock(statString) {
|
||||||
|
|
||||||
//statString = statBlock03;
|
//statString = statBlock03;
|
||||||
@ -151,7 +158,8 @@ export class RdDStatBlockParser {
|
|||||||
const competences = await SystemCompendiums.getCompetences(type);
|
const competences = await SystemCompendiums.getCompetences(type);
|
||||||
//console.log("Competences : ", competences);
|
//console.log("Competences : ", competences);
|
||||||
for (let comp of competences) {
|
for (let comp of competences) {
|
||||||
let compMatch = XRegExp.exec(statString, XRegExp(comp.name + compParser[type], 'giu'));
|
let compNameToSearch = RdDStatBlockParser.fixCompName(comp.name)
|
||||||
|
let compMatch = XRegExp.exec(statString, XRegExp(compNameToSearch + compParser[type], 'giu'));
|
||||||
if (compMatch) {
|
if (compMatch) {
|
||||||
comp = comp.toObject()
|
comp = comp.toObject()
|
||||||
comp.system.niveau = Number(compMatch.value);
|
comp.system.niveau = Number(compMatch.value);
|
||||||
@ -377,8 +385,14 @@ export class RdDStatBlockParser {
|
|||||||
static extractName(actorType, statString) {
|
static extractName(actorType, statString) {
|
||||||
switch (actorType) {
|
switch (actorType) {
|
||||||
case "personnage":
|
case "personnage":
|
||||||
// Name is all string before first comma ','
|
// Check if ',né le' is present
|
||||||
const namePersonnage = XRegExp.exec(statString, XRegExp("(?<value>[\\p{Letter}\\s\\d]+),", 'giu'));
|
let namePersonnage = "Importé"
|
||||||
|
if ( statString.includes(", né") ) {
|
||||||
|
// Name is all string before first comma ','
|
||||||
|
namePersonnage = XRegExp.exec(statString, XRegExp("(?<value>[\\p{Letter}\\s\\d]+),", 'giu'));
|
||||||
|
} else {
|
||||||
|
namePersonnage = XRegExp.exec(statString, XRegExp("(?<value>[\\p{Letter}\\s\\d]+)\\s+TAILLE", 'giu'));
|
||||||
|
}
|
||||||
if (namePersonnage?.value) {
|
if (namePersonnage?.value) {
|
||||||
return Misc.upperFirst(namePersonnage?.value);
|
return Misc.upperFirst(namePersonnage?.value);
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user