v10.6.7 #617

Merged
uberwald merged 6 commits from VincentVk/foundryvtt-reve-de-dragon:v10 into v10 2023-01-28 20:50:53 +01:00
2 changed files with 8 additions and 8 deletions
Showing only changes of commit d381191692 - Show all commits

View File

@ -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']);

View File

@ -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))