class BCDice::GameSystem::ShinMegamiTenseiKakuseihen

Constants

HELP_MESSAGE

ダイスボットの使い方

ID

ゲームシステムの識別子

NAME

ゲームシステム名

SORT_KEY

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

Public Instance Methods

check_1D100(total, dice_total, cmp_op, target) click to toggle source

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

# File lib/bcdice/game_system/ShinMegamiTenseiKakuseihen.rb, line 23
def check_1D100(total, dice_total, cmp_op, target)
  return '' if target == '?'
  return '' unless cmp_op == :<=

  dice1, dice2 = split_tens(dice_total)

  total1 = dice1 * 10 + dice2
  total2 = dice2 * 10 + dice1

  # ゾロ目
  isRepdigit = (dice1 == dice2)

  result = " > スワップ"
  result += getCheckResultText(target, [total1, total2].min, isRepdigit)
  result += "/通常"
  result += getCheckResultText(target, total % 100, isRepdigit)
  result += "/逆スワップ"
  result += getCheckResultText(target, [total1, total2].max, isRepdigit)

  return result
end
getCheckResult(diff, total, isRepdigit) click to toggle source
# File lib/bcdice/game_system/ShinMegamiTenseiKakuseihen.rb, line 60
def getCheckResult(diff, total, isRepdigit)
  if diff >= total
    return getSuccessResult(isRepdigit)
  end

  return getFailResult(isRepdigit)
end
getCheckResultText(diff, total, isRepdigit) click to toggle source
# File lib/bcdice/game_system/ShinMegamiTenseiKakuseihen.rb, line 54
def getCheckResultText(diff, total, isRepdigit)
  checkResult = getCheckResult(diff, total, isRepdigit)
  text = format("(%02d)", total) + checkResult
  return text
end
getFailResult(isRepdigit) click to toggle source
# File lib/bcdice/game_system/ShinMegamiTenseiKakuseihen.rb, line 76
def getFailResult(isRepdigit)
  if isRepdigit
    return "絶対失敗"
  end

  return "失敗"
end
getSuccessResult(isRepdigit) click to toggle source
# File lib/bcdice/game_system/ShinMegamiTenseiKakuseihen.rb, line 68
def getSuccessResult(isRepdigit)
  if isRepdigit
    return "絶対成功"
  end

  return "成功"
end
split_tens(value) click to toggle source
# File lib/bcdice/game_system/ShinMegamiTenseiKakuseihen.rb, line 45
def split_tens(value)
  value %= 100

  ones = value / 10
  tens = value % 10

  return [ones, tens]
end