2 Commits

Author SHA1 Message Date
b55754941e Enhance stats 2024-02-08 12:58:44 +01:00
00bc950479 Fix SWID again 2023-10-25 21:27:00 +02:00
3 changed files with 49 additions and 32 deletions

10
fr.json
View File

@ -88,5 +88,13 @@
"Personal Defense" : "Autodéfense", "Personal Defense" : "Autodéfense",
"Surveillance": "Surveillance", "Surveillance": "Surveillance",
"Transportation": "Transport", "Transportation": "Transport",
"Weapon": "Arme" "Weapon": "Arme",
"vigor": "Vigueur",
"smarts": "Intelligence",
"agility": "Agilité",
"spirit": "Âme",
"strength": "Force",
"Health": "Santé",
"SWADE.Wounds": "Blessures"
} }

View File

@ -57,7 +57,7 @@
} }
], ],
"url": "https://www.uberwald.me/gitea/public/swade-fr-content", "url": "https://www.uberwald.me/gitea/public/swade-fr-content",
"version": "3.2.0", "version": "3.2.2",
"esmodules": [ "esmodules": [
"modules/swade-fr-init.js" "modules/swade-fr-init.js"
], ],
@ -73,7 +73,7 @@
} }
], ],
"manifest": "https://www.uberwald.me/gitea/public/swade-fr-content/raw/branch/master/module.json", "manifest": "https://www.uberwald.me/gitea/public/swade-fr-content/raw/branch/master/module.json",
"download": "https://www.uberwald.me/gitea/public/swade-fr-content/archive/swade-fr-content-3.2.0.zip", "download": "https://www.uberwald.me/gitea/public/swade-fr-content/archive/swade-fr-content-3.2.2.zip",
"id": "swade-fr-content", "id": "swade-fr-content",
"relationships": { "relationships": {
"requires": [ "requires": [

View File

@ -1,5 +1,5 @@
import { SWDELUXStatBlockParser } from "./sw-statblock-parser.js"; import { SWDELUXStatBlockParser } from "./sw-statblock-parser.js";
import { ClassCounter} from "https://www.uberwald.me/fvtt_appcount/count-class-ready.js"
const __compFolderTranslation = [ const __compFolderTranslation = [
{ {
compendium: 'swade-core-rules.swade-vehicles', compendium: 'swade-core-rules.swade-vehicles',
@ -90,8 +90,8 @@ Hooks.once('init', () => {
return transl return transl
}, },
"skill_swid": (swid) => { "skill_swid": (swid) => {
if (swid == "fighting") return "combat"; if (swid == "combat") return "fighting";
if (swid == "shooting") return "tir"; if (swid == "tir") return "shooting";
return swid return swid
}, },
"category_converter": (category) => { "category_converter": (category) => {
@ -341,30 +341,6 @@ const subFolder = {
'Vehicular Weapons': 'Armes de véhicules' 'Vehicular Weapons': 'Armes de véhicules'
} }
/************************************************************************************/
// Register world usage statistics
function registerUsageCount(registerKey) {
if (game.user.isGM) {
game.settings.register(registerKey, "world-key", {
name: "Unique world key",
scope: "world",
config: false,
default: "",
type: String
});
let worldKey = game.settings.get(registerKey, "world-key")
if (worldKey == undefined || worldKey == "") {
worldKey = randomID(32)
game.settings.set(registerKey, "world-key", worldKey)
}
// Simple API counter
let regURL = `https://www.uberwald.me/fvtt_appcount/count.php?name="${registerKey}"&worldKey="${worldKey}"&version="${game.release.generation}.${game.release.build}"&system="${game.system.id}"&systemversion="${game.system.version}"`
$.ajax(regURL)
/* -------------------------------------------- */
}
}
/************************************************************************************/ /************************************************************************************/
async function loadSecretCompendiums() { async function loadSecretCompendiums() {
@ -394,6 +370,38 @@ async function loadSecretCompendiums() {
} }
} }
/************************************************************************************/
function processItemSwid(actor, item) {
let swid = item.system.swid
let newSwid = swid
if (swid == "combat") newSwid = "fighting";
if (swid == "tir") newSwid = "shooting";
if (swid != newSwid) {
console.log("Item to update", item.name, swid, newSwid)
actor.updateEmbeddedDocuments('Item', [{ _id: item.id, "system.swid": newSwid }])
}
}
/************************************************************************************/
function migrateSwid() {
for (let actor of game.actors) {
for (let item of actor.items) {
if (item.system?.swid) {
processItemSwid(actor, item)
}
}
}
}
/************************************************************************************/
function checkSwidSettings() {
let swidFighting = game.settings.get('swade', 'parryBaseSwid')
if (swidFighting != "fighting") {
ui.notifications.warn("Votre compétence de parade n'est pas positionnée à 'fighting' dans les paramètres de SWADE. Nous vous recommandons de le faire pour éviter des problèmes de calcul de la parade.")
//game.settings.set('swade', 'parryBaseSwid', "fighting")
}
}
/************************************************************************************/ /************************************************************************************/
Hooks.once('ready', () => { Hooks.once('ready', () => {
console.log(">>>>>>>>>>") console.log(">>>>>>>>>>")
@ -409,10 +417,11 @@ Hooks.once('ready', () => {
}) })
SwadeFRContentCommands.init() SwadeFRContentCommands.init()
migrateSwid()
checkSwidSettings()
//FolderTranslate.translateFolders() //FolderTranslate.translateFolders()
registerUsageCount("swade-fr-content") ClassCounter.registerUsageCount("swade-fr-content")
}); });
/************************************************************************************/ /************************************************************************************/