toastygm / HarnMaster-3-FoundryVTT

An unofficial system for playing the HârnMaster 3 game by Columbia Games, Inc., on Foundry VTT.
GNU General Public License v3.0
9 stars 4 forks source link

Negative sunsign modifiers aren't being applied to Convocational Skillbase #346

Closed ErnoRubik closed 2 years ago

ErnoRubik commented 2 years ago

I searched through the current and past tickets to try to make sure I'm not duplicating; if I have by mistake, my apologies.

My uncle and I have two HM groups and both groups are now using Foundry - we love the HM integration you've built! Absolutely killer.

We have several players (including myself) that love playing magic users, and we've noticed that while the skillbase formulae for the various Convocations specifies the appropriate negative sunsign modifiers, they aren't included in the SB calculation.

As an example: Savoryan mage with INT 18, AUR 18, and Feniri sunsign should have a Savorya SB of 15, but it shows 18. Same story with other magic user characters.

Are you able to replicate?

Thank you and keep up the great work! We love to see that we're not the only ones who play HM!

Screen Shot 2022-07-10 at 8 17 30 PM
ErnoRubik commented 2 years ago

I think I've tracked down the source of the bug.
In utility.js, ssBonus is initialized to 0. On ln.195, ssBonus is then set to Max of either ssParts[1] (the bonus/penalty from the formula) or ssBonus (which is 0). Thus in the case of Feniri:-3, it takes the 0.

ErnoRubik commented 2 years ago

I have a functional fix in my local copy. What I did basically is, each time it finds a sunsign match (actor to sb-formula), it chucks it into an array. At the end of the for loop, if the length of that "matches" array is > 0, then it takes the greatest of the values within the array. Otherwise, it just defaults to the init value of 0.

The code makes more sense...4-line change. I'll fork tomorrow and send you a pull request.

toastygm commented 2 years ago

Fixed in 1.4.3