Les commerces peuvent appliquer un pourcentage

This commit is contained in:
2023-01-03 01:37:50 +01:00
parent d5453c9b04
commit ceacee8e6c
9 changed files with 45 additions and 13 deletions

View File

@ -171,7 +171,6 @@ export class RdDItem extends Item {
return typesObjetsConnaissance.includes(this.type)
}
getItemGroup() {
if (this.isInventaire()) return "equipement";
if (this.isOeuvre()) return "oeuvre";
@ -258,6 +257,14 @@ export class RdDItem extends Item {
return this.system.cout ?? 0
}
calculerPrixCommercant() {
if (this.parent?.type == 'commerce') {
// appliquer le pourcentage
return this.parent.calculerPrix(this);
}
return this.system.cout;
}
prepareDerivedData() {
super.prepareDerivedData();
if (this.isInventaire()) {