|
|
|
@ -339,7 +339,7 @@ export class XmlImport {
|
|
|
|
|
|
|
|
|
|
|
|
async #addSkillFromCompendiumByNameToActor(talentName, taw, actor, combatStatistics, attributes) {
|
|
|
|
async #addSkillFromCompendiumByNameToActor(talentName, taw, actor, combatStatistics, attributes) {
|
|
|
|
const compendiumOfSkills = game.packs.get('DSA_4-1.Skills');
|
|
|
|
const compendiumOfSkills = game.packs.get('DSA_4-1.Skills');
|
|
|
|
const talentId = compendiumOfSkills.index.find(skill => skill.name === talentName)
|
|
|
|
const talentId = compendiumOfSkills.index.find(skill => skill.name.trim() === talentName.trim())
|
|
|
|
if (talentId) {
|
|
|
|
if (talentId) {
|
|
|
|
|
|
|
|
|
|
|
|
const talent = await compendiumOfSkills.getDocument(talentId._id);
|
|
|
|
const talent = await compendiumOfSkills.getDocument(talentId._id);
|
|
|
|
@ -368,7 +368,7 @@ export class XmlImport {
|
|
|
|
|
|
|
|
|
|
|
|
async #addAdvantageFromCompendiumByNameToActor(advantageName, advantageValue, actor) {
|
|
|
|
async #addAdvantageFromCompendiumByNameToActor(advantageName, advantageValue, actor) {
|
|
|
|
const compendiumOfAdvantages = game.packs.get('DSA_4-1.Advantage');
|
|
|
|
const compendiumOfAdvantages = game.packs.get('DSA_4-1.Advantage');
|
|
|
|
const advantageId = compendiumOfAdvantages.index.find(skill => skill.name === advantageName)
|
|
|
|
const advantageId = compendiumOfAdvantages.index.find(skill => skill.name.trim() === advantageName.trim())
|
|
|
|
if (advantageId) {
|
|
|
|
if (advantageId) {
|
|
|
|
|
|
|
|
|
|
|
|
const advantage = await compendiumOfAdvantages.getDocument(advantageId._id);
|
|
|
|
const advantage = await compendiumOfAdvantages.getDocument(advantageId._id);
|
|
|
|
@ -385,7 +385,7 @@ export class XmlImport {
|
|
|
|
async #addSpellsFromCompendiumByNameToActor(spellName, zfw, representation, hauszauber, actor) {
|
|
|
|
async #addSpellsFromCompendiumByNameToActor(spellName, zfw, representation, hauszauber, actor) {
|
|
|
|
const compendiumOfSpells = game.packs.get('DSA_4-1.Spells')
|
|
|
|
const compendiumOfSpells = game.packs.get('DSA_4-1.Spells')
|
|
|
|
const SCREAMING_NAME = spellName.toUpperCase()
|
|
|
|
const SCREAMING_NAME = spellName.toUpperCase()
|
|
|
|
const spellId = compendiumOfSpells.index.find(spell => spell.name === SCREAMING_NAME)
|
|
|
|
const spellId = compendiumOfSpells.index.find(spell => spell.name.trim() === SCREAMING_NAME.trim())
|
|
|
|
if (spellId) {
|
|
|
|
if (spellId) {
|
|
|
|
|
|
|
|
|
|
|
|
const spell = await compendiumOfSpells.getDocument(spellId._id);
|
|
|
|
const spell = await compendiumOfSpells.getDocument(spellId._id);
|
|
|
|
@ -403,7 +403,7 @@ export class XmlImport {
|
|
|
|
async #addLiturgiesFromCompendiumByNameToActor(liturgyName, actor) {
|
|
|
|
async #addLiturgiesFromCompendiumByNameToActor(liturgyName, actor) {
|
|
|
|
const compendiumOfLiturgies = game.packs.get('DSA_4-1.Liturgies');
|
|
|
|
const compendiumOfLiturgies = game.packs.get('DSA_4-1.Liturgies');
|
|
|
|
const liturgyId = compendiumOfLiturgies.index.find(liturgy => {
|
|
|
|
const liturgyId = compendiumOfLiturgies.index.find(liturgy => {
|
|
|
|
return liturgy.name === LiturgyData.lookupAlias(liturgyName.split(" (")[0])
|
|
|
|
return liturgy.name.trim() === LiturgyData.lookupAlias(liturgyName.split(" (")[0]).trim()
|
|
|
|
})
|
|
|
|
})
|
|
|
|
if (liturgyId) {
|
|
|
|
if (liturgyId) {
|
|
|
|
|
|
|
|
|
|
|
|
|