mirror of
https://github.com/Foundryborne/daggerheart.git
synced 2026-01-17 23:49:02 +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 => {
|
this.extraSchemas.forEach(s => {
|
||||||
let clsField;
|
let clsField;
|
||||||
if ((clsField = this.getActionField(s))) schemaFields[s] = new clsField();
|
if ((clsField = this.getActionField(s))) schemaFields[s] = new clsField(
|
||||||
|
{
|
||||||
|
type: this
|
||||||
|
}
|
||||||
|
);
|
||||||
});
|
});
|
||||||
|
|
||||||
return schemaFields;
|
return schemaFields;
|
||||||
|
|
|
||||||
|
|
@ -4,7 +4,7 @@ export class DHActionRollData extends foundry.abstract.DataModel {
|
||||||
/** @override */
|
/** @override */
|
||||||
static defineSchema() {
|
static defineSchema() {
|
||||||
return {
|
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 }),
|
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 }),
|
difficulty: new fields.NumberField({ nullable: true, initial: null, integer: true, min: 0 }),
|
||||||
bonus: new fields.NumberField({ nullable: true, initial: null, integer: true }),
|
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() {
|
getFormula() {
|
||||||
if (!this.type) return;
|
if (!this.type) return;
|
||||||
let formula = '';
|
let formula = '';
|
||||||
|
|
@ -71,5 +80,6 @@ export class DHActionRollData extends foundry.abstract.DataModel {
|
||||||
export default class RollField extends fields.EmbeddedDataField {
|
export default class RollField extends fields.EmbeddedDataField {
|
||||||
constructor(options, context = {}) {
|
constructor(options, context = {}) {
|
||||||
super(DHActionRollData, options, context);
|
super(DHActionRollData, options, context);
|
||||||
|
console.log(this)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue