View Source ExTTRPGDev.RuleSystems.Abilities.Assignment (ExTTRPGDev v0.4.0)

This module handles the different ways of assigning ability scores

Summary

Functions

Applies a method special to the rolled values

Returns the default assignment method for the defined assignment methods

Generates an ability score using the Assignment.RollingMethod

Functions

apply_method_special!(rolls, special)

Applies a method special to the rolled values

Examples

iex> Assignment.apply_method_special!([4, 3, 2, 1], "drop_lowest")
[2, 3, 4]

default_assignment(assignment)

Returns the default assignment method for the defined assignment methods

Examples

iex> Assignment.default_assignment()

roll_via_method!(method)

Generates an ability score using the Assignment.RollingMethod

Examples

# Although not necessary, let's seed the random algorithm
iex> :rand.seed(:exsplus, 1337)
iex> Assignment.roll_via_method!(%Assignment.RollingMethod{dice: "3d6"})
[6, 2, 3]