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 : {
|
||||
@ -28,7 +28,7 @@ let choice2 = [
|
||||
let choice3 = [
|
||||
{
|
||||
type : "skill",
|
||||
name : "Corps à corps (A deux mains)",
|
||||
name : "Melee (Two-Handed)",
|
||||
diff : {
|
||||
system : {
|
||||
advances : {
|
||||
@ -43,29 +43,29 @@ let choice = await Dialog.wait({
|
||||
title : "Choice",
|
||||
content :
|
||||
`<p>
|
||||
Faites un choix
|
||||
Select your choice
|
||||
</p>
|
||||
<ol>
|
||||
<li>Corps à corps (Base)</li>
|
||||
<li>Corps à corps (Armes d'hast)</li>
|
||||
<li>Corps à corps (A deux mains)</li>
|
||||
<li>Melee (Basic)</li>
|
||||
<li>Melee (Polearm)</li>
|
||||
<li>Melee (Two-Handed)</li>
|
||||
</ol>
|
||||
`,
|
||||
buttons : {
|
||||
1 : {
|
||||
label : "Base",
|
||||
label : "Basic",
|
||||
callback : () => {
|
||||
return choice1
|
||||
}
|
||||
},
|
||||
2 : {
|
||||
label : "Armes d'hast",
|
||||
label : "Polearm",
|
||||
callback : () => {
|
||||
return choice2
|
||||
}
|
||||
},
|
||||
3 : {
|
||||
label : "A deux mains",
|
||||
label : "Two-Handed",
|
||||
callback : () => {
|
||||
return choice3
|
||||
}
|
||||
@ -92,9 +92,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})
|
||||
@ -102,14 +106,4 @@ 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
|
||||
}
|
||||
this.actor.createEmbeddedDocuments("Item", items);
|
Reference in New Issue
Block a user