mirror of
https://github.com/Foundryborne/daggerheart.git
synced 2026-01-11 19:25:21 +01:00
Feature/666 experience hope cost (#728)
* h * Character & Companion Experience Hope Cost
This commit is contained in:
parent
f9cb0954f9
commit
45b3569cba
7 changed files with 61 additions and 13 deletions
|
|
@ -221,12 +221,11 @@ export default class DHBaseAction extends ActionMixin(foundry.abstract.DataModel
|
|||
}
|
||||
}
|
||||
|
||||
const resources = config.costs
|
||||
const resources = game.system.api.fields.ActionFields.CostField.getRealCosts(config.costs)
|
||||
.filter(
|
||||
c =>
|
||||
c.enabled !== false &&
|
||||
((!successCost && (!c.consumeOnSuccess || config.roll?.success)) ||
|
||||
(successCost && c.consumeOnSuccess))
|
||||
(!successCost && (!c.consumeOnSuccess || config.roll?.success)) ||
|
||||
(successCost && c.consumeOnSuccess)
|
||||
)
|
||||
.map(c => {
|
||||
const resource = usefulResources[c.key];
|
||||
|
|
@ -238,7 +237,7 @@ export default class DHBaseAction extends ActionMixin(foundry.abstract.DataModel
|
|||
};
|
||||
});
|
||||
|
||||
await this.actor.modifyResource(resources);
|
||||
await (this.actor.system.partner ?? this.actor).modifyResource(resources);
|
||||
if (
|
||||
config.uses?.enabled &&
|
||||
((!successCost && (!config.uses?.consumeOnSuccess || config.roll?.success)) ||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue