summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'src/struct/attributes.erl')
-rw-r--r--src/struct/attributes.erl19
1 files changed, 19 insertions, 0 deletions
diff --git a/src/struct/attributes.erl b/src/struct/attributes.erl
index 022cad2..bb68032 100644
--- a/src/struct/attributes.erl
+++ b/src/struct/attributes.erl
@@ -39,6 +39,14 @@
]
).
+%%%% Accessors
+-export
+(
+ [
+ random/0
+ ]
+).
+
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%% LOCAL FUNCTIONS %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
@@ -66,3 +74,14 @@ set_speed (Val, Att) ->
Att#attributes{ speed = Val }.
set_strength (Val, Att) ->
Att#attributes{ strength = Val }.
+
+random () ->
+ #attributes
+ {
+ constitution = roll:percentage(),
+ dexterity = roll:percentage(),
+ intelligence = roll:percentage(),
+ mind = roll:percentage(),
+ speed = roll:percentage(),
+ strength = roll:percentage()
+ }.