From 61f34dad0b70a7370f2f63a38799931f8804c7c7 Mon Sep 17 00:00:00 2001 From: SAKATA Sinji Date: Wed, 27 Dec 2023 20:59:01 +0900 Subject: [PATCH 1/5] Support Ruby 3.3 --- .github/workflows/lint.yaml | 2 +- .github/workflows/test.yml | 4 ++-- Gemfile | 1 - bcdice.gemspec | 1 + 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/.github/workflows/lint.yaml b/.github/workflows/lint.yaml index 1da6d1853..73f927679 100644 --- a/.github/workflows/lint.yaml +++ b/.github/workflows/lint.yaml @@ -7,6 +7,6 @@ jobs: - uses: actions/checkout@v2 - uses: ruby/setup-ruby@v1 with: - ruby-version: "3.2" + ruby-version: "3.3" bundler-cache: true - run: bundle exec rake rubocop diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 856b96d37..24ceca658 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -5,7 +5,7 @@ jobs: strategy: fail-fast: false matrix: - ruby: ["2.6", "2.7", "3.0", "3.1", "3.2"] + ruby: ["2.6", "2.7", "3.0", "3.1", "3.2", "3.3"] runs-on: ubuntu-latest steps: - uses: actions/checkout@v2 @@ -20,4 +20,4 @@ jobs: uses: codecov/codecov-action@v3 with: file: coverage/coverage.xml - if: matrix.ruby == '3.2' + if: matrix.ruby == '3.3' diff --git a/Gemfile b/Gemfile index d9e7afaf3..0ad2fc475 100644 --- a/Gemfile +++ b/Gemfile @@ -3,7 +3,6 @@ source "https://rubygems.org" gemspec group :development, :test do - gem "racc", "~> 1.6.2" gem "rake", "~> 13.0.3" gem "rubocop", "~> 1.39.0", require: false gem "simplecov", "~>0.21.2", require: false diff --git a/bcdice.gemspec b/bcdice.gemspec index eebdcb0c1..cc54d3e24 100644 --- a/bcdice.gemspec +++ b/bcdice.gemspec @@ -22,4 +22,5 @@ Gem::Specification.new do |spec| spec.require_paths = ["lib"] spec.add_runtime_dependency "i18n", "~> 1.8.5" + spec.add_runtime_dependency "racc", "~> 1.7.3" end From b0407cac3307714244427dd41f99f87088c701b3 Mon Sep 17 00:00:00 2001 From: SAKATA Sinji Date: Wed, 27 Dec 2023 21:03:59 +0900 Subject: [PATCH 2/5] Drop Ruby 2.6 support --- .github/workflows/test.yml | 2 +- .rubocop.yml | 2 +- bcdice.gemspec | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 24ceca658..6328e87ee 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -5,7 +5,7 @@ jobs: strategy: fail-fast: false matrix: - ruby: ["2.6", "2.7", "3.0", "3.1", "3.2", "3.3"] + ruby: ["2.7", "3.0", "3.1", "3.2", "3.3"] runs-on: ubuntu-latest steps: - uses: actions/checkout@v2 diff --git a/.rubocop.yml b/.rubocop.yml index 68b582c7b..464a33cf1 100644 --- a/.rubocop.yml +++ b/.rubocop.yml @@ -1,7 +1,7 @@ inherit_from: .rubocop_todo.yml AllCops: - TargetRubyVersion: 2.6 + TargetRubyVersion: 2.7 NewCops: disable Exclude: - 'node_modules/**/*' diff --git a/bcdice.gemspec b/bcdice.gemspec index cc54d3e24..b04b3968c 100644 --- a/bcdice.gemspec +++ b/bcdice.gemspec @@ -10,7 +10,7 @@ Gem::Specification.new do |spec| spec.description = "BCDice is a rolling dice engine for TRPG" spec.homepage = "https://bcdice.org" spec.license = "BSD-3-Clause" - spec.required_ruby_version = Gem::Requirement.new(">= 2.6") + spec.required_ruby_version = Gem::Requirement.new(">= 2.7") spec.metadata["allowed_push_host"] = "https://rubygems.org/" From 28390dba2102aafb91c16d812780982a98d70dc6 Mon Sep 17 00:00:00 2001 From: SAKATA Sinji Date: Thu, 28 Dec 2023 01:01:04 +0900 Subject: [PATCH 3/5] Update rubocop --- Gemfile | 2 +- lib/bcdice/base.rb | 2 +- lib/bcdice/game_system/Airgetlamh.rb | 2 +- lib/bcdice/game_system/Alsetto.rb | 4 ++-- lib/bcdice/game_system/Avandner.rb | 2 +- lib/bcdice/game_system/BBN.rb | 2 +- lib/bcdice/game_system/BadLife.rb | 6 +++--- lib/bcdice/game_system/BarnaKronika.rb | 2 +- lib/bcdice/game_system/DarkSouls.rb | 2 +- lib/bcdice/game_system/Elric.rb | 2 +- lib/bcdice/game_system/Irisbane.rb | 2 +- lib/bcdice/game_system/KillDeathBusiness.rb | 2 +- lib/bcdice/game_system/MetalHead.rb | 2 +- lib/bcdice/game_system/MetalHeadExtream.rb | 2 +- lib/bcdice/game_system/NSSQ.rb | 2 +- lib/bcdice/game_system/OneWayHeroics.rb | 2 +- lib/bcdice/game_system/Postman.rb | 6 +++--- lib/bcdice/game_system/RecordOfSteam.rb | 2 +- lib/bcdice/game_system/Ryutama.rb | 8 ++++---- lib/bcdice/game_system/Skynauts.rb | 2 +- lib/bcdice/game_system/Strave.rb | 2 +- lib/bcdice/game_system/TherapieSein.rb | 2 +- lib/bcdice/game_system/TrinitySeven.rb | 2 +- lib/bcdice/game_system/cthulhu7th/full_auto.rb | 2 +- lib/bcdice/loader.rb | 2 +- 25 files changed, 33 insertions(+), 33 deletions(-) diff --git a/Gemfile b/Gemfile index 0ad2fc475..238622fc5 100644 --- a/Gemfile +++ b/Gemfile @@ -4,7 +4,7 @@ gemspec group :development, :test do gem "rake", "~> 13.0.3" - gem "rubocop", "~> 1.39.0", require: false + gem "rubocop", "~> 1.59.0", require: false gem "simplecov", "~>0.21.2", require: false gem "simplecov-cobertura", "~> 2.1.0", require: false gem "test-unit", "~>3.3.7", require: false diff --git a/lib/bcdice/base.rb b/lib/bcdice/base.rb index 1ab62a7d6..fedd23fa1 100644 --- a/lib/bcdice/base.rb +++ b/lib/bcdice/base.rb @@ -58,7 +58,7 @@ def command_pattern @prefixes.freeze pattarns = CommonCommand::COMMANDS.map { |c| c::PREFIX_PATTERN.source } + @prefixes - @command_pattern = /^S?(#{pattarns.join("|")})/i.freeze + @command_pattern = /^S?(#{pattarns.join('|')})/i.freeze end # @param command [String] diff --git a/lib/bcdice/game_system/Airgetlamh.rb b/lib/bcdice/game_system/Airgetlamh.rb index 8b81fde50..188c194b2 100644 --- a/lib/bcdice/game_system/Airgetlamh.rb +++ b/lib/bcdice/game_system/Airgetlamh.rb @@ -102,7 +102,7 @@ def checkRoll(diceCount, target, damage, criticalTrigger, criticalNumber) totalDamage = totalSuccessCount * damage + totalCriticalCount * criticalTrigger result += "(#{diceCount}D10\<\=#{target}) > #{text} > Hits:#{totalSuccessCount}*#{damage}" - result += " + Trigger:#{totalCriticalCount}*#{criticalTrigger}" if criticalTrigger > 0 + result += " + Trigger:#{totalCriticalCount}*#{criticalTrigger}" if criticalTrigger > 0 result += " > #{totalDamage}ダメージ" else result += "(#{diceCount}D10\<\=#{target}) > #{text} > 成功数:#{totalSuccessCount}" diff --git a/lib/bcdice/game_system/Alsetto.rb b/lib/bcdice/game_system/Alsetto.rb index 04392feb9..dc7eda7f0 100644 --- a/lib/bcdice/game_system/Alsetto.rb +++ b/lib/bcdice/game_system/Alsetto.rb @@ -50,7 +50,7 @@ def eval_game_system_specific_command(command) if command =~ /(\d+)AL(C|G)?(\d+)?((x|\*)(\d+))?$/i rapid = Regexp.last_match(1).to_i isCritical = Regexp.last_match(2).nil? - if isCritical + if isCritical criticalNumber = 1 else if Regexp.last_match(2) == "G" @@ -98,7 +98,7 @@ def checkRoll(rapid, target, damage, isCritical, criticalNumber) text += "+" unless text.empty? text += "#{successCount}[#{diceText}]" - break unless isCritical + break unless isCritical rollCount = criticalCount end diff --git a/lib/bcdice/game_system/Avandner.rb b/lib/bcdice/game_system/Avandner.rb index bfdfc613a..4c66c2384 100644 --- a/lib/bcdice/game_system/Avandner.rb +++ b/lib/bcdice/game_system/Avandner.rb @@ -85,7 +85,7 @@ def checkRoll(diceCount, target, damage, criticalTrigger, criticalNumber) totalDamage = totalSuccessCount * damage + totalCriticalCount * criticalTrigger result += "(#{diceCount}D10\<\=#{target}) > #{text} > Hits:#{totalSuccessCount}*#{damage}" - result += " + Trigger:#{totalCriticalCount}*#{criticalTrigger}" if criticalTrigger > 0 + result += " + Trigger:#{totalCriticalCount}*#{criticalTrigger}" if criticalTrigger > 0 result += " > #{totalDamage}ダメージ" else result += "(#{diceCount}D10\<\=#{target}) > #{text} > 成功数:#{totalSuccessCount}" diff --git a/lib/bcdice/game_system/BBN.rb b/lib/bcdice/game_system/BBN.rb index 148b026d8..b48de4169 100644 --- a/lib/bcdice/game_system/BBN.rb +++ b/lib/bcdice/game_system/BBN.rb @@ -72,7 +72,7 @@ def parse(command) @roll_times = m[1].to_i @modify_str = m[2] || '' @modify = m[2].to_i - @difficulty = m[4] ? m[4].to_i : nil + @difficulty = m[4]&.to_i base = critical_base(@roll_times) @critical = base + m[7].to_i diff --git a/lib/bcdice/game_system/BadLife.rb b/lib/bcdice/game_system/BadLife.rb index fd41f23c5..6db574cd6 100644 --- a/lib/bcdice/game_system/BadLife.rb +++ b/lib/bcdice/game_system/BadLife.rb @@ -58,7 +58,7 @@ def judgeDice(command) fumble = 1 isStormy = (m[2] == 'GL') # 波乱万丈 - if isStormy + if isStormy critical -= 3 fumble += 1 end @@ -69,7 +69,7 @@ def judgeDice(command) critical, fumble = get_critival_fumble(critical, fumble, m[8], m[9]) target = get_value(m[11]) - optionalText = (m[13] || '') + optionalText = m[13] || '' return checkRoll(diceCount, modify, critical, fumble, target, isStormy, optionalText) end @@ -116,7 +116,7 @@ def checkRoll(diceCount, modify, critical, fumble, target, isStormy, optionalTex if isCritical result += "成功(クリティカル)" - elsif total >= target + elsif total >= target result += "成功" else result += "失敗" diff --git a/lib/bcdice/game_system/BarnaKronika.rb b/lib/bcdice/game_system/BarnaKronika.rb index 2ca21cc9c..6fad94805 100644 --- a/lib/bcdice/game_system/BarnaKronika.rb +++ b/lib/bcdice/game_system/BarnaKronika.rb @@ -121,7 +121,7 @@ def roll_barna_kronika(dice_n, criticalCallDice) set += 1 if diceCount > 1 end - if criticalCallDice != 0 + if criticalCallDice != 0 c_cnt = diceCountList[criticalCallDice - 1] suc = c_cnt * 2 diff --git a/lib/bcdice/game_system/DarkSouls.rb b/lib/bcdice/game_system/DarkSouls.rb index bb8c292bf..5d5d16272 100644 --- a/lib/bcdice/game_system/DarkSouls.rb +++ b/lib/bcdice/game_system/DarkSouls.rb @@ -64,7 +64,7 @@ def checkRoll(diceCount, isActive, modify, target) result += " > #{successValue}#{targetText}" if target > 0 - if successValue >= target + if successValue >= target result += " > 【成功】" else result += " > 【失敗】" diff --git a/lib/bcdice/game_system/Elric.rb b/lib/bcdice/game_system/Elric.rb index 446ace81a..8bc481697 100644 --- a/lib/bcdice/game_system/Elric.rb +++ b/lib/bcdice/game_system/Elric.rb @@ -22,7 +22,7 @@ def result_1d100(total, _dice_total, cmp_op, target) if total <= 1 Result.critical("貫通") # 1は常に貫通 elsif total >= 100 - Result.fumble("致命的失敗") # 100は常に致命的失敗 + Result.fumble("致命的失敗") # 100は常に致命的失敗 elsif target == '?' Result.nothing elsif total <= (target / 5.0).ceil diff --git a/lib/bcdice/game_system/Irisbane.rb b/lib/bcdice/game_system/Irisbane.rb index 4d64407cd..1d7baf134 100644 --- a/lib/bcdice/game_system/Irisbane.rb +++ b/lib/bcdice/game_system/Irisbane.rb @@ -37,7 +37,7 @@ class Irisbane < Base SceneSituation, SSi HELP - ATTACK_ROLL_REG = %r{^AT(TACK|K)?([+\-*/()\d]+)@([+\-*/()\d]+)<=([+\-*/()\d]+)(\[([+\-])([+\-*/()\d]+)\])?}i.freeze + ATTACK_ROLL_REG = %r{^AT(TACK|K)?([+\-*/()\d]+)@([+\-*/()\d]+)<=([+\-*/()\d]+)(\[([+-])([+\-*/()\d]+)\])?}i.freeze register_prefix('AT(TACK|K)?') def initialize(command) diff --git a/lib/bcdice/game_system/KillDeathBusiness.rb b/lib/bcdice/game_system/KillDeathBusiness.rb index 110d97108..8de10672b 100644 --- a/lib/bcdice/game_system/KillDeathBusiness.rb +++ b/lib/bcdice/game_system/KillDeathBusiness.rb @@ -101,7 +101,7 @@ def judgeDice(command) target = 5 end - if fumble < 2 + if fumble < 2 fumble = 2 elsif fumble > 11 result += "【#{command}】 > #{translate('KillDeathBusiness.JD.warning.over_fumble')}\n" diff --git a/lib/bcdice/game_system/MetalHead.rb b/lib/bcdice/game_system/MetalHead.rb index 66a25a2b2..38fb7ae82 100644 --- a/lib/bcdice/game_system/MetalHead.rb +++ b/lib/bcdice/game_system/MetalHead.rb @@ -151,7 +151,7 @@ def mh_crc_table(suv, num) 'D' => [{'LW' => 2}, {'MW' => 26}, {'HW' => 46}, {'MO' => 76}, {'K' => 96}], 'E' => [{'LW' => 2}, {'MW' => 26}, {'HW' => 39}, {'MO' => 54}, {'K' => 76}], 'F' => [{'LW' => 2}, {'MW' => 16}, {'HW' => 39}, {'MO' => 54}, {'K' => 66}], - 'G' => [{'LW' => 2}, {'MW' => 6}, {'HW' => 16}, {'MO' => 26}, {'K' => 39}], + 'G' => [{'LW' => 2}, {'MW' => 6}, {'HW' => 16}, {'MO' => 26}, {'K' => 39}], 'M' => [{'0' => 2}, {'1' => 22}, {'2' => 42}, {'3' => 62}, {'4' => 82}, {'5' => 92}, {'6' => 102}, {'8' => 112}], } diff --git a/lib/bcdice/game_system/MetalHeadExtream.rb b/lib/bcdice/game_system/MetalHeadExtream.rb index 217155797..488d02941 100644 --- a/lib/bcdice/game_system/MetalHeadExtream.rb +++ b/lib/bcdice/game_system/MetalHeadExtream.rb @@ -68,7 +68,7 @@ def eval_game_system_specific_command(command) type = m[1] target = m[2].to_i modify = get_value(1, m[3]) - paramText = (m[5] || '') + paramText = m[5] || '' isMuse = !m[8].nil? # パンドラ《ミューズ》 accidentValue = 96 diff --git a/lib/bcdice/game_system/NSSQ.rb b/lib/bcdice/game_system/NSSQ.rb index 40bf55a7d..6c7522d07 100644 --- a/lib/bcdice/game_system/NSSQ.rb +++ b/lib/bcdice/game_system/NSSQ.rb @@ -47,7 +47,7 @@ def roll_sq(command) dice_count = m[1].to_i modifier = ArithmeticEvaluator.eval(m[2]) - target = m[5].nil? ? nil : m[5].to_i + target = m[5]&.to_i dice_list = @randomizer.roll_barabara(dice_count, 6) largest_two = dice_list.sort.reverse.take(2) diff --git a/lib/bcdice/game_system/OneWayHeroics.rb b/lib/bcdice/game_system/OneWayHeroics.rb index a1c64e7a8..2816261fb 100644 --- a/lib/bcdice/game_system/OneWayHeroics.rb +++ b/lib/bcdice/game_system/OneWayHeroics.rb @@ -81,7 +81,7 @@ def getRollDiceCommandResult(command) target = Regexp.last_match(6) target = target.to_i unless target.nil? - modifyText = (Regexp.last_match(3) || "") + modifyText = Regexp.last_match(3) || "" modifyText = "+1" if modifyText == "+" modifyValue = modifyText.to_i diff --git a/lib/bcdice/game_system/Postman.rb b/lib/bcdice/game_system/Postman.rb index f94f63258..dc412bb7d 100644 --- a/lib/bcdice/game_system/Postman.rb +++ b/lib/bcdice/game_system/Postman.rb @@ -57,11 +57,11 @@ def eval_game_system_specific_command(command) diceCount = 2 if diceCount < 2 modify = (Regexp.last_match(2) || 0).to_i - modifyAddString = (Regexp.last_match(3) || '') + modifyAddString = Regexp.last_match(3) || '' - type = (Regexp.last_match(6) || '') + type = Regexp.last_match(6) || '' target = (Regexp.last_match(7) || 0).to_i - targetAddString = (Regexp.last_match(8) || '') + targetAddString = Regexp.last_match(8) || '' modify_list = modifyAddString.scan(/[+-]\d+/) modify_list.each { |i| modify += i.to_i } diff --git a/lib/bcdice/game_system/RecordOfSteam.rb b/lib/bcdice/game_system/RecordOfSteam.rb index a25ef9d23..6f31ef125 100644 --- a/lib/bcdice/game_system/RecordOfSteam.rb +++ b/lib/bcdice/game_system/RecordOfSteam.rb @@ -118,7 +118,7 @@ def getDiceRollResult(diceCount, targetNumber, criticalValue, specialValue) end def getRoundCountText(roundCount) - if roundCount <= 0 + if roundCount <= 0 return "" end diff --git a/lib/bcdice/game_system/Ryutama.rb b/lib/bcdice/game_system/Ryutama.rb index b9ec0d2a0..f31ce4a67 100644 --- a/lib/bcdice/game_system/Ryutama.rb +++ b/lib/bcdice/game_system/Ryutama.rb @@ -108,8 +108,8 @@ def getDiceType(dice1, dice2) end def isValidDice(dice1, dice2) - return (isValidDiceOne(dice1) && - isValidDiceOne(dice2)) + return isValidDiceOne(dice1) && + isValidDiceOne(dice2) end def isValidDiceOne(dice) @@ -144,7 +144,7 @@ def getResultText(value1, value2, dice1, dice2, difficulty, total) return '' end - if total >= difficulty + if total >= difficulty return "成功" end @@ -152,7 +152,7 @@ def getResultText(value1, value2, dice1, dice2, difficulty, total) end def isFamble(value1, value2) - return ((value1 == 1) && (value2 == 1)) + return (value1 == 1) && (value2 == 1) end def isCritical(value1, value2, dice1, dice2) diff --git a/lib/bcdice/game_system/Skynauts.rb b/lib/bcdice/game_system/Skynauts.rb index 9c3e09717..f4d7bba0e 100644 --- a/lib/bcdice/game_system/Skynauts.rb +++ b/lib/bcdice/game_system/Skynauts.rb @@ -50,7 +50,7 @@ def eval_game_system_specific_command(command) private def get_judge_result(command) - return nil unless (m = (/^2D6<=(\d)$/i.match(command) || /^SN(\d*)$/i.match(command))) + return nil unless (m = /^2D6<=(\d)$/i.match(command) || /^SN(\d*)$/i.match(command)) debug("====get_judge_result====") diff --git a/lib/bcdice/game_system/Strave.rb b/lib/bcdice/game_system/Strave.rb index 6e82b79df..5b3ab88e2 100644 --- a/lib/bcdice/game_system/Strave.rb +++ b/lib/bcdice/game_system/Strave.rb @@ -90,7 +90,7 @@ def checkRoll(diceCount, target, damage) result = "(#{diceCount}D10\<\=#{target}) > #{diceText} > Hits:#{successCount}*#{damage} > #{totalDamage}ダメージ" else result = "(#{diceCount}D10\<\=#{target}) > #{diceText}" - if successCount > 0 + if successCount > 0 result += " > 【成功】" else result += " > 【失敗】" diff --git a/lib/bcdice/game_system/TherapieSein.rb b/lib/bcdice/game_system/TherapieSein.rb index 501949d14..cb51dfb43 100644 --- a/lib/bcdice/game_system/TherapieSein.rb +++ b/lib/bcdice/game_system/TherapieSein.rb @@ -73,7 +73,7 @@ def checkRoll(hasCritical, modify, target) return result if target == 0 - if successValue >= target + if successValue >= target result += " > 【成功】" else result += " > 【失敗】" diff --git a/lib/bcdice/game_system/TrinitySeven.rb b/lib/bcdice/game_system/TrinitySeven.rb index 00082f67f..88c363afd 100644 --- a/lib/bcdice/game_system/TrinitySeven.rb +++ b/lib/bcdice/game_system/TrinitySeven.rb @@ -355,7 +355,7 @@ def roll_name(command) '武器防具の名前(ソード、メイルなど)', '自然現象の名前(カザンハリケーンなど)', '機械の名前(洗濯機、テレビなど)', - '目についた物の名前(シャーペン、メガネなど)', # 100 + '目についた物の名前(シャーペン、メガネなど)', # 100 ] ) end diff --git a/lib/bcdice/game_system/cthulhu7th/full_auto.rb b/lib/bcdice/game_system/cthulhu7th/full_auto.rb index e88b37949..19c7a5e35 100644 --- a/lib/bcdice/game_system/cthulhu7th/full_auto.rb +++ b/lib/bcdice/game_system/cthulhu7th/full_auto.rb @@ -41,7 +41,7 @@ def getFullAutoResult(command) bullet_count = m[1].to_i diff = m[2].to_i broken_number = m[3].to_i - bonus_dice_count = m[4]&.to_i || 0 + bonus_dice_count = m[4].to_i stop_count = m[5]&.downcase || "" bullet_set_count_cap = m[6]&.to_i || diff / 10 diff --git a/lib/bcdice/loader.rb b/lib/bcdice/loader.rb index 18ea75fff..dc95b1c2b 100644 --- a/lib/bcdice/loader.rb +++ b/lib/bcdice/loader.rb @@ -8,7 +8,7 @@ class << self # @param id [String] ID # @return [Class, nil] def game_system_class(id) - all_game_systems.find { |game_system| game_system::ID == id } + all_game_systems.find { |game_system| id == game_system::ID } end # ゲームシステムのクラス一覧を返す From 2ba0f8d0f0bce7ed8d744fd695ee20647311967b Mon Sep 17 00:00:00 2001 From: SAKATA Sinji Date: Thu, 28 Dec 2023 01:03:16 +0900 Subject: [PATCH 4/5] Update development dependencies --- Gemfile | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/Gemfile b/Gemfile index 238622fc5..7effc14fc 100644 --- a/Gemfile +++ b/Gemfile @@ -3,11 +3,11 @@ source "https://rubygems.org" gemspec group :development, :test do - gem "rake", "~> 13.0.3" + gem "rake", "~> 13.1.0" gem "rubocop", "~> 1.59.0", require: false - gem "simplecov", "~>0.21.2", require: false + gem "simplecov", "~> 0.21.2", require: false gem "simplecov-cobertura", "~> 2.1.0", require: false - gem "test-unit", "~>3.3.7", require: false - gem "tomlrb", "~>2.0.3" - gem "yard" + gem "test-unit", "~> 3.6.1", require: false + gem "tomlrb", "~> 2.0.3", require: false + gem "yard", "~> 0.9.34", require: false end From 7a0e2070f24378cfebe143504d09313b52266701 Mon Sep 17 00:00:00 2001 From: SAKATA Sinji Date: Wed, 24 Jan 2024 22:19:17 +0900 Subject: [PATCH 5/5] Cop --- lib/bcdice/game_system/AniMalus.rb | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/lib/bcdice/game_system/AniMalus.rb b/lib/bcdice/game_system/AniMalus.rb index 25c878863..8979323e2 100644 --- a/lib/bcdice/game_system/AniMalus.rb +++ b/lib/bcdice/game_system/AniMalus.rb @@ -107,8 +107,8 @@ def resolute_attacking(command) dice = @randomizer.roll_barabara(3, 6).sort dice_text = dice.join(",") success_num = dice.count { |val| val <= num_target } - is_critical = (dice[0] == 1 && dice[1] == 2 && dice[2] == 3) - is_fumble = (dice[0] == 4 && dice[1] == 5 && dice[2] == 6) + is_critical = dice[0] == 1 && dice[1] == 2 && dice[2] == 3 + is_fumble = dice[0] == 4 && dice[1] == 5 && dice[2] == 6 damage1 = dice.max damage2 = dice.max if dice[0] == dice[1] && dice[1] == dice[2] && dice[2] <= num_target @@ -161,8 +161,8 @@ def resolute_guarding(command) dice = @randomizer.roll_barabara(3, 6).sort dice_text = dice.join(",") success_num = dice.count(num_target) - is_critical = (dice[0] == 1 && dice[1] == 2 && dice[2] == 3) - is_fumble = (dice[0] == 4 && dice[1] == 5 && dice[2] == 6) + is_critical = dice[0] == 1 && dice[1] == 2 && dice[2] == 3 + is_fumble = dice[0] == 4 && dice[1] == 5 && dice[2] == 6 return Result.new.tap do |result| result.critical = is_critical