mirror of
https://github.com/Foundryborne/daggerheart.git
synced 2026-04-22 23:43:37 +02:00
.
This commit is contained in:
parent
6d355e342e
commit
2ef07b5d84
5 changed files with 7 additions and 7 deletions
|
|
@ -57,7 +57,7 @@ export default class ActionSelectionDialog extends HandlebarsApplicationMixin(Ap
|
||||||
|
|
||||||
/** @inheritDoc */
|
/** @inheritDoc */
|
||||||
async _prepareContext(options) {
|
async _prepareContext(options) {
|
||||||
const actions = this.#item.system.actionsList.map(action => ({
|
const actions = this.#item.system.actions.map(action => ({
|
||||||
...action.toObject(),
|
...action.toObject(),
|
||||||
id: action.id,
|
id: action.id,
|
||||||
img: action.baseAction ? action.parent.parent.img : action.img
|
img: action.baseAction ? action.parent.parent.img : action.img
|
||||||
|
|
@ -72,8 +72,8 @@ export default class ActionSelectionDialog extends HandlebarsApplicationMixin(Ap
|
||||||
|
|
||||||
static async #onChooseAction(event, button) {
|
static async #onChooseAction(event, button) {
|
||||||
const { actionId } = button.dataset;
|
const { actionId } = button.dataset;
|
||||||
this.#action = this.#item.system.actionsList.find(a => a._id === actionId);
|
this.action = this.item.system.actions.find(a => a._id === actionId);
|
||||||
Object.defineProperty(this.#event, 'shiftKey', {
|
Object.defineProperty(this.event, 'shiftKey', {
|
||||||
get() {
|
get() {
|
||||||
return event.shiftKey;
|
return event.shiftKey;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -17,7 +17,7 @@ export default class D20RollDialog extends HandlebarsApplicationMixin(Applicatio
|
||||||
this.action =
|
this.action =
|
||||||
config.data.attack?._id == config.source.action
|
config.data.attack?._id == config.source.action
|
||||||
? config.data.attack
|
? config.data.attack
|
||||||
: this.item.system.actionsList?.find(a => a.id === config.source.action);
|
: this.item.system.actions?.find(a => a.id === config.source.action);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -51,7 +51,7 @@ export default class DHAttackAction extends DHDamageAction {
|
||||||
async use(event, options) {
|
async use(event, options) {
|
||||||
const result = await super.use(event, options);
|
const result = await super.use(event, options);
|
||||||
|
|
||||||
if (result?.message?.system.action.roll?.type === 'attack') {
|
if (result?.message?.system.action?.roll?.type === 'attack') {
|
||||||
const { updateCountdowns } = game.system.api.applications.ui.DhCountdowns;
|
const { updateCountdowns } = game.system.api.applications.ui.DhCountdowns;
|
||||||
await updateCountdowns(CONFIG.DH.GENERAL.countdownProgressionTypes.characterAttack.id);
|
await updateCountdowns(CONFIG.DH.GENERAL.countdownProgressionTypes.characterAttack.id);
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -25,7 +25,7 @@ export default class DHAbilityUse extends foundry.abstract.TypeDataModel {
|
||||||
if (!actionActor || !this.source.item) return null;
|
if (!actionActor || !this.source.item) return null;
|
||||||
|
|
||||||
const item = actionActor.items.get(this.source.item);
|
const item = actionActor.items.get(this.source.item);
|
||||||
return item ? item.system.actionsList?.find(a => a.id === this.source.action) : null;
|
return item ? item.system.actions?.find(a => a.id === this.source.action) : null;
|
||||||
}
|
}
|
||||||
|
|
||||||
get action() {
|
get action() {
|
||||||
|
|
|
||||||
|
|
@ -84,7 +84,7 @@ export default class DHActorRoll extends foundry.abstract.TypeDataModel {
|
||||||
];
|
];
|
||||||
default:
|
default:
|
||||||
const item = actionActor.items.get(this.source.item);
|
const item = actionActor.items.get(this.source.item);
|
||||||
return item ? item.system.actionsList?.find(a => a.id === this.source.action) : null;
|
return item ? item.system.actions?.find(a => a.id === this.source.action) : null;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue