Update scripts
This commit is contained in:
@@ -1,7 +1,7 @@
|
||||
let choice1 = [
|
||||
{
|
||||
type : "skill",
|
||||
name : "Corps à corps (Base)",
|
||||
name : "Melee (Basic)",
|
||||
diff : {
|
||||
system : {
|
||||
advances : {
|
||||
@@ -14,7 +14,7 @@ let choice1 = [
|
||||
let choice2 = [
|
||||
{
|
||||
type : "skill",
|
||||
name : "Corps à corps (Armes d'hast)",
|
||||
name : "Melee (Polearm)",
|
||||
diff : {
|
||||
system : {
|
||||
advances : {
|
||||
@@ -26,14 +26,14 @@ let choice2 = [
|
||||
]
|
||||
|
||||
let choice = await Dialog.wait({
|
||||
title : "Choix",
|
||||
title : "Choice",
|
||||
content :
|
||||
`<p>
|
||||
Choisissez une option
|
||||
Select your choice
|
||||
</p>
|
||||
<ol>
|
||||
<li>Corps à corps (Base)</li>
|
||||
<li>Corps à corps (Armes d'hast)</li>
|
||||
<li>Melee (Basic)</li>
|
||||
<li>Melee (Polearm)</li>
|
||||
</ol>
|
||||
`,
|
||||
buttons : {
|
||||
@@ -44,7 +44,7 @@ let choice = await Dialog.wait({
|
||||
}
|
||||
},
|
||||
2 : {
|
||||
label : "Armes d'hast",
|
||||
label : "Polearm",
|
||||
callback : () => {
|
||||
return choice2;
|
||||
}
|
||||
@@ -71,9 +71,13 @@ for (let c of choice)
|
||||
let item = await game.wfrp4e.utility.find(c.name, c.type)
|
||||
if (item)
|
||||
{
|
||||
let equip = item.system.tags.has("equippable");
|
||||
item = item.toObject()
|
||||
equip(item);
|
||||
items.push(foundry.utils.mergeObject(item, (c.diff || {})))
|
||||
if (equip)
|
||||
{
|
||||
item.system.equipped.value = true;
|
||||
}
|
||||
items.push(foundry.utils.mergeObject(item, (c.diff || {})))
|
||||
}
|
||||
else
|
||||
ui.notifications.warn(`Impossible de trouver ${talent}`, {permanent : true})
|
||||
@@ -82,13 +86,3 @@ for (let c of choice)
|
||||
}
|
||||
await this.actor.update(updateObj)
|
||||
this.actor.createEmbeddedDocuments("Item", items);
|
||||
|
||||
function equip(item)
|
||||
{
|
||||
if (item.type == "armour")
|
||||
item.system.worn.value = true
|
||||
else if (item.type == "weapon")
|
||||
item.system.equipped = true
|
||||
else if (item.type == "trapping" && item.system.trappingType.value == "clothingAccessories")
|
||||
item.system.worn = true
|
||||
}
|
||||
Reference in New Issue
Block a user