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

This module handles the different ways of assigning ability scores

Link to this section 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

Link to this section Functions

Link to this function

apply_method_special!(rolls, special)

View Source

Applies a method special to the rolled values

examples

Examples

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

default_assignment(assignment)

View Source

Returns the default assignment method for the defined assignment methods

examples

Examples

iex> Assignment.default_assignment()
Link to this function

roll_via_method!(method)

View Source

Generates an ability score using the Assignment.RollingMethod

examples

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]