Add an ItemHandler class and prevent players from having more than 1 aspect.

This commit is contained in:
Oliver-Akins 2024-01-13 15:03:00 -07:00
parent 82108bfe5f
commit 38fcb1193a
7 changed files with 49 additions and 6 deletions

View file

@ -0,0 +1,17 @@
/** @this {Item} */
async function _preCreate(data, options, user) {
if (this.parent.itemTypes.aspect.length > 0) {
ui.notifications.error(
game.i18n.format(
`dotdungeon.notification.error.aspect-limit-reached`,
{ limit: 1 }
),
{ console: false }
);
return false;
};
};
export default {
_preCreate,
};