morepurplemorebetter / MPMBs-Character-Record-Sheet

MorePurpleMoreBetter's D&D 5e Character Record Sheet
https://www.flapkan.com
GNU General Public License v3.0
372 stars 352 forks source link

fixed comment explanations #116

Closed Exodia7 closed 3 years ago

Exodia7 commented 3 years ago

I fixed the explanation of the output.extraHit variable used in the atkCalc attribute (which is part of calcChanges). I assume that the previous explanation was simply a copy from the explanation of output.extraDmg, and modifying it was forgotten.

Also changed the example for the usage of the spellcasters variable used in the spellCalc attribute (which is also part of calcChanges). The previous version of the example didn't work when i tested it (in a sheet at version 13.0.4, which is currently the latest version I believe), and I came across an already coded item that used the syntax that I use in the new version, which I also tested and which worked out.

morepurplemorebetter commented 3 years ago

I just tested the code spellcasters.indexOf("cleric") != -1 and it works perfectly fine for me. The variable spellcasters is an array, so it doesn't make sense to recommend using .test() as a default. The reason why .test() is used in some cases is to allow for similarly named classes or specific features to get the bonus as well (e.g. the Warlock-Book of Ancient Secrets invocation). It all depends on whether you want it to be very strict or not.

Perhaps I can help with the code you were testing with? Because it sounds to me like something else might've been wrong.

I would be interested in merging this pull request if it was only to correct the description for output.extraHit, but not as it is right now.

Exodia7 commented 3 years ago

Hmmm, so I just tried again to do spellcasters.indexOf("ranger") != -1 as you suggested, and indeed that works. Thanks a lot !

I'm guessing I must have made other mistakes when it didn't work, sorry about that ... Thanks for the offer to help, but in the meantime I have already completed the item I was working on 😄

I'll try to see if I can remove that change from the pull request, or otherwise I'll just add another pull request with just the comment change for output.extraHit.

Exodia7 commented 3 years ago

Alright I managed to keep only the change of the extraHit variable in the calcChanges.atkCalc attribute. Let me know if there's something else to do 😄

Thanks again for your answer, have a nice day