Class: BCDice::GameSystem::OneWayHeroics::StatusDown

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

Instance Method Summary collapse

Constructor Details

#initialize(status, times) ⇒ StatusDown

Returns a new instance of StatusDown.



28
29
30
31
# File 'lib/bcdice/game_system/one_way_heroics/tables.rb', line 28

def initialize(status, times)
  @status = status
  @times = times
end

Instance Method Details

#roll(randomizer) ⇒ Object



33
34
35
36
37
38
39
40
41
42
43
44
# File 'lib/bcdice/game_system/one_way_heroics/tables.rb', line 33

def roll(randomizer)
  dice_list = randomizer.roll_barabara(@times, 6)
  total = dice_list.sum()

  sequence = [
    "#{@status}#{@times}D6減少する",
    "#{@times}D6[#{dice_list.join(',')}]",
    "#{@status}#{total} 減少する"
  ]

  return sequence.join("")
end