From fd4d031ab5b31763d376c663cc049f62ee389243 Mon Sep 17 00:00:00 2001 From: nsensfel Date: Mon, 26 Feb 2018 13:52:29 +0100 Subject: Got it to run, at last. --- src/struct/attributes.erl | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) (limited to 'src/struct/attributes.erl') 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() + }. -- cgit v1.2.3-70-g09d2