From bdc6074bd8046c7ea6367dbec674932377d72770 Mon Sep 17 00:00:00 2001 From: Faceless192x Date: Wed, 6 Sep 2023 16:25:20 +0900 Subject: [PATCH 1/2] =?UTF-8?q?=E4=B8=80=E8=88=AC=E5=88=A4=E5=AE=9A?= =?UTF-8?q?=E3=81=AB=E6=88=90=E5=8A=9F=E3=83=AC=E3=83=99=E3=83=AB=E8=A1=A8?= =?UTF-8?q?=E7=A4=BA=E3=82=92=E8=BF=BD=E5=8A=A0=E3=81=97=E3=81=9F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- lib/bcdice/game_system/SajinsenkiAGuS.rb | 3 ++- test/data/SajinsenkiAGuS.toml | 10 +++++----- 2 files changed, 7 insertions(+), 6 deletions(-) diff --git a/lib/bcdice/game_system/SajinsenkiAGuS.rb b/lib/bcdice/game_system/SajinsenkiAGuS.rb index 45d58cd84..7b79fafcf 100644 --- a/lib/bcdice/game_system/SajinsenkiAGuS.rb +++ b/lib/bcdice/game_system/SajinsenkiAGuS.rb @@ -51,6 +51,7 @@ def roll_ippan(command) dice_list = @randomizer.roll_barabara(2, 10).map { |d| d == 10 ? 0 : d } total = dice_list.sum + success_level = 1 + dice_list.count { |val| val <= level } return Result.new.tap do |result| result.condition = total <= target @@ -59,7 +60,7 @@ def roll_ippan(command) "(2D10<=#{target})", "#{total}[#{dice_list.join(',')}]", ("チャンス" if dice_list.include?(0)), - result.success? ? "成功" : "失敗" + result.success? ? "成功(+#{success_level})" : "失敗" ].compact result.text = sequence.join(" > ") diff --git a/test/data/SajinsenkiAGuS.toml b/test/data/SajinsenkiAGuS.toml index 4abd744dc..eed906219 100644 --- a/test/data/SajinsenkiAGuS.toml +++ b/test/data/SajinsenkiAGuS.toml @@ -1,7 +1,7 @@ [[ test ]] game_system = "SajinsenkiAGuS" input = "AG" -output = "(2D10<=7) > 5[2,3] > 成功" +output = "(2D10<=7) > 5[2,3] > 成功(+1)" success = true rands = [ { sides = 10, value = 2 }, @@ -21,7 +21,7 @@ rands = [ [[ test ]] game_system = "SajinsenkiAGuS" input = "AG" -output = "(2D10<=7) > 7[0,7] > チャンス > 成功" +output = "(2D10<=7) > 7[0,7] > チャンス > 成功(+2)" success = true rands = [ { sides = 10, value = 10 }, @@ -41,7 +41,7 @@ rands = [ [[ test ]] game_system = "SajinsenkiAGuS" input = "1AG" -output = "(2D10<=11) > 9[0,9] > チャンス > 成功" +output = "(2D10<=11) > 9[0,9] > チャンス > 成功(+2)" success = true rands = [ { sides = 10, value = 10 }, @@ -51,7 +51,7 @@ rands = [ [[ test ]] game_system = "SajinsenkiAGuS" input = "2AG-1" -output = "(2D10<=11) > 9[0,9] > チャンス > 成功" +output = "(2D10<=11) > 9[0,9] > チャンス > 成功(+2)" success = true rands = [ { sides = 10, value = 10 }, @@ -81,7 +81,7 @@ rands = [ [[ test ]] game_system = "SajinsenkiAGuS" input = "(2-1)AG+3-2" -output = "(2D10<=12) > 9[0,9] > チャンス > 成功" +output = "(2D10<=12) > 9[0,9] > チャンス > 成功(+2)" success = true rands = [ { sides = 10, value = 10 }, From 604566f1976645a14d3702d75b4484abbabd34a0 Mon Sep 17 00:00:00 2001 From: Faceless192x Date: Wed, 6 Sep 2023 16:28:43 +0900 Subject: [PATCH 2/2] =?UTF-8?q?AGuS2E=E3=81=AE=E3=83=86=E3=82=B9=E3=83=88?= =?UTF-8?q?=E3=83=91=E3=82=BF=E3=83=BC=E3=83=B3=E3=82=82=E8=BF=BD=E5=BE=93?= =?UTF-8?q?=E3=81=97=E3=81=A6=E5=A4=89=E6=9B=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- test/data/SajinsenkiAGuS2E.toml | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/test/data/SajinsenkiAGuS2E.toml b/test/data/SajinsenkiAGuS2E.toml index 3b2f03dda..ee9adaa5a 100644 --- a/test/data/SajinsenkiAGuS2E.toml +++ b/test/data/SajinsenkiAGuS2E.toml @@ -1,7 +1,7 @@ [[ test ]] game_system = "SajinsenkiAGuS2E" input = "AG" -output = "(2D10<=7) > 5[2,3] > 成功" +output = "(2D10<=7) > 5[2,3] > 成功(+1)" success = true rands = [ { sides = 10, value = 2 }, @@ -21,7 +21,7 @@ rands = [ [[ test ]] game_system = "SajinsenkiAGuS2E" input = "AG" -output = "(2D10<=7) > 7[0,7] > チャンス > 成功" +output = "(2D10<=7) > 7[0,7] > チャンス > 成功(+2)" success = true rands = [ { sides = 10, value = 10 }, @@ -41,7 +41,7 @@ rands = [ [[ test ]] game_system = "SajinsenkiAGuS2E" input = "1AG" -output = "(2D10<=11) > 9[0,9] > チャンス > 成功" +output = "(2D10<=11) > 9[0,9] > チャンス > 成功(+2)" success = true rands = [ { sides = 10, value = 10 }, @@ -51,7 +51,7 @@ rands = [ [[ test ]] game_system = "SajinsenkiAGuS2E" input = "2AG-1" -output = "(2D10<=11) > 9[0,9] > チャンス > 成功" +output = "(2D10<=11) > 9[0,9] > チャンス > 成功(+2)" success = true rands = [ { sides = 10, value = 10 }, @@ -81,7 +81,7 @@ rands = [ [[ test ]] game_system = "SajinsenkiAGuS2E" input = "(2-1)AG+3-2" -output = "(2D10<=12) > 9[0,9] > チャンス > 成功" +output = "(2D10<=12) > 9[0,9] > チャンス > 成功(+2)" success = true rands = [ { sides = 10, value = 10 },