forked from public/foundryvtt-wh4-lang-fr-fr
Ajout de la commande /voyage et grosse MAJK de la commande /auberge
This commit is contained in:
@@ -10,10 +10,10 @@ let characteristics = {
|
||||
"wp" : 0,
|
||||
"fel" : 10
|
||||
}
|
||||
let skills = ["Melee (Basic)", "Track"]
|
||||
let skills = ["Corps à corps (Base)", "Pistage"]
|
||||
let skillAdvancements = [8, 7]
|
||||
let talents = ["Berserk Charge", "Careful Strike", "Strike to Injure"]
|
||||
let traits = ["Flight (8)", "Fury", "Swarm", "Tracker"]
|
||||
let talents = ["Charge Berserk", "Frappe précise", "Frappe blessante"]
|
||||
let traits = ["Flight (8)", "Rage", "Nuée", "Pisteur"]
|
||||
let trappings = []
|
||||
let items = [];
|
||||
let spells = [];
|
||||
@@ -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