Class: BCDice::GameSystem::CyberpunkRed::ScreamSheetRandomizerTable
- Inherits:
- 
      Object
      
        - Object
- BCDice::GameSystem::CyberpunkRed::ScreamSheetRandomizerTable
 
- Defined in:
- lib/bcdice/game_system/cyberpunk_red/tables.rb
Instance Method Summary collapse
- 
  
    
      #initialize(locale:, type_table:, a_table:, of_table:, b_table:, c_table:)  ⇒ ScreamSheetRandomizerTable 
    
    
  
  
  
    constructor
  
  
  
  
  
  
  
    A new instance of ScreamSheetRandomizerTable. 
- #roll(randomizer) ⇒ Object
Constructor Details
#initialize(locale:, type_table:, a_table:, of_table:, b_table:, c_table:) ⇒ ScreamSheetRandomizerTable
Returns a new instance of ScreamSheetRandomizerTable.
| 7 8 9 10 11 12 13 14 | # File 'lib/bcdice/game_system/cyberpunk_red/tables.rb', line 7 def initialize(locale:, type_table:, a_table:, of_table:, b_table:, c_table:) @locale = locale @type_table = type_table @a_table = a_table @of_table = of_table @b_table = b_table @c_table = c_table end | 
Instance Method Details
#roll(randomizer) ⇒ Object
| 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 | # File 'lib/bcdice/game_system/cyberpunk_red/tables.rb', line 16 def roll(randomizer) result = "" dice = randomizer.roll_once(6) scs_type = @type_table.choice(dice) result += "#{scs_type}#{I18n.translate('CyberpunkRed.news', locale: @locale, raise: true)} 『" dice = randomizer.roll_once(10) scs_val_a = @a_table.choice(dice).body result += scs_val_a dice = randomizer.roll_once(6) scs_val_of = @of_table.choice(dice).body result += scs_val_of dice = randomizer.roll_once(10) scs_val_a = @a_table.choice(dice).body result += scs_val_a dice = randomizer.roll_once(6) scs_val_of = @of_table.choice(dice).body result += scs_val_of dice = randomizer.roll_once(10) scs_val_b = @b_table.choice(dice).body result += scs_val_b dice = randomizer.roll_once(10) scs_val_c = @c_table.choice(dice).body result += scs_val_c result += "』" return result end |