mirror of
https://github.com/Foundryborne/daggerheart.git
synced 2026-01-12 11:41:08 +01:00
Reworked Action storage
This commit is contained in:
parent
3333a9e00a
commit
ce593d02f3
16 changed files with 196 additions and 23 deletions
|
|
@ -1,4 +1,5 @@
|
|||
import { burden } from '../../config/generalConfig.mjs';
|
||||
import ActionField from '../fields/actionField.mjs';
|
||||
import ForeignDocumentUUIDField from '../fields/foreignDocumentUUIDField.mjs';
|
||||
import DhLevelData from '../levelData.mjs';
|
||||
import BaseDataActor from './base.mjs';
|
||||
|
|
@ -96,6 +97,7 @@ export default class DhCharacter extends BaseDataActor {
|
|||
value: new ForeignDocumentUUIDField({ type: 'Item', nullable: true }),
|
||||
subclass: new ForeignDocumentUUIDField({ type: 'Item', nullable: true })
|
||||
}),
|
||||
actions: new fields.ArrayField(new ActionField()),
|
||||
levelData: new fields.EmbeddedDataField(DhLevelData),
|
||||
bonuses: new fields.SchemaField({
|
||||
armorScore: new fields.NumberField({ integer: true, initial: 0 }),
|
||||
|
|
@ -155,6 +157,17 @@ export default class DhCharacter extends BaseDataActor {
|
|||
return this.parent.items.find(x => x.type === 'community') ?? null;
|
||||
}
|
||||
|
||||
// get actions() {
|
||||
// const generalActions = []; // Add in things like Sprint etc
|
||||
// const levelupActions = this.levelData.actions.filter(x => !x.partner).map(x => x.value);
|
||||
|
||||
// return [...generalActions, ...levelupActions];
|
||||
// }
|
||||
|
||||
get companionActions() {
|
||||
return this.companion ? this.companion.system.actions : [];
|
||||
}
|
||||
|
||||
get needsCharacterSetup() {
|
||||
return !this.class.value || !this.class.subclass;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -72,6 +72,7 @@ export default class DhCompanion extends BaseDataActor {
|
|||
}
|
||||
}
|
||||
}),
|
||||
actions: new fields.ArrayField(new ActionField()),
|
||||
levelData: new fields.EmbeddedDataField(DhLevelData)
|
||||
};
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue