Method: BCDice::GameSystem::Chill#result_1d100

Defined in:
lib/bcdice/game_system/Chill.rb

#result_1d100(total, _dice_total, cmp_op, target) ⇒ Object



27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
# File 'lib/bcdice/game_system/Chill.rb', line 27

def result_1d100(total, _dice_total, cmp_op, target)
  return nil if target == '?'
  return nil if cmp_op != :<=

  if total >= 100
    Result.fumble("ファンブル")
  elsif total > target
    Result.failure("失敗")
  elsif total >= (target * 0.9)
    Result.success("L成功")
  elsif total >= (target / 2)
    Result.success("M成功")
  elsif total >= (target / 10)
    Result.success("H成功")
  else
    Result.critical("C成功")
  end
end