Compare commits
4 Commits
c3fda04b74
...
9448407e41
Author | SHA1 | Date | |
---|---|---|---|
9448407e41 | |||
32adbb721f | |||
f3120f34d0 | |||
c6feac41c6 |
@ -195,17 +195,16 @@ export class RdDStatBlockParser {
|
||||
const competences = await SystemCompendiums.getCompetences(actorData.flags.type);
|
||||
//console.log("Competences : ", competences);
|
||||
for (let competence of competences) {
|
||||
let compSourceString = statString
|
||||
let pushed = actorData.flags.type != "personnage"
|
||||
let compNameToSearch = RdDStatBlockParser.fixCompName(competence.name)
|
||||
let compMatch = XRegExp.exec(compSourceString, XRegExp("\\s" + compNameToSearch + compParser[actorData.flags.type], 'giu'))
|
||||
while (compMatch) {
|
||||
items.push(RdDStatBlockParser.prepareCompetence(actorData, competence, compMatch))
|
||||
|
||||
// pour gérer les compétences avec spécialisations, si elle est trouvée, chercher si elle apparaît dans la suite
|
||||
compSourceString = compSourceString.substring(compSourceString.indexOf(compNameToSearch) + compNameToSearch.length)
|
||||
compMatch = XRegExp.exec(compSourceString, XRegExp("\\s" + compNameToSearch + compParser[actorData.flags.type], 'giu'))
|
||||
}
|
||||
if (actorData.flags.type == "personnage" && compSourceString.length == statString.length) {
|
||||
XRegExp.forEach(statString, XRegExp("\\s" + compNameToSearch + compParser[actorData.flags.type], 'giu'),
|
||||
function (compMatch, i) {
|
||||
items.push(RdDStatBlockParser.prepareCompetence(actorData, competence, compMatch))
|
||||
if (!compMatch.special) {
|
||||
pushed = true
|
||||
}
|
||||
})
|
||||
if (!pushed) {
|
||||
// ajout niveau de base
|
||||
items.push(competence.toObject())
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user