From b4c21d7b9b2ad36ca90542a537f4ca434fe2c599 Mon Sep 17 00:00:00 2001 From: Eunomiac Date: Thu, 28 Sep 2023 07:32:08 -0400 Subject: [PATCH] (amend) --- ts/data-import/data-import.ts | 26 +++++++++++++------------- 1 file changed, 13 insertions(+), 13 deletions(-) diff --git a/ts/data-import/data-import.ts b/ts/data-import/data-import.ts index 2dfaf954..56f95c69 100644 --- a/ts/data-import/data-import.ts +++ b/ts/data-import/data-import.ts @@ -3250,11 +3250,11 @@ export const updateFactions = async () => { export const updateRollMods = async () => { await Promise.all([ ...Object.entries(JSONDATA.ABILITIES.RollMods) - .map(async ([aName, eData]) => { + .map(async ([abilityName, eData]) => { // Get ability doc - const abilityDoc = game.items.getName(aName); + const abilityDoc = game.items.getName(abilityName); if (!abilityDoc) { - eLog.error("updateRollMods", `updateRollMods: Ability ${aName} Not Found.`); + eLog.error("updateRollMods", `updateRollMods: Ability ${abilityName} Not Found.`); return undefined; } @@ -3272,19 +3272,19 @@ export const updateRollMods = async () => { (testChange.isMember && eData.some((change) => !change.isMember)) || (!testChange.isMember && eData.some((change) => change.isMember)) ) { - return eLog.error("updateRollMods", `updateRollMods: Ability ${aName} has inconsistent 'isMember' entries.`); + return eLog.error("updateRollMods", `updateRollMods: Ability ${abilityName} has inconsistent 'isMember' entries.`); } if ( (testChange.isCohort && eData.some((change) => !change.isCohort)) || (!testChange.isCohort && eData.some((change) => change.isCohort)) ) { - return eLog.error("updateRollMods", `updateRollMods: Ability ${aName} has inconsistent 'isCohort' entries.`); + return eLog.error("updateRollMods", `updateRollMods: Ability ${abilityName} has inconsistent 'isCohort' entries.`); } // If eData.isMember or eData.isCohort, first see if there already is such an effect on the doc if (testChange.isMember) { if (toMemberEffects.length > 1) { - return eLog.error("updateRollMods", `updateRollMods: Ability ${aName} Has Multiple 'APPLYTOMEMBERS' Active Effects`); + return eLog.error("updateRollMods", `updateRollMods: Ability ${abilityName} Has Multiple 'APPLYTOMEMBERS' Active Effects`); } // Initialize new effect data @@ -3293,7 +3293,7 @@ export const updateRollMods = async () => { icon: string, changes: Array> } = { - name: aName, + name: abilityName, icon: abilityDoc.img ?? "", changes: eData.map((change) => { delete change.isMember; @@ -3313,7 +3313,7 @@ export const updateRollMods = async () => { key: "APPLYTOMEMBERS", mode: 0, priority: null, - value: `${aName.replace(/\s*\([^()]*? (Ability|Upgrade)\)\s*$/, "")} (Scoundrel Ability)` + value: `${abilityName.replace(/\s*\([^()]*? (Ability|Upgrade)\)\s*$/, "")} (Scoundrel Ability)` }); } @@ -3321,7 +3321,7 @@ export const updateRollMods = async () => { return abilityDoc.createEmbeddedDocuments("ActiveEffect", [effectData]); } else if (testChange.isCohort) { if (toCohortEffects.length > 1) { - eLog.error("updateRollMods", `updateRollMods: Ability ${aName} Has Multiple 'APPLYTOCOHORTS' Active Effects`); + eLog.error("updateRollMods", `updateRollMods: Ability ${abilityName} Has Multiple 'APPLYTOCOHORTS' Active Effects`); return undefined; } @@ -3331,7 +3331,7 @@ export const updateRollMods = async () => { icon: string, changes: Array> } = { - name: aName, + name: abilityName, icon: abilityDoc.img ?? "", changes: eData.map((change) => { delete change.isCohort; @@ -3351,7 +3351,7 @@ export const updateRollMods = async () => { key: "APPLYTOCOHORTS", mode: 0, priority: null, - value: `${aName.replace(/\s*\([^()]*? (Ability|Upgrade)\)\s*$/, "")} (Scoundrel Ability)` + value: `${abilityName.replace(/\s*\([^()]*? (Ability|Upgrade)\)\s*$/, "")} (Scoundrel Ability)` }); } @@ -3359,7 +3359,7 @@ export const updateRollMods = async () => { return abilityDoc.createEmbeddedDocuments("ActiveEffect", [effectData]); } else { if (standardEffects.length > 1) { - eLog.error("updateRollMods", `updateRollMods: Ability ${aName} Has Multiple Active Effects`); + eLog.error("updateRollMods", `updateRollMods: Ability ${abilityName} Has Multiple Active Effects`); return undefined; } @@ -3369,7 +3369,7 @@ export const updateRollMods = async () => { icon: string, changes: Array> } = { - name: aName, + name: abilityName, icon: abilityDoc.img ?? "", changes: eData };