mirror of
https://github.com/Foundryborne/daggerheart.git
synced 2026-01-12 11:41:08 +01:00
Creating a shared method called isItemAvailable and using it in downtime
This commit is contained in:
parent
12d6b7fa4c
commit
459f87f24c
4 changed files with 46 additions and 40 deletions
|
|
@ -93,8 +93,7 @@ export default class DhpDowntime extends HandlebarsApplicationMixin(ApplicationV
|
|||
}
|
||||
|
||||
getRefreshables() {
|
||||
const actionItems = this.actor.items.reduce((acc, x) => {
|
||||
// TODO(nsalyzyn): Eliminate items that the are part of the subclass the actor doesn't have access to.
|
||||
const actionItems = this.actor.items.filter(x => this.actor.system.isItemAvailable(x)).reduce((acc, x) => {
|
||||
if (x.system.actions) {
|
||||
const recoverable = x.system.actions.reduce((acc, action) => {
|
||||
if (refreshIsAllowed([this.shortrest ? 'shortRest' : 'longRest'], action.uses.recovery)) {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue