Merge pull request #78 from lhayhurst/feature/roll-item-refactoring

Added rollItem() family of methods
This commit is contained in:
Material Foundry
2021-06-07 14:46:19 +02:00
committed by GitHub
6 changed files with 23 additions and 1 deletions

View File

@@ -130,4 +130,8 @@ export class demonlord{
getSpellUses(token,level,item) { getSpellUses(token,level,item) {
return; return;
} }
rollItem(item) {
return item.roll()
}
} }

View File

@@ -195,4 +195,8 @@ export class dnd35e{
maximum: item.maxCharges maximum: item.maxCharges
} }
} }
rollItem(item) {
return item.roll()
}
} }

View File

@@ -198,4 +198,8 @@ export class dnd5e{
maximum: token.actor.data.data.spells?.[`spell${level}`].max maximum: token.actor.data.data.spells?.[`spell${level}`].max
} }
} }
rollItem(item) {
return item.roll()
}
} }

View File

@@ -192,4 +192,8 @@ export class pf2e{
maximum: spellbook.data.data.slots?.[`slot${level}`].max maximum: spellbook.data.data.slots?.[`slot${level}`].max
} }
} }
rollItem(item) {
return item.roll()
}
} }

View File

@@ -238,4 +238,8 @@ export class TokenHelper{
getSpellUses(token,level,item) { getSpellUses(token,level,item) {
return this.system.getSpellUses(token,level,item); return this.system.getSpellUses(token,level,item);
} }
rollItem(item) {
return this.system.rollItem(item);
}
} }

View File

@@ -739,7 +739,9 @@ export class TokenControl{
items = this.sortItems(items); items = this.sortItems(items);
const item = items[itemNr]; const item = items[itemNr];
if (item != undefined) item.roll(); if (item != undefined) {
tokenHelper.rollItem(item);
}
} }
} }