From 544dcc643b07f501a6961e96a4bc9a5bc5d12099 Mon Sep 17 00:00:00 2001 From: ocha Date: Sat, 13 Nov 2021 21:37:52 +0900 Subject: [PATCH] =?UTF-8?q?=E5=80=8B=E6=95=B0=E3=82=AB=E3=82=A6=E3=83=B3?= =?UTF-8?q?=E3=83=88=E3=83=80=E3=82=A4=E3=82=B9=EF=BC=88TY=E3=80=81TZ?= =?UTF-8?q?=EF=BC=89=E3=82=92=E8=BF=BD=E5=8A=A0=E3=81=99=E3=82=8B?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .gitignore | 1 + .rubocop.yml | 1 + Rakefile | 1 + lib/bcdice/common_command.rb | 2 + lib/bcdice/common_command/tally_dice.rb | 19 +++ lib/bcdice/common_command/tally_dice/node.rb | 135 +++++++++++++++++ lib/bcdice/common_command/tally_dice/parser.y | 93 ++++++++++++ test/data/tally_sort.toml | 53 +++++++ test/data/tally_ty.toml | 137 ++++++++++++++++++ test/data/tally_tz.toml | 137 ++++++++++++++++++ test/test_base.rb | 4 +- test/test_sai_fic_skill_table.rb | 2 +- 12 files changed, 583 insertions(+), 2 deletions(-) create mode 100644 lib/bcdice/common_command/tally_dice.rb create mode 100644 lib/bcdice/common_command/tally_dice/node.rb create mode 100644 lib/bcdice/common_command/tally_dice/parser.y create mode 100644 test/data/tally_sort.toml create mode 100644 test/data/tally_ty.toml create mode 100644 test/data/tally_tz.toml diff --git a/.gitignore b/.gitignore index 7d7be8be3..a6b10a843 100644 --- a/.gitignore +++ b/.gitignore @@ -18,6 +18,7 @@ lib/bcdice/arithmetic/parser.rb lib/bcdice/command/parser.rb lib/bcdice/common_command/add_dice/parser.rb lib/bcdice/common_command/barabara_dice/parser.rb +lib/bcdice/common_command/tally_dice/parser.rb lib/bcdice/common_command/calc/parser.rb lib/bcdice/common_command/reroll_dice/parser.rb lib/bcdice/common_command/upper_dice/parser.rb diff --git a/.rubocop.yml b/.rubocop.yml index be78ea0dd..16ee6ef47 100644 --- a/.rubocop.yml +++ b/.rubocop.yml @@ -12,6 +12,7 @@ AllCops: - lib/bcdice/command/parser.rb - lib/bcdice/common_command/add_dice/parser.rb - lib/bcdice/common_command/barabara_dice/parser.rb + - lib/bcdice/common_command/tally_dice/parser.rb - lib/bcdice/common_command/calc/parser.rb - lib/bcdice/common_command/reroll_dice/parser.rb - lib/bcdice/common_command/upper_dice/parser.rb diff --git a/Rakefile b/Rakefile index f11c4ca74..1ee13f6f6 100644 --- a/Rakefile +++ b/Rakefile @@ -25,6 +25,7 @@ RACC_TARGETS = [ "lib/bcdice/command/parser.rb", "lib/bcdice/common_command/add_dice/parser.rb", "lib/bcdice/common_command/barabara_dice/parser.rb", + "lib/bcdice/common_command/tally_dice/parser.rb", "lib/bcdice/common_command/calc/parser.rb", "lib/bcdice/common_command/reroll_dice/parser.rb", "lib/bcdice/common_command/upper_dice/parser.rb", diff --git a/lib/bcdice/common_command.rb b/lib/bcdice/common_command.rb index 059b74100..aecc41cce 100644 --- a/lib/bcdice/common_command.rb +++ b/lib/bcdice/common_command.rb @@ -2,6 +2,7 @@ require "bcdice/common_command/add_dice" require "bcdice/common_command/barabara_dice" +require "bcdice/common_command/tally_dice" require "bcdice/common_command/calc" require "bcdice/common_command/choice" require "bcdice/common_command/d66_dice" @@ -15,6 +16,7 @@ module CommonCommand COMMANDS = [ AddDice, BarabaraDice, + TallyDice, Calc, Choice, D66Dice, diff --git a/lib/bcdice/common_command/tally_dice.rb b/lib/bcdice/common_command/tally_dice.rb new file mode 100644 index 000000000..660788daa --- /dev/null +++ b/lib/bcdice/common_command/tally_dice.rb @@ -0,0 +1,19 @@ +# frozen_string_literal: true + +require "bcdice/common_command/tally_dice/parser" + +module BCDice + module CommonCommand + # 個数カウントダイスのモジュール + module TallyDice + PREFIX_PATTERN = /\d+T[YZ]\d+/.freeze + + class << self + def eval(command, game_system, randomizer) + cmd = Parser.parse(command) + cmd&.eval(game_system, randomizer) + end + end + end + end +end diff --git a/lib/bcdice/common_command/tally_dice/node.rb b/lib/bcdice/common_command/tally_dice/node.rb new file mode 100644 index 000000000..fb54e8514 --- /dev/null +++ b/lib/bcdice/common_command/tally_dice/node.rb @@ -0,0 +1,135 @@ +# frozen_string_literal: true + +require "bcdice/result" + +module BCDice + module CommonCommand + module TallyDice + # 個数カウントダイスを表すノードをまとめるモジュール + module Node + # 個数カウントダイス:コマンドのノード + class Command + # 最大面数 + MAX_SIDES = 20 + + # @param secret [Boolean] シークレットダイスか + # @param notation [Notation] ダイス表記 + def initialize(secret:, notation:) + @secret = secret + @notation = notation + end + + # @param game_system [Base] ゲームシステム + # @param randomizer [Randomizer] ランダマイザ + # @return [Result, nil] + def eval(game_system, randomizer) + dice = @notation.to_dice(game_system.round_type) + unless dice.valid? + return nil + end + + if dice.sides > MAX_SIDES + return Result.new("(#{dice}) > 面数は1以上、#{MAX_SIDES}以下としてください") + end + + values = dice.roll(randomizer) + + values_str = (game_system.sort_barabara_dice? ? values.sort : values) + .join(",") + + # TODO: Ruby 2.7以降のみサポートするようになった場合 + # Enumerable#tally で書く + values_count = values + .group_by(&:itself) + .transform_values(&:length) + + values_count_strs = (1..dice.sides).map do |v| + count = values_count.fetch(v, 0) + + next nil if count == 0 && !dice.show_zeros? + + "[#{v}]×#{values_count.fetch(v, 0)}" + end + + sequence = [ + "(#{dice})", + values_str, + values_count_strs.compact.join(", "), + ].compact + + Result.new.tap do |r| + r.secret = @secret + r.text = sequence.join(" > ") + end + end + end + + # 個数カウントダイス:ダイス表記のノード + class Notation + # @return [Integer] 振る回数 + attr_reader :times + # @return [Integer] 面数 + attr_reader :sides + # @return [Boolean] 個数0を表示するか + attr_reader :show_zeros + + # @param times [#eval] 振る回数 + # @param sides [#eval] 面数 + # @param show_zeros [Boolean] 個数0を表示するか + def initialize(times:, sides:, show_zeros:) + @times = times + @sides = sides + @show_zeros = show_zeros + end + + # @param round_type [Symbol] 除算の端数処理方法 + # @return [Dice] + def to_dice(round_type) + times = @times.eval(round_type) + sides = @sides.eval(round_type) + + Dice.new(times: times, sides: sides, show_zeros: @show_zeros) + end + end + + # 個数カウントダイス:ダイスのノード + class Dice + # @return [Integer] 振る回数 + attr_reader :times + # @return [Integer] 面数 + attr_reader :sides + # @return [Boolean] 個数0を表示するか + attr_reader :show_zeros + + alias show_zeros? show_zeros + + # @param times [Integer] 振る回数 + # @param sides [Integer] 面数 + def initialize(times:, sides:, show_zeros:) + @times = times + @sides = sides + @show_zeros = show_zeros + end + + # @return [Boolean] ダイスとして有効(振る回数、面数ともに正の数)か + def valid? + @times > 0 && @sides > 0 + end + + # ダイスを振る + # @param randomizer [BCDice::Randomizer] ランダマイザ + # @return [Array] 出目の配列 + def roll(randomizer) + randomizer.roll_barabara(@times, @sides) + end + + # @return [String] + def to_s + show_zeros_symbol = @show_zeros ? "Z" : "Y" + "#{@times}T#{show_zeros_symbol}#{@sides}" + end + end + end + end + end +end diff --git a/lib/bcdice/common_command/tally_dice/parser.y b/lib/bcdice/common_command/tally_dice/parser.y new file mode 100644 index 000000000..40725d6c0 --- /dev/null +++ b/lib/bcdice/common_command/tally_dice/parser.y @@ -0,0 +1,93 @@ +class BCDice::CommonCommand::TallyDice::Parser + token NUMBER T Y Z R U C F S PLUS MINUS ASTERISK SLASH PARENL PARENR + + rule + expr: secret notation + { + result = Node::Command.new( + secret: val[0], + notation: val[1] + ) + } + + secret: /* none */ + { result = false } + | S + { result = true } + + notation: term T show_zeros term + { + result = Node::Notation.new( + times: val[0], + sides: val[3], + show_zeros: val[2] + ) + } + + show_zeros: Y + { result = false } + | Z + { result = true } + + add: add PLUS mul + { result = Arithmetic::Node::BinaryOp.new(val[0], :+, val[2]) } + | add MINUS mul + { result = Arithmetic::Node::BinaryOp.new(val[0], :-, val[2]) } + | mul + + mul: mul ASTERISK unary + { result = Arithmetic::Node::BinaryOp.new(val[0], :*, val[2]) } + | mul SLASH unary round_type + { + divied_class = val[3] + result = divied_class.new(val[0], val[2]) + } + | unary + + round_type: /* none */ + { result = Arithmetic::Node::DivideWithGameSystemDefault } + | U + { result = Arithmetic::Node::DivideWithCeil } + | C + { result = Arithmetic::Node::DivideWithCeil } + | R + { result = Arithmetic::Node::DivideWithRound } + | F + { result = Arithmetic::Node::DivideWithFloor } + + unary: PLUS unary + { result = val[1] } + | MINUS unary + { result = Arithmetic::Node::Negative.new(val[1]) } + | term + + term: PARENL add PARENR + { result = val[1] } + | NUMBER + { result = Arithmetic::Node::Number.new(val[0]) } +end + +---- header + +require "bcdice/common_command/lexer" +require "bcdice/common_command/tally_dice/node" +require "bcdice/arithmetic/node" + +---- inner + +def self.parse(source) + new.parse(source) +end + +def parse(source) + @lexer = Lexer.new(source) + do_parse() +rescue ParseError + nil +end + +private + +def next_token + @lexer.next_token +end diff --git a/test/data/tally_sort.toml b/test/data/tally_sort.toml new file mode 100644 index 000000000..8e9f70954 --- /dev/null +++ b/test/data/tally_sort.toml @@ -0,0 +1,53 @@ +[[ test ]] +game_system = "StellarKnights" +input = "20TY6 銀剣のステラナイツ ソートあり(sort_barabara_dice? => true)" +output = "(20TY6) > 1,1,2,2,3,3,4,4,4,4,4,4,5,5,5,5,6,6,6,6 > [1]×2, [2]×2, [3]×2, [4]×6, [5]×4, [6]×4" +rands = [ + { sides = 6, value = 6 }, + { sides = 6, value = 2 }, + { sides = 6, value = 6 }, + { sides = 6, value = 4 }, + { sides = 6, value = 6 }, + { sides = 6, value = 5 }, + { sides = 6, value = 4 }, + { sides = 6, value = 3 }, + { sides = 6, value = 2 }, + { sides = 6, value = 1 }, + { sides = 6, value = 4 }, + { sides = 6, value = 4 }, + { sides = 6, value = 5 }, + { sides = 6, value = 1 }, + { sides = 6, value = 6 }, + { sides = 6, value = 5 }, + { sides = 6, value = 4 }, + { sides = 6, value = 3 }, + { sides = 6, value = 4 }, + { sides = 6, value = 5 }, +] + +[[ test ]] +game_system = "StellarKnights" +input = "20TZ6 銀剣のステラナイツ ソートあり(sort_barabara_dice? => true)" +output = "(20TZ6) > 1,1,2,2,3,3,4,4,4,4,4,4,5,5,5,5,6,6,6,6 > [1]×2, [2]×2, [3]×2, [4]×6, [5]×4, [6]×4" +rands = [ + { sides = 6, value = 6 }, + { sides = 6, value = 2 }, + { sides = 6, value = 6 }, + { sides = 6, value = 4 }, + { sides = 6, value = 6 }, + { sides = 6, value = 5 }, + { sides = 6, value = 4 }, + { sides = 6, value = 3 }, + { sides = 6, value = 2 }, + { sides = 6, value = 1 }, + { sides = 6, value = 4 }, + { sides = 6, value = 4 }, + { sides = 6, value = 5 }, + { sides = 6, value = 1 }, + { sides = 6, value = 6 }, + { sides = 6, value = 5 }, + { sides = 6, value = 4 }, + { sides = 6, value = 3 }, + { sides = 6, value = 4 }, + { sides = 6, value = 5 }, +] diff --git a/test/data/tally_ty.toml b/test/data/tally_ty.toml new file mode 100644 index 000000000..07292c9bb --- /dev/null +++ b/test/data/tally_ty.toml @@ -0,0 +1,137 @@ +[[ test ]] +game_system = "DiceBot" +input = "20TY6 大文字" +output = "(20TY6) > 6,2,6,4,6,5,4,3,2,1,4,4,5,1,6,5,4,3,4,5 > [1]×2, [2]×2, [3]×2, [4]×6, [5]×4, [6]×4" +rands = [ + { sides = 6, value = 6 }, + { sides = 6, value = 2 }, + { sides = 6, value = 6 }, + { sides = 6, value = 4 }, + { sides = 6, value = 6 }, + { sides = 6, value = 5 }, + { sides = 6, value = 4 }, + { sides = 6, value = 3 }, + { sides = 6, value = 2 }, + { sides = 6, value = 1 }, + { sides = 6, value = 4 }, + { sides = 6, value = 4 }, + { sides = 6, value = 5 }, + { sides = 6, value = 1 }, + { sides = 6, value = 6 }, + { sides = 6, value = 5 }, + { sides = 6, value = 4 }, + { sides = 6, value = 3 }, + { sides = 6, value = 4 }, + { sides = 6, value = 5 }, +] + +[[ test ]] +game_system = "DiceBot" +input = "20ty6 小文字" +output = "(20TY6) > 6,2,6,4,6,5,4,3,2,1,4,4,5,1,6,5,4,3,4,5 > [1]×2, [2]×2, [3]×2, [4]×6, [5]×4, [6]×4" +rands = [ + { sides = 6, value = 6 }, + { sides = 6, value = 2 }, + { sides = 6, value = 6 }, + { sides = 6, value = 4 }, + { sides = 6, value = 6 }, + { sides = 6, value = 5 }, + { sides = 6, value = 4 }, + { sides = 6, value = 3 }, + { sides = 6, value = 2 }, + { sides = 6, value = 1 }, + { sides = 6, value = 4 }, + { sides = 6, value = 4 }, + { sides = 6, value = 5 }, + { sides = 6, value = 1 }, + { sides = 6, value = 6 }, + { sides = 6, value = 5 }, + { sides = 6, value = 4 }, + { sides = 6, value = 3 }, + { sides = 6, value = 4 }, + { sides = 6, value = 5 }, +] + +[[ test ]] +game_system = "DiceBot" +input = "5TY6 出現しなかった出目がある場合" +output = "(5TY6) > 6,1,2,5,2 > [1]×1, [2]×2, [5]×1, [6]×1" +rands = [ + { sides = 6, value = 6 }, + { sides = 6, value = 1 }, + { sides = 6, value = 2 }, + { sides = 6, value = 5 }, + { sides = 6, value = 2 }, +] + +[[ test ]] +game_system = "DiceBot" +input = "(1+2*3)TY4 個数を計算" +output = "(7TY4) > 1,4,4,3,4,2,3 > [1]×1, [2]×1, [3]×2, [4]×3" +rands = [ + { sides = 4, value = 1 }, + { sides = 4, value = 4 }, + { sides = 4, value = 4 }, + { sides = 4, value = 3 }, + { sides = 4, value = 4 }, + { sides = 4, value = 2 }, + { sides = 4, value = 3 }, +] + +[[ test ]] +game_system = "DiceBot" +input = "7TY(1+5/2C) 面数を計算" +output = "(7TY4) > 1,4,4,3,4,2,3 > [1]×1, [2]×1, [3]×2, [4]×3" +rands = [ + { sides = 4, value = 1 }, + { sides = 4, value = 4 }, + { sides = 4, value = 4 }, + { sides = 4, value = 3 }, + { sides = 4, value = 4 }, + { sides = 4, value = 2 }, + { sides = 4, value = 3 }, +] + +[[ test ]] +game_system = "DiceBot" +input = "(1+2*3)TY(1+5/2C) 個数と面数を計算" +output = "(7TY4) > 1,4,4,3,4,2,3 > [1]×1, [2]×1, [3]×2, [4]×3" +rands = [ + { sides = 4, value = 1 }, + { sides = 4, value = 4 }, + { sides = 4, value = 4 }, + { sides = 4, value = 3 }, + { sides = 4, value = 4 }, + { sides = 4, value = 2 }, + { sides = 4, value = 3 }, +] + +[[ test ]] +game_system = "DiceBot" +input = "0TY4 個数0はエラー" +output = "" +rands = [] + +[[ test ]] +game_system = "DiceBot" +input = "(2-3)TY4 個数がマイナスはエラー" +output = "" +rands = [] + +[[ test ]] +game_system = "DiceBot" +input = "2TY0 面数0はエラー" +output = "" +rands = [] + +[[ test ]] +game_system = "DiceBot" +input = "2TY(0-1) 面数がマイナスはエラー" +output = "" +rands = [] + +[[ test ]] +game_system = "DiceBot" +input = "2TY21 面数21以上はエラー" +output = "(2TY21) > 面数は1以上、20以下としてください" +rands = [] diff --git a/test/data/tally_tz.toml b/test/data/tally_tz.toml new file mode 100644 index 000000000..195691335 --- /dev/null +++ b/test/data/tally_tz.toml @@ -0,0 +1,137 @@ +[[ test ]] +game_system = "DiceBot" +input = "20TZ6 大文字" +output = "(20TZ6) > 6,2,6,4,6,5,4,3,2,1,4,4,5,1,6,5,4,3,4,5 > [1]×2, [2]×2, [3]×2, [4]×6, [5]×4, [6]×4" +rands = [ + { sides = 6, value = 6 }, + { sides = 6, value = 2 }, + { sides = 6, value = 6 }, + { sides = 6, value = 4 }, + { sides = 6, value = 6 }, + { sides = 6, value = 5 }, + { sides = 6, value = 4 }, + { sides = 6, value = 3 }, + { sides = 6, value = 2 }, + { sides = 6, value = 1 }, + { sides = 6, value = 4 }, + { sides = 6, value = 4 }, + { sides = 6, value = 5 }, + { sides = 6, value = 1 }, + { sides = 6, value = 6 }, + { sides = 6, value = 5 }, + { sides = 6, value = 4 }, + { sides = 6, value = 3 }, + { sides = 6, value = 4 }, + { sides = 6, value = 5 }, +] + +[[ test ]] +game_system = "DiceBot" +input = "20tz6 小文字" +output = "(20TZ6) > 6,2,6,4,6,5,4,3,2,1,4,4,5,1,6,5,4,3,4,5 > [1]×2, [2]×2, [3]×2, [4]×6, [5]×4, [6]×4" +rands = [ + { sides = 6, value = 6 }, + { sides = 6, value = 2 }, + { sides = 6, value = 6 }, + { sides = 6, value = 4 }, + { sides = 6, value = 6 }, + { sides = 6, value = 5 }, + { sides = 6, value = 4 }, + { sides = 6, value = 3 }, + { sides = 6, value = 2 }, + { sides = 6, value = 1 }, + { sides = 6, value = 4 }, + { sides = 6, value = 4 }, + { sides = 6, value = 5 }, + { sides = 6, value = 1 }, + { sides = 6, value = 6 }, + { sides = 6, value = 5 }, + { sides = 6, value = 4 }, + { sides = 6, value = 3 }, + { sides = 6, value = 4 }, + { sides = 6, value = 5 }, +] + +[[ test ]] +game_system = "DiceBot" +input = "5TZ6 出現しなかった出目がある場合" +output = "(5TZ6) > 6,1,2,5,2 > [1]×1, [2]×2, [3]×0, [4]×0, [5]×1, [6]×1" +rands = [ + { sides = 6, value = 6 }, + { sides = 6, value = 1 }, + { sides = 6, value = 2 }, + { sides = 6, value = 5 }, + { sides = 6, value = 2 }, +] + +[[ test ]] +game_system = "DiceBot" +input = "(1+2*3)TZ4 個数を計算" +output = "(7TZ4) > 1,4,4,3,4,2,3 > [1]×1, [2]×1, [3]×2, [4]×3" +rands = [ + { sides = 4, value = 1 }, + { sides = 4, value = 4 }, + { sides = 4, value = 4 }, + { sides = 4, value = 3 }, + { sides = 4, value = 4 }, + { sides = 4, value = 2 }, + { sides = 4, value = 3 }, +] + +[[ test ]] +game_system = "DiceBot" +input = "7TZ(1+5/2C) 面数を計算" +output = "(7TZ4) > 1,4,4,3,4,2,3 > [1]×1, [2]×1, [3]×2, [4]×3" +rands = [ + { sides = 4, value = 1 }, + { sides = 4, value = 4 }, + { sides = 4, value = 4 }, + { sides = 4, value = 3 }, + { sides = 4, value = 4 }, + { sides = 4, value = 2 }, + { sides = 4, value = 3 }, +] + +[[ test ]] +game_system = "DiceBot" +input = "(1+2*3)TZ(1+5/2C) 個数と面数を計算" +output = "(7TZ4) > 1,4,4,3,4,2,3 > [1]×1, [2]×1, [3]×2, [4]×3" +rands = [ + { sides = 4, value = 1 }, + { sides = 4, value = 4 }, + { sides = 4, value = 4 }, + { sides = 4, value = 3 }, + { sides = 4, value = 4 }, + { sides = 4, value = 2 }, + { sides = 4, value = 3 }, +] + +[[ test ]] +game_system = "DiceBot" +input = "0TZ4 個数0はエラー" +output = "" +rands = [] + +[[ test ]] +game_system = "DiceBot" +input = "(2-3)TZ4 個数がマイナスはエラー" +output = "" +rands = [] + +[[ test ]] +game_system = "DiceBot" +input = "2TZ0 面数0はエラー" +output = "" +rands = [] + +[[ test ]] +game_system = "DiceBot" +input = "2TZ(0-1) 面数がマイナスはエラー" +output = "" +rands = [] + +[[ test ]] +game_system = "DiceBot" +input = "2TZ21 面数21以上はエラー" +output = "(2TZ21) > 面数は1以上、20以下としてください" +rands = [] diff --git a/test/test_base.rb b/test/test_base.rb index 659b9168f..384ab78f7 100644 --- a/test/test_base.rb +++ b/test/test_base.rb @@ -9,7 +9,7 @@ class DummySystem < BCDice::Base class TestBase < Test::Unit::TestCase def test_command_pattern - assert_equal(/^S?([+\-(]*\d+|\d+B\d+|C[+\-(]*\d+|choice|D66|(repeat|rep|x)\d+|\d+R\d+|\d+U\d+|BCDiceVersion|ABC|XYZ|IP\d+)/i, DummySystem.command_pattern) + assert_equal(/^S?([+\-(]*\d+|\d+B\d+|\d+T[YZ]\d+|C[+\-(]*\d+|choice|D66|(repeat|rep|x)\d+|\d+R\d+|\d+U\d+|BCDiceVersion|ABC|XYZ|IP\d+)/i, DummySystem.command_pattern) assert_match(DummySystem.command_pattern, "ABC+123") assert_match(DummySystem.command_pattern, "XYZ[hoge]") @@ -20,6 +20,8 @@ def test_command_pattern assert_match(DummySystem.command_pattern, "1D100<=70") assert_match(DummySystem.command_pattern, "4D6+2D8") assert_match(DummySystem.command_pattern, "4B6+2B8") + assert_match(DummySystem.command_pattern, "5TY6") + assert_match(DummySystem.command_pattern, "5TZ6") assert_match(DummySystem.command_pattern, "C2+4*3/2") assert_match(DummySystem.command_pattern, "choice[うさぎ,かめ]") assert_match(DummySystem.command_pattern, "D66s") diff --git a/test/test_sai_fic_skill_table.rb b/test/test_sai_fic_skill_table.rb index c4382709a..9c2e11b41 100644 --- a/test/test_sai_fic_skill_table.rb +++ b/test/test_sai_fic_skill_table.rb @@ -12,6 +12,6 @@ class DummySystem < BCDice::Base end def test_command_pattern - assert_equal(/^S?([+\-(]*\d+|\d+B\d+|C[+\-(]*\d+|choice|D66|(repeat|rep|x)\d+|\d+R\d+|\d+U\d+|BCDiceVersion|RTT[1-6]?|RCT)/i, DummySystem.command_pattern) + assert_equal(/^S?([+\-(]*\d+|\d+B\d+|\d+T[YZ]\d+|C[+\-(]*\d+|choice|D66|(repeat|rep|x)\d+|\d+R\d+|\d+U\d+|BCDiceVersion|RTT[1-6]?|RCT)/i, DummySystem.command_pattern) end end