class BCDice::GameSystem::Arianrhod

Constants

HELP_MESSAGE

ダイスボットの使い方

ID

ゲームシステムの識別子

NAME

ゲームシステム名

SORT_KEY

ゲームシステム名の読みがな

Public Class Methods

new(command) click to toggle source
Calls superclass method BCDice::Base::new
# File lib/bcdice/game_system/Arianrhod.rb, line 21
def initialize(command)
  super(command)

  @sort_add_dice = true
  @d66_sort_type = D66SortType::NO_SORT
end

Public Instance Methods

result_nd6(total, _dice_total, dice_list, cmp_op, target) click to toggle source
# File lib/bcdice/game_system/Arianrhod.rb, line 28
def result_nd6(total, _dice_total, dice_list, cmp_op, target)
  n_max = dice_list.count(6)

  if dice_list.count(1) == dice_list.size
    # 全部1の目ならファンブル
    Result.fumble("ファンブル")
  elsif n_max >= 2
    # 2個以上6の目があったらクリティカル
    Result.critical("クリティカル(+#{n_max}D6)")
  elsif cmp_op != :>= || target == '?'
    nil
  elsif total >= target
    Result.success("成功")
  else
    Result.failure("失敗")
  end
end