From b6ba94f533caae231b2da4a488d4e8c2c59358c5 Mon Sep 17 00:00:00 2001 From: Hideyo Mikisato Date: Fri, 30 Apr 2021 23:16:49 +0900 Subject: [PATCH] =?UTF-8?q?[Satasupe]=20=E6=80=A7=E6=A5=AD=E5=80=A4?= =?UTF-8?q?=E3=82=B3=E3=83=9E=E3=83=B3=E3=83=89=E3=82=92suffix=5Fnumber?= =?UTF-8?q?=E3=82=92=E7=94=A8=E3=81=84=E3=81=A6=E8=A8=98=E8=BF=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- lib/bcdice/game_system/Satasupe.rb | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/lib/bcdice/game_system/Satasupe.rb b/lib/bcdice/game_system/Satasupe.rb index 9cefb42ca..94cbfa2bd 100644 --- a/lib/bcdice/game_system/Satasupe.rb +++ b/lib/bcdice/game_system/Satasupe.rb @@ -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 "「激」"