diff --git a/icons/tmr/gift.svg b/icons/tmr/gift.svg index 6a06c684..dffbd3ad 100644 --- a/icons/tmr/gift.svg +++ b/icons/tmr/gift.svg @@ -1,130 +1,103 @@ - -image/svg+xml - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/module/actor.js b/module/actor.js index b4cdcccb..a8823165 100644 --- a/module/actor.js +++ b/module/actor.js @@ -74,6 +74,7 @@ export class RdDActor extends Actor { } } + /* -------------------------------------------- */ static getParentActor(document) { return document?.parent instanceof Actor ? document.parent : undefined } @@ -253,6 +254,7 @@ export class RdDActor extends Actor { getProtectionNaturelle() { return Misc.toInt(Misc.templateData(this).attributs.protection.value); } + /* -------------------------------------------- */ getEtatGeneral(options = { ethylisme: false }) { const tplData = Misc.templateData(this); @@ -263,15 +265,23 @@ export class RdDActor extends Actor { } return etatGeneral; } + + /* -------------------------------------------- */ getMalusArmure() { return Misc.toInt(Misc.templateData(this).attributs?.malusarmure?.value); } + + /* -------------------------------------------- */ getEncTotal() { return Math.floor(this.encTotal ?? 0); } + + /* -------------------------------------------- */ getPrixTotalEquipement() { return Math.floor(Misc.templateData(this).prixTotalEquipement ?? 0); } + + /* -------------------------------------------- */ getSurenc() { return Misc.templateData(this).compteurs.surenc?.value ?? 0; } @@ -413,6 +423,7 @@ export class RdDActor extends Actor { ChatMessage.create(message); } + /* -------------------------------------------- */ async _recupereChance() { // On ne récupère un point de chance que si aucun appel à la chance dans la journée if (this.getChanceActuel() < this.getChance() && !this.getFlag('foundryvtt-reve-de-dragon', 'utilisationChance')) { @@ -1766,6 +1777,7 @@ export class RdDActor extends Actor { await item.diminuerQuantite(doses, options); } + /* -------------------------------------------- */ async saouler(forceAlcool) { const actorTplData = Misc.templateData(this); const etatGeneral = this.getEtatGeneral({ ethylisme: true }); @@ -1781,6 +1793,7 @@ export class RdDActor extends Actor { await this.performEthylisme(rollData); } + /* -------------------------------------------- */ async apprecierCuisine(item) { const cuisine = Misc.data(this.getCompetence('cuisine')); const itemData = Misc.data(item); @@ -1793,6 +1806,7 @@ export class RdDActor extends Actor { } } + /* -------------------------------------------- */ async surmonterExotisme(item, choix = {}) { const itemData = Misc.data(item); const exotisme = Math.min(itemData.data.exotisme, itemData.data.qualite, 0); @@ -1808,6 +1822,7 @@ export class RdDActor extends Actor { return true; } + /* -------------------------------------------- */ async jetGoutCuisine() { console.info('Jet de Gout/Cuisine'); return true; @@ -1866,6 +1881,7 @@ export class RdDActor extends Actor { return result; } + /* -------------------------------------------- */ _getFacteurStress(stressRoll) { switch (stressRoll.code) { case "sign": return 75; @@ -2234,6 +2250,7 @@ export class RdDActor extends Actor { RdDResolutionTable.displayRollData(rollData, this) return rollData.rolled; } + /* -------------------------------------------- */ _appliquerExperienceRollData(rollData) { const callback = this.createCallbackExperience(); @@ -2380,7 +2397,6 @@ export class RdDActor extends Actor { const baseQualite = (artData.rolled.isSuccess ? artData.oeuvre.data.niveau : artData.competence.data.niveau); artData.qualiteFinale = Math.min(baseQualite, artData.oeuvre.data.niveau) + artData.rolled.ptQualite; - console.log("OEUVRE", artData.art, artData) RdDResolutionTable.displayRollData(artData, this.name, `chat-resultat-${artData.art}.html`); } @@ -2552,6 +2568,7 @@ export class RdDActor extends Actor { async _moralDecrease(rollData) { RdDResolutionTable.displayRollData(rollData, this, 'chat-resultat-competence.html') } + /* -------------------------------------------- */ async rollAppelChance(onSuccess = () => { }, onEchec = () => { }) { // Stocke si utilisation de la chance @@ -2603,7 +2620,6 @@ export class RdDActor extends Actor { } } - /* -------------------------------------------- */ ajustementAstrologique() { if (this.isCreature()) { @@ -3144,6 +3160,7 @@ export class RdDActor extends Actor { await this.update({ "data.sante.resonnance": resonnance }); return; } + /* -------------------------------------------- */ getFortune() { let monnaies = Monnaie.filtrerMonnaies(this.data.items); @@ -3315,12 +3332,14 @@ export class RdDActor extends Actor { return this._buildActorLinksList(Misc.templateData(this).subacteurs?.montures ?? []); } + /* -------------------------------------------- */ _buildActorLinksList(links, actorTransformation = it => RdDActor._buildActorData(it)) { return links.map(link => game.actors.get(link.id)) .filter(it => it != null) .map(actorTransformation); } + /* -------------------------------------------- */ static _vehicleData(vehicle) { const vehicleData = Misc.data(vehicle); return { @@ -3332,6 +3351,7 @@ export class RdDActor extends Actor { }; } + /* -------------------------------------------- */ static _buildActorData(it) { return { id: it.id, name: it.data.name, img: it.data.img }; } @@ -3531,6 +3551,7 @@ export class RdDActor extends Actor { } + /* -------------------------------------------- */ async diminuerQuantiteObjet(id, nb, options = { supprimerSiZero: false }) { const item = this.getObjet(id); if (item) { @@ -3696,6 +3717,7 @@ export class RdDActor extends Actor { } } + /* -------------------------------------------- */ async onCreateOwnedDraconique(item, options, id) { if (Misc.isElectedUser()) { let draconique = Draconique.all().find(it => it.match(item)); @@ -3706,6 +3728,7 @@ export class RdDActor extends Actor { } } + /* -------------------------------------------- */ async onDeleteOwnedDraconique(item, options, id) { if (Misc.isElectedUser()) { let draconique = Draconique.all().find(it => it.match(item)); @@ -3715,6 +3738,7 @@ export class RdDActor extends Actor { } } + /* -------------------------------------------- */ async onDeleteOwnedCaseTmr(item, options, id) { if (Misc.isElectedUser()) { let draconique = Draconique.all().find(it => it.isCase(item)); @@ -3724,6 +3748,7 @@ export class RdDActor extends Actor { } } + /* -------------------------------------------- */ notifyGestionTeteSouffleQueue(item, manualMessage = true) { ChatMessage.create({ whisper: ChatUtility.getWhisperRecipientsAndGMs(game.user.name), diff --git a/module/rdd-main.js b/module/rdd-main.js index 5e9cadcc..e5c01ef9 100644 --- a/module/rdd-main.js +++ b/module/rdd-main.js @@ -199,9 +199,9 @@ function messageDeBienvenue() { } } - /* -------------------------------------------- */ - /* Foundry VTT Initialization */ - /* -------------------------------------------- */ +/* -------------------------------------------- */ +/* Foundry VTT Initialization */ +/* -------------------------------------------- */ Hooks.once("ready", function () { StatusEffects.onReady();