Advertisement
Guest User

Untitled

a guest
Sep 16th, 2021
232
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.21 KB | None | 0 0
  1. //Copy paste this below your game.actors.get line for your actor
  2. if (a) {
  3. const negativeValue = getProperty(a, 'data.flags.pf2e.rollOptions.all.negative-spirit');
  4. const positiveValue = getProperty(a, 'data.flags.pf2e.rollOptions.all.positive-spirit');
  5. if(!negativeValue && positiveValue){
  6. a.update({'flags.pf2e.rollOptions.all.negative-spirit': false, 'flags.pf2e.rollOptions.all.positive-spirit': false});
  7. const regularImg = 'icons/equipment/hand/gauntlet-simple-leather-steel.webp';
  8. this.update({img:regularImg});
  9. }
  10. else if(negativeValue && !positiveValue){
  11. a.update({'flags.pf2e.rollOptions.all.negative-spirit': false, 'flags.pf2e.rollOptions.all.positive-spirit': true});
  12. const positiveImg = 'icons/magic/holy/prayer-hands-glowing-yellow.webp';
  13. this.update({img:positiveImg});
  14. }
  15. else{
  16. a.update({'flags.pf2e.rollOptions.all.negative-spirit': true, 'flags.pf2e.rollOptions.all.positive-spirit': false});
  17. const negativeImg = 'icons/magic/unholy/hands-praying-fire-green.webp';
  18. this.update({img:negativeImg});
  19. }
  20.  
  21.  
  22. } else {
  23. ui.notifications.error(game.i18n.localize('PF2E.MacroActionNoActorError'));
  24. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement