Fix WoM effects for robes and enchanted staff
This commit is contained in:
parent
4ebaad012b
commit
b7bb897a46
File diff suppressed because one or more lines are too long
@ -1,8 +1,9 @@
|
||||
let lore = this.effect.name.split("(")[1].split(")")[0].toLowerCase();
|
||||
let spellLore = game.wfrp4e.config.magicLores[args.spell.system.lore.value].toLowerCase();
|
||||
|
||||
// If channelling corresponding lore
|
||||
if (args.type == "channelling" && args.spell.system.lore.value == lore)
|
||||
if (args.type == "channelling" && spellLore == lore)
|
||||
args.prefillModifiers.slBonus += 2
|
||||
// If channelling or casting different lore
|
||||
else if (args.spell.system.lore.value != lore && args.spell.system.lore.value != "petty")
|
||||
args.prefillModifiers.slBonus -= 1
|
||||
else if (spellLore != lore && args.spell.system.lore.value != "petty")
|
||||
args.prefillModifiers.slBonus -= 1
|
||||
|
@ -1,14 +1,14 @@
|
||||
// This script needs to be separate because equipTransfer is off on the other effect, and thus won't execute when added to an actor
|
||||
|
||||
let mainEffect = this.item.effects.contents[0];
|
||||
if (mainEffect.name.includes("(Savoir)"))
|
||||
if (mainEffect.name.includes("(Lore)"))
|
||||
{
|
||||
let choice = await ItemDialog.create(ItemDialog.objectToArray(game.wfrp4e.config.magicLores, this.item.img), 1, "Choisissez le Savoir");
|
||||
if (choice.length)
|
||||
{
|
||||
mainEffect.update({name : mainEffect.name.replace("Savoir", choice[0].name)})
|
||||
mainEffect.update({name : mainEffect.name.replace("Lore", choice[0].name)})
|
||||
this.item.update({name : this.item.name += ` (${choice[0].name})`})
|
||||
}
|
||||
}
|
||||
|
||||
this.effect.delete();
|
||||
this.effect.delete();
|
||||
|
@ -1,8 +1,9 @@
|
||||
let lore = this.effect.name.split("(")[1].split(")")[0].toLowerCase();
|
||||
let spellLore = game.wfrp4e.config.magicLores[args.spell.system.lore.value].toLowerCase();
|
||||
|
||||
// If channelling corresponding lore
|
||||
if (args.type == "channelling" && args.spell.system.lore.value == lore)
|
||||
if (args.type == "channelling" && spellLore == lore)
|
||||
args.prefillModifiers.slBonus += 1
|
||||
// If channelling or casting different lore
|
||||
else if (args.spell.system.lore.value != lore && args.spell.system.lore.value != "petty")
|
||||
args.prefillModifiers.slBonus -= 1
|
||||
else if (spellLore != lore && args.spell.system.lore.value != "petty")
|
||||
args.prefillModifiers.slBonus -= 1
|
||||
|
@ -1,2 +1,3 @@
|
||||
let lore = this.effect.name.split("(")[1].split(")")[0].toLowerCase();
|
||||
return !args.spell || (args.type == "cast" && ["petty", lore].includes(args.spell.system.lore.value));
|
||||
let spellLore = game.wfrp4e.config.magicLores[args.spell.system.lore.value].toLowerCase();
|
||||
return !args.spell || (args.type == "cast" && [game.wfrp4e.config.magicLores["petty"].toLowerCase(), lore].includes(spellLore));
|
||||
|
@ -1,8 +1,9 @@
|
||||
let lore = this.effect.name.split("(")[1].split(")")[0].toLowerCase();
|
||||
let spellLore = game.wfrp4e.config.magicLores[args.spell.system.lore.value].toLowerCase();
|
||||
|
||||
// If channelling corresponding lore
|
||||
if (args.type == "channelling" && args.spell.system.lore.value == lore)
|
||||
if (args.type == "channelling" && spellLore == lore)
|
||||
args.prefillModifiers.slBonus += 3
|
||||
// If channelling or casting different lore
|
||||
else if (args.spell.system.lore.value != lore && args.spell.system.lore.value != "petty")
|
||||
args.prefillModifiers.slBonus -= 1
|
||||
else if (spellLore != lore && args.spell.system.lore.value != "petty")
|
||||
args.prefillModifiers.slBonus -= 1
|
||||
|
@ -1,5 +1,5 @@
|
||||
let lore = this.effect.name.split(" ")[2].toLowerCase();
|
||||
if (args.item.type == "spell" && args.item.system.lore.value == lore)
|
||||
if (args.item.type == "spell" && game.wfrp4e.config.magicLores[args.item.system.lore.value].toLowerCase() == lore)
|
||||
{
|
||||
args.item.system.cn.value -= 1
|
||||
}
|
||||
|
@ -1,14 +1,14 @@
|
||||
// This script needs to be separate because equipTransfer is off on the other effect, and thus won't execute when added to an actor
|
||||
|
||||
let mainEffect = this.item.effects.contents[0];
|
||||
if (mainEffect.name.includes("<Savoir>"))
|
||||
if (mainEffect.name.includes("<Lore>"))
|
||||
{
|
||||
let choice = await ItemDialog.create(ItemDialog.objectToArray(game.wfrp4e.config.magicLores, this.item.img), 1, "Choisissez le Savoir");
|
||||
if (choice.length)
|
||||
{
|
||||
mainEffect.update({name : mainEffect.name.replace("<Savoir>", choice[0].name)})
|
||||
mainEffect.update({name : mainEffect.name.replace("<Lore>", choice[0].name)})
|
||||
this.item.update({name : this.item.name += ` (${choice[0].name})`})
|
||||
}
|
||||
}
|
||||
|
||||
this.effect.delete();
|
||||
this.effect.delete();
|
||||
|
Loading…
Reference in New Issue
Block a user