Skip to content

Commit

Permalink
Merge pull request #448 from h-mikisato/feature/satasupe_sr_suffix
Browse files Browse the repository at this point in the history
[Satasupe] 性業値コマンドをsuffix_numberを用いて記述
  • Loading branch information
ysakasin authored May 4, 2021
2 parents b8055f0 + b6ba94f commit 2438247
Showing 1 changed file with 3 additions and 5 deletions.
8 changes: 3 additions & 5 deletions lib/bcdice/game_system/Satasupe.rb
Original file line number Diff line number Diff line change
Expand Up @@ -214,17 +214,15 @@ def checkRollLoop(roll_times, min_suc, target, critical, fumble, isCriticalStop)
def check_seigou(string)
debug("check_seigou begin string", string)

m = /^SR(\d+).*$/i.match(string)
return '' unless m

target = m[1].to_i
sr_parser = Command::Parser.new(/SR\d+/i, round_type: round_type)
sr_parser = Command::Parser.new("SR", round_type: round_type)
.has_suffix_number
.restrict_cmp_op_to(nil)
cmd = sr_parser.parse(string)
return '' unless cmd

dice = @randomizer.roll_sum(2, 6)
diceTotal = dice + cmd.modify_number
target = cmd.suffix_number

seigou = if target < diceTotal
"「激」"
Expand Down

0 comments on commit 2438247

Please sign in to comment.