mirror of
https://github.com/Foundryborne/daggerheart.git
synced 2026-01-12 03:31:07 +01:00
Feature/163 actor subdatas (#346)
* Actor Roll bonuses * Removed console log and comment --------- Co-authored-by: WBHarry <williambjrklund@gmail.com>
This commit is contained in:
parent
422f28c93c
commit
37c1d7ad88
21 changed files with 210 additions and 103 deletions
|
|
@ -5,7 +5,7 @@ export default class DHAttackAction extends DHDamageAction {
|
|||
static extraSchemas = [...super.extraSchemas, ...['roll', 'save']];
|
||||
|
||||
static getRollType(parent) {
|
||||
return parent.type === 'weapon' ? 'weapon' : 'spellcast';
|
||||
return parent.type === 'weapon' ? 'attack' : 'spellcast';
|
||||
}
|
||||
|
||||
get chatTemplate() {
|
||||
|
|
@ -21,7 +21,7 @@ export default class DHAttackAction extends DHDamageAction {
|
|||
}
|
||||
if (this.roll.useDefault) {
|
||||
this.roll.trait = this.item.system.attack.roll.trait;
|
||||
this.roll.type = 'weapon';
|
||||
this.roll.type = 'attack';
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -37,4 +37,8 @@ export default class DHAttackAction extends DHDamageAction {
|
|||
base: true
|
||||
};
|
||||
}
|
||||
|
||||
// get modifiers() {
|
||||
// return [];
|
||||
// }
|
||||
}
|
||||
|
|
|
|||
|
|
@ -150,7 +150,7 @@ export default class DHBaseAction extends foundry.abstract.DataModel {
|
|||
}
|
||||
|
||||
static getRollType(parent) {
|
||||
return 'ability';
|
||||
return 'trait';
|
||||
}
|
||||
|
||||
static getSourceConfig(parent) {
|
||||
|
|
@ -308,7 +308,7 @@ export default class DHBaseAction extends foundry.abstract.DataModel {
|
|||
|
||||
prepareRoll() {
|
||||
const roll = {
|
||||
modifiers: [],
|
||||
modifiers: this.modifiers,
|
||||
trait: this.roll?.trait,
|
||||
label: 'Attack',
|
||||
type: this.actionType,
|
||||
|
|
@ -362,6 +362,13 @@ export default class DHBaseAction extends foundry.abstract.DataModel {
|
|||
get hasRoll() {
|
||||
return !!this.roll?.type || !!this.roll?.bonus;
|
||||
}
|
||||
|
||||
get modifiers() {
|
||||
if(!this.actor) return [];
|
||||
const modifiers = [];
|
||||
/** Placeholder for specific bonuses **/
|
||||
return modifiers;
|
||||
}
|
||||
/* ROLL */
|
||||
|
||||
/* SAVE */
|
||||
|
|
|
|||
|
|
@ -28,6 +28,7 @@ export default class DHDamageAction extends DHBaseAction {
|
|||
hasSave: this.hasSave,
|
||||
isCritical: data.system?.roll?.isCritical ?? false,
|
||||
source: data.system?.source,
|
||||
data: this.getRollData(),
|
||||
damageTypes,
|
||||
event
|
||||
};
|
||||
|
|
@ -39,4 +40,8 @@ export default class DHDamageAction extends DHBaseAction {
|
|||
|
||||
roll = CONFIG.Dice.daggerheart.DamageRoll.build(config);
|
||||
}
|
||||
|
||||
// get modifiers() {
|
||||
// return [];
|
||||
// }
|
||||
}
|
||||
|
|
|
|||
|
|
@ -39,4 +39,8 @@ export default class DHHealingAction extends DHBaseAction {
|
|||
get chatTemplate() {
|
||||
return 'systems/daggerheart/templates/ui/chat/healing-roll.hbs';
|
||||
}
|
||||
|
||||
get modifiers() {
|
||||
return [];
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue