foundryvtt-shadowdark icon indicating copy to clipboard operation
foundryvtt-shadowdark copied to clipboard

Refactor: Centralize one place to calculate attack- and damage-bonuses

Open bakbakbakbakbak opened this issue 2 years ago • 1 comments

It is used in both the Display functionality on the character sheet, as well as for the dice mechanics. I am not a big fan of how I have to jump around as I always forget I put the code for calculating this in the ActorSheetSD class. And it may make sense to either have a method in the RollSD class that uses optional actor and item do determine these bonuses.

I suggest we wait with this refactor until the test suite I'm going to work on after 1.0.0 release is done.

bakbakbakbakbak avatar Mar 24 '23 06:03 bakbakbakbakbak

This is partly done by the calcWeaponMasterBonus function. I would like to add one for backstabbing, but I want to find a way to do this and keeping the testability of the code without having to mock actual actors and items unnecessarily.

bakbakbakbakbak avatar Mar 24 '23 13:03 bakbakbakbakbak