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

[Cthulhu] 完全一致にする #389

Merged
merged 1 commit into from
Feb 26, 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
10 changes: 7 additions & 3 deletions lib/bcdice/game_system/Cthulhu.rb
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,11 @@ def eval_game_system_specific_command(command)
private

def getCheckResult(command)
m = %r{CCB?(\d+)?(?:<=([+-/*\d]+))?}i.match(command)
m = %r{^CCB?(\d+)?(?:<=([+-/*\d]+))?$}i.match(command)
unless m
return nil
end

broken_num = m[1].to_i
diff = ArithmeticEvaluator.eval(m[2])

Expand Down Expand Up @@ -189,7 +193,7 @@ def compare(total, target, broken_number = 0)
end

def getRegistResult(command)
m = /RES(B)?([-\d]+)/i.match(command)
m = /^RES(B)?([-\d]+)$/i.match(command)
unless m
return nil
end
Expand All @@ -215,7 +219,7 @@ def getRegistResult(command)
end

def getCombineRoll(command)
m = /CBR(B)?\((\d+),(\d+)\)/i.match(command)
m = /^CBR(B)?\((\d+),(\d+)\)$/i.match(command)
unless m
return nil
end
Expand Down
10 changes: 10 additions & 0 deletions test/data/Cthulhu.toml
Original file line number Diff line number Diff line change
Expand Up @@ -461,6 +461,11 @@ rands = [
{ sides = 100, value = 77 },
]

[[ test ]]
game_system = "Cthulhu"
input = "CCさくら 完全一致"
output = ""
rands = []

##### 戦闘用技能判定 CCB #####

Expand Down Expand Up @@ -670,6 +675,11 @@ rands = [
{ sides = 100, value = 30 },
]

[[ test ]]
game_system = "Cthulhu"
input = "CCBさくら 完全一致"
output = ""
rands = []

##### 戦闘用対抗判定 RESB #####

Expand Down