mirror of
https://github.com/Foundryborne/daggerheart.git
synced 2026-06-05 20:34:15 +02:00
Lift definition of alt outcomes up one step
This commit is contained in:
parent
f607e8dfa4
commit
1ffde09568
7 changed files with 71 additions and 63 deletions
|
|
@ -4,7 +4,7 @@ import IterableTypedObjectField from '../iterableTypedObjectField.mjs';
|
|||
|
||||
const fields = foundry.data.fields;
|
||||
|
||||
const getDamageBaseFields = () => ({
|
||||
export const getDamageBaseFields = () => ({
|
||||
parts: new IterableTypedObjectField(DHDamageData),
|
||||
includeBase: new fields.BooleanField({
|
||||
initial: false,
|
||||
|
|
@ -23,12 +23,6 @@ export default class DamageField extends fields.SchemaField {
|
|||
constructor(options, context = {}) {
|
||||
const damageFields = {
|
||||
...getDamageBaseFields(),
|
||||
altOutcomes: new fields.SchemaField({
|
||||
successHope: new fields.EmbeddedDataField(AltDamageOutcome, { nullable: true, initial: null }),
|
||||
successFear: new fields.EmbeddedDataField(AltDamageOutcome, { nullable: true, initial: null }),
|
||||
failureHope: new fields.EmbeddedDataField(AltDamageOutcome, { nullable: true, initial: null }),
|
||||
failureFear: new fields.EmbeddedDataField(AltDamageOutcome, { nullable: true, initial: null })
|
||||
}),
|
||||
groupAttack: new fields.StringField({
|
||||
choices: CONFIG.DH.GENERAL.groupAttackRange,
|
||||
blank: true,
|
||||
|
|
@ -342,18 +336,3 @@ export class DHDamageData extends DHResourceData {
|
|||
};
|
||||
}
|
||||
}
|
||||
|
||||
export class AltDamageOutcome extends foundry.abstract.DataModel {
|
||||
static defineSchema() {
|
||||
return {
|
||||
...getDamageBaseFields()
|
||||
};
|
||||
}
|
||||
|
||||
get data() {
|
||||
return {
|
||||
...this.parent,
|
||||
...this
|
||||
};
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue