Class: Storyteller::Pool
Overview
This is a models a pool of Storyteller dice.
Instance Attribute Summary
#dstr, #tree
Instance Method Summary
collapse
#average, #maximum, #minimum, #notes, #notes_to_s, #result
Methods included from RollString
#inspect
Constructor Details
#initialize(number = 1, success = 8) ⇒ Pool
Returns a new instance of Pool.
9
10
11
12
13
14
15
|
# File 'lib/dicebag/systems/storyteller.rb', line 9
def initialize(number = 1, success = 8)
@number = number
@success = success
@result = nil
super("#{number}d10e t#{success}")
end
|
Instance Method Details
#roll ⇒ Object
17
18
19
|
# File 'lib/dicebag/systems/storyteller.rb', line 17
def roll
@result = super
end
|
#successes ⇒ Object
21
22
23
24
25
|
# File 'lib/dicebag/systems/storyteller.rb', line 21
def successes
roll unless @result
@result.total
end
|
#tally ⇒ Object
27
28
29
30
31
|
# File 'lib/dicebag/systems/storyteller.rb', line 27
def tally
roll unless @result
@result.sections[0].tally
end
|
#to_s ⇒ Object
33
34
35
|
# File 'lib/dicebag/systems/storyteller.rb', line 33
def to_s
"#{@number}d10/#{@success}"
end
|