Merge branch 'main' into feature/action-areas

This commit is contained in:
Carlos Fernandez 2026-04-20 20:19:58 -04:00
commit f348b64aae
53 changed files with 1240 additions and 288 deletions

View file

@ -200,7 +200,6 @@ export default class DhActiveEffect extends foundry.documents.ActiveEffect {
static effectSafeEval(expression) {
let result;
try {
// eslint-disable-next-line no-new-func
const evl = new Function('sandbox', `with (sandbox) { return ${expression}}`);
result = evl(Roll.MATH_PROXY);
} catch (err) {

View file

@ -602,7 +602,7 @@ export default class DhpActor extends Actor {
rollData.system = this.system.getRollData();
rollData.prof = this.system.proficiency ?? 1;
rollData.cast = this.system.spellcastModifier ?? 1;
return rollData;
}

View file

@ -3,7 +3,7 @@ export default class DhActorCollection extends foundry.documents.collections.Act
get party() {
const id = game.settings.get(CONFIG.DH.id, CONFIG.DH.SETTINGS.gameSettings.ActiveParty);
const actor = game.actors.get(id);
return actor?.type === "party" ? actor : null;
return actor?.type === 'party' ? actor : null;
}
/** Ensure companions are initialized after all other subtypes. */

View file

@ -76,6 +76,13 @@ export default class DHItem extends foundry.documents.Item {
return this.system.metadata.isInventoryItem ?? false;
}
/** Returns true if the item can be used */
get usable() {
const actor = this.actor;
const actionsList = this.system.actionsList;
return this.isOwner && actor?.type === 'character' && (actionsList?.size || actionsList?.length);
}
/** @inheritdoc */
static async createDialog(data = {}, createOptions = {}, options = {}) {
const { folders, types, template, context = {}, ...dialogOptions } = options;