TemplePlus icon indicating copy to clipboard operation
TemplePlus copied to clipboard

Stat level mods calculated incorrectly

Open dolio opened this issue 4 years ago • 2 comments

The (vanilla) implementation of stat_level_get for stat_X_mod seems to not take into account bonuses/penalties, including racial bonuses/penalties. This appears to be because StatLevelGetAbilityScoreMod uses ObjStatBaseGet to get the base ability score, not the current ability score.

It doesn't seem like there are many calls to the former function, so this would be most likely to affect scripts, I think. Perhaps more places should use it, though. For instance, TripCheck just calculates the mod itself from the ability score, but that means encumbrance isn't factored in to the dexterity modifier (if it's chosen).

I suppose, in addition, StatLevelGetAbilityScoreMod is factoring in the max dex bonus from encumbrance, but not armor. Perhaps it should do the latter as well.

dolio avatar May 20 '21 05:05 dolio

Hmmm, i think trip check factors in encumbrance from the abilityCheckMod dispatch.

Otherwise I think most of the time you just calculate stat level get directly and subtract 10, no?

DudeMcDude avatar May 22 '21 11:05 DudeMcDude

That doesn't seem to be the case. If I pump a character up to 30 dex, then make them encumbered and have another character try to trip them, the roll screen still says they're getting +10. Same if I have them wear full plate.

I know it's possible to cap the overall bonus on a bonus list, but I'm not sure doing it via the ability check modifier bonus list would be correct in this situation. I think encumbrance and armor impose a cap on the dexterity modifier contribution to the check, not on the bonus to the ability check from all sources. If this were the approach, too, then the decision making between strength and dexterity in TripCheck would still be wrong. It's supposed to use the stat with the higher modifier (which would be most advantageous), but it's just checking which stat is highest, without considering that an encumbrance/armor penalty could make the strength modifier better than the dexterity modifier.

It's true that all this complication applies only to dexterity, as far as I know. I can't think of any mechanisms that cap other ability score modifiers.

Edit: oh, by the way, there seems to be no indication on the character sheet that the dex bonus is being capped, either. It still says [30] [+10]. It might be nice to also fix that part. :)

dolio avatar May 22 '21 14:05 dolio