48 lines
1.0 KiB
JavaScript
48 lines
1.0 KiB
JavaScript
|
import { RdDBaseActor } from "./base-actor.js";
|
||
|
|
||
|
export class RdDCommerce extends RdDBaseActor {
|
||
|
|
||
|
static get defaultIcon() {
|
||
|
return "systems/foundryvtt-reve-de-dragon/icons/services/commerce.webp";
|
||
|
}
|
||
|
|
||
|
prepareData() {
|
||
|
super.prepareData();
|
||
|
}
|
||
|
prepareDerivedData() {
|
||
|
super.prepareDerivedData();
|
||
|
}
|
||
|
|
||
|
canReceive(item) {
|
||
|
if (item.isInventaire()) {
|
||
|
return true;
|
||
|
}
|
||
|
return super.canReceive(item);
|
||
|
}
|
||
|
|
||
|
getQuantiteDisponible(item) {
|
||
|
return this.system.illimite ? undefined : item.getQuantite();
|
||
|
}
|
||
|
|
||
|
verifierFortune(cout) {
|
||
|
return this.system.illimite || super.verifierFortune(cout);
|
||
|
}
|
||
|
async depenserSols(cout) {
|
||
|
if (this.system.illimite) {
|
||
|
return
|
||
|
}
|
||
|
await super.depenserSols(cout)
|
||
|
}
|
||
|
|
||
|
async consommerNourritureAchetee(achat, vente, createdItemId) {
|
||
|
// ne pas consommer pour un commerce
|
||
|
}
|
||
|
|
||
|
async decrementerQuantiteItem(itemVendu, quantite) {
|
||
|
if (this.system.illimite) {
|
||
|
return;
|
||
|
}
|
||
|
await super.decrementerQuantiteItem(itemVendu, quantite, {supprimerSiZero: false});
|
||
|
}
|
||
|
|
||
|
}
|