class BCDice::GameSystem::KanColle

Constants

HELP_MESSAGE

ダイスボットの使い方

ID

ゲームシステムの識別子

NAME

ゲームシステム名

RTT
SORT_KEY

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

TABLES

Public Class Methods

new(command) click to toggle source
Calls superclass method BCDice::Base::new
# File lib/bcdice/game_system/KanColle.rb, line 48
def initialize(command)
  super(command)

  @sort_add_dice = true
  @sort_barabara_dice = true
  @d66_sort_type = D66SortType::ASC
end

Public Instance Methods

eval_game_system_specific_command(command) click to toggle source
# File lib/bcdice/game_system/KanColle.rb, line 66
def eval_game_system_specific_command(command)
  output = '1'
  type = ""
  total_n = ""

  case command
  when 'DVT'
    type = '開発表'
    output, total_n = get_develop_table
  when 'DVTM'
    type = '開発表(一括)'
    output, total_n = get_develop_matome_table
  when 'WP1T'
    type = '装備1種表'
    output, total_n = get_weapon1_table
  when 'WP2T'
    type = '装備2種表'
    output, total_n = get_weapon2_table
  when 'WP3T'
    type = '装備3種表'
    output, total_n = get_weapon3_table
  when 'WP4T'
    type = '装備4種表'
    output, total_n = get_weapon4_table
  else
    return roll_tables(command, TABLES) || RTT.roll_command(@randomizer, command)
  end

  return "#{type}(#{total_n}) > #{output}"
end
get_develop_matome_table() click to toggle source
# File lib/bcdice/game_system/KanColle.rb, line 121
def get_develop_matome_table
  output1 = ''
  output2 = ''
  total_n2 = ""

  dice = @randomizer.roll_once(6)

  case dice
  when 1
    output1 = '装備1種表'
    output2, total_n2 = get_weapon1_table
  when 2
    output1 = '装備1種表'
    output2, total_n2 = get_weapon1_table
  when 3
    output1 = '装備2種表'
    output2, total_n2 = get_weapon2_table
  when 4
    output1 = '装備2種表'
    output2, total_n2 = get_weapon2_table
  when 5
    output1 = '装備3種表'
    output2, total_n2 = get_weapon3_table
  when 6
    output1 = '装備4種表'
    output2, total_n2 = get_weapon4_table
  end
  result = "#{output1}:#{output2}"
  number = "#{dice},#{total_n2}"
  return result, number
end
get_develop_table() click to toggle source
# File lib/bcdice/game_system/KanColle.rb, line 109
def get_develop_table
  table = [
    '装備1種表(WP1T)',
    '装備1種表(WP1T)',
    '装備2種表(WP2T)',
    '装備2種表(WP2T)',
    '装備3種表(WP3T)',
    '装備4種表(WP4T)',
  ]
  return get_table_by_1d6(table)
end
get_weapon1_table() click to toggle source
# File lib/bcdice/game_system/KanColle.rb, line 153
def get_weapon1_table
  table = [
    '小口径主砲(P249)',
    '10cm連装高角砲(P249)',
    '中口径主砲(P249)',
    '15.2cm連装砲(P249)',
    '20.3cm連装砲(P249)',
    '魚雷(P252)',
  ]
  return get_table_by_1d6(table)
end
get_weapon2_table() click to toggle source
# File lib/bcdice/game_system/KanColle.rb, line 165
def get_weapon2_table
  table = [
    '副砲(P250)',
    '8cm高角砲(P250)',
    '大口径主砲(P249)',
    '41cm連装砲(P250)',
    '46cm三連装砲(P250)',
    '機銃(P252)',
  ]
  return get_table_by_1d6(table)
end
get_weapon3_table() click to toggle source
# File lib/bcdice/game_system/KanColle.rb, line 177
def get_weapon3_table
  table = [
    '艦上爆撃機(P250)',
    '艦上攻撃機(P251)',
    '艦上戦闘機(P251)',
    '偵察機(P251)',
    '電探(P252)',
    '25mm連装機銃(P252)',
  ]
  return get_table_by_1d6(table)
end
get_weapon4_table() click to toggle source
# File lib/bcdice/game_system/KanColle.rb, line 189
def get_weapon4_table
  table = [
    '彗星(P250)',
    '天山(P251)',
    '零式艦戦52型(P251)',
    '彩雲(P251)',
    '61cm四連装(酸素)魚雷(P252)',
    '改良型艦本式タービン(P252)',
  ]
  return get_table_by_1d6(table)
end
result_2d6(_total, dice_total, _dice_list, cmp_op, _target) click to toggle source
# File lib/bcdice/game_system/KanColle.rb, line 56
def result_2d6(_total, dice_total, _dice_list, cmp_op, _target)
  return nil unless cmp_op == :>=

  if dice_total <= 2
    Result.fumble("ファンブル(判定失敗。アクシデント表を自分のPCに適用)")
  elsif dice_total >= 12
    Result.critical("スペシャル(判定成功。【行動力】が1D6点回復)")
  end
end