View Source ExTTRPGDev.RuleSystems.Abilities.ModifierCalculation (ExTTRPGDev v0.2.1)

Module handling calculation of ability modifiers based on ability scores

Link to this section Summary

Functions

Takes in a ModifierCalculation struct and a score, and calculates the scores modifier

Link to this section Functions

Link to this function

modifier_for_score(modifier_calculation, score)

View Source

Takes in a ModifierCalculation struct and a score, and calculates the scores modifier

examples

Examples

iex> modifier_for_score(%ModifierCalculation{steps: [%Step{}, %Step{}, ...]}, 13)
1
modifier_for_score(%ModifierCalculation{mapping: [%Mapping{}, %Mapping, ...], 6)
-2
Link to this function

modify_score_by_step(step, score)

View Source