stattr 0.0.4 → 0.0.5

Sign up to get free protection for your applications and to get access to all the features.
Files changed (2) hide show
  1. data/lib/stattr.rb +29 -2
  2. metadata +1 -1
@@ -1,4 +1,4 @@
1
- Statlist = ['STR', 'DEX', 'CHA', 'INT', 'WIS', 'CON']
1
+ Normstats = ['STR', 'DEX', 'CHA', 'INT', 'WIS', 'CON']
2
2
 
3
3
  # Roll a D(sides) size die.
4
4
  def rolld(sides)
@@ -47,9 +47,36 @@ end
47
47
  #This iterates through the Stat list and turns each stat into a key. It then rolls 3 d6's to get the starting value for that stat.
48
48
  def statroll
49
49
  stathash = {}
50
- Statlist.each do |stat|
50
+ Normstats.each do |stat|
51
51
  stathash[stat] = modstat(rollmanyd(6,3))
52
52
  end
53
53
  stathash
54
54
  end
55
55
 
56
+
57
+ #Classes
58
+ # Extend these to increase the overall functionality of your app/game!
59
+
60
+
61
+ class Statlist
62
+ attr_accessor :str, :dex, :cha, :con, :wis, :int
63
+ @@sides = 6
64
+ @@dicenum = 3
65
+ def initialize
66
+ @str = modstat(rollmanyd(@@sides, @@dicenum))
67
+ @dex = modstat(rollmanyd(@@sides, @@dicenum))
68
+ @cha = modstat(rollmanyd(@@sides, @@dicenum))
69
+ @con = modstat(rollmanyd(@@sides, @@dicenum))
70
+ @wis = modstat(rollmanyd(@@sides, @@dicenum))
71
+ @int = modstat(rollmanyd(@@sides, @@dicenum))
72
+ end
73
+ end
74
+
75
+ class Playerchar
76
+ attr_accessor :stats, :name
77
+
78
+ def initialize(name)
79
+ @name = name
80
+ @stats = Statlist.new
81
+ end
82
+ end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: stattr
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.4
4
+ version: 0.0.5
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors: