From b7fe95c8de9c8f7d55d04ccda9935347a540b2f2 Mon Sep 17 00:00:00 2001 From: Aimsot Date: Sun, 12 Apr 2026 23:03:04 +0900 Subject: [PATCH 1/2] =?UTF-8?q?[FutariSousa]=E3=83=95=E3=82=BF=E3=83=AA?= =?UTF-8?q?=E3=82=BD=E3=82=A6=E3=82=B5=E3=81=AE=E5=88=A4=E5=AE=9A=E3=82=B3?= =?UTF-8?q?=E3=83=9E=E3=83=B3=E3=83=89=E3=81=AB=E7=9B=AE=E6=A8=99=E5=80=A4?= =?UTF-8?q?=E5=A4=89=E6=9B=B4=E3=81=A8=E3=82=B9=E3=83=9A=E3=82=B7=E3=83=A3?= =?UTF-8?q?=E3=83=AB=E5=80=A4=E8=BF=BD=E5=8A=A0=E3=81=AE=E6=A9=9F=E8=83=BD?= =?UTF-8?q?=E3=82=92=E8=BF=BD=E5=8A=A0=20-=20DT/AS=E3=82=B3=E3=83=9E?= =?UTF-8?q?=E3=83=B3=E3=83=89=E3=81=AE=E6=9C=AB=E5=B0=BE=E3=81=AB=20>=3Dn?= =?UTF-8?q?=20=E3=81=A7=E7=9B=AE=E6=A8=99=E5=80=A4=E3=82=92=E5=A4=89?= =?UTF-8?q?=E6=9B=B4=20-=20[n,m]=20=E3=81=A7=E3=82=B9=E3=83=9A=E3=82=B7?= =?UTF-8?q?=E3=83=A3=E3=83=AB=E5=80=A4=E3=82=92=E6=8C=87=E5=AE=9A=E3=81=A7?= =?UTF-8?q?=E3=81=8D=E3=82=8B=E6=A9=9F=E8=83=BD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- lib/bcdice/game_system/FutariSousa.rb | 46 +++++++--- test/data/FutariSousa.toml | 120 ++++++++++++++++++++++++++ 2 files changed, 154 insertions(+), 12 deletions(-) diff --git a/lib/bcdice/game_system/FutariSousa.rb b/lib/bcdice/game_system/FutariSousa.rb index 23e0058e4..f374c2cd4 100644 --- a/lib/bcdice/game_system/FutariSousa.rb +++ b/lib/bcdice/game_system/FutariSousa.rb @@ -19,6 +19,18 @@ class FutariSousa < Base     【DT6】…6面ダイスを2つ振って判定します。『有利』なら【3DT6】、『不利』なら【1DT6】を使います。 助手用:【AS】…6面ダイスを2つ振って判定します。『有利』なら【3AS】、『不利』なら【1AS】を使います。     【AS10】…10面ダイスを2つ振って判定します。『有利』なら【3AS10】、『不利』なら【1AS10】を使います。 + + ・目標値の変更 (>=x) + ">=目標値"をつけると、成功となる出目の基準を変更します。 + >=2と指定すると、2以上で成功になります。 +  例)DT>=2   3AS10>=3 + + ・スペシャル値の追加 ([x]) + "[スペシャル値]"を付加することで、通常のスペシャル(出目6)に加えて、指定した数字でもスペシャルが発生するようになります。 + カンマ(,)で区切って記入することで、複数の出目をスペシャルに指定することも可能です。 + 目標値の変更(>=)と併用する場合は、必ず目標値指定の直後に記述してください。 +  例)DT[5]   AS[5,7]   DT>=2[5,7] + ・各種表 【セッション時】 異常な癖決定表      SHRD/新・異常な癖決定表   SHND @@ -72,12 +84,17 @@ def initialize(command) register_prefix('(\d+)?DT(?:6)?', '(\d+)?AS(?:10)?') def eval_game_system_specific_command(command) - if (m = /^(\d+)?DT(?:6)?$/i.match(command)) + if (m = /^(\d+)?DT(?:6)?(?:>=(\d+))?(?:\[([0-9,]+)\])?$/i.match(command)) count = m[1]&.to_i || 2 - return roll_dt(command, count) - elsif (m = /^(\d+)?AS(?:10)?$/i.match(command)) + target = m[2]&.to_i + specials = m[3] ? m[3].split(',').map(&:to_i) : [] + return roll_dt(command, count, target, specials) + + elsif (m = /^(\d+)?AS(?:10)?(?:>=(\d+))?(?:\[([0-9,]+)\])?$/i.match(command)) count = m[1]&.to_i || 2 - return roll_as(command, count) + target = m[2]&.to_i + specials = m[3] ? m[3].split(',').map(&:to_i) : [] + return roll_as(command, count, target, specials) end return roll_tables(command, self.class::TABLES) @@ -92,21 +109,24 @@ def eval_game_system_specific_command(command) SPECIAL_DICE = 6 # 探偵用判定コマンド DT - def roll_dt(command, count) + def roll_dt(command, count, target = nil, specials = nil) dice_list = - if command =~ /^(\d*)DT6$/i + if command =~ /^(\d*)DT6/i @randomizer.roll_barabara(count, 6) else @randomizer.roll_barabara(count, 10) end + max = dice_list.max + threshold = target || SUCCESS_THRESHOLD + special_values = ([SPECIAL_DICE] + specials).uniq result = if max <= 1 Result.fumble(translate("FutariSousa.DT.fumble")) - elsif dice_list.include?(SPECIAL_DICE) + elsif (dice_list & special_values).any? Result.critical(translate("FutariSousa.DT.special")) - elsif max >= SUCCESS_THRESHOLD + elsif max >= threshold Result.success(translate("success")) else Result.failure(translate("failure")) @@ -117,21 +137,23 @@ def roll_dt(command, count) end # 助手用判定コマンド AS - def roll_as(command, count) + def roll_as(command, count, target = nil, specials = nil) dice_list = - if command =~ /^(\d*)AS10$/i + if command =~ /^(\d*)AS10/i @randomizer.roll_barabara(count, 10) else @randomizer.roll_barabara(count, 6) end max = dice_list.max + threshold = target || SUCCESS_THRESHOLD + special_values = ([SPECIAL_DICE] + specials).uniq result = if max <= 1 Result.fumble(translate("FutariSousa.AS.fumble")) - elsif dice_list.include?(SPECIAL_DICE) + elsif (dice_list & special_values).any? Result.critical(translate("FutariSousa.AS.special")) - elsif max >= SUCCESS_THRESHOLD + elsif max >= threshold Result.success(translate("FutariSousa.AS.success")) else Result.failure(translate("failure")) diff --git a/test/data/FutariSousa.toml b/test/data/FutariSousa.toml index 2ad5fc902..941fda66b 100644 --- a/test/data/FutariSousa.toml +++ b/test/data/FutariSousa.toml @@ -486,6 +486,126 @@ rands = [ { sides = 10, value = 1 }, ] +[[ test ]] +game_system = "FutariSousa" +input = "DT>=2" +output = "DT>=2(2,1) > 成功" +success = true +rands = [ + { sides = 10, value = 2 }, + { sides = 10, value = 1 }, +] + +[[ test ]] +game_system = "FutariSousa" +input = "DT>=5" +output = "DT>=5(4,3) > 失敗" +failure = true +rands = [ + { sides = 10, value = 4 }, + { sides = 10, value = 3 }, +] + +[[ test ]] +game_system = "FutariSousa" +input = "DT>=2" +output = "DT>=2(1,1) > ファンブル(変調を受け、助手の心労が1点上昇)" +failure = true +fumble = true +rands = [ + { sides = 10, value = 1 }, + { sides = 10, value = 1 }, +] + +[[ test ]] +game_system = "FutariSousa" +input = "DT[5]" +output = "DT[5](5,3) > スペシャル(助手の余裕を1点獲得)" +success = true +critical = true +rands = [ + { sides = 10, value = 5 }, + { sides = 10, value = 3 }, +] + +[[ test ]] +game_system = "FutariSousa" +input = "DT[5]" +output = "DT[5](6,2) > スペシャル(助手の余裕を1点獲得)" +success = true +critical = true +rands = [ + { sides = 10, value = 6 }, + { sides = 10, value = 2 }, +] + +[[ test ]] +game_system = "FutariSousa" +input = "DT[5,7]" +output = "DT[5,7](7,4) > スペシャル(助手の余裕を1点獲得)" +success = true +critical = true +rands = [ + { sides = 10, value = 7 }, + { sides = 10, value = 4 }, +] + +[[ test ]] +game_system = "FutariSousa" +input = "DT>=2[5,7]" +output = "DT>=2[5,7](5,1) > スペシャル(助手の余裕を1点獲得)" +success = true +critical = true +rands = [ + { sides = 10, value = 5 }, + { sides = 10, value = 1 }, +] + +[[ test ]] +game_system = "FutariSousa" +input = "3DT6>=5[4,5]" +output = "3DT6>=5[4,5](5,3,1) > スペシャル(助手の余裕を1点獲得)" +success = true +critical = true +rands = [ + { sides = 6, value = 5 }, + { sides = 6, value = 3 }, + { sides = 6, value = 1 }, +] + +[[ test ]] +game_system = "FutariSousa" +input = "AS>=3" +output = "AS>=3(3,2) > 成功(余裕1点と、探偵から助手への感情を獲得)" +success = true +rands = [ + { sides = 6, value = 3 }, + { sides = 6, value = 2 }, +] + +[[ test ]] +game_system = "FutariSousa" +input = "AS[5]" +output = "AS[5](5,2) > スペシャル(余裕2点と、探偵から助手への感情を獲得)" +success = true +critical = true +rands = [ + { sides = 6, value = 5 }, + { sides = 6, value = 2 }, +] + +[[ test ]] +game_system = "FutariSousa" +input = "3AS10>=5[7,9]" +output = "3AS10>=5[7,9](9,4,2) > スペシャル(余裕2点と、探偵から助手への感情を獲得)" +success = true +critical = true +rands = [ + { sides = 10, value = 9 }, + { sides = 10, value = 4 }, + { sides = 10, value = 2 }, +] + [[ test ]] game_system = "FutariSousa" input = "SHRD" From d2edcedb59f671bcd4534563c3f708401e42a782 Mon Sep 17 00:00:00 2001 From: Aimsot Date: Thu, 7 May 2026 20:02:36 +0900 Subject: [PATCH 2/2] =?UTF-8?q?[FutariSousa]=20=E3=82=B9=E3=83=9A=E3=82=B7?= =?UTF-8?q?=E3=83=A3=E3=83=AB=E5=80=A4=E6=8C=87=E5=AE=9A=E3=81=AE=E6=AD=A3?= =?UTF-8?q?=E8=A6=8F=E8=A1=A8=E7=8F=BE=E3=82=92=E5=8E=B3=E5=AF=86=E5=8C=96?= =?UTF-8?q?=20-=20=E3=82=B9=E3=83=9A=E3=82=B7=E3=83=A3=E3=83=AB=E5=80=A4?= =?UTF-8?q?=20`[n,m...]`=20=E3=81=AE=E3=83=91=E3=83=BC=E3=82=B9=E5=87=A6?= =?UTF-8?q?=E7=90=86=EF=BC=88=E6=AD=A3=E8=A6=8F=E8=A1=A8=E7=8F=BE=EF=BC=89?= =?UTF-8?q?=E3=81=8C=E6=84=8F=E5=9B=B3=E3=81=97=E3=81=AA=E3=81=84=E5=85=A5?= =?UTF-8?q?=E5=8A=9B=EF=BC=88=E3=82=AB=E3=83=B3=E3=83=9E=E3=81=AE=E3=81=BF?= =?UTF-8?q?=E3=80=81=E9=80=A3=E7=B6=9A=E3=81=99=E3=82=8B=E3=82=AB=E3=83=B3?= =?UTF-8?q?=E3=83=9E=E3=81=AA=E3=81=A9=EF=BC=89=E3=81=AB=E3=83=9E=E3=83=83?= =?UTF-8?q?=E3=83=81=E3=81=97=E3=81=A6=E3=81=97=E3=81=BE=E3=81=86=E5=95=8F?= =?UTF-8?q?=E9=A1=8C=E3=82=92=E4=BF=AE=E6=AD=A3=20-=203=E3=81=A4=E4=BB=A5?= =?UTF-8?q?=E4=B8=8A=E3=81=AE=E3=82=B9=E3=83=9A=E3=82=B7=E3=83=A3=E3=83=AB?= =?UTF-8?q?=E5=80=A4=E6=8C=87=E5=AE=9A=E3=81=AB=E3=82=82=E5=AF=BE=E5=BF=9C?= =?UTF-8?q?=E3=81=A7=E3=81=8D=E3=82=8B=E3=82=88=E3=81=86=20`(\d+(=3F:,\d+)?= =?UTF-8?q?*)`=20=E3=81=AB=E5=A4=89=E6=9B=B4=20-=20=E9=96=A2=E9=80=A3?= =?UTF-8?q?=E3=81=99=E3=82=8B=E3=83=86=E3=82=B9=E3=83=88=E3=82=B1=E3=83=BC?= =?UTF-8?q?=E3=82=B9=E3=82=92=E8=BF=BD=E5=8A=A0=E3=83=BB=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/FutariSousa.rb | 4 ++-- test/data/FutariSousa.toml | 23 +++++++++++++++++++++++ 2 files changed, 25 insertions(+), 2 deletions(-) diff --git a/lib/bcdice/game_system/FutariSousa.rb b/lib/bcdice/game_system/FutariSousa.rb index f374c2cd4..38f8b9ad2 100644 --- a/lib/bcdice/game_system/FutariSousa.rb +++ b/lib/bcdice/game_system/FutariSousa.rb @@ -84,13 +84,13 @@ def initialize(command) register_prefix('(\d+)?DT(?:6)?', '(\d+)?AS(?:10)?') def eval_game_system_specific_command(command) - if (m = /^(\d+)?DT(?:6)?(?:>=(\d+))?(?:\[([0-9,]+)\])?$/i.match(command)) + if (m = /^(\d+)?DT(?:6)?(?:>=(\d+))?(?:\[(\d+(?:,\d+)*)\])?$/i.match(command)) count = m[1]&.to_i || 2 target = m[2]&.to_i specials = m[3] ? m[3].split(',').map(&:to_i) : [] return roll_dt(command, count, target, specials) - elsif (m = /^(\d+)?AS(?:10)?(?:>=(\d+))?(?:\[([0-9,]+)\])?$/i.match(command)) + elsif (m = /^(\d+)?AS(?:10)?(?:>=(\d+))?(?:\[(\d+(?:,\d+)*)\])?$/i.match(command)) count = m[1]&.to_i || 2 target = m[2]&.to_i specials = m[3] ? m[3].split(',').map(&:to_i) : [] diff --git a/test/data/FutariSousa.toml b/test/data/FutariSousa.toml index 941fda66b..44ef71a52 100644 --- a/test/data/FutariSousa.toml +++ b/test/data/FutariSousa.toml @@ -561,6 +561,17 @@ rands = [ { sides = 10, value = 1 }, ] +[[ test ]] +game_system = "FutariSousa" +input = "DT[5,7,9]" +output = "DT[5,7,9](9,1) > スペシャル(助手の余裕を1点獲得)" +success = true +critical = true +rands = [ + { sides = 10, value = 9 }, + { sides = 10, value = 1 }, +] + [[ test ]] game_system = "FutariSousa" input = "3DT6>=5[4,5]" @@ -606,6 +617,18 @@ rands = [ { sides = 10, value = 2 }, ] +[[ test ]] +game_system = "FutariSousa" +input = "3AS10>=5[7,9,10]" +output = "3AS10>=5[7,9,10](10,4,2) > スペシャル(余裕2点と、探偵から助手への感情を獲得)" +success = true +critical = true +rands = [ + { sides = 10, value = 10 }, + { sides = 10, value = 4 }, + { sides = 10, value = 2 }, +] + [[ test ]] game_system = "FutariSousa" input = "SHRD"