class BCDice::GameSystem::SwordWorld2_5

Constants

ABYSS_CURSE_ATTR_TABLE
ABYSS_CURSE_CATEGORY_TABLE
ABYSS_CURSE_TABLE
HELP_MESSAGE

ダイスボットの使い方

ID

ゲームシステムの識別子

NAME

ゲームシステム名

SORT_KEY

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

Public Instance Methods

druid_dice(command, power_list) click to toggle source
# File lib/bcdice/game_system/SwordWorld2_5.rb, line 164
def druid_dice(command, power_list)
  dice_list = @randomizer.roll_barabara(2, 6)
  dice_total = dice_list.sum()
  offset =
    case dice_total
    when 2..6
      0
    when 7..9
      1
    when 10..12
      2
    end
  power = power_list[offset]
  total = power + command.modify_number
  sequence = [
    "(#{command.command.capitalize}#{Format.modifier(command.modify_number)})",
    "2D[#{dice_list.join(',')}]=#{dice_total}",
    "#{power}#{Format.modifier(command.modify_number)}",
    total
  ]

  return sequence.join(" > ")
end
eval_game_system_specific_command(command) click to toggle source
# File lib/bcdice/game_system/SwordWorld2_5.rb, line 141
def eval_game_system_specific_command(command)
  case command
  when /^dru\[(\d+),(\d+),(\d+)\]/i
    power_list = Regexp.last_match.captures.map(&:to_i)
    druid_parser = Command::Parser.new(/dru\[\d+,\d+,\d+\]/i, round_type: BCDice::RoundType::CEIL)

    cmd = druid_parser.parse(command)
    unless cmd
      return nil
    end

    druid_dice(cmd, power_list)
  when 'ABT'
    get_abyss_curse_table
  else
    super(command)
  end
end
get_abyss_curse_table() click to toggle source
# File lib/bcdice/game_system/SwordWorld2_5.rb, line 188
def get_abyss_curse_table
  table_result = ABYSS_CURSE_TABLE.roll(@randomizer)
  additional =
    case table_result.value
    when 14  # 「差別の」における分類決定表
      ABYSS_CURSE_CATEGORY_TABLE.roll(@randomizer).to_s
    when 25  # 「過敏な」における属性決定表
      ABYSS_CURSE_ATTR_TABLE.roll(@randomizer).to_s
    end
  final_result = [
    table_result.to_s,
    additional,
  ].compact

  return final_result.join("\n")
end
rating_parser() click to toggle source
# File lib/bcdice/game_system/SwordWorld2_5.rb, line 160
def rating_parser
  return RatingParser.new(version: :v2_5)
end