View Source ExTTRPGDev.RuleSystems.RuleSystem (ExTTRPGDev v0.3.0)
Module for handling a specific Rule System
Link to this section Summary
Functions
Loads a RuleSystem struct from a json string representation
Generates a set of ability scores assigned to the rule systems abilities using the system's default assignment method .
Generates an unassigned set of ability scores using the system's default assignment method.
Returns the spec for the given spec name
Link to this section Functions
Loads a RuleSystem struct from a json string representation
examples
Examples
iex> ExTTRPGDev.RuleSystems.RuleSystem.from_json!("a json string")
%ExTTRPGDev.RuleSystems.RuleSystem{}
Generates a set of ability scores assigned to the rule systems abilities using the system's default assignment method .
examples
Examples
iex> RuleSystem.gen_ability_scores()
%{
charisma: [4, 3, 1],
constitution: [5, 6, 3],
dexterity: [5, 3, 1],
intellegence: [4, 3, 3],
strength: [4, 1, 5],
wisdom: [1, 5, 6]
}
Generates an unassigned set of ability scores using the system's default assignment method.
examples
Examples
iex> RuleSystem.gen_ability_scores(%RuleSystem{})
[[1, 6, 6], [3, 3, 2], [3, 6, 3], [4, 2, 1], [6, 5, 1], [6, 4, 6]]
Returns the spec for the given spec name
examples
Examples
iex> ExTTRPGDev.RuleSystems.get_spec_by_name(rule_system, spec_name)
%Spec{}