summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authornsensfel <SpamShield0@noot-noot.org>2018-02-26 13:52:29 +0100
committernsensfel <SpamShield0@noot-noot.org>2018-02-26 13:52:29 +0100
commitfd4d031ab5b31763d376c663cc049f62ee389243 (patch)
treecd09a29bb888acf772fa1aee59fe95e8bd75fe4e /src/struct/attributes.erl
parent66ec11ce5d2e227846d6e6b2899cda851a70fc04 (diff)
Got it to run, at last.
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()
+ }.