From 9eb1f79d659a04b6fe5202e505306122a23be1fd Mon Sep 17 00:00:00 2001 From: GenKuzumochi Date: Tue, 2 Feb 2021 20:01:38 +0900 Subject: [PATCH] =?UTF-8?q?=E3=82=AC=E3=83=A9=E3=82=B3=E3=81=AE=E5=88=A4?= =?UTF-8?q?=E5=AE=9A=E3=81=AE=E7=9B=AE=E6=A8=99=E5=80=A4=E3=82=92=E7=9C=81?= =?UTF-8?q?=E7=95=A5=E5=8F=AF=E8=83=BD=E3=81=AB?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- lib/bcdice/game_system/Garako.rb | 4 ++-- test/data/Garako.toml | 24 ++++++++++++++++++++++++ 2 files changed, 26 insertions(+), 2 deletions(-) diff --git a/lib/bcdice/game_system/Garako.rb b/lib/bcdice/game_system/Garako.rb index bc393c490..1ac22a51e 100644 --- a/lib/bcdice/game_system/Garako.rb +++ b/lib/bcdice/game_system/Garako.rb @@ -18,7 +18,7 @@ class Garako < Base # ダイスボットの使い方 HELP_MESSAGE = <<~MESSAGETEXT - ・判定 GR+n#f>=X (+n:判定値、#f:不安定による自動失敗基準値、X:目標値) + ・判定 GR+n#f>=X (+n:判定値、#f:不安定による自動失敗基準値、X:目標値、それぞれ省略可能) ・部位決定チャート:HIT ・ダメージ+部位決定:GAHn(n:火力) ・ダメージチャート:xDCy(CDC/EDC/FDC/ADC/LDC ) @@ -63,7 +63,7 @@ def eval_game_system_specific_command(command) def roll_gr(command) parser = Command::Parser.new("GR", round_type: round_type) .enable_fumble - .restrict_cmp_op_to(:>=) + .restrict_cmp_op_to(nil, :>=) cmd = parser.parse(command) return nil unless cmd diff --git a/test/data/Garako.toml b/test/data/Garako.toml index 377d4da1e..451f1a396 100644 --- a/test/data/Garako.toml +++ b/test/data/Garako.toml @@ -150,6 +150,30 @@ rands = [ { sides = 10, value = 8 }, ] +[[ test ]] +game_system = "Garako" +input = "GR+1" +output = "(1D10+1) > 10[10]+1 > 11 > クリティカル" +rands = [ + { sides = 10, value = 10 }, +] + +[[ test ]] +game_system = "Garako" +input = "GR+1" +output = "(1D10+1) > 9[9]+1 > 10" +rands = [ + { sides = 10, value = 9 }, +] + +[[ test ]] +game_system = "Garako" +input = "GR+1" +output = "(1D10+1) > 1[1]+1 > 2 > ファンブル" +rands = [ + { sides = 10, value = 1 }, +] + [[ test ]] game_system = "Garako" input = "IDI"