anathema/anathema — pull request #133 by curttasker (2012-04-11 01:27:38+00:00)
Title: Dodge DV with Specialties

So here's my implementation of adding support for [#113](https://github.com/anathema/anathema/issues/113).

If a character has a Dodge specialty, it uses it to calculate the Dodge DV with the highest dot Dodge specialty, then displays that value on the character sheet next to the usual Dodge DV. If there is no dodge specialty, nothing new is displayed on the sheet.

I ended up cleaning up `CharacterUtilities`, but its still a bit of a mess; I plan to poke at it a bit further this week. My changes laid the groundwork for adding in dodge DV pool modifiers from equipment to the calculation. So, whenever [#119](https://github.com/anathema/anathema/issues/119) is settled is settled, it will involve a very small change to tie it in.

I'm open to refactoring this a thing a bit further, but I need a little feedback:

The main meat of this feature is pulling out the highest dot specialty from the `IGenericCharacter`. Where should this be done? I need access to the result of `IGenericCharacter.getSpecialties()` to do the calculation. Right now I'm grabbing the list of specialties in `CombatStatsContent` (and `SecondEditionDBTCombatEncoder`), and sending it down to `CharacterUtilities.getDodgeDvWithSpecialty()` along with the rest of the usual data. I do the calculation there, take the highest dot Dodge specialty and use that to calculate the DV pool, then pass back the final rounded DV.

I suppose I could send down `IGenericCharacter` instead of `ICharacterType` and `INamedGenericTrait[]`, since every place that calls this function just grabs it from the character object anyways. That would move the querying of dodge specialties to `CharacterUtilities` alongside the calculation of the highest dot specialty.

I could also just build a function into `IGenericCharacter` to fetch the highest dodge specialty as an integer, and then all `CharacterUtilities` would do is query the int value directly from `IGenericCharacter`.

Any other thoughts?