mirror of
https://github.com/Foundryborne/daggerheart.git
synced 2026-01-18 07:59:03 +01:00
Some tests
This commit is contained in:
parent
6d7401c874
commit
86cb466f6e
2 changed files with 16 additions and 2 deletions
|
|
@ -37,7 +37,11 @@ export default class DHBaseAction extends ActionMixin(foundry.abstract.DataModel
|
|||
|
||||
this.extraSchemas.forEach(s => {
|
||||
let clsField;
|
||||
if ((clsField = this.getActionField(s))) schemaFields[s] = new clsField();
|
||||
if ((clsField = this.getActionField(s))) schemaFields[s] = new clsField(
|
||||
{
|
||||
type: this
|
||||
}
|
||||
);
|
||||
});
|
||||
|
||||
return schemaFields;
|
||||
|
|
|
|||
|
|
@ -4,7 +4,7 @@ export class DHActionRollData extends foundry.abstract.DataModel {
|
|||
/** @override */
|
||||
static defineSchema() {
|
||||
return {
|
||||
type: new fields.StringField({ nullable: true, initial: null, choices: CONFIG.DH.GENERAL.rollTypes }),
|
||||
type: new fields.StringField({ nullable: true, initial: null, choices: this.getRollTypes() }),
|
||||
trait: new fields.StringField({ nullable: true, initial: null, choices: CONFIG.DH.ACTOR.abilities }),
|
||||
difficulty: new fields.NumberField({ nullable: true, initial: null, integer: true, min: 0 }),
|
||||
bonus: new fields.NumberField({ nullable: true, initial: null, integer: true }),
|
||||
|
|
@ -45,6 +45,15 @@ export class DHActionRollData extends foundry.abstract.DataModel {
|
|||
};
|
||||
}
|
||||
|
||||
static getRollTypes() {
|
||||
console.log(this.parent, this._source)
|
||||
return CONFIG.DH.GENERAL.rollTypes;
|
||||
}
|
||||
|
||||
_configure() {
|
||||
console.log(this)
|
||||
}
|
||||
|
||||
getFormula() {
|
||||
if (!this.type) return;
|
||||
let formula = '';
|
||||
|
|
@ -71,5 +80,6 @@ export class DHActionRollData extends foundry.abstract.DataModel {
|
|||
export default class RollField extends fields.EmbeddedDataField {
|
||||
constructor(options, context = {}) {
|
||||
super(DHActionRollData, options, context);
|
||||
console.log(this)
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue