Skip to content

Commit

Permalink
Merge pull request #521 from bcdice/fix_res
Browse files Browse the repository at this point in the history
[Cthulhu] RESx-yを実行できないように
  • Loading branch information
ysakasin authored Dec 2, 2021
2 parents c198700 + 117d18a commit cbfe0b9
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 2 deletions.
4 changes: 2 additions & 2 deletions lib/bcdice/game_system/Cthulhu.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
12 changes: 12 additions & 0 deletions test/data/Cthulhu.toml
Original file line number Diff line number Diff line change
Expand Up @@ -162,6 +162,12 @@ rands = [
{ sides = 100, value = 47 },
]

[[ test ]]
game_system = "Cthulhu"
input = "RES18-11"
output = ""
rands = []


##### 組み合わせロール CBR #####

Expand Down Expand Up @@ -820,6 +826,12 @@ rands = [
]


[[ test ]]
game_system = "Cthulhu"
input = "RESB18-11"
output = ""
rands = []

##### 戦闘用組み合わせロール CBRB #####

[[ test ]]
Expand Down

0 comments on commit cbfe0b9

Please sign in to comment.