mirror of
https://github.com/Foundryborne/daggerheart.git
synced 2026-01-12 03:31:07 +01:00
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:
parent
006f9dde1f
commit
841819ee89
2 changed files with 5 additions and 4 deletions
|
|
@ -208,8 +208,9 @@ export default class DHBaseAction extends ActionMixin(foundry.abstract.DataModel
|
||||||
}
|
}
|
||||||
|
|
||||||
async consume(config, successCost = false) {
|
async consume(config, successCost = false) {
|
||||||
const usefulResources = {
|
const actor= this.actor.system.partner ?? this.actor,
|
||||||
...foundry.utils.deepClone(this.actor.system.resources),
|
usefulResources = {
|
||||||
|
...foundry.utils.deepClone(actor.system.resources),
|
||||||
fear: {
|
fear: {
|
||||||
value: game.settings.get(CONFIG.DH.id, CONFIG.DH.SETTINGS.gameSettings.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,
|
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 (
|
if (
|
||||||
config.uses?.enabled &&
|
config.uses?.enabled &&
|
||||||
((!successCost && (!config.uses?.consumeOnSuccess || config.roll?.success)) ||
|
((!successCost && (!config.uses?.consumeOnSuccess || config.roll?.success)) ||
|
||||||
|
|
|
||||||
|
|
@ -631,7 +631,7 @@ export default class DhpActor extends Actor {
|
||||||
}
|
}
|
||||||
|
|
||||||
async modifyResource(resources) {
|
async modifyResource(resources) {
|
||||||
if (!resources.length) return;
|
if (!resources?.length) return;
|
||||||
|
|
||||||
if (resources.find(r => r.key === 'stress')) this.convertStressDamageToHP(resources);
|
if (resources.find(r => r.key === 'stress')) this.convertStressDamageToHP(resources);
|
||||||
let updates = {
|
let updates = {
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue