Ajout de la commande /voyage et grosse MAJK de la commande /auberge
This commit is contained in:
@@ -10,13 +10,13 @@ let characteristics = {
|
||||
"wp" : 10,
|
||||
"fel" : 10
|
||||
}
|
||||
let skills = ["Charm", "Focalisation", "Entertain (Prophecy)", "Intuition"]
|
||||
let skills = ["Charme", "Focalisation", "Entertain (Prophecy)", "Intuition"]
|
||||
let skillAdvancements = [0, 0, 20, 10]
|
||||
let talents = ["Detect Artefact", "Menaçant", "Sixième Sens"]
|
||||
let traits = ["Dooming", "Spellcaster (Lore of Life)", "Ward"]
|
||||
let talents = ["Détection d’artefact", "Menaçant", "Sixième Sens"]
|
||||
let traits = ["Condamné", "Spellcaster (Lore of Life)", "Protection"]
|
||||
let trappings = []
|
||||
let items = [];
|
||||
let spells = ["Forest of Thorns"];
|
||||
let spells = ["Forêt d'épines"];
|
||||
|
||||
let updateObj = this.actor.toObject();
|
||||
|
||||
@@ -27,14 +27,14 @@ for (let ch in characteristics)
|
||||
|
||||
for (let index = 0; index < skills.length; index++)
|
||||
{
|
||||
let skill = skills[index]
|
||||
let Compétence = skills[index]
|
||||
let skillItem;
|
||||
skillItem = updateObj.items.find(i => i.name == skill && i.type == "skill")
|
||||
skillItem = updateObj.items.find(i => i.name == Compétence && i.type == "Compétence")
|
||||
if (skillItem)
|
||||
skillItem.system.advances.value += skillAdvancements[index]
|
||||
else
|
||||
{
|
||||
skillItem = await game.wfrp4e.utility.findSkill(skill)
|
||||
skillItem = await game.wfrp4e.utility.findSkill(Compétence)
|
||||
skillItem = skillItem.toObject();
|
||||
skillItem.system.advances.value = skillAdvancements[index];
|
||||
items.push(skillItem);
|
||||
@@ -50,7 +50,7 @@ for (let talent of talents)
|
||||
}
|
||||
else
|
||||
{
|
||||
ui.notifications.warn(`Impossible de trouver ${talent}`, {permanent : true})
|
||||
ui.notifications.warn(`Could not find ${talent}`, {permanent : true})
|
||||
}
|
||||
}
|
||||
|
||||
@@ -59,32 +59,16 @@ for (let trait of traits)
|
||||
{
|
||||
let traitMatches = trait.matchAll(traitRegex).next().value
|
||||
let traitName = traitMatches[1]
|
||||
let traitVal = traitMatches[2] || traitMatches[4] // could be match 2 or 4 depending on if there's a specialization
|
||||
let traitSpec = traitMatches[3]
|
||||
|
||||
let traitItem;
|
||||
try {
|
||||
traitItem = await WFRP_Utility.findItem(traitName, "trait")
|
||||
let traitVal = traitMatches[2] || traitMatches[4] // could be match 2 or 4 depending on if there'}`).trim()
|
||||
}
|
||||
catch { }
|
||||
if (!traitItem) {
|
||||
ui.notifications.warn(`Impossible de trouver ${trait}`, {permanent : true})
|
||||
}
|
||||
traitItem = traitItem.toObject()
|
||||
|
||||
if (Number.isNumeric(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
|
||||
else
|
||||
traitItem.system.specification.value = traitSpec
|
||||
|
||||
items.push(traitItem)
|
||||
|
||||
}
|
||||
|
||||
for (let trapping of trappings)
|
||||
for (let trapping of trappings)
|
||||
{
|
||||
let trappingItem = await game.wfrp4e.utility.findItem(trapping)
|
||||
if (trappingItem)
|
||||
@@ -95,13 +79,13 @@ for (let trapping of trappings)
|
||||
|
||||
items.push(trappingItem);
|
||||
}
|
||||
else
|
||||
else
|
||||
{
|
||||
ui.notifications.warn(`Impossible de trouver ${trapping}`, {permanent : true})
|
||||
ui.notifications.warn(`Could not find ${trapping}`, {permanent : true})
|
||||
}
|
||||
}
|
||||
|
||||
for (let spell of spells)
|
||||
for (let spell of spells)
|
||||
{
|
||||
let spellItem = await game.wfrp4e.utility.findItem(spell)
|
||||
if (spellItem)
|
||||
@@ -110,13 +94,55 @@ for (let spell of spells)
|
||||
|
||||
items.push(spellItem);
|
||||
}
|
||||
else
|
||||
else
|
||||
{
|
||||
ui.notifications.warn(`Impossible de trouver ${spell}`, {permanent : true})
|
||||
ui.notifications.warn(`Could not find ${spell}`, {permanent : true})
|
||||
}
|
||||
}
|
||||
|
||||
updateObj.name = updateObj.name += " " + this.effect.name
|
||||
updateObj.name = updateObj.name +='Arme','Cornes','Tail','Tentacules','Morsure') ? traitVal - parseInt(characteristicValues[3]/10) : traitVal;
|
||||
traitItem.name = (traitItem.name + ` ${traitSpec ? "("+ traitSpec + ")" : ""}`).trim()
|
||||
}
|
||||
else
|
||||
traitItem.system.specification.value = traitSpec
|
||||
|
||||
items.push(traitItem)
|
||||
|
||||
}
|
||||
|
||||
for (let trapping of trappings)
|
||||
{
|
||||
let trappingItem = await game.wfrp4e.utility.findItem(trapping)
|
||||
if (trappingItem)
|
||||
{
|
||||
trappingItem = trappingItem.toObject()
|
||||
|
||||
trappingItem.system.equipped.value = true;
|
||||
|
||||
items.push(trappingItem);
|
||||
}
|
||||
else
|
||||
{
|
||||
ui.notifications.warn(`Could not find ${trapping}`, {permanent : true})
|
||||
}
|
||||
}
|
||||
|
||||
for (let spell of spells)
|
||||
{
|
||||
let spellItem = await game.wfrp4e.utility.findItem(spell)
|
||||
if (spellItem)
|
||||
{
|
||||
spellItem = spellItem.toObject()
|
||||
|
||||
items.push(spellItem);
|
||||
}
|
||||
else
|
||||
{
|
||||
ui.notifications.warn(`Could not find ${spell}`, {permanent : true})
|
||||
}
|
||||
}
|
||||
|
||||
updateObj.name = updateObj.name += " " + this.effet.name
|
||||
|
||||
await this.actor.update(updateObj)
|
||||
this.actor.createEmbeddedDocuments("Item", items);
|
||||
Reference in New Issue
Block a user