This commit is contained in:
2025-05-02 12:24:44 +02:00
commit 39e925cc1b
3238 changed files with 110472 additions and 0 deletions
+38
View File
@@ -0,0 +1,38 @@
let choice = await Dialog.wait({
title : "Choice",
content :
`<p>
Select your choice
</p>
`,
buttons : {
1 : {
label : "Shield",
callback : () => {
return "shield"
}
},
2 : {
label : "Two-Handed Weapon",
callback : () => {
return "twohanded"
}
},
}
})
let weapons = await warhammer.utility.findAllItems("weapon", "Loading Weapons");
let items
if (choice == "shield")
{
items = await game.wfrp4e.apps.ItemDialog.create(weapons.filter(i => i.system.properties.qualities.shield), 1, "Choisissez a Shield");
}
else if (choice == "twohanded")
{
items = await game.wfrp4e.apps.ItemDialog.create(weapons.filter(i => i.system.weaponGroup.value == "twohanded"), 1, "Choisissez a Two-Handed Weapon");
}
items = items.map(i => i.toObject())
items.forEach(i => i.system.equipped.value)
this.actor.createEmbeddedDocuments("Item", items);