Class: BCDice::GameSystem::HuntersMoon::StrangeAbilityTable2

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

Constant Summary collapse

BODY =
['電撃', '障壁', '追加肢', '破裂球', '死病', 'ソナー', '未来視', '寄生体', '再構築', '分身', '大角', '鉄塊', '硬質化', '生命力吸収', '鬼火', '金縛り', '排出口', '金属化', '鋼鱗', '神経接合', '光翼', '環境適応', '消化剤', 'プロペラ', '血栓', '骨槍', '回転', '怒髪', '煙幕', '脂肪層', '逆棘', '偽頭', '赤化', '発条', '凶運', '巨砲'].freeze

Instance Attribute Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#chosenObject (readonly)

Returns the value of attribute chosen.



112
113
114
# File 'lib/bcdice/game_system/HuntersMoon.rb', line 112

def chosen
  @chosen
end

#diceObject (readonly)

Returns the value of attribute dice.



112
113
114
# File 'lib/bcdice/game_system/HuntersMoon.rb', line 112

def dice
  @dice
end

Instance Method Details

#roll(randomizer) ⇒ Object



114
115
116
117
118
119
120
121
122
123
124
125
# File 'lib/bcdice/game_system/HuntersMoon.rb', line 114

def roll(randomizer)
  dice = randomizer.roll_once(6)

  table = dice.odd? ? StrangeAbilityTable1::BODY : BODY
  table_id = dice.odd? ? 1 : 2
  dice1 = randomizer.roll_once(6)
  dice2 = randomizer.roll_once(6)
  index = (dice1 - 1) * 6 + (dice2 - 1)

  @dice = [dice, dice1 * 10 + dice2].join("-")
  @chosen = "[表#{table_id}]#{table[index]}"
end