#Alchemist Bombs - Script Call for Charge Consumption

1 messages · Page 1 of 1 (latest)

azure parcel
#

@balmy ferry I see you're offline at the moment, but I will post screenshots showing the setup that the Script Call expects:

#

Actually, a better question before I do that:

Are you on PF1E 0.81.0 or an older version? I'm setting things up again on my 0.81.0 set up and it's not working, so I will do a new set up to take advantage of the action usages.

azure parcel
#

@balmy ferry I do apologize! There was a type on the code where a ) was ending things too early.

I've re-produced a fixed version here:

=========================
Consume Charges per attack (like Bombs)

  1. Set the Auto-Deduct Charges to zero.
  2. Add this into the "Use" script call on the attack:
let theActor = token?.actor ?? actor;
let newUses = item.data.data.uses.value - attacks.length;

if( item.links?.charges?._id !== undefined) {
    await theActor.updateEmbeddedDocuments("Item", [{_id: item.links.charges.id, 'data.uses.value': newUses}]);
}
else {
    await theActor.updateEmbeddedDocuments("Item", [{_id: item.id, 'data.uses.value': newUses}]);
}```


You can also optionally adjust the Formulaic Attacks to wrap the entire contents in `min((@item.uses.value - 1),  <usual stuff here>)` to help clamp things down if you don't have enough for a full attack
balmy ferry
#

@azure parcel This worked perfectly! Thank you! I was able to set up this with subactions for all the different bomb types too!