Merged with development

This commit is contained in:
WBHarry 2025-09-06 23:23:07 +02:00
commit 19a07139ff
548 changed files with 4997 additions and 2887 deletions

View file

@ -1,9 +1,9 @@
import DHAbilityUse from "./abilityUse.mjs";
import DHActorRoll from "./adversaryRoll.mjs";
import DHAbilityUse from './abilityUse.mjs';
import DHActorRoll from './actorRoll.mjs';
export const config = {
abilityUse: DHAbilityUse,
adversaryRoll: DHActorRoll,
damageRoll: DHActorRoll,
dualityRoll: DHActorRoll
abilityUse: DHAbilityUse,
adversaryRoll: DHActorRoll,
damageRoll: DHActorRoll,
dualityRoll: DHActorRoll
};

View file

@ -55,9 +55,12 @@ export default class DHActorRoll extends foundry.abstract.TypeDataModel {
}
get action() {
const actionItem = this.actionItem;
if (!actionItem || !this.source.action) return null;
return actionItem.system.actionsList?.find(a => a.id === this.source.action);
const actionActor = this.actionActor,
actionItem = this.actionItem;
if (!this.source.action) return null;
if (actionItem) return actionItem.system.actionsList?.find(a => a.id === this.source.action);
else if (actionActor?.system.attack?._id === this.source.action) return actionActor.system.attack;
return null;
}
get targetMode() {
@ -95,7 +98,7 @@ export default class DHActorRoll extends foundry.abstract.TypeDataModel {
}
registerTargetHook() {
if (!this.parent.isAuthor) return;
if (!this.parent.isAuthor || !this.hasTarget) return;
if (this.targetMode && this.parent.targetHook !== null) {
Hooks.off('targetToken', this.parent.targetHook);
return (this.parent.targetHook = null);
@ -113,7 +116,7 @@ export default class DHActorRoll extends foundry.abstract.TypeDataModel {
this.currentTargets = this.getTargetList();
// this.registerTargetHook();
if (this.targetMode === true && this.hasRoll) {
if (this.hasRoll) {
this.targetShort = this.targets.reduce(
(a, c) => {
if (c.hit) a.hit += 1;
@ -127,7 +130,8 @@ export default class DHActorRoll extends foundry.abstract.TypeDataModel {
}
this.canViewSecret = this.parent.speakerActor?.testUserPermission(game.user, 'OBSERVER');
this.canButtonApply = game.user.isGM;
this.canButtonApply = game.user.isGM; //temp
this.isGM = game.user.isGM; //temp
}
getTargetList() {