Skip to content

Commit

Permalink
[NinjaSlayer2] 正規表現を整理
Browse files Browse the repository at this point in the history
  • Loading branch information
ysakasin committed Dec 4, 2023
1 parent b755b76 commit 52a468a
Showing 1 changed file with 7 additions and 6 deletions.
13 changes: 7 additions & 6 deletions lib/bcdice/game_system/NinjaSlayer2.rb
Original file line number Diff line number Diff line change
Expand Up @@ -270,7 +270,7 @@ def proc_text(command)
RE_COUNT_CRITICAL = /C([1-6])?/i.freeze
RE_COUNT_JUDGE = /(=|!=|>=|>|<=|<)([1-6])/.freeze

RE_JUDGE_DICEROLL = /^(UH|[KENHU])([\d,]+)(?:\[((?:(?:#{RE_COUNT_SATZ_BATZ}|#{RE_COUNT_CRITICAL}|#{RE_COUNT_JUDGE})(?:\]\[)?)+)\])?$/i.freeze
RE_JUDGE_DICEROLL = /^(UH|[KENHU])([\d,]+)(?:\[((?:(?:S([1-6])?|C([1-6])?|(=|!=|>=|>|<=|<)([1-6]))(?:\]\[)?)+)\])?$/i.freeze
RE_JUDGE_SATZ_BATZ = /^SB(?:@([1-6]))?$/i.freeze
RE_JUDGE_WASSHOI = /^WS([1-9]|10|11|12)$/i.freeze
RE_JUDGE_WASSHOI_ENTRY = /^WSE(?:@([1-6]))?$/i.freeze
Expand All @@ -287,11 +287,12 @@ def proc_text(command)
}.freeze

register_prefix(
RE_JUDGE_DICEROLL,
RE_JUDGE_SATZ_BATZ,
RE_JUDGE_WASSHOI,
RE_JUDGE_WASSHOI_ENTRY,
RE_JUDGE_NRS
"UH",
"[KENHU]",
"SB",
"WS",
"WSE",
"NRS"
)
end
end
Expand Down

0 comments on commit 52a468a

Please sign in to comment.