Compare commits
No commits in common. "970008d3aeac435d494a813df921a2be4427bbc3" and "b37773948186ad97b4c02677eb25745065b98c3b" have entirely different histories.
970008d3ae
...
b377739481
@ -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 cas de sort variable
|
- Correction feuille simplifiée qui ne s'affichait pas en ccas de sort variable
|
||||||
|
|
||||||
## 12.0.24 - Les ajustements d'Astrobazzarh
|
## 12.0.24 - Les ajustements d'Astrobazzarh
|
||||||
- amélioration
|
- amélioration
|
||||||
|
@ -17,8 +17,7 @@ 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
|
||||||
}
|
}
|
||||||
@ -106,12 +105,6 @@ 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;
|
||||||
@ -158,8 +151,7 @@ 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 compNameToSearch = RdDStatBlockParser.fixCompName(comp.name)
|
let compMatch = XRegExp.exec(statString, XRegExp(comp.name + compParser[type], 'giu'));
|
||||||
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);
|
||||||
@ -385,14 +377,8 @@ export class RdDStatBlockParser {
|
|||||||
static extractName(actorType, statString) {
|
static extractName(actorType, statString) {
|
||||||
switch (actorType) {
|
switch (actorType) {
|
||||||
case "personnage":
|
case "personnage":
|
||||||
// Check if ',né le' is present
|
// Name is all string before first comma ','
|
||||||
let namePersonnage = "Importé"
|
const namePersonnage = XRegExp.exec(statString, XRegExp("(?<value>[\\p{Letter}\\s\\d]+),", 'giu'));
|
||||||
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