Automatically select skill for effects (#59)
Changes: + when a mod gets added, check if it's a skill + if it's a skill, find appropiate ID in actors item list and apply it to the mod
This commit is contained in:
parent
fed1175987
commit
a56e6bab3d
|
|
@ -145,6 +145,11 @@ export class M5Item extends Item {
|
|||
}
|
||||
if (itemData?.mods) {
|
||||
calc.mods = {};
|
||||
for (let modKey in itemData.mods) {
|
||||
if (itemData.mods[modKey].type === M5ModType.SKILL && itemData.mods[modKey].id?.includes("midgard5")) {
|
||||
itemData.mods[modKey].id = actor?.items.find((x) => x.name === game["i18n"].localize(itemData.mods[modKey].id))?.id;
|
||||
}
|
||||
}
|
||||
|
||||
Object.keys(itemData?.mods).forEach((key) => {
|
||||
const mod = itemData.mods[key];
|
||||
|
|
|
|||
Loading…
Reference in New Issue