Skip to content
This repository has been archived by the owner on Jul 10, 2021. It is now read-only.

Commit

Permalink
Fix expending and regaining spell slots in pf2e (#298)
Browse files Browse the repository at this point in the history
* Update module.json

* Update module.json

* Update module.json

* Update module.json

* Update module.json

* Update module.json

* Update module.json

* Update module.json

* Update module.json

* Update module.json

* Update module.json

* Update module.json

* Update module.json

* Update module.json

* Update module.json

* Update module.json

* Update module.json

* Update module.json

* Update module.json

* Update module.json

* Fix expending and regaining spell slots
  • Loading branch information
Drental authored Jul 3, 2021
1 parent 68f457f commit 881b473
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion module.json
Original file line number Diff line number Diff line change
@@ -1 +1 @@
{"name":"token-action-hud","title":"Token Action HUD","author":"^ and stick#0520","description":"Creates a HUD showing a selected token's common actions.","minimumCoreVersion":"0.7.0","compatibleCoreVersion":"0.8.6","scripts":["./lib/tagify/tagify.min.js"],"esmodules":["./scripts/init.js"],"styles":["./styles/token-action-hud.css","/styles/lib/tagify/tagify.css"],"systems":["dnd5e","dungeonworld","pf2e","wfrp4e","sfrpg","sw5e","demonlord","pf1","lancer","D35E","swade","starwarsffg","tormenta20","blades-in-the-dark","symbaroum","od6s","alienrpg","cthack","kamigakari"],"languages":[{"lang":"en","name":"English","path":"lang/en.json"},{"lang":"ko","name":"Korean","path":"lang/ko.json"},{"lang":"pt-BR","name":"Português (Brasil)","path":"lang/br.json"},{"lang":"es","name":"Spanish","path":"lang/es.json"},{"lang":"fr","name":"French","path":"lang/fr.json"},{"lang":"pl","name":"Polish","path":"lang/pl.json"},{"lang":"ja","name":"日本語","path":"lang/ja.json"},{"lang":"cn","name":"中文","path":"lang/cn.json"},{"lang":"de","name":"Deutsch","path":"lang/de.json"}],"url":"https://github.com/espositos/fvtt-tokenactionhud","manifest":"https://github.com/espositos/fvtt-tokenactionhud/raw/master/module.json","version":"1.1.4","download":"https://github.com/espositos/fvtt-tokenactionhud/releases/download/1.1.4/release_1.1.4.zip"}
{"name":"token-action-hud","title":"Token Action HUD","author":"^ and stick#0520","description":"Creates a HUD showing a selected token's common actions.","minimumCoreVersion":"0.7.0","compatibleCoreVersion":"0.8.6","scripts":["./lib/tagify/tagify.min.js"],"esmodules":["./scripts/init.js"],"styles":["./styles/token-action-hud.css","/styles/lib/tagify/tagify.css"],"systems":["dnd5e","dungeonworld","pf2e","wfrp4e","sfrpg","sw5e","demonlord","pf1","lancer","D35E","swade","starwarsffg","tormenta20","blades-in-the-dark","symbaroum","od6s","alienrpg","cthack","kamigakari"],"languages":[{"lang":"en","name":"English","path":"lang/en.json"},{"lang":"ko","name":"Korean","path":"lang/ko.json"},{"lang":"pt-BR","name":"Português (Brasil)","path":"lang/br.json"},{"lang":"es","name":"Spanish","path":"lang/es.json"},{"lang":"fr","name":"French","path":"lang/fr.json"},{"lang":"pl","name":"Polish","path":"lang/pl.json"},{"lang":"ja","name":"日本語","path":"lang/ja.json"},{"lang":"cn","name":"中文","path":"lang/cn.json"},{"lang":"de","name":"Deutsch","path":"lang/de.json"}],"url":"https://github.com/espositos/fvtt-tokenactionhud","manifest":"https://github.com/espositos/fvtt-tokenactionhud/raw/master/module.json","version":"1.1.5","download":"https://github.com/espositos/fvtt-tokenactionhud/releases/download/1.1.5/release_1.1.5.zip"}
6 changes: 3 additions & 3 deletions scripts/rollHandlers/pf2e/pf2e-base.js
Original file line number Diff line number Diff line change
Expand Up @@ -231,9 +231,9 @@ export class RollHandlerBasePf2e extends RollHandler {

let update;
if (slot === 'focus')
update = [{id: spellbook.id, data: { focus: {points: value}}}];
update = [{_id: spellbook.id, data: { focus: {points: value}}}];
else
update = [{id: spellbook.id, data: {slots: {[slot]: {value: value}}}}];
update = [{_id: spellbook.id, data: { slots: {[slot]: {value: value}}}}];

await Item.updateDocuments(update, {parent: actor});
Hooks.callAll('forceUpdateTokenActionHUD');
Expand Down Expand Up @@ -408,7 +408,7 @@ export class RollHandlerBasePf2e extends RollHandler {

const key = `data.slots.slot${level}.prepared.${spellSlot}`;
const options = {
id: spellbookId,
_id: spellbookId,
};
options[key] = {
expended: true,
Expand Down

0 comments on commit 881b473

Please sign in to comment.