class BCDice::GameSystem::Elric

Constants

HELP_MESSAGE

ダイスボットの使い方

ID

ゲームシステムの識別子

NAME

ゲームシステム名

SORT_KEY

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

Public Instance Methods

result_1d100(total, _dice_total, cmp_op, target) click to toggle source

ゲーム別成功度判定(1d100)

# File lib/bcdice/game_system/Elric.rb, line 19
def result_1d100(total, _dice_total, cmp_op, target)
  return nil unless cmp_op == :<=

  if total <= 1
    Result.critical("貫通") # 1は常に貫通
  elsif total >= 100
    Result.fumble("致命的失敗")  # 100は常に致命的失敗
  elsif target == '?'
    Result.nothing
  elsif total <= (target / 5.0).ceil
    Result.critical("決定的成功")
  elsif total <= target
    Result.success("成功")
  elsif (total >= 99) && (target < 100)
    Result.fumble("致命的失敗")
  else
    Result.failure("失敗")
  end
end