Class: BCDice::GameSystem::OneWayHeroics::GoldFlow

Inherits:
Object
  • Object
show all
Defined in:
lib/bcdice/game_system/one_way_heroics/tables.rb

Instance Method Summary collapse

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.roll_barabara(@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