From 434a18b284f36e65c71606bb6edc1a0b4060d0c9 Mon Sep 17 00:00:00 2001 From: LeRatierBretonnien Date: Tue, 19 Nov 2024 23:54:30 +0100 Subject: [PATCH] Move to new compendiums --- modules/vadentis-actor-sheet.js | 2 +- modules/vadentis-actor.js | 48 +++--- modules/vadentis-combat.js | 2 +- modules/vadentis-item-sheet.js | 2 +- modules/vadentis-utility.js | 163 +++++++++--------- packs/armes/{000119.log => 000123.log} | 0 packs/armes/CURRENT | 2 +- packs/armes/LOG | 14 +- packs/armes/LOG.old | 14 +- .../{MANIFEST-000117 => MANIFEST-000121} | Bin 170 -> 170 bytes packs/armures/{000118.log => 000122.log} | 0 packs/armures/CURRENT | 2 +- packs/armures/LOG | 14 +- packs/armures/LOG.old | 14 +- .../{MANIFEST-000116 => MANIFEST-000120} | Bin 172 -> 172 bytes packs/attributs/{000119.log => 000123.log} | 0 packs/attributs/CURRENT | 2 +- packs/attributs/LOG | 14 +- packs/attributs/LOG.old | 14 +- .../{MANIFEST-000117 => MANIFEST-000121} | Bin 173 -> 173 bytes packs/bestiaire/{000032.log => 000036.log} | 0 packs/bestiaire/CURRENT | 2 +- packs/bestiaire/LOG | 14 +- packs/bestiaire/LOG.old | 14 +- .../{MANIFEST-000030 => MANIFEST-000034} | Bin 176 -> 176 bytes packs/carte/{000117.log => 000121.log} | 0 packs/carte/CURRENT | 2 +- packs/carte/LOG | 14 +- packs/carte/LOG.old | 14 +- .../{MANIFEST-000115 => MANIFEST-000119} | Bin 223 -> 223 bytes packs/competences/{000102.log => 000106.log} | 0 packs/competences/CURRENT | 2 +- packs/competences/LOG | 14 +- packs/competences/LOG.old | 14 +- .../{MANIFEST-000100 => MANIFEST-000104} | Bin 168 -> 168 bytes packs/croyances/{000032.log => 000036.log} | 0 packs/croyances/CURRENT | 2 +- packs/croyances/LOG | 14 +- packs/croyances/LOG.old | 14 +- .../{MANIFEST-000030 => MANIFEST-000034} | Bin 168 -> 168 bytes packs/donnees/{000084.log => 000088.log} | 0 packs/donnees/CURRENT | 2 +- packs/donnees/LOG | 14 +- packs/donnees/LOG.old | 14 +- .../{MANIFEST-000082 => MANIFEST-000086} | Bin 173 -> 173 bytes .../manuel-de-jeu/{000032.log => 000036.log} | 0 packs/manuel-de-jeu/CURRENT | 2 +- packs/manuel-de-jeu/LOG | 14 +- packs/manuel-de-jeu/LOG.old | 14 +- .../{MANIFEST-000030 => MANIFEST-000034} | Bin 220 -> 220 bytes packs/maps/{000118.log => 000122.log} | 0 packs/maps/CURRENT | 2 +- packs/maps/LOG | 14 +- packs/maps/LOG.old | 14 +- .../maps/{MANIFEST-000116 => MANIFEST-000120} | Bin 221 -> 221 bytes packs/materiel/{000118.log => 000122.log} | 0 packs/materiel/CURRENT | 2 +- packs/materiel/LOG | 14 +- packs/materiel/LOG.old | 14 +- .../{MANIFEST-000116 => MANIFEST-000120} | Bin 168 -> 168 bytes .../pj-archetypes/{000032.log => 000036.log} | 0 packs/pj-archetypes/CURRENT | 2 +- packs/pj-archetypes/LOG | 14 +- packs/pj-archetypes/LOG.old | 14 +- .../{MANIFEST-000030 => MANIFEST-000034} | Bin 220 -> 220 bytes .../{000032.log => 000036.log} | 0 packs/scenarios-cheminement/CURRENT | 2 +- packs/scenarios-cheminement/LOG | 14 +- packs/scenarios-cheminement/LOG.old | 14 +- .../{MANIFEST-000030 => MANIFEST-000034} | Bin 223 -> 223 bytes .../scenarios-maps/{000032.log => 000036.log} | 0 packs/scenarios-maps/CURRENT | 2 +- packs/scenarios-maps/LOG | 14 +- packs/scenarios-maps/LOG.old | 14 +- .../{MANIFEST-000030 => MANIFEST-000034} | Bin 221 -> 221 bytes .../scenarios-pnj/{000032.log => 000036.log} | 0 packs/scenarios-pnj/CURRENT | 2 +- packs/scenarios-pnj/LOG | 14 +- packs/scenarios-pnj/LOG.old | 14 +- .../{MANIFEST-000030 => MANIFEST-000034} | Bin 176 -> 176 bytes packs/sorts/{000126.log => 000130.log} | 0 packs/sorts/CURRENT | 2 +- packs/sorts/LOG | 14 +- packs/sorts/LOG.old | 14 +- .../{MANIFEST-000124 => MANIFEST-000128} | Bin 174 -> 177 bytes packs/techniques/{000117.log => 000121.log} | 0 packs/techniques/CURRENT | 2 +- packs/techniques/LOG | 14 +- packs/techniques/LOG.old | 14 +- .../{MANIFEST-000115 => MANIFEST-000119} | Bin 169 -> 169 bytes 90 files changed, 367 insertions(+), 360 deletions(-) rename packs/armes/{000119.log => 000123.log} (100%) rename packs/armes/{MANIFEST-000117 => MANIFEST-000121} (75%) rename packs/armures/{000118.log => 000122.log} (100%) rename packs/armures/{MANIFEST-000116 => MANIFEST-000120} (74%) rename packs/attributs/{000119.log => 000123.log} (100%) rename packs/attributs/{MANIFEST-000117 => MANIFEST-000121} (73%) rename packs/bestiaire/{000032.log => 000036.log} (100%) rename packs/bestiaire/{MANIFEST-000030 => MANIFEST-000034} (72%) rename packs/carte/{000117.log => 000121.log} (100%) rename packs/carte/{MANIFEST-000115 => MANIFEST-000119} (57%) rename packs/competences/{000102.log => 000106.log} (100%) rename packs/competences/{MANIFEST-000100 => MANIFEST-000104} (76%) rename packs/croyances/{000032.log => 000036.log} (100%) rename packs/croyances/{MANIFEST-000030 => MANIFEST-000034} (76%) rename packs/donnees/{000084.log => 000088.log} (100%) rename packs/donnees/{MANIFEST-000082 => MANIFEST-000086} (73%) rename packs/manuel-de-jeu/{000032.log => 000036.log} (100%) rename packs/manuel-de-jeu/{MANIFEST-000030 => MANIFEST-000034} (58%) rename packs/maps/{000118.log => 000122.log} (100%) rename packs/maps/{MANIFEST-000116 => MANIFEST-000120} (57%) rename packs/materiel/{000118.log => 000122.log} (100%) rename packs/materiel/{MANIFEST-000116 => MANIFEST-000120} (76%) rename packs/pj-archetypes/{000032.log => 000036.log} (100%) rename packs/pj-archetypes/{MANIFEST-000030 => MANIFEST-000034} (58%) rename packs/scenarios-cheminement/{000032.log => 000036.log} (100%) rename packs/scenarios-cheminement/{MANIFEST-000030 => MANIFEST-000034} (57%) rename packs/scenarios-maps/{000032.log => 000036.log} (100%) rename packs/scenarios-maps/{MANIFEST-000030 => MANIFEST-000034} (57%) rename packs/scenarios-pnj/{000032.log => 000036.log} (100%) rename packs/scenarios-pnj/{MANIFEST-000030 => MANIFEST-000034} (72%) rename packs/sorts/{000126.log => 000130.log} (100%) rename packs/sorts/{MANIFEST-000124 => MANIFEST-000128} (72%) rename packs/techniques/{000117.log => 000121.log} (100%) rename packs/techniques/{MANIFEST-000115 => MANIFEST-000119} (75%) diff --git a/modules/vadentis-actor-sheet.js b/modules/vadentis-actor-sheet.js index 65e7650..738a070 100644 --- a/modules/vadentis-actor-sheet.js +++ b/modules/vadentis-actor-sheet.js @@ -10,7 +10,7 @@ export class VadentisActorSheet extends ActorSheet { /** @override */ static get defaultOptions() { - return mergeObject(super.defaultOptions, { + return foundry.utils.mergeObject(super.defaultOptions, { classes: ["vadentis", "sheet", "actor"], template: "systems/foundryvtt-vadentis/templates/actor-sheet.html", width: 680, diff --git a/modules/vadentis-actor.js b/modules/vadentis-actor.js index 6b872cc..283eb8f 100644 --- a/modules/vadentis-actor.js +++ b/modules/vadentis-actor.js @@ -30,7 +30,7 @@ export class VadentisActor extends Actor { if (data instanceof Array) { return super.create(data, options); } - // If the created actor has items (only applicable to duplicated actors) bypass the new actor creation logic + // If the created actor has items (only applicable to foundry.utils.duplicated actors) bypass the new actor creation logic if (data.items) { let actor = super.create(data, options); return actor; @@ -46,48 +46,48 @@ export class VadentisActor extends Actor { /* -------------------------------------------- */ getCompetences() { - return duplicate( this.items.filter( item => item.type == 'competence') || [] ); + return foundry.utils.duplicate( this.items.filter( item => item.type == 'competence') || [] ); } /* -------------------------------------------- */ getDonnees() { - return duplicate( this.items.filter( item => item.type == 'donnee')|| [] ); + return foundry.utils.duplicate( this.items.filter( item => item.type == 'donnee')|| [] ); } /* -------------------------------------------- */ getEglises() { - return duplicate( this.items.filter( item => item.type == 'eglise')|| [] ); + return foundry.utils.duplicate( this.items.filter( item => item.type == 'eglise')|| [] ); } /* -------------------------------------------- */ getSorts() { - return duplicate( this.items.filter( item => item.type == 'sort')|| [] ); + return foundry.utils.duplicate( this.items.filter( item => item.type == 'sort')|| [] ); } /* -------------------------------------------- */ getAttributs() { - return duplicate( this.items.filter( item => item.type == 'attribut')|| [] ); + return foundry.utils.duplicate( this.items.filter( item => item.type == 'attribut')|| [] ); } /* -------------------------------------------- */ getTechniques() { - return duplicate( this.items.filter( item => item.type == 'technique') || [] ); + return foundry.utils.duplicate( this.items.filter( item => item.type == 'technique') || [] ); } /* -------------------------------------------- */ getDevotions() { - return duplicate(this.items.filter( item => item.type == 'devotion')|| [] ); + return foundry.utils.duplicate(this.items.filter( item => item.type == 'devotion')|| [] ); } /* -------------------------------------------- */ getEquipements() { - return duplicate(this.items.filter( item => item.type == 'equipement' ) || [] ); + return foundry.utils.duplicate(this.items.filter( item => item.type == 'equipement' ) || [] ); } /* -------------------------------------------- */ getArmes() { - return duplicate(this.items.filter( item => item.type == 'armecc' || item.type == 'tir' ) || [] ); + return foundry.utils.duplicate(this.items.filter( item => item.type == 'armecc' || item.type == 'tir' ) || [] ); } /* -------------------------------------------- */ getArmures() { - return duplicate(this.items.filter( item => item.type == 'armurebouclier' ) || [] ); + return foundry.utils.duplicate(this.items.filter( item => item.type == 'armurebouclier' ) || [] ); } /* -------------------------------------------- */ getMonnaies() { - return duplicate(this.items.filter( item => item.type == 'monnaie' ) || [] ); + return foundry.utils.duplicate(this.items.filter( item => item.type == 'monnaie' ) || [] ); } /* -------------------------------------------- */ @@ -291,7 +291,7 @@ export class VadentisActor extends Actor { async rollSort( sortId ) { let sort = this.items.get( sortId ); if ( sort ) { - sort = duplicate(sort) + sort = foundry.utils.duplicate(sort) this.processSortDevotion( "sort", sort); } } @@ -300,7 +300,7 @@ export class VadentisActor extends Actor { async rollDevotion( devotionId ) { let devotion = this.items.get( devotionId ); if ( devotion ) { - devotion = duplicate(devotion) + devotion = foundry.utils.duplicate(devotion) this.processSortDevotion( "devotion", devotion); } } @@ -316,7 +316,7 @@ export class VadentisActor extends Actor { async rollTechnique( techniqueId ) { let technique = this.items.get( techniqueId ) if (technique) { - technique = duplicate(technique) + technique = foundry.utils.duplicate(technique) let msgData = { alias: this.name, img: technique.img, @@ -344,7 +344,7 @@ export class VadentisActor extends Actor { console.log(competenceId) let competence = this.items.get( competenceId); if ( competence) { - competence = duplicate(competence) + competence = foundry.utils.duplicate(competence) let msgData = { alias: this.name, img: competence.img, @@ -424,7 +424,7 @@ export class VadentisActor extends Actor { async incrementeArgent( arme ) { let monnaie = this.items.find( item => item.type == 'monnaie' && item.name == arme.name); if (monnaie) { - monnaie = duplicate(monnaie) + monnaie = foundry.utils.duplicate(monnaie) let newValeur = monnaie.system.nombre + 1; await this.updateEmbeddedDocuments( 'Item', [{ _id: monnaie._id, 'system.nombre': newValeur }] ); } @@ -433,7 +433,7 @@ export class VadentisActor extends Actor { async decrementeArgent( arme ) { let monnaie = this.items.find( item => item.type == 'monnaie' && item.name == arme.name); if (monnaie) { - monnaie = duplicate(monnaie) + monnaie = foundry.utils.duplicate(monnaie) let newValeur = monnaie.system.nombre - 1; newValeur = (newValeur <= 0) ? 0 : newValeur; await this.updateEmbeddedDocuments( "Item", [{ _id: monnaie._id, 'system.nombre': newValeur }] ); @@ -444,7 +444,7 @@ export class VadentisActor extends Actor { async incrementeMunition( arme ) { let armeTir = this.items.find( item => item.type == 'tir' && item.name == arme.name); if (armeTir) { - armeTir = duplicate(armeTir) + armeTir = foundry.utils.duplicate(armeTir) let newMunition = armeTir.system.munition + 1; await this.updateEmbeddedDocuments( "Item", [{ _id: armeTir._id, 'system.munition': newMunition }] ); } @@ -453,7 +453,7 @@ export class VadentisActor extends Actor { async decrementeMunition( arme ) { let armeTir = this.items.find( item => item.type == 'tir' && item.name == arme.name); if (armeTir) { - armeTir = duplicate(armeTir) + armeTir = foundry.utils.duplicate(armeTir) let newMunition = armeTir.system.munition - 1; newMunition = (newMunition <= 0) ? 0 : newMunition; await this.updateEmbeddedDocuments( "Item", [{ _id: armeTir._id, 'system.munition': newMunition } ]); @@ -464,7 +464,7 @@ export class VadentisActor extends Actor { async incrementeQuantite( objet ) { let objetQ = this.items.find( item => item._id == objet._id ); if (objetQ) { - objetQ = duplicate(objetQ) + objetQ = foundry.utils.duplicate(objetQ) let newQ = objetQ.system.quantite + 1; await this.updateEmbeddedDocuments( "Item", [{ _id: objetQ._id, 'system.quantite': newQ } ] ); } @@ -474,7 +474,7 @@ export class VadentisActor extends Actor { async decrementeQuantite( objet ) { let objetQ = this.items.find( item => item._id == objet._id ); if (objetQ) { - objetQ = duplicate(objetQ) + objetQ = foundry.utils.duplicate(objetQ) let newQ = objetQ.system.quantite - 1; newQ = (newQ <= 0) ? 0 : newQ; await this.updateEmbeddedDocuments( "Item", [{ _id: objetQ._id, 'system.quantite': newQ } ]); @@ -488,7 +488,7 @@ export class VadentisActor extends Actor { if ( target ) { let arme = this.items.find( item => (item.type == 'armecc' || item.type == 'tir') && item.id == armeId); if (arme) { - arme = duplicate(arme) + arme = foundry.utils.duplicate(arme) if ( arme.type == 'tir' && arme.system.munition <= 0 ) { ui.notifications.warn("Vous n'avez plus de munitions avec cette arme."); return; @@ -496,7 +496,7 @@ export class VadentisActor extends Actor { let combatData = { attackerActorId: this.id, targetActorId: target.actor.id, - arme: duplicate(arme) + arme: foundry.utils.duplicate(arme) } if (game.user.isGM) { VadentisUtility.performAttack( combatData); diff --git a/modules/vadentis-combat.js b/modules/vadentis-combat.js index dd3972f..0b53d7b 100644 --- a/modules/vadentis-combat.js +++ b/modules/vadentis-combat.js @@ -23,7 +23,7 @@ export class VadentisCombat extends Combat { // Send a chat message let rollMode = messageOptions.rollMode || game.settings.get("core", "rollMode"); - let messageData = mergeObject( + let messageData = foundry.utils.mergeObject( { speaker: { scene: canvas.scene.id, diff --git a/modules/vadentis-item-sheet.js b/modules/vadentis-item-sheet.js index 468acda..f21a508 100644 --- a/modules/vadentis-item-sheet.js +++ b/modules/vadentis-item-sheet.js @@ -8,7 +8,7 @@ export class VadentisItemSheet extends ItemSheet { /** @override */ static get defaultOptions() { - return mergeObject(super.defaultOptions, { + return foundry.utils.mergeObject(super.defaultOptions, { classes: ["foundryvtt-vadentis", "sheet", "item"], template: "systems/foundryvtt-vadentis/templates/item-sheet.html", width: 550, diff --git a/modules/vadentis-utility.js b/modules/vadentis-utility.js index 056003e..8909647 100644 --- a/modules/vadentis-utility.js +++ b/modules/vadentis-utility.js @@ -1,12 +1,19 @@ -/* -------------------------------------------- */ +/* -------------------------------------------- */ import { VadentisCombat } from "./vadentis-combat.js"; -/* -------------------------------------------- */ -export class VadentisUtility { - - /* -------------------------------------------- */ +/* -------------------------------------------- */ +export class VadentisUtility { + + /* -------------------------------------------- */ static async preloadHandlebarsTemplates() { - + // Handle v12 removal of this helper + Handlebars.registerHelper('select', function (selected, options) { + const escapedValue = RegExp.escape(Handlebars.escapeExpression(selected)); + const rgx = new RegExp(' value=[\"\']' + escapedValue + '[\"\']'); + const html = options.fn(this); + return html.replace(rgx, "$& selected"); + }); + const templatePaths = [ 'systems/foundryvtt-vadentis/templates/actor-sheet.html', 'systems/foundryvtt-vadentis/templates/item-sheet.html', @@ -14,77 +21,77 @@ export class VadentisUtility { 'systems/foundryvtt-vadentis/templates/hud-actor-attaque.html', 'systems/foundryvtt-vadentis/templates/hud-actor-sort.html' ] - return loadTemplates(templatePaths); + return loadTemplates(templatePaths); } /* -------------------------------------------- */ - static updateCombat( combat, round, diff, id ) { + static updateCombat(combat, round, diff, id) { if (game.user.isGM && combat.round != 0 && combat.turns && combat.active) { let turn = combat.turns.find(t => t.tokenId == combat.current.tokenId); - ChatMessage.create( { content: `Round ${combat.round} : C'est au tour de ${turn.actor.name}
` } ); + ChatMessage.create({ content: `Round ${combat.round} : C'est au tour de ${turn.actor.name}
` }); canvas.tokens.get(turn.token._id).control(); canvas.tokens.cycleTokens(1, true); - } + } } /* -------------------------------------------- */ - static createOptionList( min, max) { + static createOptionList(min, max) { let options = "" - for(let i=min; i<=max; i++) { + for (let i = min; i <= max; i++) { options += `\n`; } return options; } /* -------------------------------------------- */ - static createDirectOptionList( min, max) { + static createDirectOptionList(min, max) { let options = {}; - for(let i=min; i<=max; i++) { + for (let i = min; i <= max; i++) { options[`${i}`] = `${i}`; } return options; } /* -------------------------------------------- */ - static createDirectIntegerOptionList( min, max) { + static createDirectIntegerOptionList(min, max) { let options = {}; - for(let i=min; i<=max; i++) { + for (let i = min; i <= max; i++) { options[i] = `${i}`; } return options; } /* -------------------------------------------- */ - static createDirectReverseOptionList( min, max) { + static createDirectReverseOptionList(min, max) { let options = {}; - for(let i=max; i>=min; i--) { + for (let i = max; i >= min; i--) { options[`${i}`] = `${i}`; } return options; } - + /* -------------------------------------------- */ static getTarget() { if (game.user.targets && game.user.targets.size == 1) { - for (let target of game.user.targets) { - return target; + for (let target of game.user.targets) { + return target; } } return undefined; } - + /* -------------------------------------------- */ - static processDamageString( formula, actor ) { + static processDamageString(formula, actor) { let workFormula = formula.toLowerCase(); - if ( workFormula.includes('bonus de force')) { + if (workFormula.includes('bonus de force')) { workFormula = workFormula.replace('bonus de force', actor.getForceScore()); } return workFormula; - } + } /* -------------------------------------------- */ - static async processRoll( formula, rollMode ) { + static async processRoll(formula, rollMode) { let myRoll = new Roll(formula); - myRoll.roll( { async: false} ); + await myRoll.roll(); if (game.modules.get("dice-so-nice")?.active) { await game.dice3d.showForRoll(myRoll, game.user, true); } @@ -92,48 +99,48 @@ export class VadentisUtility { } /* -------------------------------------------- */ - static async performAttack( combatData) { + static async performAttack(combatData) { let attacker = game.actors.get(combatData.attackerActorId); let defender = game.actors.get(combatData.targetActorId); console.log("ATTACK !!", attacker, defender); - if( attacker && defender) { - let defense = defender.getDefenseScore(); + if (attacker && defender) { + let defense = defender.getDefenseScore(); let attaque = attacker.getAttaqueScore(); let msgData = { - alias: this.name, + alias: this.name, title: `${attacker.name} attaque ${defender.name}` } - + let tirMsg = ""; - if ( combatData.arme.type == 'tir') { + if (combatData.arme.type == 'tir') { attacker.decrementeMunition(combatData.arme); tirMsg += `
C'est un tir, les munitions de l'attaquant ont été décrémentées`; } - let formulaTouche = "1d20+"+attaque; - let formulaFull = attacker.buildTexteFormula( attacker.system.combat.attaque ); + let formulaTouche = "1d20+" + attaque; + let formulaFull = attacker.buildTexteFormula(attacker.system.combat.attaque); let myRoll = await this.processRoll(formulaTouche); if (myRoll.dice[0].results[0].result > 1 && myRoll.total >= defense) { // Success ! let degats = `normaux : ${combatData.arme.system.damage}`; let formula = combatData.arme.system.damage.toLowerCase(); msgData.msg = `${attacker.name} a réussi son attaque sur ${defender.name} (${formulaFull} => ${myRoll.total} / ${defense}) !
Les dégâts sont ${degats}.`; - + msgData.msg += tirMsg; - if ( myRoll.dice[0].results[0].result >= combatData.arme.system.valuecritical ) { + if (myRoll.dice[0].results[0].result >= combatData.arme.system.valuecritical) { degats = `critiques : ${combatData.arme.system.criticaldamage}`; formula = combatData.arme.system.criticaldamage.toLowerCase(); msgData.msg += `
C'est une réussite critique !`; - } + } msgData.img = 'systems/foundryvtt-vadentis/images/icons/tchat_attaque_réussie.webp' - - formula = this.processDamageString( formula, attacker ); + + formula = this.processDamageString(formula, attacker); let degatsRoll = await this.processRoll(formula); - msgData.msg +=`
Les dégats infligés sont de ${degatsRoll.total} (${formula}).`; - defender.applyDamage( degatsRoll.total ); + msgData.msg += `
Les dégats infligés sont de ${degatsRoll.total} (${formula}).`; + defender.applyDamage(degatsRoll.total); } else { //Echec msgData.img = 'systems/foundryvtt-vadentis/images/icons/tchat_attaque_échouée.webp'; - if ( myRoll.dice[0].results[0].result == 1) { + if (myRoll.dice[0].results[0].result == 1) { msgData.msg = `${attacker.name} a fait un échec critique et a raté son attaque sur ${defender.name} (${myRoll.total} / ${defense}) !`; } else { msgData.msg = `${attacker.name} a raté son attaque sur ${defender.name} (${myRoll.total} / ${defense}) !`; @@ -143,38 +150,38 @@ export class VadentisUtility { ChatMessage.create({ //whisper: ChatUtility.getWhisperRecipientsAndGMs(game.user.name), content: await renderTemplate(`systems/foundryvtt-vadentis/templates/chat-generic-result.html`, msgData) - }); + }); } else { ui.notifications.warn("Impossible de trouver l'attaquant et le défenseur.") } } /* -------------------------------------------- */ - static buildJetText( stat) { + static buildJetText(stat) { let name = stat.label; let title = `Jet de ${name}`; - if ( name.toLowerCase().substr(0,1).match(/[aeoiou]/g) ) { + if (name.toLowerCase().substr(0, 1).match(/[aeoiou]/g)) { title = `Jet d'${name}`; - } + } return title; } - + /* -------------------------------------------- */ - static registerChatCallbacks( ) { + static registerChatCallbacks() { } - + /* -------------------------------------------- */ - static fillRange (start, end) { + static fillRange(start, end) { return Array(end - start + 1).fill().map((item, index) => start + index); } - - /* -------------------------------------------- */ - static onSocketMesssage( msg ) { - if( !game.user.isGM ) return; // Only GM - if (msg.name == 'msg_attack' ) { - this.performAttack( msg.data ); + /* -------------------------------------------- */ + static onSocketMesssage(msg) { + if (!game.user.isGM) return; // Only GM + + if (msg.name == 'msg_attack') { + this.performAttack(msg.data); } } @@ -185,7 +192,7 @@ export class VadentisUtility { await pack.getIndex().then(index => competences = index); return competences; } - + /* -------------------------------------------- */ static async loadCompendium(compendium, filter = item => true) { let compendiumItems = await SoSUtility.loadCompendiumNames(compendium); @@ -204,11 +211,11 @@ export class VadentisUtility { } /* -------------------------------------------- */ - static getDonnees( ) { + static getDonnees() { return this.loadCompendiumNames('foundryvtt-vadentis.donnees'); } /* -------------------------------------------- */ - static getEglises( ) { + static getEglises() { return this.loadCompendiumNames('foundryvtt-vadentis.croyances'); } @@ -218,26 +225,26 @@ export class VadentisUtility { let msgTxt = "

Etes vous certain de souhaiter supprimer cet item ?"; let buttons = { delete: { - icon: '', - label: "Oui, à supprimer", - callback: () => { - actorSheet.actor.deleteEmbeddedDocuments('Item', [ itemId] ); - li.slideUp(200, () => actorSheet.render(false)); - } - }, - cancel: { - icon: '', - label: "Annuler" + icon: '', + label: "Oui, à supprimer", + callback: () => { + actorSheet.actor.deleteEmbeddedDocuments('Item', [itemId]); + li.slideUp(200, () => actorSheet.render(false)); } + }, + cancel: { + icon: '', + label: "Annuler" } - msgTxt += "

"; - let d = new Dialog({ - title: "Confirmer la suppression", - content: msgTxt, - buttons: buttons, - default: "cancel" - }); - d.render(true); + } + msgTxt += "

"; + let d = new Dialog({ + title: "Confirmer la suppression", + content: msgTxt, + buttons: buttons, + default: "cancel" + }); + d.render(true); } } \ No newline at end of file diff --git a/packs/armes/000119.log b/packs/armes/000123.log similarity index 100% rename from packs/armes/000119.log rename to packs/armes/000123.log diff --git a/packs/armes/CURRENT b/packs/armes/CURRENT index 5ff346e..2b465ed 100644 --- a/packs/armes/CURRENT +++ b/packs/armes/CURRENT @@ -1 +1 @@ -MANIFEST-000117 +MANIFEST-000121 diff --git a/packs/armes/LOG b/packs/armes/LOG index d508bde..06bc42f 100644 --- a/packs/armes/LOG +++ b/packs/armes/LOG @@ -1,7 +1,7 @@ -2024/11/19-23:17:43.856139 7fa1053f96c0 Recovering log #115 -2024/11/19-23:17:43.866464 7fa1053f96c0 Delete type=3 #113 -2024/11/19-23:17:43.866517 7fa1053f96c0 Delete type=0 #115 -2024/11/19-23:38:11.014992 7fa0ff3ff6c0 Level-0 table #120: started -2024/11/19-23:38:11.015024 7fa0ff3ff6c0 Level-0 table #120: 0 bytes OK -2024/11/19-23:38:11.049336 7fa0ff3ff6c0 Delete type=0 #118 -2024/11/19-23:38:11.254727 7fa0ff3ff6c0 Manual compaction at level-0 from '!folders!2kE4DZEroVJcotCG' @ 72057594037927935 : 1 .. '!items!yAxHWBTO5DJ3PKod' @ 0 : 0; will stop at (end) +2024/11/19-23:44:40.365245 7fa1053f96c0 Recovering log #119 +2024/11/19-23:44:40.375278 7fa1053f96c0 Delete type=3 #117 +2024/11/19-23:44:40.375368 7fa1053f96c0 Delete type=0 #119 +2024/11/19-23:54:21.222520 7fa0ff3ff6c0 Level-0 table #124: started +2024/11/19-23:54:21.222546 7fa0ff3ff6c0 Level-0 table #124: 0 bytes OK +2024/11/19-23:54:21.253824 7fa0ff3ff6c0 Delete type=0 #122 +2024/11/19-23:54:21.395591 7fa0ff3ff6c0 Manual compaction at level-0 from '!folders!2kE4DZEroVJcotCG' @ 72057594037927935 : 1 .. '!items!yAxHWBTO5DJ3PKod' @ 0 : 0; will stop at (end) diff --git a/packs/armes/LOG.old b/packs/armes/LOG.old index 8747714..d508bde 100644 --- a/packs/armes/LOG.old +++ b/packs/armes/LOG.old @@ -1,7 +1,7 @@ -2024/11/19-22:33:16.785474 7fa105bfa6c0 Recovering log #111 -2024/11/19-22:33:16.795224 7fa105bfa6c0 Delete type=3 #109 -2024/11/19-22:33:16.795283 7fa105bfa6c0 Delete type=0 #111 -2024/11/19-22:41:18.542597 7fa0ff3ff6c0 Level-0 table #116: started -2024/11/19-22:41:18.542627 7fa0ff3ff6c0 Level-0 table #116: 0 bytes OK -2024/11/19-22:41:18.548585 7fa0ff3ff6c0 Delete type=0 #114 -2024/11/19-22:41:18.561962 7fa0ff3ff6c0 Manual compaction at level-0 from '!folders!2kE4DZEroVJcotCG' @ 72057594037927935 : 1 .. '!items!yAxHWBTO5DJ3PKod' @ 0 : 0; will stop at (end) +2024/11/19-23:17:43.856139 7fa1053f96c0 Recovering log #115 +2024/11/19-23:17:43.866464 7fa1053f96c0 Delete type=3 #113 +2024/11/19-23:17:43.866517 7fa1053f96c0 Delete type=0 #115 +2024/11/19-23:38:11.014992 7fa0ff3ff6c0 Level-0 table #120: started +2024/11/19-23:38:11.015024 7fa0ff3ff6c0 Level-0 table #120: 0 bytes OK +2024/11/19-23:38:11.049336 7fa0ff3ff6c0 Delete type=0 #118 +2024/11/19-23:38:11.254727 7fa0ff3ff6c0 Manual compaction at level-0 from '!folders!2kE4DZEroVJcotCG' @ 72057594037927935 : 1 .. '!items!yAxHWBTO5DJ3PKod' @ 0 : 0; will stop at (end) diff --git a/packs/armes/MANIFEST-000117 b/packs/armes/MANIFEST-000121 similarity index 75% rename from packs/armes/MANIFEST-000117 rename to packs/armes/MANIFEST-000121 index 7b12d6b7a1eb5c71a5b8ce3d457e22f4f1fd49ac..96e89bed6a630cef78c435db59a2f68365da9067 100644 GIT binary patch delta 37 pcmZ3*xQcN?kDTMf9vKb>My4uG2Igv((kJxR!B3uR=#>-6~E7My4uG2Igv(BaBk{m#aa1Ai-P<xR!B3uL7s8V<0C3BU2eC19Lgc5k}?t(NQ3NIgnoop3|ZJNJY53P8RRkPiUGmIz7! diff --git a/packs/carte/000117.log b/packs/carte/000121.log similarity index 100% rename from packs/carte/000117.log rename to packs/carte/000121.log diff --git a/packs/carte/CURRENT b/packs/carte/CURRENT index 4843639..8880a30 100644 --- a/packs/carte/CURRENT +++ b/packs/carte/CURRENT @@ -1 +1 @@ -MANIFEST-000115 +MANIFEST-000119 diff --git a/packs/carte/LOG b/packs/carte/LOG index 931ca7f..5a97af1 100644 --- a/packs/carte/LOG +++ b/packs/carte/LOG @@ -1,7 +1,7 @@ -2024/11/19-23:17:43.810745 7fa105bfa6c0 Recovering log #113 -2024/11/19-23:17:43.820849 7fa105bfa6c0 Delete type=3 #111 -2024/11/19-23:17:43.820898 7fa105bfa6c0 Delete type=0 #113 -2024/11/19-23:38:10.940164 7fa0ff3ff6c0 Level-0 table #118: started -2024/11/19-23:38:10.940188 7fa0ff3ff6c0 Level-0 table #118: 0 bytes OK -2024/11/19-23:38:10.972436 7fa0ff3ff6c0 Delete type=0 #116 -2024/11/19-23:38:10.972602 7fa0ff3ff6c0 Manual compaction at level-0 from '!folders!0tzWkCUDta6Cg5tp' @ 72057594037927935 : 1 .. '!journal.pages!zv1SXg1qCuG8O4up.GDKdaQhvwCVhH7qn' @ 0 : 0; will stop at (end) +2024/11/19-23:44:40.319984 7fa105bfa6c0 Recovering log #117 +2024/11/19-23:44:40.329839 7fa105bfa6c0 Delete type=3 #115 +2024/11/19-23:44:40.329926 7fa105bfa6c0 Delete type=0 #117 +2024/11/19-23:54:21.167446 7fa0ff3ff6c0 Level-0 table #122: started +2024/11/19-23:54:21.167476 7fa0ff3ff6c0 Level-0 table #122: 0 bytes OK +2024/11/19-23:54:21.193245 7fa0ff3ff6c0 Delete type=0 #120 +2024/11/19-23:54:21.222399 7fa0ff3ff6c0 Manual compaction at level-0 from '!folders!0tzWkCUDta6Cg5tp' @ 72057594037927935 : 1 .. '!journal.pages!zv1SXg1qCuG8O4up.GDKdaQhvwCVhH7qn' @ 0 : 0; will stop at (end) diff --git a/packs/carte/LOG.old b/packs/carte/LOG.old index cfb1395..931ca7f 100644 --- a/packs/carte/LOG.old +++ b/packs/carte/LOG.old @@ -1,7 +1,7 @@ -2024/11/19-22:33:16.742799 7fa0fffff6c0 Recovering log #109 -2024/11/19-22:33:16.752158 7fa0fffff6c0 Delete type=3 #107 -2024/11/19-22:33:16.752242 7fa0fffff6c0 Delete type=0 #109 -2024/11/19-22:41:18.523134 7fa0ff3ff6c0 Level-0 table #114: started -2024/11/19-22:41:18.523166 7fa0ff3ff6c0 Level-0 table #114: 0 bytes OK -2024/11/19-22:41:18.529084 7fa0ff3ff6c0 Delete type=0 #112 -2024/11/19-22:41:18.535252 7fa0ff3ff6c0 Manual compaction at level-0 from '!folders!0tzWkCUDta6Cg5tp' @ 72057594037927935 : 1 .. '!journal.pages!zv1SXg1qCuG8O4up.GDKdaQhvwCVhH7qn' @ 0 : 0; will stop at (end) +2024/11/19-23:17:43.810745 7fa105bfa6c0 Recovering log #113 +2024/11/19-23:17:43.820849 7fa105bfa6c0 Delete type=3 #111 +2024/11/19-23:17:43.820898 7fa105bfa6c0 Delete type=0 #113 +2024/11/19-23:38:10.940164 7fa0ff3ff6c0 Level-0 table #118: started +2024/11/19-23:38:10.940188 7fa0ff3ff6c0 Level-0 table #118: 0 bytes OK +2024/11/19-23:38:10.972436 7fa0ff3ff6c0 Delete type=0 #116 +2024/11/19-23:38:10.972602 7fa0ff3ff6c0 Manual compaction at level-0 from '!folders!0tzWkCUDta6Cg5tp' @ 72057594037927935 : 1 .. '!journal.pages!zv1SXg1qCuG8O4up.GDKdaQhvwCVhH7qn' @ 0 : 0; will stop at (end) diff --git a/packs/carte/MANIFEST-000115 b/packs/carte/MANIFEST-000119 similarity index 57% rename from packs/carte/MANIFEST-000115 rename to packs/carte/MANIFEST-000119 index 79899955477607eed28eaeb2d1e64a040d1e1ee6..5cd9df5ce8c8ecf7337937fb5715570b4ca7941d 100644 GIT binary patch delta 39 qcmcc5c%N~?eg&Rdc_~f?My3i*2IfkZ9jsBAA-N!aC6HeY82bEj7-X$49qGleDChf{{iBv0J&-`d;rEv2(thH delta 37 pcmZ3%xPoy)m)xJn(|&OxR!B3ufo>#sxR!B3uL4v1wO^bJj7-6t49p=cos4>nceaE0AwYf@kPiUeG6_-u diff --git a/packs/manuel-de-jeu/000032.log b/packs/manuel-de-jeu/000036.log similarity index 100% rename from packs/manuel-de-jeu/000032.log rename to packs/manuel-de-jeu/000036.log diff --git a/packs/manuel-de-jeu/CURRENT b/packs/manuel-de-jeu/CURRENT index caa721a..eea9b0f 100644 --- a/packs/manuel-de-jeu/CURRENT +++ b/packs/manuel-de-jeu/CURRENT @@ -1 +1 @@ -MANIFEST-000030 +MANIFEST-000034 diff --git a/packs/manuel-de-jeu/LOG b/packs/manuel-de-jeu/LOG index 89f4efc..272fd66 100644 --- a/packs/manuel-de-jeu/LOG +++ b/packs/manuel-de-jeu/LOG @@ -1,7 +1,7 @@ -2024/11/19-23:17:43.934084 7fa1053f96c0 Recovering log #28 -2024/11/19-23:17:43.944397 7fa1053f96c0 Delete type=3 #26 -2024/11/19-23:17:43.944457 7fa1053f96c0 Delete type=0 #28 -2024/11/19-23:38:11.371823 7fa0ff3ff6c0 Level-0 table #33: started -2024/11/19-23:38:11.371847 7fa0ff3ff6c0 Level-0 table #33: 0 bytes OK -2024/11/19-23:38:11.413824 7fa0ff3ff6c0 Delete type=0 #31 -2024/11/19-23:38:11.414079 7fa0ff3ff6c0 Manual compaction at level-0 from '!journal!dREAndyyUZV4jFd3' @ 72057594037927935 : 1 .. '!journal.pages!dREAndyyUZV4jFd3.oZ9XWTj8PjvV3ElF' @ 0 : 0; will stop at (end) +2024/11/19-23:44:40.444673 7fa1053f96c0 Recovering log #32 +2024/11/19-23:44:40.455966 7fa1053f96c0 Delete type=3 #30 +2024/11/19-23:44:40.456074 7fa1053f96c0 Delete type=0 #32 +2024/11/19-23:54:21.449072 7fa0ff3ff6c0 Level-0 table #37: started +2024/11/19-23:54:21.449108 7fa0ff3ff6c0 Level-0 table #37: 0 bytes OK +2024/11/19-23:54:21.485776 7fa0ff3ff6c0 Delete type=0 #35 +2024/11/19-23:54:21.520843 7fa0ff3ff6c0 Manual compaction at level-0 from '!journal!dREAndyyUZV4jFd3' @ 72057594037927935 : 1 .. '!journal.pages!dREAndyyUZV4jFd3.oZ9XWTj8PjvV3ElF' @ 0 : 0; will stop at (end) diff --git a/packs/manuel-de-jeu/LOG.old b/packs/manuel-de-jeu/LOG.old index 547b61e..89f4efc 100644 --- a/packs/manuel-de-jeu/LOG.old +++ b/packs/manuel-de-jeu/LOG.old @@ -1,7 +1,7 @@ -2024/11/19-22:33:16.864283 7fa105bfa6c0 Recovering log #24 -2024/11/19-22:33:16.874484 7fa105bfa6c0 Delete type=3 #22 -2024/11/19-22:33:16.874652 7fa105bfa6c0 Delete type=0 #24 -2024/11/19-22:41:18.581649 7fa0ff3ff6c0 Level-0 table #29: started -2024/11/19-22:41:18.581676 7fa0ff3ff6c0 Level-0 table #29: 0 bytes OK -2024/11/19-22:41:18.588031 7fa0ff3ff6c0 Delete type=0 #27 -2024/11/19-22:41:18.588179 7fa0ff3ff6c0 Manual compaction at level-0 from '!journal!dREAndyyUZV4jFd3' @ 72057594037927935 : 1 .. '!journal.pages!dREAndyyUZV4jFd3.oZ9XWTj8PjvV3ElF' @ 0 : 0; will stop at (end) +2024/11/19-23:17:43.934084 7fa1053f96c0 Recovering log #28 +2024/11/19-23:17:43.944397 7fa1053f96c0 Delete type=3 #26 +2024/11/19-23:17:43.944457 7fa1053f96c0 Delete type=0 #28 +2024/11/19-23:38:11.371823 7fa0ff3ff6c0 Level-0 table #33: started +2024/11/19-23:38:11.371847 7fa0ff3ff6c0 Level-0 table #33: 0 bytes OK +2024/11/19-23:38:11.413824 7fa0ff3ff6c0 Delete type=0 #31 +2024/11/19-23:38:11.414079 7fa0ff3ff6c0 Manual compaction at level-0 from '!journal!dREAndyyUZV4jFd3' @ 72057594037927935 : 1 .. '!journal.pages!dREAndyyUZV4jFd3.oZ9XWTj8PjvV3ElF' @ 0 : 0; will stop at (end) diff --git a/packs/manuel-de-jeu/MANIFEST-000030 b/packs/manuel-de-jeu/MANIFEST-000034 similarity index 58% rename from packs/manuel-de-jeu/MANIFEST-000030 rename to packs/manuel-de-jeu/MANIFEST-000034 index 4999a01017445373bfea764e7433eb1be60e41d8..50d79b2acbde050adda7721be699ec079b684a12 100644 GIT binary patch delta 37 pcmcb^c!zPqKDkbPzM~urj7-X$49qGlY&B=tx{5>2Dj7;*J49p5FY#W+p90PF`fLtXOHUQ1>2wDID diff --git a/packs/maps/000118.log b/packs/maps/000122.log similarity index 100% rename from packs/maps/000118.log rename to packs/maps/000122.log diff --git a/packs/maps/CURRENT b/packs/maps/CURRENT index 2b6390e..30eb131 100644 --- a/packs/maps/CURRENT +++ b/packs/maps/CURRENT @@ -1 +1 @@ -MANIFEST-000116 +MANIFEST-000120 diff --git a/packs/maps/LOG b/packs/maps/LOG index d9e1931..380b93e 100644 --- a/packs/maps/LOG +++ b/packs/maps/LOG @@ -1,7 +1,7 @@ -2024/11/19-23:17:43.836594 7fa104bf86c0 Recovering log #114 -2024/11/19-23:17:43.846367 7fa104bf86c0 Delete type=3 #112 -2024/11/19-23:17:43.846428 7fa104bf86c0 Delete type=0 #114 -2024/11/19-23:38:10.972732 7fa0ff3ff6c0 Level-0 table #119: started -2024/11/19-23:38:10.972773 7fa0ff3ff6c0 Level-0 table #119: 0 bytes OK -2024/11/19-23:38:11.014835 7fa0ff3ff6c0 Delete type=0 #117 -2024/11/19-23:38:11.254705 7fa0ff3ff6c0 Manual compaction at level-0 from '!folders!4Ttms111WFnwvOXH' @ 72057594037927935 : 1 .. '!scenes.walls!xywEQQB1ECQ7Xj2T.v66UtJZkHQoVmoZF' @ 0 : 0; will stop at (end) +2024/11/19-23:44:40.346191 7fa104bf86c0 Recovering log #118 +2024/11/19-23:44:40.356403 7fa104bf86c0 Delete type=3 #116 +2024/11/19-23:44:40.356479 7fa104bf86c0 Delete type=0 #118 +2024/11/19-23:54:21.340763 7fa0ff3ff6c0 Level-0 table #123: started +2024/11/19-23:54:21.340796 7fa0ff3ff6c0 Level-0 table #123: 0 bytes OK +2024/11/19-23:54:21.395446 7fa0ff3ff6c0 Delete type=0 #121 +2024/11/19-23:54:21.395623 7fa0ff3ff6c0 Manual compaction at level-0 from '!folders!4Ttms111WFnwvOXH' @ 72057594037927935 : 1 .. '!scenes.walls!xywEQQB1ECQ7Xj2T.v66UtJZkHQoVmoZF' @ 0 : 0; will stop at (end) diff --git a/packs/maps/LOG.old b/packs/maps/LOG.old index 6d27ef4..d9e1931 100644 --- a/packs/maps/LOG.old +++ b/packs/maps/LOG.old @@ -1,7 +1,7 @@ -2024/11/19-22:33:16.767200 7fa1053f96c0 Recovering log #110 -2024/11/19-22:33:16.777783 7fa1053f96c0 Delete type=3 #108 -2024/11/19-22:33:16.777851 7fa1053f96c0 Delete type=0 #110 -2024/11/19-22:41:18.535365 7fa0ff3ff6c0 Level-0 table #115: started -2024/11/19-22:41:18.535398 7fa0ff3ff6c0 Level-0 table #115: 0 bytes OK -2024/11/19-22:41:18.542494 7fa0ff3ff6c0 Delete type=0 #113 -2024/11/19-22:41:18.561948 7fa0ff3ff6c0 Manual compaction at level-0 from '!folders!4Ttms111WFnwvOXH' @ 72057594037927935 : 1 .. '!scenes.walls!xywEQQB1ECQ7Xj2T.v66UtJZkHQoVmoZF' @ 0 : 0; will stop at (end) +2024/11/19-23:17:43.836594 7fa104bf86c0 Recovering log #114 +2024/11/19-23:17:43.846367 7fa104bf86c0 Delete type=3 #112 +2024/11/19-23:17:43.846428 7fa104bf86c0 Delete type=0 #114 +2024/11/19-23:38:10.972732 7fa0ff3ff6c0 Level-0 table #119: started +2024/11/19-23:38:10.972773 7fa0ff3ff6c0 Level-0 table #119: 0 bytes OK +2024/11/19-23:38:11.014835 7fa0ff3ff6c0 Delete type=0 #117 +2024/11/19-23:38:11.254705 7fa0ff3ff6c0 Manual compaction at level-0 from '!folders!4Ttms111WFnwvOXH' @ 72057594037927935 : 1 .. '!scenes.walls!xywEQQB1ECQ7Xj2T.v66UtJZkHQoVmoZF' @ 0 : 0; will stop at (end) diff --git a/packs/maps/MANIFEST-000116 b/packs/maps/MANIFEST-000120 similarity index 57% rename from packs/maps/MANIFEST-000116 rename to packs/maps/MANIFEST-000120 index 596c86154e5afded3cd03d918c6bf3eb83800c9a..1167d26b1ed0c6348786f6760d2985969c41cebb 100644 GIT binary patch delta 39 qcmcc1c$aa)UWHEPat%%fMy5(m2IeZ3ZL(d0u0bGv6_8&8w0|3$f33dPg