Class: BCDice::GameSystem::DeadlineHeroes::HeroNameElementChart

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

Instance Method Summary collapse

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)>

Parameters:

Returns:

  • (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