View Source ExTTRPGDev.RuleSystems.RuleSystem (ExTTRPGDev v0.2.1)

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.

Link to this section Functions

Link to this function

from_json!(system_config_json)

View Source

Loads a RuleSystem struct from a json string representation

examples

Examples

iex> ExTTRPGDev.RuleSystems.RuleSystem.from_json!("a json string")
%ExTTRPGDev.RuleSystems.RuleSystem{}
Link to this function

gen_ability_scores_assigned(rule_system)

View Source

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]
}
Link to this function

gen_ability_scores_unassigned(rule_system)

View Source

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]]