diff --git a/module/actor.js b/module/actor.js index b9afa2b3..12a0a899 100644 --- a/module/actor.js +++ b/module/actor.js @@ -30,6 +30,7 @@ import { Monnaie } from "./item-monnaie.js"; import { DialogConsommer } from "./dialog-item-consommer.js"; import { DialogFabriquerPotion } from "./dialog-fabriquer-potion.js"; import { RollDataAjustements } from "./rolldata-ajustements.js"; +import { DialogItemAchat } from "./dialog-item-achat.js"; /* -------------------------------------------- */ @@ -1940,7 +1941,7 @@ export class RdDActor extends Actor { const itemData = Misc.data(item); const exotisme = Math.min(itemData.data.exotisme, itemData.data.qualite, 0); if (exotisme < 0) { - const rolled = await this.rollCaracCompetence('volonte', 'cuisine', exotisme, { title: `surmonte l'exotisme de ${itemData.name}` }); + const rolled = await this.rollCaracCompetence('volonte', 'cuisine', exotisme, { title: `tente de surmonter l'exotisme de ${itemData.name}` }); if (rolled.isEchec) { if (!choix.seForcer) { return false; @@ -3511,61 +3512,61 @@ export class RdDActor extends Actor { } /* -------------------------------------------- */ - async achatVente(vendeurId, acheteurId, venteData, chatMessageIdVente) { - if (vendeurId == acheteurId) { + async achatVente(achat) { + if (achat.vendeurId == achat.acheteurId) { ui.notifications.info("Inutile de se vendre à soi-même"); return; } if (!Misc.isElectedUser()) { RdDActor.remoteActorCall({ - actorId: vendeurId ?? acheteurId, - method: 'achatVente', args: [vendeurId, acheteurId, venteData, chatMessageIdVente] + actorId: achat.vendeurId ?? achat.acheteurId, + method: 'achatVente', args: [achat] }); return; } - const acheteur = acheteurId ? game.actors.get(acheteurId) : undefined; - const vendeur = vendeurId ? game.actors.get(vendeurId) : undefined; - const itemId = venteData.item._id; + const acheteur = achat.acheteurId ? game.actors.get(achat.acheteurId) : undefined; + const vendeur = achat.vendeurId ? game.actors.get(achat.vendeurId) : undefined; + const messageVente = game.messages.get(achat.chatMessageIdVente); + const html = await messageVente.getHTML(); + const buttonAcheter = html.find(".button-acheter")[0]; + const vente = DialogItemAchat.prepareVenteData(buttonAcheter, achat.vendeurId, vendeur, acheteur); + const itemId = vente.item._id; - const coutDeniers = Math.floor((venteData.prixTotal ?? 0) * 100); - venteData.quantiteTotal = (venteData.nombreLots ?? 1) * (venteData.tailleLot); + const coutDeniers = Math.floor((achat.prixTotal ?? 0) * 100); + achat.quantiteTotal = (achat.nombreLots ?? 1) * (vente.tailleLot); if (acheteur) { let resteAcheteur = await acheteur.depenser(coutDeniers); if (resteAcheteur < 0) { - ui.notifications.warn(`Vous n'avez pas assez d'argent pour payer ${venteData.prixTotal} sols !`); + ui.notifications.warn(`Vous n'avez pas assez d'argent pour payer ${vente.prixTotal} sols !`); return; } } if (vendeur) { - let itemData = Misc.data(vendeur.getObjet(itemId)); - // diminuer QuantiteVendeur - if ("quantite" in itemData.data ? - itemData.data.quantite < venteData.quantiteTotal : venteData.nombreLots != 1) { - // pas assez de quantite + let itemVenduData = Misc.data(vendeur.getObjet(itemId)); + if ("quantite" in itemVenduData.data ? itemVenduData.data.quantite < achat.quantiteTotal : achat.nombreLots != 1) { await acheteur?.ajouterDeniers(coutDeniers); - ui.notifications.warn(`Le vendeur n'a plus assez de ${venteData.item.name} !`); + ui.notifications.warn(`Le vendeur n'a plus assez de ${vente.item.name} !`); return; } vendeur.ajouterDeniers(coutDeniers); - let qtReste = (itemData.data.quantite ?? 1) - venteData.quantiteTotal; - if (qtReste == 0) { + let resteQuantite = (itemVenduData.data.quantite ?? 1) - achat.quantiteTotal; + if (resteQuantite == 0) { vendeur.deleteEmbeddedDocuments("Item", itemId); } else { - vendeur.updateEmbeddedDocuments("Item", [{ _id: itemId, 'data.quantite': qtReste }]); + vendeur.updateEmbeddedDocuments("Item", [{ _id: itemId, 'data.quantite': resteQuantite }]); } } - if (acheteur) { - const achat = { - type: venteData.item.type, - img: venteData.item.img, - name: venteData.item.name, - data: venteData.item.data + const achatData = { + type: vente.item.type, + img: vente.item.img, + name: vente.item.name, + data: vente.item.data } - achat.data.quantite = venteData.quantiteTotal; - await acheteur.createEmbeddedDocuments("Item", [achat]); + achatData.data.quantite = achat.quantiteTotal; + await acheteur.createEmbeddedDocuments("Item", [achatData]); } if (coutDeniers > 0) { RdDAudio.PlayContextAudio("argent"); @@ -3573,19 +3574,16 @@ export class RdDActor extends Actor { ChatMessage.create({ whisper: ChatUtility.getWhisperRecipientsAndGMs(this.name), - content: await renderTemplate('systems/foundryvtt-reve-de-dragon/templates/chat-achat-item.html', venteData) + content: await renderTemplate('systems/foundryvtt-reve-de-dragon/templates/chat-achat-item.html', vente) }); - if (!venteData.quantiteIllimite) { - if (venteData.quantiteNbLots <= venteData.nombreLots) { + if (!vente.quantiteIllimite) { + if (vente.quantiteNbLots <= achat.nombreLots) { ChatUtility.removeChatMessageId(chatMessageIdVente); } else { - venteData.quantiteNbLots -= venteData.nombreLots; - venteData.jsondata = JSON.stringify(venteData.item); - let newMessageVente = await renderTemplate('systems/foundryvtt-reve-de-dragon/templates/chat-vente-item.html', venteData); - const messageVente = game.messages.get(chatMessageIdVente); - messageVente.update({ content: newMessageVente }); + vente.quantiteNbLots -= achat.nombreLots; + messageVente.update({ content: await renderTemplate('systems/foundryvtt-reve-de-dragon/templates/chat-vente-item.html', vente) }); messageVente.render(true); } } @@ -4081,7 +4079,7 @@ export class RdDActor extends Actor { if (Misc.isElectedUser()) { let draconique = Draconique.all().find(it => it.isCase(item)); if (draconique) { - draconique.onActorDeleteCaseTmr(this, item) + draconique.onActorDeleteCaseTmr(this, Misc.data(item)) } } } diff --git a/module/dialog-create-signedraconique.js b/module/dialog-create-signedraconique.js index c2ba0a14..acbcc916 100644 --- a/module/dialog-create-signedraconique.js +++ b/module/dialog-create-signedraconique.js @@ -39,6 +39,8 @@ export class DialogCreateSigneDraconique extends Dialog { } async _onCreerSigneActeurs() { + await $("[name='signe.data.ephemere']").change(); + await $(".signe-xp-sort").change(); this.validerSigne(); this.dialogData.actors.filter(it => it.selected).map(it => game.actors.get(it._id)) .forEach(actor => this._createSigneForActor(actor, this.dialogData.signe)); @@ -75,6 +77,7 @@ export class DialogCreateSigneDraconique extends Dialog { html.find(".select-actor").change((event) => this.onSelectActor(event)); html.find(".signe-xp-sort").change((event) => this.onValeurXpSort(event)); } + async setSigneAleatoire() { const newSigne = await RdDItemSigneDraconique.randomSigneDraconique({ephemere: true}); diff --git a/module/dialog-fabriquer-potion.js b/module/dialog-fabriquer-potion.js index c6b2096b..c23287aa 100644 --- a/module/dialog-fabriquer-potion.js +++ b/module/dialog-fabriquer-potion.js @@ -25,8 +25,8 @@ export class DialogFabriquerPotion extends Dialog { /* -------------------------------------------- */ static prepareData(actor, item) { let potionData = duplicate(Misc.data(item)); - potionData.nbBrinsSelect = RdDUtility.buildListOptions( 1, potionData.data.quantite); - potionData.nbBrins = potionData.data.quantite; + potionData.nbBrinsSelect = RdDUtility.buildListOptions(1, potionData.data.quantite); + potionData.nbBrins = Math.min(potionData.data.quantite, DialogFabriquerPotion.getNombreBrinOptimal(potionData)); potionData.buttonName = "Fabriquer"; return potionData; } @@ -35,9 +35,7 @@ export class DialogFabriquerPotion extends Dialog { constructor(actor, potionData, conf, options) { conf.buttons = { [potionData.buttonName]: { - label: potionData.buttonName, callback: it => { - this.fabriquer(); - } + label: potionData.buttonName, callback: it => this.onFabriquer(it) } }; @@ -47,18 +45,27 @@ export class DialogFabriquerPotion extends Dialog { this.potionData = potionData; } + static getNombreBrinOptimal(herbeData) { + switch (herbeData.data.categorie ?? '') { + case "Soin": return 12 - herbeData.data.niveau; + case "Repos": return 7 - herbeData.data.niveau; + } + return 1; + } + /* -------------------------------------------- */ activateListeners(html) { super.activateListeners(html); html.find("#nbBrins").change(event => { - this.potionData.nbBrins = Misc.toInt(event.currentTarget.value); + this.potionData.nbBrins = Misc.toInt(event.currentTarget.value); }); } /* -------------------------------------------- */ - async fabriquer() { - this.actor.fabriquerPotion( this.potionData ); + async onFabriquer(it) { + await $("#nbBrins").change(); + this.actor.fabriquerPotion(this.potionData); this.close(); } } \ No newline at end of file diff --git a/module/dialog-item-achat.js b/module/dialog-item-achat.js index ae1f0e5e..7a7079cf 100644 --- a/module/dialog-item-achat.js +++ b/module/dialog-item-achat.js @@ -1,17 +1,18 @@ -import { RdDActor } from "./actor.js"; -import { HtmlUtility } from "./html-utility.js"; + import { Misc } from "./misc.js"; import { RdDUtility } from "./rdd-utility.js"; export class DialogItemAchat extends Dialog { static async onButtonAcheter(event) { - let jsondata = event.currentTarget.attributes['data-jsondata']?.value; - if (!jsondata) { + const buttonAcheter = event.currentTarget; + if (!buttonAcheter.attributes['data-jsondata']?.value) { ui.notifications.warn("Impossible d'acheter: informations sur l'objet manquantes") return; } - const vendeurId = event.currentTarget.attributes['data-vendeurId']?.value; + const chatMessageIdVente = RdDUtility.findChatMessageId(buttonAcheter); + + const vendeurId = buttonAcheter.attributes['data-vendeurId']?.value; const vendeur = vendeurId ? game.actors.get(vendeurId) : undefined; const acheteur = RdDUtility.getSelectedActor(); @@ -20,22 +21,7 @@ export class DialogItemAchat extends Dialog { return; } - const chatMessageIdVente = RdDUtility.findChatMessageId(event.currentTarget); - const itemData = JSON.parse(jsondata); - const prixLot = event.currentTarget.attributes['data-prixLot']?.value ?? 0; - let venteData = { - item: itemData, - vendeurId: vendeurId, - vendeur: Misc.data(vendeur), - acheteur: Misc.data(acheteur), - tailleLot: event.currentTarget.attributes['data-tailleLot']?.value ?? 1, - quantiteIllimite : event.currentTarget.attributes['data-quantiteIllimite']?.value == 'true', - quantiteNbLots: event.currentTarget.attributes['data-quantiteNbLots']?.value, - nombreLots: 1, - prixLot: prixLot, - prixTotal: prixLot, - isVente: prixLot > 0 - }; + let venteData = DialogItemAchat.prepareVenteData(buttonAcheter, vendeurId, vendeur, acheteur); const html = await renderTemplate(`systems/foundryvtt-reve-de-dragon/templates/dialog-item-achat.html`, venteData); const dialog = new DialogItemAchat(html, vendeur, acheteur, venteData, chatMessageIdVente); dialog.render(true); @@ -63,13 +49,34 @@ export class DialogItemAchat extends Dialog { this.venteData = venteData; } + static prepareVenteData(buttonAcheter, vendeurId, vendeur, acheteur) { + const jsondata = buttonAcheter.attributes['data-jsondata']?.value; + const prixLot = buttonAcheter.attributes['data-prixLot']?.value ?? 0; + let venteData = { + item: JSON.parse(jsondata), + vendeurId: vendeurId, + vendeur: Misc.data(vendeur), + acheteur: Misc.data(acheteur), + tailleLot: parseInt(buttonAcheter.attributes['data-tailleLot']?.value ?? 1), + quantiteIllimite: buttonAcheter.attributes['data-quantiteIllimite']?.value == 'true', + quantiteNbLots: parseInt(buttonAcheter.attributes['data-quantiteNbLots']?.value), + nombreLots: 1, + prixLot: prixLot, + prixTotal: prixLot, + isVente: prixLot > 0 + }; + return venteData; + } + async onAchat() { - (this.vendeur ?? this.acheteur).achatVente( - this.vendeur?.id, - this.acheteur?.id, - this.venteData, - this.chatMessageIdVente - ); + await $(".nombreLots").change(); + (this.vendeur ?? this.acheteur).achatVente({ + vendeurId: this.vendeur?.id, + acheteurId: this.acheteur?.id, + nombreLots: this.venteData.nombreLots, + prixTotal: this.venteData.prixTotal, + chatMessageIdVente: this.chatMessageIdVente + }); } /* -------------------------------------------- */ diff --git a/module/dialog-item-consommer.js b/module/dialog-item-consommer.js index 07b12a6c..3a33072a 100644 --- a/module/dialog-item-consommer.js +++ b/module/dialog-item-consommer.js @@ -17,9 +17,7 @@ export class DialogConsommer extends Dialog { default: consommerData.buttonName, buttons: { [consommerData.buttonName]: { - label: consommerData.buttonName, callback: it => { - this.actor.consommer(this.item, this.consommerData.choix); - } + label: consommerData.buttonName, callback: it => this.onConsommer(it) } } }; @@ -31,6 +29,12 @@ export class DialogConsommer extends Dialog { this.consommerData = consommerData; } + async onConsommer(event) { + await $(".se-forcer").change(); + await $(".consommer-doses").change(); + this.actor.consommer(this.item, this.consommerData.choix); + } + /* -------------------------------------------- */ static prepareData(actor, item, options) { const itemData = duplicate(Misc.data(item)); @@ -68,15 +72,19 @@ export class DialogConsommer extends Dialog { /* -------------------------------------------- */ activateListeners(html) { super.activateListeners(html); - html.find(".se-forcer").change(event => { - this.consommerData.choix.seForcer = event.currentTarget.checked; - }); - html.find(".consommer-doses").change(event => { - this.consommerData.choix.doses = Number(event.currentTarget.value); - DialogConsommer.calculDoses(this.consommerData); - $(".total-sust").text(this.consommerData.totalSust) - $(".total-desaltere").text(this.consommerData.totalDesaltere) - }); + html.find(".se-forcer").change(event => this.setSeForcer(event)); + html.find(".consommer-doses").change(event => this.selectDoses(event)); } + + setSeForcer(event) { + this.consommerData.choix.seForcer = event.currentTarget.checked; + } + + selectDoses(event) { + this.consommerData.choix.doses = Number(event.currentTarget.value); + DialogConsommer.calculDoses(this.consommerData); + $(".total-sust").text(this.consommerData.totalSust); + $(".total-desaltere").text(this.consommerData.totalDesaltere); + } } \ No newline at end of file diff --git a/module/dialog-item-vente.js b/module/dialog-item-vente.js index 0354c884..a0a5dcf4 100644 --- a/module/dialog-item-vente.js +++ b/module/dialog-item-vente.js @@ -30,7 +30,7 @@ export class DialogItemVente extends Dialog { title: "Proposer", content: html, default: "proposer", - buttons: { "proposer": { label: "Proposer", callback: it => { this.onProposer(); } } } + buttons: { "proposer": { label: "Proposer", callback: it => { this.onProposer(it); } } } }; super(conf, options); @@ -38,7 +38,11 @@ export class DialogItemVente extends Dialog { this.venteData = venteData; } - async onProposer() { + async onProposer(it) { + await $(".tailleLot").change(); + await $(".quantiteNbLots").change(); + await $(".quantiteIllimite").change(); + await $(".prixLot").change(); this.callback(this.venteData); } diff --git a/module/dialog-split-item.js b/module/dialog-split-item.js index a3521493..1f3fe253 100644 --- a/module/dialog-split-item.js +++ b/module/dialog-split-item.js @@ -36,6 +36,7 @@ export class DialogSplitItem extends Dialog { } async onSplit(){ + await $(".choix-quantite").change(); this.callback(this.item, this.splitData.choix.quantite); } diff --git a/module/item-monnaie.js b/module/item-monnaie.js index 4c70cedf..87c655aa 100644 --- a/module/item-monnaie.js +++ b/module/item-monnaie.js @@ -26,8 +26,8 @@ const monnaiesData = [ export class Monnaie { static isSystemMonnaie(item) { - let present = monnaiesData.find( monnaie => monnaie.data.valeur_deniers == item.data?.data?.valeur_deniers); - return present != undefined; + let present = monnaiesData.find(monnaie => monnaie.data.valeur_deniers == Misc.data(item)?.data?.valeur_deniers); + return present; } static monnaiesData() { @@ -39,9 +39,12 @@ export class Monnaie { } static monnaiesManquantes(items) { - const valeursPresentes = Monnaie.filtrerMonnaies(items) - .map(it => Misc.templateData(it).valeur_deniers) - return monnaiesData.filter(monnaie => !valeursPresentes.includes(Misc.templateData(monnaie).valeur_deniers) ); + const valeurs = Monnaie.filtrerMonnaies(items) + .map(it => Misc.templateData(it).valeur_deniers); + const manquantes = monnaiesData.filter(monnaie => !valeurs.find(v => v != Misc.templateData(monnaie).valeur_deniers)); + //const manquantes = monnaiesData.filter(monnaie => !valeurs.find(v => v != Misc.templateData(monnaie).valeur_deniers) ); + //console.log("Valeurs : ", valeurs, manquantes); + return []; //manquantes; } static deValeur(monnaie, v) { @@ -51,4 +54,8 @@ export class Monnaie { static arrondiDeniers(sols) { return sols.toFixed(2); } + + static triValeurDenier() { + return Misc.ascending(item => Misc.data(item).data.valeur_deniers); + } } diff --git a/module/rdd-calendrier.js b/module/rdd-calendrier.js index 3be674a6..df296080 100644 --- a/module/rdd-calendrier.js +++ b/module/rdd-calendrier.js @@ -325,11 +325,26 @@ export class RdDCalendrier extends Application { } } + findHeure(heure) { + heure = Grammar.toLowerCaseNoAccent(heure); + let parHeureOuLabel = Object.values(heuresDef).filter(it => (it.heure+1) == heure || Grammar.toLowerCaseNoAccent(it.label) == heure); + if (parHeureOuLabel.length == 1) { + return parHeureOuLabel[0]; + } + let parLabelPartiel = Object.values(heuresDef).filter(it => Grammar.toLowerCaseNoAccent(it.label).includes(heure)); + const matchLength = heure.length; + if(parLabelPartiel.length > 0) { + parLabelPartiel.sort((a,b)=> (a.label.length - matchLength)^2 - (b.label.length- matchLength)^2); + return parLabelPartiel[0]; + } + return undefined; + } + /* -------------------------------------------- */ - getAjustementAstrologique(heureNaissance, name = 'inconnu') { - let heure = Grammar.toLowerCaseNoAccent(heureNaissance); - if (heure && heuresDef[heure]) { - let hn = heuresDef[heure].heure; + getAjustementAstrologique(heureNaissance, name = undefined) { + let defHeure = this.findHeure(heureNaissance); + if (defHeure) { + let hn = defHeure.heure; let chiffreAstral = this.getCurrentNombreAstral() ?? 0; let heureCourante = this.calendrier.heureRdD; let ecartChance = (hn + chiffreAstral - heureCourante) % 12; @@ -340,9 +355,12 @@ export class RdDCalendrier extends Application { case 3: case 9: return -2; } } - else { + else if (name) { ui.notifications.warn(name + " n'a pas d'heure de naissance, ou elle est incorrecte : " + heureNaissance); } + else{ + ui.notifications.warn(heureNaissance+" ne correspond pas à une heure de naissance"); + } return 0; } diff --git a/module/rdd-commands.js b/module/rdd-commands.js index fe4c1cda..c6ff622f 100644 --- a/module/rdd-commands.js +++ b/module/rdd-commands.js @@ -79,9 +79,11 @@ export class RdDCommands {
/payer 10d permet d'envoyer un message pour payer 10 deniers` }); rddCommands.registerCommand({ - path: ["/astro"], func: (content, msg, params) => RdDUtility.afficherHeuresChanceMalchance(params[0]), - descr: `Affiche les heures de chance et de malchance selon l'heure de naissance donnée en argument. Exemples: -
/astro Lyre` + path: ["/astro"], func: (content, msg, params) => RdDUtility.afficherHeuresChanceMalchance(RdDCommands.toParamString(params)), + descr: `Affiche les heures de chance et de malchance selon l'heure de naissance donnée en argument. Exemples pour l'heure de la Lyre: +
/astro 7 +
/astro Lyre +
/astro Lyr` }); rddCommands.registerCommand({ @@ -109,6 +111,10 @@ export class RdDCommands { this.commandsTable = {}; } + static toParamString(params) { + return params.length == 1 ? params[0] : params.reduce((a, b) => `${a} ${b}`, ''); + } + /* -------------------------------------------- */ registerCommand(command) { this._addCommand(this.commandsTable, command.path, '', command); diff --git a/module/rdd-utility.js b/module/rdd-utility.js index 32dc33e1..f41c37ad 100644 --- a/module/rdd-utility.js +++ b/module/rdd-utility.js @@ -222,6 +222,7 @@ export class RdDUtility { Handlebars.registerHelper('caseTmr-label', coord => TMRUtility.getTMRLabel(coord)); Handlebars.registerHelper('caseTmr-type', coord => TMRUtility.getTMRType(coord)); Handlebars.registerHelper('typeTmr-name', coord => TMRUtility.typeTmrName(coord)); + Handlebars.registerHelper('min', (...args) => Math.min(...args.slice(0, -1))); Handlebars.registerHelper('sortCompetence', competences => competences.sort((a, b) => { if (a.name.startsWith("Survie") && b.name.startsWith("Survie")) { @@ -363,6 +364,7 @@ export class RdDUtility { .concat(formData.nourritureboissons) .concat(formData.monnaie); formData.competences = (formData.itemsByType.competence ?? []).concat(formData.itemsByType.competencecreature ?? []); + formData.monnaie.sort(Monnaie.triValeurDenier()); } /* -------------------------------------------- */ @@ -830,13 +832,18 @@ export class RdDUtility { /* -------------------------------------------- */ static afficherHeuresChanceMalchance(heureNaissance) { if ( game.user.isGM) { - if (heureNaissance) { + let heure = game.system.rdd.calendrier.findHeure(heureNaissance); + if (heureNaissance && heure) { let ajustement = game.system.rdd.calendrier.getAjustementAstrologique(heureNaissance); + const current = game.system.rdd.calendrier.findHeure(game.system.rdd.calendrier.getCurrentHeure()); ChatMessage.create({ - content: `A l'heure ${game.system.rdd.calendrier.getCurrentHeure()}, le modificateur de Chance/Malchance pour l'heure de naissance ${heureNaissance} est de : ${ajustement}.`, + content: `A l'heure de ${current.label}, le modificateur de Chance/Malchance est de ${Misc.toSignedString(ajustement)} pour l'heure de naissance ${heure.label}.`, whisper: ChatMessage.getWhisperRecipients("GM") }); } + else if (heureNaissance) { + ui.notifications.warn(heureNaissance+" ne correspond pas à une heure de naissance"); + } else { ui.notifications.warn("Pas d'heure de naissance selectionnée"); } diff --git a/module/tmr/conquete.js b/module/tmr/conquete.js index b8c0ac53..0773aa93 100644 --- a/module/tmr/conquete.js +++ b/module/tmr/conquete.js @@ -32,7 +32,7 @@ export class Conquete extends Draconique { async _creerConquete(actor, queue) { let existants = actor.data.items.filter(it => this.isCase(it)).map(it => Misc.data(it).data.coord); let possibles = TMRUtility.filterTMR(tmr => !TMRUtility.isCaseHumide(tmr) && !existants.includes(tmr.coord)); - let conquete =await RdDDice.rollOneOf(possibles); + let conquete = await RdDDice.rollOneOf(possibles); await this.createCaseTmr(actor, 'Conquête: ' + conquete.label, conquete, queue.id); } diff --git a/module/tmr/rencontre.js b/module/tmr/rencontre.js index bf18ab60..6ace25e5 100644 --- a/module/tmr/rencontre.js +++ b/module/tmr/rencontre.js @@ -13,7 +13,7 @@ export class Rencontre extends Draconique { async onActorCreateOwned(actor, item) { } code() { return 'rencontre' } - tooltip(linkData) { return `${linkData.rencontre.name} de force ${linkData.rencontre.force}` } + tooltip(rencontre) { return `${rencontre.name} de force ${rencontre.force}` } img() { return 'systems/foundryvtt-reve-de-dragon/icons/heures/hd06.webp' } createSprite(pixiTMR) { diff --git a/packs/tarot-draconique.db b/packs/tarot-draconique.db index 14a61337..528dbf7b 100644 --- a/packs/tarot-draconique.db +++ b/packs/tarot-draconique.db @@ -18,4 +18,4 @@ {"_id":"yHvIWLb4TuUAbPGa","name":"Le Groin","permission":{"default":2,"Hp9ImM4o9YRTSdfu":3},"type":"tarot","data":{"concept":"Bêtise, Ignorance, Nullité","aspect":"Négatif","description":""},"folder":"LmM8c5pdDkCsDXka","sort":1750000,"flags":{},"img":"systems/foundryvtt-reve-de-dragon/icons/tarots/dos-tarot.png","effects":[]} {"_id":"yIIUac5ehspmqDB2","name":"La Déchirure","permission":{"default":2,"Hp9ImM4o9YRTSdfu":3},"type":"tarot","data":{"concept":"Errance, Déroute, Désordre, Séparation","aspect":"Négatif","description":""},"folder":"LmM8c5pdDkCsDXka","sort":1250000,"flags":{},"img":"systems/foundryvtt-reve-de-dragon/icons/tarots/dos-tarot.png","effects":[]} {"_id":"zP2OF8ZrAYEODxOn","name":"Le Rabot","permission":{"default":2,"Hp9ImM4o9YRTSdfu":3},"type":"tarot","data":{"concept":"Travail, Labeur, Peine, Chagrin","aspect":"Négatif","description":""},"folder":"LmM8c5pdDkCsDXka","sort":1500000,"flags":{},"img":"systems/foundryvtt-reve-de-dragon/icons/tarots/dos-tarot.png","effects":[]} -{"_id":"zSqKPNeQTVjRuni6","name":"Le Soleil","permission":{"default":2,"Hp9ImM4o9YRTSdfu":3},"type":"tarot","data":{"concept":"Clarté, Evidence, Vérité, Franchiuse","aspect":"Positif","description":""},"folder":"LmM8c5pdDkCsDXka","sort":900000,"flags":{},"img":"systems/foundryvtt-reve-de-dragon/icons/tarots/dos-tarot.png","effects":[]} +{"_id":"zSqKPNeQTVjRuni6","name":"Le Soleil","type":"tarot","img":"systems/foundryvtt-reve-de-dragon/icons/tarots/dos-tarot.png","data":{"concept":"Clarté, Evidence, Vérité, Franchise","aspect":"Positif","description":""},"effects":[],"folder":"LmM8c5pdDkCsDXka","sort":900000,"permission":{"default":2,"Hp9ImM4o9YRTSdfu":3},"flags":{}} diff --git a/templates/actor-sheet.html b/templates/actor-sheet.html index 629ea8f7..4358a4a1 100644 --- a/templates/actor-sheet.html +++ b/templates/actor-sheet.html @@ -437,11 +437,11 @@ {{data.reve.refoulement.value}} {{/if}} - - - -
- {{#if data.attributs.hautrevant.value}} + + + +
+ {{#if data.attributs.hautrevant.value}} {{#if options.isGM}}

Signes draconiques