Action Save difficulty (#427)

* Action Save difficulty

* Unequipped item icon opacity

* Fix sheet header
This commit is contained in:
Dapoulp 2025-07-27 14:40:25 +02:00 committed by GitHub
parent 33ac7d5ab7
commit 8cb4b7663e
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
13 changed files with 20 additions and 12 deletions

View file

@ -110,6 +110,7 @@ export default class DHActionConfig extends DaggerheartSheet(ApplicationV2) {
context.costOptions = this.getCostOptions();
context.disableOption = this.disableOption.bind(this);
context.isNPC = this.action.actor?.isNPC;
context.baseSaveDifficulty = this.action.actor?.baseSaveDifficulty;
context.hasRoll = this.action.hasRoll;
const settingsTiers = game.settings.get(CONFIG.DH.id, CONFIG.DH.SETTINGS.gameSettings.LevelTiers).tiers;

View file

@ -311,7 +311,7 @@ export default class CharacterSheet extends DHBaseActorSheet {
icon: 'fa-solid fa-hands',
condition: target => {
const doc = getDocFromElementSync(target);
return doc && system.equipped;
return doc && doc.system.equipped;
},
callback: (target, event) => CharacterSheet.#toggleEquipItem.call(this, event, target)
}

View file

@ -305,7 +305,7 @@ export default class DHBaseAction extends ActionMixin(foundry.abstract.DataModel
title: 'Roll Save',
roll: {
trait: this.save.trait,
difficulty: this.save.difficulty,
difficulty: this.save.difficulty ?? this.actor?.baseSaveDifficulty,
type: 'reaction'
},
data: target.actor.getRollData()

View file

@ -8,7 +8,7 @@ export default class SaveField extends fields.SchemaField {
initial: null,
choices: CONFIG.DH.ACTOR.abilities
}),
difficulty: new fields.NumberField({ nullable: true, initial: 10, integer: true, min: 0 }),
difficulty: new fields.NumberField({ nullable: true, initial: null, integer: true, min: 0 }),
damageMod: new fields.StringField({
initial: CONFIG.DH.ACTIONS.damageOnSave.none.id,
choices: CONFIG.DH.ACTIONS.damageOnSave

View file

@ -6,8 +6,7 @@ export default class TargetField extends fields.SchemaField {
type: new fields.StringField({
choices: CONFIG.DH.ACTIONS.targetTypes,
initial: CONFIG.DH.ACTIONS.targetTypes.any.id,
nullable: true,
initial: null
nullable: true
}),
amount: new fields.NumberField({ nullable: true, initial: null, integer: true, min: 0 })
};

View file

@ -385,6 +385,10 @@ export default class DhpActor extends Actor {
return CONFIG.Dice.daggerheart[['character', 'companion'].includes(this.type) ? 'DualityRoll' : 'D20Roll'];
}
get baseSaveDifficulty() {
return this.system.difficulty ?? 10;
}
getRollData() {
const rollData = super.getRollData();
rollData.system = this.system.getRollData();