Class: BCDice::GameSystem::BeginningIdol::D66WithAbnormality

Inherits:
DiceTable::D66Table show all
Includes:
WithAbnormality
Defined in:
lib/bcdice/game_system/beginning_idol/with_abnormality.rb

Class Method Summary collapse

Instance Method Summary collapse

Methods included from WithAbnormality

#kanji_to_i, #replace_abnormality

Methods inherited from DiceTable::D66Table

#choice

Constructor Details

#initialize(name, sort_type, items, bad_status_table, locale) ⇒ D66WithAbnormality

Returns a new instance of D66WithAbnormality.



41
42
43
44
45
# File 'lib/bcdice/game_system/beginning_idol/with_abnormality.rb', line 41

def initialize(name, sort_type, items, bad_status_table, locale)
  super(name, sort_type, items)
  @bad_status_table = bad_status_table
  @locale = locale
end

Class Method Details

.from_i18n(key, bad_status_table, locale) ⇒ Object



34
35
36
37
38
39
# File 'lib/bcdice/game_system/beginning_idol/with_abnormality.rb', line 34

def self.from_i18n(key, bad_status_table, locale)
  table = I18n.t(key, locale: locale)
  sort_type = D66SortType.const_get(table[:d66_sort_type])

  new(table[:name], sort_type, table[:items], bad_status_table, locale)
end

Instance Method Details

#roll(randomizer) ⇒ Object



47
48
49
50
# File 'lib/bcdice/game_system/beginning_idol/with_abnormality.rb', line 47

def roll(randomizer)
  chosen = super(randomizer)
  replace_abnormality(chosen, randomizer)
end