Class: BCDice::GameSystem::DeadlineHeroes::HeroNameElementChart
- Inherits:
-
Object
- Object
- BCDice::GameSystem::DeadlineHeroes::HeroNameElementChart
- Defined in:
- lib/bcdice/game_system/DeadlineHeroes.rb
Instance Method Summary collapse
-
#initialize(name, items) ⇒ HeroNameElementChart
constructor
A new instance of HeroNameElementChart.
- #roll(randomizer) ⇒ Array<(String, String)>
Constructor Details
#initialize(name, items) ⇒ HeroNameElementChart
Returns a new instance of HeroNameElementChart.
351 352 353 354 |
# File 'lib/bcdice/game_system/DeadlineHeroes.rb', line 351 def initialize(name, items) @name = name @items = items end |
Instance Method Details
#roll(randomizer) ⇒ Array<(String, String)>
358 359 360 361 362 363 364 |
# File 'lib/bcdice/game_system/DeadlineHeroes.rb', line 358 def roll(randomizer) dice = randomizer.roll_once(10) chosen = @items[dice - 1] result = "#{@name}(#{dice}) > #{chosen[:element]} (意味:#{chosen[:mean]})" return result, chosen[:element] end |