mirror of
https://github.com/Foundryborne/daggerheart.git
synced 2026-03-07 22:46:12 +01:00
Fixed basic beastform
This commit is contained in:
parent
978d45b931
commit
3186468f28
18 changed files with 231 additions and 21 deletions
7
module/data/activeEffect/_module.mjs
Normal file
7
module/data/activeEffect/_module.mjs
Normal file
|
|
@ -0,0 +1,7 @@
|
|||
import beastformEffect from './beastformEffect.mjs';
|
||||
|
||||
export { beastformEffect };
|
||||
|
||||
export const config = {
|
||||
beastform: beastformEffect
|
||||
};
|
||||
18
module/data/activeEffect/beastformEffect.mjs
Normal file
18
module/data/activeEffect/beastformEffect.mjs
Normal file
|
|
@ -0,0 +1,18 @@
|
|||
export default class BeastformEffect extends foundry.abstract.TypeDataModel {
|
||||
static defineSchema() {
|
||||
const fields = foundry.data.fields;
|
||||
return {
|
||||
isBeastform: new fields.BooleanField({ initial: false })
|
||||
};
|
||||
}
|
||||
|
||||
async _preDelete() {
|
||||
if (this.parent.parent.type === 'character') {
|
||||
for (let item of this.parent.parent.items) {
|
||||
if (item.type === 'beastform') {
|
||||
await item.delete();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue