mirror of
https://github.com/Foundryborne/daggerheart.git
synced 2026-01-12 19:51:08 +01:00
Merged with action branch
This commit is contained in:
commit
90e7000b9c
19 changed files with 280 additions and 496 deletions
|
|
@ -1,3 +1,4 @@
|
|||
import DHActionConfig from '../config/Action.mjs';
|
||||
import DaggerheartSheet from './daggerheart-sheet.mjs';
|
||||
|
||||
const { ActorSheetV2 } = foundry.applications.sheets;
|
||||
|
|
@ -9,6 +10,7 @@ export default class AdversarySheet extends DaggerheartSheet(ActorSheetV2) {
|
|||
actions: {
|
||||
reactionRoll: this.reactionRoll,
|
||||
attackRoll: this.attackRoll,
|
||||
attackConfigure: this.attackConfigure,
|
||||
addExperience: this.addExperience,
|
||||
removeExperience: this.removeExperience,
|
||||
toggleHP: this.toggleHP,
|
||||
|
|
@ -51,7 +53,9 @@ export default class AdversarySheet extends DaggerheartSheet(ActorSheetV2) {
|
|||
const context = await super._prepareContext(_options);
|
||||
context.document = this.document;
|
||||
context.tabs = super._getTabs(this.constructor.TABS);
|
||||
|
||||
context.systemFields.attack.fields = this.document.system.attack.schema.fields;
|
||||
context.isNPC = true;
|
||||
console.log(context);
|
||||
return context;
|
||||
}
|
||||
|
||||
|
|
@ -78,25 +82,11 @@ export default class AdversarySheet extends DaggerheartSheet(ActorSheetV2) {
|
|||
}
|
||||
|
||||
static async attackRoll(event) {
|
||||
const { modifier, damage, name: attackName } = this.actor.system.attack,
|
||||
config = {
|
||||
event: event,
|
||||
title: attackName,
|
||||
roll: {
|
||||
modifier: modifier,
|
||||
type: 'action'
|
||||
},
|
||||
chatMessage: {
|
||||
type: 'adversaryRoll',
|
||||
template: 'systems/daggerheart/templates/chat/adversary-attack-roll.hbs'
|
||||
},
|
||||
damage: {
|
||||
value: damage.value,
|
||||
type: damage.type
|
||||
},
|
||||
checkTarget: true
|
||||
};
|
||||
this.actor.diceRoll(config);
|
||||
this.actor.system.attack.use(event);
|
||||
}
|
||||
|
||||
static async attackConfigure(event) {
|
||||
await new DHActionConfig(this.document.system.attack).render(true);
|
||||
}
|
||||
|
||||
static async addExperience() {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue