core-tables

This commit is contained in:
2025-05-09 09:59:36 +02:00
parent a675a1d164
commit 4b51f8970f
10 changed files with 1242 additions and 10748 deletions
+7 -7
View File
@@ -74,7 +74,7 @@ let regName = XRegExp(name_val, 'gi');
// Used to detect/manage the skill groupings in the statblock
const __SkillGroupsUS = ["Melee", "Lore", "Trade"]
const __SkillGroupsFR = ["Corps à corps", "Domaine", "Métier"]
const __SkillGroupsFR = ["Nahkampf", "Lehre", "Beruf"]
// Used to auto update the system.tests.value field
const __hasTestValue = {
"etiquette": true,
@@ -117,7 +117,7 @@ async function __findItem(itemName, itemType, location = null) {
// If all else fails, search each pack
for (let p of game.wfrp4e.tags.getPacksWithTag(itemType)) {
await p.getIndex().then(index => itemList = index);
console.log("Seatch", itemType, toSearch, itemList);
console.log("Search", itemType, toSearch, itemList);
let searchResult = itemList.find(t => (t.translated && t.type == itemType && (t.flags?.babele?.originalName.toLowerCase() == toSearch || t.flags?.babele?.originalName.toLowerCase().split("(")[0].trim() == toSearch)) || (t.type == itemType && (t.name.toLowerCase() == toSearch || t.name.toLowerCase().split("(")[0].trim() == toSearch)));
if (searchResult) {
let item = await p.getDocument(searchResult._id)
@@ -359,7 +359,7 @@ export default async function statParserFR(statString, type = "npc") {
if (itemFound && value && value.length > 0) {
let number = value.match(/\d+/g);
if (number && (name.toLowerCase() == 'ranged' || name.toLowerCase() == 'weapon' || name.toLowerCase() == "bite" || name.toLowerCase() == "tail" ||
name.toLowerCase() == 'arme' || name.toLowerCase() == "morsure" || name.toLowerCase() == "queue")) {
name.toLowerCase() == 'arme' || name.toLowerCase() == "morsure" || name.toLowerCase() == "queue" || name.toLowerCase() == 'waffe' || name.toLowerCase() == "biss" || name.toLowerCase() == "schwanz")) {
//console.log(itemFound)
number = number[0] // Take first number ....
itemFound.system.specification.value = Number(number) - ((name.toLowerCase() == 'ranged') ? 0 : Math.floor(Number(model.characteristics.s.initial) / 10))
@@ -369,7 +369,7 @@ export default async function statParserFR(statString, type = "npc") {
//itemFound.name += "(" + value + ")"
}
if (!itemFound)
ui.notifications.error("Trait non trouvé, à ajouter manuellement : " + name, { permanent: true })
ui.notifications.error("Trait nicht gefunden, muss manuell hinzugefügt werden : " + name, { permanent: true })
} else if (def.name == 'skill') {
try {
@@ -391,7 +391,7 @@ export default async function statParserFR(statString, type = "npc") {
}
}
if (!itemFound) {
ui.notifications.error("Compétence non trouvée, à ajouter manuellement : " + name, { permanent: true })
ui.notifications.error("Fähigkeit nicht gefunden, muss manuell hinzugefügt werden : " + name, { permanent: true })
}
} else if (def.name == 'talent') {
try {
@@ -401,7 +401,7 @@ export default async function statParserFR(statString, type = "npc") {
if (itemFound && subres && value)
itemFound.system.advances.value = Number(value);
if (!itemFound) {
ui.notifications.error("Talent non trouvé, à ajouter manuellement : " + name, { permanent: true })
ui.notifications.error("Talent nicht gefunden, muss manuell hinzugefügt werden : " + name, { permanent: true })
}
} else if (def.name == 'trapping') {
@@ -501,6 +501,6 @@ export default async function statParserFR(statString, type = "npc") {
}
// If the carac string has not been found
ui.notifications.error("Impossible de convertir ces statitiques, les caractéristiques n'ont pas été trouvées", { permanent: true })
ui.notifications.error("Diese Werte konnten nicht umgewandelt werden, die Merkmale wurden nicht gefunden", { permanent: true })
}