Fix/941 companion hope ranger (#950)

* Temp ActionField attack type missing

* Move missing attack type to getModel

* Fix Companion not updating Partner resources
This commit is contained in:
Dapoulp 2025-08-15 21:27:55 +02:00 committed by GitHub
parent 006f9dde1f
commit 841819ee89
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 5 additions and 4 deletions

View file

@ -208,8 +208,9 @@ export default class DHBaseAction extends ActionMixin(foundry.abstract.DataModel
}
async consume(config, successCost = false) {
const usefulResources = {
...foundry.utils.deepClone(this.actor.system.resources),
const actor= this.actor.system.partner ?? this.actor,
usefulResources = {
...foundry.utils.deepClone(actor.system.resources),
fear: {
value: game.settings.get(CONFIG.DH.id, CONFIG.DH.SETTINGS.gameSettings.Resources.Fear),
max: game.settings.get(CONFIG.DH.id, CONFIG.DH.SETTINGS.gameSettings.Homebrew).maxFear,
@ -246,7 +247,7 @@ export default class DHBaseAction extends ActionMixin(foundry.abstract.DataModel
}
}, []);
await (this.actor.system.partner ?? this.actor).modifyResource(resources);
await actor.modifyResource(resources);
if (
config.uses?.enabled &&
((!successCost && (!config.uses?.consumeOnSuccess || config.roll?.success)) ||

View file

@ -631,7 +631,7 @@ export default class DhpActor extends Actor {
}
async modifyResource(resources) {
if (!resources.length) return;
if (!resources?.length) return;
if (resources.find(r => r.key === 'stress')) this.convertStressDamageToHP(resources);
let updates = {