kakaroto / Beyond20

D&D Beyond Character Sheet Integration in Roll20
GNU General Public License v3.0
489 stars 144 forks source link

Update beyond20.js #1080

Open koalana51066 opened 1 year ago

koalana51066 commented 1 year ago

Add targets to chat messages

koalana51066 commented 1 year ago

Oops, I also added some changes to save targets to tokens. I didn't intend to include those changes but I don't have a version of the file with them separated. I "stole" the code from a module called Token Targeting and adjusted it to suit my needs.

koalana51066 commented 1 year ago

The change to encounter.js is probably in the wrong place. The idea is to send the name of the monster from the tracker card on the left. If there are multiple copies of the same monster, they get appended with (A), (B), etc. Since I try to make my tokens in Foundry the same, I thought it would be nice to know which one was making the roll even though their stat blocks are the same. This is just for having an accurate record in case there are questions later.

My code checks to see if the tracker card name (with "is-turn" class) contains the summary card name. If not, the summary card name is sent. I so, the tracker card name is sent.

koalana51066 commented 1 year ago

The change to findToken() was because I thought it would be useful when you don't have an associated request from which to get the name. I wound up never using it. That could be removed.

kakaroto commented 11 months ago

Hi @koalana51066, Sorry for the delay in reviewing this, I just wanted you to know that I've seen it and will get to fully reviewing when I get the time to work on Beyond20. And thank you for your contribution, it's very much appreciated!