Class: BCDice::GameSystem::OneWayHeroics::GoldFlow
- Inherits:
-
Object
- Object
- BCDice::GameSystem::OneWayHeroics::GoldFlow
- Defined in:
- lib/bcdice/game_system/one_way_heroics/tables.rb
Instance Method Summary collapse
-
#initialize(times, action) ⇒ GoldFlow
constructor
A new instance of GoldFlow.
- #roll(randomizer) ⇒ Object
Constructor Details
#initialize(times, action) ⇒ GoldFlow
Returns a new instance of GoldFlow.
7 8 9 10 |
# File 'lib/bcdice/game_system/one_way_heroics/tables.rb', line 7 def initialize(times, action) @times = times @action = action end |
Instance Method Details
#roll(randomizer) ⇒ Object
12 13 14 15 16 17 18 19 20 21 22 23 24 |
# File 'lib/bcdice/game_system/one_way_heroics/tables.rb', line 12 def roll(randomizer) dice_list = randomizer.(@times, 6) dice_total = dice_list.sum() gold = dice_total * 100 sequence = [ "#{@times}D6に100を掛け、それだけの【所持金】を#{@action}", "#{@times}D6[#{dice_list.join(',')}]*100", "【所持金】#{gold} を#{@action}" ] return sequence.join(" > ") end |