forked from GitHub-Mirrors/foundry-sw5e
skills and multiclass working
This commit is contained in:
parent
826f042dbb
commit
abc65220ec
1 changed files with 5 additions and 1 deletions
|
@ -133,12 +133,15 @@ export default class CharacterImporter {
|
||||||
CharacterImporter.addProfessions(sourceCharacter, actor);
|
CharacterImporter.addProfessions(sourceCharacter, actor);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Parse all classes and add them to already created actor.
|
||||||
|
// "class" is a reserved word, therefore I use profession where I can.
|
||||||
static async addProfessions(sourceCharacter, actor){
|
static async addProfessions(sourceCharacter, actor){
|
||||||
// "class" is a reserved word, therefore I use profession where I can.
|
|
||||||
let result = [];
|
let result = [];
|
||||||
|
|
||||||
// parse all class and multiclassX items
|
// parse all class and multiclassX items
|
||||||
// couldn't get Array.filter to work here for some reason
|
// couldn't get Array.filter to work here for some reason
|
||||||
|
// result = array of objects. each object is a separate class
|
||||||
sourceCharacter.attribs.forEach( (e) => {
|
sourceCharacter.attribs.forEach( (e) => {
|
||||||
if ( CharacterImporter.classOrMulticlass(e.name) ){
|
if ( CharacterImporter.classOrMulticlass(e.name) ){
|
||||||
var t = {
|
var t = {
|
||||||
|
@ -150,6 +153,7 @@ export default class CharacterImporter {
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
|
// pull classes directly from system compendium and add them to current actor
|
||||||
const professionsPack = await game.packs.get('sw5e.classes').getContent();
|
const professionsPack = await game.packs.get('sw5e.classes').getContent();
|
||||||
result.forEach( (prof) => {
|
result.forEach( (prof) => {
|
||||||
let assignedProfession = professionsPack.find( o => o.name === prof.profession );
|
let assignedProfession = professionsPack.find( o => o.name === prof.profession );
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue