.dungeon/module/documents/Item/Aspect.mjs

20 lines
488 B
JavaScript

import { DotDungeonItem } from "./GenericItem.mjs";
export class Aspect extends DotDungeonItem {
async _preCreate(...args) {
if (this.isEmbedded) {
if (this.actor.atAspectLimit) {
ui.notifications.error(
game.i18n.format(
`dotdungeon.notification.error.aspect-limit-reached`,
{ limit: game.settings.get(`dotdungeon`, `aspectLimit`) }
),
{ console: false }
);
return false;
};
return await this.actor?.preItemEmbed(...args);
};
}
};