Update scripts

This commit is contained in:
2024-10-08 20:52:09 +02:00
parent 1f1d871e53
commit fc4fa1deb5
178 changed files with 12247 additions and 10701 deletions

View File

@ -10,13 +10,13 @@ let characteristics = {
"wp" : 10,
"fel" : 15
}
let skills = ["Focalisation", "Charme", "Représentation (Danser)"]
let skills = ["Focalisation", "Charm", "Perform (Dancing)"]
let skillAdvancements = [0, 6, 3]
let talents = ["Attirant", "Distraire", "Imitation"]
let traits = ["Perturbant", "Vol (6)", "Lanceur de Sorts (Magie Mineure)"]
let talents = ["Attractive", "Distract", "Mimic"]
let traits = ["Distracting", "Flight (6)", "Spellcaster (Petty)"]
let trappings = []
let items = [];
let spells = ["Feux follets", "Sommeil"];
let spells = ["Marsh Lights", "Sleep"];
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})
}
}
@ -119,15 +119,4 @@ for (let spell of spells)
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);