mirror of
https://github.com/Foundryborne/daggerheart.git
synced 2026-06-06 04:44:16 +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
19
module/data/action/altOutcome.mjs
Normal file
19
module/data/action/altOutcome.mjs
Normal file
|
|
@ -0,0 +1,19 @@
|
|||
import { getDamageBaseFields } from '../fields/action/damageField.mjs';
|
||||
|
||||
const fields = foundry.data.fields;
|
||||
|
||||
export class AltOutcome extends foundry.abstract.DataModel {
|
||||
static defineSchema() {
|
||||
return {
|
||||
damage: new fields.SchemaField(getDamageBaseFields())
|
||||
// todo: add effects
|
||||
};
|
||||
}
|
||||
|
||||
get data() {
|
||||
return {
|
||||
...this.parent,
|
||||
...this
|
||||
};
|
||||
}
|
||||
}
|
||||
|
|
@ -1,8 +1,23 @@
|
|||
import { AltOutcome } from './altOutcome.mjs';
|
||||
import DHBaseAction from './baseAction.mjs';
|
||||
|
||||
const fields = foundry.data.fields;
|
||||
|
||||
export default class DHDamageAction extends DHBaseAction {
|
||||
static extraSchemas = [...super.extraSchemas, 'damage', 'target', 'effects'];
|
||||
|
||||
static defineSchema() {
|
||||
return {
|
||||
...super.defineSchema(),
|
||||
altOutcomes: new fields.SchemaField({
|
||||
successHope: new fields.EmbeddedDataField(AltOutcome, { nullable: true, initial: null }),
|
||||
successFear: new fields.EmbeddedDataField(AltOutcome, { nullable: true, initial: null }),
|
||||
failureHope: new fields.EmbeddedDataField(AltOutcome, { nullable: true, initial: null }),
|
||||
failureFear: new fields.EmbeddedDataField(AltOutcome, { nullable: true, initial: null })
|
||||
})
|
||||
};
|
||||
}
|
||||
|
||||
/**
|
||||
* Return a display ready damage formula string
|
||||
* @returns Formula string
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue