|
|
|
@ -1,5 +1,5 @@
|
|
|
|
|
import { SWDELUXStatBlockParser } from "./sw-statblock-parser.js";
|
|
|
|
|
|
|
|
|
|
import { ClassCounter} from "https://www.uberwald.me/fvtt_appcount/count-class-ready.js"
|
|
|
|
|
const __compFolderTranslation = [
|
|
|
|
|
{
|
|
|
|
|
compendium: 'swade-core-rules.swade-vehicles',
|
|
|
|
@ -90,8 +90,8 @@ Hooks.once('init', () => {
|
|
|
|
|
return transl
|
|
|
|
|
},
|
|
|
|
|
"skill_swid": (swid) => {
|
|
|
|
|
if (swid == "fighting") return "combat";
|
|
|
|
|
if (swid == "shooting") return "tir";
|
|
|
|
|
if (swid == "combat") return "fighting";
|
|
|
|
|
if (swid == "tir") return "shooting";
|
|
|
|
|
return swid
|
|
|
|
|
},
|
|
|
|
|
"category_converter": (category) => {
|
|
|
|
@ -341,30 +341,6 @@ const subFolder = {
|
|
|
|
|
'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() {
|
|
|
|
|
|
|
|
|
@ -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', () => {
|
|
|
|
|
console.log(">>>>>>>>>>")
|
|
|
|
@ -409,10 +417,11 @@ Hooks.once('ready', () => {
|
|
|
|
|
})
|
|
|
|
|
|
|
|
|
|
SwadeFRContentCommands.init()
|
|
|
|
|
migrateSwid()
|
|
|
|
|
checkSwidSettings()
|
|
|
|
|
|
|
|
|
|
//FolderTranslate.translateFolders()
|
|
|
|
|
registerUsageCount("swade-fr-content")
|
|
|
|
|
|
|
|
|
|
ClassCounter.registerUsageCount("swade-fr-content")
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
/************************************************************************************/
|
|
|
|
|