diff --git a/lib/bcdice/game_system/Cthulhu.rb b/lib/bcdice/game_system/Cthulhu.rb index 7dc06e7e8..cefa947f0 100644 --- a/lib/bcdice/game_system/Cthulhu.rb +++ b/lib/bcdice/game_system/Cthulhu.rb @@ -193,12 +193,12 @@ def compare(total, target, broken_number = 0) end def getRegistResult(command) - m = /^RES(B)?([-\d]+)$/i.match(command) + m = /^RESB?(-?\d+)$/i.match(command) unless m return nil end - value = m[2].to_i + value = m[1].to_i target = value * 5 + 50 if target < 5 diff --git a/test/data/Cthulhu.toml b/test/data/Cthulhu.toml index 4fe236a7e..47d0dd762 100644 --- a/test/data/Cthulhu.toml +++ b/test/data/Cthulhu.toml @@ -162,6 +162,12 @@ rands = [ { sides = 100, value = 47 }, ] +[[ test ]] +game_system = "Cthulhu" +input = "RES18-11" +output = "" +rands = [] + ##### 組み合わせロール CBR ##### @@ -820,6 +826,12 @@ rands = [ ] +[[ test ]] +game_system = "Cthulhu" +input = "RESB18-11" +output = "" +rands = [] + ##### 戦闘用組み合わせロール CBRB ##### [[ test ]]