mivalsten / ddb-dm-screen

MIT License
30 stars 10 forks source link

Properly count Draconic Resilience HP #9

Closed mivalsten closed 5 years ago

mivalsten commented 5 years ago

As of version 1.2.3 draconic resilience is counted as follows:

if (x.classes[j].subclassDefinition.name == "Draconic Bloodline") {character.bonusHP += x.classes[j].level;}

this is ugly as omething very ugly and should be fixed. Probable fix is to record all classes separately and then match with modifiers.class.id.

I think that modifiers follow ID of "classFeature_xxy_zzzz" where xx is some class ID, y is subclass id and z is feature id, but more testing needs to be done. Properly documenting and fixing this issue will probably help a ton with future improvements.

MathieuDR commented 5 years ago

This line also bugs when there are no sub classes. (low level characters)

mivalsten commented 5 years ago

If there are no subclasses then x.classes[j].subclasses is equal to null, so if is false, no problem there.