Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ガラコの判定の目標値を省略可能に #378

Merged
merged 1 commit into from
Feb 10, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions lib/bcdice/game_system/Garako.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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 )
Expand Down Expand Up @@ -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

Expand Down
24 changes: 24 additions & 0 deletions test/data/Garako.toml
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down