diff --git a/module/actor/base-actor-sheet.js b/module/actor/base-actor-sheet.js index 1af09f3f..e0d92bd1 100644 --- a/module/actor/base-actor-sheet.js +++ b/module/actor/base-actor-sheet.js @@ -45,7 +45,7 @@ export class RdDBaseActorSheet extends ActorSheet { RdDBaseActorSheet.filterItemsPerTypeForSheet(formData, this.actor.itemTypes); formData.calc = { - fortune: this.toSolsDeniers(this.actor.getFortune()), + fortune: Monnaie.toSolsDeniers(this.actor.getFortune()), prixTotalEquipement: this.actor.computePrixTotalEquipement(), encTotal: await this.actor.computeEncTotal(), } @@ -56,13 +56,6 @@ export class RdDBaseActorSheet extends ActorSheet { return formData; } - toSolsDeniers(fortune) { - return { - sols: Math.floor(fortune), - deniers: Math.round(100 * (fortune - Math.floor(fortune))) - }; - } - /* -------------------------------------------- */ static filterItemsPerTypeForSheet(formData, itemTypes) { formData.recettescuisine = Misc.arrayOrEmpty(itemTypes['recettecuisine']); diff --git a/module/item-monnaie.js b/module/item-monnaie.js index 5e091b7f..610ee2d9 100644 --- a/module/item-monnaie.js +++ b/module/item-monnaie.js @@ -62,6 +62,13 @@ export class Monnaie { return deniers; } + static toSolsDeniers(fortune) { + return { + sols: Math.floor(fortune), + deniers: Math.round(100 * (fortune - Math.floor(fortune))) + }; + } + static getFortune(monnaies) { return (monnaies??[]) .map(m => Number(m.system.cout) * Number(m.system.quantite))