diff --git a/.gitignore b/.gitignore index b60c46d..33afa0b 100644 --- a/.gitignore +++ b/.gitignore @@ -1,11 +1,14 @@ -# ---> VisualStudioCode -.vscode/* -!.vscode/settings.json -!.vscode/tasks.json -!.vscode/launch.json -!.vscode/extensions.json -*.code-workspace - -# Local History for Visual Studio Code -.history/ - +.vscode/settings.json +.idea +.history +todo.md +/.vscode +/ignored/ +/node_modules/ +/jsconfig.json +/package.json +/package-lock.json +/packs/*/ +/packs/*/CURRENT +/packs/*/LOG +/packs/*/LOCK diff --git a/fvtt-vadentis b/fvtt-vadentis deleted file mode 120000 index 9e79aa1..0000000 --- a/fvtt-vadentis +++ /dev/null @@ -1 +0,0 @@ -/home/morr/work/uberwald/fvtt-vadentis/ \ No newline at end of file diff --git a/images/icons/feuille_perso_esquive.webp b/images/icons/feuille_perso_esquive.webp deleted file mode 100644 index fd99a9c..0000000 Binary files a/images/icons/feuille_perso_esquive.webp and /dev/null differ diff --git a/images/ui/texture_feuille_perso_principale.webp b/images/ui/texture_feuille_perso_principale.webp index 46d50cf..4a89651 100644 Binary files a/images/ui/texture_feuille_perso_principale.webp and b/images/ui/texture_feuille_perso_principale.webp differ diff --git a/modules/vadentis-actor-sheet.js b/modules/vadentis-actor-sheet.js index 62f397e..fea07e2 100644 --- a/modules/vadentis-actor-sheet.js +++ b/modules/vadentis-actor-sheet.js @@ -13,7 +13,7 @@ export class VadentisActorSheet extends ActorSheet { return mergeObject(super.defaultOptions, { classes: ["vadentis", "sheet", "actor"], template: "systems/foundryvtt-vadentis/templates/actor-sheet.html", - width: 640, + width: 680, height: 720, tabs: [{ navSelector: ".sheet-tabs", contentSelector: ".sheet-body", initial: "stats" }], dragDrop: [{ dragSelector: ".item-list .item", dropSelector: null }], @@ -22,19 +22,17 @@ export class VadentisActorSheet extends ActorSheet { } /* -------------------------------------------- */ - getData() { + async getData() { this.actor.calculerSommeStats(); - const objectData = VadentisUtility.data(this.object); - - let actorData = duplicate(VadentisUtility.templateData(this.object)); - - let formData = { + let actorData = foundry.utils.duplicate(this.object.system); + + let formData = { title: this.title, - id: objectData.id, - type: objectData.type, - img: objectData.img, - name: objectData.name, + id: this.object.id, + type: this.object.type, + img: this.object.img, + name: this.object.name, editable: this.isEditable, cssClass: this.isEditable ? "editable" : "locked", data: actorData, @@ -43,28 +41,31 @@ export class VadentisActorSheet extends ActorSheet { options: this.options, owner: this.document.isOwner, editScore: this.options.editScore, - isGM: game.user.isGM + isGM: game.user.isGM, + history: await TextEditor.enrichHTML(this.object.system.history, { async: true }), + notes: await TextEditor.enrichHTML(this.object.system.notes, { async: true }), + gmnotes: await TextEditor.enrichHTML(this.object.system.gmnotes, { async: true }), } - formData.editScore = this.options.editScore; - formData.donnees = this.actor.getDonnees(); - formData.eglises = this.actor.getEglises(); + formData.editScore = this.options.editScore; + formData.donnees = this.actor.getDonnees(); + formData.eglises = this.actor.getEglises(); formData.competences = this.actor.getCompetences(); - formData.sorts = this.actor.getSorts(); - formData.devotions = this.actor.getDevotions(); - formData.attributs = this.actor.getAttributs(); - formData.techniques = this.actor.getTechniques(); - formData.armes = this.actor.getArmes(); - formData.armures = this.actor.getArmures(); + formData.sorts = this.actor.getSorts(); + formData.devotions = this.actor.getDevotions(); + formData.attributs = this.actor.getAttributs(); + formData.techniques = this.actor.getTechniques(); + formData.armes = this.actor.getArmes(); + formData.armures = this.actor.getArmures(); formData.equipements = this.actor.getEquipements(); - formData.monnaies = this.actor.getMonnaies(); - - formData.optionsBase = VadentisUtility.createDirectOptionList(0, 50); + formData.monnaies = this.actor.getMonnaies(); + + formData.optionsBase = VadentisUtility.createDirectOptionList(0, 50); formData.optionsMalus = VadentisUtility.createDirectReverseOptionList(-50, 0); formData.optionsBonus = VadentisUtility.createDirectOptionList(0, 50); - formData.optionsPV = VadentisUtility.createOptionList(-50, 200); - formData.optionsPE = VadentisUtility.createOptionList(-50, 200); - formData.optionsPA = VadentisUtility.createOptionList(0, 20); + formData.optionsPV = VadentisUtility.createDirectIntegerOptionList(-50, 999); + formData.optionsPE = VadentisUtility.createOptionList(-50, 999); + formData.optionsPA = VadentisUtility.createOptionList(0, 20); return formData; @@ -73,13 +74,25 @@ export class VadentisActorSheet extends ActorSheet { /* -------------------------------------------- */ async checkSort(sortId) { await Dialog.confirm({ - title: "Lancer un sort", - content: "Etes vous certain de vouloir incanter ce sort ?", + title: "Lancer un Sort", + content: "Etes vous certain de vouloir incanter ce Sort ?", yes: async () => { this.actor.rollSort(sortId); }, - no: () => {}, - }); + no: () => { }, + }); + } + + /* -------------------------------------------- */ + async checkDevotion(devotionId) { + await Dialog.confirm({ + title: "Lancer une Dévotion", + content: "Etes vous certain de vouloir incanter cette Dévotion ?", + yes: async () => { + this.actor.rollDevotion(devotionId); + }, + no: () => { }, + }); } /* -------------------------------------------- */ @@ -91,7 +104,7 @@ export class VadentisActorSheet extends ActorSheet { console.log("Technique ", techniqueId) this.actor.rollTechnique(techniqueId); }, - no: () => {}, + no: () => { }, }); } @@ -114,38 +127,38 @@ export class VadentisActorSheet extends ActorSheet { const li = $(ev.currentTarget).parents(".item"); VadentisUtility.confirmDelete(this, li); }); - + html.find('.munition-moins').click(event => { const li = $(event.currentTarget).parents(".item"); const item = this.actor.items.get(li.data("item-id")); - this.actor.decrementeMunition( item ); - } ); + this.actor.decrementeMunition(item); + }); html.find('.munition-plus').click(event => { const li = $(event.currentTarget).parents(".item"); const item = this.actor.items.get(li.data("item-id")); - this.actor.incrementeMunition( item ); - } ); + this.actor.incrementeMunition(item); + }); html.find('.equipement-moins').click(event => { const li = $(event.currentTarget).parents(".item"); const item = this.actor.items.get(li.data("item-id")); - this.actor.decrementeQuantite( item ); - } ); + this.actor.decrementeQuantite(item); + }); html.find('.equipement-plus').click(event => { const li = $(event.currentTarget).parents(".item"); const item = this.actor.items.get(li.data("item-id")); - this.actor.incrementeQuantite( item ); - } ); + this.actor.incrementeQuantite(item); + }); html.find('.argent-moins').click(event => { const li = $(event.currentTarget).parents(".item"); const item = this.actor.items.get(li.data("item-id")); - this.actor.decrementeArgent( item ); - } ); + this.actor.decrementeArgent(item); + }); html.find('.argent-plus').click(event => { const li = $(event.currentTarget).parents(".item"); const item = this.actor.items.get(li.data("item-id")); - this.actor.incrementeArgent( item ); - } ); + this.actor.incrementeArgent(item); + }); html.find('.combat-label a').click((event) => { let combatName = event.currentTarget.attributes.name.value; @@ -169,17 +182,17 @@ export class VadentisActorSheet extends ActorSheet { const li = $(event.currentTarget).parents(".item"); const sortId = li.data("item-id"); this.checkSort(sortId); - }); + }); html.find('.arme-label a').click((event) => { const li = $(event.currentTarget).parents(".item"); const armeId = li.data("item-id"); this.actor.rollArme(armeId); - }); + }); html.find('.devotion-label a').click((event) => { const li = $(event.currentTarget).parents(".item"); const devotionId = li.data("item-id"); - this.actor.rollDevotion(devotionId); - }); + this.checkDevotion(devotionId); + }); html.find('.weapon-label a').click((event) => { const li = $(event.currentTarget).parents(".item"); const weapon = this.actor.items.get(li.data("item-id")); @@ -205,7 +218,7 @@ export class VadentisActorSheet extends ActorSheet { const weapon = this.actor.items.get(li.data("item-id")); this.actor.rollSortDevotionDamage(weapon, 'damagecritical'); }); - + html.find('.competence-base').change((event) => { let skillName = event.currentTarget.attributes.skillname.value; this.actor.updateCompetence(skillName, "base", parseInt(event.target.value)); @@ -221,15 +234,15 @@ export class VadentisActorSheet extends ActorSheet { html.find('.lock-unlock-sheet').click((event) => { this.options.editScore = !this.options.editScore; this.render(true); - }); + }); html.find('.item-link a').click((event) => { const itemId = $(event.currentTarget).data("item-id"); const item = this.actor.items.get(itemId); item.sheet.render(true); - }); + }); html.find('.item-equip').click(ev => { const li = $(ev.currentTarget).parents(".item"); - this.actor.equiperObject( li.data("item-id") ); + this.actor.equiperObject(li.data("item-id")); this.render(true); }); diff --git a/modules/vadentis-actor.js b/modules/vadentis-actor.js index 5645dff..e5cb86e 100644 --- a/modules/vadentis-actor.js +++ b/modules/vadentis-actor.js @@ -31,7 +31,7 @@ export class VadentisActor extends Actor { return super.create(data, options); } // If the created actor has items (only applicable to duplicated actors) bypass the new actor creation logic - if (data.items) { + if (system.items) { let actor = super.create(data, options); return actor; } @@ -46,55 +46,55 @@ export class VadentisActor extends Actor { /* -------------------------------------------- */ getCompetences() { - return duplicate( this.data.items.filter( item => item.type == 'competence') || [] ); + return duplicate( this.items.filter( item => item.type == 'competence') || [] ); } /* -------------------------------------------- */ getDonnees() { - return duplicate( this.data.items.filter( item => item.type == 'donnee')|| [] ); + return duplicate( this.items.filter( item => item.type == 'donnee')|| [] ); } /* -------------------------------------------- */ getEglises() { - return duplicate( this.data.items.filter( item => item.type == 'eglise')|| [] ); + return duplicate( this.items.filter( item => item.type == 'eglise')|| [] ); } /* -------------------------------------------- */ getSorts() { - return duplicate( this.data.items.filter( item => item.type == 'sort')|| [] ); + return duplicate( this.items.filter( item => item.type == 'sort')|| [] ); } /* -------------------------------------------- */ getAttributs() { - return duplicate( this.data.items.filter( item => item.type == 'attribut')|| [] ); + return duplicate( this.items.filter( item => item.type == 'attribut')|| [] ); } /* -------------------------------------------- */ getTechniques() { - return duplicate( this.data.items.filter( item => item.type == 'technique') || [] ); + return duplicate( this.items.filter( item => item.type == 'technique') || [] ); } /* -------------------------------------------- */ getDevotions() { - return duplicate(this.data.items.filter( item => item.type == 'devotion')|| [] ); + return duplicate(this.items.filter( item => item.type == 'devotion')|| [] ); } /* -------------------------------------------- */ getEquipements() { - return duplicate(this.data.items.filter( item => item.type == 'equipement' ) || [] ); + return duplicate(this.items.filter( item => item.type == 'equipement' ) || [] ); } /* -------------------------------------------- */ getArmes() { - return duplicate(this.data.items.filter( item => item.type == 'armecc' || item.type == 'tir' ) || [] ); + return duplicate(this.items.filter( item => item.type == 'armecc' || item.type == 'tir' ) || [] ); } /* -------------------------------------------- */ getArmures() { - return duplicate(this.data.items.filter( item => item.type == 'armurebouclier' ) || [] ); + return duplicate(this.items.filter( item => item.type == 'armurebouclier' ) || [] ); } /* -------------------------------------------- */ getMonnaies() { - return duplicate(this.data.items.filter( item => item.type == 'monnaie' ) || [] ); + return duplicate(this.items.filter( item => item.type == 'monnaie' ) || [] ); } /* -------------------------------------------- */ async updateCompetence( name, field, value) { - let competence = this.data.items.find( item => item.type == 'competence' && item.name == name); + let competence = this.items.find( item => item.type == 'competence' && item.name == name); if (competence) { - let dataPath = 'data.'+field; + let dataPath = 'system.'+field; await this.updateEmbeddedDocuments( "Item", [{ _id: competence.id, [dataPath]:value }] ); } } @@ -103,7 +103,7 @@ export class VadentisActor extends Actor { async equiperObject( equipementId ) { let item = this.items.get(equipementId) if (item) { - let update = { _id: item.id, "data.equipee": !item.data.data.equipee }; + let update = { _id: item.id, "system.equipee": !item.system.equipee }; await this.updateEmbeddedDocuments("Item", [ update ] ); } } @@ -116,24 +116,24 @@ export class VadentisActor extends Actor { /* -------------------------------------------- */ calculerSommeStats( ) { - for (const key in this.data.data.combat) { - let combatData = this.data.data.combat[key]; + for (const key in this.system.combat) { + let combatData = this.system.combat[key]; combatData.total = combatData.base + combatData.malus + combatData.bonus; } - for (const key in this.data.data.magie) { - let magieData = this.data.data.magie[key]; + for (const key in this.system.magie) { + let magieData = this.system.magie[key]; magieData.total = magieData.base + magieData.malus + magieData.bonus; } } /* -------------------------------------------- */ async processSortDevotion( name, devotionSort ) { - if ( this.data.data.stats.pointsenergie.value == 0) { // Vérification du ~ de points d'énergie + if ( this.system.stats.pointsenergie.value == 0) { // Vérification du ~ de points d'énergie ChatMessage.create({ content: `${this.name} n'a pas assez de Points d'Energie pour lancer ${name} ${devotionSort.name}` } ); return; } - let scores = this.data.data.magie[(name =="devotion") ? 'devotion': 'matriseelementaire']; + let scores = this.system.magie[(name =="devotion") ? 'devotion': 'matriseelementaire']; let statValue = scores.base + scores.malus + scores.bonus; let formulaFull = this.buildTexteFormula( scores ); let myRoll = await VadentisUtility.processRoll("1d20+"+statValue ); @@ -143,33 +143,33 @@ export class VadentisActor extends Actor { isSort: true } - if (myRoll.dice[0].results[0].result > 1 && myRoll.total >= devotionSort.data.difficulty) { + if (myRoll.dice[0].results[0].result > 1 && myRoll.total >= devotionSort.system.difficulty) { msgData.img = 'systems/foundryvtt-vadentis/images/icons/tchat_sort_réussi.webp'; - msgData.msg = `${this.name} a réussi son ${name} et perd ${devotionSort.data.pe} Points d'Energie (lancer : ${formulaFull} => ${myRoll.total} / ${devotionSort.data.difficulty}).`; + msgData.msg = `${this.name} a réussi son ${name} et perd ${devotionSort.system.pe} Points d'Energie (lancer : ${formulaFull} => ${myRoll.total} / ${devotionSort.system.difficulty}).`; - let maintain = (devotionSort.data.ismaintain)?"Oui":"Non"; - let complex = (devotionSort.data.complexactions)?"Oui":"Non"; + let maintain = (devotionSort.system.ismaintain)?"Oui":"Non"; + let complex = (devotionSort.system.complexactions)?"Oui":"Non"; msgData.msg += `
Peut être maintenu: ${maintain}
Actions complexes : ${complex}`; - if ( !devotionSort.data.notes) devotionSort.data.notes = ""; - msgData.msg += `
Description : ${devotionSort.data.notes.replace(/<\/?[^>]+(>|$)/g, "")}`; + if ( !devotionSort.system.notes) devotionSort.system.notes = ""; + msgData.msg += `
Description : ${devotionSort.system.notes.replace(/<\/?[^>]+(>|$)/g, "")}`; - let newEnergie = this.data.data.stats.pointsenergie.value - devotionSort.data.pe; - await this.update( {'data.stats.pointsenergie.value': newEnergie }); - if (myRoll.dice[0].results[0].result >= devotionSort.data.valuecritical ) { // Critique ? + let newEnergie = this.system.stats.pointsenergie.value - devotionSort.system.pe; + await this.update( {'system.stats.pointsenergie.value': newEnergie }); + if (myRoll.dice[0].results[0].result >= devotionSort.system.valuecritical ) { // Critique ? msgData.img = 'systems/foundryvtt-vadentis/images/icons/tchat_réussite_critique.webp'; msgData.msg += "
C'est une réussite critique !"; - msgData.msg += `
Effet critique : ${devotionSort.data.criticaleffect.replace(/<\/?[^>]+(>|$)/g, "")}`; + msgData.msg += `
Effet critique : ${devotionSort.system.criticaleffect.replace(/<\/?[^>]+(>|$)/g, "")}`; } else { - msgData.msg += `
Effet : ${devotionSort.data.effect.replace(/<\/?[^>]+(>|$)/g, "")}`; + msgData.msg += `
Effet : ${devotionSort.system.effect.replace(/<\/?[^>]+(>|$)/g, "")}`; } - if ( devotionSort.data.damage != "") { - let formula = devotionSort.data.damage; - if (myRoll.dice[0].results[0].result >= devotionSort.data.valuecritical ) { // Critique ? - msgData.msg += `
Et provoque les dégats critiques suivants : [[/roll ${devotionSort.data.damagecritical}]]`; - formula = devotionSort.data.damagecritical; + if ( devotionSort.system.damage != "") { + let formula = devotionSort.system.damage; + if (myRoll.dice[0].results[0].result >= devotionSort.system.valuecritical ) { // Critique ? + msgData.msg += `
Et provoque les dégats critiques suivants : [[/roll ${devotionSort.system.damagecritical}]]`; + formula = devotionSort.system.damagecritical; } else { - msgData.msg += `
Et provoque les dégats suivants : [[/roll ${devotionSort.data.damage}]]`; + msgData.msg += `
Et provoque les dégats suivants : [[/roll ${devotionSort.system.damage}]]`; } } if ( newEnergie < 0) { @@ -184,7 +184,7 @@ export class VadentisActor extends Actor { msgData.msg = `${this.name} a échoué son lancer de ${name}`; } } - console.log(devotionSort.data.description, msgData); + console.log(devotionSort.system.description, msgData); ChatMessage.create({ //whisper: ChatUtility.getWhisperRecipientsAndGMs(game.user.name), content: await renderTemplate(`systems/foundryvtt-vadentis/templates/chat-generic-result.html`, msgData) @@ -193,7 +193,7 @@ export class VadentisActor extends Actor { /* -------------------------------------------- */ async rollDamage( weapon, damageType ) { - let formula = VadentisUtility.processDamageString( weapon.data.data[damageType], this ); + let formula = VadentisUtility.processDamageString( weapon.system.data[damageType], this ); let degatsRoll = await VadentisUtility.processRoll( formula ); let msgData = { alias: this.name, @@ -209,7 +209,7 @@ export class VadentisActor extends Actor { /* -------------------------------------------- */ async rollSortDevotionDamage( sort, damageType ) { - let formula = VadentisUtility.processDamageString( sort.data.data[damageType], this ); + let formula = VadentisUtility.processDamageString( sort.system.data[damageType], this ); let degatsRoll = await VadentisUtility.processRoll( formula ); let msgData = { alias: this.name, @@ -226,9 +226,9 @@ export class VadentisActor extends Actor { /* -------------------------------------------- */ async applyDamage( damageValue ) { - let pvData = this.data.data.stats.pointsvie; + let pvData = this.system.stats.pointsvie; let newValue = Math.max( pvData.value - damageValue, MIN_PV); - await this.update( {'data.stats.pointsvie.value': newValue }); + await this.update( {'system.stats.pointsvie.value': newValue }); let msgData = { alias: this.name, @@ -262,22 +262,22 @@ export class VadentisActor extends Actor { /* -------------------------------------------- */ getInitiativeScore( ) { - let initData = this.data.data.combat.initiative; + let initData = this.system.combat.initiative; return this._getCombatValue( initData); } /* -------------------------------------------- */ getDefenseScore( ) { - let defenseData = this.data.data.combat.defense; + let defenseData = this.system.combat.defense; return this._getCombatValue( defenseData); } /* -------------------------------------------- */ getForceScore( ) { - let forceData = this.data.data.combat.force; + let forceData = this.system.combat.force; return this._getCombatValue( forceData); } /* -------------------------------------------- */ getAttaqueScore( ) { - let attaqueData = this.data.data.combat.attaque; + let attaqueData = this.system.combat.attaque; return this._getCombatValue( attaqueData); } @@ -289,7 +289,7 @@ export class VadentisActor extends Actor { /* -------------------------------------------- */ async rollSort( sortId ) { - let sort = this.data.items.get( sortId ); + let sort = this.items.get( sortId ); if ( sort ) { sort = duplicate(sort) this.processSortDevotion( "sort", sort); @@ -298,7 +298,7 @@ export class VadentisActor extends Actor { /* -------------------------------------------- */ async rollDevotion( devotionId ) { - let devotion = this.data.items.get( devotionId ); + let devotion = this.items.get( devotionId ); if ( devotion ) { devotion = duplicate(devotion) this.processSortDevotion( "devotion", devotion); @@ -307,14 +307,14 @@ export class VadentisActor extends Actor { /* -------------------------------------------- */ rollSortOuDevotion( sortId ) { - let sort = this.data.items.get( sortId ); + let sort = this.items.get( sortId ); this.processSortDevotion( sort.type, sort); } /* -------------------------------------------- */ async rollTechnique( techniqueId ) { - let technique = this.data.items.get( techniqueId ) + let technique = this.items.get( techniqueId ) if (technique) { technique = duplicate(technique) let msgData = { @@ -322,13 +322,13 @@ export class VadentisActor extends Actor { img: technique.img, title: `Technique ${technique.name}` } - if ( this.data.data.stats.pointsadrenaline.value < technique.data.pacost) { // Vérification du ~ de points d'adrénaline + if ( this.system.stats.pointsadrenaline.value < technique.system.pacost) { // Vérification du ~ de points d'adrénaline msgData.msg = `${this.name} n'a pas assez de Points d'Adrénaline pour éxecuter sa technique ${technique.name}`; } else { - let newAdrenaline = this.data.data.stats.pointsadrenaline.value - technique.data.pacost; - await this.update( {'data.stats.pointsadrenaline.value': newAdrenaline }); - msgData.msg = `${this.name} execute sa technique ${technique.name}, pour un côut de ${technique.data.pacost} Points d'Adrénaline
- Les effets sont : ${technique.data.effect}`; + let newAdrenaline = this.system.stats.pointsadrenaline.value - technique.system.pacost; + await this.update( {'system.stats.pointsadrenaline.value': newAdrenaline }); + msgData.msg = `${this.name} execute sa technique ${technique.name}, pour un côut de ${technique.system.pacost} Points d'Adrénaline
+ Les effets sont : ${technique.system.effect}`; } ChatMessage.create({ //whisper: ChatUtility.getWhisperRecipientsAndGMs(game.user.name), @@ -342,7 +342,7 @@ export class VadentisActor extends Actor { /* -------------------------------------------- */ async rollCompetence( competenceId ) { console.log(competenceId) - let competence = this.data.items.get( competenceId); + let competence = this.items.get( competenceId); if ( competence) { competence = duplicate(competence) let msgData = { @@ -352,7 +352,7 @@ export class VadentisActor extends Actor { title: `Compétence ${competence.name}` } - let statValue = competence.data.base + competence.data.malus + competence.data.bonus; + let statValue = competence.system.base + competence.system.malus + competence.system.bonus; let formulaFull = this.buildTexteFormula( competence.data ); let myRoll = await VadentisUtility.processRoll("1d20+"+statValue, msgData.rollMode ); msgData.msg = `${formulaFull} => ${myRoll.total}`; @@ -410,74 +410,74 @@ export class VadentisActor extends Actor { /* -------------------------------------------- */ async rollCombat( combatName ) { - let stat = this.data.data.combat[combatName]; + let stat = this.system.combat[combatName]; this.genericRoll( stat, combatName ); } /* -------------------------------------------- */ rollMagie( magieName ) { - let stat = this.data.data.magie[magieName]; + let stat = this.system.magie[magieName]; this.genericRoll( stat, magieName ); } /* -------------------------------------------- */ async incrementeArgent( arme ) { - let monnaie = this.data.items.find( item => item.type == 'monnaie' && item.name == arme.name); + let monnaie = this.items.find( item => item.type == 'monnaie' && item.name == arme.name); if (monnaie) { monnaie = duplicate(monnaie) - let newValeur = monnaie.data.nombre + 1; - await this.updateEmbeddedDocuments( 'Item', [{ _id: monnaie._id, 'data.nombre': newValeur }] ); + let newValeur = monnaie.system.nombre + 1; + await this.updateEmbeddedDocuments( 'Item', [{ _id: monnaie._id, 'system.nombre': newValeur }] ); } } /* -------------------------------------------- */ async decrementeArgent( arme ) { - let monnaie = this.data.items.find( item => item.type == 'monnaie' && item.name == arme.name); + let monnaie = this.items.find( item => item.type == 'monnaie' && item.name == arme.name); if (monnaie) { monnaie = duplicate(monnaie) - let newValeur = monnaie.data.nombre - 1; + let newValeur = monnaie.system.nombre - 1; newValeur = (newValeur <= 0) ? 0 : newValeur; - await this.updateEmbeddedDocuments( "Item", [{ _id: monnaie._id, 'data.nombre': newValeur }] ); + await this.updateEmbeddedDocuments( "Item", [{ _id: monnaie._id, 'system.nombre': newValeur }] ); } } /* -------------------------------------------- */ async incrementeMunition( arme ) { - let armeTir = this.data.items.find( item => item.type == 'tir' && item.name == arme.name); + let armeTir = this.items.find( item => item.type == 'tir' && item.name == arme.name); if (armeTir) { armeTir = duplicate(armeTir) - let newMunition = armeTir.data.munition + 1; - await this.updateEmbeddedDocuments( "Item", [{ _id: armeTir._id, 'data.munition': newMunition }] ); + let newMunition = armeTir.system.munition + 1; + await this.updateEmbeddedDocuments( "Item", [{ _id: armeTir._id, 'system.munition': newMunition }] ); } } /* -------------------------------------------- */ async decrementeMunition( arme ) { - let armeTir = this.data.items.find( item => item.type == 'tir' && item.name == arme.name); + let armeTir = this.items.find( item => item.type == 'tir' && item.name == arme.name); if (armeTir) { armeTir = duplicate(armeTir) - let newMunition = armeTir.data.munition - 1; + let newMunition = armeTir.system.munition - 1; newMunition = (newMunition <= 0) ? 0 : newMunition; - await this.updateEmbeddedDocuments( "Item", [{ _id: armeTir._id, 'data.munition': newMunition } ]); + await this.updateEmbeddedDocuments( "Item", [{ _id: armeTir._id, 'system.munition': newMunition } ]); } } /* -------------------------------------------- */ async incrementeQuantite( objet ) { - let objetQ = this.data.items.find( item => item._id == objet._id ); + let objetQ = this.items.find( item => item._id == objet._id ); if (objetQ) { objetQ = duplicate(objetQ) - let newQ = objetQ.data.quantite + 1; - await this.updateEmbeddedDocuments( "Item", [{ _id: objetQ._id, 'data.quantite': newQ } ] ); + let newQ = objetQ.system.quantite + 1; + await this.updateEmbeddedDocuments( "Item", [{ _id: objetQ._id, 'system.quantite': newQ } ] ); } } /* -------------------------------------------- */ async decrementeQuantite( objet ) { - let objetQ = this.data.items.find( item => item._id == objet._id ); + let objetQ = this.items.find( item => item._id == objet._id ); if (objetQ) { objetQ = duplicate(objetQ) - let newQ = objetQ.data.quantite - 1; + let newQ = objetQ.system.quantite - 1; newQ = (newQ <= 0) ? 0 : newQ; - await this.updateEmbeddedDocuments( "Item", [{ _id: objetQ._id, 'data.quantite': newQ } ]); + await this.updateEmbeddedDocuments( "Item", [{ _id: objetQ._id, 'system.quantite': newQ } ]); } } @@ -486,10 +486,10 @@ export class VadentisActor extends Actor { let target = VadentisUtility.getTarget(); if ( target ) { - let arme = this.data.items.find( item => (item.type == 'armecc' || item.type == 'tir') && item.id == armeId); + let arme = this.items.find( item => (item.type == 'armecc' || item.type == 'tir') && item.id == armeId); if (arme) { arme = duplicate(arme) - if ( arme.type == 'tir' && arme.data.munition <= 0 ) { + if ( arme.type == 'tir' && arme.system.munition <= 0 ) { ui.notifications.warn("Vous n'avez plus de munitions avec cette arme."); return; } diff --git a/modules/vadentis-combat.js b/modules/vadentis-combat.js index b599d96..dd3972f 100644 --- a/modules/vadentis-combat.js +++ b/modules/vadentis-combat.js @@ -8,7 +8,7 @@ export class VadentisCombat extends Combat { console.log("Initiative is requested !!!"); ids = typeof ids === "string" ? [ids] : ids; - const currentId = this.combatant._id; + //const currentId = this.combatant.id; for (let cId = 0; cId < ids.length; cId++) { const c = this.combatants.get(ids[cId]); let initBonus = c.actor ? c.actor.getInitiativeScore() : 0; diff --git a/modules/vadentis-hud.js b/modules/vadentis-hud.js index 7b7bb5e..fb6eda1 100644 --- a/modules/vadentis-hud.js +++ b/modules/vadentis-hud.js @@ -22,24 +22,24 @@ export class VadentisTokenHud { let token = canvas.tokens.get(tokenId); let actor = token.actor; - let combatant = game.combat.data.combatants.find(c => c.tokenId == token.data._id); + //let combatant = game.combat.combatants.find(c => c.tokenId == token._id); app.hasExtension = true; - let armesList = combatant.actor.getArmes() ; - let sortsList = combatant.actor.getSorts().concat( combatant.actor.getDevotions() ); - const hudData = { combatant: combatant, armes: armesList, sorts: sortsList } + let armesList = actor.getArmes() ; + let sortsList = actor.getSorts().concat( actor.getDevotions() ); + const hudData = { actor: actor, armes: armesList, sorts: sortsList } // sort - await VadentisTokenHud._configureSubMenu(html.find('.control-icon.combat'), 'systems/foundryvtt-vadentis/templates/hud-actor-sort.html', hudData, + await VadentisTokenHud._configureSubMenu(html.find('.control-icon[data-action=combat]'), 'systems/foundryvtt-vadentis/templates/hud-actor-sort.html', hudData, (event) => { - let combatantId = event.currentTarget.attributes['data-combatant-id'].value; - const combatant = game.combat.getCombatant(combatantId); + let actorId = event.currentTarget.attributes['data-actor-id'].value; + const actor = game.actors.get(actorId); let sortId = event.currentTarget.attributes['data-sort-id'].value; - combatant.actor.rollSortOuDevotion( sortId ); + actor.rollSortOuDevotion( sortId ); }); // combat - await VadentisTokenHud._configureSubMenu(html.find('.control-icon.target'), 'systems/foundryvtt-vadentis/templates/hud-actor-attaque.html', hudData, + await VadentisTokenHud._configureSubMenu(html.find('.control-icon[data-action=target]'), 'systems/foundryvtt-vadentis/templates/hud-actor-attaque.html', hudData, (event) => { let armeId = event.currentTarget.attributes['data-arme-id'].value; actor.rollArme(armeId); @@ -49,7 +49,7 @@ export class VadentisTokenHud { /* -------------------------------------------- */ static async addTokenHudExtensions(app, html, tokenId) { - html.find('.control-icon.combat').click(event => { + html.find('.control-icon[data-action=combat]').click(event => { if ( event.currentTarget.className.includes('active')) { VadentisTokenHud.removeExtensionHud( app, html, tokenId); } else { @@ -57,9 +57,9 @@ export class VadentisTokenHud { } } ); - let combatIcon = html.find('.control-icon.combat'); + let combatIcon = html.find('.control-icon[data-action=combat]'); //console.log("COMBAT ICON", combatIcon) - if ( combatIcon[0] && combatIcon[0].className.includes('active') ) { + if ( combatIcon[0]?.className.includes('active') ) { VadentisTokenHud.addExtensionHud( app, html, tokenId); } } diff --git a/modules/vadentis-item-sheet.js b/modules/vadentis-item-sheet.js index 29aa65a..468acda 100644 --- a/modules/vadentis-item-sheet.js +++ b/modules/vadentis-item-sheet.js @@ -43,27 +43,38 @@ export class VadentisItemSheet extends ItemSheet { /* -------------------------------------------- */ async getData() { - const objectData = VadentisUtility.data(this.object); - let itemData = foundry.utils.deepClone(VadentisUtility.templateData(this.object)); + let itemData = foundry.utils.deepClone(this.object.system); let formData = { title: this.title, id: this.id, - type: objectData.type, - img: objectData.img, - name: objectData.name, + type: this.object.type, + img: this.object.img, + name: this.object.name, editable: this.isEditable, cssClass: this.isEditable ? "editable" : "locked", data: itemData, limited: this.object.limited, options: this.options, owner: this.document.isOwner, - isGM: game.user.isGM + isGM: game.user.isGM, } - if (objectData.type == 'sort') { + if (itemData.description) { + formData.description = await TextEditor.enrichHTML(this.object.system.description, { async: true }) + } + if (itemData.notes) { + formData.notes = await TextEditor.enrichHTML(this.object.system.notes, { async: true }) + } + if (itemData.effect) { + formData.effect = await TextEditor.enrichHTML(this.object.system.effect, { async: true }) + } + if (itemData.criticaleffect) { + formData.criticaleffect = await TextEditor.enrichHTML(this.object.system.criticaleffect, { async: true }) + } + if (this.object.type == 'sort') { formData.donnees = await VadentisUtility.getDonnees(); } - if (objectData.type == 'devotion') { + if (this.object.type == 'devotion') { formData.eglises = await VadentisUtility.getEglises(); } diff --git a/modules/vadentis-utility.js b/modules/vadentis-utility.js index 2a43a7e..a778ebf 100644 --- a/modules/vadentis-utility.js +++ b/modules/vadentis-utility.js @@ -19,9 +19,9 @@ export class VadentisUtility { /* -------------------------------------------- */ static updateCombat( combat, round, diff, id ) { - if (game.user.isGM && combat.data.round != 0 && combat.turns && combat.data.active) { + 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.data.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); @@ -46,6 +46,14 @@ export class VadentisUtility { return options; } /* -------------------------------------------- */ + static createDirectIntegerOptionList( min, max) { + let options = {}; + for(let i=min; i<=max; i++) { + options[i] = `${i}`; + } + return options; + } + /* -------------------------------------------- */ static createDirectReverseOptionList( min, max) { let options = {}; for(let i=max; i>=min; i--) { @@ -64,19 +72,6 @@ export class VadentisUtility { return undefined; } - /* -------------------------------------------- */ - static templateData(it) { - return VadentisUtility.data(it)?.data ?? {} - } - - /* -------------------------------------------- */ - static data(it) { - if (it instanceof Actor || it instanceof Item || it instanceof Combatant) { - return it.data; - } - return it; - } - /* -------------------------------------------- */ static processDamageString( formula, actor ) { let workFormula = formula.toLowerCase(); @@ -90,7 +85,7 @@ export class VadentisUtility { static async processRoll( formula, rollMode ) { let myRoll = new Roll(formula); myRoll.roll( { async: false} ); - if (game.modules.get("dice-so-nice") && game.modules.get("dice-so-nice").active) { + if (game.modules.get("dice-so-nice")?.active) { await game.dice3d.showForRoll(myRoll, game.user, true); } return myRoll; @@ -117,17 +112,17 @@ export class VadentisUtility { } let formulaTouche = "1d20+"+attaque; - let formulaFull = attacker.buildTexteFormula( attacker.data.data.combat.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.data.damage}`; - let formula = combatData.arme.data.damage.toLowerCase(); + 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.data.valuecritical ) { - degats = `critiques : ${combatData.arme.data.criticaldamage}`; - formula = combatData.arme.data.criticaldamage.toLowerCase(); + 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' diff --git a/styles/simple.css b/styles/simple.css index 4fbf4c8..54c9887 100644 --- a/styles/simple.css +++ b/styles/simple.css @@ -398,19 +398,19 @@ table {border: 1px solid #7a7971;} /* ======================================== */ /* Sheet */ .window-app.sheet .window-content .sheet-header{ - background: #011d33 url("../images/ui/texture_feuille_perso_onglets.webp") no-repeat left top; + /*background: #011d33 url("../images/ui/texture_feuille_perso_onglets.webp") no-repeat left top;*/ color: rgba(255, 255, 255, 1); } .window-app.sheet .window-content .sheet-header input[type="text"], .window-app.sheet .window-content .sheet-header input[type="number"], .window-app.sheet .window-content .sheet-header input[type="password"], .window-app.sheet .window-content .sheet-header input[type="date"], .window-app.sheet .window-content .sheet-header input[type="time"] { - color: rgba(255, 255, 255, 0.75); + /*color: rgba(255, 255, 255, 0.75);*/ background: rgba(255, 255, 255, 0.05); border: 0 none; margin-bottom: 0.25rem; } .window-app .window-content, .window-app.sheet .window-content .sheet-body{ - background: rgb(245,245,240) url("../images/ui/texture_feuille_perso_principale.webp") no-repeat left top; + /*background: rgb(245,245,240) url("../images/ui/texture_feuille_perso_principale.webp") no-repeat left top;*/ } section.sheet-body{padding: 0.25rem 0.5rem;} @@ -431,7 +431,8 @@ section.sheet-body{padding: 0.25rem 0.5rem;} padding: 0 0 0 0.25rem; text-align: center; text-transform: uppercase; - line-height: 2.5rem; + line-height: 1.5rem; + max-height: 2.0rem; border-top: 0 none; border-bottom: 0 none; color: rgba(52, 52, 52, 0.95); @@ -895,7 +896,7 @@ ul, li { border-radius: 0; background: rgba(30, 25, 20, 1); background-origin: padding-box; - border-image: url(img/ui/footer-button.png) 10 repeat; + /*border-image: url(img/ui/footer-button.png) 10 repeat;*/ border-image-width: 4px; border-image-outset: 0px; } @@ -903,7 +904,7 @@ ul, li { #controls .scene-control.active, #controls .control-tool.active, #controls .scene-control:hover, #controls .control-tool:hover { background: rgba(72, 46, 28, 1); background-origin: padding-box; - border-image: url(img/ui/footer-button.png) 10 repeat; + /*border-image: url(img/ui/footer-button.png) 10 repeat;*/ border-image-width: 4px; border-image-outset: 0px; box-shadow: 0 0 3px #ff6400; @@ -915,7 +916,7 @@ ul, li { } #hotbar #action-bar .macro { - border-image: url(img/ui/bg_control.jpg) 21 repeat; + /*border-image: url(img/ui/bg_control.jpg) 21 repeat;*/ border-image-slice: 6 6 6 6 fill; border-image-width: 6px 6px 6px 6px; border-image-outset: 0px 0px 0px 0px; @@ -928,7 +929,7 @@ ul, li { } #players { - border-image: url(img/ui/footer-button.png) 10 repeat; + /*border-image: url(img/ui/footer-button.png) 10 repeat;*/ border-image-width: 4px; border-image-outset: 0px; background: rgba(30, 25, 20, 1); @@ -941,7 +942,7 @@ ul, li { #navigation #scene-list .scene.nav-item { background: rgba(30, 25, 20, 1); background-origin: padding-box; - border-image: url(img/ui/footer-button.png) 10 repeat; + /*border-image: url(img/ui/footer-button.png) 10 repeat;*/ border-image-width: 4px; border-image-outset: 0px; } @@ -949,7 +950,7 @@ ul, li { #navigation #scene-list .scene.view, #navigation #scene-list .scene.context { background: rgba(72, 46, 28, 1); background-origin: padding-box; - border-image: url(img/ui/footer-button.png) 10 repeat; + /*border-image: url(img/ui/footer-button.png) 10 repeat;*/ border-image-width: 4px; border-image-outset: 0px; box-shadow: 0 0 3px #ff6400; @@ -958,7 +959,7 @@ ul, li { #navigation #nav-toggle { background: rgba(30, 25, 20, 1); background-origin: padding-box; - border-image: url(img/ui/footer-button.png) 10 repeat; + /*border-image: url(img/ui/footer-button.png) 10 repeat;*/ border-image-width: 4px; border-image-outset: 0px; } @@ -987,9 +988,8 @@ ul, li { .tooltip .ttt-fatigue{ width: 360px; - background: rgba(30, 25, 20, 0.9); - border-image: url(img/ui/bg_control.jpg) 21 repeat; + /*border-image: url(img/ui/bg_control.jpg) 21 repeat;*/ border-image-slice: 6 6 6 6 fill; border-image-width: 6px 6px 6px 6px; border-image-outset: 0px 0px 0px 0px; @@ -1075,6 +1075,17 @@ ul, li { font-weight: bold; } +.field-medium { + width: 8rem; + max-width: 8rem; +} +.item-filler { + flex-grow: 2; + flex-shrink: 3; +} + + + /*************************************************************/ #pause { diff --git a/system.json b/system.json index e29999f..441b6ae 100644 --- a/system.json +++ b/system.json @@ -1,16 +1,21 @@ { - "name": "foundryvtt-vadentis", + "id": "foundryvtt-vadentis", "title": "Vadentis", "description": "Système Vadentis pour FoundryVTT", - "version": "0.3.2", - "manifestPlusVersion": "1.0.0", - "minimumCoreVersion": "0.8.9", - "compatibleCoreVersion": "9", - "templateVersion": 17, - "author": "Uberwald", + "version": "11.0.0", + "compatibility": { + "minimum": "11", + "verified": "12" + }, + "authors": [ + { + "name": "Uberwald", + "flags": {} + } + ], "esmodules": [ "modules/vadentis-main.js" ], "styles": ["styles/simple.css"], - "background" : "images/ui/vadentis_map.webp", + "background" : "systems/foundryvtt-vadentis/images/ui/vadentis_map.webp", "media": [ ], "packs": [ @@ -20,7 +25,7 @@ "system": "foundryvtt-vadentis", "module": "foundryvtt-vadentis", "path": "./packs/eglises.db", - "entity": "Item", + "type": "Item", "tags" : [ "eglise" ] }, { @@ -29,7 +34,7 @@ "system": "foundryvtt-vadentis", "module": "foundryvtt-vadentis", "path": "./packs/donnees.db", - "entity": "Item", + "type": "Item", "tags" : [ "données", "donnee" ] }, { @@ -38,7 +43,7 @@ "system": "foundryvtt-vadentis", "module": "foundryvtt-vadentis", "path": "./packs/techniques.db", - "entity": "Item", + "type": "Item", "tags" : [ "technique" ] }, { @@ -47,7 +52,7 @@ "system": "foundryvtt-vadentis", "module": "foundryvtt-vadentis", "path": "./packs/attributs.db", - "entity": "Item", + "type": "Item", "tags" : [ "attribut" ] }, { @@ -56,7 +61,7 @@ "system": "foundryvtt-vadentis", "module": "foundryvtt-vadentis", "path": "./packs/competences.db", - "entity": "Item", + "type": "Item", "tags" : [ "competence" ] }, { @@ -65,7 +70,7 @@ "system": "foundryvtt-vadentis", "module": "foundryvtt-vadentis", "path": "./packs/equipement-armes-de-corps-a-corps.db", - "entity": "Item", + "type": "Item", "tags" : [ "armes", "corps à corps", "mêlée" ] }, { @@ -74,7 +79,7 @@ "system": "foundryvtt-vadentis", "module": "foundryvtt-vadentis", "path": "./packs/equipement-armes-de-tirs.db", - "entity": "Item", + "type": "Item", "tags" : [ "armes", "tir" ] }, { @@ -83,7 +88,7 @@ "system": "foundryvtt-vadentis", "module": "foundryvtt-vadentis", "path": "./packs/equipement-armures.db", - "entity": "Item", + "type": "Item", "tags" : [ "armure" ] }, { @@ -92,7 +97,7 @@ "system": "foundryvtt-vadentis", "module": "foundryvtt-vadentis", "path": "./packs/equipement-boucliers.db", - "entity": "Item", + "type": "Item", "tags" : [ "bouclier" ] }, { @@ -101,7 +106,7 @@ "system": "foundryvtt-vadentis", "module": "foundryvtt-vadentis", "path": "./packs/equipement-materiel.db", - "entity": "Item", + "type": "Item", "tags" : [ "materiel", "equipement" ] }, { @@ -110,7 +115,7 @@ "system": "foundryvtt-vadentis", "module": "foundryvtt-vadentis", "path": "./packs/sorts-deglises-eglise-des-26.db", - "entity": "Item", + "type": "Item", "tags" : [ "sort", "eglise des 26", "26" ] }, { @@ -119,7 +124,7 @@ "system": "foundryvtt-vadentis", "module": "foundryvtt-vadentis", "path": "./packs/sorts-deglises-eglise-des-ombres.db", - "entity": "Item", + "type": "Item", "tags" : [ "sort", "eglise des ombres", "ombres" ] }, { @@ -128,7 +133,7 @@ "system": "foundryvtt-vadentis", "module": "foundryvtt-vadentis", "path": "./packs/sorts-deglises-eglise-du-soleil.db", - "entity": "Item", + "type": "Item", "tags" : [ "sort", "eglise du soleil", "soleil" ] }, { @@ -137,7 +142,7 @@ "system": "foundryvtt-vadentis", "module": "foundryvtt-vadentis", "path": "./packs/sorts-deglises-eglise-du-temps.db", - "entity": "Item", + "type": "Item", "tags" : [ "sort", "eglise du temps", "temps" ] }, { @@ -146,7 +151,7 @@ "system": "foundryvtt-vadentis", "module": "foundryvtt-vadentis", "path": "./packs/sorts-deglises-eglise-estuanienne.db", - "entity": "Item", + "type": "Item", "tags" : [ "sort", "eglise estuanienne", "estuanienne" ] }, { @@ -155,7 +160,7 @@ "system": "foundryvtt-vadentis", "module": "foundryvtt-vadentis", "path": "./packs/sorts-elementaires-donnee-de-la-foudre.db", - "entity": "Item", + "type": "Item", "tags" : [ "sort", "foudre" ] }, { @@ -164,7 +169,7 @@ "system": "foundryvtt-vadentis", "module": "foundryvtt-vadentis", "path": "./packs/sorts-elementaires-donnee-de-la-lumiere.db", - "entity": "Item", + "type": "Item", "tags" : [ "sort", "lumiere" ] }, { @@ -173,7 +178,7 @@ "system": "foundryvtt-vadentis", "module": "foundryvtt-vadentis", "path": "./packs/sorts-elementaires-donnee-de-la-terre.db", - "entity": "Item", + "type": "Item", "tags" : [ "sort", "terre" ] }, { @@ -182,7 +187,7 @@ "system": "foundryvtt-vadentis", "module": "foundryvtt-vadentis", "path": "./packs/sorts-elementaires-donnee-de-leau.db", - "entity": "Item", + "type": "Item", "tags" : [ "sort", "eau" ] }, { @@ -191,7 +196,7 @@ "system": "foundryvtt-vadentis", "module": "foundryvtt-vadentis", "path": "./packs/sorts-elementaires-donnee-du-feu.db", - "entity": "Item", + "type": "Item", "tags" : [ "sort", "feu" ] }, { @@ -200,11 +205,10 @@ "system": "foundryvtt-vadentis", "module": "foundryvtt-vadentis", "path": "./packs/sorts-elementaires-donnee-du-vent.db", - "entity": "Item", + "type": "Item", "tags" : [ "sort", "vent" ] } ], - "library": false, "languages": [ { "lang": "fr", diff --git a/template.json b/template.json index 175d883..1e3d3e5 100644 --- a/template.json +++ b/template.json @@ -52,11 +52,11 @@ "bonus": 0, "label": "Défense" }, - "esquive": { + "vitesse": { "base": 0, "malus": 0, "bonus": 0, - "label": "Esquive" + "label": "Vitesse" } }, "magie": { diff --git a/templates/actor-sheet.html b/templates/actor-sheet.html index 34b85ca..d5b61a1 100644 --- a/templates/actor-sheet.html +++ b/templates/actor-sheet.html @@ -71,12 +71,12 @@
  • Points de Vie - {{#select data.stats.pointsvie.value}} {{{@root.optionsPV}}} {{/select}} - {{#select data.stats.pointsvie.max}} {{{@root.optionsPV}}} {{/select}} @@ -85,12 +85,12 @@
  • Points d'Energie - {{#select data.stats.pointsenergie.value}} {{{@root.optionsPE}}} {{/select}} - {{#select data.stats.pointsenergie.max}} {{{@root.optionsPE}}} {{/select}} @@ -99,12 +99,12 @@
  • Points d'Adrénaline - {{#select data.stats.pointsadrenaline.value}} {{{@root.optionsPA}}} {{/select}} - {{#select data.stats.pointsadrenaline.max}} {{{@root.optionsPA}}} {{/select}} @@ -116,7 +116,7 @@
  • Expérience - +
  • @@ -131,20 +131,24 @@ Score {{#each data.combat as |mycombat key|}} + {{#if (eq mycombat.label "Esquive")}} + + {{else}}
  • - {{mycombat.label}} - {{selectOptions @root.optionsBase selected=mycombat.base localize=false}} - {{selectOptions @root.optionsMalus selected=mycombat.malus localize=false}} - {{selectOptions @root.optionsBonus selected=mycombat.bonus localize=false}}  1d20 + {{mycombat.total}}
  • + {{/if}} {{/each}}

    Magie

    @@ -159,14 +163,14 @@ {{#each data.magie as |mymagie key|}}
  • - {{mymagie.label}} - {{selectOptions @root.optionsBase selected=mymagie.base localize=false}} - {{selectOptions @root.optionsMalus selected=mymagie.malus localize=false}} - {{selectOptions @root.optionsBonus selected=mymagie.bonus localize=false}}  1d20 + {{mymagie.total}} @@ -192,7 +196,6 @@
  • Compétence - Rôle? Base Malus Bonus @@ -202,15 +205,14 @@
  • {{competence.name}} - {{#if competence.data.competencerole}}{{else}}{{/if}}
    @@ -265,7 +267,7 @@
  • {{#each data.combat as |mycombat key|}}
  • - {{mycombat.label}} + {{mycombat.label}}  {{mycombat.base}}  {{mycombat.malus}}  {{mycombat.bonus}} @@ -276,11 +278,11 @@

    Armes équipées