mirror of
https://github.com/Foundryborne/daggerheart.git
synced 2026-01-12 11:41:08 +01:00
* rework new environment template sheet, add environment-settings sheet, improve adversary-settings sheet and delete legacy actor sheet templates * Potential Adversaries can be dragged out of the sheet onto canvas * Added ToChat and UseItem --------- Co-authored-by: WBHarry <williambjrklund@gmail.com>
39 lines
1.6 KiB
JavaScript
39 lines
1.6 KiB
JavaScript
import { environmentTypes } from '../../config/actorConfig.mjs';
|
|
import BaseDataActor from './base.mjs';
|
|
import ForeignDocumentUUIDField from '../fields/foreignDocumentUUIDField.mjs';
|
|
import ActionField from '../fields/actionField.mjs';
|
|
import ForeignDocumentUUIDArrayField from '../fields/foreignDocumentUUIDArrayField.mjs';
|
|
|
|
export default class DhEnvironment extends BaseDataActor {
|
|
static LOCALIZATION_PREFIXES = ['DAGGERHEART.Sheets.Environment'];
|
|
|
|
static get metadata() {
|
|
return foundry.utils.mergeObject(super.metadata, {
|
|
label: 'TYPES.Actor.environment',
|
|
type: 'environment'
|
|
});
|
|
}
|
|
|
|
static defineSchema() {
|
|
const fields = foundry.data.fields;
|
|
return {
|
|
tier: new fields.StringField({
|
|
required: true,
|
|
choices: SYSTEM.GENERAL.tiers,
|
|
initial: SYSTEM.GENERAL.tiers.tier1.id
|
|
}),
|
|
type: new fields.StringField({ choices: environmentTypes }),
|
|
description: new fields.StringField(),
|
|
impulses: new fields.StringField(),
|
|
difficulty: new fields.NumberField({ required: true, initial: 11, integer: true }),
|
|
potentialAdversaries: new fields.TypedObjectField(
|
|
new fields.SchemaField({
|
|
label: new fields.StringField(),
|
|
adversaries: new ForeignDocumentUUIDArrayField({ type: 'Actor' })
|
|
})
|
|
),
|
|
actions: new fields.ArrayField(new ActionField()),
|
|
notes: new fields.HTMLField()
|
|
};
|
|
}
|
|
}
|