mirror of
https://github.com/Foundryborne/daggerheart.git
synced 2026-01-12 03:31:07 +01:00
* Improved death marking styling * Added automation for defeated status * Fixed so the tracker recognises and sets the correct defeated statuses depending on type * Fixed so missing statuses doesn't cause crashes * Increased companion sheet width by 40 pixels * Added missing inheritDoc * Removed fas
17 lines
715 B
JavaScript
17 lines
715 B
JavaScript
export default class DhCombatant extends foundry.abstract.TypeDataModel {
|
|
static defineSchema() {
|
|
const fields = foundry.data.fields;
|
|
return {
|
|
spotlight: new fields.SchemaField({
|
|
requesting: new fields.BooleanField({ required: true, initial: false })
|
|
}),
|
|
actionTokens: new fields.NumberField({ required: true, integer: true, initial: 3 })
|
|
};
|
|
}
|
|
|
|
get isDefeated() {
|
|
const { unconscious, defeated, dead } = CONFIG.DH.GENERAL.conditions;
|
|
const defeatedConditions = new Set([unconscious.id, defeated.id, dead.id]);
|
|
return this.defeated || this.actor?.statuses.intersection(defeatedConditions)?.size;
|
|
}
|
|
}
|