Update scripts
This commit is contained in:
@@ -10,13 +10,13 @@ let characteristics = {
|
||||
"wp" : 10,
|
||||
"fel" : 10
|
||||
}
|
||||
let skills = ["Charme", "Focalisation", "Divertissement (Prophecie)", "Intuition"]
|
||||
let skills = ["Charm", "Focalisation", "Entertain (Prophecy)", "Intuition"]
|
||||
let skillAdvancements = [0, 0, 20, 10]
|
||||
let talents = ["Détection d’artefact", "Menaçant", "Sixième Sens"]
|
||||
let traits = ["Destinée", "Lanceur de sorts (Domaine de la Vie)", "Protection"]
|
||||
let talents = ["Detect Artefact", "Menaçant", "Sixième Sens"]
|
||||
let traits = ["Dooming", "Spellcaster (Lore of Life)", "Ward"]
|
||||
let trappings = []
|
||||
let items = [];
|
||||
let spells = ["Forêt d'épines"];
|
||||
let spells = ["Forest of Thorns"];
|
||||
|
||||
let updateObj = this.actor.toObject();
|
||||
|
||||
@@ -74,7 +74,7 @@ for (let trait of traits)
|
||||
|
||||
if (Number.isNumeric(traitVal))
|
||||
{
|
||||
traitItem.system.specification.value = traitName.includes('Arme','Cornes','Queue','Tentacules','Morsure') ? traitVal - parseInt(characteristicValues[3]/10) : traitVal;
|
||||
traitItem.system.specification.value = traitName.includes('Weapon','Horns','Tail','Tentacles','Bite') ? traitVal - parseInt(characteristicValues[3]/10) : traitVal;
|
||||
traitItem.name = (traitItem.name + ` ${traitSpec ? "("+ traitSpec + ")" : ""}`).trim()
|
||||
}
|
||||
else
|
||||
@@ -91,13 +91,13 @@ for (let trapping of trappings)
|
||||
{
|
||||
trappingItem = trappingItem.toObject()
|
||||
|
||||
equip(trappingItem)
|
||||
trappingItem.system.equipped.value = true;
|
||||
|
||||
items.push(trappingItem);
|
||||
}
|
||||
else
|
||||
{
|
||||
ui.notifications.warn(`Could not find ${trapping}`, {permanent : true})
|
||||
ui.notifications.warn(`Impossible de trouver ${trapping}`, {permanent : true})
|
||||
}
|
||||
}
|
||||
|
||||
@@ -112,22 +112,11 @@ for (let spell of spells)
|
||||
}
|
||||
else
|
||||
{
|
||||
ui.notifications.warn(`Could not find ${spell}`, {permanent : true})
|
||||
ui.notifications.warn(`Impossible de trouver ${spell}`, {permanent : true})
|
||||
}
|
||||
}
|
||||
|
||||
updateObj.name = updateObj.name += " " + this.effect.name
|
||||
|
||||
await this.actor.update(updateObj)
|
||||
this.actor.createEmbeddedDocuments("Item", items);
|
||||
|
||||
|
||||
function equip(item)
|
||||
{
|
||||
if (item.type == "armour")
|
||||
item.worn = true
|
||||
else if (item.type == "weapon")
|
||||
item.equipped = true
|
||||
else if (item.type == "trapping" && item.trappingType?.value == "clothingAccessories")
|
||||
item.worn = true
|
||||
}
|
||||
this.actor.createEmbeddedDocuments("Item", items);
|
||||
Reference in New Issue
Block a user