Ajout de la commande /voyage et grosse MAJK de la commande /auberge

This commit is contained in:
2026-01-07 15:04:49 +01:00
parent c8119601d8
commit f525b6c07a
1329 changed files with 24138 additions and 4397 deletions

View File

@@ -1,31 +1,31 @@
if (!this.item.name.includes("(") || this.item.system.tests.value.includes("Terrain"))
if (!this.item.name.includes("(") || this.item.system.Tests.value.includes("Terrain") || this.item.system.Tests.value.toLowerCase().includes("(any)"))
{
let tests = this.item.system.tests.value
let Tests = this.item.system.Tests.value
let name = this.item.name
// If name already specifies, make sure tests value reflects that
if (name.includes("("))
// If name already specifies, make sure Tests value reflects that
if (name.includes("(") && !name.toLowerCase().includes("(any)"))
{
let terrain = name.split("(")[1].split(")")[0]
tests = tests.replace("Terrain", terrain)
tests = tests.replace("the Terrain", terrain)
}
else // If no sense specified, provide dialog choice
{
let choice = await ItemDialog.create(ItemDialog.objectToArray({
coastal : "Côtes",
coastal : "Littoral",
deserts : "Déserts",
marshes : "Marches",
rocky : "Rocailles",
tundra : "Tundra",
woodlands : "Forêts"
}, this.item.img), 1, "Choisir le Terrain");
marshes : "Marécages",
rocky : "Rocailleux",
tundra : "Toundra",
woodlands : "Régions boisées"
}, this.item.img), 1, "Choisissez un Terrain");
if (choice[0])
{
name = `${name.split("(")[0].trim()} (${choice[0].name})`
tests = tests.replace("Terrain", "Terrain " + choice[0].name )
tests = tests.replace("Terrain", choice[0].name + " Terrain")
}
}
this.effect.updateSource({name})
this.effet.updateSource({name})
this.item.updateSource({name, "system.tests.value" : tests})
}