From f40b9a304a6533f6228fd0054eda08df681c0317 Mon Sep 17 00:00:00 2001 From: SAKATA Sinji Date: Mon, 22 Jan 2024 21:54:55 +0900 Subject: [PATCH] =?UTF-8?q?[AniMalus]=20Array#count=20=E3=81=A7=E3=83=96?= =?UTF-8?q?=E3=83=AD=E3=83=83=E3=82=AF=E3=81=8C=E4=B8=8D=E8=A6=81=E3=81=AA?= =?UTF-8?q?=E7=82=B9=E3=82=92=E4=BF=AE=E6=AD=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- lib/bcdice/game_system/AniMalus.rb | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/bcdice/game_system/AniMalus.rb b/lib/bcdice/game_system/AniMalus.rb index 17c145154..77446fccd 100644 --- a/lib/bcdice/game_system/AniMalus.rb +++ b/lib/bcdice/game_system/AniMalus.rb @@ -160,7 +160,7 @@ def resolute_guarding(command) dice = @randomizer.roll_barabara(3, 6).sort dice_text = dice.join(",") - success_num = dice.count { |val| val == num_target } + 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) @@ -197,7 +197,7 @@ def resolute_dodging(command) dice = @randomizer.roll_barabara(1, 6) dice_text = dice.join(",") - success_num = dice.count { |val| val == num_target } + success_num = dice.count(num_target) return Result.new.tap do |result| result.condition = (success_num > 0)