class BCDice::GameSystem::Gundog

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/Gundog.rb, line 21
def initialize(command)
  super(command)
  @enabled_d9 = true
end

Public Instance Methods

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

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

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

  if total >= 100
    Result.fumble("ファンブル")
  elsif total <= 1
    Result.critical("絶対成功(達成値1+SL)")
  elsif target == "?"
    Result.nothing
  elsif total <= target
    dig10 = total / 10
    dig1 = total - dig10 * 10
    dig10 = 0 if dig10 >= 10
    dig1 = 0 if dig1 >= 10 # 条件的にはあり得ない(笑

    if dig1 <= 0
      Result.critical("クリティカル(達成値20+SL)")
    else
      Result.success("成功(達成値#{dig10 + dig1}+SL)")
    end
  else
    Result.failure("失敗")
  end
end