140/141 - Class/Subclass Actions/Effects (#142)

* Added Actions and effects

* Added class hopeFeatures and classFeatures
This commit is contained in:
WBHarry 2025-06-15 13:19:48 +02:00 committed by GitHub
parent 0fbba51ad7
commit f80a849b73
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
15 changed files with 281 additions and 74 deletions

View file

@ -55,6 +55,7 @@ export class DHBaseAction extends foundry.abstract.DataModel {
static defineSchema() {
return {
_id: new fields.DocumentIdField(),
systemPath: new fields.StringField({ required: true, initial: 'actions' }),
type: new fields.StringField({ initial: undefined, readonly: true, required: true }),
name: new fields.StringField({ initial: undefined }),
img: new fields.FilePathField({ initial: undefined, categories: ['IMAGE'], base64: false }),
@ -93,7 +94,7 @@ export class DHBaseAction extends foundry.abstract.DataModel {
prepareData() {}
get index() {
return this.parent.actions.indexOf(this);
return foundry.utils.getProperty(this.parent, this.systemPath).indexOf(this);
}
get item() {
@ -203,7 +204,7 @@ export class DHAttackAction extends DHBaseAction {
static getRollType() {
return 'weapon';
}
get chatTitle() {
return game.i18n.format('DAGGERHEART.Chat.AttackRoll.Title', {
attack: this.item.name