Ajout de la commande /voyage et grosse MAJK de la commande /auberge
This commit is contained in:
@@ -1,58 +1,50 @@
|
||||
let choice1 = [
|
||||
{
|
||||
type : "skill",
|
||||
name : "Projectiles (Arc)",
|
||||
diff : {
|
||||
system : {
|
||||
advances : {
|
||||
value : 10
|
||||
let addOption = await foundry.applications.api.DialogV2.confirm({
|
||||
window : {title : "Option"},
|
||||
content :
|
||||
`
|
||||
Ajouter une option?
|
||||
<p>
|
||||
Projectiles (Arc) +10 et un Arc long avec 12 flèches
|
||||
</p>
|
||||
`,
|
||||
})
|
||||
|
||||
let choice = []
|
||||
|
||||
if (addOption)
|
||||
{
|
||||
choice = [
|
||||
{
|
||||
type : "skill",
|
||||
name : "Projectiles (Arc)",
|
||||
diff : {
|
||||
system : {
|
||||
advances : {
|
||||
value : 10
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
{
|
||||
type : "weapon",
|
||||
name : "Longbow",
|
||||
},
|
||||
{
|
||||
type : "ammunition",
|
||||
name : "Arrow",
|
||||
}
|
||||
]
|
||||
let choice2 = [
|
||||
]
|
||||
|
||||
let choice = await Dialog.wait({
|
||||
title : "Option",
|
||||
content :
|
||||
`<p>
|
||||
Ajouter une option?
|
||||
</p>
|
||||
<ol>
|
||||
<li>Projectiles (Arc) +10 et un Arc Long avec 12 flèches</li>
|
||||
</ol>
|
||||
`,
|
||||
buttons : {
|
||||
1 : {
|
||||
label : "Yes",
|
||||
callback : () => {
|
||||
return choice1;
|
||||
}
|
||||
},
|
||||
2 : {
|
||||
label : "No",
|
||||
callback : () => {
|
||||
return choice2;
|
||||
}
|
||||
{
|
||||
type : "weapon",
|
||||
name : "(2M) Arc long",
|
||||
},
|
||||
{
|
||||
type : "ammunition",
|
||||
name : "Flèche (12)",
|
||||
}
|
||||
}
|
||||
})
|
||||
];
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
let updateObj = this.actor.toObject();
|
||||
let items = []
|
||||
for (let c of choice)
|
||||
{
|
||||
let existing
|
||||
let existing
|
||||
if (c.type == "skill")
|
||||
{
|
||||
existing = updateObj.items.find(i => i.name == c.name && i.type == c.type)
|
||||
|
||||
Reference in New Issue
Block a user